@scarn/sdk 0.8.20 → 0.8.22

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.
Files changed (102) hide show
  1. package/dist/auth/api-token-cache.d.ts +24 -0
  2. package/dist/auth/api-token-source.d.ts +39 -0
  3. package/dist/auth/authenticated-fetch.d.ts +10 -0
  4. package/dist/auth/index.d.ts +3 -0
  5. package/dist/auth/index.js +19 -0
  6. package/dist/automations/index.js +14 -17
  7. package/dist/{chunk-habmdf89.js → chunk-0bwsjn0b.js} +29 -29
  8. package/dist/{chunk-mzj1j0p5.js → chunk-0w13kxkr.js} +34 -31
  9. package/dist/{chunk-qgkx89eg.js → chunk-3j5wf2t5.js} +44 -43
  10. package/dist/{chunk-0y2fy5en.js → chunk-4361gxk0.js} +7 -7
  11. package/dist/{chunk-n3ywwx7n.js → chunk-52520csz.js} +15 -14
  12. package/dist/chunk-5dnfgyx8.js +159 -0
  13. package/dist/{chunk-tr3v83cn.js → chunk-5fa4arn1.js} +18 -11
  14. package/dist/{chunk-ngy1fdcx.js → chunk-631ffb6r.js} +10 -10
  15. package/dist/{chunk-01nfqm18.js → chunk-7anj08zc.js} +11 -9
  16. package/dist/{chunk-yq0sf8sb.js → chunk-7dr4kybf.js} +483 -451
  17. package/dist/chunk-7mhr5aex.js +171 -0
  18. package/dist/chunk-7rywbqzz.js +27 -0
  19. package/dist/{chunk-yf15kdte.js → chunk-9ct3xypr.js} +2636 -3864
  20. package/dist/chunk-9geh4c3v.js +1034 -0
  21. package/dist/{chunk-19brnwkp.js → chunk-9qf0eg7m.js} +19 -19
  22. package/dist/{chunk-y11p1q7r.js → chunk-aqqywy8g.js} +4 -4
  23. package/dist/chunk-bcvx11fn.js +174 -0
  24. package/dist/{chunk-z4smq8qd.js → chunk-cyfeaz43.js} +86 -86
  25. package/dist/chunk-czq37rrt.js +286 -0
  26. package/dist/chunk-ec5z8bbq.js +126 -0
  27. package/dist/{chunk-rt9tq4j6.js → chunk-h9yxx0hd.js} +7 -7
  28. package/dist/{chunk-t1dq2c2s.js → chunk-hma87efq.js} +40 -40
  29. package/dist/{chunk-5dny5jg1.js → chunk-hpv234hf.js} +11 -11
  30. package/dist/{chunk-rq5k7m33.js → chunk-k7xnsmp5.js} +182 -97
  31. package/dist/{chunk-91f5gm5z.js → chunk-kbpkpxcn.js} +22 -21
  32. package/dist/{chunk-6tra3gw8.js → chunk-kjn1knb9.js} +7 -7
  33. package/dist/{chunk-g4j5cfpc.js → chunk-p3s7cjfc.js} +17 -16
  34. package/dist/chunk-pq6hrtnb.js +49 -0
  35. package/dist/{chunk-mp2rqtcj.js → chunk-ptpy7nnm.js} +8 -8
  36. package/dist/{chunk-xqfj56m9.js → chunk-vn1rfxma.js} +8 -8
  37. package/dist/chunk-vyv8kvkv.js +113 -0
  38. package/dist/{chunk-0c60x3v8.js → chunk-xe2zgyz7.js} +35 -35
  39. package/dist/chunk-y4dwmhn2.js +14 -0
  40. package/dist/{chunk-098740f7.js → chunk-yypj3zn0.js} +8 -8
  41. package/dist/chunk-yzj1mfpr.js +1515 -0
  42. package/dist/client.d.ts +5 -1
  43. package/dist/client.js +62 -61
  44. package/dist/connectors/index.js +36 -37
  45. package/dist/contracts/artifact-markers.js +11 -12
  46. package/dist/contracts/artifacts.js +21 -23
  47. package/dist/contracts/automation-document/index.js +28 -30
  48. package/dist/contracts/pipeline-document/built-ins.d.ts +1 -1
  49. package/dist/contracts/pipeline-document/index.js +95 -97
  50. package/dist/contracts/step-artifact-submissions.js +20 -17
  51. package/dist/contracts/work-item-changes.js +8 -6
  52. package/dist/create-api-client.d.ts +11 -0
  53. package/dist/defaults/index.js +44 -884
  54. package/dist/defaults/load-push-defaults.d.ts +11 -4
  55. package/dist/defaults/project-ref.d.ts +2 -4
  56. package/dist/definitions/automations/automations-client.d.ts +2 -1
  57. package/dist/definitions/automations/index.js +6 -8
  58. package/dist/definitions/environments/environments-client.d.ts +2 -1
  59. package/dist/definitions/environments/index.js +37 -38
  60. package/dist/definitions/pipelines/index.js +12 -14
  61. package/dist/definitions/pipelines/pipeline-definitions-client.d.ts +2 -1
  62. package/dist/definitions/steps/define-mcp.d.ts +2 -2
  63. package/dist/definitions/steps/index.js +93 -95
  64. package/dist/definitions/steps/mcp-server-config.d.ts +13 -3
  65. package/dist/definitions/steps/step-definitions-client.d.ts +20 -1
  66. package/dist/definitions/validation/index.js +17 -18
  67. package/dist/devcontainer-config-path.js +9 -11
  68. package/dist/env-vars.js +37 -39
  69. package/dist/environment.js +41 -42
  70. package/dist/eslint.js +0 -2
  71. package/dist/generated/index.d.ts +2 -2
  72. package/dist/generated/sdk.gen.d.ts +41 -1
  73. package/dist/generated/types.gen.d.ts +1801 -0
  74. package/dist/git-url/git-repo-identity.js +0 -2
  75. package/dist/health-checks.js +15 -17
  76. package/dist/index.js +364 -358
  77. package/dist/jsonc.js +7 -8
  78. package/dist/managed-connections.d.ts +16 -0
  79. package/dist/managed-connections.js +9 -0
  80. package/dist/managed-runtimes.js +9 -11
  81. package/dist/opencode-mcp.d.ts +55 -1
  82. package/dist/opencode-mcp.js +33 -28
  83. package/dist/pipelines/index.js +78 -81
  84. package/dist/push/code-step-lookup.js +9 -10
  85. package/dist/push/index.d.ts +1 -0
  86. package/dist/push/index.js +109 -79
  87. package/dist/push/push-from-directory.d.ts +9 -1
  88. package/dist/push/pushed-mcp-servers.d.ts +28 -0
  89. package/dist/repo-config.js +41 -43
  90. package/dist/resolve-environment.js +14 -15
  91. package/dist/scarn-config-parser.js +5 -6
  92. package/dist/task-plane-client.d.ts +143 -1
  93. package/package.json +11 -3
  94. package/dist/chunk-46wmsgv7.js +0 -14
  95. package/dist/chunk-a56zc4s5.js +0 -119
  96. package/dist/chunk-aemxz9r7.js +0 -107
  97. package/dist/chunk-b9ja6ss5.js +0 -275
  98. package/dist/chunk-e0pt5x0e.js +0 -167
  99. package/dist/chunk-pqtd0hr7.js +0 -96
  100. package/dist/chunk-rphfy0fj.js +0 -167
  101. package/dist/chunk-y34zsgsw.js +0 -39
  102. package/dist/chunk-y64skrwp.js +0 -17
