@qihongmu/dsh-client-remotes-scheduled-task 0.1.0

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/lib/client.js ADDED
@@ -0,0 +1,4391 @@
1
+ window.__ModuleLoader__.load({
2
+ id: "@qihongmu/dsh-client-remotes-scheduled-task",
3
+ factory: (require) => {
4
+ var module = { exports: {} };
5
+ var exports = module.exports;
6
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
7
+ //#region ../../../../deepseek-harness/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
8
+ var _a$1;
9
+ function $constructor(name, initializer, params) {
10
+ function init(inst, def) {
11
+ if (!inst._zod) Object.defineProperty(inst, "_zod", {
12
+ value: {
13
+ def,
14
+ constr: _,
15
+ traits: /* @__PURE__ */ new Set()
16
+ },
17
+ enumerable: false
18
+ });
19
+ if (inst._zod.traits.has(name)) return;
20
+ inst._zod.traits.add(name);
21
+ initializer(inst, def);
22
+ const proto = _.prototype;
23
+ const keys = Object.keys(proto);
24
+ for (let i = 0; i < keys.length; i++) {
25
+ const k = keys[i];
26
+ if (!(k in inst)) inst[k] = proto[k].bind(inst);
27
+ }
28
+ }
29
+ const Parent = params?.Parent ?? Object;
30
+ class Definition extends Parent {}
31
+ Object.defineProperty(Definition, "name", { value: name });
32
+ function _(def) {
33
+ var _a;
34
+ const inst = params?.Parent ? new Definition() : this;
35
+ init(inst, def);
36
+ (_a = inst._zod).deferred ?? (_a.deferred = []);
37
+ for (const fn of inst._zod.deferred) fn();
38
+ return inst;
39
+ }
40
+ Object.defineProperty(_, "init", { value: init });
41
+ Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => {
42
+ if (params?.Parent && inst instanceof params.Parent) return true;
43
+ return inst?._zod?.traits?.has(name);
44
+ } });
45
+ Object.defineProperty(_, "name", { value: name });
46
+ return _;
47
+ }
48
+ var $ZodAsyncError = class extends Error {
49
+ constructor() {
50
+ super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
51
+ }
52
+ };
53
+ var $ZodEncodeError = class extends Error {
54
+ constructor(name) {
55
+ super(`Encountered unidirectional transform during encode: ${name}`);
56
+ this.name = "ZodEncodeError";
57
+ }
58
+ };
59
+ (_a$1 = globalThis).__zod_globalConfig ?? (_a$1.__zod_globalConfig = {});
60
+ const globalConfig = globalThis.__zod_globalConfig;
61
+ function config(newConfig) {
62
+ if (newConfig) Object.assign(globalConfig, newConfig);
63
+ return globalConfig;
64
+ }
65
+ //#endregion
66
+ //#region ../../../../deepseek-harness/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js
67
+ function getEnumValues(entries) {
68
+ const numericValues = Object.values(entries).filter((v) => typeof v === "number");
69
+ return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
70
+ }
71
+ function jsonStringifyReplacer(_, value) {
72
+ if (typeof value === "bigint") return value.toString();
73
+ return value;
74
+ }
75
+ function cached(getter) {
76
+ return { get value() {
77
+ {
78
+ const value = getter();
79
+ Object.defineProperty(this, "value", { value });
80
+ return value;
81
+ }
82
+ throw new Error("cached value already set");
83
+ } };
84
+ }
85
+ function nullish(input) {
86
+ return input === null || input === void 0;
87
+ }
88
+ function cleanRegex(source) {
89
+ const start = source.startsWith("^") ? 1 : 0;
90
+ const end = source.endsWith("$") ? source.length - 1 : source.length;
91
+ return source.slice(start, end);
92
+ }
93
+ function floatSafeRemainder(val, step) {
94
+ const ratio = val / step;
95
+ const roundedRatio = Math.round(ratio);
96
+ const tolerance = Number.EPSILON * Math.max(Math.abs(ratio), 1);
97
+ if (Math.abs(ratio - roundedRatio) < tolerance) return 0;
98
+ return ratio - roundedRatio;
99
+ }
100
+ const EVALUATING = /* @__PURE__*/ Symbol("evaluating");
101
+ function defineLazy(object, key, getter) {
102
+ let value = void 0;
103
+ Object.defineProperty(object, key, {
104
+ get() {
105
+ if (value === EVALUATING) return;
106
+ if (value === void 0) {
107
+ value = EVALUATING;
108
+ value = getter();
109
+ }
110
+ return value;
111
+ },
112
+ set(v) {
113
+ Object.defineProperty(object, key, { value: v });
114
+ },
115
+ configurable: true
116
+ });
117
+ }
118
+ function assignProp(target, prop, value) {
119
+ Object.defineProperty(target, prop, {
120
+ value,
121
+ writable: true,
122
+ enumerable: true,
123
+ configurable: true
124
+ });
125
+ }
126
+ function mergeDefs(...defs) {
127
+ const mergedDescriptors = {};
128
+ for (const def of defs) Object.assign(mergedDescriptors, Object.getOwnPropertyDescriptors(def));
129
+ return Object.defineProperties({}, mergedDescriptors);
130
+ }
131
+ function esc(str) {
132
+ return JSON.stringify(str);
133
+ }
134
+ function slugify(input) {
135
+ return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
136
+ }
137
+ const captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {};
138
+ function isObject(data) {
139
+ return typeof data === "object" && data !== null && !Array.isArray(data);
140
+ }
141
+ const allowsEval = /* @__PURE__*/ cached(() => {
142
+ if (globalConfig.jitless) return false;
143
+ if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) return false;
144
+ try {
145
+ new Function("");
146
+ return true;
147
+ } catch (_) {
148
+ return false;
149
+ }
150
+ });
151
+ function isPlainObject(o) {
152
+ if (isObject(o) === false) return false;
153
+ const ctor = o.constructor;
154
+ if (ctor === void 0) return true;
155
+ if (typeof ctor !== "function") return true;
156
+ const prot = ctor.prototype;
157
+ if (isObject(prot) === false) return false;
158
+ if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) return false;
159
+ return true;
160
+ }
161
+ function shallowClone(o) {
162
+ if (isPlainObject(o)) return { ...o };
163
+ if (Array.isArray(o)) return [...o];
164
+ if (o instanceof Map) return new Map(o);
165
+ if (o instanceof Set) return new Set(o);
166
+ return o;
167
+ }
168
+ const propertyKeyTypes = /* @__PURE__*/ new Set([
169
+ "string",
170
+ "number",
171
+ "symbol"
172
+ ]);
173
+ function escapeRegex(str) {
174
+ return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
175
+ }
176
+ function clone(inst, def, params) {
177
+ const cl = new inst._zod.constr(def ?? inst._zod.def);
178
+ if (!def || params?.parent) cl._zod.parent = inst;
179
+ return cl;
180
+ }
181
+ function normalizeParams(_params) {
182
+ const params = _params;
183
+ if (!params) return {};
184
+ if (typeof params === "string") return { error: () => params };
185
+ if (params?.message !== void 0) {
186
+ if (params?.error !== void 0) throw new Error("Cannot specify both `message` and `error` params");
187
+ params.error = params.message;
188
+ }
189
+ delete params.message;
190
+ if (typeof params.error === "string") return {
191
+ ...params,
192
+ error: () => params.error
193
+ };
194
+ return params;
195
+ }
196
+ function optionalKeys(shape) {
197
+ return Object.keys(shape).filter((k) => {
198
+ return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
199
+ });
200
+ }
201
+ const NUMBER_FORMAT_RANGES = {
202
+ safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
203
+ int32: [-2147483648, 2147483647],
204
+ uint32: [0, 4294967295],
205
+ float32: [-34028234663852886e22, 34028234663852886e22],
206
+ float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
207
+ };
208
+ function pick(schema, mask) {
209
+ const currDef = schema._zod.def;
210
+ const checks = currDef.checks;
211
+ if (checks && checks.length > 0) throw new Error(".pick() cannot be used on object schemas containing refinements");
212
+ return clone(schema, mergeDefs(schema._zod.def, {
213
+ get shape() {
214
+ const newShape = {};
215
+ for (const key in mask) {
216
+ if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`);
217
+ if (!mask[key]) continue;
218
+ newShape[key] = currDef.shape[key];
219
+ }
220
+ assignProp(this, "shape", newShape);
221
+ return newShape;
222
+ },
223
+ checks: []
224
+ }));
225
+ }
226
+ function omit(schema, mask) {
227
+ const currDef = schema._zod.def;
228
+ const checks = currDef.checks;
229
+ if (checks && checks.length > 0) throw new Error(".omit() cannot be used on object schemas containing refinements");
230
+ return clone(schema, mergeDefs(schema._zod.def, {
231
+ get shape() {
232
+ const newShape = { ...schema._zod.def.shape };
233
+ for (const key in mask) {
234
+ if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`);
235
+ if (!mask[key]) continue;
236
+ delete newShape[key];
237
+ }
238
+ assignProp(this, "shape", newShape);
239
+ return newShape;
240
+ },
241
+ checks: []
242
+ }));
243
+ }
244
+ function extend(schema, shape) {
245
+ if (!isPlainObject(shape)) throw new Error("Invalid input to extend: expected a plain object");
246
+ const checks = schema._zod.def.checks;
247
+ if (checks && checks.length > 0) {
248
+ const existingShape = schema._zod.def.shape;
249
+ for (const key in shape) if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
250
+ }
251
+ return clone(schema, mergeDefs(schema._zod.def, { get shape() {
252
+ const _shape = {
253
+ ...schema._zod.def.shape,
254
+ ...shape
255
+ };
256
+ assignProp(this, "shape", _shape);
257
+ return _shape;
258
+ } }));
259
+ }
260
+ function safeExtend(schema, shape) {
261
+ if (!isPlainObject(shape)) throw new Error("Invalid input to safeExtend: expected a plain object");
262
+ return clone(schema, mergeDefs(schema._zod.def, { get shape() {
263
+ const _shape = {
264
+ ...schema._zod.def.shape,
265
+ ...shape
266
+ };
267
+ assignProp(this, "shape", _shape);
268
+ return _shape;
269
+ } }));
270
+ }
271
+ function merge(a, b) {
272
+ if (a._zod.def.checks?.length) throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
273
+ return clone(a, mergeDefs(a._zod.def, {
274
+ get shape() {
275
+ const _shape = {
276
+ ...a._zod.def.shape,
277
+ ...b._zod.def.shape
278
+ };
279
+ assignProp(this, "shape", _shape);
280
+ return _shape;
281
+ },
282
+ get catchall() {
283
+ return b._zod.def.catchall;
284
+ },
285
+ checks: b._zod.def.checks ?? []
286
+ }));
287
+ }
288
+ function partial(Class, schema, mask) {
289
+ const checks = schema._zod.def.checks;
290
+ if (checks && checks.length > 0) throw new Error(".partial() cannot be used on object schemas containing refinements");
291
+ return clone(schema, mergeDefs(schema._zod.def, {
292
+ get shape() {
293
+ const oldShape = schema._zod.def.shape;
294
+ const shape = { ...oldShape };
295
+ if (mask) for (const key in mask) {
296
+ if (!(key in oldShape)) throw new Error(`Unrecognized key: "${key}"`);
297
+ if (!mask[key]) continue;
298
+ shape[key] = Class ? new Class({
299
+ type: "optional",
300
+ innerType: oldShape[key]
301
+ }) : oldShape[key];
302
+ }
303
+ else for (const key in oldShape) shape[key] = Class ? new Class({
304
+ type: "optional",
305
+ innerType: oldShape[key]
306
+ }) : oldShape[key];
307
+ assignProp(this, "shape", shape);
308
+ return shape;
309
+ },
310
+ checks: []
311
+ }));
312
+ }
313
+ function required(Class, schema, mask) {
314
+ return clone(schema, mergeDefs(schema._zod.def, { get shape() {
315
+ const oldShape = schema._zod.def.shape;
316
+ const shape = { ...oldShape };
317
+ if (mask) for (const key in mask) {
318
+ if (!(key in shape)) throw new Error(`Unrecognized key: "${key}"`);
319
+ if (!mask[key]) continue;
320
+ shape[key] = new Class({
321
+ type: "nonoptional",
322
+ innerType: oldShape[key]
323
+ });
324
+ }
325
+ else for (const key in oldShape) shape[key] = new Class({
326
+ type: "nonoptional",
327
+ innerType: oldShape[key]
328
+ });
329
+ assignProp(this, "shape", shape);
330
+ return shape;
331
+ } }));
332
+ }
333
+ function aborted(x, startIndex = 0) {
334
+ if (x.aborted === true) return true;
335
+ for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue !== true) return true;
336
+ return false;
337
+ }
338
+ function explicitlyAborted(x, startIndex = 0) {
339
+ if (x.aborted === true) return true;
340
+ for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue === false) return true;
341
+ return false;
342
+ }
343
+ function prefixIssues(path, issues) {
344
+ return issues.map((iss) => {
345
+ var _a;
346
+ (_a = iss).path ?? (_a.path = []);
347
+ iss.path.unshift(path);
348
+ return iss;
349
+ });
350
+ }
351
+ function unwrapMessage(message) {
352
+ return typeof message === "string" ? message : message?.message;
353
+ }
354
+ function finalizeIssue(iss, ctx, config) {
355
+ const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input";
356
+ const { inst: _inst, continue: _continue, input: _input, ...rest } = iss;
357
+ rest.path ?? (rest.path = []);
358
+ rest.message = message;
359
+ if (ctx?.reportInput) rest.input = _input;
360
+ return rest;
361
+ }
362
+ function getLengthableOrigin(input) {
363
+ if (Array.isArray(input)) return "array";
364
+ if (typeof input === "string") return "string";
365
+ return "unknown";
366
+ }
367
+ function issue(...args) {
368
+ const [iss, input, inst] = args;
369
+ if (typeof iss === "string") return {
370
+ message: iss,
371
+ code: "custom",
372
+ input,
373
+ inst
374
+ };
375
+ return { ...iss };
376
+ }
377
+ //#endregion
378
+ //#region ../../../../deepseek-harness/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.js
379
+ const initializer$1 = (inst, def) => {
380
+ inst.name = "$ZodError";
381
+ Object.defineProperty(inst, "_zod", {
382
+ value: inst._zod,
383
+ enumerable: false
384
+ });
385
+ Object.defineProperty(inst, "issues", {
386
+ value: def,
387
+ enumerable: false
388
+ });
389
+ inst.message = JSON.stringify(def, jsonStringifyReplacer, 2);
390
+ Object.defineProperty(inst, "toString", {
391
+ value: () => inst.message,
392
+ enumerable: false
393
+ });
394
+ };
395
+ const $ZodError = $constructor("$ZodError", initializer$1);
396
+ const $ZodRealError = $constructor("$ZodError", initializer$1, { Parent: Error });
397
+ function flattenError(error, mapper = (issue) => issue.message) {
398
+ const fieldErrors = {};
399
+ const formErrors = [];
400
+ for (const sub of error.issues) if (sub.path.length > 0) {
401
+ fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
402
+ fieldErrors[sub.path[0]].push(mapper(sub));
403
+ } else formErrors.push(mapper(sub));
404
+ return {
405
+ formErrors,
406
+ fieldErrors
407
+ };
408
+ }
409
+ function formatError(error, mapper = (issue) => issue.message) {
410
+ const fieldErrors = { _errors: [] };
411
+ const processError = (error, path = []) => {
412
+ for (const issue of error.issues) if (issue.code === "invalid_union" && issue.errors.length) issue.errors.map((issues) => processError({ issues }, [...path, ...issue.path]));
413
+ else if (issue.code === "invalid_key") processError({ issues: issue.issues }, [...path, ...issue.path]);
414
+ else if (issue.code === "invalid_element") processError({ issues: issue.issues }, [...path, ...issue.path]);
415
+ else {
416
+ const fullpath = [...path, ...issue.path];
417
+ if (fullpath.length === 0) fieldErrors._errors.push(mapper(issue));
418
+ else {
419
+ let curr = fieldErrors;
420
+ let i = 0;
421
+ while (i < fullpath.length) {
422
+ const el = fullpath[i];
423
+ if (!(i === fullpath.length - 1)) curr[el] = curr[el] || { _errors: [] };
424
+ else {
425
+ curr[el] = curr[el] || { _errors: [] };
426
+ curr[el]._errors.push(mapper(issue));
427
+ }
428
+ curr = curr[el];
429
+ i++;
430
+ }
431
+ }
432
+ }
433
+ };
434
+ processError(error);
435
+ return fieldErrors;
436
+ }
437
+ //#endregion
438
+ //#region ../../../../deepseek-harness/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/parse.js
439
+ const _parse = (_Err) => (schema, value, _ctx, _params) => {
440
+ const ctx = _ctx ? {
441
+ ..._ctx,
442
+ async: false
443
+ } : { async: false };
444
+ const result = schema._zod.run({
445
+ value,
446
+ issues: []
447
+ }, ctx);
448
+ if (result instanceof Promise) throw new $ZodAsyncError();
449
+ if (result.issues.length) {
450
+ const e = new ((_params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
451
+ captureStackTrace(e, _params?.callee);
452
+ throw e;
453
+ }
454
+ return result.value;
455
+ };
456
+ const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
457
+ const ctx = _ctx ? {
458
+ ..._ctx,
459
+ async: true
460
+ } : { async: true };
461
+ let result = schema._zod.run({
462
+ value,
463
+ issues: []
464
+ }, ctx);
465
+ if (result instanceof Promise) result = await result;
466
+ if (result.issues.length) {
467
+ const e = new ((params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
468
+ captureStackTrace(e, params?.callee);
469
+ throw e;
470
+ }
471
+ return result.value;
472
+ };
473
+ const _safeParse = (_Err) => (schema, value, _ctx) => {
474
+ const ctx = _ctx ? {
475
+ ..._ctx,
476
+ async: false
477
+ } : { async: false };
478
+ const result = schema._zod.run({
479
+ value,
480
+ issues: []
481
+ }, ctx);
482
+ if (result instanceof Promise) throw new $ZodAsyncError();
483
+ return result.issues.length ? {
484
+ success: false,
485
+ error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
486
+ } : {
487
+ success: true,
488
+ data: result.value
489
+ };
490
+ };
491
+ const safeParse$1 = /* @__PURE__*/ _safeParse($ZodRealError);
492
+ const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
493
+ const ctx = _ctx ? {
494
+ ..._ctx,
495
+ async: true
496
+ } : { async: true };
497
+ let result = schema._zod.run({
498
+ value,
499
+ issues: []
500
+ }, ctx);
501
+ if (result instanceof Promise) result = await result;
502
+ return result.issues.length ? {
503
+ success: false,
504
+ error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
505
+ } : {
506
+ success: true,
507
+ data: result.value
508
+ };
509
+ };
510
+ const safeParseAsync$1 = /* @__PURE__*/ _safeParseAsync($ZodRealError);
511
+ const _encode = (_Err) => (schema, value, _ctx) => {
512
+ const ctx = _ctx ? {
513
+ ..._ctx,
514
+ direction: "backward"
515
+ } : { direction: "backward" };
516
+ return _parse(_Err)(schema, value, ctx);
517
+ };
518
+ const _decode = (_Err) => (schema, value, _ctx) => {
519
+ return _parse(_Err)(schema, value, _ctx);
520
+ };
521
+ const _encodeAsync = (_Err) => async (schema, value, _ctx) => {
522
+ const ctx = _ctx ? {
523
+ ..._ctx,
524
+ direction: "backward"
525
+ } : { direction: "backward" };
526
+ return _parseAsync(_Err)(schema, value, ctx);
527
+ };
528
+ const _decodeAsync = (_Err) => async (schema, value, _ctx) => {
529
+ return _parseAsync(_Err)(schema, value, _ctx);
530
+ };
531
+ const _safeEncode = (_Err) => (schema, value, _ctx) => {
532
+ const ctx = _ctx ? {
533
+ ..._ctx,
534
+ direction: "backward"
535
+ } : { direction: "backward" };
536
+ return _safeParse(_Err)(schema, value, ctx);
537
+ };
538
+ const _safeDecode = (_Err) => (schema, value, _ctx) => {
539
+ return _safeParse(_Err)(schema, value, _ctx);
540
+ };
541
+ const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
542
+ const ctx = _ctx ? {
543
+ ..._ctx,
544
+ direction: "backward"
545
+ } : { direction: "backward" };
546
+ return _safeParseAsync(_Err)(schema, value, ctx);
547
+ };
548
+ const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
549
+ return _safeParseAsync(_Err)(schema, value, _ctx);
550
+ };
551
+ //#endregion
552
+ //#region ../../../../deepseek-harness/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/regexes.js
553
+ /**
554
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
555
+ * (timestamps embedded in the id). Use {@link cuid2} instead.
556
+ * See https://github.com/paralleldrive/cuid.
557
+ */
558
+ const cuid = /^[cC][0-9a-z]{6,}$/;
559
+ const cuid2 = /^[0-9a-z]+$/;
560
+ const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
561
+ const xid = /^[0-9a-vA-V]{20}$/;
562
+ const ksuid = /^[A-Za-z0-9]{27}$/;
563
+ const nanoid = /^[a-zA-Z0-9_-]{21}$/;
564
+ /** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */
565
+ const duration$1 = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
566
+ /** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */
567
+ const 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})$/;
568
+ /** Returns a regex for validating an RFC 9562/4122 UUID.
569
+ *
570
+ * @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
571
+ const uuid = (version) => {
572
+ if (!version) 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)$/;
573
+ 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})$`);
574
+ };
575
+ /** Practical email validation */
576
+ const email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
577
+ const _emoji$1 = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
578
+ function emoji() {
579
+ return new RegExp(_emoji$1, "u");
580
+ }
581
+ const 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])$/;
582
+ const 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}|:))$/;
583
+ const 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])$/;
584
+ const 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])$/;
585
+ const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
586
+ const base64url = /^[A-Za-z0-9_-]*$/;
587
+ const httpProtocol = /^https?$/;
588
+ const e164 = /^\+[1-9]\d{6,14}$/;
589
+ const 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])))`;
590
+ const date$1 = /*@__PURE__*/ new RegExp(`^${dateSource}$`);
591
+ function timeSource(args) {
592
+ const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
593
+ return 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+)?)?`;
594
+ }
595
+ function time$1(args) {
596
+ return new RegExp(`^${timeSource(args)}$`);
597
+ }
598
+ function datetime$1(args) {
599
+ const time = timeSource({ precision: args.precision });
600
+ const opts = ["Z"];
601
+ if (args.local) opts.push("");
602
+ if (args.offset) opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
603
+ const timeRegex = `${time}(?:${opts.join("|")})`;
604
+ return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
605
+ }
606
+ const string$1 = (params) => {
607
+ const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
608
+ return new RegExp(`^${regex}$`);
609
+ };
610
+ const integer = /^-?\d+$/;
611
+ const number$1 = /^-?\d+(?:\.\d+)?$/;
612
+ const boolean$1 = /^(?:true|false)$/i;
613
+ const lowercase = /^[^A-Z]*$/;
614
+ const uppercase = /^[^a-z]*$/;
615
+ //#endregion
616
+ //#region ../../../../deepseek-harness/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/checks.js
617
+ const $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
618
+ var _a;
619
+ inst._zod ?? (inst._zod = {});
620
+ inst._zod.def = def;
621
+ (_a = inst._zod).onattach ?? (_a.onattach = []);
622
+ });
623
+ const numericOriginMap = {
624
+ number: "number",
625
+ bigint: "bigint",
626
+ object: "date"
627
+ };
628
+ const $ZodCheckLessThan = /*@__PURE__*/ $constructor("$ZodCheckLessThan", (inst, def) => {
629
+ $ZodCheck.init(inst, def);
630
+ const origin = numericOriginMap[typeof def.value];
631
+ inst._zod.onattach.push((inst) => {
632
+ const bag = inst._zod.bag;
633
+ const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
634
+ if (def.value < curr) if (def.inclusive) bag.maximum = def.value;
635
+ else bag.exclusiveMaximum = def.value;
636
+ });
637
+ inst._zod.check = (payload) => {
638
+ if (def.inclusive ? payload.value <= def.value : payload.value < def.value) return;
639
+ payload.issues.push({
640
+ origin,
641
+ code: "too_big",
642
+ maximum: typeof def.value === "object" ? def.value.getTime() : def.value,
643
+ input: payload.value,
644
+ inclusive: def.inclusive,
645
+ inst,
646
+ continue: !def.abort
647
+ });
648
+ };
649
+ });
650
+ const $ZodCheckGreaterThan = /*@__PURE__*/ $constructor("$ZodCheckGreaterThan", (inst, def) => {
651
+ $ZodCheck.init(inst, def);
652
+ const origin = numericOriginMap[typeof def.value];
653
+ inst._zod.onattach.push((inst) => {
654
+ const bag = inst._zod.bag;
655
+ const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
656
+ if (def.value > curr) if (def.inclusive) bag.minimum = def.value;
657
+ else bag.exclusiveMinimum = def.value;
658
+ });
659
+ inst._zod.check = (payload) => {
660
+ if (def.inclusive ? payload.value >= def.value : payload.value > def.value) return;
661
+ payload.issues.push({
662
+ origin,
663
+ code: "too_small",
664
+ minimum: typeof def.value === "object" ? def.value.getTime() : def.value,
665
+ input: payload.value,
666
+ inclusive: def.inclusive,
667
+ inst,
668
+ continue: !def.abort
669
+ });
670
+ };
671
+ });
672
+ const $ZodCheckMultipleOf = /*@__PURE__*/ $constructor("$ZodCheckMultipleOf", (inst, def) => {
673
+ $ZodCheck.init(inst, def);
674
+ inst._zod.onattach.push((inst) => {
675
+ var _a;
676
+ (_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
677
+ });
678
+ inst._zod.check = (payload) => {
679
+ if (typeof payload.value !== typeof def.value) throw new Error("Cannot mix number and bigint in multiple_of check.");
680
+ if (typeof payload.value === "bigint" ? payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0) return;
681
+ payload.issues.push({
682
+ origin: typeof payload.value,
683
+ code: "not_multiple_of",
684
+ divisor: def.value,
685
+ input: payload.value,
686
+ inst,
687
+ continue: !def.abort
688
+ });
689
+ };
690
+ });
691
+ const $ZodCheckNumberFormat = /*@__PURE__*/ $constructor("$ZodCheckNumberFormat", (inst, def) => {
692
+ $ZodCheck.init(inst, def);
693
+ def.format = def.format || "float64";
694
+ const isInt = def.format?.includes("int");
695
+ const origin = isInt ? "int" : "number";
696
+ const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
697
+ inst._zod.onattach.push((inst) => {
698
+ const bag = inst._zod.bag;
699
+ bag.format = def.format;
700
+ bag.minimum = minimum;
701
+ bag.maximum = maximum;
702
+ if (isInt) bag.pattern = integer;
703
+ });
704
+ inst._zod.check = (payload) => {
705
+ const input = payload.value;
706
+ if (isInt) {
707
+ if (!Number.isInteger(input)) {
708
+ payload.issues.push({
709
+ expected: origin,
710
+ format: def.format,
711
+ code: "invalid_type",
712
+ continue: false,
713
+ input,
714
+ inst
715
+ });
716
+ return;
717
+ }
718
+ if (!Number.isSafeInteger(input)) {
719
+ if (input > 0) payload.issues.push({
720
+ input,
721
+ code: "too_big",
722
+ maximum: Number.MAX_SAFE_INTEGER,
723
+ note: "Integers must be within the safe integer range.",
724
+ inst,
725
+ origin,
726
+ inclusive: true,
727
+ continue: !def.abort
728
+ });
729
+ else payload.issues.push({
730
+ input,
731
+ code: "too_small",
732
+ minimum: Number.MIN_SAFE_INTEGER,
733
+ note: "Integers must be within the safe integer range.",
734
+ inst,
735
+ origin,
736
+ inclusive: true,
737
+ continue: !def.abort
738
+ });
739
+ return;
740
+ }
741
+ }
742
+ if (input < minimum) payload.issues.push({
743
+ origin: "number",
744
+ input,
745
+ code: "too_small",
746
+ minimum,
747
+ inclusive: true,
748
+ inst,
749
+ continue: !def.abort
750
+ });
751
+ if (input > maximum) payload.issues.push({
752
+ origin: "number",
753
+ input,
754
+ code: "too_big",
755
+ maximum,
756
+ inclusive: true,
757
+ inst,
758
+ continue: !def.abort
759
+ });
760
+ };
761
+ });
762
+ const $ZodCheckMaxLength = /*@__PURE__*/ $constructor("$ZodCheckMaxLength", (inst, def) => {
763
+ var _a;
764
+ $ZodCheck.init(inst, def);
765
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
766
+ const val = payload.value;
767
+ return !nullish(val) && val.length !== void 0;
768
+ });
769
+ inst._zod.onattach.push((inst) => {
770
+ const curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
771
+ if (def.maximum < curr) inst._zod.bag.maximum = def.maximum;
772
+ });
773
+ inst._zod.check = (payload) => {
774
+ const input = payload.value;
775
+ if (input.length <= def.maximum) return;
776
+ const origin = getLengthableOrigin(input);
777
+ payload.issues.push({
778
+ origin,
779
+ code: "too_big",
780
+ maximum: def.maximum,
781
+ inclusive: true,
782
+ input,
783
+ inst,
784
+ continue: !def.abort
785
+ });
786
+ };
787
+ });
788
+ const $ZodCheckMinLength = /*@__PURE__*/ $constructor("$ZodCheckMinLength", (inst, def) => {
789
+ var _a;
790
+ $ZodCheck.init(inst, def);
791
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
792
+ const val = payload.value;
793
+ return !nullish(val) && val.length !== void 0;
794
+ });
795
+ inst._zod.onattach.push((inst) => {
796
+ const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
797
+ if (def.minimum > curr) inst._zod.bag.minimum = def.minimum;
798
+ });
799
+ inst._zod.check = (payload) => {
800
+ const input = payload.value;
801
+ if (input.length >= def.minimum) return;
802
+ const origin = getLengthableOrigin(input);
803
+ payload.issues.push({
804
+ origin,
805
+ code: "too_small",
806
+ minimum: def.minimum,
807
+ inclusive: true,
808
+ input,
809
+ inst,
810
+ continue: !def.abort
811
+ });
812
+ };
813
+ });
814
+ const $ZodCheckLengthEquals = /*@__PURE__*/ $constructor("$ZodCheckLengthEquals", (inst, def) => {
815
+ var _a;
816
+ $ZodCheck.init(inst, def);
817
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
818
+ const val = payload.value;
819
+ return !nullish(val) && val.length !== void 0;
820
+ });
821
+ inst._zod.onattach.push((inst) => {
822
+ const bag = inst._zod.bag;
823
+ bag.minimum = def.length;
824
+ bag.maximum = def.length;
825
+ bag.length = def.length;
826
+ });
827
+ inst._zod.check = (payload) => {
828
+ const input = payload.value;
829
+ const length = input.length;
830
+ if (length === def.length) return;
831
+ const origin = getLengthableOrigin(input);
832
+ const tooBig = length > def.length;
833
+ payload.issues.push({
834
+ origin,
835
+ ...tooBig ? {
836
+ code: "too_big",
837
+ maximum: def.length
838
+ } : {
839
+ code: "too_small",
840
+ minimum: def.length
841
+ },
842
+ inclusive: true,
843
+ exact: true,
844
+ input: payload.value,
845
+ inst,
846
+ continue: !def.abort
847
+ });
848
+ };
849
+ });
850
+ const $ZodCheckStringFormat = /*@__PURE__*/ $constructor("$ZodCheckStringFormat", (inst, def) => {
851
+ var _a, _b;
852
+ $ZodCheck.init(inst, def);
853
+ inst._zod.onattach.push((inst) => {
854
+ const bag = inst._zod.bag;
855
+ bag.format = def.format;
856
+ if (def.pattern) {
857
+ bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
858
+ bag.patterns.add(def.pattern);
859
+ }
860
+ });
861
+ if (def.pattern) (_a = inst._zod).check ?? (_a.check = (payload) => {
862
+ def.pattern.lastIndex = 0;
863
+ if (def.pattern.test(payload.value)) return;
864
+ payload.issues.push({
865
+ origin: "string",
866
+ code: "invalid_format",
867
+ format: def.format,
868
+ input: payload.value,
869
+ ...def.pattern ? { pattern: def.pattern.toString() } : {},
870
+ inst,
871
+ continue: !def.abort
872
+ });
873
+ });
874
+ else (_b = inst._zod).check ?? (_b.check = () => {});
875
+ });
876
+ const $ZodCheckRegex = /*@__PURE__*/ $constructor("$ZodCheckRegex", (inst, def) => {
877
+ $ZodCheckStringFormat.init(inst, def);
878
+ inst._zod.check = (payload) => {
879
+ def.pattern.lastIndex = 0;
880
+ if (def.pattern.test(payload.value)) return;
881
+ payload.issues.push({
882
+ origin: "string",
883
+ code: "invalid_format",
884
+ format: "regex",
885
+ input: payload.value,
886
+ pattern: def.pattern.toString(),
887
+ inst,
888
+ continue: !def.abort
889
+ });
890
+ };
891
+ });
892
+ const $ZodCheckLowerCase = /*@__PURE__*/ $constructor("$ZodCheckLowerCase", (inst, def) => {
893
+ def.pattern ?? (def.pattern = lowercase);
894
+ $ZodCheckStringFormat.init(inst, def);
895
+ });
896
+ const $ZodCheckUpperCase = /*@__PURE__*/ $constructor("$ZodCheckUpperCase", (inst, def) => {
897
+ def.pattern ?? (def.pattern = uppercase);
898
+ $ZodCheckStringFormat.init(inst, def);
899
+ });
900
+ const $ZodCheckIncludes = /*@__PURE__*/ $constructor("$ZodCheckIncludes", (inst, def) => {
901
+ $ZodCheck.init(inst, def);
902
+ const escapedRegex = escapeRegex(def.includes);
903
+ const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);
904
+ def.pattern = pattern;
905
+ inst._zod.onattach.push((inst) => {
906
+ const bag = inst._zod.bag;
907
+ bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
908
+ bag.patterns.add(pattern);
909
+ });
910
+ inst._zod.check = (payload) => {
911
+ if (payload.value.includes(def.includes, def.position)) return;
912
+ payload.issues.push({
913
+ origin: "string",
914
+ code: "invalid_format",
915
+ format: "includes",
916
+ includes: def.includes,
917
+ input: payload.value,
918
+ inst,
919
+ continue: !def.abort
920
+ });
921
+ };
922
+ });
923
+ const $ZodCheckStartsWith = /*@__PURE__*/ $constructor("$ZodCheckStartsWith", (inst, def) => {
924
+ $ZodCheck.init(inst, def);
925
+ const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
926
+ def.pattern ?? (def.pattern = pattern);
927
+ inst._zod.onattach.push((inst) => {
928
+ const bag = inst._zod.bag;
929
+ bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
930
+ bag.patterns.add(pattern);
931
+ });
932
+ inst._zod.check = (payload) => {
933
+ if (payload.value.startsWith(def.prefix)) return;
934
+ payload.issues.push({
935
+ origin: "string",
936
+ code: "invalid_format",
937
+ format: "starts_with",
938
+ prefix: def.prefix,
939
+ input: payload.value,
940
+ inst,
941
+ continue: !def.abort
942
+ });
943
+ };
944
+ });
945
+ const $ZodCheckEndsWith = /*@__PURE__*/ $constructor("$ZodCheckEndsWith", (inst, def) => {
946
+ $ZodCheck.init(inst, def);
947
+ const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
948
+ def.pattern ?? (def.pattern = pattern);
949
+ inst._zod.onattach.push((inst) => {
950
+ const bag = inst._zod.bag;
951
+ bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
952
+ bag.patterns.add(pattern);
953
+ });
954
+ inst._zod.check = (payload) => {
955
+ if (payload.value.endsWith(def.suffix)) return;
956
+ payload.issues.push({
957
+ origin: "string",
958
+ code: "invalid_format",
959
+ format: "ends_with",
960
+ suffix: def.suffix,
961
+ input: payload.value,
962
+ inst,
963
+ continue: !def.abort
964
+ });
965
+ };
966
+ });
967
+ const $ZodCheckOverwrite = /*@__PURE__*/ $constructor("$ZodCheckOverwrite", (inst, def) => {
968
+ $ZodCheck.init(inst, def);
969
+ inst._zod.check = (payload) => {
970
+ payload.value = def.tx(payload.value);
971
+ };
972
+ });
973
+ //#endregion
974
+ //#region ../../../../deepseek-harness/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/doc.js
975
+ var Doc = class {
976
+ constructor(args = []) {
977
+ this.content = [];
978
+ this.indent = 0;
979
+ if (this) this.args = args;
980
+ }
981
+ indented(fn) {
982
+ this.indent += 1;
983
+ fn(this);
984
+ this.indent -= 1;
985
+ }
986
+ write(arg) {
987
+ if (typeof arg === "function") {
988
+ arg(this, { execution: "sync" });
989
+ arg(this, { execution: "async" });
990
+ return;
991
+ }
992
+ const lines = arg.split("\n").filter((x) => x);
993
+ const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));
994
+ const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
995
+ for (const line of dedented) this.content.push(line);
996
+ }
997
+ compile() {
998
+ const F = Function;
999
+ const args = this?.args;
1000
+ const lines = [...(this?.content ?? [``]).map((x) => ` ${x}`)];
1001
+ return new F(...args, lines.join("\n"));
1002
+ }
1003
+ };
1004
+ //#endregion
1005
+ //#region ../../../../deepseek-harness/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/versions.js
1006
+ const version = {
1007
+ major: 4,
1008
+ minor: 4,
1009
+ patch: 3
1010
+ };
1011
+ //#endregion
1012
+ //#region ../../../../deepseek-harness/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/schemas.js
1013
+ const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
1014
+ var _a;
1015
+ inst ?? (inst = {});
1016
+ inst._zod.def = def;
1017
+ inst._zod.bag = inst._zod.bag || {};
1018
+ inst._zod.version = version;
1019
+ const checks = [...inst._zod.def.checks ?? []];
1020
+ if (inst._zod.traits.has("$ZodCheck")) checks.unshift(inst);
1021
+ for (const ch of checks) for (const fn of ch._zod.onattach) fn(inst);
1022
+ if (checks.length === 0) {
1023
+ (_a = inst._zod).deferred ?? (_a.deferred = []);
1024
+ inst._zod.deferred?.push(() => {
1025
+ inst._zod.run = inst._zod.parse;
1026
+ });
1027
+ } else {
1028
+ const runChecks = (payload, checks, ctx) => {
1029
+ let isAborted = aborted(payload);
1030
+ let asyncResult;
1031
+ for (const ch of checks) {
1032
+ if (ch._zod.def.when) {
1033
+ if (explicitlyAborted(payload)) continue;
1034
+ if (!ch._zod.def.when(payload)) continue;
1035
+ } else if (isAborted) continue;
1036
+ const currLen = payload.issues.length;
1037
+ const _ = ch._zod.check(payload);
1038
+ if (_ instanceof Promise && ctx?.async === false) throw new $ZodAsyncError();
1039
+ if (asyncResult || _ instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
1040
+ await _;
1041
+ if (payload.issues.length === currLen) return;
1042
+ if (!isAborted) isAborted = aborted(payload, currLen);
1043
+ });
1044
+ else {
1045
+ if (payload.issues.length === currLen) continue;
1046
+ if (!isAborted) isAborted = aborted(payload, currLen);
1047
+ }
1048
+ }
1049
+ if (asyncResult) return asyncResult.then(() => {
1050
+ return payload;
1051
+ });
1052
+ return payload;
1053
+ };
1054
+ const handleCanaryResult = (canary, payload, ctx) => {
1055
+ if (aborted(canary)) {
1056
+ canary.aborted = true;
1057
+ return canary;
1058
+ }
1059
+ const checkResult = runChecks(payload, checks, ctx);
1060
+ if (checkResult instanceof Promise) {
1061
+ if (ctx.async === false) throw new $ZodAsyncError();
1062
+ return checkResult.then((checkResult) => inst._zod.parse(checkResult, ctx));
1063
+ }
1064
+ return inst._zod.parse(checkResult, ctx);
1065
+ };
1066
+ inst._zod.run = (payload, ctx) => {
1067
+ if (ctx.skipChecks) return inst._zod.parse(payload, ctx);
1068
+ if (ctx.direction === "backward") {
1069
+ const canary = inst._zod.parse({
1070
+ value: payload.value,
1071
+ issues: []
1072
+ }, {
1073
+ ...ctx,
1074
+ skipChecks: true
1075
+ });
1076
+ if (canary instanceof Promise) return canary.then((canary) => {
1077
+ return handleCanaryResult(canary, payload, ctx);
1078
+ });
1079
+ return handleCanaryResult(canary, payload, ctx);
1080
+ }
1081
+ const result = inst._zod.parse(payload, ctx);
1082
+ if (result instanceof Promise) {
1083
+ if (ctx.async === false) throw new $ZodAsyncError();
1084
+ return result.then((result) => runChecks(result, checks, ctx));
1085
+ }
1086
+ return runChecks(result, checks, ctx);
1087
+ };
1088
+ }
1089
+ defineLazy(inst, "~standard", () => ({
1090
+ validate: (value) => {
1091
+ try {
1092
+ const r = safeParse$1(inst, value);
1093
+ return r.success ? { value: r.data } : { issues: r.error?.issues };
1094
+ } catch (_) {
1095
+ return safeParseAsync$1(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
1096
+ }
1097
+ },
1098
+ vendor: "zod",
1099
+ version: 1
1100
+ }));
1101
+ });
1102
+ const $ZodString = /*@__PURE__*/ $constructor("$ZodString", (inst, def) => {
1103
+ $ZodType.init(inst, def);
1104
+ inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$1(inst._zod.bag);
1105
+ inst._zod.parse = (payload, _) => {
1106
+ if (def.coerce) try {
1107
+ payload.value = String(payload.value);
1108
+ } catch (_) {}
1109
+ if (typeof payload.value === "string") return payload;
1110
+ payload.issues.push({
1111
+ expected: "string",
1112
+ code: "invalid_type",
1113
+ input: payload.value,
1114
+ inst
1115
+ });
1116
+ return payload;
1117
+ };
1118
+ });
1119
+ const $ZodStringFormat = /*@__PURE__*/ $constructor("$ZodStringFormat", (inst, def) => {
1120
+ $ZodCheckStringFormat.init(inst, def);
1121
+ $ZodString.init(inst, def);
1122
+ });
1123
+ const $ZodGUID = /*@__PURE__*/ $constructor("$ZodGUID", (inst, def) => {
1124
+ def.pattern ?? (def.pattern = guid);
1125
+ $ZodStringFormat.init(inst, def);
1126
+ });
1127
+ const $ZodUUID = /*@__PURE__*/ $constructor("$ZodUUID", (inst, def) => {
1128
+ if (def.version) {
1129
+ const v = {
1130
+ v1: 1,
1131
+ v2: 2,
1132
+ v3: 3,
1133
+ v4: 4,
1134
+ v5: 5,
1135
+ v6: 6,
1136
+ v7: 7,
1137
+ v8: 8
1138
+ }[def.version];
1139
+ if (v === void 0) throw new Error(`Invalid UUID version: "${def.version}"`);
1140
+ def.pattern ?? (def.pattern = uuid(v));
1141
+ } else def.pattern ?? (def.pattern = uuid());
1142
+ $ZodStringFormat.init(inst, def);
1143
+ });
1144
+ const $ZodEmail = /*@__PURE__*/ $constructor("$ZodEmail", (inst, def) => {
1145
+ def.pattern ?? (def.pattern = email);
1146
+ $ZodStringFormat.init(inst, def);
1147
+ });
1148
+ const $ZodURL = /*@__PURE__*/ $constructor("$ZodURL", (inst, def) => {
1149
+ $ZodStringFormat.init(inst, def);
1150
+ inst._zod.check = (payload) => {
1151
+ try {
1152
+ const trimmed = payload.value.trim();
1153
+ if (!def.normalize && def.protocol?.source === httpProtocol.source) {
1154
+ if (!/^https?:\/\//i.test(trimmed)) {
1155
+ payload.issues.push({
1156
+ code: "invalid_format",
1157
+ format: "url",
1158
+ note: "Invalid URL format",
1159
+ input: payload.value,
1160
+ inst,
1161
+ continue: !def.abort
1162
+ });
1163
+ return;
1164
+ }
1165
+ }
1166
+ const url = new URL(trimmed);
1167
+ if (def.hostname) {
1168
+ def.hostname.lastIndex = 0;
1169
+ if (!def.hostname.test(url.hostname)) payload.issues.push({
1170
+ code: "invalid_format",
1171
+ format: "url",
1172
+ note: "Invalid hostname",
1173
+ pattern: def.hostname.source,
1174
+ input: payload.value,
1175
+ inst,
1176
+ continue: !def.abort
1177
+ });
1178
+ }
1179
+ if (def.protocol) {
1180
+ def.protocol.lastIndex = 0;
1181
+ if (!def.protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol)) payload.issues.push({
1182
+ code: "invalid_format",
1183
+ format: "url",
1184
+ note: "Invalid protocol",
1185
+ pattern: def.protocol.source,
1186
+ input: payload.value,
1187
+ inst,
1188
+ continue: !def.abort
1189
+ });
1190
+ }
1191
+ if (def.normalize) payload.value = url.href;
1192
+ else payload.value = trimmed;
1193
+ return;
1194
+ } catch (_) {
1195
+ payload.issues.push({
1196
+ code: "invalid_format",
1197
+ format: "url",
1198
+ input: payload.value,
1199
+ inst,
1200
+ continue: !def.abort
1201
+ });
1202
+ }
1203
+ };
1204
+ });
1205
+ const $ZodEmoji = /*@__PURE__*/ $constructor("$ZodEmoji", (inst, def) => {
1206
+ def.pattern ?? (def.pattern = emoji());
1207
+ $ZodStringFormat.init(inst, def);
1208
+ });
1209
+ const $ZodNanoID = /*@__PURE__*/ $constructor("$ZodNanoID", (inst, def) => {
1210
+ def.pattern ?? (def.pattern = nanoid);
1211
+ $ZodStringFormat.init(inst, def);
1212
+ });
1213
+ /**
1214
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
1215
+ * (timestamps embedded in the id). Use {@link $ZodCUID2} instead.
1216
+ * See https://github.com/paralleldrive/cuid.
1217
+ */
1218
+ const $ZodCUID = /*@__PURE__*/ $constructor("$ZodCUID", (inst, def) => {
1219
+ def.pattern ?? (def.pattern = cuid);
1220
+ $ZodStringFormat.init(inst, def);
1221
+ });
1222
+ const $ZodCUID2 = /*@__PURE__*/ $constructor("$ZodCUID2", (inst, def) => {
1223
+ def.pattern ?? (def.pattern = cuid2);
1224
+ $ZodStringFormat.init(inst, def);
1225
+ });
1226
+ const $ZodULID = /*@__PURE__*/ $constructor("$ZodULID", (inst, def) => {
1227
+ def.pattern ?? (def.pattern = ulid);
1228
+ $ZodStringFormat.init(inst, def);
1229
+ });
1230
+ const $ZodXID = /*@__PURE__*/ $constructor("$ZodXID", (inst, def) => {
1231
+ def.pattern ?? (def.pattern = xid);
1232
+ $ZodStringFormat.init(inst, def);
1233
+ });
1234
+ const $ZodKSUID = /*@__PURE__*/ $constructor("$ZodKSUID", (inst, def) => {
1235
+ def.pattern ?? (def.pattern = ksuid);
1236
+ $ZodStringFormat.init(inst, def);
1237
+ });
1238
+ const $ZodISODateTime = /*@__PURE__*/ $constructor("$ZodISODateTime", (inst, def) => {
1239
+ def.pattern ?? (def.pattern = datetime$1(def));
1240
+ $ZodStringFormat.init(inst, def);
1241
+ });
1242
+ const $ZodISODate = /*@__PURE__*/ $constructor("$ZodISODate", (inst, def) => {
1243
+ def.pattern ?? (def.pattern = date$1);
1244
+ $ZodStringFormat.init(inst, def);
1245
+ });
1246
+ const $ZodISOTime = /*@__PURE__*/ $constructor("$ZodISOTime", (inst, def) => {
1247
+ def.pattern ?? (def.pattern = time$1(def));
1248
+ $ZodStringFormat.init(inst, def);
1249
+ });
1250
+ const $ZodISODuration = /*@__PURE__*/ $constructor("$ZodISODuration", (inst, def) => {
1251
+ def.pattern ?? (def.pattern = duration$1);
1252
+ $ZodStringFormat.init(inst, def);
1253
+ });
1254
+ const $ZodIPv4 = /*@__PURE__*/ $constructor("$ZodIPv4", (inst, def) => {
1255
+ def.pattern ?? (def.pattern = ipv4);
1256
+ $ZodStringFormat.init(inst, def);
1257
+ inst._zod.bag.format = `ipv4`;
1258
+ });
1259
+ const $ZodIPv6 = /*@__PURE__*/ $constructor("$ZodIPv6", (inst, def) => {
1260
+ def.pattern ?? (def.pattern = ipv6);
1261
+ $ZodStringFormat.init(inst, def);
1262
+ inst._zod.bag.format = `ipv6`;
1263
+ inst._zod.check = (payload) => {
1264
+ try {
1265
+ new URL(`http://[${payload.value}]`);
1266
+ } catch {
1267
+ payload.issues.push({
1268
+ code: "invalid_format",
1269
+ format: "ipv6",
1270
+ input: payload.value,
1271
+ inst,
1272
+ continue: !def.abort
1273
+ });
1274
+ }
1275
+ };
1276
+ });
1277
+ const $ZodCIDRv4 = /*@__PURE__*/ $constructor("$ZodCIDRv4", (inst, def) => {
1278
+ def.pattern ?? (def.pattern = cidrv4);
1279
+ $ZodStringFormat.init(inst, def);
1280
+ });
1281
+ const $ZodCIDRv6 = /*@__PURE__*/ $constructor("$ZodCIDRv6", (inst, def) => {
1282
+ def.pattern ?? (def.pattern = cidrv6);
1283
+ $ZodStringFormat.init(inst, def);
1284
+ inst._zod.check = (payload) => {
1285
+ const parts = payload.value.split("/");
1286
+ try {
1287
+ if (parts.length !== 2) throw new Error();
1288
+ const [address, prefix] = parts;
1289
+ if (!prefix) throw new Error();
1290
+ const prefixNum = Number(prefix);
1291
+ if (`${prefixNum}` !== prefix) throw new Error();
1292
+ if (prefixNum < 0 || prefixNum > 128) throw new Error();
1293
+ new URL(`http://[${address}]`);
1294
+ } catch {
1295
+ payload.issues.push({
1296
+ code: "invalid_format",
1297
+ format: "cidrv6",
1298
+ input: payload.value,
1299
+ inst,
1300
+ continue: !def.abort
1301
+ });
1302
+ }
1303
+ };
1304
+ });
1305
+ function isValidBase64(data) {
1306
+ if (data === "") return true;
1307
+ if (/\s/.test(data)) return false;
1308
+ if (data.length % 4 !== 0) return false;
1309
+ try {
1310
+ atob(data);
1311
+ return true;
1312
+ } catch {
1313
+ return false;
1314
+ }
1315
+ }
1316
+ const $ZodBase64 = /*@__PURE__*/ $constructor("$ZodBase64", (inst, def) => {
1317
+ def.pattern ?? (def.pattern = base64);
1318
+ $ZodStringFormat.init(inst, def);
1319
+ inst._zod.bag.contentEncoding = "base64";
1320
+ inst._zod.check = (payload) => {
1321
+ if (isValidBase64(payload.value)) return;
1322
+ payload.issues.push({
1323
+ code: "invalid_format",
1324
+ format: "base64",
1325
+ input: payload.value,
1326
+ inst,
1327
+ continue: !def.abort
1328
+ });
1329
+ };
1330
+ });
1331
+ function isValidBase64URL(data) {
1332
+ if (!base64url.test(data)) return false;
1333
+ const base64 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
1334
+ return isValidBase64(base64.padEnd(Math.ceil(base64.length / 4) * 4, "="));
1335
+ }
1336
+ const $ZodBase64URL = /*@__PURE__*/ $constructor("$ZodBase64URL", (inst, def) => {
1337
+ def.pattern ?? (def.pattern = base64url);
1338
+ $ZodStringFormat.init(inst, def);
1339
+ inst._zod.bag.contentEncoding = "base64url";
1340
+ inst._zod.check = (payload) => {
1341
+ if (isValidBase64URL(payload.value)) return;
1342
+ payload.issues.push({
1343
+ code: "invalid_format",
1344
+ format: "base64url",
1345
+ input: payload.value,
1346
+ inst,
1347
+ continue: !def.abort
1348
+ });
1349
+ };
1350
+ });
1351
+ const $ZodE164 = /*@__PURE__*/ $constructor("$ZodE164", (inst, def) => {
1352
+ def.pattern ?? (def.pattern = e164);
1353
+ $ZodStringFormat.init(inst, def);
1354
+ });
1355
+ function isValidJWT(token, algorithm = null) {
1356
+ try {
1357
+ const tokensParts = token.split(".");
1358
+ if (tokensParts.length !== 3) return false;
1359
+ const [header] = tokensParts;
1360
+ if (!header) return false;
1361
+ const parsedHeader = JSON.parse(atob(header));
1362
+ if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT") return false;
1363
+ if (!parsedHeader.alg) return false;
1364
+ if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm)) return false;
1365
+ return true;
1366
+ } catch {
1367
+ return false;
1368
+ }
1369
+ }
1370
+ const $ZodJWT = /*@__PURE__*/ $constructor("$ZodJWT", (inst, def) => {
1371
+ $ZodStringFormat.init(inst, def);
1372
+ inst._zod.check = (payload) => {
1373
+ if (isValidJWT(payload.value, def.alg)) return;
1374
+ payload.issues.push({
1375
+ code: "invalid_format",
1376
+ format: "jwt",
1377
+ input: payload.value,
1378
+ inst,
1379
+ continue: !def.abort
1380
+ });
1381
+ };
1382
+ });
1383
+ const $ZodNumber = /*@__PURE__*/ $constructor("$ZodNumber", (inst, def) => {
1384
+ $ZodType.init(inst, def);
1385
+ inst._zod.pattern = inst._zod.bag.pattern ?? number$1;
1386
+ inst._zod.parse = (payload, _ctx) => {
1387
+ if (def.coerce) try {
1388
+ payload.value = Number(payload.value);
1389
+ } catch (_) {}
1390
+ const input = payload.value;
1391
+ if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) return payload;
1392
+ const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : void 0 : void 0;
1393
+ payload.issues.push({
1394
+ expected: "number",
1395
+ code: "invalid_type",
1396
+ input,
1397
+ inst,
1398
+ ...received ? { received } : {}
1399
+ });
1400
+ return payload;
1401
+ };
1402
+ });
1403
+ const $ZodNumberFormat = /*@__PURE__*/ $constructor("$ZodNumberFormat", (inst, def) => {
1404
+ $ZodCheckNumberFormat.init(inst, def);
1405
+ $ZodNumber.init(inst, def);
1406
+ });
1407
+ const $ZodBoolean = /*@__PURE__*/ $constructor("$ZodBoolean", (inst, def) => {
1408
+ $ZodType.init(inst, def);
1409
+ inst._zod.pattern = boolean$1;
1410
+ inst._zod.parse = (payload, _ctx) => {
1411
+ if (def.coerce) try {
1412
+ payload.value = Boolean(payload.value);
1413
+ } catch (_) {}
1414
+ const input = payload.value;
1415
+ if (typeof input === "boolean") return payload;
1416
+ payload.issues.push({
1417
+ expected: "boolean",
1418
+ code: "invalid_type",
1419
+ input,
1420
+ inst
1421
+ });
1422
+ return payload;
1423
+ };
1424
+ });
1425
+ const $ZodUnknown = /*@__PURE__*/ $constructor("$ZodUnknown", (inst, def) => {
1426
+ $ZodType.init(inst, def);
1427
+ inst._zod.parse = (payload) => payload;
1428
+ });
1429
+ const $ZodNever = /*@__PURE__*/ $constructor("$ZodNever", (inst, def) => {
1430
+ $ZodType.init(inst, def);
1431
+ inst._zod.parse = (payload, _ctx) => {
1432
+ payload.issues.push({
1433
+ expected: "never",
1434
+ code: "invalid_type",
1435
+ input: payload.value,
1436
+ inst
1437
+ });
1438
+ return payload;
1439
+ };
1440
+ });
1441
+ function handleArrayResult(result, final, index) {
1442
+ if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
1443
+ final.value[index] = result.value;
1444
+ }
1445
+ const $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => {
1446
+ $ZodType.init(inst, def);
1447
+ inst._zod.parse = (payload, ctx) => {
1448
+ const input = payload.value;
1449
+ if (!Array.isArray(input)) {
1450
+ payload.issues.push({
1451
+ expected: "array",
1452
+ code: "invalid_type",
1453
+ input,
1454
+ inst
1455
+ });
1456
+ return payload;
1457
+ }
1458
+ payload.value = Array(input.length);
1459
+ const proms = [];
1460
+ for (let i = 0; i < input.length; i++) {
1461
+ const item = input[i];
1462
+ const result = def.element._zod.run({
1463
+ value: item,
1464
+ issues: []
1465
+ }, ctx);
1466
+ if (result instanceof Promise) proms.push(result.then((result) => handleArrayResult(result, payload, i)));
1467
+ else handleArrayResult(result, payload, i);
1468
+ }
1469
+ if (proms.length) return Promise.all(proms).then(() => payload);
1470
+ return payload;
1471
+ };
1472
+ });
1473
+ function handlePropertyResult(result, final, key, input, isOptionalIn, isOptionalOut) {
1474
+ const isPresent = key in input;
1475
+ if (result.issues.length) {
1476
+ if (isOptionalIn && isOptionalOut && !isPresent) return;
1477
+ final.issues.push(...prefixIssues(key, result.issues));
1478
+ }
1479
+ if (!isPresent && !isOptionalIn) {
1480
+ if (!result.issues.length) final.issues.push({
1481
+ code: "invalid_type",
1482
+ expected: "nonoptional",
1483
+ input: void 0,
1484
+ path: [key]
1485
+ });
1486
+ return;
1487
+ }
1488
+ if (result.value === void 0) {
1489
+ if (isPresent) final.value[key] = void 0;
1490
+ } else final.value[key] = result.value;
1491
+ }
1492
+ function normalizeDef(def) {
1493
+ const keys = Object.keys(def.shape);
1494
+ for (const k of keys) if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
1495
+ const okeys = optionalKeys(def.shape);
1496
+ return {
1497
+ ...def,
1498
+ keys,
1499
+ keySet: new Set(keys),
1500
+ numKeys: keys.length,
1501
+ optionalKeys: new Set(okeys)
1502
+ };
1503
+ }
1504
+ function handleCatchall(proms, input, payload, ctx, def, inst) {
1505
+ const unrecognized = [];
1506
+ const keySet = def.keySet;
1507
+ const _catchall = def.catchall._zod;
1508
+ const t = _catchall.def.type;
1509
+ const isOptionalIn = _catchall.optin === "optional";
1510
+ const isOptionalOut = _catchall.optout === "optional";
1511
+ for (const key in input) {
1512
+ if (key === "__proto__") continue;
1513
+ if (keySet.has(key)) continue;
1514
+ if (t === "never") {
1515
+ unrecognized.push(key);
1516
+ continue;
1517
+ }
1518
+ const r = _catchall.run({
1519
+ value: input[key],
1520
+ issues: []
1521
+ }, ctx);
1522
+ if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut)));
1523
+ else handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
1524
+ }
1525
+ if (unrecognized.length) payload.issues.push({
1526
+ code: "unrecognized_keys",
1527
+ keys: unrecognized,
1528
+ input,
1529
+ inst
1530
+ });
1531
+ if (!proms.length) return payload;
1532
+ return Promise.all(proms).then(() => {
1533
+ return payload;
1534
+ });
1535
+ }
1536
+ const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
1537
+ $ZodType.init(inst, def);
1538
+ if (!Object.getOwnPropertyDescriptor(def, "shape")?.get) {
1539
+ const sh = def.shape;
1540
+ Object.defineProperty(def, "shape", { get: () => {
1541
+ const newSh = { ...sh };
1542
+ Object.defineProperty(def, "shape", { value: newSh });
1543
+ return newSh;
1544
+ } });
1545
+ }
1546
+ const _normalized = cached(() => normalizeDef(def));
1547
+ defineLazy(inst._zod, "propValues", () => {
1548
+ const shape = def.shape;
1549
+ const propValues = {};
1550
+ for (const key in shape) {
1551
+ const field = shape[key]._zod;
1552
+ if (field.values) {
1553
+ propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
1554
+ for (const v of field.values) propValues[key].add(v);
1555
+ }
1556
+ }
1557
+ return propValues;
1558
+ });
1559
+ const isObject$1 = isObject;
1560
+ const catchall = def.catchall;
1561
+ let value;
1562
+ inst._zod.parse = (payload, ctx) => {
1563
+ value ?? (value = _normalized.value);
1564
+ const input = payload.value;
1565
+ if (!isObject$1(input)) {
1566
+ payload.issues.push({
1567
+ expected: "object",
1568
+ code: "invalid_type",
1569
+ input,
1570
+ inst
1571
+ });
1572
+ return payload;
1573
+ }
1574
+ payload.value = {};
1575
+ const proms = [];
1576
+ const shape = value.shape;
1577
+ for (const key of value.keys) {
1578
+ const el = shape[key];
1579
+ const isOptionalIn = el._zod.optin === "optional";
1580
+ const isOptionalOut = el._zod.optout === "optional";
1581
+ const r = el._zod.run({
1582
+ value: input[key],
1583
+ issues: []
1584
+ }, ctx);
1585
+ if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut)));
1586
+ else handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
1587
+ }
1588
+ if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload;
1589
+ return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
1590
+ };
1591
+ });
1592
+ const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) => {
1593
+ $ZodObject.init(inst, def);
1594
+ const superParse = inst._zod.parse;
1595
+ const _normalized = cached(() => normalizeDef(def));
1596
+ const generateFastpass = (shape) => {
1597
+ const doc = new Doc([
1598
+ "shape",
1599
+ "payload",
1600
+ "ctx"
1601
+ ]);
1602
+ const normalized = _normalized.value;
1603
+ const parseStr = (key) => {
1604
+ const k = esc(key);
1605
+ return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
1606
+ };
1607
+ doc.write(`const input = payload.value;`);
1608
+ const ids = Object.create(null);
1609
+ let counter = 0;
1610
+ for (const key of normalized.keys) ids[key] = `key_${counter++}`;
1611
+ doc.write(`const newResult = {};`);
1612
+ for (const key of normalized.keys) {
1613
+ const id = ids[key];
1614
+ const k = esc(key);
1615
+ const schema = shape[key];
1616
+ const isOptionalIn = schema?._zod?.optin === "optional";
1617
+ const isOptionalOut = schema?._zod?.optout === "optional";
1618
+ doc.write(`const ${id} = ${parseStr(key)};`);
1619
+ if (isOptionalIn && isOptionalOut) doc.write(`
1620
+ if (${id}.issues.length) {
1621
+ if (${k} in input) {
1622
+ payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
1623
+ ...iss,
1624
+ path: iss.path ? [${k}, ...iss.path] : [${k}]
1625
+ })));
1626
+ }
1627
+ }
1628
+
1629
+ if (${id}.value === undefined) {
1630
+ if (${k} in input) {
1631
+ newResult[${k}] = undefined;
1632
+ }
1633
+ } else {
1634
+ newResult[${k}] = ${id}.value;
1635
+ }
1636
+
1637
+ `);
1638
+ else if (!isOptionalIn) doc.write(`
1639
+ const ${id}_present = ${k} in input;
1640
+ if (${id}.issues.length) {
1641
+ payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
1642
+ ...iss,
1643
+ path: iss.path ? [${k}, ...iss.path] : [${k}]
1644
+ })));
1645
+ }
1646
+ if (!${id}_present && !${id}.issues.length) {
1647
+ payload.issues.push({
1648
+ code: "invalid_type",
1649
+ expected: "nonoptional",
1650
+ input: undefined,
1651
+ path: [${k}]
1652
+ });
1653
+ }
1654
+
1655
+ if (${id}_present) {
1656
+ if (${id}.value === undefined) {
1657
+ newResult[${k}] = undefined;
1658
+ } else {
1659
+ newResult[${k}] = ${id}.value;
1660
+ }
1661
+ }
1662
+
1663
+ `);
1664
+ else doc.write(`
1665
+ if (${id}.issues.length) {
1666
+ payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
1667
+ ...iss,
1668
+ path: iss.path ? [${k}, ...iss.path] : [${k}]
1669
+ })));
1670
+ }
1671
+
1672
+ if (${id}.value === undefined) {
1673
+ if (${k} in input) {
1674
+ newResult[${k}] = undefined;
1675
+ }
1676
+ } else {
1677
+ newResult[${k}] = ${id}.value;
1678
+ }
1679
+
1680
+ `);
1681
+ }
1682
+ doc.write(`payload.value = newResult;`);
1683
+ doc.write(`return payload;`);
1684
+ const fn = doc.compile();
1685
+ return (payload, ctx) => fn(shape, payload, ctx);
1686
+ };
1687
+ let fastpass;
1688
+ const isObject$2 = isObject;
1689
+ const jit = !globalConfig.jitless;
1690
+ const fastEnabled = jit && allowsEval.value;
1691
+ const catchall = def.catchall;
1692
+ let value;
1693
+ inst._zod.parse = (payload, ctx) => {
1694
+ value ?? (value = _normalized.value);
1695
+ const input = payload.value;
1696
+ if (!isObject$2(input)) {
1697
+ payload.issues.push({
1698
+ expected: "object",
1699
+ code: "invalid_type",
1700
+ input,
1701
+ inst
1702
+ });
1703
+ return payload;
1704
+ }
1705
+ if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {
1706
+ if (!fastpass) fastpass = generateFastpass(def.shape);
1707
+ payload = fastpass(payload, ctx);
1708
+ if (!catchall) return payload;
1709
+ return handleCatchall([], input, payload, ctx, value, inst);
1710
+ }
1711
+ return superParse(payload, ctx);
1712
+ };
1713
+ });
1714
+ function handleUnionResults(results, final, inst, ctx) {
1715
+ for (const result of results) if (result.issues.length === 0) {
1716
+ final.value = result.value;
1717
+ return final;
1718
+ }
1719
+ const nonaborted = results.filter((r) => !aborted(r));
1720
+ if (nonaborted.length === 1) {
1721
+ final.value = nonaborted[0].value;
1722
+ return nonaborted[0];
1723
+ }
1724
+ final.issues.push({
1725
+ code: "invalid_union",
1726
+ input: final.value,
1727
+ inst,
1728
+ errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
1729
+ });
1730
+ return final;
1731
+ }
1732
+ const $ZodUnion = /*@__PURE__*/ $constructor("$ZodUnion", (inst, def) => {
1733
+ $ZodType.init(inst, def);
1734
+ defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0);
1735
+ defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
1736
+ defineLazy(inst._zod, "values", () => {
1737
+ if (def.options.every((o) => o._zod.values)) return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
1738
+ });
1739
+ defineLazy(inst._zod, "pattern", () => {
1740
+ if (def.options.every((o) => o._zod.pattern)) {
1741
+ const patterns = def.options.map((o) => o._zod.pattern);
1742
+ return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`);
1743
+ }
1744
+ });
1745
+ const first = def.options.length === 1 ? def.options[0]._zod.run : null;
1746
+ inst._zod.parse = (payload, ctx) => {
1747
+ if (first) return first(payload, ctx);
1748
+ let async = false;
1749
+ const results = [];
1750
+ for (const option of def.options) {
1751
+ const result = option._zod.run({
1752
+ value: payload.value,
1753
+ issues: []
1754
+ }, ctx);
1755
+ if (result instanceof Promise) {
1756
+ results.push(result);
1757
+ async = true;
1758
+ } else {
1759
+ if (result.issues.length === 0) return result;
1760
+ results.push(result);
1761
+ }
1762
+ }
1763
+ if (!async) return handleUnionResults(results, payload, inst, ctx);
1764
+ return Promise.all(results).then((results) => {
1765
+ return handleUnionResults(results, payload, inst, ctx);
1766
+ });
1767
+ };
1768
+ });
1769
+ const $ZodIntersection = /*@__PURE__*/ $constructor("$ZodIntersection", (inst, def) => {
1770
+ $ZodType.init(inst, def);
1771
+ inst._zod.parse = (payload, ctx) => {
1772
+ const input = payload.value;
1773
+ const left = def.left._zod.run({
1774
+ value: input,
1775
+ issues: []
1776
+ }, ctx);
1777
+ const right = def.right._zod.run({
1778
+ value: input,
1779
+ issues: []
1780
+ }, ctx);
1781
+ if (left instanceof Promise || right instanceof Promise) return Promise.all([left, right]).then(([left, right]) => {
1782
+ return handleIntersectionResults(payload, left, right);
1783
+ });
1784
+ return handleIntersectionResults(payload, left, right);
1785
+ };
1786
+ });
1787
+ function mergeValues(a, b) {
1788
+ if (a === b) return {
1789
+ valid: true,
1790
+ data: a
1791
+ };
1792
+ if (a instanceof Date && b instanceof Date && +a === +b) return {
1793
+ valid: true,
1794
+ data: a
1795
+ };
1796
+ if (isPlainObject(a) && isPlainObject(b)) {
1797
+ const bKeys = Object.keys(b);
1798
+ const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
1799
+ const newObj = {
1800
+ ...a,
1801
+ ...b
1802
+ };
1803
+ for (const key of sharedKeys) {
1804
+ const sharedValue = mergeValues(a[key], b[key]);
1805
+ if (!sharedValue.valid) return {
1806
+ valid: false,
1807
+ mergeErrorPath: [key, ...sharedValue.mergeErrorPath]
1808
+ };
1809
+ newObj[key] = sharedValue.data;
1810
+ }
1811
+ return {
1812
+ valid: true,
1813
+ data: newObj
1814
+ };
1815
+ }
1816
+ if (Array.isArray(a) && Array.isArray(b)) {
1817
+ if (a.length !== b.length) return {
1818
+ valid: false,
1819
+ mergeErrorPath: []
1820
+ };
1821
+ const newArray = [];
1822
+ for (let index = 0; index < a.length; index++) {
1823
+ const itemA = a[index];
1824
+ const itemB = b[index];
1825
+ const sharedValue = mergeValues(itemA, itemB);
1826
+ if (!sharedValue.valid) return {
1827
+ valid: false,
1828
+ mergeErrorPath: [index, ...sharedValue.mergeErrorPath]
1829
+ };
1830
+ newArray.push(sharedValue.data);
1831
+ }
1832
+ return {
1833
+ valid: true,
1834
+ data: newArray
1835
+ };
1836
+ }
1837
+ return {
1838
+ valid: false,
1839
+ mergeErrorPath: []
1840
+ };
1841
+ }
1842
+ function handleIntersectionResults(result, left, right) {
1843
+ const unrecKeys = /* @__PURE__ */ new Map();
1844
+ let unrecIssue;
1845
+ for (const iss of left.issues) if (iss.code === "unrecognized_keys") {
1846
+ unrecIssue ?? (unrecIssue = iss);
1847
+ for (const k of iss.keys) {
1848
+ if (!unrecKeys.has(k)) unrecKeys.set(k, {});
1849
+ unrecKeys.get(k).l = true;
1850
+ }
1851
+ } else result.issues.push(iss);
1852
+ for (const iss of right.issues) if (iss.code === "unrecognized_keys") for (const k of iss.keys) {
1853
+ if (!unrecKeys.has(k)) unrecKeys.set(k, {});
1854
+ unrecKeys.get(k).r = true;
1855
+ }
1856
+ else result.issues.push(iss);
1857
+ const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);
1858
+ if (bothKeys.length && unrecIssue) result.issues.push({
1859
+ ...unrecIssue,
1860
+ keys: bothKeys
1861
+ });
1862
+ if (aborted(result)) return result;
1863
+ const merged = mergeValues(left.value, right.value);
1864
+ if (!merged.valid) throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
1865
+ result.value = merged.data;
1866
+ return result;
1867
+ }
1868
+ const $ZodEnum = /*@__PURE__*/ $constructor("$ZodEnum", (inst, def) => {
1869
+ $ZodType.init(inst, def);
1870
+ const values = getEnumValues(def.entries);
1871
+ const valuesSet = new Set(values);
1872
+ inst._zod.values = valuesSet;
1873
+ inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
1874
+ inst._zod.parse = (payload, _ctx) => {
1875
+ const input = payload.value;
1876
+ if (valuesSet.has(input)) return payload;
1877
+ payload.issues.push({
1878
+ code: "invalid_value",
1879
+ values,
1880
+ input,
1881
+ inst
1882
+ });
1883
+ return payload;
1884
+ };
1885
+ });
1886
+ const $ZodLiteral = /*@__PURE__*/ $constructor("$ZodLiteral", (inst, def) => {
1887
+ $ZodType.init(inst, def);
1888
+ if (def.values.length === 0) throw new Error("Cannot create literal schema with no valid values");
1889
+ const values = new Set(def.values);
1890
+ inst._zod.values = values;
1891
+ inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
1892
+ inst._zod.parse = (payload, _ctx) => {
1893
+ const input = payload.value;
1894
+ if (values.has(input)) return payload;
1895
+ payload.issues.push({
1896
+ code: "invalid_value",
1897
+ values: def.values,
1898
+ input,
1899
+ inst
1900
+ });
1901
+ return payload;
1902
+ };
1903
+ });
1904
+ const $ZodTransform = /*@__PURE__*/ $constructor("$ZodTransform", (inst, def) => {
1905
+ $ZodType.init(inst, def);
1906
+ inst._zod.optin = "optional";
1907
+ inst._zod.parse = (payload, ctx) => {
1908
+ if (ctx.direction === "backward") throw new $ZodEncodeError(inst.constructor.name);
1909
+ const _out = def.transform(payload.value, payload);
1910
+ if (ctx.async) return (_out instanceof Promise ? _out : Promise.resolve(_out)).then((output) => {
1911
+ payload.value = output;
1912
+ payload.fallback = true;
1913
+ return payload;
1914
+ });
1915
+ if (_out instanceof Promise) throw new $ZodAsyncError();
1916
+ payload.value = _out;
1917
+ payload.fallback = true;
1918
+ return payload;
1919
+ };
1920
+ });
1921
+ function handleOptionalResult(result, input) {
1922
+ if (input === void 0 && (result.issues.length || result.fallback)) return {
1923
+ issues: [],
1924
+ value: void 0
1925
+ };
1926
+ return result;
1927
+ }
1928
+ const $ZodOptional = /*@__PURE__*/ $constructor("$ZodOptional", (inst, def) => {
1929
+ $ZodType.init(inst, def);
1930
+ inst._zod.optin = "optional";
1931
+ inst._zod.optout = "optional";
1932
+ defineLazy(inst._zod, "values", () => {
1933
+ return def.innerType._zod.values ? new Set([...def.innerType._zod.values, void 0]) : void 0;
1934
+ });
1935
+ defineLazy(inst._zod, "pattern", () => {
1936
+ const pattern = def.innerType._zod.pattern;
1937
+ return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0;
1938
+ });
1939
+ inst._zod.parse = (payload, ctx) => {
1940
+ if (def.innerType._zod.optin === "optional") {
1941
+ const input = payload.value;
1942
+ const result = def.innerType._zod.run(payload, ctx);
1943
+ if (result instanceof Promise) return result.then((r) => handleOptionalResult(r, input));
1944
+ return handleOptionalResult(result, input);
1945
+ }
1946
+ if (payload.value === void 0) return payload;
1947
+ return def.innerType._zod.run(payload, ctx);
1948
+ };
1949
+ });
1950
+ const $ZodExactOptional = /*@__PURE__*/ $constructor("$ZodExactOptional", (inst, def) => {
1951
+ $ZodOptional.init(inst, def);
1952
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
1953
+ defineLazy(inst._zod, "pattern", () => def.innerType._zod.pattern);
1954
+ inst._zod.parse = (payload, ctx) => {
1955
+ return def.innerType._zod.run(payload, ctx);
1956
+ };
1957
+ });
1958
+ const $ZodNullable = /*@__PURE__*/ $constructor("$ZodNullable", (inst, def) => {
1959
+ $ZodType.init(inst, def);
1960
+ defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
1961
+ defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
1962
+ defineLazy(inst._zod, "pattern", () => {
1963
+ const pattern = def.innerType._zod.pattern;
1964
+ return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0;
1965
+ });
1966
+ defineLazy(inst._zod, "values", () => {
1967
+ return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : void 0;
1968
+ });
1969
+ inst._zod.parse = (payload, ctx) => {
1970
+ if (payload.value === null) return payload;
1971
+ return def.innerType._zod.run(payload, ctx);
1972
+ };
1973
+ });
1974
+ const $ZodDefault = /*@__PURE__*/ $constructor("$ZodDefault", (inst, def) => {
1975
+ $ZodType.init(inst, def);
1976
+ inst._zod.optin = "optional";
1977
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
1978
+ inst._zod.parse = (payload, ctx) => {
1979
+ if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
1980
+ if (payload.value === void 0) {
1981
+ payload.value = def.defaultValue;
1982
+ /**
1983
+ * $ZodDefault returns the default value immediately in forward direction.
1984
+ * It doesn't pass the default value into the validator ("prefault"). There's no reason to pass the default value through validation. The validity of the default is enforced by TypeScript statically. Otherwise, it's the responsibility of the user to ensure the default is valid. In the case of pipes with divergent in/out types, you can specify the default on the `in` schema of your ZodPipe to set a "prefault" for the pipe. */
1985
+ return payload;
1986
+ }
1987
+ const result = def.innerType._zod.run(payload, ctx);
1988
+ if (result instanceof Promise) return result.then((result) => handleDefaultResult(result, def));
1989
+ return handleDefaultResult(result, def);
1990
+ };
1991
+ });
1992
+ function handleDefaultResult(payload, def) {
1993
+ if (payload.value === void 0) payload.value = def.defaultValue;
1994
+ return payload;
1995
+ }
1996
+ const $ZodPrefault = /*@__PURE__*/ $constructor("$ZodPrefault", (inst, def) => {
1997
+ $ZodType.init(inst, def);
1998
+ inst._zod.optin = "optional";
1999
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2000
+ inst._zod.parse = (payload, ctx) => {
2001
+ if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
2002
+ if (payload.value === void 0) payload.value = def.defaultValue;
2003
+ return def.innerType._zod.run(payload, ctx);
2004
+ };
2005
+ });
2006
+ const $ZodNonOptional = /*@__PURE__*/ $constructor("$ZodNonOptional", (inst, def) => {
2007
+ $ZodType.init(inst, def);
2008
+ defineLazy(inst._zod, "values", () => {
2009
+ const v = def.innerType._zod.values;
2010
+ return v ? new Set([...v].filter((x) => x !== void 0)) : void 0;
2011
+ });
2012
+ inst._zod.parse = (payload, ctx) => {
2013
+ const result = def.innerType._zod.run(payload, ctx);
2014
+ if (result instanceof Promise) return result.then((result) => handleNonOptionalResult(result, inst));
2015
+ return handleNonOptionalResult(result, inst);
2016
+ };
2017
+ });
2018
+ function handleNonOptionalResult(payload, inst) {
2019
+ if (!payload.issues.length && payload.value === void 0) payload.issues.push({
2020
+ code: "invalid_type",
2021
+ expected: "nonoptional",
2022
+ input: payload.value,
2023
+ inst
2024
+ });
2025
+ return payload;
2026
+ }
2027
+ const $ZodCatch = /*@__PURE__*/ $constructor("$ZodCatch", (inst, def) => {
2028
+ $ZodType.init(inst, def);
2029
+ inst._zod.optin = "optional";
2030
+ defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
2031
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2032
+ inst._zod.parse = (payload, ctx) => {
2033
+ if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
2034
+ const result = def.innerType._zod.run(payload, ctx);
2035
+ if (result instanceof Promise) return result.then((result) => {
2036
+ payload.value = result.value;
2037
+ if (result.issues.length) {
2038
+ payload.value = def.catchValue({
2039
+ ...payload,
2040
+ error: { issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config())) },
2041
+ input: payload.value
2042
+ });
2043
+ payload.issues = [];
2044
+ payload.fallback = true;
2045
+ }
2046
+ return payload;
2047
+ });
2048
+ payload.value = result.value;
2049
+ if (result.issues.length) {
2050
+ payload.value = def.catchValue({
2051
+ ...payload,
2052
+ error: { issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config())) },
2053
+ input: payload.value
2054
+ });
2055
+ payload.issues = [];
2056
+ payload.fallback = true;
2057
+ }
2058
+ return payload;
2059
+ };
2060
+ });
2061
+ const $ZodPipe = /*@__PURE__*/ $constructor("$ZodPipe", (inst, def) => {
2062
+ $ZodType.init(inst, def);
2063
+ defineLazy(inst._zod, "values", () => def.in._zod.values);
2064
+ defineLazy(inst._zod, "optin", () => def.in._zod.optin);
2065
+ defineLazy(inst._zod, "optout", () => def.out._zod.optout);
2066
+ defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
2067
+ inst._zod.parse = (payload, ctx) => {
2068
+ if (ctx.direction === "backward") {
2069
+ const right = def.out._zod.run(payload, ctx);
2070
+ if (right instanceof Promise) return right.then((right) => handlePipeResult(right, def.in, ctx));
2071
+ return handlePipeResult(right, def.in, ctx);
2072
+ }
2073
+ const left = def.in._zod.run(payload, ctx);
2074
+ if (left instanceof Promise) return left.then((left) => handlePipeResult(left, def.out, ctx));
2075
+ return handlePipeResult(left, def.out, ctx);
2076
+ };
2077
+ });
2078
+ function handlePipeResult(left, next, ctx) {
2079
+ if (left.issues.length) {
2080
+ left.aborted = true;
2081
+ return left;
2082
+ }
2083
+ return next._zod.run({
2084
+ value: left.value,
2085
+ issues: left.issues,
2086
+ fallback: left.fallback
2087
+ }, ctx);
2088
+ }
2089
+ const $ZodReadonly = /*@__PURE__*/ $constructor("$ZodReadonly", (inst, def) => {
2090
+ $ZodType.init(inst, def);
2091
+ defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
2092
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2093
+ defineLazy(inst._zod, "optin", () => def.innerType?._zod?.optin);
2094
+ defineLazy(inst._zod, "optout", () => def.innerType?._zod?.optout);
2095
+ inst._zod.parse = (payload, ctx) => {
2096
+ if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
2097
+ const result = def.innerType._zod.run(payload, ctx);
2098
+ if (result instanceof Promise) return result.then(handleReadonlyResult);
2099
+ return handleReadonlyResult(result);
2100
+ };
2101
+ });
2102
+ function handleReadonlyResult(payload) {
2103
+ payload.value = Object.freeze(payload.value);
2104
+ return payload;
2105
+ }
2106
+ const $ZodCustom = /*@__PURE__*/ $constructor("$ZodCustom", (inst, def) => {
2107
+ $ZodCheck.init(inst, def);
2108
+ $ZodType.init(inst, def);
2109
+ inst._zod.parse = (payload, _) => {
2110
+ return payload;
2111
+ };
2112
+ inst._zod.check = (payload) => {
2113
+ const input = payload.value;
2114
+ const r = def.fn(input);
2115
+ if (r instanceof Promise) return r.then((r) => handleRefineResult(r, payload, input, inst));
2116
+ handleRefineResult(r, payload, input, inst);
2117
+ };
2118
+ });
2119
+ function handleRefineResult(result, payload, input, inst) {
2120
+ if (!result) {
2121
+ const _iss = {
2122
+ code: "custom",
2123
+ input,
2124
+ inst,
2125
+ path: [...inst._zod.def.path ?? []],
2126
+ continue: !inst._zod.def.abort
2127
+ };
2128
+ if (inst._zod.def.params) _iss.params = inst._zod.def.params;
2129
+ payload.issues.push(issue(_iss));
2130
+ }
2131
+ }
2132
+ //#endregion
2133
+ //#region ../../../../deepseek-harness/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/registries.js
2134
+ var _a;
2135
+ var $ZodRegistry = class {
2136
+ constructor() {
2137
+ this._map = /* @__PURE__ */ new WeakMap();
2138
+ this._idmap = /* @__PURE__ */ new Map();
2139
+ }
2140
+ add(schema, ..._meta) {
2141
+ const meta = _meta[0];
2142
+ this._map.set(schema, meta);
2143
+ if (meta && typeof meta === "object" && "id" in meta) this._idmap.set(meta.id, schema);
2144
+ return this;
2145
+ }
2146
+ clear() {
2147
+ this._map = /* @__PURE__ */ new WeakMap();
2148
+ this._idmap = /* @__PURE__ */ new Map();
2149
+ return this;
2150
+ }
2151
+ remove(schema) {
2152
+ const meta = this._map.get(schema);
2153
+ if (meta && typeof meta === "object" && "id" in meta) this._idmap.delete(meta.id);
2154
+ this._map.delete(schema);
2155
+ return this;
2156
+ }
2157
+ get(schema) {
2158
+ const p = schema._zod.parent;
2159
+ if (p) {
2160
+ const pm = { ...this.get(p) ?? {} };
2161
+ delete pm.id;
2162
+ const f = {
2163
+ ...pm,
2164
+ ...this._map.get(schema)
2165
+ };
2166
+ return Object.keys(f).length ? f : void 0;
2167
+ }
2168
+ return this._map.get(schema);
2169
+ }
2170
+ has(schema) {
2171
+ return this._map.has(schema);
2172
+ }
2173
+ };
2174
+ function registry() {
2175
+ return new $ZodRegistry();
2176
+ }
2177
+ (_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
2178
+ const globalRegistry = globalThis.__zod_globalRegistry;
2179
+ //#endregion
2180
+ //#region ../../../../deepseek-harness/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/api.js
2181
+ // @__NO_SIDE_EFFECTS__
2182
+ function _string(Class, params) {
2183
+ return new Class({
2184
+ type: "string",
2185
+ ...normalizeParams(params)
2186
+ });
2187
+ }
2188
+ // @__NO_SIDE_EFFECTS__
2189
+ function _email(Class, params) {
2190
+ return new Class({
2191
+ type: "string",
2192
+ format: "email",
2193
+ check: "string_format",
2194
+ abort: false,
2195
+ ...normalizeParams(params)
2196
+ });
2197
+ }
2198
+ // @__NO_SIDE_EFFECTS__
2199
+ function _guid(Class, params) {
2200
+ return new Class({
2201
+ type: "string",
2202
+ format: "guid",
2203
+ check: "string_format",
2204
+ abort: false,
2205
+ ...normalizeParams(params)
2206
+ });
2207
+ }
2208
+ // @__NO_SIDE_EFFECTS__
2209
+ function _uuid(Class, params) {
2210
+ return new Class({
2211
+ type: "string",
2212
+ format: "uuid",
2213
+ check: "string_format",
2214
+ abort: false,
2215
+ ...normalizeParams(params)
2216
+ });
2217
+ }
2218
+ // @__NO_SIDE_EFFECTS__
2219
+ function _uuidv4(Class, params) {
2220
+ return new Class({
2221
+ type: "string",
2222
+ format: "uuid",
2223
+ check: "string_format",
2224
+ abort: false,
2225
+ version: "v4",
2226
+ ...normalizeParams(params)
2227
+ });
2228
+ }
2229
+ // @__NO_SIDE_EFFECTS__
2230
+ function _uuidv6(Class, params) {
2231
+ return new Class({
2232
+ type: "string",
2233
+ format: "uuid",
2234
+ check: "string_format",
2235
+ abort: false,
2236
+ version: "v6",
2237
+ ...normalizeParams(params)
2238
+ });
2239
+ }
2240
+ // @__NO_SIDE_EFFECTS__
2241
+ function _uuidv7(Class, params) {
2242
+ return new Class({
2243
+ type: "string",
2244
+ format: "uuid",
2245
+ check: "string_format",
2246
+ abort: false,
2247
+ version: "v7",
2248
+ ...normalizeParams(params)
2249
+ });
2250
+ }
2251
+ // @__NO_SIDE_EFFECTS__
2252
+ function _url(Class, params) {
2253
+ return new Class({
2254
+ type: "string",
2255
+ format: "url",
2256
+ check: "string_format",
2257
+ abort: false,
2258
+ ...normalizeParams(params)
2259
+ });
2260
+ }
2261
+ // @__NO_SIDE_EFFECTS__
2262
+ function _emoji(Class, params) {
2263
+ return new Class({
2264
+ type: "string",
2265
+ format: "emoji",
2266
+ check: "string_format",
2267
+ abort: false,
2268
+ ...normalizeParams(params)
2269
+ });
2270
+ }
2271
+ // @__NO_SIDE_EFFECTS__
2272
+ function _nanoid(Class, params) {
2273
+ return new Class({
2274
+ type: "string",
2275
+ format: "nanoid",
2276
+ check: "string_format",
2277
+ abort: false,
2278
+ ...normalizeParams(params)
2279
+ });
2280
+ }
2281
+ /**
2282
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
2283
+ * (timestamps embedded in the id). Use {@link _cuid2} instead.
2284
+ * See https://github.com/paralleldrive/cuid.
2285
+ */
2286
+ // @__NO_SIDE_EFFECTS__
2287
+ function _cuid(Class, params) {
2288
+ return new Class({
2289
+ type: "string",
2290
+ format: "cuid",
2291
+ check: "string_format",
2292
+ abort: false,
2293
+ ...normalizeParams(params)
2294
+ });
2295
+ }
2296
+ // @__NO_SIDE_EFFECTS__
2297
+ function _cuid2(Class, params) {
2298
+ return new Class({
2299
+ type: "string",
2300
+ format: "cuid2",
2301
+ check: "string_format",
2302
+ abort: false,
2303
+ ...normalizeParams(params)
2304
+ });
2305
+ }
2306
+ // @__NO_SIDE_EFFECTS__
2307
+ function _ulid(Class, params) {
2308
+ return new Class({
2309
+ type: "string",
2310
+ format: "ulid",
2311
+ check: "string_format",
2312
+ abort: false,
2313
+ ...normalizeParams(params)
2314
+ });
2315
+ }
2316
+ // @__NO_SIDE_EFFECTS__
2317
+ function _xid(Class, params) {
2318
+ return new Class({
2319
+ type: "string",
2320
+ format: "xid",
2321
+ check: "string_format",
2322
+ abort: false,
2323
+ ...normalizeParams(params)
2324
+ });
2325
+ }
2326
+ // @__NO_SIDE_EFFECTS__
2327
+ function _ksuid(Class, params) {
2328
+ return new Class({
2329
+ type: "string",
2330
+ format: "ksuid",
2331
+ check: "string_format",
2332
+ abort: false,
2333
+ ...normalizeParams(params)
2334
+ });
2335
+ }
2336
+ // @__NO_SIDE_EFFECTS__
2337
+ function _ipv4(Class, params) {
2338
+ return new Class({
2339
+ type: "string",
2340
+ format: "ipv4",
2341
+ check: "string_format",
2342
+ abort: false,
2343
+ ...normalizeParams(params)
2344
+ });
2345
+ }
2346
+ // @__NO_SIDE_EFFECTS__
2347
+ function _ipv6(Class, params) {
2348
+ return new Class({
2349
+ type: "string",
2350
+ format: "ipv6",
2351
+ check: "string_format",
2352
+ abort: false,
2353
+ ...normalizeParams(params)
2354
+ });
2355
+ }
2356
+ // @__NO_SIDE_EFFECTS__
2357
+ function _cidrv4(Class, params) {
2358
+ return new Class({
2359
+ type: "string",
2360
+ format: "cidrv4",
2361
+ check: "string_format",
2362
+ abort: false,
2363
+ ...normalizeParams(params)
2364
+ });
2365
+ }
2366
+ // @__NO_SIDE_EFFECTS__
2367
+ function _cidrv6(Class, params) {
2368
+ return new Class({
2369
+ type: "string",
2370
+ format: "cidrv6",
2371
+ check: "string_format",
2372
+ abort: false,
2373
+ ...normalizeParams(params)
2374
+ });
2375
+ }
2376
+ // @__NO_SIDE_EFFECTS__
2377
+ function _base64(Class, params) {
2378
+ return new Class({
2379
+ type: "string",
2380
+ format: "base64",
2381
+ check: "string_format",
2382
+ abort: false,
2383
+ ...normalizeParams(params)
2384
+ });
2385
+ }
2386
+ // @__NO_SIDE_EFFECTS__
2387
+ function _base64url(Class, params) {
2388
+ return new Class({
2389
+ type: "string",
2390
+ format: "base64url",
2391
+ check: "string_format",
2392
+ abort: false,
2393
+ ...normalizeParams(params)
2394
+ });
2395
+ }
2396
+ // @__NO_SIDE_EFFECTS__
2397
+ function _e164(Class, params) {
2398
+ return new Class({
2399
+ type: "string",
2400
+ format: "e164",
2401
+ check: "string_format",
2402
+ abort: false,
2403
+ ...normalizeParams(params)
2404
+ });
2405
+ }
2406
+ // @__NO_SIDE_EFFECTS__
2407
+ function _jwt(Class, params) {
2408
+ return new Class({
2409
+ type: "string",
2410
+ format: "jwt",
2411
+ check: "string_format",
2412
+ abort: false,
2413
+ ...normalizeParams(params)
2414
+ });
2415
+ }
2416
+ // @__NO_SIDE_EFFECTS__
2417
+ function _isoDateTime(Class, params) {
2418
+ return new Class({
2419
+ type: "string",
2420
+ format: "datetime",
2421
+ check: "string_format",
2422
+ offset: false,
2423
+ local: false,
2424
+ precision: null,
2425
+ ...normalizeParams(params)
2426
+ });
2427
+ }
2428
+ // @__NO_SIDE_EFFECTS__
2429
+ function _isoDate(Class, params) {
2430
+ return new Class({
2431
+ type: "string",
2432
+ format: "date",
2433
+ check: "string_format",
2434
+ ...normalizeParams(params)
2435
+ });
2436
+ }
2437
+ // @__NO_SIDE_EFFECTS__
2438
+ function _isoTime(Class, params) {
2439
+ return new Class({
2440
+ type: "string",
2441
+ format: "time",
2442
+ check: "string_format",
2443
+ precision: null,
2444
+ ...normalizeParams(params)
2445
+ });
2446
+ }
2447
+ // @__NO_SIDE_EFFECTS__
2448
+ function _isoDuration(Class, params) {
2449
+ return new Class({
2450
+ type: "string",
2451
+ format: "duration",
2452
+ check: "string_format",
2453
+ ...normalizeParams(params)
2454
+ });
2455
+ }
2456
+ // @__NO_SIDE_EFFECTS__
2457
+ function _number(Class, params) {
2458
+ return new Class({
2459
+ type: "number",
2460
+ checks: [],
2461
+ ...normalizeParams(params)
2462
+ });
2463
+ }
2464
+ // @__NO_SIDE_EFFECTS__
2465
+ function _int(Class, params) {
2466
+ return new Class({
2467
+ type: "number",
2468
+ check: "number_format",
2469
+ abort: false,
2470
+ format: "safeint",
2471
+ ...normalizeParams(params)
2472
+ });
2473
+ }
2474
+ // @__NO_SIDE_EFFECTS__
2475
+ function _boolean(Class, params) {
2476
+ return new Class({
2477
+ type: "boolean",
2478
+ ...normalizeParams(params)
2479
+ });
2480
+ }
2481
+ // @__NO_SIDE_EFFECTS__
2482
+ function _unknown(Class) {
2483
+ return new Class({ type: "unknown" });
2484
+ }
2485
+ // @__NO_SIDE_EFFECTS__
2486
+ function _never(Class, params) {
2487
+ return new Class({
2488
+ type: "never",
2489
+ ...normalizeParams(params)
2490
+ });
2491
+ }
2492
+ // @__NO_SIDE_EFFECTS__
2493
+ function _lt(value, params) {
2494
+ return new $ZodCheckLessThan({
2495
+ check: "less_than",
2496
+ ...normalizeParams(params),
2497
+ value,
2498
+ inclusive: false
2499
+ });
2500
+ }
2501
+ // @__NO_SIDE_EFFECTS__
2502
+ function _lte(value, params) {
2503
+ return new $ZodCheckLessThan({
2504
+ check: "less_than",
2505
+ ...normalizeParams(params),
2506
+ value,
2507
+ inclusive: true
2508
+ });
2509
+ }
2510
+ // @__NO_SIDE_EFFECTS__
2511
+ function _gt(value, params) {
2512
+ return new $ZodCheckGreaterThan({
2513
+ check: "greater_than",
2514
+ ...normalizeParams(params),
2515
+ value,
2516
+ inclusive: false
2517
+ });
2518
+ }
2519
+ // @__NO_SIDE_EFFECTS__
2520
+ function _gte(value, params) {
2521
+ return new $ZodCheckGreaterThan({
2522
+ check: "greater_than",
2523
+ ...normalizeParams(params),
2524
+ value,
2525
+ inclusive: true
2526
+ });
2527
+ }
2528
+ // @__NO_SIDE_EFFECTS__
2529
+ function _multipleOf(value, params) {
2530
+ return new $ZodCheckMultipleOf({
2531
+ check: "multiple_of",
2532
+ ...normalizeParams(params),
2533
+ value
2534
+ });
2535
+ }
2536
+ // @__NO_SIDE_EFFECTS__
2537
+ function _maxLength(maximum, params) {
2538
+ return new $ZodCheckMaxLength({
2539
+ check: "max_length",
2540
+ ...normalizeParams(params),
2541
+ maximum
2542
+ });
2543
+ }
2544
+ // @__NO_SIDE_EFFECTS__
2545
+ function _minLength(minimum, params) {
2546
+ return new $ZodCheckMinLength({
2547
+ check: "min_length",
2548
+ ...normalizeParams(params),
2549
+ minimum
2550
+ });
2551
+ }
2552
+ // @__NO_SIDE_EFFECTS__
2553
+ function _length(length, params) {
2554
+ return new $ZodCheckLengthEquals({
2555
+ check: "length_equals",
2556
+ ...normalizeParams(params),
2557
+ length
2558
+ });
2559
+ }
2560
+ // @__NO_SIDE_EFFECTS__
2561
+ function _regex(pattern, params) {
2562
+ return new $ZodCheckRegex({
2563
+ check: "string_format",
2564
+ format: "regex",
2565
+ ...normalizeParams(params),
2566
+ pattern
2567
+ });
2568
+ }
2569
+ // @__NO_SIDE_EFFECTS__
2570
+ function _lowercase(params) {
2571
+ return new $ZodCheckLowerCase({
2572
+ check: "string_format",
2573
+ format: "lowercase",
2574
+ ...normalizeParams(params)
2575
+ });
2576
+ }
2577
+ // @__NO_SIDE_EFFECTS__
2578
+ function _uppercase(params) {
2579
+ return new $ZodCheckUpperCase({
2580
+ check: "string_format",
2581
+ format: "uppercase",
2582
+ ...normalizeParams(params)
2583
+ });
2584
+ }
2585
+ // @__NO_SIDE_EFFECTS__
2586
+ function _includes(includes, params) {
2587
+ return new $ZodCheckIncludes({
2588
+ check: "string_format",
2589
+ format: "includes",
2590
+ ...normalizeParams(params),
2591
+ includes
2592
+ });
2593
+ }
2594
+ // @__NO_SIDE_EFFECTS__
2595
+ function _startsWith(prefix, params) {
2596
+ return new $ZodCheckStartsWith({
2597
+ check: "string_format",
2598
+ format: "starts_with",
2599
+ ...normalizeParams(params),
2600
+ prefix
2601
+ });
2602
+ }
2603
+ // @__NO_SIDE_EFFECTS__
2604
+ function _endsWith(suffix, params) {
2605
+ return new $ZodCheckEndsWith({
2606
+ check: "string_format",
2607
+ format: "ends_with",
2608
+ ...normalizeParams(params),
2609
+ suffix
2610
+ });
2611
+ }
2612
+ // @__NO_SIDE_EFFECTS__
2613
+ function _overwrite(tx) {
2614
+ return new $ZodCheckOverwrite({
2615
+ check: "overwrite",
2616
+ tx
2617
+ });
2618
+ }
2619
+ // @__NO_SIDE_EFFECTS__
2620
+ function _normalize(form) {
2621
+ return /* @__PURE__ */ _overwrite((input) => input.normalize(form));
2622
+ }
2623
+ // @__NO_SIDE_EFFECTS__
2624
+ function _trim() {
2625
+ return /* @__PURE__ */ _overwrite((input) => input.trim());
2626
+ }
2627
+ // @__NO_SIDE_EFFECTS__
2628
+ function _toLowerCase() {
2629
+ return /* @__PURE__ */ _overwrite((input) => input.toLowerCase());
2630
+ }
2631
+ // @__NO_SIDE_EFFECTS__
2632
+ function _toUpperCase() {
2633
+ return /* @__PURE__ */ _overwrite((input) => input.toUpperCase());
2634
+ }
2635
+ // @__NO_SIDE_EFFECTS__
2636
+ function _slugify() {
2637
+ return /* @__PURE__ */ _overwrite((input) => slugify(input));
2638
+ }
2639
+ // @__NO_SIDE_EFFECTS__
2640
+ function _array(Class, element, params) {
2641
+ return new Class({
2642
+ type: "array",
2643
+ element,
2644
+ ...normalizeParams(params)
2645
+ });
2646
+ }
2647
+ // @__NO_SIDE_EFFECTS__
2648
+ function _refine(Class, fn, _params) {
2649
+ return new Class({
2650
+ type: "custom",
2651
+ check: "custom",
2652
+ fn,
2653
+ ...normalizeParams(_params)
2654
+ });
2655
+ }
2656
+ // @__NO_SIDE_EFFECTS__
2657
+ function _superRefine(fn, params) {
2658
+ const ch = /* @__PURE__ */ _check((payload) => {
2659
+ payload.addIssue = (issue$2) => {
2660
+ if (typeof issue$2 === "string") payload.issues.push(issue(issue$2, payload.value, ch._zod.def));
2661
+ else {
2662
+ const _issue = issue$2;
2663
+ if (_issue.fatal) _issue.continue = false;
2664
+ _issue.code ?? (_issue.code = "custom");
2665
+ _issue.input ?? (_issue.input = payload.value);
2666
+ _issue.inst ?? (_issue.inst = ch);
2667
+ _issue.continue ?? (_issue.continue = !ch._zod.def.abort);
2668
+ payload.issues.push(issue(_issue));
2669
+ }
2670
+ };
2671
+ return fn(payload.value, payload);
2672
+ }, params);
2673
+ return ch;
2674
+ }
2675
+ // @__NO_SIDE_EFFECTS__
2676
+ function _check(fn, params) {
2677
+ const ch = new $ZodCheck({
2678
+ check: "custom",
2679
+ ...normalizeParams(params)
2680
+ });
2681
+ ch._zod.check = fn;
2682
+ return ch;
2683
+ }
2684
+ //#endregion
2685
+ //#region ../../../../deepseek-harness/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.js
2686
+ function initializeContext(params) {
2687
+ let target = params?.target ?? "draft-2020-12";
2688
+ if (target === "draft-4") target = "draft-04";
2689
+ if (target === "draft-7") target = "draft-07";
2690
+ return {
2691
+ processors: params.processors ?? {},
2692
+ metadataRegistry: params?.metadata ?? globalRegistry,
2693
+ target,
2694
+ unrepresentable: params?.unrepresentable ?? "throw",
2695
+ override: params?.override ?? (() => {}),
2696
+ io: params?.io ?? "output",
2697
+ counter: 0,
2698
+ seen: /* @__PURE__ */ new Map(),
2699
+ cycles: params?.cycles ?? "ref",
2700
+ reused: params?.reused ?? "inline",
2701
+ external: params?.external ?? void 0
2702
+ };
2703
+ }
2704
+ function process(schema, ctx, _params = {
2705
+ path: [],
2706
+ schemaPath: []
2707
+ }) {
2708
+ var _a;
2709
+ const def = schema._zod.def;
2710
+ const seen = ctx.seen.get(schema);
2711
+ if (seen) {
2712
+ seen.count++;
2713
+ if (_params.schemaPath.includes(schema)) seen.cycle = _params.path;
2714
+ return seen.schema;
2715
+ }
2716
+ const result = {
2717
+ schema: {},
2718
+ count: 1,
2719
+ cycle: void 0,
2720
+ path: _params.path
2721
+ };
2722
+ ctx.seen.set(schema, result);
2723
+ const overrideSchema = schema._zod.toJSONSchema?.();
2724
+ if (overrideSchema) result.schema = overrideSchema;
2725
+ else {
2726
+ const params = {
2727
+ ..._params,
2728
+ schemaPath: [..._params.schemaPath, schema],
2729
+ path: _params.path
2730
+ };
2731
+ if (schema._zod.processJSONSchema) schema._zod.processJSONSchema(ctx, result.schema, params);
2732
+ else {
2733
+ const _json = result.schema;
2734
+ const processor = ctx.processors[def.type];
2735
+ if (!processor) throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`);
2736
+ processor(schema, ctx, _json, params);
2737
+ }
2738
+ const parent = schema._zod.parent;
2739
+ if (parent) {
2740
+ if (!result.ref) result.ref = parent;
2741
+ process(parent, ctx, params);
2742
+ ctx.seen.get(parent).isParent = true;
2743
+ }
2744
+ }
2745
+ const meta = ctx.metadataRegistry.get(schema);
2746
+ if (meta) Object.assign(result.schema, meta);
2747
+ if (ctx.io === "input" && isTransforming(schema)) {
2748
+ delete result.schema.examples;
2749
+ delete result.schema.default;
2750
+ }
2751
+ if (ctx.io === "input" && "_prefault" in result.schema) (_a = result.schema).default ?? (_a.default = result.schema._prefault);
2752
+ delete result.schema._prefault;
2753
+ return ctx.seen.get(schema).schema;
2754
+ }
2755
+ function extractDefs(ctx, schema) {
2756
+ const root = ctx.seen.get(schema);
2757
+ if (!root) throw new Error("Unprocessed schema. This is a bug in Zod.");
2758
+ const idToSchema = /* @__PURE__ */ new Map();
2759
+ for (const entry of ctx.seen.entries()) {
2760
+ const id = ctx.metadataRegistry.get(entry[0])?.id;
2761
+ if (id) {
2762
+ const existing = idToSchema.get(id);
2763
+ if (existing && existing !== entry[0]) throw new Error(`Duplicate schema id "${id}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
2764
+ idToSchema.set(id, entry[0]);
2765
+ }
2766
+ }
2767
+ const makeURI = (entry) => {
2768
+ const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
2769
+ if (ctx.external) {
2770
+ const externalId = ctx.external.registry.get(entry[0])?.id;
2771
+ const uriGenerator = ctx.external.uri ?? ((id) => id);
2772
+ if (externalId) return { ref: uriGenerator(externalId) };
2773
+ const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
2774
+ entry[1].defId = id;
2775
+ return {
2776
+ defId: id,
2777
+ ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}`
2778
+ };
2779
+ }
2780
+ if (entry[1] === root) return { ref: "#" };
2781
+ const defUriPrefix = `#/${defsSegment}/`;
2782
+ const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;
2783
+ return {
2784
+ defId,
2785
+ ref: defUriPrefix + defId
2786
+ };
2787
+ };
2788
+ const extractToDef = (entry) => {
2789
+ if (entry[1].schema.$ref) return;
2790
+ const seen = entry[1];
2791
+ const { ref, defId } = makeURI(entry);
2792
+ seen.def = { ...seen.schema };
2793
+ if (defId) seen.defId = defId;
2794
+ const schema = seen.schema;
2795
+ for (const key in schema) delete schema[key];
2796
+ schema.$ref = ref;
2797
+ };
2798
+ if (ctx.cycles === "throw") for (const entry of ctx.seen.entries()) {
2799
+ const seen = entry[1];
2800
+ if (seen.cycle) throw new Error(`Cycle detected: #/${seen.cycle?.join("/")}/<root>
2801
+
2802
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
2803
+ }
2804
+ for (const entry of ctx.seen.entries()) {
2805
+ const seen = entry[1];
2806
+ if (schema === entry[0]) {
2807
+ extractToDef(entry);
2808
+ continue;
2809
+ }
2810
+ if (ctx.external) {
2811
+ const ext = ctx.external.registry.get(entry[0])?.id;
2812
+ if (schema !== entry[0] && ext) {
2813
+ extractToDef(entry);
2814
+ continue;
2815
+ }
2816
+ }
2817
+ if (ctx.metadataRegistry.get(entry[0])?.id) {
2818
+ extractToDef(entry);
2819
+ continue;
2820
+ }
2821
+ if (seen.cycle) {
2822
+ extractToDef(entry);
2823
+ continue;
2824
+ }
2825
+ if (seen.count > 1) {
2826
+ if (ctx.reused === "ref") {
2827
+ extractToDef(entry);
2828
+ continue;
2829
+ }
2830
+ }
2831
+ }
2832
+ }
2833
+ function finalize(ctx, schema) {
2834
+ const root = ctx.seen.get(schema);
2835
+ if (!root) throw new Error("Unprocessed schema. This is a bug in Zod.");
2836
+ const flattenRef = (zodSchema) => {
2837
+ const seen = ctx.seen.get(zodSchema);
2838
+ if (seen.ref === null) return;
2839
+ const schema = seen.def ?? seen.schema;
2840
+ const _cached = { ...schema };
2841
+ const ref = seen.ref;
2842
+ seen.ref = null;
2843
+ if (ref) {
2844
+ flattenRef(ref);
2845
+ const refSeen = ctx.seen.get(ref);
2846
+ const refSchema = refSeen.schema;
2847
+ if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) {
2848
+ schema.allOf = schema.allOf ?? [];
2849
+ schema.allOf.push(refSchema);
2850
+ } else Object.assign(schema, refSchema);
2851
+ Object.assign(schema, _cached);
2852
+ if (zodSchema._zod.parent === ref) for (const key in schema) {
2853
+ if (key === "$ref" || key === "allOf") continue;
2854
+ if (!(key in _cached)) delete schema[key];
2855
+ }
2856
+ if (refSchema.$ref && refSeen.def) for (const key in schema) {
2857
+ if (key === "$ref" || key === "allOf") continue;
2858
+ if (key in refSeen.def && JSON.stringify(schema[key]) === JSON.stringify(refSeen.def[key])) delete schema[key];
2859
+ }
2860
+ }
2861
+ const parent = zodSchema._zod.parent;
2862
+ if (parent && parent !== ref) {
2863
+ flattenRef(parent);
2864
+ const parentSeen = ctx.seen.get(parent);
2865
+ if (parentSeen?.schema.$ref) {
2866
+ schema.$ref = parentSeen.schema.$ref;
2867
+ if (parentSeen.def) for (const key in schema) {
2868
+ if (key === "$ref" || key === "allOf") continue;
2869
+ if (key in parentSeen.def && JSON.stringify(schema[key]) === JSON.stringify(parentSeen.def[key])) delete schema[key];
2870
+ }
2871
+ }
2872
+ }
2873
+ ctx.override({
2874
+ zodSchema,
2875
+ jsonSchema: schema,
2876
+ path: seen.path ?? []
2877
+ });
2878
+ };
2879
+ for (const entry of [...ctx.seen.entries()].reverse()) flattenRef(entry[0]);
2880
+ const result = {};
2881
+ if (ctx.target === "draft-2020-12") result.$schema = "https://json-schema.org/draft/2020-12/schema";
2882
+ else if (ctx.target === "draft-07") result.$schema = "http://json-schema.org/draft-07/schema#";
2883
+ else if (ctx.target === "draft-04") result.$schema = "http://json-schema.org/draft-04/schema#";
2884
+ else if (ctx.target === "openapi-3.0") {}
2885
+ if (ctx.external?.uri) {
2886
+ const id = ctx.external.registry.get(schema)?.id;
2887
+ if (!id) throw new Error("Schema is missing an `id` property");
2888
+ result.$id = ctx.external.uri(id);
2889
+ }
2890
+ Object.assign(result, root.def ?? root.schema);
2891
+ const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
2892
+ if (rootMetaId !== void 0 && result.id === rootMetaId) delete result.id;
2893
+ const defs = ctx.external?.defs ?? {};
2894
+ for (const entry of ctx.seen.entries()) {
2895
+ const seen = entry[1];
2896
+ if (seen.def && seen.defId) {
2897
+ if (seen.def.id === seen.defId) delete seen.def.id;
2898
+ defs[seen.defId] = seen.def;
2899
+ }
2900
+ }
2901
+ if (ctx.external) {} else if (Object.keys(defs).length > 0) if (ctx.target === "draft-2020-12") result.$defs = defs;
2902
+ else result.definitions = defs;
2903
+ try {
2904
+ const finalized = JSON.parse(JSON.stringify(result));
2905
+ Object.defineProperty(finalized, "~standard", {
2906
+ value: {
2907
+ ...schema["~standard"],
2908
+ jsonSchema: {
2909
+ input: createStandardJSONSchemaMethod(schema, "input", ctx.processors),
2910
+ output: createStandardJSONSchemaMethod(schema, "output", ctx.processors)
2911
+ }
2912
+ },
2913
+ enumerable: false,
2914
+ writable: false
2915
+ });
2916
+ return finalized;
2917
+ } catch (_err) {
2918
+ throw new Error("Error converting schema to JSON.");
2919
+ }
2920
+ }
2921
+ function isTransforming(_schema, _ctx) {
2922
+ const ctx = _ctx ?? { seen: /* @__PURE__ */ new Set() };
2923
+ if (ctx.seen.has(_schema)) return false;
2924
+ ctx.seen.add(_schema);
2925
+ const def = _schema._zod.def;
2926
+ if (def.type === "transform") return true;
2927
+ if (def.type === "array") return isTransforming(def.element, ctx);
2928
+ if (def.type === "set") return isTransforming(def.valueType, ctx);
2929
+ if (def.type === "lazy") return isTransforming(def.getter(), ctx);
2930
+ if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault") return isTransforming(def.innerType, ctx);
2931
+ if (def.type === "intersection") return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
2932
+ if (def.type === "record" || def.type === "map") return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
2933
+ if (def.type === "pipe") {
2934
+ if (_schema._zod.traits.has("$ZodCodec")) return true;
2935
+ return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
2936
+ }
2937
+ if (def.type === "object") {
2938
+ for (const key in def.shape) if (isTransforming(def.shape[key], ctx)) return true;
2939
+ return false;
2940
+ }
2941
+ if (def.type === "union") {
2942
+ for (const option of def.options) if (isTransforming(option, ctx)) return true;
2943
+ return false;
2944
+ }
2945
+ if (def.type === "tuple") {
2946
+ for (const item of def.items) if (isTransforming(item, ctx)) return true;
2947
+ if (def.rest && isTransforming(def.rest, ctx)) return true;
2948
+ return false;
2949
+ }
2950
+ return false;
2951
+ }
2952
+ /**
2953
+ * Creates a toJSONSchema method for a schema instance.
2954
+ * This encapsulates the logic of initializing context, processing, extracting defs, and finalizing.
2955
+ */
2956
+ const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
2957
+ const ctx = initializeContext({
2958
+ ...params,
2959
+ processors
2960
+ });
2961
+ process(schema, ctx);
2962
+ extractDefs(ctx, schema);
2963
+ return finalize(ctx, schema);
2964
+ };
2965
+ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
2966
+ const { libraryOptions, target } = params ?? {};
2967
+ const ctx = initializeContext({
2968
+ ...libraryOptions ?? {},
2969
+ target,
2970
+ io,
2971
+ processors
2972
+ });
2973
+ process(schema, ctx);
2974
+ extractDefs(ctx, schema);
2975
+ return finalize(ctx, schema);
2976
+ };
2977
+ //#endregion
2978
+ //#region ../../../../deepseek-harness/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema-processors.js
2979
+ const formatMap = {
2980
+ guid: "uuid",
2981
+ url: "uri",
2982
+ datetime: "date-time",
2983
+ json_string: "json-string",
2984
+ regex: ""
2985
+ };
2986
+ const stringProcessor = (schema, ctx, _json, _params) => {
2987
+ const json = _json;
2988
+ json.type = "string";
2989
+ const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
2990
+ if (typeof minimum === "number") json.minLength = minimum;
2991
+ if (typeof maximum === "number") json.maxLength = maximum;
2992
+ if (format) {
2993
+ json.format = formatMap[format] ?? format;
2994
+ if (json.format === "") delete json.format;
2995
+ if (format === "time") delete json.format;
2996
+ }
2997
+ if (contentEncoding) json.contentEncoding = contentEncoding;
2998
+ if (patterns && patterns.size > 0) {
2999
+ const regexes = [...patterns];
3000
+ if (regexes.length === 1) json.pattern = regexes[0].source;
3001
+ else if (regexes.length > 1) json.allOf = [...regexes.map((regex) => ({
3002
+ ...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
3003
+ pattern: regex.source
3004
+ }))];
3005
+ }
3006
+ };
3007
+ const numberProcessor = (schema, ctx, _json, _params) => {
3008
+ const json = _json;
3009
+ const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
3010
+ if (typeof format === "string" && format.includes("int")) json.type = "integer";
3011
+ else json.type = "number";
3012
+ const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
3013
+ const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
3014
+ const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
3015
+ if (exMin) if (legacy) {
3016
+ json.minimum = exclusiveMinimum;
3017
+ json.exclusiveMinimum = true;
3018
+ } else json.exclusiveMinimum = exclusiveMinimum;
3019
+ else if (typeof minimum === "number") json.minimum = minimum;
3020
+ if (exMax) if (legacy) {
3021
+ json.maximum = exclusiveMaximum;
3022
+ json.exclusiveMaximum = true;
3023
+ } else json.exclusiveMaximum = exclusiveMaximum;
3024
+ else if (typeof maximum === "number") json.maximum = maximum;
3025
+ if (typeof multipleOf === "number") json.multipleOf = multipleOf;
3026
+ };
3027
+ const booleanProcessor = (_schema, _ctx, json, _params) => {
3028
+ json.type = "boolean";
3029
+ };
3030
+ const neverProcessor = (_schema, _ctx, json, _params) => {
3031
+ json.not = {};
3032
+ };
3033
+ const enumProcessor = (schema, _ctx, json, _params) => {
3034
+ const def = schema._zod.def;
3035
+ const values = getEnumValues(def.entries);
3036
+ if (values.every((v) => typeof v === "number")) json.type = "number";
3037
+ if (values.every((v) => typeof v === "string")) json.type = "string";
3038
+ json.enum = values;
3039
+ };
3040
+ const literalProcessor = (schema, ctx, json, _params) => {
3041
+ const def = schema._zod.def;
3042
+ const vals = [];
3043
+ for (const val of def.values) if (val === void 0) {
3044
+ if (ctx.unrepresentable === "throw") throw new Error("Literal `undefined` cannot be represented in JSON Schema");
3045
+ } else if (typeof val === "bigint") if (ctx.unrepresentable === "throw") throw new Error("BigInt literals cannot be represented in JSON Schema");
3046
+ else vals.push(Number(val));
3047
+ else vals.push(val);
3048
+ if (vals.length === 0) {} else if (vals.length === 1) {
3049
+ const val = vals[0];
3050
+ json.type = val === null ? "null" : typeof val;
3051
+ if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") json.enum = [val];
3052
+ else json.const = val;
3053
+ } else {
3054
+ if (vals.every((v) => typeof v === "number")) json.type = "number";
3055
+ if (vals.every((v) => typeof v === "string")) json.type = "string";
3056
+ if (vals.every((v) => typeof v === "boolean")) json.type = "boolean";
3057
+ if (vals.every((v) => v === null)) json.type = "null";
3058
+ json.enum = vals;
3059
+ }
3060
+ };
3061
+ const customProcessor = (_schema, ctx, _json, _params) => {
3062
+ if (ctx.unrepresentable === "throw") throw new Error("Custom types cannot be represented in JSON Schema");
3063
+ };
3064
+ const transformProcessor = (_schema, ctx, _json, _params) => {
3065
+ if (ctx.unrepresentable === "throw") throw new Error("Transforms cannot be represented in JSON Schema");
3066
+ };
3067
+ const arrayProcessor = (schema, ctx, _json, params) => {
3068
+ const json = _json;
3069
+ const def = schema._zod.def;
3070
+ const { minimum, maximum } = schema._zod.bag;
3071
+ if (typeof minimum === "number") json.minItems = minimum;
3072
+ if (typeof maximum === "number") json.maxItems = maximum;
3073
+ json.type = "array";
3074
+ json.items = process(def.element, ctx, {
3075
+ ...params,
3076
+ path: [...params.path, "items"]
3077
+ });
3078
+ };
3079
+ const objectProcessor = (schema, ctx, _json, params) => {
3080
+ const json = _json;
3081
+ const def = schema._zod.def;
3082
+ json.type = "object";
3083
+ json.properties = {};
3084
+ const shape = def.shape;
3085
+ for (const key in shape) json.properties[key] = process(shape[key], ctx, {
3086
+ ...params,
3087
+ path: [
3088
+ ...params.path,
3089
+ "properties",
3090
+ key
3091
+ ]
3092
+ });
3093
+ const allKeys = new Set(Object.keys(shape));
3094
+ const requiredKeys = new Set([...allKeys].filter((key) => {
3095
+ const v = def.shape[key]._zod;
3096
+ if (ctx.io === "input") return v.optin === void 0;
3097
+ else return v.optout === void 0;
3098
+ }));
3099
+ if (requiredKeys.size > 0) json.required = Array.from(requiredKeys);
3100
+ if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
3101
+ else if (!def.catchall) {
3102
+ if (ctx.io === "output") json.additionalProperties = false;
3103
+ } else if (def.catchall) json.additionalProperties = process(def.catchall, ctx, {
3104
+ ...params,
3105
+ path: [...params.path, "additionalProperties"]
3106
+ });
3107
+ };
3108
+ const unionProcessor = (schema, ctx, json, params) => {
3109
+ const def = schema._zod.def;
3110
+ const isExclusive = def.inclusive === false;
3111
+ const options = def.options.map((x, i) => process(x, ctx, {
3112
+ ...params,
3113
+ path: [
3114
+ ...params.path,
3115
+ isExclusive ? "oneOf" : "anyOf",
3116
+ i
3117
+ ]
3118
+ }));
3119
+ if (isExclusive) json.oneOf = options;
3120
+ else json.anyOf = options;
3121
+ };
3122
+ const intersectionProcessor = (schema, ctx, json, params) => {
3123
+ const def = schema._zod.def;
3124
+ const a = process(def.left, ctx, {
3125
+ ...params,
3126
+ path: [
3127
+ ...params.path,
3128
+ "allOf",
3129
+ 0
3130
+ ]
3131
+ });
3132
+ const b = process(def.right, ctx, {
3133
+ ...params,
3134
+ path: [
3135
+ ...params.path,
3136
+ "allOf",
3137
+ 1
3138
+ ]
3139
+ });
3140
+ const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
3141
+ json.allOf = [...isSimpleIntersection(a) ? a.allOf : [a], ...isSimpleIntersection(b) ? b.allOf : [b]];
3142
+ };
3143
+ const nullableProcessor = (schema, ctx, json, params) => {
3144
+ const def = schema._zod.def;
3145
+ const inner = process(def.innerType, ctx, params);
3146
+ const seen = ctx.seen.get(schema);
3147
+ if (ctx.target === "openapi-3.0") {
3148
+ seen.ref = def.innerType;
3149
+ json.nullable = true;
3150
+ } else json.anyOf = [inner, { type: "null" }];
3151
+ };
3152
+ const nonoptionalProcessor = (schema, ctx, _json, params) => {
3153
+ const def = schema._zod.def;
3154
+ process(def.innerType, ctx, params);
3155
+ const seen = ctx.seen.get(schema);
3156
+ seen.ref = def.innerType;
3157
+ };
3158
+ const defaultProcessor = (schema, ctx, json, params) => {
3159
+ const def = schema._zod.def;
3160
+ process(def.innerType, ctx, params);
3161
+ const seen = ctx.seen.get(schema);
3162
+ seen.ref = def.innerType;
3163
+ json.default = JSON.parse(JSON.stringify(def.defaultValue));
3164
+ };
3165
+ const prefaultProcessor = (schema, ctx, json, params) => {
3166
+ const def = schema._zod.def;
3167
+ process(def.innerType, ctx, params);
3168
+ const seen = ctx.seen.get(schema);
3169
+ seen.ref = def.innerType;
3170
+ if (ctx.io === "input") json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
3171
+ };
3172
+ const catchProcessor = (schema, ctx, json, params) => {
3173
+ const def = schema._zod.def;
3174
+ process(def.innerType, ctx, params);
3175
+ const seen = ctx.seen.get(schema);
3176
+ seen.ref = def.innerType;
3177
+ let catchValue;
3178
+ try {
3179
+ catchValue = def.catchValue(void 0);
3180
+ } catch {
3181
+ throw new Error("Dynamic catch values are not supported in JSON Schema");
3182
+ }
3183
+ json.default = catchValue;
3184
+ };
3185
+ const pipeProcessor = (schema, ctx, _json, params) => {
3186
+ const def = schema._zod.def;
3187
+ const inIsTransform = def.in._zod.traits.has("$ZodTransform");
3188
+ const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
3189
+ process(innerType, ctx, params);
3190
+ const seen = ctx.seen.get(schema);
3191
+ seen.ref = innerType;
3192
+ };
3193
+ const readonlyProcessor = (schema, ctx, json, params) => {
3194
+ const def = schema._zod.def;
3195
+ process(def.innerType, ctx, params);
3196
+ const seen = ctx.seen.get(schema);
3197
+ seen.ref = def.innerType;
3198
+ json.readOnly = true;
3199
+ };
3200
+ const optionalProcessor = (schema, ctx, _json, params) => {
3201
+ const def = schema._zod.def;
3202
+ process(def.innerType, ctx, params);
3203
+ const seen = ctx.seen.get(schema);
3204
+ seen.ref = def.innerType;
3205
+ };
3206
+ //#endregion
3207
+ //#region ../../../../deepseek-harness/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/iso.js
3208
+ const ZodISODateTime = /*@__PURE__*/ $constructor("ZodISODateTime", (inst, def) => {
3209
+ $ZodISODateTime.init(inst, def);
3210
+ ZodStringFormat.init(inst, def);
3211
+ });
3212
+ function datetime(params) {
3213
+ return /* @__PURE__ */ _isoDateTime(ZodISODateTime, params);
3214
+ }
3215
+ const ZodISODate = /*@__PURE__*/ $constructor("ZodISODate", (inst, def) => {
3216
+ $ZodISODate.init(inst, def);
3217
+ ZodStringFormat.init(inst, def);
3218
+ });
3219
+ function date(params) {
3220
+ return /* @__PURE__ */ _isoDate(ZodISODate, params);
3221
+ }
3222
+ const ZodISOTime = /*@__PURE__*/ $constructor("ZodISOTime", (inst, def) => {
3223
+ $ZodISOTime.init(inst, def);
3224
+ ZodStringFormat.init(inst, def);
3225
+ });
3226
+ function time(params) {
3227
+ return /* @__PURE__ */ _isoTime(ZodISOTime, params);
3228
+ }
3229
+ const ZodISODuration = /*@__PURE__*/ $constructor("ZodISODuration", (inst, def) => {
3230
+ $ZodISODuration.init(inst, def);
3231
+ ZodStringFormat.init(inst, def);
3232
+ });
3233
+ function duration(params) {
3234
+ return /* @__PURE__ */ _isoDuration(ZodISODuration, params);
3235
+ }
3236
+ //#endregion
3237
+ //#region ../../../../deepseek-harness/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/errors.js
3238
+ const initializer = (inst, issues) => {
3239
+ $ZodError.init(inst, issues);
3240
+ inst.name = "ZodError";
3241
+ Object.defineProperties(inst, {
3242
+ format: { value: (mapper) => formatError(inst, mapper) },
3243
+ flatten: { value: (mapper) => flattenError(inst, mapper) },
3244
+ addIssue: { value: (issue) => {
3245
+ inst.issues.push(issue);
3246
+ inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
3247
+ } },
3248
+ addIssues: { value: (issues) => {
3249
+ inst.issues.push(...issues);
3250
+ inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
3251
+ } },
3252
+ isEmpty: { get() {
3253
+ return inst.issues.length === 0;
3254
+ } }
3255
+ });
3256
+ };
3257
+ const ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, { Parent: Error });
3258
+ //#endregion
3259
+ //#region ../../../../deepseek-harness/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/parse.js
3260
+ const parse = /* @__PURE__ */ _parse(ZodRealError);
3261
+ const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
3262
+ const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
3263
+ const safeParseAsync = /* @__PURE__ */ _safeParseAsync(ZodRealError);
3264
+ const encode = /* @__PURE__ */ _encode(ZodRealError);
3265
+ const decode = /* @__PURE__ */ _decode(ZodRealError);
3266
+ const encodeAsync = /* @__PURE__ */ _encodeAsync(ZodRealError);
3267
+ const decodeAsync = /* @__PURE__ */ _decodeAsync(ZodRealError);
3268
+ const safeEncode = /* @__PURE__ */ _safeEncode(ZodRealError);
3269
+ const safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
3270
+ const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
3271
+ const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
3272
+ //#endregion
3273
+ //#region ../../../../deepseek-harness/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/schemas.js
3274
+ const _installedGroups = /* @__PURE__ */ new WeakMap();
3275
+ function _installLazyMethods(inst, group, methods) {
3276
+ const proto = Object.getPrototypeOf(inst);
3277
+ let installed = _installedGroups.get(proto);
3278
+ if (!installed) {
3279
+ installed = /* @__PURE__ */ new Set();
3280
+ _installedGroups.set(proto, installed);
3281
+ }
3282
+ if (installed.has(group)) return;
3283
+ installed.add(group);
3284
+ for (const key in methods) {
3285
+ const fn = methods[key];
3286
+ Object.defineProperty(proto, key, {
3287
+ configurable: true,
3288
+ enumerable: false,
3289
+ get() {
3290
+ const bound = fn.bind(this);
3291
+ Object.defineProperty(this, key, {
3292
+ configurable: true,
3293
+ writable: true,
3294
+ enumerable: true,
3295
+ value: bound
3296
+ });
3297
+ return bound;
3298
+ },
3299
+ set(v) {
3300
+ Object.defineProperty(this, key, {
3301
+ configurable: true,
3302
+ writable: true,
3303
+ enumerable: true,
3304
+ value: v
3305
+ });
3306
+ }
3307
+ });
3308
+ }
3309
+ }
3310
+ const ZodType = /*@__PURE__*/ $constructor("ZodType", (inst, def) => {
3311
+ $ZodType.init(inst, def);
3312
+ Object.assign(inst["~standard"], { jsonSchema: {
3313
+ input: createStandardJSONSchemaMethod(inst, "input"),
3314
+ output: createStandardJSONSchemaMethod(inst, "output")
3315
+ } });
3316
+ inst.toJSONSchema = createToJSONSchemaMethod(inst, {});
3317
+ inst.def = def;
3318
+ inst.type = def.type;
3319
+ Object.defineProperty(inst, "_def", { value: def });
3320
+ inst.parse = (data, params) => parse(inst, data, params, { callee: inst.parse });
3321
+ inst.safeParse = (data, params) => safeParse(inst, data, params);
3322
+ inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync });
3323
+ inst.safeParseAsync = async (data, params) => safeParseAsync(inst, data, params);
3324
+ inst.spa = inst.safeParseAsync;
3325
+ inst.encode = (data, params) => encode(inst, data, params);
3326
+ inst.decode = (data, params) => decode(inst, data, params);
3327
+ inst.encodeAsync = async (data, params) => encodeAsync(inst, data, params);
3328
+ inst.decodeAsync = async (data, params) => decodeAsync(inst, data, params);
3329
+ inst.safeEncode = (data, params) => safeEncode(inst, data, params);
3330
+ inst.safeDecode = (data, params) => safeDecode(inst, data, params);
3331
+ inst.safeEncodeAsync = async (data, params) => safeEncodeAsync(inst, data, params);
3332
+ inst.safeDecodeAsync = async (data, params) => safeDecodeAsync(inst, data, params);
3333
+ _installLazyMethods(inst, "ZodType", {
3334
+ check(...chks) {
3335
+ const def = this.def;
3336
+ return this.clone(mergeDefs(def, { checks: [...def.checks ?? [], ...chks.map((ch) => typeof ch === "function" ? { _zod: {
3337
+ check: ch,
3338
+ def: { check: "custom" },
3339
+ onattach: []
3340
+ } } : ch)] }), { parent: true });
3341
+ },
3342
+ with(...chks) {
3343
+ return this.check(...chks);
3344
+ },
3345
+ clone(def, params) {
3346
+ return clone(this, def, params);
3347
+ },
3348
+ brand() {
3349
+ return this;
3350
+ },
3351
+ register(reg, meta) {
3352
+ reg.add(this, meta);
3353
+ return this;
3354
+ },
3355
+ refine(check, params) {
3356
+ return this.check(refine(check, params));
3357
+ },
3358
+ superRefine(refinement, params) {
3359
+ return this.check(superRefine(refinement, params));
3360
+ },
3361
+ overwrite(fn) {
3362
+ return this.check(/* @__PURE__ */ _overwrite(fn));
3363
+ },
3364
+ optional() {
3365
+ return optional(this);
3366
+ },
3367
+ exactOptional() {
3368
+ return exactOptional(this);
3369
+ },
3370
+ nullable() {
3371
+ return nullable(this);
3372
+ },
3373
+ nullish() {
3374
+ return optional(nullable(this));
3375
+ },
3376
+ nonoptional(params) {
3377
+ return nonoptional(this, params);
3378
+ },
3379
+ array() {
3380
+ return array(this);
3381
+ },
3382
+ or(arg) {
3383
+ return union([this, arg]);
3384
+ },
3385
+ and(arg) {
3386
+ return intersection(this, arg);
3387
+ },
3388
+ transform(tx) {
3389
+ return pipe(this, transform(tx));
3390
+ },
3391
+ default(d) {
3392
+ return _default(this, d);
3393
+ },
3394
+ prefault(d) {
3395
+ return prefault(this, d);
3396
+ },
3397
+ catch(params) {
3398
+ return _catch(this, params);
3399
+ },
3400
+ pipe(target) {
3401
+ return pipe(this, target);
3402
+ },
3403
+ readonly() {
3404
+ return readonly(this);
3405
+ },
3406
+ describe(description) {
3407
+ const cl = this.clone();
3408
+ globalRegistry.add(cl, { description });
3409
+ return cl;
3410
+ },
3411
+ meta(...args) {
3412
+ if (args.length === 0) return globalRegistry.get(this);
3413
+ const cl = this.clone();
3414
+ globalRegistry.add(cl, args[0]);
3415
+ return cl;
3416
+ },
3417
+ isOptional() {
3418
+ return this.safeParse(void 0).success;
3419
+ },
3420
+ isNullable() {
3421
+ return this.safeParse(null).success;
3422
+ },
3423
+ apply(fn) {
3424
+ return fn(this);
3425
+ }
3426
+ });
3427
+ Object.defineProperty(inst, "description", {
3428
+ get() {
3429
+ return globalRegistry.get(inst)?.description;
3430
+ },
3431
+ configurable: true
3432
+ });
3433
+ return inst;
3434
+ });
3435
+ /** @internal */
3436
+ const _ZodString = /*@__PURE__*/ $constructor("_ZodString", (inst, def) => {
3437
+ $ZodString.init(inst, def);
3438
+ ZodType.init(inst, def);
3439
+ inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params);
3440
+ const bag = inst._zod.bag;
3441
+ inst.format = bag.format ?? null;
3442
+ inst.minLength = bag.minimum ?? null;
3443
+ inst.maxLength = bag.maximum ?? null;
3444
+ _installLazyMethods(inst, "_ZodString", {
3445
+ regex(...args) {
3446
+ return this.check(/* @__PURE__ */ _regex(...args));
3447
+ },
3448
+ includes(...args) {
3449
+ return this.check(/* @__PURE__ */ _includes(...args));
3450
+ },
3451
+ startsWith(...args) {
3452
+ return this.check(/* @__PURE__ */ _startsWith(...args));
3453
+ },
3454
+ endsWith(...args) {
3455
+ return this.check(/* @__PURE__ */ _endsWith(...args));
3456
+ },
3457
+ min(...args) {
3458
+ return this.check(/* @__PURE__ */ _minLength(...args));
3459
+ },
3460
+ max(...args) {
3461
+ return this.check(/* @__PURE__ */ _maxLength(...args));
3462
+ },
3463
+ length(...args) {
3464
+ return this.check(/* @__PURE__ */ _length(...args));
3465
+ },
3466
+ nonempty(...args) {
3467
+ return this.check(/* @__PURE__ */ _minLength(1, ...args));
3468
+ },
3469
+ lowercase(params) {
3470
+ return this.check(/* @__PURE__ */ _lowercase(params));
3471
+ },
3472
+ uppercase(params) {
3473
+ return this.check(/* @__PURE__ */ _uppercase(params));
3474
+ },
3475
+ trim() {
3476
+ return this.check(/* @__PURE__ */ _trim());
3477
+ },
3478
+ normalize(...args) {
3479
+ return this.check(/* @__PURE__ */ _normalize(...args));
3480
+ },
3481
+ toLowerCase() {
3482
+ return this.check(/* @__PURE__ */ _toLowerCase());
3483
+ },
3484
+ toUpperCase() {
3485
+ return this.check(/* @__PURE__ */ _toUpperCase());
3486
+ },
3487
+ slugify() {
3488
+ return this.check(/* @__PURE__ */ _slugify());
3489
+ }
3490
+ });
3491
+ });
3492
+ const ZodString = /*@__PURE__*/ $constructor("ZodString", (inst, def) => {
3493
+ $ZodString.init(inst, def);
3494
+ _ZodString.init(inst, def);
3495
+ inst.email = (params) => inst.check(/* @__PURE__ */ _email(ZodEmail, params));
3496
+ inst.url = (params) => inst.check(/* @__PURE__ */ _url(ZodURL, params));
3497
+ inst.jwt = (params) => inst.check(/* @__PURE__ */ _jwt(ZodJWT, params));
3498
+ inst.emoji = (params) => inst.check(/* @__PURE__ */ _emoji(ZodEmoji, params));
3499
+ inst.guid = (params) => inst.check(/* @__PURE__ */ _guid(ZodGUID, params));
3500
+ inst.uuid = (params) => inst.check(/* @__PURE__ */ _uuid(ZodUUID, params));
3501
+ inst.uuidv4 = (params) => inst.check(/* @__PURE__ */ _uuidv4(ZodUUID, params));
3502
+ inst.uuidv6 = (params) => inst.check(/* @__PURE__ */ _uuidv6(ZodUUID, params));
3503
+ inst.uuidv7 = (params) => inst.check(/* @__PURE__ */ _uuidv7(ZodUUID, params));
3504
+ inst.nanoid = (params) => inst.check(/* @__PURE__ */ _nanoid(ZodNanoID, params));
3505
+ inst.guid = (params) => inst.check(/* @__PURE__ */ _guid(ZodGUID, params));
3506
+ inst.cuid = (params) => inst.check(/* @__PURE__ */ _cuid(ZodCUID, params));
3507
+ inst.cuid2 = (params) => inst.check(/* @__PURE__ */ _cuid2(ZodCUID2, params));
3508
+ inst.ulid = (params) => inst.check(/* @__PURE__ */ _ulid(ZodULID, params));
3509
+ inst.base64 = (params) => inst.check(/* @__PURE__ */ _base64(ZodBase64, params));
3510
+ inst.base64url = (params) => inst.check(/* @__PURE__ */ _base64url(ZodBase64URL, params));
3511
+ inst.xid = (params) => inst.check(/* @__PURE__ */ _xid(ZodXID, params));
3512
+ inst.ksuid = (params) => inst.check(/* @__PURE__ */ _ksuid(ZodKSUID, params));
3513
+ inst.ipv4 = (params) => inst.check(/* @__PURE__ */ _ipv4(ZodIPv4, params));
3514
+ inst.ipv6 = (params) => inst.check(/* @__PURE__ */ _ipv6(ZodIPv6, params));
3515
+ inst.cidrv4 = (params) => inst.check(/* @__PURE__ */ _cidrv4(ZodCIDRv4, params));
3516
+ inst.cidrv6 = (params) => inst.check(/* @__PURE__ */ _cidrv6(ZodCIDRv6, params));
3517
+ inst.e164 = (params) => inst.check(/* @__PURE__ */ _e164(ZodE164, params));
3518
+ inst.datetime = (params) => inst.check(datetime(params));
3519
+ inst.date = (params) => inst.check(date(params));
3520
+ inst.time = (params) => inst.check(time(params));
3521
+ inst.duration = (params) => inst.check(duration(params));
3522
+ });
3523
+ function string(params) {
3524
+ return /* @__PURE__ */ _string(ZodString, params);
3525
+ }
3526
+ const ZodStringFormat = /*@__PURE__*/ $constructor("ZodStringFormat", (inst, def) => {
3527
+ $ZodStringFormat.init(inst, def);
3528
+ _ZodString.init(inst, def);
3529
+ });
3530
+ const ZodEmail = /*@__PURE__*/ $constructor("ZodEmail", (inst, def) => {
3531
+ $ZodEmail.init(inst, def);
3532
+ ZodStringFormat.init(inst, def);
3533
+ });
3534
+ const ZodGUID = /*@__PURE__*/ $constructor("ZodGUID", (inst, def) => {
3535
+ $ZodGUID.init(inst, def);
3536
+ ZodStringFormat.init(inst, def);
3537
+ });
3538
+ const ZodUUID = /*@__PURE__*/ $constructor("ZodUUID", (inst, def) => {
3539
+ $ZodUUID.init(inst, def);
3540
+ ZodStringFormat.init(inst, def);
3541
+ });
3542
+ const ZodURL = /*@__PURE__*/ $constructor("ZodURL", (inst, def) => {
3543
+ $ZodURL.init(inst, def);
3544
+ ZodStringFormat.init(inst, def);
3545
+ });
3546
+ const ZodEmoji = /*@__PURE__*/ $constructor("ZodEmoji", (inst, def) => {
3547
+ $ZodEmoji.init(inst, def);
3548
+ ZodStringFormat.init(inst, def);
3549
+ });
3550
+ const ZodNanoID = /*@__PURE__*/ $constructor("ZodNanoID", (inst, def) => {
3551
+ $ZodNanoID.init(inst, def);
3552
+ ZodStringFormat.init(inst, def);
3553
+ });
3554
+ /**
3555
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
3556
+ * (timestamps embedded in the id). Use {@link ZodCUID2} instead.
3557
+ * See https://github.com/paralleldrive/cuid.
3558
+ */
3559
+ const ZodCUID = /*@__PURE__*/ $constructor("ZodCUID", (inst, def) => {
3560
+ $ZodCUID.init(inst, def);
3561
+ ZodStringFormat.init(inst, def);
3562
+ });
3563
+ const ZodCUID2 = /*@__PURE__*/ $constructor("ZodCUID2", (inst, def) => {
3564
+ $ZodCUID2.init(inst, def);
3565
+ ZodStringFormat.init(inst, def);
3566
+ });
3567
+ const ZodULID = /*@__PURE__*/ $constructor("ZodULID", (inst, def) => {
3568
+ $ZodULID.init(inst, def);
3569
+ ZodStringFormat.init(inst, def);
3570
+ });
3571
+ const ZodXID = /*@__PURE__*/ $constructor("ZodXID", (inst, def) => {
3572
+ $ZodXID.init(inst, def);
3573
+ ZodStringFormat.init(inst, def);
3574
+ });
3575
+ const ZodKSUID = /*@__PURE__*/ $constructor("ZodKSUID", (inst, def) => {
3576
+ $ZodKSUID.init(inst, def);
3577
+ ZodStringFormat.init(inst, def);
3578
+ });
3579
+ const ZodIPv4 = /*@__PURE__*/ $constructor("ZodIPv4", (inst, def) => {
3580
+ $ZodIPv4.init(inst, def);
3581
+ ZodStringFormat.init(inst, def);
3582
+ });
3583
+ const ZodIPv6 = /*@__PURE__*/ $constructor("ZodIPv6", (inst, def) => {
3584
+ $ZodIPv6.init(inst, def);
3585
+ ZodStringFormat.init(inst, def);
3586
+ });
3587
+ const ZodCIDRv4 = /*@__PURE__*/ $constructor("ZodCIDRv4", (inst, def) => {
3588
+ $ZodCIDRv4.init(inst, def);
3589
+ ZodStringFormat.init(inst, def);
3590
+ });
3591
+ const ZodCIDRv6 = /*@__PURE__*/ $constructor("ZodCIDRv6", (inst, def) => {
3592
+ $ZodCIDRv6.init(inst, def);
3593
+ ZodStringFormat.init(inst, def);
3594
+ });
3595
+ const ZodBase64 = /*@__PURE__*/ $constructor("ZodBase64", (inst, def) => {
3596
+ $ZodBase64.init(inst, def);
3597
+ ZodStringFormat.init(inst, def);
3598
+ });
3599
+ const ZodBase64URL = /*@__PURE__*/ $constructor("ZodBase64URL", (inst, def) => {
3600
+ $ZodBase64URL.init(inst, def);
3601
+ ZodStringFormat.init(inst, def);
3602
+ });
3603
+ const ZodE164 = /*@__PURE__*/ $constructor("ZodE164", (inst, def) => {
3604
+ $ZodE164.init(inst, def);
3605
+ ZodStringFormat.init(inst, def);
3606
+ });
3607
+ const ZodJWT = /*@__PURE__*/ $constructor("ZodJWT", (inst, def) => {
3608
+ $ZodJWT.init(inst, def);
3609
+ ZodStringFormat.init(inst, def);
3610
+ });
3611
+ const ZodNumber = /*@__PURE__*/ $constructor("ZodNumber", (inst, def) => {
3612
+ $ZodNumber.init(inst, def);
3613
+ ZodType.init(inst, def);
3614
+ inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
3615
+ _installLazyMethods(inst, "ZodNumber", {
3616
+ gt(value, params) {
3617
+ return this.check(/* @__PURE__ */ _gt(value, params));
3618
+ },
3619
+ gte(value, params) {
3620
+ return this.check(/* @__PURE__ */ _gte(value, params));
3621
+ },
3622
+ min(value, params) {
3623
+ return this.check(/* @__PURE__ */ _gte(value, params));
3624
+ },
3625
+ lt(value, params) {
3626
+ return this.check(/* @__PURE__ */ _lt(value, params));
3627
+ },
3628
+ lte(value, params) {
3629
+ return this.check(/* @__PURE__ */ _lte(value, params));
3630
+ },
3631
+ max(value, params) {
3632
+ return this.check(/* @__PURE__ */ _lte(value, params));
3633
+ },
3634
+ int(params) {
3635
+ return this.check(int(params));
3636
+ },
3637
+ safe(params) {
3638
+ return this.check(int(params));
3639
+ },
3640
+ positive(params) {
3641
+ return this.check(/* @__PURE__ */ _gt(0, params));
3642
+ },
3643
+ nonnegative(params) {
3644
+ return this.check(/* @__PURE__ */ _gte(0, params));
3645
+ },
3646
+ negative(params) {
3647
+ return this.check(/* @__PURE__ */ _lt(0, params));
3648
+ },
3649
+ nonpositive(params) {
3650
+ return this.check(/* @__PURE__ */ _lte(0, params));
3651
+ },
3652
+ multipleOf(value, params) {
3653
+ return this.check(/* @__PURE__ */ _multipleOf(value, params));
3654
+ },
3655
+ step(value, params) {
3656
+ return this.check(/* @__PURE__ */ _multipleOf(value, params));
3657
+ },
3658
+ finite() {
3659
+ return this;
3660
+ }
3661
+ });
3662
+ const bag = inst._zod.bag;
3663
+ inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
3664
+ inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
3665
+ inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? .5);
3666
+ inst.isFinite = true;
3667
+ inst.format = bag.format ?? null;
3668
+ });
3669
+ function number(params) {
3670
+ return /* @__PURE__ */ _number(ZodNumber, params);
3671
+ }
3672
+ const ZodNumberFormat = /*@__PURE__*/ $constructor("ZodNumberFormat", (inst, def) => {
3673
+ $ZodNumberFormat.init(inst, def);
3674
+ ZodNumber.init(inst, def);
3675
+ });
3676
+ function int(params) {
3677
+ return /* @__PURE__ */ _int(ZodNumberFormat, params);
3678
+ }
3679
+ const ZodBoolean = /*@__PURE__*/ $constructor("ZodBoolean", (inst, def) => {
3680
+ $ZodBoolean.init(inst, def);
3681
+ ZodType.init(inst, def);
3682
+ inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json, params);
3683
+ });
3684
+ function boolean(params) {
3685
+ return /* @__PURE__ */ _boolean(ZodBoolean, params);
3686
+ }
3687
+ const ZodUnknown = /*@__PURE__*/ $constructor("ZodUnknown", (inst, def) => {
3688
+ $ZodUnknown.init(inst, def);
3689
+ ZodType.init(inst, def);
3690
+ inst._zod.processJSONSchema = (ctx, json, params) => void 0;
3691
+ });
3692
+ function unknown() {
3693
+ return /* @__PURE__ */ _unknown(ZodUnknown);
3694
+ }
3695
+ const ZodNever = /*@__PURE__*/ $constructor("ZodNever", (inst, def) => {
3696
+ $ZodNever.init(inst, def);
3697
+ ZodType.init(inst, def);
3698
+ inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor(inst, ctx, json, params);
3699
+ });
3700
+ function never(params) {
3701
+ return /* @__PURE__ */ _never(ZodNever, params);
3702
+ }
3703
+ const ZodArray = /*@__PURE__*/ $constructor("ZodArray", (inst, def) => {
3704
+ $ZodArray.init(inst, def);
3705
+ ZodType.init(inst, def);
3706
+ inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params);
3707
+ inst.element = def.element;
3708
+ _installLazyMethods(inst, "ZodArray", {
3709
+ min(n, params) {
3710
+ return this.check(/* @__PURE__ */ _minLength(n, params));
3711
+ },
3712
+ nonempty(params) {
3713
+ return this.check(/* @__PURE__ */ _minLength(1, params));
3714
+ },
3715
+ max(n, params) {
3716
+ return this.check(/* @__PURE__ */ _maxLength(n, params));
3717
+ },
3718
+ length(n, params) {
3719
+ return this.check(/* @__PURE__ */ _length(n, params));
3720
+ },
3721
+ unwrap() {
3722
+ return this.element;
3723
+ }
3724
+ });
3725
+ });
3726
+ function array(element, params) {
3727
+ return /* @__PURE__ */ _array(ZodArray, element, params);
3728
+ }
3729
+ const ZodObject = /*@__PURE__*/ $constructor("ZodObject", (inst, def) => {
3730
+ $ZodObjectJIT.init(inst, def);
3731
+ ZodType.init(inst, def);
3732
+ inst._zod.processJSONSchema = (ctx, json, params) => objectProcessor(inst, ctx, json, params);
3733
+ defineLazy(inst, "shape", () => {
3734
+ return def.shape;
3735
+ });
3736
+ _installLazyMethods(inst, "ZodObject", {
3737
+ keyof() {
3738
+ return _enum(Object.keys(this._zod.def.shape));
3739
+ },
3740
+ catchall(catchall) {
3741
+ return this.clone({
3742
+ ...this._zod.def,
3743
+ catchall
3744
+ });
3745
+ },
3746
+ passthrough() {
3747
+ return this.clone({
3748
+ ...this._zod.def,
3749
+ catchall: unknown()
3750
+ });
3751
+ },
3752
+ loose() {
3753
+ return this.clone({
3754
+ ...this._zod.def,
3755
+ catchall: unknown()
3756
+ });
3757
+ },
3758
+ strict() {
3759
+ return this.clone({
3760
+ ...this._zod.def,
3761
+ catchall: never()
3762
+ });
3763
+ },
3764
+ strip() {
3765
+ return this.clone({
3766
+ ...this._zod.def,
3767
+ catchall: void 0
3768
+ });
3769
+ },
3770
+ extend(incoming) {
3771
+ return extend(this, incoming);
3772
+ },
3773
+ safeExtend(incoming) {
3774
+ return safeExtend(this, incoming);
3775
+ },
3776
+ merge(other) {
3777
+ return merge(this, other);
3778
+ },
3779
+ pick(mask) {
3780
+ return pick(this, mask);
3781
+ },
3782
+ omit(mask) {
3783
+ return omit(this, mask);
3784
+ },
3785
+ partial(...args) {
3786
+ return partial(ZodOptional, this, args[0]);
3787
+ },
3788
+ required(...args) {
3789
+ return required(ZodNonOptional, this, args[0]);
3790
+ }
3791
+ });
3792
+ });
3793
+ function object(shape, params) {
3794
+ return new ZodObject({
3795
+ type: "object",
3796
+ shape: shape ?? {},
3797
+ ...normalizeParams(params)
3798
+ });
3799
+ }
3800
+ const ZodUnion = /*@__PURE__*/ $constructor("ZodUnion", (inst, def) => {
3801
+ $ZodUnion.init(inst, def);
3802
+ ZodType.init(inst, def);
3803
+ inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params);
3804
+ inst.options = def.options;
3805
+ });
3806
+ function union(options, params) {
3807
+ return new ZodUnion({
3808
+ type: "union",
3809
+ options,
3810
+ ...normalizeParams(params)
3811
+ });
3812
+ }
3813
+ const ZodIntersection = /*@__PURE__*/ $constructor("ZodIntersection", (inst, def) => {
3814
+ $ZodIntersection.init(inst, def);
3815
+ ZodType.init(inst, def);
3816
+ inst._zod.processJSONSchema = (ctx, json, params) => intersectionProcessor(inst, ctx, json, params);
3817
+ });
3818
+ function intersection(left, right) {
3819
+ return new ZodIntersection({
3820
+ type: "intersection",
3821
+ left,
3822
+ right
3823
+ });
3824
+ }
3825
+ const ZodEnum = /*@__PURE__*/ $constructor("ZodEnum", (inst, def) => {
3826
+ $ZodEnum.init(inst, def);
3827
+ ZodType.init(inst, def);
3828
+ inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
3829
+ inst.enum = def.entries;
3830
+ inst.options = Object.values(def.entries);
3831
+ const keys = new Set(Object.keys(def.entries));
3832
+ inst.extract = (values, params) => {
3833
+ const newEntries = {};
3834
+ for (const value of values) if (keys.has(value)) newEntries[value] = def.entries[value];
3835
+ else throw new Error(`Key ${value} not found in enum`);
3836
+ return new ZodEnum({
3837
+ ...def,
3838
+ checks: [],
3839
+ ...normalizeParams(params),
3840
+ entries: newEntries
3841
+ });
3842
+ };
3843
+ inst.exclude = (values, params) => {
3844
+ const newEntries = { ...def.entries };
3845
+ for (const value of values) if (keys.has(value)) delete newEntries[value];
3846
+ else throw new Error(`Key ${value} not found in enum`);
3847
+ return new ZodEnum({
3848
+ ...def,
3849
+ checks: [],
3850
+ ...normalizeParams(params),
3851
+ entries: newEntries
3852
+ });
3853
+ };
3854
+ });
3855
+ function _enum(values, params) {
3856
+ return new ZodEnum({
3857
+ type: "enum",
3858
+ entries: Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values,
3859
+ ...normalizeParams(params)
3860
+ });
3861
+ }
3862
+ const ZodLiteral = /*@__PURE__*/ $constructor("ZodLiteral", (inst, def) => {
3863
+ $ZodLiteral.init(inst, def);
3864
+ ZodType.init(inst, def);
3865
+ inst._zod.processJSONSchema = (ctx, json, params) => literalProcessor(inst, ctx, json, params);
3866
+ inst.values = new Set(def.values);
3867
+ Object.defineProperty(inst, "value", { get() {
3868
+ if (def.values.length > 1) throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
3869
+ return def.values[0];
3870
+ } });
3871
+ });
3872
+ function literal(value, params) {
3873
+ return new ZodLiteral({
3874
+ type: "literal",
3875
+ values: Array.isArray(value) ? value : [value],
3876
+ ...normalizeParams(params)
3877
+ });
3878
+ }
3879
+ const ZodTransform = /*@__PURE__*/ $constructor("ZodTransform", (inst, def) => {
3880
+ $ZodTransform.init(inst, def);
3881
+ ZodType.init(inst, def);
3882
+ inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx, json, params);
3883
+ inst._zod.parse = (payload, _ctx) => {
3884
+ if (_ctx.direction === "backward") throw new $ZodEncodeError(inst.constructor.name);
3885
+ payload.addIssue = (issue$1) => {
3886
+ if (typeof issue$1 === "string") payload.issues.push(issue(issue$1, payload.value, def));
3887
+ else {
3888
+ const _issue = issue$1;
3889
+ if (_issue.fatal) _issue.continue = false;
3890
+ _issue.code ?? (_issue.code = "custom");
3891
+ _issue.input ?? (_issue.input = payload.value);
3892
+ _issue.inst ?? (_issue.inst = inst);
3893
+ payload.issues.push(issue(_issue));
3894
+ }
3895
+ };
3896
+ const output = def.transform(payload.value, payload);
3897
+ if (output instanceof Promise) return output.then((output) => {
3898
+ payload.value = output;
3899
+ payload.fallback = true;
3900
+ return payload;
3901
+ });
3902
+ payload.value = output;
3903
+ payload.fallback = true;
3904
+ return payload;
3905
+ };
3906
+ });
3907
+ function transform(fn) {
3908
+ return new ZodTransform({
3909
+ type: "transform",
3910
+ transform: fn
3911
+ });
3912
+ }
3913
+ const ZodOptional = /*@__PURE__*/ $constructor("ZodOptional", (inst, def) => {
3914
+ $ZodOptional.init(inst, def);
3915
+ ZodType.init(inst, def);
3916
+ inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
3917
+ inst.unwrap = () => inst._zod.def.innerType;
3918
+ });
3919
+ function optional(innerType) {
3920
+ return new ZodOptional({
3921
+ type: "optional",
3922
+ innerType
3923
+ });
3924
+ }
3925
+ const ZodExactOptional = /*@__PURE__*/ $constructor("ZodExactOptional", (inst, def) => {
3926
+ $ZodExactOptional.init(inst, def);
3927
+ ZodType.init(inst, def);
3928
+ inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
3929
+ inst.unwrap = () => inst._zod.def.innerType;
3930
+ });
3931
+ function exactOptional(innerType) {
3932
+ return new ZodExactOptional({
3933
+ type: "optional",
3934
+ innerType
3935
+ });
3936
+ }
3937
+ const ZodNullable = /*@__PURE__*/ $constructor("ZodNullable", (inst, def) => {
3938
+ $ZodNullable.init(inst, def);
3939
+ ZodType.init(inst, def);
3940
+ inst._zod.processJSONSchema = (ctx, json, params) => nullableProcessor(inst, ctx, json, params);
3941
+ inst.unwrap = () => inst._zod.def.innerType;
3942
+ });
3943
+ function nullable(innerType) {
3944
+ return new ZodNullable({
3945
+ type: "nullable",
3946
+ innerType
3947
+ });
3948
+ }
3949
+ const ZodDefault = /*@__PURE__*/ $constructor("ZodDefault", (inst, def) => {
3950
+ $ZodDefault.init(inst, def);
3951
+ ZodType.init(inst, def);
3952
+ inst._zod.processJSONSchema = (ctx, json, params) => defaultProcessor(inst, ctx, json, params);
3953
+ inst.unwrap = () => inst._zod.def.innerType;
3954
+ inst.removeDefault = inst.unwrap;
3955
+ });
3956
+ function _default(innerType, defaultValue) {
3957
+ return new ZodDefault({
3958
+ type: "default",
3959
+ innerType,
3960
+ get defaultValue() {
3961
+ return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
3962
+ }
3963
+ });
3964
+ }
3965
+ const ZodPrefault = /*@__PURE__*/ $constructor("ZodPrefault", (inst, def) => {
3966
+ $ZodPrefault.init(inst, def);
3967
+ ZodType.init(inst, def);
3968
+ inst._zod.processJSONSchema = (ctx, json, params) => prefaultProcessor(inst, ctx, json, params);
3969
+ inst.unwrap = () => inst._zod.def.innerType;
3970
+ });
3971
+ function prefault(innerType, defaultValue) {
3972
+ return new ZodPrefault({
3973
+ type: "prefault",
3974
+ innerType,
3975
+ get defaultValue() {
3976
+ return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
3977
+ }
3978
+ });
3979
+ }
3980
+ const ZodNonOptional = /*@__PURE__*/ $constructor("ZodNonOptional", (inst, def) => {
3981
+ $ZodNonOptional.init(inst, def);
3982
+ ZodType.init(inst, def);
3983
+ inst._zod.processJSONSchema = (ctx, json, params) => nonoptionalProcessor(inst, ctx, json, params);
3984
+ inst.unwrap = () => inst._zod.def.innerType;
3985
+ });
3986
+ function nonoptional(innerType, params) {
3987
+ return new ZodNonOptional({
3988
+ type: "nonoptional",
3989
+ innerType,
3990
+ ...normalizeParams(params)
3991
+ });
3992
+ }
3993
+ const ZodCatch = /*@__PURE__*/ $constructor("ZodCatch", (inst, def) => {
3994
+ $ZodCatch.init(inst, def);
3995
+ ZodType.init(inst, def);
3996
+ inst._zod.processJSONSchema = (ctx, json, params) => catchProcessor(inst, ctx, json, params);
3997
+ inst.unwrap = () => inst._zod.def.innerType;
3998
+ inst.removeCatch = inst.unwrap;
3999
+ });
4000
+ function _catch(innerType, catchValue) {
4001
+ return new ZodCatch({
4002
+ type: "catch",
4003
+ innerType,
4004
+ catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
4005
+ });
4006
+ }
4007
+ const ZodPipe = /*@__PURE__*/ $constructor("ZodPipe", (inst, def) => {
4008
+ $ZodPipe.init(inst, def);
4009
+ ZodType.init(inst, def);
4010
+ inst._zod.processJSONSchema = (ctx, json, params) => pipeProcessor(inst, ctx, json, params);
4011
+ inst.in = def.in;
4012
+ inst.out = def.out;
4013
+ });
4014
+ function pipe(in_, out) {
4015
+ return new ZodPipe({
4016
+ type: "pipe",
4017
+ in: in_,
4018
+ out
4019
+ });
4020
+ }
4021
+ const ZodReadonly = /*@__PURE__*/ $constructor("ZodReadonly", (inst, def) => {
4022
+ $ZodReadonly.init(inst, def);
4023
+ ZodType.init(inst, def);
4024
+ inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor(inst, ctx, json, params);
4025
+ inst.unwrap = () => inst._zod.def.innerType;
4026
+ });
4027
+ function readonly(innerType) {
4028
+ return new ZodReadonly({
4029
+ type: "readonly",
4030
+ innerType
4031
+ });
4032
+ }
4033
+ const ZodCustom = /*@__PURE__*/ $constructor("ZodCustom", (inst, def) => {
4034
+ $ZodCustom.init(inst, def);
4035
+ ZodType.init(inst, def);
4036
+ inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
4037
+ });
4038
+ function refine(fn, _params = {}) {
4039
+ return /* @__PURE__ */ _refine(ZodCustom, fn, _params);
4040
+ }
4041
+ function superRefine(fn, params) {
4042
+ return /* @__PURE__ */ _superRefine(fn, params);
4043
+ }
4044
+ //#endregion
4045
+ //#region src/client/remote-client.js
4046
+ const $id = intersection(string(), unknown());
4047
+ const $status = union([
4048
+ literal("active"),
4049
+ literal("paused"),
4050
+ literal("completed")
4051
+ ]);
4052
+ const $state = union([
4053
+ literal("scheduled"),
4054
+ literal("overdue"),
4055
+ literal("completed")
4056
+ ]);
4057
+ const $model = object({
4058
+ "provider": string(),
4059
+ "model": string()
4060
+ });
4061
+ const $errorCode = union([
4062
+ literal("invalid_title"),
4063
+ literal("invalid_prompt"),
4064
+ literal("invalid_selector"),
4065
+ literal("invalid_rule"),
4066
+ literal("invalid_time_zone"),
4067
+ literal("not_future"),
4068
+ literal("time_out_of_range"),
4069
+ literal("frequency_too_high"),
4070
+ literal("task_not_found"),
4071
+ literal("internal_error")
4072
+ ]);
4073
+ const $failure = object({
4074
+ "ok": literal(false),
4075
+ "code": $errorCode,
4076
+ "message": string()
4077
+ });
4078
+ const $rule = union([
4079
+ object({
4080
+ "kind": literal("after"),
4081
+ "afterSeconds": number(),
4082
+ "scheduledAt": string()
4083
+ }),
4084
+ object({
4085
+ "kind": literal("at"),
4086
+ "scheduledAt": string()
4087
+ }),
4088
+ object({
4089
+ "kind": literal("every"),
4090
+ "everySeconds": number(),
4091
+ "scheduledAt": string()
4092
+ }),
4093
+ object({
4094
+ "kind": literal("hourly"),
4095
+ "minute": number(),
4096
+ "scheduledAt": string()
4097
+ }),
4098
+ object({
4099
+ "kind": literal("daily"),
4100
+ "time": string(),
4101
+ "time_zone": string(),
4102
+ "scheduledAt": string()
4103
+ }),
4104
+ object({
4105
+ "kind": literal("weekly"),
4106
+ "weekdays": array(number()),
4107
+ "time": string(),
4108
+ "time_zone": string(),
4109
+ "scheduledAt": string()
4110
+ }),
4111
+ object({
4112
+ "kind": literal("monthly"),
4113
+ "dayOfMonth": number(),
4114
+ "time": string(),
4115
+ "time_zone": string(),
4116
+ "scheduledAt": string()
4117
+ })
4118
+ ]);
4119
+ const $taskView = object({
4120
+ "id": $id,
4121
+ "title": string(),
4122
+ "prompt": string(),
4123
+ "rule": $rule,
4124
+ "status": $status,
4125
+ "sessionId": $id,
4126
+ "createdAt": string(),
4127
+ "lastRunAt": string().optional(),
4128
+ "nextRunAt": string().optional(),
4129
+ "lastError": object({
4130
+ at: string(),
4131
+ message: string().min(1)
4132
+ }).optional(),
4133
+ "state": $state,
4134
+ "unread": boolean(),
4135
+ "workspaceId": string().optional(),
4136
+ "cwd": string().optional(),
4137
+ "model": $model.optional(),
4138
+ "confirmBeforeChange": boolean()
4139
+ });
4140
+ const $mutationResult = union([object({
4141
+ "ok": literal(true),
4142
+ "task": $taskView
4143
+ }), $failure]);
4144
+ const $carryFields = {
4145
+ "prompt": string().optional(),
4146
+ "workspaceId": string().optional(),
4147
+ "cwd": string().optional(),
4148
+ "model": $model.optional(),
4149
+ "confirmBeforeChange": boolean().optional()
4150
+ };
4151
+ const $selectorFields = {
4152
+ "after_seconds": number().optional(),
4153
+ "at": object({
4154
+ "date": string(),
4155
+ "time": string(),
4156
+ "time_zone": string()
4157
+ }).optional(),
4158
+ "every_seconds": number().optional(),
4159
+ "hourly": object({ "minute": number() }).optional(),
4160
+ "daily": object({
4161
+ "time": string(),
4162
+ "time_zone": string()
4163
+ }).optional(),
4164
+ "weekly": object({
4165
+ "weekdays": array(number()),
4166
+ "time": string(),
4167
+ "time_zone": string()
4168
+ }).optional(),
4169
+ "monthly": object({
4170
+ "dayOfMonth": number(),
4171
+ "time": string(),
4172
+ "time_zone": string()
4173
+ }).optional()
4174
+ };
4175
+ const _deepseek_ai_dsh_scheduled_task_scheduledTasks_create_parameter_0$schema = object({
4176
+ "title": string(),
4177
+ ...$carryFields,
4178
+ ...$selectorFields
4179
+ });
4180
+ const _deepseek_ai_dsh_scheduled_task_scheduledTasks_create_result$schema = $mutationResult;
4181
+ const _deepseek_ai_dsh_scheduled_task_scheduledTasks_delete_parameter_0$schema = $id;
4182
+ const _deepseek_ai_dsh_scheduled_task_scheduledTasks_delete_result$schema = union([object({
4183
+ "ok": literal(true),
4184
+ "deleted": boolean()
4185
+ }), $failure]);
4186
+ const _deepseek_ai_dsh_scheduled_task_scheduledTasks_list_result$schema = array($taskView);
4187
+ const _deepseek_ai_dsh_scheduled_task_scheduledTasks_markRead_parameter_0$schema = $id;
4188
+ const _deepseek_ai_dsh_scheduled_task_scheduledTasks_markRead_result$schema = literal(null);
4189
+ const _deepseek_ai_dsh_scheduled_task_scheduledTasks_setStatus_parameter_0$schema = $id;
4190
+ const _deepseek_ai_dsh_scheduled_task_scheduledTasks_setStatus_parameter_1$schema = union([literal("active"), literal("paused")]);
4191
+ const _deepseek_ai_dsh_scheduled_task_scheduledTasks_setStatus_result$schema = $mutationResult;
4192
+ const _deepseek_ai_dsh_scheduled_task_scheduledTasks_update_parameter_0$schema = $id;
4193
+ const _deepseek_ai_dsh_scheduled_task_scheduledTasks_update_parameter_1$schema = object({
4194
+ "title": string().optional(),
4195
+ ...$carryFields,
4196
+ ...$selectorFields
4197
+ });
4198
+ const TYPERT_REMOTE = {
4199
+ package: "@qihongmu/dsh-plugins-scheduled-task",
4200
+ descriptors: [
4201
+ {
4202
+ id: "@qihongmu/dsh-plugins-scheduled-task#scheduledTasks/create",
4203
+ service: "scheduledTasks",
4204
+ namespace: "scheduledTasks",
4205
+ method: "create",
4206
+ invocation: { kind: "direct" },
4207
+ parameters: [{
4208
+ name: "input",
4209
+ wire: "input",
4210
+ source: "json",
4211
+ codec: {
4212
+ mode: "strict",
4213
+ typeSymbol: "@qihongmu/dsh-plugins-scheduled-task/types#ScheduledTaskCreateInput",
4214
+ schema: _deepseek_ai_dsh_scheduled_task_scheduledTasks_create_parameter_0$schema
4215
+ }
4216
+ }],
4217
+ result: {
4218
+ mode: "strict",
4219
+ typeSymbol: "@qihongmu/dsh-plugins-scheduled-task/types#ScheduledTaskMutationResult",
4220
+ schema: _deepseek_ai_dsh_scheduled_task_scheduledTasks_create_result$schema
4221
+ },
4222
+ sourceLocation: {
4223
+ "file": "packages/scheduled-task/host/src/index.ts",
4224
+ "line": 166,
4225
+ "column": 3
4226
+ }
4227
+ },
4228
+ {
4229
+ id: "@qihongmu/dsh-plugins-scheduled-task#scheduledTasks/delete",
4230
+ service: "scheduledTasks",
4231
+ namespace: "scheduledTasks",
4232
+ method: "delete",
4233
+ invocation: { kind: "direct" },
4234
+ parameters: [{
4235
+ name: "id",
4236
+ wire: "id",
4237
+ source: "json",
4238
+ codec: {
4239
+ mode: "strict",
4240
+ typeSymbol: "@qihongmu/dsh-plugins-scheduled-task/types#ScheduledTaskId",
4241
+ schema: _deepseek_ai_dsh_scheduled_task_scheduledTasks_delete_parameter_0$schema
4242
+ }
4243
+ }],
4244
+ result: {
4245
+ mode: "strict",
4246
+ typeSymbol: "@qihongmu/dsh-plugins-scheduled-task/types#ScheduledTaskDeleteResult",
4247
+ schema: _deepseek_ai_dsh_scheduled_task_scheduledTasks_delete_result$schema
4248
+ },
4249
+ sourceLocation: {
4250
+ "file": "packages/scheduled-task/host/src/index.ts",
4251
+ "line": 244,
4252
+ "column": 3
4253
+ }
4254
+ },
4255
+ {
4256
+ id: "@qihongmu/dsh-plugins-scheduled-task#scheduledTasks/list",
4257
+ service: "scheduledTasks",
4258
+ namespace: "scheduledTasks",
4259
+ method: "list",
4260
+ invocation: { kind: "direct" },
4261
+ parameters: [],
4262
+ result: {
4263
+ mode: "strict",
4264
+ typeSymbol: "@qihongmu/dsh-plugins-scheduled-task#scheduledTasks/list:result",
4265
+ schema: _deepseek_ai_dsh_scheduled_task_scheduledTasks_list_result$schema
4266
+ },
4267
+ sourceLocation: {
4268
+ "file": "packages/scheduled-task/host/src/index.ts",
4269
+ "line": 151,
4270
+ "column": 3
4271
+ }
4272
+ },
4273
+ {
4274
+ id: "@qihongmu/dsh-plugins-scheduled-task#scheduledTasks/markRead",
4275
+ service: "scheduledTasks",
4276
+ namespace: "scheduledTasks",
4277
+ method: "markRead",
4278
+ invocation: { kind: "direct" },
4279
+ parameters: [{
4280
+ name: "id",
4281
+ wire: "id",
4282
+ source: "json",
4283
+ codec: {
4284
+ mode: "strict",
4285
+ typeSymbol: "@qihongmu/dsh-plugins-scheduled-task/types#ScheduledTaskId",
4286
+ schema: _deepseek_ai_dsh_scheduled_task_scheduledTasks_markRead_parameter_0$schema
4287
+ }
4288
+ }],
4289
+ result: {
4290
+ mode: "strict",
4291
+ typeSymbol: "@qihongmu/dsh-plugins-scheduled-task#scheduledTasks/markRead:result",
4292
+ schema: _deepseek_ai_dsh_scheduled_task_scheduledTasks_markRead_result$schema
4293
+ },
4294
+ sourceLocation: {
4295
+ "file": "packages/scheduled-task/host/src/index.ts",
4296
+ "line": 268,
4297
+ "column": 3
4298
+ }
4299
+ },
4300
+ {
4301
+ id: "@qihongmu/dsh-plugins-scheduled-task#scheduledTasks/setStatus",
4302
+ service: "scheduledTasks",
4303
+ namespace: "scheduledTasks",
4304
+ method: "setStatus",
4305
+ invocation: { kind: "direct" },
4306
+ parameters: [{
4307
+ name: "id",
4308
+ wire: "id",
4309
+ source: "json",
4310
+ codec: {
4311
+ mode: "strict",
4312
+ typeSymbol: "@qihongmu/dsh-plugins-scheduled-task/types#ScheduledTaskId",
4313
+ schema: _deepseek_ai_dsh_scheduled_task_scheduledTasks_setStatus_parameter_0$schema
4314
+ }
4315
+ }, {
4316
+ name: "status",
4317
+ wire: "status",
4318
+ source: "json",
4319
+ codec: {
4320
+ mode: "strict",
4321
+ typeSymbol: "@qihongmu/dsh-plugins-scheduled-task/types#ScheduledTaskSettableStatus",
4322
+ schema: _deepseek_ai_dsh_scheduled_task_scheduledTasks_setStatus_parameter_1$schema
4323
+ }
4324
+ }],
4325
+ result: {
4326
+ mode: "strict",
4327
+ typeSymbol: "@qihongmu/dsh-plugins-scheduled-task/types#ScheduledTaskMutationResult",
4328
+ schema: _deepseek_ai_dsh_scheduled_task_scheduledTasks_setStatus_result$schema
4329
+ },
4330
+ sourceLocation: {
4331
+ "file": "packages/scheduled-task/host/src/index.ts",
4332
+ "line": 222,
4333
+ "column": 3
4334
+ }
4335
+ },
4336
+ {
4337
+ id: "@qihongmu/dsh-plugins-scheduled-task#scheduledTasks/update",
4338
+ service: "scheduledTasks",
4339
+ namespace: "scheduledTasks",
4340
+ method: "update",
4341
+ invocation: { kind: "direct" },
4342
+ parameters: [{
4343
+ name: "id",
4344
+ wire: "id",
4345
+ source: "json",
4346
+ codec: {
4347
+ mode: "strict",
4348
+ typeSymbol: "@qihongmu/dsh-plugins-scheduled-task/types#ScheduledTaskId",
4349
+ schema: _deepseek_ai_dsh_scheduled_task_scheduledTasks_update_parameter_0$schema
4350
+ }
4351
+ }, {
4352
+ name: "input",
4353
+ wire: "input",
4354
+ source: "json",
4355
+ codec: {
4356
+ mode: "strict",
4357
+ typeSymbol: "@qihongmu/dsh-plugins-scheduled-task/types#ScheduledTaskUpdateInput",
4358
+ schema: _deepseek_ai_dsh_scheduled_task_scheduledTasks_update_parameter_1$schema
4359
+ }
4360
+ }],
4361
+ result: {
4362
+ mode: "strict",
4363
+ typeSymbol: "@qihongmu/dsh-plugins-scheduled-task/types#ScheduledTaskMutationResult",
4364
+ schema: $mutationResult
4365
+ },
4366
+ sourceLocation: {
4367
+ "file": "packages/scheduled-task/host/src/index.ts",
4368
+ "line": 200,
4369
+ "column": 3
4370
+ }
4371
+ }
4372
+ ]
4373
+ };
4374
+ //#endregion
4375
+ //#region src/client/index.ts
4376
+ /** Required service: the typed Client Remote contribution mount. */
4377
+ const inject = ["remote"];
4378
+ /**
4379
+ * Mount the scheduledTasks Remote namespaces for this plugin.
4380
+ * @param ctx - Client Cordis context carrying the typed API service.
4381
+ * @returns disposer after every mounted namespace is ready.
4382
+ */
4383
+ async function apply(ctx) {
4384
+ return await ctx.remote.$mount(TYPERT_REMOTE);
4385
+ }
4386
+ //#endregion
4387
+ exports.apply = apply;
4388
+ exports.inject = inject;
4389
+ return module.exports;
4390
+ }
4391
+ });