@digitalforgestudios/openclaw-sulcus 6.6.2 → 6.6.3
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/index.js +2739 -134
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -38,7 +37,2614 @@ var import_node_fs = require("node:fs");
|
|
|
38
37
|
var https = __toESM(require("node:https"));
|
|
39
38
|
var http = __toESM(require("node:http"));
|
|
40
39
|
var import_node_url = require("node:url");
|
|
41
|
-
|
|
40
|
+
|
|
41
|
+
// node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
42
|
+
var value_exports = {};
|
|
43
|
+
__export(value_exports, {
|
|
44
|
+
HasPropertyKey: () => HasPropertyKey,
|
|
45
|
+
IsArray: () => IsArray,
|
|
46
|
+
IsAsyncIterator: () => IsAsyncIterator,
|
|
47
|
+
IsBigInt: () => IsBigInt,
|
|
48
|
+
IsBoolean: () => IsBoolean,
|
|
49
|
+
IsDate: () => IsDate,
|
|
50
|
+
IsFunction: () => IsFunction,
|
|
51
|
+
IsIterator: () => IsIterator,
|
|
52
|
+
IsNull: () => IsNull,
|
|
53
|
+
IsNumber: () => IsNumber,
|
|
54
|
+
IsObject: () => IsObject,
|
|
55
|
+
IsRegExp: () => IsRegExp,
|
|
56
|
+
IsString: () => IsString,
|
|
57
|
+
IsSymbol: () => IsSymbol,
|
|
58
|
+
IsUint8Array: () => IsUint8Array,
|
|
59
|
+
IsUndefined: () => IsUndefined
|
|
60
|
+
});
|
|
61
|
+
function HasPropertyKey(value, key) {
|
|
62
|
+
return key in value;
|
|
63
|
+
}
|
|
64
|
+
function IsAsyncIterator(value) {
|
|
65
|
+
return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.asyncIterator in value;
|
|
66
|
+
}
|
|
67
|
+
function IsArray(value) {
|
|
68
|
+
return Array.isArray(value);
|
|
69
|
+
}
|
|
70
|
+
function IsBigInt(value) {
|
|
71
|
+
return typeof value === "bigint";
|
|
72
|
+
}
|
|
73
|
+
function IsBoolean(value) {
|
|
74
|
+
return typeof value === "boolean";
|
|
75
|
+
}
|
|
76
|
+
function IsDate(value) {
|
|
77
|
+
return value instanceof globalThis.Date;
|
|
78
|
+
}
|
|
79
|
+
function IsFunction(value) {
|
|
80
|
+
return typeof value === "function";
|
|
81
|
+
}
|
|
82
|
+
function IsIterator(value) {
|
|
83
|
+
return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.iterator in value;
|
|
84
|
+
}
|
|
85
|
+
function IsNull(value) {
|
|
86
|
+
return value === null;
|
|
87
|
+
}
|
|
88
|
+
function IsNumber(value) {
|
|
89
|
+
return typeof value === "number";
|
|
90
|
+
}
|
|
91
|
+
function IsObject(value) {
|
|
92
|
+
return typeof value === "object" && value !== null;
|
|
93
|
+
}
|
|
94
|
+
function IsRegExp(value) {
|
|
95
|
+
return value instanceof globalThis.RegExp;
|
|
96
|
+
}
|
|
97
|
+
function IsString(value) {
|
|
98
|
+
return typeof value === "string";
|
|
99
|
+
}
|
|
100
|
+
function IsSymbol(value) {
|
|
101
|
+
return typeof value === "symbol";
|
|
102
|
+
}
|
|
103
|
+
function IsUint8Array(value) {
|
|
104
|
+
return value instanceof globalThis.Uint8Array;
|
|
105
|
+
}
|
|
106
|
+
function IsUndefined(value) {
|
|
107
|
+
return value === void 0;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// node_modules/@sinclair/typebox/build/esm/type/clone/value.mjs
|
|
111
|
+
function ArrayType(value) {
|
|
112
|
+
return value.map((value2) => Visit(value2));
|
|
113
|
+
}
|
|
114
|
+
function DateType(value) {
|
|
115
|
+
return new Date(value.getTime());
|
|
116
|
+
}
|
|
117
|
+
function Uint8ArrayType(value) {
|
|
118
|
+
return new Uint8Array(value);
|
|
119
|
+
}
|
|
120
|
+
function RegExpType(value) {
|
|
121
|
+
return new RegExp(value.source, value.flags);
|
|
122
|
+
}
|
|
123
|
+
function ObjectType(value) {
|
|
124
|
+
const result = {};
|
|
125
|
+
for (const key of Object.getOwnPropertyNames(value)) {
|
|
126
|
+
result[key] = Visit(value[key]);
|
|
127
|
+
}
|
|
128
|
+
for (const key of Object.getOwnPropertySymbols(value)) {
|
|
129
|
+
result[key] = Visit(value[key]);
|
|
130
|
+
}
|
|
131
|
+
return result;
|
|
132
|
+
}
|
|
133
|
+
function Visit(value) {
|
|
134
|
+
return IsArray(value) ? ArrayType(value) : IsDate(value) ? DateType(value) : IsUint8Array(value) ? Uint8ArrayType(value) : IsRegExp(value) ? RegExpType(value) : IsObject(value) ? ObjectType(value) : value;
|
|
135
|
+
}
|
|
136
|
+
function Clone(value) {
|
|
137
|
+
return Visit(value);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// node_modules/@sinclair/typebox/build/esm/type/clone/type.mjs
|
|
141
|
+
function CloneType(schema, options) {
|
|
142
|
+
return options === void 0 ? Clone(schema) : Clone({ ...options, ...schema });
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// node_modules/@sinclair/typebox/build/esm/value/guard/guard.mjs
|
|
146
|
+
function IsObject2(value) {
|
|
147
|
+
return value !== null && typeof value === "object";
|
|
148
|
+
}
|
|
149
|
+
function IsArray2(value) {
|
|
150
|
+
return globalThis.Array.isArray(value) && !globalThis.ArrayBuffer.isView(value);
|
|
151
|
+
}
|
|
152
|
+
function IsUndefined2(value) {
|
|
153
|
+
return value === void 0;
|
|
154
|
+
}
|
|
155
|
+
function IsNumber2(value) {
|
|
156
|
+
return typeof value === "number";
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// node_modules/@sinclair/typebox/build/esm/system/policy.mjs
|
|
160
|
+
var TypeSystemPolicy;
|
|
161
|
+
(function(TypeSystemPolicy2) {
|
|
162
|
+
TypeSystemPolicy2.InstanceMode = "default";
|
|
163
|
+
TypeSystemPolicy2.ExactOptionalPropertyTypes = false;
|
|
164
|
+
TypeSystemPolicy2.AllowArrayObject = false;
|
|
165
|
+
TypeSystemPolicy2.AllowNaN = false;
|
|
166
|
+
TypeSystemPolicy2.AllowNullVoid = false;
|
|
167
|
+
function IsExactOptionalProperty(value, key) {
|
|
168
|
+
return TypeSystemPolicy2.ExactOptionalPropertyTypes ? key in value : value[key] !== void 0;
|
|
169
|
+
}
|
|
170
|
+
TypeSystemPolicy2.IsExactOptionalProperty = IsExactOptionalProperty;
|
|
171
|
+
function IsObjectLike(value) {
|
|
172
|
+
const isObject = IsObject2(value);
|
|
173
|
+
return TypeSystemPolicy2.AllowArrayObject ? isObject : isObject && !IsArray2(value);
|
|
174
|
+
}
|
|
175
|
+
TypeSystemPolicy2.IsObjectLike = IsObjectLike;
|
|
176
|
+
function IsRecordLike(value) {
|
|
177
|
+
return IsObjectLike(value) && !(value instanceof Date) && !(value instanceof Uint8Array);
|
|
178
|
+
}
|
|
179
|
+
TypeSystemPolicy2.IsRecordLike = IsRecordLike;
|
|
180
|
+
function IsNumberLike(value) {
|
|
181
|
+
return TypeSystemPolicy2.AllowNaN ? IsNumber2(value) : Number.isFinite(value);
|
|
182
|
+
}
|
|
183
|
+
TypeSystemPolicy2.IsNumberLike = IsNumberLike;
|
|
184
|
+
function IsVoidLike(value) {
|
|
185
|
+
const isUndefined = IsUndefined2(value);
|
|
186
|
+
return TypeSystemPolicy2.AllowNullVoid ? isUndefined || value === null : isUndefined;
|
|
187
|
+
}
|
|
188
|
+
TypeSystemPolicy2.IsVoidLike = IsVoidLike;
|
|
189
|
+
})(TypeSystemPolicy || (TypeSystemPolicy = {}));
|
|
190
|
+
|
|
191
|
+
// node_modules/@sinclair/typebox/build/esm/type/create/immutable.mjs
|
|
192
|
+
function ImmutableArray(value) {
|
|
193
|
+
return globalThis.Object.freeze(value).map((value2) => Immutable(value2));
|
|
194
|
+
}
|
|
195
|
+
function ImmutableDate(value) {
|
|
196
|
+
return value;
|
|
197
|
+
}
|
|
198
|
+
function ImmutableUint8Array(value) {
|
|
199
|
+
return value;
|
|
200
|
+
}
|
|
201
|
+
function ImmutableRegExp(value) {
|
|
202
|
+
return value;
|
|
203
|
+
}
|
|
204
|
+
function ImmutableObject(value) {
|
|
205
|
+
const result = {};
|
|
206
|
+
for (const key of Object.getOwnPropertyNames(value)) {
|
|
207
|
+
result[key] = Immutable(value[key]);
|
|
208
|
+
}
|
|
209
|
+
for (const key of Object.getOwnPropertySymbols(value)) {
|
|
210
|
+
result[key] = Immutable(value[key]);
|
|
211
|
+
}
|
|
212
|
+
return globalThis.Object.freeze(result);
|
|
213
|
+
}
|
|
214
|
+
function Immutable(value) {
|
|
215
|
+
return IsArray(value) ? ImmutableArray(value) : IsDate(value) ? ImmutableDate(value) : IsUint8Array(value) ? ImmutableUint8Array(value) : IsRegExp(value) ? ImmutableRegExp(value) : IsObject(value) ? ImmutableObject(value) : value;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// node_modules/@sinclair/typebox/build/esm/type/create/type.mjs
|
|
219
|
+
function CreateType(schema, options) {
|
|
220
|
+
const result = options !== void 0 ? { ...options, ...schema } : schema;
|
|
221
|
+
switch (TypeSystemPolicy.InstanceMode) {
|
|
222
|
+
case "freeze":
|
|
223
|
+
return Immutable(result);
|
|
224
|
+
case "clone":
|
|
225
|
+
return Clone(result);
|
|
226
|
+
default:
|
|
227
|
+
return result;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// node_modules/@sinclair/typebox/build/esm/type/error/error.mjs
|
|
232
|
+
var TypeBoxError = class extends Error {
|
|
233
|
+
constructor(message) {
|
|
234
|
+
super(message);
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
// node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.mjs
|
|
239
|
+
var TransformKind = /* @__PURE__ */ Symbol.for("TypeBox.Transform");
|
|
240
|
+
var ReadonlyKind = /* @__PURE__ */ Symbol.for("TypeBox.Readonly");
|
|
241
|
+
var OptionalKind = /* @__PURE__ */ Symbol.for("TypeBox.Optional");
|
|
242
|
+
var Hint = /* @__PURE__ */ Symbol.for("TypeBox.Hint");
|
|
243
|
+
var Kind = /* @__PURE__ */ Symbol.for("TypeBox.Kind");
|
|
244
|
+
|
|
245
|
+
// node_modules/@sinclair/typebox/build/esm/type/guard/kind.mjs
|
|
246
|
+
function IsReadonly(value) {
|
|
247
|
+
return IsObject(value) && value[ReadonlyKind] === "Readonly";
|
|
248
|
+
}
|
|
249
|
+
function IsOptional(value) {
|
|
250
|
+
return IsObject(value) && value[OptionalKind] === "Optional";
|
|
251
|
+
}
|
|
252
|
+
function IsAny(value) {
|
|
253
|
+
return IsKindOf(value, "Any");
|
|
254
|
+
}
|
|
255
|
+
function IsArgument(value) {
|
|
256
|
+
return IsKindOf(value, "Argument");
|
|
257
|
+
}
|
|
258
|
+
function IsArray3(value) {
|
|
259
|
+
return IsKindOf(value, "Array");
|
|
260
|
+
}
|
|
261
|
+
function IsAsyncIterator2(value) {
|
|
262
|
+
return IsKindOf(value, "AsyncIterator");
|
|
263
|
+
}
|
|
264
|
+
function IsBigInt2(value) {
|
|
265
|
+
return IsKindOf(value, "BigInt");
|
|
266
|
+
}
|
|
267
|
+
function IsBoolean2(value) {
|
|
268
|
+
return IsKindOf(value, "Boolean");
|
|
269
|
+
}
|
|
270
|
+
function IsComputed(value) {
|
|
271
|
+
return IsKindOf(value, "Computed");
|
|
272
|
+
}
|
|
273
|
+
function IsConstructor(value) {
|
|
274
|
+
return IsKindOf(value, "Constructor");
|
|
275
|
+
}
|
|
276
|
+
function IsDate2(value) {
|
|
277
|
+
return IsKindOf(value, "Date");
|
|
278
|
+
}
|
|
279
|
+
function IsFunction2(value) {
|
|
280
|
+
return IsKindOf(value, "Function");
|
|
281
|
+
}
|
|
282
|
+
function IsInteger(value) {
|
|
283
|
+
return IsKindOf(value, "Integer");
|
|
284
|
+
}
|
|
285
|
+
function IsIntersect(value) {
|
|
286
|
+
return IsKindOf(value, "Intersect");
|
|
287
|
+
}
|
|
288
|
+
function IsIterator2(value) {
|
|
289
|
+
return IsKindOf(value, "Iterator");
|
|
290
|
+
}
|
|
291
|
+
function IsKindOf(value, kind) {
|
|
292
|
+
return IsObject(value) && Kind in value && value[Kind] === kind;
|
|
293
|
+
}
|
|
294
|
+
function IsLiteralValue(value) {
|
|
295
|
+
return IsBoolean(value) || IsNumber(value) || IsString(value);
|
|
296
|
+
}
|
|
297
|
+
function IsLiteral(value) {
|
|
298
|
+
return IsKindOf(value, "Literal");
|
|
299
|
+
}
|
|
300
|
+
function IsMappedKey(value) {
|
|
301
|
+
return IsKindOf(value, "MappedKey");
|
|
302
|
+
}
|
|
303
|
+
function IsMappedResult(value) {
|
|
304
|
+
return IsKindOf(value, "MappedResult");
|
|
305
|
+
}
|
|
306
|
+
function IsNever(value) {
|
|
307
|
+
return IsKindOf(value, "Never");
|
|
308
|
+
}
|
|
309
|
+
function IsNot(value) {
|
|
310
|
+
return IsKindOf(value, "Not");
|
|
311
|
+
}
|
|
312
|
+
function IsNull2(value) {
|
|
313
|
+
return IsKindOf(value, "Null");
|
|
314
|
+
}
|
|
315
|
+
function IsNumber3(value) {
|
|
316
|
+
return IsKindOf(value, "Number");
|
|
317
|
+
}
|
|
318
|
+
function IsObject3(value) {
|
|
319
|
+
return IsKindOf(value, "Object");
|
|
320
|
+
}
|
|
321
|
+
function IsPromise(value) {
|
|
322
|
+
return IsKindOf(value, "Promise");
|
|
323
|
+
}
|
|
324
|
+
function IsRecord(value) {
|
|
325
|
+
return IsKindOf(value, "Record");
|
|
326
|
+
}
|
|
327
|
+
function IsRef(value) {
|
|
328
|
+
return IsKindOf(value, "Ref");
|
|
329
|
+
}
|
|
330
|
+
function IsRegExp2(value) {
|
|
331
|
+
return IsKindOf(value, "RegExp");
|
|
332
|
+
}
|
|
333
|
+
function IsString2(value) {
|
|
334
|
+
return IsKindOf(value, "String");
|
|
335
|
+
}
|
|
336
|
+
function IsSymbol2(value) {
|
|
337
|
+
return IsKindOf(value, "Symbol");
|
|
338
|
+
}
|
|
339
|
+
function IsTemplateLiteral(value) {
|
|
340
|
+
return IsKindOf(value, "TemplateLiteral");
|
|
341
|
+
}
|
|
342
|
+
function IsThis(value) {
|
|
343
|
+
return IsKindOf(value, "This");
|
|
344
|
+
}
|
|
345
|
+
function IsTransform(value) {
|
|
346
|
+
return IsObject(value) && TransformKind in value;
|
|
347
|
+
}
|
|
348
|
+
function IsTuple(value) {
|
|
349
|
+
return IsKindOf(value, "Tuple");
|
|
350
|
+
}
|
|
351
|
+
function IsUndefined3(value) {
|
|
352
|
+
return IsKindOf(value, "Undefined");
|
|
353
|
+
}
|
|
354
|
+
function IsUnion(value) {
|
|
355
|
+
return IsKindOf(value, "Union");
|
|
356
|
+
}
|
|
357
|
+
function IsUint8Array2(value) {
|
|
358
|
+
return IsKindOf(value, "Uint8Array");
|
|
359
|
+
}
|
|
360
|
+
function IsUnknown(value) {
|
|
361
|
+
return IsKindOf(value, "Unknown");
|
|
362
|
+
}
|
|
363
|
+
function IsUnsafe(value) {
|
|
364
|
+
return IsKindOf(value, "Unsafe");
|
|
365
|
+
}
|
|
366
|
+
function IsVoid(value) {
|
|
367
|
+
return IsKindOf(value, "Void");
|
|
368
|
+
}
|
|
369
|
+
function IsKind(value) {
|
|
370
|
+
return IsObject(value) && Kind in value && IsString(value[Kind]);
|
|
371
|
+
}
|
|
372
|
+
function IsSchema(value) {
|
|
373
|
+
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);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
// node_modules/@sinclair/typebox/build/esm/type/guard/type.mjs
|
|
377
|
+
var type_exports = {};
|
|
378
|
+
__export(type_exports, {
|
|
379
|
+
IsAny: () => IsAny2,
|
|
380
|
+
IsArgument: () => IsArgument2,
|
|
381
|
+
IsArray: () => IsArray4,
|
|
382
|
+
IsAsyncIterator: () => IsAsyncIterator3,
|
|
383
|
+
IsBigInt: () => IsBigInt3,
|
|
384
|
+
IsBoolean: () => IsBoolean3,
|
|
385
|
+
IsComputed: () => IsComputed2,
|
|
386
|
+
IsConstructor: () => IsConstructor2,
|
|
387
|
+
IsDate: () => IsDate3,
|
|
388
|
+
IsFunction: () => IsFunction3,
|
|
389
|
+
IsImport: () => IsImport,
|
|
390
|
+
IsInteger: () => IsInteger2,
|
|
391
|
+
IsIntersect: () => IsIntersect2,
|
|
392
|
+
IsIterator: () => IsIterator3,
|
|
393
|
+
IsKind: () => IsKind2,
|
|
394
|
+
IsKindOf: () => IsKindOf2,
|
|
395
|
+
IsLiteral: () => IsLiteral2,
|
|
396
|
+
IsLiteralBoolean: () => IsLiteralBoolean,
|
|
397
|
+
IsLiteralNumber: () => IsLiteralNumber,
|
|
398
|
+
IsLiteralString: () => IsLiteralString,
|
|
399
|
+
IsLiteralValue: () => IsLiteralValue2,
|
|
400
|
+
IsMappedKey: () => IsMappedKey2,
|
|
401
|
+
IsMappedResult: () => IsMappedResult2,
|
|
402
|
+
IsNever: () => IsNever2,
|
|
403
|
+
IsNot: () => IsNot2,
|
|
404
|
+
IsNull: () => IsNull3,
|
|
405
|
+
IsNumber: () => IsNumber4,
|
|
406
|
+
IsObject: () => IsObject4,
|
|
407
|
+
IsOptional: () => IsOptional2,
|
|
408
|
+
IsPromise: () => IsPromise2,
|
|
409
|
+
IsProperties: () => IsProperties,
|
|
410
|
+
IsReadonly: () => IsReadonly2,
|
|
411
|
+
IsRecord: () => IsRecord2,
|
|
412
|
+
IsRecursive: () => IsRecursive,
|
|
413
|
+
IsRef: () => IsRef2,
|
|
414
|
+
IsRegExp: () => IsRegExp3,
|
|
415
|
+
IsSchema: () => IsSchema2,
|
|
416
|
+
IsString: () => IsString3,
|
|
417
|
+
IsSymbol: () => IsSymbol3,
|
|
418
|
+
IsTemplateLiteral: () => IsTemplateLiteral2,
|
|
419
|
+
IsThis: () => IsThis2,
|
|
420
|
+
IsTransform: () => IsTransform2,
|
|
421
|
+
IsTuple: () => IsTuple2,
|
|
422
|
+
IsUint8Array: () => IsUint8Array3,
|
|
423
|
+
IsUndefined: () => IsUndefined4,
|
|
424
|
+
IsUnion: () => IsUnion2,
|
|
425
|
+
IsUnionLiteral: () => IsUnionLiteral,
|
|
426
|
+
IsUnknown: () => IsUnknown2,
|
|
427
|
+
IsUnsafe: () => IsUnsafe2,
|
|
428
|
+
IsVoid: () => IsVoid2,
|
|
429
|
+
TypeGuardUnknownTypeError: () => TypeGuardUnknownTypeError
|
|
430
|
+
});
|
|
431
|
+
var TypeGuardUnknownTypeError = class extends TypeBoxError {
|
|
432
|
+
};
|
|
433
|
+
var KnownTypes = [
|
|
434
|
+
"Argument",
|
|
435
|
+
"Any",
|
|
436
|
+
"Array",
|
|
437
|
+
"AsyncIterator",
|
|
438
|
+
"BigInt",
|
|
439
|
+
"Boolean",
|
|
440
|
+
"Computed",
|
|
441
|
+
"Constructor",
|
|
442
|
+
"Date",
|
|
443
|
+
"Enum",
|
|
444
|
+
"Function",
|
|
445
|
+
"Integer",
|
|
446
|
+
"Intersect",
|
|
447
|
+
"Iterator",
|
|
448
|
+
"Literal",
|
|
449
|
+
"MappedKey",
|
|
450
|
+
"MappedResult",
|
|
451
|
+
"Not",
|
|
452
|
+
"Null",
|
|
453
|
+
"Number",
|
|
454
|
+
"Object",
|
|
455
|
+
"Promise",
|
|
456
|
+
"Record",
|
|
457
|
+
"Ref",
|
|
458
|
+
"RegExp",
|
|
459
|
+
"String",
|
|
460
|
+
"Symbol",
|
|
461
|
+
"TemplateLiteral",
|
|
462
|
+
"This",
|
|
463
|
+
"Tuple",
|
|
464
|
+
"Undefined",
|
|
465
|
+
"Union",
|
|
466
|
+
"Uint8Array",
|
|
467
|
+
"Unknown",
|
|
468
|
+
"Void"
|
|
469
|
+
];
|
|
470
|
+
function IsPattern(value) {
|
|
471
|
+
try {
|
|
472
|
+
new RegExp(value);
|
|
473
|
+
return true;
|
|
474
|
+
} catch {
|
|
475
|
+
return false;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
function IsControlCharacterFree(value) {
|
|
479
|
+
if (!IsString(value))
|
|
480
|
+
return false;
|
|
481
|
+
for (let i = 0; i < value.length; i++) {
|
|
482
|
+
const code = value.charCodeAt(i);
|
|
483
|
+
if (code >= 7 && code <= 13 || code === 27 || code === 127) {
|
|
484
|
+
return false;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
return true;
|
|
488
|
+
}
|
|
489
|
+
function IsAdditionalProperties(value) {
|
|
490
|
+
return IsOptionalBoolean(value) || IsSchema2(value);
|
|
491
|
+
}
|
|
492
|
+
function IsOptionalBigInt(value) {
|
|
493
|
+
return IsUndefined(value) || IsBigInt(value);
|
|
494
|
+
}
|
|
495
|
+
function IsOptionalNumber(value) {
|
|
496
|
+
return IsUndefined(value) || IsNumber(value);
|
|
497
|
+
}
|
|
498
|
+
function IsOptionalBoolean(value) {
|
|
499
|
+
return IsUndefined(value) || IsBoolean(value);
|
|
500
|
+
}
|
|
501
|
+
function IsOptionalString(value) {
|
|
502
|
+
return IsUndefined(value) || IsString(value);
|
|
503
|
+
}
|
|
504
|
+
function IsOptionalPattern(value) {
|
|
505
|
+
return IsUndefined(value) || IsString(value) && IsControlCharacterFree(value) && IsPattern(value);
|
|
506
|
+
}
|
|
507
|
+
function IsOptionalFormat(value) {
|
|
508
|
+
return IsUndefined(value) || IsString(value) && IsControlCharacterFree(value);
|
|
509
|
+
}
|
|
510
|
+
function IsOptionalSchema(value) {
|
|
511
|
+
return IsUndefined(value) || IsSchema2(value);
|
|
512
|
+
}
|
|
513
|
+
function IsReadonly2(value) {
|
|
514
|
+
return IsObject(value) && value[ReadonlyKind] === "Readonly";
|
|
515
|
+
}
|
|
516
|
+
function IsOptional2(value) {
|
|
517
|
+
return IsObject(value) && value[OptionalKind] === "Optional";
|
|
518
|
+
}
|
|
519
|
+
function IsAny2(value) {
|
|
520
|
+
return IsKindOf2(value, "Any") && IsOptionalString(value.$id);
|
|
521
|
+
}
|
|
522
|
+
function IsArgument2(value) {
|
|
523
|
+
return IsKindOf2(value, "Argument") && IsNumber(value.index);
|
|
524
|
+
}
|
|
525
|
+
function IsArray4(value) {
|
|
526
|
+
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);
|
|
527
|
+
}
|
|
528
|
+
function IsAsyncIterator3(value) {
|
|
529
|
+
return IsKindOf2(value, "AsyncIterator") && value.type === "AsyncIterator" && IsOptionalString(value.$id) && IsSchema2(value.items);
|
|
530
|
+
}
|
|
531
|
+
function IsBigInt3(value) {
|
|
532
|
+
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);
|
|
533
|
+
}
|
|
534
|
+
function IsBoolean3(value) {
|
|
535
|
+
return IsKindOf2(value, "Boolean") && value.type === "boolean" && IsOptionalString(value.$id);
|
|
536
|
+
}
|
|
537
|
+
function IsComputed2(value) {
|
|
538
|
+
return IsKindOf2(value, "Computed") && IsString(value.target) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema));
|
|
539
|
+
}
|
|
540
|
+
function IsConstructor2(value) {
|
|
541
|
+
return IsKindOf2(value, "Constructor") && value.type === "Constructor" && IsOptionalString(value.$id) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)) && IsSchema2(value.returns);
|
|
542
|
+
}
|
|
543
|
+
function IsDate3(value) {
|
|
544
|
+
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);
|
|
545
|
+
}
|
|
546
|
+
function IsFunction3(value) {
|
|
547
|
+
return IsKindOf2(value, "Function") && value.type === "Function" && IsOptionalString(value.$id) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)) && IsSchema2(value.returns);
|
|
548
|
+
}
|
|
549
|
+
function IsImport(value) {
|
|
550
|
+
return IsKindOf2(value, "Import") && HasPropertyKey(value, "$defs") && IsObject(value.$defs) && IsProperties(value.$defs) && HasPropertyKey(value, "$ref") && IsString(value.$ref) && value.$ref in value.$defs;
|
|
551
|
+
}
|
|
552
|
+
function IsInteger2(value) {
|
|
553
|
+
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);
|
|
554
|
+
}
|
|
555
|
+
function IsProperties(value) {
|
|
556
|
+
return IsObject(value) && Object.entries(value).every(([key, schema]) => IsControlCharacterFree(key) && IsSchema2(schema));
|
|
557
|
+
}
|
|
558
|
+
function IsIntersect2(value) {
|
|
559
|
+
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);
|
|
560
|
+
}
|
|
561
|
+
function IsIterator3(value) {
|
|
562
|
+
return IsKindOf2(value, "Iterator") && value.type === "Iterator" && IsOptionalString(value.$id) && IsSchema2(value.items);
|
|
563
|
+
}
|
|
564
|
+
function IsKindOf2(value, kind) {
|
|
565
|
+
return IsObject(value) && Kind in value && value[Kind] === kind;
|
|
566
|
+
}
|
|
567
|
+
function IsLiteralString(value) {
|
|
568
|
+
return IsLiteral2(value) && IsString(value.const);
|
|
569
|
+
}
|
|
570
|
+
function IsLiteralNumber(value) {
|
|
571
|
+
return IsLiteral2(value) && IsNumber(value.const);
|
|
572
|
+
}
|
|
573
|
+
function IsLiteralBoolean(value) {
|
|
574
|
+
return IsLiteral2(value) && IsBoolean(value.const);
|
|
575
|
+
}
|
|
576
|
+
function IsLiteral2(value) {
|
|
577
|
+
return IsKindOf2(value, "Literal") && IsOptionalString(value.$id) && IsLiteralValue2(value.const);
|
|
578
|
+
}
|
|
579
|
+
function IsLiteralValue2(value) {
|
|
580
|
+
return IsBoolean(value) || IsNumber(value) || IsString(value);
|
|
581
|
+
}
|
|
582
|
+
function IsMappedKey2(value) {
|
|
583
|
+
return IsKindOf2(value, "MappedKey") && IsArray(value.keys) && value.keys.every((key) => IsNumber(key) || IsString(key));
|
|
584
|
+
}
|
|
585
|
+
function IsMappedResult2(value) {
|
|
586
|
+
return IsKindOf2(value, "MappedResult") && IsProperties(value.properties);
|
|
587
|
+
}
|
|
588
|
+
function IsNever2(value) {
|
|
589
|
+
return IsKindOf2(value, "Never") && IsObject(value.not) && Object.getOwnPropertyNames(value.not).length === 0;
|
|
590
|
+
}
|
|
591
|
+
function IsNot2(value) {
|
|
592
|
+
return IsKindOf2(value, "Not") && IsSchema2(value.not);
|
|
593
|
+
}
|
|
594
|
+
function IsNull3(value) {
|
|
595
|
+
return IsKindOf2(value, "Null") && value.type === "null" && IsOptionalString(value.$id);
|
|
596
|
+
}
|
|
597
|
+
function IsNumber4(value) {
|
|
598
|
+
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);
|
|
599
|
+
}
|
|
600
|
+
function IsObject4(value) {
|
|
601
|
+
return IsKindOf2(value, "Object") && value.type === "object" && IsOptionalString(value.$id) && IsProperties(value.properties) && IsAdditionalProperties(value.additionalProperties) && IsOptionalNumber(value.minProperties) && IsOptionalNumber(value.maxProperties);
|
|
602
|
+
}
|
|
603
|
+
function IsPromise2(value) {
|
|
604
|
+
return IsKindOf2(value, "Promise") && value.type === "Promise" && IsOptionalString(value.$id) && IsSchema2(value.item);
|
|
605
|
+
}
|
|
606
|
+
function IsRecord2(value) {
|
|
607
|
+
return IsKindOf2(value, "Record") && value.type === "object" && IsOptionalString(value.$id) && IsAdditionalProperties(value.additionalProperties) && IsObject(value.patternProperties) && ((schema) => {
|
|
608
|
+
const keys = Object.getOwnPropertyNames(schema.patternProperties);
|
|
609
|
+
return keys.length === 1 && IsPattern(keys[0]) && IsObject(schema.patternProperties) && IsSchema2(schema.patternProperties[keys[0]]);
|
|
610
|
+
})(value);
|
|
611
|
+
}
|
|
612
|
+
function IsRecursive(value) {
|
|
613
|
+
return IsObject(value) && Hint in value && value[Hint] === "Recursive";
|
|
614
|
+
}
|
|
615
|
+
function IsRef2(value) {
|
|
616
|
+
return IsKindOf2(value, "Ref") && IsOptionalString(value.$id) && IsString(value.$ref);
|
|
617
|
+
}
|
|
618
|
+
function IsRegExp3(value) {
|
|
619
|
+
return IsKindOf2(value, "RegExp") && IsOptionalString(value.$id) && IsString(value.source) && IsString(value.flags) && IsOptionalNumber(value.maxLength) && IsOptionalNumber(value.minLength);
|
|
620
|
+
}
|
|
621
|
+
function IsString3(value) {
|
|
622
|
+
return IsKindOf2(value, "String") && value.type === "string" && IsOptionalString(value.$id) && IsOptionalNumber(value.minLength) && IsOptionalNumber(value.maxLength) && IsOptionalPattern(value.pattern) && IsOptionalFormat(value.format);
|
|
623
|
+
}
|
|
624
|
+
function IsSymbol3(value) {
|
|
625
|
+
return IsKindOf2(value, "Symbol") && value.type === "symbol" && IsOptionalString(value.$id);
|
|
626
|
+
}
|
|
627
|
+
function IsTemplateLiteral2(value) {
|
|
628
|
+
return IsKindOf2(value, "TemplateLiteral") && value.type === "string" && IsString(value.pattern) && value.pattern[0] === "^" && value.pattern[value.pattern.length - 1] === "$";
|
|
629
|
+
}
|
|
630
|
+
function IsThis2(value) {
|
|
631
|
+
return IsKindOf2(value, "This") && IsOptionalString(value.$id) && IsString(value.$ref);
|
|
632
|
+
}
|
|
633
|
+
function IsTransform2(value) {
|
|
634
|
+
return IsObject(value) && TransformKind in value;
|
|
635
|
+
}
|
|
636
|
+
function IsTuple2(value) {
|
|
637
|
+
return IsKindOf2(value, "Tuple") && value.type === "array" && IsOptionalString(value.$id) && IsNumber(value.minItems) && IsNumber(value.maxItems) && value.minItems === value.maxItems && // empty
|
|
638
|
+
(IsUndefined(value.items) && IsUndefined(value.additionalItems) && value.minItems === 0 || IsArray(value.items) && value.items.every((schema) => IsSchema2(schema)));
|
|
639
|
+
}
|
|
640
|
+
function IsUndefined4(value) {
|
|
641
|
+
return IsKindOf2(value, "Undefined") && value.type === "undefined" && IsOptionalString(value.$id);
|
|
642
|
+
}
|
|
643
|
+
function IsUnionLiteral(value) {
|
|
644
|
+
return IsUnion2(value) && value.anyOf.every((schema) => IsLiteralString(schema) || IsLiteralNumber(schema));
|
|
645
|
+
}
|
|
646
|
+
function IsUnion2(value) {
|
|
647
|
+
return IsKindOf2(value, "Union") && IsOptionalString(value.$id) && IsObject(value) && IsArray(value.anyOf) && value.anyOf.every((schema) => IsSchema2(schema));
|
|
648
|
+
}
|
|
649
|
+
function IsUint8Array3(value) {
|
|
650
|
+
return IsKindOf2(value, "Uint8Array") && value.type === "Uint8Array" && IsOptionalString(value.$id) && IsOptionalNumber(value.minByteLength) && IsOptionalNumber(value.maxByteLength);
|
|
651
|
+
}
|
|
652
|
+
function IsUnknown2(value) {
|
|
653
|
+
return IsKindOf2(value, "Unknown") && IsOptionalString(value.$id);
|
|
654
|
+
}
|
|
655
|
+
function IsUnsafe2(value) {
|
|
656
|
+
return IsKindOf2(value, "Unsafe");
|
|
657
|
+
}
|
|
658
|
+
function IsVoid2(value) {
|
|
659
|
+
return IsKindOf2(value, "Void") && value.type === "void" && IsOptionalString(value.$id);
|
|
660
|
+
}
|
|
661
|
+
function IsKind2(value) {
|
|
662
|
+
return IsObject(value) && Kind in value && IsString(value[Kind]) && !KnownTypes.includes(value[Kind]);
|
|
663
|
+
}
|
|
664
|
+
function IsSchema2(value) {
|
|
665
|
+
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));
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
// node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.mjs
|
|
669
|
+
var PatternBoolean = "(true|false)";
|
|
670
|
+
var PatternNumber = "(0|[1-9][0-9]*)";
|
|
671
|
+
var PatternString = "(.*)";
|
|
672
|
+
var PatternNever = "(?!.*)";
|
|
673
|
+
var PatternBooleanExact = `^${PatternBoolean}$`;
|
|
674
|
+
var PatternNumberExact = `^${PatternNumber}$`;
|
|
675
|
+
var PatternStringExact = `^${PatternString}$`;
|
|
676
|
+
var PatternNeverExact = `^${PatternNever}$`;
|
|
677
|
+
|
|
678
|
+
// node_modules/@sinclair/typebox/build/esm/type/sets/set.mjs
|
|
679
|
+
function SetIncludes(T, S) {
|
|
680
|
+
return T.includes(S);
|
|
681
|
+
}
|
|
682
|
+
function SetDistinct(T) {
|
|
683
|
+
return [...new Set(T)];
|
|
684
|
+
}
|
|
685
|
+
function SetIntersect(T, S) {
|
|
686
|
+
return T.filter((L) => S.includes(L));
|
|
687
|
+
}
|
|
688
|
+
function SetIntersectManyResolve(T, Init) {
|
|
689
|
+
return T.reduce((Acc, L) => {
|
|
690
|
+
return SetIntersect(Acc, L);
|
|
691
|
+
}, Init);
|
|
692
|
+
}
|
|
693
|
+
function SetIntersectMany(T) {
|
|
694
|
+
return T.length === 1 ? T[0] : T.length > 1 ? SetIntersectManyResolve(T.slice(1), T[0]) : [];
|
|
695
|
+
}
|
|
696
|
+
function SetUnionMany(T) {
|
|
697
|
+
const Acc = [];
|
|
698
|
+
for (const L of T)
|
|
699
|
+
Acc.push(...L);
|
|
700
|
+
return Acc;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
// node_modules/@sinclair/typebox/build/esm/type/any/any.mjs
|
|
704
|
+
function Any(options) {
|
|
705
|
+
return CreateType({ [Kind]: "Any" }, options);
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
// node_modules/@sinclair/typebox/build/esm/type/array/array.mjs
|
|
709
|
+
function Array2(items, options) {
|
|
710
|
+
return CreateType({ [Kind]: "Array", type: "array", items }, options);
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
// node_modules/@sinclair/typebox/build/esm/type/argument/argument.mjs
|
|
714
|
+
function Argument(index) {
|
|
715
|
+
return CreateType({ [Kind]: "Argument", index });
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
// node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.mjs
|
|
719
|
+
function AsyncIterator(items, options) {
|
|
720
|
+
return CreateType({ [Kind]: "AsyncIterator", type: "AsyncIterator", items }, options);
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
// node_modules/@sinclair/typebox/build/esm/type/computed/computed.mjs
|
|
724
|
+
function Computed(target, parameters, options) {
|
|
725
|
+
return CreateType({ [Kind]: "Computed", target, parameters }, options);
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
// node_modules/@sinclair/typebox/build/esm/type/discard/discard.mjs
|
|
729
|
+
function DiscardKey(value, key) {
|
|
730
|
+
const { [key]: _, ...rest } = value;
|
|
731
|
+
return rest;
|
|
732
|
+
}
|
|
733
|
+
function Discard(value, keys) {
|
|
734
|
+
return keys.reduce((acc, key) => DiscardKey(acc, key), value);
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
// node_modules/@sinclair/typebox/build/esm/type/never/never.mjs
|
|
738
|
+
function Never(options) {
|
|
739
|
+
return CreateType({ [Kind]: "Never", not: {} }, options);
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
// node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.mjs
|
|
743
|
+
function MappedResult(properties) {
|
|
744
|
+
return CreateType({
|
|
745
|
+
[Kind]: "MappedResult",
|
|
746
|
+
properties
|
|
747
|
+
});
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
// node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.mjs
|
|
751
|
+
function Constructor(parameters, returns, options) {
|
|
752
|
+
return CreateType({ [Kind]: "Constructor", type: "Constructor", parameters, returns }, options);
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
// node_modules/@sinclair/typebox/build/esm/type/function/function.mjs
|
|
756
|
+
function Function(parameters, returns, options) {
|
|
757
|
+
return CreateType({ [Kind]: "Function", type: "Function", parameters, returns }, options);
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
// node_modules/@sinclair/typebox/build/esm/type/union/union-create.mjs
|
|
761
|
+
function UnionCreate(T, options) {
|
|
762
|
+
return CreateType({ [Kind]: "Union", anyOf: T }, options);
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
// node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.mjs
|
|
766
|
+
function IsUnionOptional(types) {
|
|
767
|
+
return types.some((type) => IsOptional(type));
|
|
768
|
+
}
|
|
769
|
+
function RemoveOptionalFromRest(types) {
|
|
770
|
+
return types.map((left) => IsOptional(left) ? RemoveOptionalFromType(left) : left);
|
|
771
|
+
}
|
|
772
|
+
function RemoveOptionalFromType(T) {
|
|
773
|
+
return Discard(T, [OptionalKind]);
|
|
774
|
+
}
|
|
775
|
+
function ResolveUnion(types, options) {
|
|
776
|
+
const isOptional = IsUnionOptional(types);
|
|
777
|
+
return isOptional ? Optional(UnionCreate(RemoveOptionalFromRest(types), options)) : UnionCreate(RemoveOptionalFromRest(types), options);
|
|
778
|
+
}
|
|
779
|
+
function UnionEvaluated(T, options) {
|
|
780
|
+
return T.length === 1 ? CreateType(T[0], options) : T.length === 0 ? Never(options) : ResolveUnion(T, options);
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
// node_modules/@sinclair/typebox/build/esm/type/union/union.mjs
|
|
784
|
+
function Union(types, options) {
|
|
785
|
+
return types.length === 0 ? Never(options) : types.length === 1 ? CreateType(types[0], options) : UnionCreate(types, options);
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
// node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.mjs
|
|
789
|
+
var TemplateLiteralParserError = class extends TypeBoxError {
|
|
790
|
+
};
|
|
791
|
+
function Unescape(pattern) {
|
|
792
|
+
return pattern.replace(/\\\$/g, "$").replace(/\\\*/g, "*").replace(/\\\^/g, "^").replace(/\\\|/g, "|").replace(/\\\(/g, "(").replace(/\\\)/g, ")");
|
|
793
|
+
}
|
|
794
|
+
function IsNonEscaped(pattern, index, char) {
|
|
795
|
+
return pattern[index] === char && pattern.charCodeAt(index - 1) !== 92;
|
|
796
|
+
}
|
|
797
|
+
function IsOpenParen(pattern, index) {
|
|
798
|
+
return IsNonEscaped(pattern, index, "(");
|
|
799
|
+
}
|
|
800
|
+
function IsCloseParen(pattern, index) {
|
|
801
|
+
return IsNonEscaped(pattern, index, ")");
|
|
802
|
+
}
|
|
803
|
+
function IsSeparator(pattern, index) {
|
|
804
|
+
return IsNonEscaped(pattern, index, "|");
|
|
805
|
+
}
|
|
806
|
+
function IsGroup(pattern) {
|
|
807
|
+
if (!(IsOpenParen(pattern, 0) && IsCloseParen(pattern, pattern.length - 1)))
|
|
808
|
+
return false;
|
|
809
|
+
let count = 0;
|
|
810
|
+
for (let index = 0; index < pattern.length; index++) {
|
|
811
|
+
if (IsOpenParen(pattern, index))
|
|
812
|
+
count += 1;
|
|
813
|
+
if (IsCloseParen(pattern, index))
|
|
814
|
+
count -= 1;
|
|
815
|
+
if (count === 0 && index !== pattern.length - 1)
|
|
816
|
+
return false;
|
|
817
|
+
}
|
|
818
|
+
return true;
|
|
819
|
+
}
|
|
820
|
+
function InGroup(pattern) {
|
|
821
|
+
return pattern.slice(1, pattern.length - 1);
|
|
822
|
+
}
|
|
823
|
+
function IsPrecedenceOr(pattern) {
|
|
824
|
+
let count = 0;
|
|
825
|
+
for (let index = 0; index < pattern.length; index++) {
|
|
826
|
+
if (IsOpenParen(pattern, index))
|
|
827
|
+
count += 1;
|
|
828
|
+
if (IsCloseParen(pattern, index))
|
|
829
|
+
count -= 1;
|
|
830
|
+
if (IsSeparator(pattern, index) && count === 0)
|
|
831
|
+
return true;
|
|
832
|
+
}
|
|
833
|
+
return false;
|
|
834
|
+
}
|
|
835
|
+
function IsPrecedenceAnd(pattern) {
|
|
836
|
+
for (let index = 0; index < pattern.length; index++) {
|
|
837
|
+
if (IsOpenParen(pattern, index))
|
|
838
|
+
return true;
|
|
839
|
+
}
|
|
840
|
+
return false;
|
|
841
|
+
}
|
|
842
|
+
function Or(pattern) {
|
|
843
|
+
let [count, start] = [0, 0];
|
|
844
|
+
const expressions = [];
|
|
845
|
+
for (let index = 0; index < pattern.length; index++) {
|
|
846
|
+
if (IsOpenParen(pattern, index))
|
|
847
|
+
count += 1;
|
|
848
|
+
if (IsCloseParen(pattern, index))
|
|
849
|
+
count -= 1;
|
|
850
|
+
if (IsSeparator(pattern, index) && count === 0) {
|
|
851
|
+
const range2 = pattern.slice(start, index);
|
|
852
|
+
if (range2.length > 0)
|
|
853
|
+
expressions.push(TemplateLiteralParse(range2));
|
|
854
|
+
start = index + 1;
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
const range = pattern.slice(start);
|
|
858
|
+
if (range.length > 0)
|
|
859
|
+
expressions.push(TemplateLiteralParse(range));
|
|
860
|
+
if (expressions.length === 0)
|
|
861
|
+
return { type: "const", const: "" };
|
|
862
|
+
if (expressions.length === 1)
|
|
863
|
+
return expressions[0];
|
|
864
|
+
return { type: "or", expr: expressions };
|
|
865
|
+
}
|
|
866
|
+
function And(pattern) {
|
|
867
|
+
function Group(value, index) {
|
|
868
|
+
if (!IsOpenParen(value, index))
|
|
869
|
+
throw new TemplateLiteralParserError(`TemplateLiteralParser: Index must point to open parens`);
|
|
870
|
+
let count = 0;
|
|
871
|
+
for (let scan = index; scan < value.length; scan++) {
|
|
872
|
+
if (IsOpenParen(value, scan))
|
|
873
|
+
count += 1;
|
|
874
|
+
if (IsCloseParen(value, scan))
|
|
875
|
+
count -= 1;
|
|
876
|
+
if (count === 0)
|
|
877
|
+
return [index, scan];
|
|
878
|
+
}
|
|
879
|
+
throw new TemplateLiteralParserError(`TemplateLiteralParser: Unclosed group parens in expression`);
|
|
880
|
+
}
|
|
881
|
+
function Range(pattern2, index) {
|
|
882
|
+
for (let scan = index; scan < pattern2.length; scan++) {
|
|
883
|
+
if (IsOpenParen(pattern2, scan))
|
|
884
|
+
return [index, scan];
|
|
885
|
+
}
|
|
886
|
+
return [index, pattern2.length];
|
|
887
|
+
}
|
|
888
|
+
const expressions = [];
|
|
889
|
+
for (let index = 0; index < pattern.length; index++) {
|
|
890
|
+
if (IsOpenParen(pattern, index)) {
|
|
891
|
+
const [start, end] = Group(pattern, index);
|
|
892
|
+
const range = pattern.slice(start, end + 1);
|
|
893
|
+
expressions.push(TemplateLiteralParse(range));
|
|
894
|
+
index = end;
|
|
895
|
+
} else {
|
|
896
|
+
const [start, end] = Range(pattern, index);
|
|
897
|
+
const range = pattern.slice(start, end);
|
|
898
|
+
if (range.length > 0)
|
|
899
|
+
expressions.push(TemplateLiteralParse(range));
|
|
900
|
+
index = end - 1;
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
return expressions.length === 0 ? { type: "const", const: "" } : expressions.length === 1 ? expressions[0] : { type: "and", expr: expressions };
|
|
904
|
+
}
|
|
905
|
+
function TemplateLiteralParse(pattern) {
|
|
906
|
+
return IsGroup(pattern) ? TemplateLiteralParse(InGroup(pattern)) : IsPrecedenceOr(pattern) ? Or(pattern) : IsPrecedenceAnd(pattern) ? And(pattern) : { type: "const", const: Unescape(pattern) };
|
|
907
|
+
}
|
|
908
|
+
function TemplateLiteralParseExact(pattern) {
|
|
909
|
+
return TemplateLiteralParse(pattern.slice(1, pattern.length - 1));
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
// node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.mjs
|
|
913
|
+
var TemplateLiteralFiniteError = class extends TypeBoxError {
|
|
914
|
+
};
|
|
915
|
+
function IsNumberExpression(expression) {
|
|
916
|
+
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]*";
|
|
917
|
+
}
|
|
918
|
+
function IsBooleanExpression(expression) {
|
|
919
|
+
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";
|
|
920
|
+
}
|
|
921
|
+
function IsStringExpression(expression) {
|
|
922
|
+
return expression.type === "const" && expression.const === ".*";
|
|
923
|
+
}
|
|
924
|
+
function IsTemplateLiteralExpressionFinite(expression) {
|
|
925
|
+
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 : (() => {
|
|
926
|
+
throw new TemplateLiteralFiniteError(`Unknown expression type`);
|
|
927
|
+
})();
|
|
928
|
+
}
|
|
929
|
+
function IsTemplateLiteralFinite(schema) {
|
|
930
|
+
const expression = TemplateLiteralParseExact(schema.pattern);
|
|
931
|
+
return IsTemplateLiteralExpressionFinite(expression);
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
// node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.mjs
|
|
935
|
+
var TemplateLiteralGenerateError = class extends TypeBoxError {
|
|
936
|
+
};
|
|
937
|
+
function* GenerateReduce(buffer) {
|
|
938
|
+
if (buffer.length === 1)
|
|
939
|
+
return yield* buffer[0];
|
|
940
|
+
for (const left of buffer[0]) {
|
|
941
|
+
for (const right of GenerateReduce(buffer.slice(1))) {
|
|
942
|
+
yield `${left}${right}`;
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
function* GenerateAnd(expression) {
|
|
947
|
+
return yield* GenerateReduce(expression.expr.map((expr) => [...TemplateLiteralExpressionGenerate(expr)]));
|
|
948
|
+
}
|
|
949
|
+
function* GenerateOr(expression) {
|
|
950
|
+
for (const expr of expression.expr)
|
|
951
|
+
yield* TemplateLiteralExpressionGenerate(expr);
|
|
952
|
+
}
|
|
953
|
+
function* GenerateConst(expression) {
|
|
954
|
+
return yield expression.const;
|
|
955
|
+
}
|
|
956
|
+
function* TemplateLiteralExpressionGenerate(expression) {
|
|
957
|
+
return expression.type === "and" ? yield* GenerateAnd(expression) : expression.type === "or" ? yield* GenerateOr(expression) : expression.type === "const" ? yield* GenerateConst(expression) : (() => {
|
|
958
|
+
throw new TemplateLiteralGenerateError("Unknown expression");
|
|
959
|
+
})();
|
|
960
|
+
}
|
|
961
|
+
function TemplateLiteralGenerate(schema) {
|
|
962
|
+
const expression = TemplateLiteralParseExact(schema.pattern);
|
|
963
|
+
return IsTemplateLiteralExpressionFinite(expression) ? [...TemplateLiteralExpressionGenerate(expression)] : [];
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
// node_modules/@sinclair/typebox/build/esm/type/literal/literal.mjs
|
|
967
|
+
function Literal(value, options) {
|
|
968
|
+
return CreateType({
|
|
969
|
+
[Kind]: "Literal",
|
|
970
|
+
const: value,
|
|
971
|
+
type: typeof value
|
|
972
|
+
}, options);
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
// node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.mjs
|
|
976
|
+
function Boolean2(options) {
|
|
977
|
+
return CreateType({ [Kind]: "Boolean", type: "boolean" }, options);
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
// node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.mjs
|
|
981
|
+
function BigInt(options) {
|
|
982
|
+
return CreateType({ [Kind]: "BigInt", type: "bigint" }, options);
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
// node_modules/@sinclair/typebox/build/esm/type/number/number.mjs
|
|
986
|
+
function Number2(options) {
|
|
987
|
+
return CreateType({ [Kind]: "Number", type: "number" }, options);
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
// node_modules/@sinclair/typebox/build/esm/type/string/string.mjs
|
|
991
|
+
function String2(options) {
|
|
992
|
+
return CreateType({ [Kind]: "String", type: "string" }, options);
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
// node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.mjs
|
|
996
|
+
function* FromUnion(syntax) {
|
|
997
|
+
const trim = syntax.trim().replace(/"|'/g, "");
|
|
998
|
+
return trim === "boolean" ? yield Boolean2() : trim === "number" ? yield Number2() : trim === "bigint" ? yield BigInt() : trim === "string" ? yield String2() : yield (() => {
|
|
999
|
+
const literals = trim.split("|").map((literal) => Literal(literal.trim()));
|
|
1000
|
+
return literals.length === 0 ? Never() : literals.length === 1 ? literals[0] : UnionEvaluated(literals);
|
|
1001
|
+
})();
|
|
1002
|
+
}
|
|
1003
|
+
function* FromTerminal(syntax) {
|
|
1004
|
+
if (syntax[1] !== "{") {
|
|
1005
|
+
const L = Literal("$");
|
|
1006
|
+
const R = FromSyntax(syntax.slice(1));
|
|
1007
|
+
return yield* [L, ...R];
|
|
1008
|
+
}
|
|
1009
|
+
for (let i = 2; i < syntax.length; i++) {
|
|
1010
|
+
if (syntax[i] === "}") {
|
|
1011
|
+
const L = FromUnion(syntax.slice(2, i));
|
|
1012
|
+
const R = FromSyntax(syntax.slice(i + 1));
|
|
1013
|
+
return yield* [...L, ...R];
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
yield Literal(syntax);
|
|
1017
|
+
}
|
|
1018
|
+
function* FromSyntax(syntax) {
|
|
1019
|
+
for (let i = 0; i < syntax.length; i++) {
|
|
1020
|
+
if (syntax[i] === "$") {
|
|
1021
|
+
const L = Literal(syntax.slice(0, i));
|
|
1022
|
+
const R = FromTerminal(syntax.slice(i));
|
|
1023
|
+
return yield* [L, ...R];
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
yield Literal(syntax);
|
|
1027
|
+
}
|
|
1028
|
+
function TemplateLiteralSyntax(syntax) {
|
|
1029
|
+
return [...FromSyntax(syntax)];
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
// node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.mjs
|
|
1033
|
+
var TemplateLiteralPatternError = class extends TypeBoxError {
|
|
1034
|
+
};
|
|
1035
|
+
function Escape(value) {
|
|
1036
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1037
|
+
}
|
|
1038
|
+
function Visit2(schema, acc) {
|
|
1039
|
+
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}` : (() => {
|
|
1040
|
+
throw new TemplateLiteralPatternError(`Unexpected Kind '${schema[Kind]}'`);
|
|
1041
|
+
})();
|
|
1042
|
+
}
|
|
1043
|
+
function TemplateLiteralPattern(kinds) {
|
|
1044
|
+
return `^${kinds.map((schema) => Visit2(schema, "")).join("")}$`;
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
// node_modules/@sinclair/typebox/build/esm/type/template-literal/union.mjs
|
|
1048
|
+
function TemplateLiteralToUnion(schema) {
|
|
1049
|
+
const R = TemplateLiteralGenerate(schema);
|
|
1050
|
+
const L = R.map((S) => Literal(S));
|
|
1051
|
+
return UnionEvaluated(L);
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
// node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.mjs
|
|
1055
|
+
function TemplateLiteral(unresolved, options) {
|
|
1056
|
+
const pattern = IsString(unresolved) ? TemplateLiteralPattern(TemplateLiteralSyntax(unresolved)) : TemplateLiteralPattern(unresolved);
|
|
1057
|
+
return CreateType({ [Kind]: "TemplateLiteral", type: "string", pattern }, options);
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
// node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.mjs
|
|
1061
|
+
function FromTemplateLiteral(templateLiteral) {
|
|
1062
|
+
const keys = TemplateLiteralGenerate(templateLiteral);
|
|
1063
|
+
return keys.map((key) => key.toString());
|
|
1064
|
+
}
|
|
1065
|
+
function FromUnion2(types) {
|
|
1066
|
+
const result = [];
|
|
1067
|
+
for (const type of types)
|
|
1068
|
+
result.push(...IndexPropertyKeys(type));
|
|
1069
|
+
return result;
|
|
1070
|
+
}
|
|
1071
|
+
function FromLiteral(literalValue) {
|
|
1072
|
+
return [literalValue.toString()];
|
|
1073
|
+
}
|
|
1074
|
+
function IndexPropertyKeys(type) {
|
|
1075
|
+
return [...new Set(IsTemplateLiteral(type) ? FromTemplateLiteral(type) : IsUnion(type) ? FromUnion2(type.anyOf) : IsLiteral(type) ? FromLiteral(type.const) : IsNumber3(type) ? ["[number]"] : IsInteger(type) ? ["[number]"] : [])];
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
// node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.mjs
|
|
1079
|
+
function FromProperties(type, properties, options) {
|
|
1080
|
+
const result = {};
|
|
1081
|
+
for (const K2 of Object.getOwnPropertyNames(properties)) {
|
|
1082
|
+
result[K2] = Index(type, IndexPropertyKeys(properties[K2]), options);
|
|
1083
|
+
}
|
|
1084
|
+
return result;
|
|
1085
|
+
}
|
|
1086
|
+
function FromMappedResult(type, mappedResult, options) {
|
|
1087
|
+
return FromProperties(type, mappedResult.properties, options);
|
|
1088
|
+
}
|
|
1089
|
+
function IndexFromMappedResult(type, mappedResult, options) {
|
|
1090
|
+
const properties = FromMappedResult(type, mappedResult, options);
|
|
1091
|
+
return MappedResult(properties);
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
// node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.mjs
|
|
1095
|
+
function FromRest(types, key) {
|
|
1096
|
+
return types.map((type) => IndexFromPropertyKey(type, key));
|
|
1097
|
+
}
|
|
1098
|
+
function FromIntersectRest(types) {
|
|
1099
|
+
return types.filter((type) => !IsNever(type));
|
|
1100
|
+
}
|
|
1101
|
+
function FromIntersect(types, key) {
|
|
1102
|
+
return IntersectEvaluated(FromIntersectRest(FromRest(types, key)));
|
|
1103
|
+
}
|
|
1104
|
+
function FromUnionRest(types) {
|
|
1105
|
+
return types.some((L) => IsNever(L)) ? [] : types;
|
|
1106
|
+
}
|
|
1107
|
+
function FromUnion3(types, key) {
|
|
1108
|
+
return UnionEvaluated(FromUnionRest(FromRest(types, key)));
|
|
1109
|
+
}
|
|
1110
|
+
function FromTuple(types, key) {
|
|
1111
|
+
return key in types ? types[key] : key === "[number]" ? UnionEvaluated(types) : Never();
|
|
1112
|
+
}
|
|
1113
|
+
function FromArray(type, key) {
|
|
1114
|
+
return key === "[number]" ? type : Never();
|
|
1115
|
+
}
|
|
1116
|
+
function FromProperty(properties, propertyKey) {
|
|
1117
|
+
return propertyKey in properties ? properties[propertyKey] : Never();
|
|
1118
|
+
}
|
|
1119
|
+
function IndexFromPropertyKey(type, propertyKey) {
|
|
1120
|
+
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();
|
|
1121
|
+
}
|
|
1122
|
+
function IndexFromPropertyKeys(type, propertyKeys) {
|
|
1123
|
+
return propertyKeys.map((propertyKey) => IndexFromPropertyKey(type, propertyKey));
|
|
1124
|
+
}
|
|
1125
|
+
function FromSchema(type, propertyKeys) {
|
|
1126
|
+
return UnionEvaluated(IndexFromPropertyKeys(type, propertyKeys));
|
|
1127
|
+
}
|
|
1128
|
+
function Index(type, key, options) {
|
|
1129
|
+
if (IsRef(type) || IsRef(key)) {
|
|
1130
|
+
const error = `Index types using Ref parameters require both Type and Key to be of TSchema`;
|
|
1131
|
+
if (!IsSchema(type) || !IsSchema(key))
|
|
1132
|
+
throw new TypeBoxError(error);
|
|
1133
|
+
return Computed("Index", [type, key]);
|
|
1134
|
+
}
|
|
1135
|
+
if (IsMappedResult(key))
|
|
1136
|
+
return IndexFromMappedResult(type, key, options);
|
|
1137
|
+
if (IsMappedKey(key))
|
|
1138
|
+
return IndexFromMappedKey(type, key, options);
|
|
1139
|
+
return CreateType(IsSchema(key) ? FromSchema(type, IndexPropertyKeys(key)) : FromSchema(type, key), options);
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
// node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.mjs
|
|
1143
|
+
function MappedIndexPropertyKey(type, key, options) {
|
|
1144
|
+
return { [key]: Index(type, [key], Clone(options)) };
|
|
1145
|
+
}
|
|
1146
|
+
function MappedIndexPropertyKeys(type, propertyKeys, options) {
|
|
1147
|
+
return propertyKeys.reduce((result, left) => {
|
|
1148
|
+
return { ...result, ...MappedIndexPropertyKey(type, left, options) };
|
|
1149
|
+
}, {});
|
|
1150
|
+
}
|
|
1151
|
+
function MappedIndexProperties(type, mappedKey, options) {
|
|
1152
|
+
return MappedIndexPropertyKeys(type, mappedKey.keys, options);
|
|
1153
|
+
}
|
|
1154
|
+
function IndexFromMappedKey(type, mappedKey, options) {
|
|
1155
|
+
const properties = MappedIndexProperties(type, mappedKey, options);
|
|
1156
|
+
return MappedResult(properties);
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
// node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.mjs
|
|
1160
|
+
function Iterator(items, options) {
|
|
1161
|
+
return CreateType({ [Kind]: "Iterator", type: "Iterator", items }, options);
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
// node_modules/@sinclair/typebox/build/esm/type/object/object.mjs
|
|
1165
|
+
function RequiredArray(properties) {
|
|
1166
|
+
return globalThis.Object.keys(properties).filter((key) => !IsOptional(properties[key]));
|
|
1167
|
+
}
|
|
1168
|
+
function _Object(properties, options) {
|
|
1169
|
+
const required = RequiredArray(properties);
|
|
1170
|
+
const schema = required.length > 0 ? { [Kind]: "Object", type: "object", required, properties } : { [Kind]: "Object", type: "object", properties };
|
|
1171
|
+
return CreateType(schema, options);
|
|
1172
|
+
}
|
|
1173
|
+
var Object2 = _Object;
|
|
1174
|
+
|
|
1175
|
+
// node_modules/@sinclair/typebox/build/esm/type/promise/promise.mjs
|
|
1176
|
+
function Promise2(item, options) {
|
|
1177
|
+
return CreateType({ [Kind]: "Promise", type: "Promise", item }, options);
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
// node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.mjs
|
|
1181
|
+
function RemoveReadonly(schema) {
|
|
1182
|
+
return CreateType(Discard(schema, [ReadonlyKind]));
|
|
1183
|
+
}
|
|
1184
|
+
function AddReadonly(schema) {
|
|
1185
|
+
return CreateType({ ...schema, [ReadonlyKind]: "Readonly" });
|
|
1186
|
+
}
|
|
1187
|
+
function ReadonlyWithFlag(schema, F) {
|
|
1188
|
+
return F === false ? RemoveReadonly(schema) : AddReadonly(schema);
|
|
1189
|
+
}
|
|
1190
|
+
function Readonly(schema, enable) {
|
|
1191
|
+
const F = enable ?? true;
|
|
1192
|
+
return IsMappedResult(schema) ? ReadonlyFromMappedResult(schema, F) : ReadonlyWithFlag(schema, F);
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
// node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.mjs
|
|
1196
|
+
function FromProperties2(K, F) {
|
|
1197
|
+
const Acc = {};
|
|
1198
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(K))
|
|
1199
|
+
Acc[K2] = Readonly(K[K2], F);
|
|
1200
|
+
return Acc;
|
|
1201
|
+
}
|
|
1202
|
+
function FromMappedResult2(R, F) {
|
|
1203
|
+
return FromProperties2(R.properties, F);
|
|
1204
|
+
}
|
|
1205
|
+
function ReadonlyFromMappedResult(R, F) {
|
|
1206
|
+
const P = FromMappedResult2(R, F);
|
|
1207
|
+
return MappedResult(P);
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
// node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.mjs
|
|
1211
|
+
function Tuple(types, options) {
|
|
1212
|
+
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);
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
// node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.mjs
|
|
1216
|
+
function FromMappedResult3(K, P) {
|
|
1217
|
+
return K in P ? FromSchemaType(K, P[K]) : MappedResult(P);
|
|
1218
|
+
}
|
|
1219
|
+
function MappedKeyToKnownMappedResultProperties(K) {
|
|
1220
|
+
return { [K]: Literal(K) };
|
|
1221
|
+
}
|
|
1222
|
+
function MappedKeyToUnknownMappedResultProperties(P) {
|
|
1223
|
+
const Acc = {};
|
|
1224
|
+
for (const L of P)
|
|
1225
|
+
Acc[L] = Literal(L);
|
|
1226
|
+
return Acc;
|
|
1227
|
+
}
|
|
1228
|
+
function MappedKeyToMappedResultProperties(K, P) {
|
|
1229
|
+
return SetIncludes(P, K) ? MappedKeyToKnownMappedResultProperties(K) : MappedKeyToUnknownMappedResultProperties(P);
|
|
1230
|
+
}
|
|
1231
|
+
function FromMappedKey(K, P) {
|
|
1232
|
+
const R = MappedKeyToMappedResultProperties(K, P);
|
|
1233
|
+
return FromMappedResult3(K, R);
|
|
1234
|
+
}
|
|
1235
|
+
function FromRest2(K, T) {
|
|
1236
|
+
return T.map((L) => FromSchemaType(K, L));
|
|
1237
|
+
}
|
|
1238
|
+
function FromProperties3(K, T) {
|
|
1239
|
+
const Acc = {};
|
|
1240
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(T))
|
|
1241
|
+
Acc[K2] = FromSchemaType(K, T[K2]);
|
|
1242
|
+
return Acc;
|
|
1243
|
+
}
|
|
1244
|
+
function FromSchemaType(K, T) {
|
|
1245
|
+
const options = { ...T };
|
|
1246
|
+
return (
|
|
1247
|
+
// unevaluated modifier types
|
|
1248
|
+
IsOptional(T) ? Optional(FromSchemaType(K, Discard(T, [OptionalKind]))) : IsReadonly(T) ? Readonly(FromSchemaType(K, Discard(T, [ReadonlyKind]))) : (
|
|
1249
|
+
// unevaluated mapped types
|
|
1250
|
+
IsMappedResult(T) ? FromMappedResult3(K, T.properties) : IsMappedKey(T) ? FromMappedKey(K, T.keys) : (
|
|
1251
|
+
// unevaluated types
|
|
1252
|
+
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
|
|
1253
|
+
)
|
|
1254
|
+
)
|
|
1255
|
+
);
|
|
1256
|
+
}
|
|
1257
|
+
function MappedFunctionReturnType(K, T) {
|
|
1258
|
+
const Acc = {};
|
|
1259
|
+
for (const L of K)
|
|
1260
|
+
Acc[L] = FromSchemaType(L, T);
|
|
1261
|
+
return Acc;
|
|
1262
|
+
}
|
|
1263
|
+
function Mapped(key, map, options) {
|
|
1264
|
+
const K = IsSchema(key) ? IndexPropertyKeys(key) : key;
|
|
1265
|
+
const RT = map({ [Kind]: "MappedKey", keys: K });
|
|
1266
|
+
const R = MappedFunctionReturnType(K, RT);
|
|
1267
|
+
return Object2(R, options);
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
// node_modules/@sinclair/typebox/build/esm/type/optional/optional.mjs
|
|
1271
|
+
function RemoveOptional(schema) {
|
|
1272
|
+
return CreateType(Discard(schema, [OptionalKind]));
|
|
1273
|
+
}
|
|
1274
|
+
function AddOptional(schema) {
|
|
1275
|
+
return CreateType({ ...schema, [OptionalKind]: "Optional" });
|
|
1276
|
+
}
|
|
1277
|
+
function OptionalWithFlag(schema, F) {
|
|
1278
|
+
return F === false ? RemoveOptional(schema) : AddOptional(schema);
|
|
1279
|
+
}
|
|
1280
|
+
function Optional(schema, enable) {
|
|
1281
|
+
const F = enable ?? true;
|
|
1282
|
+
return IsMappedResult(schema) ? OptionalFromMappedResult(schema, F) : OptionalWithFlag(schema, F);
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
// node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.mjs
|
|
1286
|
+
function FromProperties4(P, F) {
|
|
1287
|
+
const Acc = {};
|
|
1288
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
|
|
1289
|
+
Acc[K2] = Optional(P[K2], F);
|
|
1290
|
+
return Acc;
|
|
1291
|
+
}
|
|
1292
|
+
function FromMappedResult4(R, F) {
|
|
1293
|
+
return FromProperties4(R.properties, F);
|
|
1294
|
+
}
|
|
1295
|
+
function OptionalFromMappedResult(R, F) {
|
|
1296
|
+
const P = FromMappedResult4(R, F);
|
|
1297
|
+
return MappedResult(P);
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
// node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.mjs
|
|
1301
|
+
function IntersectCreate(T, options = {}) {
|
|
1302
|
+
const allObjects = T.every((schema) => IsObject3(schema));
|
|
1303
|
+
const clonedUnevaluatedProperties = IsSchema(options.unevaluatedProperties) ? { unevaluatedProperties: options.unevaluatedProperties } : {};
|
|
1304
|
+
return CreateType(options.unevaluatedProperties === false || IsSchema(options.unevaluatedProperties) || allObjects ? { ...clonedUnevaluatedProperties, [Kind]: "Intersect", type: "object", allOf: T } : { ...clonedUnevaluatedProperties, [Kind]: "Intersect", allOf: T }, options);
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
// node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.mjs
|
|
1308
|
+
function IsIntersectOptional(types) {
|
|
1309
|
+
return types.every((left) => IsOptional(left));
|
|
1310
|
+
}
|
|
1311
|
+
function RemoveOptionalFromType2(type) {
|
|
1312
|
+
return Discard(type, [OptionalKind]);
|
|
1313
|
+
}
|
|
1314
|
+
function RemoveOptionalFromRest2(types) {
|
|
1315
|
+
return types.map((left) => IsOptional(left) ? RemoveOptionalFromType2(left) : left);
|
|
1316
|
+
}
|
|
1317
|
+
function ResolveIntersect(types, options) {
|
|
1318
|
+
return IsIntersectOptional(types) ? Optional(IntersectCreate(RemoveOptionalFromRest2(types), options)) : IntersectCreate(RemoveOptionalFromRest2(types), options);
|
|
1319
|
+
}
|
|
1320
|
+
function IntersectEvaluated(types, options = {}) {
|
|
1321
|
+
if (types.length === 1)
|
|
1322
|
+
return CreateType(types[0], options);
|
|
1323
|
+
if (types.length === 0)
|
|
1324
|
+
return Never(options);
|
|
1325
|
+
if (types.some((schema) => IsTransform(schema)))
|
|
1326
|
+
throw new Error("Cannot intersect transform types");
|
|
1327
|
+
return ResolveIntersect(types, options);
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
// node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.mjs
|
|
1331
|
+
function Intersect(types, options) {
|
|
1332
|
+
if (types.length === 1)
|
|
1333
|
+
return CreateType(types[0], options);
|
|
1334
|
+
if (types.length === 0)
|
|
1335
|
+
return Never(options);
|
|
1336
|
+
if (types.some((schema) => IsTransform(schema)))
|
|
1337
|
+
throw new Error("Cannot intersect transform types");
|
|
1338
|
+
return IntersectCreate(types, options);
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
// node_modules/@sinclair/typebox/build/esm/type/ref/ref.mjs
|
|
1342
|
+
function Ref(...args) {
|
|
1343
|
+
const [$ref, options] = typeof args[0] === "string" ? [args[0], args[1]] : [args[0].$id, args[1]];
|
|
1344
|
+
if (typeof $ref !== "string")
|
|
1345
|
+
throw new TypeBoxError("Ref: $ref must be a string");
|
|
1346
|
+
return CreateType({ [Kind]: "Ref", $ref }, options);
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
// node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.mjs
|
|
1350
|
+
function FromComputed(target, parameters) {
|
|
1351
|
+
return Computed("Awaited", [Computed(target, parameters)]);
|
|
1352
|
+
}
|
|
1353
|
+
function FromRef($ref) {
|
|
1354
|
+
return Computed("Awaited", [Ref($ref)]);
|
|
1355
|
+
}
|
|
1356
|
+
function FromIntersect2(types) {
|
|
1357
|
+
return Intersect(FromRest3(types));
|
|
1358
|
+
}
|
|
1359
|
+
function FromUnion4(types) {
|
|
1360
|
+
return Union(FromRest3(types));
|
|
1361
|
+
}
|
|
1362
|
+
function FromPromise(type) {
|
|
1363
|
+
return Awaited(type);
|
|
1364
|
+
}
|
|
1365
|
+
function FromRest3(types) {
|
|
1366
|
+
return types.map((type) => Awaited(type));
|
|
1367
|
+
}
|
|
1368
|
+
function Awaited(type, options) {
|
|
1369
|
+
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);
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
// node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.mjs
|
|
1373
|
+
function FromRest4(types) {
|
|
1374
|
+
const result = [];
|
|
1375
|
+
for (const L of types)
|
|
1376
|
+
result.push(KeyOfPropertyKeys(L));
|
|
1377
|
+
return result;
|
|
1378
|
+
}
|
|
1379
|
+
function FromIntersect3(types) {
|
|
1380
|
+
const propertyKeysArray = FromRest4(types);
|
|
1381
|
+
const propertyKeys = SetUnionMany(propertyKeysArray);
|
|
1382
|
+
return propertyKeys;
|
|
1383
|
+
}
|
|
1384
|
+
function FromUnion5(types) {
|
|
1385
|
+
const propertyKeysArray = FromRest4(types);
|
|
1386
|
+
const propertyKeys = SetIntersectMany(propertyKeysArray);
|
|
1387
|
+
return propertyKeys;
|
|
1388
|
+
}
|
|
1389
|
+
function FromTuple2(types) {
|
|
1390
|
+
return types.map((_, indexer) => indexer.toString());
|
|
1391
|
+
}
|
|
1392
|
+
function FromArray2(_) {
|
|
1393
|
+
return ["[number]"];
|
|
1394
|
+
}
|
|
1395
|
+
function FromProperties5(T) {
|
|
1396
|
+
return globalThis.Object.getOwnPropertyNames(T);
|
|
1397
|
+
}
|
|
1398
|
+
function FromPatternProperties(patternProperties) {
|
|
1399
|
+
if (!includePatternProperties)
|
|
1400
|
+
return [];
|
|
1401
|
+
const patternPropertyKeys = globalThis.Object.getOwnPropertyNames(patternProperties);
|
|
1402
|
+
return patternPropertyKeys.map((key) => {
|
|
1403
|
+
return key[0] === "^" && key[key.length - 1] === "$" ? key.slice(1, key.length - 1) : key;
|
|
1404
|
+
});
|
|
1405
|
+
}
|
|
1406
|
+
function KeyOfPropertyKeys(type) {
|
|
1407
|
+
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) : [];
|
|
1408
|
+
}
|
|
1409
|
+
var includePatternProperties = false;
|
|
1410
|
+
|
|
1411
|
+
// node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.mjs
|
|
1412
|
+
function FromComputed2(target, parameters) {
|
|
1413
|
+
return Computed("KeyOf", [Computed(target, parameters)]);
|
|
1414
|
+
}
|
|
1415
|
+
function FromRef2($ref) {
|
|
1416
|
+
return Computed("KeyOf", [Ref($ref)]);
|
|
1417
|
+
}
|
|
1418
|
+
function KeyOfFromType(type, options) {
|
|
1419
|
+
const propertyKeys = KeyOfPropertyKeys(type);
|
|
1420
|
+
const propertyKeyTypes = KeyOfPropertyKeysToRest(propertyKeys);
|
|
1421
|
+
const result = UnionEvaluated(propertyKeyTypes);
|
|
1422
|
+
return CreateType(result, options);
|
|
1423
|
+
}
|
|
1424
|
+
function KeyOfPropertyKeysToRest(propertyKeys) {
|
|
1425
|
+
return propertyKeys.map((L) => L === "[number]" ? Number2() : Literal(L));
|
|
1426
|
+
}
|
|
1427
|
+
function KeyOf(type, options) {
|
|
1428
|
+
return IsComputed(type) ? FromComputed2(type.target, type.parameters) : IsRef(type) ? FromRef2(type.$ref) : IsMappedResult(type) ? KeyOfFromMappedResult(type, options) : KeyOfFromType(type, options);
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1431
|
+
// node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.mjs
|
|
1432
|
+
function FromProperties6(properties, options) {
|
|
1433
|
+
const result = {};
|
|
1434
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
|
|
1435
|
+
result[K2] = KeyOf(properties[K2], Clone(options));
|
|
1436
|
+
return result;
|
|
1437
|
+
}
|
|
1438
|
+
function FromMappedResult5(mappedResult, options) {
|
|
1439
|
+
return FromProperties6(mappedResult.properties, options);
|
|
1440
|
+
}
|
|
1441
|
+
function KeyOfFromMappedResult(mappedResult, options) {
|
|
1442
|
+
const properties = FromMappedResult5(mappedResult, options);
|
|
1443
|
+
return MappedResult(properties);
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
// node_modules/@sinclair/typebox/build/esm/type/composite/composite.mjs
|
|
1447
|
+
function CompositeKeys(T) {
|
|
1448
|
+
const Acc = [];
|
|
1449
|
+
for (const L of T)
|
|
1450
|
+
Acc.push(...KeyOfPropertyKeys(L));
|
|
1451
|
+
return SetDistinct(Acc);
|
|
1452
|
+
}
|
|
1453
|
+
function FilterNever(T) {
|
|
1454
|
+
return T.filter((L) => !IsNever(L));
|
|
1455
|
+
}
|
|
1456
|
+
function CompositeProperty(T, K) {
|
|
1457
|
+
const Acc = [];
|
|
1458
|
+
for (const L of T)
|
|
1459
|
+
Acc.push(...IndexFromPropertyKeys(L, [K]));
|
|
1460
|
+
return FilterNever(Acc);
|
|
1461
|
+
}
|
|
1462
|
+
function CompositeProperties(T, K) {
|
|
1463
|
+
const Acc = {};
|
|
1464
|
+
for (const L of K) {
|
|
1465
|
+
Acc[L] = IntersectEvaluated(CompositeProperty(T, L));
|
|
1466
|
+
}
|
|
1467
|
+
return Acc;
|
|
1468
|
+
}
|
|
1469
|
+
function Composite(T, options) {
|
|
1470
|
+
const K = CompositeKeys(T);
|
|
1471
|
+
const P = CompositeProperties(T, K);
|
|
1472
|
+
const R = Object2(P, options);
|
|
1473
|
+
return R;
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
// node_modules/@sinclair/typebox/build/esm/type/date/date.mjs
|
|
1477
|
+
function Date2(options) {
|
|
1478
|
+
return CreateType({ [Kind]: "Date", type: "Date" }, options);
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
// node_modules/@sinclair/typebox/build/esm/type/null/null.mjs
|
|
1482
|
+
function Null(options) {
|
|
1483
|
+
return CreateType({ [Kind]: "Null", type: "null" }, options);
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
// node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.mjs
|
|
1487
|
+
function Symbol2(options) {
|
|
1488
|
+
return CreateType({ [Kind]: "Symbol", type: "symbol" }, options);
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1491
|
+
// node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.mjs
|
|
1492
|
+
function Undefined(options) {
|
|
1493
|
+
return CreateType({ [Kind]: "Undefined", type: "undefined" }, options);
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
// node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.mjs
|
|
1497
|
+
function Uint8Array2(options) {
|
|
1498
|
+
return CreateType({ [Kind]: "Uint8Array", type: "Uint8Array" }, options);
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
// node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.mjs
|
|
1502
|
+
function Unknown(options) {
|
|
1503
|
+
return CreateType({ [Kind]: "Unknown" }, options);
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
// node_modules/@sinclair/typebox/build/esm/type/const/const.mjs
|
|
1507
|
+
function FromArray3(T) {
|
|
1508
|
+
return T.map((L) => FromValue(L, false));
|
|
1509
|
+
}
|
|
1510
|
+
function FromProperties7(value) {
|
|
1511
|
+
const Acc = {};
|
|
1512
|
+
for (const K of globalThis.Object.getOwnPropertyNames(value))
|
|
1513
|
+
Acc[K] = Readonly(FromValue(value[K], false));
|
|
1514
|
+
return Acc;
|
|
1515
|
+
}
|
|
1516
|
+
function ConditionalReadonly(T, root) {
|
|
1517
|
+
return root === true ? T : Readonly(T);
|
|
1518
|
+
}
|
|
1519
|
+
function FromValue(value, root) {
|
|
1520
|
+
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({});
|
|
1521
|
+
}
|
|
1522
|
+
function Const(T, options) {
|
|
1523
|
+
return CreateType(FromValue(T, true), options);
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
// node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.mjs
|
|
1527
|
+
function ConstructorParameters(schema, options) {
|
|
1528
|
+
return IsConstructor(schema) ? Tuple(schema.parameters, options) : Never(options);
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
// node_modules/@sinclair/typebox/build/esm/type/enum/enum.mjs
|
|
1532
|
+
function Enum(item, options) {
|
|
1533
|
+
if (IsUndefined(item))
|
|
1534
|
+
throw new Error("Enum undefined or empty");
|
|
1535
|
+
const values1 = globalThis.Object.getOwnPropertyNames(item).filter((key) => isNaN(key)).map((key) => item[key]);
|
|
1536
|
+
const values2 = [...new Set(values1)];
|
|
1537
|
+
const anyOf = values2.map((value) => Literal(value));
|
|
1538
|
+
return Union(anyOf, { ...options, [Hint]: "Enum" });
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
// node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.mjs
|
|
1542
|
+
var ExtendsResolverError = class extends TypeBoxError {
|
|
1543
|
+
};
|
|
1544
|
+
var ExtendsResult;
|
|
1545
|
+
(function(ExtendsResult2) {
|
|
1546
|
+
ExtendsResult2[ExtendsResult2["Union"] = 0] = "Union";
|
|
1547
|
+
ExtendsResult2[ExtendsResult2["True"] = 1] = "True";
|
|
1548
|
+
ExtendsResult2[ExtendsResult2["False"] = 2] = "False";
|
|
1549
|
+
})(ExtendsResult || (ExtendsResult = {}));
|
|
1550
|
+
function IntoBooleanResult(result) {
|
|
1551
|
+
return result === ExtendsResult.False ? result : ExtendsResult.True;
|
|
1552
|
+
}
|
|
1553
|
+
function Throw(message) {
|
|
1554
|
+
throw new ExtendsResolverError(message);
|
|
1555
|
+
}
|
|
1556
|
+
function IsStructuralRight(right) {
|
|
1557
|
+
return type_exports.IsNever(right) || type_exports.IsIntersect(right) || type_exports.IsUnion(right) || type_exports.IsUnknown(right) || type_exports.IsAny(right);
|
|
1558
|
+
}
|
|
1559
|
+
function StructuralRight(left, right) {
|
|
1560
|
+
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");
|
|
1561
|
+
}
|
|
1562
|
+
function FromAnyRight(left, right) {
|
|
1563
|
+
return ExtendsResult.True;
|
|
1564
|
+
}
|
|
1565
|
+
function FromAny(left, right) {
|
|
1566
|
+
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;
|
|
1567
|
+
}
|
|
1568
|
+
function FromArrayRight(left, right) {
|
|
1569
|
+
return type_exports.IsUnknown(left) ? ExtendsResult.False : type_exports.IsAny(left) ? ExtendsResult.Union : type_exports.IsNever(left) ? ExtendsResult.True : ExtendsResult.False;
|
|
1570
|
+
}
|
|
1571
|
+
function FromArray4(left, right) {
|
|
1572
|
+
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));
|
|
1573
|
+
}
|
|
1574
|
+
function FromAsyncIterator(left, right) {
|
|
1575
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : !type_exports.IsAsyncIterator(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.items, right.items));
|
|
1576
|
+
}
|
|
1577
|
+
function FromBigInt(left, right) {
|
|
1578
|
+
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;
|
|
1579
|
+
}
|
|
1580
|
+
function FromBooleanRight(left, right) {
|
|
1581
|
+
return type_exports.IsLiteralBoolean(left) ? ExtendsResult.True : type_exports.IsBoolean(left) ? ExtendsResult.True : ExtendsResult.False;
|
|
1582
|
+
}
|
|
1583
|
+
function FromBoolean(left, right) {
|
|
1584
|
+
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;
|
|
1585
|
+
}
|
|
1586
|
+
function FromConstructor(left, right) {
|
|
1587
|
+
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));
|
|
1588
|
+
}
|
|
1589
|
+
function FromDate(left, right) {
|
|
1590
|
+
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;
|
|
1591
|
+
}
|
|
1592
|
+
function FromFunction(left, right) {
|
|
1593
|
+
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));
|
|
1594
|
+
}
|
|
1595
|
+
function FromIntegerRight(left, right) {
|
|
1596
|
+
return type_exports.IsLiteral(left) && value_exports.IsNumber(left.const) ? ExtendsResult.True : type_exports.IsNumber(left) || type_exports.IsInteger(left) ? ExtendsResult.True : ExtendsResult.False;
|
|
1597
|
+
}
|
|
1598
|
+
function FromInteger(left, right) {
|
|
1599
|
+
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;
|
|
1600
|
+
}
|
|
1601
|
+
function FromIntersectRight(left, right) {
|
|
1602
|
+
return right.allOf.every((schema) => Visit3(left, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
|
|
1603
|
+
}
|
|
1604
|
+
function FromIntersect4(left, right) {
|
|
1605
|
+
return left.allOf.some((schema) => Visit3(schema, right) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
|
|
1606
|
+
}
|
|
1607
|
+
function FromIterator(left, right) {
|
|
1608
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : !type_exports.IsIterator(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.items, right.items));
|
|
1609
|
+
}
|
|
1610
|
+
function FromLiteral2(left, right) {
|
|
1611
|
+
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;
|
|
1612
|
+
}
|
|
1613
|
+
function FromNeverRight(left, right) {
|
|
1614
|
+
return ExtendsResult.False;
|
|
1615
|
+
}
|
|
1616
|
+
function FromNever(left, right) {
|
|
1617
|
+
return ExtendsResult.True;
|
|
1618
|
+
}
|
|
1619
|
+
function UnwrapTNot(schema) {
|
|
1620
|
+
let [current, depth] = [schema, 0];
|
|
1621
|
+
while (true) {
|
|
1622
|
+
if (!type_exports.IsNot(current))
|
|
1623
|
+
break;
|
|
1624
|
+
current = current.not;
|
|
1625
|
+
depth += 1;
|
|
1626
|
+
}
|
|
1627
|
+
return depth % 2 === 0 ? current : Unknown();
|
|
1628
|
+
}
|
|
1629
|
+
function FromNot(left, right) {
|
|
1630
|
+
return type_exports.IsNot(left) ? Visit3(UnwrapTNot(left), right) : type_exports.IsNot(right) ? Visit3(left, UnwrapTNot(right)) : Throw("Invalid fallthrough for Not");
|
|
1631
|
+
}
|
|
1632
|
+
function FromNull(left, right) {
|
|
1633
|
+
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;
|
|
1634
|
+
}
|
|
1635
|
+
function FromNumberRight(left, right) {
|
|
1636
|
+
return type_exports.IsLiteralNumber(left) ? ExtendsResult.True : type_exports.IsNumber(left) || type_exports.IsInteger(left) ? ExtendsResult.True : ExtendsResult.False;
|
|
1637
|
+
}
|
|
1638
|
+
function FromNumber(left, right) {
|
|
1639
|
+
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;
|
|
1640
|
+
}
|
|
1641
|
+
function IsObjectPropertyCount(schema, count) {
|
|
1642
|
+
return Object.getOwnPropertyNames(schema.properties).length === count;
|
|
1643
|
+
}
|
|
1644
|
+
function IsObjectStringLike(schema) {
|
|
1645
|
+
return IsObjectArrayLike(schema);
|
|
1646
|
+
}
|
|
1647
|
+
function IsObjectSymbolLike(schema) {
|
|
1648
|
+
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]));
|
|
1649
|
+
}
|
|
1650
|
+
function IsObjectNumberLike(schema) {
|
|
1651
|
+
return IsObjectPropertyCount(schema, 0);
|
|
1652
|
+
}
|
|
1653
|
+
function IsObjectBooleanLike(schema) {
|
|
1654
|
+
return IsObjectPropertyCount(schema, 0);
|
|
1655
|
+
}
|
|
1656
|
+
function IsObjectBigIntLike(schema) {
|
|
1657
|
+
return IsObjectPropertyCount(schema, 0);
|
|
1658
|
+
}
|
|
1659
|
+
function IsObjectDateLike(schema) {
|
|
1660
|
+
return IsObjectPropertyCount(schema, 0);
|
|
1661
|
+
}
|
|
1662
|
+
function IsObjectUint8ArrayLike(schema) {
|
|
1663
|
+
return IsObjectArrayLike(schema);
|
|
1664
|
+
}
|
|
1665
|
+
function IsObjectFunctionLike(schema) {
|
|
1666
|
+
const length = Number2();
|
|
1667
|
+
return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "length" in schema.properties && IntoBooleanResult(Visit3(schema.properties["length"], length)) === ExtendsResult.True;
|
|
1668
|
+
}
|
|
1669
|
+
function IsObjectConstructorLike(schema) {
|
|
1670
|
+
return IsObjectPropertyCount(schema, 0);
|
|
1671
|
+
}
|
|
1672
|
+
function IsObjectArrayLike(schema) {
|
|
1673
|
+
const length = Number2();
|
|
1674
|
+
return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "length" in schema.properties && IntoBooleanResult(Visit3(schema.properties["length"], length)) === ExtendsResult.True;
|
|
1675
|
+
}
|
|
1676
|
+
function IsObjectPromiseLike(schema) {
|
|
1677
|
+
const then = Function([Any()], Any());
|
|
1678
|
+
return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "then" in schema.properties && IntoBooleanResult(Visit3(schema.properties["then"], then)) === ExtendsResult.True;
|
|
1679
|
+
}
|
|
1680
|
+
function Property(left, right) {
|
|
1681
|
+
return Visit3(left, right) === ExtendsResult.False ? ExtendsResult.False : type_exports.IsOptional(left) && !type_exports.IsOptional(right) ? ExtendsResult.False : ExtendsResult.True;
|
|
1682
|
+
}
|
|
1683
|
+
function FromObjectRight(left, right) {
|
|
1684
|
+
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)) ? (() => {
|
|
1685
|
+
return right[Hint] === "Record" ? ExtendsResult.True : ExtendsResult.False;
|
|
1686
|
+
})() : type_exports.IsRecord(left) && type_exports.IsNumber(RecordKey(left)) ? (() => {
|
|
1687
|
+
return IsObjectPropertyCount(right, 0) ? ExtendsResult.True : ExtendsResult.False;
|
|
1688
|
+
})() : ExtendsResult.False;
|
|
1689
|
+
}
|
|
1690
|
+
function FromObject(left, right) {
|
|
1691
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : !type_exports.IsObject(right) ? ExtendsResult.False : (() => {
|
|
1692
|
+
for (const key of Object.getOwnPropertyNames(right.properties)) {
|
|
1693
|
+
if (!(key in left.properties) && !type_exports.IsOptional(right.properties[key])) {
|
|
1694
|
+
return ExtendsResult.False;
|
|
1695
|
+
}
|
|
1696
|
+
if (type_exports.IsOptional(right.properties[key])) {
|
|
1697
|
+
return ExtendsResult.True;
|
|
1698
|
+
}
|
|
1699
|
+
if (Property(left.properties[key], right.properties[key]) === ExtendsResult.False) {
|
|
1700
|
+
return ExtendsResult.False;
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
return ExtendsResult.True;
|
|
1704
|
+
})();
|
|
1705
|
+
}
|
|
1706
|
+
function FromPromise2(left, right) {
|
|
1707
|
+
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));
|
|
1708
|
+
}
|
|
1709
|
+
function RecordKey(schema) {
|
|
1710
|
+
return PatternNumberExact in schema.patternProperties ? Number2() : PatternStringExact in schema.patternProperties ? String2() : Throw("Unknown record key pattern");
|
|
1711
|
+
}
|
|
1712
|
+
function RecordValue(schema) {
|
|
1713
|
+
return PatternNumberExact in schema.patternProperties ? schema.patternProperties[PatternNumberExact] : PatternStringExact in schema.patternProperties ? schema.patternProperties[PatternStringExact] : Throw("Unable to get record value schema");
|
|
1714
|
+
}
|
|
1715
|
+
function FromRecordRight(left, right) {
|
|
1716
|
+
const [Key, Value] = [RecordKey(right), RecordValue(right)];
|
|
1717
|
+
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) ? (() => {
|
|
1718
|
+
for (const key of Object.getOwnPropertyNames(left.properties)) {
|
|
1719
|
+
if (Property(Value, left.properties[key]) === ExtendsResult.False) {
|
|
1720
|
+
return ExtendsResult.False;
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1723
|
+
return ExtendsResult.True;
|
|
1724
|
+
})() : ExtendsResult.False;
|
|
1725
|
+
}
|
|
1726
|
+
function FromRecord(left, right) {
|
|
1727
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : !type_exports.IsRecord(right) ? ExtendsResult.False : Visit3(RecordValue(left), RecordValue(right));
|
|
1728
|
+
}
|
|
1729
|
+
function FromRegExp(left, right) {
|
|
1730
|
+
const L = type_exports.IsRegExp(left) ? String2() : left;
|
|
1731
|
+
const R = type_exports.IsRegExp(right) ? String2() : right;
|
|
1732
|
+
return Visit3(L, R);
|
|
1733
|
+
}
|
|
1734
|
+
function FromStringRight(left, right) {
|
|
1735
|
+
return type_exports.IsLiteral(left) && value_exports.IsString(left.const) ? ExtendsResult.True : type_exports.IsString(left) ? ExtendsResult.True : ExtendsResult.False;
|
|
1736
|
+
}
|
|
1737
|
+
function FromString(left, right) {
|
|
1738
|
+
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;
|
|
1739
|
+
}
|
|
1740
|
+
function FromSymbol(left, right) {
|
|
1741
|
+
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;
|
|
1742
|
+
}
|
|
1743
|
+
function FromTemplateLiteral2(left, right) {
|
|
1744
|
+
return type_exports.IsTemplateLiteral(left) ? Visit3(TemplateLiteralToUnion(left), right) : type_exports.IsTemplateLiteral(right) ? Visit3(left, TemplateLiteralToUnion(right)) : Throw("Invalid fallthrough for TemplateLiteral");
|
|
1745
|
+
}
|
|
1746
|
+
function IsArrayOfTuple(left, right) {
|
|
1747
|
+
return type_exports.IsArray(right) && left.items !== void 0 && left.items.every((schema) => Visit3(schema, right.items) === ExtendsResult.True);
|
|
1748
|
+
}
|
|
1749
|
+
function FromTupleRight(left, right) {
|
|
1750
|
+
return type_exports.IsNever(left) ? ExtendsResult.True : type_exports.IsUnknown(left) ? ExtendsResult.False : type_exports.IsAny(left) ? ExtendsResult.Union : ExtendsResult.False;
|
|
1751
|
+
}
|
|
1752
|
+
function FromTuple3(left, right) {
|
|
1753
|
+
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;
|
|
1754
|
+
}
|
|
1755
|
+
function FromUint8Array(left, right) {
|
|
1756
|
+
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;
|
|
1757
|
+
}
|
|
1758
|
+
function FromUndefined(left, right) {
|
|
1759
|
+
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;
|
|
1760
|
+
}
|
|
1761
|
+
function FromUnionRight(left, right) {
|
|
1762
|
+
return right.anyOf.some((schema) => Visit3(left, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
|
|
1763
|
+
}
|
|
1764
|
+
function FromUnion6(left, right) {
|
|
1765
|
+
return left.anyOf.every((schema) => Visit3(schema, right) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
|
|
1766
|
+
}
|
|
1767
|
+
function FromUnknownRight(left, right) {
|
|
1768
|
+
return ExtendsResult.True;
|
|
1769
|
+
}
|
|
1770
|
+
function FromUnknown(left, right) {
|
|
1771
|
+
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;
|
|
1772
|
+
}
|
|
1773
|
+
function FromVoidRight(left, right) {
|
|
1774
|
+
return type_exports.IsUndefined(left) ? ExtendsResult.True : type_exports.IsUndefined(left) ? ExtendsResult.True : ExtendsResult.False;
|
|
1775
|
+
}
|
|
1776
|
+
function FromVoid(left, right) {
|
|
1777
|
+
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;
|
|
1778
|
+
}
|
|
1779
|
+
function Visit3(left, right) {
|
|
1780
|
+
return (
|
|
1781
|
+
// resolvable
|
|
1782
|
+
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) : (
|
|
1783
|
+
// standard
|
|
1784
|
+
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]}'`)
|
|
1785
|
+
)
|
|
1786
|
+
);
|
|
1787
|
+
}
|
|
1788
|
+
function ExtendsCheck(left, right) {
|
|
1789
|
+
return Visit3(left, right);
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
// node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.mjs
|
|
1793
|
+
function FromProperties8(P, Right, True, False, options) {
|
|
1794
|
+
const Acc = {};
|
|
1795
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
|
|
1796
|
+
Acc[K2] = Extends(P[K2], Right, True, False, Clone(options));
|
|
1797
|
+
return Acc;
|
|
1798
|
+
}
|
|
1799
|
+
function FromMappedResult6(Left, Right, True, False, options) {
|
|
1800
|
+
return FromProperties8(Left.properties, Right, True, False, options);
|
|
1801
|
+
}
|
|
1802
|
+
function ExtendsFromMappedResult(Left, Right, True, False, options) {
|
|
1803
|
+
const P = FromMappedResult6(Left, Right, True, False, options);
|
|
1804
|
+
return MappedResult(P);
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
// node_modules/@sinclair/typebox/build/esm/type/extends/extends.mjs
|
|
1808
|
+
function ExtendsResolve(left, right, trueType, falseType) {
|
|
1809
|
+
const R = ExtendsCheck(left, right);
|
|
1810
|
+
return R === ExtendsResult.Union ? Union([trueType, falseType]) : R === ExtendsResult.True ? trueType : falseType;
|
|
1811
|
+
}
|
|
1812
|
+
function Extends(L, R, T, F, options) {
|
|
1813
|
+
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);
|
|
1814
|
+
}
|
|
1815
|
+
|
|
1816
|
+
// node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.mjs
|
|
1817
|
+
function FromPropertyKey(K, U, L, R, options) {
|
|
1818
|
+
return {
|
|
1819
|
+
[K]: Extends(Literal(K), U, L, R, Clone(options))
|
|
1820
|
+
};
|
|
1821
|
+
}
|
|
1822
|
+
function FromPropertyKeys(K, U, L, R, options) {
|
|
1823
|
+
return K.reduce((Acc, LK) => {
|
|
1824
|
+
return { ...Acc, ...FromPropertyKey(LK, U, L, R, options) };
|
|
1825
|
+
}, {});
|
|
1826
|
+
}
|
|
1827
|
+
function FromMappedKey2(K, U, L, R, options) {
|
|
1828
|
+
return FromPropertyKeys(K.keys, U, L, R, options);
|
|
1829
|
+
}
|
|
1830
|
+
function ExtendsFromMappedKey(T, U, L, R, options) {
|
|
1831
|
+
const P = FromMappedKey2(T, U, L, R, options);
|
|
1832
|
+
return MappedResult(P);
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1835
|
+
// node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-template-literal.mjs
|
|
1836
|
+
function ExcludeFromTemplateLiteral(L, R) {
|
|
1837
|
+
return Exclude(TemplateLiteralToUnion(L), R);
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
// node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.mjs
|
|
1841
|
+
function ExcludeRest(L, R) {
|
|
1842
|
+
const excluded = L.filter((inner) => ExtendsCheck(inner, R) === ExtendsResult.False);
|
|
1843
|
+
return excluded.length === 1 ? excluded[0] : Union(excluded);
|
|
1844
|
+
}
|
|
1845
|
+
function Exclude(L, R, options = {}) {
|
|
1846
|
+
if (IsTemplateLiteral(L))
|
|
1847
|
+
return CreateType(ExcludeFromTemplateLiteral(L, R), options);
|
|
1848
|
+
if (IsMappedResult(L))
|
|
1849
|
+
return CreateType(ExcludeFromMappedResult(L, R), options);
|
|
1850
|
+
return CreateType(IsUnion(L) ? ExcludeRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? Never() : L, options);
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1853
|
+
// node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.mjs
|
|
1854
|
+
function FromProperties9(P, U) {
|
|
1855
|
+
const Acc = {};
|
|
1856
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
|
|
1857
|
+
Acc[K2] = Exclude(P[K2], U);
|
|
1858
|
+
return Acc;
|
|
1859
|
+
}
|
|
1860
|
+
function FromMappedResult7(R, T) {
|
|
1861
|
+
return FromProperties9(R.properties, T);
|
|
1862
|
+
}
|
|
1863
|
+
function ExcludeFromMappedResult(R, T) {
|
|
1864
|
+
const P = FromMappedResult7(R, T);
|
|
1865
|
+
return MappedResult(P);
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
// node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.mjs
|
|
1869
|
+
function ExtractFromTemplateLiteral(L, R) {
|
|
1870
|
+
return Extract(TemplateLiteralToUnion(L), R);
|
|
1871
|
+
}
|
|
1872
|
+
|
|
1873
|
+
// node_modules/@sinclair/typebox/build/esm/type/extract/extract.mjs
|
|
1874
|
+
function ExtractRest(L, R) {
|
|
1875
|
+
const extracted = L.filter((inner) => ExtendsCheck(inner, R) !== ExtendsResult.False);
|
|
1876
|
+
return extracted.length === 1 ? extracted[0] : Union(extracted);
|
|
1877
|
+
}
|
|
1878
|
+
function Extract(L, R, options) {
|
|
1879
|
+
if (IsTemplateLiteral(L))
|
|
1880
|
+
return CreateType(ExtractFromTemplateLiteral(L, R), options);
|
|
1881
|
+
if (IsMappedResult(L))
|
|
1882
|
+
return CreateType(ExtractFromMappedResult(L, R), options);
|
|
1883
|
+
return CreateType(IsUnion(L) ? ExtractRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? L : Never(), options);
|
|
1884
|
+
}
|
|
1885
|
+
|
|
1886
|
+
// node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.mjs
|
|
1887
|
+
function FromProperties10(P, T) {
|
|
1888
|
+
const Acc = {};
|
|
1889
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
|
|
1890
|
+
Acc[K2] = Extract(P[K2], T);
|
|
1891
|
+
return Acc;
|
|
1892
|
+
}
|
|
1893
|
+
function FromMappedResult8(R, T) {
|
|
1894
|
+
return FromProperties10(R.properties, T);
|
|
1895
|
+
}
|
|
1896
|
+
function ExtractFromMappedResult(R, T) {
|
|
1897
|
+
const P = FromMappedResult8(R, T);
|
|
1898
|
+
return MappedResult(P);
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1901
|
+
// node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.mjs
|
|
1902
|
+
function InstanceType(schema, options) {
|
|
1903
|
+
return IsConstructor(schema) ? CreateType(schema.returns, options) : Never(options);
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
// node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.mjs
|
|
1907
|
+
function ReadonlyOptional(schema) {
|
|
1908
|
+
return Readonly(Optional(schema));
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1911
|
+
// node_modules/@sinclair/typebox/build/esm/type/record/record.mjs
|
|
1912
|
+
function RecordCreateFromPattern(pattern, T, options) {
|
|
1913
|
+
return CreateType({ [Kind]: "Record", type: "object", patternProperties: { [pattern]: T } }, options);
|
|
1914
|
+
}
|
|
1915
|
+
function RecordCreateFromKeys(K, T, options) {
|
|
1916
|
+
const result = {};
|
|
1917
|
+
for (const K2 of K)
|
|
1918
|
+
result[K2] = T;
|
|
1919
|
+
return Object2(result, { ...options, [Hint]: "Record" });
|
|
1920
|
+
}
|
|
1921
|
+
function FromTemplateLiteralKey(K, T, options) {
|
|
1922
|
+
return IsTemplateLiteralFinite(K) ? RecordCreateFromKeys(IndexPropertyKeys(K), T, options) : RecordCreateFromPattern(K.pattern, T, options);
|
|
1923
|
+
}
|
|
1924
|
+
function FromUnionKey(key, type, options) {
|
|
1925
|
+
return RecordCreateFromKeys(IndexPropertyKeys(Union(key)), type, options);
|
|
1926
|
+
}
|
|
1927
|
+
function FromLiteralKey(key, type, options) {
|
|
1928
|
+
return RecordCreateFromKeys([key.toString()], type, options);
|
|
1929
|
+
}
|
|
1930
|
+
function FromRegExpKey(key, type, options) {
|
|
1931
|
+
return RecordCreateFromPattern(key.source, type, options);
|
|
1932
|
+
}
|
|
1933
|
+
function FromStringKey(key, type, options) {
|
|
1934
|
+
const pattern = IsUndefined(key.pattern) ? PatternStringExact : key.pattern;
|
|
1935
|
+
return RecordCreateFromPattern(pattern, type, options);
|
|
1936
|
+
}
|
|
1937
|
+
function FromAnyKey(_, type, options) {
|
|
1938
|
+
return RecordCreateFromPattern(PatternStringExact, type, options);
|
|
1939
|
+
}
|
|
1940
|
+
function FromNeverKey(_key, type, options) {
|
|
1941
|
+
return RecordCreateFromPattern(PatternNeverExact, type, options);
|
|
1942
|
+
}
|
|
1943
|
+
function FromBooleanKey(_key, type, options) {
|
|
1944
|
+
return Object2({ true: type, false: type }, options);
|
|
1945
|
+
}
|
|
1946
|
+
function FromIntegerKey(_key, type, options) {
|
|
1947
|
+
return RecordCreateFromPattern(PatternNumberExact, type, options);
|
|
1948
|
+
}
|
|
1949
|
+
function FromNumberKey(_, type, options) {
|
|
1950
|
+
return RecordCreateFromPattern(PatternNumberExact, type, options);
|
|
1951
|
+
}
|
|
1952
|
+
function Record(key, type, options = {}) {
|
|
1953
|
+
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);
|
|
1954
|
+
}
|
|
1955
|
+
function RecordPattern(record) {
|
|
1956
|
+
return globalThis.Object.getOwnPropertyNames(record.patternProperties)[0];
|
|
1957
|
+
}
|
|
1958
|
+
function RecordKey2(type) {
|
|
1959
|
+
const pattern = RecordPattern(type);
|
|
1960
|
+
return pattern === PatternStringExact ? String2() : pattern === PatternNumberExact ? Number2() : String2({ pattern });
|
|
1961
|
+
}
|
|
1962
|
+
function RecordValue2(type) {
|
|
1963
|
+
return type.patternProperties[RecordPattern(type)];
|
|
1964
|
+
}
|
|
1965
|
+
|
|
1966
|
+
// node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.mjs
|
|
1967
|
+
function FromConstructor2(args, type) {
|
|
1968
|
+
type.parameters = FromTypes(args, type.parameters);
|
|
1969
|
+
type.returns = FromType(args, type.returns);
|
|
1970
|
+
return type;
|
|
1971
|
+
}
|
|
1972
|
+
function FromFunction2(args, type) {
|
|
1973
|
+
type.parameters = FromTypes(args, type.parameters);
|
|
1974
|
+
type.returns = FromType(args, type.returns);
|
|
1975
|
+
return type;
|
|
1976
|
+
}
|
|
1977
|
+
function FromIntersect5(args, type) {
|
|
1978
|
+
type.allOf = FromTypes(args, type.allOf);
|
|
1979
|
+
return type;
|
|
1980
|
+
}
|
|
1981
|
+
function FromUnion7(args, type) {
|
|
1982
|
+
type.anyOf = FromTypes(args, type.anyOf);
|
|
1983
|
+
return type;
|
|
1984
|
+
}
|
|
1985
|
+
function FromTuple4(args, type) {
|
|
1986
|
+
if (IsUndefined(type.items))
|
|
1987
|
+
return type;
|
|
1988
|
+
type.items = FromTypes(args, type.items);
|
|
1989
|
+
return type;
|
|
1990
|
+
}
|
|
1991
|
+
function FromArray5(args, type) {
|
|
1992
|
+
type.items = FromType(args, type.items);
|
|
1993
|
+
return type;
|
|
1994
|
+
}
|
|
1995
|
+
function FromAsyncIterator2(args, type) {
|
|
1996
|
+
type.items = FromType(args, type.items);
|
|
1997
|
+
return type;
|
|
1998
|
+
}
|
|
1999
|
+
function FromIterator2(args, type) {
|
|
2000
|
+
type.items = FromType(args, type.items);
|
|
2001
|
+
return type;
|
|
2002
|
+
}
|
|
2003
|
+
function FromPromise3(args, type) {
|
|
2004
|
+
type.item = FromType(args, type.item);
|
|
2005
|
+
return type;
|
|
2006
|
+
}
|
|
2007
|
+
function FromObject2(args, type) {
|
|
2008
|
+
const mappedProperties = FromProperties11(args, type.properties);
|
|
2009
|
+
return { ...type, ...Object2(mappedProperties) };
|
|
2010
|
+
}
|
|
2011
|
+
function FromRecord2(args, type) {
|
|
2012
|
+
const mappedKey = FromType(args, RecordKey2(type));
|
|
2013
|
+
const mappedValue = FromType(args, RecordValue2(type));
|
|
2014
|
+
const result = Record(mappedKey, mappedValue);
|
|
2015
|
+
return { ...type, ...result };
|
|
2016
|
+
}
|
|
2017
|
+
function FromArgument(args, argument) {
|
|
2018
|
+
return argument.index in args ? args[argument.index] : Unknown();
|
|
2019
|
+
}
|
|
2020
|
+
function FromProperty2(args, type) {
|
|
2021
|
+
const isReadonly = IsReadonly(type);
|
|
2022
|
+
const isOptional = IsOptional(type);
|
|
2023
|
+
const mapped = FromType(args, type);
|
|
2024
|
+
return isReadonly && isOptional ? ReadonlyOptional(mapped) : isReadonly && !isOptional ? Readonly(mapped) : !isReadonly && isOptional ? Optional(mapped) : mapped;
|
|
2025
|
+
}
|
|
2026
|
+
function FromProperties11(args, properties) {
|
|
2027
|
+
return globalThis.Object.getOwnPropertyNames(properties).reduce((result, key) => {
|
|
2028
|
+
return { ...result, [key]: FromProperty2(args, properties[key]) };
|
|
2029
|
+
}, {});
|
|
2030
|
+
}
|
|
2031
|
+
function FromTypes(args, types) {
|
|
2032
|
+
return types.map((type) => FromType(args, type));
|
|
2033
|
+
}
|
|
2034
|
+
function FromType(args, type) {
|
|
2035
|
+
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;
|
|
2036
|
+
}
|
|
2037
|
+
function Instantiate(type, args) {
|
|
2038
|
+
return FromType(args, CloneType(type));
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
// node_modules/@sinclair/typebox/build/esm/type/integer/integer.mjs
|
|
2042
|
+
function Integer(options) {
|
|
2043
|
+
return CreateType({ [Kind]: "Integer", type: "integer" }, options);
|
|
2044
|
+
}
|
|
2045
|
+
|
|
2046
|
+
// node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.mjs
|
|
2047
|
+
function MappedIntrinsicPropertyKey(K, M, options) {
|
|
2048
|
+
return {
|
|
2049
|
+
[K]: Intrinsic(Literal(K), M, Clone(options))
|
|
2050
|
+
};
|
|
2051
|
+
}
|
|
2052
|
+
function MappedIntrinsicPropertyKeys(K, M, options) {
|
|
2053
|
+
const result = K.reduce((Acc, L) => {
|
|
2054
|
+
return { ...Acc, ...MappedIntrinsicPropertyKey(L, M, options) };
|
|
2055
|
+
}, {});
|
|
2056
|
+
return result;
|
|
2057
|
+
}
|
|
2058
|
+
function MappedIntrinsicProperties(T, M, options) {
|
|
2059
|
+
return MappedIntrinsicPropertyKeys(T["keys"], M, options);
|
|
2060
|
+
}
|
|
2061
|
+
function IntrinsicFromMappedKey(T, M, options) {
|
|
2062
|
+
const P = MappedIntrinsicProperties(T, M, options);
|
|
2063
|
+
return MappedResult(P);
|
|
2064
|
+
}
|
|
2065
|
+
|
|
2066
|
+
// node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic.mjs
|
|
2067
|
+
function ApplyUncapitalize(value) {
|
|
2068
|
+
const [first, rest] = [value.slice(0, 1), value.slice(1)];
|
|
2069
|
+
return [first.toLowerCase(), rest].join("");
|
|
2070
|
+
}
|
|
2071
|
+
function ApplyCapitalize(value) {
|
|
2072
|
+
const [first, rest] = [value.slice(0, 1), value.slice(1)];
|
|
2073
|
+
return [first.toUpperCase(), rest].join("");
|
|
2074
|
+
}
|
|
2075
|
+
function ApplyUppercase(value) {
|
|
2076
|
+
return value.toUpperCase();
|
|
2077
|
+
}
|
|
2078
|
+
function ApplyLowercase(value) {
|
|
2079
|
+
return value.toLowerCase();
|
|
2080
|
+
}
|
|
2081
|
+
function FromTemplateLiteral3(schema, mode, options) {
|
|
2082
|
+
const expression = TemplateLiteralParseExact(schema.pattern);
|
|
2083
|
+
const finite = IsTemplateLiteralExpressionFinite(expression);
|
|
2084
|
+
if (!finite)
|
|
2085
|
+
return { ...schema, pattern: FromLiteralValue(schema.pattern, mode) };
|
|
2086
|
+
const strings = [...TemplateLiteralExpressionGenerate(expression)];
|
|
2087
|
+
const literals = strings.map((value) => Literal(value));
|
|
2088
|
+
const mapped = FromRest5(literals, mode);
|
|
2089
|
+
const union = Union(mapped);
|
|
2090
|
+
return TemplateLiteral([union], options);
|
|
2091
|
+
}
|
|
2092
|
+
function FromLiteralValue(value, mode) {
|
|
2093
|
+
return typeof value === "string" ? mode === "Uncapitalize" ? ApplyUncapitalize(value) : mode === "Capitalize" ? ApplyCapitalize(value) : mode === "Uppercase" ? ApplyUppercase(value) : mode === "Lowercase" ? ApplyLowercase(value) : value : value.toString();
|
|
2094
|
+
}
|
|
2095
|
+
function FromRest5(T, M) {
|
|
2096
|
+
return T.map((L) => Intrinsic(L, M));
|
|
2097
|
+
}
|
|
2098
|
+
function Intrinsic(schema, mode, options = {}) {
|
|
2099
|
+
return (
|
|
2100
|
+
// Intrinsic-Mapped-Inference
|
|
2101
|
+
IsMappedKey(schema) ? IntrinsicFromMappedKey(schema, mode, options) : (
|
|
2102
|
+
// Standard-Inference
|
|
2103
|
+
IsTemplateLiteral(schema) ? FromTemplateLiteral3(schema, mode, options) : IsUnion(schema) ? Union(FromRest5(schema.anyOf, mode), options) : IsLiteral(schema) ? Literal(FromLiteralValue(schema.const, mode), options) : (
|
|
2104
|
+
// Default Type
|
|
2105
|
+
CreateType(schema, options)
|
|
2106
|
+
)
|
|
2107
|
+
)
|
|
2108
|
+
);
|
|
2109
|
+
}
|
|
2110
|
+
|
|
2111
|
+
// node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.mjs
|
|
2112
|
+
function Capitalize(T, options = {}) {
|
|
2113
|
+
return Intrinsic(T, "Capitalize", options);
|
|
2114
|
+
}
|
|
2115
|
+
|
|
2116
|
+
// node_modules/@sinclair/typebox/build/esm/type/intrinsic/lowercase.mjs
|
|
2117
|
+
function Lowercase(T, options = {}) {
|
|
2118
|
+
return Intrinsic(T, "Lowercase", options);
|
|
2119
|
+
}
|
|
2120
|
+
|
|
2121
|
+
// node_modules/@sinclair/typebox/build/esm/type/intrinsic/uncapitalize.mjs
|
|
2122
|
+
function Uncapitalize(T, options = {}) {
|
|
2123
|
+
return Intrinsic(T, "Uncapitalize", options);
|
|
2124
|
+
}
|
|
2125
|
+
|
|
2126
|
+
// node_modules/@sinclair/typebox/build/esm/type/intrinsic/uppercase.mjs
|
|
2127
|
+
function Uppercase(T, options = {}) {
|
|
2128
|
+
return Intrinsic(T, "Uppercase", options);
|
|
2129
|
+
}
|
|
2130
|
+
|
|
2131
|
+
// node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.mjs
|
|
2132
|
+
function FromProperties12(properties, propertyKeys, options) {
|
|
2133
|
+
const result = {};
|
|
2134
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
|
|
2135
|
+
result[K2] = Omit(properties[K2], propertyKeys, Clone(options));
|
|
2136
|
+
return result;
|
|
2137
|
+
}
|
|
2138
|
+
function FromMappedResult9(mappedResult, propertyKeys, options) {
|
|
2139
|
+
return FromProperties12(mappedResult.properties, propertyKeys, options);
|
|
2140
|
+
}
|
|
2141
|
+
function OmitFromMappedResult(mappedResult, propertyKeys, options) {
|
|
2142
|
+
const properties = FromMappedResult9(mappedResult, propertyKeys, options);
|
|
2143
|
+
return MappedResult(properties);
|
|
2144
|
+
}
|
|
2145
|
+
|
|
2146
|
+
// node_modules/@sinclair/typebox/build/esm/type/omit/omit.mjs
|
|
2147
|
+
function FromIntersect6(types, propertyKeys) {
|
|
2148
|
+
return types.map((type) => OmitResolve(type, propertyKeys));
|
|
2149
|
+
}
|
|
2150
|
+
function FromUnion8(types, propertyKeys) {
|
|
2151
|
+
return types.map((type) => OmitResolve(type, propertyKeys));
|
|
2152
|
+
}
|
|
2153
|
+
function FromProperty3(properties, key) {
|
|
2154
|
+
const { [key]: _, ...R } = properties;
|
|
2155
|
+
return R;
|
|
2156
|
+
}
|
|
2157
|
+
function FromProperties13(properties, propertyKeys) {
|
|
2158
|
+
return propertyKeys.reduce((T, K2) => FromProperty3(T, K2), properties);
|
|
2159
|
+
}
|
|
2160
|
+
function FromObject3(type, propertyKeys, properties) {
|
|
2161
|
+
const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
|
|
2162
|
+
const mappedProperties = FromProperties13(properties, propertyKeys);
|
|
2163
|
+
return Object2(mappedProperties, options);
|
|
2164
|
+
}
|
|
2165
|
+
function UnionFromPropertyKeys(propertyKeys) {
|
|
2166
|
+
const result = propertyKeys.reduce((result2, key) => IsLiteralValue(key) ? [...result2, Literal(key)] : result2, []);
|
|
2167
|
+
return Union(result);
|
|
2168
|
+
}
|
|
2169
|
+
function OmitResolve(type, propertyKeys) {
|
|
2170
|
+
return IsIntersect(type) ? Intersect(FromIntersect6(type.allOf, propertyKeys)) : IsUnion(type) ? Union(FromUnion8(type.anyOf, propertyKeys)) : IsObject3(type) ? FromObject3(type, propertyKeys, type.properties) : Object2({});
|
|
2171
|
+
}
|
|
2172
|
+
function Omit(type, key, options) {
|
|
2173
|
+
const typeKey = IsArray(key) ? UnionFromPropertyKeys(key) : key;
|
|
2174
|
+
const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key;
|
|
2175
|
+
const isTypeRef = IsRef(type);
|
|
2176
|
+
const isKeyRef = IsRef(key);
|
|
2177
|
+
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 });
|
|
2178
|
+
}
|
|
2179
|
+
|
|
2180
|
+
// node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.mjs
|
|
2181
|
+
function FromPropertyKey2(type, key, options) {
|
|
2182
|
+
return { [key]: Omit(type, [key], Clone(options)) };
|
|
2183
|
+
}
|
|
2184
|
+
function FromPropertyKeys2(type, propertyKeys, options) {
|
|
2185
|
+
return propertyKeys.reduce((Acc, LK) => {
|
|
2186
|
+
return { ...Acc, ...FromPropertyKey2(type, LK, options) };
|
|
2187
|
+
}, {});
|
|
2188
|
+
}
|
|
2189
|
+
function FromMappedKey3(type, mappedKey, options) {
|
|
2190
|
+
return FromPropertyKeys2(type, mappedKey.keys, options);
|
|
2191
|
+
}
|
|
2192
|
+
function OmitFromMappedKey(type, mappedKey, options) {
|
|
2193
|
+
const properties = FromMappedKey3(type, mappedKey, options);
|
|
2194
|
+
return MappedResult(properties);
|
|
2195
|
+
}
|
|
2196
|
+
|
|
2197
|
+
// node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.mjs
|
|
2198
|
+
function FromProperties14(properties, propertyKeys, options) {
|
|
2199
|
+
const result = {};
|
|
2200
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
|
|
2201
|
+
result[K2] = Pick(properties[K2], propertyKeys, Clone(options));
|
|
2202
|
+
return result;
|
|
2203
|
+
}
|
|
2204
|
+
function FromMappedResult10(mappedResult, propertyKeys, options) {
|
|
2205
|
+
return FromProperties14(mappedResult.properties, propertyKeys, options);
|
|
2206
|
+
}
|
|
2207
|
+
function PickFromMappedResult(mappedResult, propertyKeys, options) {
|
|
2208
|
+
const properties = FromMappedResult10(mappedResult, propertyKeys, options);
|
|
2209
|
+
return MappedResult(properties);
|
|
2210
|
+
}
|
|
2211
|
+
|
|
2212
|
+
// node_modules/@sinclair/typebox/build/esm/type/pick/pick.mjs
|
|
2213
|
+
function FromIntersect7(types, propertyKeys) {
|
|
2214
|
+
return types.map((type) => PickResolve(type, propertyKeys));
|
|
2215
|
+
}
|
|
2216
|
+
function FromUnion9(types, propertyKeys) {
|
|
2217
|
+
return types.map((type) => PickResolve(type, propertyKeys));
|
|
2218
|
+
}
|
|
2219
|
+
function FromProperties15(properties, propertyKeys) {
|
|
2220
|
+
const result = {};
|
|
2221
|
+
for (const K2 of propertyKeys)
|
|
2222
|
+
if (K2 in properties)
|
|
2223
|
+
result[K2] = properties[K2];
|
|
2224
|
+
return result;
|
|
2225
|
+
}
|
|
2226
|
+
function FromObject4(Type2, keys, properties) {
|
|
2227
|
+
const options = Discard(Type2, [TransformKind, "$id", "required", "properties"]);
|
|
2228
|
+
const mappedProperties = FromProperties15(properties, keys);
|
|
2229
|
+
return Object2(mappedProperties, options);
|
|
2230
|
+
}
|
|
2231
|
+
function UnionFromPropertyKeys2(propertyKeys) {
|
|
2232
|
+
const result = propertyKeys.reduce((result2, key) => IsLiteralValue(key) ? [...result2, Literal(key)] : result2, []);
|
|
2233
|
+
return Union(result);
|
|
2234
|
+
}
|
|
2235
|
+
function PickResolve(type, propertyKeys) {
|
|
2236
|
+
return IsIntersect(type) ? Intersect(FromIntersect7(type.allOf, propertyKeys)) : IsUnion(type) ? Union(FromUnion9(type.anyOf, propertyKeys)) : IsObject3(type) ? FromObject4(type, propertyKeys, type.properties) : Object2({});
|
|
2237
|
+
}
|
|
2238
|
+
function Pick(type, key, options) {
|
|
2239
|
+
const typeKey = IsArray(key) ? UnionFromPropertyKeys2(key) : key;
|
|
2240
|
+
const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key;
|
|
2241
|
+
const isTypeRef = IsRef(type);
|
|
2242
|
+
const isKeyRef = IsRef(key);
|
|
2243
|
+
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 });
|
|
2244
|
+
}
|
|
2245
|
+
|
|
2246
|
+
// node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.mjs
|
|
2247
|
+
function FromPropertyKey3(type, key, options) {
|
|
2248
|
+
return {
|
|
2249
|
+
[key]: Pick(type, [key], Clone(options))
|
|
2250
|
+
};
|
|
2251
|
+
}
|
|
2252
|
+
function FromPropertyKeys3(type, propertyKeys, options) {
|
|
2253
|
+
return propertyKeys.reduce((result, leftKey) => {
|
|
2254
|
+
return { ...result, ...FromPropertyKey3(type, leftKey, options) };
|
|
2255
|
+
}, {});
|
|
2256
|
+
}
|
|
2257
|
+
function FromMappedKey4(type, mappedKey, options) {
|
|
2258
|
+
return FromPropertyKeys3(type, mappedKey.keys, options);
|
|
2259
|
+
}
|
|
2260
|
+
function PickFromMappedKey(type, mappedKey, options) {
|
|
2261
|
+
const properties = FromMappedKey4(type, mappedKey, options);
|
|
2262
|
+
return MappedResult(properties);
|
|
2263
|
+
}
|
|
2264
|
+
|
|
2265
|
+
// node_modules/@sinclair/typebox/build/esm/type/partial/partial.mjs
|
|
2266
|
+
function FromComputed3(target, parameters) {
|
|
2267
|
+
return Computed("Partial", [Computed(target, parameters)]);
|
|
2268
|
+
}
|
|
2269
|
+
function FromRef3($ref) {
|
|
2270
|
+
return Computed("Partial", [Ref($ref)]);
|
|
2271
|
+
}
|
|
2272
|
+
function FromProperties16(properties) {
|
|
2273
|
+
const partialProperties = {};
|
|
2274
|
+
for (const K of globalThis.Object.getOwnPropertyNames(properties))
|
|
2275
|
+
partialProperties[K] = Optional(properties[K]);
|
|
2276
|
+
return partialProperties;
|
|
2277
|
+
}
|
|
2278
|
+
function FromObject5(type, properties) {
|
|
2279
|
+
const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
|
|
2280
|
+
const mappedProperties = FromProperties16(properties);
|
|
2281
|
+
return Object2(mappedProperties, options);
|
|
2282
|
+
}
|
|
2283
|
+
function FromRest6(types) {
|
|
2284
|
+
return types.map((type) => PartialResolve(type));
|
|
2285
|
+
}
|
|
2286
|
+
function PartialResolve(type) {
|
|
2287
|
+
return (
|
|
2288
|
+
// Mappable
|
|
2289
|
+
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) : (
|
|
2290
|
+
// Intrinsic
|
|
2291
|
+
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 : (
|
|
2292
|
+
// Passthrough
|
|
2293
|
+
Object2({})
|
|
2294
|
+
)
|
|
2295
|
+
)
|
|
2296
|
+
);
|
|
2297
|
+
}
|
|
2298
|
+
function Partial(type, options) {
|
|
2299
|
+
if (IsMappedResult(type)) {
|
|
2300
|
+
return PartialFromMappedResult(type, options);
|
|
2301
|
+
} else {
|
|
2302
|
+
return CreateType({ ...PartialResolve(type), ...options });
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2305
|
+
|
|
2306
|
+
// node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.mjs
|
|
2307
|
+
function FromProperties17(K, options) {
|
|
2308
|
+
const Acc = {};
|
|
2309
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(K))
|
|
2310
|
+
Acc[K2] = Partial(K[K2], Clone(options));
|
|
2311
|
+
return Acc;
|
|
2312
|
+
}
|
|
2313
|
+
function FromMappedResult11(R, options) {
|
|
2314
|
+
return FromProperties17(R.properties, options);
|
|
2315
|
+
}
|
|
2316
|
+
function PartialFromMappedResult(R, options) {
|
|
2317
|
+
const P = FromMappedResult11(R, options);
|
|
2318
|
+
return MappedResult(P);
|
|
2319
|
+
}
|
|
2320
|
+
|
|
2321
|
+
// node_modules/@sinclair/typebox/build/esm/type/required/required.mjs
|
|
2322
|
+
function FromComputed4(target, parameters) {
|
|
2323
|
+
return Computed("Required", [Computed(target, parameters)]);
|
|
2324
|
+
}
|
|
2325
|
+
function FromRef4($ref) {
|
|
2326
|
+
return Computed("Required", [Ref($ref)]);
|
|
2327
|
+
}
|
|
2328
|
+
function FromProperties18(properties) {
|
|
2329
|
+
const requiredProperties = {};
|
|
2330
|
+
for (const K of globalThis.Object.getOwnPropertyNames(properties))
|
|
2331
|
+
requiredProperties[K] = Discard(properties[K], [OptionalKind]);
|
|
2332
|
+
return requiredProperties;
|
|
2333
|
+
}
|
|
2334
|
+
function FromObject6(type, properties) {
|
|
2335
|
+
const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
|
|
2336
|
+
const mappedProperties = FromProperties18(properties);
|
|
2337
|
+
return Object2(mappedProperties, options);
|
|
2338
|
+
}
|
|
2339
|
+
function FromRest7(types) {
|
|
2340
|
+
return types.map((type) => RequiredResolve(type));
|
|
2341
|
+
}
|
|
2342
|
+
function RequiredResolve(type) {
|
|
2343
|
+
return (
|
|
2344
|
+
// Mappable
|
|
2345
|
+
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) : (
|
|
2346
|
+
// Intrinsic
|
|
2347
|
+
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 : (
|
|
2348
|
+
// Passthrough
|
|
2349
|
+
Object2({})
|
|
2350
|
+
)
|
|
2351
|
+
)
|
|
2352
|
+
);
|
|
2353
|
+
}
|
|
2354
|
+
function Required(type, options) {
|
|
2355
|
+
if (IsMappedResult(type)) {
|
|
2356
|
+
return RequiredFromMappedResult(type, options);
|
|
2357
|
+
} else {
|
|
2358
|
+
return CreateType({ ...RequiredResolve(type), ...options });
|
|
2359
|
+
}
|
|
2360
|
+
}
|
|
2361
|
+
|
|
2362
|
+
// node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.mjs
|
|
2363
|
+
function FromProperties19(P, options) {
|
|
2364
|
+
const Acc = {};
|
|
2365
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
|
|
2366
|
+
Acc[K2] = Required(P[K2], options);
|
|
2367
|
+
return Acc;
|
|
2368
|
+
}
|
|
2369
|
+
function FromMappedResult12(R, options) {
|
|
2370
|
+
return FromProperties19(R.properties, options);
|
|
2371
|
+
}
|
|
2372
|
+
function RequiredFromMappedResult(R, options) {
|
|
2373
|
+
const P = FromMappedResult12(R, options);
|
|
2374
|
+
return MappedResult(P);
|
|
2375
|
+
}
|
|
2376
|
+
|
|
2377
|
+
// node_modules/@sinclair/typebox/build/esm/type/module/compute.mjs
|
|
2378
|
+
function DereferenceParameters(moduleProperties, types) {
|
|
2379
|
+
return types.map((type) => {
|
|
2380
|
+
return IsRef(type) ? Dereference(moduleProperties, type.$ref) : FromType2(moduleProperties, type);
|
|
2381
|
+
});
|
|
2382
|
+
}
|
|
2383
|
+
function Dereference(moduleProperties, ref) {
|
|
2384
|
+
return ref in moduleProperties ? IsRef(moduleProperties[ref]) ? Dereference(moduleProperties, moduleProperties[ref].$ref) : FromType2(moduleProperties, moduleProperties[ref]) : Never();
|
|
2385
|
+
}
|
|
2386
|
+
function FromAwaited(parameters) {
|
|
2387
|
+
return Awaited(parameters[0]);
|
|
2388
|
+
}
|
|
2389
|
+
function FromIndex(parameters) {
|
|
2390
|
+
return Index(parameters[0], parameters[1]);
|
|
2391
|
+
}
|
|
2392
|
+
function FromKeyOf(parameters) {
|
|
2393
|
+
return KeyOf(parameters[0]);
|
|
2394
|
+
}
|
|
2395
|
+
function FromPartial(parameters) {
|
|
2396
|
+
return Partial(parameters[0]);
|
|
2397
|
+
}
|
|
2398
|
+
function FromOmit(parameters) {
|
|
2399
|
+
return Omit(parameters[0], parameters[1]);
|
|
2400
|
+
}
|
|
2401
|
+
function FromPick(parameters) {
|
|
2402
|
+
return Pick(parameters[0], parameters[1]);
|
|
2403
|
+
}
|
|
2404
|
+
function FromRequired(parameters) {
|
|
2405
|
+
return Required(parameters[0]);
|
|
2406
|
+
}
|
|
2407
|
+
function FromComputed5(moduleProperties, target, parameters) {
|
|
2408
|
+
const dereferenced = DereferenceParameters(moduleProperties, parameters);
|
|
2409
|
+
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();
|
|
2410
|
+
}
|
|
2411
|
+
function FromArray6(moduleProperties, type) {
|
|
2412
|
+
return Array2(FromType2(moduleProperties, type));
|
|
2413
|
+
}
|
|
2414
|
+
function FromAsyncIterator3(moduleProperties, type) {
|
|
2415
|
+
return AsyncIterator(FromType2(moduleProperties, type));
|
|
2416
|
+
}
|
|
2417
|
+
function FromConstructor3(moduleProperties, parameters, instanceType) {
|
|
2418
|
+
return Constructor(FromTypes2(moduleProperties, parameters), FromType2(moduleProperties, instanceType));
|
|
2419
|
+
}
|
|
2420
|
+
function FromFunction3(moduleProperties, parameters, returnType) {
|
|
2421
|
+
return Function(FromTypes2(moduleProperties, parameters), FromType2(moduleProperties, returnType));
|
|
2422
|
+
}
|
|
2423
|
+
function FromIntersect8(moduleProperties, types) {
|
|
2424
|
+
return Intersect(FromTypes2(moduleProperties, types));
|
|
2425
|
+
}
|
|
2426
|
+
function FromIterator3(moduleProperties, type) {
|
|
2427
|
+
return Iterator(FromType2(moduleProperties, type));
|
|
2428
|
+
}
|
|
2429
|
+
function FromObject7(moduleProperties, properties) {
|
|
2430
|
+
return Object2(globalThis.Object.keys(properties).reduce((result, key) => {
|
|
2431
|
+
return { ...result, [key]: FromType2(moduleProperties, properties[key]) };
|
|
2432
|
+
}, {}));
|
|
2433
|
+
}
|
|
2434
|
+
function FromRecord3(moduleProperties, type) {
|
|
2435
|
+
const [value, pattern] = [FromType2(moduleProperties, RecordValue2(type)), RecordPattern(type)];
|
|
2436
|
+
const result = CloneType(type);
|
|
2437
|
+
result.patternProperties[pattern] = value;
|
|
2438
|
+
return result;
|
|
2439
|
+
}
|
|
2440
|
+
function FromTransform(moduleProperties, transform) {
|
|
2441
|
+
return IsRef(transform) ? { ...Dereference(moduleProperties, transform.$ref), [TransformKind]: transform[TransformKind] } : transform;
|
|
2442
|
+
}
|
|
2443
|
+
function FromTuple5(moduleProperties, types) {
|
|
2444
|
+
return Tuple(FromTypes2(moduleProperties, types));
|
|
2445
|
+
}
|
|
2446
|
+
function FromUnion10(moduleProperties, types) {
|
|
2447
|
+
return Union(FromTypes2(moduleProperties, types));
|
|
2448
|
+
}
|
|
2449
|
+
function FromTypes2(moduleProperties, types) {
|
|
2450
|
+
return types.map((type) => FromType2(moduleProperties, type));
|
|
2451
|
+
}
|
|
2452
|
+
function FromType2(moduleProperties, type) {
|
|
2453
|
+
return (
|
|
2454
|
+
// Modifiers
|
|
2455
|
+
IsOptional(type) ? CreateType(FromType2(moduleProperties, Discard(type, [OptionalKind])), type) : IsReadonly(type) ? CreateType(FromType2(moduleProperties, Discard(type, [ReadonlyKind])), type) : (
|
|
2456
|
+
// Transform
|
|
2457
|
+
IsTransform(type) ? CreateType(FromTransform(moduleProperties, type), type) : (
|
|
2458
|
+
// Types
|
|
2459
|
+
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
|
|
2460
|
+
)
|
|
2461
|
+
)
|
|
2462
|
+
);
|
|
2463
|
+
}
|
|
2464
|
+
function ComputeType(moduleProperties, key) {
|
|
2465
|
+
return key in moduleProperties ? FromType2(moduleProperties, moduleProperties[key]) : Never();
|
|
2466
|
+
}
|
|
2467
|
+
function ComputeModuleProperties(moduleProperties) {
|
|
2468
|
+
return globalThis.Object.getOwnPropertyNames(moduleProperties).reduce((result, key) => {
|
|
2469
|
+
return { ...result, [key]: ComputeType(moduleProperties, key) };
|
|
2470
|
+
}, {});
|
|
2471
|
+
}
|
|
2472
|
+
|
|
2473
|
+
// node_modules/@sinclair/typebox/build/esm/type/module/module.mjs
|
|
2474
|
+
var TModule = class {
|
|
2475
|
+
constructor($defs) {
|
|
2476
|
+
const computed = ComputeModuleProperties($defs);
|
|
2477
|
+
const identified = this.WithIdentifiers(computed);
|
|
2478
|
+
this.$defs = identified;
|
|
2479
|
+
}
|
|
2480
|
+
/** `[Json]` Imports a Type by Key. */
|
|
2481
|
+
Import(key, options) {
|
|
2482
|
+
const $defs = { ...this.$defs, [key]: CreateType(this.$defs[key], options) };
|
|
2483
|
+
return CreateType({ [Kind]: "Import", $defs, $ref: key });
|
|
2484
|
+
}
|
|
2485
|
+
// prettier-ignore
|
|
2486
|
+
WithIdentifiers($defs) {
|
|
2487
|
+
return globalThis.Object.getOwnPropertyNames($defs).reduce((result, key) => {
|
|
2488
|
+
return { ...result, [key]: { ...$defs[key], $id: key } };
|
|
2489
|
+
}, {});
|
|
2490
|
+
}
|
|
2491
|
+
};
|
|
2492
|
+
function Module(properties) {
|
|
2493
|
+
return new TModule(properties);
|
|
2494
|
+
}
|
|
2495
|
+
|
|
2496
|
+
// node_modules/@sinclair/typebox/build/esm/type/not/not.mjs
|
|
2497
|
+
function Not(type, options) {
|
|
2498
|
+
return CreateType({ [Kind]: "Not", not: type }, options);
|
|
2499
|
+
}
|
|
2500
|
+
|
|
2501
|
+
// node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.mjs
|
|
2502
|
+
function Parameters(schema, options) {
|
|
2503
|
+
return IsFunction2(schema) ? Tuple(schema.parameters, options) : Never();
|
|
2504
|
+
}
|
|
2505
|
+
|
|
2506
|
+
// node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.mjs
|
|
2507
|
+
var Ordinal = 0;
|
|
2508
|
+
function Recursive(callback, options = {}) {
|
|
2509
|
+
if (IsUndefined(options.$id))
|
|
2510
|
+
options.$id = `T${Ordinal++}`;
|
|
2511
|
+
const thisType = CloneType(callback({ [Kind]: "This", $ref: `${options.$id}` }));
|
|
2512
|
+
thisType.$id = options.$id;
|
|
2513
|
+
return CreateType({ [Hint]: "Recursive", ...thisType }, options);
|
|
2514
|
+
}
|
|
2515
|
+
|
|
2516
|
+
// node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.mjs
|
|
2517
|
+
function RegExp2(unresolved, options) {
|
|
2518
|
+
const expr = IsString(unresolved) ? new globalThis.RegExp(unresolved) : unresolved;
|
|
2519
|
+
return CreateType({ [Kind]: "RegExp", type: "RegExp", source: expr.source, flags: expr.flags }, options);
|
|
2520
|
+
}
|
|
2521
|
+
|
|
2522
|
+
// node_modules/@sinclair/typebox/build/esm/type/rest/rest.mjs
|
|
2523
|
+
function RestResolve(T) {
|
|
2524
|
+
return IsIntersect(T) ? T.allOf : IsUnion(T) ? T.anyOf : IsTuple(T) ? T.items ?? [] : [];
|
|
2525
|
+
}
|
|
2526
|
+
function Rest(T) {
|
|
2527
|
+
return RestResolve(T);
|
|
2528
|
+
}
|
|
2529
|
+
|
|
2530
|
+
// node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.mjs
|
|
2531
|
+
function ReturnType(schema, options) {
|
|
2532
|
+
return IsFunction2(schema) ? CreateType(schema.returns, options) : Never(options);
|
|
2533
|
+
}
|
|
2534
|
+
|
|
2535
|
+
// node_modules/@sinclair/typebox/build/esm/type/transform/transform.mjs
|
|
2536
|
+
var TransformDecodeBuilder = class {
|
|
2537
|
+
constructor(schema) {
|
|
2538
|
+
this.schema = schema;
|
|
2539
|
+
}
|
|
2540
|
+
Decode(decode) {
|
|
2541
|
+
return new TransformEncodeBuilder(this.schema, decode);
|
|
2542
|
+
}
|
|
2543
|
+
};
|
|
2544
|
+
var TransformEncodeBuilder = class {
|
|
2545
|
+
constructor(schema, decode) {
|
|
2546
|
+
this.schema = schema;
|
|
2547
|
+
this.decode = decode;
|
|
2548
|
+
}
|
|
2549
|
+
EncodeTransform(encode, schema) {
|
|
2550
|
+
const Encode = (value) => schema[TransformKind].Encode(encode(value));
|
|
2551
|
+
const Decode = (value) => this.decode(schema[TransformKind].Decode(value));
|
|
2552
|
+
const Codec = { Encode, Decode };
|
|
2553
|
+
return { ...schema, [TransformKind]: Codec };
|
|
2554
|
+
}
|
|
2555
|
+
EncodeSchema(encode, schema) {
|
|
2556
|
+
const Codec = { Decode: this.decode, Encode: encode };
|
|
2557
|
+
return { ...schema, [TransformKind]: Codec };
|
|
2558
|
+
}
|
|
2559
|
+
Encode(encode) {
|
|
2560
|
+
return IsTransform(this.schema) ? this.EncodeTransform(encode, this.schema) : this.EncodeSchema(encode, this.schema);
|
|
2561
|
+
}
|
|
2562
|
+
};
|
|
2563
|
+
function Transform(schema) {
|
|
2564
|
+
return new TransformDecodeBuilder(schema);
|
|
2565
|
+
}
|
|
2566
|
+
|
|
2567
|
+
// node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.mjs
|
|
2568
|
+
function Unsafe(options = {}) {
|
|
2569
|
+
return CreateType({ [Kind]: options[Kind] ?? "Unsafe" }, options);
|
|
2570
|
+
}
|
|
2571
|
+
|
|
2572
|
+
// node_modules/@sinclair/typebox/build/esm/type/void/void.mjs
|
|
2573
|
+
function Void(options) {
|
|
2574
|
+
return CreateType({ [Kind]: "Void", type: "void" }, options);
|
|
2575
|
+
}
|
|
2576
|
+
|
|
2577
|
+
// node_modules/@sinclair/typebox/build/esm/type/type/type.mjs
|
|
2578
|
+
var type_exports2 = {};
|
|
2579
|
+
__export(type_exports2, {
|
|
2580
|
+
Any: () => Any,
|
|
2581
|
+
Argument: () => Argument,
|
|
2582
|
+
Array: () => Array2,
|
|
2583
|
+
AsyncIterator: () => AsyncIterator,
|
|
2584
|
+
Awaited: () => Awaited,
|
|
2585
|
+
BigInt: () => BigInt,
|
|
2586
|
+
Boolean: () => Boolean2,
|
|
2587
|
+
Capitalize: () => Capitalize,
|
|
2588
|
+
Composite: () => Composite,
|
|
2589
|
+
Const: () => Const,
|
|
2590
|
+
Constructor: () => Constructor,
|
|
2591
|
+
ConstructorParameters: () => ConstructorParameters,
|
|
2592
|
+
Date: () => Date2,
|
|
2593
|
+
Enum: () => Enum,
|
|
2594
|
+
Exclude: () => Exclude,
|
|
2595
|
+
Extends: () => Extends,
|
|
2596
|
+
Extract: () => Extract,
|
|
2597
|
+
Function: () => Function,
|
|
2598
|
+
Index: () => Index,
|
|
2599
|
+
InstanceType: () => InstanceType,
|
|
2600
|
+
Instantiate: () => Instantiate,
|
|
2601
|
+
Integer: () => Integer,
|
|
2602
|
+
Intersect: () => Intersect,
|
|
2603
|
+
Iterator: () => Iterator,
|
|
2604
|
+
KeyOf: () => KeyOf,
|
|
2605
|
+
Literal: () => Literal,
|
|
2606
|
+
Lowercase: () => Lowercase,
|
|
2607
|
+
Mapped: () => Mapped,
|
|
2608
|
+
Module: () => Module,
|
|
2609
|
+
Never: () => Never,
|
|
2610
|
+
Not: () => Not,
|
|
2611
|
+
Null: () => Null,
|
|
2612
|
+
Number: () => Number2,
|
|
2613
|
+
Object: () => Object2,
|
|
2614
|
+
Omit: () => Omit,
|
|
2615
|
+
Optional: () => Optional,
|
|
2616
|
+
Parameters: () => Parameters,
|
|
2617
|
+
Partial: () => Partial,
|
|
2618
|
+
Pick: () => Pick,
|
|
2619
|
+
Promise: () => Promise2,
|
|
2620
|
+
Readonly: () => Readonly,
|
|
2621
|
+
ReadonlyOptional: () => ReadonlyOptional,
|
|
2622
|
+
Record: () => Record,
|
|
2623
|
+
Recursive: () => Recursive,
|
|
2624
|
+
Ref: () => Ref,
|
|
2625
|
+
RegExp: () => RegExp2,
|
|
2626
|
+
Required: () => Required,
|
|
2627
|
+
Rest: () => Rest,
|
|
2628
|
+
ReturnType: () => ReturnType,
|
|
2629
|
+
String: () => String2,
|
|
2630
|
+
Symbol: () => Symbol2,
|
|
2631
|
+
TemplateLiteral: () => TemplateLiteral,
|
|
2632
|
+
Transform: () => Transform,
|
|
2633
|
+
Tuple: () => Tuple,
|
|
2634
|
+
Uint8Array: () => Uint8Array2,
|
|
2635
|
+
Uncapitalize: () => Uncapitalize,
|
|
2636
|
+
Undefined: () => Undefined,
|
|
2637
|
+
Union: () => Union,
|
|
2638
|
+
Unknown: () => Unknown,
|
|
2639
|
+
Unsafe: () => Unsafe,
|
|
2640
|
+
Uppercase: () => Uppercase,
|
|
2641
|
+
Void: () => Void
|
|
2642
|
+
});
|
|
2643
|
+
|
|
2644
|
+
// node_modules/@sinclair/typebox/build/esm/type/type/index.mjs
|
|
2645
|
+
var Type = type_exports2;
|
|
2646
|
+
|
|
2647
|
+
// index.ts
|
|
42
2648
|
function generateSessionId() {
|
|
43
2649
|
const ts = Date.now().toString(36);
|
|
44
2650
|
const rand = Math.random().toString(36).slice(2, 8);
|
|
@@ -2544,10 +5150,10 @@ var toolDefinitions = {
|
|
|
2544
5150
|
name: "memory_recall",
|
|
2545
5151
|
label: "Memory Recall",
|
|
2546
5152
|
description: "Search Sulcus memory for relevant context",
|
|
2547
|
-
parameters:
|
|
2548
|
-
query:
|
|
2549
|
-
limit:
|
|
2550
|
-
namespace:
|
|
5153
|
+
parameters: Type.Object({
|
|
5154
|
+
query: Type.String({ description: "Search query string." }),
|
|
5155
|
+
limit: Type.Optional(Type.Number({ default: 5, description: "Maximum number of results to return (1-10)." })),
|
|
5156
|
+
namespace: Type.Optional(Type.String({ description: "Namespace to search. Defaults to your own namespace." }))
|
|
2551
5157
|
})
|
|
2552
5158
|
},
|
|
2553
5159
|
options: { name: "memory_recall" },
|
|
@@ -2567,16 +5173,16 @@ var toolDefinitions = {
|
|
|
2567
5173
|
name: "memory_store",
|
|
2568
5174
|
label: "Memory Store",
|
|
2569
5175
|
description: "Record information in Sulcus memory. Supports Markdown formatting. You control the memory type at creation time.",
|
|
2570
|
-
parameters:
|
|
2571
|
-
content:
|
|
2572
|
-
memory_type:
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
5176
|
+
parameters: Type.Object({
|
|
5177
|
+
content: Type.String({ description: "Memory content. Supports Markdown formatting for structured content." }),
|
|
5178
|
+
memory_type: Type.Optional(Type.Union([
|
|
5179
|
+
Type.Literal("episodic"),
|
|
5180
|
+
Type.Literal("semantic"),
|
|
5181
|
+
Type.Literal("preference"),
|
|
5182
|
+
Type.Literal("procedural"),
|
|
5183
|
+
Type.Literal("fact")
|
|
2578
5184
|
], { description: "Memory type. Default: episodic" })),
|
|
2579
|
-
train:
|
|
5185
|
+
train: Type.Optional(Type.Boolean({ description: "Signal the SIU to learn from this manual store. Default: false" }))
|
|
2580
5186
|
})
|
|
2581
5187
|
},
|
|
2582
5188
|
options: { name: "memory_store" },
|
|
@@ -2620,7 +5226,7 @@ var toolDefinitions = {
|
|
|
2620
5226
|
name: "memory_status",
|
|
2621
5227
|
label: "Memory Status",
|
|
2622
5228
|
description: "Check Sulcus memory backend status: connection, namespace, capabilities, and hot nodes.",
|
|
2623
|
-
parameters:
|
|
5229
|
+
parameters: Type.Object({})
|
|
2624
5230
|
},
|
|
2625
5231
|
options: { name: "memory_status" },
|
|
2626
5232
|
makeExecute: ({ sulcusMem, backendMode, namespace, nativeLoader, storeLibPath, vectorsLibPath, wasmDir, isAvailable }) => async (_id, _params) => {
|
|
@@ -2694,7 +5300,7 @@ var toolDefinitions = {
|
|
|
2694
5300
|
name: "consolidate",
|
|
2695
5301
|
label: "Memory Consolidate",
|
|
2696
5302
|
description: "Consolidate cold memories: merges, prunes, or archives nodes below the given heat threshold.",
|
|
2697
|
-
parameters:
|
|
5303
|
+
parameters: Type.Object({ min_heat: Type.Optional(Type.Number({ default: 0.1, description: "Heat threshold (0.0\u20131.0)." })) })
|
|
2698
5304
|
},
|
|
2699
5305
|
options: { name: "consolidate" },
|
|
2700
5306
|
makeExecute: ({ sulcusMem, backendMode, namespace, nativeLoader, isAvailable }) => async (_id, params) => {
|
|
@@ -2708,7 +5314,7 @@ var toolDefinitions = {
|
|
|
2708
5314
|
name: "export_markdown",
|
|
2709
5315
|
label: "Export Memory (Markdown)",
|
|
2710
5316
|
description: "Export all memories in the current namespace as a Markdown document.",
|
|
2711
|
-
parameters:
|
|
5317
|
+
parameters: Type.Object({})
|
|
2712
5318
|
},
|
|
2713
5319
|
options: { name: "export_markdown" },
|
|
2714
5320
|
makeExecute: ({ sulcusMem, backendMode, namespace, nativeLoader, isAvailable }) => async (_id, _params) => {
|
|
@@ -2722,7 +5328,7 @@ var toolDefinitions = {
|
|
|
2722
5328
|
name: "import_markdown",
|
|
2723
5329
|
label: "Import Memory (Markdown)",
|
|
2724
5330
|
description: "Import memories from a Markdown document into the current namespace.",
|
|
2725
|
-
parameters:
|
|
5331
|
+
parameters: Type.Object({ text: Type.String({ description: "Markdown content to import." }) })
|
|
2726
5332
|
},
|
|
2727
5333
|
options: { name: "import_markdown" },
|
|
2728
5334
|
makeExecute: ({ sulcusMem, backendMode, namespace, nativeLoader, isAvailable }) => async (_id, params) => {
|
|
@@ -2736,9 +5342,9 @@ var toolDefinitions = {
|
|
|
2736
5342
|
name: "evaluate_triggers",
|
|
2737
5343
|
label: "Evaluate Memory Triggers",
|
|
2738
5344
|
description: "Evaluate reactive memory triggers against an event and context.",
|
|
2739
|
-
parameters:
|
|
2740
|
-
event:
|
|
2741
|
-
context_json:
|
|
5345
|
+
parameters: Type.Object({
|
|
5346
|
+
event: Type.String({ description: "Event name to evaluate triggers against (e.g. 'agent_end', 'user_message')." }),
|
|
5347
|
+
context_json: Type.Optional(Type.String({ description: "JSON string of additional context." }))
|
|
2742
5348
|
})
|
|
2743
5349
|
},
|
|
2744
5350
|
options: { name: "evaluate_triggers" },
|
|
@@ -2753,9 +5359,9 @@ var toolDefinitions = {
|
|
|
2753
5359
|
name: "memory_delete",
|
|
2754
5360
|
label: "Delete Memory",
|
|
2755
5361
|
description: "Delete a memory node by ID. With train=true (default), trains SIVU to reject similar content.",
|
|
2756
|
-
parameters:
|
|
2757
|
-
id:
|
|
2758
|
-
train:
|
|
5362
|
+
parameters: Type.Object({
|
|
5363
|
+
id: Type.String({ description: "Memory node ID to delete." }),
|
|
5364
|
+
train: Type.Optional(Type.Boolean({ default: true, description: "Train SIVU to reject similar content (default true)." }))
|
|
2759
5365
|
})
|
|
2760
5366
|
},
|
|
2761
5367
|
options: { name: "memory_delete" },
|
|
@@ -2774,8 +5380,8 @@ var toolDefinitions = {
|
|
|
2774
5380
|
name: "memory_get",
|
|
2775
5381
|
label: "Get Memory",
|
|
2776
5382
|
description: "Fetch a specific memory by its UUID. Returns full memory details including content, type, heat, graph edges, and metadata.",
|
|
2777
|
-
parameters:
|
|
2778
|
-
id:
|
|
5383
|
+
parameters: Type.Object({
|
|
5384
|
+
id: Type.String({ description: "Memory node UUID." })
|
|
2779
5385
|
})
|
|
2780
5386
|
},
|
|
2781
5387
|
options: { name: "memory_get" },
|
|
@@ -2796,25 +5402,25 @@ var toolDefinitions = {
|
|
|
2796
5402
|
name: "memory_list",
|
|
2797
5403
|
label: "List Memories",
|
|
2798
5404
|
description: "Browse memories with optional filters. Returns paginated results sorted by heat (hottest first). Use this to explore what Sulcus knows without a search query.",
|
|
2799
|
-
parameters:
|
|
2800
|
-
page:
|
|
2801
|
-
page_size:
|
|
2802
|
-
memory_type:
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
5405
|
+
parameters: Type.Object({
|
|
5406
|
+
page: Type.Optional(Type.Number({ default: 1, description: "Page number (1-indexed)." })),
|
|
5407
|
+
page_size: Type.Optional(Type.Number({ default: 20, description: "Results per page (1-100).", minimum: 1, maximum: 100 })),
|
|
5408
|
+
memory_type: Type.Optional(Type.Union([
|
|
5409
|
+
Type.Literal("episodic"),
|
|
5410
|
+
Type.Literal("semantic"),
|
|
5411
|
+
Type.Literal("preference"),
|
|
5412
|
+
Type.Literal("procedural"),
|
|
5413
|
+
Type.Literal("fact")
|
|
2808
5414
|
], { description: "Filter by memory type." })),
|
|
2809
|
-
pinned:
|
|
2810
|
-
sort_by:
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
5415
|
+
pinned: Type.Optional(Type.Boolean({ description: "Filter by pinned status." })),
|
|
5416
|
+
sort_by: Type.Optional(Type.Union([
|
|
5417
|
+
Type.Literal("current_heat"),
|
|
5418
|
+
Type.Literal("created_at"),
|
|
5419
|
+
Type.Literal("updated_at")
|
|
2814
5420
|
], { description: "Sort field (default: current_heat)." })),
|
|
2815
|
-
sort_order:
|
|
2816
|
-
|
|
2817
|
-
|
|
5421
|
+
sort_order: Type.Optional(Type.Union([
|
|
5422
|
+
Type.Literal("asc"),
|
|
5423
|
+
Type.Literal("desc")
|
|
2818
5424
|
], { description: "Sort order (default: desc)." }))
|
|
2819
5425
|
})
|
|
2820
5426
|
},
|
|
@@ -2845,18 +5451,18 @@ var toolDefinitions = {
|
|
|
2845
5451
|
name: "memory_update",
|
|
2846
5452
|
label: "Update Memory",
|
|
2847
5453
|
description: "Update fields on an existing memory in-place. Preserves graph edges and history. More surgical than delete+re-store.",
|
|
2848
|
-
parameters:
|
|
2849
|
-
id:
|
|
2850
|
-
content:
|
|
2851
|
-
memory_type:
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
5454
|
+
parameters: Type.Object({
|
|
5455
|
+
id: Type.String({ description: "Memory node UUID to update." }),
|
|
5456
|
+
content: Type.Optional(Type.String({ description: "New content text (replaces existing)." })),
|
|
5457
|
+
memory_type: Type.Optional(Type.Union([
|
|
5458
|
+
Type.Literal("episodic"),
|
|
5459
|
+
Type.Literal("semantic"),
|
|
5460
|
+
Type.Literal("preference"),
|
|
5461
|
+
Type.Literal("procedural"),
|
|
5462
|
+
Type.Literal("fact")
|
|
2857
5463
|
], { description: "New memory type classification." })),
|
|
2858
|
-
is_pinned:
|
|
2859
|
-
heat:
|
|
5464
|
+
is_pinned: Type.Optional(Type.Boolean({ description: "Pin (prevent decay) or unpin." })),
|
|
5465
|
+
heat: Type.Optional(Type.Number({ description: "Set heat directly (0.0-1.0).", minimum: 0, maximum: 1 }))
|
|
2860
5466
|
})
|
|
2861
5467
|
},
|
|
2862
5468
|
options: { name: "memory_update" },
|
|
@@ -2886,8 +5492,8 @@ var toolDefinitions = {
|
|
|
2886
5492
|
name: "memory_profile",
|
|
2887
5493
|
label: "Memory Profile",
|
|
2888
5494
|
description: "Show a rich snapshot of this agent's memory health: type distribution, heat curve, top hot nodes, top preferences/facts, and graph stats. Call this to understand what Sulcus knows and how active the memory is.",
|
|
2889
|
-
parameters:
|
|
2890
|
-
limit:
|
|
5495
|
+
parameters: Type.Object({
|
|
5496
|
+
limit: Type.Optional(Type.Number({ description: "Max hot nodes to surface (default 10).", minimum: 1, maximum: 50 }))
|
|
2891
5497
|
})
|
|
2892
5498
|
},
|
|
2893
5499
|
options: { name: "memory_profile" },
|
|
@@ -2982,9 +5588,9 @@ var toolDefinitions = {
|
|
|
2982
5588
|
name: "siu_label",
|
|
2983
5589
|
label: "SIU Label",
|
|
2984
5590
|
description: "Classify text using SIU v2 \u2014 returns SIVU store/reject decision and SICU memory type classification.",
|
|
2985
|
-
parameters:
|
|
2986
|
-
text:
|
|
2987
|
-
classify_only:
|
|
5591
|
+
parameters: Type.Object({
|
|
5592
|
+
text: Type.String({ description: "Text to classify." }),
|
|
5593
|
+
classify_only: Type.Optional(Type.Boolean({ description: "Skip SIVU quality gate, only run SICU type classification." }))
|
|
2988
5594
|
})
|
|
2989
5595
|
},
|
|
2990
5596
|
options: { name: "siu_label" },
|
|
@@ -3005,7 +5611,7 @@ var toolDefinitions = {
|
|
|
3005
5611
|
name: "siu_status",
|
|
3006
5612
|
label: "SIU Status",
|
|
3007
5613
|
description: "Check SIU v2 model availability, deployed versions, and training signal statistics.",
|
|
3008
|
-
parameters:
|
|
5614
|
+
parameters: Type.Object({})
|
|
3009
5615
|
},
|
|
3010
5616
|
options: { name: "siu_status" },
|
|
3011
5617
|
makeExecute: ({ siuRequest, logger }) => async (_id, _params) => {
|
|
@@ -3025,7 +5631,7 @@ var toolDefinitions = {
|
|
|
3025
5631
|
name: "siu_retrain",
|
|
3026
5632
|
label: "SIU Retrain",
|
|
3027
5633
|
description: "Trigger an async retrain of SIU v2 models using accumulated training signals.",
|
|
3028
|
-
parameters:
|
|
5634
|
+
parameters: Type.Object({})
|
|
3029
5635
|
},
|
|
3030
5636
|
options: { name: "siu_retrain" },
|
|
3031
5637
|
makeExecute: ({ siuRequest, logger }) => async (_id, _params) => {
|
|
@@ -3045,14 +5651,14 @@ var toolDefinitions = {
|
|
|
3045
5651
|
name: "trigger_feedback",
|
|
3046
5652
|
label: "Trigger Feedback",
|
|
3047
5653
|
description: "Record feedback on a trigger fire (for SITU training).",
|
|
3048
|
-
parameters:
|
|
3049
|
-
feedback_type:
|
|
3050
|
-
trigger_id:
|
|
3051
|
-
trigger_log_id:
|
|
3052
|
-
event_type:
|
|
3053
|
-
memory_id:
|
|
3054
|
-
expected_action:
|
|
3055
|
-
notes:
|
|
5654
|
+
parameters: Type.Object({
|
|
5655
|
+
feedback_type: Type.String({ description: 'One of: "false_positive", "false_negative", "correct", "wrong_action"' }),
|
|
5656
|
+
trigger_id: Type.Optional(Type.String({ description: "UUID of the trigger rule" })),
|
|
5657
|
+
trigger_log_id: Type.Optional(Type.String({ description: "UUID of the trigger fire log entry" })),
|
|
5658
|
+
event_type: Type.Optional(Type.String({ description: "Event type: memory_created, heat_threshold, recall, etc." })),
|
|
5659
|
+
memory_id: Type.Optional(Type.String({ description: "UUID of the memory involved" })),
|
|
5660
|
+
expected_action: Type.Optional(Type.String({ description: "What should have happened: fire, no_fire, different_action" })),
|
|
5661
|
+
notes: Type.Optional(Type.String({ description: "Free-text explanation of the feedback" }))
|
|
3056
5662
|
})
|
|
3057
5663
|
},
|
|
3058
5664
|
options: { name: "trigger_feedback" },
|
|
@@ -3073,14 +5679,14 @@ var toolDefinitions = {
|
|
|
3073
5679
|
name: "session_store",
|
|
3074
5680
|
label: "Session Store",
|
|
3075
5681
|
description: "Store ephemeral context for the current conversation only. Automatically purged when the session ends. Use this for short-term scratch-pad notes, intermediate reasoning, or context that's only relevant to this exchange.",
|
|
3076
|
-
parameters:
|
|
3077
|
-
content:
|
|
3078
|
-
memory_type:
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
5682
|
+
parameters: Type.Object({
|
|
5683
|
+
content: Type.String({ description: "Content to store for this session." }),
|
|
5684
|
+
memory_type: Type.Optional(Type.Union([
|
|
5685
|
+
Type.Literal("episodic"),
|
|
5686
|
+
Type.Literal("semantic"),
|
|
5687
|
+
Type.Literal("preference"),
|
|
5688
|
+
Type.Literal("procedural"),
|
|
5689
|
+
Type.Literal("fact")
|
|
3084
5690
|
], { description: "Memory type classification. Default: episodic" }))
|
|
3085
5691
|
})
|
|
3086
5692
|
},
|
|
@@ -3116,9 +5722,9 @@ var toolDefinitions = {
|
|
|
3116
5722
|
name: "session_recall",
|
|
3117
5723
|
label: "Session Recall",
|
|
3118
5724
|
description: "Search ephemeral context stored in the current conversation with session_store. Returns only memories from this session \u2014 nothing from prior sessions.",
|
|
3119
|
-
parameters:
|
|
3120
|
-
query:
|
|
3121
|
-
limit:
|
|
5725
|
+
parameters: Type.Object({
|
|
5726
|
+
query: Type.String({ description: "Search query string." }),
|
|
5727
|
+
limit: Type.Optional(Type.Number({ default: 5, description: "Maximum results (1-10)." }))
|
|
3122
5728
|
})
|
|
3123
5729
|
},
|
|
3124
5730
|
options: { name: "session_recall" },
|
|
@@ -3142,7 +5748,7 @@ var toolDefinitions = {
|
|
|
3142
5748
|
name: "memory_inspect",
|
|
3143
5749
|
label: "Memory Inspect",
|
|
3144
5750
|
description: "Debug window into what Sulcus is actually doing. Shows what was injected in the last recall, what the output/tool guard scanned, what was blocked and why, and the last N guardrail events. Use this to verify Sulcus is working correctly.",
|
|
3145
|
-
parameters:
|
|
5751
|
+
parameters: Type.Object({})
|
|
3146
5752
|
},
|
|
3147
5753
|
options: { name: "memory_inspect" },
|
|
3148
5754
|
makeExecute: (_deps) => async (_id, _params) => {
|
|
@@ -3209,7 +5815,7 @@ var toolDefinitions = {
|
|
|
3209
5815
|
name: "guardrail_status",
|
|
3210
5816
|
label: "Guardrail Status",
|
|
3211
5817
|
description: "Returns current guardrail configuration: outputGuard enabled/disabled, which rules are active (PII/preferences/custom), last 5 blocked events with reasons, preference keywords cached, negative prefs count. Use this to verify the guard is working and what it's watching.",
|
|
3212
|
-
parameters:
|
|
5818
|
+
parameters: Type.Object({})
|
|
3213
5819
|
},
|
|
3214
5820
|
options: { name: "guardrail_status" },
|
|
3215
5821
|
makeExecute: (_deps) => async (_id, _params) => {
|
|
@@ -3298,7 +5904,7 @@ var toolDefinitions = {
|
|
|
3298
5904
|
name: "__sulcus_workflow__",
|
|
3299
5905
|
label: "Sulcus Workflow",
|
|
3300
5906
|
description: "Call this when you are unsure what to do next with Sulcus memory tools. Returns a step-by-step workflow checklist so you always know the right action.",
|
|
3301
|
-
parameters:
|
|
5907
|
+
parameters: Type.Object({})
|
|
3302
5908
|
},
|
|
3303
5909
|
options: { name: "__sulcus_workflow__" },
|
|
3304
5910
|
makeExecute: (_deps) => async (_id, _params) => {
|
|
@@ -3320,13 +5926,13 @@ var toolDefinitions = {
|
|
|
3320
5926
|
name: "graph_explore",
|
|
3321
5927
|
label: "Graph Explore",
|
|
3322
5928
|
description: "Explore the knowledge graph around a memory (neighbors mode) or query temporal connections (temporal mode).",
|
|
3323
|
-
parameters:
|
|
3324
|
-
mode:
|
|
3325
|
-
memory_id:
|
|
3326
|
-
query:
|
|
3327
|
-
time_from:
|
|
3328
|
-
time_to:
|
|
3329
|
-
limit:
|
|
5929
|
+
parameters: Type.Object({
|
|
5930
|
+
mode: Type.Union([Type.Literal("neighbors"), Type.Literal("temporal")], { description: "Exploration mode: 'neighbors' for graph edges around a memory, 'temporal' for time-based connections." }),
|
|
5931
|
+
memory_id: Type.Optional(Type.String({ description: "Memory node UUID. Required for neighbors mode." })),
|
|
5932
|
+
query: Type.Optional(Type.String({ description: "Search query for temporal mode." })),
|
|
5933
|
+
time_from: Type.Optional(Type.String({ description: "ISO 8601 start time for temporal range filter." })),
|
|
5934
|
+
time_to: Type.Optional(Type.String({ description: "ISO 8601 end time for temporal range filter." })),
|
|
5935
|
+
limit: Type.Optional(Type.Number({ default: 10, description: "Max results to return (default 10).", minimum: 1, maximum: 50 }))
|
|
3330
5936
|
})
|
|
3331
5937
|
},
|
|
3332
5938
|
options: { name: "graph_explore" },
|
|
@@ -3364,16 +5970,16 @@ var toolDefinitions = {
|
|
|
3364
5970
|
name: "memory_conflicts",
|
|
3365
5971
|
label: "Memory Conflicts",
|
|
3366
5972
|
description: "List detected memory conflicts or resolve a specific conflict.",
|
|
3367
|
-
parameters:
|
|
3368
|
-
action:
|
|
3369
|
-
id:
|
|
3370
|
-
resolution:
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
5973
|
+
parameters: Type.Object({
|
|
5974
|
+
action: Type.Union([Type.Literal("list"), Type.Literal("resolve")], { description: "Action: 'list' to see conflicts, 'resolve' to resolve one." }),
|
|
5975
|
+
id: Type.Optional(Type.String({ description: "Conflict UUID. Required for resolve action." })),
|
|
5976
|
+
resolution: Type.Optional(Type.Union([
|
|
5977
|
+
Type.Literal("keep_newer"),
|
|
5978
|
+
Type.Literal("keep_older"),
|
|
5979
|
+
Type.Literal("merge"),
|
|
5980
|
+
Type.Literal("dismiss")
|
|
3375
5981
|
], { description: "Resolution strategy. Required for resolve action." })),
|
|
3376
|
-
limit:
|
|
5982
|
+
limit: Type.Optional(Type.Number({ default: 10, description: "Max conflicts to return for list action (default 10).", minimum: 1, maximum: 100 }))
|
|
3377
5983
|
})
|
|
3378
5984
|
},
|
|
3379
5985
|
options: { name: "memory_conflicts" },
|
|
@@ -3407,7 +6013,7 @@ var toolDefinitions = {
|
|
|
3407
6013
|
name: "core_memory_read",
|
|
3408
6014
|
label: "Core Memory Read",
|
|
3409
6015
|
description: "Read the current core memory block \u2014 the persistent structured identity context always injected into agent sessions. Contains identity, relationships, preferences, current_focus, and custom fields.",
|
|
3410
|
-
parameters:
|
|
6016
|
+
parameters: Type.Object({})
|
|
3411
6017
|
},
|
|
3412
6018
|
options: { name: "core_memory_read" },
|
|
3413
6019
|
makeExecute: ({ sulcusMem, backendMode, namespace, nativeLoader, isAvailable }) => async (_id, _params) => {
|
|
@@ -3431,12 +6037,12 @@ var toolDefinitions = {
|
|
|
3431
6037
|
name: "core_memory_update",
|
|
3432
6038
|
label: "Core Memory Update",
|
|
3433
6039
|
description: "Update fields in the core memory block. Core memory is a persistent structured identity context always injected into agent sessions. Only provide the fields you want to update.",
|
|
3434
|
-
parameters:
|
|
3435
|
-
identity:
|
|
3436
|
-
relationships:
|
|
3437
|
-
preferences:
|
|
3438
|
-
current_focus:
|
|
3439
|
-
custom:
|
|
6040
|
+
parameters: Type.Object({
|
|
6041
|
+
identity: Type.Optional(Type.String({ description: "Who the agent is: name, role, and description." })),
|
|
6042
|
+
relationships: Type.Optional(Type.String({ description: "Key people and entities the agent works with." })),
|
|
6043
|
+
preferences: Type.Optional(Type.String({ description: "Agent preferences and communication style." })),
|
|
6044
|
+
current_focus: Type.Optional(Type.String({ description: "What the agent is currently working on (mutable)." })),
|
|
6045
|
+
custom: Type.Optional(Type.String({ description: "JSON string of additional freeform key-value pairs." }))
|
|
3440
6046
|
})
|
|
3441
6047
|
},
|
|
3442
6048
|
options: { name: "core_memory_update" },
|
|
@@ -3471,11 +6077,11 @@ var toolDefinitions = {
|
|
|
3471
6077
|
name: "memory_archive",
|
|
3472
6078
|
label: "Memory Archive",
|
|
3473
6079
|
description: "List archived memories or restore specific ones from the archive.",
|
|
3474
|
-
parameters:
|
|
3475
|
-
action:
|
|
3476
|
-
ids:
|
|
3477
|
-
limit:
|
|
3478
|
-
offset:
|
|
6080
|
+
parameters: Type.Object({
|
|
6081
|
+
action: Type.Union([Type.Literal("list"), Type.Literal("restore")], { description: "Action: 'list' to browse archived memories, 'restore' to un-archive specific ones." }),
|
|
6082
|
+
ids: Type.Optional(Type.Array(Type.String(), { description: "Memory UUIDs to restore. Required for restore action." })),
|
|
6083
|
+
limit: Type.Optional(Type.Number({ default: 20, description: "Max archived memories to return for list action (default 20).", minimum: 1, maximum: 100 })),
|
|
6084
|
+
offset: Type.Optional(Type.Number({ default: 0, description: "Pagination offset for list action (default 0).", minimum: 0 }))
|
|
3479
6085
|
})
|
|
3480
6086
|
},
|
|
3481
6087
|
options: { name: "memory_archive" },
|
|
@@ -3507,9 +6113,9 @@ var toolDefinitions = {
|
|
|
3507
6113
|
name: "memory_fold",
|
|
3508
6114
|
label: "Memory Fold",
|
|
3509
6115
|
description: "Merge multiple related memories into a single consolidated node. Collapses redundant or tightly related memories into one.",
|
|
3510
|
-
parameters:
|
|
3511
|
-
ids:
|
|
3512
|
-
label:
|
|
6116
|
+
parameters: Type.Object({
|
|
6117
|
+
ids: Type.Array(Type.String(), { description: "Array of memory UUIDs to merge (minimum 2).", minItems: 2 }),
|
|
6118
|
+
label: Type.Optional(Type.String({ description: "Optional summary label for the merged memory node." }))
|
|
3513
6119
|
})
|
|
3514
6120
|
},
|
|
3515
6121
|
options: { name: "memory_fold" },
|
|
@@ -3531,7 +6137,7 @@ var toolDefinitions = {
|
|
|
3531
6137
|
name: "memory_dashboard",
|
|
3532
6138
|
label: "Memory Dashboard",
|
|
3533
6139
|
description: "Get a high-level dashboard of memory health, usage statistics, and storage information.",
|
|
3534
|
-
parameters:
|
|
6140
|
+
parameters: Type.Object({})
|
|
3535
6141
|
},
|
|
3536
6142
|
options: { name: "memory_dashboard" },
|
|
3537
6143
|
makeExecute: ({ sulcusMem, backendMode, namespace, nativeLoader, isAvailable }) => async (_id, _params) => {
|
|
@@ -3556,9 +6162,9 @@ var toolDefinitions = {
|
|
|
3556
6162
|
name: "episode_recall",
|
|
3557
6163
|
label: "Episode Recall",
|
|
3558
6164
|
description: "Search past conversation episodes \u2014 structured session summaries including topic, decisions, files modified, and outcome. Use for questions like 'what did we discuss last time?' or 'when did we work on X?'",
|
|
3559
|
-
parameters:
|
|
3560
|
-
query:
|
|
3561
|
-
limit:
|
|
6165
|
+
parameters: Type.Object({
|
|
6166
|
+
query: Type.String({ description: "Search query \u2014 topic, keyword, date, or question about past sessions." }),
|
|
6167
|
+
limit: Type.Optional(Type.Number({ default: 5, minimum: 1, maximum: 20, description: "Max episodes to return." }))
|
|
3562
6168
|
})
|
|
3563
6169
|
},
|
|
3564
6170
|
options: { name: "episode_recall" },
|
|
@@ -3605,9 +6211,9 @@ ${formatted}` }],
|
|
|
3605
6211
|
name: "memory_namespace",
|
|
3606
6212
|
label: "Memory Namespace",
|
|
3607
6213
|
description: "Switch the active memory namespace at runtime. Useful for reading from project-specific or shared namespaces, or when serving multiple users. Affects all subsequent memory operations until switched again or the session ends.",
|
|
3608
|
-
parameters:
|
|
3609
|
-
namespace:
|
|
3610
|
-
reason:
|
|
6214
|
+
parameters: Type.Object({
|
|
6215
|
+
namespace: Type.String({ description: "Target namespace to switch to. Use the base namespace name (e.g. 'ariadne', 'project-alpha')." }),
|
|
6216
|
+
reason: Type.Optional(Type.String({ description: "Why you're switching namespace \u2014 logged for audit trail." }))
|
|
3611
6217
|
})
|
|
3612
6218
|
},
|
|
3613
6219
|
options: { name: "memory_namespace" },
|
|
@@ -3631,7 +6237,7 @@ All subsequent memory operations will use namespace \`${target}\` until switched
|
|
|
3631
6237
|
name: "namespace_list",
|
|
3632
6238
|
label: "Namespace List",
|
|
3633
6239
|
description: "List available memory namespaces and their stats (node count, last activity). Useful for multi-user setups or project-scoped memory. Cloud-only.",
|
|
3634
|
-
parameters:
|
|
6240
|
+
parameters: Type.Object({})
|
|
3635
6241
|
},
|
|
3636
6242
|
options: { name: "namespace_list" },
|
|
3637
6243
|
makeExecute: ({ sulcusMem, backendMode, namespace, nativeLoader, isAvailable }) => async (_id, _params) => {
|
|
@@ -3666,8 +6272,8 @@ ${formatted}` }],
|
|
|
3666
6272
|
name: "sulcus_setup",
|
|
3667
6273
|
label: "Sulcus Setup",
|
|
3668
6274
|
description: "Run the Sulcus setup diagnostic \u2014 checks backend connectivity, configuration status, core memory state, and generates recommended cron job configurations for memory maintenance. Call this once when first setting up Sulcus.",
|
|
3669
|
-
parameters:
|
|
3670
|
-
init_core_memory:
|
|
6275
|
+
parameters: Type.Object({
|
|
6276
|
+
init_core_memory: Type.Optional(Type.Boolean({ description: "If true and core memory is empty, initialize it with defaults based on the agent's namespace." }))
|
|
3671
6277
|
})
|
|
3672
6278
|
},
|
|
3673
6279
|
options: { name: "sulcus_setup" },
|
|
@@ -4254,7 +6860,7 @@ var sulcusPlugin = {
|
|
|
4254
6860
|
const dreamMinMemories = pluginConfig?.dreamMinMemories ?? 50;
|
|
4255
6861
|
const dreamMinHeat = pluginConfig?.dreamConsolidateMinHeat ?? 0.1;
|
|
4256
6862
|
if (dreamEnabled && isAvailable && sulcusMem instanceof SulcusCloudClient) {
|
|
4257
|
-
let
|
|
6863
|
+
let readDreamState = function() {
|
|
4258
6864
|
try {
|
|
4259
6865
|
if ((0, import_node_fs.existsSync)(dreamStateFile)) {
|
|
4260
6866
|
const raw = (0, import_node_fs.readFileSync)(dreamStateFile, "utf-8");
|
|
@@ -4267,12 +6873,12 @@ var sulcusPlugin = {
|
|
|
4267
6873
|
} catch {
|
|
4268
6874
|
}
|
|
4269
6875
|
return { lastDreamMs: 0, lastSessionCount: 0 };
|
|
4270
|
-
},
|
|
6876
|
+
}, writeDreamState = function(state) {
|
|
4271
6877
|
try {
|
|
4272
6878
|
(0, import_node_fs.writeFileSync)(dreamStateFile, JSON.stringify(state));
|
|
4273
6879
|
} catch {
|
|
4274
6880
|
}
|
|
4275
|
-
},
|
|
6881
|
+
}, acquireDreamLock = function() {
|
|
4276
6882
|
try {
|
|
4277
6883
|
if ((0, import_node_fs.existsSync)(dreamLockFile)) {
|
|
4278
6884
|
const lockAge = Date.now() - (JSON.parse((0, import_node_fs.readFileSync)(dreamLockFile, "utf-8")).ts ?? 0);
|
|
@@ -4283,13 +6889,12 @@ var sulcusPlugin = {
|
|
|
4283
6889
|
} catch {
|
|
4284
6890
|
return false;
|
|
4285
6891
|
}
|
|
4286
|
-
},
|
|
6892
|
+
}, releaseDreamLock = function() {
|
|
4287
6893
|
try {
|
|
4288
6894
|
if ((0, import_node_fs.existsSync)(dreamLockFile)) require("node:fs").unlinkSync(dreamLockFile);
|
|
4289
6895
|
} catch {
|
|
4290
6896
|
}
|
|
4291
6897
|
};
|
|
4292
|
-
var readDreamState = readDreamState2, writeDreamState = writeDreamState2, acquireDreamLock = acquireDreamLock2, releaseDreamLock = releaseDreamLock2;
|
|
4293
6898
|
const stateDir = (0, import_node_path.resolve)(__dirname, ".sulcus-state");
|
|
4294
6899
|
if (!(0, import_node_fs.existsSync)(stateDir)) (0, import_node_fs.mkdirSync)(stateDir, { recursive: true });
|
|
4295
6900
|
const dreamStateFile = (0, import_node_path.resolve)(stateDir, "dream-state.json");
|
|
@@ -4303,7 +6908,7 @@ var sulcusPlugin = {
|
|
|
4303
6908
|
dreamApiOn("agent_end", async () => {
|
|
4304
6909
|
if (dreamSessionCount % dreamSessionInterval !== 0) return;
|
|
4305
6910
|
if (dreamSessionCount === 0) return;
|
|
4306
|
-
const state =
|
|
6911
|
+
const state = readDreamState();
|
|
4307
6912
|
const elapsed = Date.now() - state.lastDreamMs;
|
|
4308
6913
|
if (elapsed < dreamMinGapMs) {
|
|
4309
6914
|
logger.info(`sulcus/dream: gate 2 skip \u2014 ${Math.round(elapsed / 36e5)}h since last dream (need ${Math.round(dreamMinGapMs / 36e5)}h)`);
|
|
@@ -4322,18 +6927,18 @@ var sulcusPlugin = {
|
|
|
4322
6927
|
logger.warn(`sulcus/dream: gate 3 error \u2014 ${e instanceof Error ? e.message : e}`);
|
|
4323
6928
|
return;
|
|
4324
6929
|
}
|
|
4325
|
-
if (!
|
|
6930
|
+
if (!acquireDreamLock()) {
|
|
4326
6931
|
logger.info("sulcus/dream: lock held \u2014 another consolidation in progress");
|
|
4327
6932
|
return;
|
|
4328
6933
|
}
|
|
4329
6934
|
logger.info(`sulcus/dream: triggering consolidation (minHeat=${dreamMinHeat})`);
|
|
4330
6935
|
sulcusMem.consolidate(dreamMinHeat).then((result) => {
|
|
4331
|
-
|
|
6936
|
+
writeDreamState({ lastDreamMs: Date.now(), lastSessionCount: dreamSessionCount });
|
|
4332
6937
|
logger.info(`sulcus/dream: consolidation complete \u2014 ${JSON.stringify(result)}`);
|
|
4333
6938
|
}).catch((e) => {
|
|
4334
6939
|
logger.warn(`sulcus/dream: consolidation failed \u2014 ${e instanceof Error ? e.message : e}`);
|
|
4335
6940
|
}).finally(() => {
|
|
4336
|
-
|
|
6941
|
+
releaseDreamLock();
|
|
4337
6942
|
});
|
|
4338
6943
|
});
|
|
4339
6944
|
logger.info(`sulcus: dream auto-trigger enabled (every ${dreamSessionInterval} sessions, ${Math.round(dreamMinGapMs / 36e5)}h gap, min ${dreamMinMemories} memories)`);
|