@cydm/pie 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.
Files changed (45) hide show
  1. package/README.md +150 -0
  2. package/dist/builtin/extensions/ask-user/index.js +2924 -0
  3. package/dist/builtin/extensions/changelog/index.js +200 -0
  4. package/dist/builtin/extensions/compact/index.js +52 -0
  5. package/dist/builtin/extensions/deploy/index.js +11 -0
  6. package/dist/builtin/extensions/files/index.js +10 -0
  7. package/dist/builtin/extensions/init/index.js +144 -0
  8. package/dist/builtin/extensions/plan-mode/index.js +209 -0
  9. package/dist/builtin/extensions/questionnaire/index.js +2753 -0
  10. package/dist/builtin/extensions/subagent/index.js +7350 -0
  11. package/dist/builtin/extensions/todo/index.js +162 -0
  12. package/dist/builtin/skills/browser-tools/CHANGELOG.md +47 -0
  13. package/dist/builtin/skills/browser-tools/README.md +106 -0
  14. package/dist/builtin/skills/browser-tools/SKILL.md +196 -0
  15. package/dist/builtin/skills/browser-tools/browser-content.js +103 -0
  16. package/dist/builtin/skills/browser-tools/browser-cookies.js +35 -0
  17. package/dist/builtin/skills/browser-tools/browser-eval.js +49 -0
  18. package/dist/builtin/skills/browser-tools/browser-hn-scraper.js +108 -0
  19. package/dist/builtin/skills/browser-tools/browser-nav.js +44 -0
  20. package/dist/builtin/skills/browser-tools/browser-pick.js +162 -0
  21. package/dist/builtin/skills/browser-tools/browser-screenshot.js +34 -0
  22. package/dist/builtin/skills/browser-tools/browser-start.js +86 -0
  23. package/dist/builtin/skills/browser-tools/package.json +19 -0
  24. package/dist/builtin/skills/skill-creator/LICENSE.txt +202 -0
  25. package/dist/builtin/skills/skill-creator/SKILL.md +485 -0
  26. package/dist/builtin/skills/skill-creator/agents/analyzer.md +274 -0
  27. package/dist/builtin/skills/skill-creator/agents/comparator.md +202 -0
  28. package/dist/builtin/skills/skill-creator/agents/grader.md +223 -0
  29. package/dist/builtin/skills/skill-creator/assets/eval_review.html +146 -0
  30. package/dist/builtin/skills/skill-creator/eval-viewer/generate_review.py +471 -0
  31. package/dist/builtin/skills/skill-creator/eval-viewer/viewer.html +1325 -0
  32. package/dist/builtin/skills/skill-creator/references/schemas.md +430 -0
  33. package/dist/builtin/skills/skill-creator/scripts/__init__.py +0 -0
  34. package/dist/builtin/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
  35. package/dist/builtin/skills/skill-creator/scripts/generate_report.py +326 -0
  36. package/dist/builtin/skills/skill-creator/scripts/improve_description.py +247 -0
  37. package/dist/builtin/skills/skill-creator/scripts/package_skill.py +136 -0
  38. package/dist/builtin/skills/skill-creator/scripts/quick_validate.py +103 -0
  39. package/dist/builtin/skills/skill-creator/scripts/run_eval.py +310 -0
  40. package/dist/builtin/skills/skill-creator/scripts/run_loop.py +328 -0
  41. package/dist/builtin/skills/skill-creator/scripts/utils.py +47 -0
  42. package/dist/cli.js +74440 -0
  43. package/dist/theme/dark.json +85 -0
  44. package/dist/theme/light.json +84 -0
  45. package/package.json +61 -0
