@akagilnc/pi-workflow-roles 0.1.4620 → 0.1.4631
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.zh-CN.md +1 -1
- package/dist/acp-host/production-host.js +231 -218
- package/dist/activation-ledger-topology.js +0 -4
- package/dist/headless-host/production-host.js +215 -202
- package/dist/pi/role-turn-host.js +0 -3
- package/dist/public-cli/auto-resume.js +26 -0
- package/dist/public-cli/main.js +1054 -780
- package/dist/public-cli/post-admission.js +101 -7
- package/dist/public-cli/process-cancel.js +57 -0
- package/package.json +1 -1
- package/scripts/build-package.mjs +0 -1
- package/src/activation-ledger-topology.ts +1 -6
- package/src/activation-ledger.ts +5 -236
- package/src/analyst-entry.ts +19 -2
- package/src/analyst-ledger.ts +111 -6
- package/src/archivist-record-entry.ts +1 -1
- package/src/pi/role-turn-host.ts +0 -3
- package/src/public-cli/auto-resume.ts +34 -0
- package/src/public-cli/cli.ts +30 -0
- package/src/public-cli/main.ts +25 -3
- package/src/public-cli/post-admission.ts +173 -6
- package/src/public-cli/process-cancel.ts +75 -0
- package/src/role-runtime.ts +4 -51
- package/dist/activation-reconciliation.js +0 -61
- package/src/activation-reconciliation.ts +0 -163
package/dist/public-cli/main.js
CHANGED
|
@@ -101,7 +101,6 @@ var activation_ledger_topology_exports = {};
|
|
|
101
101
|
__export(activation_ledger_topology_exports, {
|
|
102
102
|
ActivationLedgerError: () => ActivationLedgerError,
|
|
103
103
|
activationBookDirectory: () => activationBookDirectory,
|
|
104
|
-
activationWaitingLedgerPath: () => activationWaitingLedgerPath,
|
|
105
104
|
assertLedgerFileInsideHome: () => assertLedgerFileInsideHome,
|
|
106
105
|
ensureRealDirectoryTree: () => ensureRealDirectoryTree,
|
|
107
106
|
errnoCode: () => errnoCode,
|
|
@@ -164,9 +163,6 @@ function resolveActivationLedgerHomeForPath(path) {
|
|
|
164
163
|
function activationBookDirectory(ledgerHome, bookKey) {
|
|
165
164
|
return join2(ledgerHome, "books", bookKey);
|
|
166
165
|
}
|
|
167
|
-
function activationWaitingLedgerPath(ledgerHome, bookKey) {
|
|
168
|
-
return join2(activationBookDirectory(ledgerHome, bookKey), "waiting.jsonl");
|
|
169
|
-
}
|
|
170
166
|
function pathContainedIn(root, candidate) {
|
|
171
167
|
const rel = relative(root, candidate);
|
|
172
168
|
return rel !== "" && rel !== ".." && !rel.startsWith(`..${sep}`) && !isAbsolute2(rel);
|
|
@@ -870,10 +866,10 @@ function IsBoolean(value) {
|
|
|
870
866
|
function IsConstructor(value) {
|
|
871
867
|
if (IsUndefined(value) || !IsFunction(value))
|
|
872
868
|
return false;
|
|
873
|
-
const
|
|
874
|
-
if (/^class\s/.test(
|
|
869
|
+
const result = Function.prototype.toString.call(value);
|
|
870
|
+
if (/^class\s/.test(result))
|
|
875
871
|
return true;
|
|
876
|
-
if (/\[native code\]/.test(
|
|
872
|
+
if (/\[native code\]/.test(result))
|
|
877
873
|
return true;
|
|
878
874
|
return false;
|
|
879
875
|
}
|
|
@@ -959,12 +955,12 @@ function Every(value, offset, callback) {
|
|
|
959
955
|
return true;
|
|
960
956
|
}
|
|
961
957
|
function EveryAll(value, offset, callback) {
|
|
962
|
-
let
|
|
958
|
+
let result = true;
|
|
963
959
|
for (let index = offset; index < value.length; index++) {
|
|
964
960
|
if (!callback(value[index], index))
|
|
965
|
-
|
|
961
|
+
result = false;
|
|
966
962
|
}
|
|
967
|
-
return
|
|
963
|
+
return result;
|
|
968
964
|
}
|
|
969
965
|
function Some(value, callback) {
|
|
970
966
|
for (let index = 0; index < value.length; index++) {
|
|
@@ -974,15 +970,15 @@ function Some(value, callback) {
|
|
|
974
970
|
return false;
|
|
975
971
|
}
|
|
976
972
|
function SomeAll(value, callback) {
|
|
977
|
-
let
|
|
973
|
+
let result = false;
|
|
978
974
|
for (let index = 0; index < value.length; index++) {
|
|
979
975
|
if (callback(value[index], index))
|
|
980
|
-
|
|
976
|
+
result = true;
|
|
981
977
|
}
|
|
982
|
-
return
|
|
978
|
+
return result;
|
|
983
979
|
}
|
|
984
980
|
function Counted(value, callback) {
|
|
985
|
-
return value.reduce((
|
|
981
|
+
return value.reduce((result, value2, index) => callback(value2, index) ? ++result : result, 0);
|
|
986
982
|
}
|
|
987
983
|
function ShiftLeft(array, true_, false_) {
|
|
988
984
|
return IsEqual(array.length, 0) ? false_() : true_(array[0], array.slice(1));
|
|
@@ -1146,29 +1142,29 @@ function IsTypeObject(value) {
|
|
|
1146
1142
|
return guard_exports.HasPropertyKey(value, "~kind") || guard_exports.HasPropertyKey(value, "~unsafe");
|
|
1147
1143
|
}
|
|
1148
1144
|
function FromTypeObject(value) {
|
|
1149
|
-
const
|
|
1145
|
+
const result = {};
|
|
1150
1146
|
const descriptors = Object.getOwnPropertyDescriptors(value);
|
|
1151
1147
|
for (const key of Object.keys(descriptors)) {
|
|
1152
1148
|
if (guard_exports.IsUnsafePropertyKey(key))
|
|
1153
1149
|
continue;
|
|
1154
1150
|
const descriptor = descriptors[key];
|
|
1155
1151
|
if (guard_exports.HasPropertyKey(descriptor, "value")) {
|
|
1156
|
-
Object.defineProperty(
|
|
1152
|
+
Object.defineProperty(result, key, { ...descriptor, value: FromValue(descriptor.value) });
|
|
1157
1153
|
}
|
|
1158
1154
|
}
|
|
1159
|
-
return
|
|
1155
|
+
return result;
|
|
1160
1156
|
}
|
|
1161
1157
|
function FromPlainObject(value) {
|
|
1162
|
-
const
|
|
1158
|
+
const result = {};
|
|
1163
1159
|
for (const key of guard_exports.Keys(value)) {
|
|
1164
1160
|
if (guard_exports.IsUnsafePropertyKey(key))
|
|
1165
1161
|
continue;
|
|
1166
|
-
|
|
1162
|
+
result[key] = FromValue(value[key]);
|
|
1167
1163
|
}
|
|
1168
1164
|
for (const key of guard_exports.Symbols(value)) {
|
|
1169
|
-
|
|
1165
|
+
result[key] = FromValue(value[key]);
|
|
1170
1166
|
}
|
|
1171
|
-
return
|
|
1167
|
+
return result;
|
|
1172
1168
|
}
|
|
1173
1169
|
function FromObject(value) {
|
|
1174
1170
|
return guard_exports.IsClassInstance(value) ? FromClassInstance(value) : IsTypeObject(value) ? FromTypeObject(value) : FromPlainObject(value);
|
|
@@ -1284,15 +1280,15 @@ var init_create = __esm({
|
|
|
1284
1280
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/system/memory/discard.mjs
|
|
1285
1281
|
function Discard(value, propertyKeys) {
|
|
1286
1282
|
Metrics.discard += 1;
|
|
1287
|
-
const
|
|
1283
|
+
const result = {};
|
|
1288
1284
|
const descriptors = Object.getOwnPropertyDescriptors(Clone(value));
|
|
1289
1285
|
const keysToDiscard = new Set(propertyKeys);
|
|
1290
1286
|
for (const key of Object.keys(descriptors)) {
|
|
1291
1287
|
if (keysToDiscard.has(key))
|
|
1292
1288
|
continue;
|
|
1293
|
-
Object.defineProperty(
|
|
1289
|
+
Object.defineProperty(result, key, descriptors[key]);
|
|
1294
1290
|
}
|
|
1295
|
-
return
|
|
1291
|
+
return result;
|
|
1296
1292
|
}
|
|
1297
1293
|
var init_discard = __esm({
|
|
1298
1294
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/system/memory/discard.mjs"() {
|
|
@@ -1305,9 +1301,9 @@ var init_discard = __esm({
|
|
|
1305
1301
|
function Update(current, hidden, enumerable) {
|
|
1306
1302
|
Metrics.update += 1;
|
|
1307
1303
|
const settings2 = settings_exports.Get();
|
|
1308
|
-
const
|
|
1304
|
+
const result = Clone(current);
|
|
1309
1305
|
for (const key of Object.keys(hidden)) {
|
|
1310
|
-
Object.defineProperty(
|
|
1306
|
+
Object.defineProperty(result, key, {
|
|
1311
1307
|
configurable: true,
|
|
1312
1308
|
writable: true,
|
|
1313
1309
|
enumerable: settings2.enumerableKind,
|
|
@@ -1315,14 +1311,14 @@ function Update(current, hidden, enumerable) {
|
|
|
1315
1311
|
});
|
|
1316
1312
|
}
|
|
1317
1313
|
for (const key of Object.keys(enumerable)) {
|
|
1318
|
-
Object.defineProperty(
|
|
1314
|
+
Object.defineProperty(result, key, {
|
|
1319
1315
|
configurable: true,
|
|
1320
1316
|
enumerable: true,
|
|
1321
1317
|
writable: true,
|
|
1322
1318
|
value: enumerable[key]
|
|
1323
1319
|
});
|
|
1324
1320
|
}
|
|
1325
|
-
return
|
|
1321
|
+
return result;
|
|
1326
1322
|
}
|
|
1327
1323
|
var init_update = __esm({
|
|
1328
1324
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/system/memory/update.mjs"() {
|
|
@@ -1392,8 +1388,8 @@ function AddReadonlyOperation(type) {
|
|
|
1392
1388
|
return memory_exports.Update(type, { "~readonly": true }, {});
|
|
1393
1389
|
}
|
|
1394
1390
|
function AddReadonlyAction(type, options) {
|
|
1395
|
-
const
|
|
1396
|
-
return
|
|
1391
|
+
const result = memory_exports.Update(AddReadonlyOperation(type), {}, options);
|
|
1392
|
+
return result;
|
|
1397
1393
|
}
|
|
1398
1394
|
function AddReadonlyInstantiate(context, state, type, options) {
|
|
1399
1395
|
const instantiatedType = InstantiateType(context, state, type);
|
|
@@ -1411,8 +1407,8 @@ function AddOptionalOperation(type) {
|
|
|
1411
1407
|
return memory_exports.Update(type, { "~optional": true }, {});
|
|
1412
1408
|
}
|
|
1413
1409
|
function AddOptionalAction(type, options) {
|
|
1414
|
-
const
|
|
1415
|
-
return
|
|
1410
|
+
const result = memory_exports.Update(AddOptionalOperation(type), {}, options);
|
|
1411
|
+
return result;
|
|
1416
1412
|
}
|
|
1417
1413
|
function AddOptionalInstantiate(context, state, type, options) {
|
|
1418
1414
|
const instantiatedType = InstantiateType(context, state, type);
|
|
@@ -1616,8 +1612,8 @@ var init_unknown = __esm({
|
|
|
1616
1612
|
|
|
1617
1613
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/types/cyclic.mjs
|
|
1618
1614
|
function Cyclic($defs, $ref, options) {
|
|
1619
|
-
const defs = guard_exports.Keys($defs).reduce((
|
|
1620
|
-
return { ...
|
|
1615
|
+
const defs = guard_exports.Keys($defs).reduce((result, key) => {
|
|
1616
|
+
return { ...result, [key]: memory_exports.Update($defs[key], {}, { $id: key }) };
|
|
1621
1617
|
}, {});
|
|
1622
1618
|
return memory_exports.Create({ ["~kind"]: "Cyclic" }, { $defs: defs, $ref }, options);
|
|
1623
1619
|
}
|
|
@@ -1711,7 +1707,7 @@ function IsTypeScriptEnumLike(value) {
|
|
|
1711
1707
|
}
|
|
1712
1708
|
function TypeScriptEnumToEnumValues(type) {
|
|
1713
1709
|
const keys = guard_exports.Keys(type).filter((key) => isNaN(key));
|
|
1714
|
-
return keys.reduce((
|
|
1710
|
+
return keys.reduce((result, key) => [...result, type[key]], []);
|
|
1715
1711
|
}
|
|
1716
1712
|
var init_typescript_enum_to_enum_values = __esm({
|
|
1717
1713
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/enum/typescript_enum_to_enum_values.mjs"() {
|
|
@@ -2656,8 +2652,8 @@ var init_union = __esm({
|
|
|
2656
2652
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/patterns/pattern.mjs
|
|
2657
2653
|
function ParsePatternIntoTypes(pattern) {
|
|
2658
2654
|
const parsed = Pattern(pattern);
|
|
2659
|
-
const
|
|
2660
|
-
return
|
|
2655
|
+
const result = guard_exports.IsEqual(parsed.length, 2) ? parsed[0] : [];
|
|
2656
|
+
return result;
|
|
2661
2657
|
}
|
|
2662
2658
|
var init_pattern = __esm({
|
|
2663
2659
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/patterns/pattern.mjs"() {
|
|
@@ -2674,15 +2670,15 @@ function FromTypesReduce(types) {
|
|
|
2674
2670
|
return guard_exports.ShiftLeft(types, (left, right) => FromType(left) ? FromTypesReduce(right) : false, () => true);
|
|
2675
2671
|
}
|
|
2676
2672
|
function FromTypes(types) {
|
|
2677
|
-
const
|
|
2678
|
-
return
|
|
2673
|
+
const result = guard_exports.IsEqual(types.length, 0) ? false : FromTypesReduce(types);
|
|
2674
|
+
return result;
|
|
2679
2675
|
}
|
|
2680
2676
|
function FromType(type) {
|
|
2681
2677
|
return IsUnion(type) ? FromTypes(type.anyOf) : IsLiteral(type) ? FromLiteral(type.const) : false;
|
|
2682
2678
|
}
|
|
2683
2679
|
function IsTemplateLiteralFinite(types) {
|
|
2684
|
-
const
|
|
2685
|
-
return
|
|
2680
|
+
const result = FromTypes(types);
|
|
2681
|
+
return result;
|
|
2686
2682
|
}
|
|
2687
2683
|
var init_is_finite = __esm({
|
|
2688
2684
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs"() {
|
|
@@ -2703,18 +2699,18 @@ var init_create2 = __esm({
|
|
|
2703
2699
|
});
|
|
2704
2700
|
|
|
2705
2701
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/template_literal/decode.mjs
|
|
2706
|
-
function FromLiteralPush(variants, value,
|
|
2707
|
-
return guard_exports.ShiftLeft(variants, (left, right) => FromLiteralPush(right, value, [...
|
|
2702
|
+
function FromLiteralPush(variants, value, result = []) {
|
|
2703
|
+
return guard_exports.ShiftLeft(variants, (left, right) => FromLiteralPush(right, value, [...result, `${left}${value}`]), () => result);
|
|
2708
2704
|
}
|
|
2709
2705
|
function FromLiteral2(variants, value) {
|
|
2710
2706
|
return guard_exports.IsEqual(variants.length, 0) ? [`${value}`] : FromLiteralPush(variants, value);
|
|
2711
2707
|
}
|
|
2712
|
-
function FromUnion(variants, types,
|
|
2713
|
-
return guard_exports.ShiftLeft(types, (left, right) => FromUnion(variants, right, [...
|
|
2708
|
+
function FromUnion(variants, types, result = []) {
|
|
2709
|
+
return guard_exports.ShiftLeft(types, (left, right) => FromUnion(variants, right, [...result, ...FromType2(variants, left)]), () => result);
|
|
2714
2710
|
}
|
|
2715
2711
|
function FromType2(variants, type) {
|
|
2716
|
-
const
|
|
2717
|
-
return
|
|
2712
|
+
const result = IsUnion(type) ? FromUnion(variants, type.anyOf) : IsLiteral(type) ? FromLiteral2(variants, type.const) : Unreachable();
|
|
2713
|
+
return result;
|
|
2718
2714
|
}
|
|
2719
2715
|
function DecodeFromSpan(variants, types) {
|
|
2720
2716
|
return guard_exports.ShiftLeft(types, (left, right) => DecodeFromSpan(FromType2(variants, left), right), () => variants);
|
|
@@ -2725,8 +2721,8 @@ function VariantsToLiterals(variants) {
|
|
|
2725
2721
|
function DecodeTypesAsUnion(types) {
|
|
2726
2722
|
const variants = DecodeFromSpan([], types);
|
|
2727
2723
|
const literals = VariantsToLiterals(variants);
|
|
2728
|
-
const
|
|
2729
|
-
return
|
|
2724
|
+
const result = Union(literals);
|
|
2725
|
+
return result;
|
|
2730
2726
|
}
|
|
2731
2727
|
function DecodeTypes(types) {
|
|
2732
2728
|
return guard_exports.IsEqual(types.length, 0) ? Unreachable() : (
|
|
@@ -2736,13 +2732,13 @@ function DecodeTypes(types) {
|
|
|
2736
2732
|
}
|
|
2737
2733
|
function TemplateLiteralDecodeUnsafe(pattern) {
|
|
2738
2734
|
const types = ParsePatternIntoTypes(pattern);
|
|
2739
|
-
const
|
|
2740
|
-
return
|
|
2735
|
+
const result = guard_exports.IsEqual(types.length, 0) ? String2() : IsTemplateLiteralFinite(types) ? DecodeTypes(types) : TemplateLiteralCreate(pattern);
|
|
2736
|
+
return result;
|
|
2741
2737
|
}
|
|
2742
2738
|
function TemplateLiteralDecode(pattern) {
|
|
2743
2739
|
const decoded = TemplateLiteralDecodeUnsafe(pattern);
|
|
2744
|
-
const
|
|
2745
|
-
return
|
|
2740
|
+
const result = IsTemplateLiteral(decoded) ? String2() : decoded;
|
|
2741
|
+
return result;
|
|
2746
2742
|
}
|
|
2747
2743
|
var init_decode = __esm({
|
|
2748
2744
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/template_literal/decode.mjs"() {
|
|
@@ -2814,8 +2810,8 @@ function RemoveReadonlyOperation(type) {
|
|
|
2814
2810
|
return memory_exports.Discard(type, ["~readonly"]);
|
|
2815
2811
|
}
|
|
2816
2812
|
function RemoveReadonlyAction(type, options) {
|
|
2817
|
-
const
|
|
2818
|
-
return
|
|
2813
|
+
const result = memory_exports.Update(RemoveReadonlyOperation(type), {}, options);
|
|
2814
|
+
return result;
|
|
2819
2815
|
}
|
|
2820
2816
|
function RemoveReadonlyInstantiate(context, state, type, options) {
|
|
2821
2817
|
const instantiatedType = InstantiateType(context, state, type);
|
|
@@ -2847,8 +2843,8 @@ function RemoveOptionalOperation(type) {
|
|
|
2847
2843
|
return memory_exports.Discard(type, ["~optional"]);
|
|
2848
2844
|
}
|
|
2849
2845
|
function RemoveOptionalAction(type, options) {
|
|
2850
|
-
const
|
|
2851
|
-
return
|
|
2846
|
+
const result = memory_exports.Update(RemoveOptionalOperation(type), {}, options);
|
|
2847
|
+
return result;
|
|
2852
2848
|
}
|
|
2853
2849
|
function RemoveOptionalInstantiate(context, state, type, options) {
|
|
2854
2850
|
const instantiatedType = InstantiateType(context, state, type);
|
|
@@ -2877,15 +2873,15 @@ var init_remove_optional = __esm({
|
|
|
2877
2873
|
|
|
2878
2874
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/tuple/to_object.mjs
|
|
2879
2875
|
function TupleElementsToProperties(types) {
|
|
2880
|
-
const
|
|
2881
|
-
return { [index]: right, ...
|
|
2876
|
+
const result = types.reduceRight((result2, right, index) => {
|
|
2877
|
+
return { [index]: right, ...result2 };
|
|
2882
2878
|
}, {});
|
|
2883
|
-
return
|
|
2879
|
+
return result;
|
|
2884
2880
|
}
|
|
2885
2881
|
function TupleToObject(type) {
|
|
2886
2882
|
const properties = TupleElementsToProperties(type.items);
|
|
2887
|
-
const
|
|
2888
|
-
return
|
|
2883
|
+
const result = _Object_(properties);
|
|
2884
|
+
return result;
|
|
2889
2885
|
}
|
|
2890
2886
|
var init_to_object = __esm({
|
|
2891
2887
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/tuple/to_object.mjs"() {
|
|
@@ -2912,13 +2908,13 @@ function CompositePropertyKey(left, right, key) {
|
|
|
2912
2908
|
}
|
|
2913
2909
|
function CompositeProperties(left, right) {
|
|
2914
2910
|
const keys = /* @__PURE__ */ new Set([...guard_exports.Keys(right), ...guard_exports.Keys(left)]);
|
|
2915
|
-
return [...keys].reduce((
|
|
2916
|
-
return { ...
|
|
2911
|
+
return [...keys].reduce((result, key) => {
|
|
2912
|
+
return { ...result, [key]: CompositePropertyKey(left, right, key) };
|
|
2917
2913
|
}, {});
|
|
2918
2914
|
}
|
|
2919
2915
|
function GetProperties(type) {
|
|
2920
|
-
const
|
|
2921
|
-
return
|
|
2916
|
+
const result = IsObject2(type) ? type.properties : IsTuple(type) ? TupleElementsToProperties(type.items) : Unreachable();
|
|
2917
|
+
return result;
|
|
2922
2918
|
}
|
|
2923
2919
|
function Composite(left, right) {
|
|
2924
2920
|
const leftProperties = GetProperties(left);
|
|
@@ -2946,8 +2942,8 @@ var init_composite = __esm({
|
|
|
2946
2942
|
|
|
2947
2943
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/evaluate/narrow.mjs
|
|
2948
2944
|
function Narrow(left, right) {
|
|
2949
|
-
const
|
|
2950
|
-
return guard_exports.IsEqual(
|
|
2945
|
+
const result = Compare(left, right);
|
|
2946
|
+
return guard_exports.IsEqual(result, ResultLeftInside) ? left : guard_exports.IsEqual(result, ResultRightInside) ? right : guard_exports.IsEqual(result, ResultEqual) ? right : Never();
|
|
2951
2947
|
}
|
|
2952
2948
|
var init_narrow = __esm({
|
|
2953
2949
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/evaluate/narrow.mjs"() {
|
|
@@ -2964,8 +2960,8 @@ function IsObjectLike(type) {
|
|
|
2964
2960
|
function IsUnionOperand(left, right) {
|
|
2965
2961
|
const isUnionLeft = IsUnion(left);
|
|
2966
2962
|
const isUnionRight = IsUnion(right);
|
|
2967
|
-
const
|
|
2968
|
-
return
|
|
2963
|
+
const result = isUnionLeft || isUnionRight;
|
|
2964
|
+
return result;
|
|
2969
2965
|
}
|
|
2970
2966
|
function DistributeOperation(left, right) {
|
|
2971
2967
|
const evaluatedLeft = EvaluateType(left);
|
|
@@ -2973,17 +2969,17 @@ function DistributeOperation(left, right) {
|
|
|
2973
2969
|
const isUnionOperand = IsUnionOperand(evaluatedLeft, evaluatedRight);
|
|
2974
2970
|
const isObjectLeft = IsObjectLike(evaluatedLeft);
|
|
2975
2971
|
const IsObjectRight = IsObjectLike(evaluatedRight);
|
|
2976
|
-
const
|
|
2977
|
-
return
|
|
2972
|
+
const result = isUnionOperand ? EvaluateIntersect([evaluatedLeft, evaluatedRight]) : isObjectLeft && IsObjectRight ? Composite(evaluatedLeft, evaluatedRight) : isObjectLeft && !IsObjectRight ? evaluatedLeft : !isObjectLeft && IsObjectRight ? evaluatedRight : Narrow(evaluatedLeft, evaluatedRight);
|
|
2973
|
+
return result;
|
|
2978
2974
|
}
|
|
2979
|
-
function DistributeType(type, types,
|
|
2980
|
-
return guard_exports.ShiftLeft(types, (left, right) => DistributeType(type, right, [...
|
|
2975
|
+
function DistributeType(type, types, result = []) {
|
|
2976
|
+
return guard_exports.ShiftLeft(types, (left, right) => DistributeType(type, right, [...result, DistributeOperation(type, left)]), () => guard_exports.IsEqual(result.length, 0) ? [type] : result);
|
|
2981
2977
|
}
|
|
2982
|
-
function DistributeUnion(types, distribution,
|
|
2983
|
-
return guard_exports.ShiftLeft(types, (left, right) => DistributeUnion(right, distribution, [...
|
|
2978
|
+
function DistributeUnion(types, distribution, result = []) {
|
|
2979
|
+
return guard_exports.ShiftLeft(types, (left, right) => DistributeUnion(right, distribution, [...result, ...Distribute([left], distribution)]), () => result);
|
|
2984
2980
|
}
|
|
2985
|
-
function Distribute(types,
|
|
2986
|
-
return guard_exports.ShiftLeft(types, (left, right) => IsUnion(left) ? Distribute(right, DistributeUnion(left.anyOf,
|
|
2981
|
+
function Distribute(types, result = []) {
|
|
2982
|
+
return guard_exports.ShiftLeft(types, (left, right) => IsUnion(left) ? Distribute(right, DistributeUnion(left.anyOf, result)) : Distribute(right, DistributeType(left, result)), () => result);
|
|
2987
2983
|
}
|
|
2988
2984
|
var init_distribute = __esm({
|
|
2989
2985
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/evaluate/distribute.mjs"() {
|
|
@@ -3001,20 +2997,20 @@ var init_distribute = __esm({
|
|
|
3001
2997
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/exclude/operation.mjs
|
|
3002
2998
|
function ExcludeType(left, right) {
|
|
3003
2999
|
const check = Extends({}, left, right);
|
|
3004
|
-
const
|
|
3005
|
-
return
|
|
3000
|
+
const result = result_exports.IsExtendsTrueLike(check) ? [] : [left];
|
|
3001
|
+
return result;
|
|
3006
3002
|
}
|
|
3007
3003
|
function ExcludeUnion(types, right) {
|
|
3008
|
-
return types.reduce((
|
|
3009
|
-
return [...
|
|
3004
|
+
return types.reduce((result, head) => {
|
|
3005
|
+
return [...result, ...ExcludeType(head, right)];
|
|
3010
3006
|
}, []);
|
|
3011
3007
|
}
|
|
3012
3008
|
function ExcludeOperation(left, right) {
|
|
3013
3009
|
const evaluated = EvaluateType(left);
|
|
3014
3010
|
const canonical = IsUnion(evaluated) ? evaluated.anyOf : [evaluated];
|
|
3015
3011
|
const remaining = ExcludeUnion(canonical, right);
|
|
3016
|
-
const
|
|
3017
|
-
return
|
|
3012
|
+
const result = EvaluateUnion(remaining);
|
|
3013
|
+
return result;
|
|
3018
3014
|
}
|
|
3019
3015
|
var init_operation = __esm({
|
|
3020
3016
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/exclude/operation.mjs"() {
|
|
@@ -3029,35 +3025,35 @@ var init_operation = __esm({
|
|
|
3029
3025
|
function EvaluateDependent(if_, then_, else_) {
|
|
3030
3026
|
const intersect = Intersect([if_, then_]);
|
|
3031
3027
|
const excluded = ExcludeOperation(else_, if_);
|
|
3032
|
-
const
|
|
3033
|
-
return
|
|
3028
|
+
const result = EvaluateUnion([intersect, excluded]);
|
|
3029
|
+
return result;
|
|
3034
3030
|
}
|
|
3035
3031
|
function EvaluateEnum(values) {
|
|
3036
|
-
const
|
|
3037
|
-
return EvaluateUnion(
|
|
3032
|
+
const result = values.map((value) => Literal(value));
|
|
3033
|
+
return EvaluateUnion(result);
|
|
3038
3034
|
}
|
|
3039
3035
|
function EvaluateIntersect(types) {
|
|
3040
3036
|
const distribution = Distribute(types);
|
|
3041
3037
|
const broadend = Broaden(distribution);
|
|
3042
|
-
const
|
|
3043
|
-
return
|
|
3038
|
+
const result = EvaluateUnionFast(broadend);
|
|
3039
|
+
return result;
|
|
3044
3040
|
}
|
|
3045
3041
|
function EvaluateTemplateLiteral(pattern) {
|
|
3046
3042
|
const evaluated = TemplateLiteralDecode(pattern);
|
|
3047
|
-
const
|
|
3048
|
-
return
|
|
3043
|
+
const result = EvaluateType(evaluated);
|
|
3044
|
+
return result;
|
|
3049
3045
|
}
|
|
3050
3046
|
function EvaluateUnion(types) {
|
|
3051
3047
|
const broadend = Broaden(types);
|
|
3052
|
-
const
|
|
3053
|
-
return
|
|
3048
|
+
const result = EvaluateUnionFast(broadend);
|
|
3049
|
+
return result;
|
|
3054
3050
|
}
|
|
3055
3051
|
function EvaluateType(type) {
|
|
3056
3052
|
return IsDependent(type) ? EvaluateDependent(type.if, type.then, type.else) : IsEnum(type) ? EvaluateEnum(type.enum) : IsIntersect(type) ? EvaluateIntersect(type.allOf) : IsTemplateLiteral(type) ? EvaluateTemplateLiteral(type.pattern) : IsUnion(type) ? EvaluateUnion(type.anyOf) : type;
|
|
3057
3053
|
}
|
|
3058
3054
|
function EvaluateUnionFast(types) {
|
|
3059
|
-
const
|
|
3060
|
-
return
|
|
3055
|
+
const result = guard_exports.IsEqual(types.length, 1) ? types[0] : guard_exports.IsEqual(types.length, 0) ? Never() : Union(types);
|
|
3056
|
+
return result;
|
|
3061
3057
|
}
|
|
3062
3058
|
var init_evaluate2 = __esm({
|
|
3063
3059
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs"() {
|
|
@@ -3079,8 +3075,8 @@ var init_evaluate2 = __esm({
|
|
|
3079
3075
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/record/from_key_enum.mjs
|
|
3080
3076
|
function FromEnumKey(values, value) {
|
|
3081
3077
|
const unionKey = EvaluateEnum(values);
|
|
3082
|
-
const
|
|
3083
|
-
return
|
|
3078
|
+
const result = FromKey(unionKey, value);
|
|
3079
|
+
return result;
|
|
3084
3080
|
}
|
|
3085
3081
|
var init_from_key_enum = __esm({
|
|
3086
3082
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/record/from_key_enum.mjs"() {
|
|
@@ -3091,8 +3087,8 @@ var init_from_key_enum = __esm({
|
|
|
3091
3087
|
|
|
3092
3088
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/record/from_key_integer.mjs
|
|
3093
3089
|
function FromIntegerKey(_key, value) {
|
|
3094
|
-
const
|
|
3095
|
-
return
|
|
3090
|
+
const result = CreateRecord(IntegerKey, value);
|
|
3091
|
+
return result;
|
|
3096
3092
|
}
|
|
3097
3093
|
var init_from_key_integer = __esm({
|
|
3098
3094
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/record/from_key_integer.mjs"() {
|
|
@@ -3104,8 +3100,8 @@ var init_from_key_integer = __esm({
|
|
|
3104
3100
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/record/from_key_intersect.mjs
|
|
3105
3101
|
function FromIntersectKey(types, value) {
|
|
3106
3102
|
const evaluatedKey = EvaluateIntersect(types);
|
|
3107
|
-
const
|
|
3108
|
-
return
|
|
3103
|
+
const result = FromKey(evaluatedKey, value);
|
|
3104
|
+
return result;
|
|
3109
3105
|
}
|
|
3110
3106
|
var init_from_key_intersect = __esm({
|
|
3111
3107
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/record/from_key_intersect.mjs"() {
|
|
@@ -3127,8 +3123,8 @@ var init_from_key_literal = __esm({
|
|
|
3127
3123
|
|
|
3128
3124
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/record/from_key_number.mjs
|
|
3129
3125
|
function FromNumberKey(_key, value) {
|
|
3130
|
-
const
|
|
3131
|
-
return
|
|
3126
|
+
const result = CreateRecord(NumberKey, value);
|
|
3127
|
+
return result;
|
|
3132
3128
|
}
|
|
3133
3129
|
var init_from_key_number = __esm({
|
|
3134
3130
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/record/from_key_number.mjs"() {
|
|
@@ -3153,8 +3149,8 @@ var init_from_key_string = __esm({
|
|
|
3153
3149
|
function FromTemplateKey(pattern, value) {
|
|
3154
3150
|
const types = ParsePatternIntoTypes(pattern);
|
|
3155
3151
|
const finite = IsTemplateLiteralFinite(types);
|
|
3156
|
-
const
|
|
3157
|
-
return
|
|
3152
|
+
const result = finite ? FromKey(EvaluateTemplateLiteral(pattern), value) : CreateRecord(pattern, value);
|
|
3153
|
+
return result;
|
|
3158
3154
|
}
|
|
3159
3155
|
var init_from_key_template_literal = __esm({
|
|
3160
3156
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs"() {
|
|
@@ -3168,12 +3164,12 @@ var init_from_key_template_literal = __esm({
|
|
|
3168
3164
|
|
|
3169
3165
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/evaluate/flatten.mjs
|
|
3170
3166
|
function FlattenType(type) {
|
|
3171
|
-
const
|
|
3172
|
-
return
|
|
3167
|
+
const result = IsUnion(type) ? Flatten(type.anyOf) : [type];
|
|
3168
|
+
return result;
|
|
3173
3169
|
}
|
|
3174
3170
|
function Flatten(types) {
|
|
3175
|
-
return types.reduce((
|
|
3176
|
-
return [...
|
|
3171
|
+
return types.reduce((result, type) => {
|
|
3172
|
+
return [...result, ...FlattenType(type)];
|
|
3177
3173
|
}, []);
|
|
3178
3174
|
}
|
|
3179
3175
|
var init_flatten = __esm({
|
|
@@ -3190,14 +3186,14 @@ function TryBuildRecord(types, value) {
|
|
|
3190
3186
|
return guard_exports.IsEqual(StringOrNumberCheck(types), true) ? CreateRecord(StringKey, value) : void 0;
|
|
3191
3187
|
}
|
|
3192
3188
|
function CreateProperties(types, value) {
|
|
3193
|
-
return types.reduce((
|
|
3194
|
-
return IsLiteral(left) && (guard_exports.IsString(left.const) || guard_exports.IsNumber(left.const)) ? { ...
|
|
3189
|
+
return types.reduce((result, left) => {
|
|
3190
|
+
return IsLiteral(left) && (guard_exports.IsString(left.const) || guard_exports.IsNumber(left.const)) ? { ...result, [left.const]: value } : result;
|
|
3195
3191
|
}, {});
|
|
3196
3192
|
}
|
|
3197
3193
|
function CreateObject(types, value) {
|
|
3198
3194
|
const properties = CreateProperties(types, value);
|
|
3199
|
-
const
|
|
3200
|
-
return
|
|
3195
|
+
const result = _Object_(properties);
|
|
3196
|
+
return result;
|
|
3201
3197
|
}
|
|
3202
3198
|
function FromUnionKey(types, value) {
|
|
3203
3199
|
const flattened = Flatten(types);
|
|
@@ -3221,8 +3217,8 @@ var init_from_key_union = __esm({
|
|
|
3221
3217
|
|
|
3222
3218
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/record/from_key.mjs
|
|
3223
3219
|
function FromKey(key, value) {
|
|
3224
|
-
const
|
|
3225
|
-
return
|
|
3220
|
+
const result = IsAny(key) ? FromAnyKey(value) : IsBoolean3(key) ? FromBooleanKey(value) : IsEnum(key) ? FromEnumKey(key.enum, value) : IsInteger2(key) ? FromIntegerKey(key, value) : IsIntersect(key) ? FromIntersectKey(key.allOf, value) : IsLiteral(key) ? FromLiteralKey(key.const, value) : IsNumber3(key) ? FromNumberKey(key, value) : IsUnion(key) ? FromUnionKey(key.anyOf, value) : IsString3(key) ? FromStringKey(key, value) : IsTemplateLiteral(key) ? FromTemplateKey(key.pattern, value) : _Object_({});
|
|
3221
|
+
return result;
|
|
3226
3222
|
}
|
|
3227
3223
|
var init_from_key = __esm({
|
|
3228
3224
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/record/from_key.mjs"() {
|
|
@@ -3252,8 +3248,8 @@ var init_from_key = __esm({
|
|
|
3252
3248
|
|
|
3253
3249
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/record/instantiate.mjs
|
|
3254
3250
|
function RecordAction(key, value, options) {
|
|
3255
|
-
const
|
|
3256
|
-
return
|
|
3251
|
+
const result = CanInstantiate([key]) ? memory_exports.Update(FromKey(key, value), {}, options) : RecordDeferred(key, value, options);
|
|
3252
|
+
return result;
|
|
3257
3253
|
}
|
|
3258
3254
|
function RecordInstantiate(context, state, key, value, options) {
|
|
3259
3255
|
const instantiatedKey = InstantiateType(context, state, key);
|
|
@@ -3280,16 +3276,16 @@ function RecordFromPattern(pattern, value) {
|
|
|
3280
3276
|
return CreateRecord(pattern, value);
|
|
3281
3277
|
}
|
|
3282
3278
|
function RecordPatternToType(pattern) {
|
|
3283
|
-
const
|
|
3284
|
-
return
|
|
3279
|
+
const result = guard_exports.IsEqual(pattern, StringKey) ? String2() : guard_exports.IsEqual(pattern, IntegerKey) ? Integer() : guard_exports.IsEqual(pattern, NumberKey) ? Number2() : TemplateLiteralDecodeUnsafe(pattern);
|
|
3280
|
+
return result;
|
|
3285
3281
|
}
|
|
3286
3282
|
function RecordPattern(type) {
|
|
3287
3283
|
return guard_exports.Keys(type.patternProperties)[0];
|
|
3288
3284
|
}
|
|
3289
3285
|
function RecordKey(type) {
|
|
3290
3286
|
const pattern = RecordPattern(type);
|
|
3291
|
-
const
|
|
3292
|
-
return
|
|
3287
|
+
const result = RecordPatternToType(pattern);
|
|
3288
|
+
return result;
|
|
3293
3289
|
}
|
|
3294
3290
|
function RecordValue(type) {
|
|
3295
3291
|
return type.patternProperties[RecordPattern(type)];
|
|
@@ -3545,8 +3541,8 @@ function KeyOfMapping(input) {
|
|
|
3545
3541
|
return input.length > 0;
|
|
3546
3542
|
}
|
|
3547
3543
|
function IndexArrayMapping(input) {
|
|
3548
|
-
return input.reduce((
|
|
3549
|
-
return guard_exports.IsEqual(current.length, 3) ? [...
|
|
3544
|
+
return input.reduce((result, current) => {
|
|
3545
|
+
return guard_exports.IsEqual(current.length, 3) ? [...result, [current[1]]] : [...result, []];
|
|
3550
3546
|
}, []);
|
|
3551
3547
|
}
|
|
3552
3548
|
function ExtendsMapping(input) {
|
|
@@ -3559,9 +3555,9 @@ function WithMapping(input) {
|
|
|
3559
3555
|
return guard_exports.IsEqual(input.length, 2) ? input[1] : [];
|
|
3560
3556
|
}
|
|
3561
3557
|
function FactorIndexArray(Type2, indexArray) {
|
|
3562
|
-
return indexArray.reduce((
|
|
3558
|
+
return indexArray.reduce((result, left) => {
|
|
3563
3559
|
const _left = left;
|
|
3564
|
-
return guard_exports.IsEqual(_left.length, 1) ? IndexDeferred(
|
|
3560
|
+
return guard_exports.IsEqual(_left.length, 1) ? IndexDeferred(result, _left[0]) : guard_exports.IsEqual(_left.length, 0) ? _Array_(result) : Unreachable2();
|
|
3565
3561
|
}, Type2);
|
|
3566
3562
|
}
|
|
3567
3563
|
function FactorExtends(type, extend) {
|
|
@@ -3650,9 +3646,9 @@ function PropertyListMapping(input) {
|
|
|
3650
3646
|
return Delimited(input);
|
|
3651
3647
|
}
|
|
3652
3648
|
function PropertiesReduce(propertyList) {
|
|
3653
|
-
return propertyList.reduce((
|
|
3649
|
+
return propertyList.reduce((result, left) => {
|
|
3654
3650
|
const isPatternProperties = guard_exports.HasPropertyKey(left, IntegerKey) || guard_exports.HasPropertyKey(left, NumberKey) || guard_exports.HasPropertyKey(left, StringKey);
|
|
3655
|
-
return isPatternProperties ? [
|
|
3651
|
+
return isPatternProperties ? [result[0], memory_exports.Assign(result[1], left)] : [memory_exports.Assign(result[0], left), result[1]];
|
|
3656
3652
|
}, [{}, {}]);
|
|
3657
3653
|
}
|
|
3658
3654
|
function PropertiesMapping(input) {
|
|
@@ -3760,8 +3756,8 @@ function WithPropertyListMapping(input) {
|
|
|
3760
3756
|
return Delimited(input);
|
|
3761
3757
|
}
|
|
3762
3758
|
function WithObjectMappingReduce(propertyList) {
|
|
3763
|
-
return propertyList.reduce((
|
|
3764
|
-
return memory_exports.Assign(
|
|
3759
|
+
return propertyList.reduce((result, left) => {
|
|
3760
|
+
return memory_exports.Assign(result, left);
|
|
3765
3761
|
}, {});
|
|
3766
3762
|
}
|
|
3767
3763
|
function WithObjectMapping(input) {
|
|
@@ -3864,9 +3860,9 @@ var init_mapping = __esm({
|
|
|
3864
3860
|
init_guard2();
|
|
3865
3861
|
init_types();
|
|
3866
3862
|
init_action();
|
|
3867
|
-
DelimitedDecode = (input,
|
|
3868
|
-
return input.reduce((
|
|
3869
|
-
return guard_exports.IsArray(left) && guard_exports.IsEqual(left.length, 2) ? [...
|
|
3863
|
+
DelimitedDecode = (input, result = []) => {
|
|
3864
|
+
return input.reduce((result2, left) => {
|
|
3865
|
+
return guard_exports.IsArray(left) && guard_exports.IsEqual(left.length, 2) ? [...result2, left[0]] : [...result2, left];
|
|
3870
3866
|
}, []);
|
|
3871
3867
|
};
|
|
3872
3868
|
Delimited = (input) => {
|
|
@@ -3902,9 +3898,9 @@ function TakeVariant(variant, input) {
|
|
|
3902
3898
|
}
|
|
3903
3899
|
function Take(variants, input) {
|
|
3904
3900
|
for (let i = 0; i < variants.length; i++) {
|
|
3905
|
-
const
|
|
3906
|
-
if (IsMatch(
|
|
3907
|
-
return
|
|
3901
|
+
const result = TakeVariant(variants[i], input);
|
|
3902
|
+
if (IsMatch(result))
|
|
3903
|
+
return result;
|
|
3908
3904
|
}
|
|
3909
3905
|
return [];
|
|
3910
3906
|
}
|
|
@@ -3943,13 +3939,13 @@ var init_char = __esm({
|
|
|
3943
3939
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/script/token/internal/trim.mjs
|
|
3944
3940
|
function DiscardMultilineComment(input) {
|
|
3945
3941
|
const index = input.indexOf(CloseComment);
|
|
3946
|
-
const
|
|
3947
|
-
return
|
|
3942
|
+
const result = IsEqual(index, -1) ? "" : input.slice(index + 2);
|
|
3943
|
+
return result;
|
|
3948
3944
|
}
|
|
3949
3945
|
function DiscardLineComment(input) {
|
|
3950
3946
|
const index = input.indexOf(NewLine);
|
|
3951
|
-
const
|
|
3952
|
-
return
|
|
3947
|
+
const result = IsEqual(index, -1) ? "" : input.slice(index);
|
|
3948
|
+
return result;
|
|
3953
3949
|
}
|
|
3954
3950
|
function TrimStartUntilNewline(input) {
|
|
3955
3951
|
return input.replace(/^[ \t\r\f\v]+/, "");
|
|
@@ -3988,8 +3984,8 @@ var init_optional2 = __esm({
|
|
|
3988
3984
|
function IsDiscard(discard, input) {
|
|
3989
3985
|
return discard.includes(input);
|
|
3990
3986
|
}
|
|
3991
|
-
function Many(allowed, discard, input,
|
|
3992
|
-
return Match2(Take(allowed, input), (Char, Rest2) => IsDiscard(discard, Char) ? Many(allowed, discard, Rest2,
|
|
3987
|
+
function Many(allowed, discard, input, result = "") {
|
|
3988
|
+
return Match2(Take(allowed, input), (Char, Rest2) => IsDiscard(discard, Char) ? Many(allowed, discard, Rest2, result) : Many(allowed, discard, Rest2, `${result}${Char}`), () => [result, input]);
|
|
3993
3989
|
}
|
|
3994
3990
|
var init_many = __esm({
|
|
3995
3991
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/script/token/internal/many.mjs"() {
|
|
@@ -4098,8 +4094,8 @@ var init_const = __esm({
|
|
|
4098
4094
|
function TakeInitial(input) {
|
|
4099
4095
|
return Take(Initial, input);
|
|
4100
4096
|
}
|
|
4101
|
-
function TakeRemaining(input,
|
|
4102
|
-
return Match2(Take(Remaining, input), (Remaining2, RemainingRest) => TakeRemaining(RemainingRest, `${
|
|
4097
|
+
function TakeRemaining(input, result = "") {
|
|
4098
|
+
return Match2(Take(Remaining, input), (Remaining2, RemainingRest) => TakeRemaining(RemainingRest, `${result}${Remaining2}`), () => [result, input]);
|
|
4103
4099
|
}
|
|
4104
4100
|
function TakeIdent(input) {
|
|
4105
4101
|
return Match2(
|
|
@@ -4210,16 +4206,16 @@ var init_rest2 = __esm({
|
|
|
4210
4206
|
|
|
4211
4207
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/script/token/until.mjs
|
|
4212
4208
|
function TakeOne(input) {
|
|
4213
|
-
const
|
|
4214
|
-
return
|
|
4209
|
+
const result = IsEqual(input, "") ? [] : [input.slice(0, 1), input.slice(1)];
|
|
4210
|
+
return result;
|
|
4215
4211
|
}
|
|
4216
4212
|
function IsInputMatchSentinal(end, input) {
|
|
4217
4213
|
return ShiftLeft(end, (left, right) => input.startsWith(left) ? true : IsInputMatchSentinal(right, input), () => false);
|
|
4218
4214
|
}
|
|
4219
|
-
function Until(end, input,
|
|
4215
|
+
function Until(end, input, result = "") {
|
|
4220
4216
|
return Match2(
|
|
4221
4217
|
TakeOne(input),
|
|
4222
|
-
(One, Rest2) => IsInputMatchSentinal(end, input) ? [
|
|
4218
|
+
(One, Rest2) => IsInputMatchSentinal(end, input) ? [result, input] : Until(end, Rest2, `${result}${One}`),
|
|
4223
4219
|
() => []
|
|
4224
4220
|
);
|
|
4225
4221
|
}
|
|
@@ -4328,16 +4324,16 @@ var init_parser = __esm({
|
|
|
4328
4324
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/script/parser.mjs"() {
|
|
4329
4325
|
init_mapping();
|
|
4330
4326
|
init_token();
|
|
4331
|
-
If = (
|
|
4327
|
+
If = (result, left, right = () => []) => result.length === 2 ? left(result) : right();
|
|
4332
4328
|
GenericParameterExtendsEquals = (input) => If(If(Ident(input), ([_0, input2]) => If(Const("extends", input2), ([_1, input3]) => If(Type(input3), ([_2, input4]) => If(Const("=", input4), ([_3, input5]) => If(Type(input5), ([_4, input6]) => [[_0, _1, _2, _3, _4], input6]))))), ([_0, input2]) => [GenericParameterExtendsEqualsMapping(_0), input2]);
|
|
4333
4329
|
GenericParameterExtends = (input) => If(If(Ident(input), ([_0, input2]) => If(Const("extends", input2), ([_1, input3]) => If(Type(input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [GenericParameterExtendsMapping(_0), input2]);
|
|
4334
4330
|
GenericParameterEquals = (input) => If(If(Ident(input), ([_0, input2]) => If(Const("=", input2), ([_1, input3]) => If(Type(input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [GenericParameterEqualsMapping(_0), input2]);
|
|
4335
4331
|
GenericParameterIdentifier = (input) => If(Ident(input), ([_0, input2]) => [GenericParameterIdentifierMapping(_0), input2]);
|
|
4336
4332
|
GenericParameter = (input) => If(If(GenericParameterExtendsEquals(input), ([_0, input2]) => [_0, input2], () => If(GenericParameterExtends(input), ([_0, input2]) => [_0, input2], () => If(GenericParameterEquals(input), ([_0, input2]) => [_0, input2], () => If(GenericParameterIdentifier(input), ([_0, input2]) => [_0, input2], () => [])))), ([_0, input2]) => [GenericParameterMapping(_0), input2]);
|
|
4337
|
-
GenericParameterList_0 = (input,
|
|
4333
|
+
GenericParameterList_0 = (input, result = []) => If(If(GenericParameter(input), ([_0, input2]) => If(Const(",", input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => GenericParameterList_0(input2, [...result, _0]), () => [result, input]);
|
|
4338
4334
|
GenericParameterList = (input) => If(If(GenericParameterList_0(input), ([_0, input2]) => If(If(If(GenericParameter(input2), ([_02, input3]) => [[_02], input3]), ([_02, input3]) => [_02, input3], () => If([[], input2], ([_02, input3]) => [_02, input3], () => [])), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [GenericParameterListMapping(_0), input2]);
|
|
4339
4335
|
GenericParameters = (input) => If(If(Const("<", input), ([_0, input2]) => If(GenericParameterList(input2), ([_1, input3]) => If(Const(">", input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [GenericParametersMapping(_0), input2]);
|
|
4340
|
-
GenericCallArgumentList_0 = (input,
|
|
4336
|
+
GenericCallArgumentList_0 = (input, result = []) => If(If(Type(input), ([_0, input2]) => If(Const(",", input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => GenericCallArgumentList_0(input2, [...result, _0]), () => [result, input]);
|
|
4341
4337
|
GenericCallArgumentList = (input) => If(If(GenericCallArgumentList_0(input), ([_0, input2]) => If(If(If(Type(input2), ([_02, input3]) => [[_02], input3]), ([_02, input3]) => [_02, input3], () => If([[], input2], ([_02, input3]) => [_02, input3], () => [])), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [GenericCallArgumentListMapping(_0), input2]);
|
|
4342
4338
|
GenericCallArguments = (input) => If(If(Const("<", input), ([_0, input2]) => If(GenericCallArgumentList(input2), ([_1, input3]) => If(Const(">", input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [GenericCallArgumentsMapping(_0), input2]);
|
|
4343
4339
|
GenericCall = (input) => If(If(Ident(input), ([_0, input2]) => If(GenericCallArguments(input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [GenericCallMapping(_0), input2]);
|
|
@@ -4367,7 +4363,7 @@ var init_parser = __esm({
|
|
|
4367
4363
|
LiteralNumber = (input) => If(Number3(input), ([_0, input2]) => [LiteralNumberMapping(_0), input2]);
|
|
4368
4364
|
LiteralString = (input) => If(String3(["'", '"'], input), ([_0, input2]) => [LiteralStringMapping(_0), input2]);
|
|
4369
4365
|
KeyOf = (input) => If(If(If(Const("keyof", input), ([_0, input2]) => [[_0], input2]), ([_0, input2]) => [_0, input2], () => If([[], input], ([_0, input2]) => [_0, input2], () => [])), ([_0, input2]) => [KeyOfMapping(_0), input2]);
|
|
4370
|
-
IndexArray_0 = (input,
|
|
4366
|
+
IndexArray_0 = (input, result = []) => If(If(If(Const("[", input), ([_0, input2]) => If(Type(input2), ([_1, input3]) => If(Const("]", input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [_0, input2], () => If(If(Const("[", input), ([_0, input2]) => If(Const("]", input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [_0, input2], () => [])), ([_0, input2]) => IndexArray_0(input2, [...result, _0]), () => [result, input]);
|
|
4371
4367
|
IndexArray = (input) => If(IndexArray_0(input), ([_0, input2]) => [IndexArrayMapping(_0), input2]);
|
|
4372
4368
|
Extends2 = (input) => If(If(If(Const("extends", input), ([_0, input2]) => If(Type(input2), ([_1, input3]) => If(Const("?", input3), ([_2, input4]) => If(Type(input4), ([_3, input5]) => If(Const(":", input5), ([_4, input6]) => If(Type(input6), ([_5, input7]) => [[_0, _1, _2, _3, _4, _5], input7])))))), ([_0, input2]) => [_0, input2], () => If([[], input], ([_0, input2]) => [_0, input2], () => [])), ([_0, input2]) => [ExtendsMapping(_0), input2]);
|
|
4373
4369
|
Base = (input) => If(If(If(Const("(", input), ([_0, input2]) => If(Type(input2), ([_1, input3]) => If(Const(")", input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [_0, input2], () => If(KeywordString(input), ([_0, input2]) => [_0, input2], () => If(KeywordNumber(input), ([_0, input2]) => [_0, input2], () => If(KeywordBoolean(input), ([_0, input2]) => [_0, input2], () => If(KeywordUndefined(input), ([_0, input2]) => [_0, input2], () => If(KeywordNull(input), ([_0, input2]) => [_0, input2], () => If(KeywordInteger(input), ([_0, input2]) => [_0, input2], () => If(KeywordBigInt(input), ([_0, input2]) => [_0, input2], () => If(KeywordUnknown(input), ([_0, input2]) => [_0, input2], () => If(KeywordAny(input), ([_0, input2]) => [_0, input2], () => If(KeywordObject(input), ([_0, input2]) => [_0, input2], () => If(KeywordNever(input), ([_0, input2]) => [_0, input2], () => If(KeywordSymbol(input), ([_0, input2]) => [_0, input2], () => If(KeywordVoid(input), ([_0, input2]) => [_0, input2], () => If(KeywordThis(input), ([_0, input2]) => [_0, input2], () => If(LiteralBigInt(input), ([_0, input2]) => [_0, input2], () => If(LiteralBoolean(input), ([_0, input2]) => [_0, input2], () => If(LiteralNumber(input), ([_0, input2]) => [_0, input2], () => If(LiteralString(input), ([_0, input2]) => [_0, input2], () => If(TemplateLiteral(input), ([_0, input2]) => [_0, input2], () => If(Dependent2(input), ([_0, input2]) => [_0, input2], () => If(_Object_2(input), ([_0, input2]) => [_0, input2], () => If(_Tuple_(input), ([_0, input2]) => [_0, input2], () => If(_Constructor_(input), ([_0, input2]) => [_0, input2], () => If(_Function_2(input), ([_0, input2]) => [_0, input2], () => If(_Mapped_(input), ([_0, input2]) => [_0, input2], () => If(GenericCall(input), ([_0, input2]) => [_0, input2], () => If(Reference(input), ([_0, input2]) => [_0, input2], () => [])))))))))))))))))))))))))))), ([_0, input2]) => [BaseMapping(_0), input2]);
|
|
@@ -4391,7 +4387,7 @@ var init_parser = __esm({
|
|
|
4391
4387
|
Optional3 = (input) => If(If(If(Const("?", input), ([_0, input2]) => [[_0], input2]), ([_0, input2]) => [_0, input2], () => If([[], input], ([_0, input2]) => [_0, input2], () => [])), ([_0, input2]) => [OptionalMapping(_0), input2]);
|
|
4392
4388
|
Property = (input) => If(If(Readonly2(input), ([_0, input2]) => If(PropertyKey(input2), ([_1, input3]) => If(Optional3(input3), ([_2, input4]) => If(Const(":", input4), ([_3, input5]) => If(Type(input5), ([_4, input6]) => [[_0, _1, _2, _3, _4], input6]))))), ([_0, input2]) => [PropertyMapping(_0), input2]);
|
|
4393
4389
|
PropertyDelimiter = (input) => If(If(If(Const(",", input), ([_0, input2]) => If(Const("\n", input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [_0, input2], () => If(If(Const(";", input), ([_0, input2]) => If(Const("\n", input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [_0, input2], () => If(If(Const(",", input), ([_0, input2]) => [[_0], input2]), ([_0, input2]) => [_0, input2], () => If(If(Const(";", input), ([_0, input2]) => [[_0], input2]), ([_0, input2]) => [_0, input2], () => If(If(Const("\n", input), ([_0, input2]) => [[_0], input2]), ([_0, input2]) => [_0, input2], () => []))))), ([_0, input2]) => [PropertyDelimiterMapping(_0), input2]);
|
|
4394
|
-
PropertyList_0 = (input,
|
|
4390
|
+
PropertyList_0 = (input, result = []) => If(If(Property(input), ([_0, input2]) => If(PropertyDelimiter(input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => PropertyList_0(input2, [...result, _0]), () => [result, input]);
|
|
4395
4391
|
PropertyList = (input) => If(If(PropertyList_0(input), ([_0, input2]) => If(If(If(Property(input2), ([_02, input3]) => [[_02], input3]), ([_02, input3]) => [_02, input3], () => If([[], input2], ([_02, input3]) => [_02, input3], () => [])), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [PropertyListMapping(_0), input2]);
|
|
4396
4392
|
Properties = (input) => If(If(Const("{", input), ([_0, input2]) => If(PropertyList(input2), ([_1, input3]) => If(Const("}", input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [PropertiesMapping(_0), input2]);
|
|
4397
4393
|
_Object_2 = (input) => If(Properties(input), ([_0, input2]) => [_Object_Mapping(_0), input2]);
|
|
@@ -4401,7 +4397,7 @@ var init_parser = __esm({
|
|
|
4401
4397
|
ElementOptional = (input) => If(If(Type(input), ([_0, input2]) => If(Const("?", input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [ElementOptionalMapping(_0), input2]);
|
|
4402
4398
|
ElementBase = (input) => If(If(ElementNamed(input), ([_0, input2]) => [_0, input2], () => If(ElementReadonlyOptional(input), ([_0, input2]) => [_0, input2], () => If(ElementReadonly(input), ([_0, input2]) => [_0, input2], () => If(ElementOptional(input), ([_0, input2]) => [_0, input2], () => If(Type(input), ([_0, input2]) => [_0, input2], () => []))))), ([_0, input2]) => [ElementBaseMapping(_0), input2]);
|
|
4403
4399
|
Element = (input) => If(If(If(Const("...", input), ([_0, input2]) => If(ElementBase(input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [_0, input2], () => If(If(ElementBase(input), ([_0, input2]) => [[_0], input2]), ([_0, input2]) => [_0, input2], () => [])), ([_0, input2]) => [ElementMapping(_0), input2]);
|
|
4404
|
-
ElementList_0 = (input,
|
|
4400
|
+
ElementList_0 = (input, result = []) => If(If(Element(input), ([_0, input2]) => If(Const(",", input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => ElementList_0(input2, [...result, _0]), () => [result, input]);
|
|
4405
4401
|
ElementList = (input) => If(If(ElementList_0(input), ([_0, input2]) => If(If(If(Element(input2), ([_02, input3]) => [[_02], input3]), ([_02, input3]) => [_02, input3], () => If([[], input2], ([_02, input3]) => [_02, input3], () => [])), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [ElementListMapping(_0), input2]);
|
|
4406
4402
|
_Tuple_ = (input) => If(If(Const("[", input), ([_0, input2]) => If(ElementList(input2), ([_1, input3]) => If(Const("]", input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [_Tuple_Mapping(_0), input2]);
|
|
4407
4403
|
ParameterReadonlyOptional = (input) => If(If(Ident(input), ([_0, input2]) => If(Const("?", input2), ([_1, input3]) => If(Const(":", input3), ([_2, input4]) => If(Const("readonly", input4), ([_3, input5]) => If(Type(input5), ([_4, input6]) => [[_0, _1, _2, _3, _4], input6]))))), ([_0, input2]) => [ParameterReadonlyOptionalMapping(_0), input2]);
|
|
@@ -4410,7 +4406,7 @@ var init_parser = __esm({
|
|
|
4410
4406
|
ParameterType = (input) => If(If(Ident(input), ([_0, input2]) => If(Const(":", input2), ([_1, input3]) => If(Type(input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [ParameterTypeMapping(_0), input2]);
|
|
4411
4407
|
ParameterBase = (input) => If(If(ParameterReadonlyOptional(input), ([_0, input2]) => [_0, input2], () => If(ParameterReadonly(input), ([_0, input2]) => [_0, input2], () => If(ParameterOptional(input), ([_0, input2]) => [_0, input2], () => If(ParameterType(input), ([_0, input2]) => [_0, input2], () => [])))), ([_0, input2]) => [ParameterBaseMapping(_0), input2]);
|
|
4412
4408
|
Parameter2 = (input) => If(If(If(Const("...", input), ([_0, input2]) => If(ParameterBase(input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [_0, input2], () => If(If(ParameterBase(input), ([_0, input2]) => [[_0], input2]), ([_0, input2]) => [_0, input2], () => [])), ([_0, input2]) => [ParameterMapping(_0), input2]);
|
|
4413
|
-
ParameterList_0 = (input,
|
|
4409
|
+
ParameterList_0 = (input, result = []) => If(If(Parameter2(input), ([_0, input2]) => If(Const(",", input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => ParameterList_0(input2, [...result, _0]), () => [result, input]);
|
|
4414
4410
|
ParameterList = (input) => If(If(ParameterList_0(input), ([_0, input2]) => If(If(If(Parameter2(input2), ([_02, input3]) => [[_02], input3]), ([_02, input3]) => [_02, input3], () => If([[], input2], ([_02, input3]) => [_02, input3], () => [])), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [ParameterListMapping(_0), input2]);
|
|
4415
4411
|
_Function_2 = (input) => If(If(Const("(", input), ([_0, input2]) => If(ParameterList(input2), ([_1, input3]) => If(Const(")", input3), ([_2, input4]) => If(Const("=>", input4), ([_3, input5]) => If(Type(input5), ([_4, input6]) => [[_0, _1, _2, _3, _4], input6]))))), ([_0, input2]) => [_Function_Mapping(_0), input2]);
|
|
4416
4412
|
_Constructor_ = (input) => If(If(Const("new", input), ([_0, input2]) => If(Const("(", input2), ([_1, input3]) => If(ParameterList(input3), ([_2, input4]) => If(Const(")", input4), ([_3, input5]) => If(Const("=>", input5), ([_4, input6]) => If(Type(input6), ([_5, input7]) => [[_0, _1, _2, _3, _4, _5], input7])))))), ([_0, input2]) => [_Constructor_Mapping(_0), input2]);
|
|
@@ -4426,10 +4422,10 @@ var init_parser = __esm({
|
|
|
4426
4422
|
WithNull = (input) => If(Const("null", input), ([_0, input2]) => [WithNullMapping(_0), input2]);
|
|
4427
4423
|
WithUndefined = (input) => If(Const("undefined", input), ([_0, input2]) => [WithUndefinedMapping(_0), input2]);
|
|
4428
4424
|
WithProperty = (input) => If(If(PropertyKey(input), ([_0, input2]) => If(Const(":", input2), ([_1, input3]) => If(WithValue(input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [WithPropertyMapping(_0), input2]);
|
|
4429
|
-
WithPropertyList_0 = (input,
|
|
4425
|
+
WithPropertyList_0 = (input, result = []) => If(If(WithProperty(input), ([_0, input2]) => If(PropertyDelimiter(input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => WithPropertyList_0(input2, [...result, _0]), () => [result, input]);
|
|
4430
4426
|
WithPropertyList = (input) => If(If(WithPropertyList_0(input), ([_0, input2]) => If(If(If(WithProperty(input2), ([_02, input3]) => [[_02], input3]), ([_02, input3]) => [_02, input3], () => If([[], input2], ([_02, input3]) => [_02, input3], () => [])), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [WithPropertyListMapping(_0), input2]);
|
|
4431
4427
|
WithObject = (input) => If(If(Const("{", input), ([_0, input2]) => If(WithPropertyList(input2), ([_1, input3]) => If(Const("}", input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [WithObjectMapping(_0), input2]);
|
|
4432
|
-
WithElementList_0 = (input,
|
|
4428
|
+
WithElementList_0 = (input, result = []) => If(If(WithValue(input), ([_0, input2]) => If(Const(",", input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => WithElementList_0(input2, [...result, _0]), () => [result, input]);
|
|
4433
4429
|
WithElementList = (input) => If(If(WithElementList_0(input), ([_0, input2]) => If(If(If(WithValue(input2), ([_02, input3]) => [[_02], input3]), ([_02, input3]) => [_02, input3], () => If([[], input2], ([_02, input3]) => [_02, input3], () => [])), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [WithElementListMapping(_0), input2]);
|
|
4434
4430
|
WithArray = (input) => If(If(Const("[", input), ([_0, input2]) => If(WithElementList(input2), ([_1, input3]) => If(Const("]", input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [WithArrayMapping(_0), input2]);
|
|
4435
4431
|
WithValue = (input) => If(If(WithBigInt(input), ([_0, input2]) => [_0, input2], () => If(WithNumber(input), ([_0, input2]) => [_0, input2], () => If(WithBoolean(input), ([_0, input2]) => [_0, input2], () => If(WithString(input), ([_0, input2]) => [_0, input2], () => If(WithNull(input), ([_0, input2]) => [_0, input2], () => If(WithUndefined(input), ([_0, input2]) => [_0, input2], () => If(WithObject(input), ([_0, input2]) => [_0, input2], () => If(WithArray(input), ([_0, input2]) => [_0, input2], () => [])))))))), ([_0, input2]) => [WithValueMapping(_0), input2]);
|
|
@@ -4445,7 +4441,7 @@ var init_parser = __esm({
|
|
|
4445
4441
|
PatternTerm = (input) => If(If(PatternBase(input), ([_0, input2]) => If(PatternBody(input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [PatternTermMapping(_0), input2]);
|
|
4446
4442
|
PatternBody = (input) => If(If(PatternUnion(input), ([_0, input2]) => [_0, input2], () => If(PatternTerm(input), ([_0, input2]) => [_0, input2], () => [])), ([_0, input2]) => [PatternBodyMapping(_0), input2]);
|
|
4447
4443
|
Pattern = (input) => If(If(Const("^", input), ([_0, input2]) => If(PatternBody(input2), ([_1, input3]) => If(Const("$", input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [PatternMapping(_0), input2]);
|
|
4448
|
-
InterfaceDeclarationHeritageList_0 = (input,
|
|
4444
|
+
InterfaceDeclarationHeritageList_0 = (input, result = []) => If(If(Type(input), ([_0, input2]) => If(Const(",", input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => InterfaceDeclarationHeritageList_0(input2, [...result, _0]), () => [result, input]);
|
|
4449
4445
|
InterfaceDeclarationHeritageList = (input) => If(If(InterfaceDeclarationHeritageList_0(input), ([_0, input2]) => If(If(If(Type(input2), ([_02, input3]) => [[_02], input3]), ([_02, input3]) => [_02, input3], () => If([[], input2], ([_02, input3]) => [_02, input3], () => [])), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [InterfaceDeclarationHeritageListMapping(_0), input2]);
|
|
4450
4446
|
InterfaceDeclarationHeritage = (input) => If(If(If(Const("extends", input), ([_0, input2]) => If(InterfaceDeclarationHeritageList(input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [_0, input2], () => If([[], input], ([_0, input2]) => [_0, input2], () => [])), ([_0, input2]) => [InterfaceDeclarationHeritageMapping(_0), input2]);
|
|
4451
4447
|
InterfaceDeclarationGeneric = (input) => If(If(Const("interface", input), ([_0, input2]) => If(Ident(input2), ([_1, input3]) => If(GenericParameters(input3), ([_2, input4]) => If(InterfaceDeclarationHeritage(input4), ([_3, input5]) => If(Properties(input5), ([_4, input6]) => [[_0, _1, _2, _3, _4], input6]))))), ([_0, input2]) => [InterfaceDeclarationGenericMapping(_0), input2]);
|
|
@@ -4454,7 +4450,7 @@ var init_parser = __esm({
|
|
|
4454
4450
|
TypeAliasDeclaration = (input) => If(If(Const("type", input), ([_0, input2]) => If(Ident(input2), ([_1, input3]) => If(Const("=", input3), ([_2, input4]) => If(Type(input4), ([_3, input5]) => [[_0, _1, _2, _3], input5])))), ([_0, input2]) => [TypeAliasDeclarationMapping(_0), input2]);
|
|
4455
4451
|
ExportKeyword = (input) => If(If(If(Const("export", input), ([_0, input2]) => [[_0], input2]), ([_0, input2]) => [_0, input2], () => If([[], input], ([_0, input2]) => [_0, input2], () => [])), ([_0, input2]) => [ExportKeywordMapping(_0), input2]);
|
|
4456
4452
|
ModuleDeclarationDelimiter = (input) => If(If(If(Const(";", input), ([_0, input2]) => If(Const("\n", input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [_0, input2], () => If(If(Const(";", input), ([_0, input2]) => [[_0], input2]), ([_0, input2]) => [_0, input2], () => If(If(Const("\n", input), ([_0, input2]) => [[_0], input2]), ([_0, input2]) => [_0, input2], () => []))), ([_0, input2]) => [ModuleDeclarationDelimiterMapping(_0), input2]);
|
|
4457
|
-
ModuleDeclarationList_0 = (input,
|
|
4453
|
+
ModuleDeclarationList_0 = (input, result = []) => If(If(ModuleDeclaration(input), ([_0, input2]) => If(ModuleDeclarationDelimiter(input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => ModuleDeclarationList_0(input2, [...result, _0]), () => [result, input]);
|
|
4458
4454
|
ModuleDeclarationList = (input) => If(If(ModuleDeclarationList_0(input), ([_0, input2]) => If(If(If(ModuleDeclaration(input2), ([_02, input3]) => [[_02], input3]), ([_02, input3]) => [_02, input3], () => If([[], input2], ([_02, input3]) => [_02, input3], () => [])), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [ModuleDeclarationListMapping(_0), input2]);
|
|
4459
4455
|
ModuleDeclaration = (input) => If(If(ExportKeyword(input), ([_0, input2]) => If(If(InterfaceDeclarationGeneric(input2), ([_02, input3]) => [_02, input3], () => If(InterfaceDeclaration(input2), ([_02, input3]) => [_02, input3], () => If(TypeAliasDeclarationGeneric(input2), ([_02, input3]) => [_02, input3], () => If(TypeAliasDeclaration(input2), ([_02, input3]) => [_02, input3], () => [])))), ([_1, input3]) => If(OptionalSemiColon(input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [ModuleDeclarationMapping(_0), input2]);
|
|
4460
4456
|
Module = (input) => If(If(ModuleDeclaration(input), ([_0, input2]) => If(ModuleDeclarationList(input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [ModuleMapping(_0), input2]);
|
|
@@ -4465,8 +4461,8 @@ var init_parser = __esm({
|
|
|
4465
4461
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/patterns/template.mjs
|
|
4466
4462
|
function ParseTemplateIntoTypes(template) {
|
|
4467
4463
|
const parsed = TemplateLiteralTypes(`\`${template}\``);
|
|
4468
|
-
const
|
|
4469
|
-
return
|
|
4464
|
+
const result = guard_exports.IsEqual(parsed.length, 2) ? parsed[0] : Unreachable();
|
|
4465
|
+
return result;
|
|
4470
4466
|
}
|
|
4471
4467
|
var init_template = __esm({
|
|
4472
4468
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/patterns/template.mjs"() {
|
|
@@ -4506,15 +4502,15 @@ function EncodeTemplateLiteral(templatePattern, right, pattern) {
|
|
|
4506
4502
|
}
|
|
4507
4503
|
function EncodeTemplateLiteralDeferred(types, right, pattern) {
|
|
4508
4504
|
const templateLiteral = TemplateLiteralAction(types, {});
|
|
4509
|
-
const
|
|
4510
|
-
return
|
|
4505
|
+
const result = EncodeType(templateLiteral, right, pattern);
|
|
4506
|
+
return result;
|
|
4511
4507
|
}
|
|
4512
4508
|
function EncodeEnum(values, right, pattern) {
|
|
4513
4509
|
const evaluated = EvaluateEnum(values);
|
|
4514
4510
|
return EncodeType(evaluated, right, pattern);
|
|
4515
4511
|
}
|
|
4516
|
-
function EncodeUnion(types, right, pattern,
|
|
4517
|
-
return guard_exports.ShiftLeft(types, (head, tail) => EncodeUnion(tail, right, pattern, [...
|
|
4512
|
+
function EncodeUnion(types, right, pattern, result = []) {
|
|
4513
|
+
return guard_exports.ShiftLeft(types, (head, tail) => EncodeUnion(tail, right, pattern, [...result, EncodeType(head, [], "")]), () => EncodeTypes(right, `${pattern}(${JoinString(result)})`));
|
|
4518
4514
|
}
|
|
4519
4515
|
function EncodeType(type, right, pattern) {
|
|
4520
4516
|
return IsEnum(type) ? EncodeEnum(type.enum, right, pattern) : IsInteger2(type) ? EncodeInteger(right, pattern) : IsLiteral(type) ? EncodeLiteral(type.const, right, pattern) : IsBigInt2(type) ? EncodeBigInt(right, pattern) : IsBoolean3(type) ? EncodeBoolean(right, pattern) : IsNumber3(type) ? EncodeNumber(right, pattern) : IsString3(type) ? EncodeString(right, pattern) : IsTemplateLiteral(type) ? EncodeTemplateLiteral(type.pattern, right, pattern) : IsTemplateLiteralDeferred(type) ? EncodeTemplateLiteralDeferred(type.parameters[0], right, pattern) : IsUnion(type) ? EncodeUnion(type.anyOf, right, pattern) : NeverPattern;
|
|
@@ -4524,13 +4520,13 @@ function EncodeTypes(types, pattern) {
|
|
|
4524
4520
|
}
|
|
4525
4521
|
function EncodePattern(types) {
|
|
4526
4522
|
const encoded = EncodeTypes(types, "");
|
|
4527
|
-
const
|
|
4528
|
-
return
|
|
4523
|
+
const result = `^${encoded}$`;
|
|
4524
|
+
return result;
|
|
4529
4525
|
}
|
|
4530
4526
|
function TemplateLiteralEncode(types) {
|
|
4531
4527
|
const pattern = EncodePattern(types);
|
|
4532
|
-
const
|
|
4533
|
-
return
|
|
4528
|
+
const result = TemplateLiteralCreate(pattern);
|
|
4529
|
+
return result;
|
|
4534
4530
|
}
|
|
4535
4531
|
var init_encode = __esm({
|
|
4536
4532
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/template_literal/encode.mjs"() {
|
|
@@ -4553,8 +4549,8 @@ var init_encode = __esm({
|
|
|
4553
4549
|
|
|
4554
4550
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/template_literal/instantiate.mjs
|
|
4555
4551
|
function TemplateLiteralAction(types, options) {
|
|
4556
|
-
const
|
|
4557
|
-
return
|
|
4552
|
+
const result = CanInstantiate(types) ? memory_exports.Update(TemplateLiteralEncode(types), {}, options) : TemplateLiteralDeferred(types, options);
|
|
4553
|
+
return result;
|
|
4558
4554
|
}
|
|
4559
4555
|
function TemplateLiteralInstantiate(context, state, types, options) {
|
|
4560
4556
|
const instantiatedTypes = InstantiateTypes(context, state, types);
|
|
@@ -4634,8 +4630,8 @@ function IsExtendsFalse(value) {
|
|
|
4634
4630
|
function IsExtendsTrueLike(value) {
|
|
4635
4631
|
return IsExtendsUnion(value) || IsExtendsTrue(value);
|
|
4636
4632
|
}
|
|
4637
|
-
function Match3(
|
|
4638
|
-
return IsExtendsTrueLike(
|
|
4633
|
+
function Match3(result, true_, false_) {
|
|
4634
|
+
return IsExtendsTrueLike(result) ? true_(result.inferred) : false_();
|
|
4639
4635
|
}
|
|
4640
4636
|
var init_result = __esm({
|
|
4641
4637
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/extends/result.mjs"() {
|
|
@@ -4944,8 +4940,8 @@ function ExtendsProperty(inferred, left, right) {
|
|
|
4944
4940
|
);
|
|
4945
4941
|
}
|
|
4946
4942
|
function ExtractInferredProperties(keys, properties) {
|
|
4947
|
-
return keys.reduce((
|
|
4948
|
-
return key in properties ? IsExtendsTrueLike(properties[key]) ? { ...
|
|
4943
|
+
return keys.reduce((result, key) => {
|
|
4944
|
+
return key in properties ? IsExtendsTrueLike(properties[key]) ? { ...result, ...properties[key].inferred } : Unreachable() : Unreachable();
|
|
4949
4945
|
}, {});
|
|
4950
4946
|
}
|
|
4951
4947
|
function ExtendsPropertiesComparer(inferred, left, right) {
|
|
@@ -4953,7 +4949,7 @@ function ExtendsPropertiesComparer(inferred, left, right) {
|
|
|
4953
4949
|
for (const rightKey of guard_exports.Keys(right)) {
|
|
4954
4950
|
properties[rightKey] = rightKey in left ? ExtendsProperty({}, left[rightKey], right[rightKey]) : IsOptional(right[rightKey]) ? IsInfer(right[rightKey]) ? ExtendsTrue(memory_exports.Assign(inferred, { [right[rightKey].name]: right[rightKey].extends })) : ExtendsTrue(inferred) : ExtendsFalse();
|
|
4955
4951
|
}
|
|
4956
|
-
const checked = guard_exports.Values(properties).every((
|
|
4952
|
+
const checked = guard_exports.Values(properties).every((result) => IsExtendsTrueLike(result));
|
|
4957
4953
|
const extracted = checked ? ExtractInferredProperties(guard_exports.Keys(properties), properties) : {};
|
|
4958
4954
|
return checked ? ExtendsTrue(extracted) : ExtendsFalse();
|
|
4959
4955
|
}
|
|
@@ -4965,20 +4961,20 @@ function ExtendsObjectToObject(inferred, left, right) {
|
|
|
4965
4961
|
return ExtendsProperties(inferred, left, right);
|
|
4966
4962
|
}
|
|
4967
4963
|
function RecordMergeInferred(left, right) {
|
|
4968
|
-
return guard_exports.Keys(right).reduce((
|
|
4964
|
+
return guard_exports.Keys(right).reduce((result, key) => {
|
|
4969
4965
|
return {
|
|
4970
|
-
...
|
|
4971
|
-
[key]: guard_exports.HasPropertyKey(left, key) ? IsUnion(
|
|
4966
|
+
...result,
|
|
4967
|
+
[key]: guard_exports.HasPropertyKey(left, key) ? IsUnion(result[key]) ? Union([...result[key].anyOf, right[key]]) : Union([left[key], right[key]]) : right[key]
|
|
4972
4968
|
};
|
|
4973
4969
|
}, left);
|
|
4974
4970
|
}
|
|
4975
|
-
function ExtendsRecordComparer(properties, keys, type,
|
|
4976
|
-
return guard_exports.ShiftLeft(keys, (left, right) => Match3(ExtendsLeft({}, properties[left], type), (inferred) => ExtendsRecordComparer(properties, right, type, RecordMergeInferred(
|
|
4971
|
+
function ExtendsRecordComparer(properties, keys, type, result) {
|
|
4972
|
+
return guard_exports.ShiftLeft(keys, (left, right) => Match3(ExtendsLeft({}, properties[left], type), (inferred) => ExtendsRecordComparer(properties, right, type, RecordMergeInferred(result, inferred)), () => ExtendsFalse()), () => ExtendsTrue(result));
|
|
4977
4973
|
}
|
|
4978
4974
|
function ExtendsObjectToRecord(inferred, properties, _pattern, value) {
|
|
4979
4975
|
const keys = guard_exports.Keys(properties);
|
|
4980
|
-
const
|
|
4981
|
-
return
|
|
4976
|
+
const result = ExtendsRecordComparer(properties, keys, value, inferred);
|
|
4977
|
+
return result;
|
|
4982
4978
|
}
|
|
4983
4979
|
function ExtendsObject(inferred, left, right) {
|
|
4984
4980
|
return IsRecord(right) ? ExtendsObjectToRecord(inferred, left, RecordPattern(right), RecordValue(right)) : IsObject2(right) ? ExtendsObjectToObject(inferred, left, right.properties) : ExtendsRight(inferred, _Object_(left), right);
|
|
@@ -5071,8 +5067,8 @@ function TryRestInferable(type) {
|
|
|
5071
5067
|
function TryInferable(type) {
|
|
5072
5068
|
return IsInfer(type) ? Inferrable(type.name, type.extends) : void 0;
|
|
5073
5069
|
}
|
|
5074
|
-
function TryInferResults(rest, right,
|
|
5075
|
-
return guard_exports.ShiftLeft(rest, (head, tail) => Match3(ExtendsLeft({}, head, right), () => TryInferResults(tail, right, [...
|
|
5070
|
+
function TryInferResults(rest, right, result = []) {
|
|
5071
|
+
return guard_exports.ShiftLeft(rest, (head, tail) => Match3(ExtendsLeft({}, head, right), () => TryInferResults(tail, right, [...result, head]), () => void 0), () => result);
|
|
5076
5072
|
}
|
|
5077
5073
|
function InferTupleResult(inferred, name, left, right) {
|
|
5078
5074
|
const results = TryInferResults(left, right);
|
|
@@ -5274,12 +5270,12 @@ var init_extends_left = __esm({
|
|
|
5274
5270
|
|
|
5275
5271
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/interface/instantiate.mjs
|
|
5276
5272
|
function InterfaceOperation(heritage, properties) {
|
|
5277
|
-
const
|
|
5278
|
-
return
|
|
5273
|
+
const result = EvaluateIntersect([...heritage, _Object_(properties)]);
|
|
5274
|
+
return result;
|
|
5279
5275
|
}
|
|
5280
5276
|
function InterfaceAction(heritage, properties, options) {
|
|
5281
|
-
const
|
|
5282
|
-
return
|
|
5277
|
+
const result = CanInstantiate(heritage) ? memory_exports.Update(InterfaceOperation(heritage, properties), {}, options) : InterfaceDeferred(heritage, properties, options);
|
|
5278
|
+
return result;
|
|
5283
5279
|
}
|
|
5284
5280
|
function InterfaceInstantiate(context, state, heritage, properties, options) {
|
|
5285
5281
|
const instantiatedHeritage = InstantiateTypes(context, state, heritage);
|
|
@@ -5332,8 +5328,8 @@ function FromType3(stack, context, type) {
|
|
|
5332
5328
|
return IsRef(type) ? FromRef(stack, context, type.$ref) : IsArray2(type) ? FromType3(stack, context, type.items) : IsConstructor2(type) ? FromTypes2(stack, context, [...type.parameters, type.instanceType]) : IsFunction2(type) ? FromTypes2(stack, context, [...type.parameters, type.returnType]) : IsInterfaceDeferred(type) ? FromProperties(stack, context, type.parameters[1]) : IsIntersect(type) ? FromTypes2(stack, context, type.allOf) : IsObject2(type) ? FromProperties(stack, context, type.properties) : IsUnion(type) ? FromTypes2(stack, context, type.anyOf) : IsTuple(type) ? FromTypes2(stack, context, type.items) : IsRecord(type) ? FromType3(stack, context, RecordValue(type)) : false;
|
|
5333
5329
|
}
|
|
5334
5330
|
function CyclicCheck(stack, context, type) {
|
|
5335
|
-
const
|
|
5336
|
-
return
|
|
5331
|
+
const result = FromType3(stack, context, type);
|
|
5332
|
+
return result;
|
|
5337
5333
|
}
|
|
5338
5334
|
var init_check = __esm({
|
|
5339
5335
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/cyclic/check.mjs"() {
|
|
@@ -5354,14 +5350,14 @@ var init_check = __esm({
|
|
|
5354
5350
|
|
|
5355
5351
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/cyclic/candidates.mjs
|
|
5356
5352
|
function ResolveCandidateKeys(context, keys) {
|
|
5357
|
-
return keys.reduce((
|
|
5358
|
-
return CyclicCheck([left], context, context[left]) ? [...
|
|
5353
|
+
return keys.reduce((result, left) => {
|
|
5354
|
+
return CyclicCheck([left], context, context[left]) ? [...result, left] : result;
|
|
5359
5355
|
}, []);
|
|
5360
5356
|
}
|
|
5361
5357
|
function CyclicCandidates(context) {
|
|
5362
5358
|
const keys = PropertyKeys(context);
|
|
5363
|
-
const
|
|
5364
|
-
return
|
|
5359
|
+
const result = ResolveCandidateKeys(context, keys);
|
|
5360
|
+
return result;
|
|
5365
5361
|
}
|
|
5366
5362
|
var init_candidates = __esm({
|
|
5367
5363
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/cyclic/candidates.mjs"() {
|
|
@@ -5371,24 +5367,24 @@ var init_candidates = __esm({
|
|
|
5371
5367
|
});
|
|
5372
5368
|
|
|
5373
5369
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs
|
|
5374
|
-
function FromRef2(context, ref,
|
|
5375
|
-
return
|
|
5370
|
+
function FromRef2(context, ref, result) {
|
|
5371
|
+
return result.includes(ref) ? result : ref in context ? FromType4(context, context[ref], [...result, ref]) : Unreachable();
|
|
5376
5372
|
}
|
|
5377
|
-
function FromProperties2(context, properties,
|
|
5373
|
+
function FromProperties2(context, properties, result) {
|
|
5378
5374
|
const types = PropertyValues(properties);
|
|
5379
|
-
return FromTypes3(context, types,
|
|
5375
|
+
return FromTypes3(context, types, result);
|
|
5380
5376
|
}
|
|
5381
|
-
function FromTypes3(context, types,
|
|
5382
|
-
return types.reduce((
|
|
5383
|
-
return FromType4(context, left,
|
|
5384
|
-
},
|
|
5377
|
+
function FromTypes3(context, types, result) {
|
|
5378
|
+
return types.reduce((result2, left) => {
|
|
5379
|
+
return FromType4(context, left, result2);
|
|
5380
|
+
}, result);
|
|
5385
5381
|
}
|
|
5386
|
-
function FromType4(context, type,
|
|
5387
|
-
return IsRef(type) ? FromRef2(context, type.$ref,
|
|
5382
|
+
function FromType4(context, type, result) {
|
|
5383
|
+
return IsRef(type) ? FromRef2(context, type.$ref, result) : IsArray2(type) ? FromType4(context, type.items, result) : IsConstructor2(type) ? FromTypes3(context, [...type.parameters, type.instanceType], result) : IsFunction2(type) ? FromTypes3(context, [...type.parameters, type.returnType], result) : IsInterfaceDeferred(type) ? FromProperties2(context, type.parameters[1], result) : IsIntersect(type) ? FromTypes3(context, type.allOf, result) : IsObject2(type) ? FromProperties2(context, type.properties, result) : IsUnion(type) ? FromTypes3(context, type.anyOf, result) : IsTuple(type) ? FromTypes3(context, type.items, result) : IsRecord(type) ? FromType4(context, RecordValue(type), result) : result;
|
|
5388
5384
|
}
|
|
5389
5385
|
function CyclicDependencies(context, key, type) {
|
|
5390
|
-
const
|
|
5391
|
-
return
|
|
5386
|
+
const result = FromType4(context, type, [key]);
|
|
5387
|
+
return result;
|
|
5392
5388
|
}
|
|
5393
5389
|
var init_dependencies = __esm({
|
|
5394
5390
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs"() {
|
|
@@ -5412,13 +5408,13 @@ function FromRef3(_ref) {
|
|
|
5412
5408
|
return Any();
|
|
5413
5409
|
}
|
|
5414
5410
|
function FromProperties3(properties) {
|
|
5415
|
-
return guard_exports.Keys(properties).reduce((
|
|
5416
|
-
return { ...
|
|
5411
|
+
return guard_exports.Keys(properties).reduce((result, key) => {
|
|
5412
|
+
return { ...result, [key]: FromType5(properties[key]) };
|
|
5417
5413
|
}, {});
|
|
5418
5414
|
}
|
|
5419
5415
|
function FromTypes4(types) {
|
|
5420
|
-
return types.reduce((
|
|
5421
|
-
return [...
|
|
5416
|
+
return types.reduce((result, left) => {
|
|
5417
|
+
return [...result, FromType5(left)];
|
|
5422
5418
|
}, []);
|
|
5423
5419
|
}
|
|
5424
5420
|
function FromType5(type) {
|
|
@@ -5456,17 +5452,17 @@ function CyclicInterface(context, heritage, properties) {
|
|
|
5456
5452
|
}
|
|
5457
5453
|
function CyclicDefinitions(context, dependencies) {
|
|
5458
5454
|
const keys = guard_exports.Keys(context).filter((key) => dependencies.includes(key));
|
|
5459
|
-
return keys.reduce((
|
|
5455
|
+
return keys.reduce((result, key) => {
|
|
5460
5456
|
const type = context[key];
|
|
5461
5457
|
const instantiatedType = IsInterfaceDeferred(type) ? CyclicInterface(context, type.parameters[0], type.parameters[1]) : type;
|
|
5462
|
-
return { ...
|
|
5458
|
+
return { ...result, [key]: instantiatedType };
|
|
5463
5459
|
}, {});
|
|
5464
5460
|
}
|
|
5465
5461
|
function InstantiateCyclic(context, ref, type) {
|
|
5466
5462
|
const dependencies = CyclicDependencies(context, ref, type);
|
|
5467
5463
|
const definitions = CyclicDefinitions(context, dependencies);
|
|
5468
|
-
const
|
|
5469
|
-
return
|
|
5464
|
+
const result = Cyclic(definitions, ref);
|
|
5465
|
+
return result;
|
|
5470
5466
|
}
|
|
5471
5467
|
var init_instantiate4 = __esm({
|
|
5472
5468
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs"() {
|
|
@@ -5487,8 +5483,8 @@ function Resolve(defs, ref) {
|
|
|
5487
5483
|
return ref in defs ? IsRef(defs[ref]) ? Resolve(defs, defs[ref].$ref) : defs[ref] : Never();
|
|
5488
5484
|
}
|
|
5489
5485
|
function CyclicTarget(defs, ref) {
|
|
5490
|
-
const
|
|
5491
|
-
return
|
|
5486
|
+
const result = Resolve(defs, ref);
|
|
5487
|
+
return result;
|
|
5492
5488
|
}
|
|
5493
5489
|
var init_target = __esm({
|
|
5494
5490
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/cyclic/target.mjs"() {
|
|
@@ -5563,23 +5559,23 @@ function BroadFilter(type, types) {
|
|
|
5563
5559
|
});
|
|
5564
5560
|
}
|
|
5565
5561
|
function IsBroadestType(type, types) {
|
|
5566
|
-
const
|
|
5567
|
-
const
|
|
5568
|
-
return guard_exports.IsEqual(
|
|
5562
|
+
const result = types.some((left) => {
|
|
5563
|
+
const result2 = Compare(type, left);
|
|
5564
|
+
return guard_exports.IsEqual(result2, ResultLeftInside) || guard_exports.IsEqual(result2, ResultEqual);
|
|
5569
5565
|
});
|
|
5570
|
-
return guard_exports.IsEqual(
|
|
5566
|
+
return guard_exports.IsEqual(result, false);
|
|
5571
5567
|
}
|
|
5572
5568
|
function BroadenType(type, types) {
|
|
5573
5569
|
const evaluated = EvaluateType(type);
|
|
5574
5570
|
return IsAny(evaluated) ? [evaluated] : IsBroadestType(evaluated, types) ? [...BroadFilter(evaluated, types), evaluated] : types;
|
|
5575
5571
|
}
|
|
5576
5572
|
function BroadenTypes(types) {
|
|
5577
|
-
return types.reduce((
|
|
5578
|
-
return IsObject2(left) ? [...
|
|
5573
|
+
return types.reduce((result, left) => {
|
|
5574
|
+
return IsObject2(left) ? [...result, left] : (
|
|
5579
5575
|
// push
|
|
5580
|
-
IsNever(left) ?
|
|
5576
|
+
IsNever(left) ? result : (
|
|
5581
5577
|
// ignore
|
|
5582
|
-
BroadenType(left,
|
|
5578
|
+
BroadenType(left, result)
|
|
5583
5579
|
)
|
|
5584
5580
|
);
|
|
5585
5581
|
}, []);
|
|
@@ -5603,8 +5599,8 @@ var init_broaden = __esm({
|
|
|
5603
5599
|
|
|
5604
5600
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/evaluate/instantiate.mjs
|
|
5605
5601
|
function EvaluateAction(type, options) {
|
|
5606
|
-
const
|
|
5607
|
-
return
|
|
5602
|
+
const result = memory_exports.Update(EvaluateType(type), {}, options);
|
|
5603
|
+
return result;
|
|
5608
5604
|
}
|
|
5609
5605
|
function EvaluateInstantiate(context, state, type, options) {
|
|
5610
5606
|
const instantiatedType = InstantiateType(context, state, type);
|
|
@@ -5633,32 +5629,32 @@ var init_evaluate3 = __esm({
|
|
|
5633
5629
|
});
|
|
5634
5630
|
|
|
5635
5631
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs
|
|
5636
|
-
function CollectDistributionNames(expression,
|
|
5632
|
+
function CollectDistributionNames(expression, result = []) {
|
|
5637
5633
|
return (
|
|
5638
5634
|
// Conditional
|
|
5639
|
-
IsDeferred(expression) && guard_exports.IsEqual(expression.action, "Conditional") ? IsRef(expression.parameters[0]) ? CollectDistributionNames(expression.parameters[2], CollectDistributionNames(expression.parameters[3], [...
|
|
5635
|
+
IsDeferred(expression) && guard_exports.IsEqual(expression.action, "Conditional") ? IsRef(expression.parameters[0]) ? CollectDistributionNames(expression.parameters[2], CollectDistributionNames(expression.parameters[3], [...result, expression.parameters[0]["$ref"]])) : CollectDistributionNames(expression.parameters[2], CollectDistributionNames(expression.parameters[3], result)) : IsDeferred(expression) && guard_exports.IsEqual(expression.action, "Mapped") ? IsDeferred(expression.parameters[1]) && guard_exports.IsEqual(expression.parameters[1].action, "KeyOf") && IsRef(expression.parameters[1].parameters[0]) ? [...result, expression.parameters[1].parameters[0]["$ref"]] : result : result
|
|
5640
5636
|
);
|
|
5641
5637
|
}
|
|
5642
5638
|
function BuildDistributionArray(parameters, names) {
|
|
5643
|
-
return parameters.reduce((
|
|
5639
|
+
return parameters.reduce((result, left) => [...result, names.includes(left.name)], []);
|
|
5644
5640
|
}
|
|
5645
|
-
function ZipDistributionArray(arguments_, distributionArray,
|
|
5646
|
-
return guard_exports.ShiftLeft(arguments_, (argumentLeft, argumentRight) => guard_exports.ShiftLeft(distributionArray, (booleanLeft, booleanRight) => ZipDistributionArray(argumentRight, booleanRight, [...
|
|
5641
|
+
function ZipDistributionArray(arguments_, distributionArray, result = []) {
|
|
5642
|
+
return guard_exports.ShiftLeft(arguments_, (argumentLeft, argumentRight) => guard_exports.ShiftLeft(distributionArray, (booleanLeft, booleanRight) => ZipDistributionArray(argumentRight, booleanRight, [...result, [booleanLeft, argumentLeft]]), () => result), () => result);
|
|
5647
5643
|
}
|
|
5648
5644
|
function Expand(type) {
|
|
5649
5645
|
return IsUnion(type) ? [...type.anyOf] : [type];
|
|
5650
5646
|
}
|
|
5651
5647
|
function Append(current, type) {
|
|
5652
|
-
return current.reduce((
|
|
5648
|
+
return current.reduce((result, left) => [...result, [...left, type]], []);
|
|
5653
5649
|
}
|
|
5654
5650
|
function Cross(current, variants) {
|
|
5655
|
-
return variants.reduce((
|
|
5656
|
-
return [...
|
|
5651
|
+
return variants.reduce((result, left) => {
|
|
5652
|
+
return [...result, ...Append(current, left)];
|
|
5657
5653
|
}, []);
|
|
5658
5654
|
}
|
|
5659
5655
|
function Distribute2(zipped) {
|
|
5660
|
-
return zipped.reduce((
|
|
5661
|
-
return guard_exports.IsEqual(left[0], true) ? Cross(
|
|
5656
|
+
return zipped.reduce((result, left) => {
|
|
5657
|
+
return guard_exports.IsEqual(left[0], true) ? Cross(result, Expand(left[1])) : Cross(result, [left[1]]);
|
|
5662
5658
|
}, [[]]);
|
|
5663
5659
|
}
|
|
5664
5660
|
function DistributeArguments(parameters, arguments_, expression) {
|
|
@@ -5739,12 +5735,12 @@ var init_resolve_arguments = __esm({
|
|
|
5739
5735
|
|
|
5740
5736
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/call/instantiate.mjs
|
|
5741
5737
|
function Peek(state) {
|
|
5742
|
-
const
|
|
5743
|
-
return
|
|
5738
|
+
const result = guard_exports.IsGreaterThan(state.callstack.length, 0) ? state.callstack[state.callstack.length - 1] : "";
|
|
5739
|
+
return result;
|
|
5744
5740
|
}
|
|
5745
5741
|
function IsTailCall(state, name) {
|
|
5746
|
-
const
|
|
5747
|
-
return
|
|
5742
|
+
const result = guard_exports.IsEqual(Peek(state), name);
|
|
5743
|
+
return result;
|
|
5748
5744
|
}
|
|
5749
5745
|
function CallDispatch(context, state, target, parameters, expression, arguments_) {
|
|
5750
5746
|
const argumentsContext = ResolveArgumentsContext(context, state, parameters, arguments_);
|
|
@@ -5752,21 +5748,21 @@ function CallDispatch(context, state, target, parameters, expression, arguments_
|
|
|
5752
5748
|
return InstantiateType(argumentsContext, State([], []), returnType);
|
|
5753
5749
|
}
|
|
5754
5750
|
function CallDistributed(context, state, target, parameters, expression, distributedArguments) {
|
|
5755
|
-
return distributedArguments.reduce((
|
|
5751
|
+
return distributedArguments.reduce((result, arguments_) => [...result, CallDispatch(context, state, target, parameters, expression, arguments_)], []);
|
|
5756
5752
|
}
|
|
5757
5753
|
function CallImmediate(context, state, target, parameters, expression, arguments_) {
|
|
5758
5754
|
const distributedArguments = DistributeArguments(parameters, arguments_, expression);
|
|
5759
5755
|
const returnTypes = CallDistributed(context, state, target, parameters, expression, distributedArguments);
|
|
5760
|
-
const
|
|
5761
|
-
return
|
|
5756
|
+
const result = guard_exports.IsEqual(returnTypes.length, 1) ? returnTypes[0] : EvaluateUnion(returnTypes);
|
|
5757
|
+
return result;
|
|
5762
5758
|
}
|
|
5763
5759
|
function CallInstantiate(context, state, target, arguments_) {
|
|
5764
5760
|
const instantiatedArguments = InstantiateTypes(context, state, arguments_);
|
|
5765
5761
|
const resolved = ResolveTarget(context, target, arguments_);
|
|
5766
5762
|
const name = resolved[0];
|
|
5767
5763
|
const type = resolved[1];
|
|
5768
|
-
const
|
|
5769
|
-
return
|
|
5764
|
+
const result = IsGeneric(type) ? IsTailCall(state, name) ? CallConstruct(Ref(name), instantiatedArguments) : CallImmediate(context, state, Ref(name), type.parameters, type.expression, instantiatedArguments) : CallConstruct(target, instantiatedArguments);
|
|
5765
|
+
return result;
|
|
5770
5766
|
}
|
|
5771
5767
|
var init_instantiate6 = __esm({
|
|
5772
5768
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/call/instantiate.mjs"() {
|
|
@@ -5808,8 +5804,8 @@ function RemoveImmutableOperation(type) {
|
|
|
5808
5804
|
return memory_exports.Discard(type, ["~immutable"]);
|
|
5809
5805
|
}
|
|
5810
5806
|
function RemoveImmutableAction(type, options) {
|
|
5811
|
-
const
|
|
5812
|
-
return
|
|
5807
|
+
const result = memory_exports.Update(RemoveImmutableOperation(type), {}, options);
|
|
5808
|
+
return result;
|
|
5813
5809
|
}
|
|
5814
5810
|
function RemoveImmutableInstantiate(context, state, type, options) {
|
|
5815
5811
|
const instantiatedType = InstantiateType(context, state, type);
|
|
@@ -5846,8 +5842,8 @@ var init_from_literal = __esm({
|
|
|
5846
5842
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs
|
|
5847
5843
|
function FromTemplateLiteral(mapping, pattern) {
|
|
5848
5844
|
const evaluated = EvaluateTemplateLiteral(pattern);
|
|
5849
|
-
const
|
|
5850
|
-
return
|
|
5845
|
+
const result = FromType7(mapping, evaluated);
|
|
5846
|
+
return result;
|
|
5851
5847
|
}
|
|
5852
5848
|
var init_from_template_literal = __esm({
|
|
5853
5849
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs"() {
|
|
@@ -5858,8 +5854,8 @@ var init_from_template_literal = __esm({
|
|
|
5858
5854
|
|
|
5859
5855
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/intrinsics/from_union.mjs
|
|
5860
5856
|
function FromUnion2(mapping, types) {
|
|
5861
|
-
const
|
|
5862
|
-
return Union(
|
|
5857
|
+
const result = types.map((type) => FromType7(mapping, type));
|
|
5858
|
+
return Union(result);
|
|
5863
5859
|
}
|
|
5864
5860
|
var init_from_union = __esm({
|
|
5865
5861
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/intrinsics/from_union.mjs"() {
|
|
@@ -5941,20 +5937,20 @@ var init_uppercase = __esm({
|
|
|
5941
5937
|
|
|
5942
5938
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/intrinsics/instantiate.mjs
|
|
5943
5939
|
function CapitalizeAction(type, options) {
|
|
5944
|
-
const
|
|
5945
|
-
return
|
|
5940
|
+
const result = CanInstantiate([type]) ? memory_exports.Update(FromType7(CapitalizeMapping, type), {}, options) : CapitalizeDeferred(type, options);
|
|
5941
|
+
return result;
|
|
5946
5942
|
}
|
|
5947
5943
|
function LowercaseAction(type, options) {
|
|
5948
|
-
const
|
|
5949
|
-
return
|
|
5944
|
+
const result = CanInstantiate([type]) ? memory_exports.Update(FromType7(LowercaseMapping, type), {}, options) : LowercaseDeferred(type, options);
|
|
5945
|
+
return result;
|
|
5950
5946
|
}
|
|
5951
5947
|
function UncapitalizeAction(type, options) {
|
|
5952
|
-
const
|
|
5953
|
-
return
|
|
5948
|
+
const result = CanInstantiate([type]) ? memory_exports.Update(FromType7(UncapitalizeMapping, type), {}, options) : UncapitalizeDeferred(type, options);
|
|
5949
|
+
return result;
|
|
5954
5950
|
}
|
|
5955
5951
|
function UppercaseAction(type, options) {
|
|
5956
|
-
const
|
|
5957
|
-
return
|
|
5952
|
+
const result = CanInstantiate([type]) ? memory_exports.Update(FromType7(UppercaseMapping, type), {}, options) : UppercaseDeferred(type, options);
|
|
5953
|
+
return result;
|
|
5958
5954
|
}
|
|
5959
5955
|
function CapitalizeInstantiate(context, state, type, options) {
|
|
5960
5956
|
const instantiatedType = InstantiateType(context, state, type);
|
|
@@ -6010,8 +6006,8 @@ function ConditionalOperation(context, state, left, right, true_, false_) {
|
|
|
6010
6006
|
return result_exports.IsExtendsUnion(extendsResult) ? Union([InstantiateType(extendsResult.inferred, state, true_), InstantiateType(context, state, false_)]) : result_exports.IsExtendsTrue(extendsResult) ? InstantiateType(extendsResult.inferred, state, true_) : InstantiateType(context, state, false_);
|
|
6011
6007
|
}
|
|
6012
6008
|
function ConditionalAction(context, state, left, right, true_, false_, options) {
|
|
6013
|
-
const
|
|
6014
|
-
return
|
|
6009
|
+
const result = CanInstantiate([left, right]) ? memory_exports.Update(ConditionalOperation(context, state, left, right, true_, false_), {}, options) : ConditionalDeferred(left, right, true_, false_, options);
|
|
6010
|
+
return result;
|
|
6015
6011
|
}
|
|
6016
6012
|
function ConditionalInstantiate(context, state, left, right, true_, false_, options) {
|
|
6017
6013
|
const instantiatedLeft = InstantiateType(context, state, left);
|
|
@@ -6053,12 +6049,12 @@ var init_constructor_parameters = __esm({
|
|
|
6053
6049
|
function ConstructorParametersOperation(type) {
|
|
6054
6050
|
const parameters = IsConstructor2(type) ? type["parameters"] : [];
|
|
6055
6051
|
const instantiatedParameters = InstantiateElements({}, State([], []), parameters);
|
|
6056
|
-
const
|
|
6057
|
-
return
|
|
6052
|
+
const result = Tuple(instantiatedParameters);
|
|
6053
|
+
return result;
|
|
6058
6054
|
}
|
|
6059
6055
|
function ConstructorParametersAction(type, options) {
|
|
6060
|
-
const
|
|
6061
|
-
return
|
|
6056
|
+
const result = CanInstantiate([type]) ? memory_exports.Update(ConstructorParametersOperation(type), {}, options) : ConstructorParametersDeferred(type, options);
|
|
6057
|
+
return result;
|
|
6062
6058
|
}
|
|
6063
6059
|
function ConstructorParametersInstantiate(context, state, type, options) {
|
|
6064
6060
|
const instantiatedType = InstantiateType(context, state, type);
|
|
@@ -6092,8 +6088,8 @@ var init_exclude = __esm({
|
|
|
6092
6088
|
|
|
6093
6089
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/exclude/instantiate.mjs
|
|
6094
6090
|
function ExcludeAction(left, right, options) {
|
|
6095
|
-
const
|
|
6096
|
-
return
|
|
6091
|
+
const result = CanInstantiate([left, right]) ? memory_exports.Update(ExcludeOperation(left, right), {}, options) : ExcludeDeferred(left, right, options);
|
|
6092
|
+
return result;
|
|
6097
6093
|
}
|
|
6098
6094
|
function ExcludeInstantiate(context, state, left, right, options) {
|
|
6099
6095
|
const instantiatedLeft = InstantiateType(context, state, left);
|
|
@@ -6126,20 +6122,20 @@ var init_extract = __esm({
|
|
|
6126
6122
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/extract/operation.mjs
|
|
6127
6123
|
function ExtractType(left, right) {
|
|
6128
6124
|
const check = Extends({}, left, right);
|
|
6129
|
-
const
|
|
6130
|
-
return
|
|
6125
|
+
const result = result_exports.IsExtendsTrueLike(check) ? [left] : [];
|
|
6126
|
+
return result;
|
|
6131
6127
|
}
|
|
6132
6128
|
function ExtractUnion(types, right) {
|
|
6133
|
-
return types.reduce((
|
|
6134
|
-
return [...
|
|
6129
|
+
return types.reduce((result, head) => {
|
|
6130
|
+
return [...result, ...ExtractType(head, right)];
|
|
6135
6131
|
}, []);
|
|
6136
6132
|
}
|
|
6137
6133
|
function ExtractOperation(left, right) {
|
|
6138
6134
|
const evaluated = EvaluateType(left);
|
|
6139
6135
|
const canonical = IsUnion(evaluated) ? evaluated.anyOf : [evaluated];
|
|
6140
6136
|
const remaining = ExtractUnion(canonical, right);
|
|
6141
|
-
const
|
|
6142
|
-
return
|
|
6137
|
+
const result = EvaluateUnion(remaining);
|
|
6138
|
+
return result;
|
|
6143
6139
|
}
|
|
6144
6140
|
var init_operation2 = __esm({
|
|
6145
6141
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/extract/operation.mjs"() {
|
|
@@ -6152,8 +6148,8 @@ var init_operation2 = __esm({
|
|
|
6152
6148
|
|
|
6153
6149
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/extract/instantiate.mjs
|
|
6154
6150
|
function ExtractAction(left, right, options) {
|
|
6155
|
-
const
|
|
6156
|
-
return
|
|
6151
|
+
const result = CanInstantiate([left, right]) ? memory_exports.Update(ExtractOperation(left, right), {}, options) : ExtractDeferred(left, right, options);
|
|
6152
|
+
return result;
|
|
6157
6153
|
}
|
|
6158
6154
|
function ExtractInstantiate(context, state, left, right, options) {
|
|
6159
6155
|
const instantiatedLeft = InstantiateType(context, state, left);
|
|
@@ -6171,14 +6167,14 @@ var init_instantiate11 = __esm({
|
|
|
6171
6167
|
|
|
6172
6168
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/helpers/keys_to_indexer.mjs
|
|
6173
6169
|
function KeysToLiterals(keys) {
|
|
6174
|
-
return keys.reduce((
|
|
6175
|
-
return IsLiteralValue(left) ? [...
|
|
6170
|
+
return keys.reduce((result, left) => {
|
|
6171
|
+
return IsLiteralValue(left) ? [...result, Literal(left)] : result;
|
|
6176
6172
|
}, []);
|
|
6177
6173
|
}
|
|
6178
6174
|
function KeysToIndexer(keys) {
|
|
6179
6175
|
const literals = KeysToLiterals(keys);
|
|
6180
|
-
const
|
|
6181
|
-
return
|
|
6176
|
+
const result = Union(literals);
|
|
6177
|
+
return result;
|
|
6182
6178
|
}
|
|
6183
6179
|
var init_keys_to_indexer = __esm({
|
|
6184
6180
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/helpers/keys_to_indexer.mjs"() {
|
|
@@ -6207,8 +6203,8 @@ var init_indexed = __esm({
|
|
|
6207
6203
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/object/from_cyclic.mjs
|
|
6208
6204
|
function FromCyclic(defs, ref) {
|
|
6209
6205
|
const target = CyclicTarget(defs, ref);
|
|
6210
|
-
const
|
|
6211
|
-
return
|
|
6206
|
+
const result = FromType8(target);
|
|
6207
|
+
return result;
|
|
6212
6208
|
}
|
|
6213
6209
|
var init_from_cyclic = __esm({
|
|
6214
6210
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/object/from_cyclic.mjs"() {
|
|
@@ -6220,8 +6216,8 @@ var init_from_cyclic = __esm({
|
|
|
6220
6216
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/object/from_dependent.mjs
|
|
6221
6217
|
function FromDependent(if_, then_, else_) {
|
|
6222
6218
|
const evaluated = EvaluateDependent(if_, then_, else_);
|
|
6223
|
-
const
|
|
6224
|
-
return
|
|
6219
|
+
const result = FromType8(evaluated);
|
|
6220
|
+
return result;
|
|
6225
6221
|
}
|
|
6226
6222
|
var init_from_dependent = __esm({
|
|
6227
6223
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/object/from_dependent.mjs"() {
|
|
@@ -6235,16 +6231,16 @@ function CollapseIntersectProperties(left, right) {
|
|
|
6235
6231
|
const leftKeys = guard_exports.Keys(left).filter((key) => !guard_exports.HasPropertyKey(right, key));
|
|
6236
6232
|
const rightKeys = guard_exports.Keys(right).filter((key) => !guard_exports.HasPropertyKey(left, key));
|
|
6237
6233
|
const sharedKeys = guard_exports.Keys(left).filter((key) => guard_exports.HasPropertyKey(right, key));
|
|
6238
|
-
const leftProperties = leftKeys.reduce((
|
|
6239
|
-
const rightProperties = rightKeys.reduce((
|
|
6240
|
-
const sharedProperties = sharedKeys.reduce((
|
|
6234
|
+
const leftProperties = leftKeys.reduce((result, key) => ({ ...result, [key]: left[key] }), {});
|
|
6235
|
+
const rightProperties = rightKeys.reduce((result, key) => ({ ...result, [key]: right[key] }), {});
|
|
6236
|
+
const sharedProperties = sharedKeys.reduce((result, key) => ({ ...result, [key]: EvaluateIntersect([left[key], right[key]]) }), {});
|
|
6241
6237
|
const unique = memory_exports.Assign(leftProperties, rightProperties);
|
|
6242
6238
|
const shared = memory_exports.Assign(unique, sharedProperties);
|
|
6243
6239
|
return shared;
|
|
6244
6240
|
}
|
|
6245
6241
|
function FromIntersect(types) {
|
|
6246
|
-
return types.reduce((
|
|
6247
|
-
return CollapseIntersectProperties(
|
|
6242
|
+
return types.reduce((result, left) => {
|
|
6243
|
+
return CollapseIntersectProperties(result, FromType8(left));
|
|
6248
6244
|
}, {});
|
|
6249
6245
|
}
|
|
6250
6246
|
var init_from_intersect = __esm({
|
|
@@ -6268,8 +6264,8 @@ var init_from_object = __esm({
|
|
|
6268
6264
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/object/from_tuple.mjs
|
|
6269
6265
|
function FromTuple(types) {
|
|
6270
6266
|
const object = TupleToObject(Tuple(types));
|
|
6271
|
-
const
|
|
6272
|
-
return
|
|
6267
|
+
const result = FromType8(object);
|
|
6268
|
+
return result;
|
|
6273
6269
|
}
|
|
6274
6270
|
var init_from_tuple = __esm({
|
|
6275
6271
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/object/from_tuple.mjs"() {
|
|
@@ -6282,13 +6278,13 @@ var init_from_tuple = __esm({
|
|
|
6282
6278
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/object/from_union.mjs
|
|
6283
6279
|
function CollapseUnionProperties(left, right) {
|
|
6284
6280
|
const sharedKeys = guard_exports.Keys(left).filter((key) => key in right);
|
|
6285
|
-
const
|
|
6286
|
-
return { ...
|
|
6281
|
+
const result = sharedKeys.reduce((result2, key) => {
|
|
6282
|
+
return { ...result2, [key]: EvaluateUnion([left[key], right[key]]) };
|
|
6287
6283
|
}, {});
|
|
6288
|
-
return
|
|
6284
|
+
return result;
|
|
6289
6285
|
}
|
|
6290
|
-
function ReduceVariants(types,
|
|
6291
|
-
return guard_exports.ShiftLeft(types, (left, right) => ReduceVariants(right, CollapseUnionProperties(
|
|
6286
|
+
function ReduceVariants(types, result) {
|
|
6287
|
+
return guard_exports.ShiftLeft(types, (left, right) => ReduceVariants(right, CollapseUnionProperties(result, FromType8(left))), () => result);
|
|
6292
6288
|
}
|
|
6293
6289
|
function FromUnion3(types) {
|
|
6294
6290
|
return guard_exports.ShiftLeft(types, (left, right) => ReduceVariants(right, FromType8(left)), () => Unreachable());
|
|
@@ -6326,8 +6322,8 @@ var init_from_type2 = __esm({
|
|
|
6326
6322
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/object/collapse.mjs
|
|
6327
6323
|
function CollapseToObject(type) {
|
|
6328
6324
|
const properties = FromType8(type);
|
|
6329
|
-
const
|
|
6330
|
-
return
|
|
6325
|
+
const result = _Object_(properties);
|
|
6326
|
+
return result;
|
|
6331
6327
|
}
|
|
6332
6328
|
var init_collapse = __esm({
|
|
6333
6329
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/object/collapse.mjs"() {
|
|
@@ -6368,11 +6364,11 @@ function NormalizeIndexer(type) {
|
|
|
6368
6364
|
function FromArray3(type, indexer) {
|
|
6369
6365
|
const normalizedIndexer = NormalizeIndexer(indexer);
|
|
6370
6366
|
const check = Extends({}, normalizedIndexer, Number2());
|
|
6371
|
-
const
|
|
6367
|
+
const result = (
|
|
6372
6368
|
// indexer
|
|
6373
6369
|
result_exports.IsExtendsTrueLike(check) ? type : IsLiteral(indexer) && guard_exports.IsEqual(indexer.const, "length") ? Number2() : Never()
|
|
6374
6370
|
);
|
|
6375
|
-
return
|
|
6371
|
+
return result;
|
|
6376
6372
|
}
|
|
6377
6373
|
var init_from_array = __esm({
|
|
6378
6374
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/indexed/from_array.mjs"() {
|
|
@@ -6390,8 +6386,8 @@ var init_from_array = __esm({
|
|
|
6390
6386
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/indexable/from_cyclic.mjs
|
|
6391
6387
|
function FromCyclic2(defs, ref) {
|
|
6392
6388
|
const target = CyclicTarget(defs, ref);
|
|
6393
|
-
const
|
|
6394
|
-
return
|
|
6389
|
+
const result = FromType9(target);
|
|
6390
|
+
return result;
|
|
6395
6391
|
}
|
|
6396
6392
|
var init_from_cyclic2 = __esm({
|
|
6397
6393
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/indexable/from_cyclic.mjs"() {
|
|
@@ -6403,8 +6399,8 @@ var init_from_cyclic2 = __esm({
|
|
|
6403
6399
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/indexable/from_dependent.mjs
|
|
6404
6400
|
function FromDependent2(if_, then_, else_) {
|
|
6405
6401
|
const evaluated = EvaluateDependent(if_, then_, else_);
|
|
6406
|
-
const
|
|
6407
|
-
return
|
|
6402
|
+
const result = FromType9(evaluated);
|
|
6403
|
+
return result;
|
|
6408
6404
|
}
|
|
6409
6405
|
var init_from_dependent2 = __esm({
|
|
6410
6406
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/indexable/from_dependent.mjs"() {
|
|
@@ -6416,8 +6412,8 @@ var init_from_dependent2 = __esm({
|
|
|
6416
6412
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/indexable/from_enum.mjs
|
|
6417
6413
|
function FromEnum(values) {
|
|
6418
6414
|
const evaluated = EvaluateEnum(values);
|
|
6419
|
-
const
|
|
6420
|
-
return
|
|
6415
|
+
const result = FromType9(evaluated);
|
|
6416
|
+
return result;
|
|
6421
6417
|
}
|
|
6422
6418
|
var init_from_enum = __esm({
|
|
6423
6419
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/indexable/from_enum.mjs"() {
|
|
@@ -6429,8 +6425,8 @@ var init_from_enum = __esm({
|
|
|
6429
6425
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/indexable/from_intersect.mjs
|
|
6430
6426
|
function FromIntersect2(types) {
|
|
6431
6427
|
const evaluated = EvaluateIntersect(types);
|
|
6432
|
-
const
|
|
6433
|
-
return
|
|
6428
|
+
const result = FromType9(evaluated);
|
|
6429
|
+
return result;
|
|
6434
6430
|
}
|
|
6435
6431
|
var init_from_intersect2 = __esm({
|
|
6436
6432
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/indexable/from_intersect.mjs"() {
|
|
@@ -6441,8 +6437,8 @@ var init_from_intersect2 = __esm({
|
|
|
6441
6437
|
|
|
6442
6438
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/indexable/from_literal.mjs
|
|
6443
6439
|
function FromLiteral4(value) {
|
|
6444
|
-
const
|
|
6445
|
-
return
|
|
6440
|
+
const result = [`${value}`];
|
|
6441
|
+
return result;
|
|
6446
6442
|
}
|
|
6447
6443
|
var init_from_literal2 = __esm({
|
|
6448
6444
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/indexable/from_literal.mjs"() {
|
|
@@ -6452,8 +6448,8 @@ var init_from_literal2 = __esm({
|
|
|
6452
6448
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs
|
|
6453
6449
|
function FromTemplateLiteral2(pattern) {
|
|
6454
6450
|
const evaluated = EvaluateTemplateLiteral(pattern);
|
|
6455
|
-
const
|
|
6456
|
-
return
|
|
6451
|
+
const result = FromType9(evaluated);
|
|
6452
|
+
return result;
|
|
6457
6453
|
}
|
|
6458
6454
|
var init_from_template_literal2 = __esm({
|
|
6459
6455
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs"() {
|
|
@@ -6464,8 +6460,8 @@ var init_from_template_literal2 = __esm({
|
|
|
6464
6460
|
|
|
6465
6461
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/indexable/from_union.mjs
|
|
6466
6462
|
function FromUnion4(types) {
|
|
6467
|
-
return types.reduce((
|
|
6468
|
-
return [...
|
|
6463
|
+
return types.reduce((result, left) => {
|
|
6464
|
+
return [...result, ...FromType9(left)];
|
|
6469
6465
|
}, []);
|
|
6470
6466
|
}
|
|
6471
6467
|
var init_from_union3 = __esm({
|
|
@@ -6499,8 +6495,8 @@ var init_from_type3 = __esm({
|
|
|
6499
6495
|
|
|
6500
6496
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/indexable/to_indexable_keys.mjs
|
|
6501
6497
|
function ToIndexableKeys(type) {
|
|
6502
|
-
const
|
|
6503
|
-
return
|
|
6498
|
+
const result = FromType9(type);
|
|
6499
|
+
return result;
|
|
6504
6500
|
}
|
|
6505
6501
|
var init_to_indexable_keys = __esm({
|
|
6506
6502
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/indexable/to_indexable_keys.mjs"() {
|
|
@@ -6516,8 +6512,8 @@ function FromType10(properties, type) {
|
|
|
6516
6512
|
return IsArray2(type) ? _Array_(FromType10(properties, type.items)) : IsConstructor2(type) ? Constructor(FromTypes5(properties, type.parameters), FromType10(properties, type.instanceType)) : IsFunction2(type) ? _Function_(FromTypes5(properties, type.parameters), FromType10(properties, type.returnType)) : IsTuple(type) ? Tuple(FromTypes5(properties, type.items)) : IsUnion(type) ? Union(FromTypes5(properties, type.anyOf)) : IsIntersect(type) ? Intersect(FromTypes5(properties, type.allOf)) : IsThis(type) ? _Object_(properties) : type;
|
|
6517
6513
|
}
|
|
6518
6514
|
function ExpandThis(properties, type) {
|
|
6519
|
-
const
|
|
6520
|
-
return
|
|
6515
|
+
const result = FromType10(properties, type);
|
|
6516
|
+
return result;
|
|
6521
6517
|
}
|
|
6522
6518
|
var init_expand_this = __esm({
|
|
6523
6519
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/this/expand_this.mjs"() {
|
|
@@ -6535,34 +6531,34 @@ var init_expand_this = __esm({
|
|
|
6535
6531
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/indexed/from_object.mjs
|
|
6536
6532
|
function IndexProperty(properties, key) {
|
|
6537
6533
|
const selectedType = key in properties ? properties[key] : Never();
|
|
6538
|
-
const
|
|
6539
|
-
return
|
|
6534
|
+
const result = ExpandThis(properties, selectedType);
|
|
6535
|
+
return result;
|
|
6540
6536
|
}
|
|
6541
6537
|
function IndexProperties(properties, keys) {
|
|
6542
|
-
return keys.reduce((
|
|
6543
|
-
return [...
|
|
6538
|
+
return keys.reduce((result, left) => {
|
|
6539
|
+
return [...result, IndexProperty(properties, left)];
|
|
6544
6540
|
}, []);
|
|
6545
6541
|
}
|
|
6546
6542
|
function FromIndexer(properties, indexer) {
|
|
6547
6543
|
const keys = ToIndexableKeys(indexer);
|
|
6548
6544
|
const variants = IndexProperties(properties, keys);
|
|
6549
|
-
const
|
|
6550
|
-
return
|
|
6545
|
+
const result = EvaluateUnion(variants);
|
|
6546
|
+
return result;
|
|
6551
6547
|
}
|
|
6552
6548
|
function NumericKeys(keys) {
|
|
6553
|
-
const
|
|
6554
|
-
return
|
|
6549
|
+
const result = keys.filter((key) => NumericKeyPattern.test(key));
|
|
6550
|
+
return result;
|
|
6555
6551
|
}
|
|
6556
6552
|
function FromIndexerNumber(properties) {
|
|
6557
6553
|
const keys = PropertyKeys(properties);
|
|
6558
6554
|
const numericKeys = NumericKeys(keys);
|
|
6559
6555
|
const variants = IndexProperties(properties, numericKeys);
|
|
6560
|
-
const
|
|
6561
|
-
return
|
|
6556
|
+
const result = EvaluateUnion(variants);
|
|
6557
|
+
return result;
|
|
6562
6558
|
}
|
|
6563
6559
|
function FromObject5(properties, indexer) {
|
|
6564
|
-
const
|
|
6565
|
-
return
|
|
6560
|
+
const result = IsNumber3(indexer) ? FromIndexerNumber(properties) : FromIndexer(properties, indexer);
|
|
6561
|
+
return result;
|
|
6566
6562
|
}
|
|
6567
6563
|
var NumericKeyPattern;
|
|
6568
6564
|
var init_from_object2 = __esm({
|
|
@@ -6599,9 +6595,9 @@ var init_array_indexer = __esm({
|
|
|
6599
6595
|
|
|
6600
6596
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/indexed/from_tuple.mjs
|
|
6601
6597
|
function IndexElementsWithIndexer(types, indexer) {
|
|
6602
|
-
return types.reduceRight((
|
|
6598
|
+
return types.reduceRight((result, right, index) => {
|
|
6603
6599
|
const check = Extends({}, Literal(index), indexer);
|
|
6604
|
-
return result_exports.IsExtendsTrueLike(check) ? [right, ...
|
|
6600
|
+
return result_exports.IsExtendsTrueLike(check) ? [right, ...result] : result;
|
|
6605
6601
|
}, []);
|
|
6606
6602
|
}
|
|
6607
6603
|
function FromTupleWithIndexer(types, indexer) {
|
|
@@ -6648,12 +6644,12 @@ var init_from_type4 = __esm({
|
|
|
6648
6644
|
|
|
6649
6645
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/indexed/instantiate.mjs
|
|
6650
6646
|
function NormalizeType(type) {
|
|
6651
|
-
const
|
|
6652
|
-
return
|
|
6647
|
+
const result = IsCyclic(type) || IsDependent(type) || IsIntersect(type) || IsUnion(type) ? CollapseToObject(type) : type;
|
|
6648
|
+
return result;
|
|
6653
6649
|
}
|
|
6654
6650
|
function IndexAction(type, indexer, options) {
|
|
6655
|
-
const
|
|
6656
|
-
return
|
|
6651
|
+
const result = CanInstantiate([type, indexer]) ? memory_exports.Update(FromType11(NormalizeType(type), indexer), {}, options) : IndexDeferred(type, indexer, options);
|
|
6652
|
+
return result;
|
|
6657
6653
|
}
|
|
6658
6654
|
function IndexInstantiate(context, state, type, indexer, options) {
|
|
6659
6655
|
const instantiatedType = InstantiateType(context, state, type);
|
|
@@ -6693,8 +6689,8 @@ function InstanceTypeOperation(type) {
|
|
|
6693
6689
|
return IsConstructor2(type) ? type["instanceType"] : Never();
|
|
6694
6690
|
}
|
|
6695
6691
|
function InstanceTypeAction(type, options) {
|
|
6696
|
-
const
|
|
6697
|
-
return
|
|
6692
|
+
const result = CanInstantiate([type]) ? memory_exports.Update(InstanceTypeOperation(type), {}, options) : InstanceTypeDeferred(type, options);
|
|
6693
|
+
return result;
|
|
6698
6694
|
}
|
|
6699
6695
|
function InstanceTypeInstantiate(context, state, type, options = {}) {
|
|
6700
6696
|
const instantiatedType = InstantiateType(context, state, type);
|
|
@@ -6749,16 +6745,16 @@ var init_from_array2 = __esm({
|
|
|
6749
6745
|
|
|
6750
6746
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/keyof/from_object.mjs
|
|
6751
6747
|
function FromPropertyKeys(keys) {
|
|
6752
|
-
const
|
|
6753
|
-
return IsLiteralValue(left) ? [...
|
|
6748
|
+
const result = keys.reduce((result2, left) => {
|
|
6749
|
+
return IsLiteralValue(left) ? [...result2, Literal(ConvertToIntegerKey(left))] : Unreachable();
|
|
6754
6750
|
}, []);
|
|
6755
|
-
return
|
|
6751
|
+
return result;
|
|
6756
6752
|
}
|
|
6757
6753
|
function FromObject6(properties) {
|
|
6758
6754
|
const propertyKeys = guard_exports.Keys(properties);
|
|
6759
6755
|
const variants = FromPropertyKeys(propertyKeys);
|
|
6760
|
-
const
|
|
6761
|
-
return
|
|
6756
|
+
const result = EvaluateUnionFast(variants);
|
|
6757
|
+
return result;
|
|
6762
6758
|
}
|
|
6763
6759
|
var init_from_object3 = __esm({
|
|
6764
6760
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/keyof/from_object.mjs"() {
|
|
@@ -6782,8 +6778,8 @@ var init_from_record = __esm({
|
|
|
6782
6778
|
|
|
6783
6779
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/keyof/from_tuple.mjs
|
|
6784
6780
|
function FromTuple3(types) {
|
|
6785
|
-
const
|
|
6786
|
-
return EvaluateUnionFast(
|
|
6781
|
+
const result = types.map((_, index) => Literal(index));
|
|
6782
|
+
return EvaluateUnionFast(result);
|
|
6787
6783
|
}
|
|
6788
6784
|
var init_from_tuple3 = __esm({
|
|
6789
6785
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/keyof/from_tuple.mjs"() {
|
|
@@ -6814,8 +6810,8 @@ var init_from_type5 = __esm({
|
|
|
6814
6810
|
|
|
6815
6811
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/keyof/instantiate.mjs
|
|
6816
6812
|
function NormalizeType2(type) {
|
|
6817
|
-
const
|
|
6818
|
-
return
|
|
6813
|
+
const result = IsCyclic(type) || IsDependent(type) || IsIntersect(type) || IsUnion(type) ? CollapseToObject(type) : type;
|
|
6814
|
+
return result;
|
|
6819
6815
|
}
|
|
6820
6816
|
function KeyOfAction(type, options) {
|
|
6821
6817
|
return CanInstantiate([type]) ? memory_exports.Update(FromType12(NormalizeType2(type)), {}, options) : KeyOfDeferred(type, options);
|
|
@@ -6856,30 +6852,30 @@ var init_mapped = __esm({
|
|
|
6856
6852
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs
|
|
6857
6853
|
function FromTemplateLiteral3(pattern) {
|
|
6858
6854
|
const evaluated = EvaluateTemplateLiteral(pattern);
|
|
6859
|
-
const
|
|
6860
|
-
return
|
|
6855
|
+
const result = FromType13(evaluated);
|
|
6856
|
+
return result;
|
|
6861
6857
|
}
|
|
6862
6858
|
function FromUnion5(types) {
|
|
6863
|
-
return types.reduce((
|
|
6864
|
-
return [...
|
|
6859
|
+
return types.reduce((result, left) => {
|
|
6860
|
+
return [...result, ...FromType13(left)];
|
|
6865
6861
|
}, []);
|
|
6866
6862
|
}
|
|
6867
6863
|
function FromEnum2(values) {
|
|
6868
6864
|
const evaluated = EvaluateEnum(values);
|
|
6869
|
-
const
|
|
6870
|
-
return
|
|
6865
|
+
const result = FromType13(evaluated);
|
|
6866
|
+
return result;
|
|
6871
6867
|
}
|
|
6872
6868
|
function FromLiteral5(value) {
|
|
6873
|
-
const
|
|
6874
|
-
return
|
|
6869
|
+
const result = guard_exports.IsNumber(value) ? [Literal(`${value}`)] : [Literal(value)];
|
|
6870
|
+
return result;
|
|
6875
6871
|
}
|
|
6876
6872
|
function FromType13(type) {
|
|
6877
|
-
const
|
|
6878
|
-
return
|
|
6873
|
+
const result = IsEnum(type) ? FromEnum2(type.enum) : IsLiteral(type) ? FromLiteral5(type.const) : IsTemplateLiteral(type) ? FromTemplateLiteral3(type.pattern) : IsUnion(type) ? FromUnion5(type.anyOf) : [type];
|
|
6874
|
+
return result;
|
|
6879
6875
|
}
|
|
6880
6876
|
function MappedVariants(type) {
|
|
6881
|
-
const
|
|
6882
|
-
return
|
|
6877
|
+
const result = FromType13(type);
|
|
6878
|
+
return result;
|
|
6883
6879
|
}
|
|
6884
6880
|
var init_mapped_variants = __esm({
|
|
6885
6881
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs"() {
|
|
@@ -6895,8 +6891,8 @@ var init_mapped_variants = __esm({
|
|
|
6895
6891
|
|
|
6896
6892
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs
|
|
6897
6893
|
function CanonicalAs(instantiatedAs) {
|
|
6898
|
-
const
|
|
6899
|
-
return
|
|
6894
|
+
const result = IsTemplateLiteral(instantiatedAs) ? EvaluateTemplateLiteral(instantiatedAs.pattern) : instantiatedAs;
|
|
6895
|
+
return result;
|
|
6900
6896
|
}
|
|
6901
6897
|
function MappedVariant(context, state, identifier, variant, as, property) {
|
|
6902
6898
|
const variantContext = memory_exports.Assign(context, { [identifier["name"]]: variant });
|
|
@@ -6906,21 +6902,21 @@ function MappedVariant(context, state, identifier, variant, as, property) {
|
|
|
6906
6902
|
return IsLiteralNumber(canonicalAs) || IsLiteralString(canonicalAs) ? { [canonicalAs.const]: instantiatedProperty } : {};
|
|
6907
6903
|
}
|
|
6908
6904
|
function MappedProperties(context, state, identifier, variants, as, property) {
|
|
6909
|
-
return variants.reduce((
|
|
6910
|
-
return [...
|
|
6905
|
+
return variants.reduce((result, left) => {
|
|
6906
|
+
return [...result, MappedVariant(context, state, identifier, left, as, property)];
|
|
6911
6907
|
}, []);
|
|
6912
6908
|
}
|
|
6913
6909
|
function MappedObjects(properties) {
|
|
6914
|
-
return properties.reduce((
|
|
6915
|
-
return [...
|
|
6910
|
+
return properties.reduce((result, left) => {
|
|
6911
|
+
return [...result, _Object_(left)];
|
|
6916
6912
|
}, []);
|
|
6917
6913
|
}
|
|
6918
6914
|
function MappedOperation(context, state, identifier, type, as, property) {
|
|
6919
6915
|
const variants = MappedVariants(type);
|
|
6920
6916
|
const mappedProperties = MappedProperties(context, state, identifier, variants, as, property);
|
|
6921
6917
|
const mappedObjects = MappedObjects(mappedProperties);
|
|
6922
|
-
const
|
|
6923
|
-
return
|
|
6918
|
+
const result = EvaluateIntersect(mappedObjects);
|
|
6919
|
+
return result;
|
|
6924
6920
|
}
|
|
6925
6921
|
var init_mapped_operation = __esm({
|
|
6926
6922
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs"() {
|
|
@@ -6937,8 +6933,8 @@ var init_mapped_operation = __esm({
|
|
|
6937
6933
|
|
|
6938
6934
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/mapped/instantiate.mjs
|
|
6939
6935
|
function MappedAction(context, state, identifier, type, as, property, options) {
|
|
6940
|
-
const
|
|
6941
|
-
return
|
|
6936
|
+
const result = CanInstantiate([type]) ? memory_exports.Update(MappedOperation(context, state, identifier, type, as, property), {}, options) : MappedDeferred(identifier, type, as, property, options);
|
|
6937
|
+
return result;
|
|
6942
6938
|
}
|
|
6943
6939
|
function MappedInstantiate(context, state, identifier, type, as, property, options) {
|
|
6944
6940
|
const instantiatedType = InstantiateType(context, state, type);
|
|
@@ -6957,15 +6953,15 @@ var init_instantiate15 = __esm({
|
|
|
6957
6953
|
function InstantiateCyclics(context, declarations, cyclicKeys) {
|
|
6958
6954
|
const declarationContext = memory_exports.Assign(context, declarations);
|
|
6959
6955
|
const declarationKeys = guard_exports.Keys(declarations).filter((key) => cyclicKeys.includes(key));
|
|
6960
|
-
return declarationKeys.reduce((
|
|
6961
|
-
return { ...
|
|
6956
|
+
return declarationKeys.reduce((result, key) => {
|
|
6957
|
+
return { ...result, [key]: InstantiateCyclic(declarationContext, key, declarations[key]) };
|
|
6962
6958
|
}, {});
|
|
6963
6959
|
}
|
|
6964
6960
|
function InstantiateNonCyclics(context, declarations, cyclicKeys) {
|
|
6965
6961
|
const declarationContext = memory_exports.Assign(context, declarations);
|
|
6966
6962
|
const declarationKeys = guard_exports.Keys(declarations).filter((key) => !cyclicKeys.includes(key));
|
|
6967
|
-
return declarationKeys.reduce((
|
|
6968
|
-
return { ...
|
|
6963
|
+
return declarationKeys.reduce((result, key) => {
|
|
6964
|
+
return { ...result, [key]: InstantiateType(declarationContext, State([], []), declarations[key]) };
|
|
6969
6965
|
}, {});
|
|
6970
6966
|
}
|
|
6971
6967
|
function InstantiateModule(context, declarations, options) {
|
|
@@ -7010,8 +7006,8 @@ function NonNullableOperation(type) {
|
|
|
7010
7006
|
return ExcludeAction(type, excluded, {});
|
|
7011
7007
|
}
|
|
7012
7008
|
function NonNullableAction(type, options) {
|
|
7013
|
-
const
|
|
7014
|
-
return
|
|
7009
|
+
const result = CanInstantiate([type]) ? memory_exports.Update(NonNullableOperation(type), {}, options) : NonNullableDeferred(type, options);
|
|
7010
|
+
return result;
|
|
7015
7011
|
}
|
|
7016
7012
|
function NonNullableInstantiate(context, state, type, options) {
|
|
7017
7013
|
const instantiatedType = InstantiateType(context, state, type);
|
|
@@ -7049,8 +7045,8 @@ var init_omit = __esm({
|
|
|
7049
7045
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/indexable/to_indexable.mjs
|
|
7050
7046
|
function ToIndexable(type) {
|
|
7051
7047
|
const collapsed = CollapseToObject(type);
|
|
7052
|
-
const
|
|
7053
|
-
return
|
|
7048
|
+
const result = IsObject2(collapsed) ? collapsed.properties : Unreachable();
|
|
7049
|
+
return result;
|
|
7054
7050
|
}
|
|
7055
7051
|
var init_to_indexable = __esm({
|
|
7056
7052
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/indexable/to_indexable.mjs"() {
|
|
@@ -7062,17 +7058,17 @@ var init_to_indexable = __esm({
|
|
|
7062
7058
|
|
|
7063
7059
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/omit/from_type.mjs
|
|
7064
7060
|
function FromKeys(properties, keys) {
|
|
7065
|
-
const
|
|
7066
|
-
return keys.includes(key) ?
|
|
7061
|
+
const result = guard_exports.Keys(properties).reduce((result2, key) => {
|
|
7062
|
+
return keys.includes(key) ? result2 : { ...result2, [key]: properties[key] };
|
|
7067
7063
|
}, {});
|
|
7068
|
-
return
|
|
7064
|
+
return result;
|
|
7069
7065
|
}
|
|
7070
7066
|
function FromType14(type, indexer) {
|
|
7071
7067
|
const indexable = ToIndexable(type);
|
|
7072
7068
|
const indexableKeys = ToIndexableKeys(indexer);
|
|
7073
7069
|
const omitted = FromKeys(indexable, indexableKeys);
|
|
7074
|
-
const
|
|
7075
|
-
return
|
|
7070
|
+
const result = _Object_(omitted);
|
|
7071
|
+
return result;
|
|
7076
7072
|
}
|
|
7077
7073
|
var init_from_type6 = __esm({
|
|
7078
7074
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/omit/from_type.mjs"() {
|
|
@@ -7085,8 +7081,8 @@ var init_from_type6 = __esm({
|
|
|
7085
7081
|
|
|
7086
7082
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/omit/instantiate.mjs
|
|
7087
7083
|
function OmitAction(type, indexer, options) {
|
|
7088
|
-
const
|
|
7089
|
-
return
|
|
7084
|
+
const result = CanInstantiate([type, indexer]) ? memory_exports.Update(FromType14(type, indexer), {}, options) : OmitDeferred(type, indexer, options);
|
|
7085
|
+
return result;
|
|
7090
7086
|
}
|
|
7091
7087
|
function OmitInstantiate(context, state, type, indexer, options) {
|
|
7092
7088
|
const instantiatedType = InstantiateType(context, state, type);
|
|
@@ -7120,12 +7116,12 @@ var init_parameters2 = __esm({
|
|
|
7120
7116
|
function ParametersOperation(type) {
|
|
7121
7117
|
const parameters = IsFunction2(type) ? type["parameters"] : [];
|
|
7122
7118
|
const instantiatedParameters = InstantiateElements({}, State([], []), parameters);
|
|
7123
|
-
const
|
|
7124
|
-
return
|
|
7119
|
+
const result = Tuple(instantiatedParameters);
|
|
7120
|
+
return result;
|
|
7125
7121
|
}
|
|
7126
7122
|
function ParametersAction(type, options) {
|
|
7127
|
-
const
|
|
7128
|
-
return
|
|
7123
|
+
const result = CanInstantiate([type]) ? memory_exports.Update(ParametersOperation(type), {}, options) : ParametersDeferred(type, options);
|
|
7124
|
+
return result;
|
|
7129
7125
|
}
|
|
7130
7126
|
function ParametersInstantiate(context, state, type, options) {
|
|
7131
7127
|
const instantiatedType = InstantiateType(context, state, type);
|
|
@@ -7161,8 +7157,8 @@ var init_partial = __esm({
|
|
|
7161
7157
|
function FromCyclic3(defs, ref) {
|
|
7162
7158
|
const target = CyclicTarget(defs, ref);
|
|
7163
7159
|
const partial = FromType15(target);
|
|
7164
|
-
const
|
|
7165
|
-
return
|
|
7160
|
+
const result = Cyclic(memory_exports.Assign(defs, { [ref]: partial }), ref);
|
|
7161
|
+
return result;
|
|
7166
7162
|
}
|
|
7167
7163
|
var init_from_cyclic3 = __esm({
|
|
7168
7164
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/partial/from_cyclic.mjs"() {
|
|
@@ -7176,8 +7172,8 @@ var init_from_cyclic3 = __esm({
|
|
|
7176
7172
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/partial/from_dependent.mjs
|
|
7177
7173
|
function FromDependent3(if_, then_, else_) {
|
|
7178
7174
|
const evaluated = EvaluateDependent(if_, then_, else_);
|
|
7179
|
-
const
|
|
7180
|
-
return
|
|
7175
|
+
const result = FromType15(evaluated);
|
|
7176
|
+
return result;
|
|
7181
7177
|
}
|
|
7182
7178
|
var init_from_dependent3 = __esm({
|
|
7183
7179
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/partial/from_dependent.mjs"() {
|
|
@@ -7189,8 +7185,8 @@ var init_from_dependent3 = __esm({
|
|
|
7189
7185
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/partial/from_intersect.mjs
|
|
7190
7186
|
function FromIntersect3(types) {
|
|
7191
7187
|
const evaluated = EvaluateIntersect(types);
|
|
7192
|
-
const
|
|
7193
|
-
return
|
|
7188
|
+
const result = FromType15(evaluated);
|
|
7189
|
+
return result;
|
|
7194
7190
|
}
|
|
7195
7191
|
var init_from_intersect3 = __esm({
|
|
7196
7192
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/partial/from_intersect.mjs"() {
|
|
@@ -7201,8 +7197,8 @@ var init_from_intersect3 = __esm({
|
|
|
7201
7197
|
|
|
7202
7198
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/partial/from_union.mjs
|
|
7203
7199
|
function FromUnion6(types) {
|
|
7204
|
-
const
|
|
7205
|
-
return Union(
|
|
7200
|
+
const result = types.map((type) => FromType15(type));
|
|
7201
|
+
return Union(result);
|
|
7206
7202
|
}
|
|
7207
7203
|
var init_from_union4 = __esm({
|
|
7208
7204
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/partial/from_union.mjs"() {
|
|
@@ -7213,11 +7209,11 @@ var init_from_union4 = __esm({
|
|
|
7213
7209
|
|
|
7214
7210
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/partial/from_object.mjs
|
|
7215
7211
|
function FromObject7(properties) {
|
|
7216
|
-
const mapped = guard_exports.Keys(properties).reduce((
|
|
7217
|
-
return { ...
|
|
7212
|
+
const mapped = guard_exports.Keys(properties).reduce((result2, left) => {
|
|
7213
|
+
return { ...result2, [left]: AddOptional(properties[left]) };
|
|
7218
7214
|
}, {});
|
|
7219
|
-
const
|
|
7220
|
-
return
|
|
7215
|
+
const result = _Object_(mapped);
|
|
7216
|
+
return result;
|
|
7221
7217
|
}
|
|
7222
7218
|
var init_from_object4 = __esm({
|
|
7223
7219
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/partial/from_object.mjs"() {
|
|
@@ -7248,8 +7244,8 @@ var init_from_type7 = __esm({
|
|
|
7248
7244
|
|
|
7249
7245
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/partial/instantiate.mjs
|
|
7250
7246
|
function PartialAction(type, options) {
|
|
7251
|
-
const
|
|
7252
|
-
return
|
|
7247
|
+
const result = CanInstantiate([type]) ? memory_exports.Update(FromType15(type), {}, options) : PartialDeferred(type, options);
|
|
7248
|
+
return result;
|
|
7253
7249
|
}
|
|
7254
7250
|
function PartialInstantiate(context, state, type, options) {
|
|
7255
7251
|
const instantiatedType = InstantiateType(context, state, type);
|
|
@@ -7283,17 +7279,17 @@ var init_pick = __esm({
|
|
|
7283
7279
|
|
|
7284
7280
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/pick/from_type.mjs
|
|
7285
7281
|
function FromKeys2(properties, keys) {
|
|
7286
|
-
const
|
|
7287
|
-
return keys.includes(key) ? memory_exports.Assign(
|
|
7282
|
+
const result = guard_exports.Keys(properties).reduce((result2, key) => {
|
|
7283
|
+
return keys.includes(key) ? memory_exports.Assign(result2, { [key]: properties[key] }) : result2;
|
|
7288
7284
|
}, {});
|
|
7289
|
-
return
|
|
7285
|
+
return result;
|
|
7290
7286
|
}
|
|
7291
7287
|
function FromType16(type, indexer) {
|
|
7292
7288
|
const indexable = ToIndexable(type);
|
|
7293
7289
|
const keys = ToIndexableKeys(indexer);
|
|
7294
7290
|
const applied = FromKeys2(indexable, keys);
|
|
7295
|
-
const
|
|
7296
|
-
return
|
|
7291
|
+
const result = _Object_(applied);
|
|
7292
|
+
return result;
|
|
7297
7293
|
}
|
|
7298
7294
|
var init_from_type8 = __esm({
|
|
7299
7295
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/pick/from_type.mjs"() {
|
|
@@ -7307,8 +7303,8 @@ var init_from_type8 = __esm({
|
|
|
7307
7303
|
|
|
7308
7304
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/pick/instantiate.mjs
|
|
7309
7305
|
function PickAction(type, indexer, options) {
|
|
7310
|
-
const
|
|
7311
|
-
return
|
|
7306
|
+
const result = CanInstantiate([type, indexer]) ? memory_exports.Update(FromType16(type, indexer), {}, options) : PickDeferred(type, indexer, options);
|
|
7307
|
+
return result;
|
|
7312
7308
|
}
|
|
7313
7309
|
function PickInstantiate(context, state, type, indexer, options) {
|
|
7314
7310
|
const instantiatedType = InstantiateType(context, state, type);
|
|
@@ -7342,8 +7338,8 @@ var init_readonly_object = __esm({
|
|
|
7342
7338
|
|
|
7343
7339
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs
|
|
7344
7340
|
function FromArray5(type) {
|
|
7345
|
-
const
|
|
7346
|
-
return
|
|
7341
|
+
const result = AddImmutable(_Array_(type));
|
|
7342
|
+
return result;
|
|
7347
7343
|
}
|
|
7348
7344
|
var init_from_array3 = __esm({
|
|
7349
7345
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs"() {
|
|
@@ -7356,8 +7352,8 @@ var init_from_array3 = __esm({
|
|
|
7356
7352
|
function FromCyclic4(defs, ref) {
|
|
7357
7353
|
const target = CyclicTarget(defs, ref);
|
|
7358
7354
|
const partial = FromType17(target);
|
|
7359
|
-
const
|
|
7360
|
-
return
|
|
7355
|
+
const result = Cyclic(memory_exports.Assign(defs, { [ref]: partial }), ref);
|
|
7356
|
+
return result;
|
|
7361
7357
|
}
|
|
7362
7358
|
var init_from_cyclic4 = __esm({
|
|
7363
7359
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/readonly_object/from_cyclic.mjs"() {
|
|
@@ -7371,8 +7367,8 @@ var init_from_cyclic4 = __esm({
|
|
|
7371
7367
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/readonly_object/from_dependent.mjs
|
|
7372
7368
|
function FromDependent4(if_, then_, else_) {
|
|
7373
7369
|
const evaluated = EvaluateDependent(if_, then_, else_);
|
|
7374
|
-
const
|
|
7375
|
-
return
|
|
7370
|
+
const result = FromType17(evaluated);
|
|
7371
|
+
return result;
|
|
7376
7372
|
}
|
|
7377
7373
|
var init_from_dependent4 = __esm({
|
|
7378
7374
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/readonly_object/from_dependent.mjs"() {
|
|
@@ -7384,8 +7380,8 @@ var init_from_dependent4 = __esm({
|
|
|
7384
7380
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs
|
|
7385
7381
|
function FromIntersect4(types) {
|
|
7386
7382
|
const evaluated = EvaluateIntersect(types);
|
|
7387
|
-
const
|
|
7388
|
-
return
|
|
7383
|
+
const result = FromType17(evaluated);
|
|
7384
|
+
return result;
|
|
7389
7385
|
}
|
|
7390
7386
|
var init_from_intersect4 = __esm({
|
|
7391
7387
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs"() {
|
|
@@ -7396,11 +7392,11 @@ var init_from_intersect4 = __esm({
|
|
|
7396
7392
|
|
|
7397
7393
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs
|
|
7398
7394
|
function FromObject8(properties) {
|
|
7399
|
-
const mapped = guard_exports.Keys(properties).reduce((
|
|
7400
|
-
return { ...
|
|
7395
|
+
const mapped = guard_exports.Keys(properties).reduce((result2, left) => {
|
|
7396
|
+
return { ...result2, [left]: AddReadonly(properties[left]) };
|
|
7401
7397
|
}, {});
|
|
7402
|
-
const
|
|
7403
|
-
return
|
|
7398
|
+
const result = _Object_(mapped);
|
|
7399
|
+
return result;
|
|
7404
7400
|
}
|
|
7405
7401
|
var init_from_object5 = __esm({
|
|
7406
7402
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs"() {
|
|
@@ -7412,8 +7408,8 @@ var init_from_object5 = __esm({
|
|
|
7412
7408
|
|
|
7413
7409
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs
|
|
7414
7410
|
function FromTuple4(types) {
|
|
7415
|
-
const
|
|
7416
|
-
return
|
|
7411
|
+
const result = AddImmutable(Tuple(types));
|
|
7412
|
+
return result;
|
|
7417
7413
|
}
|
|
7418
7414
|
var init_from_tuple4 = __esm({
|
|
7419
7415
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs"() {
|
|
@@ -7424,8 +7420,8 @@ var init_from_tuple4 = __esm({
|
|
|
7424
7420
|
|
|
7425
7421
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/readonly_object/from_union.mjs
|
|
7426
7422
|
function FromUnion7(types) {
|
|
7427
|
-
const
|
|
7428
|
-
return Union(
|
|
7423
|
+
const result = types.map((type) => FromType17(type));
|
|
7424
|
+
return Union(result);
|
|
7429
7425
|
}
|
|
7430
7426
|
var init_from_union5 = __esm({
|
|
7431
7427
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/readonly_object/from_union.mjs"() {
|
|
@@ -7459,8 +7455,8 @@ var init_from_type9 = __esm({
|
|
|
7459
7455
|
|
|
7460
7456
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/readonly_object/instantiate.mjs
|
|
7461
7457
|
function ReadonlyObjectAction(type, options) {
|
|
7462
|
-
const
|
|
7463
|
-
return
|
|
7458
|
+
const result = CanInstantiate([type]) ? memory_exports.Update(FromType17(type), {}, options) : ReadonlyObjectDeferred(type);
|
|
7459
|
+
return result;
|
|
7464
7460
|
}
|
|
7465
7461
|
function ReadonlyObjectInstantiate(context, state, type, options) {
|
|
7466
7462
|
const instantiatedType = InstantiateType(context, state, type);
|
|
@@ -7490,8 +7486,8 @@ var init_instantiate23 = __esm({
|
|
|
7490
7486
|
function FromCyclic5(defs, ref) {
|
|
7491
7487
|
const target = CyclicTarget(defs, ref);
|
|
7492
7488
|
const partial = FromType18(target);
|
|
7493
|
-
const
|
|
7494
|
-
return
|
|
7489
|
+
const result = Cyclic(memory_exports.Assign(defs, { [ref]: partial }), ref);
|
|
7490
|
+
return result;
|
|
7495
7491
|
}
|
|
7496
7492
|
var init_from_cyclic5 = __esm({
|
|
7497
7493
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/required/from_cyclic.mjs"() {
|
|
@@ -7505,8 +7501,8 @@ var init_from_cyclic5 = __esm({
|
|
|
7505
7501
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/required/from_dependent.mjs
|
|
7506
7502
|
function FromDependent5(if_, then_, else_) {
|
|
7507
7503
|
const evaluated = EvaluateDependent(if_, then_, else_);
|
|
7508
|
-
const
|
|
7509
|
-
return
|
|
7504
|
+
const result = FromType18(evaluated);
|
|
7505
|
+
return result;
|
|
7510
7506
|
}
|
|
7511
7507
|
var init_from_dependent5 = __esm({
|
|
7512
7508
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/required/from_dependent.mjs"() {
|
|
@@ -7518,8 +7514,8 @@ var init_from_dependent5 = __esm({
|
|
|
7518
7514
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/required/from_intersect.mjs
|
|
7519
7515
|
function FromIntersect5(types) {
|
|
7520
7516
|
const evaluated = EvaluateIntersect(types);
|
|
7521
|
-
const
|
|
7522
|
-
return
|
|
7517
|
+
const result = FromType18(evaluated);
|
|
7518
|
+
return result;
|
|
7523
7519
|
}
|
|
7524
7520
|
var init_from_intersect5 = __esm({
|
|
7525
7521
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/required/from_intersect.mjs"() {
|
|
@@ -7530,8 +7526,8 @@ var init_from_intersect5 = __esm({
|
|
|
7530
7526
|
|
|
7531
7527
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/required/from_union.mjs
|
|
7532
7528
|
function FromUnion8(types) {
|
|
7533
|
-
const
|
|
7534
|
-
return Union(
|
|
7529
|
+
const result = types.map((type) => FromType18(type));
|
|
7530
|
+
return Union(result);
|
|
7535
7531
|
}
|
|
7536
7532
|
var init_from_union6 = __esm({
|
|
7537
7533
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/required/from_union.mjs"() {
|
|
@@ -7542,11 +7538,11 @@ var init_from_union6 = __esm({
|
|
|
7542
7538
|
|
|
7543
7539
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/required/from_object.mjs
|
|
7544
7540
|
function FromObject9(properties) {
|
|
7545
|
-
const mapped = guard_exports.Keys(properties).reduce((
|
|
7546
|
-
return { ...
|
|
7541
|
+
const mapped = guard_exports.Keys(properties).reduce((result2, left) => {
|
|
7542
|
+
return { ...result2, [left]: RemoveOptional(properties[left]) };
|
|
7547
7543
|
}, {});
|
|
7548
|
-
const
|
|
7549
|
-
return
|
|
7544
|
+
const result = _Object_(mapped);
|
|
7545
|
+
return result;
|
|
7550
7546
|
}
|
|
7551
7547
|
var init_from_object6 = __esm({
|
|
7552
7548
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/required/from_object.mjs"() {
|
|
@@ -7591,8 +7587,8 @@ var init_required = __esm({
|
|
|
7591
7587
|
|
|
7592
7588
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/required/instantiate.mjs
|
|
7593
7589
|
function RequiredAction(type, options) {
|
|
7594
|
-
const
|
|
7595
|
-
return
|
|
7590
|
+
const result = CanInstantiate([type]) ? memory_exports.Update(FromType18(type), {}, options) : RequiredDeferred(type, options);
|
|
7591
|
+
return result;
|
|
7596
7592
|
}
|
|
7597
7593
|
function RequiredInstantiate(context, state, type, options) {
|
|
7598
7594
|
const instaniatedType = InstantiateType(context, state, type);
|
|
@@ -7626,8 +7622,8 @@ function ReturnTypeOperation(type) {
|
|
|
7626
7622
|
return IsFunction2(type) ? type["returnType"] : Never();
|
|
7627
7623
|
}
|
|
7628
7624
|
function ReturnTypeAction(type, options) {
|
|
7629
|
-
const
|
|
7630
|
-
return
|
|
7625
|
+
const result = CanInstantiate([type]) ? memory_exports.Update(ReturnTypeOperation(type), {}, options) : ReturnTypeDeferred(type, options);
|
|
7626
|
+
return result;
|
|
7631
7627
|
}
|
|
7632
7628
|
function ReturnTypeInstantiate(context, state, type, options = {}) {
|
|
7633
7629
|
const instantiatedType = InstantiateType(context, state, type);
|
|
@@ -7659,8 +7655,8 @@ var init_with = __esm({
|
|
|
7659
7655
|
|
|
7660
7656
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/with/instantiate.mjs
|
|
7661
7657
|
function WithAction(type, options) {
|
|
7662
|
-
const
|
|
7663
|
-
return
|
|
7658
|
+
const result = CanInstantiate([type]) ? memory_exports.Update(type, {}, options) : WithDeferred(type, options);
|
|
7659
|
+
return result;
|
|
7664
7660
|
}
|
|
7665
7661
|
function WithInstantiate(context, state, type, options) {
|
|
7666
7662
|
const instaniatedType = InstantiateType(context, state, type);
|
|
@@ -7676,14 +7672,14 @@ var init_instantiate26 = __esm({
|
|
|
7676
7672
|
|
|
7677
7673
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/rest/spread.mjs
|
|
7678
7674
|
function SpreadElement(type) {
|
|
7679
|
-
const
|
|
7680
|
-
return
|
|
7675
|
+
const result = IsRest(type) ? IsTuple(type.items) ? RestSpread(type.items.items) : IsInfer(type.items) ? [type] : IsRef(type.items) ? [type] : [Never()] : [type];
|
|
7676
|
+
return result;
|
|
7681
7677
|
}
|
|
7682
7678
|
function RestSpread(types) {
|
|
7683
|
-
const
|
|
7684
|
-
return [...
|
|
7679
|
+
const result = types.reduce((result2, left) => {
|
|
7680
|
+
return [...result2, ...SpreadElement(left)];
|
|
7685
7681
|
}, []);
|
|
7686
|
-
return
|
|
7682
|
+
return result;
|
|
7687
7683
|
}
|
|
7688
7684
|
var init_spread = __esm({
|
|
7689
7685
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/rest/spread.mjs"() {
|
|
@@ -7710,14 +7706,14 @@ function CanInstantiate(types) {
|
|
|
7710
7706
|
return guard_exports.ShiftLeft(types, (left, right) => IsRef(left) ? false : CanInstantiate(right), () => true);
|
|
7711
7707
|
}
|
|
7712
7708
|
function InstantiateProperties(context, state, properties) {
|
|
7713
|
-
return guard_exports.Keys(properties).reduce((
|
|
7714
|
-
return { ...
|
|
7709
|
+
return guard_exports.Keys(properties).reduce((result, key) => {
|
|
7710
|
+
return { ...result, [key]: InstantiateType(context, state, properties[key]) };
|
|
7715
7711
|
}, {});
|
|
7716
7712
|
}
|
|
7717
7713
|
function InstantiateElements(context, state, types) {
|
|
7718
7714
|
const elements = InstantiateTypes(context, state, types);
|
|
7719
|
-
const
|
|
7720
|
-
return
|
|
7715
|
+
const result = RestSpread(elements);
|
|
7716
|
+
return result;
|
|
7721
7717
|
}
|
|
7722
7718
|
function InstantiateTypes(context, state, types) {
|
|
7723
7719
|
return types.map((type) => InstantiateType(context, state, type));
|
|
@@ -7743,8 +7739,8 @@ function InstantiateImmediate(context, state, type) {
|
|
|
7743
7739
|
return withModifiers;
|
|
7744
7740
|
}
|
|
7745
7741
|
function InstantiateType(context, state, type) {
|
|
7746
|
-
const
|
|
7747
|
-
return
|
|
7742
|
+
const result = IsDeferred(type) ? InstantiateDeferred(context, state, type.action, type.parameters, type.options) : InstantiateImmediate(context, state, type);
|
|
7743
|
+
return result;
|
|
7748
7744
|
}
|
|
7749
7745
|
function Instantiate(context, type) {
|
|
7750
7746
|
return InstantiateType(context, State([], []), type);
|
|
@@ -7814,8 +7810,8 @@ function AddImmutableOperation(type) {
|
|
|
7814
7810
|
return memory_exports.Update(type, { "~immutable": true }, {});
|
|
7815
7811
|
}
|
|
7816
7812
|
function AddImmutableAction(type, options) {
|
|
7817
|
-
const
|
|
7818
|
-
return
|
|
7813
|
+
const result = memory_exports.Update(AddImmutableOperation(type), {}, options);
|
|
7814
|
+
return result;
|
|
7819
7815
|
}
|
|
7820
7816
|
function AddImmutableInstantiate(context, state, type, options) {
|
|
7821
7817
|
const instantiatedType = InstantiateType(context, state, type);
|
|
@@ -8053,18 +8049,18 @@ var init_pick2 = __esm({
|
|
|
8053
8049
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/priority/priority.mjs
|
|
8054
8050
|
function Comparer(left, right) {
|
|
8055
8051
|
const compareResult = Compare(left, right);
|
|
8056
|
-
const
|
|
8057
|
-
return
|
|
8052
|
+
const result = guard_exports.IsEqual(compareResult, "right-inside") ? 1 : guard_exports.IsEqual(compareResult, "disjoint") ? 1 : 0;
|
|
8053
|
+
return result;
|
|
8058
8054
|
}
|
|
8059
|
-
function Insert(type, types,
|
|
8060
|
-
return guard_exports.ShiftLeft(types, (left, right) => guard_exports.IsEqual(Comparer(type, left), 1) ? Insert(type, right, [...
|
|
8055
|
+
function Insert(type, types, result = []) {
|
|
8056
|
+
return guard_exports.ShiftLeft(types, (left, right) => guard_exports.IsEqual(Comparer(type, left), 1) ? Insert(type, right, [...result, left]) : [...result, type, ...types], () => [...result, type]);
|
|
8061
8057
|
}
|
|
8062
|
-
function Sort(types,
|
|
8063
|
-
return guard_exports.ShiftLeft(types, (left, right) => Sort(right, Insert(left,
|
|
8058
|
+
function Sort(types, result = []) {
|
|
8059
|
+
return guard_exports.ShiftLeft(types, (left, right) => Sort(right, Insert(left, result)), () => result);
|
|
8064
8060
|
}
|
|
8065
8061
|
function Priority(types) {
|
|
8066
|
-
const
|
|
8067
|
-
return
|
|
8062
|
+
const result = Sort(types);
|
|
8063
|
+
return result;
|
|
8068
8064
|
}
|
|
8069
8065
|
var init_priority = __esm({
|
|
8070
8066
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/type/engine/priority/priority.mjs"() {
|
|
@@ -8192,8 +8188,8 @@ function Script2(...args) {
|
|
|
8192
8188
|
3: (context2, script, options2) => [context2, script, options2],
|
|
8193
8189
|
1: (script) => [{}, script, {}]
|
|
8194
8190
|
});
|
|
8195
|
-
const
|
|
8196
|
-
const parsed = guard_exports.IsArray(
|
|
8191
|
+
const result = Script(input);
|
|
8192
|
+
const parsed = guard_exports.IsArray(result) && guard_exports.IsEqual(result.length, 2) ? InstantiateType(context, State([], []), result[0]) : Never();
|
|
8197
8193
|
return memory_exports.Update(parsed, {}, options);
|
|
8198
8194
|
}
|
|
8199
8195
|
var init_script = __esm({
|
|
@@ -9440,21 +9436,21 @@ var init_reducer = __esm({
|
|
|
9440
9436
|
|
|
9441
9437
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/schema/engine/allOf.mjs
|
|
9442
9438
|
function CheckAllOf(stack, context, schema, value) {
|
|
9443
|
-
const results = schema.allOf.reduce((
|
|
9439
|
+
const results = schema.allOf.reduce((result, schema2) => {
|
|
9444
9440
|
const nextContext = new CheckContext();
|
|
9445
|
-
return CheckSchema(stack, nextContext, schema2, value) ? [...
|
|
9441
|
+
return CheckSchema(stack, nextContext, schema2, value) ? [...result, nextContext] : result;
|
|
9446
9442
|
}, []);
|
|
9447
9443
|
return guard_exports.IsEqual(results.length, schema.allOf.length) && context.Merge(results);
|
|
9448
9444
|
}
|
|
9449
9445
|
function ErrorAllOf(stack, context, schemaPath, instancePath, schema, value) {
|
|
9450
9446
|
const failedContexts = [];
|
|
9451
|
-
const results = schema.allOf.reduce((
|
|
9447
|
+
const results = schema.allOf.reduce((result, schema2, index) => {
|
|
9452
9448
|
const nextSchemaPath = `${schemaPath}/allOf/${index}`;
|
|
9453
9449
|
const nextContext = new AccumulatedErrorContext();
|
|
9454
9450
|
const isSchema = ErrorSchema(stack, nextContext, nextSchemaPath, instancePath, schema2, value);
|
|
9455
9451
|
if (!isSchema)
|
|
9456
9452
|
failedContexts.push(nextContext);
|
|
9457
|
-
return isSchema ? [...
|
|
9453
|
+
return isSchema ? [...result, nextContext] : result;
|
|
9458
9454
|
}, []);
|
|
9459
9455
|
const isAllOf = guard_exports.IsEqual(results.length, schema.allOf.length) && context.Merge(results);
|
|
9460
9456
|
if (!isAllOf)
|
|
@@ -9472,21 +9468,21 @@ var init_allOf2 = __esm({
|
|
|
9472
9468
|
|
|
9473
9469
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/schema/engine/anyOf.mjs
|
|
9474
9470
|
function CheckAnyOf(stack, context, schema, value) {
|
|
9475
|
-
const results = schema.anyOf.reduce((
|
|
9471
|
+
const results = schema.anyOf.reduce((result, schema2) => {
|
|
9476
9472
|
const nextContext = new CheckContext();
|
|
9477
|
-
return CheckSchema(stack, nextContext, schema2, value) ? [...
|
|
9473
|
+
return CheckSchema(stack, nextContext, schema2, value) ? [...result, nextContext] : result;
|
|
9478
9474
|
}, []);
|
|
9479
9475
|
return guard_exports.IsGreaterThan(results.length, 0) && context.Merge(results);
|
|
9480
9476
|
}
|
|
9481
9477
|
function ErrorAnyOf(stack, context, schemaPath, instancePath, schema, value) {
|
|
9482
9478
|
const failedContexts = [];
|
|
9483
|
-
const results = schema.anyOf.reduce((
|
|
9479
|
+
const results = schema.anyOf.reduce((result, schema2, index) => {
|
|
9484
9480
|
const nextContext = new AccumulatedErrorContext();
|
|
9485
9481
|
const nextSchemaPath = `${schemaPath}/anyOf/${index}`;
|
|
9486
9482
|
const isSchema = ErrorSchema(stack, nextContext, nextSchemaPath, instancePath, schema2, value);
|
|
9487
9483
|
if (!isSchema)
|
|
9488
9484
|
failedContexts.push(nextContext);
|
|
9489
|
-
return isSchema ? [...
|
|
9485
|
+
return isSchema ? [...result, nextContext] : result;
|
|
9490
9486
|
}, []);
|
|
9491
9487
|
const isAnyOf = guard_exports.IsGreaterThan(results.length, 0) && context.Merge(results);
|
|
9492
9488
|
if (!isAnyOf)
|
|
@@ -10974,16 +10970,16 @@ var init_not2 = __esm({
|
|
|
10974
10970
|
|
|
10975
10971
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/schema/engine/oneOf.mjs
|
|
10976
10972
|
function CheckOneOf(stack, context, schema, value) {
|
|
10977
|
-
const passedContexts = schema.oneOf.reduce((
|
|
10973
|
+
const passedContexts = schema.oneOf.reduce((result, schema2) => {
|
|
10978
10974
|
const nextContext = new CheckContext();
|
|
10979
|
-
return CheckSchema(stack, nextContext, schema2, value) ? [...
|
|
10975
|
+
return CheckSchema(stack, nextContext, schema2, value) ? [...result, nextContext] : result;
|
|
10980
10976
|
}, []);
|
|
10981
10977
|
return guard_exports.IsEqual(passedContexts.length, 1) && context.Merge(passedContexts);
|
|
10982
10978
|
}
|
|
10983
10979
|
function ErrorOneOf(stack, context, schemaPath, instancePath, schema, value) {
|
|
10984
10980
|
const failedContexts = [];
|
|
10985
10981
|
const passingSchemas = [];
|
|
10986
|
-
const passedContexts = schema.oneOf.reduce((
|
|
10982
|
+
const passedContexts = schema.oneOf.reduce((result, schema2, index) => {
|
|
10987
10983
|
const nextContext = new AccumulatedErrorContext();
|
|
10988
10984
|
const nextSchemaPath = `${schemaPath}/oneOf/${index}`;
|
|
10989
10985
|
const isSchema = ErrorSchema(stack, nextContext, nextSchemaPath, instancePath, schema2, value);
|
|
@@ -10991,7 +10987,7 @@ function ErrorOneOf(stack, context, schemaPath, instancePath, schema, value) {
|
|
|
10991
10987
|
passingSchemas.push(index);
|
|
10992
10988
|
if (!isSchema)
|
|
10993
10989
|
failedContexts.push(nextContext);
|
|
10994
|
-
return isSchema ? [...
|
|
10990
|
+
return isSchema ? [...result, nextContext] : result;
|
|
10995
10991
|
}, []);
|
|
10996
10992
|
const isOneOf = guard_exports.IsEqual(passedContexts.length, 1) && context.Merge(passedContexts);
|
|
10997
10993
|
if (!isOneOf && guard_exports.IsEqual(passingSchemas.length, 0))
|
|
@@ -11176,20 +11172,20 @@ var init_recursiveRef2 = __esm({
|
|
|
11176
11172
|
function CheckRef(stack, context, schema, value) {
|
|
11177
11173
|
const target = stack.Ref(schema) ?? false;
|
|
11178
11174
|
const nextContext = new CheckContext();
|
|
11179
|
-
const
|
|
11180
|
-
if (
|
|
11175
|
+
const result = IsSchema2(target) && CheckSchema(stack, nextContext, target, value);
|
|
11176
|
+
if (result)
|
|
11181
11177
|
context.Merge([nextContext]);
|
|
11182
|
-
return
|
|
11178
|
+
return result;
|
|
11183
11179
|
}
|
|
11184
11180
|
function ErrorRef(stack, context, _schemaPath, instancePath, schema, value) {
|
|
11185
11181
|
const target = stack.Ref(schema) ?? false;
|
|
11186
11182
|
const nextContext = new AccumulatedErrorContext();
|
|
11187
|
-
const
|
|
11188
|
-
if (
|
|
11183
|
+
const result = IsSchema2(target) && ErrorSchema(stack, nextContext, "#", instancePath, target, value);
|
|
11184
|
+
if (result)
|
|
11189
11185
|
context.Merge([nextContext]);
|
|
11190
|
-
if (!
|
|
11186
|
+
if (!result)
|
|
11191
11187
|
nextContext.GetErrors().forEach((error) => context.AddError(error));
|
|
11192
|
-
return
|
|
11188
|
+
return result;
|
|
11193
11189
|
}
|
|
11194
11190
|
var init_ref4 = __esm({
|
|
11195
11191
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/schema/engine/ref.mjs"() {
|
|
@@ -11338,12 +11334,12 @@ function ErrorUniqueItems(_stack, context, schemaPath, instancePath, schema, val
|
|
|
11338
11334
|
if (!IsValid5(schema))
|
|
11339
11335
|
return true;
|
|
11340
11336
|
const set = /* @__PURE__ */ new Set();
|
|
11341
|
-
const duplicateItems = value.reduce((
|
|
11337
|
+
const duplicateItems = value.reduce((result, value2, index) => {
|
|
11342
11338
|
const hash = hash_exports.Hash(value2);
|
|
11343
11339
|
if (set.has(hash))
|
|
11344
|
-
return [...
|
|
11340
|
+
return [...result, index];
|
|
11345
11341
|
set.add(hash);
|
|
11346
|
-
return
|
|
11342
|
+
return result;
|
|
11347
11343
|
}, []);
|
|
11348
11344
|
const isUniqueItems = guard_exports.IsEqual(duplicateItems.length, 0);
|
|
11349
11345
|
return isUniqueItems || context.AddError({
|
|
@@ -11366,18 +11362,18 @@ function CheckSchemaPushStack(stack, context, schema, value) {
|
|
|
11366
11362
|
}
|
|
11367
11363
|
function CheckSchema(stack, context, schema, value) {
|
|
11368
11364
|
stack.Push(schema);
|
|
11369
|
-
const
|
|
11365
|
+
const result = IsSchemaBoolean(schema) ? CheckSchemaBoolean(stack, context, schema, value) : (!IsType(schema) || CheckType(stack, context, schema, value)) && (!(guard_exports.IsObject(value) && !guard_exports.IsArray(value)) || (!IsRequired(schema) || CheckRequired(stack, context, schema, value)) && (!IsAdditionalProperties(schema) || CheckAdditionalProperties(stack, context, schema, value)) && (!IsDependencies(schema) || CheckDependencies(stack, context, schema, value)) && (!IsDependentRequired(schema) || CheckDependentRequired(stack, context, schema, value)) && (!IsDependentSchemas(schema) || CheckDependentSchemas(stack, context, schema, value)) && (!IsPatternProperties(schema) || CheckPatternProperties(stack, context, schema, value)) && (!IsProperties(schema) || CheckProperties(stack, context, schema, value)) && (!IsPropertyNames(schema) || CheckPropertyNames(stack, context, schema, value)) && (!IsMinProperties(schema) || CheckMinProperties(stack, context, schema, value)) && (!IsMaxProperties(schema) || CheckMaxProperties(stack, context, schema, value))) && (!guard_exports.IsArray(value) || (!IsAdditionalItems(schema) || CheckAdditionalItems(stack, context, schema, value)) && (!IsContains(schema) || CheckContains(stack, context, schema, value)) && (!IsItems(schema) || CheckItems(stack, context, schema, value)) && (!IsMaxContains(schema) || CheckMaxContains(stack, context, schema, value)) && (!IsMaxItems(schema) || CheckMaxItems(stack, context, schema, value)) && (!IsMinContains(schema) || CheckMinContains(stack, context, schema, value)) && (!IsMinItems(schema) || CheckMinItems(stack, context, schema, value)) && (!IsPrefixItems(schema) || CheckPrefixItems(stack, context, schema, value)) && (!IsUniqueItems(schema) || CheckUniqueItems(stack, context, schema, value))) && (!guard_exports.IsString(value) || (!IsMaxLength3(schema) || CheckMaxLength(stack, context, schema, value)) && (!IsMinLength3(schema) || CheckMinLength(stack, context, schema, value)) && (!IsFormat(schema) || CheckFormat(stack, context, schema, value)) && (!IsPattern(schema) || CheckPattern(stack, context, schema, value))) && (!(guard_exports.IsNumber(value) || guard_exports.IsBigInt(value)) || (!IsExclusiveMaximum(schema) || CheckExclusiveMaximum(stack, context, schema, value)) && (!IsExclusiveMinimum(schema) || CheckExclusiveMinimum(stack, context, schema, value)) && (!IsMaximum(schema) || CheckMaximum(stack, context, schema, value)) && (!IsMinimum(schema) || CheckMinimum(stack, context, schema, value)) && (!IsMultipleOf2(schema) || CheckMultipleOf(stack, context, schema, value))) && (!IsRef2(schema) || CheckRef(stack, context, schema, value)) && (!IsRecursiveRef(schema) || CheckRecursiveRef(stack, context, schema, value)) && (!IsDynamicRef(schema) || CheckDynamicRef(stack, context, schema, value)) && (!IsConst(schema) || CheckConst(stack, context, schema, value)) && (!IsEnum2(schema) || CheckEnum(stack, context, schema, value)) && (!IsIf(schema) || CheckIf(stack, context, schema, value)) && (!IsNot(schema) || CheckNot(stack, context, schema, value)) && (!IsAllOf(schema) || CheckAllOf(stack, context, schema, value)) && (!IsAnyOf(schema) || CheckAnyOf(stack, context, schema, value)) && (!IsOneOf(schema) || CheckOneOf(stack, context, schema, value)) && (!IsUnevaluatedItems(schema) || (!guard_exports.IsArray(value) || CheckUnevaluatedItems(stack, context, schema, value))) && (!IsUnevaluatedProperties(schema) || (!guard_exports.IsObject(value) || CheckUnevaluatedProperties(stack, context, schema, value))) && (!IsRefine2(schema) || CheckRefine(stack, context, schema, value));
|
|
11370
11366
|
stack.Pop(schema);
|
|
11371
|
-
return
|
|
11367
|
+
return result;
|
|
11372
11368
|
}
|
|
11373
11369
|
function ErrorSchemaPushStack(stack, context, schemaPath, instancePath, schema, value) {
|
|
11374
11370
|
return context.Push() && ErrorSchema(stack, context, schemaPath, instancePath, schema, value) && context.Pop();
|
|
11375
11371
|
}
|
|
11376
11372
|
function ErrorSchema(stack, context, schemaPath, instancePath, schema, value) {
|
|
11377
11373
|
stack.Push(schema);
|
|
11378
|
-
const
|
|
11374
|
+
const result = IsSchemaBoolean(schema) ? ErrorSchemaBoolean(stack, context, schemaPath, instancePath, schema, value) : !!(+(!IsType(schema) || ErrorType(stack, context, schemaPath, instancePath, schema, value)) & +(!(guard_exports.IsObject(value) && !guard_exports.IsArray(value)) || !!(+(!IsRequired(schema) || ErrorRequired(stack, context, schemaPath, instancePath, schema, value)) & +(!IsAdditionalProperties(schema) || ErrorAdditionalProperties(stack, context, schemaPath, instancePath, schema, value)) & +(!IsDependencies(schema) || ErrorDependencies(stack, context, schemaPath, instancePath, schema, value)) & +(!IsDependentRequired(schema) || ErrorDependentRequired(stack, context, schemaPath, instancePath, schema, value)) & +(!IsDependentSchemas(schema) || ErrorDependentSchemas(stack, context, schemaPath, instancePath, schema, value)) & +(!IsPatternProperties(schema) || ErrorPatternProperties(stack, context, schemaPath, instancePath, schema, value)) & +(!IsProperties(schema) || ErrorProperties(stack, context, schemaPath, instancePath, schema, value)) & +(!IsPropertyNames(schema) || ErrorPropertyNames(stack, context, schemaPath, instancePath, schema, value)) & +(!IsMinProperties(schema) || ErrorMinProperties(stack, context, schemaPath, instancePath, schema, value)) & +(!IsMaxProperties(schema) || ErrorMaxProperties(stack, context, schemaPath, instancePath, schema, value)))) & +(!guard_exports.IsArray(value) || !!(+(!IsAdditionalItems(schema) || ErrorAdditionalItems(stack, context, schemaPath, instancePath, schema, value)) & +(!IsContains(schema) || ErrorContains(stack, context, schemaPath, instancePath, schema, value)) & +(!IsItems(schema) || ErrorItems(stack, context, schemaPath, instancePath, schema, value)) & +(!IsMaxContains(schema) || ErrorMaxContains(stack, context, schemaPath, instancePath, schema, value)) & +(!IsMaxItems(schema) || ErrorMaxItems(stack, context, schemaPath, instancePath, schema, value)) & +(!IsMinContains(schema) || ErrorMinContains(stack, context, schemaPath, instancePath, schema, value)) & +(!IsMinItems(schema) || ErrorMinItems(stack, context, schemaPath, instancePath, schema, value)) & +(!IsPrefixItems(schema) || ErrorPrefixItems(stack, context, schemaPath, instancePath, schema, value)) & +(!IsUniqueItems(schema) || ErrorUniqueItems(stack, context, schemaPath, instancePath, schema, value)))) & +(!guard_exports.IsString(value) || !!(+(!IsMaxLength3(schema) || ErrorMaxLength(stack, context, schemaPath, instancePath, schema, value)) & +(!IsMinLength3(schema) || ErrorMinLength(stack, context, schemaPath, instancePath, schema, value)) & +(!IsFormat(schema) || ErrorFormat(stack, context, schemaPath, instancePath, schema, value)) & +(!IsPattern(schema) || ErrorPattern(stack, context, schemaPath, instancePath, schema, value)))) & +(!(guard_exports.IsNumber(value) || guard_exports.IsBigInt(value)) || !!(+(!IsExclusiveMaximum(schema) || ErrorExclusiveMaximum(stack, context, schemaPath, instancePath, schema, value)) & +(!IsExclusiveMinimum(schema) || ErrorExclusiveMinimum(stack, context, schemaPath, instancePath, schema, value)) & +(!IsMaximum(schema) || ErrorMaximum(stack, context, schemaPath, instancePath, schema, value)) & +(!IsMinimum(schema) || ErrorMinimum(stack, context, schemaPath, instancePath, schema, value)) & +(!IsMultipleOf2(schema) || ErrorMultipleOf(stack, context, schemaPath, instancePath, schema, value)))) & +(!IsRef2(schema) || ErrorRef(stack, context, schemaPath, instancePath, schema, value)) & +(!IsRecursiveRef(schema) || ErrorRecursiveRef(stack, context, schemaPath, instancePath, schema, value)) & +(!IsDynamicRef(schema) || ErrorDynamicRef(stack, context, schemaPath, instancePath, schema, value)) & +(!IsConst(schema) || ErrorConst(stack, context, schemaPath, instancePath, schema, value)) & +(!IsEnum2(schema) || ErrorEnum(stack, context, schemaPath, instancePath, schema, value)) & +(!IsIf(schema) || ErrorIf(stack, context, schemaPath, instancePath, schema, value)) & +(!IsNot(schema) || ErrorNot(stack, context, schemaPath, instancePath, schema, value)) & +(!IsAllOf(schema) || ErrorAllOf(stack, context, schemaPath, instancePath, schema, value)) & +(!IsAnyOf(schema) || ErrorAnyOf(stack, context, schemaPath, instancePath, schema, value)) & +(!IsOneOf(schema) || ErrorOneOf(stack, context, schemaPath, instancePath, schema, value)) & +(!IsUnevaluatedItems(schema) || (!guard_exports.IsArray(value) || ErrorUnevaluatedItems(stack, context, schemaPath, instancePath, schema, value))) & +(!IsUnevaluatedProperties(schema) || (!guard_exports.IsObject(value) || ErrorUnevaluatedProperties(stack, context, schemaPath, instancePath, schema, value)))) && (!IsRefine2(schema) || ErrorRefine(stack, context, schemaPath, instancePath, schema, value));
|
|
11379
11375
|
stack.Pop(schema);
|
|
11380
|
-
return
|
|
11376
|
+
return result;
|
|
11381
11377
|
}
|
|
11382
11378
|
var init_schema3 = __esm({
|
|
11383
11379
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/schema/engine/schema.mjs"() {
|
|
@@ -11576,40 +11572,40 @@ function MatchHash(schema, _base, ref) {
|
|
|
11576
11572
|
}
|
|
11577
11573
|
function Match4(schema, base, ref) {
|
|
11578
11574
|
if (IsId(schema)) {
|
|
11579
|
-
const
|
|
11580
|
-
if (!guard_exports.IsUndefined(
|
|
11581
|
-
return
|
|
11575
|
+
const result = MatchId(schema, base, ref);
|
|
11576
|
+
if (!guard_exports.IsUndefined(result))
|
|
11577
|
+
return result;
|
|
11582
11578
|
}
|
|
11583
11579
|
if (IsAnchor(schema)) {
|
|
11584
|
-
const
|
|
11585
|
-
if (!guard_exports.IsUndefined(
|
|
11586
|
-
return
|
|
11580
|
+
const result = MatchAnchor(schema, base, ref);
|
|
11581
|
+
if (!guard_exports.IsUndefined(result))
|
|
11582
|
+
return result;
|
|
11587
11583
|
}
|
|
11588
11584
|
if (IsDynamicAnchor(schema)) {
|
|
11589
|
-
const
|
|
11590
|
-
if (!guard_exports.IsUndefined(
|
|
11591
|
-
return
|
|
11585
|
+
const result = MatchDynamicAnchor(schema, base, ref);
|
|
11586
|
+
if (!guard_exports.IsUndefined(result))
|
|
11587
|
+
return result;
|
|
11592
11588
|
}
|
|
11593
11589
|
return MatchHash(schema, base, ref);
|
|
11594
11590
|
}
|
|
11595
11591
|
function FromArray6(schema, base, ref) {
|
|
11596
|
-
return schema.reduce((
|
|
11592
|
+
return schema.reduce((result, item) => {
|
|
11597
11593
|
const match = FromValue3(item, base, ref);
|
|
11598
|
-
return !guard_exports.IsUndefined(match) ? match :
|
|
11594
|
+
return !guard_exports.IsUndefined(match) ? match : result;
|
|
11599
11595
|
}, void 0);
|
|
11600
11596
|
}
|
|
11601
11597
|
function FromObject10(schema, base, ref) {
|
|
11602
|
-
return guard_exports.Keys(schema).reduce((
|
|
11598
|
+
return guard_exports.Keys(schema).reduce((result, key) => {
|
|
11603
11599
|
const match = FromValue3(schema[key], base, ref);
|
|
11604
|
-
return !guard_exports.IsUndefined(match) ? match :
|
|
11600
|
+
return !guard_exports.IsUndefined(match) ? match : result;
|
|
11605
11601
|
}, void 0);
|
|
11606
11602
|
}
|
|
11607
11603
|
function FromValue3(schema, base, ref) {
|
|
11608
11604
|
const nextBase = IsSchemaObject(schema) && IsId(schema) ? new URL(schema.$id, base.href) : base;
|
|
11609
11605
|
if (IsSchemaObject(schema)) {
|
|
11610
|
-
const
|
|
11611
|
-
if (!guard_exports.IsUndefined(
|
|
11612
|
-
return
|
|
11606
|
+
const result = Match4(schema, nextBase, ref);
|
|
11607
|
+
if (!guard_exports.IsUndefined(result))
|
|
11608
|
+
return result;
|
|
11613
11609
|
}
|
|
11614
11610
|
if (guard_exports.IsArray(schema))
|
|
11615
11611
|
return FromArray6(schema, nextBase, ref);
|
|
@@ -11688,7 +11684,7 @@ var init_stack = __esm({
|
|
|
11688
11684
|
// Base
|
|
11689
11685
|
// ----------------------------------------------------------------
|
|
11690
11686
|
BaseURL() {
|
|
11691
|
-
return this.ids.reduce((
|
|
11687
|
+
return this.ids.reduce((result, schema) => new URL(schema.$id, result), new URL("http://unknown"));
|
|
11692
11688
|
}
|
|
11693
11689
|
Base() {
|
|
11694
11690
|
return this.ids[this.ids.length - 1] ?? this.schema;
|
|
@@ -11857,8 +11853,8 @@ function Errors(...args) {
|
|
|
11857
11853
|
return;
|
|
11858
11854
|
return errors.push({ ...error, message: locale2(error) });
|
|
11859
11855
|
});
|
|
11860
|
-
const
|
|
11861
|
-
return [
|
|
11856
|
+
const result = ErrorSchema(stack, errorContext, "#", "", schema, value);
|
|
11857
|
+
return [result, errors];
|
|
11862
11858
|
}
|
|
11863
11859
|
var init_errors = __esm({
|
|
11864
11860
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/schema/errors.mjs"() {
|
|
@@ -12232,10 +12228,10 @@ function Modifiers(type, next) {
|
|
|
12232
12228
|
return next;
|
|
12233
12229
|
}
|
|
12234
12230
|
function FromProperties4(properties) {
|
|
12235
|
-
const
|
|
12231
|
+
const result = {};
|
|
12236
12232
|
for (const key of guard_default.Keys(properties))
|
|
12237
|
-
|
|
12238
|
-
return
|
|
12233
|
+
result[key] = FromType20(properties[key]);
|
|
12234
|
+
return result;
|
|
12239
12235
|
}
|
|
12240
12236
|
function FromPriorityTypes(types) {
|
|
12241
12237
|
return FromTypes6(Priority(types));
|
|
@@ -12248,8 +12244,8 @@ function FromType20(type) {
|
|
|
12248
12244
|
return Modifiers(type, next);
|
|
12249
12245
|
}
|
|
12250
12246
|
function UnionPrioritySort(type) {
|
|
12251
|
-
const
|
|
12252
|
-
return
|
|
12247
|
+
const result = FromType20(type);
|
|
12248
|
+
return result;
|
|
12253
12249
|
}
|
|
12254
12250
|
var init_union_priority_sort = __esm({
|
|
12255
12251
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/shared/union_priority_sort.mjs"() {
|
|
@@ -12407,9 +12403,9 @@ function FromString5(value) {
|
|
|
12407
12403
|
return Ok(0);
|
|
12408
12404
|
if (guard_exports.IsEqual(lowercase, "true"))
|
|
12409
12405
|
return Ok(1);
|
|
12410
|
-
const
|
|
12411
|
-
if (IsOk(
|
|
12412
|
-
return
|
|
12406
|
+
const result = TryBigInt(value);
|
|
12407
|
+
if (IsOk(result))
|
|
12408
|
+
return result.value <= maxBigInt && result.value >= minBigInt ? Ok(Number(result.value)) : Fail();
|
|
12413
12409
|
return Fail();
|
|
12414
12410
|
}
|
|
12415
12411
|
function TryNumber(value) {
|
|
@@ -12498,8 +12494,8 @@ var init_try2 = __esm({
|
|
|
12498
12494
|
|
|
12499
12495
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_array.mjs
|
|
12500
12496
|
function FromArray8(context, type, value) {
|
|
12501
|
-
const
|
|
12502
|
-
return
|
|
12497
|
+
const result = try_exports.TryArray(value);
|
|
12498
|
+
return result.value.map((value2) => FromType21(context, type.items, value2));
|
|
12503
12499
|
}
|
|
12504
12500
|
var init_from_array5 = __esm({
|
|
12505
12501
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_array.mjs"() {
|
|
@@ -12510,8 +12506,8 @@ var init_from_array5 = __esm({
|
|
|
12510
12506
|
|
|
12511
12507
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_bigint.mjs
|
|
12512
12508
|
function FromBigInt6(_context, _type, value) {
|
|
12513
|
-
const
|
|
12514
|
-
return try_exports.IsOk(
|
|
12509
|
+
const result = try_exports.TryBigInt(value);
|
|
12510
|
+
return try_exports.IsOk(result) ? result.value : value;
|
|
12515
12511
|
}
|
|
12516
12512
|
var init_from_bigint = __esm({
|
|
12517
12513
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_bigint.mjs"() {
|
|
@@ -12521,8 +12517,8 @@ var init_from_bigint = __esm({
|
|
|
12521
12517
|
|
|
12522
12518
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_boolean.mjs
|
|
12523
12519
|
function FromBoolean6(_context, _type, value) {
|
|
12524
|
-
const
|
|
12525
|
-
return try_exports.IsOk(
|
|
12520
|
+
const result = try_exports.TryBoolean(value);
|
|
12521
|
+
return try_exports.IsOk(result) ? result.value : value;
|
|
12526
12522
|
}
|
|
12527
12523
|
var init_from_boolean = __esm({
|
|
12528
12524
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_boolean.mjs"() {
|
|
@@ -12554,8 +12550,8 @@ var init_from_enum2 = __esm({
|
|
|
12554
12550
|
|
|
12555
12551
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_integer.mjs
|
|
12556
12552
|
function FromInteger(_context, _type, value) {
|
|
12557
|
-
const
|
|
12558
|
-
return try_exports.IsOk(
|
|
12553
|
+
const result = try_exports.TryNumber(value);
|
|
12554
|
+
return try_exports.IsOk(result) ? Math.trunc(result.value) : value;
|
|
12559
12555
|
}
|
|
12560
12556
|
var init_from_integer = __esm({
|
|
12561
12557
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_integer.mjs"() {
|
|
@@ -12578,20 +12574,20 @@ var init_from_intersect7 = __esm({
|
|
|
12578
12574
|
|
|
12579
12575
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_literal.mjs
|
|
12580
12576
|
function FromLiteralBigInt(_context, type, value) {
|
|
12581
|
-
const
|
|
12582
|
-
return try_exports.IsOk(
|
|
12577
|
+
const result = try_exports.TryBigInt(value);
|
|
12578
|
+
return try_exports.IsOk(result) && guard_exports.IsEqual(type.const, result.value) ? result.value : value;
|
|
12583
12579
|
}
|
|
12584
12580
|
function FromLiteralBoolean(_context, type, value) {
|
|
12585
|
-
const
|
|
12586
|
-
return try_exports.IsOk(
|
|
12581
|
+
const result = try_exports.TryBoolean(value);
|
|
12582
|
+
return try_exports.IsOk(result) && guard_exports.IsEqual(type.const, result.value) ? result.value : value;
|
|
12587
12583
|
}
|
|
12588
12584
|
function FromLiteralNumber(_context, type, value) {
|
|
12589
|
-
const
|
|
12590
|
-
return try_exports.IsOk(
|
|
12585
|
+
const result = try_exports.TryNumber(value);
|
|
12586
|
+
return try_exports.IsOk(result) && guard_exports.IsEqual(type.const, result.value) ? result.value : value;
|
|
12591
12587
|
}
|
|
12592
12588
|
function FromLiteralString(_context, type, value) {
|
|
12593
|
-
const
|
|
12594
|
-
return try_exports.IsOk(
|
|
12589
|
+
const result = try_exports.TryString(value);
|
|
12590
|
+
return try_exports.IsOk(result) && guard_exports.IsEqual(type.const, result.value) ? result.value : value;
|
|
12595
12591
|
}
|
|
12596
12592
|
function FromLiteral6(context, type, value) {
|
|
12597
12593
|
if (guard_exports.IsEqual(type.const, value))
|
|
@@ -12609,8 +12605,8 @@ var init_from_literal3 = __esm({
|
|
|
12609
12605
|
|
|
12610
12606
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_null.mjs
|
|
12611
12607
|
function FromNull2(_context, _type, value) {
|
|
12612
|
-
const
|
|
12613
|
-
return try_exports.IsOk(
|
|
12608
|
+
const result = try_exports.TryNull(value);
|
|
12609
|
+
return try_exports.IsOk(result) ? result.value : value;
|
|
12614
12610
|
}
|
|
12615
12611
|
var init_from_null = __esm({
|
|
12616
12612
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_null.mjs"() {
|
|
@@ -12620,8 +12616,8 @@ var init_from_null = __esm({
|
|
|
12620
12616
|
|
|
12621
12617
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_number.mjs
|
|
12622
12618
|
function FromNumber5(_context, _type, value) {
|
|
12623
|
-
const
|
|
12624
|
-
return try_exports.IsOk(
|
|
12619
|
+
const result = try_exports.TryNumber(value);
|
|
12620
|
+
return try_exports.IsOk(result) ? result.value : value;
|
|
12625
12621
|
}
|
|
12626
12622
|
var init_from_number = __esm({
|
|
12627
12623
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_number.mjs"() {
|
|
@@ -12721,8 +12717,8 @@ var init_from_ref2 = __esm({
|
|
|
12721
12717
|
|
|
12722
12718
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_string.mjs
|
|
12723
12719
|
function FromString7(_context, _type, value) {
|
|
12724
|
-
const
|
|
12725
|
-
return try_exports.IsOk(
|
|
12720
|
+
const result = try_exports.TryString(value);
|
|
12721
|
+
return try_exports.IsOk(result) ? result.value : value;
|
|
12726
12722
|
}
|
|
12727
12723
|
var init_from_string = __esm({
|
|
12728
12724
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_string.mjs"() {
|
|
@@ -12759,8 +12755,8 @@ var init_from_tuple6 = __esm({
|
|
|
12759
12755
|
|
|
12760
12756
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_undefined.mjs
|
|
12761
12757
|
function FromUndefined2(_context, _type, value) {
|
|
12762
|
-
const
|
|
12763
|
-
return try_exports.IsOk(
|
|
12758
|
+
const result = try_exports.TryUndefined(value);
|
|
12759
|
+
return try_exports.IsOk(result) ? result.value : value;
|
|
12764
12760
|
}
|
|
12765
12761
|
var init_from_undefined = __esm({
|
|
12766
12762
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_undefined.mjs"() {
|
|
@@ -12788,8 +12784,8 @@ var init_from_union8 = __esm({
|
|
|
12788
12784
|
|
|
12789
12785
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_void.mjs
|
|
12790
12786
|
function FromVoid(_context, _type, value) {
|
|
12791
|
-
const
|
|
12792
|
-
return try_exports.IsOk(
|
|
12787
|
+
const result = try_exports.TryUndefined(value);
|
|
12788
|
+
return try_exports.IsOk(result) ? void 0 : value;
|
|
12793
12789
|
}
|
|
12794
12790
|
var init_from_void = __esm({
|
|
12795
12791
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_void.mjs"() {
|
|
@@ -12991,9 +12987,9 @@ var init_from_tuple7 = __esm({
|
|
|
12991
12987
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/default/from_union.mjs
|
|
12992
12988
|
function FromUnion11(context, schema, value) {
|
|
12993
12989
|
for (const inner of schema.anyOf) {
|
|
12994
|
-
const
|
|
12995
|
-
if (Check2(context, inner,
|
|
12996
|
-
return
|
|
12990
|
+
const result = FromType22(context, inner, Clone2(value));
|
|
12991
|
+
if (Check2(context, inner, result)) {
|
|
12992
|
+
return result;
|
|
12997
12993
|
}
|
|
12998
12994
|
}
|
|
12999
12995
|
return value;
|
|
@@ -13056,7 +13052,7 @@ function Pipeline(pipeline) {
|
|
|
13056
13052
|
3: (context2, type2, value2) => [context2, type2, value2],
|
|
13057
13053
|
2: (type2, value2) => [{}, type2, value2]
|
|
13058
13054
|
});
|
|
13059
|
-
return pipeline.reduce((
|
|
13055
|
+
return pipeline.reduce((result, func) => func(context, type, result), value);
|
|
13060
13056
|
};
|
|
13061
13057
|
}
|
|
13062
13058
|
var init_pipeline = __esm({
|
|
@@ -13147,7 +13143,7 @@ function Decode5(direction, context, type, value) {
|
|
|
13147
13143
|
if (guard_exports.IsEqual(type.allOf.length, 0))
|
|
13148
13144
|
return Callback(direction, context, type, value);
|
|
13149
13145
|
const interiors = type.allOf.map((schema) => FromType23(direction, context, schema, Clean(schema, Clone2(value))));
|
|
13150
|
-
const structural = interiors.every((
|
|
13146
|
+
const structural = interiors.every((result) => guard_exports.IsObject(result));
|
|
13151
13147
|
const exterior = structural ? MergeInteriors(interiors) : NonMatchingInterior(value, interiors);
|
|
13152
13148
|
return Callback(direction, context, type, exterior);
|
|
13153
13149
|
}
|
|
@@ -13156,7 +13152,7 @@ function Encode4(direction, context, type, value) {
|
|
|
13156
13152
|
return Callback(direction, context, type, value);
|
|
13157
13153
|
const exterior = Callback(direction, context, type, value);
|
|
13158
13154
|
const interiors = type.allOf.map((schema) => FromType23(direction, context, schema, Clean(schema, Clone2(exterior))));
|
|
13159
|
-
const structural = interiors.every((
|
|
13155
|
+
const structural = interiors.every((result) => guard_exports.IsObject(result));
|
|
13160
13156
|
if (structural)
|
|
13161
13157
|
return MergeInteriors(interiors);
|
|
13162
13158
|
return NonMatchingInterior(exterior, interiors);
|
|
@@ -13674,8 +13670,8 @@ var init_from_number2 = __esm({
|
|
|
13674
13670
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/create/from_object.mjs
|
|
13675
13671
|
function FromObject16(context, type) {
|
|
13676
13672
|
const required = guard_exports.IsUndefined(type.required) ? [] : type.required;
|
|
13677
|
-
return required.reduce((
|
|
13678
|
-
return { ...
|
|
13673
|
+
return required.reduce((result, key) => {
|
|
13674
|
+
return { ...result, [key]: FromType25(context, type.properties[key]) };
|
|
13679
13675
|
}, {});
|
|
13680
13676
|
}
|
|
13681
13677
|
var init_from_object11 = __esm({
|
|
@@ -14135,15 +14131,15 @@ var init_error2 = __esm({
|
|
|
14135
14131
|
|
|
14136
14132
|
// node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/repair/from_array.mjs
|
|
14137
14133
|
function MakeUnique(values) {
|
|
14138
|
-
const [hashes,
|
|
14134
|
+
const [hashes, result] = [/* @__PURE__ */ new Set(), []];
|
|
14139
14135
|
for (const value of values) {
|
|
14140
14136
|
const hash = Hash2(value);
|
|
14141
14137
|
if (hashes.has(hash))
|
|
14142
14138
|
continue;
|
|
14143
14139
|
hashes.add(hash);
|
|
14144
|
-
|
|
14140
|
+
result.push(value);
|
|
14145
14141
|
}
|
|
14146
|
-
return
|
|
14142
|
+
return result;
|
|
14147
14143
|
}
|
|
14148
14144
|
function FromArray14(context, type, value) {
|
|
14149
14145
|
if (Check2(context, type, value))
|
|
@@ -14202,21 +14198,21 @@ function FromObject18(context, type, value) {
|
|
|
14202
14198
|
if (!guard_exports.IsObjectNotArray(value))
|
|
14203
14199
|
return Create2(context, type);
|
|
14204
14200
|
const required = new Set(guard_exports.IsUndefined(type.required) ? [] : type.required);
|
|
14205
|
-
const
|
|
14201
|
+
const result = {};
|
|
14206
14202
|
for (const [key, schema] of guard_exports.Entries(type.properties)) {
|
|
14207
14203
|
if (!required.has(key) && guard_exports.IsUndefined(value[key]))
|
|
14208
14204
|
continue;
|
|
14209
|
-
|
|
14205
|
+
result[key] = key in value ? FromType26(context, schema, value[key]) : Create2(context, schema);
|
|
14210
14206
|
}
|
|
14211
14207
|
const evaluatedKeys = guard_exports.Keys(type.properties);
|
|
14212
14208
|
if (IsAdditionalProperties(type) && guard_exports.IsObject(type.additionalProperties)) {
|
|
14213
14209
|
for (const key of guard_exports.Keys(value)) {
|
|
14214
14210
|
if (evaluatedKeys.includes(key))
|
|
14215
14211
|
continue;
|
|
14216
|
-
|
|
14212
|
+
result[key] = FromType26(context, type.additionalProperties, value[key]);
|
|
14217
14213
|
}
|
|
14218
14214
|
}
|
|
14219
|
-
return
|
|
14215
|
+
return result;
|
|
14220
14216
|
}
|
|
14221
14217
|
var init_from_object12 = __esm({
|
|
14222
14218
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/repair/from_object.mjs"() {
|
|
@@ -14237,21 +14233,21 @@ function FromRecord9(context, type, value) {
|
|
|
14237
14233
|
const recordKey = new RegExp(RecordPattern(type));
|
|
14238
14234
|
const recordValue = RecordValue(type);
|
|
14239
14235
|
const evaluatedKeys = /* @__PURE__ */ new Set();
|
|
14240
|
-
const
|
|
14236
|
+
const result = {};
|
|
14241
14237
|
for (const [key, value_] of guard_exports.Entries(value)) {
|
|
14242
14238
|
if (!recordKey.test(key))
|
|
14243
14239
|
continue;
|
|
14244
|
-
|
|
14240
|
+
result[key] = FromType26(context, recordValue, value_);
|
|
14245
14241
|
evaluatedKeys.add(key);
|
|
14246
14242
|
}
|
|
14247
14243
|
if (IsAdditionalProperties(type)) {
|
|
14248
14244
|
for (const key of guard_exports.Keys(value)) {
|
|
14249
14245
|
if (evaluatedKeys.has(key))
|
|
14250
14246
|
continue;
|
|
14251
|
-
|
|
14247
|
+
result[key] = FromType26(context, type.additionalProperties, value[key]);
|
|
14252
14248
|
}
|
|
14253
14249
|
}
|
|
14254
|
-
return
|
|
14250
|
+
return result;
|
|
14255
14251
|
}
|
|
14256
14252
|
var init_from_record7 = __esm({
|
|
14257
14253
|
"node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/repair/from_record.mjs"() {
|
|
@@ -14318,11 +14314,11 @@ function ScoreVariant(context, type, value) {
|
|
|
14318
14314
|
return 0;
|
|
14319
14315
|
const keys = guard_exports.Keys(value);
|
|
14320
14316
|
const entries = guard_exports.Entries(type.properties);
|
|
14321
|
-
return entries.reduce((
|
|
14317
|
+
return entries.reduce((result, [key, schema]) => {
|
|
14322
14318
|
const literal = IsLiteral(schema) && guard_exports.IsEqual(schema.const, value[key]) ? 100 : 0;
|
|
14323
14319
|
const checks = Check2(context, schema, value[key]) ? 10 : 0;
|
|
14324
14320
|
const exists = keys.includes(key) ? 1 : 0;
|
|
14325
|
-
return
|
|
14321
|
+
return result + (literal + checks + exists);
|
|
14326
14322
|
}, 0);
|
|
14327
14323
|
}
|
|
14328
14324
|
function UnionScoreSelect(context, type, value) {
|
|
@@ -16330,7 +16326,7 @@ function appendWithIdentityClaim(recordFile, record4, row) {
|
|
|
16330
16326
|
);
|
|
16331
16327
|
}
|
|
16332
16328
|
let primaryFailure;
|
|
16333
|
-
let
|
|
16329
|
+
let result;
|
|
16334
16330
|
let cleanupFailure;
|
|
16335
16331
|
try {
|
|
16336
16332
|
sealTornTail(recordFile);
|
|
@@ -16341,10 +16337,10 @@ function appendWithIdentityClaim(recordFile, record4, row) {
|
|
|
16341
16337
|
record4.level
|
|
16342
16338
|
);
|
|
16343
16339
|
if (raced !== void 0) {
|
|
16344
|
-
|
|
16340
|
+
result = raced;
|
|
16345
16341
|
} else {
|
|
16346
16342
|
appendFileSync(recordFile, row, "utf8");
|
|
16347
|
-
|
|
16343
|
+
result = {
|
|
16348
16344
|
identity: record4.identity,
|
|
16349
16345
|
recordFile,
|
|
16350
16346
|
kind: record4.kind,
|
|
@@ -16369,7 +16365,7 @@ function appendWithIdentityClaim(recordFile, record4, row) {
|
|
|
16369
16365
|
{ cause: cleanupFailure }
|
|
16370
16366
|
);
|
|
16371
16367
|
}
|
|
16372
|
-
return
|
|
16368
|
+
return result;
|
|
16373
16369
|
}
|
|
16374
16370
|
function resolveSitianVolumeCategory(kind) {
|
|
16375
16371
|
if (S4_SUBMISSION_LEDGER_KINDS.has(kind)) {
|
|
@@ -16801,9 +16797,6 @@ ${paths.join("\n")}`
|
|
|
16801
16797
|
if (typeof process.env.AK_ROLE_AUDITOR_SUBJECT === "string" && process.env.AK_ROLE_AUDITOR_SUBJECT.trim() !== "") {
|
|
16802
16798
|
env.AK_ROLE_AUDITOR_SUBJECT = process.env.AK_ROLE_AUDITOR_SUBJECT;
|
|
16803
16799
|
}
|
|
16804
|
-
if (request.correlationId !== void 0 && request.correlationId.trim() !== "") {
|
|
16805
|
-
env.AK_CORRELATION_ID = request.correlationId;
|
|
16806
|
-
}
|
|
16807
16800
|
if (config.recordLaunchedRolePackageIdentity !== void 0 && config.observeLaunchedRolePackageIdentity !== void 0) {
|
|
16808
16801
|
await config.recordLaunchedRolePackageIdentity(
|
|
16809
16802
|
request.runDirectory,
|
|
@@ -17519,13 +17512,13 @@ async function loadDoctorCase(runsPath) {
|
|
|
17519
17512
|
const kind = id.endsWith(".jsonl") ? "session" : "stderr";
|
|
17520
17513
|
evidence.push({ id, kind, byteLength: bytes.byteLength, contentLength: content.length, sha256: sha256Hex(bytes), content });
|
|
17521
17514
|
if (kind === "stderr") continue;
|
|
17522
|
-
const
|
|
17523
|
-
sessions.push(
|
|
17524
|
-
statuses.push(...
|
|
17525
|
-
commits.push(...
|
|
17526
|
-
accumulate(turns,
|
|
17527
|
-
accumulate(calls,
|
|
17528
|
-
accumulate(tokens,
|
|
17515
|
+
const result = deriveSession(content, id);
|
|
17516
|
+
sessions.push(result.session);
|
|
17517
|
+
statuses.push(...result.statuses);
|
|
17518
|
+
commits.push(...result.commits);
|
|
17519
|
+
accumulate(turns, result.turns, id);
|
|
17520
|
+
accumulate(calls, result.calls, id);
|
|
17521
|
+
accumulate(tokens, result.tokens, id);
|
|
17529
17522
|
}
|
|
17530
17523
|
const runDirs = (await readdir3(root, { withFileTypes: true })).filter((item) => item.isDirectory()).map((item) => item.name).sort();
|
|
17531
17524
|
const legs = evidence.filter((entry) => entry.kind === "session").map((entry) => entry.id);
|
|
@@ -21316,7 +21309,7 @@ async function withPreparedAttachments(attachmentPaths, use) {
|
|
|
21316
21309
|
if (attachmentPaths.length === 0) return await use([]);
|
|
21317
21310
|
const stagingDirectory = await mkdtemp(join15(tmpdir(), "ak-role-attachments-"));
|
|
21318
21311
|
const prepared = [];
|
|
21319
|
-
let
|
|
21312
|
+
let result;
|
|
21320
21313
|
try {
|
|
21321
21314
|
for (let index = 0; index < attachmentPaths.length; index += 1) {
|
|
21322
21315
|
const { absolute, bytes } = await readRegularFileAttachment(attachmentPaths[index]);
|
|
@@ -21324,7 +21317,7 @@ async function withPreparedAttachments(attachmentPaths, use) {
|
|
|
21324
21317
|
await writeFile5(snapshotPath, bytes);
|
|
21325
21318
|
prepared.push({ absolute, snapshotPath });
|
|
21326
21319
|
}
|
|
21327
|
-
|
|
21320
|
+
result = await use(prepared);
|
|
21328
21321
|
} catch (primary) {
|
|
21329
21322
|
try {
|
|
21330
21323
|
await removePreparedAttachmentDirectory(stagingDirectory);
|
|
@@ -21338,7 +21331,7 @@ async function withPreparedAttachments(attachmentPaths, use) {
|
|
|
21338
21331
|
throw primary;
|
|
21339
21332
|
}
|
|
21340
21333
|
await removePreparedAttachmentDirectory(stagingDirectory);
|
|
21341
|
-
return
|
|
21334
|
+
return result;
|
|
21342
21335
|
}
|
|
21343
21336
|
async function freezeAttachmentBytes(provenancePath, bytes, destinationDir, index) {
|
|
21344
21337
|
const frozenPath = join15(
|
|
@@ -24905,69 +24898,69 @@ function adviceNavigatorFact(input) {
|
|
|
24905
24898
|
...input.advisoryDiagnostic === void 0 ? {} : { advisoryDiagnostic: input.advisoryDiagnostic }
|
|
24906
24899
|
};
|
|
24907
24900
|
}
|
|
24908
|
-
function formatTerminalResult(
|
|
24901
|
+
function formatTerminalResult(result) {
|
|
24909
24902
|
const lines = [];
|
|
24910
24903
|
lines.push("role outcome status");
|
|
24911
|
-
const outcomeStatus =
|
|
24904
|
+
const outcomeStatus = result.roleOutcome.kind === "failure" ? result.roleOutcome.cause ?? "" : result.roleOutcome.kind === "accepted" ? "accepted" : result.roleOutcome.status;
|
|
24912
24905
|
lines.push(
|
|
24913
|
-
`${
|
|
24906
|
+
`${result.roleOutcome.role} ${result.roleOutcome.kind} ${encodeTerminalField(outcomeStatus)}`
|
|
24914
24907
|
);
|
|
24915
|
-
if (
|
|
24908
|
+
if (result.roleOutcome.kind === "failure") {
|
|
24916
24909
|
lines.push(
|
|
24917
|
-
`diagnostic ${encodeTerminalField(
|
|
24910
|
+
`diagnostic ${encodeTerminalField(result.roleOutcome.diagnostic)}`
|
|
24918
24911
|
);
|
|
24919
24912
|
}
|
|
24920
|
-
if (
|
|
24921
|
-
const facts =
|
|
24913
|
+
if (result.roleOutcome.kind === "failure" || result.roleOutcome.kind === "no_receipt") {
|
|
24914
|
+
const facts = result.roleOutcome.decisiveFacts;
|
|
24922
24915
|
for (const [key, value] of Object.entries(facts)) {
|
|
24923
24916
|
if (value === void 0) continue;
|
|
24924
24917
|
const rendered = typeof value === "string" ? value : JSON.stringify(value);
|
|
24925
24918
|
lines.push(`fact ${encodeTerminalField(key)} ${encodeTerminalField(rendered)}`);
|
|
24926
24919
|
}
|
|
24927
24920
|
}
|
|
24928
|
-
lines.push(`navigator ${
|
|
24929
|
-
if (
|
|
24930
|
-
lines.push(`navigator-advisory ${encodeTerminalField(
|
|
24921
|
+
lines.push(`navigator ${result.navigator.disposition}`);
|
|
24922
|
+
if (result.navigator.advisoryDiagnostic !== void 0) {
|
|
24923
|
+
lines.push(`navigator-advisory ${encodeTerminalField(result.navigator.advisoryDiagnostic)}`);
|
|
24931
24924
|
}
|
|
24932
|
-
if (
|
|
24933
|
-
lines.push(`prose ${encodeTerminalField(
|
|
24934
|
-
} else if (
|
|
24925
|
+
if (result.navigator.disposition === "advice") {
|
|
24926
|
+
lines.push(`prose ${encodeTerminalField(result.navigator.prose)}`);
|
|
24927
|
+
} else if (result.navigator.disposition === "unavailable") {
|
|
24935
24928
|
lines.push(
|
|
24936
|
-
`unavailable ${
|
|
24929
|
+
`unavailable ${result.navigator.source} ${encodeTerminalField(result.navigator.reason)}`
|
|
24937
24930
|
);
|
|
24938
24931
|
}
|
|
24939
|
-
for (const artifact of
|
|
24932
|
+
for (const artifact of result.artifacts) {
|
|
24940
24933
|
lines.push(`artifact ${artifact.kind} ${encodeTerminalField(artifact.path)}`);
|
|
24941
24934
|
}
|
|
24942
|
-
if (
|
|
24935
|
+
if (result.gate !== void 0) {
|
|
24943
24936
|
lines.push(
|
|
24944
|
-
`gate ${encodeTerminalField(
|
|
24937
|
+
`gate ${encodeTerminalField(result.gate.actualSeats.join(","))} ${result.gate.rounds.length}`
|
|
24945
24938
|
);
|
|
24946
|
-
for (const round of
|
|
24939
|
+
for (const round of result.gate.rounds) {
|
|
24947
24940
|
const reason = round.dispatch.kind === "historical_dispatch" && round.dispatch.reason !== void 0 ? encodeTerminalField(round.dispatch.reason) : "";
|
|
24948
24941
|
lines.push(
|
|
24949
24942
|
`gate-round ${round.roundIndex} ${round.dispatch.kind} ${round.dispatch.officer} ${reason} ${round.officer.seat} ${encodeTerminalField(round.officer.status)} ${encodeTerminalField(JSON.stringify(round.officer.findings))}`
|
|
24950
24943
|
);
|
|
24951
24944
|
}
|
|
24952
24945
|
}
|
|
24953
|
-
if (
|
|
24946
|
+
if (result.reviewerChildOutcomes !== void 0) {
|
|
24954
24947
|
for (const axis of ["completeness", "correctness"]) {
|
|
24955
|
-
const child =
|
|
24948
|
+
const child = result.reviewerChildOutcomes[axis];
|
|
24956
24949
|
lines.push(`reviewer-child ${axis} ${child.exitCode}`);
|
|
24957
24950
|
if (child.stderr !== void 0 && child.stderr !== "") {
|
|
24958
24951
|
lines.push(`reviewer-child-diagnostic ${axis} ${encodeTerminalField(child.stderr)}`);
|
|
24959
24952
|
}
|
|
24960
24953
|
}
|
|
24961
24954
|
}
|
|
24962
|
-
if (
|
|
24963
|
-
lines.push(`resume ${encodeTerminalField(
|
|
24964
|
-
} else if (
|
|
24965
|
-
lines.push(`run ${encodeTerminalField(
|
|
24955
|
+
if (result.resume !== void 0) {
|
|
24956
|
+
lines.push(`resume ${encodeTerminalField(result.resume.command)}`);
|
|
24957
|
+
} else if (result.runId !== void 0) {
|
|
24958
|
+
lines.push(`run ${encodeTerminalField(result.runId)}`);
|
|
24966
24959
|
}
|
|
24967
|
-
if (
|
|
24968
|
-
lines.push(`autoResumeCount ${encodeTerminalField(String(
|
|
24960
|
+
if (result.autoResumeCount !== void 0) {
|
|
24961
|
+
lines.push(`autoResumeCount ${encodeTerminalField(String(result.autoResumeCount))}`);
|
|
24969
24962
|
}
|
|
24970
|
-
const payloads =
|
|
24963
|
+
const payloads = result.roleOutcome.kind === "accepted" || result.roleOutcome.kind === "audit_escalation" ? result.roleOutcome.payloads ?? result.submissions ?? [] : result.roleOutcome.kind === "failure" ? result.roleOutcome.payloads ?? result.submissions ?? [] : result.submissions ?? [];
|
|
24971
24964
|
for (let i = payloads.length - 1; i >= 0; i -= 1) {
|
|
24972
24965
|
const payload = payloads[i];
|
|
24973
24966
|
const rendered = typeof payload === "string" ? payload : JSON.stringify(payload);
|
|
@@ -27776,8 +27769,8 @@ function missingCredentialPreDispatchFailure(model, credentials) {
|
|
|
27776
27769
|
knownFailure
|
|
27777
27770
|
};
|
|
27778
27771
|
}
|
|
27779
|
-
function postRunMissingCredentialFailure(
|
|
27780
|
-
if (!(
|
|
27772
|
+
function postRunMissingCredentialFailure(result, model, credentials) {
|
|
27773
|
+
if (!(result.timedOut || result.code !== 0)) return void 0;
|
|
27781
27774
|
return knownFailureForMissingProviderCredential(model, credentials);
|
|
27782
27775
|
}
|
|
27783
27776
|
var init_public_run_credentials = __esm({
|
|
@@ -27787,6 +27780,59 @@ var init_public_run_credentials = __esm({
|
|
|
27787
27780
|
}
|
|
27788
27781
|
});
|
|
27789
27782
|
|
|
27783
|
+
// src/public-cli/process-cancel.ts
|
|
27784
|
+
var process_cancel_exports = {};
|
|
27785
|
+
__export(process_cancel_exports, {
|
|
27786
|
+
installProcessCancelHandlers: () => installProcessCancelHandlers,
|
|
27787
|
+
processCancelDiagnostic: () => processCancelDiagnostic,
|
|
27788
|
+
processCancelSignalName: () => processCancelSignalName
|
|
27789
|
+
});
|
|
27790
|
+
function installProcessCancelHandlers(processRef = process) {
|
|
27791
|
+
const controller = new AbortController();
|
|
27792
|
+
let received;
|
|
27793
|
+
const listeners = /* @__PURE__ */ new Map();
|
|
27794
|
+
for (const sig of CATCHABLE_PROCESS_SIGNALS) {
|
|
27795
|
+
const onSignal = () => {
|
|
27796
|
+
if (received !== void 0) return;
|
|
27797
|
+
received = sig;
|
|
27798
|
+
try {
|
|
27799
|
+
controller.abort(sig);
|
|
27800
|
+
} catch {
|
|
27801
|
+
}
|
|
27802
|
+
};
|
|
27803
|
+
listeners.set(sig, onSignal);
|
|
27804
|
+
processRef.on(sig, onSignal);
|
|
27805
|
+
}
|
|
27806
|
+
return {
|
|
27807
|
+
signal: controller.signal,
|
|
27808
|
+
receivedSignal: () => received,
|
|
27809
|
+
dispose() {
|
|
27810
|
+
for (const [sig, onSignal] of listeners) {
|
|
27811
|
+
processRef.off(sig, onSignal);
|
|
27812
|
+
}
|
|
27813
|
+
listeners.clear();
|
|
27814
|
+
}
|
|
27815
|
+
};
|
|
27816
|
+
}
|
|
27817
|
+
function processCancelSignalName(signal) {
|
|
27818
|
+
if (signal === void 0 || signal.aborted !== true) return void 0;
|
|
27819
|
+
const reason = signal.reason;
|
|
27820
|
+
if (reason === "SIGTERM" || reason === "SIGINT" || reason === "SIGHUP") {
|
|
27821
|
+
return reason;
|
|
27822
|
+
}
|
|
27823
|
+
return void 0;
|
|
27824
|
+
}
|
|
27825
|
+
function processCancelDiagnostic(signalName) {
|
|
27826
|
+
return `ak-role terminated by ${signalName}`;
|
|
27827
|
+
}
|
|
27828
|
+
var CATCHABLE_PROCESS_SIGNALS;
|
|
27829
|
+
var init_process_cancel = __esm({
|
|
27830
|
+
"src/public-cli/process-cancel.ts"() {
|
|
27831
|
+
"use strict";
|
|
27832
|
+
CATCHABLE_PROCESS_SIGNALS = ["SIGTERM", "SIGINT", "SIGHUP"];
|
|
27833
|
+
}
|
|
27834
|
+
});
|
|
27835
|
+
|
|
27790
27836
|
// src/public-cli/auto-resume.ts
|
|
27791
27837
|
import { constants as fsConstants2 } from "node:fs";
|
|
27792
27838
|
import { randomUUID as randomUUID5 } from "node:crypto";
|
|
@@ -28037,10 +28083,10 @@ async function runWithAutoResumeLoop(options) {
|
|
|
28037
28083
|
}
|
|
28038
28084
|
throw error;
|
|
28039
28085
|
}
|
|
28040
|
-
let
|
|
28086
|
+
let result;
|
|
28041
28087
|
let turnStartedBeforeThrow = false;
|
|
28042
28088
|
try {
|
|
28043
|
-
|
|
28089
|
+
result = await options.dispatch(currentPayload, lease, isFirst, dummyIo);
|
|
28044
28090
|
} catch (error) {
|
|
28045
28091
|
lastThrownError = error;
|
|
28046
28092
|
turnStartedBeforeThrow = error instanceof TurnDispatchedFailure;
|
|
@@ -28072,9 +28118,9 @@ async function runWithAutoResumeLoop(options) {
|
|
|
28072
28118
|
}
|
|
28073
28119
|
}
|
|
28074
28120
|
dispatchOrdinal += 1;
|
|
28075
|
-
if (
|
|
28121
|
+
if (result !== void 0) {
|
|
28076
28122
|
everyAttemptThrew = false;
|
|
28077
|
-
const terminal =
|
|
28123
|
+
const terminal = result.terminal;
|
|
28078
28124
|
if (terminal !== void 0) {
|
|
28079
28125
|
terminal.autoResumeCount = autoResumeAttempts;
|
|
28080
28126
|
}
|
|
@@ -28083,22 +28129,26 @@ async function runWithAutoResumeLoop(options) {
|
|
|
28083
28129
|
if (terminal !== void 0) {
|
|
28084
28130
|
options.io.stdout(formatTerminalResult(terminal));
|
|
28085
28131
|
}
|
|
28086
|
-
return
|
|
28132
|
+
return result;
|
|
28087
28133
|
}
|
|
28088
|
-
if (
|
|
28134
|
+
if (result.skipAutoResume === true) {
|
|
28089
28135
|
if (terminal !== void 0) presentTerminal(terminal, options.io);
|
|
28090
|
-
return
|
|
28136
|
+
return result;
|
|
28137
|
+
}
|
|
28138
|
+
if (processCancelSignalName(options.signal) !== void 0) {
|
|
28139
|
+
if (terminal !== void 0) presentTerminal(terminal, options.io);
|
|
28140
|
+
return result;
|
|
28091
28141
|
}
|
|
28092
28142
|
}
|
|
28093
|
-
if (
|
|
28094
|
-
const terminal =
|
|
28143
|
+
if (result !== void 0) {
|
|
28144
|
+
const terminal = result.terminal;
|
|
28095
28145
|
if (autoResumeAttempts >= limit) {
|
|
28096
28146
|
if (terminal !== void 0) presentTerminal(terminal, options.io);
|
|
28097
|
-
return
|
|
28147
|
+
return result;
|
|
28098
28148
|
}
|
|
28099
|
-
if (
|
|
28149
|
+
if (result.turnDispatched === true && !await isPrincipalAvailable(options.admitted.principal)) {
|
|
28100
28150
|
if (terminal !== void 0) presentTerminal(terminal, options.io);
|
|
28101
|
-
return
|
|
28151
|
+
return result;
|
|
28102
28152
|
}
|
|
28103
28153
|
} else {
|
|
28104
28154
|
if (autoResumeAttempts >= limit) {
|
|
@@ -28122,6 +28172,28 @@ async function runWithAutoResumeLoop(options) {
|
|
|
28122
28172
|
terminal
|
|
28123
28173
|
};
|
|
28124
28174
|
}
|
|
28175
|
+
const cancelName = processCancelSignalName(options.signal);
|
|
28176
|
+
if (cancelName !== void 0) {
|
|
28177
|
+
const terminal = await attachDispatchExceptionTerminal(
|
|
28178
|
+
options.admitted,
|
|
28179
|
+
dispatchExceptionFailureTerminal({
|
|
28180
|
+
role: options.admitted.role,
|
|
28181
|
+
runId: options.admitted.runId,
|
|
28182
|
+
causeError: lastThrownError,
|
|
28183
|
+
errorFiles: retainedErrorFiles,
|
|
28184
|
+
autoResumeAttempts,
|
|
28185
|
+
endReason: `ak-role terminated by ${cancelName}`,
|
|
28186
|
+
everyAttemptThrew
|
|
28187
|
+
}),
|
|
28188
|
+
options.io
|
|
28189
|
+
);
|
|
28190
|
+
await finalizeExceptionRunBestEffort(options.admitted.runDirectory, options.io);
|
|
28191
|
+
presentTerminal(terminal, options.io);
|
|
28192
|
+
return {
|
|
28193
|
+
exitCode: 1,
|
|
28194
|
+
terminal
|
|
28195
|
+
};
|
|
28196
|
+
}
|
|
28125
28197
|
if (!await isPrincipalAvailable(options.admitted.principal)) {
|
|
28126
28198
|
const terminal = await attachDispatchExceptionTerminal(
|
|
28127
28199
|
options.admitted,
|
|
@@ -28145,7 +28217,7 @@ async function runWithAutoResumeLoop(options) {
|
|
|
28145
28217
|
}
|
|
28146
28218
|
}
|
|
28147
28219
|
autoResumeAttempts++;
|
|
28148
|
-
if (
|
|
28220
|
+
if (result?.turnDispatched === true || turnStartedBeforeThrow) {
|
|
28149
28221
|
currentPayload = options.buildResumePayload();
|
|
28150
28222
|
}
|
|
28151
28223
|
isFirst = false;
|
|
@@ -28158,6 +28230,7 @@ var init_auto_resume = __esm({
|
|
|
28158
28230
|
init_role_run_placement();
|
|
28159
28231
|
init_run_lifecycle();
|
|
28160
28232
|
init_config2();
|
|
28233
|
+
init_process_cancel();
|
|
28161
28234
|
init_terminal();
|
|
28162
28235
|
init_settlement();
|
|
28163
28236
|
dummyIo = { stdout: () => {
|
|
@@ -28190,6 +28263,36 @@ function describeCaughtError(error) {
|
|
|
28190
28263
|
function isStationChildOfficerDialogue(role, env) {
|
|
28191
28264
|
return env.stationChild === true && isOfficerReviewSeat(role);
|
|
28192
28265
|
}
|
|
28266
|
+
function withProcessCancelSkipAutoResume(result, signal) {
|
|
28267
|
+
if (processCancelSignalName(signal) === void 0) {
|
|
28268
|
+
return result;
|
|
28269
|
+
}
|
|
28270
|
+
return { ...result, skipAutoResume: true };
|
|
28271
|
+
}
|
|
28272
|
+
async function settleProcessCancelAfterTurn(input) {
|
|
28273
|
+
const failed = await settleAfterTurnStarted(
|
|
28274
|
+
input.admitted,
|
|
28275
|
+
withEngineDetourInvocationScope(
|
|
28276
|
+
{
|
|
28277
|
+
timedOut: input.result.timedOut,
|
|
28278
|
+
code: input.result.code,
|
|
28279
|
+
stderr: input.result.stderr,
|
|
28280
|
+
knownDiagnostic: processCancelDiagnostic(input.cancelName)
|
|
28281
|
+
},
|
|
28282
|
+
input.invocationScopeId
|
|
28283
|
+
),
|
|
28284
|
+
input.adapters,
|
|
28285
|
+
input.env.principalAuthority,
|
|
28286
|
+
input.io,
|
|
28287
|
+
input.persistRunState
|
|
28288
|
+
);
|
|
28289
|
+
return {
|
|
28290
|
+
...failed,
|
|
28291
|
+
turnDispatched: true,
|
|
28292
|
+
skipAutoResume: true,
|
|
28293
|
+
...input.deferredPersist
|
|
28294
|
+
};
|
|
28295
|
+
}
|
|
28193
28296
|
function withOnceSuccessfulBeforeDispatch(adapters) {
|
|
28194
28297
|
const hook = adapters.beforeDispatch;
|
|
28195
28298
|
if (hook === void 0) return adapters;
|
|
@@ -28322,10 +28425,10 @@ async function settleAfterTurnStarted(admitted, failureInput, adapters, authorit
|
|
|
28322
28425
|
throw new TurnDispatchedFailure(error);
|
|
28323
28426
|
}
|
|
28324
28427
|
}
|
|
28325
|
-
async function settleDeferredPersist(admitted, authority, adapters, io,
|
|
28326
|
-
if (
|
|
28327
|
-
const { needsPersist: _needsPersist, ...settledResult } =
|
|
28328
|
-
const lawful = isLawfulTypedTerminalOutcome(
|
|
28428
|
+
async function settleDeferredPersist(admitted, authority, adapters, io, result) {
|
|
28429
|
+
if (result.needsPersist !== true || result.terminal === void 0) return result;
|
|
28430
|
+
const { needsPersist: _needsPersist, ...settledResult } = result;
|
|
28431
|
+
const lawful = isLawfulTypedTerminalOutcome(result.terminal.roleOutcome);
|
|
28329
28432
|
try {
|
|
28330
28433
|
await persistReturnedRunState(admitted, authority, lawful ? { lawful: true } : void 0);
|
|
28331
28434
|
return settledResult;
|
|
@@ -28347,9 +28450,34 @@ async function dispatchPostAdmissionTurn(input) {
|
|
|
28347
28450
|
const deferredPersist = persistRunState ? {} : { needsPersist: true };
|
|
28348
28451
|
const shouldPresent = adapters.shouldPresentSettled ?? ((terminal) => isLawfulTypedTerminalOutcome(terminal.roleOutcome));
|
|
28349
28452
|
let afterDispatchApplied = false;
|
|
28350
|
-
const finishAfterTurn = async (
|
|
28351
|
-
if (afterDispatchApplied) return
|
|
28453
|
+
const finishAfterTurn = async (result) => {
|
|
28454
|
+
if (afterDispatchApplied) return result;
|
|
28352
28455
|
afterDispatchApplied = true;
|
|
28456
|
+
const cancelBeforeFinish = processCancelSignalName(env.signal);
|
|
28457
|
+
if (cancelBeforeFinish !== void 0 && result.terminal !== void 0 && isLawfulTypedTerminalOutcome(result.terminal.roleOutcome)) {
|
|
28458
|
+
result = {
|
|
28459
|
+
...await settleAfterTurnStarted(
|
|
28460
|
+
admitted,
|
|
28461
|
+
withEngineDetourInvocationScope(
|
|
28462
|
+
{
|
|
28463
|
+
timedOut: false,
|
|
28464
|
+
code: null,
|
|
28465
|
+
stderr: "",
|
|
28466
|
+
knownDiagnostic: processCancelDiagnostic(cancelBeforeFinish),
|
|
28467
|
+
skipRunStateWrite: true
|
|
28468
|
+
},
|
|
28469
|
+
request.invocationScopeId
|
|
28470
|
+
),
|
|
28471
|
+
adapters,
|
|
28472
|
+
env.principalAuthority,
|
|
28473
|
+
io,
|
|
28474
|
+
persistRunState
|
|
28475
|
+
),
|
|
28476
|
+
turnDispatched: true,
|
|
28477
|
+
skipAutoResume: true,
|
|
28478
|
+
...deferredPersist
|
|
28479
|
+
};
|
|
28480
|
+
}
|
|
28353
28481
|
try {
|
|
28354
28482
|
if (admitted.ticketNumber === void 0) {
|
|
28355
28483
|
const rows = await readRecordedSubmissionRows(
|
|
@@ -28366,9 +28494,9 @@ async function dispatchPostAdmissionTurn(input) {
|
|
|
28366
28494
|
if (ticketNumber !== void 0) await bindAdmittedTicketNumber(admitted, ticketNumber);
|
|
28367
28495
|
}
|
|
28368
28496
|
if (adapters.afterDispatch !== void 0) await adapters.afterDispatch(admitted, lease);
|
|
28369
|
-
return
|
|
28497
|
+
return result;
|
|
28370
28498
|
} catch (error) {
|
|
28371
|
-
const primaryFailure =
|
|
28499
|
+
const primaryFailure = result.terminal !== void 0 && !isLawfulTypedTerminalOutcome(result.terminal.roleOutcome);
|
|
28372
28500
|
if (primaryFailure) {
|
|
28373
28501
|
await recordBestEffortPostDispatchDiagnostic(
|
|
28374
28502
|
admitted,
|
|
@@ -28376,7 +28504,7 @@ async function dispatchPostAdmissionTurn(input) {
|
|
|
28376
28504
|
`afterDispatch failed beside primary terminal (best-effort continue): ${describeErrorIdentity(error)}`,
|
|
28377
28505
|
io
|
|
28378
28506
|
);
|
|
28379
|
-
return
|
|
28507
|
+
return result;
|
|
28380
28508
|
}
|
|
28381
28509
|
return {
|
|
28382
28510
|
...await presentControlledFailure2(
|
|
@@ -28392,8 +28520,8 @@ async function dispatchPostAdmissionTurn(input) {
|
|
|
28392
28520
|
io,
|
|
28393
28521
|
persistRunState
|
|
28394
28522
|
),
|
|
28395
|
-
...
|
|
28396
|
-
...
|
|
28523
|
+
...result.turnDispatched === true ? { turnDispatched: true } : {},
|
|
28524
|
+
...result.skipAutoResume === true ? { skipAutoResume: true } : {},
|
|
28397
28525
|
...deferredPersist
|
|
28398
28526
|
};
|
|
28399
28527
|
}
|
|
@@ -28492,30 +28620,36 @@ async function dispatchPostAdmissionTurn(input) {
|
|
|
28492
28620
|
env.host,
|
|
28493
28621
|
env.engineModel
|
|
28494
28622
|
);
|
|
28495
|
-
let
|
|
28623
|
+
let result;
|
|
28496
28624
|
try {
|
|
28497
|
-
|
|
28625
|
+
result = await env.roleTurnHost.executeTurn(turnRequest);
|
|
28498
28626
|
} catch (error) {
|
|
28627
|
+
const processCancelName = processCancelSignalName(env.signal);
|
|
28499
28628
|
const settled2 = await settleAfterTurnStarted(
|
|
28500
28629
|
admitted,
|
|
28501
28630
|
withEngineDetourInvocationScope({
|
|
28502
28631
|
timedOut: false,
|
|
28503
28632
|
code: null,
|
|
28504
28633
|
stderr: "",
|
|
28505
|
-
thrown: error
|
|
28634
|
+
thrown: processCancelName === void 0 ? error : new Error(processCancelDiagnostic(processCancelName), { cause: error })
|
|
28506
28635
|
}, request.invocationScopeId),
|
|
28507
28636
|
adapters,
|
|
28508
28637
|
env.principalAuthority,
|
|
28509
28638
|
io,
|
|
28510
28639
|
persistRunState
|
|
28511
28640
|
);
|
|
28512
|
-
return await finishAfterTurn(
|
|
28641
|
+
return await finishAfterTurn(
|
|
28642
|
+
withProcessCancelSkipAutoResume(
|
|
28643
|
+
{ ...settled2, turnDispatched: true, ...deferredPersist },
|
|
28644
|
+
env.signal
|
|
28645
|
+
)
|
|
28646
|
+
);
|
|
28513
28647
|
}
|
|
28514
28648
|
let stderrLogWriteFailure;
|
|
28515
28649
|
try {
|
|
28516
28650
|
await writeFile9(
|
|
28517
28651
|
join29(admitted.runDirectory, "stderr.log"),
|
|
28518
|
-
|
|
28652
|
+
result.stderr,
|
|
28519
28653
|
"utf8"
|
|
28520
28654
|
);
|
|
28521
28655
|
} catch (error) {
|
|
@@ -28537,9 +28671,9 @@ async function dispatchPostAdmissionTurn(input) {
|
|
|
28537
28671
|
let resolution;
|
|
28538
28672
|
try {
|
|
28539
28673
|
const sessionFile = admitted.principal !== void 0 ? env.principalAuthority.decode(admitted.principal).sessionFile : "";
|
|
28540
|
-
const runnerKnownFailure = adapters.resolveRunnerKnownFailure !== void 0 && sessionFile !== "" ? await adapters.resolveRunnerKnownFailure({ result
|
|
28674
|
+
const runnerKnownFailure = adapters.resolveRunnerKnownFailure !== void 0 && sessionFile !== "" ? await adapters.resolveRunnerKnownFailure({ result, sessionFile }) : result.knownFailure;
|
|
28541
28675
|
const credentialFailure = postRunMissingCredentialFailure(
|
|
28542
|
-
|
|
28676
|
+
result,
|
|
28543
28677
|
env.model,
|
|
28544
28678
|
env.credentials
|
|
28545
28679
|
);
|
|
@@ -28549,15 +28683,17 @@ async function dispatchPostAdmissionTurn(input) {
|
|
|
28549
28683
|
credential: credentialFailure,
|
|
28550
28684
|
runDirectory: admitted.runDirectory
|
|
28551
28685
|
});
|
|
28552
|
-
const
|
|
28553
|
-
|
|
28686
|
+
const processCancelName = processCancelSignalName(env.signal);
|
|
28687
|
+
const directHostFailureSignal = result.timedOut || result.knownFailure !== void 0 || runnerKnownFailure !== void 0 || credentialFailure !== void 0 || processCancelName !== void 0;
|
|
28688
|
+
hostSignalFailed = directHostFailureSignal || result.code !== null && result.code !== 0 || resolution.knownFailure !== void 0;
|
|
28554
28689
|
settled = await adapters.trySettle(admitted, env.principalAuthority, courtScope);
|
|
28555
28690
|
if (settled !== void 0) {
|
|
28556
28691
|
settled = await attachRecordedSubmissions(admitted, settled, courtScope);
|
|
28557
28692
|
}
|
|
28558
28693
|
const settledIsFreshThisAttempt = settled === void 0 || settled.roleOutcome.kind !== "accepted" && settled.roleOutcome.kind !== "audit_escalation" ? true : await attemptProducedFreshSubmission(admitted, courtScope);
|
|
28559
28694
|
const staleAcceptanceOutranksRealFailure = !settledIsFreshThisAttempt && hostSignalFailed;
|
|
28560
|
-
|
|
28695
|
+
const cancelAfterSettle = processCancelSignalName(env.signal);
|
|
28696
|
+
if (settled !== void 0 && shouldPresent(settled) && !directHostFailureSignal && !staleAcceptanceOutranksRealFailure && stderrLogWriteFailure === void 0 && cancelAfterSettle === void 0) {
|
|
28561
28697
|
if (settled.roleOutcome.kind === "accepted" && request.courtAttemptId !== void 0 && request.courtAttemptId.length > 0) {
|
|
28562
28698
|
try {
|
|
28563
28699
|
await clearCurrentCourt(admitted.runDirectory, request.courtAttemptId);
|
|
@@ -28582,8 +28718,8 @@ async function dispatchPostAdmissionTurn(input) {
|
|
|
28582
28718
|
admitted,
|
|
28583
28719
|
withEngineDetourInvocationScope({
|
|
28584
28720
|
timedOut: false,
|
|
28585
|
-
code:
|
|
28586
|
-
stderr:
|
|
28721
|
+
code: result.code,
|
|
28722
|
+
stderr: result.stderr,
|
|
28587
28723
|
thrown: error
|
|
28588
28724
|
}, request.invocationScopeId),
|
|
28589
28725
|
adapters,
|
|
@@ -28594,6 +28730,22 @@ async function dispatchPostAdmissionTurn(input) {
|
|
|
28594
28730
|
return await finishAfterTurn({ ...settledFailure, turnDispatched: true, ...deferredPersist });
|
|
28595
28731
|
}
|
|
28596
28732
|
if (settledOutcome !== void 0) {
|
|
28733
|
+
const lateCancel = processCancelSignalName(env.signal);
|
|
28734
|
+
if (lateCancel !== void 0) {
|
|
28735
|
+
return await finishAfterTurn(
|
|
28736
|
+
await settleProcessCancelAfterTurn({
|
|
28737
|
+
admitted,
|
|
28738
|
+
cancelName: lateCancel,
|
|
28739
|
+
result,
|
|
28740
|
+
adapters,
|
|
28741
|
+
env,
|
|
28742
|
+
io,
|
|
28743
|
+
persistRunState,
|
|
28744
|
+
deferredPersist,
|
|
28745
|
+
invocationScopeId: request.invocationScopeId
|
|
28746
|
+
})
|
|
28747
|
+
);
|
|
28748
|
+
}
|
|
28597
28749
|
if (persistRunState) {
|
|
28598
28750
|
try {
|
|
28599
28751
|
await persistReturnedRunState(admitted, env.principalAuthority, { lawful: true });
|
|
@@ -28612,21 +28764,28 @@ async function dispatchPostAdmissionTurn(input) {
|
|
|
28612
28764
|
io,
|
|
28613
28765
|
persistRunState
|
|
28614
28766
|
);
|
|
28615
|
-
return await finishAfterTurn(
|
|
28767
|
+
return await finishAfterTurn(
|
|
28768
|
+
withProcessCancelSkipAutoResume(
|
|
28769
|
+
{ ...failed, turnDispatched: true, ...deferredPersist },
|
|
28770
|
+
env.signal
|
|
28771
|
+
)
|
|
28772
|
+
);
|
|
28616
28773
|
}
|
|
28617
28774
|
}
|
|
28618
28775
|
return await finishAfterTurn({ ...settledOutcome, ...deferredPersist });
|
|
28619
28776
|
}
|
|
28620
28777
|
if (hostSignalFailed) {
|
|
28621
28778
|
const resolutionInput = controlledFailureInputFromResolution(resolution);
|
|
28779
|
+
const processCancelName = processCancelSignalName(env.signal);
|
|
28622
28780
|
const stderrLogWriteDetails = stderrLogWriteFailure === void 0 ? void 0 : { stderrLogWriteFailure: describeCaughtError(stderrLogWriteFailure) };
|
|
28623
28781
|
const failed = await settleAfterTurnStarted(
|
|
28624
28782
|
admitted,
|
|
28625
28783
|
withEngineDetourInvocationScope({
|
|
28626
|
-
timedOut:
|
|
28627
|
-
code:
|
|
28628
|
-
stderr:
|
|
28784
|
+
timedOut: result.timedOut,
|
|
28785
|
+
code: result.code,
|
|
28786
|
+
stderr: result.stderr,
|
|
28629
28787
|
...resolutionInput,
|
|
28788
|
+
...processCancelName === void 0 ? {} : { knownDiagnostic: processCancelDiagnostic(processCancelName) },
|
|
28630
28789
|
// Secondary fact only — never the cause. Rides on whichever channel
|
|
28631
28790
|
// classification actually reads (knownFailure.details owns it when
|
|
28632
28791
|
// a knownFailure exists; the top-level knownDetails otherwise).
|
|
@@ -28642,15 +28801,20 @@ async function dispatchPostAdmissionTurn(input) {
|
|
|
28642
28801
|
io,
|
|
28643
28802
|
persistRunState
|
|
28644
28803
|
);
|
|
28645
|
-
return await finishAfterTurn(
|
|
28804
|
+
return await finishAfterTurn(
|
|
28805
|
+
withProcessCancelSkipAutoResume(
|
|
28806
|
+
{ ...failed, turnDispatched: true, ...deferredPersist },
|
|
28807
|
+
env.signal
|
|
28808
|
+
)
|
|
28809
|
+
);
|
|
28646
28810
|
}
|
|
28647
28811
|
if (stderrLogWriteFailure !== void 0) {
|
|
28648
28812
|
const failed = await settleAfterTurnStarted(
|
|
28649
28813
|
admitted,
|
|
28650
28814
|
withEngineDetourInvocationScope({
|
|
28651
28815
|
timedOut: false,
|
|
28652
|
-
code:
|
|
28653
|
-
stderr:
|
|
28816
|
+
code: result.code,
|
|
28817
|
+
stderr: result.stderr,
|
|
28654
28818
|
thrown: stderrLogWriteFailure
|
|
28655
28819
|
}, request.invocationScopeId),
|
|
28656
28820
|
adapters,
|
|
@@ -28665,6 +28829,22 @@ async function dispatchPostAdmissionTurn(input) {
|
|
|
28665
28829
|
await settleHostEndedNoReceipt(admitted, env.principalAuthority, courtScope),
|
|
28666
28830
|
courtScope
|
|
28667
28831
|
);
|
|
28832
|
+
const noReceiptCancel = processCancelSignalName(env.signal);
|
|
28833
|
+
if (noReceiptCancel !== void 0) {
|
|
28834
|
+
return await finishAfterTurn(
|
|
28835
|
+
await settleProcessCancelAfterTurn({
|
|
28836
|
+
admitted,
|
|
28837
|
+
cancelName: noReceiptCancel,
|
|
28838
|
+
result,
|
|
28839
|
+
adapters,
|
|
28840
|
+
env,
|
|
28841
|
+
io,
|
|
28842
|
+
persistRunState,
|
|
28843
|
+
deferredPersist,
|
|
28844
|
+
invocationScopeId: request.invocationScopeId
|
|
28845
|
+
})
|
|
28846
|
+
);
|
|
28847
|
+
}
|
|
28668
28848
|
if (persistRunState) {
|
|
28669
28849
|
try {
|
|
28670
28850
|
await persistReturnedRunState(admitted, env.principalAuthority, { lawful: true });
|
|
@@ -28683,7 +28863,12 @@ async function dispatchPostAdmissionTurn(input) {
|
|
|
28683
28863
|
io,
|
|
28684
28864
|
persistRunState
|
|
28685
28865
|
);
|
|
28686
|
-
return await finishAfterTurn(
|
|
28866
|
+
return await finishAfterTurn(
|
|
28867
|
+
withProcessCancelSkipAutoResume(
|
|
28868
|
+
{ ...failed, turnDispatched: true, ...deferredPersist },
|
|
28869
|
+
env.signal
|
|
28870
|
+
)
|
|
28871
|
+
);
|
|
28687
28872
|
}
|
|
28688
28873
|
}
|
|
28689
28874
|
return await finishAfterTurn({
|
|
@@ -28879,6 +29064,7 @@ async function runPostAdmissionSeatResume(input) {
|
|
|
28879
29064
|
io: input.io,
|
|
28880
29065
|
sessionAppender: env.sessionAppender,
|
|
28881
29066
|
autoResumeLimit: env.autoResumeLimit,
|
|
29067
|
+
...env.signal === void 0 ? {} : { signal: env.signal },
|
|
28882
29068
|
buildInitialPayload: () => ({ resumeTurn: false }),
|
|
28883
29069
|
buildResumePayload: () => ({ resumeTurn: true }),
|
|
28884
29070
|
// Same as public manual resume: prior-court sealed acceptance is not a
|
|
@@ -28903,7 +29089,7 @@ async function runPostAdmissionSeatResume(input) {
|
|
|
28903
29089
|
return turnRequest;
|
|
28904
29090
|
},
|
|
28905
29091
|
dispatch: async (turnRequest) => {
|
|
28906
|
-
const
|
|
29092
|
+
const result = await dispatchPostAdmissionTurn({
|
|
28907
29093
|
admitted: loaded.admitted,
|
|
28908
29094
|
env,
|
|
28909
29095
|
io: attemptIo,
|
|
@@ -28918,7 +29104,7 @@ async function runPostAdmissionSeatResume(input) {
|
|
|
28918
29104
|
env.principalAuthority,
|
|
28919
29105
|
stationAdapters,
|
|
28920
29106
|
attemptIo,
|
|
28921
|
-
|
|
29107
|
+
result
|
|
28922
29108
|
);
|
|
28923
29109
|
}
|
|
28924
29110
|
})
|
|
@@ -28982,10 +29168,11 @@ async function runPostAdmissionResumable(input) {
|
|
|
28982
29168
|
io,
|
|
28983
29169
|
sessionAppender: env.sessionAppender,
|
|
28984
29170
|
autoResumeLimit: env.autoResumeLimit,
|
|
29171
|
+
...env.signal === void 0 ? {} : { signal: env.signal },
|
|
28985
29172
|
buildInitialPayload: buildScopedInitial,
|
|
28986
29173
|
buildResumePayload: buildScopedResume,
|
|
28987
29174
|
dispatch: async (request, lease, _isFirst, attemptIo) => {
|
|
28988
|
-
const
|
|
29175
|
+
const result = await dispatchPostAdmissionTurn({
|
|
28989
29176
|
admitted,
|
|
28990
29177
|
env: {
|
|
28991
29178
|
...env,
|
|
@@ -28999,7 +29186,7 @@ async function runPostAdmissionResumable(input) {
|
|
|
28999
29186
|
// #600: every attempt (initial + auto-resume) writes seat engine when present.
|
|
29000
29187
|
...effectiveEngine === void 0 ? {} : { effectiveEngine }
|
|
29001
29188
|
});
|
|
29002
|
-
return settleDeferredPersist(admitted, env.principalAuthority, adapters, attemptIo,
|
|
29189
|
+
return settleDeferredPersist(admitted, env.principalAuthority, adapters, attemptIo, result);
|
|
29003
29190
|
}
|
|
29004
29191
|
});
|
|
29005
29192
|
}
|
|
@@ -29034,7 +29221,7 @@ async function runPostAdmissionManualResume(input) {
|
|
|
29034
29221
|
const invocationScopeId = mintEngineDetourInvocationScope({
|
|
29035
29222
|
...effectiveEngine === void 0 ? {} : { effectiveEngine }
|
|
29036
29223
|
});
|
|
29037
|
-
const
|
|
29224
|
+
const result = await dispatchAfterWriterLease({
|
|
29038
29225
|
lease,
|
|
29039
29226
|
build: async () => {
|
|
29040
29227
|
if (request === void 0) {
|
|
@@ -29062,14 +29249,14 @@ async function runPostAdmissionManualResume(input) {
|
|
|
29062
29249
|
...effectiveEngine === void 0 ? {} : { effectiveEngine }
|
|
29063
29250
|
})
|
|
29064
29251
|
});
|
|
29065
|
-
if (
|
|
29066
|
-
io.stdout(formatTerminalResult(
|
|
29252
|
+
if (result.terminal !== void 0 && isLawfulTypedTerminalOutcome(result.terminal.roleOutcome)) {
|
|
29253
|
+
io.stdout(formatTerminalResult(result.terminal));
|
|
29067
29254
|
}
|
|
29068
|
-
if (
|
|
29069
|
-
|
|
29255
|
+
if (result.terminal !== void 0) {
|
|
29256
|
+
result.terminal.autoResumeCount = 0;
|
|
29070
29257
|
}
|
|
29071
29258
|
return {
|
|
29072
|
-
...
|
|
29259
|
+
...result,
|
|
29073
29260
|
...staleWriterLeaseReclaimed === true ? { staleWriterLeaseReclaimed: true } : {}
|
|
29074
29261
|
};
|
|
29075
29262
|
}
|
|
@@ -29090,6 +29277,7 @@ var init_post_admission = __esm({
|
|
|
29090
29277
|
init_host_transition_prior_native();
|
|
29091
29278
|
init_public_run_credentials();
|
|
29092
29279
|
init_run_lifecycle();
|
|
29280
|
+
init_process_cancel();
|
|
29093
29281
|
init_activation_ledger_topology();
|
|
29094
29282
|
init_settlement();
|
|
29095
29283
|
init_terminal();
|
|
@@ -29131,10 +29319,10 @@ function coderAdapters(methodProvenance) {
|
|
|
29131
29319
|
)
|
|
29132
29320
|
};
|
|
29133
29321
|
}
|
|
29134
|
-
async function runPublicCoder(
|
|
29322
|
+
async function runPublicCoder(argv2, env, io, parseCoderArgv2) {
|
|
29135
29323
|
let admitted;
|
|
29136
29324
|
try {
|
|
29137
|
-
const parsed = parseCoderArgv2(
|
|
29325
|
+
const parsed = parseCoderArgv2(argv2);
|
|
29138
29326
|
admitted = await admitCoderInvocation({
|
|
29139
29327
|
home: env.home,
|
|
29140
29328
|
principalAuthority: env.principalAuthority,
|
|
@@ -29319,11 +29507,11 @@ function instructionSeatAdapters(options) {
|
|
|
29319
29507
|
// #675 / #357 T2: failInfrastructure abort after engine-detour tool failure must not
|
|
29320
29508
|
// wash the durable toolResult diagnostic (same seam as reviewer-run / judge-run).
|
|
29321
29509
|
resolveRunnerKnownFailure: async ({
|
|
29322
|
-
result
|
|
29510
|
+
result,
|
|
29323
29511
|
sessionFile
|
|
29324
29512
|
}) => {
|
|
29325
29513
|
const infrastructureFailure = await readEngineDetourInfrastructureFailure(sessionFile);
|
|
29326
|
-
return infrastructureFailure === void 0 ?
|
|
29514
|
+
return infrastructureFailure === void 0 ? result.knownFailure : {
|
|
29327
29515
|
...infrastructureFailure.cause === void 0 ? {} : { cause: infrastructureFailure.cause },
|
|
29328
29516
|
diagnostic: infrastructureFailure.diagnostic,
|
|
29329
29517
|
...infrastructureFailure.identity === void 0 ? {} : { identity: infrastructureFailure.identity }
|
|
@@ -29397,10 +29585,10 @@ async function withAuditorSoulEnv(options) {
|
|
|
29397
29585
|
}
|
|
29398
29586
|
}
|
|
29399
29587
|
}
|
|
29400
|
-
async function runPublicInstructionSeat(
|
|
29588
|
+
async function runPublicInstructionSeat(argv2, env, io, role, parseArgv2) {
|
|
29401
29589
|
let parsed;
|
|
29402
29590
|
try {
|
|
29403
|
-
parsed = parseArgv2(
|
|
29591
|
+
parsed = parseArgv2(argv2);
|
|
29404
29592
|
} catch (error) {
|
|
29405
29593
|
if (error instanceof CliUsageError) {
|
|
29406
29594
|
presentStructuralRejection(error, io);
|
|
@@ -29566,10 +29754,10 @@ function buildCollectorTurnRequest(admitted, options) {
|
|
|
29566
29754
|
options
|
|
29567
29755
|
);
|
|
29568
29756
|
}
|
|
29569
|
-
async function runPublicCollector(
|
|
29757
|
+
async function runPublicCollector(argv2, env, io, parseCollectorArgv2) {
|
|
29570
29758
|
let admitted;
|
|
29571
29759
|
try {
|
|
29572
|
-
const parsed = parseCollectorArgv2(
|
|
29760
|
+
const parsed = parseCollectorArgv2(argv2);
|
|
29573
29761
|
admitted = await admitCollectorInvocation({
|
|
29574
29762
|
home: env.home,
|
|
29575
29763
|
principalAuthority: env.principalAuthority,
|
|
@@ -29624,9 +29812,9 @@ function collectorAdapters() {
|
|
|
29624
29812
|
return {
|
|
29625
29813
|
trySettle: (admitted, authority, scope) => trySettleCollectorTerminalResult(admitted, authority, scope),
|
|
29626
29814
|
shouldPresentSettled: () => true,
|
|
29627
|
-
resolveRunnerKnownFailure: async ({ result
|
|
29815
|
+
resolveRunnerKnownFailure: async ({ result, sessionFile }) => {
|
|
29628
29816
|
const infrastructureFailure = await readCollectorInfrastructureFailure(sessionFile);
|
|
29629
|
-
return
|
|
29817
|
+
return result.knownFailure ?? (infrastructureFailure === void 0 ? void 0 : {
|
|
29630
29818
|
...infrastructureFailure.cause === void 0 ? {} : { cause: infrastructureFailure.cause },
|
|
29631
29819
|
diagnostic: infrastructureFailure.diagnostic,
|
|
29632
29820
|
...infrastructureFailure.identity === void 0 ? {} : { identity: infrastructureFailure.identity }
|
|
@@ -29686,10 +29874,10 @@ function buildNotaryTurnRequest(admitted, options) {
|
|
|
29686
29874
|
options
|
|
29687
29875
|
);
|
|
29688
29876
|
}
|
|
29689
|
-
async function runPublicNotary(
|
|
29877
|
+
async function runPublicNotary(argv2, env, io, parseNotaryArgv2) {
|
|
29690
29878
|
let parsed;
|
|
29691
29879
|
try {
|
|
29692
|
-
parsed = parseNotaryArgv2(
|
|
29880
|
+
parsed = parseNotaryArgv2(argv2);
|
|
29693
29881
|
} catch (error) {
|
|
29694
29882
|
if (error instanceof CliUsageError) {
|
|
29695
29883
|
presentStructuralRejection(error, io);
|
|
@@ -29877,10 +30065,10 @@ function buildInspectorTurnRequest(admitted, options) {
|
|
|
29877
30065
|
options
|
|
29878
30066
|
);
|
|
29879
30067
|
}
|
|
29880
|
-
async function runPublicInspector(
|
|
30068
|
+
async function runPublicInspector(argv2, env, io, parseInspectorArgv2) {
|
|
29881
30069
|
let parsed;
|
|
29882
30070
|
try {
|
|
29883
|
-
parsed = parseInspectorArgv2(
|
|
30071
|
+
parsed = parseInspectorArgv2(argv2);
|
|
29884
30072
|
} catch (error) {
|
|
29885
30073
|
if (error instanceof CliUsageError) {
|
|
29886
30074
|
presentStructuralRejection(error, io);
|
|
@@ -30030,9 +30218,9 @@ function buildJudgeTurnRequest(admitted, options) {
|
|
|
30030
30218
|
function judgeAdapters() {
|
|
30031
30219
|
return {
|
|
30032
30220
|
trySettle: (admitted, authority, scope) => trySettleJudgeTerminalResult(admitted, authority, scope),
|
|
30033
|
-
resolveRunnerKnownFailure: async ({ result
|
|
30221
|
+
resolveRunnerKnownFailure: async ({ result, sessionFile }) => {
|
|
30034
30222
|
const infrastructureFailure = await readEngineDetourInfrastructureFailure(sessionFile);
|
|
30035
|
-
return
|
|
30223
|
+
return result.knownFailure ?? (infrastructureFailure === void 0 ? void 0 : {
|
|
30036
30224
|
...infrastructureFailure.cause === void 0 ? {} : { cause: infrastructureFailure.cause },
|
|
30037
30225
|
diagnostic: infrastructureFailure.diagnostic,
|
|
30038
30226
|
...infrastructureFailure.identity === void 0 ? {} : { identity: infrastructureFailure.identity }
|
|
@@ -30040,10 +30228,10 @@ function judgeAdapters() {
|
|
|
30040
30228
|
}
|
|
30041
30229
|
};
|
|
30042
30230
|
}
|
|
30043
|
-
async function runPublicJudge(
|
|
30231
|
+
async function runPublicJudge(argv2, env, io, parseJudgeArgv2) {
|
|
30044
30232
|
let admitted;
|
|
30045
30233
|
try {
|
|
30046
|
-
const parsed = parseJudgeArgv2(
|
|
30234
|
+
const parsed = parseJudgeArgv2(argv2);
|
|
30047
30235
|
admitted = await admitJudgeInvocation({
|
|
30048
30236
|
home: env.home,
|
|
30049
30237
|
principalAuthority: env.principalAuthority,
|
|
@@ -30148,10 +30336,10 @@ function buildDoctorTurnRequest(admitted, options) {
|
|
|
30148
30336
|
options
|
|
30149
30337
|
);
|
|
30150
30338
|
}
|
|
30151
|
-
async function runPublicDoctor(
|
|
30339
|
+
async function runPublicDoctor(argv2, env, io, parseDoctorArgv2) {
|
|
30152
30340
|
let admitted;
|
|
30153
30341
|
try {
|
|
30154
|
-
const parsed = parseDoctorArgv2(
|
|
30342
|
+
const parsed = parseDoctorArgv2(argv2);
|
|
30155
30343
|
admitted = await admitDoctorInvocation({
|
|
30156
30344
|
home: env.home,
|
|
30157
30345
|
principalAuthority: env.principalAuthority,
|
|
@@ -30277,10 +30465,10 @@ function diaristAdapters(env) {
|
|
|
30277
30465
|
}
|
|
30278
30466
|
};
|
|
30279
30467
|
}
|
|
30280
|
-
async function runPublicDiarist(
|
|
30468
|
+
async function runPublicDiarist(argv2, env, io, parseDiaristArgv2) {
|
|
30281
30469
|
let parsed;
|
|
30282
30470
|
try {
|
|
30283
|
-
parsed = parseDiaristArgv2(
|
|
30471
|
+
parsed = parseDiaristArgv2(argv2);
|
|
30284
30472
|
} catch (error) {
|
|
30285
30473
|
if (error instanceof CliUsageError) {
|
|
30286
30474
|
presentStructuralRejection(error, io);
|
|
@@ -30458,9 +30646,9 @@ function reviewerAdapters(packageRoot2, methodMaterial) {
|
|
|
30458
30646
|
},
|
|
30459
30647
|
scope
|
|
30460
30648
|
),
|
|
30461
|
-
resolveRunnerKnownFailure: async ({ result
|
|
30649
|
+
resolveRunnerKnownFailure: async ({ result, sessionFile }) => {
|
|
30462
30650
|
const infrastructureFailure = await readEngineDetourInfrastructureFailure(sessionFile);
|
|
30463
|
-
return infrastructureFailure === void 0 ?
|
|
30651
|
+
return infrastructureFailure === void 0 ? result.knownFailure : {
|
|
30464
30652
|
...infrastructureFailure.cause === void 0 ? {} : { cause: infrastructureFailure.cause },
|
|
30465
30653
|
diagnostic: infrastructureFailure.diagnostic,
|
|
30466
30654
|
...infrastructureFailure.identity === void 0 ? {} : { identity: infrastructureFailure.identity }
|
|
@@ -30482,10 +30670,10 @@ function reviewerResumePrompt(env, message) {
|
|
|
30482
30670
|
})
|
|
30483
30671
|
).join("\n");
|
|
30484
30672
|
}
|
|
30485
|
-
async function runPublicReviewer(
|
|
30673
|
+
async function runPublicReviewer(argv2, env, io, parseReviewerArgv2) {
|
|
30486
30674
|
let parsed;
|
|
30487
30675
|
try {
|
|
30488
|
-
parsed = parseReviewerArgv2(
|
|
30676
|
+
parsed = parseReviewerArgv2(argv2);
|
|
30489
30677
|
} catch (error) {
|
|
30490
30678
|
if (error instanceof CliUsageError) {
|
|
30491
30679
|
presentStructuralRejection(error, io);
|
|
@@ -30496,7 +30684,7 @@ async function runPublicReviewer(argv, env, io, parseReviewerArgv2) {
|
|
|
30496
30684
|
if (parsed.lens === void 0) {
|
|
30497
30685
|
const { summonParallelReviewerLenses: summonParallelReviewerLenses2 } = await Promise.resolve().then(() => (init_public_role_summons(), public_role_summons_exports));
|
|
30498
30686
|
const children = await summonParallelReviewerLenses2({
|
|
30499
|
-
argv,
|
|
30687
|
+
argv: argv2,
|
|
30500
30688
|
// Replay argv under the same cwd the single-axis entry would see (10a).
|
|
30501
30689
|
// Do not substitute the resolved project path — relative --project must
|
|
30502
30690
|
// not be re-resolved against a shifted cwd.
|
|
@@ -30978,7 +31166,7 @@ async function summonPublicRole(options) {
|
|
|
30978
31166
|
if (!prepared.ok) return { fail: projectPrepareFailure(prepared) };
|
|
30979
31167
|
return { ok: await run(prepared.env, () => parsedArgv) };
|
|
30980
31168
|
}
|
|
30981
|
-
let
|
|
31169
|
+
let result;
|
|
30982
31170
|
switch (options.role) {
|
|
30983
31171
|
case "notary": {
|
|
30984
31172
|
const [{ runPublicNotary: runPublicNotary2 }, { parseNotaryArgv: parseNotaryArgv2 }] = await Promise.all([
|
|
@@ -30987,7 +31175,7 @@ async function summonPublicRole(options) {
|
|
|
30987
31175
|
]);
|
|
30988
31176
|
const stepped = await runPrepared(parseNotaryArgv2, (env, once) => runPublicNotary2(options.argv, env, io, once));
|
|
30989
31177
|
if ("fail" in stepped) return stepped.fail;
|
|
30990
|
-
|
|
31178
|
+
result = stepped.ok;
|
|
30991
31179
|
break;
|
|
30992
31180
|
}
|
|
30993
31181
|
case "inspector": {
|
|
@@ -30997,7 +31185,7 @@ async function summonPublicRole(options) {
|
|
|
30997
31185
|
]);
|
|
30998
31186
|
const stepped = await runPrepared(parseInspectorArgv2, (env, once) => runPublicInspector2(options.argv, env, io, once));
|
|
30999
31187
|
if ("fail" in stepped) return stepped.fail;
|
|
31000
|
-
|
|
31188
|
+
result = stepped.ok;
|
|
31001
31189
|
break;
|
|
31002
31190
|
}
|
|
31003
31191
|
case "auditor":
|
|
@@ -31024,11 +31212,11 @@ async function summonPublicRole(options) {
|
|
|
31024
31212
|
io
|
|
31025
31213
|
));
|
|
31026
31214
|
if ("fail" in stepped) return stepped.fail;
|
|
31027
|
-
|
|
31215
|
+
result = stepped.ok;
|
|
31028
31216
|
} else {
|
|
31029
31217
|
const stepped = await runPrepared(parse, (env, once) => runPublicInstructionSeat2(options.argv, env, io, seat2, once));
|
|
31030
31218
|
if ("fail" in stepped) return stepped.fail;
|
|
31031
|
-
|
|
31219
|
+
result = stepped.ok;
|
|
31032
31220
|
}
|
|
31033
31221
|
break;
|
|
31034
31222
|
}
|
|
@@ -31039,7 +31227,7 @@ async function summonPublicRole(options) {
|
|
|
31039
31227
|
]);
|
|
31040
31228
|
const stepped = await runPrepared(parseJudgeArgv2, (env, once) => runPublicJudge2(options.argv, env, io, once));
|
|
31041
31229
|
if ("fail" in stepped) return stepped.fail;
|
|
31042
|
-
|
|
31230
|
+
result = stepped.ok;
|
|
31043
31231
|
break;
|
|
31044
31232
|
}
|
|
31045
31233
|
case "doctor": {
|
|
@@ -31049,7 +31237,7 @@ async function summonPublicRole(options) {
|
|
|
31049
31237
|
]);
|
|
31050
31238
|
const stepped = await runPrepared(parseDoctorArgv2, (env, once) => runPublicDoctor2(options.argv, env, io, once));
|
|
31051
31239
|
if ("fail" in stepped) return stepped.fail;
|
|
31052
|
-
|
|
31240
|
+
result = stepped.ok;
|
|
31053
31241
|
break;
|
|
31054
31242
|
}
|
|
31055
31243
|
case "diarist": {
|
|
@@ -31059,7 +31247,7 @@ async function summonPublicRole(options) {
|
|
|
31059
31247
|
]);
|
|
31060
31248
|
const stepped = await runPrepared(parseDiaristArgv2, (env, once) => runPublicDiarist2(options.argv, env, io, once));
|
|
31061
31249
|
if ("fail" in stepped) return stepped.fail;
|
|
31062
|
-
|
|
31250
|
+
result = stepped.ok;
|
|
31063
31251
|
break;
|
|
31064
31252
|
}
|
|
31065
31253
|
case "countersign": {
|
|
@@ -31069,7 +31257,7 @@ async function summonPublicRole(options) {
|
|
|
31069
31257
|
]);
|
|
31070
31258
|
const stepped = await runPrepared(parseCountersignArgv2, (env, once) => runPublicCountersign2(options.argv, env, io, once));
|
|
31071
31259
|
if ("fail" in stepped) return stepped.fail;
|
|
31072
|
-
|
|
31260
|
+
result = stepped.ok;
|
|
31073
31261
|
break;
|
|
31074
31262
|
}
|
|
31075
31263
|
case "reviewer": {
|
|
@@ -31079,24 +31267,24 @@ async function summonPublicRole(options) {
|
|
|
31079
31267
|
]);
|
|
31080
31268
|
const stepped = await runPrepared(parseReviewerArgv2, (env, once) => runPublicReviewer2(options.argv, env, io, once));
|
|
31081
31269
|
if ("fail" in stepped) return stepped.fail;
|
|
31082
|
-
|
|
31270
|
+
result = stepped.ok;
|
|
31083
31271
|
break;
|
|
31084
31272
|
}
|
|
31085
31273
|
}
|
|
31086
31274
|
const stderr = captured?.stderrText();
|
|
31087
|
-
const runDirectory =
|
|
31275
|
+
const runDirectory = result.admitted?.runDirectory;
|
|
31088
31276
|
return {
|
|
31089
|
-
exitCode:
|
|
31090
|
-
...
|
|
31091
|
-
...
|
|
31277
|
+
exitCode: result.exitCode,
|
|
31278
|
+
...result.terminal === void 0 ? {} : { terminal: result.terminal },
|
|
31279
|
+
...result.admitted === void 0 ? {} : { admitted: result.admitted },
|
|
31092
31280
|
...typeof runDirectory === "string" && runDirectory.trim() !== "" ? { runDirectory } : {},
|
|
31093
31281
|
...stderr === void 0 || stderr === "" ? {} : { stderr }
|
|
31094
31282
|
};
|
|
31095
31283
|
}
|
|
31096
|
-
function withReviewerLens(
|
|
31097
|
-
const separator =
|
|
31098
|
-
if (separator === -1) return [...
|
|
31099
|
-
return [...
|
|
31284
|
+
function withReviewerLens(argv2, lens) {
|
|
31285
|
+
const separator = argv2.indexOf("--");
|
|
31286
|
+
if (separator === -1) return [...argv2, "--lens", lens];
|
|
31287
|
+
return [...argv2.slice(0, separator), "--lens", lens, ...argv2.slice(separator)];
|
|
31100
31288
|
}
|
|
31101
31289
|
async function resolveReviewerWorktreeRoots(projectRoot) {
|
|
31102
31290
|
const callerProjectRoot = await realpath6(projectRoot);
|
|
@@ -31271,7 +31459,7 @@ async function summonParallelReviewerLenses(options) {
|
|
|
31271
31459
|
}
|
|
31272
31460
|
})
|
|
31273
31461
|
);
|
|
31274
|
-
const creationFailures = creation.flatMap((
|
|
31462
|
+
const creationFailures = creation.flatMap((result) => result.status === "rejected" ? [result.reason] : []);
|
|
31275
31463
|
if (creationFailures.length > 0) {
|
|
31276
31464
|
const failure = failedResult(new AggregateError(
|
|
31277
31465
|
creationFailures,
|
|
@@ -31345,10 +31533,10 @@ async function summonParallelReviewerLenses(options) {
|
|
|
31345
31533
|
${describeFailure(error)}`;
|
|
31346
31534
|
}
|
|
31347
31535
|
if (sealDiagnostic !== void 0) {
|
|
31348
|
-
const withSealFailure = (
|
|
31349
|
-
...
|
|
31536
|
+
const withSealFailure = (result) => ({
|
|
31537
|
+
...result,
|
|
31350
31538
|
exitCode: 1,
|
|
31351
|
-
stderr: [
|
|
31539
|
+
stderr: [result.stderr, sealDiagnostic].filter(
|
|
31352
31540
|
(text) => typeof text === "string" && text !== ""
|
|
31353
31541
|
).join("\n")
|
|
31354
31542
|
});
|
|
@@ -31360,19 +31548,19 @@ ${describeFailure(error)}`;
|
|
|
31360
31548
|
const cleanup = await Promise.allSettled(
|
|
31361
31549
|
[...created].map((path) => execFileAsync3("git", ["worktree", "remove", path], { cwd: sourceProjectRoot }))
|
|
31362
31550
|
);
|
|
31363
|
-
const cleanupFailures = cleanup.flatMap((
|
|
31551
|
+
const cleanupFailures = cleanup.flatMap((result) => result.status === "rejected" ? [result.reason] : []);
|
|
31364
31552
|
if (cleanupFailures.length === 0) {
|
|
31365
31553
|
const rootCleanup = await Promise.allSettled([rm3(root, { recursive: true, force: true })]);
|
|
31366
|
-
cleanupFailures.push(...rootCleanup.flatMap((
|
|
31554
|
+
cleanupFailures.push(...rootCleanup.flatMap((result) => result.status === "rejected" ? [result.reason] : []));
|
|
31367
31555
|
}
|
|
31368
31556
|
if (cleanupFailures.length > 0) {
|
|
31369
31557
|
const diagnostic = [
|
|
31370
31558
|
"parallel reviewer worktree cleanup failed",
|
|
31371
31559
|
...cleanupFailures.map((failure) => failure instanceof Error ? failure.message : String(failure))
|
|
31372
31560
|
].join("\n");
|
|
31373
|
-
const withCleanupDiagnostic = (
|
|
31374
|
-
...
|
|
31375
|
-
stderr: [
|
|
31561
|
+
const withCleanupDiagnostic = (result) => ({
|
|
31562
|
+
...result,
|
|
31563
|
+
stderr: [result.stderr, diagnostic].filter(
|
|
31376
31564
|
(text) => typeof text === "string" && text !== ""
|
|
31377
31565
|
).join("\n")
|
|
31378
31566
|
});
|
|
@@ -31508,7 +31696,7 @@ async function invokeCourtDiarist(input, env, io) {
|
|
|
31508
31696
|
}
|
|
31509
31697
|
};
|
|
31510
31698
|
const { summonPublicRole: summonPublicRole2 } = await Promise.resolve().then(() => (init_public_role_summons(), public_role_summons_exports));
|
|
31511
|
-
const
|
|
31699
|
+
const result = await summonPublicRole2({
|
|
31512
31700
|
role: "diarist",
|
|
31513
31701
|
argv: [
|
|
31514
31702
|
"--project",
|
|
@@ -31530,14 +31718,14 @@ async function invokeCourtDiarist(input, env, io) {
|
|
|
31530
31718
|
// already-selected parent adapter (#840 / ADR 0082: --host 旗标>席位配置>缺省 pi).
|
|
31531
31719
|
...env.hostAdapters === void 0 ? {} : { hostAdapters: env.hostAdapters }
|
|
31532
31720
|
});
|
|
31533
|
-
const roleOutcome =
|
|
31721
|
+
const roleOutcome = result.terminal?.roleOutcome;
|
|
31534
31722
|
if (courtDiaristEscalated(roleOutcome)) {
|
|
31535
31723
|
return {
|
|
31536
31724
|
identity: { kind: "escalate" }
|
|
31537
31725
|
};
|
|
31538
31726
|
}
|
|
31539
|
-
if (
|
|
31540
|
-
const diagnostic = roleOutcome?.kind === "failure" ? roleOutcome.diagnostic :
|
|
31727
|
+
if (result.exitCode !== 0) {
|
|
31728
|
+
const diagnostic = roleOutcome?.kind === "failure" ? roleOutcome.diagnostic : result.stderr?.trim() || `exit ${result.exitCode}`;
|
|
31541
31729
|
return {
|
|
31542
31730
|
identity: { kind: "unbound" },
|
|
31543
31731
|
failedWithoutEscalate: {
|
|
@@ -31545,7 +31733,7 @@ async function invokeCourtDiarist(input, env, io) {
|
|
|
31545
31733
|
}
|
|
31546
31734
|
};
|
|
31547
31735
|
}
|
|
31548
|
-
const asserted =
|
|
31736
|
+
const asserted = result.admitted?.ticketNumber;
|
|
31549
31737
|
if (isSafePositiveTicketNumber(asserted)) {
|
|
31550
31738
|
const courtTicketNumbers = courtTicketNumbersFromOutcome(
|
|
31551
31739
|
roleOutcome,
|
|
@@ -31605,10 +31793,10 @@ async function runCountersignCourtDiaristStation(admitted, env, io) {
|
|
|
31605
31793
|
}
|
|
31606
31794
|
}
|
|
31607
31795
|
}
|
|
31608
|
-
async function runPublicCountersign(
|
|
31796
|
+
async function runPublicCountersign(argv2, env, io, parseCountersignArgv2) {
|
|
31609
31797
|
let parsed;
|
|
31610
31798
|
try {
|
|
31611
|
-
parsed = parseCountersignArgv2(
|
|
31799
|
+
parsed = parseCountersignArgv2(argv2);
|
|
31612
31800
|
} catch (error) {
|
|
31613
31801
|
if (error instanceof CliUsageError) {
|
|
31614
31802
|
presentStructuralRejection(error, io);
|
|
@@ -31811,7 +31999,7 @@ async function runPublicCountersign(argv, env, io, parseCountersignArgv2) {
|
|
|
31811
31999
|
admitted,
|
|
31812
32000
|
turnProjection
|
|
31813
32001
|
);
|
|
31814
|
-
const
|
|
32002
|
+
const result = await runPostAdmissionOneShot({
|
|
31815
32003
|
admitted,
|
|
31816
32004
|
env,
|
|
31817
32005
|
io,
|
|
@@ -31837,7 +32025,7 @@ async function runPublicCountersign(argv, env, io, parseCountersignArgv2) {
|
|
|
31837
32025
|
...env.engine === void 0 ? {} : { effectiveEngine: env.engine }
|
|
31838
32026
|
});
|
|
31839
32027
|
await relocateAdmittedRunToTicket(admitted, env.principalAuthority);
|
|
31840
|
-
return
|
|
32028
|
+
return result;
|
|
31841
32029
|
}
|
|
31842
32030
|
);
|
|
31843
32031
|
} catch (error) {
|
|
@@ -31940,10 +32128,10 @@ function diaristEnv(env) {
|
|
|
31940
32128
|
...env.hostAdapters === void 0 ? {} : { hostAdapters: env.hostAdapters }
|
|
31941
32129
|
};
|
|
31942
32130
|
}
|
|
31943
|
-
async function runPublicSecretariat(
|
|
32131
|
+
async function runPublicSecretariat(argv2, env, io, parseSecretariatArgv2) {
|
|
31944
32132
|
let parsed;
|
|
31945
32133
|
try {
|
|
31946
|
-
parsed = parseSecretariatArgv2(
|
|
32134
|
+
parsed = parseSecretariatArgv2(argv2);
|
|
31947
32135
|
} catch (error) {
|
|
31948
32136
|
if (error instanceof CliUsageError) {
|
|
31949
32137
|
presentStructuralRejection(error, io);
|
|
@@ -32111,10 +32299,10 @@ function buildGleanerLeftTurnRequest(admitted, options) {
|
|
|
32111
32299
|
options
|
|
32112
32300
|
);
|
|
32113
32301
|
}
|
|
32114
|
-
async function runPublicGleanerLeft(
|
|
32302
|
+
async function runPublicGleanerLeft(argv2, env, io, parseGleanerLeftArgv2) {
|
|
32115
32303
|
let admitted;
|
|
32116
32304
|
try {
|
|
32117
|
-
const parsed = parseGleanerLeftArgv2(
|
|
32305
|
+
const parsed = parseGleanerLeftArgv2(argv2);
|
|
32118
32306
|
admitted = await admitGleanerLeftInvocation({
|
|
32119
32307
|
home: env.home,
|
|
32120
32308
|
principalAuthority: env.principalAuthority,
|
|
@@ -32241,10 +32429,10 @@ function fixerAdapters(packageRoot2, methodMaterial) {
|
|
|
32241
32429
|
async function loadFixerMethodMaterial(packageRoot2) {
|
|
32242
32430
|
return await loadPackagedMethodSkillMaterial(packageRoot2, "diagnosing-bugs");
|
|
32243
32431
|
}
|
|
32244
|
-
async function runPublicFixer(
|
|
32432
|
+
async function runPublicFixer(argv2, env, io, parseFixerArgv2) {
|
|
32245
32433
|
let admitted;
|
|
32246
32434
|
try {
|
|
32247
|
-
const parsed = parseFixerArgv2(
|
|
32435
|
+
const parsed = parseFixerArgv2(argv2);
|
|
32248
32436
|
admitted = await admitFixerInvocation({
|
|
32249
32437
|
home: env.home,
|
|
32250
32438
|
principalAuthority: env.principalAuthority,
|
|
@@ -32418,10 +32606,10 @@ function mergerTurnOptions(admitted, env) {
|
|
|
32418
32606
|
...admitted.correlationId === void 0 && env.correlationId === void 0 ? {} : { correlationId: admitted.correlationId ?? env.correlationId }
|
|
32419
32607
|
};
|
|
32420
32608
|
}
|
|
32421
|
-
async function runPublicMerger(
|
|
32609
|
+
async function runPublicMerger(argv2, env, io, parseMergerArgv2) {
|
|
32422
32610
|
let parsed;
|
|
32423
32611
|
try {
|
|
32424
|
-
parsed = parseMergerArgv2(
|
|
32612
|
+
parsed = parseMergerArgv2(argv2);
|
|
32425
32613
|
} catch (error) {
|
|
32426
32614
|
if (error instanceof CliUsageError) {
|
|
32427
32615
|
presentStructuralRejection(error, io);
|
|
@@ -32951,6 +33139,34 @@ async function readExistingRunLifecycleState(runDirectory) {
|
|
|
32951
33139
|
return void 0;
|
|
32952
33140
|
}
|
|
32953
33141
|
}
|
|
33142
|
+
function ghostLeaseCheckFromAutopsy(autopsy) {
|
|
33143
|
+
switch (autopsy.verdict) {
|
|
33144
|
+
case "alive":
|
|
33145
|
+
return void 0;
|
|
33146
|
+
case "dead":
|
|
33147
|
+
return { kind: "holder-dead", pid: autopsy.pid };
|
|
33148
|
+
case "absent":
|
|
33149
|
+
return { kind: "no-lease" };
|
|
33150
|
+
case "unknown":
|
|
33151
|
+
return {
|
|
33152
|
+
kind: "unverifiable",
|
|
33153
|
+
reason: autopsy.reason === "unreadable" ? "unreadable" : "unparseable"
|
|
33154
|
+
};
|
|
33155
|
+
}
|
|
33156
|
+
}
|
|
33157
|
+
async function classifyGhostCandidate(input) {
|
|
33158
|
+
const autopsy = await autopsyWriterLock(join33(input.runDirectory, "writer.lock"));
|
|
33159
|
+
const leaseCheck = ghostLeaseCheckFromAutopsy(autopsy);
|
|
33160
|
+
if (leaseCheck === void 0) return { kind: "live" };
|
|
33161
|
+
return {
|
|
33162
|
+
kind: "ghost",
|
|
33163
|
+
leg: {
|
|
33164
|
+
runId: input.runId,
|
|
33165
|
+
runState: input.runState,
|
|
33166
|
+
leaseCheck
|
|
33167
|
+
}
|
|
33168
|
+
};
|
|
33169
|
+
}
|
|
32954
33170
|
function parseRunDirectoryName2(name) {
|
|
32955
33171
|
const at = name.lastIndexOf("@");
|
|
32956
33172
|
if (at <= 0 || at === name.length - 1) return void 0;
|
|
@@ -33143,13 +33359,26 @@ async function classifyScopedRun(input) {
|
|
|
33143
33359
|
reasons.push(errorText3(error));
|
|
33144
33360
|
}
|
|
33145
33361
|
}
|
|
33362
|
+
const lifecycle = await readExistingRunLifecycleState(input.runDirectory);
|
|
33363
|
+
let ghostLeg;
|
|
33364
|
+
if (lifecycle === "admitted" || lifecycle === "running") {
|
|
33365
|
+
const ghost = await classifyGhostCandidate({
|
|
33366
|
+
runId: input.runId,
|
|
33367
|
+
runState: lifecycle,
|
|
33368
|
+
runDirectory: input.runDirectory
|
|
33369
|
+
});
|
|
33370
|
+
if (ghost.kind === "ghost") ghostLeg = ghost.leg;
|
|
33371
|
+
}
|
|
33146
33372
|
try {
|
|
33147
33373
|
const artifact = await readRunTerminalArtifact(input.runDirectory);
|
|
33148
33374
|
if (artifact.status === "unreadable") {
|
|
33149
33375
|
missingSources.push("terminal-artifact");
|
|
33150
33376
|
reasons.push(`${artifact.file}: ${artifact.reason}`);
|
|
33151
33377
|
} else if (artifact.status === "absent") {
|
|
33152
|
-
|
|
33378
|
+
if (lifecycle === "admitted" || lifecycle === "running") {
|
|
33379
|
+
if (ghostLeg !== void 0) return { kind: "ghost", leg: ghostLeg };
|
|
33380
|
+
return { kind: "live" };
|
|
33381
|
+
}
|
|
33153
33382
|
if (lifecycle !== void 0 && LIVE_RUN_STATES.has(lifecycle)) {
|
|
33154
33383
|
return { kind: "live" };
|
|
33155
33384
|
}
|
|
@@ -33178,7 +33407,8 @@ async function classifyScopedRun(input) {
|
|
|
33178
33407
|
reason: reasons.join("; "),
|
|
33179
33408
|
firstFrameAt,
|
|
33180
33409
|
lastFrameAt
|
|
33181
|
-
}
|
|
33410
|
+
},
|
|
33411
|
+
...ghostLeg !== void 0 ? { ghostLeg } : {}
|
|
33182
33412
|
};
|
|
33183
33413
|
}
|
|
33184
33414
|
if (frameSpan === void 0 || toolIntervals === void 0 || terminal === void 0) {
|
|
@@ -33203,7 +33433,8 @@ async function classifyScopedRun(input) {
|
|
|
33203
33433
|
reason: errorText3(error),
|
|
33204
33434
|
firstFrameAt: { status: "present", at: frameSpan.startedAt },
|
|
33205
33435
|
lastFrameAt: { status: "present", at: frameSpan.endedAt }
|
|
33206
|
-
}
|
|
33436
|
+
},
|
|
33437
|
+
...ghostLeg !== void 0 ? { ghostLeg } : {}
|
|
33207
33438
|
};
|
|
33208
33439
|
}
|
|
33209
33440
|
return {
|
|
@@ -33217,7 +33448,8 @@ async function classifyScopedRun(input) {
|
|
|
33217
33448
|
terminal,
|
|
33218
33449
|
models,
|
|
33219
33450
|
gateCycles
|
|
33220
|
-
}
|
|
33451
|
+
},
|
|
33452
|
+
...ghostLeg !== void 0 ? { ghostLeg } : {}
|
|
33221
33453
|
};
|
|
33222
33454
|
}
|
|
33223
33455
|
async function scanAnalystIssueRuns(input) {
|
|
@@ -33249,10 +33481,11 @@ async function scanAnalystIssueRuns(input) {
|
|
|
33249
33481
|
wholeBook = true;
|
|
33250
33482
|
}
|
|
33251
33483
|
if (bookNames.length === 0) {
|
|
33252
|
-
return { runs: [], unreadable: [], scopeConflicts: [] };
|
|
33484
|
+
return { runs: [], unreadable: [], scopeConflicts: [], ghostLegs: [] };
|
|
33253
33485
|
}
|
|
33254
33486
|
const runs = [];
|
|
33255
33487
|
const unreadable = [];
|
|
33488
|
+
const ghostLegs = [];
|
|
33256
33489
|
const scopeConflicts = [];
|
|
33257
33490
|
for (const book of bookNames) {
|
|
33258
33491
|
const bookDir = join33(booksRoot, book);
|
|
@@ -33290,14 +33523,22 @@ async function scanAnalystIssueRuns(input) {
|
|
|
33290
33523
|
role: parsed.role,
|
|
33291
33524
|
runDirectory
|
|
33292
33525
|
});
|
|
33293
|
-
if (classified.kind === "readable")
|
|
33294
|
-
|
|
33526
|
+
if (classified.kind === "readable") {
|
|
33527
|
+
runs.push(classified.facts);
|
|
33528
|
+
if (classified.ghostLeg !== void 0) ghostLegs.push(classified.ghostLeg);
|
|
33529
|
+
} else if (classified.kind === "unreadable") {
|
|
33530
|
+
unreadable.push(classified.entry);
|
|
33531
|
+
if (classified.ghostLeg !== void 0) ghostLegs.push(classified.ghostLeg);
|
|
33532
|
+
} else if (classified.kind === "ghost") {
|
|
33533
|
+
ghostLegs.push(classified.leg);
|
|
33534
|
+
}
|
|
33295
33535
|
}
|
|
33296
33536
|
}
|
|
33297
33537
|
return {
|
|
33298
33538
|
runs,
|
|
33299
33539
|
unreadable,
|
|
33300
|
-
scopeConflicts
|
|
33540
|
+
scopeConflicts,
|
|
33541
|
+
ghostLegs
|
|
33301
33542
|
};
|
|
33302
33543
|
}
|
|
33303
33544
|
var LIVE_RUN_STATES;
|
|
@@ -33307,6 +33548,7 @@ var init_analyst_ledger = __esm({
|
|
|
33307
33548
|
init_activation_ledger_git();
|
|
33308
33549
|
init_activation_ledger_topology();
|
|
33309
33550
|
init_role_run_placement();
|
|
33551
|
+
init_run_lifecycle();
|
|
33310
33552
|
init_run_ticket_number();
|
|
33311
33553
|
init_ledger_session_read();
|
|
33312
33554
|
init_run_terminal_artifacts();
|
|
@@ -34302,7 +34544,13 @@ async function readOrComputeAnalystIssuePage(input, options) {
|
|
|
34302
34544
|
const raw = await readFile21(pagePath, "utf8");
|
|
34303
34545
|
const page = JSON.parse(raw);
|
|
34304
34546
|
if (cachedPageMatchesRequestedScope(page, { bookKey, ...input })) {
|
|
34305
|
-
|
|
34547
|
+
const ghostScan = await scanAnalystIssueRuns({
|
|
34548
|
+
bookKey,
|
|
34549
|
+
...issueNumber === void 0 ? {} : { ticketNumber: issueNumber },
|
|
34550
|
+
...options?.scanProjectRoot === void 0 ? {} : { projectRoot: options.scanProjectRoot },
|
|
34551
|
+
...options?.home === void 0 ? {} : { home: options.home }
|
|
34552
|
+
});
|
|
34553
|
+
return { mode: "issue", page, pagePath, ghostLegs: ghostScan.ghostLegs };
|
|
34306
34554
|
}
|
|
34307
34555
|
} catch (error) {
|
|
34308
34556
|
if (!isMissingPathError7(error)) {
|
|
@@ -34360,7 +34608,7 @@ async function runAnalystIssueMode(input, precomputedScan, scanProjectRoot, home
|
|
|
34360
34608
|
rowFromIssueMetricsPage(page)
|
|
34361
34609
|
]);
|
|
34362
34610
|
}
|
|
34363
|
-
return { mode: "issue", page, pagePath };
|
|
34611
|
+
return { mode: "issue", page, pagePath, ghostLegs: scan.ghostLegs };
|
|
34364
34612
|
}
|
|
34365
34613
|
async function runAnalystSweepMode(input, home) {
|
|
34366
34614
|
const ledgerHome = resolveActivationLedgerHome(home);
|
|
@@ -34368,7 +34616,7 @@ async function runAnalystSweepMode(input, home) {
|
|
|
34368
34616
|
for (const entry of input.mergedPullRequests) {
|
|
34369
34617
|
issuePages.push(await runAnalystIssueMode(entry, void 0, void 0, home));
|
|
34370
34618
|
}
|
|
34371
|
-
const upserts = issuePages.map((
|
|
34619
|
+
const upserts = issuePages.map((result) => rowFromIssueMetricsPage(result.page));
|
|
34372
34620
|
const { index, indexPath } = await mergeAnalystLibraryIndexRows(ledgerHome, upserts);
|
|
34373
34621
|
return { mode: "sweep", issuePages, index, indexPath };
|
|
34374
34622
|
}
|
|
@@ -34571,16 +34819,16 @@ async function buildAnalystSweepModeInputFromAttachmentPaths(attachmentPaths) {
|
|
|
34571
34819
|
}
|
|
34572
34820
|
return parseAnalystSweepModeInputFromJsonValue(parsed);
|
|
34573
34821
|
}
|
|
34574
|
-
async function runPublicAnalyst(
|
|
34822
|
+
async function runPublicAnalyst(argv2, _env, io, parseAnalystArgv2) {
|
|
34575
34823
|
try {
|
|
34576
|
-
const parsed = parseAnalystArgv2(
|
|
34824
|
+
const parsed = parseAnalystArgv2(argv2);
|
|
34577
34825
|
const ledgerHome = resolveActivationLedgerHome(_env.home);
|
|
34578
34826
|
if (parsed.query === "sweep") {
|
|
34579
34827
|
const input2 = await buildAnalystSweepModeInputFromAttachmentPaths(
|
|
34580
34828
|
parsed.attachmentPaths
|
|
34581
34829
|
);
|
|
34582
|
-
const
|
|
34583
|
-
io.stdout(`${JSON.stringify(
|
|
34830
|
+
const result2 = await runAnalyst(input2, { home: _env.home });
|
|
34831
|
+
io.stdout(`${JSON.stringify(result2, null, 2)}
|
|
34584
34832
|
`);
|
|
34585
34833
|
return { exitCode: 0 };
|
|
34586
34834
|
}
|
|
@@ -34593,7 +34841,7 @@ async function runPublicAnalyst(argv, _env, io, parseAnalystArgv2) {
|
|
|
34593
34841
|
defaultBookKey ??= resolveAnalystIssueBookKeyFromCwd();
|
|
34594
34842
|
return { bookKey: defaultBookKey, issueNumber: token.issueNumber };
|
|
34595
34843
|
};
|
|
34596
|
-
const
|
|
34844
|
+
const result2 = await runAnalyst({
|
|
34597
34845
|
mode: "cohort",
|
|
34598
34846
|
groups: [
|
|
34599
34847
|
{
|
|
@@ -34606,13 +34854,13 @@ async function runPublicAnalyst(argv, _env, io, parseAnalystArgv2) {
|
|
|
34606
34854
|
}
|
|
34607
34855
|
]
|
|
34608
34856
|
}, { home: _env.home });
|
|
34609
|
-
io.stdout(`${JSON.stringify(
|
|
34857
|
+
io.stdout(`${JSON.stringify(result2, null, 2)}
|
|
34610
34858
|
`);
|
|
34611
34859
|
return { exitCode: 0 };
|
|
34612
34860
|
}
|
|
34613
34861
|
const input = await buildAnalystIssueModeInputFromPublicArgv(parsed, ledgerHome);
|
|
34614
|
-
const
|
|
34615
|
-
io.stdout(`${JSON.stringify(
|
|
34862
|
+
const result = await readOrComputeAnalystIssuePage(input, { home: _env.home });
|
|
34863
|
+
io.stdout(`${JSON.stringify(result, null, 2)}
|
|
34616
34864
|
`);
|
|
34617
34865
|
return { exitCode: 0 };
|
|
34618
34866
|
} catch (error) {
|
|
@@ -34658,6 +34906,7 @@ __export(cli_exports, {
|
|
|
34658
34906
|
PUBLIC_GLOBAL_OPTIONS: () => PUBLIC_GLOBAL_OPTIONS,
|
|
34659
34907
|
PUBLIC_ROLE_ARGV: () => PUBLIC_ROLE_ARGV,
|
|
34660
34908
|
buildExplicitInternalActivationArgs: () => buildExplicitInternalActivationArgs,
|
|
34909
|
+
commandNeedsProcessCancel: () => commandNeedsProcessCancel,
|
|
34661
34910
|
helpDocument: () => helpDocument,
|
|
34662
34911
|
helpDocumentForCommand: () => helpDocumentForCommand,
|
|
34663
34912
|
projectConfigDisplaySeats: () => projectConfigDisplaySeats,
|
|
@@ -34667,11 +34916,11 @@ __export(cli_exports, {
|
|
|
34667
34916
|
});
|
|
34668
34917
|
import { realpath as realpath7 } from "node:fs/promises";
|
|
34669
34918
|
import { join as join35 } from "node:path";
|
|
34670
|
-
function takePublicGlobalFlag(
|
|
34671
|
-
const tokens =
|
|
34919
|
+
function takePublicGlobalFlag(argv2, index, options) {
|
|
34920
|
+
const tokens = argv2.slice(index);
|
|
34672
34921
|
const taken = options.takeDashed(tokens);
|
|
34673
34922
|
if (taken === void 0) return void 0;
|
|
34674
|
-
const consumed =
|
|
34923
|
+
const consumed = argv2.length - index - tokens.length;
|
|
34675
34924
|
if (taken.def.id === "help") {
|
|
34676
34925
|
return { flag: "help", consume: consumed };
|
|
34677
34926
|
}
|
|
@@ -34746,7 +34995,8 @@ function createRoleEnvironment(env, options, afterHost) {
|
|
|
34746
34995
|
...timeoutMs === void 0 ? {} : { timeoutMs },
|
|
34747
34996
|
...env.createRunId === void 0 ? {} : { createRunId: env.createRunId },
|
|
34748
34997
|
...options.config?.autoResumeLimit === void 0 ? {} : { autoResumeLimit: options.config.autoResumeLimit },
|
|
34749
|
-
...env.freshSummons === true ? { freshSummons: true } : {}
|
|
34998
|
+
...env.freshSummons === true ? { freshSummons: true } : {},
|
|
34999
|
+
...env.signal === void 0 ? {} : { signal: env.signal }
|
|
34750
35000
|
};
|
|
34751
35001
|
}
|
|
34752
35002
|
async function dispatchPublicRoleCommand(env, home, io, parsed, role, parse, run) {
|
|
@@ -34761,7 +35011,7 @@ async function dispatchPublicRoleCommand(env, home, io, parsed, role, parse, run
|
|
|
34761
35011
|
invocationFromParsed(parsed)
|
|
34762
35012
|
);
|
|
34763
35013
|
let parsedRoleArgv;
|
|
34764
|
-
const
|
|
35014
|
+
const result = await run(
|
|
34765
35015
|
parsed.args,
|
|
34766
35016
|
createRoleEnvironment(
|
|
34767
35017
|
env,
|
|
@@ -34773,15 +35023,15 @@ async function dispatchPublicRoleCommand(env, home, io, parsed, role, parse, run
|
|
|
34773
35023
|
() => parsedRoleArgv
|
|
34774
35024
|
);
|
|
34775
35025
|
return {
|
|
34776
|
-
exitCode:
|
|
34777
|
-
...
|
|
35026
|
+
exitCode: result.exitCode,
|
|
35027
|
+
...result.terminal === void 0 ? {} : { terminal: result.terminal }
|
|
34778
35028
|
};
|
|
34779
35029
|
}
|
|
34780
|
-
function cliResultFromRoleRun(
|
|
35030
|
+
function cliResultFromRoleRun(result) {
|
|
34781
35031
|
return {
|
|
34782
|
-
exitCode:
|
|
34783
|
-
...
|
|
34784
|
-
...
|
|
35032
|
+
exitCode: result.exitCode,
|
|
35033
|
+
...result.terminal === void 0 ? {} : { terminal: result.terminal },
|
|
35034
|
+
...result.staleWriterLeaseReclaimed === true ? { staleWriterLeaseReclaimed: true } : {}
|
|
34785
35035
|
};
|
|
34786
35036
|
}
|
|
34787
35037
|
function defaultIo() {
|
|
@@ -34803,8 +35053,8 @@ function resolveAgentDir(env, home) {
|
|
|
34803
35053
|
function parseThinking(value) {
|
|
34804
35054
|
return value;
|
|
34805
35055
|
}
|
|
34806
|
-
function parseArgv(
|
|
34807
|
-
const args = [...
|
|
35056
|
+
function parseArgv(argv2) {
|
|
35057
|
+
const args = [...argv2];
|
|
34808
35058
|
let model;
|
|
34809
35059
|
let thinking;
|
|
34810
35060
|
let engine;
|
|
@@ -35314,7 +35564,21 @@ async function runConfigCommand(args, home, packageRoot2, io) {
|
|
|
35314
35564
|
}
|
|
35315
35565
|
throw new CliUsageError(`unknown config subcommand: ${args[0]}`);
|
|
35316
35566
|
}
|
|
35317
|
-
|
|
35567
|
+
function commandNeedsProcessCancel(argv2) {
|
|
35568
|
+
let parsed;
|
|
35569
|
+
try {
|
|
35570
|
+
parsed = parseArgv(argv2);
|
|
35571
|
+
} catch (error) {
|
|
35572
|
+
if (error instanceof CliUsageError) return false;
|
|
35573
|
+
throw error;
|
|
35574
|
+
}
|
|
35575
|
+
if (parsed.help || parsed.command === void 0 || parsed.command === "help") {
|
|
35576
|
+
return false;
|
|
35577
|
+
}
|
|
35578
|
+
if (parsed.command === "resume" || parsed.command === "new") return true;
|
|
35579
|
+
return isPublicCallableRole(parsed.command);
|
|
35580
|
+
}
|
|
35581
|
+
async function runAkRole(argv2, env) {
|
|
35318
35582
|
const io = env.io ?? defaultIo();
|
|
35319
35583
|
try {
|
|
35320
35584
|
env = {
|
|
@@ -35322,7 +35586,7 @@ async function runAkRole(argv, env) {
|
|
|
35322
35586
|
packageRoot: await realpath7(env.packageRoot),
|
|
35323
35587
|
principalAuthority: env.principalAuthority ?? piDurablePrincipalAuthority
|
|
35324
35588
|
};
|
|
35325
|
-
let parsed = parseArgv(
|
|
35589
|
+
let parsed = parseArgv(argv2);
|
|
35326
35590
|
const acceptsSeatAxes = parsed.command !== void 0 && (isPublicCallableRole(parsed.command) || parsed.command === "resume" || parsed.command === "new");
|
|
35327
35591
|
if (parsed.host !== void 0 && !parsed.help && parsed.command !== void 0 && parsed.command !== "help" && !acceptsSeatAxes) {
|
|
35328
35592
|
throw new CliUsageError(`host axis is role commands only; refused command ${parsed.command}`);
|
|
@@ -35397,7 +35661,7 @@ async function runAkRole(argv, env) {
|
|
|
35397
35661
|
credentials,
|
|
35398
35662
|
invocationFromParsed(parsed)
|
|
35399
35663
|
);
|
|
35400
|
-
const
|
|
35664
|
+
const result = await dispatch.run(
|
|
35401
35665
|
resumeRequest,
|
|
35402
35666
|
createRoleEnvironment(env, {
|
|
35403
35667
|
role: dispatch.seat,
|
|
@@ -35410,7 +35674,7 @@ async function runAkRole(argv, env) {
|
|
|
35410
35674
|
}),
|
|
35411
35675
|
io
|
|
35412
35676
|
);
|
|
35413
|
-
return cliResultFromRoleRun(
|
|
35677
|
+
return cliResultFromRoleRun(result);
|
|
35414
35678
|
}
|
|
35415
35679
|
if (parsed.command !== void 0 && isPublicCliSupportCommand(parsed.command)) {
|
|
35416
35680
|
throw new CliUsageError(`unhandled support command: ${parsed.command}`);
|
|
@@ -35571,13 +35835,13 @@ async function runAkRole(argv, env) {
|
|
|
35571
35835
|
);
|
|
35572
35836
|
}
|
|
35573
35837
|
if (parsed.command === "analyst") {
|
|
35574
|
-
const
|
|
35838
|
+
const result = await runPublicAnalyst(
|
|
35575
35839
|
parsed.args,
|
|
35576
35840
|
{ home },
|
|
35577
35841
|
io,
|
|
35578
35842
|
PUBLIC_ROLE_ARGV.analyst.parse
|
|
35579
35843
|
);
|
|
35580
|
-
return { exitCode:
|
|
35844
|
+
return { exitCode: result.exitCode };
|
|
35581
35845
|
}
|
|
35582
35846
|
throw new CliUsageError(`unknown command: ${parsed.command}`);
|
|
35583
35847
|
} catch (error) {
|
|
@@ -35783,6 +36047,16 @@ function resolvePackageRoot(binDir) {
|
|
|
35783
36047
|
var packageRoot = resolvePackageRoot(here);
|
|
35784
36048
|
process.env.AK_ROLE_PACKAGE_ROOT = packageRoot;
|
|
35785
36049
|
ensureHostPiRuntimeResolvable(packageRoot);
|
|
35786
|
-
var { runAkRole: runAkRole2 } = await Promise.resolve().then(() => (init_cli(), cli_exports));
|
|
35787
|
-
var
|
|
35788
|
-
|
|
36050
|
+
var { runAkRole: runAkRole2, commandNeedsProcessCancel: commandNeedsProcessCancel2 } = await Promise.resolve().then(() => (init_cli(), cli_exports));
|
|
36051
|
+
var { installProcessCancelHandlers: installProcessCancelHandlers2 } = await Promise.resolve().then(() => (init_process_cancel(), process_cancel_exports));
|
|
36052
|
+
var argv = process.argv.slice(2);
|
|
36053
|
+
var processCancel = commandNeedsProcessCancel2(argv) ? installProcessCancelHandlers2() : void 0;
|
|
36054
|
+
try {
|
|
36055
|
+
const result = await runAkRole2(argv, {
|
|
36056
|
+
packageRoot,
|
|
36057
|
+
...processCancel === void 0 ? {} : { signal: processCancel.signal }
|
|
36058
|
+
});
|
|
36059
|
+
process.exitCode = processCancel !== void 0 && processCancel.receivedSignal() !== void 0 && result.exitCode === 0 ? 1 : result.exitCode;
|
|
36060
|
+
} finally {
|
|
36061
|
+
processCancel?.dispose();
|
|
36062
|
+
}
|