@remnic/plugin-openclaw 9.3.542 → 9.3.544

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