@@ -0,0 +1,1515 @@
1
+ // @bun
2
+ import {
3
+ __export,
4
+ toZod,
5
+ assignProp,
6
+ mergeDefs,
7
+ isPlainObject,
8
+ clone,
9
+ exports_util,
10
+ NEVER,
11
+ $brand,
12
+ config,
13
+ flattenError,
14
+ formatError,
15
+ treeifyError,
16
+ prettifyError,
17
+ validate,
18
+ validateAsync,
19
+ exports_regexes,
20
+ getDiscriminatedOption,
21
+ $ZodLazy,
22
+ memoizer,
23
+ exports_locales,
24
+ $output,
25
+ $input,
26
+ registry,
27
+ globalRegistry,
28
+ INVALID,
29
+ ZodCompileAsyncError,
30
+ ZodCompileUnsupportedError,
31
+ compile,
32
+ withParser,
33
+ _coercedString,
34
+ TimePrecision,
35
+ _isoDateTime,
36
+ _isoDate,
37
+ _isoTime,
38
+ _isoDuration,
39
+ _coercedNumber,
40
+ _coercedBoolean,
41
+ _coercedBigint,
42
+ _coercedDate,
43
+ _lt,
44
+ _lte,
45
+ _gt,
46
+ _gte,
47
+ _positive,
48
+ _negative,
49
+ _nonpositive,
50
+ _nonnegative,
51
+ _multipleOf,
52
+ _maxSize,
53
+ _minSize,
54
+ _size,
55
+ _maxLength,
56
+ _minLength,
57
+ _length,
58
+ _regex,
59
+ _lowercase,
60
+ _uppercase,
61
+ _includes,
62
+ _startsWith,
63
+ _endsWith,
64
+ _property,
65
+ _properties,
66
+ _mime,
67
+ _overwrite,
68
+ _normalize,
69
+ _trim,
70
+ _toLowerCase,
71
+ _toUpperCase,
72
+ _slugify,
73
+ toJSONSchema,
74
+ exports_core,
75
+ exports_checks,
76
+ ZodError,
77
+ ZodRealError,
78
+ parse2,
79
+ parseAsync,
80
+ safeParse,
81
+ safeParseAsync,
82
+ encode,
83
+ decode,
84
+ encodeAsync,
85
+ decodeAsync,
86
+ safeEncode,
87
+ safeDecode,
88
+ safeEncodeAsync,
89
+ safeDecodeAsync,
90
+ ZodType,
91
+ _ZodString,
92
+ ZodString,
93
+ string,
94
+ ZodStringFormat,
95
+ ZodISODateTime,
96
+ ZodISODate,
97
+ ZodISOTime,
98
+ ZodISODuration,
99
+ ZodEmail,
100
+ email,
101
+ ZodGUID,
102
+ guid,
103
+ ZodUUID,
104
+ uuid,
105
+ uuidv4,
106
+ uuidv6,
107
+ uuidv7,
108
+ ZodURL,
109
+ url,
110
+ httpUrl,
111
+ ZodEmoji,
112
+ emoji,
113
+ ZodNanoID,
114
+ nanoid,
115
+ ZodCUID,
116
+ cuid,
117
+ ZodCUID2,
118
+ cuid2,
119
+ ZodULID,
120
+ ulid,
121
+ ZodXID,
122
+ xid,
123
+ ZodKSUID,
124
+ ksuid,
125
+ ZodIPv4,
126
+ ipv4,
127
+ ZodMAC,
128
+ mac,
129
+ ZodIPv6,
130
+ ipv6,
131
+ ZodCIDRv4,
132
+ cidrv4,
133
+ ZodCIDRv6,
134
+ cidrv6,
135
+ ZodBase64,
136
+ base64,
137
+ ZodBase64URL,
138
+ base64url,
139
+ ZodE164,
140
+ e164,
141
+ ZodCreditCard,
142
+ creditCard,
143
+ ZodIBAN,
144
+ iban,
145
+ ZodJWT,
146
+ jwt,
147
+ ZodCustomStringFormat,
148
+ stringFormat,
149
+ hostname,
150
+ hex,
151
+ currencyCode,
152
+ hash,
153
+ ZodNumber,
154
+ number,
155
+ ZodNumberFormat,
156
+ int,
157
+ float32,
158
+ float64,
159
+ int32,
160
+ uint32,
161
+ ZodBoolean,
162
+ boolean,
163
+ ZodBigInt,
164
+ bigint,
165
+ ZodBigIntFormat,
166
+ int64,
167
+ uint64,
168
+ ZodSymbol,
169
+ symbol,
170
+ ZodUndefined,
171
+ _undefined,
172
+ ZodNull,
173
+ _null,
174
+ ZodAny,
175
+ any3,
176
+ ZodUnknown,
177
+ unknown,
178
+ ZodNever,
179
+ never,
180
+ ZodVoid,
181
+ _void,
182
+ ZodDate,
183
+ date,
184
+ ZodArray,
185
+ array,
186
+ keyof,
187
+ ZodObject,
188
+ object,
189
+ strictObject,
190
+ looseObject,
191
+ ZodUnion,
192
+ union,
193
+ ZodXor,
194
+ xor,
195
+ ZodDiscriminatedUnion,
196
+ discriminatedUnion,
197
+ ZodIntersection,
198
+ intersection,
199
+ ZodTuple,
200
+ tuple,
201
+ ZodRecord,
202
+ record,
203
+ partialRecord,
204
+ looseRecord,
205
+ ZodMap,
206
+ map,
207
+ ZodSet,
208
+ set,
209
+ ZodEnum,
210
+ _enum,
211
+ nativeEnum,
212
+ ZodLiteral,
213
+ literal,
214
+ ZodFile,
215
+ file,
216
+ ZodTransform,
217
+ transform,
218
+ ZodOptional,
219
+ optional,
220
+ ZodExactOptional,
221
+ exactOptional,
222
+ ZodNullable,
223
+ nullable,
224
+ nullish,
225
+ ZodDefault,
226
+ _default,
227
+ ZodPrefault,
228
+ prefault,
229
+ ZodNonOptional,
230
+ nonoptional,
231
+ ZodSuccess,
232
+ success,
233
+ ZodCatch,
234
+ _catch,
235
+ ZodNaN,
236
+ nan,
237
+ ZodPipe,
238
+ pipe,
239
+ ZodCodec,
240
+ codec,
241
+ invertCodec,
242
+ ZodPreprocess,
243
+ ZodReadonly,
244
+ readonly,
245
+ ZodTemplateLiteral,
246
+ templateLiteral,
247
+ ZodLazy,
248
+ lazy,
249
+ ZodPromise,
250
+ promise,
251
+ ZodFunction,
252
+ _function,
253
+ ZodCustom,
254
+ check,
255
+ custom,
256
+ refine,
257
+ superRefine,
258
+ describe,
259
+ meta,
260
+ ZodInstanceOf,
261
+ _instanceof,
262
+ stringbool,
263
+ json,
264
+ preprocess,
265
+ exports_schemas
266
+ } from "./chunk-9ct3xypr.js";
267
+
268
+ // ../../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/classic/external.js
269
+ var exports_external = {};
270
+ __export(exports_external, {
271
+ $brand: () => $brand,
272
+ $input: () => $input,
273
+ $output: () => $output,
274
+ INVALID: () => INVALID,
275
+ NEVER: () => NEVER,
276
+ TimePrecision: () => TimePrecision,
277
+ ZodAny: () => ZodAny,
278
+ ZodArray: () => ZodArray,
279
+ ZodBase64: () => ZodBase64,
280
+ ZodBase64URL: () => ZodBase64URL,
281
+ ZodBigInt: () => ZodBigInt,
282
+ ZodBigIntFormat: () => ZodBigIntFormat,
283
+ ZodBoolean: () => ZodBoolean,
284
+ ZodCIDRv4: () => ZodCIDRv4,
285
+ ZodCIDRv6: () => ZodCIDRv6,
286
+ ZodCUID: () => ZodCUID,
287
+ ZodCUID2: () => ZodCUID2,
288
+ ZodCatch: () => ZodCatch,
289
+ ZodCodec: () => ZodCodec,
290
+ ZodCompileAsyncError: () => ZodCompileAsyncError,
291
+ ZodCompileUnsupportedError: () => ZodCompileUnsupportedError,
292
+ ZodCreditCard: () => ZodCreditCard,
293
+ ZodCustom: () => ZodCustom,
294
+ ZodCustomStringFormat: () => ZodCustomStringFormat,
295
+ ZodDate: () => ZodDate,
296
+ ZodDefault: () => ZodDefault,
297
+ ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
298
+ ZodE164: () => ZodE164,
299
+ ZodEmail: () => ZodEmail,
300
+ ZodEmoji: () => ZodEmoji,
301
+ ZodEnum: () => ZodEnum,
302
+ ZodError: () => ZodError,
303
+ ZodExactOptional: () => ZodExactOptional,
304
+ ZodFile: () => ZodFile,
305
+ ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
306
+ ZodFunction: () => ZodFunction,
307
+ ZodGUID: () => ZodGUID,
308
+ ZodIBAN: () => ZodIBAN,
309
+ ZodIPv4: () => ZodIPv4,
310
+ ZodIPv6: () => ZodIPv6,
311
+ ZodISODate: () => ZodISODate,
312
+ ZodISODateTime: () => ZodISODateTime,
313
+ ZodISODuration: () => ZodISODuration,
314
+ ZodISOTime: () => ZodISOTime,
315
+ ZodInstanceOf: () => ZodInstanceOf,
316
+ ZodIntersection: () => ZodIntersection,
317
+ ZodIssueCode: () => ZodIssueCode,
318
+ ZodJWT: () => ZodJWT,
319
+ ZodKSUID: () => ZodKSUID,
320
+ ZodLazy: () => ZodLazy,
321
+ ZodLiteral: () => ZodLiteral,
322
+ ZodMAC: () => ZodMAC,
323
+ ZodMap: () => ZodMap,
324
+ ZodNaN: () => ZodNaN,
325
+ ZodNanoID: () => ZodNanoID,
326
+ ZodNever: () => ZodNever,
327
+ ZodNonOptional: () => ZodNonOptional,
328
+ ZodNull: () => ZodNull,
329
+ ZodNullable: () => ZodNullable,
330
+ ZodNumber: () => ZodNumber,
331
+ ZodNumberFormat: () => ZodNumberFormat,
332
+ ZodObject: () => ZodObject,
333
+ ZodOptional: () => ZodOptional,
334
+ ZodPipe: () => ZodPipe,
335
+ ZodPrefault: () => ZodPrefault,
336
+ ZodPreprocess: () => ZodPreprocess,
337
+ ZodPromise: () => ZodPromise,
338
+ ZodReadonly: () => ZodReadonly,
339
+ ZodRealError: () => ZodRealError,
340
+ ZodRecord: () => ZodRecord,
341
+ ZodSet: () => ZodSet,
342
+ ZodString: () => ZodString,
343
+ ZodStringFormat: () => ZodStringFormat,
344
+ ZodSuccess: () => ZodSuccess,
345
+ ZodSymbol: () => ZodSymbol,
346
+ ZodTemplateLiteral: () => ZodTemplateLiteral,
347
+ ZodTransform: () => ZodTransform,
348
+ ZodTuple: () => ZodTuple,
349
+ ZodType: () => ZodType,
350
+ ZodULID: () => ZodULID,
351
+ ZodURL: () => ZodURL,
352
+ ZodUUID: () => ZodUUID,
353
+ ZodUndefined: () => ZodUndefined,
354
+ ZodUnion: () => ZodUnion,
355
+ ZodUnknown: () => ZodUnknown,
356
+ ZodVoid: () => ZodVoid,
357
+ ZodXID: () => ZodXID,
358
+ ZodXor: () => ZodXor,
359
+ _ZodString: () => _ZodString,
360
+ _default: () => _default,
361
+ _function: () => _function,
362
+ any: () => any3,
363
+ array: () => array,
364
+ base64: () => base64,
365
+ base64url: () => base64url,
366
+ bigint: () => bigint,
367
+ boolean: () => boolean,
368
+ catch: () => _catch,
369
+ check: () => check,
370
+ cidrv4: () => cidrv4,
371
+ cidrv6: () => cidrv6,
372
+ clone: () => clone,
373
+ codec: () => codec,
374
+ coerce: () => exports_coerce,
375
+ compile: () => compile,
376
+ config: () => config,
377
+ core: () => exports_core,
378
+ creditCard: () => creditCard,
379
+ cuid: () => cuid,
380
+ cuid2: () => cuid2,
381
+ currencyCode: () => currencyCode,
382
+ custom: () => custom,
383
+ date: () => date,
384
+ decode: () => decode,
385
+ decodeAsync: () => decodeAsync,
386
+ deepPartial: () => deepPartial,
387
+ describe: () => describe,
388
+ discriminatedUnion: () => discriminatedUnion,
389
+ e164: () => e164,
390
+ email: () => email,
391
+ emoji: () => emoji,
392
+ encode: () => encode,
393
+ encodeAsync: () => encodeAsync,
394
+ endsWith: () => _endsWith,
395
+ enum: () => _enum,
396
+ exactOptional: () => exactOptional,
397
+ file: () => file,
398
+ flattenError: () => flattenError,
399
+ float32: () => float32,
400
+ float64: () => float64,
401
+ formatError: () => formatError,
402
+ fromJSONSchema: () => fromJSONSchema,
403
+ function: () => _function,
404
+ getDiscriminatedOption: () => getDiscriminatedOption,
405
+ getErrorMap: () => getErrorMap,
406
+ globalRegistry: () => globalRegistry,
407
+ gt: () => _gt,
408
+ gte: () => _gte,
409
+ guid: () => guid,
410
+ hash: () => hash,
411
+ hex: () => hex,
412
+ hostname: () => hostname,
413
+ httpUrl: () => httpUrl,
414
+ iban: () => iban,
415
+ includes: () => _includes,
416
+ input: () => input,
417
+ instanceof: () => _instanceof,
418
+ int: () => int,
419
+ int32: () => int32,
420
+ int64: () => int64,
421
+ intersection: () => intersection,
422
+ invertCodec: () => invertCodec,
423
+ ipv4: () => ipv4,
424
+ ipv6: () => ipv6,
425
+ iso: () => exports_iso,
426
+ json: () => json,
427
+ jwt: () => jwt,
428
+ keyof: () => keyof,
429
+ ksuid: () => ksuid,
430
+ lazy: () => lazy,
431
+ length: () => _length,
432
+ literal: () => literal,
433
+ locales: () => exports_locales,
434
+ looseObject: () => looseObject,
435
+ looseRecord: () => looseRecord,
436
+ lowercase: () => _lowercase,
437
+ lt: () => _lt,
438
+ lte: () => _lte,
439
+ mac: () => mac,
440
+ map: () => map,
441
+ maxLength: () => _maxLength,
442
+ maxSize: () => _maxSize,
443
+ memoizer: () => memoizer,
444
+ meta: () => meta,
445
+ mime: () => _mime,
446
+ minLength: () => _minLength,
447
+ minSize: () => _minSize,
448
+ multipleOf: () => _multipleOf,
449
+ nan: () => nan,
450
+ nanoid: () => nanoid,
451
+ nativeEnum: () => nativeEnum,
452
+ negative: () => _negative,
453
+ never: () => never,
454
+ nonnegative: () => _nonnegative,
455
+ nonoptional: () => nonoptional,
456
+ nonpositive: () => _nonpositive,
457
+ normalize: () => _normalize,
458
+ null: () => _null,
459
+ nullable: () => nullable,
460
+ nullish: () => nullish,
461
+ number: () => number,
462
+ object: () => object,
463
+ optional: () => optional,
464
+ output: () => output,
465
+ overwrite: () => _overwrite,
466
+ parse: () => parse2,
467
+ parseAsync: () => parseAsync,
468
+ partialRecord: () => partialRecord,
469
+ pipe: () => pipe,
470
+ positive: () => _positive,
471
+ prefault: () => prefault,
472
+ preprocess: () => preprocess,
473
+ prettifyError: () => prettifyError,
474
+ promise: () => promise,
475
+ properties: () => _properties,
476
+ property: () => _property,
477
+ readonly: () => readonly,
478
+ record: () => record,
479
+ refine: () => refine,
480
+ regex: () => _regex,
481
+ regexes: () => exports_regexes,
482
+ registry: () => registry,
483
+ safeDecode: () => safeDecode,
484
+ safeDecodeAsync: () => safeDecodeAsync,
485
+ safeEncode: () => safeEncode,
486
+ safeEncodeAsync: () => safeEncodeAsync,
487
+ safeParse: () => safeParse,
488
+ safeParseAsync: () => safeParseAsync,
489
+ set: () => set,
490
+ setErrorMap: () => setErrorMap,
491
+ size: () => _size,
492
+ slugify: () => _slugify,
493
+ startsWith: () => _startsWith,
494
+ strictObject: () => strictObject,
495
+ string: () => string,
496
+ stringFormat: () => stringFormat,
497
+ stringbool: () => stringbool,
498
+ success: () => success,
499
+ superRefine: () => superRefine,
500
+ symbol: () => symbol,
501
+ templateLiteral: () => templateLiteral,
502
+ toJSONSchema: () => toJSONSchema,
503
+ toLowerCase: () => _toLowerCase,
504
+ toUpperCase: () => _toUpperCase,
505
+ toZod: () => toZod,
506
+ transform: () => transform,
507
+ treeifyError: () => treeifyError,
508
+ trim: () => _trim,
509
+ tuple: () => tuple,
510
+ uint32: () => uint32,
511
+ uint64: () => uint64,
512
+ ulid: () => ulid,
513
+ undefined: () => _undefined,
514
+ union: () => union,
515
+ unknown: () => unknown,
516
+ uppercase: () => _uppercase,
517
+ url: () => url,
518
+ util: () => exports_util,
519
+ uuid: () => uuid,
520
+ uuidv4: () => uuidv4,
521
+ uuidv6: () => uuidv6,
522
+ uuidv7: () => uuidv7,
523
+ validate: () => validate,
524
+ validateAsync: () => validateAsync,
525
+ void: () => _void,
526
+ withParser: () => withParser,
527
+ xid: () => xid,
528
+ xor: () => xor
529
+ });
530
+
531
+ // ../../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/classic/iso.js
532
+ var exports_iso = {};
533
+ __export(exports_iso, {
534
+ ZodISODate: () => ZodISODate,
535
+ ZodISODateTime: () => ZodISODateTime,
536
+ ZodISODuration: () => ZodISODuration,
537
+ ZodISOTime: () => ZodISOTime,
538
+ date: () => date2,
539
+ datetime: () => datetime,
540
+ duration: () => duration,
541
+ time: () => time
542
+ });
543
+
544
+ // ../../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/classic/coerce.js
545
+ var exports_coerce = {};
546
+ __export(exports_coerce, {
547
+ bigint: () => bigint2,
548
+ boolean: () => boolean2,
549
+ date: () => date3,
550
+ number: () => number2,
551
+ string: () => string2
552
+ });
553
+ // ../../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/classic/compat.js
554
+ var ZodIssueCode = {
555
+ invalid_type: "invalid_type",
556
+ too_big: "too_big",
557
+ too_small: "too_small",
558
+ invalid_format: "invalid_format",
559
+ not_multiple_of: "not_multiple_of",
560
+ unrecognized_keys: "unrecognized_keys",
561
+ invalid_union: "invalid_union",
562
+ invalid_key: "invalid_key",
563
+ invalid_element: "invalid_element",
564
+ invalid_value: "invalid_value",
565
+ custom: "custom"
566
+ };
567
+ function setErrorMap(map) {
568
+ config({
569
+ customError: map
570
+ });
571
+ }
572
+ function getErrorMap() {
573
+ return config().customError;
574
+ }
575
+ var ZodFirstPartyTypeKind;
576
+ (function(ZodFirstPartyTypeKind) {})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
577
+ // ../../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/classic/iso.js
578
+ function datetime(params) {
579
+ return _isoDateTime(ZodISODateTime, params);
580
+ }
581
+ function date2(params) {
582
+ return _isoDate(ZodISODate, params);
583
+ }
584
+ function time(params) {
585
+ return _isoTime(ZodISOTime, params);
586
+ }
587
+ function duration(params) {
588
+ return _isoDuration(ZodISODuration, params);
589
+ }
590
+
591
+ // ../../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/classic/from-json-schema.js
592
+ var z = {
593
+ ...exports_schemas,
594
+ ...exports_checks,
595
+ iso: exports_iso
596
+ };
597
+ var RECOGNIZED_KEYS = /* @__PURE__ */ new Set([
598
+ "$schema",
599
+ "$ref",
600
+ "$defs",
601
+ "definitions",
602
+ "$id",
603
+ "id",
604
+ "$comment",
605
+ "$anchor",
606
+ "$vocabulary",
607
+ "$dynamicRef",
608
+ "$dynamicAnchor",
609
+ "type",
610
+ "enum",
611
+ "const",
612
+ "anyOf",
613
+ "oneOf",
614
+ "allOf",
615
+ "not",
616
+ "properties",
617
+ "required",
618
+ "additionalProperties",
619
+ "patternProperties",
620
+ "propertyNames",
621
+ "minProperties",
622
+ "maxProperties",
623
+ "items",
624
+ "prefixItems",
625
+ "additionalItems",
626
+ "minItems",
627
+ "maxItems",
628
+ "uniqueItems",
629
+ "contains",
630
+ "minContains",
631
+ "maxContains",
632
+ "minLength",
633
+ "maxLength",
634
+ "pattern",
635
+ "format",
636
+ "minimum",
637
+ "maximum",
638
+ "exclusiveMinimum",
639
+ "exclusiveMaximum",
640
+ "multipleOf",
641
+ "description",
642
+ "default",
643
+ "contentEncoding",
644
+ "contentMediaType",
645
+ "contentSchema",
646
+ "unevaluatedItems",
647
+ "unevaluatedProperties",
648
+ "if",
649
+ "then",
650
+ "else",
651
+ "dependentSchemas",
652
+ "dependentRequired",
653
+ "nullable",
654
+ "readOnly"
655
+ ]);
656
+ function detectVersion(schema, defaultTarget) {
657
+ const $schema = schema.$schema;
658
+ if ($schema === "https://json-schema.org/draft/2020-12/schema") {
659
+ return "draft-2020-12";
660
+ }
661
+ if ($schema === "http://json-schema.org/draft-07/schema#") {
662
+ return "draft-7";
663
+ }
664
+ if ($schema === "http://json-schema.org/draft-04/schema#") {
665
+ return "draft-4";
666
+ }
667
+ return defaultTarget ?? "draft-2020-12";
668
+ }
669
+ function applyMinItems(items, minItems) {
670
+ return items.map((item, index) => index < minItems ? item : item.optional());
671
+ }
672
+ function decodeJSONPointerSegment(segment) {
673
+ return segment.replace(/~1/g, "/").replace(/~0/g, "~");
674
+ }
675
+ function resolveRef(ref, ctx) {
676
+ if (!ref.startsWith("#")) {
677
+ throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
678
+ }
679
+ const path = ref.slice(1).split("/").filter(Boolean);
680
+ if (path.length === 0) {
681
+ return ctx.rootSchema;
682
+ }
683
+ const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
684
+ if (path[0] === defsKey) {
685
+ const key = path[1] === undefined ? undefined : decodeJSONPointerSegment(path[1]);
686
+ if (!key || !ctx.defs[key]) {
687
+ throw new Error(`Reference not found: ${ref}`);
688
+ }
689
+ return ctx.defs[key];
690
+ }
691
+ throw new Error(`Reference not found: ${ref}`);
692
+ }
693
+ function checkObjectGuards(objectSchema, guards) {
694
+ const guard = z.transform((value) => value).check((payload) => {
695
+ const value = payload.value;
696
+ if (typeof value !== "object" || value === null || Array.isArray(value))
697
+ return;
698
+ const keys = Object.getOwnPropertyNames(value);
699
+ if (guards.minProperties !== undefined && keys.length < guards.minProperties) {
700
+ payload.issues.push({
701
+ origin: "object",
702
+ code: "too_small",
703
+ minimum: guards.minProperties,
704
+ inclusive: true,
705
+ message: `Too small: expected object to have >=${guards.minProperties} properties`,
706
+ input: value,
707
+ inst: objectSchema,
708
+ continue: true
709
+ });
710
+ }
711
+ if (guards.maxProperties !== undefined && keys.length > guards.maxProperties) {
712
+ payload.issues.push({
713
+ origin: "object",
714
+ code: "too_big",
715
+ maximum: guards.maxProperties,
716
+ inclusive: true,
717
+ message: `Too big: expected object to have <=${guards.maxProperties} properties`,
718
+ input: value,
719
+ inst: objectSchema,
720
+ continue: true
721
+ });
722
+ }
723
+ if (guards.keySchema) {
724
+ for (const key of keys) {
725
+ const result = guards.keySchema.safeParse(key);
726
+ if (result.success)
727
+ continue;
728
+ payload.issues.push({
729
+ code: "invalid_key",
730
+ origin: "record",
731
+ issues: result.error.issues,
732
+ input: key,
733
+ path: [key],
734
+ continue: true
735
+ });
736
+ }
737
+ }
738
+ });
739
+ return guard.pipe(objectSchema);
740
+ }
741
+ function canonicalKey(value, seen) {
742
+ if (value === null)
743
+ return "z";
744
+ const type = typeof value;
745
+ if (type !== "object") {
746
+ if (type === "number" && Number.isNaN(value))
747
+ return null;
748
+ const raw = String(value);
749
+ return `${type[0]}${raw.length}:${raw}`;
750
+ }
751
+ if (seen.has(value))
752
+ return null;
753
+ seen.add(value);
754
+ try {
755
+ if (Array.isArray(value)) {
756
+ const parts = [];
757
+ for (const item of value) {
758
+ const key = canonicalKey(item, seen);
759
+ if (key === null)
760
+ return null;
761
+ parts.push(key);
762
+ }
763
+ return `a${parts.length}:[${parts.join(",")}]`;
764
+ }
765
+ const keys = Object.keys(value).sort();
766
+ const parts = [];
767
+ for (const k of keys) {
768
+ const key = canonicalKey(value[k], seen);
769
+ if (key === null)
770
+ return null;
771
+ parts.push(`${k.length}:${k}=${key}`);
772
+ }
773
+ return `o${parts.length}:{${parts.join(",")}}`;
774
+ } finally {
775
+ seen.delete(value);
776
+ }
777
+ }
778
+ var SCHEMA_KEYWORDS = /* @__PURE__ */ new Set([
779
+ "items",
780
+ "prefixItems",
781
+ "additionalItems",
782
+ "additionalProperties",
783
+ "contains",
784
+ "propertyNames",
785
+ "not",
786
+ "if",
787
+ "then",
788
+ "else",
789
+ "allOf",
790
+ "anyOf",
791
+ "oneOf",
792
+ "unevaluatedItems",
793
+ "unevaluatedProperties",
794
+ "contentSchema"
795
+ ]);
796
+ var SCHEMA_MAP_KEYWORDS = /* @__PURE__ */ new Set([
797
+ "properties",
798
+ "patternProperties",
799
+ "dependentSchemas",
800
+ "dependencies",
801
+ "$defs",
802
+ "definitions"
803
+ ]);
804
+ function containsRef(value) {
805
+ if (typeof value !== "object" || value === null)
806
+ return false;
807
+ if (Array.isArray(value))
808
+ return value.some(containsRef);
809
+ if (typeof value.$ref === "string")
810
+ return true;
811
+ return Object.entries(value).some(([key, sub]) => {
812
+ if (SCHEMA_KEYWORDS.has(key))
813
+ return containsRef(sub);
814
+ if (!SCHEMA_MAP_KEYWORDS.has(key) || typeof sub !== "object" || sub === null)
815
+ return false;
816
+ return Object.values(sub).some(containsRef);
817
+ });
818
+ }
819
+ function plural(n) {
820
+ return n === 1 ? "element" : "elements";
821
+ }
822
+ function checkArrayGuards(arraySchema, guards) {
823
+ const guard = z.transform((value) => value).check((payload) => {
824
+ const items = payload.value;
825
+ if (!Array.isArray(items))
826
+ return;
827
+ if (guards.uniqueItems === true) {
828
+ const firstSeen = new Map;
829
+ for (let i = 0;i < items.length; i++) {
830
+ const key = canonicalKey(items[i], new Set);
831
+ if (key === null)
832
+ continue;
833
+ const first = firstSeen.get(key);
834
+ if (first === undefined) {
835
+ firstSeen.set(key, i);
836
+ continue;
837
+ }
838
+ payload.issues.push({
839
+ code: "custom",
840
+ message: `Array items must be unique: element at index ${i} duplicates the one at index ${first}`,
841
+ input: items,
842
+ path: [i],
843
+ continue: true
844
+ });
845
+ }
846
+ }
847
+ if (guards.containsSchema) {
848
+ const minContains = guards.minContains ?? 1;
849
+ const ceiling = guards.maxContains !== undefined ? guards.maxContains + 1 : Number.POSITIVE_INFINITY;
850
+ let matches = 0;
851
+ for (const item of items) {
852
+ if (guards.containsSchema.safeParse(item).success && ++matches >= ceiling)
853
+ break;
854
+ }
855
+ if (matches < minContains) {
856
+ payload.issues.push({
857
+ code: "custom",
858
+ message: `Array must contain at least ${minContains} matching ${plural(minContains)}; found ${matches}`,
859
+ input: items,
860
+ continue: true
861
+ });
862
+ }
863
+ if (guards.maxContains !== undefined && matches > guards.maxContains) {
864
+ payload.issues.push({
865
+ code: "custom",
866
+ message: `Array must contain at most ${guards.maxContains} matching ${plural(guards.maxContains)}`,
867
+ input: items,
868
+ continue: true
869
+ });
870
+ }
871
+ }
872
+ });
873
+ return guard.pipe(arraySchema);
874
+ }
875
+ function getTupleRest(restSchema, ctx) {
876
+ if (restSchema === false) {
877
+ return;
878
+ }
879
+ if (restSchema === undefined || restSchema === true) {
880
+ return z.any();
881
+ }
882
+ return convertSchema(restSchema, ctx);
883
+ }
884
+ var fullTime = /^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;
885
+ function convertBaseSchema(schema, ctx) {
886
+ if (schema.not !== undefined) {
887
+ if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
888
+ return z.never();
889
+ }
890
+ throw new Error("not is not supported in Zod (except { not: {} } for never)");
891
+ }
892
+ if (schema.unevaluatedItems !== undefined) {
893
+ throw new Error("unevaluatedItems is not supported");
894
+ }
895
+ if (schema.unevaluatedProperties !== undefined) {
896
+ throw new Error("unevaluatedProperties is not supported");
897
+ }
898
+ if (schema.if !== undefined || schema.then !== undefined || schema.else !== undefined) {
899
+ throw new Error("Conditional schemas (if/then/else) are not supported");
900
+ }
901
+ if (schema.dependentSchemas !== undefined || schema.dependentRequired !== undefined) {
902
+ throw new Error("dependentSchemas and dependentRequired are not supported");
903
+ }
904
+ if (schema.$ref) {
905
+ const refPath = schema.$ref;
906
+ if (ctx.refs.has(refPath)) {
907
+ return ctx.refs.get(refPath);
908
+ }
909
+ if (ctx.processing.has(refPath)) {
910
+ return z.lazy(() => {
911
+ if (!ctx.refs.has(refPath)) {
912
+ throw new Error(`Circular reference not resolved: ${refPath}`);
913
+ }
914
+ return ctx.refs.get(refPath);
915
+ });
916
+ }
917
+ ctx.processing.add(refPath);
918
+ const resolved = resolveRef(refPath, ctx);
919
+ const zodSchema = convertSchema(resolved, ctx);
920
+ ctx.refs.set(refPath, zodSchema);
921
+ ctx.processing.delete(refPath);
922
+ return zodSchema;
923
+ }
924
+ if (schema.enum !== undefined) {
925
+ const enumValues = schema.enum;
926
+ if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
927
+ return z.null();
928
+ }
929
+ if (enumValues.length === 0) {
930
+ return z.never();
931
+ }
932
+ if (enumValues.length === 1) {
933
+ return z.literal(enumValues[0]);
934
+ }
935
+ if (enumValues.every((v) => typeof v === "string")) {
936
+ return z.enum(enumValues);
937
+ }
938
+ const literalSchemas = enumValues.map((v) => z.literal(v));
939
+ if (literalSchemas.length < 2) {
940
+ return literalSchemas[0];
941
+ }
942
+ return z.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
943
+ }
944
+ if (schema.const !== undefined) {
945
+ return z.literal(schema.const);
946
+ }
947
+ const type = schema.type;
948
+ if (Array.isArray(type)) {
949
+ const typeSchemas = type.map((t) => {
950
+ const typeSchema = { ...schema, type: t };
951
+ return convertBaseSchema(typeSchema, ctx);
952
+ });
953
+ if (typeSchemas.length === 0) {
954
+ return z.never();
955
+ }
956
+ if (typeSchemas.length === 1) {
957
+ return typeSchemas[0];
958
+ }
959
+ return z.union(typeSchemas);
960
+ }
961
+ if (!type) {
962
+ return z.any();
963
+ }
964
+ let zodSchema;
965
+ switch (type) {
966
+ case "string": {
967
+ let stringSchema = z.string();
968
+ if (schema.format) {
969
+ const format = schema.format;
970
+ if (format === "email") {
971
+ stringSchema = stringSchema.check(z.email());
972
+ } else if (format === "uri" || format === "uri-reference") {
973
+ stringSchema = stringSchema.check(z.url());
974
+ } else if (format === "uuid" || format === "guid") {
975
+ stringSchema = stringSchema.check(z.uuid());
976
+ } else if (format === "date-time") {
977
+ stringSchema = stringSchema.check(z.iso.datetime({ offset: true }));
978
+ } else if (format === "date") {
979
+ stringSchema = stringSchema.check(z.iso.date());
980
+ } else if (format === "time") {
981
+ stringSchema = stringSchema.check(z.regex(fullTime));
982
+ } else if (format === "duration") {
983
+ stringSchema = stringSchema.check(z.iso.duration());
984
+ } else if (format === "hostname") {
985
+ stringSchema = stringSchema.check(z.hostname());
986
+ } else if (format === "ipv4") {
987
+ stringSchema = stringSchema.check(z.ipv4());
988
+ } else if (format === "ipv6") {
989
+ stringSchema = stringSchema.check(z.ipv6());
990
+ } else if (format === "mac") {
991
+ stringSchema = stringSchema.check(z.mac());
992
+ } else if (format === "cidr") {
993
+ stringSchema = stringSchema.check(z.cidrv4());
994
+ } else if (format === "cidr-v6") {
995
+ stringSchema = stringSchema.check(z.cidrv6());
996
+ } else if (format === "base64") {
997
+ stringSchema = stringSchema.check(z.base64());
998
+ } else if (format === "base64url") {
999
+ stringSchema = stringSchema.check(z.base64url());
1000
+ } else if (format === "e164") {
1001
+ stringSchema = stringSchema.check(z.e164());
1002
+ } else if (format === "credit_card") {
1003
+ stringSchema = stringSchema.check(z.creditCard());
1004
+ } else if (format === "iban") {
1005
+ stringSchema = stringSchema.check(z.iban());
1006
+ } else if (format === "jwt") {
1007
+ stringSchema = stringSchema.check(z.jwt());
1008
+ } else if (format === "emoji") {
1009
+ stringSchema = stringSchema.check(z.emoji());
1010
+ } else if (format === "nanoid") {
1011
+ stringSchema = stringSchema.check(z.nanoid());
1012
+ } else if (format === "cuid") {
1013
+ stringSchema = stringSchema.check(z.cuid());
1014
+ } else if (format === "cuid2") {
1015
+ stringSchema = stringSchema.check(z.cuid2());
1016
+ } else if (format === "ulid") {
1017
+ stringSchema = stringSchema.check(z.ulid());
1018
+ } else if (format === "xid") {
1019
+ stringSchema = stringSchema.check(z.xid());
1020
+ } else if (format === "ksuid") {
1021
+ stringSchema = stringSchema.check(z.ksuid());
1022
+ }
1023
+ }
1024
+ if (typeof schema.minLength === "number") {
1025
+ stringSchema = stringSchema.min(schema.minLength);
1026
+ }
1027
+ if (typeof schema.maxLength === "number") {
1028
+ stringSchema = stringSchema.max(schema.maxLength);
1029
+ }
1030
+ if (schema.pattern) {
1031
+ stringSchema = stringSchema.regex(new RegExp(schema.pattern));
1032
+ }
1033
+ zodSchema = stringSchema;
1034
+ break;
1035
+ }
1036
+ case "number":
1037
+ case "integer": {
1038
+ let numberSchema = type === "integer" ? z.number().int() : z.number();
1039
+ if (typeof schema.minimum === "number" && schema.exclusiveMinimum !== true) {
1040
+ numberSchema = numberSchema.min(schema.minimum);
1041
+ }
1042
+ if (typeof schema.maximum === "number" && schema.exclusiveMaximum !== true) {
1043
+ numberSchema = numberSchema.max(schema.maximum);
1044
+ }
1045
+ if (typeof schema.exclusiveMinimum === "number") {
1046
+ numberSchema = numberSchema.gt(schema.exclusiveMinimum);
1047
+ } else if (schema.exclusiveMinimum === true && typeof schema.minimum === "number") {
1048
+ numberSchema = numberSchema.gt(schema.minimum);
1049
+ }
1050
+ if (typeof schema.exclusiveMaximum === "number") {
1051
+ numberSchema = numberSchema.lt(schema.exclusiveMaximum);
1052
+ } else if (schema.exclusiveMaximum === true && typeof schema.maximum === "number") {
1053
+ numberSchema = numberSchema.lt(schema.maximum);
1054
+ }
1055
+ if (typeof schema.multipleOf === "number") {
1056
+ numberSchema = numberSchema.multipleOf(schema.multipleOf);
1057
+ }
1058
+ zodSchema = numberSchema;
1059
+ break;
1060
+ }
1061
+ case "boolean": {
1062
+ zodSchema = z.boolean();
1063
+ break;
1064
+ }
1065
+ case "null": {
1066
+ zodSchema = z.null();
1067
+ break;
1068
+ }
1069
+ case "object": {
1070
+ const shape = {};
1071
+ const properties = schema.properties || {};
1072
+ const requiredSet = new Set(schema.required || []);
1073
+ const additionalSchema = typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : undefined;
1074
+ for (const [key, propSchema] of Object.entries(properties)) {
1075
+ const propZodSchema = convertSchema(propSchema, ctx);
1076
+ assignProp(shape, key, requiredSet.has(key) ? propZodSchema : propZodSchema.optional());
1077
+ }
1078
+ if (schema.patternProperties) {
1079
+ const patternProps = schema.patternProperties;
1080
+ const patternKeys = Object.keys(patternProps);
1081
+ const looseRecords = [];
1082
+ for (const pattern of patternKeys) {
1083
+ const patternValue = convertSchema(patternProps[pattern], ctx);
1084
+ const keySchema = z.string().regex(new RegExp(pattern));
1085
+ looseRecords.push(z.looseRecord(keySchema, patternValue));
1086
+ }
1087
+ const schemasToIntersect = [];
1088
+ if (Object.keys(shape).length > 0) {
1089
+ schemasToIntersect.push(z.object(shape).passthrough());
1090
+ }
1091
+ schemasToIntersect.push(...looseRecords);
1092
+ if (schemasToIntersect.length === 0) {
1093
+ zodSchema = z.object({}).passthrough();
1094
+ } else if (schemasToIntersect.length === 1) {
1095
+ zodSchema = schemasToIntersect[0];
1096
+ } else {
1097
+ let result = z.intersection(schemasToIntersect[0], schemasToIntersect[1]);
1098
+ for (let i = 2;i < schemasToIntersect.length; i++) {
1099
+ result = z.intersection(result, schemasToIntersect[i]);
1100
+ }
1101
+ zodSchema = result;
1102
+ }
1103
+ if (schema.additionalProperties === false) {
1104
+ const propertyKeys = Object.keys(shape);
1105
+ const patterns = patternKeys.map((p) => new RegExp(p));
1106
+ const basePatternSchema = zodSchema;
1107
+ zodSchema = zodSchema.check((payload) => {
1108
+ if (!isPlainObject(payload.value))
1109
+ return;
1110
+ const unrecognized = [];
1111
+ for (const key of Object.keys(payload.value)) {
1112
+ if (propertyKeys.includes(key))
1113
+ continue;
1114
+ if (patterns.some((regex) => regex.test(key)))
1115
+ continue;
1116
+ unrecognized.push(key);
1117
+ }
1118
+ if (unrecognized.length) {
1119
+ payload.issues.push({
1120
+ code: "unrecognized_keys",
1121
+ keys: unrecognized,
1122
+ input: payload.value,
1123
+ inst: basePatternSchema
1124
+ });
1125
+ }
1126
+ });
1127
+ }
1128
+ } else {
1129
+ const objectSchema = z.object(shape);
1130
+ if (schema.additionalProperties === false) {
1131
+ zodSchema = objectSchema.strict();
1132
+ } else if (additionalSchema) {
1133
+ zodSchema = objectSchema.catchall(additionalSchema);
1134
+ } else {
1135
+ zodSchema = objectSchema.passthrough();
1136
+ }
1137
+ }
1138
+ const hasKeyGuard = schema.propertyNames !== undefined && schema.propertyNames !== true;
1139
+ const minProperties = typeof schema.minProperties === "number" ? schema.minProperties : undefined;
1140
+ const maxProperties = typeof schema.maxProperties === "number" ? schema.maxProperties : undefined;
1141
+ if (hasKeyGuard || minProperties !== undefined || maxProperties !== undefined) {
1142
+ let keySchema;
1143
+ if (hasKeyGuard) {
1144
+ const keyJSONSchema = typeof schema.propertyNames === "object" && schema.propertyNames.type === undefined ? { type: "string", ...schema.propertyNames } : schema.propertyNames;
1145
+ keySchema = convertSchema(keyJSONSchema, ctx);
1146
+ }
1147
+ zodSchema = checkObjectGuards(zodSchema, { keySchema, minProperties, maxProperties });
1148
+ }
1149
+ break;
1150
+ }
1151
+ case "array": {
1152
+ const prefixItems = schema.prefixItems;
1153
+ const items = schema.items;
1154
+ if (prefixItems && Array.isArray(prefixItems)) {
1155
+ const minItems = typeof schema.minItems === "number" ? schema.minItems : 0;
1156
+ const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
1157
+ const positionalItems = applyMinItems(tupleItems, minItems);
1158
+ const rest = !Array.isArray(items) ? getTupleRest(items, ctx) : undefined;
1159
+ const tupleSchema = z.tuple(positionalItems);
1160
+ zodSchema = rest ? tupleSchema.rest(rest) : tupleSchema;
1161
+ if (typeof schema.minItems === "number") {
1162
+ zodSchema = zodSchema.check(z.minLength(schema.minItems));
1163
+ }
1164
+ if (typeof schema.maxItems === "number") {
1165
+ zodSchema = zodSchema.check(z.maxLength(schema.maxItems));
1166
+ }
1167
+ } else if (Array.isArray(items)) {
1168
+ const minItems = typeof schema.minItems === "number" ? schema.minItems : 0;
1169
+ const tupleItems = items.map((item) => convertSchema(item, ctx));
1170
+ const positionalItems = applyMinItems(tupleItems, minItems);
1171
+ const rest = getTupleRest(schema.additionalItems, ctx);
1172
+ const tupleSchema = z.tuple(positionalItems);
1173
+ zodSchema = rest ? tupleSchema.rest(rest) : tupleSchema;
1174
+ if (typeof schema.minItems === "number") {
1175
+ zodSchema = zodSchema.check(z.minLength(schema.minItems));
1176
+ }
1177
+ if (typeof schema.maxItems === "number") {
1178
+ zodSchema = zodSchema.check(z.maxLength(schema.maxItems));
1179
+ }
1180
+ } else if (items !== undefined) {
1181
+ const element = convertSchema(items, ctx);
1182
+ let arraySchema = z.array(element);
1183
+ if (typeof schema.minItems === "number") {
1184
+ arraySchema = arraySchema.min(schema.minItems);
1185
+ }
1186
+ if (typeof schema.maxItems === "number") {
1187
+ arraySchema = arraySchema.max(schema.maxItems);
1188
+ }
1189
+ zodSchema = arraySchema;
1190
+ } else {
1191
+ zodSchema = z.array(z.any());
1192
+ }
1193
+ if (schema.uniqueItems === true || schema.contains !== undefined) {
1194
+ zodSchema = checkArrayGuards(zodSchema, {
1195
+ uniqueItems: schema.uniqueItems === true,
1196
+ containsSchema: schema.contains !== undefined ? convertSchema(schema.contains, ctx) : undefined,
1197
+ minContains: typeof schema.minContains === "number" ? schema.minContains : undefined,
1198
+ maxContains: typeof schema.maxContains === "number" ? schema.maxContains : undefined
1199
+ });
1200
+ }
1201
+ break;
1202
+ }
1203
+ default:
1204
+ throw new Error(`Unsupported type: ${type}`);
1205
+ }
1206
+ return zodSchema;
1207
+ }
1208
+ function convertSchema(schema, ctx) {
1209
+ if (typeof schema === "boolean") {
1210
+ return schema ? z.any() : z.never();
1211
+ }
1212
+ let baseSchema = convertBaseSchema(schema, ctx);
1213
+ const hasExplicitType = schema.type || schema.enum !== undefined || schema.const !== undefined;
1214
+ if (schema.anyOf && Array.isArray(schema.anyOf)) {
1215
+ const options = schema.anyOf.map((s) => convertSchema(s, ctx));
1216
+ const anyOfUnion = z.union(options);
1217
+ baseSchema = hasExplicitType ? z.intersection(baseSchema, anyOfUnion) : anyOfUnion;
1218
+ }
1219
+ if (schema.oneOf && Array.isArray(schema.oneOf)) {
1220
+ const options = schema.oneOf.map((s) => convertSchema(s, ctx));
1221
+ const oneOfUnion = z.xor(options);
1222
+ baseSchema = hasExplicitType ? z.intersection(baseSchema, oneOfUnion) : oneOfUnion;
1223
+ }
1224
+ if (schema.allOf && Array.isArray(schema.allOf)) {
1225
+ if (schema.allOf.length === 0) {
1226
+ baseSchema = hasExplicitType ? baseSchema : z.any();
1227
+ } else {
1228
+ let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
1229
+ const startIdx = hasExplicitType ? 0 : 1;
1230
+ for (let i = startIdx;i < schema.allOf.length; i++) {
1231
+ result = z.intersection(result, convertSchema(schema.allOf[i], ctx));
1232
+ }
1233
+ baseSchema = result;
1234
+ }
1235
+ }
1236
+ if (schema.nullable === true && ctx.version === "openapi-3.0") {
1237
+ baseSchema = z.nullable(baseSchema);
1238
+ }
1239
+ if (schema.readOnly === true) {
1240
+ baseSchema = z.readonly(baseSchema);
1241
+ }
1242
+ if (schema.default !== undefined) {
1243
+ baseSchema = baseSchema.default(schema.default);
1244
+ }
1245
+ const extraMeta = {};
1246
+ const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
1247
+ for (const key of coreMetadataKeys) {
1248
+ if (key in schema) {
1249
+ extraMeta[key] = schema[key];
1250
+ }
1251
+ }
1252
+ const contentMetadataKeys = ["contentEncoding", "contentMediaType", "contentSchema"];
1253
+ for (const key of contentMetadataKeys) {
1254
+ if (key in schema) {
1255
+ extraMeta[key] = schema[key];
1256
+ }
1257
+ }
1258
+ if (schema.type === "object" && schema.$ref === undefined) {
1259
+ if (schema.propertyNames !== undefined && !containsRef(schema.propertyNames)) {
1260
+ extraMeta.propertyNames = schema.propertyNames;
1261
+ }
1262
+ for (const key of ["minProperties", "maxProperties"]) {
1263
+ if (schema[key] !== undefined)
1264
+ extraMeta[key] = schema[key];
1265
+ }
1266
+ }
1267
+ if (schema.type === "array" && schema.$ref === undefined) {
1268
+ if (schema.contains !== undefined && !containsRef(schema.contains)) {
1269
+ extraMeta.contains = schema.contains;
1270
+ }
1271
+ for (const key of ["uniqueItems", "minContains", "maxContains"]) {
1272
+ if (schema[key] !== undefined)
1273
+ extraMeta[key] = schema[key];
1274
+ }
1275
+ }
1276
+ for (const key of Object.keys(schema)) {
1277
+ if (!RECOGNIZED_KEYS.has(key)) {
1278
+ assignProp(extraMeta, key, schema[key]);
1279
+ }
1280
+ }
1281
+ if (Object.keys(extraMeta).length > 0) {
1282
+ ctx.registry.add(baseSchema, extraMeta);
1283
+ }
1284
+ if (schema.description) {
1285
+ baseSchema = baseSchema.describe(schema.description);
1286
+ }
1287
+ return baseSchema;
1288
+ }
1289
+ function fromJSONSchema(schema, params) {
1290
+ if (typeof schema === "boolean") {
1291
+ return schema ? z.any() : z.never();
1292
+ }
1293
+ let normalized;
1294
+ try {
1295
+ normalized = JSON.parse(JSON.stringify(schema));
1296
+ } catch {
1297
+ throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas");
1298
+ }
1299
+ const version = detectVersion(normalized, params?.defaultTarget);
1300
+ const defs = normalized.$defs || normalized.definitions || {};
1301
+ const ctx = {
1302
+ version,
1303
+ defs,
1304
+ refs: new Map,
1305
+ processing: new Set,
1306
+ rootSchema: normalized,
1307
+ registry: params?.registry ?? globalRegistry
1308
+ };
1309
+ return convertSchema(normalized, ctx);
1310
+ }
1311
+ // ../../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/visit.js
1312
+ var RESOLVING = Symbol("z.visit/resolving");
1313
+ function visit(schema, fnOrHandlers) {
1314
+ const fn = typeof fnOrHandlers === "function" ? fnOrHandlers : (node, rewritten) => {
1315
+ const h = fnOrHandlers[node._zod.def.type];
1316
+ return h ? h(node, rewritten) : node;
1317
+ };
1318
+ const cache = new Map;
1319
+ function run(s) {
1320
+ const cached = cache.get(s);
1321
+ if (cached === RESOLVING) {
1322
+ return new $ZodLazy({
1323
+ type: "lazy",
1324
+ getter: () => cache.get(s)
1325
+ });
1326
+ }
1327
+ if (cached !== undefined)
1328
+ return cached;
1329
+ cache.set(s, RESOLVING);
1330
+ const inner = mapInner(s);
1331
+ const mapped = fn(inner, inner !== s);
1332
+ cache.set(s, mapped);
1333
+ return mapped;
1334
+ }
1335
+ function mapInner(s) {
1336
+ const def = s._zod.def;
1337
+ const kind = def.type;
1338
+ switch (kind) {
1339
+ case "object": {
1340
+ const oldShape = def.shape;
1341
+ const keys = Object.keys(oldShape);
1342
+ let changed = false;
1343
+ const newShape = {};
1344
+ for (const k of keys) {
1345
+ const mapped = run(oldShape[k]);
1346
+ if (mapped !== oldShape[k])
1347
+ changed = true;
1348
+ newShape[k] = mapped;
1349
+ }
1350
+ let newCatchall = def.catchall;
1351
+ if (def.catchall) {
1352
+ newCatchall = run(def.catchall);
1353
+ if (newCatchall !== def.catchall)
1354
+ changed = true;
1355
+ }
1356
+ return changed ? clone(s, { ...def, shape: newShape, catchall: newCatchall }) : s;
1357
+ }
1358
+ case "array": {
1359
+ const mapped = run(def.element);
1360
+ return mapped === def.element ? s : clone(s, { ...def, element: mapped });
1361
+ }
1362
+ case "tuple": {
1363
+ const oldItems = def.items;
1364
+ let changed = false;
1365
+ const newItems = [];
1366
+ for (const item of oldItems) {
1367
+ const mapped = run(item);
1368
+ if (mapped !== item)
1369
+ changed = true;
1370
+ newItems.push(mapped);
1371
+ }
1372
+ let newRest = def.rest;
1373
+ if (def.rest) {
1374
+ newRest = run(def.rest);
1375
+ if (newRest !== def.rest)
1376
+ changed = true;
1377
+ }
1378
+ return changed ? clone(s, { ...def, items: newItems, rest: newRest }) : s;
1379
+ }
1380
+ case "record":
1381
+ case "map": {
1382
+ const newKey = run(def.keyType);
1383
+ const newVal = run(def.valueType);
1384
+ return newKey === def.keyType && newVal === def.valueType ? s : clone(s, { ...def, keyType: newKey, valueType: newVal });
1385
+ }
1386
+ case "set": {
1387
+ const newVal = run(def.valueType);
1388
+ return newVal === def.valueType ? s : clone(s, { ...def, valueType: newVal });
1389
+ }
1390
+ case "union": {
1391
+ const oldOptions = def.options;
1392
+ let changed = false;
1393
+ const newOptions = [];
1394
+ for (const opt of oldOptions) {
1395
+ const mapped = run(opt);
1396
+ if (mapped !== opt)
1397
+ changed = true;
1398
+ newOptions.push(mapped);
1399
+ }
1400
+ return changed ? clone(s, { ...def, options: newOptions }) : s;
1401
+ }
1402
+ case "intersection": {
1403
+ const newLeft = run(def.left);
1404
+ const newRight = run(def.right);
1405
+ return newLeft === def.left && newRight === def.right ? s : clone(s, { ...def, left: newLeft, right: newRight });
1406
+ }
1407
+ case "optional":
1408
+ case "nullable":
1409
+ case "default":
1410
+ case "prefault":
1411
+ case "catch":
1412
+ case "readonly":
1413
+ case "nonoptional":
1414
+ case "promise":
1415
+ case "success": {
1416
+ const newInner = run(def.innerType);
1417
+ return newInner === def.innerType ? s : clone(s, { ...def, innerType: newInner });
1418
+ }
1419
+ case "pipe": {
1420
+ const newIn = run(def.in);
1421
+ const newOut = run(def.out);
1422
+ return newIn === def.in && newOut === def.out ? s : clone(s, { ...def, in: newIn, out: newOut });
1423
+ }
1424
+ case "function": {
1425
+ const newInput = run(def.input);
1426
+ const newOutput = run(def.output);
1427
+ return newInput === def.input && newOutput === def.output ? s : clone(s, { ...def, input: newInput, output: newOutput });
1428
+ }
1429
+ case "lazy": {
1430
+ const original = def.getter;
1431
+ const { _cachedInner, ...rest } = def;
1432
+ return clone(s, { ...rest, getter: () => run(original()) });
1433
+ }
1434
+ case "template_literal":
1435
+ case "string":
1436
+ case "number":
1437
+ case "int":
1438
+ case "boolean":
1439
+ case "bigint":
1440
+ case "symbol":
1441
+ case "undefined":
1442
+ case "null":
1443
+ case "void":
1444
+ case "never":
1445
+ case "any":
1446
+ case "unknown":
1447
+ case "date":
1448
+ case "nan":
1449
+ case "enum":
1450
+ case "literal":
1451
+ case "file":
1452
+ case "transform":
1453
+ case "custom":
1454
+ return s;
1455
+ default: {
1456
+ return s;
1457
+ }
1458
+ }
1459
+ }
1460
+ return run(schema);
1461
+ }
1462
+
1463
+ // ../../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/classic/deep-partial.js
1464
+ function deepPartial(schema) {
1465
+ return visit(schema, {
1466
+ object: (s) => s.partial(),
1467
+ union: (s) => {
1468
+ const def = s._zod.def;
1469
+ return def.discriminator === undefined ? s : union(def.options);
1470
+ }
1471
+ });
1472
+ }
1473
+ // ../../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/classic/in-out.js
1474
+ function withChecks(side, checks) {
1475
+ if (!checks?.length)
1476
+ return side;
1477
+ const def = side._zod.def;
1478
+ return clone(side, mergeDefs(def, { checks: [...def.checks ?? [], ...checks] }), { parent: true });
1479
+ }
1480
+ function outSide(def) {
1481
+ return withChecks(def.out, def.checks);
1482
+ }
1483
+ function inSide(def) {
1484
+ return def.in._zod.traits.has("$ZodTransform") ? outSide(def) : def.in;
1485
+ }
1486
+ function input(schema) {
1487
+ return visit(schema, {
1488
+ pipe: (s) => inSide(s._zod.def),
1489
+ default: (s, rewritten) => rewritten ? optional(s._zod.def.innerType) : s,
1490
+ catch: (s, rewritten) => rewritten ? s._zod.def.innerType : s
1491
+ });
1492
+ }
1493
+ function output(schema) {
1494
+ return visit(schema, {
1495
+ pipe: (s) => outSide(s._zod.def),
1496
+ prefault: (s, rewritten) => rewritten ? s._zod.def.innerType : s
1497
+ });
1498
+ }
1499
+ // ../../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/classic/coerce.js
1500
+ function string2(params) {
1501
+ return _coercedString(ZodString, params);
1502
+ }
1503
+ function number2(params) {
1504
+ return _coercedNumber(ZodNumber, params);
1505
+ }
1506
+ function boolean2(params) {
1507
+ return _coercedBoolean(ZodBoolean, params);
1508
+ }
1509
+ function bigint2(params) {
1510
+ return _coercedBigint(ZodBigInt, params);
1511
+ }
1512
+ function date3(params) {
1513
+ return _coercedDate(ZodDate, params);
1514
+ }
1515
+ export { ZodIssueCode, setErrorMap, getErrorMap, ZodFirstPartyTypeKind, exports_iso, fromJSONSchema, deepPartial, input, output, exports_coerce, exports_external };