deepline 0.2.13 → 0.2.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/bundling-sources/sdk/src/index.ts +3 -0
  2. package/dist/bundling-sources/sdk/src/play.ts +150 -691
  3. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  4. package/dist/bundling-sources/shared_libs/play-runtime/child-execution-strategy.ts +7 -1
  5. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +249 -51
  6. package/dist/bundling-sources/shared_libs/play-runtime/csv-rename.ts +10 -6
  7. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +32 -51
  8. package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +11 -22
  9. package/dist/bundling-sources/shared_libs/play-runtime/durable-call-policy.ts +34 -0
  10. package/dist/bundling-sources/shared_libs/play-runtime/play-call-execution.ts +2 -1
  11. package/dist/bundling-sources/shared_libs/play-runtime/run-ledger-projection-contract.ts +95 -0
  12. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +11 -6
  13. package/dist/bundling-sources/shared_libs/play-runtime/runtime-receipt-store-adapter.ts +38 -9
  14. package/dist/bundling-sources/shared_libs/play-runtime/secret-capability.ts +23 -15
  15. package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +3 -0
  16. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +2222 -0
  17. package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +3 -2
  18. package/dist/bundling-sources/shared_libs/plays/compiler-manifest.ts +2 -0
  19. package/dist/bundling-sources/shared_libs/plays/contracts.ts +16 -0
  20. package/dist/bundling-sources/shared_libs/plays/input-contract-definition.ts +28 -0
  21. package/dist/bundling-sources/shared_libs/plays/input-contract.ts +3 -3
  22. package/dist/cli/index.js +5074 -829
  23. package/dist/cli/index.mjs +5019 -759
  24. package/dist/compiler-manifest-xFkbJX2B.d.mts +2517 -0
  25. package/dist/compiler-manifest-xFkbJX2B.d.ts +2517 -0
  26. package/dist/index.d.mts +36 -1011
  27. package/dist/index.d.ts +36 -1011
  28. package/dist/index.js +25 -7
  29. package/dist/index.mjs +25 -7
  30. package/dist/plays/bundle-play-file.d.mts +5 -8
  31. package/dist/plays/bundle-play-file.d.ts +5 -8
  32. package/dist/plays/bundle-play-file.mjs +3844 -3
  33. package/package.json +1 -1
  34. package/dist/bundling-sources/shared_libs/plays/source-metadata.ts +0 -240
  35. package/dist/tool-execution-error-4-rhemLQ.d.mts +0 -446
  36. package/dist/tool-execution-error-4-rhemLQ.d.ts +0 -446
@@ -1,3 +1,9 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
1
7
  // src/plays/bundle-play-file.ts
2
8
  import { tmpdir as tmpdir2 } from "os";
3
9
  import { dirname as dirname3, join as join3, resolve as resolve3 } from "path";
@@ -55,6 +61,3839 @@ var TOOL_EXECUTION_ERROR_SCHEMA_VERSION = 1;
55
61
  // ../shared_libs/plays/artifact-contract-version.ts
56
62
  var CURRENT_PLAY_ARTIFACT_CONTRACT_VERSION = 2;
57
63
 
