@jeffreyjyz/opencode-command-code 0.2.9 → 0.2.11

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.js CHANGED
@@ -1,7 +1,2416 @@
1
1
  // @bun
2
- // src/index.ts
3
- import { tool } from "@opencode-ai/plugin";
2
+ // node_modules/zod/v4/core/core.js
3
+ var NEVER = Object.freeze({
4
+ status: "aborted"
5
+ });
6
+ function $constructor(name, initializer, params) {
7
+ function init(inst, def) {
8
+ var _a;
9
+ Object.defineProperty(inst, "_zod", {
10
+ value: inst._zod ?? {},
11
+ enumerable: false
12
+ });
13
+ (_a = inst._zod).traits ?? (_a.traits = new Set);
14
+ inst._zod.traits.add(name);
15
+ initializer(inst, def);
16
+ for (const k in _.prototype) {
17
+ if (!(k in inst))
18
+ Object.defineProperty(inst, k, { value: _.prototype[k].bind(inst) });
19
+ }
20
+ inst._zod.constr = _;
21
+ inst._zod.def = def;
22
+ }
23
+ const Parent = params?.Parent ?? Object;
24
+
25
+ class Definition extends Parent {
26
+ }
27
+ Object.defineProperty(Definition, "name", { value: name });
28
+ function _(def) {
29
+ var _a;
30
+ const inst = params?.Parent ? new Definition : this;
31
+ init(inst, def);
32
+ (_a = inst._zod).deferred ?? (_a.deferred = []);
33
+ for (const fn of inst._zod.deferred) {
34
+ fn();
35
+ }
36
+ return inst;
37
+ }
38
+ Object.defineProperty(_, "init", { value: init });
39
+ Object.defineProperty(_, Symbol.hasInstance, {
40
+ value: (inst) => {
41
+ if (params?.Parent && inst instanceof params.Parent)
42
+ return true;
43
+ return inst?._zod?.traits?.has(name);
44
+ }
45
+ });
46
+ Object.defineProperty(_, "name", { value: name });
47
+ return _;
48
+ }
49
+ var $brand = Symbol("zod_brand");
50
+
51
+ class $ZodAsyncError extends Error {
52
+ constructor() {
53
+ super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
54
+ }
55
+ }
56
+
57
+ class $ZodEncodeError extends Error {
58
+ constructor(name) {
59
+ super(`Encountered unidirectional transform during encode: ${name}`);
60
+ this.name = "ZodEncodeError";
61
+ }
62
+ }
63
+ var globalConfig = {};
64
+ function config(newConfig) {
65
+ if (newConfig)
66
+ Object.assign(globalConfig, newConfig);
67
+ return globalConfig;
68
+ }
69
+ // node_modules/zod/v4/core/util.js
70
+ function jsonStringifyReplacer(_, value) {
71
+ if (typeof value === "bigint")
72
+ return value.toString();
73
+ return value;
74
+ }
75
+ function cached(getter) {
76
+ const set = false;
77
+ return {
78
+ get value() {
79
+ if (!set) {
80
+ const value = getter();
81
+ Object.defineProperty(this, "value", { value });
82
+ return value;
83
+ }
84
+ throw new Error("cached value already set");
85
+ }
86
+ };
87
+ }
88
+ function nullish(input) {
89
+ return input === null || input === undefined;
90
+ }
91
+ function cleanRegex(source) {
92
+ const start = source.startsWith("^") ? 1 : 0;
93
+ const end = source.endsWith("$") ? source.length - 1 : source.length;
94
+ return source.slice(start, end);
95
+ }
96
+ var EVALUATING = Symbol("evaluating");
97
+ function defineLazy(object, key, getter) {
98
+ let value = undefined;
99
+ Object.defineProperty(object, key, {
100
+ get() {
101
+ if (value === EVALUATING) {
102
+ return;
103
+ }
104
+ if (value === undefined) {
105
+ value = EVALUATING;
106
+ value = getter();
107
+ }
108
+ return value;
109
+ },
110
+ set(v) {
111
+ Object.defineProperty(object, key, {
112
+ value: v
113
+ });
114
+ },
115
+ configurable: true
116
+ });
117
+ }
118
+ var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {};
119
+ function isObject(data) {
120
+ return typeof data === "object" && data !== null && !Array.isArray(data);
121
+ }
122
+ var allowsEval = cached(() => {
123
+ if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
124
+ return false;
125
+ }
126
+ try {
127
+ const F = Function;
128
+ new F("");
129
+ return true;
130
+ } catch (_) {
131
+ return false;
132
+ }
133
+ });
134
+ function isPlainObject(o) {
135
+ if (isObject(o) === false)
136
+ return false;
137
+ const ctor = o.constructor;
138
+ if (ctor === undefined)
139
+ return true;
140
+ const prot = ctor.prototype;
141
+ if (isObject(prot) === false)
142
+ return false;
143
+ if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) {
144
+ return false;
145
+ }
146
+ return true;
147
+ }
148
+ function shallowClone(o) {
149
+ if (isPlainObject(o))
150
+ return { ...o };
151
+ if (Array.isArray(o))
152
+ return [...o];
153
+ return o;
154
+ }
155
+ var propertyKeyTypes = new Set(["string", "number", "symbol"]);
156
+ var primitiveTypes = new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]);
157
+ function escapeRegex(str) {
158
+ return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
159
+ }
160
+ function clone(inst, def, params) {
161
+ const cl = new inst._zod.constr(def ?? inst._zod.def);
162
+ if (!def || params?.parent)
163
+ cl._zod.parent = inst;
164
+ return cl;
165
+ }
166
+ function normalizeParams(_params) {
167
+ const params = _params;
168
+ if (!params)
169
+ return {};
170
+ if (typeof params === "string")
171
+ return { error: () => params };
172
+ if (params?.message !== undefined) {
173
+ if (params?.error !== undefined)
174
+ throw new Error("Cannot specify both `message` and `error` params");
175
+ params.error = params.message;
176
+ }
177
+ delete params.message;
178
+ if (typeof params.error === "string")
179
+ return { ...params, error: () => params.error };
180
+ return params;
181
+ }
182
+ var NUMBER_FORMAT_RANGES = {
183
+ safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
184
+ int32: [-2147483648, 2147483647],
185
+ uint32: [0, 4294967295],
186
+ float32: [-340282346638528860000000000000000000000, 340282346638528860000000000000000000000],
187
+ float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
188
+ };
189
+ function aborted(x, startIndex = 0) {
190
+ if (x.aborted === true)
191
+ return true;
192
+ for (let i = startIndex;i < x.issues.length; i++) {
193
+ if (x.issues[i]?.continue !== true) {
194
+ return true;
195
+ }
196
+ }
197
+ return false;
198
+ }
199
+ function prefixIssues(path, issues) {
200
+ return issues.map((iss) => {
201
+ var _a;
202
+ (_a = iss).path ?? (_a.path = []);
203
+ iss.path.unshift(path);
204
+ return iss;
205
+ });
206
+ }
207
+ function unwrapMessage(message) {
208
+ return typeof message === "string" ? message : message?.message;
209
+ }
210
+ function finalizeIssue(iss, ctx, config) {
211
+ const full = { ...iss, path: iss.path ?? [] };
212
+ if (!iss.message) {
213
+ const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input";
214
+ full.message = message;
215
+ }
216
+ delete full.inst;
217
+ delete full.continue;
218
+ if (!ctx?.reportInput) {
219
+ delete full.input;
220
+ }
221
+ return full;
222
+ }
223
+ function getLengthableOrigin(input) {
224
+ if (Array.isArray(input))
225
+ return "array";
226
+ if (typeof input === "string")
227
+ return "string";
228
+ return "unknown";
229
+ }
230
+ function issue(...args) {
231
+ const [iss, input, inst] = args;
232
+ if (typeof iss === "string") {
233
+ return {
234
+ message: iss,
235
+ code: "custom",
236
+ input,
237
+ inst
238
+ };
239
+ }
240
+ return { ...iss };
241
+ }
242
+
243
+ // node_modules/zod/v4/core/errors.js
244
+ var initializer = (inst, def) => {
245
+ inst.name = "$ZodError";
246
+ Object.defineProperty(inst, "_zod", {
247
+ value: inst._zod,
248
+ enumerable: false
249
+ });
250
+ Object.defineProperty(inst, "issues", {
251
+ value: def,
252
+ enumerable: false
253
+ });
254
+ inst.message = JSON.stringify(def, jsonStringifyReplacer, 2);
255
+ Object.defineProperty(inst, "toString", {
256
+ value: () => inst.message,
257
+ enumerable: false
258
+ });
259
+ };
260
+ var $ZodError = $constructor("$ZodError", initializer);
261
+ var $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error });
262
+ function flattenError(error, mapper = (issue) => issue.message) {
263
+ const fieldErrors = {};
264
+ const formErrors = [];
265
+ for (const sub of error.issues) {
266
+ if (sub.path.length > 0) {
267
+ fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
268
+ fieldErrors[sub.path[0]].push(mapper(sub));
269
+ } else {
270
+ formErrors.push(mapper(sub));
271
+ }
272
+ }
273
+ return { formErrors, fieldErrors };
274
+ }
275
+ function formatError(error, _mapper) {
276
+ const mapper = _mapper || function(issue) {
277
+ return issue.message;
278
+ };
279
+ const fieldErrors = { _errors: [] };
280
+ const processError = (error) => {
281
+ for (const issue of error.issues) {
282
+ if (issue.code === "invalid_union" && issue.errors.length) {
283
+ issue.errors.map((issues) => processError({ issues }));
284
+ } else if (issue.code === "invalid_key") {
285
+ processError({ issues: issue.issues });
286
+ } else if (issue.code === "invalid_element") {
287
+ processError({ issues: issue.issues });
288
+ } else if (issue.path.length === 0) {
289
+ fieldErrors._errors.push(mapper(issue));
290
+ } else {
291
+ let curr = fieldErrors;
292
+ let i = 0;
293
+ while (i < issue.path.length) {
294
+ const el = issue.path[i];
295
+ const terminal = i === issue.path.length - 1;
296
+ if (!terminal) {
297
+ curr[el] = curr[el] || { _errors: [] };
298
+ } else {
299
+ curr[el] = curr[el] || { _errors: [] };
300
+ curr[el]._errors.push(mapper(issue));
301
+ }
302
+ curr = curr[el];
303
+ i++;
304
+ }
305
+ }
306
+ }
307
+ };
308
+ processError(error);
309
+ return fieldErrors;
310
+ }
311
+
312
+ // node_modules/zod/v4/core/parse.js
313
+ var _parse = (_Err) => (schema, value, _ctx, _params) => {
314
+ const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
315
+ const result = schema._zod.run({ value, issues: [] }, ctx);
316
+ if (result instanceof Promise) {
317
+ throw new $ZodAsyncError;
318
+ }
319
+ if (result.issues.length) {
320
+ const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
321
+ captureStackTrace(e, _params?.callee);
322
+ throw e;
323
+ }
324
+ return result.value;
325
+ };
326
+ var _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
327
+ const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
328
+ let result = schema._zod.run({ value, issues: [] }, ctx);
329
+ if (result instanceof Promise)
330
+ result = await result;
331
+ if (result.issues.length) {
332
+ const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
333
+ captureStackTrace(e, params?.callee);
334
+ throw e;
335
+ }
336
+ return result.value;
337
+ };
338
+ var _safeParse = (_Err) => (schema, value, _ctx) => {
339
+ const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
340
+ const result = schema._zod.run({ value, issues: [] }, ctx);
341
+ if (result instanceof Promise) {
342
+ throw new $ZodAsyncError;
343
+ }
344
+ return result.issues.length ? {
345
+ success: false,
346
+ error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
347
+ } : { success: true, data: result.value };
348
+ };
349
+ var safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
350
+ var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
351
+ const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
352
+ let result = schema._zod.run({ value, issues: [] }, ctx);
353
+ if (result instanceof Promise)
354
+ result = await result;
355
+ return result.issues.length ? {
356
+ success: false,
357
+ error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
358
+ } : { success: true, data: result.value };
359
+ };
360
+ var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
361
+ var _encode = (_Err) => (schema, value, _ctx) => {
362
+ const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
363
+ return _parse(_Err)(schema, value, ctx);
364
+ };
365
+ var _decode = (_Err) => (schema, value, _ctx) => {
366
+ return _parse(_Err)(schema, value, _ctx);
367
+ };
368
+ var _encodeAsync = (_Err) => async (schema, value, _ctx) => {
369
+ const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
370
+ return _parseAsync(_Err)(schema, value, ctx);
371
+ };
372
+ var _decodeAsync = (_Err) => async (schema, value, _ctx) => {
373
+ return _parseAsync(_Err)(schema, value, _ctx);
374
+ };
375
+ var _safeEncode = (_Err) => (schema, value, _ctx) => {
376
+ const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
377
+ return _safeParse(_Err)(schema, value, ctx);
378
+ };
379
+ var _safeDecode = (_Err) => (schema, value, _ctx) => {
380
+ return _safeParse(_Err)(schema, value, _ctx);
381
+ };
382
+ var _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
383
+ const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
384
+ return _safeParseAsync(_Err)(schema, value, ctx);
385
+ };
386
+ var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
387
+ return _safeParseAsync(_Err)(schema, value, _ctx);
388
+ };
389
+ // node_modules/zod/v4/core/regexes.js
390
+ var cuid = /^[cC][^\s-]{8,}$/;
391
+ var cuid2 = /^[0-9a-z]+$/;
392
+ var ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
393
+ var xid = /^[0-9a-vA-V]{20}$/;
394
+ var ksuid = /^[A-Za-z0-9]{27}$/;
395
+ var nanoid = /^[a-zA-Z0-9_-]{21}$/;
396
+ var duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
397
+ var guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
398
+ var uuid = (version) => {
399
+ if (!version)
400
+ return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;
401
+ return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
402
+ };
403
+ var email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
404
+ var _emoji = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
405
+ function emoji() {
406
+ return new RegExp(_emoji, "u");
407
+ }
408
+ var ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
409
+ var ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;
410
+ var cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
411
+ var cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
412
+ var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
413
+ var base64url = /^[A-Za-z0-9_-]*$/;
414
+ var hostname = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;
415
+ var e164 = /^\+(?:[0-9]){6,14}[0-9]$/;
416
+ var dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
417
+ var date = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
418
+ function timeSource(args) {
419
+ const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
420
+ const regex = typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
421
+ return regex;
422
+ }
423
+ function time(args) {
424
+ return new RegExp(`^${timeSource(args)}$`);
425
+ }
426
+ function datetime(args) {
427
+ const time = timeSource({ precision: args.precision });
428
+ const opts = ["Z"];
429
+ if (args.local)
430
+ opts.push("");
431
+ if (args.offset)
432
+ opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
433
+ const timeRegex = `${time}(?:${opts.join("|")})`;
434
+ return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
435
+ }
436
+ var string = (params) => {
437
+ const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
438
+ return new RegExp(`^${regex}$`);
439
+ };
440
+ var lowercase = /^[^A-Z]*$/;
441
+ var uppercase = /^[^a-z]*$/;
442
+
443
+ // node_modules/zod/v4/core/checks.js
444
+ var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
445
+ var _a;
446
+ inst._zod ?? (inst._zod = {});
447
+ inst._zod.def = def;
448
+ (_a = inst._zod).onattach ?? (_a.onattach = []);
449
+ });
450
+ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
451
+ var _a;
452
+ $ZodCheck.init(inst, def);
453
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
454
+ const val = payload.value;
455
+ return !nullish(val) && val.length !== undefined;
456
+ });
457
+ inst._zod.onattach.push((inst) => {
458
+ const curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
459
+ if (def.maximum < curr)
460
+ inst._zod.bag.maximum = def.maximum;
461
+ });
462
+ inst._zod.check = (payload) => {
463
+ const input = payload.value;
464
+ const length = input.length;
465
+ if (length <= def.maximum)
466
+ return;
467
+ const origin = getLengthableOrigin(input);
468
+ payload.issues.push({
469
+ origin,
470
+ code: "too_big",
471
+ maximum: def.maximum,
472
+ inclusive: true,
473
+ input,
474
+ inst,
475
+ continue: !def.abort
476
+ });
477
+ };
478
+ });
479
+ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
480
+ var _a;
481
+ $ZodCheck.init(inst, def);
482
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
483
+ const val = payload.value;
484
+ return !nullish(val) && val.length !== undefined;
485
+ });
486
+ inst._zod.onattach.push((inst) => {
487
+ const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
488
+ if (def.minimum > curr)
489
+ inst._zod.bag.minimum = def.minimum;
490
+ });
491
+ inst._zod.check = (payload) => {
492
+ const input = payload.value;
493
+ const length = input.length;
494
+ if (length >= def.minimum)
495
+ return;
496
+ const origin = getLengthableOrigin(input);
497
+ payload.issues.push({
498
+ origin,
499
+ code: "too_small",
500
+ minimum: def.minimum,
501
+ inclusive: true,
502
+ input,
503
+ inst,
504
+ continue: !def.abort
505
+ });
506
+ };
507
+ });
508
+ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
509
+ var _a;
510
+ $ZodCheck.init(inst, def);
511
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
512
+ const val = payload.value;
513
+ return !nullish(val) && val.length !== undefined;
514
+ });
515
+ inst._zod.onattach.push((inst) => {
516
+ const bag = inst._zod.bag;
517
+ bag.minimum = def.length;
518
+ bag.maximum = def.length;
519
+ bag.length = def.length;
520
+ });
521
+ inst._zod.check = (payload) => {
522
+ const input = payload.value;
523
+ const length = input.length;
524
+ if (length === def.length)
525
+ return;
526
+ const origin = getLengthableOrigin(input);
527
+ const tooBig = length > def.length;
528
+ payload.issues.push({
529
+ origin,
530
+ ...tooBig ? { code: "too_big", maximum: def.length } : { code: "too_small", minimum: def.length },
531
+ inclusive: true,
532
+ exact: true,
533
+ input: payload.value,
534
+ inst,
535
+ continue: !def.abort
536
+ });
537
+ };
538
+ });
539
+ var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
540
+ var _a, _b;
541
+ $ZodCheck.init(inst, def);
542
+ inst._zod.onattach.push((inst) => {
543
+ const bag = inst._zod.bag;
544
+ bag.format = def.format;
545
+ if (def.pattern) {
546
+ bag.patterns ?? (bag.patterns = new Set);
547
+ bag.patterns.add(def.pattern);
548
+ }
549
+ });
550
+ if (def.pattern)
551
+ (_a = inst._zod).check ?? (_a.check = (payload) => {
552
+ def.pattern.lastIndex = 0;
553
+ if (def.pattern.test(payload.value))
554
+ return;
555
+ payload.issues.push({
556
+ origin: "string",
557
+ code: "invalid_format",
558
+ format: def.format,
559
+ input: payload.value,
560
+ ...def.pattern ? { pattern: def.pattern.toString() } : {},
561
+ inst,
562
+ continue: !def.abort
563
+ });
564
+ });
565
+ else
566
+ (_b = inst._zod).check ?? (_b.check = () => {});
567
+ });
568
+ var $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def) => {
569
+ $ZodCheckStringFormat.init(inst, def);
570
+ inst._zod.check = (payload) => {
571
+ def.pattern.lastIndex = 0;
572
+ if (def.pattern.test(payload.value))
573
+ return;
574
+ payload.issues.push({
575
+ origin: "string",
576
+ code: "invalid_format",
577
+ format: "regex",
578
+ input: payload.value,
579
+ pattern: def.pattern.toString(),
580
+ inst,
581
+ continue: !def.abort
582
+ });
583
+ };
584
+ });
585
+ var $ZodCheckLowerCase = /* @__PURE__ */ $constructor("$ZodCheckLowerCase", (inst, def) => {
586
+ def.pattern ?? (def.pattern = lowercase);
587
+ $ZodCheckStringFormat.init(inst, def);
588
+ });
589
+ var $ZodCheckUpperCase = /* @__PURE__ */ $constructor("$ZodCheckUpperCase", (inst, def) => {
590
+ def.pattern ?? (def.pattern = uppercase);
591
+ $ZodCheckStringFormat.init(inst, def);
592
+ });
593
+ var $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst, def) => {
594
+ $ZodCheck.init(inst, def);
595
+ const escapedRegex = escapeRegex(def.includes);
596
+ const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);
597
+ def.pattern = pattern;
598
+ inst._zod.onattach.push((inst) => {
599
+ const bag = inst._zod.bag;
600
+ bag.patterns ?? (bag.patterns = new Set);
601
+ bag.patterns.add(pattern);
602
+ });
603
+ inst._zod.check = (payload) => {
604
+ if (payload.value.includes(def.includes, def.position))
605
+ return;
606
+ payload.issues.push({
607
+ origin: "string",
608
+ code: "invalid_format",
609
+ format: "includes",
610
+ includes: def.includes,
611
+ input: payload.value,
612
+ inst,
613
+ continue: !def.abort
614
+ });
615
+ };
616
+ });
617
+ var $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (inst, def) => {
618
+ $ZodCheck.init(inst, def);
619
+ const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
620
+ def.pattern ?? (def.pattern = pattern);
621
+ inst._zod.onattach.push((inst) => {
622
+ const bag = inst._zod.bag;
623
+ bag.patterns ?? (bag.patterns = new Set);
624
+ bag.patterns.add(pattern);
625
+ });
626
+ inst._zod.check = (payload) => {
627
+ if (payload.value.startsWith(def.prefix))
628
+ return;
629
+ payload.issues.push({
630
+ origin: "string",
631
+ code: "invalid_format",
632
+ format: "starts_with",
633
+ prefix: def.prefix,
634
+ input: payload.value,
635
+ inst,
636
+ continue: !def.abort
637
+ });
638
+ };
639
+ });
640
+ var $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst, def) => {
641
+ $ZodCheck.init(inst, def);
642
+ const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
643
+ def.pattern ?? (def.pattern = pattern);
644
+ inst._zod.onattach.push((inst) => {
645
+ const bag = inst._zod.bag;
646
+ bag.patterns ?? (bag.patterns = new Set);
647
+ bag.patterns.add(pattern);
648
+ });
649
+ inst._zod.check = (payload) => {
650
+ if (payload.value.endsWith(def.suffix))
651
+ return;
652
+ payload.issues.push({
653
+ origin: "string",
654
+ code: "invalid_format",
655
+ format: "ends_with",
656
+ suffix: def.suffix,
657
+ input: payload.value,
658
+ inst,
659
+ continue: !def.abort
660
+ });
661
+ };
662
+ });
663
+ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (inst, def) => {
664
+ $ZodCheck.init(inst, def);
665
+ inst._zod.check = (payload) => {
666
+ payload.value = def.tx(payload.value);
667
+ };
668
+ });
669
+
670
+ // node_modules/zod/v4/core/versions.js
671
+ var version = {
672
+ major: 4,
673
+ minor: 1,
674
+ patch: 8
675
+ };
676
+
677
+ // node_modules/zod/v4/core/schemas.js
678
+ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
679
+ var _a;
680
+ inst ?? (inst = {});
681
+ inst._zod.def = def;
682
+ inst._zod.bag = inst._zod.bag || {};
683
+ inst._zod.version = version;
684
+ const checks = [...inst._zod.def.checks ?? []];
685
+ if (inst._zod.traits.has("$ZodCheck")) {
686
+ checks.unshift(inst);
687
+ }
688
+ for (const ch of checks) {
689
+ for (const fn of ch._zod.onattach) {
690
+ fn(inst);
691
+ }
692
+ }
693
+ if (checks.length === 0) {
694
+ (_a = inst._zod).deferred ?? (_a.deferred = []);
695
+ inst._zod.deferred?.push(() => {
696
+ inst._zod.run = inst._zod.parse;
697
+ });
698
+ } else {
699
+ const runChecks = (payload, checks, ctx) => {
700
+ let isAborted = aborted(payload);
701
+ let asyncResult;
702
+ for (const ch of checks) {
703
+ if (ch._zod.def.when) {
704
+ const shouldRun = ch._zod.def.when(payload);
705
+ if (!shouldRun)
706
+ continue;
707
+ } else if (isAborted) {
708
+ continue;
709
+ }
710
+ const currLen = payload.issues.length;
711
+ const _ = ch._zod.check(payload);
712
+ if (_ instanceof Promise && ctx?.async === false) {
713
+ throw new $ZodAsyncError;
714
+ }
715
+ if (asyncResult || _ instanceof Promise) {
716
+ asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
717
+ await _;
718
+ const nextLen = payload.issues.length;
719
+ if (nextLen === currLen)
720
+ return;
721
+ if (!isAborted)
722
+ isAborted = aborted(payload, currLen);
723
+ });
724
+ } else {
725
+ const nextLen = payload.issues.length;
726
+ if (nextLen === currLen)
727
+ continue;
728
+ if (!isAborted)
729
+ isAborted = aborted(payload, currLen);
730
+ }
731
+ }
732
+ if (asyncResult) {
733
+ return asyncResult.then(() => {
734
+ return payload;
735
+ });
736
+ }
737
+ return payload;
738
+ };
739
+ const handleCanaryResult = (canary, payload, ctx) => {
740
+ if (aborted(canary)) {
741
+ canary.aborted = true;
742
+ return canary;
743
+ }
744
+ const checkResult = runChecks(payload, checks, ctx);
745
+ if (checkResult instanceof Promise) {
746
+ if (ctx.async === false)
747
+ throw new $ZodAsyncError;
748
+ return checkResult.then((checkResult) => inst._zod.parse(checkResult, ctx));
749
+ }
750
+ return inst._zod.parse(checkResult, ctx);
751
+ };
752
+ inst._zod.run = (payload, ctx) => {
753
+ if (ctx.skipChecks) {
754
+ return inst._zod.parse(payload, ctx);
755
+ }
756
+ if (ctx.direction === "backward") {
757
+ const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true });
758
+ if (canary instanceof Promise) {
759
+ return canary.then((canary) => {
760
+ return handleCanaryResult(canary, payload, ctx);
761
+ });
762
+ }
763
+ return handleCanaryResult(canary, payload, ctx);
764
+ }
765
+ const result = inst._zod.parse(payload, ctx);
766
+ if (result instanceof Promise) {
767
+ if (ctx.async === false)
768
+ throw new $ZodAsyncError;
769
+ return result.then((result) => runChecks(result, checks, ctx));
770
+ }
771
+ return runChecks(result, checks, ctx);
772
+ };
773
+ }
774
+ inst["~standard"] = {
775
+ validate: (value) => {
776
+ try {
777
+ const r = safeParse(inst, value);
778
+ return r.success ? { value: r.data } : { issues: r.error?.issues };
779
+ } catch (_) {
780
+ return safeParseAsync(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
781
+ }
782
+ },
783
+ vendor: "zod",
784
+ version: 1
785
+ };
786
+ });
787
+ var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
788
+ $ZodType.init(inst, def);
789
+ inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string(inst._zod.bag);
790
+ inst._zod.parse = (payload, _) => {
791
+ if (def.coerce)
792
+ try {
793
+ payload.value = String(payload.value);
794
+ } catch (_) {}
795
+ if (typeof payload.value === "string")
796
+ return payload;
797
+ payload.issues.push({
798
+ expected: "string",
799
+ code: "invalid_type",
800
+ input: payload.value,
801
+ inst
802
+ });
803
+ return payload;
804
+ };
805
+ });
806
+ var $ZodStringFormat = /* @__PURE__ */ $constructor("$ZodStringFormat", (inst, def) => {
807
+ $ZodCheckStringFormat.init(inst, def);
808
+ $ZodString.init(inst, def);
809
+ });
810
+ var $ZodGUID = /* @__PURE__ */ $constructor("$ZodGUID", (inst, def) => {
811
+ def.pattern ?? (def.pattern = guid);
812
+ $ZodStringFormat.init(inst, def);
813
+ });
814
+ var $ZodUUID = /* @__PURE__ */ $constructor("$ZodUUID", (inst, def) => {
815
+ if (def.version) {
816
+ const versionMap = {
817
+ v1: 1,
818
+ v2: 2,
819
+ v3: 3,
820
+ v4: 4,
821
+ v5: 5,
822
+ v6: 6,
823
+ v7: 7,
824
+ v8: 8
825
+ };
826
+ const v = versionMap[def.version];
827
+ if (v === undefined)
828
+ throw new Error(`Invalid UUID version: "${def.version}"`);
829
+ def.pattern ?? (def.pattern = uuid(v));
830
+ } else
831
+ def.pattern ?? (def.pattern = uuid());
832
+ $ZodStringFormat.init(inst, def);
833
+ });
834
+ var $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => {
835
+ def.pattern ?? (def.pattern = email);
836
+ $ZodStringFormat.init(inst, def);
837
+ });
838
+ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
839
+ $ZodStringFormat.init(inst, def);
840
+ inst._zod.check = (payload) => {
841
+ try {
842
+ const trimmed = payload.value.trim();
843
+ const url = new URL(trimmed);
844
+ if (def.hostname) {
845
+ def.hostname.lastIndex = 0;
846
+ if (!def.hostname.test(url.hostname)) {
847
+ payload.issues.push({
848
+ code: "invalid_format",
849
+ format: "url",
850
+ note: "Invalid hostname",
851
+ pattern: hostname.source,
852
+ input: payload.value,
853
+ inst,
854
+ continue: !def.abort
855
+ });
856
+ }
857
+ }
858
+ if (def.protocol) {
859
+ def.protocol.lastIndex = 0;
860
+ if (!def.protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol)) {
861
+ payload.issues.push({
862
+ code: "invalid_format",
863
+ format: "url",
864
+ note: "Invalid protocol",
865
+ pattern: def.protocol.source,
866
+ input: payload.value,
867
+ inst,
868
+ continue: !def.abort
869
+ });
870
+ }
871
+ }
872
+ if (def.normalize) {
873
+ payload.value = url.href;
874
+ } else {
875
+ payload.value = trimmed;
876
+ }
877
+ return;
878
+ } catch (_) {
879
+ payload.issues.push({
880
+ code: "invalid_format",
881
+ format: "url",
882
+ input: payload.value,
883
+ inst,
884
+ continue: !def.abort
885
+ });
886
+ }
887
+ };
888
+ });
889
+ var $ZodEmoji = /* @__PURE__ */ $constructor("$ZodEmoji", (inst, def) => {
890
+ def.pattern ?? (def.pattern = emoji());
891
+ $ZodStringFormat.init(inst, def);
892
+ });
893
+ var $ZodNanoID = /* @__PURE__ */ $constructor("$ZodNanoID", (inst, def) => {
894
+ def.pattern ?? (def.pattern = nanoid);
895
+ $ZodStringFormat.init(inst, def);
896
+ });
897
+ var $ZodCUID = /* @__PURE__ */ $constructor("$ZodCUID", (inst, def) => {
898
+ def.pattern ?? (def.pattern = cuid);
899
+ $ZodStringFormat.init(inst, def);
900
+ });
901
+ var $ZodCUID2 = /* @__PURE__ */ $constructor("$ZodCUID2", (inst, def) => {
902
+ def.pattern ?? (def.pattern = cuid2);
903
+ $ZodStringFormat.init(inst, def);
904
+ });
905
+ var $ZodULID = /* @__PURE__ */ $constructor("$ZodULID", (inst, def) => {
906
+ def.pattern ?? (def.pattern = ulid);
907
+ $ZodStringFormat.init(inst, def);
908
+ });
909
+ var $ZodXID = /* @__PURE__ */ $constructor("$ZodXID", (inst, def) => {
910
+ def.pattern ?? (def.pattern = xid);
911
+ $ZodStringFormat.init(inst, def);
912
+ });
913
+ var $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => {
914
+ def.pattern ?? (def.pattern = ksuid);
915
+ $ZodStringFormat.init(inst, def);
916
+ });
917
+ var $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => {
918
+ def.pattern ?? (def.pattern = datetime(def));
919
+ $ZodStringFormat.init(inst, def);
920
+ });
921
+ var $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => {
922
+ def.pattern ?? (def.pattern = date);
923
+ $ZodStringFormat.init(inst, def);
924
+ });
925
+ var $ZodISOTime = /* @__PURE__ */ $constructor("$ZodISOTime", (inst, def) => {
926
+ def.pattern ?? (def.pattern = time(def));
927
+ $ZodStringFormat.init(inst, def);
928
+ });
929
+ var $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def) => {
930
+ def.pattern ?? (def.pattern = duration);
931
+ $ZodStringFormat.init(inst, def);
932
+ });
933
+ var $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => {
934
+ def.pattern ?? (def.pattern = ipv4);
935
+ $ZodStringFormat.init(inst, def);
936
+ inst._zod.onattach.push((inst) => {
937
+ const bag = inst._zod.bag;
938
+ bag.format = `ipv4`;
939
+ });
940
+ });
941
+ var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
942
+ def.pattern ?? (def.pattern = ipv6);
943
+ $ZodStringFormat.init(inst, def);
944
+ inst._zod.onattach.push((inst) => {
945
+ const bag = inst._zod.bag;
946
+ bag.format = `ipv6`;
947
+ });
948
+ inst._zod.check = (payload) => {
949
+ try {
950
+ new URL(`http://[${payload.value}]`);
951
+ } catch {
952
+ payload.issues.push({
953
+ code: "invalid_format",
954
+ format: "ipv6",
955
+ input: payload.value,
956
+ inst,
957
+ continue: !def.abort
958
+ });
959
+ }
960
+ };
961
+ });
962
+ var $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def) => {
963
+ def.pattern ?? (def.pattern = cidrv4);
964
+ $ZodStringFormat.init(inst, def);
965
+ });
966
+ var $ZodCIDRv6 = /* @__PURE__ */ $constructor("$ZodCIDRv6", (inst, def) => {
967
+ def.pattern ?? (def.pattern = cidrv6);
968
+ $ZodStringFormat.init(inst, def);
969
+ inst._zod.check = (payload) => {
970
+ const parts = payload.value.split("/");
971
+ try {
972
+ if (parts.length !== 2)
973
+ throw new Error;
974
+ const [address, prefix] = parts;
975
+ if (!prefix)
976
+ throw new Error;
977
+ const prefixNum = Number(prefix);
978
+ if (`${prefixNum}` !== prefix)
979
+ throw new Error;
980
+ if (prefixNum < 0 || prefixNum > 128)
981
+ throw new Error;
982
+ new URL(`http://[${address}]`);
983
+ } catch {
984
+ payload.issues.push({
985
+ code: "invalid_format",
986
+ format: "cidrv6",
987
+ input: payload.value,
988
+ inst,
989
+ continue: !def.abort
990
+ });
991
+ }
992
+ };
993
+ });
994
+ function isValidBase64(data) {
995
+ if (data === "")
996
+ return true;
997
+ if (data.length % 4 !== 0)
998
+ return false;
999
+ try {
1000
+ atob(data);
1001
+ return true;
1002
+ } catch {
1003
+ return false;
1004
+ }
1005
+ }
1006
+ var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
1007
+ def.pattern ?? (def.pattern = base64);
1008
+ $ZodStringFormat.init(inst, def);
1009
+ inst._zod.onattach.push((inst) => {
1010
+ inst._zod.bag.contentEncoding = "base64";
1011
+ });
1012
+ inst._zod.check = (payload) => {
1013
+ if (isValidBase64(payload.value))
1014
+ return;
1015
+ payload.issues.push({
1016
+ code: "invalid_format",
1017
+ format: "base64",
1018
+ input: payload.value,
1019
+ inst,
1020
+ continue: !def.abort
1021
+ });
1022
+ };
1023
+ });
1024
+ function isValidBase64URL(data) {
1025
+ if (!base64url.test(data))
1026
+ return false;
1027
+ const base64 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
1028
+ const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, "=");
1029
+ return isValidBase64(padded);
1030
+ }
1031
+ var $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
1032
+ def.pattern ?? (def.pattern = base64url);
1033
+ $ZodStringFormat.init(inst, def);
1034
+ inst._zod.onattach.push((inst) => {
1035
+ inst._zod.bag.contentEncoding = "base64url";
1036
+ });
1037
+ inst._zod.check = (payload) => {
1038
+ if (isValidBase64URL(payload.value))
1039
+ return;
1040
+ payload.issues.push({
1041
+ code: "invalid_format",
1042
+ format: "base64url",
1043
+ input: payload.value,
1044
+ inst,
1045
+ continue: !def.abort
1046
+ });
1047
+ };
1048
+ });
1049
+ var $ZodE164 = /* @__PURE__ */ $constructor("$ZodE164", (inst, def) => {
1050
+ def.pattern ?? (def.pattern = e164);
1051
+ $ZodStringFormat.init(inst, def);
1052
+ });
1053
+ function isValidJWT(token, algorithm = null) {
1054
+ try {
1055
+ const tokensParts = token.split(".");
1056
+ if (tokensParts.length !== 3)
1057
+ return false;
1058
+ const [header] = tokensParts;
1059
+ if (!header)
1060
+ return false;
1061
+ const parsedHeader = JSON.parse(atob(header));
1062
+ if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT")
1063
+ return false;
1064
+ if (!parsedHeader.alg)
1065
+ return false;
1066
+ if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm))
1067
+ return false;
1068
+ return true;
1069
+ } catch {
1070
+ return false;
1071
+ }
1072
+ }
1073
+ var $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => {
1074
+ $ZodStringFormat.init(inst, def);
1075
+ inst._zod.check = (payload) => {
1076
+ if (isValidJWT(payload.value, def.alg))
1077
+ return;
1078
+ payload.issues.push({
1079
+ code: "invalid_format",
1080
+ format: "jwt",
1081
+ input: payload.value,
1082
+ inst,
1083
+ continue: !def.abort
1084
+ });
1085
+ };
1086
+ });
1087
+ function handleArrayResult(result, final, index) {
1088
+ if (result.issues.length) {
1089
+ final.issues.push(...prefixIssues(index, result.issues));
1090
+ }
1091
+ final.value[index] = result.value;
1092
+ }
1093
+ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
1094
+ $ZodType.init(inst, def);
1095
+ inst._zod.parse = (payload, ctx) => {
1096
+ const input = payload.value;
1097
+ if (!Array.isArray(input)) {
1098
+ payload.issues.push({
1099
+ expected: "array",
1100
+ code: "invalid_type",
1101
+ input,
1102
+ inst
1103
+ });
1104
+ return payload;
1105
+ }
1106
+ payload.value = Array(input.length);
1107
+ const proms = [];
1108
+ for (let i = 0;i < input.length; i++) {
1109
+ const item = input[i];
1110
+ const result = def.element._zod.run({
1111
+ value: item,
1112
+ issues: []
1113
+ }, ctx);
1114
+ if (result instanceof Promise) {
1115
+ proms.push(result.then((result) => handleArrayResult(result, payload, i)));
1116
+ } else {
1117
+ handleArrayResult(result, payload, i);
1118
+ }
1119
+ }
1120
+ if (proms.length) {
1121
+ return Promise.all(proms).then(() => payload);
1122
+ }
1123
+ return payload;
1124
+ };
1125
+ });
1126
+ function handleUnionResults(results, final, inst, ctx) {
1127
+ for (const result of results) {
1128
+ if (result.issues.length === 0) {
1129
+ final.value = result.value;
1130
+ return final;
1131
+ }
1132
+ }
1133
+ const nonaborted = results.filter((r) => !aborted(r));
1134
+ if (nonaborted.length === 1) {
1135
+ final.value = nonaborted[0].value;
1136
+ return nonaborted[0];
1137
+ }
1138
+ final.issues.push({
1139
+ code: "invalid_union",
1140
+ input: final.value,
1141
+ inst,
1142
+ errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
1143
+ });
1144
+ return final;
1145
+ }
1146
+ var $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
1147
+ $ZodType.init(inst, def);
1148
+ defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : undefined);
1149
+ defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : undefined);
1150
+ defineLazy(inst._zod, "values", () => {
1151
+ if (def.options.every((o) => o._zod.values)) {
1152
+ return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
1153
+ }
1154
+ return;
1155
+ });
1156
+ defineLazy(inst._zod, "pattern", () => {
1157
+ if (def.options.every((o) => o._zod.pattern)) {
1158
+ const patterns = def.options.map((o) => o._zod.pattern);
1159
+ return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`);
1160
+ }
1161
+ return;
1162
+ });
1163
+ const single = def.options.length === 1;
1164
+ const first = def.options[0]._zod.run;
1165
+ inst._zod.parse = (payload, ctx) => {
1166
+ if (single) {
1167
+ return first(payload, ctx);
1168
+ }
1169
+ let async = false;
1170
+ const results = [];
1171
+ for (const option of def.options) {
1172
+ const result = option._zod.run({
1173
+ value: payload.value,
1174
+ issues: []
1175
+ }, ctx);
1176
+ if (result instanceof Promise) {
1177
+ results.push(result);
1178
+ async = true;
1179
+ } else {
1180
+ if (result.issues.length === 0)
1181
+ return result;
1182
+ results.push(result);
1183
+ }
1184
+ }
1185
+ if (!async)
1186
+ return handleUnionResults(results, payload, inst, ctx);
1187
+ return Promise.all(results).then((results) => {
1188
+ return handleUnionResults(results, payload, inst, ctx);
1189
+ });
1190
+ };
1191
+ });
1192
+ var $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => {
1193
+ $ZodType.init(inst, def);
1194
+ inst._zod.parse = (payload, ctx) => {
1195
+ const input = payload.value;
1196
+ const left = def.left._zod.run({ value: input, issues: [] }, ctx);
1197
+ const right = def.right._zod.run({ value: input, issues: [] }, ctx);
1198
+ const async = left instanceof Promise || right instanceof Promise;
1199
+ if (async) {
1200
+ return Promise.all([left, right]).then(([left, right]) => {
1201
+ return handleIntersectionResults(payload, left, right);
1202
+ });
1203
+ }
1204
+ return handleIntersectionResults(payload, left, right);
1205
+ };
1206
+ });
1207
+ function mergeValues(a, b) {
1208
+ if (a === b) {
1209
+ return { valid: true, data: a };
1210
+ }
1211
+ if (a instanceof Date && b instanceof Date && +a === +b) {
1212
+ return { valid: true, data: a };
1213
+ }
1214
+ if (isPlainObject(a) && isPlainObject(b)) {
1215
+ const bKeys = Object.keys(b);
1216
+ const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
1217
+ const newObj = { ...a, ...b };
1218
+ for (const key of sharedKeys) {
1219
+ const sharedValue = mergeValues(a[key], b[key]);
1220
+ if (!sharedValue.valid) {
1221
+ return {
1222
+ valid: false,
1223
+ mergeErrorPath: [key, ...sharedValue.mergeErrorPath]
1224
+ };
1225
+ }
1226
+ newObj[key] = sharedValue.data;
1227
+ }
1228
+ return { valid: true, data: newObj };
1229
+ }
1230
+ if (Array.isArray(a) && Array.isArray(b)) {
1231
+ if (a.length !== b.length) {
1232
+ return { valid: false, mergeErrorPath: [] };
1233
+ }
1234
+ const newArray = [];
1235
+ for (let index = 0;index < a.length; index++) {
1236
+ const itemA = a[index];
1237
+ const itemB = b[index];
1238
+ const sharedValue = mergeValues(itemA, itemB);
1239
+ if (!sharedValue.valid) {
1240
+ return {
1241
+ valid: false,
1242
+ mergeErrorPath: [index, ...sharedValue.mergeErrorPath]
1243
+ };
1244
+ }
1245
+ newArray.push(sharedValue.data);
1246
+ }
1247
+ return { valid: true, data: newArray };
1248
+ }
1249
+ return { valid: false, mergeErrorPath: [] };
1250
+ }
1251
+ function handleIntersectionResults(result, left, right) {
1252
+ if (left.issues.length) {
1253
+ result.issues.push(...left.issues);
1254
+ }
1255
+ if (right.issues.length) {
1256
+ result.issues.push(...right.issues);
1257
+ }
1258
+ if (aborted(result))
1259
+ return result;
1260
+ const merged = mergeValues(left.value, right.value);
1261
+ if (!merged.valid) {
1262
+ throw new Error(`Unmergable intersection. Error path: ` + `${JSON.stringify(merged.mergeErrorPath)}`);
1263
+ }
1264
+ result.value = merged.data;
1265
+ return result;
1266
+ }
1267
+ var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => {
1268
+ $ZodType.init(inst, def);
1269
+ inst._zod.parse = (payload, ctx) => {
1270
+ if (ctx.direction === "backward") {
1271
+ throw new $ZodEncodeError(inst.constructor.name);
1272
+ }
1273
+ const _out = def.transform(payload.value, payload);
1274
+ if (ctx.async) {
1275
+ const output = _out instanceof Promise ? _out : Promise.resolve(_out);
1276
+ return output.then((output) => {
1277
+ payload.value = output;
1278
+ return payload;
1279
+ });
1280
+ }
1281
+ if (_out instanceof Promise) {
1282
+ throw new $ZodAsyncError;
1283
+ }
1284
+ payload.value = _out;
1285
+ return payload;
1286
+ };
1287
+ });
1288
+ function handleOptionalResult(result, input) {
1289
+ if (result.issues.length && input === undefined) {
1290
+ return { issues: [], value: undefined };
1291
+ }
1292
+ return result;
1293
+ }
1294
+ var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
1295
+ $ZodType.init(inst, def);
1296
+ inst._zod.optin = "optional";
1297
+ inst._zod.optout = "optional";
1298
+ defineLazy(inst._zod, "values", () => {
1299
+ return def.innerType._zod.values ? new Set([...def.innerType._zod.values, undefined]) : undefined;
1300
+ });
1301
+ defineLazy(inst._zod, "pattern", () => {
1302
+ const pattern = def.innerType._zod.pattern;
1303
+ return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : undefined;
1304
+ });
1305
+ inst._zod.parse = (payload, ctx) => {
1306
+ if (def.innerType._zod.optin === "optional") {
1307
+ const result = def.innerType._zod.run(payload, ctx);
1308
+ if (result instanceof Promise)
1309
+ return result.then((r) => handleOptionalResult(r, payload.value));
1310
+ return handleOptionalResult(result, payload.value);
1311
+ }
1312
+ if (payload.value === undefined) {
1313
+ return payload;
1314
+ }
1315
+ return def.innerType._zod.run(payload, ctx);
1316
+ };
1317
+ });
1318
+ var $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => {
1319
+ $ZodType.init(inst, def);
1320
+ defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
1321
+ defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
1322
+ defineLazy(inst._zod, "pattern", () => {
1323
+ const pattern = def.innerType._zod.pattern;
1324
+ return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : undefined;
1325
+ });
1326
+ defineLazy(inst._zod, "values", () => {
1327
+ return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : undefined;
1328
+ });
1329
+ inst._zod.parse = (payload, ctx) => {
1330
+ if (payload.value === null)
1331
+ return payload;
1332
+ return def.innerType._zod.run(payload, ctx);
1333
+ };
1334
+ });
1335
+ var $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => {
1336
+ $ZodType.init(inst, def);
1337
+ inst._zod.optin = "optional";
1338
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
1339
+ inst._zod.parse = (payload, ctx) => {
1340
+ if (ctx.direction === "backward") {
1341
+ return def.innerType._zod.run(payload, ctx);
1342
+ }
1343
+ if (payload.value === undefined) {
1344
+ payload.value = def.defaultValue;
1345
+ return payload;
1346
+ }
1347
+ const result = def.innerType._zod.run(payload, ctx);
1348
+ if (result instanceof Promise) {
1349
+ return result.then((result) => handleDefaultResult(result, def));
1350
+ }
1351
+ return handleDefaultResult(result, def);
1352
+ };
1353
+ });
1354
+ function handleDefaultResult(payload, def) {
1355
+ if (payload.value === undefined) {
1356
+ payload.value = def.defaultValue;
1357
+ }
1358
+ return payload;
1359
+ }
1360
+ var $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) => {
1361
+ $ZodType.init(inst, def);
1362
+ inst._zod.optin = "optional";
1363
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
1364
+ inst._zod.parse = (payload, ctx) => {
1365
+ if (ctx.direction === "backward") {
1366
+ return def.innerType._zod.run(payload, ctx);
1367
+ }
1368
+ if (payload.value === undefined) {
1369
+ payload.value = def.defaultValue;
1370
+ }
1371
+ return def.innerType._zod.run(payload, ctx);
1372
+ };
1373
+ });
1374
+ var $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, def) => {
1375
+ $ZodType.init(inst, def);
1376
+ defineLazy(inst._zod, "values", () => {
1377
+ const v = def.innerType._zod.values;
1378
+ return v ? new Set([...v].filter((x) => x !== undefined)) : undefined;
1379
+ });
1380
+ inst._zod.parse = (payload, ctx) => {
1381
+ const result = def.innerType._zod.run(payload, ctx);
1382
+ if (result instanceof Promise) {
1383
+ return result.then((result) => handleNonOptionalResult(result, inst));
1384
+ }
1385
+ return handleNonOptionalResult(result, inst);
1386
+ };
1387
+ });
1388
+ function handleNonOptionalResult(payload, inst) {
1389
+ if (!payload.issues.length && payload.value === undefined) {
1390
+ payload.issues.push({
1391
+ code: "invalid_type",
1392
+ expected: "nonoptional",
1393
+ input: payload.value,
1394
+ inst
1395
+ });
1396
+ }
1397
+ return payload;
1398
+ }
1399
+ var $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
1400
+ $ZodType.init(inst, def);
1401
+ defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
1402
+ defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
1403
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
1404
+ inst._zod.parse = (payload, ctx) => {
1405
+ if (ctx.direction === "backward") {
1406
+ return def.innerType._zod.run(payload, ctx);
1407
+ }
1408
+ const result = def.innerType._zod.run(payload, ctx);
1409
+ if (result instanceof Promise) {
1410
+ return result.then((result) => {
1411
+ payload.value = result.value;
1412
+ if (result.issues.length) {
1413
+ payload.value = def.catchValue({
1414
+ ...payload,
1415
+ error: {
1416
+ issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config()))
1417
+ },
1418
+ input: payload.value
1419
+ });
1420
+ payload.issues = [];
1421
+ }
1422
+ return payload;
1423
+ });
1424
+ }
1425
+ payload.value = result.value;
1426
+ if (result.issues.length) {
1427
+ payload.value = def.catchValue({
1428
+ ...payload,
1429
+ error: {
1430
+ issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config()))
1431
+ },
1432
+ input: payload.value
1433
+ });
1434
+ payload.issues = [];
1435
+ }
1436
+ return payload;
1437
+ };
1438
+ });
1439
+ var $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => {
1440
+ $ZodType.init(inst, def);
1441
+ defineLazy(inst._zod, "values", () => def.in._zod.values);
1442
+ defineLazy(inst._zod, "optin", () => def.in._zod.optin);
1443
+ defineLazy(inst._zod, "optout", () => def.out._zod.optout);
1444
+ defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
1445
+ inst._zod.parse = (payload, ctx) => {
1446
+ if (ctx.direction === "backward") {
1447
+ const right = def.out._zod.run(payload, ctx);
1448
+ if (right instanceof Promise) {
1449
+ return right.then((right) => handlePipeResult(right, def.in, ctx));
1450
+ }
1451
+ return handlePipeResult(right, def.in, ctx);
1452
+ }
1453
+ const left = def.in._zod.run(payload, ctx);
1454
+ if (left instanceof Promise) {
1455
+ return left.then((left) => handlePipeResult(left, def.out, ctx));
1456
+ }
1457
+ return handlePipeResult(left, def.out, ctx);
1458
+ };
1459
+ });
1460
+ function handlePipeResult(left, next, ctx) {
1461
+ if (left.issues.length) {
1462
+ left.aborted = true;
1463
+ return left;
1464
+ }
1465
+ return next._zod.run({ value: left.value, issues: left.issues }, ctx);
1466
+ }
1467
+ var $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => {
1468
+ $ZodType.init(inst, def);
1469
+ defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
1470
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
1471
+ defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
1472
+ defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
1473
+ inst._zod.parse = (payload, ctx) => {
1474
+ if (ctx.direction === "backward") {
1475
+ return def.innerType._zod.run(payload, ctx);
1476
+ }
1477
+ const result = def.innerType._zod.run(payload, ctx);
1478
+ if (result instanceof Promise) {
1479
+ return result.then(handleReadonlyResult);
1480
+ }
1481
+ return handleReadonlyResult(result);
1482
+ };
1483
+ });
1484
+ function handleReadonlyResult(payload) {
1485
+ payload.value = Object.freeze(payload.value);
1486
+ return payload;
1487
+ }
1488
+ var $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
1489
+ $ZodCheck.init(inst, def);
1490
+ $ZodType.init(inst, def);
1491
+ inst._zod.parse = (payload, _) => {
1492
+ return payload;
1493
+ };
1494
+ inst._zod.check = (payload) => {
1495
+ const input = payload.value;
1496
+ const r = def.fn(input);
1497
+ if (r instanceof Promise) {
1498
+ return r.then((r) => handleRefineResult(r, payload, input, inst));
1499
+ }
1500
+ handleRefineResult(r, payload, input, inst);
1501
+ return;
1502
+ };
1503
+ });
1504
+ function handleRefineResult(result, payload, input, inst) {
1505
+ if (!result) {
1506
+ const _iss = {
1507
+ code: "custom",
1508
+ input,
1509
+ inst,
1510
+ path: [...inst._zod.def.path ?? []],
1511
+ continue: !inst._zod.def.abort
1512
+ };
1513
+ if (inst._zod.def.params)
1514
+ _iss.params = inst._zod.def.params;
1515
+ payload.issues.push(issue(_iss));
1516
+ }
1517
+ }
1518
+ // node_modules/zod/v4/core/registries.js
1519
+ var $output = Symbol("ZodOutput");
1520
+ var $input = Symbol("ZodInput");
1521
+
1522
+ class $ZodRegistry {
1523
+ constructor() {
1524
+ this._map = new WeakMap;
1525
+ this._idmap = new Map;
1526
+ }
1527
+ add(schema, ..._meta) {
1528
+ const meta = _meta[0];
1529
+ this._map.set(schema, meta);
1530
+ if (meta && typeof meta === "object" && "id" in meta) {
1531
+ if (this._idmap.has(meta.id)) {
1532
+ throw new Error(`ID ${meta.id} already exists in the registry`);
1533
+ }
1534
+ this._idmap.set(meta.id, schema);
1535
+ }
1536
+ return this;
1537
+ }
1538
+ clear() {
1539
+ this._map = new WeakMap;
1540
+ this._idmap = new Map;
1541
+ return this;
1542
+ }
1543
+ remove(schema) {
1544
+ const meta = this._map.get(schema);
1545
+ if (meta && typeof meta === "object" && "id" in meta) {
1546
+ this._idmap.delete(meta.id);
1547
+ }
1548
+ this._map.delete(schema);
1549
+ return this;
1550
+ }
1551
+ get(schema) {
1552
+ const p = schema._zod.parent;
1553
+ if (p) {
1554
+ const pm = { ...this.get(p) ?? {} };
1555
+ delete pm.id;
1556
+ const f = { ...pm, ...this._map.get(schema) };
1557
+ return Object.keys(f).length ? f : undefined;
1558
+ }
1559
+ return this._map.get(schema);
1560
+ }
1561
+ has(schema) {
1562
+ return this._map.has(schema);
1563
+ }
1564
+ }
1565
+ function registry() {
1566
+ return new $ZodRegistry;
1567
+ }
1568
+ var globalRegistry = /* @__PURE__ */ registry();
1569
+ // node_modules/zod/v4/core/api.js
1570
+ function _string(Class, params) {
1571
+ return new Class({
1572
+ type: "string",
1573
+ ...normalizeParams(params)
1574
+ });
1575
+ }
1576
+ function _email(Class, params) {
1577
+ return new Class({
1578
+ type: "string",
1579
+ format: "email",
1580
+ check: "string_format",
1581
+ abort: false,
1582
+ ...normalizeParams(params)
1583
+ });
1584
+ }
1585
+ function _guid(Class, params) {
1586
+ return new Class({
1587
+ type: "string",
1588
+ format: "guid",
1589
+ check: "string_format",
1590
+ abort: false,
1591
+ ...normalizeParams(params)
1592
+ });
1593
+ }
1594
+ function _uuid(Class, params) {
1595
+ return new Class({
1596
+ type: "string",
1597
+ format: "uuid",
1598
+ check: "string_format",
1599
+ abort: false,
1600
+ ...normalizeParams(params)
1601
+ });
1602
+ }
1603
+ function _uuidv4(Class, params) {
1604
+ return new Class({
1605
+ type: "string",
1606
+ format: "uuid",
1607
+ check: "string_format",
1608
+ abort: false,
1609
+ version: "v4",
1610
+ ...normalizeParams(params)
1611
+ });
1612
+ }
1613
+ function _uuidv6(Class, params) {
1614
+ return new Class({
1615
+ type: "string",
1616
+ format: "uuid",
1617
+ check: "string_format",
1618
+ abort: false,
1619
+ version: "v6",
1620
+ ...normalizeParams(params)
1621
+ });
1622
+ }
1623
+ function _uuidv7(Class, params) {
1624
+ return new Class({
1625
+ type: "string",
1626
+ format: "uuid",
1627
+ check: "string_format",
1628
+ abort: false,
1629
+ version: "v7",
1630
+ ...normalizeParams(params)
1631
+ });
1632
+ }
1633
+ function _url(Class, params) {
1634
+ return new Class({
1635
+ type: "string",
1636
+ format: "url",
1637
+ check: "string_format",
1638
+ abort: false,
1639
+ ...normalizeParams(params)
1640
+ });
1641
+ }
1642
+ function _emoji2(Class, params) {
1643
+ return new Class({
1644
+ type: "string",
1645
+ format: "emoji",
1646
+ check: "string_format",
1647
+ abort: false,
1648
+ ...normalizeParams(params)
1649
+ });
1650
+ }
1651
+ function _nanoid(Class, params) {
1652
+ return new Class({
1653
+ type: "string",
1654
+ format: "nanoid",
1655
+ check: "string_format",
1656
+ abort: false,
1657
+ ...normalizeParams(params)
1658
+ });
1659
+ }
1660
+ function _cuid(Class, params) {
1661
+ return new Class({
1662
+ type: "string",
1663
+ format: "cuid",
1664
+ check: "string_format",
1665
+ abort: false,
1666
+ ...normalizeParams(params)
1667
+ });
1668
+ }
1669
+ function _cuid2(Class, params) {
1670
+ return new Class({
1671
+ type: "string",
1672
+ format: "cuid2",
1673
+ check: "string_format",
1674
+ abort: false,
1675
+ ...normalizeParams(params)
1676
+ });
1677
+ }
1678
+ function _ulid(Class, params) {
1679
+ return new Class({
1680
+ type: "string",
1681
+ format: "ulid",
1682
+ check: "string_format",
1683
+ abort: false,
1684
+ ...normalizeParams(params)
1685
+ });
1686
+ }
1687
+ function _xid(Class, params) {
1688
+ return new Class({
1689
+ type: "string",
1690
+ format: "xid",
1691
+ check: "string_format",
1692
+ abort: false,
1693
+ ...normalizeParams(params)
1694
+ });
1695
+ }
1696
+ function _ksuid(Class, params) {
1697
+ return new Class({
1698
+ type: "string",
1699
+ format: "ksuid",
1700
+ check: "string_format",
1701
+ abort: false,
1702
+ ...normalizeParams(params)
1703
+ });
1704
+ }
1705
+ function _ipv4(Class, params) {
1706
+ return new Class({
1707
+ type: "string",
1708
+ format: "ipv4",
1709
+ check: "string_format",
1710
+ abort: false,
1711
+ ...normalizeParams(params)
1712
+ });
1713
+ }
1714
+ function _ipv6(Class, params) {
1715
+ return new Class({
1716
+ type: "string",
1717
+ format: "ipv6",
1718
+ check: "string_format",
1719
+ abort: false,
1720
+ ...normalizeParams(params)
1721
+ });
1722
+ }
1723
+ function _cidrv4(Class, params) {
1724
+ return new Class({
1725
+ type: "string",
1726
+ format: "cidrv4",
1727
+ check: "string_format",
1728
+ abort: false,
1729
+ ...normalizeParams(params)
1730
+ });
1731
+ }
1732
+ function _cidrv6(Class, params) {
1733
+ return new Class({
1734
+ type: "string",
1735
+ format: "cidrv6",
1736
+ check: "string_format",
1737
+ abort: false,
1738
+ ...normalizeParams(params)
1739
+ });
1740
+ }
1741
+ function _base64(Class, params) {
1742
+ return new Class({
1743
+ type: "string",
1744
+ format: "base64",
1745
+ check: "string_format",
1746
+ abort: false,
1747
+ ...normalizeParams(params)
1748
+ });
1749
+ }
1750
+ function _base64url(Class, params) {
1751
+ return new Class({
1752
+ type: "string",
1753
+ format: "base64url",
1754
+ check: "string_format",
1755
+ abort: false,
1756
+ ...normalizeParams(params)
1757
+ });
1758
+ }
1759
+ function _e164(Class, params) {
1760
+ return new Class({
1761
+ type: "string",
1762
+ format: "e164",
1763
+ check: "string_format",
1764
+ abort: false,
1765
+ ...normalizeParams(params)
1766
+ });
1767
+ }
1768
+ function _jwt(Class, params) {
1769
+ return new Class({
1770
+ type: "string",
1771
+ format: "jwt",
1772
+ check: "string_format",
1773
+ abort: false,
1774
+ ...normalizeParams(params)
1775
+ });
1776
+ }
1777
+ function _isoDateTime(Class, params) {
1778
+ return new Class({
1779
+ type: "string",
1780
+ format: "datetime",
1781
+ check: "string_format",
1782
+ offset: false,
1783
+ local: false,
1784
+ precision: null,
1785
+ ...normalizeParams(params)
1786
+ });
1787
+ }
1788
+ function _isoDate(Class, params) {
1789
+ return new Class({
1790
+ type: "string",
1791
+ format: "date",
1792
+ check: "string_format",
1793
+ ...normalizeParams(params)
1794
+ });
1795
+ }
1796
+ function _isoTime(Class, params) {
1797
+ return new Class({
1798
+ type: "string",
1799
+ format: "time",
1800
+ check: "string_format",
1801
+ precision: null,
1802
+ ...normalizeParams(params)
1803
+ });
1804
+ }
1805
+ function _isoDuration(Class, params) {
1806
+ return new Class({
1807
+ type: "string",
1808
+ format: "duration",
1809
+ check: "string_format",
1810
+ ...normalizeParams(params)
1811
+ });
1812
+ }
1813
+ function _maxLength(maximum, params) {
1814
+ const ch = new $ZodCheckMaxLength({
1815
+ check: "max_length",
1816
+ ...normalizeParams(params),
1817
+ maximum
1818
+ });
1819
+ return ch;
1820
+ }
1821
+ function _minLength(minimum, params) {
1822
+ return new $ZodCheckMinLength({
1823
+ check: "min_length",
1824
+ ...normalizeParams(params),
1825
+ minimum
1826
+ });
1827
+ }
1828
+ function _length(length, params) {
1829
+ return new $ZodCheckLengthEquals({
1830
+ check: "length_equals",
1831
+ ...normalizeParams(params),
1832
+ length
1833
+ });
1834
+ }
1835
+ function _regex(pattern, params) {
1836
+ return new $ZodCheckRegex({
1837
+ check: "string_format",
1838
+ format: "regex",
1839
+ ...normalizeParams(params),
1840
+ pattern
1841
+ });
1842
+ }
1843
+ function _lowercase(params) {
1844
+ return new $ZodCheckLowerCase({
1845
+ check: "string_format",
1846
+ format: "lowercase",
1847
+ ...normalizeParams(params)
1848
+ });
1849
+ }
1850
+ function _uppercase(params) {
1851
+ return new $ZodCheckUpperCase({
1852
+ check: "string_format",
1853
+ format: "uppercase",
1854
+ ...normalizeParams(params)
1855
+ });
1856
+ }
1857
+ function _includes(includes, params) {
1858
+ return new $ZodCheckIncludes({
1859
+ check: "string_format",
1860
+ format: "includes",
1861
+ ...normalizeParams(params),
1862
+ includes
1863
+ });
1864
+ }
1865
+ function _startsWith(prefix, params) {
1866
+ return new $ZodCheckStartsWith({
1867
+ check: "string_format",
1868
+ format: "starts_with",
1869
+ ...normalizeParams(params),
1870
+ prefix
1871
+ });
1872
+ }
1873
+ function _endsWith(suffix, params) {
1874
+ return new $ZodCheckEndsWith({
1875
+ check: "string_format",
1876
+ format: "ends_with",
1877
+ ...normalizeParams(params),
1878
+ suffix
1879
+ });
1880
+ }
1881
+ function _overwrite(tx) {
1882
+ return new $ZodCheckOverwrite({
1883
+ check: "overwrite",
1884
+ tx
1885
+ });
1886
+ }
1887
+ function _normalize(form) {
1888
+ return _overwrite((input) => input.normalize(form));
1889
+ }
1890
+ function _trim() {
1891
+ return _overwrite((input) => input.trim());
1892
+ }
1893
+ function _toLowerCase() {
1894
+ return _overwrite((input) => input.toLowerCase());
1895
+ }
1896
+ function _toUpperCase() {
1897
+ return _overwrite((input) => input.toUpperCase());
1898
+ }
1899
+ function _array(Class, element, params) {
1900
+ return new Class({
1901
+ type: "array",
1902
+ element,
1903
+ ...normalizeParams(params)
1904
+ });
1905
+ }
1906
+ function _refine(Class, fn, _params) {
1907
+ const schema = new Class({
1908
+ type: "custom",
1909
+ check: "custom",
1910
+ fn,
1911
+ ...normalizeParams(_params)
1912
+ });
1913
+ return schema;
1914
+ }
1915
+ function _superRefine(fn) {
1916
+ const ch = _check((payload) => {
1917
+ payload.addIssue = (issue2) => {
1918
+ if (typeof issue2 === "string") {
1919
+ payload.issues.push(issue(issue2, payload.value, ch._zod.def));
1920
+ } else {
1921
+ const _issue = issue2;
1922
+ if (_issue.fatal)
1923
+ _issue.continue = false;
1924
+ _issue.code ?? (_issue.code = "custom");
1925
+ _issue.input ?? (_issue.input = payload.value);
1926
+ _issue.inst ?? (_issue.inst = ch);
1927
+ _issue.continue ?? (_issue.continue = !ch._zod.def.abort);
1928
+ payload.issues.push(issue(_issue));
1929
+ }
1930
+ };
1931
+ return fn(payload.value, payload);
1932
+ });
1933
+ return ch;
1934
+ }
1935
+ function _check(fn, params) {
1936
+ const ch = new $ZodCheck({
1937
+ check: "custom",
1938
+ ...normalizeParams(params)
1939
+ });
1940
+ ch._zod.check = fn;
1941
+ return ch;
1942
+ }
1943
+ // node_modules/zod/v4/classic/iso.js
1944
+ var ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
1945
+ $ZodISODateTime.init(inst, def);
1946
+ ZodStringFormat.init(inst, def);
1947
+ });
1948
+ function datetime2(params) {
1949
+ return _isoDateTime(ZodISODateTime, params);
1950
+ }
1951
+ var ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => {
1952
+ $ZodISODate.init(inst, def);
1953
+ ZodStringFormat.init(inst, def);
1954
+ });
1955
+ function date2(params) {
1956
+ return _isoDate(ZodISODate, params);
1957
+ }
1958
+ var ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => {
1959
+ $ZodISOTime.init(inst, def);
1960
+ ZodStringFormat.init(inst, def);
1961
+ });
1962
+ function time2(params) {
1963
+ return _isoTime(ZodISOTime, params);
1964
+ }
1965
+ var ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => {
1966
+ $ZodISODuration.init(inst, def);
1967
+ ZodStringFormat.init(inst, def);
1968
+ });
1969
+ function duration2(params) {
1970
+ return _isoDuration(ZodISODuration, params);
1971
+ }
1972
+
1973
+ // node_modules/zod/v4/classic/errors.js
1974
+ var initializer2 = (inst, issues) => {
1975
+ $ZodError.init(inst, issues);
1976
+ inst.name = "ZodError";
1977
+ Object.defineProperties(inst, {
1978
+ format: {
1979
+ value: (mapper) => formatError(inst, mapper)
1980
+ },
1981
+ flatten: {
1982
+ value: (mapper) => flattenError(inst, mapper)
1983
+ },
1984
+ addIssue: {
1985
+ value: (issue) => {
1986
+ inst.issues.push(issue);
1987
+ inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
1988
+ }
1989
+ },
1990
+ addIssues: {
1991
+ value: (issues) => {
1992
+ inst.issues.push(...issues);
1993
+ inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
1994
+ }
1995
+ },
1996
+ isEmpty: {
1997
+ get() {
1998
+ return inst.issues.length === 0;
1999
+ }
2000
+ }
2001
+ });
2002
+ };
2003
+ var ZodError = $constructor("ZodError", initializer2);
2004
+ var ZodRealError = $constructor("ZodError", initializer2, {
2005
+ Parent: Error
2006
+ });
2007
+
2008
+ // node_modules/zod/v4/classic/parse.js
2009
+ var parse3 = /* @__PURE__ */ _parse(ZodRealError);
2010
+ var parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError);
2011
+ var safeParse2 = /* @__PURE__ */ _safeParse(ZodRealError);
2012
+ var safeParseAsync2 = /* @__PURE__ */ _safeParseAsync(ZodRealError);
2013
+ var encode = /* @__PURE__ */ _encode(ZodRealError);
2014
+ var decode = /* @__PURE__ */ _decode(ZodRealError);
2015
+ var encodeAsync = /* @__PURE__ */ _encodeAsync(ZodRealError);
2016
+ var decodeAsync = /* @__PURE__ */ _decodeAsync(ZodRealError);
2017
+ var safeEncode = /* @__PURE__ */ _safeEncode(ZodRealError);
2018
+ var safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
2019
+ var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
2020
+ var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
4
2021
 
2022
+ // node_modules/zod/v4/classic/schemas.js
2023
+ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
2024
+ $ZodType.init(inst, def);
2025
+ inst.def = def;
2026
+ inst.type = def.type;
2027
+ Object.defineProperty(inst, "_def", { value: def });
2028
+ inst.check = (...checks) => {
2029
+ return inst.clone({
2030
+ ...def,
2031
+ checks: [
2032
+ ...def.checks ?? [],
2033
+ ...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
2034
+ ]
2035
+ });
2036
+ };
2037
+ inst.clone = (def, params) => clone(inst, def, params);
2038
+ inst.brand = () => inst;
2039
+ inst.register = (reg, meta) => {
2040
+ reg.add(inst, meta);
2041
+ return inst;
2042
+ };
2043
+ inst.parse = (data, params) => parse3(inst, data, params, { callee: inst.parse });
2044
+ inst.safeParse = (data, params) => safeParse2(inst, data, params);
2045
+ inst.parseAsync = async (data, params) => parseAsync2(inst, data, params, { callee: inst.parseAsync });
2046
+ inst.safeParseAsync = async (data, params) => safeParseAsync2(inst, data, params);
2047
+ inst.spa = inst.safeParseAsync;
2048
+ inst.encode = (data, params) => encode(inst, data, params);
2049
+ inst.decode = (data, params) => decode(inst, data, params);
2050
+ inst.encodeAsync = async (data, params) => encodeAsync(inst, data, params);
2051
+ inst.decodeAsync = async (data, params) => decodeAsync(inst, data, params);
2052
+ inst.safeEncode = (data, params) => safeEncode(inst, data, params);
2053
+ inst.safeDecode = (data, params) => safeDecode(inst, data, params);
2054
+ inst.safeEncodeAsync = async (data, params) => safeEncodeAsync(inst, data, params);
2055
+ inst.safeDecodeAsync = async (data, params) => safeDecodeAsync(inst, data, params);
2056
+ inst.refine = (check, params) => inst.check(refine(check, params));
2057
+ inst.superRefine = (refinement) => inst.check(superRefine(refinement));
2058
+ inst.overwrite = (fn) => inst.check(_overwrite(fn));
2059
+ inst.optional = () => optional(inst);
2060
+ inst.nullable = () => nullable(inst);
2061
+ inst.nullish = () => optional(nullable(inst));
2062
+ inst.nonoptional = (params) => nonoptional(inst, params);
2063
+ inst.array = () => array(inst);
2064
+ inst.or = (arg) => union([inst, arg]);
2065
+ inst.and = (arg) => intersection(inst, arg);
2066
+ inst.transform = (tx) => pipe(inst, transform(tx));
2067
+ inst.default = (def) => _default(inst, def);
2068
+ inst.prefault = (def) => prefault(inst, def);
2069
+ inst.catch = (params) => _catch(inst, params);
2070
+ inst.pipe = (target) => pipe(inst, target);
2071
+ inst.readonly = () => readonly(inst);
2072
+ inst.describe = (description) => {
2073
+ const cl = inst.clone();
2074
+ globalRegistry.add(cl, { description });
2075
+ return cl;
2076
+ };
2077
+ Object.defineProperty(inst, "description", {
2078
+ get() {
2079
+ return globalRegistry.get(inst)?.description;
2080
+ },
2081
+ configurable: true
2082
+ });
2083
+ inst.meta = (...args) => {
2084
+ if (args.length === 0) {
2085
+ return globalRegistry.get(inst);
2086
+ }
2087
+ const cl = inst.clone();
2088
+ globalRegistry.add(cl, args[0]);
2089
+ return cl;
2090
+ };
2091
+ inst.isOptional = () => inst.safeParse(undefined).success;
2092
+ inst.isNullable = () => inst.safeParse(null).success;
2093
+ return inst;
2094
+ });
2095
+ var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
2096
+ $ZodString.init(inst, def);
2097
+ ZodType.init(inst, def);
2098
+ const bag = inst._zod.bag;
2099
+ inst.format = bag.format ?? null;
2100
+ inst.minLength = bag.minimum ?? null;
2101
+ inst.maxLength = bag.maximum ?? null;
2102
+ inst.regex = (...args) => inst.check(_regex(...args));
2103
+ inst.includes = (...args) => inst.check(_includes(...args));
2104
+ inst.startsWith = (...args) => inst.check(_startsWith(...args));
2105
+ inst.endsWith = (...args) => inst.check(_endsWith(...args));
2106
+ inst.min = (...args) => inst.check(_minLength(...args));
2107
+ inst.max = (...args) => inst.check(_maxLength(...args));
2108
+ inst.length = (...args) => inst.check(_length(...args));
2109
+ inst.nonempty = (...args) => inst.check(_minLength(1, ...args));
2110
+ inst.lowercase = (params) => inst.check(_lowercase(params));
2111
+ inst.uppercase = (params) => inst.check(_uppercase(params));
2112
+ inst.trim = () => inst.check(_trim());
2113
+ inst.normalize = (...args) => inst.check(_normalize(...args));
2114
+ inst.toLowerCase = () => inst.check(_toLowerCase());
2115
+ inst.toUpperCase = () => inst.check(_toUpperCase());
2116
+ });
2117
+ var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
2118
+ $ZodString.init(inst, def);
2119
+ _ZodString.init(inst, def);
2120
+ inst.email = (params) => inst.check(_email(ZodEmail, params));
2121
+ inst.url = (params) => inst.check(_url(ZodURL, params));
2122
+ inst.jwt = (params) => inst.check(_jwt(ZodJWT, params));
2123
+ inst.emoji = (params) => inst.check(_emoji2(ZodEmoji, params));
2124
+ inst.guid = (params) => inst.check(_guid(ZodGUID, params));
2125
+ inst.uuid = (params) => inst.check(_uuid(ZodUUID, params));
2126
+ inst.uuidv4 = (params) => inst.check(_uuidv4(ZodUUID, params));
2127
+ inst.uuidv6 = (params) => inst.check(_uuidv6(ZodUUID, params));
2128
+ inst.uuidv7 = (params) => inst.check(_uuidv7(ZodUUID, params));
2129
+ inst.nanoid = (params) => inst.check(_nanoid(ZodNanoID, params));
2130
+ inst.guid = (params) => inst.check(_guid(ZodGUID, params));
2131
+ inst.cuid = (params) => inst.check(_cuid(ZodCUID, params));
2132
+ inst.cuid2 = (params) => inst.check(_cuid2(ZodCUID2, params));
2133
+ inst.ulid = (params) => inst.check(_ulid(ZodULID, params));
2134
+ inst.base64 = (params) => inst.check(_base64(ZodBase64, params));
2135
+ inst.base64url = (params) => inst.check(_base64url(ZodBase64URL, params));
2136
+ inst.xid = (params) => inst.check(_xid(ZodXID, params));
2137
+ inst.ksuid = (params) => inst.check(_ksuid(ZodKSUID, params));
2138
+ inst.ipv4 = (params) => inst.check(_ipv4(ZodIPv4, params));
2139
+ inst.ipv6 = (params) => inst.check(_ipv6(ZodIPv6, params));
2140
+ inst.cidrv4 = (params) => inst.check(_cidrv4(ZodCIDRv4, params));
2141
+ inst.cidrv6 = (params) => inst.check(_cidrv6(ZodCIDRv6, params));
2142
+ inst.e164 = (params) => inst.check(_e164(ZodE164, params));
2143
+ inst.datetime = (params) => inst.check(datetime2(params));
2144
+ inst.date = (params) => inst.check(date2(params));
2145
+ inst.time = (params) => inst.check(time2(params));
2146
+ inst.duration = (params) => inst.check(duration2(params));
2147
+ });
2148
+ function string2(params) {
2149
+ return _string(ZodString, params);
2150
+ }
2151
+ var ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def) => {
2152
+ $ZodStringFormat.init(inst, def);
2153
+ _ZodString.init(inst, def);
2154
+ });
2155
+ var ZodEmail = /* @__PURE__ */ $constructor("ZodEmail", (inst, def) => {
2156
+ $ZodEmail.init(inst, def);
2157
+ ZodStringFormat.init(inst, def);
2158
+ });
2159
+ var ZodGUID = /* @__PURE__ */ $constructor("ZodGUID", (inst, def) => {
2160
+ $ZodGUID.init(inst, def);
2161
+ ZodStringFormat.init(inst, def);
2162
+ });
2163
+ var ZodUUID = /* @__PURE__ */ $constructor("ZodUUID", (inst, def) => {
2164
+ $ZodUUID.init(inst, def);
2165
+ ZodStringFormat.init(inst, def);
2166
+ });
2167
+ var ZodURL = /* @__PURE__ */ $constructor("ZodURL", (inst, def) => {
2168
+ $ZodURL.init(inst, def);
2169
+ ZodStringFormat.init(inst, def);
2170
+ });
2171
+ var ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def) => {
2172
+ $ZodEmoji.init(inst, def);
2173
+ ZodStringFormat.init(inst, def);
2174
+ });
2175
+ var ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def) => {
2176
+ $ZodNanoID.init(inst, def);
2177
+ ZodStringFormat.init(inst, def);
2178
+ });
2179
+ var ZodCUID = /* @__PURE__ */ $constructor("ZodCUID", (inst, def) => {
2180
+ $ZodCUID.init(inst, def);
2181
+ ZodStringFormat.init(inst, def);
2182
+ });
2183
+ var ZodCUID2 = /* @__PURE__ */ $constructor("ZodCUID2", (inst, def) => {
2184
+ $ZodCUID2.init(inst, def);
2185
+ ZodStringFormat.init(inst, def);
2186
+ });
2187
+ var ZodULID = /* @__PURE__ */ $constructor("ZodULID", (inst, def) => {
2188
+ $ZodULID.init(inst, def);
2189
+ ZodStringFormat.init(inst, def);
2190
+ });
2191
+ var ZodXID = /* @__PURE__ */ $constructor("ZodXID", (inst, def) => {
2192
+ $ZodXID.init(inst, def);
2193
+ ZodStringFormat.init(inst, def);
2194
+ });
2195
+ var ZodKSUID = /* @__PURE__ */ $constructor("ZodKSUID", (inst, def) => {
2196
+ $ZodKSUID.init(inst, def);
2197
+ ZodStringFormat.init(inst, def);
2198
+ });
2199
+ var ZodIPv4 = /* @__PURE__ */ $constructor("ZodIPv4", (inst, def) => {
2200
+ $ZodIPv4.init(inst, def);
2201
+ ZodStringFormat.init(inst, def);
2202
+ });
2203
+ var ZodIPv6 = /* @__PURE__ */ $constructor("ZodIPv6", (inst, def) => {
2204
+ $ZodIPv6.init(inst, def);
2205
+ ZodStringFormat.init(inst, def);
2206
+ });
2207
+ var ZodCIDRv4 = /* @__PURE__ */ $constructor("ZodCIDRv4", (inst, def) => {
2208
+ $ZodCIDRv4.init(inst, def);
2209
+ ZodStringFormat.init(inst, def);
2210
+ });
2211
+ var ZodCIDRv6 = /* @__PURE__ */ $constructor("ZodCIDRv6", (inst, def) => {
2212
+ $ZodCIDRv6.init(inst, def);
2213
+ ZodStringFormat.init(inst, def);
2214
+ });
2215
+ var ZodBase64 = /* @__PURE__ */ $constructor("ZodBase64", (inst, def) => {
2216
+ $ZodBase64.init(inst, def);
2217
+ ZodStringFormat.init(inst, def);
2218
+ });
2219
+ var ZodBase64URL = /* @__PURE__ */ $constructor("ZodBase64URL", (inst, def) => {
2220
+ $ZodBase64URL.init(inst, def);
2221
+ ZodStringFormat.init(inst, def);
2222
+ });
2223
+ var ZodE164 = /* @__PURE__ */ $constructor("ZodE164", (inst, def) => {
2224
+ $ZodE164.init(inst, def);
2225
+ ZodStringFormat.init(inst, def);
2226
+ });
2227
+ var ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
2228
+ $ZodJWT.init(inst, def);
2229
+ ZodStringFormat.init(inst, def);
2230
+ });
2231
+ var ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
2232
+ $ZodArray.init(inst, def);
2233
+ ZodType.init(inst, def);
2234
+ inst.element = def.element;
2235
+ inst.min = (minLength, params) => inst.check(_minLength(minLength, params));
2236
+ inst.nonempty = (params) => inst.check(_minLength(1, params));
2237
+ inst.max = (maxLength, params) => inst.check(_maxLength(maxLength, params));
2238
+ inst.length = (len, params) => inst.check(_length(len, params));
2239
+ inst.unwrap = () => inst.element;
2240
+ });
2241
+ function array(element, params) {
2242
+ return _array(ZodArray, element, params);
2243
+ }
2244
+ var ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
2245
+ $ZodUnion.init(inst, def);
2246
+ ZodType.init(inst, def);
2247
+ inst.options = def.options;
2248
+ });
2249
+ function union(options, params) {
2250
+ return new ZodUnion({
2251
+ type: "union",
2252
+ options,
2253
+ ...normalizeParams(params)
2254
+ });
2255
+ }
2256
+ var ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
2257
+ $ZodIntersection.init(inst, def);
2258
+ ZodType.init(inst, def);
2259
+ });
2260
+ function intersection(left, right) {
2261
+ return new ZodIntersection({
2262
+ type: "intersection",
2263
+ left,
2264
+ right
2265
+ });
2266
+ }
2267
+ var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
2268
+ $ZodTransform.init(inst, def);
2269
+ ZodType.init(inst, def);
2270
+ inst._zod.parse = (payload, _ctx) => {
2271
+ if (_ctx.direction === "backward") {
2272
+ throw new $ZodEncodeError(inst.constructor.name);
2273
+ }
2274
+ payload.addIssue = (issue2) => {
2275
+ if (typeof issue2 === "string") {
2276
+ payload.issues.push(issue(issue2, payload.value, def));
2277
+ } else {
2278
+ const _issue = issue2;
2279
+ if (_issue.fatal)
2280
+ _issue.continue = false;
2281
+ _issue.code ?? (_issue.code = "custom");
2282
+ _issue.input ?? (_issue.input = payload.value);
2283
+ _issue.inst ?? (_issue.inst = inst);
2284
+ payload.issues.push(issue(_issue));
2285
+ }
2286
+ };
2287
+ const output = def.transform(payload.value, payload);
2288
+ if (output instanceof Promise) {
2289
+ return output.then((output) => {
2290
+ payload.value = output;
2291
+ return payload;
2292
+ });
2293
+ }
2294
+ payload.value = output;
2295
+ return payload;
2296
+ };
2297
+ });
2298
+ function transform(fn) {
2299
+ return new ZodTransform({
2300
+ type: "transform",
2301
+ transform: fn
2302
+ });
2303
+ }
2304
+ var ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => {
2305
+ $ZodOptional.init(inst, def);
2306
+ ZodType.init(inst, def);
2307
+ inst.unwrap = () => inst._zod.def.innerType;
2308
+ });
2309
+ function optional(innerType) {
2310
+ return new ZodOptional({
2311
+ type: "optional",
2312
+ innerType
2313
+ });
2314
+ }
2315
+ var ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
2316
+ $ZodNullable.init(inst, def);
2317
+ ZodType.init(inst, def);
2318
+ inst.unwrap = () => inst._zod.def.innerType;
2319
+ });
2320
+ function nullable(innerType) {
2321
+ return new ZodNullable({
2322
+ type: "nullable",
2323
+ innerType
2324
+ });
2325
+ }
2326
+ var ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => {
2327
+ $ZodDefault.init(inst, def);
2328
+ ZodType.init(inst, def);
2329
+ inst.unwrap = () => inst._zod.def.innerType;
2330
+ inst.removeDefault = inst.unwrap;
2331
+ });
2332
+ function _default(innerType, defaultValue) {
2333
+ return new ZodDefault({
2334
+ type: "default",
2335
+ innerType,
2336
+ get defaultValue() {
2337
+ return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
2338
+ }
2339
+ });
2340
+ }
2341
+ var ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => {
2342
+ $ZodPrefault.init(inst, def);
2343
+ ZodType.init(inst, def);
2344
+ inst.unwrap = () => inst._zod.def.innerType;
2345
+ });
2346
+ function prefault(innerType, defaultValue) {
2347
+ return new ZodPrefault({
2348
+ type: "prefault",
2349
+ innerType,
2350
+ get defaultValue() {
2351
+ return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
2352
+ }
2353
+ });
2354
+ }
2355
+ var ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => {
2356
+ $ZodNonOptional.init(inst, def);
2357
+ ZodType.init(inst, def);
2358
+ inst.unwrap = () => inst._zod.def.innerType;
2359
+ });
2360
+ function nonoptional(innerType, params) {
2361
+ return new ZodNonOptional({
2362
+ type: "nonoptional",
2363
+ innerType,
2364
+ ...normalizeParams(params)
2365
+ });
2366
+ }
2367
+ var ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => {
2368
+ $ZodCatch.init(inst, def);
2369
+ ZodType.init(inst, def);
2370
+ inst.unwrap = () => inst._zod.def.innerType;
2371
+ inst.removeCatch = inst.unwrap;
2372
+ });
2373
+ function _catch(innerType, catchValue) {
2374
+ return new ZodCatch({
2375
+ type: "catch",
2376
+ innerType,
2377
+ catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
2378
+ });
2379
+ }
2380
+ var ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
2381
+ $ZodPipe.init(inst, def);
2382
+ ZodType.init(inst, def);
2383
+ inst.in = def.in;
2384
+ inst.out = def.out;
2385
+ });
2386
+ function pipe(in_, out) {
2387
+ return new ZodPipe({
2388
+ type: "pipe",
2389
+ in: in_,
2390
+ out
2391
+ });
2392
+ }
2393
+ var ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
2394
+ $ZodReadonly.init(inst, def);
2395
+ ZodType.init(inst, def);
2396
+ inst.unwrap = () => inst._zod.def.innerType;
2397
+ });
2398
+ function readonly(innerType) {
2399
+ return new ZodReadonly({
2400
+ type: "readonly",
2401
+ innerType
2402
+ });
2403
+ }
2404
+ var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
2405
+ $ZodCustom.init(inst, def);
2406
+ ZodType.init(inst, def);
2407
+ });
2408
+ function refine(fn, _params = {}) {
2409
+ return _refine(ZodCustom, fn, _params);
2410
+ }
2411
+ function superRefine(fn) {
2412
+ return _superRefine(fn);
2413
+ }
5
2414
  // src/api.ts
6
2415
  var API_BASE = "https://api.commandcode.ai";
7
2416
  function authHeaders(key) {
@@ -180,6 +2589,107 @@ async function resolveKey(getAuth) {
180
2589
  } catch {}
181
2590
  throw new Error("No Command Code API key found. Run /connect, choose Command Code, and paste your key (or `cmd login` in a terminal, or set CMD_API_KEY).");
182
2591
  }
2592
+
2593
+ // src/catalog.ts
2594
+ var MODEL_CATALOG = {
2595
+ "claude-fable-5": { name: "Claude Fable 5", context: 1e6, efforts: ["low", "medium", "high", "xhigh", "max"], cost: { input: 10, output: 50, cacheRead: 1, cacheWrite: 12.5 }, modalities: ["text", "image"] },
2596
+ "claude-fable-5-1": { name: "Claude Fable 5.1", context: 1e6, efforts: ["low", "medium", "high", "xhigh", "max"], cost: { input: 10, output: 50, cacheRead: 0.25, cacheWrite: 12.5 }, modalities: ["text", "image"] },
2597
+ "claude-haiku-4-5-20251001": { name: "Claude Haiku 4.5", context: 200000, efforts: null, cost: { input: 1, output: 5, cacheRead: 0.1, cacheWrite: 1.25 }, modalities: ["text", "image"] },
2598
+ "claude-opus-4-7": { name: "Claude Opus 4.7", context: 1e6, efforts: ["low", "medium", "high", "xhigh", "max"], cost: { input: 5, output: 25, cacheRead: 0.5, cacheWrite: 6.25 }, modalities: ["text", "image"] },
2599
+ "claude-opus-4-8": { name: "Claude Opus 4.8", context: 1e6, efforts: ["low", "medium", "high", "xhigh", "max"], cost: { input: 5, output: 25, cacheRead: 0.5, cacheWrite: 6.25 }, modalities: ["text", "image"] },
2600
+ "claude-opus-5": { name: "Claude Opus 5", context: 1e6, efforts: ["low", "medium", "high", "xhigh", "max"], cost: { input: 5, output: 25, cacheRead: 0.5, cacheWrite: 6.25 }, modalities: ["text", "image"] },
2601
+ "claude-opus-5-5": { name: "Claude Opus 5.5", context: 1e6, efforts: ["low", "medium", "high", "xhigh", "max"], cost: { input: 4, output: 20, cacheRead: 0.2, cacheWrite: 5 }, modalities: ["text", "image"] },
2602
+ "claude-sonnet-4-6": { name: "Claude Sonnet 4.6", context: 1e6, efforts: ["low", "medium", "high", "xhigh", "max"], cost: { input: 3, output: 15, cacheRead: 0.3, cacheWrite: 3.75 }, modalities: ["text", "image"] },
2603
+ "claude-sonnet-5": { name: "Claude Sonnet 5", context: 1e6, efforts: ["low", "medium", "high", "xhigh", "max"], cost: { input: 2, output: 10, cacheRead: 0.2, cacheWrite: 2.5 }, modalities: ["text", "image"] },
2604
+ "deepseek/deepseek-v4-flash": { name: "DeepSeek V4 Flash (latest)", context: 1e6, efforts: ["high", "max"], cost: { input: 0.15, output: 0.6, cacheRead: 0.003, cacheWrite: 0 }, modalities: ["text"] },
2605
+ "deepseek/deepseek-v4-flash-fast": { name: "DeepSeek V4 Flash Fast", context: 1e6, efforts: ["low", "high", "max"], cost: { input: 0.28, output: 0.56, cacheRead: 0.07, cacheWrite: 0 }, modalities: ["text"] },
2606
+ "deepseek/deepseek-v4-flash-vision-exp": { name: "DeepSeek V4 Flash Vision (exp)", context: 1e6, efforts: ["high", "max"], cost: { input: 0.15, output: 0.6, cacheRead: 0.003, cacheWrite: 0 }, modalities: ["text", "image"] },
2607
+ "deepseek/deepseek-v4-pro": { name: "DeepSeek V4 Pro (latest)", context: 1e6, efforts: ["high", "max"], cost: { input: 0.66, output: 1.98, cacheRead: 0.022, cacheWrite: 0 }, modalities: ["text"] },
2608
+ "deepseek/deepseek-v4.1-flash": { name: "DeepSeek V4.1 Flash", context: 1e6, efforts: ["low", "high", "max"], cost: { input: 0.15, output: 0.6, cacheRead: 0.003, cacheWrite: 0 }, modalities: ["text", "image"] },
2609
+ "google/gemini-3.1-flash-lite": { name: "Gemini 3.1 Flash Lite", context: 1e6, efforts: ["low", "medium", "high"], cost: { input: 0.25, output: 1.5, cacheRead: 0.03, cacheWrite: 0 }, modalities: ["text", "image"] },
2610
+ "google/gemini-3.5-flash": { name: "Gemini 3.5 Flash", context: 1e6, efforts: ["low", "medium", "high"], cost: { input: 1.5, output: 9, cacheRead: 0.15, cacheWrite: 0 }, modalities: ["text", "image"] },
2611
+ "google/gemini-3.5-flash-lite": { name: "Gemini 3.5 Flash Lite", context: 1e6, efforts: ["low", "medium", "high"], cost: { input: 0.3, output: 2.5, cacheRead: 0.03, cacheWrite: 0 }, modalities: ["text", "image"] },
2612
+ "google/gemini-3.6-flash": { name: "Gemini 3.6 Flash", context: 1e6, efforts: ["low", "medium", "high"], cost: { input: 1.5, output: 7.5, cacheRead: 0.15, cacheWrite: 0 }, modalities: ["text", "image"] },
2613
+ "google/gemini-3.7-flash": { name: "Gemini 3.7 Flash", context: 1050000, efforts: ["low", "medium", "high"], cost: { input: 1.5, output: 7.5, cacheRead: 0.15, cacheWrite: 0.08334 }, modalities: ["text", "image"] },
2614
+ "google/gemini-3.8-flash": { name: "Gemini 3.8 Flash", context: 1e6, efforts: ["low", "medium", "high"], cost: { input: 1.5, output: 7.5, cacheRead: 0.15, cacheWrite: 0 }, modalities: ["text", "image"] },
2615
+ "gpt-5.3-codex": { name: "GPT-5.3 Codex", context: 400000, efforts: ["low", "medium", "high", "xhigh"], cost: { input: 2, output: 8, cacheRead: 0.5, cacheWrite: 0 }, modalities: ["text", "image"] },
2616
+ "gpt-5.4": { name: "GPT-5.4", context: 400000, efforts: ["low", "medium", "high", "xhigh"], cost: { input: 2.5, output: 15, cacheRead: 0.25, cacheWrite: 0 }, modalities: ["text", "image"] },
2617
+ "gpt-5.4-mini": { name: "GPT-5.4 Mini", context: 400000, efforts: ["low", "medium", "high"], cost: { input: 0.75, output: 4.5, cacheRead: 0.075, cacheWrite: 0 }, modalities: ["text", "image"] },
2618
+ "gpt-5.5": { name: "GPT-5.5", context: 400000, efforts: ["low", "medium", "high", "xhigh"], cost: { input: 5, output: 30, cacheRead: 0.5, cacheWrite: 0 }, modalities: ["text", "image"] },
2619
+ "gpt-5.6-luna": { name: "GPT-5.6 Luna", context: 1050000, efforts: ["low", "medium", "high", "xhigh", "max"], cost: { input: 0.2, output: 1.2, cacheRead: 0.02, cacheWrite: 0.25 }, modalities: ["text", "image"] },
2620
+ "gpt-5.6-sol": { name: "GPT-5.6 Sol", context: 1050000, efforts: ["low", "medium", "high", "xhigh", "max"], cost: { input: 5, output: 30, cacheRead: 0.5, cacheWrite: 6.25 }, modalities: ["text", "image"] },
2621
+ "gpt-5.6-terra": { name: "GPT-5.6 Terra", context: 1050000, efforts: ["low", "medium", "high", "xhigh", "max"], cost: { input: 2, output: 12, cacheRead: 0.2, cacheWrite: 2.5 }, modalities: ["text", "image"] },
2622
+ "gpt-6-astra": { name: "GPT-6 Astra", context: 1050000, efforts: ["low", "medium", "high", "xhigh", "max"], cost: { input: 10, output: 50, cacheRead: 1, cacheWrite: 12.5 }, modalities: ["text", "image"] },
2623
+ "gpt-6-luna": { name: "GPT-6 Luna", context: 1050000, efforts: ["low", "medium", "high", "xhigh", "max"], cost: { input: 0.1, output: 0.5, cacheRead: 0.01, cacheWrite: 0.125 }, modalities: ["text", "image"] },
2624
+ "gpt-6-sol": { name: "GPT-6 Sol", context: 1050000, efforts: ["low", "medium", "high", "xhigh", "max"], cost: { input: 2, output: 10, cacheRead: 0.2, cacheWrite: 2.5 }, modalities: ["text", "image"] },
2625
+ "inclusionai/ling-3.0-flash-sante:free": { name: "Ling 3.0 Flash Sante", context: 262000, efforts: null, cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, modalities: ["text"] },
2626
+ "meituan/LongCat-2.0": { name: "LongCat 2.0", context: 1050000, efforts: null, cost: { input: 0.3, output: 1.2, cacheRead: 0.006, cacheWrite: 0 }, modalities: ["text"] },
2627
+ "meta/muse-spark-1.1": { name: "Muse Spark 1.1", context: 1050000, efforts: ["low", "medium", "high", "xhigh"], cost: { input: 1.25, output: 4.25, cacheRead: 0.15, cacheWrite: 0 }, modalities: ["text", "image"] },
2628
+ "meta/muse-spark-1.2": { name: "Muse Spark 1.2", context: 1050000, efforts: ["low", "medium", "high", "xhigh"], cost: { input: 1.25, output: 4.25, cacheRead: 0.15, cacheWrite: 0 }, modalities: ["text", "image"] },
2629
+ "meta/muse-spark-1.2-contributor": { name: "Muse Spark 1.2 Contributor", context: 1050000, efforts: ["low", "medium", "high", "xhigh"], cost: { input: 0.1, output: 0.2, cacheRead: 0.002, cacheWrite: 0 }, modalities: ["text", "image"] },
2630
+ "meta/muse-spark-1.3": { name: "Muse Spark 1.3", context: 1050000, efforts: ["low", "medium", "high", "xhigh", "max"], cost: { input: 1.25, output: 4.25, cacheRead: 0.15, cacheWrite: 0 }, modalities: ["text", "image"] },
2631
+ "meta/muse-spark-1.3-contributor": { name: "Muse Spark 1.3 Contributor", context: 1050000, efforts: ["low", "medium", "high", "xhigh"], cost: { input: 0.1, output: 0.2, cacheRead: 0.002, cacheWrite: 0 }, modalities: ["text", "image"] },
2632
+ "MiniMaxAI/MiniMax-M2.5": { name: "MiniMax M2.5", context: 200000, efforts: null, cost: { input: 0.3, output: 1.2, cacheRead: 0.03, cacheWrite: 0 }, modalities: ["text"] },
2633
+ "MiniMaxAI/MiniMax-M2.7": { name: "MiniMax M2.7", context: 0, efforts: null, cost: { input: 0.3, output: 1.2, cacheRead: 0.06, cacheWrite: 0 }, modalities: ["text"] },
2634
+ "MiniMaxAI/MiniMax-M3": { name: "MiniMax M3", context: 1e6, efforts: ["low", "medium", "high"], cost: { input: 0.3, output: 1.2, cacheRead: 0.06, cacheWrite: 0 }, modalities: ["text", "image"] },
2635
+ "moonshotai/Kimi-K2.5": { name: "Kimi K2.5", context: 256000, efforts: null, cost: { input: 0.6, output: 3, cacheRead: 0.1, cacheWrite: 0 }, modalities: ["text", "image"] },
2636
+ "moonshotai/Kimi-K2.6": { name: "Kimi K2.6", context: 256000, efforts: null, cost: { input: 0.95, output: 4, cacheRead: 0.16, cacheWrite: 0 }, modalities: ["text", "image"] },
2637
+ "moonshotai/Kimi-K2.7-Code": { name: "Kimi K2.7 Code", context: 256000, efforts: null, cost: { input: 0.95, output: 4, cacheRead: 0.19, cacheWrite: 0 }, modalities: ["text", "image"] },
2638
+ "moonshotai/Kimi-K2.7-Code-Highspeed": { name: "Kimi K2.7 Code HighSpeed", context: 262000, efforts: null, cost: { input: 1.9, output: 8, cacheRead: 0.38, cacheWrite: 0 }, modalities: ["text", "image"] },
2639
+ "moonshotai/Kimi-K3": { name: "Kimi K3", context: 1e6, efforts: ["low", "high", "max"], cost: { input: 3, output: 15, cacheRead: 0.3, cacheWrite: 0 }, modalities: ["text", "image"] },
2640
+ "nvidia/nemotron-3-ultra-550b-a55b": { name: "Nemotron 3 Ultra", context: 1e6, efforts: null, cost: { input: 0.6, output: 2.4, cacheRead: 0.12, cacheWrite: 0 }, modalities: ["text"] },
2641
+ "poolside/laguna-s-2.1-free": { name: "Laguna S 2.1", context: 256000, efforts: null, cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, modalities: ["text"] },
2642
+ "Qwen/Qwen3.6-Max-Preview": { name: "Qwen 3.6 Max Preview", context: 0, efforts: null, cost: { input: 1.3, output: 7.8, cacheRead: 0.26, cacheWrite: 1.63 }, modalities: ["text"] },
2643
+ "Qwen/Qwen3.6-Plus": { name: "Qwen 3.6 Plus", context: 0, efforts: null, cost: { input: 0.5, output: 3, cacheRead: 0.1, cacheWrite: 0 }, modalities: ["text", "image"] },
2644
+ "Qwen/Qwen3.7-Flash": { name: "Qwen 3.7 Flash", context: 1e6, efforts: null, cost: { input: 0.03, output: 0.13, cacheRead: 0.006, cacheWrite: 0.038 }, modalities: ["text", "image"] },
2645
+ "Qwen/Qwen3.7-Max": { name: "Qwen 3.7 Max", context: 1e6, efforts: null, cost: { input: 2.5, output: 7.5, cacheRead: 0.5, cacheWrite: 3.13 }, modalities: ["text"] },
2646
+ "Qwen/Qwen3.7-Plus": { name: "Qwen 3.7 Plus", context: 1e6, efforts: null, cost: { input: 0.4, output: 1.6, cacheRead: 0.08, cacheWrite: 0.5 }, modalities: ["text", "image"] },
2647
+ "Qwen/Qwen3.8-27B": { name: "Qwen 3.8 27B", context: 262000, efforts: ["low", "medium", "xhigh"], cost: { input: 0.4, output: 3, cacheRead: 0.04, cacheWrite: 0 }, modalities: ["text", "image"] },
2648
+ "Qwen/Qwen3.8-Flash": { name: "Qwen 3.8 Flash", context: 1e6, efforts: ["low", "medium", "xhigh"], cost: { input: 0.16, output: 0.47, cacheRead: 0.016, cacheWrite: 0 }, modalities: ["text", "image"] },
2649
+ "Qwen/Qwen3.8-Max": { name: "Qwen 3.8 Max", context: 1e6, efforts: ["low", "medium", "xhigh"], cost: { input: 2, output: 6, cacheRead: 0.25, cacheWrite: 2.5 }, modalities: ["text", "image"] },
2650
+ "Qwen/Qwen3.8-Max-0902": { name: "Qwen 3.8 Max 0902", context: 1e6, efforts: ["low", "medium", "xhigh"], cost: { input: 2, output: 6, cacheRead: 0.25, cacheWrite: 0 }, modalities: ["text", "image"] },
2651
+ "Qwen/Qwen3.8-Omni-Flash": { name: "Qwen 3.8 Omni Flash", context: 1e6, efforts: ["low", "medium", "xhigh"], cost: { input: 0.15, output: 0.47, cacheRead: 0.016, cacheWrite: 0 }, modalities: ["text", "image"] },
2652
+ "sakana/fugu-ultra": { name: "Fugu Ultra", context: 1e6, efforts: ["high", "xhigh"], cost: { input: 5, output: 30, cacheRead: 0.5, cacheWrite: 0 }, modalities: ["text", "image"] },
2653
+ "stealth/space-bunny-alpha": { name: "Space Bunny Alpha", context: 1e6, efforts: ["low", "medium", "high"], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, modalities: ["text", "image"] },
2654
+ "stepfun/Step-3.5-Flash": { name: "Step 3.5 Flash", context: 1e6, efforts: null, cost: { input: 0.1, output: 0.3, cacheRead: 0.02, cacheWrite: 0 }, modalities: ["text"] },
2655
+ "stepfun/Step-3.7-Flash": { name: "Step 3.7 Flash", context: 256000, efforts: null, cost: { input: 0.2, output: 1.15, cacheRead: 0.04, cacheWrite: 0 }, modalities: ["text", "image"] },
2656
+ "stepfun/Step-5-Preview": { name: "Step 5 Preview", context: 1e6, efforts: ["low", "medium", "high"], cost: { input: 1, output: 2.7, cacheRead: 0.05, cacheWrite: 0 }, modalities: ["text", "image"] },
2657
+ "tencent/hy3-paid": { name: "Tencent Hy3", context: 262000, efforts: null, cost: { input: 0.14, output: 0.58, cacheRead: 0.035, cacheWrite: 0 }, modalities: ["text"] },
2658
+ "tencent/hy4-preview": { name: "Tencent Hy4 Preview", context: 1050000, efforts: ["low", "medium", "high"], cost: { input: 0.834, output: 2.501, cacheRead: 0.042, cacheWrite: 0 }, modalities: ["text"] },
2659
+ "thinkingmachines/inkling": { name: "Inkling", context: 256000, efforts: null, cost: { input: 1, output: 4.05, cacheRead: 0.17, cacheWrite: 0 }, modalities: ["text", "image"] },
2660
+ "thinkingmachines/inkling-small": { name: "Inkling Small", context: 1e6, efforts: null, cost: { input: 0.5, output: 1.2, cacheRead: 0.1, cacheWrite: 0 }, modalities: ["text", "image"] },
2661
+ "xai/grok-4.5": { name: "Grok 4.5", context: 500000, efforts: ["low", "medium", "high"], cost: { input: 2, output: 6, cacheRead: 0.5, cacheWrite: 0 }, modalities: ["text", "image"] },
2662
+ "xai/grok-4.6": { name: "Grok 4.6", context: 500000, efforts: ["low", "medium", "high", "xhigh"], cost: { input: 2, output: 6, cacheRead: 0.5, cacheWrite: 0 }, modalities: ["text", "image"] },
2663
+ "xai/grok-4.7": { name: "Grok 4.7", context: 500000, efforts: ["low", "medium", "high", "xhigh"], cost: { input: 1.2, output: 3.6, cacheRead: 0.3, cacheWrite: 0 }, modalities: ["text", "image"] },
2664
+ "xiaomi/mimo-v2.5": { name: "MiMo V2.5", context: 1e6, efforts: null, cost: { input: 0.14, output: 0.28, cacheRead: 0.0028, cacheWrite: 0 }, modalities: ["text", "image"] },
2665
+ "xiaomi/mimo-v2.5-pro": { name: "MiMo V2.5 Pro", context: 1e6, efforts: null, cost: { input: 0.435, output: 0.87, cacheRead: 0.0036, cacheWrite: 0 }, modalities: ["text"] },
2666
+ "xiaomi/mimo-v2.6-flash": { name: "MiMo V2.6 Flash", context: 1050000, efforts: null, cost: { input: 0.14, output: 0.28, cacheRead: 0.0028, cacheWrite: 0 }, modalities: ["text", "image"] },
2667
+ "xiaomi/mimo-v2.6-pro": { name: "MiMo V2.6 Pro", context: 1050000, efforts: null, cost: { input: 0.435, output: 0.87, cacheRead: 0.0036, cacheWrite: 0 }, modalities: ["text", "image"] },
2668
+ "xiaomi/mimo-v2.6-pro-ultraspeed": { name: "MiMo V2.6 Pro UltraSpeed", context: 1050000, efforts: null, cost: { input: 4.35, output: 8.7, cacheRead: 0.036, cacheWrite: 0 }, modalities: ["text", "image"] },
2669
+ "z-ai/glm-5.3-flash": { name: "GLM-5.3 Flash", context: 1050000, efforts: ["low", "high", "max"], cost: { input: 0.15, output: 0.5, cacheRead: 0.03, cacheWrite: 0 }, modalities: ["text", "image"] },
2670
+ "z-ai/glm-5.3-flashx": { name: "GLM-5.3 FlashX", context: 1e6, efforts: ["low", "high", "max"], cost: { input: 0.37, output: 1.25, cacheRead: 0.075, cacheWrite: 0 }, modalities: ["text", "image"] },
2671
+ "zai-org/GLM-5": { name: "GLM-5", context: 200000, efforts: null, cost: { input: 1, output: 3.2, cacheRead: 0.2, cacheWrite: 0 }, modalities: ["text"] },
2672
+ "zai-org/GLM-5.1": { name: "GLM-5.1", context: 0, efforts: null, cost: { input: 1.4, output: 4.4, cacheRead: 0.26, cacheWrite: 0 }, modalities: ["text"] },
2673
+ "zai-org/GLM-5.2": { name: "GLM-5.2", context: 1e6, efforts: ["high", "max"], cost: { input: 1.4, output: 4.4, cacheRead: 0.26, cacheWrite: 0 }, modalities: ["text"] },
2674
+ "zai-org/GLM-5.2-Fast": { name: "GLM-5.2 Fast", context: 1e6, efforts: null, cost: { input: 3, output: 10.25, cacheRead: 0.5, cacheWrite: 0 }, modalities: ["text"] },
2675
+ "zai-org/GLM-5.3": { name: "GLM-5.3", context: 1e6, efforts: ["low", "high", "max"], cost: { input: 1.4, output: 4.4, cacheRead: 0.26, cacheWrite: 0 }, modalities: ["text"] }
2676
+ };
2677
+ var TEXT_ONLY = ["text"];
2678
+ function inputModalities(id) {
2679
+ return MODEL_CATALOG[id]?.modalities ?? TEXT_ONLY;
2680
+ }
2681
+ function supportsImage(id) {
2682
+ return inputModalities(id).includes("image");
2683
+ }
2684
+ function modelCost(id) {
2685
+ return MODEL_CATALOG[id]?.cost;
2686
+ }
2687
+ function reasoningVariants(id) {
2688
+ const efforts = MODEL_CATALOG[id]?.efforts;
2689
+ if (!efforts || efforts.length === 0)
2690
+ return;
2691
+ return Object.fromEntries(efforts.map((effort) => [effort, { reasoningEffort: effort }]));
2692
+ }
183
2693
  // ../core/gating.json
184
2694
  var gating_default = {
185
2695
  extractedAt: "2026-09-12T06:01:01.385Z",
@@ -545,7 +3055,6 @@ async function loadModels(key) {
545
3055
  }
546
3056
 
547
3057
  // src/v2.ts
548
- import { Plugin } from "@opencode/plugin";
549
3058
  var PLUGIN_ID = "command-code";
550
3059
  var PROVIDER_BASE = "https://api.commandcode.ai/provider/v1";
551
3060
  var INTEGRATION_ID = "command-code";
@@ -560,16 +3069,22 @@ var LANES = [
560
3069
  }
561
3070
  ];
562
3071
  var TOOL_DESCRIPTION = "Fetch live Command Code plan/usage: plan name, monthly credits, 5-hour & weekly windows, billing-period summary. Pass arg='plans' for the plan comparison table only, or extra cmduse flags (e.g. '--tz +05:30 daily').";
3072
+ function costEntry(id) {
3073
+ const cost = modelCost(id);
3074
+ return cost ? [{ input: cost.input, output: cost.output, cache: { read: cost.cacheRead, write: cost.cacheWrite } }] : [];
3075
+ }
563
3076
  function toV2Model(m, lane) {
3077
+ const efforts = reasoningVariants(m.id);
3078
+ const variants = efforts ? Object.entries(efforts).map(([id, settings]) => ({ id, settings })) : [];
564
3079
  const info = {
565
3080
  id: m.id,
566
3081
  modelID: m.id,
567
3082
  providerID: lane.id,
568
3083
  name: m.name,
569
- capabilities: { tools: true, input: ["text"], output: ["text"] },
570
- variants: [],
3084
+ capabilities: { tools: true, input: [...inputModalities(m.id)], output: ["text"] },
3085
+ variants,
571
3086
  time: { released: 0 },
572
- cost: [],
3087
+ cost: costEntry(m.id),
573
3088
  status: "active",
574
3089
  enabled: true,
575
3090
  limit: { context: m.contextLength || 128000, output: 32000 },
@@ -605,7 +3120,7 @@ async function credentialKey(ctx) {
605
3120
  return;
606
3121
  }
607
3122
  }
608
- var commandCodeV2 = Plugin.define({
3123
+ var commandCodeV2 = {
609
3124
  id: PLUGIN_ID,
610
3125
  async setup(ctx) {
611
3126
  let localKey;
@@ -705,9 +3220,12 @@ var commandCodeV2 = Plugin.define({
705
3220
  clearInterval(timer);
706
3221
  };
707
3222
  }
708
- });
3223
+ };
709
3224
 
710
3225
  // src/index.ts
3226
+ function tool(input) {
3227
+ return input;
3228
+ }
711
3229
  var MODEL_CAPABILITIES = {
712
3230
  temperature: true,
713
3231
  reasoning: true,
@@ -716,6 +3234,14 @@ var MODEL_CAPABILITIES = {
716
3234
  input: { text: true, audio: false, image: false, video: false, pdf: false },
717
3235
  output: { text: true, audio: false, image: false, video: false, pdf: false }
718
3236
  };
3237
+ function costFor(id) {
3238
+ const cost = modelCost(id);
3239
+ return {
3240
+ input: cost?.input ?? 0,
3241
+ output: cost?.output ?? 0,
3242
+ cache: { read: cost?.cacheRead ?? 0, write: cost?.cacheWrite ?? 0 }
3243
+ };
3244
+ }
719
3245
  function toModelDefs(models, providerID, npm, interleaved = false) {
720
3246
  return Object.fromEntries(models.map((m) => [
721
3247
  m.id,
@@ -724,8 +3250,12 @@ function toModelDefs(models, providerID, npm, interleaved = false) {
724
3250
  providerID,
725
3251
  api: { id: m.id, url: PROVIDER_BASE, npm },
726
3252
  name: m.name,
727
- capabilities: { ...MODEL_CAPABILITIES, interleaved },
728
- cost: { input: 0, output: 0, cache: { read: 0, write: 0 } },
3253
+ capabilities: {
3254
+ ...MODEL_CAPABILITIES,
3255
+ interleaved,
3256
+ ...supportsImage(m.id) ? { attachment: true, input: { ...MODEL_CAPABILITIES.input, image: true } } : {}
3257
+ },
3258
+ cost: costFor(m.id),
729
3259
  limit: { context: m.contextLength || 128000, output: 32000 },
730
3260
  status: "active",
731
3261
  options: {},
@@ -827,9 +3357,9 @@ var CommandCodePlugin = async (_input) => {
827
3357
  },
828
3358
  tool: {
829
3359
  cmd_usage: tool({
830
- description: "Fetch live Command Code plan/usage: plan name, monthly credits, 5-hour & weekly windows, billing-period summary. Pass arg=plans for the plan comparison table only.",
3360
+ description: TOOL_DESCRIPTION,
831
3361
  args: {
832
- arg: tool.schema.string().optional().describe("Optional: 'plans' for the plan table only, or extra cmduse flags")
3362
+ arg: string2().optional().describe("Optional: 'plans' for the plan table only, or extra cmduse flags")
833
3363
  },
834
3364
  async execute(args) {
835
3365
  const key = await resolveKey();