@@ -0,0 +1,2924 @@
1
+ import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
2
+ var __defProp = Object.defineProperty;
3
+ var __export = (target, all) => {
4
+ for (var name in all)
5
+ __defProp(target, name, { get: all[name], enumerable: true });
6
+ };
7
+
8
+ // ../../node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
9
+ var value_exports = {};
10
+ __export(value_exports, {
11
+ HasPropertyKey: () => HasPropertyKey,
12
+ IsArray: () => IsArray,
13
+ IsAsyncIterator: () => IsAsyncIterator,
14
+ IsBigInt: () => IsBigInt,
15
+ IsBoolean: () => IsBoolean,
16
+ IsDate: () => IsDate,
17
+ IsFunction: () => IsFunction,
18
+ IsIterator: () => IsIterator,
19
+ IsNull: () => IsNull,
20
+ IsNumber: () => IsNumber,
21
+ IsObject: () => IsObject,
22
+ IsRegExp: () => IsRegExp,
23
+ IsString: () => IsString,
24
+ IsSymbol: () => IsSymbol,
25
+ IsUint8Array: () => IsUint8Array,
26
+ IsUndefined: () => IsUndefined
27
+ });
28
+ function HasPropertyKey(value, key) {
29
+ return key in value;
30
+ }
31
+ function IsAsyncIterator(value) {
32
+ return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.asyncIterator in value;
33
+ }
34
+ function IsArray(value) {
35
+ return Array.isArray(value);
36
+ }
37
+ function IsBigInt(value) {
38
+ return typeof value === "bigint";
39
+ }
40
+ function IsBoolean(value) {
41
+ return typeof value === "boolean";
42
+ }
43
+ function IsDate(value) {
44
+ return value instanceof globalThis.Date;
45
+ }
46
+ function IsFunction(value) {
47
+ return typeof value === "function";
48
+ }
49
+ function IsIterator(value) {
50
+ return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.iterator in value;
51
+ }
52
+ function IsNull(value) {
53
+ return value === null;
54
+ }
55
+ function IsNumber(value) {
56
+ return typeof value === "number";
57
+ }
58
+ function IsObject(value) {
59
+ return typeof value === "object" && value !== null;
60
+ }
61
+ function IsRegExp(value) {
62
+ return value instanceof globalThis.RegExp;
63
+ }
64
+ function IsString(value) {
65
+ return typeof value === "string";
66
+ }
67
+ function IsSymbol(value) {
68
+ return typeof value === "symbol";
69
+ }
70
+ function IsUint8Array(value) {
71
+ return value instanceof globalThis.Uint8Array;
72
+ }
73
+ function IsUndefined(value) {
74
+ return value === void 0;
75
+ }
76
+
77
+ // ../../node_modules/@sinclair/typebox/build/esm/type/clone/value.mjs
78
+ function ArrayType(value) {
79
+ return value.map((value2) => Visit(value2));
80
+ }
81
+ function DateType(value) {
82
+ return new Date(value.getTime());
83
+ }
84
+ function Uint8ArrayType(value) {
85
+ return new Uint8Array(value);
86
+ }
87
+ function RegExpType(value) {
88
+ return new RegExp(value.source, value.flags);
89
+ }
90
+ function ObjectType(value) {
91
+ const result = {};
92
+ for (const key of Object.getOwnPropertyNames(value)) {
93
+ result[key] = Visit(value[key]);
94
+ }
95
+ for (const key of Object.getOwnPropertySymbols(value)) {
96
+ result[key] = Visit(value[key]);
97
+ }
98
+ return result;
99
+ }
100
+ function Visit(value) {
101
+ return IsArray(value) ? ArrayType(value) : IsDate(value) ? DateType(value) : IsUint8Array(value) ? Uint8ArrayType(value) : IsRegExp(value) ? RegExpType(value) : IsObject(value) ? ObjectType(value) : value;
102
+ }
103
+ function Clone(value) {
104
+ return Visit(value);
105
+ }
106
+
107
+ // ../../node_modules/@sinclair/typebox/build/esm/type/clone/type.mjs
108
+ function CloneType(schema, options) {
109
+ return options === void 0 ? Clone(schema) : Clone({ ...options, ...schema });
110
+ }
111
+
112
+ // ../../node_modules/@sinclair/typebox/build/esm/value/guard/guard.mjs
113
+ function IsObject2(value) {
114
+ return value !== null && typeof value === "object";
115
+ }
116
+ function IsArray2(value) {
117
+ return globalThis.Array.isArray(value) && !globalThis.ArrayBuffer.isView(value);
118
+ }
119
+ function IsUndefined2(value) {
120
+ return value === void 0;
121
+ }
122
+ function IsNumber2(value) {
123
+ return typeof value === "number";
124
+ }
125
+
126
+ // ../../node_modules/@sinclair/typebox/build/esm/system/policy.mjs
127
+ var TypeSystemPolicy;
128
+ (function(TypeSystemPolicy2) {
129
+ TypeSystemPolicy2.InstanceMode = "default";
130
+ TypeSystemPolicy2.ExactOptionalPropertyTypes = false;
131
+ TypeSystemPolicy2.AllowArrayObject = false;
132
+ TypeSystemPolicy2.AllowNaN = false;
133
+ TypeSystemPolicy2.AllowNullVoid = false;
134
+ function IsExactOptionalProperty(value, key) {
135
+ return TypeSystemPolicy2.ExactOptionalPropertyTypes ? key in value : value[key] !== void 0;
136
+ }
137
+ TypeSystemPolicy2.IsExactOptionalProperty = IsExactOptionalProperty;
138
+ function IsObjectLike(value) {
139
+ const isObject = IsObject2(value);
140
+ return TypeSystemPolicy2.AllowArrayObject ? isObject : isObject && !IsArray2(value);
141
+ }
142
+ TypeSystemPolicy2.IsObjectLike = IsObjectLike;
143
+ function IsRecordLike(value) {
144
+ return IsObjectLike(value) && !(value instanceof Date) && !(value instanceof Uint8Array);
145
+ }
146
+ TypeSystemPolicy2.IsRecordLike = IsRecordLike;
147
+ function IsNumberLike(value) {
148
+ return TypeSystemPolicy2.AllowNaN ? IsNumber2(value) : Number.isFinite(value);
149
+ }
150
+ TypeSystemPolicy2.IsNumberLike = IsNumberLike;
151
+ function IsVoidLike(value) {
152
+ const isUndefined = IsUndefined2(value);
153
+ return TypeSystemPolicy2.AllowNullVoid ? isUndefined || value === null : isUndefined;
154
+ }
155
+ TypeSystemPolicy2.IsVoidLike = IsVoidLike;
156
+ })(TypeSystemPolicy || (TypeSystemPolicy = {}));
157
+
158
+ // ../../node_modules/@sinclair/typebox/build/esm/type/create/immutable.mjs
159
+ function ImmutableArray(value) {
160
+ return globalThis.Object.freeze(value).map((value2) => Immutable(value2));
161
+ }
162
+ function ImmutableDate(value) {
163
+ return value;
164
+ }
165
+ function ImmutableUint8Array(value) {
166
+ return value;
167
+ }
168
+ function ImmutableRegExp(value) {
169
+ return value;
170
+ }
171
+ function ImmutableObject(value) {
172
+ const result = {};
173
+ for (const key of Object.getOwnPropertyNames(value)) {
174
+ result[key] = Immutable(value[key]);
175
+ }
176
+ for (const key of Object.getOwnPropertySymbols(value)) {
177
+ result[key] = Immutable(value[key]);
178
+ }
179
+ return globalThis.Object.freeze(result);
180
+ }
181
+ function Immutable(value) {
182
+ return IsArray(value) ? ImmutableArray(value) : IsDate(value) ? ImmutableDate(value) : IsUint8Array(value) ? ImmutableUint8Array(value) : IsRegExp(value) ? ImmutableRegExp(value) : IsObject(value) ? ImmutableObject(value) : value;
183
+ }
184
+
185
+ // ../../node_modules/@sinclair/typebox/build/esm/type/create/type.mjs
186
+ function CreateType(schema, options) {
187
+ const result = options !== void 0 ? { ...options, ...schema } : schema;
188
+ switch (TypeSystemPolicy.InstanceMode) {
189
+ case "freeze":
190
+ return Immutable(result);
191
+ case "clone":
192
+ return Clone(result);
193
+ default:
194
+ return result;
195
+ }
196
+ }
197
+
198
+ // ../../node_modules/@sinclair/typebox/build/esm/type/error/error.mjs
199
+ var TypeBoxError = class extends Error {
200
+ constructor(message) {
201
+ super(message);
202
+ }
203
+ };
204
+
205
+ // ../../node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.mjs
206
+ var TransformKind = /* @__PURE__ */ Symbol.for("TypeBox.Transform");
207
+ var ReadonlyKind = /* @__PURE__ */ Symbol.for("TypeBox.Readonly");
208
+ var OptionalKind = /* @__PURE__ */ Symbol.for("TypeBox.Optional");
209
+ var Hint = /* @__PURE__ */ Symbol.for("TypeBox.Hint");
210
+ var Kind = /* @__PURE__ */ Symbol.for("TypeBox.Kind");
211
+
212
+ // ../../node_modules/@sinclair/typebox/build/esm/type/guard/kind.mjs
213
+ function IsReadonly(value) {
214
+ return IsObject(value) && value[ReadonlyKind] === "Readonly";
215
+ }
216
+ function IsOptional(value) {
217
+ return IsObject(value) && value[OptionalKind] === "Optional";
218
+ }
219
+ function IsAny(value) {
220
+ return IsKindOf(value, "Any");
221
+ }
222
+ function IsArgument(value) {
223
+ return IsKindOf(value, "Argument");
224
+ }
225
+ function IsArray3(value) {
226
+ return IsKindOf(value, "Array");
227
+ }
228
+ function IsAsyncIterator2(value) {
229
+ return IsKindOf(value, "AsyncIterator");
230
+ }
231
+ function IsBigInt2(value) {
232
+ return IsKindOf(value, "BigInt");
233
+ }
234
+ function IsBoolean2(value) {
235
+ return IsKindOf(value, "Boolean");
236
+ }
237
+ function IsComputed(value) {
238
+ return IsKindOf(value, "Computed");
239
+ }
240
+ function IsConstructor(value) {
241
+ return IsKindOf(value, "Constructor");
242
+ }
243
+ function IsDate2(value) {
244
+ return IsKindOf(value, "Date");
245
+ }
246
+ function IsFunction2(value) {
247
+ return IsKindOf(value, "Function");
248
+ }
249
+ function IsInteger(value) {
250
+ return IsKindOf(value, "Integer");
251
+ }
252
+ function IsIntersect(value) {
253
+ return IsKindOf(value, "Intersect");
254
+ }
255
+ function IsIterator2(value) {
256
+ return IsKindOf(value, "Iterator");
257
+ }
258
+ function IsKindOf(value, kind) {
259
+ return IsObject(value) && Kind in value && value[Kind] === kind;
260
+ }
261
+ function IsLiteralValue(value) {
262
+ return IsBoolean(value) || IsNumber(value) || IsString(value);
263
+ }
264
+ function IsLiteral(value) {
265
+ return IsKindOf(value, "Literal");
266
+ }
267
+ function IsMappedKey(value) {
268
+ return IsKindOf(value, "MappedKey");
269
+ }
270
+ function IsMappedResult(value) {
271
+ return IsKindOf(value, "MappedResult");
272
+ }
273
+ function IsNever(value) {
274
+ return IsKindOf(value, "Never");
275
+ }
276
+ function IsNot(value) {
277
+ return IsKindOf(value, "Not");
278
+ }
279
+ function IsNull2(value) {
280
+ return IsKindOf(value, "Null");
281
+ }
282
+ function IsNumber3(value) {
283
+ return IsKindOf(value, "Number");
284
+ }
285
+ function IsObject3(value) {
286
+ return IsKindOf(value, "Object");
287
+ }
288
+ function IsPromise(value) {
289
+ return IsKindOf(value, "Promise");
290
+ }
291
+ function IsRecord(value) {
292
+ return IsKindOf(value, "Record");
293
+ }
294
+ function IsRef(value) {
295
+ return IsKindOf(value, "Ref");
296
+ }
297
+ function IsRegExp2(value) {
298
+ return IsKindOf(value, "RegExp");
299
+ }
300
+ function IsString2(value) {
301
+ return IsKindOf(value, "String");
302
+ }
303
+ function IsSymbol2(value) {
304
+ return IsKindOf(value, "Symbol");
305
+ }
306
+ function IsTemplateLiteral(value) {
307
+ return IsKindOf(value, "TemplateLiteral");
308
+ }
309
+ function IsThis(value) {
310
+ return IsKindOf(value, "This");
311
+ }
312
+ function IsTransform(value) {
313
+ return IsObject(value) && TransformKind in value;
314
+ }
315
+ function IsTuple(value) {
316
+ return IsKindOf(value, "Tuple");
317
+ }
318
+ function IsUndefined3(value) {
319
+ return IsKindOf(value, "Undefined");
320
+ }
321
+ function IsUnion(value) {
322
+ return IsKindOf(value, "Union");
323
+ }
324
+ function IsUint8Array2(value) {
325
+ return IsKindOf(value, "Uint8Array");
326
+ }
327
+ function IsUnknown(value) {
328
+ return IsKindOf(value, "Unknown");
329
+ }
330
+ function IsUnsafe(value) {
331
+ return IsKindOf(value, "Unsafe");
332
+ }
333
+ function IsVoid(value) {
334
+ return IsKindOf(value, "Void");
335
+ }
336
+ function IsKind(value) {
337
+ return IsObject(value) && Kind in value && IsString(value[Kind]);
338
+ }
339
+ function IsSchema(value) {
340
+ return IsAny(value) || IsArgument(value) || IsArray3(value) || IsBoolean2(value) || IsBigInt2(value) || IsAsyncIterator2(value) || IsComputed(value) || IsConstructor(value) || IsDate2(value) || IsFunction2(value) || IsInteger(value) || IsIntersect(value) || IsIterator2(value) || IsLiteral(value) || IsMappedKey(value) || IsMappedResult(value) || IsNever(value) || IsNot(value) || IsNull2(value) || IsNumber3(value) || IsObject3(value) || IsPromise(value) || IsRecord(value) || IsRef(value) || IsRegExp2(value) || IsString2(value) || IsSymbol2(value) || IsTemplateLiteral(value) || IsThis(value) || IsTuple(value) || IsUndefined3(value) || IsUnion(value) || IsUint8Array2(value) || IsUnknown(value) || IsUnsafe(value) || IsVoid(value) || IsKind(value);
341
+ }
342
+
343
+ // ../../node_modules/@sinclair/typebox/build/esm/type/guard/type.mjs
344
+ var type_exports = {};
345
+ __export(type_exports, {
346
+ IsAny: () => IsAny2,
347
+ IsArgument: () => IsArgument2,
348
+ IsArray: () => IsArray4,
349
+ IsAsyncIterator: () => IsAsyncIterator3,
350
+ IsBigInt: () => IsBigInt3,
351
+ IsBoolean: () => IsBoolean3,
352
+ IsComputed: () => IsComputed2,
353
+ IsConstructor: () => IsConstructor2,
354
+ IsDate: () => IsDate3,
355
+ IsFunction: () => IsFunction3,
356
+ IsImport: () => IsImport,
357
+ IsInteger: () => IsInteger2,
358
+ IsIntersect: () => IsIntersect2,
359
+ IsIterator: () => IsIterator3,
360
+ IsKind: () => IsKind2,
361
+ IsKindOf: () => IsKindOf2,
362
+ IsLiteral: () => IsLiteral2,
363
+ IsLiteralBoolean: () => IsLiteralBoolean,
364
+ IsLiteralNumber: () => IsLiteralNumber,
365
+ IsLiteralString: () => IsLiteralString,
366
+ IsLiteralValue: () => IsLiteralValue2,
367
+ IsMappedKey: () => IsMappedKey2,
368
+ IsMappedResult: () => IsMappedResult2,
369
+ IsNever: () => IsNever2,
370
+ IsNot: () => IsNot2,
371
+ IsNull: () => IsNull3,
372
+ IsNumber: () => IsNumber4,
373
+ IsObject: () => IsObject4,
374
+ IsOptional: () => IsOptional2,
375
+ IsPromise: () => IsPromise2,
376
+ IsProperties: () => IsProperties,
377
+ IsReadonly: () => IsReadonly2,
378
+ IsRecord: () => IsRecord2,
379
+ IsRecursive: () => IsRecursive,
380
+ IsRef: () => IsRef2,
381
+ IsRegExp: () => IsRegExp3,
382
+ IsSchema: () => IsSchema2,
383
+ IsString: () => IsString3,
384
+ IsSymbol: () => IsSymbol3,
385
+ IsTemplateLiteral: () => IsTemplateLiteral2,
386
+ IsThis: () => IsThis2,
387
+ IsTransform: () => IsTransform2,
388
+ IsTuple: () => IsTuple2,
389
+ IsUint8Array: () => IsUint8Array3,
390
+ IsUndefined: () => IsUndefined4,
391
+ IsUnion: () => IsUnion2,
392
+ IsUnionLiteral: () => IsUnionLiteral,
393
+ IsUnknown: () => IsUnknown2,
394
+ IsUnsafe: () => IsUnsafe2,
395
+ IsVoid: () => IsVoid2,
396
+ TypeGuardUnknownTypeError: () => TypeGuardUnknownTypeError
397
+ });
398
+ var TypeGuardUnknownTypeError = class extends TypeBoxError {
399
+ };
400
+ var KnownTypes = [
401
+ "Argument",
402
+ "Any",
403
+ "Array",
404
+ "AsyncIterator",
405
+ "BigInt",
406
+ "Boolean",
407
+ "Computed",
408
+ "Constructor",
409
+ "Date",
410
+ "Enum",
411
+ "Function",
412
+ "Integer",
413
+ "Intersect",
414
+ "Iterator",
415
+ "Literal",
416
+ "MappedKey",
417
+ "MappedResult",
418
+ "Not",
419
+ "Null",
420
+ "Number",
421
+ "Object",
422
+ "Promise",
423
+ "Record",
424
+ "Ref",
425
+ "RegExp",
426
+ "String",
427
+ "Symbol",
428
+ "TemplateLiteral",
429
+ "This",
430
+ "Tuple",
431
+ "Undefined",
432
+ "Union",
433
+ "Uint8Array",
434
+ "Unknown",
435
+ "Void"
436
+ ];
437
+ function IsPattern(value) {
438
+ try {
439
+ new RegExp(value);
440
+ return true;
441
+ } catch {
442
+ return false;
443
+ }
444
+ }
445
+ function IsControlCharacterFree(value) {
446
+ if (!IsString(value))
447
+ return false;
448
+ for (let i = 0; i < value.length; i++) {
449
+ const code = value.charCodeAt(i);
450
+ if (code >= 7 && code <= 13 || code === 27 || code === 127) {
451
+ return false;
452
+ }
453
+ }
454
+ return true;
455
+ }
456
+ function IsAdditionalProperties(value) {
457
+ return IsOptionalBoolean(value) || IsSchema2(value);
458
+ }
459
+ function IsOptionalBigInt(value) {
460
+ return IsUndefined(value) || IsBigInt(value);
461
+ }
462
+ function IsOptionalNumber(value) {
463
+ return IsUndefined(value) || IsNumber(value);
464
+ }
465
+ function IsOptionalBoolean(value) {
466
+ return IsUndefined(value) || IsBoolean(value);
467
+ }
468
+ function IsOptionalString(value) {
469
+ return IsUndefined(value) || IsString(value);
470
+ }
471
+ function IsOptionalPattern(value) {
472
+ return IsUndefined(value) || IsString(value) && IsControlCharacterFree(value) && IsPattern(value);
473
+ }
474
+ function IsOptionalFormat(value) {
475
+ return IsUndefined(value) || IsString(value) && IsControlCharacterFree(value);
476
+ }
477
+ function IsOptionalSchema(value) {
478
+ return IsUndefined(value) || IsSchema2(value);
479
+ }
480
+ function IsReadonly2(value) {
481
+ return IsObject(value) && value[ReadonlyKind] === "Readonly";
482
+ }
483
+ function IsOptional2(value) {
484
+ return IsObject(value) && value[OptionalKind] === "Optional";
485
+ }
486
+ function IsAny2(value) {
487
+ return IsKindOf2(value, "Any") && IsOptionalString(value.$id);
488
+ }
489
+ function IsArgument2(value) {
490
+ return IsKindOf2(value, "Argument") && IsNumber(value.index);
491
+ }
492
+ function IsArray4(value) {
493
+ return IsKindOf2(value, "Array") && value.type === "array" && IsOptionalString(value.$id) && IsSchema2(value.items) && IsOptionalNumber(value.minItems) && IsOptionalNumber(value.maxItems) && IsOptionalBoolean(value.uniqueItems) && IsOptionalSchema(value.contains) && IsOptionalNumber(value.minContains) && IsOptionalNumber(value.maxContains);
494
+ }
495
+ function IsAsyncIterator3(value) {
496
+ return IsKindOf2(value, "AsyncIterator") && value.type === "AsyncIterator" && IsOptionalString(value.$id) && IsSchema2(value.items);
497
+ }
498
+ function IsBigInt3(value) {
499
+ return IsKindOf2(value, "BigInt") && value.type === "bigint" && IsOptionalString(value.$id) && IsOptionalBigInt(value.exclusiveMaximum) && IsOptionalBigInt(value.exclusiveMinimum) && IsOptionalBigInt(value.maximum) && IsOptionalBigInt(value.minimum) && IsOptionalBigInt(value.multipleOf);
500
+ }
501
+ function IsBoolean3(value) {
502
+ return IsKindOf2(value, "Boolean") && value.type === "boolean" && IsOptionalString(value.$id);
503
+ }
504
+ function IsComputed2(value) {
505
+ return IsKindOf2(value, "Computed") && IsString(value.target) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema));
506
+ }
507
+ function IsConstructor2(value) {
508
+ return IsKindOf2(value, "Constructor") && value.type === "Constructor" && IsOptionalString(value.$id) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)) && IsSchema2(value.returns);
509
+ }
510
+ function IsDate3(value) {
511
+ return IsKindOf2(value, "Date") && value.type === "Date" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximumTimestamp) && IsOptionalNumber(value.exclusiveMinimumTimestamp) && IsOptionalNumber(value.maximumTimestamp) && IsOptionalNumber(value.minimumTimestamp) && IsOptionalNumber(value.multipleOfTimestamp);
512
+ }
513
+ function IsFunction3(value) {
514
+ return IsKindOf2(value, "Function") && value.type === "Function" && IsOptionalString(value.$id) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)) && IsSchema2(value.returns);
515
+ }
516
+ function IsImport(value) {
517
+ return IsKindOf2(value, "Import") && HasPropertyKey(value, "$defs") && IsObject(value.$defs) && IsProperties(value.$defs) && HasPropertyKey(value, "$ref") && IsString(value.$ref) && value.$ref in value.$defs;
518
+ }
519
+ function IsInteger2(value) {
520
+ return IsKindOf2(value, "Integer") && value.type === "integer" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximum) && IsOptionalNumber(value.exclusiveMinimum) && IsOptionalNumber(value.maximum) && IsOptionalNumber(value.minimum) && IsOptionalNumber(value.multipleOf);
521
+ }
522
+ function IsProperties(value) {
523
+ return IsObject(value) && Object.entries(value).every(([key, schema]) => IsControlCharacterFree(key) && IsSchema2(schema));
524
+ }
525
+ function IsIntersect2(value) {
526
+ return IsKindOf2(value, "Intersect") && (IsString(value.type) && value.type !== "object" ? false : true) && IsArray(value.allOf) && value.allOf.every((schema) => IsSchema2(schema) && !IsTransform2(schema)) && IsOptionalString(value.type) && (IsOptionalBoolean(value.unevaluatedProperties) || IsOptionalSchema(value.unevaluatedProperties)) && IsOptionalString(value.$id);
527
+ }
528
+ function IsIterator3(value) {
529
+ return IsKindOf2(value, "Iterator") && value.type === "Iterator" && IsOptionalString(value.$id) && IsSchema2(value.items);
530
+ }
531
+ function IsKindOf2(value, kind) {
532
+ return IsObject(value) && Kind in value && value[Kind] === kind;
533
+ }
534
+ function IsLiteralString(value) {
535
+ return IsLiteral2(value) && IsString(value.const);
536
+ }
537
+ function IsLiteralNumber(value) {
538
+ return IsLiteral2(value) && IsNumber(value.const);
539
+ }
540
+ function IsLiteralBoolean(value) {
541
+ return IsLiteral2(value) && IsBoolean(value.const);
542
+ }
543
+ function IsLiteral2(value) {
544
+ return IsKindOf2(value, "Literal") && IsOptionalString(value.$id) && IsLiteralValue2(value.const);
545
+ }
546
+ function IsLiteralValue2(value) {
547
+ return IsBoolean(value) || IsNumber(value) || IsString(value);
548
+ }
549
+ function IsMappedKey2(value) {
550
+ return IsKindOf2(value, "MappedKey") && IsArray(value.keys) && value.keys.every((key) => IsNumber(key) || IsString(key));
551
+ }
552
+ function IsMappedResult2(value) {
553
+ return IsKindOf2(value, "MappedResult") && IsProperties(value.properties);
554
+ }
555
+ function IsNever2(value) {
556
+ return IsKindOf2(value, "Never") && IsObject(value.not) && Object.getOwnPropertyNames(value.not).length === 0;
557
+ }
558
+ function IsNot2(value) {
559
+ return IsKindOf2(value, "Not") && IsSchema2(value.not);
560
+ }
561
+ function IsNull3(value) {
562
+ return IsKindOf2(value, "Null") && value.type === "null" && IsOptionalString(value.$id);
563
+ }
564
+ function IsNumber4(value) {
565
+ return IsKindOf2(value, "Number") && value.type === "number" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximum) && IsOptionalNumber(value.exclusiveMinimum) && IsOptionalNumber(value.maximum) && IsOptionalNumber(value.minimum) && IsOptionalNumber(value.multipleOf);
566
+ }
567
+ function IsObject4(value) {
568
+ return IsKindOf2(value, "Object") && value.type === "object" && IsOptionalString(value.$id) && IsProperties(value.properties) && IsAdditionalProperties(value.additionalProperties) && IsOptionalNumber(value.minProperties) && IsOptionalNumber(value.maxProperties);
569
+ }
570
+ function IsPromise2(value) {
571
+ return IsKindOf2(value, "Promise") && value.type === "Promise" && IsOptionalString(value.$id) && IsSchema2(value.item);
572
+ }
573
+ function IsRecord2(value) {
574
+ return IsKindOf2(value, "Record") && value.type === "object" && IsOptionalString(value.$id) && IsAdditionalProperties(value.additionalProperties) && IsObject(value.patternProperties) && ((schema) => {
575
+ const keys = Object.getOwnPropertyNames(schema.patternProperties);
576
+ return keys.length === 1 && IsPattern(keys[0]) && IsObject(schema.patternProperties) && IsSchema2(schema.patternProperties[keys[0]]);
577
+ })(value);
578
+ }
579
+ function IsRecursive(value) {
580
+ return IsObject(value) && Hint in value && value[Hint] === "Recursive";
581
+ }
582
+ function IsRef2(value) {
583
+ return IsKindOf2(value, "Ref") && IsOptionalString(value.$id) && IsString(value.$ref);
584
+ }
585
+ function IsRegExp3(value) {
586
+ return IsKindOf2(value, "RegExp") && IsOptionalString(value.$id) && IsString(value.source) && IsString(value.flags) && IsOptionalNumber(value.maxLength) && IsOptionalNumber(value.minLength);
587
+ }
588
+ function IsString3(value) {
589
+ return IsKindOf2(value, "String") && value.type === "string" && IsOptionalString(value.$id) && IsOptionalNumber(value.minLength) && IsOptionalNumber(value.maxLength) && IsOptionalPattern(value.pattern) && IsOptionalFormat(value.format);
590
+ }
591
+ function IsSymbol3(value) {
592
+ return IsKindOf2(value, "Symbol") && value.type === "symbol" && IsOptionalString(value.$id);
593
+ }
594
+ function IsTemplateLiteral2(value) {
595
+ return IsKindOf2(value, "TemplateLiteral") && value.type === "string" && IsString(value.pattern) && value.pattern[0] === "^" && value.pattern[value.pattern.length - 1] === "$";
596
+ }
597
+ function IsThis2(value) {
598
+ return IsKindOf2(value, "This") && IsOptionalString(value.$id) && IsString(value.$ref);
599
+ }
600
+ function IsTransform2(value) {
601
+ return IsObject(value) && TransformKind in value;
602
+ }
603
+ function IsTuple2(value) {
604
+ return IsKindOf2(value, "Tuple") && value.type === "array" && IsOptionalString(value.$id) && IsNumber(value.minItems) && IsNumber(value.maxItems) && value.minItems === value.maxItems && // empty
605
+ (IsUndefined(value.items) && IsUndefined(value.additionalItems) && value.minItems === 0 || IsArray(value.items) && value.items.every((schema) => IsSchema2(schema)));
606
+ }
607
+ function IsUndefined4(value) {
608
+ return IsKindOf2(value, "Undefined") && value.type === "undefined" && IsOptionalString(value.$id);
609
+ }
610
+ function IsUnionLiteral(value) {
611
+ return IsUnion2(value) && value.anyOf.every((schema) => IsLiteralString(schema) || IsLiteralNumber(schema));
612
+ }
613
+ function IsUnion2(value) {
614
+ return IsKindOf2(value, "Union") && IsOptionalString(value.$id) && IsObject(value) && IsArray(value.anyOf) && value.anyOf.every((schema) => IsSchema2(schema));
615
+ }
616
+ function IsUint8Array3(value) {
617
+ return IsKindOf2(value, "Uint8Array") && value.type === "Uint8Array" && IsOptionalString(value.$id) && IsOptionalNumber(value.minByteLength) && IsOptionalNumber(value.maxByteLength);
618
+ }
619
+ function IsUnknown2(value) {
620
+ return IsKindOf2(value, "Unknown") && IsOptionalString(value.$id);
621
+ }
622
+ function IsUnsafe2(value) {
623
+ return IsKindOf2(value, "Unsafe");
624
+ }
625
+ function IsVoid2(value) {
626
+ return IsKindOf2(value, "Void") && value.type === "void" && IsOptionalString(value.$id);
627
+ }
628
+ function IsKind2(value) {
629
+ return IsObject(value) && Kind in value && IsString(value[Kind]) && !KnownTypes.includes(value[Kind]);
630
+ }
631
+ function IsSchema2(value) {
632
+ return IsObject(value) && (IsAny2(value) || IsArgument2(value) || IsArray4(value) || IsBoolean3(value) || IsBigInt3(value) || IsAsyncIterator3(value) || IsComputed2(value) || IsConstructor2(value) || IsDate3(value) || IsFunction3(value) || IsInteger2(value) || IsIntersect2(value) || IsIterator3(value) || IsLiteral2(value) || IsMappedKey2(value) || IsMappedResult2(value) || IsNever2(value) || IsNot2(value) || IsNull3(value) || IsNumber4(value) || IsObject4(value) || IsPromise2(value) || IsRecord2(value) || IsRef2(value) || IsRegExp3(value) || IsString3(value) || IsSymbol3(value) || IsTemplateLiteral2(value) || IsThis2(value) || IsTuple2(value) || IsUndefined4(value) || IsUnion2(value) || IsUint8Array3(value) || IsUnknown2(value) || IsUnsafe2(value) || IsVoid2(value) || IsKind2(value));
633
+ }
634
+
635
+ // ../../node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.mjs
636
+ var PatternBoolean = "(true|false)";
637
+ var PatternNumber = "(0|[1-9][0-9]*)";
638
+ var PatternString = "(.*)";
639
+ var PatternNever = "(?!.*)";
640
+ var PatternBooleanExact = `^${PatternBoolean}$`;
641
+ var PatternNumberExact = `^${PatternNumber}$`;
642
+ var PatternStringExact = `^${PatternString}$`;
643
+ var PatternNeverExact = `^${PatternNever}$`;
644
+
645
+ // ../../node_modules/@sinclair/typebox/build/esm/type/sets/set.mjs
646
+ function SetIncludes(T, S) {
647
+ return T.includes(S);
648
+ }
649
+ function SetDistinct(T) {
650
+ return [...new Set(T)];
651
+ }
652
+ function SetIntersect(T, S) {
653
+ return T.filter((L) => S.includes(L));
654
+ }
655
+ function SetIntersectManyResolve(T, Init) {
656
+ return T.reduce((Acc, L) => {
657
+ return SetIntersect(Acc, L);
658
+ }, Init);
659
+ }
660
+ function SetIntersectMany(T) {
661
+ return T.length === 1 ? T[0] : T.length > 1 ? SetIntersectManyResolve(T.slice(1), T[0]) : [];
662
+ }
663
+ function SetUnionMany(T) {
664
+ const Acc = [];
665
+ for (const L of T)
666
+ Acc.push(...L);
667
+ return Acc;
668
+ }
669
+
670
+ // ../../node_modules/@sinclair/typebox/build/esm/type/any/any.mjs
671
+ function Any(options) {
672
+ return CreateType({ [Kind]: "Any" }, options);
673
+ }
674
+
675
+ // ../../node_modules/@sinclair/typebox/build/esm/type/array/array.mjs
676
+ function Array2(items, options) {
677
+ return CreateType({ [Kind]: "Array", type: "array", items }, options);
678
+ }
679
+
680
+ // ../../node_modules/@sinclair/typebox/build/esm/type/argument/argument.mjs
681
+ function Argument(index) {
682
+ return CreateType({ [Kind]: "Argument", index });
683
+ }
684
+
685
+ // ../../node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.mjs
686
+ function AsyncIterator(items, options) {
687
+ return CreateType({ [Kind]: "AsyncIterator", type: "AsyncIterator", items }, options);
688
+ }
689
+
690
+ // ../../node_modules/@sinclair/typebox/build/esm/type/computed/computed.mjs
691
+ function Computed(target, parameters, options) {
692
+ return CreateType({ [Kind]: "Computed", target, parameters }, options);
693
+ }
694
+
695
+ // ../../node_modules/@sinclair/typebox/build/esm/type/discard/discard.mjs
696
+ function DiscardKey(value, key) {
697
+ const { [key]: _, ...rest } = value;
698
+ return rest;
699
+ }
700
+ function Discard(value, keys) {
701
+ return keys.reduce((acc, key) => DiscardKey(acc, key), value);
702
+ }
703
+
704
+ // ../../node_modules/@sinclair/typebox/build/esm/type/never/never.mjs
705
+ function Never(options) {
706
+ return CreateType({ [Kind]: "Never", not: {} }, options);
707
+ }
708
+
709
+ // ../../node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.mjs
710
+ function MappedResult(properties) {
711
+ return CreateType({
712
+ [Kind]: "MappedResult",
713
+ properties
714
+ });
715
+ }
716
+
717
+ // ../../node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.mjs
718
+ function Constructor(parameters, returns, options) {
719
+ return CreateType({ [Kind]: "Constructor", type: "Constructor", parameters, returns }, options);
720
+ }
721
+
722
+ // ../../node_modules/@sinclair/typebox/build/esm/type/function/function.mjs
723
+ function Function(parameters, returns, options) {
724
+ return CreateType({ [Kind]: "Function", type: "Function", parameters, returns }, options);
725
+ }
726
+
727
+ // ../../node_modules/@sinclair/typebox/build/esm/type/union/union-create.mjs
728
+ function UnionCreate(T, options) {
729
+ return CreateType({ [Kind]: "Union", anyOf: T }, options);
730
+ }
731
+
732
+ // ../../node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.mjs
733
+ function IsUnionOptional(types) {
734
+ return types.some((type) => IsOptional(type));
735
+ }
736
+ function RemoveOptionalFromRest(types) {
737
+ return types.map((left) => IsOptional(left) ? RemoveOptionalFromType(left) : left);
738
+ }
739
+ function RemoveOptionalFromType(T) {
740
+ return Discard(T, [OptionalKind]);
741
+ }
742
+ function ResolveUnion(types, options) {
743
+ const isOptional = IsUnionOptional(types);
744
+ return isOptional ? Optional(UnionCreate(RemoveOptionalFromRest(types), options)) : UnionCreate(RemoveOptionalFromRest(types), options);
745
+ }
746
+ function UnionEvaluated(T, options) {
747
+ return T.length === 1 ? CreateType(T[0], options) : T.length === 0 ? Never(options) : ResolveUnion(T, options);
748
+ }
749
+
750
+ // ../../node_modules/@sinclair/typebox/build/esm/type/union/union.mjs
751
+ function Union(types, options) {
752
+ return types.length === 0 ? Never(options) : types.length === 1 ? CreateType(types[0], options) : UnionCreate(types, options);
753
+ }
754
+
755
+ // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.mjs
756
+ var TemplateLiteralParserError = class extends TypeBoxError {
757
+ };
758
+ function Unescape(pattern) {
759
+ return pattern.replace(/\\\$/g, "$").replace(/\\\*/g, "*").replace(/\\\^/g, "^").replace(/\\\|/g, "|").replace(/\\\(/g, "(").replace(/\\\)/g, ")");
760
+ }
761
+ function IsNonEscaped(pattern, index, char) {
762
+ return pattern[index] === char && pattern.charCodeAt(index - 1) !== 92;
763
+ }
764
+ function IsOpenParen(pattern, index) {
765
+ return IsNonEscaped(pattern, index, "(");
766
+ }
767
+ function IsCloseParen(pattern, index) {
768
+ return IsNonEscaped(pattern, index, ")");
769
+ }
770
+ function IsSeparator(pattern, index) {
771
+ return IsNonEscaped(pattern, index, "|");
772
+ }
773
+ function IsGroup(pattern) {
774
+ if (!(IsOpenParen(pattern, 0) && IsCloseParen(pattern, pattern.length - 1)))
775
+ return false;
776
+ let count = 0;
777
+ for (let index = 0; index < pattern.length; index++) {
778
+ if (IsOpenParen(pattern, index))
779
+ count += 1;
780
+ if (IsCloseParen(pattern, index))
781
+ count -= 1;
782
+ if (count === 0 && index !== pattern.length - 1)
783
+ return false;
784
+ }
785
+ return true;
786
+ }
787
+ function InGroup(pattern) {
788
+ return pattern.slice(1, pattern.length - 1);
789
+ }
790
+ function IsPrecedenceOr(pattern) {
791
+ let count = 0;
792
+ for (let index = 0; index < pattern.length; index++) {
793
+ if (IsOpenParen(pattern, index))
794
+ count += 1;
795
+ if (IsCloseParen(pattern, index))
796
+ count -= 1;
797
+ if (IsSeparator(pattern, index) && count === 0)
798
+ return true;
799
+ }
800
+ return false;
801
+ }
802
+ function IsPrecedenceAnd(pattern) {
803
+ for (let index = 0; index < pattern.length; index++) {
804
+ if (IsOpenParen(pattern, index))
805
+ return true;
806
+ }
807
+ return false;
808
+ }
809
+ function Or(pattern) {
810
+ let [count, start] = [0, 0];
811
+ const expressions = [];
812
+ for (let index = 0; index < pattern.length; index++) {
813
+ if (IsOpenParen(pattern, index))
814
+ count += 1;
815
+ if (IsCloseParen(pattern, index))
816
+ count -= 1;
817
+ if (IsSeparator(pattern, index) && count === 0) {
818
+ const range2 = pattern.slice(start, index);
819
+ if (range2.length > 0)
820
+ expressions.push(TemplateLiteralParse(range2));
821
+ start = index + 1;
822
+ }
823
+ }
824
+ const range = pattern.slice(start);
825
+ if (range.length > 0)
826
+ expressions.push(TemplateLiteralParse(range));
827
+ if (expressions.length === 0)
828
+ return { type: "const", const: "" };
829
+ if (expressions.length === 1)
830
+ return expressions[0];
831
+ return { type: "or", expr: expressions };
832
+ }
833
+ function And(pattern) {
834
+ function Group(value, index) {
835
+ if (!IsOpenParen(value, index))
836
+ throw new TemplateLiteralParserError(`TemplateLiteralParser: Index must point to open parens`);
837
+ let count = 0;
838
+ for (let scan = index; scan < value.length; scan++) {
839
+ if (IsOpenParen(value, scan))
840
+ count += 1;
841
+ if (IsCloseParen(value, scan))
842
+ count -= 1;
843
+ if (count === 0)
844
+ return [index, scan];
845
+ }
846
+ throw new TemplateLiteralParserError(`TemplateLiteralParser: Unclosed group parens in expression`);
847
+ }
848
+ function Range(pattern2, index) {
849
+ for (let scan = index; scan < pattern2.length; scan++) {
850
+ if (IsOpenParen(pattern2, scan))
851
+ return [index, scan];
852
+ }
853
+ return [index, pattern2.length];
854
+ }
855
+ const expressions = [];
856
+ for (let index = 0; index < pattern.length; index++) {
857
+ if (IsOpenParen(pattern, index)) {
858
+ const [start, end] = Group(pattern, index);
859
+ const range = pattern.slice(start, end + 1);
860
+ expressions.push(TemplateLiteralParse(range));
861
+ index = end;
862
+ } else {
863
+ const [start, end] = Range(pattern, index);
864
+ const range = pattern.slice(start, end);
865
+ if (range.length > 0)
866
+ expressions.push(TemplateLiteralParse(range));
867
+ index = end - 1;
868
+ }
869
+ }
870
+ return expressions.length === 0 ? { type: "const", const: "" } : expressions.length === 1 ? expressions[0] : { type: "and", expr: expressions };
871
+ }
872
+ function TemplateLiteralParse(pattern) {
873
+ return IsGroup(pattern) ? TemplateLiteralParse(InGroup(pattern)) : IsPrecedenceOr(pattern) ? Or(pattern) : IsPrecedenceAnd(pattern) ? And(pattern) : { type: "const", const: Unescape(pattern) };
874
+ }
875
+ function TemplateLiteralParseExact(pattern) {
876
+ return TemplateLiteralParse(pattern.slice(1, pattern.length - 1));
877
+ }
878
+
879
+ // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.mjs
880
+ var TemplateLiteralFiniteError = class extends TypeBoxError {
881
+ };
882
+ function IsNumberExpression(expression) {
883
+ return expression.type === "or" && expression.expr.length === 2 && expression.expr[0].type === "const" && expression.expr[0].const === "0" && expression.expr[1].type === "const" && expression.expr[1].const === "[1-9][0-9]*";
884
+ }
885
+ function IsBooleanExpression(expression) {
886
+ return expression.type === "or" && expression.expr.length === 2 && expression.expr[0].type === "const" && expression.expr[0].const === "true" && expression.expr[1].type === "const" && expression.expr[1].const === "false";
887
+ }
888
+ function IsStringExpression(expression) {
889
+ return expression.type === "const" && expression.const === ".*";
890
+ }
891
+ function IsTemplateLiteralExpressionFinite(expression) {
892
+ return IsNumberExpression(expression) || IsStringExpression(expression) ? false : IsBooleanExpression(expression) ? true : expression.type === "and" ? expression.expr.every((expr) => IsTemplateLiteralExpressionFinite(expr)) : expression.type === "or" ? expression.expr.every((expr) => IsTemplateLiteralExpressionFinite(expr)) : expression.type === "const" ? true : (() => {
893
+ throw new TemplateLiteralFiniteError(`Unknown expression type`);
894
+ })();
895
+ }
896
+ function IsTemplateLiteralFinite(schema) {
897
+ const expression = TemplateLiteralParseExact(schema.pattern);
898
+ return IsTemplateLiteralExpressionFinite(expression);
899
+ }
900
+
901
+ // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.mjs
902
+ var TemplateLiteralGenerateError = class extends TypeBoxError {
903
+ };
904
+ function* GenerateReduce(buffer) {
905
+ if (buffer.length === 1)
906
+ return yield* buffer[0];
907
+ for (const left of buffer[0]) {
908
+ for (const right of GenerateReduce(buffer.slice(1))) {
909
+ yield `${left}${right}`;
910
+ }
911
+ }
912
+ }
913
+ function* GenerateAnd(expression) {
914
+ return yield* GenerateReduce(expression.expr.map((expr) => [...TemplateLiteralExpressionGenerate(expr)]));
915
+ }
916
+ function* GenerateOr(expression) {
917
+ for (const expr of expression.expr)
918
+ yield* TemplateLiteralExpressionGenerate(expr);
919
+ }
920
+ function* GenerateConst(expression) {
921
+ return yield expression.const;
922
+ }
923
+ function* TemplateLiteralExpressionGenerate(expression) {
924
+ return expression.type === "and" ? yield* GenerateAnd(expression) : expression.type === "or" ? yield* GenerateOr(expression) : expression.type === "const" ? yield* GenerateConst(expression) : (() => {
925
+ throw new TemplateLiteralGenerateError("Unknown expression");
926
+ })();
927
+ }
928
+ function TemplateLiteralGenerate(schema) {
929
+ const expression = TemplateLiteralParseExact(schema.pattern);
930
+ return IsTemplateLiteralExpressionFinite(expression) ? [...TemplateLiteralExpressionGenerate(expression)] : [];
931
+ }
932
+
933
+ // ../../node_modules/@sinclair/typebox/build/esm/type/literal/literal.mjs
934
+ function Literal(value, options) {
935
+ return CreateType({
936
+ [Kind]: "Literal",
937
+ const: value,
938
+ type: typeof value
939
+ }, options);
940
+ }
941
+
942
+ // ../../node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.mjs
943
+ function Boolean(options) {
944
+ return CreateType({ [Kind]: "Boolean", type: "boolean" }, options);
945
+ }
946
+
947
+ // ../../node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.mjs
948
+ function BigInt(options) {
949
+ return CreateType({ [Kind]: "BigInt", type: "bigint" }, options);
950
+ }
951
+
952
+ // ../../node_modules/@sinclair/typebox/build/esm/type/number/number.mjs
953
+ function Number2(options) {
954
+ return CreateType({ [Kind]: "Number", type: "number" }, options);
955
+ }
956
+
957
+ // ../../node_modules/@sinclair/typebox/build/esm/type/string/string.mjs
958
+ function String2(options) {
959
+ return CreateType({ [Kind]: "String", type: "string" }, options);
960
+ }
961
+
962
+ // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.mjs
963
+ function* FromUnion(syntax) {
964
+ const trim = syntax.trim().replace(/"|'/g, "");
965
+ return trim === "boolean" ? yield Boolean() : trim === "number" ? yield Number2() : trim === "bigint" ? yield BigInt() : trim === "string" ? yield String2() : yield (() => {
966
+ const literals = trim.split("|").map((literal) => Literal(literal.trim()));
967
+ return literals.length === 0 ? Never() : literals.length === 1 ? literals[0] : UnionEvaluated(literals);
968
+ })();
969
+ }
970
+ function* FromTerminal(syntax) {
971
+ if (syntax[1] !== "{") {
972
+ const L = Literal("$");
973
+ const R = FromSyntax(syntax.slice(1));
974
+ return yield* [L, ...R];
975
+ }
976
+ for (let i = 2; i < syntax.length; i++) {
977
+ if (syntax[i] === "}") {
978
+ const L = FromUnion(syntax.slice(2, i));
979
+ const R = FromSyntax(syntax.slice(i + 1));
980
+ return yield* [...L, ...R];
981
+ }
982
+ }
983
+ yield Literal(syntax);
984
+ }
985
+ function* FromSyntax(syntax) {
986
+ for (let i = 0; i < syntax.length; i++) {
987
+ if (syntax[i] === "$") {
988
+ const L = Literal(syntax.slice(0, i));
989
+ const R = FromTerminal(syntax.slice(i));
990
+ return yield* [L, ...R];
991
+ }
992
+ }
993
+ yield Literal(syntax);
994
+ }
995
+ function TemplateLiteralSyntax(syntax) {
996
+ return [...FromSyntax(syntax)];
997
+ }
998
+
999
+ // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.mjs
1000
+ var TemplateLiteralPatternError = class extends TypeBoxError {
1001
+ };
1002
+ function Escape(value) {
1003
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1004
+ }
1005
+ function Visit2(schema, acc) {
1006
+ return IsTemplateLiteral(schema) ? schema.pattern.slice(1, schema.pattern.length - 1) : IsUnion(schema) ? `(${schema.anyOf.map((schema2) => Visit2(schema2, acc)).join("|")})` : IsNumber3(schema) ? `${acc}${PatternNumber}` : IsInteger(schema) ? `${acc}${PatternNumber}` : IsBigInt2(schema) ? `${acc}${PatternNumber}` : IsString2(schema) ? `${acc}${PatternString}` : IsLiteral(schema) ? `${acc}${Escape(schema.const.toString())}` : IsBoolean2(schema) ? `${acc}${PatternBoolean}` : (() => {
1007
+ throw new TemplateLiteralPatternError(`Unexpected Kind '${schema[Kind]}'`);
1008
+ })();
1009
+ }
1010
+ function TemplateLiteralPattern(kinds) {
1011
+ return `^${kinds.map((schema) => Visit2(schema, "")).join("")}$`;
1012
+ }
1013
+
1014
+ // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/union.mjs
1015
+ function TemplateLiteralToUnion(schema) {
1016
+ const R = TemplateLiteralGenerate(schema);
1017
+ const L = R.map((S) => Literal(S));
1018
+ return UnionEvaluated(L);
1019
+ }
1020
+
1021
+ // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.mjs
1022
+ function TemplateLiteral(unresolved, options) {
1023
+ const pattern = IsString(unresolved) ? TemplateLiteralPattern(TemplateLiteralSyntax(unresolved)) : TemplateLiteralPattern(unresolved);
1024
+ return CreateType({ [Kind]: "TemplateLiteral", type: "string", pattern }, options);
1025
+ }
1026
+
1027
+ // ../../node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.mjs
1028
+ function FromTemplateLiteral(templateLiteral) {
1029
+ const keys = TemplateLiteralGenerate(templateLiteral);
1030
+ return keys.map((key) => key.toString());
1031
+ }
1032
+ function FromUnion2(types) {
1033
+ const result = [];
1034
+ for (const type of types)
1035
+ result.push(...IndexPropertyKeys(type));
1036
+ return result;
1037
+ }
1038
+ function FromLiteral(literalValue) {
1039
+ return [literalValue.toString()];
1040
+ }
1041
+ function IndexPropertyKeys(type) {
1042
+ return [...new Set(IsTemplateLiteral(type) ? FromTemplateLiteral(type) : IsUnion(type) ? FromUnion2(type.anyOf) : IsLiteral(type) ? FromLiteral(type.const) : IsNumber3(type) ? ["[number]"] : IsInteger(type) ? ["[number]"] : [])];
1043
+ }
1044
+
1045
+ // ../../node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.mjs
1046
+ function FromProperties(type, properties, options) {
1047
+ const result = {};
1048
+ for (const K2 of Object.getOwnPropertyNames(properties)) {
1049
+ result[K2] = Index(type, IndexPropertyKeys(properties[K2]), options);
1050
+ }
1051
+ return result;
1052
+ }
1053
+ function FromMappedResult(type, mappedResult, options) {
1054
+ return FromProperties(type, mappedResult.properties, options);
1055
+ }
1056
+ function IndexFromMappedResult(type, mappedResult, options) {
1057
+ const properties = FromMappedResult(type, mappedResult, options);
1058
+ return MappedResult(properties);
1059
+ }
1060
+
1061
+ // ../../node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.mjs
1062
+ function FromRest(types, key) {
1063
+ return types.map((type) => IndexFromPropertyKey(type, key));
1064
+ }
1065
+ function FromIntersectRest(types) {
1066
+ return types.filter((type) => !IsNever(type));
1067
+ }
1068
+ function FromIntersect(types, key) {
1069
+ return IntersectEvaluated(FromIntersectRest(FromRest(types, key)));
1070
+ }
1071
+ function FromUnionRest(types) {
1072
+ return types.some((L) => IsNever(L)) ? [] : types;
1073
+ }
1074
+ function FromUnion3(types, key) {
1075
+ return UnionEvaluated(FromUnionRest(FromRest(types, key)));
1076
+ }
1077
+ function FromTuple(types, key) {
1078
+ return key in types ? types[key] : key === "[number]" ? UnionEvaluated(types) : Never();
1079
+ }
1080
+ function FromArray(type, key) {
1081
+ return key === "[number]" ? type : Never();
1082
+ }
1083
+ function FromProperty(properties, propertyKey) {
1084
+ return propertyKey in properties ? properties[propertyKey] : Never();
1085
+ }
1086
+ function IndexFromPropertyKey(type, propertyKey) {
1087
+ return IsIntersect(type) ? FromIntersect(type.allOf, propertyKey) : IsUnion(type) ? FromUnion3(type.anyOf, propertyKey) : IsTuple(type) ? FromTuple(type.items ?? [], propertyKey) : IsArray3(type) ? FromArray(type.items, propertyKey) : IsObject3(type) ? FromProperty(type.properties, propertyKey) : Never();
1088
+ }
1089
+ function IndexFromPropertyKeys(type, propertyKeys) {
1090
+ return propertyKeys.map((propertyKey) => IndexFromPropertyKey(type, propertyKey));
1091
+ }
1092
+ function FromSchema(type, propertyKeys) {
1093
+ return UnionEvaluated(IndexFromPropertyKeys(type, propertyKeys));
1094
+ }
1095
+ function Index(type, key, options) {
1096
+ if (IsRef(type) || IsRef(key)) {
1097
+ const error = `Index types using Ref parameters require both Type and Key to be of TSchema`;
1098
+ if (!IsSchema(type) || !IsSchema(key))
1099
+ throw new TypeBoxError(error);
1100
+ return Computed("Index", [type, key]);
1101
+ }
1102
+ if (IsMappedResult(key))
1103
+ return IndexFromMappedResult(type, key, options);
1104
+ if (IsMappedKey(key))
1105
+ return IndexFromMappedKey(type, key, options);
1106
+ return CreateType(IsSchema(key) ? FromSchema(type, IndexPropertyKeys(key)) : FromSchema(type, key), options);
1107
+ }
1108
+
1109
+ // ../../node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.mjs
1110
+ function MappedIndexPropertyKey(type, key, options) {
1111
+ return { [key]: Index(type, [key], Clone(options)) };
1112
+ }
1113
+ function MappedIndexPropertyKeys(type, propertyKeys, options) {
1114
+ return propertyKeys.reduce((result, left) => {
1115
+ return { ...result, ...MappedIndexPropertyKey(type, left, options) };
1116
+ }, {});
1117
+ }
1118
+ function MappedIndexProperties(type, mappedKey, options) {
1119
+ return MappedIndexPropertyKeys(type, mappedKey.keys, options);
1120
+ }
1121
+ function IndexFromMappedKey(type, mappedKey, options) {
1122
+ const properties = MappedIndexProperties(type, mappedKey, options);
1123
+ return MappedResult(properties);
1124
+ }
1125
+
1126
+ // ../../node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.mjs
1127
+ function Iterator(items, options) {
1128
+ return CreateType({ [Kind]: "Iterator", type: "Iterator", items }, options);
1129
+ }
1130
+
1131
+ // ../../node_modules/@sinclair/typebox/build/esm/type/object/object.mjs
1132
+ function RequiredArray(properties) {
1133
+ return globalThis.Object.keys(properties).filter((key) => !IsOptional(properties[key]));
1134
+ }
1135
+ function _Object(properties, options) {
1136
+ const required = RequiredArray(properties);
1137
+ const schema = required.length > 0 ? { [Kind]: "Object", type: "object", required, properties } : { [Kind]: "Object", type: "object", properties };
1138
+ return CreateType(schema, options);
1139
+ }
1140
+ var Object2 = _Object;
1141
+
1142
+ // ../../node_modules/@sinclair/typebox/build/esm/type/promise/promise.mjs
1143
+ function Promise2(item, options) {
1144
+ return CreateType({ [Kind]: "Promise", type: "Promise", item }, options);
1145
+ }
1146
+
1147
+ // ../../node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.mjs
1148
+ function RemoveReadonly(schema) {
1149
+ return CreateType(Discard(schema, [ReadonlyKind]));
1150
+ }
1151
+ function AddReadonly(schema) {
1152
+ return CreateType({ ...schema, [ReadonlyKind]: "Readonly" });
1153
+ }
1154
+ function ReadonlyWithFlag(schema, F) {
1155
+ return F === false ? RemoveReadonly(schema) : AddReadonly(schema);
1156
+ }
1157
+ function Readonly(schema, enable) {
1158
+ const F = enable ?? true;
1159
+ return IsMappedResult(schema) ? ReadonlyFromMappedResult(schema, F) : ReadonlyWithFlag(schema, F);
1160
+ }
1161
+
1162
+ // ../../node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.mjs
1163
+ function FromProperties2(K, F) {
1164
+ const Acc = {};
1165
+ for (const K2 of globalThis.Object.getOwnPropertyNames(K))
1166
+ Acc[K2] = Readonly(K[K2], F);
1167
+ return Acc;
1168
+ }
1169
+ function FromMappedResult2(R, F) {
1170
+ return FromProperties2(R.properties, F);
1171
+ }
1172
+ function ReadonlyFromMappedResult(R, F) {
1173
+ const P = FromMappedResult2(R, F);
1174
+ return MappedResult(P);
1175
+ }
1176
+
1177
+ // ../../node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.mjs
1178
+ function Tuple(types, options) {
1179
+ return CreateType(types.length > 0 ? { [Kind]: "Tuple", type: "array", items: types, additionalItems: false, minItems: types.length, maxItems: types.length } : { [Kind]: "Tuple", type: "array", minItems: types.length, maxItems: types.length }, options);
1180
+ }
1181
+
1182
+ // ../../node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.mjs
1183
+ function FromMappedResult3(K, P) {
1184
+ return K in P ? FromSchemaType(K, P[K]) : MappedResult(P);
1185
+ }
1186
+ function MappedKeyToKnownMappedResultProperties(K) {
1187
+ return { [K]: Literal(K) };
1188
+ }
1189
+ function MappedKeyToUnknownMappedResultProperties(P) {
1190
+ const Acc = {};
1191
+ for (const L of P)
1192
+ Acc[L] = Literal(L);
1193
+ return Acc;
1194
+ }
1195
+ function MappedKeyToMappedResultProperties(K, P) {
1196
+ return SetIncludes(P, K) ? MappedKeyToKnownMappedResultProperties(K) : MappedKeyToUnknownMappedResultProperties(P);
1197
+ }
1198
+ function FromMappedKey(K, P) {
1199
+ const R = MappedKeyToMappedResultProperties(K, P);
1200
+ return FromMappedResult3(K, R);
1201
+ }
1202
+ function FromRest2(K, T) {
1203
+ return T.map((L) => FromSchemaType(K, L));
1204
+ }
1205
+ function FromProperties3(K, T) {
1206
+ const Acc = {};
1207
+ for (const K2 of globalThis.Object.getOwnPropertyNames(T))
1208
+ Acc[K2] = FromSchemaType(K, T[K2]);
1209
+ return Acc;
1210
+ }
1211
+ function FromSchemaType(K, T) {
1212
+ const options = { ...T };
1213
+ return (
1214
+ // unevaluated modifier types
1215
+ IsOptional(T) ? Optional(FromSchemaType(K, Discard(T, [OptionalKind]))) : IsReadonly(T) ? Readonly(FromSchemaType(K, Discard(T, [ReadonlyKind]))) : (
1216
+ // unevaluated mapped types
1217
+ IsMappedResult(T) ? FromMappedResult3(K, T.properties) : IsMappedKey(T) ? FromMappedKey(K, T.keys) : (
1218
+ // unevaluated types
1219
+ IsConstructor(T) ? Constructor(FromRest2(K, T.parameters), FromSchemaType(K, T.returns), options) : IsFunction2(T) ? Function(FromRest2(K, T.parameters), FromSchemaType(K, T.returns), options) : IsAsyncIterator2(T) ? AsyncIterator(FromSchemaType(K, T.items), options) : IsIterator2(T) ? Iterator(FromSchemaType(K, T.items), options) : IsIntersect(T) ? Intersect(FromRest2(K, T.allOf), options) : IsUnion(T) ? Union(FromRest2(K, T.anyOf), options) : IsTuple(T) ? Tuple(FromRest2(K, T.items ?? []), options) : IsObject3(T) ? Object2(FromProperties3(K, T.properties), options) : IsArray3(T) ? Array2(FromSchemaType(K, T.items), options) : IsPromise(T) ? Promise2(FromSchemaType(K, T.item), options) : T
1220
+ )
1221
+ )
1222
+ );
1223
+ }
1224
+ function MappedFunctionReturnType(K, T) {
1225
+ const Acc = {};
1226
+ for (const L of K)
1227
+ Acc[L] = FromSchemaType(L, T);
1228
+ return Acc;
1229
+ }
1230
+ function Mapped(key, map, options) {
1231
+ const K = IsSchema(key) ? IndexPropertyKeys(key) : key;
1232
+ const RT = map({ [Kind]: "MappedKey", keys: K });
1233
+ const R = MappedFunctionReturnType(K, RT);
1234
+ return Object2(R, options);
1235
+ }
1236
+
1237
+ // ../../node_modules/@sinclair/typebox/build/esm/type/optional/optional.mjs
1238
+ function RemoveOptional(schema) {
1239
+ return CreateType(Discard(schema, [OptionalKind]));
1240
+ }
1241
+ function AddOptional(schema) {
1242
+ return CreateType({ ...schema, [OptionalKind]: "Optional" });
1243
+ }
1244
+ function OptionalWithFlag(schema, F) {
1245
+ return F === false ? RemoveOptional(schema) : AddOptional(schema);
1246
+ }
1247
+ function Optional(schema, enable) {
1248
+ const F = enable ?? true;
1249
+ return IsMappedResult(schema) ? OptionalFromMappedResult(schema, F) : OptionalWithFlag(schema, F);
1250
+ }
1251
+
1252
+ // ../../node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.mjs
1253
+ function FromProperties4(P, F) {
1254
+ const Acc = {};
1255
+ for (const K2 of globalThis.Object.getOwnPropertyNames(P))
1256
+ Acc[K2] = Optional(P[K2], F);
1257
+ return Acc;
1258
+ }
1259
+ function FromMappedResult4(R, F) {
1260
+ return FromProperties4(R.properties, F);
1261
+ }
1262
+ function OptionalFromMappedResult(R, F) {
1263
+ const P = FromMappedResult4(R, F);
1264
+ return MappedResult(P);
1265
+ }
1266
+
1267
+ // ../../node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.mjs
1268
+ function IntersectCreate(T, options = {}) {
1269
+ const allObjects = T.every((schema) => IsObject3(schema));
1270
+ const clonedUnevaluatedProperties = IsSchema(options.unevaluatedProperties) ? { unevaluatedProperties: options.unevaluatedProperties } : {};
1271
+ return CreateType(options.unevaluatedProperties === false || IsSchema(options.unevaluatedProperties) || allObjects ? { ...clonedUnevaluatedProperties, [Kind]: "Intersect", type: "object", allOf: T } : { ...clonedUnevaluatedProperties, [Kind]: "Intersect", allOf: T }, options);
1272
+ }
1273
+
1274
+ // ../../node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.mjs
1275
+ function IsIntersectOptional(types) {
1276
+ return types.every((left) => IsOptional(left));
1277
+ }
1278
+ function RemoveOptionalFromType2(type) {
1279
+ return Discard(type, [OptionalKind]);
1280
+ }
1281
+ function RemoveOptionalFromRest2(types) {
1282
+ return types.map((left) => IsOptional(left) ? RemoveOptionalFromType2(left) : left);
1283
+ }
1284
+ function ResolveIntersect(types, options) {
1285
+ return IsIntersectOptional(types) ? Optional(IntersectCreate(RemoveOptionalFromRest2(types), options)) : IntersectCreate(RemoveOptionalFromRest2(types), options);
1286
+ }
1287
+ function IntersectEvaluated(types, options = {}) {
1288
+ if (types.length === 1)
1289
+ return CreateType(types[0], options);
1290
+ if (types.length === 0)
1291
+ return Never(options);
1292
+ if (types.some((schema) => IsTransform(schema)))
1293
+ throw new Error("Cannot intersect transform types");
1294
+ return ResolveIntersect(types, options);
1295
+ }
1296
+
1297
+ // ../../node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.mjs
1298
+ function Intersect(types, options) {
1299
+ if (types.length === 1)
1300
+ return CreateType(types[0], options);
1301
+ if (types.length === 0)
1302
+ return Never(options);
1303
+ if (types.some((schema) => IsTransform(schema)))
1304
+ throw new Error("Cannot intersect transform types");
1305
+ return IntersectCreate(types, options);
1306
+ }
1307
+
1308
+ // ../../node_modules/@sinclair/typebox/build/esm/type/ref/ref.mjs
1309
+ function Ref(...args) {
1310
+ const [$ref, options] = typeof args[0] === "string" ? [args[0], args[1]] : [args[0].$id, args[1]];
1311
+ if (typeof $ref !== "string")
1312
+ throw new TypeBoxError("Ref: $ref must be a string");
1313
+ return CreateType({ [Kind]: "Ref", $ref }, options);
1314
+ }
1315
+
1316
+ // ../../node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.mjs
1317
+ function FromComputed(target, parameters) {
1318
+ return Computed("Awaited", [Computed(target, parameters)]);
1319
+ }
1320
+ function FromRef($ref) {
1321
+ return Computed("Awaited", [Ref($ref)]);
1322
+ }
1323
+ function FromIntersect2(types) {
1324
+ return Intersect(FromRest3(types));
1325
+ }
1326
+ function FromUnion4(types) {
1327
+ return Union(FromRest3(types));
1328
+ }
1329
+ function FromPromise(type) {
1330
+ return Awaited(type);
1331
+ }
1332
+ function FromRest3(types) {
1333
+ return types.map((type) => Awaited(type));
1334
+ }
1335
+ function Awaited(type, options) {
1336
+ return CreateType(IsComputed(type) ? FromComputed(type.target, type.parameters) : IsIntersect(type) ? FromIntersect2(type.allOf) : IsUnion(type) ? FromUnion4(type.anyOf) : IsPromise(type) ? FromPromise(type.item) : IsRef(type) ? FromRef(type.$ref) : type, options);
1337
+ }
1338
+
1339
+ // ../../node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.mjs
1340
+ function FromRest4(types) {
1341
+ const result = [];
1342
+ for (const L of types)
1343
+ result.push(KeyOfPropertyKeys(L));
1344
+ return result;
1345
+ }
1346
+ function FromIntersect3(types) {
1347
+ const propertyKeysArray = FromRest4(types);
1348
+ const propertyKeys = SetUnionMany(propertyKeysArray);
1349
+ return propertyKeys;
1350
+ }
1351
+ function FromUnion5(types) {
1352
+ const propertyKeysArray = FromRest4(types);
1353
+ const propertyKeys = SetIntersectMany(propertyKeysArray);
1354
+ return propertyKeys;
1355
+ }
1356
+ function FromTuple2(types) {
1357
+ return types.map((_, indexer) => indexer.toString());
1358
+ }
1359
+ function FromArray2(_) {
1360
+ return ["[number]"];
1361
+ }
1362
+ function FromProperties5(T) {
1363
+ return globalThis.Object.getOwnPropertyNames(T);
1364
+ }
1365
+ function FromPatternProperties(patternProperties) {
1366
+ if (!includePatternProperties)
1367
+ return [];
1368
+ const patternPropertyKeys = globalThis.Object.getOwnPropertyNames(patternProperties);
1369
+ return patternPropertyKeys.map((key) => {
1370
+ return key[0] === "^" && key[key.length - 1] === "$" ? key.slice(1, key.length - 1) : key;
1371
+ });
1372
+ }
1373
+ function KeyOfPropertyKeys(type) {
1374
+ return IsIntersect(type) ? FromIntersect3(type.allOf) : IsUnion(type) ? FromUnion5(type.anyOf) : IsTuple(type) ? FromTuple2(type.items ?? []) : IsArray3(type) ? FromArray2(type.items) : IsObject3(type) ? FromProperties5(type.properties) : IsRecord(type) ? FromPatternProperties(type.patternProperties) : [];
1375
+ }
1376
+ var includePatternProperties = false;
1377
+
1378
+ // ../../node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.mjs
1379
+ function FromComputed2(target, parameters) {
1380
+ return Computed("KeyOf", [Computed(target, parameters)]);
1381
+ }
1382
+ function FromRef2($ref) {
1383
+ return Computed("KeyOf", [Ref($ref)]);
1384
+ }
1385
+ function KeyOfFromType(type, options) {
1386
+ const propertyKeys = KeyOfPropertyKeys(type);
1387
+ const propertyKeyTypes = KeyOfPropertyKeysToRest(propertyKeys);
1388
+ const result = UnionEvaluated(propertyKeyTypes);
1389
+ return CreateType(result, options);
1390
+ }
1391
+ function KeyOfPropertyKeysToRest(propertyKeys) {
1392
+ return propertyKeys.map((L) => L === "[number]" ? Number2() : Literal(L));
1393
+ }
1394
+ function KeyOf(type, options) {
1395
+ return IsComputed(type) ? FromComputed2(type.target, type.parameters) : IsRef(type) ? FromRef2(type.$ref) : IsMappedResult(type) ? KeyOfFromMappedResult(type, options) : KeyOfFromType(type, options);
1396
+ }
1397
+
1398
+ // ../../node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.mjs
1399
+ function FromProperties6(properties, options) {
1400
+ const result = {};
1401
+ for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
1402
+ result[K2] = KeyOf(properties[K2], Clone(options));
1403
+ return result;
1404
+ }
1405
+ function FromMappedResult5(mappedResult, options) {
1406
+ return FromProperties6(mappedResult.properties, options);
1407
+ }
1408
+ function KeyOfFromMappedResult(mappedResult, options) {
1409
+ const properties = FromMappedResult5(mappedResult, options);
1410
+ return MappedResult(properties);
1411
+ }
1412
+
1413
+ // ../../node_modules/@sinclair/typebox/build/esm/type/composite/composite.mjs
1414
+ function CompositeKeys(T) {
1415
+ const Acc = [];
1416
+ for (const L of T)
1417
+ Acc.push(...KeyOfPropertyKeys(L));
1418
+ return SetDistinct(Acc);
1419
+ }
1420
+ function FilterNever(T) {
1421
+ return T.filter((L) => !IsNever(L));
1422
+ }
1423
+ function CompositeProperty(T, K) {
1424
+ const Acc = [];
1425
+ for (const L of T)
1426
+ Acc.push(...IndexFromPropertyKeys(L, [K]));
1427
+ return FilterNever(Acc);
1428
+ }
1429
+ function CompositeProperties(T, K) {
1430
+ const Acc = {};
1431
+ for (const L of K) {
1432
+ Acc[L] = IntersectEvaluated(CompositeProperty(T, L));
1433
+ }
1434
+ return Acc;
1435
+ }
1436
+ function Composite(T, options) {
1437
+ const K = CompositeKeys(T);
1438
+ const P = CompositeProperties(T, K);
1439
+ const R = Object2(P, options);
1440
+ return R;
1441
+ }
1442
+
1443
+ // ../../node_modules/@sinclair/typebox/build/esm/type/date/date.mjs
1444
+ function Date2(options) {
1445
+ return CreateType({ [Kind]: "Date", type: "Date" }, options);
1446
+ }
1447
+
1448
+ // ../../node_modules/@sinclair/typebox/build/esm/type/null/null.mjs
1449
+ function Null(options) {
1450
+ return CreateType({ [Kind]: "Null", type: "null" }, options);
1451
+ }
1452
+
1453
+ // ../../node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.mjs
1454
+ function Symbol2(options) {
1455
+ return CreateType({ [Kind]: "Symbol", type: "symbol" }, options);
1456
+ }
1457
+
1458
+ // ../../node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.mjs
1459
+ function Undefined(options) {
1460
+ return CreateType({ [Kind]: "Undefined", type: "undefined" }, options);
1461
+ }
1462
+
1463
+ // ../../node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.mjs
1464
+ function Uint8Array2(options) {
1465
+ return CreateType({ [Kind]: "Uint8Array", type: "Uint8Array" }, options);
1466
+ }
1467
+
1468
+ // ../../node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.mjs
1469
+ function Unknown(options) {
1470
+ return CreateType({ [Kind]: "Unknown" }, options);
1471
+ }
1472
+
1473
+ // ../../node_modules/@sinclair/typebox/build/esm/type/const/const.mjs
1474
+ function FromArray3(T) {
1475
+ return T.map((L) => FromValue(L, false));
1476
+ }
1477
+ function FromProperties7(value) {
1478
+ const Acc = {};
1479
+ for (const K of globalThis.Object.getOwnPropertyNames(value))
1480
+ Acc[K] = Readonly(FromValue(value[K], false));
1481
+ return Acc;
1482
+ }
1483
+ function ConditionalReadonly(T, root) {
1484
+ return root === true ? T : Readonly(T);
1485
+ }
1486
+ function FromValue(value, root) {
1487
+ return IsAsyncIterator(value) ? ConditionalReadonly(Any(), root) : IsIterator(value) ? ConditionalReadonly(Any(), root) : IsArray(value) ? Readonly(Tuple(FromArray3(value))) : IsUint8Array(value) ? Uint8Array2() : IsDate(value) ? Date2() : IsObject(value) ? ConditionalReadonly(Object2(FromProperties7(value)), root) : IsFunction(value) ? ConditionalReadonly(Function([], Unknown()), root) : IsUndefined(value) ? Undefined() : IsNull(value) ? Null() : IsSymbol(value) ? Symbol2() : IsBigInt(value) ? BigInt() : IsNumber(value) ? Literal(value) : IsBoolean(value) ? Literal(value) : IsString(value) ? Literal(value) : Object2({});
1488
+ }
1489
+ function Const(T, options) {
1490
+ return CreateType(FromValue(T, true), options);
1491
+ }
1492
+
1493
+ // ../../node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.mjs
1494
+ function ConstructorParameters(schema, options) {
1495
+ return IsConstructor(schema) ? Tuple(schema.parameters, options) : Never(options);
1496
+ }
1497
+
1498
+ // ../../node_modules/@sinclair/typebox/build/esm/type/enum/enum.mjs
1499
+ function Enum(item, options) {
1500
+ if (IsUndefined(item))
1501
+ throw new Error("Enum undefined or empty");
1502
+ const values1 = globalThis.Object.getOwnPropertyNames(item).filter((key) => isNaN(key)).map((key) => item[key]);
1503
+ const values2 = [...new Set(values1)];
1504
+ const anyOf = values2.map((value) => Literal(value));
1505
+ return Union(anyOf, { ...options, [Hint]: "Enum" });
1506
+ }
1507
+
1508
+ // ../../node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.mjs
1509
+ var ExtendsResolverError = class extends TypeBoxError {
1510
+ };
1511
+ var ExtendsResult;
1512
+ (function(ExtendsResult2) {
1513
+ ExtendsResult2[ExtendsResult2["Union"] = 0] = "Union";
1514
+ ExtendsResult2[ExtendsResult2["True"] = 1] = "True";
1515
+ ExtendsResult2[ExtendsResult2["False"] = 2] = "False";
1516
+ })(ExtendsResult || (ExtendsResult = {}));
1517
+ function IntoBooleanResult(result) {
1518
+ return result === ExtendsResult.False ? result : ExtendsResult.True;
1519
+ }
1520
+ function Throw(message) {
1521
+ throw new ExtendsResolverError(message);
1522
+ }
1523
+ function IsStructuralRight(right) {
1524
+ return type_exports.IsNever(right) || type_exports.IsIntersect(right) || type_exports.IsUnion(right) || type_exports.IsUnknown(right) || type_exports.IsAny(right);
1525
+ }
1526
+ function StructuralRight(left, right) {
1527
+ return type_exports.IsNever(right) ? FromNeverRight(left, right) : type_exports.IsIntersect(right) ? FromIntersectRight(left, right) : type_exports.IsUnion(right) ? FromUnionRight(left, right) : type_exports.IsUnknown(right) ? FromUnknownRight(left, right) : type_exports.IsAny(right) ? FromAnyRight(left, right) : Throw("StructuralRight");
1528
+ }
1529
+ function FromAnyRight(left, right) {
1530
+ return ExtendsResult.True;
1531
+ }
1532
+ function FromAny(left, right) {
1533
+ return type_exports.IsIntersect(right) ? FromIntersectRight(left, right) : type_exports.IsUnion(right) && right.anyOf.some((schema) => type_exports.IsAny(schema) || type_exports.IsUnknown(schema)) ? ExtendsResult.True : type_exports.IsUnion(right) ? ExtendsResult.Union : type_exports.IsUnknown(right) ? ExtendsResult.True : type_exports.IsAny(right) ? ExtendsResult.True : ExtendsResult.Union;
1534
+ }
1535
+ function FromArrayRight(left, right) {
1536
+ return type_exports.IsUnknown(left) ? ExtendsResult.False : type_exports.IsAny(left) ? ExtendsResult.Union : type_exports.IsNever(left) ? ExtendsResult.True : ExtendsResult.False;
1537
+ }
1538
+ function FromArray4(left, right) {
1539
+ return type_exports.IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True : IsStructuralRight(right) ? StructuralRight(left, right) : !type_exports.IsArray(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.items, right.items));
1540
+ }
1541
+ function FromAsyncIterator(left, right) {
1542
+ return IsStructuralRight(right) ? StructuralRight(left, right) : !type_exports.IsAsyncIterator(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.items, right.items));
1543
+ }
1544
+ function FromBigInt(left, right) {
1545
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsBigInt(right) ? ExtendsResult.True : ExtendsResult.False;
1546
+ }
1547
+ function FromBooleanRight(left, right) {
1548
+ return type_exports.IsLiteralBoolean(left) ? ExtendsResult.True : type_exports.IsBoolean(left) ? ExtendsResult.True : ExtendsResult.False;
1549
+ }
1550
+ function FromBoolean(left, right) {
1551
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsBoolean(right) ? ExtendsResult.True : ExtendsResult.False;
1552
+ }
1553
+ function FromConstructor(left, right) {
1554
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : !type_exports.IsConstructor(right) ? ExtendsResult.False : left.parameters.length > right.parameters.length ? ExtendsResult.False : !left.parameters.every((schema, index) => IntoBooleanResult(Visit3(right.parameters[index], schema)) === ExtendsResult.True) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.returns, right.returns));
1555
+ }
1556
+ function FromDate(left, right) {
1557
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsDate(right) ? ExtendsResult.True : ExtendsResult.False;
1558
+ }
1559
+ function FromFunction(left, right) {
1560
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : !type_exports.IsFunction(right) ? ExtendsResult.False : left.parameters.length > right.parameters.length ? ExtendsResult.False : !left.parameters.every((schema, index) => IntoBooleanResult(Visit3(right.parameters[index], schema)) === ExtendsResult.True) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.returns, right.returns));
1561
+ }
1562
+ function FromIntegerRight(left, right) {
1563
+ return type_exports.IsLiteral(left) && value_exports.IsNumber(left.const) ? ExtendsResult.True : type_exports.IsNumber(left) || type_exports.IsInteger(left) ? ExtendsResult.True : ExtendsResult.False;
1564
+ }
1565
+ function FromInteger(left, right) {
1566
+ return type_exports.IsInteger(right) || type_exports.IsNumber(right) ? ExtendsResult.True : IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : ExtendsResult.False;
1567
+ }
1568
+ function FromIntersectRight(left, right) {
1569
+ return right.allOf.every((schema) => Visit3(left, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1570
+ }
1571
+ function FromIntersect4(left, right) {
1572
+ return left.allOf.some((schema) => Visit3(schema, right) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1573
+ }
1574
+ function FromIterator(left, right) {
1575
+ return IsStructuralRight(right) ? StructuralRight(left, right) : !type_exports.IsIterator(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.items, right.items));
1576
+ }
1577
+ function FromLiteral2(left, right) {
1578
+ return type_exports.IsLiteral(right) && right.const === left.const ? ExtendsResult.True : IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsString(right) ? FromStringRight(left, right) : type_exports.IsNumber(right) ? FromNumberRight(left, right) : type_exports.IsInteger(right) ? FromIntegerRight(left, right) : type_exports.IsBoolean(right) ? FromBooleanRight(left, right) : ExtendsResult.False;
1579
+ }
1580
+ function FromNeverRight(left, right) {
1581
+ return ExtendsResult.False;
1582
+ }
1583
+ function FromNever(left, right) {
1584
+ return ExtendsResult.True;
1585
+ }
1586
+ function UnwrapTNot(schema) {
1587
+ let [current, depth] = [schema, 0];
1588
+ while (true) {
1589
+ if (!type_exports.IsNot(current))
1590
+ break;
1591
+ current = current.not;
1592
+ depth += 1;
1593
+ }
1594
+ return depth % 2 === 0 ? current : Unknown();
1595
+ }
1596
+ function FromNot(left, right) {
1597
+ return type_exports.IsNot(left) ? Visit3(UnwrapTNot(left), right) : type_exports.IsNot(right) ? Visit3(left, UnwrapTNot(right)) : Throw("Invalid fallthrough for Not");
1598
+ }
1599
+ function FromNull(left, right) {
1600
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsNull(right) ? ExtendsResult.True : ExtendsResult.False;
1601
+ }
1602
+ function FromNumberRight(left, right) {
1603
+ return type_exports.IsLiteralNumber(left) ? ExtendsResult.True : type_exports.IsNumber(left) || type_exports.IsInteger(left) ? ExtendsResult.True : ExtendsResult.False;
1604
+ }
1605
+ function FromNumber(left, right) {
1606
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsInteger(right) || type_exports.IsNumber(right) ? ExtendsResult.True : ExtendsResult.False;
1607
+ }
1608
+ function IsObjectPropertyCount(schema, count) {
1609
+ return Object.getOwnPropertyNames(schema.properties).length === count;
1610
+ }
1611
+ function IsObjectStringLike(schema) {
1612
+ return IsObjectArrayLike(schema);
1613
+ }
1614
+ function IsObjectSymbolLike(schema) {
1615
+ return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "description" in schema.properties && type_exports.IsUnion(schema.properties.description) && schema.properties.description.anyOf.length === 2 && (type_exports.IsString(schema.properties.description.anyOf[0]) && type_exports.IsUndefined(schema.properties.description.anyOf[1]) || type_exports.IsString(schema.properties.description.anyOf[1]) && type_exports.IsUndefined(schema.properties.description.anyOf[0]));
1616
+ }
1617
+ function IsObjectNumberLike(schema) {
1618
+ return IsObjectPropertyCount(schema, 0);
1619
+ }
1620
+ function IsObjectBooleanLike(schema) {
1621
+ return IsObjectPropertyCount(schema, 0);
1622
+ }
1623
+ function IsObjectBigIntLike(schema) {
1624
+ return IsObjectPropertyCount(schema, 0);
1625
+ }
1626
+ function IsObjectDateLike(schema) {
1627
+ return IsObjectPropertyCount(schema, 0);
1628
+ }
1629
+ function IsObjectUint8ArrayLike(schema) {
1630
+ return IsObjectArrayLike(schema);
1631
+ }
1632
+ function IsObjectFunctionLike(schema) {
1633
+ const length = Number2();
1634
+ return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "length" in schema.properties && IntoBooleanResult(Visit3(schema.properties["length"], length)) === ExtendsResult.True;
1635
+ }
1636
+ function IsObjectConstructorLike(schema) {
1637
+ return IsObjectPropertyCount(schema, 0);
1638
+ }
1639
+ function IsObjectArrayLike(schema) {
1640
+ const length = Number2();
1641
+ return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "length" in schema.properties && IntoBooleanResult(Visit3(schema.properties["length"], length)) === ExtendsResult.True;
1642
+ }
1643
+ function IsObjectPromiseLike(schema) {
1644
+ const then = Function([Any()], Any());
1645
+ return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "then" in schema.properties && IntoBooleanResult(Visit3(schema.properties["then"], then)) === ExtendsResult.True;
1646
+ }
1647
+ function Property(left, right) {
1648
+ return Visit3(left, right) === ExtendsResult.False ? ExtendsResult.False : type_exports.IsOptional(left) && !type_exports.IsOptional(right) ? ExtendsResult.False : ExtendsResult.True;
1649
+ }
1650
+ function FromObjectRight(left, right) {
1651
+ return type_exports.IsUnknown(left) ? ExtendsResult.False : type_exports.IsAny(left) ? ExtendsResult.Union : type_exports.IsNever(left) || type_exports.IsLiteralString(left) && IsObjectStringLike(right) || type_exports.IsLiteralNumber(left) && IsObjectNumberLike(right) || type_exports.IsLiteralBoolean(left) && IsObjectBooleanLike(right) || type_exports.IsSymbol(left) && IsObjectSymbolLike(right) || type_exports.IsBigInt(left) && IsObjectBigIntLike(right) || type_exports.IsString(left) && IsObjectStringLike(right) || type_exports.IsSymbol(left) && IsObjectSymbolLike(right) || type_exports.IsNumber(left) && IsObjectNumberLike(right) || type_exports.IsInteger(left) && IsObjectNumberLike(right) || type_exports.IsBoolean(left) && IsObjectBooleanLike(right) || type_exports.IsUint8Array(left) && IsObjectUint8ArrayLike(right) || type_exports.IsDate(left) && IsObjectDateLike(right) || type_exports.IsConstructor(left) && IsObjectConstructorLike(right) || type_exports.IsFunction(left) && IsObjectFunctionLike(right) ? ExtendsResult.True : type_exports.IsRecord(left) && type_exports.IsString(RecordKey(left)) ? (() => {
1652
+ return right[Hint] === "Record" ? ExtendsResult.True : ExtendsResult.False;
1653
+ })() : type_exports.IsRecord(left) && type_exports.IsNumber(RecordKey(left)) ? (() => {
1654
+ return IsObjectPropertyCount(right, 0) ? ExtendsResult.True : ExtendsResult.False;
1655
+ })() : ExtendsResult.False;
1656
+ }
1657
+ function FromObject(left, right) {
1658
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : !type_exports.IsObject(right) ? ExtendsResult.False : (() => {
1659
+ for (const key of Object.getOwnPropertyNames(right.properties)) {
1660
+ if (!(key in left.properties) && !type_exports.IsOptional(right.properties[key])) {
1661
+ return ExtendsResult.False;
1662
+ }
1663
+ if (type_exports.IsOptional(right.properties[key])) {
1664
+ return ExtendsResult.True;
1665
+ }
1666
+ if (Property(left.properties[key], right.properties[key]) === ExtendsResult.False) {
1667
+ return ExtendsResult.False;
1668
+ }
1669
+ }
1670
+ return ExtendsResult.True;
1671
+ })();
1672
+ }
1673
+ function FromPromise2(left, right) {
1674
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) && IsObjectPromiseLike(right) ? ExtendsResult.True : !type_exports.IsPromise(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.item, right.item));
1675
+ }
1676
+ function RecordKey(schema) {
1677
+ return PatternNumberExact in schema.patternProperties ? Number2() : PatternStringExact in schema.patternProperties ? String2() : Throw("Unknown record key pattern");
1678
+ }
1679
+ function RecordValue(schema) {
1680
+ return PatternNumberExact in schema.patternProperties ? schema.patternProperties[PatternNumberExact] : PatternStringExact in schema.patternProperties ? schema.patternProperties[PatternStringExact] : Throw("Unable to get record value schema");
1681
+ }
1682
+ function FromRecordRight(left, right) {
1683
+ const [Key, Value] = [RecordKey(right), RecordValue(right)];
1684
+ return type_exports.IsLiteralString(left) && type_exports.IsNumber(Key) && IntoBooleanResult(Visit3(left, Value)) === ExtendsResult.True ? ExtendsResult.True : type_exports.IsUint8Array(left) && type_exports.IsNumber(Key) ? Visit3(left, Value) : type_exports.IsString(left) && type_exports.IsNumber(Key) ? Visit3(left, Value) : type_exports.IsArray(left) && type_exports.IsNumber(Key) ? Visit3(left, Value) : type_exports.IsObject(left) ? (() => {
1685
+ for (const key of Object.getOwnPropertyNames(left.properties)) {
1686
+ if (Property(Value, left.properties[key]) === ExtendsResult.False) {
1687
+ return ExtendsResult.False;
1688
+ }
1689
+ }
1690
+ return ExtendsResult.True;
1691
+ })() : ExtendsResult.False;
1692
+ }
1693
+ function FromRecord(left, right) {
1694
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : !type_exports.IsRecord(right) ? ExtendsResult.False : Visit3(RecordValue(left), RecordValue(right));
1695
+ }
1696
+ function FromRegExp(left, right) {
1697
+ const L = type_exports.IsRegExp(left) ? String2() : left;
1698
+ const R = type_exports.IsRegExp(right) ? String2() : right;
1699
+ return Visit3(L, R);
1700
+ }
1701
+ function FromStringRight(left, right) {
1702
+ return type_exports.IsLiteral(left) && value_exports.IsString(left.const) ? ExtendsResult.True : type_exports.IsString(left) ? ExtendsResult.True : ExtendsResult.False;
1703
+ }
1704
+ function FromString(left, right) {
1705
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsString(right) ? ExtendsResult.True : ExtendsResult.False;
1706
+ }
1707
+ function FromSymbol(left, right) {
1708
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsSymbol(right) ? ExtendsResult.True : ExtendsResult.False;
1709
+ }
1710
+ function FromTemplateLiteral2(left, right) {
1711
+ return type_exports.IsTemplateLiteral(left) ? Visit3(TemplateLiteralToUnion(left), right) : type_exports.IsTemplateLiteral(right) ? Visit3(left, TemplateLiteralToUnion(right)) : Throw("Invalid fallthrough for TemplateLiteral");
1712
+ }
1713
+ function IsArrayOfTuple(left, right) {
1714
+ return type_exports.IsArray(right) && left.items !== void 0 && left.items.every((schema) => Visit3(schema, right.items) === ExtendsResult.True);
1715
+ }
1716
+ function FromTupleRight(left, right) {
1717
+ return type_exports.IsNever(left) ? ExtendsResult.True : type_exports.IsUnknown(left) ? ExtendsResult.False : type_exports.IsAny(left) ? ExtendsResult.Union : ExtendsResult.False;
1718
+ }
1719
+ function FromTuple3(left, right) {
1720
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True : type_exports.IsArray(right) && IsArrayOfTuple(left, right) ? ExtendsResult.True : !type_exports.IsTuple(right) ? ExtendsResult.False : value_exports.IsUndefined(left.items) && !value_exports.IsUndefined(right.items) || !value_exports.IsUndefined(left.items) && value_exports.IsUndefined(right.items) ? ExtendsResult.False : value_exports.IsUndefined(left.items) && !value_exports.IsUndefined(right.items) ? ExtendsResult.True : left.items.every((schema, index) => Visit3(schema, right.items[index]) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1721
+ }
1722
+ function FromUint8Array(left, right) {
1723
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsUint8Array(right) ? ExtendsResult.True : ExtendsResult.False;
1724
+ }
1725
+ function FromUndefined(left, right) {
1726
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsVoid(right) ? FromVoidRight(left, right) : type_exports.IsUndefined(right) ? ExtendsResult.True : ExtendsResult.False;
1727
+ }
1728
+ function FromUnionRight(left, right) {
1729
+ return right.anyOf.some((schema) => Visit3(left, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1730
+ }
1731
+ function FromUnion6(left, right) {
1732
+ return left.anyOf.every((schema) => Visit3(schema, right) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1733
+ }
1734
+ function FromUnknownRight(left, right) {
1735
+ return ExtendsResult.True;
1736
+ }
1737
+ function FromUnknown(left, right) {
1738
+ return type_exports.IsNever(right) ? FromNeverRight(left, right) : type_exports.IsIntersect(right) ? FromIntersectRight(left, right) : type_exports.IsUnion(right) ? FromUnionRight(left, right) : type_exports.IsAny(right) ? FromAnyRight(left, right) : type_exports.IsString(right) ? FromStringRight(left, right) : type_exports.IsNumber(right) ? FromNumberRight(left, right) : type_exports.IsInteger(right) ? FromIntegerRight(left, right) : type_exports.IsBoolean(right) ? FromBooleanRight(left, right) : type_exports.IsArray(right) ? FromArrayRight(left, right) : type_exports.IsTuple(right) ? FromTupleRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsUnknown(right) ? ExtendsResult.True : ExtendsResult.False;
1739
+ }
1740
+ function FromVoidRight(left, right) {
1741
+ return type_exports.IsUndefined(left) ? ExtendsResult.True : type_exports.IsUndefined(left) ? ExtendsResult.True : ExtendsResult.False;
1742
+ }
1743
+ function FromVoid(left, right) {
1744
+ return type_exports.IsIntersect(right) ? FromIntersectRight(left, right) : type_exports.IsUnion(right) ? FromUnionRight(left, right) : type_exports.IsUnknown(right) ? FromUnknownRight(left, right) : type_exports.IsAny(right) ? FromAnyRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsVoid(right) ? ExtendsResult.True : ExtendsResult.False;
1745
+ }
1746
+ function Visit3(left, right) {
1747
+ return (
1748
+ // resolvable
1749
+ type_exports.IsTemplateLiteral(left) || type_exports.IsTemplateLiteral(right) ? FromTemplateLiteral2(left, right) : type_exports.IsRegExp(left) || type_exports.IsRegExp(right) ? FromRegExp(left, right) : type_exports.IsNot(left) || type_exports.IsNot(right) ? FromNot(left, right) : (
1750
+ // standard
1751
+ type_exports.IsAny(left) ? FromAny(left, right) : type_exports.IsArray(left) ? FromArray4(left, right) : type_exports.IsBigInt(left) ? FromBigInt(left, right) : type_exports.IsBoolean(left) ? FromBoolean(left, right) : type_exports.IsAsyncIterator(left) ? FromAsyncIterator(left, right) : type_exports.IsConstructor(left) ? FromConstructor(left, right) : type_exports.IsDate(left) ? FromDate(left, right) : type_exports.IsFunction(left) ? FromFunction(left, right) : type_exports.IsInteger(left) ? FromInteger(left, right) : type_exports.IsIntersect(left) ? FromIntersect4(left, right) : type_exports.IsIterator(left) ? FromIterator(left, right) : type_exports.IsLiteral(left) ? FromLiteral2(left, right) : type_exports.IsNever(left) ? FromNever(left, right) : type_exports.IsNull(left) ? FromNull(left, right) : type_exports.IsNumber(left) ? FromNumber(left, right) : type_exports.IsObject(left) ? FromObject(left, right) : type_exports.IsRecord(left) ? FromRecord(left, right) : type_exports.IsString(left) ? FromString(left, right) : type_exports.IsSymbol(left) ? FromSymbol(left, right) : type_exports.IsTuple(left) ? FromTuple3(left, right) : type_exports.IsPromise(left) ? FromPromise2(left, right) : type_exports.IsUint8Array(left) ? FromUint8Array(left, right) : type_exports.IsUndefined(left) ? FromUndefined(left, right) : type_exports.IsUnion(left) ? FromUnion6(left, right) : type_exports.IsUnknown(left) ? FromUnknown(left, right) : type_exports.IsVoid(left) ? FromVoid(left, right) : Throw(`Unknown left type operand '${left[Kind]}'`)
1752
+ )
1753
+ );
1754
+ }
1755
+ function ExtendsCheck(left, right) {
1756
+ return Visit3(left, right);
1757
+ }
1758
+
1759
+ // ../../node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.mjs
1760
+ function FromProperties8(P, Right, True, False, options) {
1761
+ const Acc = {};
1762
+ for (const K2 of globalThis.Object.getOwnPropertyNames(P))
1763
+ Acc[K2] = Extends(P[K2], Right, True, False, Clone(options));
1764
+ return Acc;
1765
+ }
1766
+ function FromMappedResult6(Left, Right, True, False, options) {
1767
+ return FromProperties8(Left.properties, Right, True, False, options);
1768
+ }
1769
+ function ExtendsFromMappedResult(Left, Right, True, False, options) {
1770
+ const P = FromMappedResult6(Left, Right, True, False, options);
1771
+ return MappedResult(P);
1772
+ }
1773
+
1774
+ // ../../node_modules/@sinclair/typebox/build/esm/type/extends/extends.mjs
1775
+ function ExtendsResolve(left, right, trueType, falseType) {
1776
+ const R = ExtendsCheck(left, right);
1777
+ return R === ExtendsResult.Union ? Union([trueType, falseType]) : R === ExtendsResult.True ? trueType : falseType;
1778
+ }
1779
+ function Extends(L, R, T, F, options) {
1780
+ return IsMappedResult(L) ? ExtendsFromMappedResult(L, R, T, F, options) : IsMappedKey(L) ? CreateType(ExtendsFromMappedKey(L, R, T, F, options)) : CreateType(ExtendsResolve(L, R, T, F), options);
1781
+ }
1782
+
1783
+ // ../../node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.mjs
1784
+ function FromPropertyKey(K, U, L, R, options) {
1785
+ return {
1786
+ [K]: Extends(Literal(K), U, L, R, Clone(options))
1787
+ };
1788
+ }
1789
+ function FromPropertyKeys(K, U, L, R, options) {
1790
+ return K.reduce((Acc, LK) => {
1791
+ return { ...Acc, ...FromPropertyKey(LK, U, L, R, options) };
1792
+ }, {});
1793
+ }
1794
+ function FromMappedKey2(K, U, L, R, options) {
1795
+ return FromPropertyKeys(K.keys, U, L, R, options);
1796
+ }
1797
+ function ExtendsFromMappedKey(T, U, L, R, options) {
1798
+ const P = FromMappedKey2(T, U, L, R, options);
1799
+ return MappedResult(P);
1800
+ }
1801
+
1802
+ // ../../node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-template-literal.mjs
1803
+ function ExcludeFromTemplateLiteral(L, R) {
1804
+ return Exclude(TemplateLiteralToUnion(L), R);
1805
+ }
1806
+
1807
+ // ../../node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.mjs
1808
+ function ExcludeRest(L, R) {
1809
+ const excluded = L.filter((inner) => ExtendsCheck(inner, R) === ExtendsResult.False);
1810
+ return excluded.length === 1 ? excluded[0] : Union(excluded);
1811
+ }
1812
+ function Exclude(L, R, options = {}) {
1813
+ if (IsTemplateLiteral(L))
1814
+ return CreateType(ExcludeFromTemplateLiteral(L, R), options);
1815
+ if (IsMappedResult(L))
1816
+ return CreateType(ExcludeFromMappedResult(L, R), options);
1817
+ return CreateType(IsUnion(L) ? ExcludeRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? Never() : L, options);
1818
+ }
1819
+
1820
+ // ../../node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.mjs
1821
+ function FromProperties9(P, U) {
1822
+ const Acc = {};
1823
+ for (const K2 of globalThis.Object.getOwnPropertyNames(P))
1824
+ Acc[K2] = Exclude(P[K2], U);
1825
+ return Acc;
1826
+ }
1827
+ function FromMappedResult7(R, T) {
1828
+ return FromProperties9(R.properties, T);
1829
+ }
1830
+ function ExcludeFromMappedResult(R, T) {
1831
+ const P = FromMappedResult7(R, T);
1832
+ return MappedResult(P);
1833
+ }
1834
+
1835
+ // ../../node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.mjs
1836
+ function ExtractFromTemplateLiteral(L, R) {
1837
+ return Extract(TemplateLiteralToUnion(L), R);
1838
+ }
1839
+
1840
+ // ../../node_modules/@sinclair/typebox/build/esm/type/extract/extract.mjs
1841
+ function ExtractRest(L, R) {
1842
+ const extracted = L.filter((inner) => ExtendsCheck(inner, R) !== ExtendsResult.False);
1843
+ return extracted.length === 1 ? extracted[0] : Union(extracted);
1844
+ }
1845
+ function Extract(L, R, options) {
1846
+ if (IsTemplateLiteral(L))
1847
+ return CreateType(ExtractFromTemplateLiteral(L, R), options);
1848
+ if (IsMappedResult(L))
1849
+ return CreateType(ExtractFromMappedResult(L, R), options);
1850
+ return CreateType(IsUnion(L) ? ExtractRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? L : Never(), options);
1851
+ }
1852
+
1853
+ // ../../node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.mjs
1854
+ function FromProperties10(P, T) {
1855
+ const Acc = {};
1856
+ for (const K2 of globalThis.Object.getOwnPropertyNames(P))
1857
+ Acc[K2] = Extract(P[K2], T);
1858
+ return Acc;
1859
+ }
1860
+ function FromMappedResult8(R, T) {
1861
+ return FromProperties10(R.properties, T);
1862
+ }
1863
+ function ExtractFromMappedResult(R, T) {
1864
+ const P = FromMappedResult8(R, T);
1865
+ return MappedResult(P);
1866
+ }
1867
+
1868
+ // ../../node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.mjs
1869
+ function InstanceType(schema, options) {
1870
+ return IsConstructor(schema) ? CreateType(schema.returns, options) : Never(options);
1871
+ }
1872
+
1873
+ // ../../node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.mjs
1874
+ function ReadonlyOptional(schema) {
1875
+ return Readonly(Optional(schema));
1876
+ }
1877
+
1878
+ // ../../node_modules/@sinclair/typebox/build/esm/type/record/record.mjs
1879
+ function RecordCreateFromPattern(pattern, T, options) {
1880
+ return CreateType({ [Kind]: "Record", type: "object", patternProperties: { [pattern]: T } }, options);
1881
+ }
1882
+ function RecordCreateFromKeys(K, T, options) {
1883
+ const result = {};
1884
+ for (const K2 of K)
1885
+ result[K2] = T;
1886
+ return Object2(result, { ...options, [Hint]: "Record" });
1887
+ }
1888
+ function FromTemplateLiteralKey(K, T, options) {
1889
+ return IsTemplateLiteralFinite(K) ? RecordCreateFromKeys(IndexPropertyKeys(K), T, options) : RecordCreateFromPattern(K.pattern, T, options);
1890
+ }
1891
+ function FromUnionKey(key, type, options) {
1892
+ return RecordCreateFromKeys(IndexPropertyKeys(Union(key)), type, options);
1893
+ }
1894
+ function FromLiteralKey(key, type, options) {
1895
+ return RecordCreateFromKeys([key.toString()], type, options);
1896
+ }
1897
+ function FromRegExpKey(key, type, options) {
1898
+ return RecordCreateFromPattern(key.source, type, options);
1899
+ }
1900
+ function FromStringKey(key, type, options) {
1901
+ const pattern = IsUndefined(key.pattern) ? PatternStringExact : key.pattern;
1902
+ return RecordCreateFromPattern(pattern, type, options);
1903
+ }
1904
+ function FromAnyKey(_, type, options) {
1905
+ return RecordCreateFromPattern(PatternStringExact, type, options);
1906
+ }
1907
+ function FromNeverKey(_key, type, options) {
1908
+ return RecordCreateFromPattern(PatternNeverExact, type, options);
1909
+ }
1910
+ function FromBooleanKey(_key, type, options) {
1911
+ return Object2({ true: type, false: type }, options);
1912
+ }
1913
+ function FromIntegerKey(_key, type, options) {
1914
+ return RecordCreateFromPattern(PatternNumberExact, type, options);
1915
+ }
1916
+ function FromNumberKey(_, type, options) {
1917
+ return RecordCreateFromPattern(PatternNumberExact, type, options);
1918
+ }
1919
+ function Record(key, type, options = {}) {
1920
+ return IsUnion(key) ? FromUnionKey(key.anyOf, type, options) : IsTemplateLiteral(key) ? FromTemplateLiteralKey(key, type, options) : IsLiteral(key) ? FromLiteralKey(key.const, type, options) : IsBoolean2(key) ? FromBooleanKey(key, type, options) : IsInteger(key) ? FromIntegerKey(key, type, options) : IsNumber3(key) ? FromNumberKey(key, type, options) : IsRegExp2(key) ? FromRegExpKey(key, type, options) : IsString2(key) ? FromStringKey(key, type, options) : IsAny(key) ? FromAnyKey(key, type, options) : IsNever(key) ? FromNeverKey(key, type, options) : Never(options);
1921
+ }
1922
+ function RecordPattern(record) {
1923
+ return globalThis.Object.getOwnPropertyNames(record.patternProperties)[0];
1924
+ }
1925
+ function RecordKey2(type) {
1926
+ const pattern = RecordPattern(type);
1927
+ return pattern === PatternStringExact ? String2() : pattern === PatternNumberExact ? Number2() : String2({ pattern });
1928
+ }
1929
+ function RecordValue2(type) {
1930
+ return type.patternProperties[RecordPattern(type)];
1931
+ }
1932
+
1933
+ // ../../node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.mjs
1934
+ function FromConstructor2(args, type) {
1935
+ type.parameters = FromTypes(args, type.parameters);
1936
+ type.returns = FromType(args, type.returns);
1937
+ return type;
1938
+ }
1939
+ function FromFunction2(args, type) {
1940
+ type.parameters = FromTypes(args, type.parameters);
1941
+ type.returns = FromType(args, type.returns);
1942
+ return type;
1943
+ }
1944
+ function FromIntersect5(args, type) {
1945
+ type.allOf = FromTypes(args, type.allOf);
1946
+ return type;
1947
+ }
1948
+ function FromUnion7(args, type) {
1949
+ type.anyOf = FromTypes(args, type.anyOf);
1950
+ return type;
1951
+ }
1952
+ function FromTuple4(args, type) {
1953
+ if (IsUndefined(type.items))
1954
+ return type;
1955
+ type.items = FromTypes(args, type.items);
1956
+ return type;
1957
+ }
1958
+ function FromArray5(args, type) {
1959
+ type.items = FromType(args, type.items);
1960
+ return type;
1961
+ }
1962
+ function FromAsyncIterator2(args, type) {
1963
+ type.items = FromType(args, type.items);
1964
+ return type;
1965
+ }
1966
+ function FromIterator2(args, type) {
1967
+ type.items = FromType(args, type.items);
1968
+ return type;
1969
+ }
1970
+ function FromPromise3(args, type) {
1971
+ type.item = FromType(args, type.item);
1972
+ return type;
1973
+ }
1974
+ function FromObject2(args, type) {
1975
+ const mappedProperties = FromProperties11(args, type.properties);
1976
+ return { ...type, ...Object2(mappedProperties) };
1977
+ }
1978
+ function FromRecord2(args, type) {
1979
+ const mappedKey = FromType(args, RecordKey2(type));
1980
+ const mappedValue = FromType(args, RecordValue2(type));
1981
+ const result = Record(mappedKey, mappedValue);
1982
+ return { ...type, ...result };
1983
+ }
1984
+ function FromArgument(args, argument) {
1985
+ return argument.index in args ? args[argument.index] : Unknown();
1986
+ }
1987
+ function FromProperty2(args, type) {
1988
+ const isReadonly = IsReadonly(type);
1989
+ const isOptional = IsOptional(type);
1990
+ const mapped = FromType(args, type);
1991
+ return isReadonly && isOptional ? ReadonlyOptional(mapped) : isReadonly && !isOptional ? Readonly(mapped) : !isReadonly && isOptional ? Optional(mapped) : mapped;
1992
+ }
1993
+ function FromProperties11(args, properties) {
1994
+ return globalThis.Object.getOwnPropertyNames(properties).reduce((result, key) => {
1995
+ return { ...result, [key]: FromProperty2(args, properties[key]) };
1996
+ }, {});
1997
+ }
1998
+ function FromTypes(args, types) {
1999
+ return types.map((type) => FromType(args, type));
2000
+ }
2001
+ function FromType(args, type) {
2002
+ return IsConstructor(type) ? FromConstructor2(args, type) : IsFunction2(type) ? FromFunction2(args, type) : IsIntersect(type) ? FromIntersect5(args, type) : IsUnion(type) ? FromUnion7(args, type) : IsTuple(type) ? FromTuple4(args, type) : IsArray3(type) ? FromArray5(args, type) : IsAsyncIterator2(type) ? FromAsyncIterator2(args, type) : IsIterator2(type) ? FromIterator2(args, type) : IsPromise(type) ? FromPromise3(args, type) : IsObject3(type) ? FromObject2(args, type) : IsRecord(type) ? FromRecord2(args, type) : IsArgument(type) ? FromArgument(args, type) : type;
2003
+ }
2004
+ function Instantiate(type, args) {
2005
+ return FromType(args, CloneType(type));
2006
+ }
2007
+
2008
+ // ../../node_modules/@sinclair/typebox/build/esm/type/integer/integer.mjs
2009
+ function Integer(options) {
2010
+ return CreateType({ [Kind]: "Integer", type: "integer" }, options);
2011
+ }
2012
+
2013
+ // ../../node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.mjs
2014
+ function MappedIntrinsicPropertyKey(K, M, options) {
2015
+ return {
2016
+ [K]: Intrinsic(Literal(K), M, Clone(options))
2017
+ };
2018
+ }
2019
+ function MappedIntrinsicPropertyKeys(K, M, options) {
2020
+ const result = K.reduce((Acc, L) => {
2021
+ return { ...Acc, ...MappedIntrinsicPropertyKey(L, M, options) };
2022
+ }, {});
2023
+ return result;
2024
+ }
2025
+ function MappedIntrinsicProperties(T, M, options) {
2026
+ return MappedIntrinsicPropertyKeys(T["keys"], M, options);
2027
+ }
2028
+ function IntrinsicFromMappedKey(T, M, options) {
2029
+ const P = MappedIntrinsicProperties(T, M, options);
2030
+ return MappedResult(P);
2031
+ }
2032
+
2033
+ // ../../node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic.mjs
2034
+ function ApplyUncapitalize(value) {
2035
+ const [first, rest] = [value.slice(0, 1), value.slice(1)];
2036
+ return [first.toLowerCase(), rest].join("");
2037
+ }
2038
+ function ApplyCapitalize(value) {
2039
+ const [first, rest] = [value.slice(0, 1), value.slice(1)];
2040
+ return [first.toUpperCase(), rest].join("");
2041
+ }
2042
+ function ApplyUppercase(value) {
2043
+ return value.toUpperCase();
2044
+ }
2045
+ function ApplyLowercase(value) {
2046
+ return value.toLowerCase();
2047
+ }
2048
+ function FromTemplateLiteral3(schema, mode, options) {
2049
+ const expression = TemplateLiteralParseExact(schema.pattern);
2050
+ const finite = IsTemplateLiteralExpressionFinite(expression);
2051
+ if (!finite)
2052
+ return { ...schema, pattern: FromLiteralValue(schema.pattern, mode) };
2053
+ const strings = [...TemplateLiteralExpressionGenerate(expression)];
2054
+ const literals = strings.map((value) => Literal(value));
2055
+ const mapped = FromRest5(literals, mode);
2056
+ const union = Union(mapped);
2057
+ return TemplateLiteral([union], options);
2058
+ }
2059
+ function FromLiteralValue(value, mode) {
2060
+ return typeof value === "string" ? mode === "Uncapitalize" ? ApplyUncapitalize(value) : mode === "Capitalize" ? ApplyCapitalize(value) : mode === "Uppercase" ? ApplyUppercase(value) : mode === "Lowercase" ? ApplyLowercase(value) : value : value.toString();
2061
+ }
2062
+ function FromRest5(T, M) {
2063
+ return T.map((L) => Intrinsic(L, M));
2064
+ }
2065
+ function Intrinsic(schema, mode, options = {}) {
2066
+ return (
2067
+ // Intrinsic-Mapped-Inference
2068
+ IsMappedKey(schema) ? IntrinsicFromMappedKey(schema, mode, options) : (
2069
+ // Standard-Inference
2070
+ IsTemplateLiteral(schema) ? FromTemplateLiteral3(schema, mode, options) : IsUnion(schema) ? Union(FromRest5(schema.anyOf, mode), options) : IsLiteral(schema) ? Literal(FromLiteralValue(schema.const, mode), options) : (
2071
+ // Default Type
2072
+ CreateType(schema, options)
2073
+ )
2074
+ )
2075
+ );
2076
+ }
2077
+
2078
+ // ../../node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.mjs
2079
+ function Capitalize(T, options = {}) {
2080
+ return Intrinsic(T, "Capitalize", options);
2081
+ }
2082
+
2083
+ // ../../node_modules/@sinclair/typebox/build/esm/type/intrinsic/lowercase.mjs
2084
+ function Lowercase(T, options = {}) {
2085
+ return Intrinsic(T, "Lowercase", options);
2086
+ }
2087
+
2088
+ // ../../node_modules/@sinclair/typebox/build/esm/type/intrinsic/uncapitalize.mjs
2089
+ function Uncapitalize(T, options = {}) {
2090
+ return Intrinsic(T, "Uncapitalize", options);
2091
+ }
2092
+
2093
+ // ../../node_modules/@sinclair/typebox/build/esm/type/intrinsic/uppercase.mjs
2094
+ function Uppercase(T, options = {}) {
2095
+ return Intrinsic(T, "Uppercase", options);
2096
+ }
2097
+
2098
+ // ../../node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.mjs
2099
+ function FromProperties12(properties, propertyKeys, options) {
2100
+ const result = {};
2101
+ for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
2102
+ result[K2] = Omit(properties[K2], propertyKeys, Clone(options));
2103
+ return result;
2104
+ }
2105
+ function FromMappedResult9(mappedResult, propertyKeys, options) {
2106
+ return FromProperties12(mappedResult.properties, propertyKeys, options);
2107
+ }
2108
+ function OmitFromMappedResult(mappedResult, propertyKeys, options) {
2109
+ const properties = FromMappedResult9(mappedResult, propertyKeys, options);
2110
+ return MappedResult(properties);
2111
+ }
2112
+
2113
+ // ../../node_modules/@sinclair/typebox/build/esm/type/omit/omit.mjs
2114
+ function FromIntersect6(types, propertyKeys) {
2115
+ return types.map((type) => OmitResolve(type, propertyKeys));
2116
+ }
2117
+ function FromUnion8(types, propertyKeys) {
2118
+ return types.map((type) => OmitResolve(type, propertyKeys));
2119
+ }
2120
+ function FromProperty3(properties, key) {
2121
+ const { [key]: _, ...R } = properties;
2122
+ return R;
2123
+ }
2124
+ function FromProperties13(properties, propertyKeys) {
2125
+ return propertyKeys.reduce((T, K2) => FromProperty3(T, K2), properties);
2126
+ }
2127
+ function FromObject3(type, propertyKeys, properties) {
2128
+ const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
2129
+ const mappedProperties = FromProperties13(properties, propertyKeys);
2130
+ return Object2(mappedProperties, options);
2131
+ }
2132
+ function UnionFromPropertyKeys(propertyKeys) {
2133
+ const result = propertyKeys.reduce((result2, key) => IsLiteralValue(key) ? [...result2, Literal(key)] : result2, []);
2134
+ return Union(result);
2135
+ }
2136
+ function OmitResolve(type, propertyKeys) {
2137
+ return IsIntersect(type) ? Intersect(FromIntersect6(type.allOf, propertyKeys)) : IsUnion(type) ? Union(FromUnion8(type.anyOf, propertyKeys)) : IsObject3(type) ? FromObject3(type, propertyKeys, type.properties) : Object2({});
2138
+ }
2139
+ function Omit(type, key, options) {
2140
+ const typeKey = IsArray(key) ? UnionFromPropertyKeys(key) : key;
2141
+ const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key;
2142
+ const isTypeRef = IsRef(type);
2143
+ const isKeyRef = IsRef(key);
2144
+ return IsMappedResult(type) ? OmitFromMappedResult(type, propertyKeys, options) : IsMappedKey(key) ? OmitFromMappedKey(type, key, options) : isTypeRef && isKeyRef ? Computed("Omit", [type, typeKey], options) : !isTypeRef && isKeyRef ? Computed("Omit", [type, typeKey], options) : isTypeRef && !isKeyRef ? Computed("Omit", [type, typeKey], options) : CreateType({ ...OmitResolve(type, propertyKeys), ...options });
2145
+ }
2146
+
2147
+ // ../../node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.mjs
2148
+ function FromPropertyKey2(type, key, options) {
2149
+ return { [key]: Omit(type, [key], Clone(options)) };
2150
+ }
2151
+ function FromPropertyKeys2(type, propertyKeys, options) {
2152
+ return propertyKeys.reduce((Acc, LK) => {
2153
+ return { ...Acc, ...FromPropertyKey2(type, LK, options) };
2154
+ }, {});
2155
+ }
2156
+ function FromMappedKey3(type, mappedKey, options) {
2157
+ return FromPropertyKeys2(type, mappedKey.keys, options);
2158
+ }
2159
+ function OmitFromMappedKey(type, mappedKey, options) {
2160
+ const properties = FromMappedKey3(type, mappedKey, options);
2161
+ return MappedResult(properties);
2162
+ }
2163
+
2164
+ // ../../node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.mjs
2165
+ function FromProperties14(properties, propertyKeys, options) {
2166
+ const result = {};
2167
+ for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
2168
+ result[K2] = Pick(properties[K2], propertyKeys, Clone(options));
2169
+ return result;
2170
+ }
2171
+ function FromMappedResult10(mappedResult, propertyKeys, options) {
2172
+ return FromProperties14(mappedResult.properties, propertyKeys, options);
2173
+ }
2174
+ function PickFromMappedResult(mappedResult, propertyKeys, options) {
2175
+ const properties = FromMappedResult10(mappedResult, propertyKeys, options);
2176
+ return MappedResult(properties);
2177
+ }
2178
+
2179
+ // ../../node_modules/@sinclair/typebox/build/esm/type/pick/pick.mjs
2180
+ function FromIntersect7(types, propertyKeys) {
2181
+ return types.map((type) => PickResolve(type, propertyKeys));
2182
+ }
2183
+ function FromUnion9(types, propertyKeys) {
2184
+ return types.map((type) => PickResolve(type, propertyKeys));
2185
+ }
2186
+ function FromProperties15(properties, propertyKeys) {
2187
+ const result = {};
2188
+ for (const K2 of propertyKeys)
2189
+ if (K2 in properties)
2190
+ result[K2] = properties[K2];
2191
+ return result;
2192
+ }
2193
+ function FromObject4(Type2, keys, properties) {
2194
+ const options = Discard(Type2, [TransformKind, "$id", "required", "properties"]);
2195
+ const mappedProperties = FromProperties15(properties, keys);
2196
+ return Object2(mappedProperties, options);
2197
+ }
2198
+ function UnionFromPropertyKeys2(propertyKeys) {
2199
+ const result = propertyKeys.reduce((result2, key) => IsLiteralValue(key) ? [...result2, Literal(key)] : result2, []);
2200
+ return Union(result);
2201
+ }
2202
+ function PickResolve(type, propertyKeys) {
2203
+ return IsIntersect(type) ? Intersect(FromIntersect7(type.allOf, propertyKeys)) : IsUnion(type) ? Union(FromUnion9(type.anyOf, propertyKeys)) : IsObject3(type) ? FromObject4(type, propertyKeys, type.properties) : Object2({});
2204
+ }
2205
+ function Pick(type, key, options) {
2206
+ const typeKey = IsArray(key) ? UnionFromPropertyKeys2(key) : key;
2207
+ const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key;
2208
+ const isTypeRef = IsRef(type);
2209
+ const isKeyRef = IsRef(key);
2210
+ return IsMappedResult(type) ? PickFromMappedResult(type, propertyKeys, options) : IsMappedKey(key) ? PickFromMappedKey(type, key, options) : isTypeRef && isKeyRef ? Computed("Pick", [type, typeKey], options) : !isTypeRef && isKeyRef ? Computed("Pick", [type, typeKey], options) : isTypeRef && !isKeyRef ? Computed("Pick", [type, typeKey], options) : CreateType({ ...PickResolve(type, propertyKeys), ...options });
2211
+ }
2212
+
2213
+ // ../../node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.mjs
2214
+ function FromPropertyKey3(type, key, options) {
2215
+ return {
2216
+ [key]: Pick(type, [key], Clone(options))
2217
+ };
2218
+ }
2219
+ function FromPropertyKeys3(type, propertyKeys, options) {
2220
+ return propertyKeys.reduce((result, leftKey) => {
2221
+ return { ...result, ...FromPropertyKey3(type, leftKey, options) };
2222
+ }, {});
2223
+ }
2224
+ function FromMappedKey4(type, mappedKey, options) {
2225
+ return FromPropertyKeys3(type, mappedKey.keys, options);
2226
+ }
2227
+ function PickFromMappedKey(type, mappedKey, options) {
2228
+ const properties = FromMappedKey4(type, mappedKey, options);
2229
+ return MappedResult(properties);
2230
+ }
2231
+
2232
+ // ../../node_modules/@sinclair/typebox/build/esm/type/partial/partial.mjs
2233
+ function FromComputed3(target, parameters) {
2234
+ return Computed("Partial", [Computed(target, parameters)]);
2235
+ }
2236
+ function FromRef3($ref) {
2237
+ return Computed("Partial", [Ref($ref)]);
2238
+ }
2239
+ function FromProperties16(properties) {
2240
+ const partialProperties = {};
2241
+ for (const K of globalThis.Object.getOwnPropertyNames(properties))
2242
+ partialProperties[K] = Optional(properties[K]);
2243
+ return partialProperties;
2244
+ }
2245
+ function FromObject5(type, properties) {
2246
+ const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
2247
+ const mappedProperties = FromProperties16(properties);
2248
+ return Object2(mappedProperties, options);
2249
+ }
2250
+ function FromRest6(types) {
2251
+ return types.map((type) => PartialResolve(type));
2252
+ }
2253
+ function PartialResolve(type) {
2254
+ return (
2255
+ // Mappable
2256
+ IsComputed(type) ? FromComputed3(type.target, type.parameters) : IsRef(type) ? FromRef3(type.$ref) : IsIntersect(type) ? Intersect(FromRest6(type.allOf)) : IsUnion(type) ? Union(FromRest6(type.anyOf)) : IsObject3(type) ? FromObject5(type, type.properties) : (
2257
+ // Intrinsic
2258
+ IsBigInt2(type) ? type : IsBoolean2(type) ? type : IsInteger(type) ? type : IsLiteral(type) ? type : IsNull2(type) ? type : IsNumber3(type) ? type : IsString2(type) ? type : IsSymbol2(type) ? type : IsUndefined3(type) ? type : (
2259
+ // Passthrough
2260
+ Object2({})
2261
+ )
2262
+ )
2263
+ );
2264
+ }
2265
+ function Partial(type, options) {
2266
+ if (IsMappedResult(type)) {
2267
+ return PartialFromMappedResult(type, options);
2268
+ } else {
2269
+ return CreateType({ ...PartialResolve(type), ...options });
2270
+ }
2271
+ }
2272
+
2273
+ // ../../node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.mjs
2274
+ function FromProperties17(K, options) {
2275
+ const Acc = {};
2276
+ for (const K2 of globalThis.Object.getOwnPropertyNames(K))
2277
+ Acc[K2] = Partial(K[K2], Clone(options));
2278
+ return Acc;
2279
+ }
2280
+ function FromMappedResult11(R, options) {
2281
+ return FromProperties17(R.properties, options);
2282
+ }
2283
+ function PartialFromMappedResult(R, options) {
2284
+ const P = FromMappedResult11(R, options);
2285
+ return MappedResult(P);
2286
+ }
2287
+
2288
+ // ../../node_modules/@sinclair/typebox/build/esm/type/required/required.mjs
2289
+ function FromComputed4(target, parameters) {
2290
+ return Computed("Required", [Computed(target, parameters)]);
2291
+ }
2292
+ function FromRef4($ref) {
2293
+ return Computed("Required", [Ref($ref)]);
2294
+ }
2295
+ function FromProperties18(properties) {
2296
+ const requiredProperties = {};
2297
+ for (const K of globalThis.Object.getOwnPropertyNames(properties))
2298
+ requiredProperties[K] = Discard(properties[K], [OptionalKind]);
2299
+ return requiredProperties;
2300
+ }
2301
+ function FromObject6(type, properties) {
2302
+ const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
2303
+ const mappedProperties = FromProperties18(properties);
2304
+ return Object2(mappedProperties, options);
2305
+ }
2306
+ function FromRest7(types) {
2307
+ return types.map((type) => RequiredResolve(type));
2308
+ }
2309
+ function RequiredResolve(type) {
2310
+ return (
2311
+ // Mappable
2312
+ IsComputed(type) ? FromComputed4(type.target, type.parameters) : IsRef(type) ? FromRef4(type.$ref) : IsIntersect(type) ? Intersect(FromRest7(type.allOf)) : IsUnion(type) ? Union(FromRest7(type.anyOf)) : IsObject3(type) ? FromObject6(type, type.properties) : (
2313
+ // Intrinsic
2314
+ IsBigInt2(type) ? type : IsBoolean2(type) ? type : IsInteger(type) ? type : IsLiteral(type) ? type : IsNull2(type) ? type : IsNumber3(type) ? type : IsString2(type) ? type : IsSymbol2(type) ? type : IsUndefined3(type) ? type : (
2315
+ // Passthrough
2316
+ Object2({})
2317
+ )
2318
+ )
2319
+ );
2320
+ }
2321
+ function Required(type, options) {
2322
+ if (IsMappedResult(type)) {
2323
+ return RequiredFromMappedResult(type, options);
2324
+ } else {
2325
+ return CreateType({ ...RequiredResolve(type), ...options });
2326
+ }
2327
+ }
2328
+
2329
+ // ../../node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.mjs
2330
+ function FromProperties19(P, options) {
2331
+ const Acc = {};
2332
+ for (const K2 of globalThis.Object.getOwnPropertyNames(P))
2333
+ Acc[K2] = Required(P[K2], options);
2334
+ return Acc;
2335
+ }
2336
+ function FromMappedResult12(R, options) {
2337
+ return FromProperties19(R.properties, options);
2338
+ }
2339
+ function RequiredFromMappedResult(R, options) {
2340
+ const P = FromMappedResult12(R, options);
2341
+ return MappedResult(P);
2342
+ }
2343
+
2344
+ // ../../node_modules/@sinclair/typebox/build/esm/type/module/compute.mjs
2345
+ function DereferenceParameters(moduleProperties, types) {
2346
+ return types.map((type) => {
2347
+ return IsRef(type) ? Dereference(moduleProperties, type.$ref) : FromType2(moduleProperties, type);
2348
+ });
2349
+ }
2350
+ function Dereference(moduleProperties, ref) {
2351
+ return ref in moduleProperties ? IsRef(moduleProperties[ref]) ? Dereference(moduleProperties, moduleProperties[ref].$ref) : FromType2(moduleProperties, moduleProperties[ref]) : Never();
2352
+ }
2353
+ function FromAwaited(parameters) {
2354
+ return Awaited(parameters[0]);
2355
+ }
2356
+ function FromIndex(parameters) {
2357
+ return Index(parameters[0], parameters[1]);
2358
+ }
2359
+ function FromKeyOf(parameters) {
2360
+ return KeyOf(parameters[0]);
2361
+ }
2362
+ function FromPartial(parameters) {
2363
+ return Partial(parameters[0]);
2364
+ }
2365
+ function FromOmit(parameters) {
2366
+ return Omit(parameters[0], parameters[1]);
2367
+ }
2368
+ function FromPick(parameters) {
2369
+ return Pick(parameters[0], parameters[1]);
2370
+ }
2371
+ function FromRequired(parameters) {
2372
+ return Required(parameters[0]);
2373
+ }
2374
+ function FromComputed5(moduleProperties, target, parameters) {
2375
+ const dereferenced = DereferenceParameters(moduleProperties, parameters);
2376
+ return target === "Awaited" ? FromAwaited(dereferenced) : target === "Index" ? FromIndex(dereferenced) : target === "KeyOf" ? FromKeyOf(dereferenced) : target === "Partial" ? FromPartial(dereferenced) : target === "Omit" ? FromOmit(dereferenced) : target === "Pick" ? FromPick(dereferenced) : target === "Required" ? FromRequired(dereferenced) : Never();
2377
+ }
2378
+ function FromArray6(moduleProperties, type) {
2379
+ return Array2(FromType2(moduleProperties, type));
2380
+ }
2381
+ function FromAsyncIterator3(moduleProperties, type) {
2382
+ return AsyncIterator(FromType2(moduleProperties, type));
2383
+ }
2384
+ function FromConstructor3(moduleProperties, parameters, instanceType) {
2385
+ return Constructor(FromTypes2(moduleProperties, parameters), FromType2(moduleProperties, instanceType));
2386
+ }
2387
+ function FromFunction3(moduleProperties, parameters, returnType) {
2388
+ return Function(FromTypes2(moduleProperties, parameters), FromType2(moduleProperties, returnType));
2389
+ }
2390
+ function FromIntersect8(moduleProperties, types) {
2391
+ return Intersect(FromTypes2(moduleProperties, types));
2392
+ }
2393
+ function FromIterator3(moduleProperties, type) {
2394
+ return Iterator(FromType2(moduleProperties, type));
2395
+ }
2396
+ function FromObject7(moduleProperties, properties) {
2397
+ return Object2(globalThis.Object.keys(properties).reduce((result, key) => {
2398
+ return { ...result, [key]: FromType2(moduleProperties, properties[key]) };
2399
+ }, {}));
2400
+ }
2401
+ function FromRecord3(moduleProperties, type) {
2402
+ const [value, pattern] = [FromType2(moduleProperties, RecordValue2(type)), RecordPattern(type)];
2403
+ const result = CloneType(type);
2404
+ result.patternProperties[pattern] = value;
2405
+ return result;
2406
+ }
2407
+ function FromTransform(moduleProperties, transform) {
2408
+ return IsRef(transform) ? { ...Dereference(moduleProperties, transform.$ref), [TransformKind]: transform[TransformKind] } : transform;
2409
+ }
2410
+ function FromTuple5(moduleProperties, types) {
2411
+ return Tuple(FromTypes2(moduleProperties, types));
2412
+ }
2413
+ function FromUnion10(moduleProperties, types) {
2414
+ return Union(FromTypes2(moduleProperties, types));
2415
+ }
2416
+ function FromTypes2(moduleProperties, types) {
2417
+ return types.map((type) => FromType2(moduleProperties, type));
2418
+ }
2419
+ function FromType2(moduleProperties, type) {
2420
+ return (
2421
+ // Modifiers
2422
+ IsOptional(type) ? CreateType(FromType2(moduleProperties, Discard(type, [OptionalKind])), type) : IsReadonly(type) ? CreateType(FromType2(moduleProperties, Discard(type, [ReadonlyKind])), type) : (
2423
+ // Transform
2424
+ IsTransform(type) ? CreateType(FromTransform(moduleProperties, type), type) : (
2425
+ // Types
2426
+ IsArray3(type) ? CreateType(FromArray6(moduleProperties, type.items), type) : IsAsyncIterator2(type) ? CreateType(FromAsyncIterator3(moduleProperties, type.items), type) : IsComputed(type) ? CreateType(FromComputed5(moduleProperties, type.target, type.parameters)) : IsConstructor(type) ? CreateType(FromConstructor3(moduleProperties, type.parameters, type.returns), type) : IsFunction2(type) ? CreateType(FromFunction3(moduleProperties, type.parameters, type.returns), type) : IsIntersect(type) ? CreateType(FromIntersect8(moduleProperties, type.allOf), type) : IsIterator2(type) ? CreateType(FromIterator3(moduleProperties, type.items), type) : IsObject3(type) ? CreateType(FromObject7(moduleProperties, type.properties), type) : IsRecord(type) ? CreateType(FromRecord3(moduleProperties, type)) : IsTuple(type) ? CreateType(FromTuple5(moduleProperties, type.items || []), type) : IsUnion(type) ? CreateType(FromUnion10(moduleProperties, type.anyOf), type) : type
2427
+ )
2428
+ )
2429
+ );
2430
+ }
2431
+ function ComputeType(moduleProperties, key) {
2432
+ return key in moduleProperties ? FromType2(moduleProperties, moduleProperties[key]) : Never();
2433
+ }
2434
+ function ComputeModuleProperties(moduleProperties) {
2435
+ return globalThis.Object.getOwnPropertyNames(moduleProperties).reduce((result, key) => {
2436
+ return { ...result, [key]: ComputeType(moduleProperties, key) };
2437
+ }, {});
2438
+ }
2439
+
2440
+ // ../../node_modules/@sinclair/typebox/build/esm/type/module/module.mjs
2441
+ var TModule = class {
2442
+ constructor($defs) {
2443
+ const computed = ComputeModuleProperties($defs);
2444
+ const identified = this.WithIdentifiers(computed);
2445
+ this.$defs = identified;
2446
+ }
2447
+ /** `[Json]` Imports a Type by Key. */
2448
+ Import(key, options) {
2449
+ const $defs = { ...this.$defs, [key]: CreateType(this.$defs[key], options) };
2450
+ return CreateType({ [Kind]: "Import", $defs, $ref: key });
2451
+ }
2452
+ // prettier-ignore
2453
+ WithIdentifiers($defs) {
2454
+ return globalThis.Object.getOwnPropertyNames($defs).reduce((result, key) => {
2455
+ return { ...result, [key]: { ...$defs[key], $id: key } };
2456
+ }, {});
2457
+ }
2458
+ };
2459
+ function Module(properties) {
2460
+ return new TModule(properties);
2461
+ }
2462
+
2463
+ // ../../node_modules/@sinclair/typebox/build/esm/type/not/not.mjs
2464
+ function Not(type, options) {
2465
+ return CreateType({ [Kind]: "Not", not: type }, options);
2466
+ }
2467
+
2468
+ // ../../node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.mjs
2469
+ function Parameters(schema, options) {
2470
+ return IsFunction2(schema) ? Tuple(schema.parameters, options) : Never();
2471
+ }
2472
+
2473
+ // ../../node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.mjs
2474
+ var Ordinal = 0;
2475
+ function Recursive(callback, options = {}) {
2476
+ if (IsUndefined(options.$id))
2477
+ options.$id = `T${Ordinal++}`;
2478
+ const thisType = CloneType(callback({ [Kind]: "This", $ref: `${options.$id}` }));
2479
+ thisType.$id = options.$id;
2480
+ return CreateType({ [Hint]: "Recursive", ...thisType }, options);
2481
+ }
2482
+
2483
+ // ../../node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.mjs
2484
+ function RegExp2(unresolved, options) {
2485
+ const expr = IsString(unresolved) ? new globalThis.RegExp(unresolved) : unresolved;
2486
+ return CreateType({ [Kind]: "RegExp", type: "RegExp", source: expr.source, flags: expr.flags }, options);
2487
+ }
2488
+
2489
+ // ../../node_modules/@sinclair/typebox/build/esm/type/rest/rest.mjs
2490
+ function RestResolve(T) {
2491
+ return IsIntersect(T) ? T.allOf : IsUnion(T) ? T.anyOf : IsTuple(T) ? T.items ?? [] : [];
2492
+ }
2493
+ function Rest(T) {
2494
+ return RestResolve(T);
2495
+ }
2496
+
2497
+ // ../../node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.mjs
2498
+ function ReturnType(schema, options) {
2499
+ return IsFunction2(schema) ? CreateType(schema.returns, options) : Never(options);
2500
+ }
2501
+
2502
+ // ../../node_modules/@sinclair/typebox/build/esm/type/transform/transform.mjs
2503
+ var TransformDecodeBuilder = class {
2504
+ constructor(schema) {
2505
+ this.schema = schema;
2506
+ }
2507
+ Decode(decode) {
2508
+ return new TransformEncodeBuilder(this.schema, decode);
2509
+ }
2510
+ };
2511
+ var TransformEncodeBuilder = class {
2512
+ constructor(schema, decode) {
2513
+ this.schema = schema;
2514
+ this.decode = decode;
2515
+ }
2516
+ EncodeTransform(encode, schema) {
2517
+ const Encode = (value) => schema[TransformKind].Encode(encode(value));
2518
+ const Decode = (value) => this.decode(schema[TransformKind].Decode(value));
2519
+ const Codec = { Encode, Decode };
2520
+ return { ...schema, [TransformKind]: Codec };
2521
+ }
2522
+ EncodeSchema(encode, schema) {
2523
+ const Codec = { Decode: this.decode, Encode: encode };
2524
+ return { ...schema, [TransformKind]: Codec };
2525
+ }
2526
+ Encode(encode) {
2527
+ return IsTransform(this.schema) ? this.EncodeTransform(encode, this.schema) : this.EncodeSchema(encode, this.schema);
2528
+ }
2529
+ };
2530
+ function Transform(schema) {
2531
+ return new TransformDecodeBuilder(schema);
2532
+ }
2533
+
2534
+ // ../../node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.mjs
2535
+ function Unsafe(options = {}) {
2536
+ return CreateType({ [Kind]: options[Kind] ?? "Unsafe" }, options);
2537
+ }
2538
+
2539
+ // ../../node_modules/@sinclair/typebox/build/esm/type/void/void.mjs
2540
+ function Void(options) {
2541
+ return CreateType({ [Kind]: "Void", type: "void" }, options);
2542
+ }
2543
+
2544
+ // ../../node_modules/@sinclair/typebox/build/esm/type/type/type.mjs
2545
+ var type_exports2 = {};
2546
+ __export(type_exports2, {
2547
+ Any: () => Any,
2548
+ Argument: () => Argument,
2549
+ Array: () => Array2,
2550
+ AsyncIterator: () => AsyncIterator,
2551
+ Awaited: () => Awaited,
2552
+ BigInt: () => BigInt,
2553
+ Boolean: () => Boolean,
2554
+ Capitalize: () => Capitalize,
2555
+ Composite: () => Composite,
2556
+ Const: () => Const,
2557
+ Constructor: () => Constructor,
2558
+ ConstructorParameters: () => ConstructorParameters,
2559
+ Date: () => Date2,
2560
+ Enum: () => Enum,
2561
+ Exclude: () => Exclude,
2562
+ Extends: () => Extends,
2563
+ Extract: () => Extract,
2564
+ Function: () => Function,
2565
+ Index: () => Index,
2566
+ InstanceType: () => InstanceType,
2567
+ Instantiate: () => Instantiate,
2568
+ Integer: () => Integer,
2569
+ Intersect: () => Intersect,
2570
+ Iterator: () => Iterator,
2571
+ KeyOf: () => KeyOf,
2572
+ Literal: () => Literal,
2573
+ Lowercase: () => Lowercase,
2574
+ Mapped: () => Mapped,
2575
+ Module: () => Module,
2576
+ Never: () => Never,
2577
+ Not: () => Not,
2578
+ Null: () => Null,
2579
+ Number: () => Number2,
2580
+ Object: () => Object2,
2581
+ Omit: () => Omit,
2582
+ Optional: () => Optional,
2583
+ Parameters: () => Parameters,
2584
+ Partial: () => Partial,
2585
+ Pick: () => Pick,
2586
+ Promise: () => Promise2,
2587
+ Readonly: () => Readonly,
2588
+ ReadonlyOptional: () => ReadonlyOptional,
2589
+ Record: () => Record,
2590
+ Recursive: () => Recursive,
2591
+ Ref: () => Ref,
2592
+ RegExp: () => RegExp2,
2593
+ Required: () => Required,
2594
+ Rest: () => Rest,
2595
+ ReturnType: () => ReturnType,
2596
+ String: () => String2,
2597
+ Symbol: () => Symbol2,
2598
+ TemplateLiteral: () => TemplateLiteral,
2599
+ Transform: () => Transform,
2600
+ Tuple: () => Tuple,
2601
+ Uint8Array: () => Uint8Array2,
2602
+ Uncapitalize: () => Uncapitalize,
2603
+ Undefined: () => Undefined,
2604
+ Union: () => Union,
2605
+ Unknown: () => Unknown,
2606
+ Unsafe: () => Unsafe,
2607
+ Uppercase: () => Uppercase,
2608
+ Void: () => Void
2609
+ });
2610
+
2611
+ // ../../node_modules/@sinclair/typebox/build/esm/type/type/index.mjs
2612
+ var Type = type_exports2;
2613
+
2614
+ // builtin/extensions/ask-user/index.ts
2615
+ var AskUserParams = Type.Object({
2616
+ question: Type.String({
2617
+ description: "REQUIRED: The question text to ask the user"
2618
+ }),
2619
+ options: Type.Optional(Type.Array(
2620
+ Type.String({ description: "An option label" }),
2621
+ { description: "Predefined options. If provided, user selects from list with 'Other' option appended. If omitted, shows input field." }
2622
+ )),
2623
+ allowOther: Type.Optional(Type.Boolean({
2624
+ description: "Whether to show 'Other' option (default: true when options provided)",
2625
+ default: true
2626
+ })),
2627
+ allowBack: Type.Optional(Type.Boolean({
2628
+ description: "Whether to allow going back (adds '\u2190 Back' option)",
2629
+ default: false
2630
+ })),
2631
+ placeholder: Type.Optional(Type.String({
2632
+ description: "Placeholder text for input field (when user selects 'Other' or open-ended)"
2633
+ }))
2634
+ });
2635
+ var AskUserMultiParams = Type.Object({
2636
+ questions: Type.Array(
2637
+ Type.Object({
2638
+ id: Type.String({ description: "Question identifier" }),
2639
+ question: Type.String({ description: "Question text" }),
2640
+ options: Type.Optional(Type.Array(Type.String())),
2641
+ allowOther: Type.Optional(Type.Boolean()),
2642
+ placeholder: Type.Optional(Type.String())
2643
+ }),
2644
+ { description: "Array of questions to ask sequentially" }
2645
+ ),
2646
+ allowReview: Type.Optional(Type.Boolean({
2647
+ description: "Allow user to review and modify answers at the end",
2648
+ default: true
2649
+ }))
2650
+ });
2651
+ function askUserExtension(ctx) {
2652
+ ctx.log("Ask user extension loaded");
2653
+ async function askSingleQuestion(args) {
2654
+ const { question, options, allowOther = true, allowBack = false, allowReview = false, placeholder } = args;
2655
+ if (!question || typeof question !== "string") {
2656
+ return {
2657
+ content: [{ type: "text", text: "Error: 'question' parameter is required" }],
2658
+ isError: true
2659
+ };
2660
+ }
2661
+ if (!ctx.hasUI) {
2662
+ const opts = options || [];
2663
+ const otherText = allowOther && options ? " / Other" : "";
2664
+ const text = opts.length > 0 ? `${question}
2665
+ Options: ${opts.join(", ")}${otherText}
2666
+
2667
+ Please reply with your choice.` : `${question}
2668
+
2669
+ Please reply with your answer.`;
2670
+ return { content: [{ type: "text", text }], isError: false };
2671
+ }
2672
+ if (!options || options.length === 0) {
2673
+ const answer = await ctx.ui.input(question, placeholder || "Type your answer...");
2674
+ if (answer === void 0) {
2675
+ return { content: [{ type: "text", text: "User cancelled" }], details: { cancelled: true } };
2676
+ }
2677
+ return {
2678
+ content: [{ type: "text", text: answer }],
2679
+ details: { answer, cancelled: false }
2680
+ };
2681
+ }
2682
+ let displayOptions = [...options];
2683
+ if (allowOther !== false) {
2684
+ displayOptions.push("\u270F\uFE0F Other (type your own)");
2685
+ }
2686
+ if (allowBack) {
2687
+ displayOptions.push("\u2190 Back");
2688
+ }
2689
+ if (allowReview) {
2690
+ displayOptions.push("\u2630 Review all answers");
2691
+ }
2692
+ const optionLabels = displayOptions.map(
2693
+ (opt, idx) => `${String.fromCharCode(65 + idx)}. ${opt}`
2694
+ );
2695
+ const selection = await ctx.ui.select(question, optionLabels);
2696
+ if (selection === void 0) {
2697
+ return { content: [{ type: "text", text: "User cancelled" }], details: { cancelled: true } };
2698
+ }
2699
+ const selectedIndex = optionLabels.indexOf(selection);
2700
+ const selectedValue = displayOptions[selectedIndex];
2701
+ if (selectedValue === "\u2190 Back") {
2702
+ return { content: [{ type: "text", text: "BACK" }], details: { goBack: true, cancelled: false } };
2703
+ }
2704
+ if (selectedValue === "\u2630 Review all answers") {
2705
+ return { content: [{ type: "text", text: "REVIEW" }], details: { goReview: true, cancelled: false } };
2706
+ }
2707
+ if (selectedValue === "\u270F\uFE0F Other (type your own)") {
2708
+ const customAnswer = await ctx.ui.input(`${question} (Other)`, placeholder || "Please specify...");
2709
+ if (customAnswer === void 0) {
2710
+ return { content: [{ type: "text", text: "User cancelled" }], details: { cancelled: true } };
2711
+ }
2712
+ return {
2713
+ content: [{ type: "text", text: `Other: ${customAnswer}` }],
2714
+ details: { answer: customAnswer, isOther: true, cancelled: false }
2715
+ };
2716
+ }
2717
+ return {
2718
+ content: [{ type: "text", text: `${String.fromCharCode(65 + selectedIndex)}. ${selectedValue}` }],
2719
+ details: {
2720
+ answer: selectedValue,
2721
+ selectedIndex,
2722
+ isOther: false,
2723
+ cancelled: false
2724
+ }
2725
+ };
2726
+ }
2727
+ ctx.registerTool({
2728
+ name: "ask_user",
2729
+ label: "Ask User",
2730
+ description: `Ask the user a single question and get their answer.
2731
+
2732
+ \u26A0\uFE0F IMPORTANT: Always provide 'options' unless you truly need free-form text input.
2733
+ Providing options makes it easier for users to answer and allows "Other" fallback.
2734
+
2735
+ FEATURES:
2736
+ - Multiple-choice: User selects from predefined options (RECOMMENDED)
2737
+ - "Other" option: Always auto-added (unless allowOther=false), lets user type custom answer
2738
+ - Open-ended: Omit 'options' only for truly open questions (e.g., "What is your name?")
2739
+ - Back navigation: Set allowBack=true to add "\u2190 Back" option
2740
+
2741
+ BEST PRACTICES:
2742
+ 1. Provide 2-5 relevant options for most questions
2743
+ 2. Users can always pick "\u270F\uFE0F Other" to give a different answer
2744
+ 3. Only use open-ended (no options) for: names, descriptions, unique IDs, etc.
2745
+
2746
+ EXAMPLES:
2747
+
2748
+ \u2705 GOOD - With options + Other:
2749
+ {"question": "What do you want to do?", "options": ["Write code", "Debug", "Learn", "Review"]}
2750
+ \u2192 Shows: A. Write code, B. Debug, C. Learn, D. Review, E. \u270F\uFE0F Other
2751
+
2752
+ \u2705 GOOD - Yes/No:
2753
+ {"question": "Should I proceed?", "options": ["Yes", "No"], "allowOther": false}
2754
+
2755
+ \u26A0\uFE0F ONLY for truly open questions:
2756
+ {"question": "What is your project name?", "placeholder": "my-project"}
2757
+
2758
+ \u274C AVOID - No options when choices exist:
2759
+ {"question": "Which language?"} // Instead, provide ["Python", "JS", "Go"] options`,
2760
+ parameters: AskUserParams,
2761
+ async execute(args) {
2762
+ ctx.log(`[ask_user] Called: ${JSON.stringify(args)}`);
2763
+ return askSingleQuestion(args);
2764
+ }
2765
+ });
2766
+ ctx.registerTool({
2767
+ name: "ask_user_multi",
2768
+ label: "Ask Multiple Questions",
2769
+ description: `Ask multiple questions with "anytime review" - users can jump to review mode at any time.
2770
+
2771
+ \u26A0\uFE0F IMPORTANT: Provide 'options' for each question unless you truly need open-ended input.
2772
+
2773
+ FEATURES:
2774
+ - \u2630 "Review all answers" option on EVERY question (after answering at least 1)
2775
+ - Progress indicator: "1/3: Question?"
2776
+ - Auto "\u270F\uFE0F Other" option (unless allowOther=false)
2777
+ - "\u2190 Back" to return to previous question
2778
+ - Review screen shows all answers with current values
2779
+ - Click any answer in review to edit it
2780
+
2781
+ NAVIGATION:
2782
+ - Normal: Answer \u2192 Next question
2783
+ - Back: Select "\u2190 Back" to go to previous question
2784
+ - Review anytime: Select "\u2630 Review all answers" to see/edit all answers
2785
+ - In review: Click any Q to edit, or Confirm to finish
2786
+
2787
+ WHEN TO USE:
2788
+ - Wizard-style flows where users might change their minds
2789
+ - When you need 2+ pieces of information
2790
+ - When users should be able to review before finalizing
2791
+
2792
+ EXAMPLE:
2793
+ {
2794
+ "questions": [
2795
+ {"id": "goal", "question": "What do you want to do?", "options": ["Code", "Debug", "Learn", "Review"]},
2796
+ {"id": "lang", "question": "Which language?", "options": ["Python", "JS", "Go", "Rust"]},
2797
+ {"id": "confirm", "question": "Ready?", "options": ["Yes", "No - let me change"], "allowOther": false}
2798
+ ]
2799
+ }
2800
+
2801
+ USER EXPERIENCE:
2802
+ - Q1 shows: A-D (options), E. \u270F\uFE0F Other, F. \u2190 Back
2803
+ - After Q1 answered, Q2 shows: A-D (options), E. \u270F\uFE0F Other, F. \u2190 Back, G. \u2630 Review all answers
2804
+ - User can pick G anytime to jump to review and edit any previous answer
2805
+
2806
+ RETURNS: All answers keyed by question id`,
2807
+ parameters: AskUserMultiParams,
2808
+ async execute(args) {
2809
+ ctx.log(`[ask_user_multi] Called: ${JSON.stringify(args)}`);
2810
+ const { questions, allowReview = true } = args;
2811
+ if (!Array.isArray(questions) || questions.length === 0) {
2812
+ return {
2813
+ content: [{ type: "text", text: "Error: 'questions' must be a non-empty array" }],
2814
+ isError: true
2815
+ };
2816
+ }
2817
+ if (!ctx.hasUI) {
2818
+ const text = questions.map((q, i) => `${i + 1}. ${q.question}`).join("\n");
2819
+ return {
2820
+ content: [{ type: "text", text: `Please answer these questions:
2821
+
2822
+ ${text}` }],
2823
+ isError: false
2824
+ };
2825
+ }
2826
+ const answers = {};
2827
+ let currentIndex = 0;
2828
+ while (currentIndex < questions.length) {
2829
+ const q = questions[currentIndex];
2830
+ const result = await askSingleQuestion({
2831
+ question: `${currentIndex + 1}/${questions.length}: ${q.question}`,
2832
+ options: q.options,
2833
+ allowOther: q.allowOther,
2834
+ allowBack: currentIndex > 0,
2835
+ // Allow back if not first question
2836
+ allowReview: allowReview && Object.keys(answers).length > 0,
2837
+ // Allow review if we have answers
2838
+ placeholder: q.placeholder
2839
+ });
2840
+ if (result.details?.cancelled) {
2841
+ return { content: [{ type: "text", text: "User cancelled" }], details: { cancelled: true } };
2842
+ }
2843
+ if (result.details?.goBack) {
2844
+ currentIndex = Math.max(0, currentIndex - 1);
2845
+ delete answers[questions[currentIndex].id];
2846
+ continue;
2847
+ }
2848
+ if (result.details?.goReview) {
2849
+ break;
2850
+ }
2851
+ answers[q.id] = {
2852
+ question: q.question,
2853
+ answer: result.details?.answer || result.content[0].text,
2854
+ ...result.details
2855
+ };
2856
+ currentIndex++;
2857
+ }
2858
+ if (allowReview && Object.keys(answers).length > 0) {
2859
+ while (true) {
2860
+ const reviewOptions = [
2861
+ "\u2713 Confirm and continue",
2862
+ ...questions.map((q, i) => {
2863
+ const ans = answers[q.id]?.answer || "(not answered)";
2864
+ const displayAns = ans.length > 20 ? ans.substring(0, 20) + "..." : ans;
2865
+ return `\u270F\uFE0F Q${i + 1}: ${displayAns}`;
2866
+ }),
2867
+ "\u21BA Restart all"
2868
+ ];
2869
+ const reviewLabel = reviewOptions.map(
2870
+ (opt, idx) => `${String.fromCharCode(65 + idx)}. ${opt}`
2871
+ );
2872
+ const reviewSelection = await ctx.ui.select("\u2630 Review your answers (select to edit):", reviewLabel);
2873
+ if (reviewSelection === void 0) {
2874
+ return { content: [{ type: "text", text: "User cancelled during review" }], details: { cancelled: true } };
2875
+ }
2876
+ const reviewIndex = reviewLabel.indexOf(reviewSelection);
2877
+ if (reviewIndex === 0) {
2878
+ break;
2879
+ } else if (reviewIndex === reviewOptions.length - 1) {
2880
+ Object.keys(answers).forEach((key) => delete answers[key]);
2881
+ currentIndex = 0;
2882
+ break;
2883
+ } else {
2884
+ const questionIndex = reviewIndex - 1;
2885
+ const q = questions[questionIndex];
2886
+ const result = await askSingleQuestion({
2887
+ question: `\u270F\uFE0F Edit Q${questionIndex + 1}/${questions.length}: ${q.question}`,
2888
+ options: q.options,
2889
+ allowOther: q.allowOther,
2890
+ allowBack: questionIndex > 0,
2891
+ allowReview: true,
2892
+ placeholder: q.placeholder
2893
+ });
2894
+ if (result.details?.cancelled) {
2895
+ return { content: [{ type: "text", text: "User cancelled" }], details: { cancelled: true } };
2896
+ }
2897
+ if (result.details?.goBack && questionIndex > 0) {
2898
+ delete answers[q.id];
2899
+ currentIndex = questionIndex - 1;
2900
+ break;
2901
+ }
2902
+ if (result.details?.goReview) {
2903
+ continue;
2904
+ }
2905
+ answers[q.id] = {
2906
+ question: q.question,
2907
+ answer: result.details?.answer || result.content[0].text,
2908
+ ...result.details
2909
+ };
2910
+ }
2911
+ }
2912
+ }
2913
+ const summary = Object.entries(answers).map(([id, data]) => `${id}: ${data.answer}`).join("\n");
2914
+ return {
2915
+ content: [{ type: "text", text: summary }],
2916
+ details: { answers, cancelled: false }
2917
+ };
2918
+ }
2919
+ });
2920
+ ctx.ui.notify("\u{1F4AC} Ask user extension loaded (v2 with Other/Back/Multi)", "info");
2921
+ }
2922
+ export {
2923
+ askUserExtension as default
2924
+ };