64
+ // ../node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
65
+ var value_exports = {};
66
+ __export(value_exports, {
67
+ HasPropertyKey: () => HasPropertyKey,
68
+ IsArray: () => IsArray,
69
+ IsAsyncIterator: () => IsAsyncIterator,
70
+ IsBigInt: () => IsBigInt,
71
+ IsBoolean: () => IsBoolean,
72
+ IsDate: () => IsDate,
73
+ IsFunction: () => IsFunction,
74
+ IsIterator: () => IsIterator,
75
+ IsNull: () => IsNull,
76
+ IsNumber: () => IsNumber,
77
+ IsObject: () => IsObject,
78
+ IsRegExp: () => IsRegExp,
79
+ IsString: () => IsString,
80
+ IsSymbol: () => IsSymbol,
81
+ IsUint8Array: () => IsUint8Array,
82
+ IsUndefined: () => IsUndefined
83
+ });
84
+ function HasPropertyKey(value, key) {
85
+ return key in value;
86
+ }
87
+ function IsAsyncIterator(value) {
88
+ return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.asyncIterator in value;
89
+ }
90
+ function IsArray(value) {
91
+ return Array.isArray(value);
92
+ }
93
+ function IsBigInt(value) {
94
+ return typeof value === "bigint";
95
+ }
96
+ function IsBoolean(value) {
97
+ return typeof value === "boolean";
98
+ }
99
+ function IsDate(value) {
100
+ return value instanceof globalThis.Date;
101
+ }
102
+ function IsFunction(value) {
103
+ return typeof value === "function";
104
+ }
105
+ function IsIterator(value) {
106
+ return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.iterator in value;
107
+ }
108
+ function IsNull(value) {
109
+ return value === null;
110
+ }
111
+ function IsNumber(value) {
112
+ return typeof value === "number";
113
+ }
114
+ function IsObject(value) {
115
+ return typeof value === "object" && value !== null;
116
+ }
117
+ function IsRegExp(value) {
118
+ return value instanceof globalThis.RegExp;
119
+ }
120
+ function IsString(value) {
121
+ return typeof value === "string";
122
+ }
123
+ function IsSymbol(value) {
124
+ return typeof value === "symbol";
125
+ }
126
+ function IsUint8Array(value) {
127
+ return value instanceof globalThis.Uint8Array;
128
+ }
129
+ function IsUndefined(value) {
130
+ return value === void 0;
131
+ }
132
+
133
+ // ../node_modules/@sinclair/typebox/build/esm/type/clone/value.mjs
134
+ function ArrayType(value) {
135
+ return value.map((value2) => Visit(value2));
136
+ }
137
+ function DateType(value) {
138
+ return new Date(value.getTime());
139
+ }
140
+ function Uint8ArrayType(value) {
141
+ return new Uint8Array(value);
142
+ }
143
+ function RegExpType(value) {
144
+ return new RegExp(value.source, value.flags);
145
+ }
146
+ function ObjectType(value) {
147
+ const result = {};
148
+ for (const key of Object.getOwnPropertyNames(value)) {
149
+ result[key] = Visit(value[key]);
150
+ }
151
+ for (const key of Object.getOwnPropertySymbols(value)) {
152
+ result[key] = Visit(value[key]);
153
+ }
154
+ return result;
155
+ }
156
+ function Visit(value) {
157
+ return IsArray(value) ? ArrayType(value) : IsDate(value) ? DateType(value) : IsUint8Array(value) ? Uint8ArrayType(value) : IsRegExp(value) ? RegExpType(value) : IsObject(value) ? ObjectType(value) : value;
158
+ }
159
+ function Clone(value) {
160
+ return Visit(value);
161
+ }
162
+
163
+ // ../node_modules/@sinclair/typebox/build/esm/type/clone/type.mjs
164
+ function CloneType(schema, options) {
165
+ return options === void 0 ? Clone(schema) : Clone({ ...options, ...schema });
166
+ }
167
+
168
+ // ../node_modules/@sinclair/typebox/build/esm/value/guard/guard.mjs
169
+ function IsObject2(value) {
170
+ return value !== null && typeof value === "object";
171
+ }
172
+ function IsArray2(value) {
173
+ return globalThis.Array.isArray(value) && !globalThis.ArrayBuffer.isView(value);
174
+ }
175
+ function IsUndefined2(value) {
176
+ return value === void 0;
177
+ }
178
+ function IsNumber2(value) {
179
+ return typeof value === "number";
180
+ }
181
+
182
+ // ../node_modules/@sinclair/typebox/build/esm/system/policy.mjs
183
+ var TypeSystemPolicy;
184
+ (function(TypeSystemPolicy2) {
185
+ TypeSystemPolicy2.InstanceMode = "default";
186
+ TypeSystemPolicy2.ExactOptionalPropertyTypes = false;
187
+ TypeSystemPolicy2.AllowArrayObject = false;
188
+ TypeSystemPolicy2.AllowNaN = false;
189
+ TypeSystemPolicy2.AllowNullVoid = false;
190
+ function IsExactOptionalProperty(value, key) {
191
+ return TypeSystemPolicy2.ExactOptionalPropertyTypes ? key in value : value[key] !== void 0;
192
+ }
193
+ TypeSystemPolicy2.IsExactOptionalProperty = IsExactOptionalProperty;
194
+ function IsObjectLike(value) {
195
+ const isObject = IsObject2(value);
196
+ return TypeSystemPolicy2.AllowArrayObject ? isObject : isObject && !IsArray2(value);
197
+ }
198
+ TypeSystemPolicy2.IsObjectLike = IsObjectLike;
199
+ function IsRecordLike(value) {
200
+ return IsObjectLike(value) && !(value instanceof Date) && !(value instanceof Uint8Array);
201
+ }
202
+ TypeSystemPolicy2.IsRecordLike = IsRecordLike;
203
+ function IsNumberLike(value) {
204
+ return TypeSystemPolicy2.AllowNaN ? IsNumber2(value) : Number.isFinite(value);
205
+ }
206
+ TypeSystemPolicy2.IsNumberLike = IsNumberLike;
207
+ function IsVoidLike(value) {
208
+ const isUndefined = IsUndefined2(value);
209
+ return TypeSystemPolicy2.AllowNullVoid ? isUndefined || value === null : isUndefined;
210
+ }
211
+ TypeSystemPolicy2.IsVoidLike = IsVoidLike;
212
+ })(TypeSystemPolicy || (TypeSystemPolicy = {}));
213
+
214
+ // ../node_modules/@sinclair/typebox/build/esm/type/create/immutable.mjs
215
+ function ImmutableArray(value) {
216
+ return globalThis.Object.freeze(value).map((value2) => Immutable(value2));
217
+ }
218
+ function ImmutableDate(value) {
219
+ return value;
220
+ }
221
+ function ImmutableUint8Array(value) {
222
+ return value;
223
+ }
224
+ function ImmutableRegExp(value) {
225
+ return value;
226
+ }
227
+ function ImmutableObject(value) {
228
+ const result = {};
229
+ for (const key of Object.getOwnPropertyNames(value)) {
230
+ result[key] = Immutable(value[key]);
231
+ }
232
+ for (const key of Object.getOwnPropertySymbols(value)) {
233
+ result[key] = Immutable(value[key]);
234
+ }
235
+ return globalThis.Object.freeze(result);
236
+ }
237
+ function Immutable(value) {
238
+ return IsArray(value) ? ImmutableArray(value) : IsDate(value) ? ImmutableDate(value) : IsUint8Array(value) ? ImmutableUint8Array(value) : IsRegExp(value) ? ImmutableRegExp(value) : IsObject(value) ? ImmutableObject(value) : value;
239
+ }
240
+
241
+ // ../node_modules/@sinclair/typebox/build/esm/type/create/type.mjs
242
+ function CreateType(schema, options) {
243
+ const result = options !== void 0 ? { ...options, ...schema } : schema;
244
+ switch (TypeSystemPolicy.InstanceMode) {
245
+ case "freeze":
246
+ return Immutable(result);
247
+ case "clone":
248
+ return Clone(result);
249
+ default:
250
+ return result;
251
+ }
252
+ }
253
+
254
+ // ../node_modules/@sinclair/typebox/build/esm/type/error/error.mjs
255
+ var TypeBoxError = class extends Error {
256
+ constructor(message) {
257
+ super(message);
258
+ }
259
+ };
260
+
261
+ // ../node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.mjs
262
+ var TransformKind = /* @__PURE__ */ Symbol.for("TypeBox.Transform");
263
+ var ReadonlyKind = /* @__PURE__ */ Symbol.for("TypeBox.Readonly");
264
+ var OptionalKind = /* @__PURE__ */ Symbol.for("TypeBox.Optional");
265
+ var Hint = /* @__PURE__ */ Symbol.for("TypeBox.Hint");
266
+ var Kind = /* @__PURE__ */ Symbol.for("TypeBox.Kind");
267
+
268
+ // ../node_modules/@sinclair/typebox/build/esm/type/guard/kind.mjs
269
+ function IsReadonly(value) {
270
+ return IsObject(value) && value[ReadonlyKind] === "Readonly";
271
+ }
272
+ function IsOptional(value) {
273
+ return IsObject(value) && value[OptionalKind] === "Optional";
274
+ }
275
+ function IsAny(value) {
276
+ return IsKindOf(value, "Any");
277
+ }
278
+ function IsArgument(value) {
279
+ return IsKindOf(value, "Argument");
280
+ }
281
+ function IsArray3(value) {
282
+ return IsKindOf(value, "Array");
283
+ }
284
+ function IsAsyncIterator2(value) {
285
+ return IsKindOf(value, "AsyncIterator");
286
+ }
287
+ function IsBigInt2(value) {
288
+ return IsKindOf(value, "BigInt");
289
+ }
290
+ function IsBoolean2(value) {
291
+ return IsKindOf(value, "Boolean");
292
+ }
293
+ function IsComputed(value) {
294
+ return IsKindOf(value, "Computed");
295
+ }
296
+ function IsConstructor(value) {
297
+ return IsKindOf(value, "Constructor");
298
+ }
299
+ function IsDate2(value) {
300
+ return IsKindOf(value, "Date");
301
+ }
302
+ function IsFunction2(value) {
303
+ return IsKindOf(value, "Function");
304
+ }
305
+ function IsInteger(value) {
306
+ return IsKindOf(value, "Integer");
307
+ }
308
+ function IsIntersect(value) {
309
+ return IsKindOf(value, "Intersect");
310
+ }
311
+ function IsIterator2(value) {
312
+ return IsKindOf(value, "Iterator");
313
+ }
314
+ function IsKindOf(value, kind) {
315
+ return IsObject(value) && Kind in value && value[Kind] === kind;
316
+ }
317
+ function IsLiteralValue(value) {
318
+ return IsBoolean(value) || IsNumber(value) || IsString(value);
319
+ }
320
+ function IsLiteral(value) {
321
+ return IsKindOf(value, "Literal");
322
+ }
323
+ function IsMappedKey(value) {
324
+ return IsKindOf(value, "MappedKey");
325
+ }
326
+ function IsMappedResult(value) {
327
+ return IsKindOf(value, "MappedResult");
328
+ }
329
+ function IsNever(value) {
330
+ return IsKindOf(value, "Never");
331
+ }
332
+ function IsNot(value) {
333
+ return IsKindOf(value, "Not");
334
+ }
335
+ function IsNull2(value) {
336
+ return IsKindOf(value, "Null");
337
+ }
338
+ function IsNumber3(value) {
339
+ return IsKindOf(value, "Number");
340
+ }
341
+ function IsObject3(value) {
342
+ return IsKindOf(value, "Object");
343
+ }
344
+ function IsPromise(value) {
345
+ return IsKindOf(value, "Promise");
346
+ }
347
+ function IsRecord(value) {
348
+ return IsKindOf(value, "Record");
349
+ }
350
+ function IsRef(value) {
351
+ return IsKindOf(value, "Ref");
352
+ }
353
+ function IsRegExp2(value) {
354
+ return IsKindOf(value, "RegExp");
355
+ }
356
+ function IsString2(value) {
357
+ return IsKindOf(value, "String");
358
+ }
359
+ function IsSymbol2(value) {
360
+ return IsKindOf(value, "Symbol");
361
+ }
362
+ function IsTemplateLiteral(value) {
363
+ return IsKindOf(value, "TemplateLiteral");
364
+ }
365
+ function IsThis(value) {
366
+ return IsKindOf(value, "This");
367
+ }
368
+ function IsTransform(value) {
369
+ return IsObject(value) && TransformKind in value;
370
+ }
371
+ function IsTuple(value) {
372
+ return IsKindOf(value, "Tuple");
373
+ }
374
+ function IsUndefined3(value) {
375
+ return IsKindOf(value, "Undefined");
376
+ }
377
+ function IsUnion(value) {
378
+ return IsKindOf(value, "Union");
379
+ }
380
+ function IsUint8Array2(value) {
381
+ return IsKindOf(value, "Uint8Array");
382
+ }
383
+ function IsUnknown(value) {
384
+ return IsKindOf(value, "Unknown");
385
+ }
386
+ function IsUnsafe(value) {
387
+ return IsKindOf(value, "Unsafe");
388
+ }
389
+ function IsVoid(value) {
390
+ return IsKindOf(value, "Void");
391
+ }
392
+ function IsKind(value) {
393
+ return IsObject(value) && Kind in value && IsString(value[Kind]);
394
+ }
395
+ function IsSchema(value) {
396
+ 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);
397
+ }
398
+
399
+ // ../node_modules/@sinclair/typebox/build/esm/type/guard/type.mjs
400
+ var type_exports = {};
401
+ __export(type_exports, {
402
+ IsAny: () => IsAny2,
403
+ IsArgument: () => IsArgument2,
404
+ IsArray: () => IsArray4,
405
+ IsAsyncIterator: () => IsAsyncIterator3,
406
+ IsBigInt: () => IsBigInt3,
407
+ IsBoolean: () => IsBoolean3,
408
+ IsComputed: () => IsComputed2,
409
+ IsConstructor: () => IsConstructor2,
410
+ IsDate: () => IsDate3,
411
+ IsFunction: () => IsFunction3,
412
+ IsImport: () => IsImport,
413
+ IsInteger: () => IsInteger2,
414
+ IsIntersect: () => IsIntersect2,
415
+ IsIterator: () => IsIterator3,
416
+ IsKind: () => IsKind2,
417
+ IsKindOf: () => IsKindOf2,
418
+ IsLiteral: () => IsLiteral2,
419
+ IsLiteralBoolean: () => IsLiteralBoolean,
420
+ IsLiteralNumber: () => IsLiteralNumber,
421
+ IsLiteralString: () => IsLiteralString,
422
+ IsLiteralValue: () => IsLiteralValue2,
423
+ IsMappedKey: () => IsMappedKey2,
424
+ IsMappedResult: () => IsMappedResult2,
425
+ IsNever: () => IsNever2,
426
+ IsNot: () => IsNot2,
427
+ IsNull: () => IsNull3,
428
+ IsNumber: () => IsNumber4,
429
+ IsObject: () => IsObject4,
430
+ IsOptional: () => IsOptional2,
431
+ IsPromise: () => IsPromise2,
432
+ IsProperties: () => IsProperties,
433
+ IsReadonly: () => IsReadonly2,
434
+ IsRecord: () => IsRecord2,
435
+ IsRecursive: () => IsRecursive,
436
+ IsRef: () => IsRef2,
437
+ IsRegExp: () => IsRegExp3,
438
+ IsSchema: () => IsSchema2,
439
+ IsString: () => IsString3,
440
+ IsSymbol: () => IsSymbol3,
441
+ IsTemplateLiteral: () => IsTemplateLiteral2,
442
+ IsThis: () => IsThis2,
443
+ IsTransform: () => IsTransform2,
444
+ IsTuple: () => IsTuple2,
445
+ IsUint8Array: () => IsUint8Array3,
446
+ IsUndefined: () => IsUndefined4,
447
+ IsUnion: () => IsUnion2,
448
+ IsUnionLiteral: () => IsUnionLiteral,
449
+ IsUnknown: () => IsUnknown2,
450
+ IsUnsafe: () => IsUnsafe2,
451
+ IsVoid: () => IsVoid2,
452
+ TypeGuardUnknownTypeError: () => TypeGuardUnknownTypeError
453
+ });
454
+ var TypeGuardUnknownTypeError = class extends TypeBoxError {
455
+ };
456
+ var KnownTypes = [
457
+ "Argument",
458
+ "Any",
459
+ "Array",
460
+ "AsyncIterator",
461
+ "BigInt",
462
+ "Boolean",
463
+ "Computed",
464
+ "Constructor",
465
+ "Date",
466
+ "Enum",
467
+ "Function",
468
+ "Integer",
469
+ "Intersect",
470
+ "Iterator",
471
+ "Literal",
472
+ "MappedKey",
473
+ "MappedResult",
474
+ "Not",
475
+ "Null",
476
+ "Number",
477
+ "Object",
478
+ "Promise",
479
+ "Record",
480
+ "Ref",
481
+ "RegExp",
482
+ "String",
483
+ "Symbol",
484
+ "TemplateLiteral",
485
+ "This",
486
+ "Tuple",
487
+ "Undefined",
488
+ "Union",
489
+ "Uint8Array",
490
+ "Unknown",
491
+ "Void"
492
+ ];
493
+ function IsPattern(value) {
494
+ try {
495
+ new RegExp(value);
496
+ return true;
497
+ } catch {
498
+ return false;
499
+ }
500
+ }
501
+ function IsControlCharacterFree(value) {
502
+ if (!IsString(value))
503
+ return false;
504
+ for (let i = 0; i < value.length; i++) {
505
+ const code = value.charCodeAt(i);
506
+ if (code >= 7 && code <= 13 || code === 27 || code === 127) {
507
+ return false;
508
+ }
509
+ }
510
+ return true;
511
+ }
512
+ function IsAdditionalProperties(value) {
513
+ return IsOptionalBoolean(value) || IsSchema2(value);
514
+ }
515
+ function IsOptionalBigInt(value) {
516
+ return IsUndefined(value) || IsBigInt(value);
517
+ }
518
+ function IsOptionalNumber(value) {
519
+ return IsUndefined(value) || IsNumber(value);
520
+ }
521
+ function IsOptionalBoolean(value) {
522
+ return IsUndefined(value) || IsBoolean(value);
523
+ }
524
+ function IsOptionalString(value) {
525
+ return IsUndefined(value) || IsString(value);
526
+ }
527
+ function IsOptionalPattern(value) {
528
+ return IsUndefined(value) || IsString(value) && IsControlCharacterFree(value) && IsPattern(value);
529
+ }
530
+ function IsOptionalFormat(value) {
531
+ return IsUndefined(value) || IsString(value) && IsControlCharacterFree(value);
532
+ }
533
+ function IsOptionalSchema(value) {
534
+ return IsUndefined(value) || IsSchema2(value);
535
+ }
536
+ function IsReadonly2(value) {
537
+ return IsObject(value) && value[ReadonlyKind] === "Readonly";
538
+ }
539
+ function IsOptional2(value) {
540
+ return IsObject(value) && value[OptionalKind] === "Optional";
541
+ }
542
+ function IsAny2(value) {
543
+ return IsKindOf2(value, "Any") && IsOptionalString(value.$id);
544
+ }
545
+ function IsArgument2(value) {
546
+ return IsKindOf2(value, "Argument") && IsNumber(value.index);
547
+ }
548
+ function IsArray4(value) {
549
+ 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);
550
+ }
551
+ function IsAsyncIterator3(value) {
552
+ return IsKindOf2(value, "AsyncIterator") && value.type === "AsyncIterator" && IsOptionalString(value.$id) && IsSchema2(value.items);
553
+ }
554
+ function IsBigInt3(value) {
555
+ 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);
556
+ }
557
+ function IsBoolean3(value) {
558
+ return IsKindOf2(value, "Boolean") && value.type === "boolean" && IsOptionalString(value.$id);
559
+ }
560
+ function IsComputed2(value) {
561
+ return IsKindOf2(value, "Computed") && IsString(value.target) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema));
562
+ }
563
+ function IsConstructor2(value) {
564
+ return IsKindOf2(value, "Constructor") && value.type === "Constructor" && IsOptionalString(value.$id) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)) && IsSchema2(value.returns);
565
+ }
566
+ function IsDate3(value) {
567
+ 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);
568
+ }
569
+ function IsFunction3(value) {
570
+ return IsKindOf2(value, "Function") && value.type === "Function" && IsOptionalString(value.$id) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)) && IsSchema2(value.returns);
571
+ }
572
+ function IsImport(value) {
573
+ return IsKindOf2(value, "Import") && HasPropertyKey(value, "$defs") && IsObject(value.$defs) && IsProperties(value.$defs) && HasPropertyKey(value, "$ref") && IsString(value.$ref) && value.$ref in value.$defs;
574
+ }
575
+ function IsInteger2(value) {
576
+ 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);
577
+ }
578
+ function IsProperties(value) {
579
+ return IsObject(value) && Object.entries(value).every(([key, schema]) => IsControlCharacterFree(key) && IsSchema2(schema));
580
+ }
581
+ function IsIntersect2(value) {
582
+ 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);
583
+ }
584
+ function IsIterator3(value) {
585
+ return IsKindOf2(value, "Iterator") && value.type === "Iterator" && IsOptionalString(value.$id) && IsSchema2(value.items);
586
+ }
587
+ function IsKindOf2(value, kind) {
588
+ return IsObject(value) && Kind in value && value[Kind] === kind;
589
+ }
590
+ function IsLiteralString(value) {
591
+ return IsLiteral2(value) && IsString(value.const);
592
+ }
593
+ function IsLiteralNumber(value) {
594
+ return IsLiteral2(value) && IsNumber(value.const);
595
+ }
596
+ function IsLiteralBoolean(value) {
597
+ return IsLiteral2(value) && IsBoolean(value.const);
598
+ }
599
+ function IsLiteral2(value) {
600
+ return IsKindOf2(value, "Literal") && IsOptionalString(value.$id) && IsLiteralValue2(value.const);
601
+ }
602
+ function IsLiteralValue2(value) {
603
+ return IsBoolean(value) || IsNumber(value) || IsString(value);
604
+ }
605
+ function IsMappedKey2(value) {
606
+ return IsKindOf2(value, "MappedKey") && IsArray(value.keys) && value.keys.every((key) => IsNumber(key) || IsString(key));
607
+ }
608
+ function IsMappedResult2(value) {
609
+ return IsKindOf2(value, "MappedResult") && IsProperties(value.properties);
610
+ }
611
+ function IsNever2(value) {
612
+ return IsKindOf2(value, "Never") && IsObject(value.not) && Object.getOwnPropertyNames(value.not).length === 0;
613
+ }
614
+ function IsNot2(value) {
615
+ return IsKindOf2(value, "Not") && IsSchema2(value.not);
616
+ }
617
+ function IsNull3(value) {
618
+ return IsKindOf2(value, "Null") && value.type === "null" && IsOptionalString(value.$id);
619
+ }
620
+ function IsNumber4(value) {
621
+ 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);
622
+ }
623
+ function IsObject4(value) {
624
+ return IsKindOf2(value, "Object") && value.type === "object" && IsOptionalString(value.$id) && IsProperties(value.properties) && IsAdditionalProperties(value.additionalProperties) && IsOptionalNumber(value.minProperties) && IsOptionalNumber(value.maxProperties);
625
+ }
626
+ function IsPromise2(value) {
627
+ return IsKindOf2(value, "Promise") && value.type === "Promise" && IsOptionalString(value.$id) && IsSchema2(value.item);
628
+ }
629
+ function IsRecord2(value) {
630
+ return IsKindOf2(value, "Record") && value.type === "object" && IsOptionalString(value.$id) && IsAdditionalProperties(value.additionalProperties) && IsObject(value.patternProperties) && ((schema) => {
631
+ const keys = Object.getOwnPropertyNames(schema.patternProperties);
632
+ return keys.length === 1 && IsPattern(keys[0]) && IsObject(schema.patternProperties) && IsSchema2(schema.patternProperties[keys[0]]);
633
+ })(value);
634
+ }
635
+ function IsRecursive(value) {
636
+ return IsObject(value) && Hint in value && value[Hint] === "Recursive";
637
+ }
638
+ function IsRef2(value) {
639
+ return IsKindOf2(value, "Ref") && IsOptionalString(value.$id) && IsString(value.$ref);
640
+ }
641
+ function IsRegExp3(value) {
642
+ return IsKindOf2(value, "RegExp") && IsOptionalString(value.$id) && IsString(value.source) && IsString(value.flags) && IsOptionalNumber(value.maxLength) && IsOptionalNumber(value.minLength);
643
+ }
644
+ function IsString3(value) {
645
+ return IsKindOf2(value, "String") && value.type === "string" && IsOptionalString(value.$id) && IsOptionalNumber(value.minLength) && IsOptionalNumber(value.maxLength) && IsOptionalPattern(value.pattern) && IsOptionalFormat(value.format);
646
+ }
647
+ function IsSymbol3(value) {
648
+ return IsKindOf2(value, "Symbol") && value.type === "symbol" && IsOptionalString(value.$id);
649
+ }
650
+ function IsTemplateLiteral2(value) {
651
+ return IsKindOf2(value, "TemplateLiteral") && value.type === "string" && IsString(value.pattern) && value.pattern[0] === "^" && value.pattern[value.pattern.length - 1] === "$";
652
+ }
653
+ function IsThis2(value) {
654
+ return IsKindOf2(value, "This") && IsOptionalString(value.$id) && IsString(value.$ref);
655
+ }
656
+ function IsTransform2(value) {
657
+ return IsObject(value) && TransformKind in value;
658
+ }
659
+ function IsTuple2(value) {
660
+ return IsKindOf2(value, "Tuple") && value.type === "array" && IsOptionalString(value.$id) && IsNumber(value.minItems) && IsNumber(value.maxItems) && value.minItems === value.maxItems && // empty
661
+ (IsUndefined(value.items) && IsUndefined(value.additionalItems) && value.minItems === 0 || IsArray(value.items) && value.items.every((schema) => IsSchema2(schema)));
662
+ }
663
+ function IsUndefined4(value) {
664
+ return IsKindOf2(value, "Undefined") && value.type === "undefined" && IsOptionalString(value.$id);
665
+ }
666
+ function IsUnionLiteral(value) {
667
+ return IsUnion2(value) && value.anyOf.every((schema) => IsLiteralString(schema) || IsLiteralNumber(schema));
668
+ }
669
+ function IsUnion2(value) {
670
+ return IsKindOf2(value, "Union") && IsOptionalString(value.$id) && IsObject(value) && IsArray(value.anyOf) && value.anyOf.every((schema) => IsSchema2(schema));
671
+ }
672
+ function IsUint8Array3(value) {
673
+ return IsKindOf2(value, "Uint8Array") && value.type === "Uint8Array" && IsOptionalString(value.$id) && IsOptionalNumber(value.minByteLength) && IsOptionalNumber(value.maxByteLength);
674
+ }
675
+ function IsUnknown2(value) {
676
+ return IsKindOf2(value, "Unknown") && IsOptionalString(value.$id);
677
+ }
678
+ function IsUnsafe2(value) {
679
+ return IsKindOf2(value, "Unsafe");
680
+ }
681
+ function IsVoid2(value) {
682
+ return IsKindOf2(value, "Void") && value.type === "void" && IsOptionalString(value.$id);
683
+ }
684
+ function IsKind2(value) {
685
+ return IsObject(value) && Kind in value && IsString(value[Kind]) && !KnownTypes.includes(value[Kind]);
686
+ }
687
+ function IsSchema2(value) {
688
+ 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));
689
+ }
690
+
691
+ // ../node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.mjs
692
+ var PatternBoolean = "(true|false)";
693
+ var PatternNumber = "(0|[1-9][0-9]*)";
694
+ var PatternString = "(.*)";
695
+ var PatternNever = "(?!.*)";
696
+ var PatternBooleanExact = `^${PatternBoolean}$`;
697
+ var PatternNumberExact = `^${PatternNumber}$`;
698
+ var PatternStringExact = `^${PatternString}$`;
699
+ var PatternNeverExact = `^${PatternNever}$`;
700
+
701
+ // ../node_modules/@sinclair/typebox/build/esm/type/sets/set.mjs
702
+ function SetIncludes(T, S) {
703
+ return T.includes(S);
704
+ }
705
+ function SetDistinct(T) {
706
+ return [...new Set(T)];
707
+ }
708
+ function SetIntersect(T, S) {
709
+ return T.filter((L) => S.includes(L));
710
+ }
711
+ function SetIntersectManyResolve(T, Init) {
712
+ return T.reduce((Acc, L) => {
713
+ return SetIntersect(Acc, L);
714
+ }, Init);
715
+ }
716
+ function SetIntersectMany(T) {
717
+ return T.length === 1 ? T[0] : T.length > 1 ? SetIntersectManyResolve(T.slice(1), T[0]) : [];
718
+ }
719
+ function SetUnionMany(T) {
720
+ const Acc = [];
721
+ for (const L of T)
722
+ Acc.push(...L);
723
+ return Acc;
724
+ }
725
+
726
+ // ../node_modules/@sinclair/typebox/build/esm/type/any/any.mjs
727
+ function Any(options) {
728
+ return CreateType({ [Kind]: "Any" }, options);
729
+ }
730
+
731
+ // ../node_modules/@sinclair/typebox/build/esm/type/array/array.mjs
732
+ function Array2(items, options) {
733
+ return CreateType({ [Kind]: "Array", type: "array", items }, options);
734
+ }
735
+
736
+ // ../node_modules/@sinclair/typebox/build/esm/type/argument/argument.mjs
737
+ function Argument(index) {
738
+ return CreateType({ [Kind]: "Argument", index });
739
+ }
740
+
741
+ // ../node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.mjs
742
+ function AsyncIterator(items, options) {
743
+ return CreateType({ [Kind]: "AsyncIterator", type: "AsyncIterator", items }, options);
744
+ }
745
+
746
+ // ../node_modules/@sinclair/typebox/build/esm/type/computed/computed.mjs
747
+ function Computed(target, parameters, options) {
748
+ return CreateType({ [Kind]: "Computed", target, parameters }, options);
749
+ }
750
+
751
+ // ../node_modules/@sinclair/typebox/build/esm/type/discard/discard.mjs
752
+ function DiscardKey(value, key) {
753
+ const { [key]: _, ...rest } = value;
754
+ return rest;
755
+ }
756
+ function Discard(value, keys) {
757
+ return keys.reduce((acc, key) => DiscardKey(acc, key), value);
758
+ }
759
+
760
+ // ../node_modules/@sinclair/typebox/build/esm/type/never/never.mjs
761
+ function Never(options) {
762
+ return CreateType({ [Kind]: "Never", not: {} }, options);
763
+ }
764
+
765
+ // ../node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.mjs
766
+ function MappedResult(properties) {
767
+ return CreateType({
768
+ [Kind]: "MappedResult",
769
+ properties
770
+ });
771
+ }
772
+
773
+ // ../node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.mjs
774
+ function Constructor(parameters, returns, options) {
775
+ return CreateType({ [Kind]: "Constructor", type: "Constructor", parameters, returns }, options);
776
+ }
777
+
778
+ // ../node_modules/@sinclair/typebox/build/esm/type/function/function.mjs
779
+ function Function2(parameters, returns, options) {
780
+ return CreateType({ [Kind]: "Function", type: "Function", parameters, returns }, options);
781
+ }
782
+
783
+ // ../node_modules/@sinclair/typebox/build/esm/type/union/union-create.mjs
784
+ function UnionCreate(T, options) {
785
+ return CreateType({ [Kind]: "Union", anyOf: T }, options);
786
+ }
787
+
788
+ // ../node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.mjs
789
+ function IsUnionOptional(types) {
790
+ return types.some((type) => IsOptional(type));
791
+ }
792
+ function RemoveOptionalFromRest(types) {
793
+ return types.map((left) => IsOptional(left) ? RemoveOptionalFromType(left) : left);
794
+ }
795
+ function RemoveOptionalFromType(T) {
796
+ return Discard(T, [OptionalKind]);
797
+ }
798
+ function ResolveUnion(types, options) {
799
+ const isOptional = IsUnionOptional(types);
800
+ return isOptional ? Optional(UnionCreate(RemoveOptionalFromRest(types), options)) : UnionCreate(RemoveOptionalFromRest(types), options);
801
+ }
802
+ function UnionEvaluated(T, options) {
803
+ return T.length === 1 ? CreateType(T[0], options) : T.length === 0 ? Never(options) : ResolveUnion(T, options);
804
+ }
805
+
806
+ // ../node_modules/@sinclair/typebox/build/esm/type/union/union.mjs
807
+ function Union(types, options) {
808
+ return types.length === 0 ? Never(options) : types.length === 1 ? CreateType(types[0], options) : UnionCreate(types, options);
809
+ }
810
+
811
+ // ../node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.mjs
812
+ var TemplateLiteralParserError = class extends TypeBoxError {
813
+ };
814
+ function Unescape(pattern) {
815
+ return pattern.replace(/\\\$/g, "$").replace(/\\\*/g, "*").replace(/\\\^/g, "^").replace(/\\\|/g, "|").replace(/\\\(/g, "(").replace(/\\\)/g, ")");
816
+ }
817
+ function IsNonEscaped(pattern, index, char) {
818
+ return pattern[index] === char && pattern.charCodeAt(index - 1) !== 92;
819
+ }
820
+ function IsOpenParen(pattern, index) {
821
+ return IsNonEscaped(pattern, index, "(");
822
+ }
823
+ function IsCloseParen(pattern, index) {
824
+ return IsNonEscaped(pattern, index, ")");
825
+ }
826
+ function IsSeparator(pattern, index) {
827
+ return IsNonEscaped(pattern, index, "|");
828
+ }
829
+ function IsGroup(pattern) {
830
+ if (!(IsOpenParen(pattern, 0) && IsCloseParen(pattern, pattern.length - 1)))
831
+ return false;
832
+ let count = 0;
833
+ for (let index = 0; index < pattern.length; index++) {
834
+ if (IsOpenParen(pattern, index))
835
+ count += 1;
836
+ if (IsCloseParen(pattern, index))
837
+ count -= 1;
838
+ if (count === 0 && index !== pattern.length - 1)
839
+ return false;
840
+ }
841
+ return true;
842
+ }
843
+ function InGroup(pattern) {
844
+ return pattern.slice(1, pattern.length - 1);
845
+ }
846
+ function IsPrecedenceOr(pattern) {
847
+ let count = 0;
848
+ for (let index = 0; index < pattern.length; index++) {
849
+ if (IsOpenParen(pattern, index))
850
+ count += 1;
851
+ if (IsCloseParen(pattern, index))
852
+ count -= 1;
853
+ if (IsSeparator(pattern, index) && count === 0)
854
+ return true;
855
+ }
856
+ return false;
857
+ }
858
+ function IsPrecedenceAnd(pattern) {
859
+ for (let index = 0; index < pattern.length; index++) {
860
+ if (IsOpenParen(pattern, index))
861
+ return true;
862
+ }
863
+ return false;
864
+ }
865
+ function Or(pattern) {
866
+ let [count, start] = [0, 0];
867
+ const expressions = [];
868
+ for (let index = 0; index < pattern.length; index++) {
869
+ if (IsOpenParen(pattern, index))
870
+ count += 1;
871
+ if (IsCloseParen(pattern, index))
872
+ count -= 1;
873
+ if (IsSeparator(pattern, index) && count === 0) {
874
+ const range2 = pattern.slice(start, index);
875
+ if (range2.length > 0)
876
+ expressions.push(TemplateLiteralParse(range2));
877
+ start = index + 1;
878
+ }
879
+ }
880
+ const range = pattern.slice(start);
881
+ if (range.length > 0)
882
+ expressions.push(TemplateLiteralParse(range));
883
+ if (expressions.length === 0)
884
+ return { type: "const", const: "" };
885
+ if (expressions.length === 1)
886
+ return expressions[0];
887
+ return { type: "or", expr: expressions };
888
+ }
889
+ function And(pattern) {
890
+ function Group(value, index) {
891
+ if (!IsOpenParen(value, index))
892
+ throw new TemplateLiteralParserError(`TemplateLiteralParser: Index must point to open parens`);
893
+ let count = 0;
894
+ for (let scan = index; scan < value.length; scan++) {
895
+ if (IsOpenParen(value, scan))
896
+ count += 1;
897
+ if (IsCloseParen(value, scan))
898
+ count -= 1;
899
+ if (count === 0)
900
+ return [index, scan];
901
+ }
902
+ throw new TemplateLiteralParserError(`TemplateLiteralParser: Unclosed group parens in expression`);
903
+ }
904
+ function Range(pattern2, index) {
905
+ for (let scan = index; scan < pattern2.length; scan++) {
906
+ if (IsOpenParen(pattern2, scan))
907
+ return [index, scan];
908
+ }
909
+ return [index, pattern2.length];
910
+ }
911
+ const expressions = [];
912
+ for (let index = 0; index < pattern.length; index++) {
913
+ if (IsOpenParen(pattern, index)) {
914
+ const [start, end] = Group(pattern, index);
915
+ const range = pattern.slice(start, end + 1);
916
+ expressions.push(TemplateLiteralParse(range));
917
+ index = end;
918
+ } else {
919
+ const [start, end] = Range(pattern, index);
920
+ const range = pattern.slice(start, end);
921
+ if (range.length > 0)
922
+ expressions.push(TemplateLiteralParse(range));
923
+ index = end - 1;
924
+ }
925
+ }
926
+ return expressions.length === 0 ? { type: "const", const: "" } : expressions.length === 1 ? expressions[0] : { type: "and", expr: expressions };
927
+ }
928
+ function TemplateLiteralParse(pattern) {
929
+ return IsGroup(pattern) ? TemplateLiteralParse(InGroup(pattern)) : IsPrecedenceOr(pattern) ? Or(pattern) : IsPrecedenceAnd(pattern) ? And(pattern) : { type: "const", const: Unescape(pattern) };
930
+ }
931
+ function TemplateLiteralParseExact(pattern) {
932
+ return TemplateLiteralParse(pattern.slice(1, pattern.length - 1));
933
+ }
934
+
935
+ // ../node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.mjs
936
+ var TemplateLiteralFiniteError = class extends TypeBoxError {
937
+ };
938
+ function IsNumberExpression(expression) {
939
+ 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]*";
940
+ }
941
+ function IsBooleanExpression(expression) {
942
+ 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";
943
+ }
944
+ function IsStringExpression(expression) {
945
+ return expression.type === "const" && expression.const === ".*";
946
+ }
947
+ function IsTemplateLiteralExpressionFinite(expression) {
948
+ 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 : (() => {
949
+ throw new TemplateLiteralFiniteError(`Unknown expression type`);
950
+ })();
951
+ }
952
+ function IsTemplateLiteralFinite(schema) {
953
+ const expression = TemplateLiteralParseExact(schema.pattern);
954
+ return IsTemplateLiteralExpressionFinite(expression);
955
+ }
956
+
957
+ // ../node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.mjs
958
+ var TemplateLiteralGenerateError = class extends TypeBoxError {
959
+ };
960
+ function* GenerateReduce(buffer) {
961
+ if (buffer.length === 1)
962
+ return yield* buffer[0];
963
+ for (const left of buffer[0]) {
964
+ for (const right of GenerateReduce(buffer.slice(1))) {
965
+ yield `${left}${right}`;
966
+ }
967
+ }
968
+ }
969
+ function* GenerateAnd(expression) {
970
+ return yield* GenerateReduce(expression.expr.map((expr) => [...TemplateLiteralExpressionGenerate(expr)]));
971
+ }
972
+ function* GenerateOr(expression) {
973
+ for (const expr of expression.expr)
974
+ yield* TemplateLiteralExpressionGenerate(expr);
975
+ }
976
+ function* GenerateConst(expression) {
977
+ return yield expression.const;
978
+ }
979
+ function* TemplateLiteralExpressionGenerate(expression) {
980
+ return expression.type === "and" ? yield* GenerateAnd(expression) : expression.type === "or" ? yield* GenerateOr(expression) : expression.type === "const" ? yield* GenerateConst(expression) : (() => {
981
+ throw new TemplateLiteralGenerateError("Unknown expression");
982
+ })();
983
+ }
984
+ function TemplateLiteralGenerate(schema) {
985
+ const expression = TemplateLiteralParseExact(schema.pattern);
986
+ return IsTemplateLiteralExpressionFinite(expression) ? [...TemplateLiteralExpressionGenerate(expression)] : [];
987
+ }
988
+
989
+ // ../node_modules/@sinclair/typebox/build/esm/type/literal/literal.mjs
990
+ function Literal(value, options) {
991
+ return CreateType({
992
+ [Kind]: "Literal",
993
+ const: value,
994
+ type: typeof value
995
+ }, options);
996
+ }
997
+
998
+ // ../node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.mjs
999
+ function Boolean2(options) {
1000
+ return CreateType({ [Kind]: "Boolean", type: "boolean" }, options);
1001
+ }
1002
+
1003
+ // ../node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.mjs
1004
+ function BigInt(options) {
1005
+ return CreateType({ [Kind]: "BigInt", type: "bigint" }, options);
1006
+ }
1007
+
1008
+ // ../node_modules/@sinclair/typebox/build/esm/type/number/number.mjs
1009
+ function Number2(options) {
1010
+ return CreateType({ [Kind]: "Number", type: "number" }, options);
1011
+ }
1012
+
1013
+ // ../node_modules/@sinclair/typebox/build/esm/type/string/string.mjs
1014
+ function String2(options) {
1015
+ return CreateType({ [Kind]: "String", type: "string" }, options);
1016
+ }
1017
+
1018
+ // ../node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.mjs
1019
+ function* FromUnion(syntax) {
1020
+ const trim = syntax.trim().replace(/"|'/g, "");
1021
+ return trim === "boolean" ? yield Boolean2() : trim === "number" ? yield Number2() : trim === "bigint" ? yield BigInt() : trim === "string" ? yield String2() : yield (() => {
1022
+ const literals = trim.split("|").map((literal) => Literal(literal.trim()));
1023
+ return literals.length === 0 ? Never() : literals.length === 1 ? literals[0] : UnionEvaluated(literals);
1024
+ })();
1025
+ }
1026
+ function* FromTerminal(syntax) {
1027
+ if (syntax[1] !== "{") {
1028
+ const L = Literal("$");
1029
+ const R = FromSyntax(syntax.slice(1));
1030
+ return yield* [L, ...R];
1031
+ }
1032
+ for (let i = 2; i < syntax.length; i++) {
1033
+ if (syntax[i] === "}") {
1034
+ const L = FromUnion(syntax.slice(2, i));
1035
+ const R = FromSyntax(syntax.slice(i + 1));
1036
+ return yield* [...L, ...R];
1037
+ }
1038
+ }
1039
+ yield Literal(syntax);
1040
+ }
1041
+ function* FromSyntax(syntax) {
1042
+ for (let i = 0; i < syntax.length; i++) {
1043
+ if (syntax[i] === "$") {
1044
+ const L = Literal(syntax.slice(0, i));
1045
+ const R = FromTerminal(syntax.slice(i));
1046
+ return yield* [L, ...R];
1047
+ }
1048
+ }
1049
+ yield Literal(syntax);
1050
+ }
1051
+ function TemplateLiteralSyntax(syntax) {
1052
+ return [...FromSyntax(syntax)];
1053
+ }
1054
+
1055
+ // ../node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.mjs
1056
+ var TemplateLiteralPatternError = class extends TypeBoxError {
1057
+ };
1058
+ function Escape(value) {
1059
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1060
+ }
1061
+ function Visit2(schema, acc) {
1062
+ 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}` : (() => {
1063
+ throw new TemplateLiteralPatternError(`Unexpected Kind '${schema[Kind]}'`);
1064
+ })();
1065
+ }
1066
+ function TemplateLiteralPattern(kinds) {
1067
+ return `^${kinds.map((schema) => Visit2(schema, "")).join("")}$`;
1068
+ }
1069
+
1070
+ // ../node_modules/@sinclair/typebox/build/esm/type/template-literal/union.mjs
1071
+ function TemplateLiteralToUnion(schema) {
1072
+ const R = TemplateLiteralGenerate(schema);
1073
+ const L = R.map((S) => Literal(S));
1074
+ return UnionEvaluated(L);
1075
+ }
1076
+
1077
+ // ../node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.mjs
1078
+ function TemplateLiteral(unresolved, options) {
1079
+ const pattern = IsString(unresolved) ? TemplateLiteralPattern(TemplateLiteralSyntax(unresolved)) : TemplateLiteralPattern(unresolved);
1080
+ return CreateType({ [Kind]: "TemplateLiteral", type: "string", pattern }, options);
1081
+ }
1082
+
1083
+ // ../node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.mjs
1084
+ function FromTemplateLiteral(templateLiteral) {
1085
+ const keys = TemplateLiteralGenerate(templateLiteral);
1086
+ return keys.map((key) => key.toString());
1087
+ }
1088
+ function FromUnion2(types) {
1089
+ const result = [];
1090
+ for (const type of types)
1091
+ result.push(...IndexPropertyKeys(type));
1092
+ return result;
1093
+ }
1094
+ function FromLiteral(literalValue) {
1095
+ return [literalValue.toString()];
1096
+ }
1097
+ function IndexPropertyKeys(type) {
1098
+ return [...new Set(IsTemplateLiteral(type) ? FromTemplateLiteral(type) : IsUnion(type) ? FromUnion2(type.anyOf) : IsLiteral(type) ? FromLiteral(type.const) : IsNumber3(type) ? ["[number]"] : IsInteger(type) ? ["[number]"] : [])];
1099
+ }
1100
+
1101
+ // ../node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.mjs
1102
+ function FromProperties(type, properties, options) {
1103
+ const result = {};
1104
+ for (const K2 of Object.getOwnPropertyNames(properties)) {
1105
+ result[K2] = Index(type, IndexPropertyKeys(properties[K2]), options);
1106
+ }
1107
+ return result;
1108
+ }
1109
+ function FromMappedResult(type, mappedResult, options) {
1110
+ return FromProperties(type, mappedResult.properties, options);
1111
+ }
1112
+ function IndexFromMappedResult(type, mappedResult, options) {
1113
+ const properties = FromMappedResult(type, mappedResult, options);
1114
+ return MappedResult(properties);
1115
+ }
1116
+
1117
+ // ../node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.mjs
1118
+ function FromRest(types, key) {
1119
+ return types.map((type) => IndexFromPropertyKey(type, key));
1120
+ }
1121
+ function FromIntersectRest(types) {
1122
+ return types.filter((type) => !IsNever(type));
1123
+ }
1124
+ function FromIntersect(types, key) {
1125
+ return IntersectEvaluated(FromIntersectRest(FromRest(types, key)));
1126
+ }
1127
+ function FromUnionRest(types) {
1128
+ return types.some((L) => IsNever(L)) ? [] : types;
1129
+ }
1130
+ function FromUnion3(types, key) {
1131
+ return UnionEvaluated(FromUnionRest(FromRest(types, key)));
1132
+ }
1133
+ function FromTuple(types, key) {
1134
+ return key in types ? types[key] : key === "[number]" ? UnionEvaluated(types) : Never();
1135
+ }
1136
+ function FromArray(type, key) {
1137
+ return key === "[number]" ? type : Never();
1138
+ }
1139
+ function FromProperty(properties, propertyKey) {
1140
+ return propertyKey in properties ? properties[propertyKey] : Never();
1141
+ }
1142
+ function IndexFromPropertyKey(type, propertyKey) {
1143
+ 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();
1144
+ }
1145
+ function IndexFromPropertyKeys(type, propertyKeys) {
1146
+ return propertyKeys.map((propertyKey) => IndexFromPropertyKey(type, propertyKey));
1147
+ }
1148
+ function FromSchema(type, propertyKeys) {
1149
+ return UnionEvaluated(IndexFromPropertyKeys(type, propertyKeys));
1150
+ }
1151
+ function Index(type, key, options) {
1152
+ if (IsRef(type) || IsRef(key)) {
1153
+ const error = `Index types using Ref parameters require both Type and Key to be of TSchema`;
1154
+ if (!IsSchema(type) || !IsSchema(key))
1155
+ throw new TypeBoxError(error);
1156
+ return Computed("Index", [type, key]);
1157
+ }
1158
+ if (IsMappedResult(key))
1159
+ return IndexFromMappedResult(type, key, options);
1160
+ if (IsMappedKey(key))
1161
+ return IndexFromMappedKey(type, key, options);
1162
+ return CreateType(IsSchema(key) ? FromSchema(type, IndexPropertyKeys(key)) : FromSchema(type, key), options);
1163
+ }
1164
+
1165
+ // ../node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.mjs
1166
+ function MappedIndexPropertyKey(type, key, options) {
1167
+ return { [key]: Index(type, [key], Clone(options)) };
1168
+ }
1169
+ function MappedIndexPropertyKeys(type, propertyKeys, options) {
1170
+ return propertyKeys.reduce((result, left) => {
1171
+ return { ...result, ...MappedIndexPropertyKey(type, left, options) };
1172
+ }, {});
1173
+ }
1174
+ function MappedIndexProperties(type, mappedKey, options) {
1175
+ return MappedIndexPropertyKeys(type, mappedKey.keys, options);
1176
+ }
1177
+ function IndexFromMappedKey(type, mappedKey, options) {
1178
+ const properties = MappedIndexProperties(type, mappedKey, options);
1179
+ return MappedResult(properties);
1180
+ }
1181
+
1182
+ // ../node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.mjs
1183
+ function Iterator(items, options) {
1184
+ return CreateType({ [Kind]: "Iterator", type: "Iterator", items }, options);
1185
+ }
1186
+
1187
+ // ../node_modules/@sinclair/typebox/build/esm/type/object/object.mjs
1188
+ function RequiredArray(properties) {
1189
+ return globalThis.Object.keys(properties).filter((key) => !IsOptional(properties[key]));
1190
+ }
1191
+ function _Object(properties, options) {
1192
+ const required = RequiredArray(properties);
1193
+ const schema = required.length > 0 ? { [Kind]: "Object", type: "object", required, properties } : { [Kind]: "Object", type: "object", properties };
1194
+ return CreateType(schema, options);
1195
+ }
1196
+ var Object2 = _Object;
1197
+
1198
+ // ../node_modules/@sinclair/typebox/build/esm/type/promise/promise.mjs
1199
+ function Promise2(item, options) {
1200
+ return CreateType({ [Kind]: "Promise", type: "Promise", item }, options);
1201
+ }
1202
+
1203
+ // ../node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.mjs
1204
+ function RemoveReadonly(schema) {
1205
+ return CreateType(Discard(schema, [ReadonlyKind]));
1206
+ }
1207
+ function AddReadonly(schema) {
1208
+ return CreateType({ ...schema, [ReadonlyKind]: "Readonly" });
1209
+ }
1210
+ function ReadonlyWithFlag(schema, F) {
1211
+ return F === false ? RemoveReadonly(schema) : AddReadonly(schema);
1212
+ }
1213
+ function Readonly(schema, enable) {
1214
+ const F = enable ?? true;
1215
+ return IsMappedResult(schema) ? ReadonlyFromMappedResult(schema, F) : ReadonlyWithFlag(schema, F);
1216
+ }
1217
+
1218
+ // ../node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.mjs
1219
+ function FromProperties2(K, F) {
1220
+ const Acc = {};
1221
+ for (const K2 of globalThis.Object.getOwnPropertyNames(K))
1222
+ Acc[K2] = Readonly(K[K2], F);
1223
+ return Acc;
1224
+ }
1225
+ function FromMappedResult2(R, F) {
1226
+ return FromProperties2(R.properties, F);
1227
+ }
1228
+ function ReadonlyFromMappedResult(R, F) {
1229
+ const P = FromMappedResult2(R, F);
1230
+ return MappedResult(P);
1231
+ }
1232
+
1233
+ // ../node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.mjs
1234
+ function Tuple(types, options) {
1235
+ 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);
1236
+ }
1237
+
1238
+ // ../node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.mjs
1239
+ function FromMappedResult3(K, P) {
1240
+ return K in P ? FromSchemaType(K, P[K]) : MappedResult(P);
1241
+ }
1242
+ function MappedKeyToKnownMappedResultProperties(K) {
1243
+ return { [K]: Literal(K) };
1244
+ }
1245
+ function MappedKeyToUnknownMappedResultProperties(P) {
1246
+ const Acc = {};
1247
+ for (const L of P)
1248
+ Acc[L] = Literal(L);
1249
+ return Acc;
1250
+ }
1251
+ function MappedKeyToMappedResultProperties(K, P) {
1252
+ return SetIncludes(P, K) ? MappedKeyToKnownMappedResultProperties(K) : MappedKeyToUnknownMappedResultProperties(P);
1253
+ }
1254
+ function FromMappedKey(K, P) {
1255
+ const R = MappedKeyToMappedResultProperties(K, P);
1256
+ return FromMappedResult3(K, R);
1257
+ }
1258
+ function FromRest2(K, T) {
1259
+ return T.map((L) => FromSchemaType(K, L));
1260
+ }
1261
+ function FromProperties3(K, T) {
1262
+ const Acc = {};
1263
+ for (const K2 of globalThis.Object.getOwnPropertyNames(T))
1264
+ Acc[K2] = FromSchemaType(K, T[K2]);
1265
+ return Acc;
1266
+ }
1267
+ function FromSchemaType(K, T) {
1268
+ const options = { ...T };
1269
+ return (
1270
+ // unevaluated modifier types
1271
+ IsOptional(T) ? Optional(FromSchemaType(K, Discard(T, [OptionalKind]))) : IsReadonly(T) ? Readonly(FromSchemaType(K, Discard(T, [ReadonlyKind]))) : (
1272
+ // unevaluated mapped types
1273
+ IsMappedResult(T) ? FromMappedResult3(K, T.properties) : IsMappedKey(T) ? FromMappedKey(K, T.keys) : (
1274
+ // unevaluated types
1275
+ IsConstructor(T) ? Constructor(FromRest2(K, T.parameters), FromSchemaType(K, T.returns), options) : IsFunction2(T) ? Function2(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
1276
+ )
1277
+ )
1278
+ );
1279
+ }
1280
+ function MappedFunctionReturnType(K, T) {
1281
+ const Acc = {};
1282
+ for (const L of K)
1283
+ Acc[L] = FromSchemaType(L, T);
1284
+ return Acc;
1285
+ }
1286
+ function Mapped(key, map, options) {
1287
+ const K = IsSchema(key) ? IndexPropertyKeys(key) : key;
1288
+ const RT = map({ [Kind]: "MappedKey", keys: K });
1289
+ const R = MappedFunctionReturnType(K, RT);
1290
+ return Object2(R, options);
1291
+ }
1292
+
1293
+ // ../node_modules/@sinclair/typebox/build/esm/type/optional/optional.mjs
1294
+ function RemoveOptional(schema) {
1295
+ return CreateType(Discard(schema, [OptionalKind]));
1296
+ }
1297
+ function AddOptional(schema) {
1298
+ return CreateType({ ...schema, [OptionalKind]: "Optional" });
1299
+ }
1300
+ function OptionalWithFlag(schema, F) {
1301
+ return F === false ? RemoveOptional(schema) : AddOptional(schema);
1302
+ }
1303
+ function Optional(schema, enable) {
1304
+ const F = enable ?? true;
1305
+ return IsMappedResult(schema) ? OptionalFromMappedResult(schema, F) : OptionalWithFlag(schema, F);
1306
+ }
1307
+
1308
+ // ../node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.mjs
1309
+ function FromProperties4(P, F) {
1310
+ const Acc = {};
1311
+ for (const K2 of globalThis.Object.getOwnPropertyNames(P))
1312
+ Acc[K2] = Optional(P[K2], F);
1313
+ return Acc;
1314
+ }
1315
+ function FromMappedResult4(R, F) {
1316
+ return FromProperties4(R.properties, F);
1317
+ }
1318
+ function OptionalFromMappedResult(R, F) {
1319
+ const P = FromMappedResult4(R, F);
1320
+ return MappedResult(P);
1321
+ }
1322
+
1323
+ // ../node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.mjs
1324
+ function IntersectCreate(T, options = {}) {
1325
+ const allObjects = T.every((schema) => IsObject3(schema));
1326
+ const clonedUnevaluatedProperties = IsSchema(options.unevaluatedProperties) ? { unevaluatedProperties: options.unevaluatedProperties } : {};
1327
+ return CreateType(options.unevaluatedProperties === false || IsSchema(options.unevaluatedProperties) || allObjects ? { ...clonedUnevaluatedProperties, [Kind]: "Intersect", type: "object", allOf: T } : { ...clonedUnevaluatedProperties, [Kind]: "Intersect", allOf: T }, options);
1328
+ }
1329
+
1330
+ // ../node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.mjs
1331
+ function IsIntersectOptional(types) {
1332
+ return types.every((left) => IsOptional(left));
1333
+ }
1334
+ function RemoveOptionalFromType2(type) {
1335
+ return Discard(type, [OptionalKind]);
1336
+ }
1337
+ function RemoveOptionalFromRest2(types) {
1338
+ return types.map((left) => IsOptional(left) ? RemoveOptionalFromType2(left) : left);
1339
+ }
1340
+ function ResolveIntersect(types, options) {
1341
+ return IsIntersectOptional(types) ? Optional(IntersectCreate(RemoveOptionalFromRest2(types), options)) : IntersectCreate(RemoveOptionalFromRest2(types), options);
1342
+ }
1343
+ function IntersectEvaluated(types, options = {}) {
1344
+ if (types.length === 1)
1345
+ return CreateType(types[0], options);
1346
+ if (types.length === 0)
1347
+ return Never(options);
1348
+ if (types.some((schema) => IsTransform(schema)))
1349
+ throw new Error("Cannot intersect transform types");
1350
+ return ResolveIntersect(types, options);
1351
+ }
1352
+
1353
+ // ../node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.mjs
1354
+ function Intersect(types, options) {
1355
+ if (types.length === 1)
1356
+ return CreateType(types[0], options);
1357
+ if (types.length === 0)
1358
+ return Never(options);
1359
+ if (types.some((schema) => IsTransform(schema)))
1360
+ throw new Error("Cannot intersect transform types");
1361
+ return IntersectCreate(types, options);
1362
+ }
1363
+
1364
+ // ../node_modules/@sinclair/typebox/build/esm/type/ref/ref.mjs
1365
+ function Ref(...args) {
1366
+ const [$ref, options] = typeof args[0] === "string" ? [args[0], args[1]] : [args[0].$id, args[1]];
1367
+ if (typeof $ref !== "string")
1368
+ throw new TypeBoxError("Ref: $ref must be a string");
1369
+ return CreateType({ [Kind]: "Ref", $ref }, options);
1370
+ }
1371
+
1372
+ // ../node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.mjs
1373
+ function FromComputed(target, parameters) {
1374
+ return Computed("Awaited", [Computed(target, parameters)]);
1375
+ }
1376
+ function FromRef($ref) {
1377
+ return Computed("Awaited", [Ref($ref)]);
1378
+ }
1379
+ function FromIntersect2(types) {
1380
+ return Intersect(FromRest3(types));
1381
+ }
1382
+ function FromUnion4(types) {
1383
+ return Union(FromRest3(types));
1384
+ }
1385
+ function FromPromise(type) {
1386
+ return Awaited(type);
1387
+ }
1388
+ function FromRest3(types) {
1389
+ return types.map((type) => Awaited(type));
1390
+ }
1391
+ function Awaited(type, options) {
1392
+ 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);
1393
+ }
1394
+
1395
+ // ../node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.mjs
1396
+ function FromRest4(types) {
1397
+ const result = [];
1398
+ for (const L of types)
1399
+ result.push(KeyOfPropertyKeys(L));
1400
+ return result;
1401
+ }
1402
+ function FromIntersect3(types) {
1403
+ const propertyKeysArray = FromRest4(types);
1404
+ const propertyKeys = SetUnionMany(propertyKeysArray);
1405
+ return propertyKeys;
1406
+ }
1407
+ function FromUnion5(types) {
1408
+ const propertyKeysArray = FromRest4(types);
1409
+ const propertyKeys = SetIntersectMany(propertyKeysArray);
1410
+ return propertyKeys;
1411
+ }
1412
+ function FromTuple2(types) {
1413
+ return types.map((_, indexer) => indexer.toString());
1414
+ }
1415
+ function FromArray2(_) {
1416
+ return ["[number]"];
1417
+ }
1418
+ function FromProperties5(T) {
1419
+ return globalThis.Object.getOwnPropertyNames(T);
1420
+ }
1421
+ function FromPatternProperties(patternProperties) {
1422
+ if (!includePatternProperties)
1423
+ return [];
1424
+ const patternPropertyKeys = globalThis.Object.getOwnPropertyNames(patternProperties);
1425
+ return patternPropertyKeys.map((key) => {
1426
+ return key[0] === "^" && key[key.length - 1] === "$" ? key.slice(1, key.length - 1) : key;
1427
+ });
1428
+ }
1429
+ function KeyOfPropertyKeys(type) {
1430
+ 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) : [];
1431
+ }
1432
+ var includePatternProperties = false;
1433
+
1434
+ // ../node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.mjs
1435
+ function FromComputed2(target, parameters) {
1436
+ return Computed("KeyOf", [Computed(target, parameters)]);
1437
+ }
1438
+ function FromRef2($ref) {
1439
+ return Computed("KeyOf", [Ref($ref)]);
1440
+ }
1441
+ function KeyOfFromType(type, options) {
1442
+ const propertyKeys = KeyOfPropertyKeys(type);
1443
+ const propertyKeyTypes = KeyOfPropertyKeysToRest(propertyKeys);
1444
+ const result = UnionEvaluated(propertyKeyTypes);
1445
+ return CreateType(result, options);
1446
+ }
1447
+ function KeyOfPropertyKeysToRest(propertyKeys) {
1448
+ return propertyKeys.map((L) => L === "[number]" ? Number2() : Literal(L));
1449
+ }
1450
+ function KeyOf(type, options) {
1451
+ return IsComputed(type) ? FromComputed2(type.target, type.parameters) : IsRef(type) ? FromRef2(type.$ref) : IsMappedResult(type) ? KeyOfFromMappedResult(type, options) : KeyOfFromType(type, options);
1452
+ }
1453
+
1454
+ // ../node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.mjs
1455
+ function FromProperties6(properties, options) {
1456
+ const result = {};
1457
+ for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
1458
+ result[K2] = KeyOf(properties[K2], Clone(options));
1459
+ return result;
1460
+ }
1461
+ function FromMappedResult5(mappedResult, options) {
1462
+ return FromProperties6(mappedResult.properties, options);
1463
+ }
1464
+ function KeyOfFromMappedResult(mappedResult, options) {
1465
+ const properties = FromMappedResult5(mappedResult, options);
1466
+ return MappedResult(properties);
1467
+ }
1468
+
1469
+ // ../node_modules/@sinclair/typebox/build/esm/type/composite/composite.mjs
1470
+ function CompositeKeys(T) {
1471
+ const Acc = [];
1472
+ for (const L of T)
1473
+ Acc.push(...KeyOfPropertyKeys(L));
1474
+ return SetDistinct(Acc);
1475
+ }
1476
+ function FilterNever(T) {
1477
+ return T.filter((L) => !IsNever(L));
1478
+ }
1479
+ function CompositeProperty(T, K) {
1480
+ const Acc = [];
1481
+ for (const L of T)
1482
+ Acc.push(...IndexFromPropertyKeys(L, [K]));
1483
+ return FilterNever(Acc);
1484
+ }
1485
+ function CompositeProperties(T, K) {
1486
+ const Acc = {};
1487
+ for (const L of K) {
1488
+ Acc[L] = IntersectEvaluated(CompositeProperty(T, L));
1489
+ }
1490
+ return Acc;
1491
+ }
1492
+ function Composite(T, options) {
1493
+ const K = CompositeKeys(T);
1494
+ const P = CompositeProperties(T, K);
1495
+ const R = Object2(P, options);
1496
+ return R;
1497
+ }
1498
+
1499
+ // ../node_modules/@sinclair/typebox/build/esm/type/date/date.mjs
1500
+ function Date2(options) {
1501
+ return CreateType({ [Kind]: "Date", type: "Date" }, options);
1502
+ }
1503
+
1504
+ // ../node_modules/@sinclair/typebox/build/esm/type/null/null.mjs
1505
+ function Null(options) {
1506
+ return CreateType({ [Kind]: "Null", type: "null" }, options);
1507
+ }
1508
+
1509
+ // ../node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.mjs
1510
+ function Symbol2(options) {
1511
+ return CreateType({ [Kind]: "Symbol", type: "symbol" }, options);
1512
+ }
1513
+
1514
+ // ../node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.mjs
1515
+ function Undefined(options) {
1516
+ return CreateType({ [Kind]: "Undefined", type: "undefined" }, options);
1517
+ }
1518
+
1519
+ // ../node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.mjs
1520
+ function Uint8Array2(options) {
1521
+ return CreateType({ [Kind]: "Uint8Array", type: "Uint8Array" }, options);
1522
+ }
1523
+
1524
+ // ../node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.mjs
1525
+ function Unknown(options) {
1526
+ return CreateType({ [Kind]: "Unknown" }, options);
1527
+ }
1528
+
1529
+ // ../node_modules/@sinclair/typebox/build/esm/type/const/const.mjs
1530
+ function FromArray3(T) {
1531
+ return T.map((L) => FromValue(L, false));
1532
+ }
1533
+ function FromProperties7(value) {
1534
+ const Acc = {};
1535
+ for (const K of globalThis.Object.getOwnPropertyNames(value))
1536
+ Acc[K] = Readonly(FromValue(value[K], false));
1537
+ return Acc;
1538
+ }
1539
+ function ConditionalReadonly(T, root) {
1540
+ return root === true ? T : Readonly(T);
1541
+ }
1542
+ function FromValue(value, root) {
1543
+ 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(Function2([], 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({});
1544
+ }
1545
+ function Const(T, options) {
1546
+ return CreateType(FromValue(T, true), options);
1547
+ }
1548
+
1549
+ // ../node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.mjs
1550
+ function ConstructorParameters(schema, options) {
1551
+ return IsConstructor(schema) ? Tuple(schema.parameters, options) : Never(options);
1552
+ }
1553
+
1554
+ // ../node_modules/@sinclair/typebox/build/esm/type/enum/enum.mjs
1555
+ function Enum(item, options) {
1556
+ if (IsUndefined(item))
1557
+ throw new Error("Enum undefined or empty");
1558
+ const values1 = globalThis.Object.getOwnPropertyNames(item).filter((key) => isNaN(key)).map((key) => item[key]);
1559
+ const values2 = [...new Set(values1)];
1560
+ const anyOf = values2.map((value) => Literal(value));
1561
+ return Union(anyOf, { ...options, [Hint]: "Enum" });
1562
+ }
1563
+
1564
+ // ../node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.mjs
1565
+ var ExtendsResolverError = class extends TypeBoxError {
1566
+ };
1567
+ var ExtendsResult;
1568
+ (function(ExtendsResult2) {
1569
+ ExtendsResult2[ExtendsResult2["Union"] = 0] = "Union";
1570
+ ExtendsResult2[ExtendsResult2["True"] = 1] = "True";
1571
+ ExtendsResult2[ExtendsResult2["False"] = 2] = "False";
1572
+ })(ExtendsResult || (ExtendsResult = {}));
1573
+ function IntoBooleanResult(result) {
1574
+ return result === ExtendsResult.False ? result : ExtendsResult.True;
1575
+ }
1576
+ function Throw(message) {
1577
+ throw new ExtendsResolverError(message);
1578
+ }
1579
+ function IsStructuralRight(right) {
1580
+ return type_exports.IsNever(right) || type_exports.IsIntersect(right) || type_exports.IsUnion(right) || type_exports.IsUnknown(right) || type_exports.IsAny(right);
1581
+ }
1582
+ function StructuralRight(left, right) {
1583
+ 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");
1584
+ }
1585
+ function FromAnyRight(left, right) {
1586
+ return ExtendsResult.True;
1587
+ }
1588
+ function FromAny(left, right) {
1589
+ 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;
1590
+ }
1591
+ function FromArrayRight(left, right) {
1592
+ return type_exports.IsUnknown(left) ? ExtendsResult.False : type_exports.IsAny(left) ? ExtendsResult.Union : type_exports.IsNever(left) ? ExtendsResult.True : ExtendsResult.False;
1593
+ }
1594
+ function FromArray4(left, right) {
1595
+ 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));
1596
+ }
1597
+ function FromAsyncIterator(left, right) {
1598
+ return IsStructuralRight(right) ? StructuralRight(left, right) : !type_exports.IsAsyncIterator(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.items, right.items));
1599
+ }
1600
+ function FromBigInt(left, right) {
1601
+ 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;
1602
+ }
1603
+ function FromBooleanRight(left, right) {
1604
+ return type_exports.IsLiteralBoolean(left) ? ExtendsResult.True : type_exports.IsBoolean(left) ? ExtendsResult.True : ExtendsResult.False;
1605
+ }
1606
+ function FromBoolean(left, right) {
1607
+ 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;
1608
+ }
1609
+ function FromConstructor(left, right) {
1610
+ 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));
1611
+ }
1612
+ function FromDate(left, right) {
1613
+ 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;
1614
+ }
1615
+ function FromFunction(left, right) {
1616
+ 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));
1617
+ }
1618
+ function FromIntegerRight(left, right) {
1619
+ return type_exports.IsLiteral(left) && value_exports.IsNumber(left.const) ? ExtendsResult.True : type_exports.IsNumber(left) || type_exports.IsInteger(left) ? ExtendsResult.True : ExtendsResult.False;
1620
+ }
1621
+ function FromInteger(left, right) {
1622
+ 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;
1623
+ }
1624
+ function FromIntersectRight(left, right) {
1625
+ return right.allOf.every((schema) => Visit3(left, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1626
+ }
1627
+ function FromIntersect4(left, right) {
1628
+ return left.allOf.some((schema) => Visit3(schema, right) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1629
+ }
1630
+ function FromIterator(left, right) {
1631
+ return IsStructuralRight(right) ? StructuralRight(left, right) : !type_exports.IsIterator(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.items, right.items));
1632
+ }
1633
+ function FromLiteral2(left, right) {
1634
+ 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;
1635
+ }
1636
+ function FromNeverRight(left, right) {
1637
+ return ExtendsResult.False;
1638
+ }
1639
+ function FromNever(left, right) {
1640
+ return ExtendsResult.True;
1641
+ }
1642
+ function UnwrapTNot(schema) {
1643
+ let [current, depth] = [schema, 0];
1644
+ while (true) {
1645
+ if (!type_exports.IsNot(current))
1646
+ break;
1647
+ current = current.not;
1648
+ depth += 1;
1649
+ }
1650
+ return depth % 2 === 0 ? current : Unknown();
1651
+ }
1652
+ function FromNot(left, right) {
1653
+ return type_exports.IsNot(left) ? Visit3(UnwrapTNot(left), right) : type_exports.IsNot(right) ? Visit3(left, UnwrapTNot(right)) : Throw("Invalid fallthrough for Not");
1654
+ }
1655
+ function FromNull(left, right) {
1656
+ 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;
1657
+ }
1658
+ function FromNumberRight(left, right) {
1659
+ return type_exports.IsLiteralNumber(left) ? ExtendsResult.True : type_exports.IsNumber(left) || type_exports.IsInteger(left) ? ExtendsResult.True : ExtendsResult.False;
1660
+ }
1661
+ function FromNumber(left, right) {
1662
+ 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;
1663
+ }
1664
+ function IsObjectPropertyCount(schema, count) {
1665
+ return Object.getOwnPropertyNames(schema.properties).length === count;
1666
+ }
1667
+ function IsObjectStringLike(schema) {
1668
+ return IsObjectArrayLike(schema);
1669
+ }
1670
+ function IsObjectSymbolLike(schema) {
1671
+ 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]));
1672
+ }
1673
+ function IsObjectNumberLike(schema) {
1674
+ return IsObjectPropertyCount(schema, 0);
1675
+ }
1676
+ function IsObjectBooleanLike(schema) {
1677
+ return IsObjectPropertyCount(schema, 0);
1678
+ }
1679
+ function IsObjectBigIntLike(schema) {
1680
+ return IsObjectPropertyCount(schema, 0);
1681
+ }
1682
+ function IsObjectDateLike(schema) {
1683
+ return IsObjectPropertyCount(schema, 0);
1684
+ }
1685
+ function IsObjectUint8ArrayLike(schema) {
1686
+ return IsObjectArrayLike(schema);
1687
+ }
1688
+ function IsObjectFunctionLike(schema) {
1689
+ const length = Number2();
1690
+ return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "length" in schema.properties && IntoBooleanResult(Visit3(schema.properties["length"], length)) === ExtendsResult.True;
1691
+ }
1692
+ function IsObjectConstructorLike(schema) {
1693
+ return IsObjectPropertyCount(schema, 0);
1694
+ }
1695
+ function IsObjectArrayLike(schema) {
1696
+ const length = Number2();
1697
+ return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "length" in schema.properties && IntoBooleanResult(Visit3(schema.properties["length"], length)) === ExtendsResult.True;
1698
+ }
1699
+ function IsObjectPromiseLike(schema) {
1700
+ const then = Function2([Any()], Any());
1701
+ return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "then" in schema.properties && IntoBooleanResult(Visit3(schema.properties["then"], then)) === ExtendsResult.True;
1702
+ }
1703
+ function Property(left, right) {
1704
+ return Visit3(left, right) === ExtendsResult.False ? ExtendsResult.False : type_exports.IsOptional(left) && !type_exports.IsOptional(right) ? ExtendsResult.False : ExtendsResult.True;
1705
+ }
1706
+ function FromObjectRight(left, right) {
1707
+ 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)) ? (() => {
1708
+ return right[Hint] === "Record" ? ExtendsResult.True : ExtendsResult.False;
1709
+ })() : type_exports.IsRecord(left) && type_exports.IsNumber(RecordKey(left)) ? (() => {
1710
+ return IsObjectPropertyCount(right, 0) ? ExtendsResult.True : ExtendsResult.False;
1711
+ })() : ExtendsResult.False;
1712
+ }
1713
+ function FromObject(left, right) {
1714
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : !type_exports.IsObject(right) ? ExtendsResult.False : (() => {
1715
+ for (const key of Object.getOwnPropertyNames(right.properties)) {
1716
+ if (!(key in left.properties) && !type_exports.IsOptional(right.properties[key])) {
1717
+ return ExtendsResult.False;
1718
+ }
1719
+ if (type_exports.IsOptional(right.properties[key])) {
1720
+ return ExtendsResult.True;
1721
+ }
1722
+ if (Property(left.properties[key], right.properties[key]) === ExtendsResult.False) {
1723
+ return ExtendsResult.False;
1724
+ }
1725
+ }
1726
+ return ExtendsResult.True;
1727
+ })();
1728
+ }
1729
+ function FromPromise2(left, right) {
1730
+ 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));
1731
+ }
1732
+ function RecordKey(schema) {
1733
+ return PatternNumberExact in schema.patternProperties ? Number2() : PatternStringExact in schema.patternProperties ? String2() : Throw("Unknown record key pattern");
1734
+ }
1735
+ function RecordValue(schema) {
1736
+ return PatternNumberExact in schema.patternProperties ? schema.patternProperties[PatternNumberExact] : PatternStringExact in schema.patternProperties ? schema.patternProperties[PatternStringExact] : Throw("Unable to get record value schema");
1737
+ }
1738
+ function FromRecordRight(left, right) {
1739
+ const [Key, Value] = [RecordKey(right), RecordValue(right)];
1740
+ 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) ? (() => {
1741
+ for (const key of Object.getOwnPropertyNames(left.properties)) {
1742
+ if (Property(Value, left.properties[key]) === ExtendsResult.False) {
1743
+ return ExtendsResult.False;
1744
+ }
1745
+ }
1746
+ return ExtendsResult.True;
1747
+ })() : ExtendsResult.False;
1748
+ }
1749
+ function FromRecord(left, right) {
1750
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : !type_exports.IsRecord(right) ? ExtendsResult.False : Visit3(RecordValue(left), RecordValue(right));
1751
+ }
1752
+ function FromRegExp(left, right) {
1753
+ const L = type_exports.IsRegExp(left) ? String2() : left;
1754
+ const R = type_exports.IsRegExp(right) ? String2() : right;
1755
+ return Visit3(L, R);
1756
+ }
1757
+ function FromStringRight(left, right) {
1758
+ return type_exports.IsLiteral(left) && value_exports.IsString(left.const) ? ExtendsResult.True : type_exports.IsString(left) ? ExtendsResult.True : ExtendsResult.False;
1759
+ }
1760
+ function FromString(left, right) {
1761
+ 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;
1762
+ }
1763
+ function FromSymbol(left, right) {
1764
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsSymbol(right) ? ExtendsResult.True : ExtendsResult.False;
1765
+ }
1766
+ function FromTemplateLiteral2(left, right) {
1767
+ return type_exports.IsTemplateLiteral(left) ? Visit3(TemplateLiteralToUnion(left), right) : type_exports.IsTemplateLiteral(right) ? Visit3(left, TemplateLiteralToUnion(right)) : Throw("Invalid fallthrough for TemplateLiteral");
1768
+ }
1769
+ function IsArrayOfTuple(left, right) {
1770
+ return type_exports.IsArray(right) && left.items !== void 0 && left.items.every((schema) => Visit3(schema, right.items) === ExtendsResult.True);
1771
+ }
1772
+ function FromTupleRight(left, right) {
1773
+ return type_exports.IsNever(left) ? ExtendsResult.True : type_exports.IsUnknown(left) ? ExtendsResult.False : type_exports.IsAny(left) ? ExtendsResult.Union : ExtendsResult.False;
1774
+ }
1775
+ function FromTuple3(left, right) {
1776
+ 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;
1777
+ }
1778
+ function FromUint8Array(left, right) {
1779
+ 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;
1780
+ }
1781
+ function FromUndefined(left, right) {
1782
+ 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;
1783
+ }
1784
+ function FromUnionRight(left, right) {
1785
+ return right.anyOf.some((schema) => Visit3(left, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1786
+ }
1787
+ function FromUnion6(left, right) {
1788
+ return left.anyOf.every((schema) => Visit3(schema, right) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1789
+ }
1790
+ function FromUnknownRight(left, right) {
1791
+ return ExtendsResult.True;
1792
+ }
1793
+ function FromUnknown(left, right) {
1794
+ 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;
1795
+ }
1796
+ function FromVoidRight(left, right) {
1797
+ return type_exports.IsUndefined(left) ? ExtendsResult.True : type_exports.IsUndefined(left) ? ExtendsResult.True : ExtendsResult.False;
1798
+ }
1799
+ function FromVoid(left, right) {
1800
+ 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;
1801
+ }
1802
+ function Visit3(left, right) {
1803
+ return (
1804
+ // resolvable
1805
+ 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) : (
1806
+ // standard
1807
+ 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]}'`)
1808
+ )
1809
+ );
1810
+ }
1811
+ function ExtendsCheck(left, right) {
1812
+ return Visit3(left, right);
1813
+ }
1814
+
1815
+ // ../node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.mjs
1816
+ function FromProperties8(P, Right, True, False, options) {
1817
+ const Acc = {};
1818
+ for (const K2 of globalThis.Object.getOwnPropertyNames(P))
1819
+ Acc[K2] = Extends(P[K2], Right, True, False, Clone(options));
1820
+ return Acc;
1821
+ }
1822
+ function FromMappedResult6(Left, Right, True, False, options) {
1823
+ return FromProperties8(Left.properties, Right, True, False, options);
1824
+ }
1825
+ function ExtendsFromMappedResult(Left, Right, True, False, options) {
1826
+ const P = FromMappedResult6(Left, Right, True, False, options);
1827
+ return MappedResult(P);
1828
+ }
1829
+
1830
+ // ../node_modules/@sinclair/typebox/build/esm/type/extends/extends.mjs
1831
+ function ExtendsResolve(left, right, trueType, falseType) {
1832
+ const R = ExtendsCheck(left, right);
1833
+ return R === ExtendsResult.Union ? Union([trueType, falseType]) : R === ExtendsResult.True ? trueType : falseType;
1834
+ }
1835
+ function Extends(L, R, T, F, options) {
1836
+ 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);
1837
+ }
1838
+
1839
+ // ../node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.mjs
1840
+ function FromPropertyKey(K, U, L, R, options) {
1841
+ return {
1842
+ [K]: Extends(Literal(K), U, L, R, Clone(options))
1843
+ };
1844
+ }
1845
+ function FromPropertyKeys(K, U, L, R, options) {
1846
+ return K.reduce((Acc, LK) => {
1847
+ return { ...Acc, ...FromPropertyKey(LK, U, L, R, options) };
1848
+ }, {});
1849
+ }
1850
+ function FromMappedKey2(K, U, L, R, options) {
1851
+ return FromPropertyKeys(K.keys, U, L, R, options);
1852
+ }
1853
+ function ExtendsFromMappedKey(T, U, L, R, options) {
1854
+ const P = FromMappedKey2(T, U, L, R, options);
1855
+ return MappedResult(P);
1856
+ }
1857
+
1858
+ // ../node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-template-literal.mjs
1859
+ function ExcludeFromTemplateLiteral(L, R) {
1860
+ return Exclude(TemplateLiteralToUnion(L), R);
1861
+ }
1862
+
1863
+ // ../node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.mjs
1864
+ function ExcludeRest(L, R) {
1865
+ const excluded = L.filter((inner) => ExtendsCheck(inner, R) === ExtendsResult.False);
1866
+ return excluded.length === 1 ? excluded[0] : Union(excluded);
1867
+ }
1868
+ function Exclude(L, R, options = {}) {
1869
+ if (IsTemplateLiteral(L))
1870
+ return CreateType(ExcludeFromTemplateLiteral(L, R), options);
1871
+ if (IsMappedResult(L))
1872
+ return CreateType(ExcludeFromMappedResult(L, R), options);
1873
+ return CreateType(IsUnion(L) ? ExcludeRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? Never() : L, options);
1874
+ }
1875
+
1876
+ // ../node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.mjs
1877
+ function FromProperties9(P, U) {
1878
+ const Acc = {};
1879
+ for (const K2 of globalThis.Object.getOwnPropertyNames(P))
1880
+ Acc[K2] = Exclude(P[K2], U);
1881
+ return Acc;
1882
+ }
1883
+ function FromMappedResult7(R, T) {
1884
+ return FromProperties9(R.properties, T);
1885
+ }
1886
+ function ExcludeFromMappedResult(R, T) {
1887
+ const P = FromMappedResult7(R, T);
1888
+ return MappedResult(P);
1889
+ }
1890
+
1891
+ // ../node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.mjs
1892
+ function ExtractFromTemplateLiteral(L, R) {
1893
+ return Extract(TemplateLiteralToUnion(L), R);
1894
+ }
1895
+
1896
+ // ../node_modules/@sinclair/typebox/build/esm/type/extract/extract.mjs
1897
+ function ExtractRest(L, R) {
1898
+ const extracted = L.filter((inner) => ExtendsCheck(inner, R) !== ExtendsResult.False);
1899
+ return extracted.length === 1 ? extracted[0] : Union(extracted);
1900
+ }
1901
+ function Extract(L, R, options) {
1902
+ if (IsTemplateLiteral(L))
1903
+ return CreateType(ExtractFromTemplateLiteral(L, R), options);
1904
+ if (IsMappedResult(L))
1905
+ return CreateType(ExtractFromMappedResult(L, R), options);
1906
+ return CreateType(IsUnion(L) ? ExtractRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? L : Never(), options);
1907
+ }
1908
+
1909
+ // ../node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.mjs
1910
+ function FromProperties10(P, T) {
1911
+ const Acc = {};
1912
+ for (const K2 of globalThis.Object.getOwnPropertyNames(P))
1913
+ Acc[K2] = Extract(P[K2], T);
1914
+ return Acc;
1915
+ }
1916
+ function FromMappedResult8(R, T) {
1917
+ return FromProperties10(R.properties, T);
1918
+ }
1919
+ function ExtractFromMappedResult(R, T) {
1920
+ const P = FromMappedResult8(R, T);
1921
+ return MappedResult(P);
1922
+ }
1923
+
1924
+ // ../node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.mjs
1925
+ function InstanceType(schema, options) {
1926
+ return IsConstructor(schema) ? CreateType(schema.returns, options) : Never(options);
1927
+ }
1928
+
1929
+ // ../node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.mjs
1930
+ function ReadonlyOptional(schema) {
1931
+ return Readonly(Optional(schema));
1932
+ }
1933
+
1934
+ // ../node_modules/@sinclair/typebox/build/esm/type/record/record.mjs
1935
+ function RecordCreateFromPattern(pattern, T, options) {
1936
+ return CreateType({ [Kind]: "Record", type: "object", patternProperties: { [pattern]: T } }, options);
1937
+ }
1938
+ function RecordCreateFromKeys(K, T, options) {
1939
+ const result = {};
1940
+ for (const K2 of K)
1941
+ result[K2] = T;
1942
+ return Object2(result, { ...options, [Hint]: "Record" });
1943
+ }
1944
+ function FromTemplateLiteralKey(K, T, options) {
1945
+ return IsTemplateLiteralFinite(K) ? RecordCreateFromKeys(IndexPropertyKeys(K), T, options) : RecordCreateFromPattern(K.pattern, T, options);
1946
+ }
1947
+ function FromUnionKey(key, type, options) {
1948
+ return RecordCreateFromKeys(IndexPropertyKeys(Union(key)), type, options);
1949
+ }
1950
+ function FromLiteralKey(key, type, options) {
1951
+ return RecordCreateFromKeys([key.toString()], type, options);
1952
+ }
1953
+ function FromRegExpKey(key, type, options) {
1954
+ return RecordCreateFromPattern(key.source, type, options);
1955
+ }
1956
+ function FromStringKey(key, type, options) {
1957
+ const pattern = IsUndefined(key.pattern) ? PatternStringExact : key.pattern;
1958
+ return RecordCreateFromPattern(pattern, type, options);
1959
+ }
1960
+ function FromAnyKey(_, type, options) {
1961
+ return RecordCreateFromPattern(PatternStringExact, type, options);
1962
+ }
1963
+ function FromNeverKey(_key, type, options) {
1964
+ return RecordCreateFromPattern(PatternNeverExact, type, options);
1965
+ }
1966
+ function FromBooleanKey(_key, type, options) {
1967
+ return Object2({ true: type, false: type }, options);
1968
+ }
1969
+ function FromIntegerKey(_key, type, options) {
1970
+ return RecordCreateFromPattern(PatternNumberExact, type, options);
1971
+ }
1972
+ function FromNumberKey(_, type, options) {
1973
+ return RecordCreateFromPattern(PatternNumberExact, type, options);
1974
+ }
1975
+ function Record(key, type, options = {}) {
1976
+ 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);
1977
+ }
1978
+ function RecordPattern(record) {
1979
+ return globalThis.Object.getOwnPropertyNames(record.patternProperties)[0];
1980
+ }
1981
+ function RecordKey2(type) {
1982
+ const pattern = RecordPattern(type);
1983
+ return pattern === PatternStringExact ? String2() : pattern === PatternNumberExact ? Number2() : String2({ pattern });
1984
+ }
1985
+ function RecordValue2(type) {
1986
+ return type.patternProperties[RecordPattern(type)];
1987
+ }
1988
+
1989
+ // ../node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.mjs
1990
+ function FromConstructor2(args, type) {
1991
+ type.parameters = FromTypes(args, type.parameters);
1992
+ type.returns = FromType(args, type.returns);
1993
+ return type;
1994
+ }
1995
+ function FromFunction2(args, type) {
1996
+ type.parameters = FromTypes(args, type.parameters);
1997
+ type.returns = FromType(args, type.returns);
1998
+ return type;
1999
+ }
2000
+ function FromIntersect5(args, type) {
2001
+ type.allOf = FromTypes(args, type.allOf);
2002
+ return type;
2003
+ }
2004
+ function FromUnion7(args, type) {
2005
+ type.anyOf = FromTypes(args, type.anyOf);
2006
+ return type;
2007
+ }
2008
+ function FromTuple4(args, type) {
2009
+ if (IsUndefined(type.items))
2010
+ return type;
2011
+ type.items = FromTypes(args, type.items);
2012
+ return type;
2013
+ }
2014
+ function FromArray5(args, type) {
2015
+ type.items = FromType(args, type.items);
2016
+ return type;
2017
+ }
2018
+ function FromAsyncIterator2(args, type) {
2019
+ type.items = FromType(args, type.items);
2020
+ return type;
2021
+ }
2022
+ function FromIterator2(args, type) {
2023
+ type.items = FromType(args, type.items);
2024
+ return type;
2025
+ }
2026
+ function FromPromise3(args, type) {
2027
+ type.item = FromType(args, type.item);
2028
+ return type;
2029
+ }
2030
+ function FromObject2(args, type) {
2031
+ const mappedProperties = FromProperties11(args, type.properties);
2032
+ return { ...type, ...Object2(mappedProperties) };
2033
+ }
2034
+ function FromRecord2(args, type) {
2035
+ const mappedKey = FromType(args, RecordKey2(type));
2036
+ const mappedValue = FromType(args, RecordValue2(type));
2037
+ const result = Record(mappedKey, mappedValue);
2038
+ return { ...type, ...result };
2039
+ }
2040
+ function FromArgument(args, argument) {
2041
+ return argument.index in args ? args[argument.index] : Unknown();
2042
+ }
2043
+ function FromProperty2(args, type) {
2044
+ const isReadonly = IsReadonly(type);
2045
+ const isOptional = IsOptional(type);
2046
+ const mapped = FromType(args, type);
2047
+ return isReadonly && isOptional ? ReadonlyOptional(mapped) : isReadonly && !isOptional ? Readonly(mapped) : !isReadonly && isOptional ? Optional(mapped) : mapped;
2048
+ }
2049
+ function FromProperties11(args, properties) {
2050
+ return globalThis.Object.getOwnPropertyNames(properties).reduce((result, key) => {
2051
+ return { ...result, [key]: FromProperty2(args, properties[key]) };
2052
+ }, {});
2053
+ }
2054
+ function FromTypes(args, types) {
2055
+ return types.map((type) => FromType(args, type));
2056
+ }
2057
+ function FromType(args, type) {
2058
+ 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;
2059
+ }
2060
+ function Instantiate(type, args) {
2061
+ return FromType(args, CloneType(type));
2062
+ }
2063
+
2064
+ // ../node_modules/@sinclair/typebox/build/esm/type/integer/integer.mjs
2065
+ function Integer(options) {
2066
+ return CreateType({ [Kind]: "Integer", type: "integer" }, options);
2067
+ }
2068
+
2069
+ // ../node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.mjs
2070
+ function MappedIntrinsicPropertyKey(K, M, options) {
2071
+ return {
2072
+ [K]: Intrinsic(Literal(K), M, Clone(options))
2073
+ };
2074
+ }
2075
+ function MappedIntrinsicPropertyKeys(K, M, options) {
2076
+ const result = K.reduce((Acc, L) => {
2077
+ return { ...Acc, ...MappedIntrinsicPropertyKey(L, M, options) };
2078
+ }, {});
2079
+ return result;
2080
+ }
2081
+ function MappedIntrinsicProperties(T, M, options) {
2082
+ return MappedIntrinsicPropertyKeys(T["keys"], M, options);
2083
+ }
2084
+ function IntrinsicFromMappedKey(T, M, options) {
2085
+ const P = MappedIntrinsicProperties(T, M, options);
2086
+ return MappedResult(P);
2087
+ }
2088
+
2089
+ // ../node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic.mjs
2090
+ function ApplyUncapitalize(value) {
2091
+ const [first, rest] = [value.slice(0, 1), value.slice(1)];
2092
+ return [first.toLowerCase(), rest].join("");
2093
+ }
2094
+ function ApplyCapitalize(value) {
2095
+ const [first, rest] = [value.slice(0, 1), value.slice(1)];
2096
+ return [first.toUpperCase(), rest].join("");
2097
+ }
2098
+ function ApplyUppercase(value) {
2099
+ return value.toUpperCase();
2100
+ }
2101
+ function ApplyLowercase(value) {
2102
+ return value.toLowerCase();
2103
+ }
2104
+ function FromTemplateLiteral3(schema, mode, options) {
2105
+ const expression = TemplateLiteralParseExact(schema.pattern);
2106
+ const finite = IsTemplateLiteralExpressionFinite(expression);
2107
+ if (!finite)
2108
+ return { ...schema, pattern: FromLiteralValue(schema.pattern, mode) };
2109
+ const strings = [...TemplateLiteralExpressionGenerate(expression)];
2110
+ const literals = strings.map((value) => Literal(value));
2111
+ const mapped = FromRest5(literals, mode);
2112
+ const union = Union(mapped);
2113
+ return TemplateLiteral([union], options);
2114
+ }
2115
+ function FromLiteralValue(value, mode) {
2116
+ return typeof value === "string" ? mode === "Uncapitalize" ? ApplyUncapitalize(value) : mode === "Capitalize" ? ApplyCapitalize(value) : mode === "Uppercase" ? ApplyUppercase(value) : mode === "Lowercase" ? ApplyLowercase(value) : value : value.toString();
2117
+ }
2118
+ function FromRest5(T, M) {
2119
+ return T.map((L) => Intrinsic(L, M));
2120
+ }
2121
+ function Intrinsic(schema, mode, options = {}) {
2122
+ return (
2123
+ // Intrinsic-Mapped-Inference
2124
+ IsMappedKey(schema) ? IntrinsicFromMappedKey(schema, mode, options) : (
2125
+ // Standard-Inference
2126
+ IsTemplateLiteral(schema) ? FromTemplateLiteral3(schema, mode, options) : IsUnion(schema) ? Union(FromRest5(schema.anyOf, mode), options) : IsLiteral(schema) ? Literal(FromLiteralValue(schema.const, mode), options) : (
2127
+ // Default Type
2128
+ CreateType(schema, options)
2129
+ )
2130
+ )
2131
+ );
2132
+ }
2133
+
2134
+ // ../node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.mjs
2135
+ function Capitalize(T, options = {}) {
2136
+ return Intrinsic(T, "Capitalize", options);
2137
+ }
2138
+
2139
+ // ../node_modules/@sinclair/typebox/build/esm/type/intrinsic/lowercase.mjs
2140
+ function Lowercase(T, options = {}) {
2141
+ return Intrinsic(T, "Lowercase", options);
2142
+ }
2143
+
2144
+ // ../node_modules/@sinclair/typebox/build/esm/type/intrinsic/uncapitalize.mjs
2145
+ function Uncapitalize(T, options = {}) {
2146
+ return Intrinsic(T, "Uncapitalize", options);
2147
+ }
2148
+
2149
+ // ../node_modules/@sinclair/typebox/build/esm/type/intrinsic/uppercase.mjs
2150
+ function Uppercase(T, options = {}) {
2151
+ return Intrinsic(T, "Uppercase", options);
2152
+ }
2153
+
2154
+ // ../node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.mjs
2155
+ function FromProperties12(properties, propertyKeys, options) {
2156
+ const result = {};
2157
+ for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
2158
+ result[K2] = Omit(properties[K2], propertyKeys, Clone(options));
2159
+ return result;
2160
+ }
2161
+ function FromMappedResult9(mappedResult, propertyKeys, options) {
2162
+ return FromProperties12(mappedResult.properties, propertyKeys, options);
2163
+ }
2164
+ function OmitFromMappedResult(mappedResult, propertyKeys, options) {
2165
+ const properties = FromMappedResult9(mappedResult, propertyKeys, options);
2166
+ return MappedResult(properties);
2167
+ }
2168
+
2169
+ // ../node_modules/@sinclair/typebox/build/esm/type/omit/omit.mjs
2170
+ function FromIntersect6(types, propertyKeys) {
2171
+ return types.map((type) => OmitResolve(type, propertyKeys));
2172
+ }
2173
+ function FromUnion8(types, propertyKeys) {
2174
+ return types.map((type) => OmitResolve(type, propertyKeys));
2175
+ }
2176
+ function FromProperty3(properties, key) {
2177
+ const { [key]: _, ...R } = properties;
2178
+ return R;
2179
+ }
2180
+ function FromProperties13(properties, propertyKeys) {
2181
+ return propertyKeys.reduce((T, K2) => FromProperty3(T, K2), properties);
2182
+ }
2183
+ function FromObject3(type, propertyKeys, properties) {
2184
+ const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
2185
+ const mappedProperties = FromProperties13(properties, propertyKeys);
2186
+ return Object2(mappedProperties, options);
2187
+ }
2188
+ function UnionFromPropertyKeys(propertyKeys) {
2189
+ const result = propertyKeys.reduce((result2, key) => IsLiteralValue(key) ? [...result2, Literal(key)] : result2, []);
2190
+ return Union(result);
2191
+ }
2192
+ function OmitResolve(type, propertyKeys) {
2193
+ return IsIntersect(type) ? Intersect(FromIntersect6(type.allOf, propertyKeys)) : IsUnion(type) ? Union(FromUnion8(type.anyOf, propertyKeys)) : IsObject3(type) ? FromObject3(type, propertyKeys, type.properties) : Object2({});
2194
+ }
2195
+ function Omit(type, key, options) {
2196
+ const typeKey = IsArray(key) ? UnionFromPropertyKeys(key) : key;
2197
+ const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key;
2198
+ const isTypeRef = IsRef(type);
2199
+ const isKeyRef = IsRef(key);
2200
+ 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 });
2201
+ }
2202
+
2203
+ // ../node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.mjs
2204
+ function FromPropertyKey2(type, key, options) {
2205
+ return { [key]: Omit(type, [key], Clone(options)) };
2206
+ }
2207
+ function FromPropertyKeys2(type, propertyKeys, options) {
2208
+ return propertyKeys.reduce((Acc, LK) => {
2209
+ return { ...Acc, ...FromPropertyKey2(type, LK, options) };
2210
+ }, {});
2211
+ }
2212
+ function FromMappedKey3(type, mappedKey, options) {
2213
+ return FromPropertyKeys2(type, mappedKey.keys, options);
2214
+ }
2215
+ function OmitFromMappedKey(type, mappedKey, options) {
2216
+ const properties = FromMappedKey3(type, mappedKey, options);
2217
+ return MappedResult(properties);
2218
+ }
2219
+
2220
+ // ../node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.mjs
2221
+ function FromProperties14(properties, propertyKeys, options) {
2222
+ const result = {};
2223
+ for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
2224
+ result[K2] = Pick(properties[K2], propertyKeys, Clone(options));
2225
+ return result;
2226
+ }
2227
+ function FromMappedResult10(mappedResult, propertyKeys, options) {
2228
+ return FromProperties14(mappedResult.properties, propertyKeys, options);
2229
+ }
2230
+ function PickFromMappedResult(mappedResult, propertyKeys, options) {
2231
+ const properties = FromMappedResult10(mappedResult, propertyKeys, options);
2232
+ return MappedResult(properties);
2233
+ }
2234
+
2235
+ // ../node_modules/@sinclair/typebox/build/esm/type/pick/pick.mjs
2236
+ function FromIntersect7(types, propertyKeys) {
2237
+ return types.map((type) => PickResolve(type, propertyKeys));
2238
+ }
2239
+ function FromUnion9(types, propertyKeys) {
2240
+ return types.map((type) => PickResolve(type, propertyKeys));
2241
+ }
2242
+ function FromProperties15(properties, propertyKeys) {
2243
+ const result = {};
2244
+ for (const K2 of propertyKeys)
2245
+ if (K2 in properties)
2246
+ result[K2] = properties[K2];
2247
+ return result;
2248
+ }
2249
+ function FromObject4(Type2, keys, properties) {
2250
+ const options = Discard(Type2, [TransformKind, "$id", "required", "properties"]);
2251
+ const mappedProperties = FromProperties15(properties, keys);
2252
+ return Object2(mappedProperties, options);
2253
+ }
2254
+ function UnionFromPropertyKeys2(propertyKeys) {
2255
+ const result = propertyKeys.reduce((result2, key) => IsLiteralValue(key) ? [...result2, Literal(key)] : result2, []);
2256
+ return Union(result);
2257
+ }
2258
+ function PickResolve(type, propertyKeys) {
2259
+ return IsIntersect(type) ? Intersect(FromIntersect7(type.allOf, propertyKeys)) : IsUnion(type) ? Union(FromUnion9(type.anyOf, propertyKeys)) : IsObject3(type) ? FromObject4(type, propertyKeys, type.properties) : Object2({});
2260
+ }
2261
+ function Pick(type, key, options) {
2262
+ const typeKey = IsArray(key) ? UnionFromPropertyKeys2(key) : key;
2263
+ const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key;
2264
+ const isTypeRef = IsRef(type);
2265
+ const isKeyRef = IsRef(key);
2266
+ 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 });
2267
+ }
2268
+
2269
+ // ../node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.mjs
2270
+ function FromPropertyKey3(type, key, options) {
2271
+ return {
2272
+ [key]: Pick(type, [key], Clone(options))
2273
+ };
2274
+ }
2275
+ function FromPropertyKeys3(type, propertyKeys, options) {
2276
+ return propertyKeys.reduce((result, leftKey) => {
2277
+ return { ...result, ...FromPropertyKey3(type, leftKey, options) };
2278
+ }, {});
2279
+ }
2280
+ function FromMappedKey4(type, mappedKey, options) {
2281
+ return FromPropertyKeys3(type, mappedKey.keys, options);
2282
+ }
2283
+ function PickFromMappedKey(type, mappedKey, options) {
2284
+ const properties = FromMappedKey4(type, mappedKey, options);
2285
+ return MappedResult(properties);
2286
+ }
2287
+
2288
+ // ../node_modules/@sinclair/typebox/build/esm/type/partial/partial.mjs
2289
+ function FromComputed3(target, parameters) {
2290
+ return Computed("Partial", [Computed(target, parameters)]);
2291
+ }
2292
+ function FromRef3($ref) {
2293
+ return Computed("Partial", [Ref($ref)]);
2294
+ }
2295
+ function FromProperties16(properties) {
2296
+ const partialProperties = {};
2297
+ for (const K of globalThis.Object.getOwnPropertyNames(properties))
2298
+ partialProperties[K] = Optional(properties[K]);
2299
+ return partialProperties;
2300
+ }
2301
+ function FromObject5(type, properties) {
2302
+ const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
2303
+ const mappedProperties = FromProperties16(properties);
2304
+ return Object2(mappedProperties, options);
2305
+ }
2306
+ function FromRest6(types) {
2307
+ return types.map((type) => PartialResolve(type));
2308
+ }
2309
+ function PartialResolve(type) {
2310
+ return (
2311
+ // Mappable
2312
+ 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) : (
2313
+ // Intrinsic
2314
+ IsBigInt2(type) ? type : IsBoolean2(type) ? type : IsInteger(type) ? type : IsLiteral(type) ? type : IsNull2(type) ? type : IsNumber3(type) ? type : IsString2(type) ? type : IsSymbol2(type) ? type : IsUndefined3(type) ? type : (
2315
+ // Passthrough
2316
+ Object2({})
2317
+ )
2318
+ )
2319
+ );
2320
+ }
2321
+ function Partial(type, options) {
2322
+ if (IsMappedResult(type)) {
2323
+ return PartialFromMappedResult(type, options);
2324
+ } else {
2325
+ return CreateType({ ...PartialResolve(type), ...options });
2326
+ }
2327
+ }
2328
+
2329
+ // ../node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.mjs
2330
+ function FromProperties17(K, options) {
2331
+ const Acc = {};
2332
+ for (const K2 of globalThis.Object.getOwnPropertyNames(K))
2333
+ Acc[K2] = Partial(K[K2], Clone(options));
2334
+ return Acc;
2335
+ }
2336
+ function FromMappedResult11(R, options) {
2337
+ return FromProperties17(R.properties, options);
2338
+ }
2339
+ function PartialFromMappedResult(R, options) {
2340
+ const P = FromMappedResult11(R, options);
2341
+ return MappedResult(P);
2342
+ }
2343
+
2344
+ // ../node_modules/@sinclair/typebox/build/esm/type/required/required.mjs
2345
+ function FromComputed4(target, parameters) {
2346
+ return Computed("Required", [Computed(target, parameters)]);
2347
+ }
2348
+ function FromRef4($ref) {
2349
+ return Computed("Required", [Ref($ref)]);
2350
+ }
2351
+ function FromProperties18(properties) {
2352
+ const requiredProperties = {};
2353
+ for (const K of globalThis.Object.getOwnPropertyNames(properties))
2354
+ requiredProperties[K] = Discard(properties[K], [OptionalKind]);
2355
+ return requiredProperties;
2356
+ }
2357
+ function FromObject6(type, properties) {
2358
+ const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
2359
+ const mappedProperties = FromProperties18(properties);
2360
+ return Object2(mappedProperties, options);
2361
+ }
2362
+ function FromRest7(types) {
2363
+ return types.map((type) => RequiredResolve(type));
2364
+ }
2365
+ function RequiredResolve(type) {
2366
+ return (
2367
+ // Mappable
2368
+ 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) : (
2369
+ // Intrinsic
2370
+ 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 : (
2371
+ // Passthrough
2372
+ Object2({})
2373
+ )
2374
+ )
2375
+ );
2376
+ }
2377
+ function Required(type, options) {
2378
+ if (IsMappedResult(type)) {
2379
+ return RequiredFromMappedResult(type, options);
2380
+ } else {
2381
+ return CreateType({ ...RequiredResolve(type), ...options });
2382
+ }
2383
+ }
2384
+
2385
+ // ../node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.mjs
2386
+ function FromProperties19(P, options) {
2387
+ const Acc = {};
2388
+ for (const K2 of globalThis.Object.getOwnPropertyNames(P))
2389
+ Acc[K2] = Required(P[K2], options);
2390
+ return Acc;
2391
+ }
2392
+ function FromMappedResult12(R, options) {
2393
+ return FromProperties19(R.properties, options);
2394
+ }
2395
+ function RequiredFromMappedResult(R, options) {
2396
+ const P = FromMappedResult12(R, options);
2397
+ return MappedResult(P);
2398
+ }
2399
+
2400
+ // ../node_modules/@sinclair/typebox/build/esm/type/module/compute.mjs
2401
+ function DereferenceParameters(moduleProperties, types) {
2402
+ return types.map((type) => {
2403
+ return IsRef(type) ? Dereference(moduleProperties, type.$ref) : FromType2(moduleProperties, type);
2404
+ });
2405
+ }
2406
+ function Dereference(moduleProperties, ref) {
2407
+ return ref in moduleProperties ? IsRef(moduleProperties[ref]) ? Dereference(moduleProperties, moduleProperties[ref].$ref) : FromType2(moduleProperties, moduleProperties[ref]) : Never();
2408
+ }
2409
+ function FromAwaited(parameters) {
2410
+ return Awaited(parameters[0]);
2411
+ }
2412
+ function FromIndex(parameters) {
2413
+ return Index(parameters[0], parameters[1]);
2414
+ }
2415
+ function FromKeyOf(parameters) {
2416
+ return KeyOf(parameters[0]);
2417
+ }
2418
+ function FromPartial(parameters) {
2419
+ return Partial(parameters[0]);
2420
+ }
2421
+ function FromOmit(parameters) {
2422
+ return Omit(parameters[0], parameters[1]);
2423
+ }
2424
+ function FromPick(parameters) {
2425
+ return Pick(parameters[0], parameters[1]);
2426
+ }
2427
+ function FromRequired(parameters) {
2428
+ return Required(parameters[0]);
2429
+ }
2430
+ function FromComputed5(moduleProperties, target, parameters) {
2431
+ const dereferenced = DereferenceParameters(moduleProperties, parameters);
2432
+ 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();
2433
+ }
2434
+ function FromArray6(moduleProperties, type) {
2435
+ return Array2(FromType2(moduleProperties, type));
2436
+ }
2437
+ function FromAsyncIterator3(moduleProperties, type) {
2438
+ return AsyncIterator(FromType2(moduleProperties, type));
2439
+ }
2440
+ function FromConstructor3(moduleProperties, parameters, instanceType) {
2441
+ return Constructor(FromTypes2(moduleProperties, parameters), FromType2(moduleProperties, instanceType));
2442
+ }
2443
+ function FromFunction3(moduleProperties, parameters, returnType) {
2444
+ return Function2(FromTypes2(moduleProperties, parameters), FromType2(moduleProperties, returnType));
2445
+ }
2446
+ function FromIntersect8(moduleProperties, types) {
2447
+ return Intersect(FromTypes2(moduleProperties, types));
2448
+ }
2449
+ function FromIterator3(moduleProperties, type) {
2450
+ return Iterator(FromType2(moduleProperties, type));
2451
+ }
2452
+ function FromObject7(moduleProperties, properties) {
2453
+ return Object2(globalThis.Object.keys(properties).reduce((result, key) => {
2454
+ return { ...result, [key]: FromType2(moduleProperties, properties[key]) };
2455
+ }, {}));
2456
+ }
2457
+ function FromRecord3(moduleProperties, type) {
2458
+ const [value, pattern] = [FromType2(moduleProperties, RecordValue2(type)), RecordPattern(type)];
2459
+ const result = CloneType(type);
2460
+ result.patternProperties[pattern] = value;
2461
+ return result;
2462
+ }
2463
+ function FromTransform(moduleProperties, transform) {
2464
+ return IsRef(transform) ? { ...Dereference(moduleProperties, transform.$ref), [TransformKind]: transform[TransformKind] } : transform;
2465
+ }
2466
+ function FromTuple5(moduleProperties, types) {
2467
+ return Tuple(FromTypes2(moduleProperties, types));
2468
+ }
2469
+ function FromUnion10(moduleProperties, types) {
2470
+ return Union(FromTypes2(moduleProperties, types));
2471
+ }
2472
+ function FromTypes2(moduleProperties, types) {
2473
+ return types.map((type) => FromType2(moduleProperties, type));
2474
+ }
2475
+ function FromType2(moduleProperties, type) {
2476
+ return (
2477
+ // Modifiers
2478
+ IsOptional(type) ? CreateType(FromType2(moduleProperties, Discard(type, [OptionalKind])), type) : IsReadonly(type) ? CreateType(FromType2(moduleProperties, Discard(type, [ReadonlyKind])), type) : (
2479
+ // Transform
2480
+ IsTransform(type) ? CreateType(FromTransform(moduleProperties, type), type) : (
2481
+ // Types
2482
+ 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
2483
+ )
2484
+ )
2485
+ );
2486
+ }
2487
+ function ComputeType(moduleProperties, key) {
2488
+ return key in moduleProperties ? FromType2(moduleProperties, moduleProperties[key]) : Never();
2489
+ }
2490
+ function ComputeModuleProperties(moduleProperties) {
2491
+ return globalThis.Object.getOwnPropertyNames(moduleProperties).reduce((result, key) => {
2492
+ return { ...result, [key]: ComputeType(moduleProperties, key) };
2493
+ }, {});
2494
+ }
2495
+
2496
+ // ../node_modules/@sinclair/typebox/build/esm/type/module/module.mjs
2497
+ var TModule = class {
2498
+ constructor($defs) {
2499
+ const computed = ComputeModuleProperties($defs);
2500
+ const identified = this.WithIdentifiers(computed);
2501
+ this.$defs = identified;
2502
+ }
2503
+ /** `[Json]` Imports a Type by Key. */
2504
+ Import(key, options) {
2505
+ const $defs = { ...this.$defs, [key]: CreateType(this.$defs[key], options) };
2506
+ return CreateType({ [Kind]: "Import", $defs, $ref: key });
2507
+ }
2508
+ // prettier-ignore
2509
+ WithIdentifiers($defs) {
2510
+ return globalThis.Object.getOwnPropertyNames($defs).reduce((result, key) => {
2511
+ return { ...result, [key]: { ...$defs[key], $id: key } };
2512
+ }, {});
2513
+ }
2514
+ };
2515
+ function Module(properties) {
2516
+ return new TModule(properties);
2517
+ }
2518
+
2519
+ // ../node_modules/@sinclair/typebox/build/esm/type/not/not.mjs
2520
+ function Not(type, options) {
2521
+ return CreateType({ [Kind]: "Not", not: type }, options);
2522
+ }
2523
+
2524
+ // ../node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.mjs
2525
+ function Parameters(schema, options) {
2526
+ return IsFunction2(schema) ? Tuple(schema.parameters, options) : Never();
2527
+ }
2528
+
2529
+ // ../node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.mjs
2530
+ var Ordinal = 0;
2531
+ function Recursive(callback, options = {}) {
2532
+ if (IsUndefined(options.$id))
2533
+ options.$id = `T${Ordinal++}`;
2534
+ const thisType = CloneType(callback({ [Kind]: "This", $ref: `${options.$id}` }));
2535
+ thisType.$id = options.$id;
2536
+ return CreateType({ [Hint]: "Recursive", ...thisType }, options);
2537
+ }
2538
+
2539
+ // ../node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.mjs
2540
+ function RegExp2(unresolved, options) {
2541
+ const expr = IsString(unresolved) ? new globalThis.RegExp(unresolved) : unresolved;
2542
+ return CreateType({ [Kind]: "RegExp", type: "RegExp", source: expr.source, flags: expr.flags }, options);
2543
+ }
2544
+
2545
+ // ../node_modules/@sinclair/typebox/build/esm/type/rest/rest.mjs
2546
+ function RestResolve(T) {
2547
+ return IsIntersect(T) ? T.allOf : IsUnion(T) ? T.anyOf : IsTuple(T) ? T.items ?? [] : [];
2548
+ }
2549
+ function Rest(T) {
2550
+ return RestResolve(T);
2551
+ }
2552
+
2553
+ // ../node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.mjs
2554
+ function ReturnType(schema, options) {
2555
+ return IsFunction2(schema) ? CreateType(schema.returns, options) : Never(options);
2556
+ }
2557
+
2558
+ // ../node_modules/@sinclair/typebox/build/esm/type/transform/transform.mjs
2559
+ var TransformDecodeBuilder = class {
2560
+ constructor(schema) {
2561
+ this.schema = schema;
2562
+ }
2563
+ Decode(decode) {
2564
+ return new TransformEncodeBuilder(this.schema, decode);
2565
+ }
2566
+ };
2567
+ var TransformEncodeBuilder = class {
2568
+ constructor(schema, decode) {
2569
+ this.schema = schema;
2570
+ this.decode = decode;
2571
+ }
2572
+ EncodeTransform(encode, schema) {
2573
+ const Encode = (value) => schema[TransformKind].Encode(encode(value));
2574
+ const Decode = (value) => this.decode(schema[TransformKind].Decode(value));
2575
+ const Codec = { Encode, Decode };
2576
+ return { ...schema, [TransformKind]: Codec };
2577
+ }
2578
+ EncodeSchema(encode, schema) {
2579
+ const Codec = { Decode: this.decode, Encode: encode };
2580
+ return { ...schema, [TransformKind]: Codec };
2581
+ }
2582
+ Encode(encode) {
2583
+ return IsTransform(this.schema) ? this.EncodeTransform(encode, this.schema) : this.EncodeSchema(encode, this.schema);
2584
+ }
2585
+ };
2586
+ function Transform(schema) {
2587
+ return new TransformDecodeBuilder(schema);
2588
+ }
2589
+
2590
+ // ../node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.mjs
2591
+ function Unsafe(options = {}) {
2592
+ return CreateType({ [Kind]: options[Kind] ?? "Unsafe" }, options);
2593
+ }
2594
+
2595
+ // ../node_modules/@sinclair/typebox/build/esm/type/void/void.mjs
2596
+ function Void(options) {
2597
+ return CreateType({ [Kind]: "Void", type: "void" }, options);
2598
+ }
2599
+
2600
+ // ../node_modules/@sinclair/typebox/build/esm/type/type/type.mjs
2601
+ var type_exports2 = {};
2602
+ __export(type_exports2, {
2603
+ Any: () => Any,
2604
+ Argument: () => Argument,
2605
+ Array: () => Array2,
2606
+ AsyncIterator: () => AsyncIterator,
2607
+ Awaited: () => Awaited,
2608
+ BigInt: () => BigInt,
2609
+ Boolean: () => Boolean2,
2610
+ Capitalize: () => Capitalize,
2611
+ Composite: () => Composite,
2612
+ Const: () => Const,
2613
+ Constructor: () => Constructor,
2614
+ ConstructorParameters: () => ConstructorParameters,
2615
+ Date: () => Date2,
2616
+ Enum: () => Enum,
2617
+ Exclude: () => Exclude,
2618
+ Extends: () => Extends,
2619
+ Extract: () => Extract,
2620
+ Function: () => Function2,
2621
+ Index: () => Index,
2622
+ InstanceType: () => InstanceType,
2623
+ Instantiate: () => Instantiate,
2624
+ Integer: () => Integer,
2625
+ Intersect: () => Intersect,
2626
+ Iterator: () => Iterator,
2627
+ KeyOf: () => KeyOf,
2628
+ Literal: () => Literal,
2629
+ Lowercase: () => Lowercase,
2630
+ Mapped: () => Mapped,
2631
+ Module: () => Module,
2632
+ Never: () => Never,
2633
+ Not: () => Not,
2634
+ Null: () => Null,
2635
+ Number: () => Number2,
2636
+ Object: () => Object2,
2637
+ Omit: () => Omit,
2638
+ Optional: () => Optional,
2639
+ Parameters: () => Parameters,
2640
+ Partial: () => Partial,
2641
+ Pick: () => Pick,
2642
+ Promise: () => Promise2,
2643
+ Readonly: () => Readonly,
2644
+ ReadonlyOptional: () => ReadonlyOptional,
2645
+ Record: () => Record,
2646
+ Recursive: () => Recursive,
2647
+ Ref: () => Ref,
2648
+ RegExp: () => RegExp2,
2649
+ Required: () => Required,
2650
+ Rest: () => Rest,
2651
+ ReturnType: () => ReturnType,
2652
+ String: () => String2,
2653
+ Symbol: () => Symbol2,
2654
+ TemplateLiteral: () => TemplateLiteral,
2655
+ Transform: () => Transform,
2656
+ Tuple: () => Tuple,
2657
+ Uint8Array: () => Uint8Array2,
2658
+ Uncapitalize: () => Uncapitalize,
2659
+ Undefined: () => Undefined,
2660
+ Union: () => Union,
2661
+ Unknown: () => Unknown,
2662
+ Unsafe: () => Unsafe,
2663
+ Uppercase: () => Uppercase,
2664
+ Void: () => Void
2665
+ });
2666
+
2667
+ // ../node_modules/@sinclair/typebox/build/esm/type/type/index.mjs
2668
+ var Type = type_exports2;
2669
+
2670
+ // ../shared_libs/plays/authoring-contract.ts
2671
+ var PLAY_AUTHORING_CONTRACT_EDITION = 3;
2672
+ var PLAY_SQL_LISTENER_WHERE_OPERATORS = [
2673
+ "eq",
2674
+ "neq",
2675
+ "in",
2676
+ "notIn",
2677
+ "isNull",
2678
+ "isNotNull",
2679
+ "ilike"
2680
+ ];
2681
+ var PLAY_SQL_LISTENER_ID_PATTERN = /^[a-zA-Z][a-zA-Z0-9_-]*$/;
2682
+ var PLAY_SQL_LISTENER_TOOL_PATTERN = /^[a-zA-Z][a-zA-Z0-9_-]*\.[a-zA-Z][a-zA-Z0-9_-]*$/;
2683
+ var PLAY_SQL_LISTENER_WHERE_OPERATOR_SET = new Set(
2684
+ PLAY_SQL_LISTENER_WHERE_OPERATORS
2685
+ );
2686
+ var SecretEnvironmentNameSchema = Type.String({
2687
+ pattern: "^[A-Z][A-Z0-9_]{1,63}$",
2688
+ description: "An uppercase environment variable name beginning with a letter."
2689
+ });
2690
+ var SqlListenerFilterScalarSchema = Type.Union([
2691
+ Type.String(),
2692
+ Type.Number(),
2693
+ Type.Boolean(),
2694
+ Type.Null()
2695
+ ]);
2696
+ var PLAY_AUTHORING_FIELD_REGISTRY = {
2697
+ description: {
2698
+ schema: Type.String({ minLength: 1 }),
2699
+ fixtures: {
2700
+ valid: "Enrich a company.",
2701
+ invalid: "",
2702
+ absent: void 0,
2703
+ unresolved: { expression: "description" },
2704
+ edition1: "Legacy play."
2705
+ },
2706
+ referenceType: "string",
2707
+ required: false,
2708
+ resolution: "static-required",
2709
+ issueCode: "play_authoring_binding_invalid",
2710
+ description: "Optional non-empty human-readable summary of the Play.",
2711
+ errorMessage: "description must be a non-empty static string."
2712
+ },
2713
+ "compatibility.toolErrorSchemaVersion": {
2714
+ schema: Type.Union([Type.Literal(0), Type.Literal(1)]),
2715
+ fixtures: {
2716
+ valid: 1,
2717
+ invalid: 2,
2718
+ absent: void 0,
2719
+ unresolved: { expression: "version" },
2720
+ edition1: 0
2721
+ },
2722
+ referenceType: "0 | 1",
2723
+ required: false,
2724
+ resolution: "static-required",
2725
+ issueCode: "play_authoring_binding_invalid",
2726
+ description: "Artifact-pinned tool error behavior, either 0 or 1.",
2727
+ errorMessage: "compatibility.toolErrorSchemaVersion must be the static literal 0 or 1."
2728
+ },
2729
+ inline: {
2730
+ schema: Type.Boolean(),
2731
+ fixtures: {
2732
+ valid: true,
2733
+ invalid: "true",
2734
+ absent: void 0,
2735
+ unresolved: { expression: "inline" },
2736
+ edition1: false
2737
+ },
2738
+ referenceType: "boolean",
2739
+ required: false,
2740
+ resolution: "static-required",
2741
+ issueCode: "play_authoring_binding_invalid",
2742
+ description: "Compiler hint for an inline named Play handler.",
2743
+ errorMessage: "inline must be a static boolean."
2744
+ },
2745
+ "billing.maxCreditsPerRun": {
2746
+ schema: Type.Number({ exclusiveMinimum: 0 }),
2747
+ fixtures: {
2748
+ valid: 1,
2749
+ invalid: 0,
2750
+ absent: void 0,
2751
+ unresolved: { expression: "cap" },
2752
+ edition1: 1
2753
+ },
2754
+ referenceType: "number",
2755
+ required: false,
2756
+ resolution: "static-required",
2757
+ issueCode: "play_authoring_billing_limit_invalid",
2758
+ description: "Maximum Deepline credits permitted for one Play Run.",
2759
+ errorMessage: "billing.maxCreditsPerRun must be a static number greater than 0. Remove it for no run cap."
2760
+ },
2761
+ "bindings.webhook.hmac.secretEnv": {
2762
+ schema: SecretEnvironmentNameSchema,
2763
+ fixtures: {
2764
+ valid: "WEBHOOK_SECRET",
2765
+ invalid: "webhook_secret",
2766
+ absent: void 0,
2767
+ unresolved: { expression: "secretEnv" },
2768
+ edition1: "WEBHOOK_SECRET"
2769
+ },
2770
+ referenceType: "string",
2771
+ required: true,
2772
+ resolution: "static-required",
2773
+ issueCode: "play_authoring_webhook_hmac_invalid",
2774
+ description: "Environment variable containing the webhook HMAC secret.",
2775
+ errorMessage: "bindings.webhook.hmac.secretEnv must be an uppercase environment variable name beginning with a letter."
2776
+ },
2777
+ "bindings.webhook.hmac.algorithm": {
2778
+ schema: Type.Literal("sha256"),
2779
+ fixtures: {
2780
+ valid: "sha256",
2781
+ invalid: "sha1",
2782
+ absent: void 0,
2783
+ unresolved: { expression: "algorithm" },
2784
+ edition1: "sha256"
2785
+ },
2786
+ referenceType: "'sha256'",
2787
+ required: false,
2788
+ resolution: "static-required",
2789
+ issueCode: "play_authoring_webhook_hmac_invalid",
2790
+ description: "Webhook signature hash algorithm. Only sha256 is supported.",
2791
+ errorMessage: 'bindings.webhook.hmac.algorithm must be the static literal "sha256".'
2792
+ },
2793
+ "bindings.webhook.hmac.header": {
2794
+ schema: Type.String({ minLength: 1 }),
2795
+ fixtures: {
2796
+ valid: "x-signature",
2797
+ invalid: "",
2798
+ absent: void 0,
2799
+ unresolved: { expression: "header" },
2800
+ edition1: "x-signature"
2801
+ },
2802
+ referenceType: "string",
2803
+ required: false,
2804
+ resolution: "static-required",
2805
+ issueCode: "play_authoring_webhook_hmac_invalid",
2806
+ description: "HTTP header containing the webhook signature.",
2807
+ errorMessage: "bindings.webhook.hmac.header must be a non-empty static string."
2808
+ },
2809
+ "bindings.cron.schedule": {
2810
+ schema: Type.String({ minLength: 1 }),
2811
+ fixtures: {
2812
+ valid: "0 9 * * *",
2813
+ invalid: "",
2814
+ absent: void 0,
2815
+ unresolved: { expression: "schedule" },
2816
+ edition1: "0 9 * * *"
2817
+ },
2818
+ referenceType: "string",
2819
+ required: true,
2820
+ resolution: "static-required",
2821
+ issueCode: "play_authoring_binding_invalid",
2822
+ description: "Five-field cron expression.",
2823
+ errorMessage: "bindings.cron.schedule must be a non-empty static string."
2824
+ },
2825
+ "bindings.cron.timezone": {
2826
+ schema: Type.String({ minLength: 1 }),
2827
+ fixtures: {
2828
+ valid: "UTC",
2829
+ invalid: "",
2830
+ absent: void 0,
2831
+ unresolved: { expression: "timezone" },
2832
+ edition1: "UTC"
2833
+ },
2834
+ referenceType: "string",
2835
+ required: false,
2836
+ resolution: "static-required",
2837
+ issueCode: "play_authoring_cron_timezone_invalid",
2838
+ description: "IANA timezone. Omitted means UTC.",
2839
+ errorMessage: "bindings.cron.timezone must be a valid non-empty IANA timezone string."
2840
+ },
2841
+ "bindings.sqlListeners": {
2842
+ schema: Type.Array(Type.Object({}, { additionalProperties: true })),
2843
+ fixtures: {
2844
+ valid: [],
2845
+ invalid: "listeners",
2846
+ absent: void 0,
2847
+ unresolved: { expression: "listeners" },
2848
+ edition1: []
2849
+ },
2850
+ referenceType: "SqlListener[]",
2851
+ required: false,
2852
+ resolution: "static-required",
2853
+ issueCode: "play_authoring_binding_invalid",
2854
+ description: "Static provider-monitor listener declarations.",
2855
+ errorMessage: "bindings.sqlListeners must be a static array of objects."
2856
+ },
2857
+ "bindings.sqlListeners[].id": {
2858
+ schema: Type.String({ pattern: PLAY_SQL_LISTENER_ID_PATTERN.source }),
2859
+ fixtures: {
2860
+ valid: "job-openings",
2861
+ invalid: "1-job-openings",
2862
+ absent: void 0,
2863
+ unresolved: { expression: "listenerId" },
2864
+ edition1: "job-openings"
2865
+ },
2866
+ referenceType: "string",
2867
+ required: true,
2868
+ resolution: "static-required",
2869
+ issueCode: "sql_listener_binding_shape",
2870
+ description: "Unique static listener identifier within one Play.",
2871
+ errorMessage: "bindings.sqlListeners[].id must begin with a letter and contain only letters, numbers, underscores, or hyphens."
2872
+ },
2873
+ "bindings.sqlListeners[].tool": {
2874
+ schema: Type.String({ pattern: PLAY_SQL_LISTENER_TOOL_PATTERN.source }),
2875
+ fixtures: {
2876
+ valid: "deepline_native.company_radar",
2877
+ invalid: "company_radar",
2878
+ absent: void 0,
2879
+ unresolved: { expression: "toolId" },
2880
+ edition1: "deepline_native.company_radar"
2881
+ },
2882
+ referenceType: "string",
2883
+ required: true,
2884
+ resolution: "static-required",
2885
+ issueCode: "sql_listener_binding_shape",
2886
+ description: "Modeled provider monitor tool id in provider.tool form.",
2887
+ errorMessage: "bindings.sqlListeners[].tool must use static provider.tool syntax."
2888
+ },
2889
+ "bindings.sqlListeners[].stream": {
2890
+ schema: Type.String({ pattern: PLAY_SQL_LISTENER_ID_PATTERN.source }),
2891
+ fixtures: {
2892
+ valid: "company_job_openings",
2893
+ invalid: "1-company-job-openings",
2894
+ absent: void 0,
2895
+ unresolved: { expression: "stream" },
2896
+ edition1: "company_job_openings"
2897
+ },
2898
+ referenceType: "string",
2899
+ required: true,
2900
+ resolution: "static-required",
2901
+ issueCode: "sql_listener_binding_shape",
2902
+ description: "Static output stream key exposed by the monitor tool.",
2903
+ errorMessage: "bindings.sqlListeners[].stream must be a static stream identifier."
2904
+ },
2905
+ "bindings.sqlListeners[].operations[]": {
2906
+ schema: Type.Union([
2907
+ Type.Literal("INSERT"),
2908
+ Type.Literal("UPDATE"),
2909
+ Type.Literal("DELETE")
2910
+ ]),
2911
+ fixtures: {
2912
+ valid: "INSERT",
2913
+ invalid: "UPSERT",
2914
+ absent: void 0,
2915
+ unresolved: { expression: "operation" },
2916
+ edition1: "UPDATE"
2917
+ },
2918
+ referenceType: "'INSERT' | 'UPDATE' | 'DELETE'",
2919
+ required: false,
2920
+ resolution: "static-required",
2921
+ issueCode: "sql_listener_binding_shape",
2922
+ description: "Database operation that wakes the listener.",
2923
+ errorMessage: "bindings.sqlListeners[].operations entries must be INSERT, UPDATE, or DELETE."
2924
+ },
2925
+ "bindings.sqlListeners[].where.before": {
2926
+ schema: Type.Record(Type.String(), Type.Unknown()),
2927
+ fixtures: {
2928
+ valid: { status: { eq: "open" } },
2929
+ invalid: "status=open",
2930
+ absent: void 0,
2931
+ unresolved: "beforeFilter",
2932
+ edition1: { status: { eq: "open" } }
2933
+ },
2934
+ referenceType: "Record<string, SqlListenerFilterOperator>",
2935
+ required: false,
2936
+ resolution: "static-required",
2937
+ issueCode: "sql_listener_binding_shape",
2938
+ description: "Column filters evaluated against the row before mutation.",
2939
+ errorMessage: "bindings.sqlListeners[].where.before must be a static object keyed by column."
2940
+ },
2941
+ "bindings.sqlListeners[].where.after": {
2942
+ schema: Type.Record(Type.String(), Type.Unknown()),
2943
+ fixtures: {
2944
+ valid: { status: { eq: "open" } },
2945
+ invalid: "status=open",
2946
+ absent: void 0,
2947
+ unresolved: "afterFilter",
2948
+ edition1: { status: { eq: "open" } }
2949
+ },
2950
+ referenceType: "Record<string, SqlListenerFilterOperator>",
2951
+ required: false,
2952
+ resolution: "static-required",
2953
+ issueCode: "sql_listener_binding_shape",
2954
+ description: "Column filters evaluated against the row after mutation.",
2955
+ errorMessage: "bindings.sqlListeners[].where.after must be a static object keyed by column."
2956
+ },
2957
+ "bindings.sqlListeners[].where.*.*.eq": {
2958
+ schema: SqlListenerFilterScalarSchema,
2959
+ fixtures: {
2960
+ valid: "open",
2961
+ invalid: { nested: true },
2962
+ absent: void 0,
2963
+ unresolved: { expression: "equalsValue" },
2964
+ edition1: "open"
2965
+ },
2966
+ referenceType: "SqlListenerFilterScalar",
2967
+ required: false,
2968
+ resolution: "static-required",
2969
+ issueCode: "sql_listener_binding_shape",
2970
+ description: "Scalar equality condition.",
2971
+ errorMessage: "SQL listener eq must compare a scalar value."
2972
+ },
2973
+ "bindings.sqlListeners[].where.*.*.neq": {
2974
+ schema: SqlListenerFilterScalarSchema,
2975
+ fixtures: {
2976
+ valid: "closed",
2977
+ invalid: { nested: true },
2978
+ absent: void 0,
2979
+ unresolved: { expression: "notEqualsValue" },
2980
+ edition1: "closed"
2981
+ },
2982
+ referenceType: "SqlListenerFilterScalar",
2983
+ required: false,
2984
+ resolution: "static-required",
2985
+ issueCode: "sql_listener_binding_shape",
2986
+ description: "Scalar inequality condition.",
2987
+ errorMessage: "SQL listener neq must compare a scalar value."
2988
+ },
2989
+ "bindings.sqlListeners[].where.*.*.in": {
2990
+ schema: Type.Array(SqlListenerFilterScalarSchema, { minItems: 1 }),
2991
+ fixtures: {
2992
+ valid: ["open", "pending"],
2993
+ invalid: [],
2994
+ absent: void 0,
2995
+ unresolved: { expression: "acceptedValues" },
2996
+ edition1: ["open"]
2997
+ },
2998
+ referenceType: "readonly SqlListenerFilterScalar[]",
2999
+ required: false,
3000
+ resolution: "static-required",
3001
+ issueCode: "sql_listener_binding_shape",
3002
+ description: "Non-empty scalar membership condition.",
3003
+ errorMessage: "SQL listener in must contain at least one scalar value."
3004
+ },
3005
+ "bindings.sqlListeners[].where.*.*.notIn": {
3006
+ schema: Type.Array(SqlListenerFilterScalarSchema, { minItems: 1 }),
3007
+ fixtures: {
3008
+ valid: ["closed"],
3009
+ invalid: [],
3010
+ absent: void 0,
3011
+ unresolved: { expression: "rejectedValues" },
3012
+ edition1: ["closed"]
3013
+ },
3014
+ referenceType: "readonly SqlListenerFilterScalar[]",
3015
+ required: false,
3016
+ resolution: "static-required",
3017
+ issueCode: "sql_listener_binding_shape",
3018
+ description: "Non-empty scalar exclusion condition.",
3019
+ errorMessage: "SQL listener notIn must contain at least one scalar value."
3020
+ },
3021
+ "bindings.sqlListeners[].where.*.*.isNull": {
3022
+ schema: Type.Literal(true),
3023
+ fixtures: {
3024
+ valid: true,
3025
+ invalid: false,
3026
+ absent: void 0,
3027
+ unresolved: { expression: "isNull" },
3028
+ edition1: true
3029
+ },
3030
+ referenceType: "true",
3031
+ required: false,
3032
+ resolution: "static-required",
3033
+ issueCode: "sql_listener_binding_shape",
3034
+ description: "Matches null values when set to true.",
3035
+ errorMessage: "SQL listener isNull must be the static literal true."
3036
+ },
3037
+ "bindings.sqlListeners[].where.*.*.isNotNull": {
3038
+ schema: Type.Literal(true),
3039
+ fixtures: {
3040
+ valid: true,
3041
+ invalid: false,
3042
+ absent: void 0,
3043
+ unresolved: { expression: "isNotNull" },
3044
+ edition1: true
3045
+ },
3046
+ referenceType: "true",
3047
+ required: false,
3048
+ resolution: "static-required",
3049
+ issueCode: "sql_listener_binding_shape",
3050
+ description: "Matches non-null values when set to true.",
3051
+ errorMessage: "SQL listener isNotNull must be the static literal true."
3052
+ },
3053
+ "bindings.sqlListeners[].where.*.*.ilike": {
3054
+ schema: Type.String(),
3055
+ fixtures: {
3056
+ valid: "%software%",
3057
+ invalid: 1,
3058
+ absent: void 0,
3059
+ unresolved: { expression: "pattern" },
3060
+ edition1: "%software%"
3061
+ },
3062
+ referenceType: "string",
3063
+ required: false,
3064
+ resolution: "static-required",
3065
+ issueCode: "sql_listener_binding_shape",
3066
+ description: "Case-insensitive SQL pattern condition.",
3067
+ errorMessage: "SQL listener ilike must be a string pattern."
3068
+ },
3069
+ "bindings.secrets[]": {
3070
+ schema: SecretEnvironmentNameSchema,
3071
+ fixtures: {
3072
+ valid: "API_TOKEN",
3073
+ invalid: "api_token",
3074
+ absent: void 0,
3075
+ unresolved: { expression: "secret" },
3076
+ edition1: "API_TOKEN"
3077
+ },
3078
+ referenceType: "string",
3079
+ required: false,
3080
+ resolution: "static-required",
3081
+ issueCode: "play_authoring_secret_invalid",
3082
+ description: "Environment variable made available to the Play.",
3083
+ errorMessage: "bindings.secrets entries must be uppercase environment variable names beginning with a letter."
3084
+ },
3085
+ "ctx.tools.execute.staleAfterSeconds": {
3086
+ schema: Type.Union([Type.Null(), Type.Integer({ minimum: 0 })]),
3087
+ fixtures: {
3088
+ valid: 0,
3089
+ invalid: -1,
3090
+ absent: void 0,
3091
+ unresolved: { expression: "ttl" },
3092
+ edition1: null
3093
+ },
3094
+ referenceType: "number | null",
3095
+ required: false,
3096
+ resolution: "runtime-allowed",
3097
+ issueCode: "play_authoring_durable_policy_invalid",
3098
+ description: "`0` always executes; `null`/omitted never expires; a positive integer is a TTL in seconds.",
3099
+ errorMessage: "staleAfterSeconds must be null, 0 (always execute), or a positive whole number of seconds."
3100
+ },
3101
+ "ctx.tools.execute.id": {
3102
+ schema: Type.String({ pattern: "\\S" }),
3103
+ fixtures: {
3104
+ valid: "company-enrichment",
3105
+ invalid: "",
3106
+ absent: void 0,
3107
+ unresolved: { expression: "receiptId" },
3108
+ edition1: "company-enrichment"
3109
+ },
3110
+ referenceType: "string",
3111
+ required: true,
3112
+ resolution: "runtime-allowed",
3113
+ issueCode: "play_authoring_tool_request_invalid",
3114
+ description: "Stable durable receipt identity within one execution scope.",
3115
+ errorMessage: "ctx.tools.execute id must be a non-empty string."
3116
+ },
3117
+ "ctx.tools.execute.tool": {
3118
+ schema: Type.String({ pattern: "\\S" }),
3119
+ fixtures: {
3120
+ valid: "openmart_enrich_company",
3121
+ invalid: "",
3122
+ absent: void 0,
3123
+ unresolved: { expression: "toolId" },
3124
+ edition1: "openmart_enrich_company"
3125
+ },
3126
+ referenceType: "K",
3127
+ required: true,
3128
+ resolution: "runtime-allowed",
3129
+ issueCode: "play_authoring_tool_request_invalid",
3130
+ description: "Integration tool id resolved against the generated ToolMap.",
3131
+ errorMessage: "ctx.tools.execute tool must be a non-empty tool id."
3132
+ },
3133
+ "ctx.tools.execute.input": {
3134
+ schema: Type.Record(Type.String(), Type.Unknown()),
3135
+ fixtures: {
3136
+ valid: { domain: "example.com" },
3137
+ invalid: "example.com",
3138
+ absent: void 0,
3139
+ unresolved: "toolInput",
3140
+ edition1: {}
3141
+ },
3142
+ referenceType: "K extends keyof ToolMap ? ToolMap[K]['input'] : Record<string, unknown>",
3143
+ required: true,
3144
+ resolution: "runtime-allowed",
3145
+ issueCode: "play_authoring_tool_request_invalid",
3146
+ description: "Tool-specific input object.",
3147
+ errorMessage: "ctx.tools.execute input must be an object."
3148
+ },
3149
+ "ctx.tools.execute.description": {
3150
+ schema: Type.String(),
3151
+ fixtures: {
3152
+ valid: "Enrich the company.",
3153
+ invalid: 1,
3154
+ absent: void 0,
3155
+ unresolved: { expression: "description" },
3156
+ edition1: "Enrich the company."
3157
+ },
3158
+ referenceType: "string",
3159
+ required: false,
3160
+ resolution: "runtime-allowed",
3161
+ issueCode: "play_authoring_tool_request_invalid",
3162
+ description: "Human-readable purpose of the durable tool call.",
3163
+ errorMessage: "ctx.tools.execute description must be a string."
3164
+ },
3165
+ "ctx.tools.execute.force": {
3166
+ schema: Type.Boolean(),
3167
+ fixtures: {
3168
+ valid: true,
3169
+ invalid: "true",
3170
+ absent: void 0,
3171
+ unresolved: { expression: "force" },
3172
+ edition1: false
3173
+ },
3174
+ referenceType: "boolean",
3175
+ required: false,
3176
+ resolution: "runtime-allowed",
3177
+ issueCode: "play_authoring_tool_request_invalid",
3178
+ description: "Explicitly bypasses a completed durable tool receipt.",
3179
+ errorMessage: "ctx.tools.execute force must be a boolean."
3180
+ },
3181
+ "ctx.tools.execute.timeoutMs": {
3182
+ schema: Type.Integer({ minimum: 1 }),
3183
+ fixtures: {
3184
+ valid: 1,
3185
+ invalid: 0,
3186
+ absent: void 0,
3187
+ unresolved: { expression: "timeout" },
3188
+ edition1: 1
3189
+ },
3190
+ referenceType: "number",
3191
+ required: false,
3192
+ resolution: "runtime-allowed",
3193
+ issueCode: "play_authoring_durable_policy_invalid",
3194
+ description: "Positive whole-number runtime transport timeout in milliseconds.",
3195
+ errorMessage: "timeoutMs must be a positive whole number of milliseconds."
3196
+ },
3197
+ "ctx.tools.execute.receiptWaitMs": {
3198
+ schema: Type.Integer({ minimum: 1 }),
3199
+ fixtures: {
3200
+ valid: 1,
3201
+ invalid: 0,
3202
+ absent: void 0,
3203
+ unresolved: { expression: "receiptWait" },
3204
+ edition1: 1
3205
+ },
3206
+ referenceType: "number",
3207
+ required: false,
3208
+ resolution: "runtime-allowed",
3209
+ issueCode: "play_authoring_durable_policy_invalid",
3210
+ description: "Positive whole-number durable receipt wait budget in milliseconds.",
3211
+ errorMessage: "receiptWaitMs must be a positive whole number of milliseconds."
3212
+ },
3213
+ "ctx.csv.options.description": {
3214
+ schema: Type.String({ minLength: 1 }),
3215
+ fixtures: {
3216
+ valid: "Load account rows.",
3217
+ invalid: "",
3218
+ absent: void 0,
3219
+ unresolved: { expression: "description" },
3220
+ edition1: "Load rows."
3221
+ },
3222
+ referenceType: "string",
3223
+ required: false,
3224
+ resolution: "static-when-present",
3225
+ issueCode: "play_authoring_csv_option_invalid",
3226
+ description: "Non-empty description for a staged CSV load.",
3227
+ errorMessage: "ctx.csv options.description must be non-empty."
3228
+ },
3229
+ "ctx.csv.options.columns": {
3230
+ schema: Type.Record(
3231
+ Type.String(),
3232
+ Type.Union([
3233
+ Type.String({ minLength: 1 }),
3234
+ Type.Array(Type.String({ minLength: 1 }), { minItems: 1 })
3235
+ ])
3236
+ ),
3237
+ fixtures: {
3238
+ valid: { domain: ["domain", "Company Domain"] },
3239
+ invalid: { domain: [] },
3240
+ absent: void 0,
3241
+ unresolved: { expression: { dynamic: true } },
3242
+ edition1: { domain: "domain" }
3243
+ },
3244
+ referenceType: "CsvRenameMap",
3245
+ required: false,
3246
+ resolution: "runtime-allowed",
3247
+ issueCode: "play_authoring_csv_option_invalid",
3248
+ description: "Canonical field-to-header aliases for a staged CSV.",
3249
+ errorMessage: "ctx.csv options.columns values must be a non-empty header or alias list."
3250
+ },
3251
+ "ctx.csv.options.rename": {
3252
+ schema: Type.Record(
3253
+ Type.String(),
3254
+ Type.Union([
3255
+ Type.String({ minLength: 1 }),
3256
+ Type.Array(Type.String({ minLength: 1 }), { minItems: 1 })
3257
+ ])
3258
+ ),
3259
+ fixtures: {
3260
+ valid: { domain: "Company Domain" },
3261
+ invalid: { domain: "" },
3262
+ absent: void 0,
3263
+ unresolved: { expression: { dynamic: true } },
3264
+ edition1: { domain: "domain" }
3265
+ },
3266
+ referenceType: "CsvRenameMap",
3267
+ required: false,
3268
+ resolution: "static-when-present",
3269
+ issueCode: "play_authoring_csv_option_invalid",
3270
+ description: "Legacy header rename aliases for a staged CSV.",
3271
+ errorMessage: "ctx.csv options.rename values must be a non-empty header or alias list."
3272
+ },
3273
+ "ctx.csv.options.required": {
3274
+ schema: Type.Array(Type.String({ minLength: 1 })),
3275
+ fixtures: {
3276
+ valid: ["domain"],
3277
+ invalid: [""],
3278
+ absent: void 0,
3279
+ unresolved: { expression: "requiredColumns" },
3280
+ edition1: []
3281
+ },
3282
+ referenceType: "readonly string[]",
3283
+ required: false,
3284
+ resolution: "static-when-present",
3285
+ issueCode: "play_authoring_csv_option_invalid",
3286
+ description: "Canonical columns required after CSV normalization.",
3287
+ errorMessage: "ctx.csv options.required entries must be non-empty column names."
3288
+ },
3289
+ "ctx.dataset.key": {
3290
+ schema: Type.String({ minLength: 1 }),
3291
+ fixtures: {
3292
+ valid: "accounts",
3293
+ invalid: "",
3294
+ absent: void 0,
3295
+ unresolved: { expression: "datasetKey" },
3296
+ edition1: "rows"
3297
+ },
3298
+ referenceType: "string",
3299
+ required: true,
3300
+ resolution: "static-required",
3301
+ issueCode: "play_authoring_dataset_option_invalid",
3302
+ description: "Stable durable identity for one dataset.",
3303
+ errorMessage: "ctx.dataset key must be a non-empty static string."
3304
+ },
3305
+ "ctx.dataset.run.description": {
3306
+ schema: Type.String({ minLength: 1 }),
3307
+ fixtures: {
3308
+ valid: "Enrich account rows.",
3309
+ invalid: "",
3310
+ absent: void 0,
3311
+ unresolved: { expression: "description" },
3312
+ edition1: "Process rows."
3313
+ },
3314
+ referenceType: "string",
3315
+ required: false,
3316
+ resolution: "static-when-present",
3317
+ issueCode: "play_authoring_dataset_option_invalid",
3318
+ description: "Non-empty description for one dataset execution.",
3319
+ errorMessage: "ctx.dataset run description must be non-empty."
3320
+ },
3321
+ "ctx.dataset.run.key": {
3322
+ schema: Type.Union([
3323
+ Type.String({ minLength: 1 }),
3324
+ Type.Array(Type.String({ minLength: 1 }), { minItems: 1 }),
3325
+ Type.Function(
3326
+ [Type.Record(Type.String(), Type.Unknown()), Type.Integer()],
3327
+ Type.Union([
3328
+ Type.String(),
3329
+ Type.Number(),
3330
+ Type.Readonly(Type.Array(Type.Unknown()))
3331
+ ])
3332
+ )
3333
+ ]),
3334
+ fixtures: {
3335
+ valid: (row) => String(row.domain),
3336
+ invalid: [],
3337
+ absent: void 0,
3338
+ unresolved: { expression: "rowKey" },
3339
+ edition1: ["domain"]
3340
+ },
3341
+ referenceType: "DatasetRowKey<InputRow>",
3342
+ required: false,
3343
+ resolution: "runtime-dynamic",
3344
+ issueCode: "play_authoring_dataset_option_invalid",
3345
+ description: "Stable field or fields used for durable row identity.",
3346
+ errorMessage: "ctx.dataset run key must be a non-empty field, field list, or key function."
3347
+ },
3348
+ "ctx.dataset.run.onRowError": {
3349
+ schema: Type.Union([Type.Literal("isolate"), Type.Literal("fail")]),
3350
+ fixtures: {
3351
+ valid: "isolate",
3352
+ invalid: "continue",
3353
+ absent: void 0,
3354
+ unresolved: { expression: "rowErrorPolicy" },
3355
+ edition1: "fail"
3356
+ },
3357
+ referenceType: "'isolate' | 'fail'",
3358
+ required: false,
3359
+ resolution: "static-when-present",
3360
+ issueCode: "play_authoring_dataset_option_invalid",
3361
+ description: "Whether row failures isolate or fail the whole dataset.",
3362
+ errorMessage: 'ctx.dataset run onRowError must be "isolate" or "fail".'
3363
+ },
3364
+ "ctx.dataset.run.mode": {
3365
+ schema: Type.Union([Type.Literal("upsert"), Type.Literal("net_new")]),
3366
+ fixtures: {
3367
+ valid: "upsert",
3368
+ invalid: "append",
3369
+ absent: void 0,
3370
+ unresolved: { expression: "datasetMode" },
3371
+ edition1: "upsert"
3372
+ },
3373
+ referenceType: "'upsert' | 'net_new'",
3374
+ required: false,
3375
+ resolution: "static-when-present",
3376
+ issueCode: "play_authoring_dataset_option_invalid",
3377
+ description: "Whether the dataset returns all rows or only newly admitted rows.",
3378
+ errorMessage: 'ctx.dataset run mode must be "upsert" or "net_new".'
3379
+ },
3380
+ "ctx.step.id": {
3381
+ schema: Type.String({ minLength: 1 }),
3382
+ fixtures: {
3383
+ valid: "load-settings",
3384
+ invalid: "",
3385
+ absent: void 0,
3386
+ unresolved: { expression: "stepId" },
3387
+ edition1: "step"
3388
+ },
3389
+ referenceType: "string",
3390
+ required: true,
3391
+ resolution: "static-required",
3392
+ issueCode: "play_authoring_step_option_invalid",
3393
+ description: "Stable durable identity for one scalar checkpoint.",
3394
+ errorMessage: "ctx.step id must be a non-empty static string."
3395
+ },
3396
+ "ctx.step.semanticKey": {
3397
+ schema: Type.String({ minLength: 1 }),
3398
+ fixtures: {
3399
+ valid: "account:stripe.com",
3400
+ invalid: "",
3401
+ absent: void 0,
3402
+ unresolved: { expression: "semanticKey" },
3403
+ edition1: "account"
3404
+ },
3405
+ referenceType: "string",
3406
+ required: false,
3407
+ resolution: "runtime-dynamic",
3408
+ issueCode: "play_authoring_step_option_invalid",
3409
+ description: "Optional semantic receipt identity for a scalar checkpoint.",
3410
+ errorMessage: "ctx.step semanticKey must be a non-empty string."
3411
+ },
3412
+ "ctx.step.staleAfterSeconds": {
3413
+ schema: Type.Union([Type.Null(), Type.Integer({ minimum: 0 })]),
3414
+ fixtures: {
3415
+ valid: 0,
3416
+ invalid: -1,
3417
+ absent: void 0,
3418
+ unresolved: { expression: "ttl" },
3419
+ edition1: null
3420
+ },
3421
+ referenceType: "number | null",
3422
+ required: false,
3423
+ resolution: "runtime-dynamic",
3424
+ issueCode: "play_authoring_durable_policy_invalid",
3425
+ description: "Checkpoint freshness: null/omitted never expires, 0 always executes.",
3426
+ errorMessage: "staleAfterSeconds must be null, 0 (always execute), or a positive whole number of seconds."
3427
+ },
3428
+ "ctx.fetch.key": {
3429
+ schema: Type.String({ minLength: 1 }),
3430
+ fixtures: {
3431
+ valid: "notify-crm",
3432
+ invalid: "",
3433
+ absent: void 0,
3434
+ unresolved: { expression: "fetchKey" },
3435
+ edition1: "fetch"
3436
+ },
3437
+ referenceType: "string",
3438
+ required: true,
3439
+ resolution: "static-required",
3440
+ issueCode: "play_authoring_durable_policy_invalid",
3441
+ description: "Stable durable identity for one external HTTP request.",
3442
+ errorMessage: "ctx.fetch key must be a non-empty static string."
3443
+ },
3444
+ "ctx.fetch.staleAfterSeconds": {
3445
+ schema: Type.Union([Type.Null(), Type.Integer({ minimum: 0 })]),
3446
+ fixtures: {
3447
+ valid: null,
3448
+ invalid: 1.5,
3449
+ absent: void 0,
3450
+ unresolved: { expression: "ttl" },
3451
+ edition1: 0
3452
+ },
3453
+ referenceType: "number | null",
3454
+ required: false,
3455
+ resolution: "runtime-dynamic",
3456
+ issueCode: "play_authoring_durable_policy_invalid",
3457
+ description: "Fetch freshness: null/omitted never expires, 0 always executes.",
3458
+ errorMessage: "staleAfterSeconds must be null, 0 (always execute), or a positive whole number of seconds."
3459
+ },
3460
+ "ctx.runPlay.key": {
3461
+ schema: Type.String({ minLength: 1 }),
3462
+ fixtures: {
3463
+ valid: "enrich-company",
3464
+ invalid: "",
3465
+ absent: void 0,
3466
+ unresolved: { expression: "callKey" },
3467
+ edition1: "child"
3468
+ },
3469
+ referenceType: "string",
3470
+ required: true,
3471
+ resolution: "static-required",
3472
+ issueCode: "play_authoring_run_play_option_invalid",
3473
+ description: "Stable identity for one inline child Play call.",
3474
+ errorMessage: "ctx.runPlay key must be a non-empty static string."
3475
+ },
3476
+ "ctx.runPlay.playRef": {
3477
+ schema: Type.Union([
3478
+ Type.String({ minLength: 1 }),
3479
+ Type.Union([
3480
+ Type.Object(
3481
+ { playName: Type.String({ minLength: 1 }) },
3482
+ { additionalProperties: true }
3483
+ ),
3484
+ Type.Object(
3485
+ { name: Type.String({ minLength: 1 }) },
3486
+ { additionalProperties: true }
3487
+ )
3488
+ ])
3489
+ ]),
3490
+ fixtures: {
3491
+ valid: "prebuilt/company-lookup",
3492
+ invalid: {},
3493
+ absent: void 0,
3494
+ unresolved: { expression: "playRef" },
3495
+ edition1: { name: "company-lookup" }
3496
+ },
3497
+ referenceType: "string | PlayReferenceLike",
3498
+ required: true,
3499
+ resolution: "runtime-dynamic",
3500
+ issueCode: "play_authoring_run_play_option_invalid",
3501
+ description: "Child Play name or typed Play definition handle.",
3502
+ errorMessage: "ctx.runPlay playRef must be a non-empty Play name or definition handle."
3503
+ },
3504
+ "ctx.runPlay.input": {
3505
+ schema: Type.Record(Type.String(), Type.Unknown()),
3506
+ fixtures: {
3507
+ valid: { domain: "example.com" },
3508
+ invalid: "example.com",
3509
+ absent: void 0,
3510
+ unresolved: "childInput",
3511
+ edition1: {}
3512
+ },
3513
+ referenceType: "Record<string, unknown>",
3514
+ required: true,
3515
+ resolution: "runtime-dynamic",
3516
+ issueCode: "play_authoring_run_play_option_invalid",
3517
+ description: "Scalar input object submitted to the child Play.",
3518
+ errorMessage: "ctx.runPlay input must be an object."
3519
+ },
3520
+ "ctx.runPlay.options.description": {
3521
+ schema: Type.String({ minLength: 1 }),
3522
+ fixtures: {
3523
+ valid: "Enrich the company.",
3524
+ invalid: "",
3525
+ absent: void 0,
3526
+ unresolved: { expression: "description" },
3527
+ edition1: "Run child."
3528
+ },
3529
+ referenceType: "string",
3530
+ required: true,
3531
+ resolution: "runtime-dynamic",
3532
+ issueCode: "play_authoring_run_play_option_invalid",
3533
+ description: "Non-empty purpose for one inline child Play call.",
3534
+ errorMessage: "ctx.runPlay options.description must be non-empty."
3535
+ },
3536
+ "ctx.runPlay.options.execution": {
3537
+ schema: Type.Literal("inline"),
3538
+ fixtures: {
3539
+ valid: "inline",
3540
+ invalid: "child-workflow",
3541
+ absent: void 0,
3542
+ unresolved: { expression: "execution" },
3543
+ edition1: "inline"
3544
+ },
3545
+ referenceType: "'inline'",
3546
+ required: false,
3547
+ resolution: "static-required",
3548
+ issueCode: "play_authoring_run_play_option_invalid",
3549
+ description: "Child composition strategy. Only inline is supported.",
3550
+ errorMessage: 'ctx.runPlay execution must be "inline".'
3551
+ },
3552
+ "ctx.runPlay.options.timeoutMs": {
3553
+ schema: Type.Undefined(),
3554
+ fixtures: {
3555
+ valid: void 0,
3556
+ invalid: 1e3,
3557
+ absent: void 0,
3558
+ unresolved: { expression: "timeoutMs" },
3559
+ edition1: void 0
3560
+ },
3561
+ referenceType: "never",
3562
+ required: false,
3563
+ resolution: "unsupported",
3564
+ issueCode: "play_authoring_run_play_option_invalid",
3565
+ description: "Unsupported legacy child-workflow timeout.",
3566
+ errorMessage: "ctx.runPlay timeoutMs is unsupported because child Plays execute inline."
3567
+ },
3568
+ "runtime.timeout": {
3569
+ schema: Type.String({ pattern: "^\\d+\\s*[mh]$" }),
3570
+ fixtures: {
3571
+ valid: "90m",
3572
+ invalid: "90s",
3573
+ absent: void 0,
3574
+ unresolved: { expression: "timeout" },
3575
+ edition1: "90m"
3576
+ },
3577
+ referenceType: "string",
3578
+ required: false,
3579
+ resolution: "static-required",
3580
+ issueCode: "play_authoring_binding_invalid",
3581
+ description: "Sandbox deadline such as 90m or 2h.",
3582
+ errorMessage: 'runtime.timeout must be a static duration such as "90m" or "2h".'
3583
+ },
3584
+ "runtime.size": {
3585
+ schema: Type.Literal("standard"),
3586
+ fixtures: {
3587
+ valid: "standard",
3588
+ invalid: "large",
3589
+ absent: void 0,
3590
+ unresolved: { expression: "size" },
3591
+ edition1: "standard"
3592
+ },
3593
+ referenceType: "'standard'",
3594
+ required: false,
3595
+ resolution: "static-required",
3596
+ issueCode: "play_authoring_binding_invalid",
3597
+ description: "Deepline-managed sandbox size. Only standard is supported.",
3598
+ errorMessage: 'runtime.size must be the static literal "standard".'
3599
+ },
3600
+ "ctx.customerDb.query.statement": {
3601
+ schema: Type.Union([
3602
+ Type.String({ minLength: 1 }),
3603
+ Type.Object(
3604
+ {
3605
+ kind: Type.Optional(Type.Literal("sql.query")),
3606
+ text: Type.String({ minLength: 1 }),
3607
+ values: Type.Optional(Type.Array(Type.Unknown(), { maxItems: 0 }))
3608
+ },
3609
+ { additionalProperties: false }
3610
+ )
3611
+ ]),
3612
+ fixtures: {
3613
+ valid: { kind: "sql.query", text: "select 1", values: [] },
3614
+ invalid: { kind: "sql.query", text: "select $1", values: [1] },
3615
+ absent: void 0,
3616
+ unresolved: { expression: "statement" },
3617
+ edition1: "select 1"
3618
+ },
3619
+ referenceType: "SqlQuery",
3620
+ required: true,
3621
+ resolution: "runtime-dynamic",
3622
+ issueCode: "play_authoring_tool_request_invalid",
3623
+ description: "One non-empty Customer DB SQL string; the deprecated SqlQuery object is accepted only without parameter values.",
3624
+ errorMessage: "ctx.customerDb.query statement must be a non-empty SQL string. Deprecated SqlQuery objects cannot contain parameter values."
3625
+ },
3626
+ "ctx.customerDb.query.options.maxRows": {
3627
+ schema: Type.Integer({ minimum: 1 }),
3628
+ fixtures: {
3629
+ valid: 100,
3630
+ invalid: 0,
3631
+ absent: void 0,
3632
+ unresolved: { expression: "maxRows" },
3633
+ edition1: 100
3634
+ },
3635
+ referenceType: "number",
3636
+ required: false,
3637
+ resolution: "runtime-dynamic",
3638
+ issueCode: "play_authoring_tool_request_invalid",
3639
+ description: "Positive whole-number Customer DB response row limit.",
3640
+ errorMessage: "ctx.customerDb.query options.maxRows must be a positive whole number."
3641
+ },
3642
+ "ctx.customerDb.query.options.timeoutMs": {
3643
+ schema: Type.Integer({ minimum: 1 }),
3644
+ fixtures: {
3645
+ valid: 1e3,
3646
+ invalid: 0,
3647
+ absent: void 0,
3648
+ unresolved: { expression: "timeoutMs" },
3649
+ edition1: 1e3
3650
+ },
3651
+ referenceType: "number",
3652
+ required: false,
3653
+ resolution: "runtime-dynamic",
3654
+ issueCode: "play_authoring_durable_policy_invalid",
3655
+ description: "Positive whole-number Customer DB timeout in milliseconds.",
3656
+ errorMessage: "ctx.customerDb.query options.timeoutMs must be a positive whole number of milliseconds."
3657
+ },
3658
+ "ctx.tool.key": {
3659
+ schema: Type.String({ minLength: 1 }),
3660
+ fixtures: {
3661
+ valid: "company",
3662
+ invalid: "",
3663
+ absent: void 0,
3664
+ unresolved: { expression: "key" },
3665
+ edition1: "tool"
3666
+ },
3667
+ referenceType: "string",
3668
+ required: true,
3669
+ resolution: "runtime-dynamic",
3670
+ issueCode: "play_authoring_tool_request_invalid",
3671
+ description: "Stable receipt identity for the tool shorthand.",
3672
+ errorMessage: "ctx.tool key must be a non-empty string."
3673
+ },
3674
+ "ctx.tool.tool": {
3675
+ schema: Type.String({ minLength: 1 }),
3676
+ fixtures: {
3677
+ valid: "openmart_enrich_company",
3678
+ invalid: "",
3679
+ absent: void 0,
3680
+ unresolved: { expression: "tool" },
3681
+ edition1: "openmart_enrich_company"
3682
+ },
3683
+ referenceType: "string",
3684
+ required: true,
3685
+ resolution: "runtime-dynamic",
3686
+ issueCode: "play_authoring_tool_request_invalid",
3687
+ description: "Integration tool id for the tool shorthand.",
3688
+ errorMessage: "ctx.tool tool must be a non-empty tool id."
3689
+ },
3690
+ "ctx.tool.input": {
3691
+ schema: Type.Record(Type.String(), Type.Unknown()),
3692
+ fixtures: {
3693
+ valid: { domain: "example.com" },
3694
+ invalid: "example.com",
3695
+ absent: void 0,
3696
+ unresolved: "toolInput",
3697
+ edition1: {}
3698
+ },
3699
+ referenceType: "Record<string, unknown>",
3700
+ required: true,
3701
+ resolution: "runtime-dynamic",
3702
+ issueCode: "play_authoring_tool_request_invalid",
3703
+ description: "Tool-specific input object for the shorthand.",
3704
+ errorMessage: "ctx.tool input must be an object."
3705
+ },
3706
+ "ctx.tool.options.description": {
3707
+ schema: Type.String({ minLength: 1 }),
3708
+ fixtures: {
3709
+ valid: "Enrich the company.",
3710
+ invalid: "",
3711
+ absent: void 0,
3712
+ unresolved: { expression: "description" },
3713
+ edition1: "Run tool."
3714
+ },
3715
+ referenceType: "string",
3716
+ required: false,
3717
+ resolution: "runtime-dynamic",
3718
+ issueCode: "play_authoring_tool_request_invalid",
3719
+ description: "Non-empty purpose for the tool shorthand.",
3720
+ errorMessage: "ctx.tool options.description must be non-empty."
3721
+ },
3722
+ "ctx.runSteps.options.description": {
3723
+ schema: Type.String({ minLength: 1 }),
3724
+ fixtures: {
3725
+ valid: "Score the account.",
3726
+ invalid: "",
3727
+ absent: void 0,
3728
+ unresolved: { expression: "description" },
3729
+ edition1: "Run steps."
3730
+ },
3731
+ referenceType: "string",
3732
+ required: false,
3733
+ resolution: "runtime-dynamic",
3734
+ issueCode: "play_authoring_step_option_invalid",
3735
+ description: "Non-empty purpose for a reusable step program.",
3736
+ errorMessage: "ctx.runSteps options.description must be non-empty."
3737
+ },
3738
+ "ctx.sleep.ms": {
3739
+ schema: Type.Integer({ minimum: 0 }),
3740
+ fixtures: {
3741
+ valid: 0,
3742
+ invalid: -1,
3743
+ absent: void 0,
3744
+ unresolved: { expression: "delayMs" },
3745
+ edition1: 1e3
3746
+ },
3747
+ referenceType: "number",
3748
+ required: true,
3749
+ resolution: "runtime-dynamic",
3750
+ issueCode: "play_authoring_step_option_invalid",
3751
+ description: "Non-negative whole-number sleep duration in milliseconds.",
3752
+ errorMessage: "ctx.sleep ms must be a non-negative whole number."
3753
+ },
3754
+ "ctx.fetch.url": {
3755
+ schema: Type.String({ minLength: 1 }),
3756
+ fixtures: {
3757
+ valid: "https://example.com",
3758
+ invalid: "",
3759
+ absent: void 0,
3760
+ unresolved: { expression: "url" },
3761
+ edition1: "https://example.com"
3762
+ },
3763
+ referenceType: "string",
3764
+ required: true,
3765
+ resolution: "runtime-allowed",
3766
+ issueCode: "play_authoring_fetch_secret_requires_tls",
3767
+ description: "HTTP request URL. Secret authentication requires HTTPS.",
3768
+ errorMessage: "ctx.fetch URL must be a non-empty URL string."
3769
+ },
3770
+ "ctx.fetch.init.method": {
3771
+ schema: Type.String({ minLength: 1 }),
3772
+ fixtures: {
3773
+ valid: "GET",
3774
+ invalid: "",
3775
+ absent: void 0,
3776
+ unresolved: { expression: "method" },
3777
+ edition1: "GET"
3778
+ },
3779
+ referenceType: "string",
3780
+ required: false,
3781
+ resolution: "runtime-allowed",
3782
+ issueCode: "play_authoring_fetch_idempotency_required",
3783
+ description: "HTTP method. Mutating methods require an Idempotency-Key.",
3784
+ errorMessage: "ctx.fetch method must be a non-empty string."
3785
+ },
3786
+ "ctx.fetch.init.headers.Idempotency-Key": {
3787
+ schema: Type.String({ minLength: 1 }),
3788
+ fixtures: {
3789
+ valid: "contact-123-update",
3790
+ invalid: "",
3791
+ absent: void 0,
3792
+ unresolved: { expression: "idempotencyKey" },
3793
+ edition1: "contact-123-update"
3794
+ },
3795
+ referenceType: "string",
3796
+ required: false,
3797
+ resolution: "runtime-allowed",
3798
+ issueCode: "play_authoring_fetch_idempotency_required",
3799
+ description: "Required for mutating HTTP methods to make replay safe.",
3800
+ errorMessage: "Idempotency-Key must be a non-empty string when provided."
3801
+ }
3802
+ };
3803
+ function cloudReferenceType(path) {
3804
+ return PLAY_AUTHORING_FIELD_REGISTRY[path].referenceType;
3805
+ }
3806
+ var PLAY_AUTHORING_CLOUD_TYPE_DECLARATIONS = [
3807
+ `export type DurableCallStaleAfterSeconds = ${cloudReferenceType("ctx.tools.execute.staleAfterSeconds")};`,
3808
+ `export type PlayRuntimeTimeoutMs = ${cloudReferenceType("ctx.tools.execute.timeoutMs")};`,
3809
+ `export type PlayReceiptWaitMs = ${cloudReferenceType("ctx.tools.execute.receiptWaitMs")};`,
3810
+ `export type SqlListenerOperation = ${cloudReferenceType("bindings.sqlListeners[].operations[]")};`,
3811
+ "export type SqlListenerFilterScalar = string | number | boolean | null;",
3812
+ `export type SqlListenerFilterOperator = { eq?: ${cloudReferenceType("bindings.sqlListeners[].where.*.*.eq")}; neq?: ${cloudReferenceType("bindings.sqlListeners[].where.*.*.neq")}; in?: ${cloudReferenceType("bindings.sqlListeners[].where.*.*.in")}; notIn?: ${cloudReferenceType("bindings.sqlListeners[].where.*.*.notIn")}; isNull?: ${cloudReferenceType("bindings.sqlListeners[].where.*.*.isNull")}; isNotNull?: ${cloudReferenceType("bindings.sqlListeners[].where.*.*.isNotNull")}; ilike?: ${cloudReferenceType("bindings.sqlListeners[].where.*.*.ilike")} };`,
3813
+ `export type SqlListenerWhere = { before?: ${cloudReferenceType("bindings.sqlListeners[].where.before")}; after?: ${cloudReferenceType("bindings.sqlListeners[].where.after")} };`,
3814
+ `export type SqlListenerDeclaration = { id: ${cloudReferenceType("bindings.sqlListeners[].id")}; tool: ${cloudReferenceType("bindings.sqlListeners[].tool")}; stream: ${cloudReferenceType("bindings.sqlListeners[].stream")}; operations?: readonly SqlListenerOperation[]; where?: SqlListenerWhere };`,
3815
+ "export type SqlListenerEvent<T extends object = Record<string, unknown>> = { tool: string; stream: string; operation: SqlListenerOperation; before: T | null; after: T | null; changedAt: string; metadata: { outboxId: string; listenerId: string; table: string } };",
3816
+ "export type SqlQuery = string | { kind?: 'sql.query'; text: string; values?: readonly unknown[] };",
3817
+ "export type ToolExecutionRequest<K extends string> = {",
3818
+ ` readonly id: ${cloudReferenceType("ctx.tools.execute.id")};`,
3819
+ ` readonly tool: ${cloudReferenceType("ctx.tools.execute.tool")};`,
3820
+ ` readonly input: ${cloudReferenceType("ctx.tools.execute.input")};`,
3821
+ ` readonly description?: ${cloudReferenceType("ctx.tools.execute.description")};`,
3822
+ ` readonly force?: ${cloudReferenceType("ctx.tools.execute.force")};`,
3823
+ " readonly staleAfterSeconds?: DurableCallStaleAfterSeconds;",
3824
+ " readonly timeoutMs?: PlayRuntimeTimeoutMs;",
3825
+ " readonly receiptWaitMs?: PlayReceiptWaitMs;",
3826
+ "};",
3827
+ "export type PlayBindings = {",
3828
+ ` description?: ${cloudReferenceType("description")};`,
3829
+ ` compatibility?: { toolErrorSchemaVersion: ${cloudReferenceType("compatibility.toolErrorSchemaVersion")} };`,
3830
+ ` inline?: ${cloudReferenceType("inline")};`,
3831
+ ` billing?: { maxCreditsPerRun?: ${cloudReferenceType("billing.maxCreditsPerRun")} };`,
3832
+ ` runtime?: { timeout?: ${cloudReferenceType("runtime.timeout")}; size?: ${cloudReferenceType("runtime.size")} };`,
3833
+ ` webhook?: { hmac?: { algorithm?: ${cloudReferenceType("bindings.webhook.hmac.algorithm")}; header?: ${cloudReferenceType("bindings.webhook.hmac.header")}; secretEnv: ${cloudReferenceType("bindings.webhook.hmac.secretEnv")} } };`,
3834
+ ` cron?: { schedule: ${cloudReferenceType("bindings.cron.schedule")}; timezone?: ${cloudReferenceType("bindings.cron.timezone")} };`,
3835
+ " sqlListeners?: readonly SqlListenerDeclaration[];",
3836
+ ` secrets?: readonly ${cloudReferenceType("bindings.secrets[]")}[];`,
3837
+ "};",
3838
+ "declare const SECRET_HANDLE_BRAND: unique symbol;",
3839
+ "export type SecretHandle = { readonly [SECRET_HANDLE_BRAND]: never; readonly name: string; toString(): string; toJSON(): never };",
3840
+ "export type SecretAuth = { readonly kind: 'bearer' | 'header'; readonly secret: SecretHandle; readonly header?: string };",
3841
+ "export type PlayInputContract<TInput> = { readonly schema: Record<string, unknown>; readonly __inputType?: TInput };",
3842
+ "export type PlayReturnObject = Record<string, unknown> & { readonly _metadata?: never };",
3843
+ "export type CsvRenameMap = Record<string, string | readonly string[]>;",
3844
+ "export type FileInput<TMetadata = unknown> = string & { readonly __deeplineFileInputMetadata?: TMetadata };",
3845
+ "export type CsvInput<TRow extends object = Record<string, unknown>> = FileInput<{ readonly kind: 'csv'; readonly row: TRow }>;",
3846
+ "export type ColumnMap<TRow extends object> = { [K in keyof TRow & string]?: string | readonly string[] };",
3847
+ `export type CsvOptions = { description?: ${cloudReferenceType("ctx.csv.options.description")}; columns?: ${cloudReferenceType("ctx.csv.options.columns")}; rename?: ${cloudReferenceType("ctx.csv.options.rename")}; required?: ${cloudReferenceType("ctx.csv.options.required")} };`,
3848
+ "export type PlayCallExecution = 'inline';",
3849
+ `export type PlayCallOptions = { description: ${cloudReferenceType("ctx.runPlay.options.description")}; execution?: ${cloudReferenceType("ctx.runPlay.options.execution")}; timeoutMs?: ${cloudReferenceType("ctx.runPlay.options.timeoutMs")} };`,
3850
+ `export type RuntimeStepOptions = { semanticKey?: ${cloudReferenceType("ctx.step.semanticKey")}; staleAfterSeconds?: ${cloudReferenceType("ctx.step.staleAfterSeconds")} };`,
3851
+ `export type FetchOptions = { staleAfterSeconds?: ${cloudReferenceType("ctx.fetch.staleAfterSeconds")} };`,
3852
+ "export type PlayFetchResponse = { ok: boolean; status: number; statusText: string; url: string; headers: Record<string, string>; bodyText: string; json: unknown | null };",
3853
+ "export type StepResolver<Row, Value> = (row: Row, ctx: DeeplinePlayRuntimeContext, index: number, previousCell?: PreviousCell<Value>) => Value | Promise<Value>;",
3854
+ "export type DatasetColumnRunInput<Row, Value> = { readonly row: Row; readonly ctx: DeeplinePlayRuntimeContext; readonly index: number; readonly previousCell?: PreviousCell<Value> };",
3855
+ "export type DatasetColumnDefinition<Row, Value> = { readonly run: (input: DatasetColumnRunInput<Row, Value>) => Value | Promise<Value>; readonly runIf?: (row: Row, index: number) => boolean | Promise<boolean> };",
3856
+ "export type ConditionalStepResolver<Row, Value, Else = null> = { readonly kind: 'conditional'; readonly when: (row: Row, index: number) => boolean | Promise<boolean>; readonly run: StepResolver<Row, Value>; readonly elseValue: Else; else<ValueElse>(value: ValueElse): ConditionalStepResolver<Row, Value, ValueElse>; };",
3857
+ "export type StepOptions<Row, Value = unknown> = { readonly runIf?: (row: Row, index: number) => boolean | Promise<boolean>; readonly recompute?: boolean; readonly recomputeOnError?: boolean; readonly staleAfterSeconds?: number };",
3858
+ "export type StepProgram<Input, Output, Return = Output> = { readonly kind: 'steps'; readonly steps: readonly PlayStepProgramStep[]; readonly returnResolver?: StepResolver<Output, Return>; readonly __inputType?: (input: Input) => void; step<Name extends string, Value>(name: Name, resolver: StepResolver<Output, Value> | ConditionalStepResolver<Output, Value> | StepProgramResolver<Output, Value>): StepProgram<Input, Output & Record<Name, Value>, Return>; step<Name extends string, Value>(name: Name, resolver: StepResolver<Output, Value> | StepProgramResolver<Output, Value>, options: StepOptions<Output, Value>): StepProgram<Input, Output & Record<Name, Value | null>, Return>; return<Value>(resolver: StepResolver<Output, Value>): StepProgram<Input, Output, Value>; };",
3859
+ "export type StepProgramResolver<Input, Return> = { readonly kind: 'steps'; readonly steps: readonly PlayStepProgramStep[]; readonly returnResolver?: StepResolver<never, Return>; readonly __inputType?: (input: Input) => void };",
3860
+ "export type RunnableStepProgram<Input, Return> = Pick<StepProgram<Input, never, Return>, 'kind' | 'steps' | 'returnResolver' | '__inputType'>;",
3861
+ "export type RunnableColumnStepProgram<Return> = Pick<StepProgramResolver<unknown, Return>, 'kind' | 'steps' | 'returnResolver'>;",
3862
+ "export type PlayStepProgramStep = { readonly name: string; readonly recompute?: boolean; readonly recomputeOnError?: boolean; readonly staleAfterSeconds?: number; readonly resolver: StepResolver<Record<string, unknown>, unknown> | ConditionalStepResolver<Record<string, unknown>, unknown> | StepProgramResolver<Record<string, unknown>, unknown> };",
3863
+ "export type ColumnResolver<Row, Value> = StepResolver<Row, Value> | ConditionalStepResolver<Row, Value> | RunnableColumnStepProgram<Value>;",
3864
+ "export type StepProgramOutput<TProgram> = TProgram extends StepProgram<unknown, infer Output, unknown> ? Output : never;",
3865
+ "export type DatasetRowKey<InputRow extends object> = (keyof InputRow & string) | readonly (keyof InputRow & string)[] | ((row: InputRow, index: number) => string | number | readonly unknown[]);",
3866
+ "export type DatasetDefinitionOptions<InputRow extends object> = { key?: DatasetRowKey<InputRow> };",
3867
+ `export type DatasetRunOptions<InputRow extends object> = { description?: ${cloudReferenceType("ctx.dataset.run.description")}; key?: DatasetRowKey<InputRow>; onRowError?: ${cloudReferenceType("ctx.dataset.run.onRowError")}; mode?: ${cloudReferenceType("ctx.dataset.run.mode")} };`,
3868
+ "export type DatasetBuilder<InputRow extends object, OutputRow extends object> = {",
3869
+ " withColumn<Name extends string, Value>(name: Name, resolver: ColumnResolver<OutputRow, Value>): DatasetBuilder<InputRow, OutputRow & Record<Name, Value>>;",
3870
+ " withColumn<Name extends string, Value>(name: Name, definition: DatasetColumnDefinition<OutputRow, Value> & { readonly runIf: (row: OutputRow, index: number) => boolean | Promise<boolean> }): DatasetBuilder<InputRow, OutputRow & Record<Name, Value | null>>;",
3871
+ " withColumn<Name extends string, Value>(name: Name, definition: DatasetColumnDefinition<OutputRow, Value>): DatasetBuilder<InputRow, OutputRow & Record<Name, Value>>;",
3872
+ " withColumn<Name extends string, Value>(name: Name, resolver: StepResolver<OutputRow, Value> | RunnableColumnStepProgram<Value>, options: StepOptions<OutputRow, Value>): DatasetBuilder<InputRow, OutputRow & Record<Name, Value | null>>;",
3873
+ " withColumns<Program extends StepProgram<OutputRow, object, unknown>>(program: Program): DatasetBuilder<InputRow, StepProgramOutput<Program>>;",
3874
+ " step<Name extends string, Value>(name: Name, resolver: ColumnResolver<OutputRow, Value>): never;",
3875
+ " run(options?: DatasetRunOptions<InputRow>): Promise<PlayDataset<OutputRow>>;",
3876
+ "};",
3877
+ "export type PlayReferenceLike = { readonly playName: string; readonly name?: string } | { readonly name: string; readonly playName?: string };",
3878
+ "export interface DeeplinePlayRuntimeContext {",
3879
+ " csv<T = Record<string, unknown>>(path: string | CsvInput<T & object>, options?: CsvOptions): Promise<PlayDataset<T>>;",
3880
+ " dataset<TSource extends PlayDatasetInput<object>>(key: string, items: TSource): DatasetBuilder<PlayDatasetRow<TSource> & object, PlayDatasetRow<TSource> & object>;",
3881
+ " map<TSource extends PlayDatasetInput<object>>(key: string, items: TSource, options?: DatasetDefinitionOptions<PlayDatasetRow<TSource> & object>): never;",
3882
+ ` runSteps<TInput extends Record<string, unknown>, TOutput>(program: RunnableStepProgram<TInput, TOutput>, input: TInput, options?: { description?: ${cloudReferenceType("ctx.runSteps.options.description")} }): Promise<TOutput>;`,
3883
+ " tools: { execute<K extends string>(request: ToolExecutionRequest<K>): Promise<ToolExecutionOutput<K>> };",
3884
+ ` customerDb: { query<TRow extends Record<string, unknown> = Record<string, unknown>>(statement: SqlQuery, options?: { maxRows?: ${cloudReferenceType("ctx.customerDb.query.options.maxRows")}; timeoutMs?: ${cloudReferenceType("ctx.customerDb.query.options.timeoutMs")} }): Promise<TRow[]> };`,
3885
+ ` tool<K extends string>(key: ${cloudReferenceType("ctx.tool.key")}, toolId: K, input: ${cloudReferenceType("ctx.tool.input")}, options?: { description?: ${cloudReferenceType("ctx.tool.options.description")} }): Promise<ToolExecutionOutput<K>>;`,
3886
+ " step<T>(id: string, run: () => T | Promise<T>, options?: RuntimeStepOptions): Promise<T>;",
3887
+ " fetch(key: string, url: string | URL, init?: RequestInit & { headers?: HeadersInit & { 'Idempotency-Key'?: string; 'X-Idempotency-Key'?: string }; auth?: SecretAuth }, options?: FetchOptions): Promise<PlayFetchResponse>;",
3888
+ " secrets: { get(name: string): SecretHandle; bearer(secret: SecretHandle): SecretAuth; header(header: string, secret: SecretHandle): SecretAuth };",
3889
+ ` runPlay<TOutput = unknown>(key: string, playRef: ${cloudReferenceType("ctx.runPlay.playRef")}, input: ${cloudReferenceType("ctx.runPlay.input")}, options: PlayCallOptions): Promise<TOutput>;`,
3890
+ " log(message: string): void;",
3891
+ ` sleep(ms: ${cloudReferenceType("ctx.sleep.ms")}): Promise<void>;`,
3892
+ "}",
3893
+ "export type DefinePlayConfig<TInput, TOutput extends PlayReturnObject> = { id: string; description?: string; input: PlayInputContract<TInput>; run: (ctx: DeeplinePlayRuntimeContext, input: TInput) => Promise<TOutput>; bindings?: PlayBindings; billing?: PlayBindings['billing']; runtime?: PlayBindings['runtime']; compatibility?: PlayBindings['compatibility'] };",
3894
+ "export type DefinedPlay<TInput, TOutput extends PlayReturnObject> = ((ctx: DeeplinePlayRuntimeContext, input: TInput) => Promise<TOutput>) & { readonly name: string; readonly __inputType?: TInput; readonly __outputType?: TOutput; readonly runtime?: PlayBindings['runtime']; readonly compatibility?: PlayBindings['compatibility'] };"
3895
+ ];
3896
+
58
3897
  // ../shared_libs/plays/contracts.ts
