@ai-sdk/valibot 0.0.0-677c097b-20250505090413

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,420 @@
1
+ # @ai-sdk/valibot
2
+
3
+ ## 0.0.0-677c097b-20250505090413
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [4b282ea]
8
+ - ai@0.0.0-677c097b-20250505090413
9
+
10
+ ## 0.1.25
11
+
12
+ ### Patch Changes
13
+
14
+ - ai@4.3.13
15
+
16
+ ## 0.1.24
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies [1ed3755]
21
+ - Updated dependencies [46cb332]
22
+ - ai@4.3.12
23
+
24
+ ## 0.1.23
25
+
26
+ ### Patch Changes
27
+
28
+ - ai@4.3.11
29
+
30
+ ## 0.1.22
31
+
32
+ ### Patch Changes
33
+
34
+ - Updated dependencies [0432959]
35
+ - ai@4.3.10
36
+
37
+ ## 0.1.21
38
+
39
+ ### Patch Changes
40
+
41
+ - Updated dependencies [b69a253]
42
+ - ai@4.3.9
43
+
44
+ ## 0.1.20
45
+
46
+ ### Patch Changes
47
+
48
+ - Updated dependencies [6e8a73b]
49
+ - ai@4.3.8
50
+
51
+ ## 0.1.19
52
+
53
+ ### Patch Changes
54
+
55
+ - Updated dependencies [f4f3945]
56
+ - ai@4.3.7
57
+
58
+ ## 0.1.18
59
+
60
+ ### Patch Changes
61
+
62
+ - Updated dependencies [beef951]
63
+ - Updated dependencies [bd41167]
64
+ - ai@4.3.6
65
+
66
+ ## 0.1.17
67
+
68
+ ### Patch Changes
69
+
70
+ - Updated dependencies [452bf12]
71
+ - ai@4.3.5
72
+
73
+ ## 0.1.16
74
+
75
+ ### Patch Changes
76
+
77
+ - Updated dependencies [013faa8]
78
+ - ai@4.3.4
79
+
80
+ ## 0.1.15
81
+
82
+ ### Patch Changes
83
+
84
+ - Updated dependencies [3e88f4d]
85
+ - Updated dependencies [c21fa6d]
86
+ - ai@4.3.3
87
+
88
+ ## 0.1.14
89
+
90
+ ### Patch Changes
91
+
92
+ - Updated dependencies [665a567]
93
+ - ai@4.3.2
94
+
95
+ ## 0.1.13
96
+
97
+ ### Patch Changes
98
+
99
+ - Updated dependencies [3d1bd38]
100
+ - ai@4.3.1
101
+
102
+ ## 0.1.12
103
+
104
+ ### Patch Changes
105
+
106
+ - Updated dependencies [772a2d7]
107
+ - ai@4.3.0
108
+
109
+ ## 0.1.11
110
+
111
+ ### Patch Changes
112
+
113
+ - Updated dependencies [c45d100]
114
+ - ai@4.2.11
115
+
116
+ ## 0.1.10
117
+
118
+ ### Patch Changes
119
+
120
+ - ai@4.2.10
121
+
122
+ ## 0.1.9
123
+
124
+ ### Patch Changes
125
+
126
+ - ai@4.2.9
127
+
128
+ ## 0.1.8
129
+
130
+ ### Patch Changes
131
+
132
+ - Updated dependencies [65243ce]
133
+ - ai@4.2.8
134
+
135
+ ## 0.1.7
136
+
137
+ ### Patch Changes
138
+
139
+ - Updated dependencies [e14c066]
140
+ - ai@4.2.7
141
+
142
+ ## 0.1.6
143
+
144
+ ### Patch Changes
145
+
146
+ - Updated dependencies [625591b]
147
+ - Updated dependencies [6a1506f]
148
+ - Updated dependencies [ea3d998]
149
+ - ai@4.2.6
150
+
151
+ ## 0.1.5
152
+
153
+ ### Patch Changes
154
+
155
+ - ai@4.2.5
156
+
157
+ ## 0.1.4
158
+
159
+ ### Patch Changes
160
+
161
+ - Updated dependencies [3d6d96d]
162
+ - ai@4.2.4
163
+
164
+ ## 0.1.3
165
+
166
+ ### Patch Changes
167
+
168
+ - Updated dependencies [0b3bf29]
169
+ - ai@4.2.3
170
+
171
+ ## 0.1.2
172
+
173
+ ### Patch Changes
174
+
175
+ - Updated dependencies [f10f0fa]
176
+ - ai@4.2.2
177
+
178
+ ## 0.1.1
179
+
180
+ ### Patch Changes
181
+
182
+ - Updated dependencies [b796152]
183
+ - Updated dependencies [06361d6]
184
+ - ai@4.2.1
185
+
186
+ ## 0.1.0
187
+
188
+ ### Minor Changes
189
+
190
+ - 5bc638d: AI SDK 4.2
191
+
192
+ ### Patch Changes
193
+
194
+ - Updated dependencies [5bc638d]
195
+ - ai@4.2.0
196
+
197
+ ## 0.0.33
198
+
199
+ ### Patch Changes
200
+
201
+ - Updated dependencies [5d0fc29]
202
+ - ai@4.1.66
203
+
204
+ ## 0.0.32
205
+
206
+ ### Patch Changes
207
+
208
+ - Updated dependencies [16c444f]
209
+ - ai@4.1.65
210
+
211
+ ## 0.0.31
212
+
213
+ ### Patch Changes
214
+
215
+ - ai@4.1.64
216
+
217
+ ## 0.0.30
218
+
219
+ ### Patch Changes
220
+
221
+ - Updated dependencies [0bd5bc6]
222
+ - ai@4.1.63
223
+
224
+ ## 0.0.29
225
+
226
+ ### Patch Changes
227
+
228
+ - Updated dependencies [c9ed3c4]
229
+ - ai@4.1.62
230
+
231
+ ## 0.0.28
232
+
233
+ ### Patch Changes
234
+
235
+ - Updated dependencies [2e1101a]
236
+ - ai@4.1.61
237
+
238
+ ## 0.0.27
239
+
240
+ ### Patch Changes
241
+
242
+ - Updated dependencies [0b8797f]
243
+ - ai@4.1.60
244
+
245
+ ## 0.0.26
246
+
247
+ ### Patch Changes
248
+
249
+ - Updated dependencies [dd18049]
250
+ - ai@4.1.59
251
+
252
+ ## 0.0.25
253
+
254
+ ### Patch Changes
255
+
256
+ - Updated dependencies [e9897eb]
257
+ - ai@4.1.58
258
+
259
+ ## 0.0.24
260
+
261
+ ### Patch Changes
262
+
263
+ - Updated dependencies [092fdaa]
264
+ - ai@4.1.57
265
+
266
+ ## 0.0.23
267
+
268
+ ### Patch Changes
269
+
270
+ - Updated dependencies [80be82b]
271
+ - Updated dependencies [8109a24]
272
+ - ai@4.1.56
273
+
274
+ ## 0.0.22
275
+
276
+ ### Patch Changes
277
+
278
+ - Updated dependencies [1531959]
279
+ - ai@4.1.55
280
+
281
+ ## 0.0.21
282
+
283
+ ### Patch Changes
284
+
285
+ - Updated dependencies [ee1c787]
286
+ - ai@4.1.54
287
+
288
+ ## 0.0.20
289
+
290
+ ### Patch Changes
291
+
292
+ - Updated dependencies [e1d3d42]
293
+ - ai@4.1.53
294
+
295
+ ## 0.0.19
296
+
297
+ ### Patch Changes
298
+
299
+ - Updated dependencies [5329a69]
300
+ - ai@4.1.52
301
+
302
+ ## 0.0.18
303
+
304
+ ### Patch Changes
305
+
306
+ - Updated dependencies [0cb2647]
307
+ - ai@4.1.51
308
+
309
+ ## 0.0.17
310
+
311
+ ### Patch Changes
312
+
313
+ - Updated dependencies [ae98f0d]
314
+ - ai@4.1.50
315
+
316
+ ## 0.0.16
317
+
318
+ ### Patch Changes
319
+
320
+ - Updated dependencies [dc027d3]
321
+ - ai@4.1.49
322
+
323
+ ## 0.0.15
324
+
325
+ ### Patch Changes
326
+
327
+ - ai@4.1.48
328
+
329
+ ## 0.0.14
330
+
331
+ ### Patch Changes
332
+
333
+ - ai@4.1.47
334
+
335
+ ## 0.0.13
336
+
337
+ ### Patch Changes
338
+
339
+ - Updated dependencies [ddf9740]
340
+ - ai@4.1.46
341
+
342
+ ## 0.0.12
343
+
344
+ ### Patch Changes
345
+
346
+ - Updated dependencies [93bd5a0]
347
+ - ai@4.1.45
348
+
349
+ ## 0.0.11
350
+
351
+ ### Patch Changes
352
+
353
+ - Updated dependencies [f8e7df2]
354
+ - ai@4.1.44
355
+
356
+ ## 0.0.10
357
+
358
+ ### Patch Changes
359
+
360
+ - Updated dependencies [ef2e23b]
361
+ - ai@4.1.43
362
+
363
+ ## 0.0.9
364
+
365
+ ### Patch Changes
366
+
367
+ - ai@4.1.42
368
+
369
+ ## 0.0.8
370
+
371
+ ### Patch Changes
372
+
373
+ - ai@4.1.41
374
+
375
+ ## 0.0.7
376
+
377
+ ### Patch Changes
378
+
379
+ - ai@4.1.40
380
+
381
+ ## 0.0.6
382
+
383
+ ### Patch Changes
384
+
385
+ - Updated dependencies [075a9a9]
386
+ - ai@4.1.39
387
+
388
+ ## 0.0.5
389
+
390
+ ### Patch Changes
391
+
392
+ - Updated dependencies [4c9c194]
393
+ - Updated dependencies [2e898b4]
394
+ - ai@4.1.38
395
+
396
+ ## 0.0.4
397
+
398
+ ### Patch Changes
399
+
400
+ - Updated dependencies [c1e10d1]
401
+ - ai@4.1.37
402
+
403
+ ## 0.0.3
404
+
405
+ ### Patch Changes
406
+
407
+ - ai@4.1.36
408
+
409
+ ## 0.0.2
410
+
411
+ ### Patch Changes
412
+
413
+ - Updated dependencies [166e09e]
414
+ - ai@4.1.35
415
+
416
+ ## 0.0.1
417
+
418
+ ### Patch Changes
419
+
420
+ - 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-677c097b-20250505090413",
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-677c097b-20250505090413"
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://ai-sdk.dev/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
+ }