59
3898
  var PLAY_PUBLIC_API_VERSION = 1;
60
3899
  var PLAY_ARTIFACT_VERSION = CURRENT_PLAY_ARTIFACT_CONTRACT_VERSION;
@@ -72,7 +3911,8 @@ function buildPlayContractCompatibility(input) {
72
3911
  minRunnerVersion: PLAY_MIN_RUNNER_VERSION,
73
3912
  runtimeFeatures: [...PLAY_RUNTIME_FEATURES],
74
3913
  runtimeBackend: input?.runtimeBackend ?? null,
75
- toolErrorSchemaVersion: input?.toolErrorSchemaVersion ?? TOOL_EXECUTION_ERROR_SCHEMA_VERSION
3914
+ toolErrorSchemaVersion: input?.toolErrorSchemaVersion ?? TOOL_EXECUTION_ERROR_SCHEMA_VERSION,
3915
+ authoringContractEdition: input?.authoringContractEdition ?? PLAY_AUTHORING_CONTRACT_EDITION
76
3916
  };
77
3917
  }
78
3918
 
@@ -146,7 +3986,7 @@ function validatePlaySourceFilesHaveNoInlineSecrets(sourceFiles) {
146
3986
  var MAX_PLAY_BUNDLE_BYTES = 30 * 1024 * 1024;
147
3987
 
148
3988
  // ../shared_libs/plays/bundling/index.ts
149
- var PLAY_BUNDLE_CACHE_VERSION = 27;
3989
+ var PLAY_BUNDLE_CACHE_VERSION = 28;
150
3990
  var PLAY_ARTIFACT_CACHE_DIR = join(
151
3991
  tmpdir(),
152
3992
  `deepline-play-artifacts-v${PLAY_BUNDLE_CACHE_VERSION}`
@@ -1252,7 +5092,8 @@ async function bundlePlayFile(filePath, options) {
1252
5092
  );
1253
5093
  analysis.graphHash = sha256(
1254
5094
  `${analysis.graphHash}
1255
- entry-export:${exportName}`
5095
+ entry-export:${exportName}
5096
+ authoring-contract-edition:${PLAY_AUTHORING_CONTRACT_EDITION}`
1256
5097
  );
1257
5098
  try {
1258
5099
  validatePlaySourceFilesHaveNoInlineSecrets(analysis.sourceFiles);