@akagilnc/pi-workflow-roles 0.1.4586 → 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.
Files changed (63) hide show
  1. package/README.md +2 -2
  2. package/README.zh-CN.md +3 -3
  3. package/dist/acp-host/production-host.js +1184 -717
  4. package/dist/activation-ledger-topology.js +0 -4
  5. package/dist/archivist-record-topology.js +27 -35
  6. package/dist/headless-host/description.js +7 -4
  7. package/dist/headless-host/production-host.js +998 -595
  8. package/dist/migrate-book-topology.js +3 -6
  9. package/dist/navigator-attendance.js +146 -241
  10. package/dist/navigator-public-session.js +81 -15
  11. package/dist/package-contracts/navigator-output.js +30 -12
  12. package/dist/pi/role-turn-host.js +0 -3
  13. package/dist/public-cli/auto-resume.js +26 -0
  14. package/dist/public-cli/judge-run.js +2 -2
  15. package/dist/public-cli/main.js +1119 -870
  16. package/dist/public-cli/option-definitions.js +1 -1
  17. package/dist/public-cli/post-admission.js +103 -9
  18. package/dist/public-cli/process-cancel.js +57 -0
  19. package/dist/public-cli/run-lifecycle.js +29 -7
  20. package/dist/public-cli/settlement.js +46 -32
  21. package/dist/public-cli/terminal.js +8 -27
  22. package/dist/public-role-summons.js +22 -4
  23. package/dist/submission-ledger.js +56 -23
  24. package/package.json +1 -1
  25. package/resources/836-deleted-machine-instruction-inventory.md +2 -0
  26. package/resources/navigator-route-playbook.md +9 -0
  27. package/scripts/build-package.mjs +6 -2
  28. package/src/acp-host/role-turn-host.ts +129 -13
  29. package/src/activation-ledger-topology.ts +1 -6
  30. package/src/activation-ledger.ts +5 -236
  31. package/src/analyst-entry.ts +19 -2
  32. package/src/analyst-ledger.ts +111 -6
  33. package/src/archivist-record-entry.ts +1 -1
  34. package/src/headless-host/description.ts +17 -7
  35. package/src/headless-host/role-turn-host.ts +42 -11
  36. package/src/navigator-attendance.ts +290 -425
  37. package/src/navigator-public-session.ts +126 -25
  38. package/src/navigator-role.ts +2 -2
  39. package/src/package-contracts/navigator-output.ts +41 -25
  40. package/src/pi/role-turn-host.ts +0 -3
  41. package/src/public-cli/auto-resume.ts +34 -0
  42. package/src/public-cli/cli.ts +30 -0
  43. package/src/public-cli/coder-run.ts +2 -2
  44. package/src/public-cli/fixer-run.ts +2 -2
  45. package/src/public-cli/judge-run.ts +2 -2
  46. package/src/public-cli/main.ts +25 -3
  47. package/src/public-cli/merger-run.ts +2 -2
  48. package/src/public-cli/option-definitions.ts +1 -1
  49. package/src/public-cli/post-admission.ts +175 -7
  50. package/src/public-cli/process-cancel.ts +75 -0
  51. package/src/public-cli/run-lifecycle.ts +37 -7
  52. package/src/public-cli/settlement.ts +42 -33
  53. package/src/public-cli/terminal.ts +12 -37
  54. package/src/public-role-summons.ts +34 -5
  55. package/src/role-envelope.ts +89 -4
  56. package/src/role-runtime.ts +78 -65
  57. package/src/submission-ledger.ts +63 -21
  58. package/dist/activation-reconciliation.js +0 -61
  59. package/dist/public-cli/command-renderer.js +0 -5
  60. package/dist/public-command-renderer.js +0 -29
  61. package/src/activation-reconciliation.ts +0 -163
  62. package/src/public-cli/command-renderer.ts +0 -9
  63. package/src/public-command-renderer.ts +0 -55
@@ -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 result2 = Function.prototype.toString.call(value);
874
- if (/^class\s/.test(result2))
869
+ const result = Function.prototype.toString.call(value);
870
+ if (/^class\s/.test(result))
875
871
  return true;
876
- if (/\[native code\]/.test(result2))
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 result2 = true;
958
+ let result = true;
963
959
  for (let index = offset; index < value.length; index++) {
964
960
  if (!callback(value[index], index))
965
- result2 = false;
961
+ result = false;
966
962
  }
967
- return result2;
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 result2 = false;
973
+ let result = false;
978
974
  for (let index = 0; index < value.length; index++) {
979
975
  if (callback(value[index], index))
980
- result2 = true;
976
+ result = true;
981
977
  }
982
- return result2;
978
+ return result;
983
979
  }
984
980
  function Counted(value, callback) {
985
- return value.reduce((result2, value2, index) => callback(value2, index) ? ++result2 : result2, 0);
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 result2 = {};
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(result2, key, { ...descriptor, value: FromValue(descriptor.value) });
1152
+ Object.defineProperty(result, key, { ...descriptor, value: FromValue(descriptor.value) });
1157
1153
  }
1158
1154
  }
1159
- return result2;
1155
+ return result;
1160
1156
  }
1161
1157
  function FromPlainObject(value) {
1162
- const result2 = {};
1158
+ const result = {};
1163
1159
  for (const key of guard_exports.Keys(value)) {
1164
1160
  if (guard_exports.IsUnsafePropertyKey(key))
1165
1161
  continue;
1166
- result2[key] = FromValue(value[key]);
1162
+ result[key] = FromValue(value[key]);
1167
1163
  }
1168
1164
  for (const key of guard_exports.Symbols(value)) {
1169
- result2[key] = FromValue(value[key]);
1165
+ result[key] = FromValue(value[key]);
1170
1166
  }
1171
- return result2;
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 result2 = {};
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(result2, key, descriptors[key]);
1289
+ Object.defineProperty(result, key, descriptors[key]);
1294
1290
  }
1295
- return result2;
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 result2 = Clone(current);
1304
+ const result = Clone(current);
1309
1305
  for (const key of Object.keys(hidden)) {
1310
- Object.defineProperty(result2, key, {
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(result2, key, {
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 result2;
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 result2 = memory_exports.Update(AddReadonlyOperation(type), {}, options);
1396
- return result2;
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 result2 = memory_exports.Update(AddOptionalOperation(type), {}, options);
1415
- return result2;
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((result2, key) => {
1620
- return { ...result2, [key]: memory_exports.Update($defs[key], {}, { $id: key }) };
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((result2, key) => [...result2, type[key]], []);
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 result2 = guard_exports.IsEqual(parsed.length, 2) ? parsed[0] : [];
2660
- return result2;
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 result2 = guard_exports.IsEqual(types.length, 0) ? false : FromTypesReduce(types);
2678
- return result2;
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 result2 = FromTypes(types);
2685
- return result2;
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, result2 = []) {
2707
- return guard_exports.ShiftLeft(variants, (left, right) => FromLiteralPush(right, value, [...result2, `${left}${value}`]), () => result2);
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, result2 = []) {
2713
- return guard_exports.ShiftLeft(types, (left, right) => FromUnion(variants, right, [...result2, ...FromType2(variants, left)]), () => result2);
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 result2 = IsUnion(type) ? FromUnion(variants, type.anyOf) : IsLiteral(type) ? FromLiteral2(variants, type.const) : Unreachable();
2717
- return result2;
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 result2 = Union(literals);
2729
- return result2;
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 result2 = guard_exports.IsEqual(types.length, 0) ? String2() : IsTemplateLiteralFinite(types) ? DecodeTypes(types) : TemplateLiteralCreate(pattern);
2740
- return result2;
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 result2 = IsTemplateLiteral(decoded) ? String2() : decoded;
2745
- return result2;
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 result2 = memory_exports.Update(RemoveReadonlyOperation(type), {}, options);
2818
- return result2;
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 result2 = memory_exports.Update(RemoveOptionalOperation(type), {}, options);
2851
- return result2;
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 result2 = types.reduceRight((result3, right, index) => {
2881
- return { [index]: right, ...result3 };
2876
+ const result = types.reduceRight((result2, right, index) => {
2877
+ return { [index]: right, ...result2 };
2882
2878
  }, {});
2883
- return result2;
2879
+ return result;
2884
2880
  }
2885
2881
  function TupleToObject(type) {
2886
2882
  const properties = TupleElementsToProperties(type.items);
2887
- const result2 = _Object_(properties);
2888
- return result2;
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((result2, key) => {
2916
- return { ...result2, [key]: CompositePropertyKey(left, right, key) };
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 result2 = IsObject2(type) ? type.properties : IsTuple(type) ? TupleElementsToProperties(type.items) : Unreachable();
2921
- return result2;
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 result2 = Compare(left, right);
2950
- return guard_exports.IsEqual(result2, ResultLeftInside) ? left : guard_exports.IsEqual(result2, ResultRightInside) ? right : guard_exports.IsEqual(result2, ResultEqual) ? right : Never();
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 result2 = isUnionLeft || isUnionRight;
2968
- return result2;
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 result2 = isUnionOperand ? EvaluateIntersect([evaluatedLeft, evaluatedRight]) : isObjectLeft && IsObjectRight ? Composite(evaluatedLeft, evaluatedRight) : isObjectLeft && !IsObjectRight ? evaluatedLeft : !isObjectLeft && IsObjectRight ? evaluatedRight : Narrow(evaluatedLeft, evaluatedRight);
2977
- return result2;
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, result2 = []) {
2980
- return guard_exports.ShiftLeft(types, (left, right) => DistributeType(type, right, [...result2, DistributeOperation(type, left)]), () => guard_exports.IsEqual(result2.length, 0) ? [type] : result2);
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, result2 = []) {
2983
- return guard_exports.ShiftLeft(types, (left, right) => DistributeUnion(right, distribution, [...result2, ...Distribute([left], distribution)]), () => result2);
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, result2 = []) {
2986
- return guard_exports.ShiftLeft(types, (left, right) => IsUnion(left) ? Distribute(right, DistributeUnion(left.anyOf, result2)) : Distribute(right, DistributeType(left, result2)), () => result2);
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 result2 = result_exports.IsExtendsTrueLike(check) ? [] : [left];
3005
- return result2;
3000
+ const result = result_exports.IsExtendsTrueLike(check) ? [] : [left];
3001
+ return result;
3006
3002
  }
3007
3003
  function ExcludeUnion(types, right) {
3008
- return types.reduce((result2, head) => {
3009
- return [...result2, ...ExcludeType(head, right)];
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 result2 = EvaluateUnion(remaining);
3017
- return result2;
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 result2 = EvaluateUnion([intersect, excluded]);
3033
- return result2;
3028
+ const result = EvaluateUnion([intersect, excluded]);
3029
+ return result;
3034
3030
  }
3035
3031
  function EvaluateEnum(values) {
3036
- const result2 = values.map((value) => Literal(value));
3037
- return EvaluateUnion(result2);
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 result2 = EvaluateUnionFast(broadend);
3043
- return result2;
3038
+ const result = EvaluateUnionFast(broadend);
3039
+ return result;
3044
3040
  }
3045
3041
  function EvaluateTemplateLiteral(pattern) {
3046
3042
  const evaluated = TemplateLiteralDecode(pattern);
3047
- const result2 = EvaluateType(evaluated);
3048
- return result2;
3043
+ const result = EvaluateType(evaluated);
3044
+ return result;
3049
3045
  }
3050
3046
  function EvaluateUnion(types) {
3051
3047
  const broadend = Broaden(types);
3052
- const result2 = EvaluateUnionFast(broadend);
3053
- return result2;
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 result2 = guard_exports.IsEqual(types.length, 1) ? types[0] : guard_exports.IsEqual(types.length, 0) ? Never() : Union(types);
3060
- return result2;
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 result2 = FromKey(unionKey, value);
3083
- return result2;
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 result2 = CreateRecord(IntegerKey, value);
3095
- return result2;
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 result2 = FromKey(evaluatedKey, value);
3108
- return result2;
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 result2 = CreateRecord(NumberKey, value);
3131
- return result2;
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 result2 = finite ? FromKey(EvaluateTemplateLiteral(pattern), value) : CreateRecord(pattern, value);
3157
- return result2;
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 result2 = IsUnion(type) ? Flatten(type.anyOf) : [type];
3172
- return result2;
3167
+ const result = IsUnion(type) ? Flatten(type.anyOf) : [type];
3168
+ return result;
3173
3169
  }
3174
3170
  function Flatten(types) {
3175
- return types.reduce((result2, type) => {
3176
- return [...result2, ...FlattenType(type)];
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((result2, left) => {
3194
- return IsLiteral(left) && (guard_exports.IsString(left.const) || guard_exports.IsNumber(left.const)) ? { ...result2, [left.const]: value } : result2;
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 result2 = _Object_(properties);
3200
- return result2;
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 result2 = 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_({});
3225
- return result2;
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 result2 = CanInstantiate([key]) ? memory_exports.Update(FromKey(key, value), {}, options) : RecordDeferred(key, value, options);
3256
- return result2;
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 result2 = guard_exports.IsEqual(pattern, StringKey) ? String2() : guard_exports.IsEqual(pattern, IntegerKey) ? Integer() : guard_exports.IsEqual(pattern, NumberKey) ? Number2() : TemplateLiteralDecodeUnsafe(pattern);
3284
- return result2;
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 result2 = RecordPatternToType(pattern);
3292
- return result2;
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((result2, current) => {
3549
- return guard_exports.IsEqual(current.length, 3) ? [...result2, [current[1]]] : [...result2, []];
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((result2, left) => {
3558
+ return indexArray.reduce((result, left) => {
3563
3559
  const _left = left;
3564
- return guard_exports.IsEqual(_left.length, 1) ? IndexDeferred(result2, _left[0]) : guard_exports.IsEqual(_left.length, 0) ? _Array_(result2) : Unreachable2();
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((result2, left) => {
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 ? [result2[0], memory_exports.Assign(result2[1], left)] : [memory_exports.Assign(result2[0], left), result2[1]];
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((result2, left) => {
3764
- return memory_exports.Assign(result2, left);
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, result2 = []) => {
3868
- return input.reduce((result3, left) => {
3869
- return guard_exports.IsArray(left) && guard_exports.IsEqual(left.length, 2) ? [...result3, left[0]] : [...result3, left];
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 result2 = TakeVariant(variants[i], input);
3906
- if (IsMatch(result2))
3907
- return result2;
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 result2 = IsEqual(index, -1) ? "" : input.slice(index + 2);
3947
- return result2;
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 result2 = IsEqual(index, -1) ? "" : input.slice(index);
3952
- return result2;
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, result2 = "") {
3992
- return Match2(Take(allowed, input), (Char, Rest2) => IsDiscard(discard, Char) ? Many(allowed, discard, Rest2, result2) : Many(allowed, discard, Rest2, `${result2}${Char}`), () => [result2, input]);
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, result2 = "") {
4102
- return Match2(Take(Remaining, input), (Remaining2, RemainingRest) => TakeRemaining(RemainingRest, `${result2}${Remaining2}`), () => [result2, input]);
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 result2 = IsEqual(input, "") ? [] : [input.slice(0, 1), input.slice(1)];
4214
- return result2;
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, result2 = "") {
4215
+ function Until(end, input, result = "") {
4220
4216
  return Match2(
4221
4217
  TakeOne(input),
4222
- (One, Rest2) => IsInputMatchSentinal(end, input) ? [result2, input] : Until(end, Rest2, `${result2}${One}`),
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 = (result2, left, right = () => []) => result2.length === 2 ? left(result2) : right();
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, result2 = []) => If(If(GenericParameter(input), ([_0, input2]) => If(Const(",", input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => GenericParameterList_0(input2, [...result2, _0]), () => [result2, 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, result2 = []) => If(If(Type(input), ([_0, input2]) => If(Const(",", input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => GenericCallArgumentList_0(input2, [...result2, _0]), () => [result2, 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, result2 = []) => 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, [...result2, _0]), () => [result2, 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, result2 = []) => If(If(Property(input), ([_0, input2]) => If(PropertyDelimiter(input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => PropertyList_0(input2, [...result2, _0]), () => [result2, 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, result2 = []) => If(If(Element(input), ([_0, input2]) => If(Const(",", input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => ElementList_0(input2, [...result2, _0]), () => [result2, 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, result2 = []) => If(If(Parameter2(input), ([_0, input2]) => If(Const(",", input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => ParameterList_0(input2, [...result2, _0]), () => [result2, 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, result2 = []) => If(If(WithProperty(input), ([_0, input2]) => If(PropertyDelimiter(input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => WithPropertyList_0(input2, [...result2, _0]), () => [result2, 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, result2 = []) => If(If(WithValue(input), ([_0, input2]) => If(Const(",", input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => WithElementList_0(input2, [...result2, _0]), () => [result2, 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, result2 = []) => If(If(Type(input), ([_0, input2]) => If(Const(",", input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => InterfaceDeclarationHeritageList_0(input2, [...result2, _0]), () => [result2, 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, result2 = []) => If(If(ModuleDeclaration(input), ([_0, input2]) => If(ModuleDeclarationDelimiter(input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => ModuleDeclarationList_0(input2, [...result2, _0]), () => [result2, 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 result2 = guard_exports.IsEqual(parsed.length, 2) ? parsed[0] : Unreachable();
4469
- return result2;
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 result2 = EncodeType(templateLiteral, right, pattern);
4510
- return result2;
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, result2 = []) {
4517
- return guard_exports.ShiftLeft(types, (head, tail) => EncodeUnion(tail, right, pattern, [...result2, EncodeType(head, [], "")]), () => EncodeTypes(right, `${pattern}(${JoinString(result2)})`));
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 result2 = `^${encoded}$`;
4528
- return result2;
4523
+ const result = `^${encoded}$`;
4524
+ return result;
4529
4525
  }
4530
4526
  function TemplateLiteralEncode(types) {
4531
4527
  const pattern = EncodePattern(types);
4532
- const result2 = TemplateLiteralCreate(pattern);
4533
- return result2;
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 result2 = CanInstantiate(types) ? memory_exports.Update(TemplateLiteralEncode(types), {}, options) : TemplateLiteralDeferred(types, options);
4557
- return result2;
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(result2, true_, false_) {
4638
- return IsExtendsTrueLike(result2) ? true_(result2.inferred) : false_();
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((result2, key) => {
4948
- return key in properties ? IsExtendsTrueLike(properties[key]) ? { ...result2, ...properties[key].inferred } : Unreachable() : Unreachable();
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((result2) => IsExtendsTrueLike(result2));
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((result2, key) => {
4964
+ return guard_exports.Keys(right).reduce((result, key) => {
4969
4965
  return {
4970
- ...result2,
4971
- [key]: guard_exports.HasPropertyKey(left, key) ? IsUnion(result2[key]) ? Union([...result2[key].anyOf, right[key]]) : Union([left[key], right[key]]) : right[key]
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, result2) {
4976
- return guard_exports.ShiftLeft(keys, (left, right) => Match3(ExtendsLeft({}, properties[left], type), (inferred) => ExtendsRecordComparer(properties, right, type, RecordMergeInferred(result2, inferred)), () => ExtendsFalse()), () => ExtendsTrue(result2));
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 result2 = ExtendsRecordComparer(properties, keys, value, inferred);
4981
- return result2;
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, result2 = []) {
5075
- return guard_exports.ShiftLeft(rest, (head, tail) => Match3(ExtendsLeft({}, head, right), () => TryInferResults(tail, right, [...result2, head]), () => void 0), () => result2);
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 result2 = EvaluateIntersect([...heritage, _Object_(properties)]);
5278
- return result2;
5273
+ const result = EvaluateIntersect([...heritage, _Object_(properties)]);
5274
+ return result;
5279
5275
  }
5280
5276
  function InterfaceAction(heritage, properties, options) {
5281
- const result2 = CanInstantiate(heritage) ? memory_exports.Update(InterfaceOperation(heritage, properties), {}, options) : InterfaceDeferred(heritage, properties, options);
5282
- return result2;
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 result2 = FromType3(stack, context, type);
5336
- return result2;
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((result2, left) => {
5358
- return CyclicCheck([left], context, context[left]) ? [...result2, left] : result2;
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 result2 = ResolveCandidateKeys(context, keys);
5364
- return result2;
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, result2) {
5375
- return result2.includes(ref) ? result2 : ref in context ? FromType4(context, context[ref], [...result2, ref]) : Unreachable();
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, result2) {
5373
+ function FromProperties2(context, properties, result) {
5378
5374
  const types = PropertyValues(properties);
5379
- return FromTypes3(context, types, result2);
5375
+ return FromTypes3(context, types, result);
5380
5376
  }
5381
- function FromTypes3(context, types, result2) {
5382
- return types.reduce((result3, left) => {
5383
- return FromType4(context, left, result3);
5384
- }, result2);
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, result2) {
5387
- return IsRef(type) ? FromRef2(context, type.$ref, result2) : IsArray2(type) ? FromType4(context, type.items, result2) : IsConstructor2(type) ? FromTypes3(context, [...type.parameters, type.instanceType], result2) : IsFunction2(type) ? FromTypes3(context, [...type.parameters, type.returnType], result2) : IsInterfaceDeferred(type) ? FromProperties2(context, type.parameters[1], result2) : IsIntersect(type) ? FromTypes3(context, type.allOf, result2) : IsObject2(type) ? FromProperties2(context, type.properties, result2) : IsUnion(type) ? FromTypes3(context, type.anyOf, result2) : IsTuple(type) ? FromTypes3(context, type.items, result2) : IsRecord(type) ? FromType4(context, RecordValue(type), result2) : result2;
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 result2 = FromType4(context, type, [key]);
5391
- return result2;
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((result2, key) => {
5416
- return { ...result2, [key]: FromType5(properties[key]) };
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((result2, left) => {
5421
- return [...result2, FromType5(left)];
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((result2, key) => {
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 { ...result2, [key]: instantiatedType };
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 result2 = Cyclic(definitions, ref);
5469
- return result2;
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 result2 = Resolve(defs, ref);
5491
- return result2;
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 result2 = types.some((left) => {
5567
- const result3 = Compare(type, left);
5568
- return guard_exports.IsEqual(result3, ResultLeftInside) || guard_exports.IsEqual(result3, ResultEqual);
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(result2, false);
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((result2, left) => {
5578
- return IsObject2(left) ? [...result2, left] : (
5573
+ return types.reduce((result, left) => {
5574
+ return IsObject2(left) ? [...result, left] : (
5579
5575
  // push
5580
- IsNever(left) ? result2 : (
5576
+ IsNever(left) ? result : (
5581
5577
  // ignore
5582
- BroadenType(left, result2)
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 result2 = memory_exports.Update(EvaluateType(type), {}, options);
5607
- return result2;
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, result2 = []) {
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], [...result2, expression.parameters[0]["$ref"]])) : CollectDistributionNames(expression.parameters[2], CollectDistributionNames(expression.parameters[3], result2)) : 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]) ? [...result2, expression.parameters[1].parameters[0]["$ref"]] : result2 : result2
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((result2, left) => [...result2, names.includes(left.name)], []);
5639
+ return parameters.reduce((result, left) => [...result, names.includes(left.name)], []);
5644
5640
  }
5645
- function ZipDistributionArray(arguments_, distributionArray, result2 = []) {
5646
- return guard_exports.ShiftLeft(arguments_, (argumentLeft, argumentRight) => guard_exports.ShiftLeft(distributionArray, (booleanLeft, booleanRight) => ZipDistributionArray(argumentRight, booleanRight, [...result2, [booleanLeft, argumentLeft]]), () => result2), () => result2);
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((result2, left) => [...result2, [...left, type]], []);
5648
+ return current.reduce((result, left) => [...result, [...left, type]], []);
5653
5649
  }
5654
5650
  function Cross(current, variants) {
5655
- return variants.reduce((result2, left) => {
5656
- return [...result2, ...Append(current, left)];
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((result2, left) => {
5661
- return guard_exports.IsEqual(left[0], true) ? Cross(result2, Expand(left[1])) : Cross(result2, [left[1]]);
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 result2 = guard_exports.IsGreaterThan(state.callstack.length, 0) ? state.callstack[state.callstack.length - 1] : "";
5743
- return result2;
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 result2 = guard_exports.IsEqual(Peek(state), name);
5747
- return result2;
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((result2, arguments_) => [...result2, CallDispatch(context, state, target, parameters, expression, arguments_)], []);
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 result2 = guard_exports.IsEqual(returnTypes.length, 1) ? returnTypes[0] : EvaluateUnion(returnTypes);
5761
- return result2;
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 result2 = IsGeneric(type) ? IsTailCall(state, name) ? CallConstruct(Ref(name), instantiatedArguments) : CallImmediate(context, state, Ref(name), type.parameters, type.expression, instantiatedArguments) : CallConstruct(target, instantiatedArguments);
5769
- return result2;
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 result2 = memory_exports.Update(RemoveImmutableOperation(type), {}, options);
5812
- return result2;
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 result2 = FromType7(mapping, evaluated);
5850
- return result2;
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 result2 = types.map((type) => FromType7(mapping, type));
5862
- return Union(result2);
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 result2 = CanInstantiate([type]) ? memory_exports.Update(FromType7(CapitalizeMapping, type), {}, options) : CapitalizeDeferred(type, options);
5945
- return result2;
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 result2 = CanInstantiate([type]) ? memory_exports.Update(FromType7(LowercaseMapping, type), {}, options) : LowercaseDeferred(type, options);
5949
- return result2;
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 result2 = CanInstantiate([type]) ? memory_exports.Update(FromType7(UncapitalizeMapping, type), {}, options) : UncapitalizeDeferred(type, options);
5953
- return result2;
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 result2 = CanInstantiate([type]) ? memory_exports.Update(FromType7(UppercaseMapping, type), {}, options) : UppercaseDeferred(type, options);
5957
- return result2;
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 result2 = CanInstantiate([left, right]) ? memory_exports.Update(ConditionalOperation(context, state, left, right, true_, false_), {}, options) : ConditionalDeferred(left, right, true_, false_, options);
6014
- return result2;
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 result2 = Tuple(instantiatedParameters);
6057
- return result2;
6052
+ const result = Tuple(instantiatedParameters);
6053
+ return result;
6058
6054
  }
6059
6055
  function ConstructorParametersAction(type, options) {
6060
- const result2 = CanInstantiate([type]) ? memory_exports.Update(ConstructorParametersOperation(type), {}, options) : ConstructorParametersDeferred(type, options);
6061
- return result2;
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 result2 = CanInstantiate([left, right]) ? memory_exports.Update(ExcludeOperation(left, right), {}, options) : ExcludeDeferred(left, right, options);
6096
- return result2;
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 result2 = result_exports.IsExtendsTrueLike(check) ? [left] : [];
6130
- return result2;
6125
+ const result = result_exports.IsExtendsTrueLike(check) ? [left] : [];
6126
+ return result;
6131
6127
  }
6132
6128
  function ExtractUnion(types, right) {
6133
- return types.reduce((result2, head) => {
6134
- return [...result2, ...ExtractType(head, right)];
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 result2 = EvaluateUnion(remaining);
6142
- return result2;
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 result2 = CanInstantiate([left, right]) ? memory_exports.Update(ExtractOperation(left, right), {}, options) : ExtractDeferred(left, right, options);
6156
- return result2;
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((result2, left) => {
6175
- return IsLiteralValue(left) ? [...result2, Literal(left)] : result2;
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 result2 = Union(literals);
6181
- return result2;
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 result2 = FromType8(target);
6211
- return result2;
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 result2 = FromType8(evaluated);
6224
- return result2;
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((result2, key) => ({ ...result2, [key]: left[key] }), {});
6239
- const rightProperties = rightKeys.reduce((result2, key) => ({ ...result2, [key]: right[key] }), {});
6240
- const sharedProperties = sharedKeys.reduce((result2, key) => ({ ...result2, [key]: EvaluateIntersect([left[key], right[key]]) }), {});
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((result2, left) => {
6247
- return CollapseIntersectProperties(result2, FromType8(left));
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 result2 = FromType8(object);
6272
- return result2;
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 result2 = sharedKeys.reduce((result3, key) => {
6286
- return { ...result3, [key]: EvaluateUnion([left[key], right[key]]) };
6281
+ const result = sharedKeys.reduce((result2, key) => {
6282
+ return { ...result2, [key]: EvaluateUnion([left[key], right[key]]) };
6287
6283
  }, {});
6288
- return result2;
6284
+ return result;
6289
6285
  }
6290
- function ReduceVariants(types, result2) {
6291
- return guard_exports.ShiftLeft(types, (left, right) => ReduceVariants(right, CollapseUnionProperties(result2, FromType8(left))), () => result2);
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 result2 = _Object_(properties);
6330
- return result2;
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 result2 = (
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 result2;
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 result2 = FromType9(target);
6394
- return result2;
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 result2 = FromType9(evaluated);
6407
- return result2;
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 result2 = FromType9(evaluated);
6420
- return result2;
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 result2 = FromType9(evaluated);
6433
- return result2;
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 result2 = [`${value}`];
6445
- return result2;
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 result2 = FromType9(evaluated);
6456
- return result2;
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((result2, left) => {
6468
- return [...result2, ...FromType9(left)];
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 result2 = FromType9(type);
6503
- return result2;
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 result2 = FromType10(properties, type);
6520
- return result2;
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 result2 = ExpandThis(properties, selectedType);
6539
- return result2;
6534
+ const result = ExpandThis(properties, selectedType);
6535
+ return result;
6540
6536
  }
6541
6537
  function IndexProperties(properties, keys) {
6542
- return keys.reduce((result2, left) => {
6543
- return [...result2, IndexProperty(properties, left)];
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 result2 = EvaluateUnion(variants);
6550
- return result2;
6545
+ const result = EvaluateUnion(variants);
6546
+ return result;
6551
6547
  }
6552
6548
  function NumericKeys(keys) {
6553
- const result2 = keys.filter((key) => NumericKeyPattern.test(key));
6554
- return result2;
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 result2 = EvaluateUnion(variants);
6561
- return result2;
6556
+ const result = EvaluateUnion(variants);
6557
+ return result;
6562
6558
  }
6563
6559
  function FromObject5(properties, indexer) {
6564
- const result2 = IsNumber3(indexer) ? FromIndexerNumber(properties) : FromIndexer(properties, indexer);
6565
- return result2;
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((result2, right, index) => {
6598
+ return types.reduceRight((result, right, index) => {
6603
6599
  const check = Extends({}, Literal(index), indexer);
6604
- return result_exports.IsExtendsTrueLike(check) ? [right, ...result2] : result2;
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 result2 = IsCyclic(type) || IsDependent(type) || IsIntersect(type) || IsUnion(type) ? CollapseToObject(type) : type;
6652
- return result2;
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 result2 = CanInstantiate([type, indexer]) ? memory_exports.Update(FromType11(NormalizeType(type), indexer), {}, options) : IndexDeferred(type, indexer, options);
6656
- return result2;
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 result2 = CanInstantiate([type]) ? memory_exports.Update(InstanceTypeOperation(type), {}, options) : InstanceTypeDeferred(type, options);
6697
- return result2;
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 result2 = keys.reduce((result3, left) => {
6753
- return IsLiteralValue(left) ? [...result3, Literal(ConvertToIntegerKey(left))] : Unreachable();
6748
+ const result = keys.reduce((result2, left) => {
6749
+ return IsLiteralValue(left) ? [...result2, Literal(ConvertToIntegerKey(left))] : Unreachable();
6754
6750
  }, []);
6755
- return result2;
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 result2 = EvaluateUnionFast(variants);
6761
- return result2;
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 result2 = types.map((_, index) => Literal(index));
6786
- return EvaluateUnionFast(result2);
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 result2 = IsCyclic(type) || IsDependent(type) || IsIntersect(type) || IsUnion(type) ? CollapseToObject(type) : type;
6818
- return result2;
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 result2 = FromType13(evaluated);
6860
- return result2;
6855
+ const result = FromType13(evaluated);
6856
+ return result;
6861
6857
  }
6862
6858
  function FromUnion5(types) {
6863
- return types.reduce((result2, left) => {
6864
- return [...result2, ...FromType13(left)];
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 result2 = FromType13(evaluated);
6870
- return result2;
6865
+ const result = FromType13(evaluated);
6866
+ return result;
6871
6867
  }
6872
6868
  function FromLiteral5(value) {
6873
- const result2 = guard_exports.IsNumber(value) ? [Literal(`${value}`)] : [Literal(value)];
6874
- return result2;
6869
+ const result = guard_exports.IsNumber(value) ? [Literal(`${value}`)] : [Literal(value)];
6870
+ return result;
6875
6871
  }
6876
6872
  function FromType13(type) {
6877
- const result2 = IsEnum(type) ? FromEnum2(type.enum) : IsLiteral(type) ? FromLiteral5(type.const) : IsTemplateLiteral(type) ? FromTemplateLiteral3(type.pattern) : IsUnion(type) ? FromUnion5(type.anyOf) : [type];
6878
- return result2;
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 result2 = FromType13(type);
6882
- return result2;
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 result2 = IsTemplateLiteral(instantiatedAs) ? EvaluateTemplateLiteral(instantiatedAs.pattern) : instantiatedAs;
6899
- return result2;
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((result2, left) => {
6910
- return [...result2, MappedVariant(context, state, identifier, left, as, property)];
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((result2, left) => {
6915
- return [...result2, _Object_(left)];
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 result2 = EvaluateIntersect(mappedObjects);
6923
- return result2;
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 result2 = CanInstantiate([type]) ? memory_exports.Update(MappedOperation(context, state, identifier, type, as, property), {}, options) : MappedDeferred(identifier, type, as, property, options);
6941
- return result2;
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((result2, key) => {
6961
- return { ...result2, [key]: InstantiateCyclic(declarationContext, key, declarations[key]) };
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((result2, key) => {
6968
- return { ...result2, [key]: InstantiateType(declarationContext, State([], []), declarations[key]) };
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 result2 = CanInstantiate([type]) ? memory_exports.Update(NonNullableOperation(type), {}, options) : NonNullableDeferred(type, options);
7014
- return result2;
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 result2 = IsObject2(collapsed) ? collapsed.properties : Unreachable();
7053
- return result2;
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 result2 = guard_exports.Keys(properties).reduce((result3, key) => {
7066
- return keys.includes(key) ? result3 : { ...result3, [key]: properties[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 result2;
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 result2 = _Object_(omitted);
7075
- return result2;
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 result2 = CanInstantiate([type, indexer]) ? memory_exports.Update(FromType14(type, indexer), {}, options) : OmitDeferred(type, indexer, options);
7089
- return result2;
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 result2 = Tuple(instantiatedParameters);
7124
- return result2;
7119
+ const result = Tuple(instantiatedParameters);
7120
+ return result;
7125
7121
  }
7126
7122
  function ParametersAction(type, options) {
7127
- const result2 = CanInstantiate([type]) ? memory_exports.Update(ParametersOperation(type), {}, options) : ParametersDeferred(type, options);
7128
- return result2;
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 result2 = Cyclic(memory_exports.Assign(defs, { [ref]: partial }), ref);
7165
- return result2;
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 result2 = FromType15(evaluated);
7180
- return result2;
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 result2 = FromType15(evaluated);
7193
- return result2;
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 result2 = types.map((type) => FromType15(type));
7205
- return Union(result2);
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((result3, left) => {
7217
- return { ...result3, [left]: AddOptional(properties[left]) };
7212
+ const mapped = guard_exports.Keys(properties).reduce((result2, left) => {
7213
+ return { ...result2, [left]: AddOptional(properties[left]) };
7218
7214
  }, {});
7219
- const result2 = _Object_(mapped);
7220
- return result2;
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 result2 = CanInstantiate([type]) ? memory_exports.Update(FromType15(type), {}, options) : PartialDeferred(type, options);
7252
- return result2;
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 result2 = guard_exports.Keys(properties).reduce((result3, key) => {
7287
- return keys.includes(key) ? memory_exports.Assign(result3, { [key]: properties[key] }) : result3;
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 result2;
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 result2 = _Object_(applied);
7296
- return result2;
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 result2 = CanInstantiate([type, indexer]) ? memory_exports.Update(FromType16(type, indexer), {}, options) : PickDeferred(type, indexer, options);
7311
- return result2;
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 result2 = AddImmutable(_Array_(type));
7346
- return result2;
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 result2 = Cyclic(memory_exports.Assign(defs, { [ref]: partial }), ref);
7360
- return result2;
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 result2 = FromType17(evaluated);
7375
- return result2;
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 result2 = FromType17(evaluated);
7388
- return result2;
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((result3, left) => {
7400
- return { ...result3, [left]: AddReadonly(properties[left]) };
7395
+ const mapped = guard_exports.Keys(properties).reduce((result2, left) => {
7396
+ return { ...result2, [left]: AddReadonly(properties[left]) };
7401
7397
  }, {});
7402
- const result2 = _Object_(mapped);
7403
- return result2;
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 result2 = AddImmutable(Tuple(types));
7416
- return result2;
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 result2 = types.map((type) => FromType17(type));
7428
- return Union(result2);
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 result2 = CanInstantiate([type]) ? memory_exports.Update(FromType17(type), {}, options) : ReadonlyObjectDeferred(type);
7463
- return result2;
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 result2 = Cyclic(memory_exports.Assign(defs, { [ref]: partial }), ref);
7494
- return result2;
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 result2 = FromType18(evaluated);
7509
- return result2;
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 result2 = FromType18(evaluated);
7522
- return result2;
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 result2 = types.map((type) => FromType18(type));
7534
- return Union(result2);
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((result3, left) => {
7546
- return { ...result3, [left]: RemoveOptional(properties[left]) };
7541
+ const mapped = guard_exports.Keys(properties).reduce((result2, left) => {
7542
+ return { ...result2, [left]: RemoveOptional(properties[left]) };
7547
7543
  }, {});
7548
- const result2 = _Object_(mapped);
7549
- return result2;
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 result2 = CanInstantiate([type]) ? memory_exports.Update(FromType18(type), {}, options) : RequiredDeferred(type, options);
7595
- return result2;
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 result2 = CanInstantiate([type]) ? memory_exports.Update(ReturnTypeOperation(type), {}, options) : ReturnTypeDeferred(type, options);
7630
- return result2;
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 result2 = CanInstantiate([type]) ? memory_exports.Update(type, {}, options) : WithDeferred(type, options);
7663
- return result2;
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 result2 = IsRest(type) ? IsTuple(type.items) ? RestSpread(type.items.items) : IsInfer(type.items) ? [type] : IsRef(type.items) ? [type] : [Never()] : [type];
7680
- return result2;
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 result2 = types.reduce((result3, left) => {
7684
- return [...result3, ...SpreadElement(left)];
7679
+ const result = types.reduce((result2, left) => {
7680
+ return [...result2, ...SpreadElement(left)];
7685
7681
  }, []);
7686
- return result2;
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((result2, key) => {
7714
- return { ...result2, [key]: InstantiateType(context, state, properties[key]) };
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 result2 = RestSpread(elements);
7720
- return result2;
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 result2 = IsDeferred(type) ? InstantiateDeferred(context, state, type.action, type.parameters, type.options) : InstantiateImmediate(context, state, type);
7747
- return result2;
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 result2 = memory_exports.Update(AddImmutableOperation(type), {}, options);
7818
- return result2;
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 result2 = guard_exports.IsEqual(compareResult, "right-inside") ? 1 : guard_exports.IsEqual(compareResult, "disjoint") ? 1 : 0;
8057
- return result2;
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, result2 = []) {
8060
- return guard_exports.ShiftLeft(types, (left, right) => guard_exports.IsEqual(Comparer(type, left), 1) ? Insert(type, right, [...result2, left]) : [...result2, type, ...types], () => [...result2, type]);
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, result2 = []) {
8063
- return guard_exports.ShiftLeft(types, (left, right) => Sort(right, Insert(left, result2)), () => result2);
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 result2 = Sort(types);
8067
- return result2;
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 result2 = Script(input);
8196
- const parsed = guard_exports.IsArray(result2) && guard_exports.IsEqual(result2.length, 2) ? InstantiateType(context, State([], []), result2[0]) : Never();
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({
@@ -8548,11 +8544,8 @@ var init_navigator_output = __esm({
8548
8544
  navigatorOutputSchema = withTerminatingOutputDeclarations(
8549
8545
  openToolObject(
8550
8546
  typebox_exports.Object({
8551
- status: typebox_exports.Unknown({
8552
- description: "advice \u2014 \u5F62\u72B6\u6307\u5F15\uFF0C\u975E schema \u95F8"
8553
- }),
8554
- candidates: typebox_exports.Unknown({
8555
- description: "\u6392\u597D\u5E8F\u7684\u8DEF\u7EBF\u5EFA\u8BAE\u6570\u7EC4\uFF0C\u5143\u7D20\u542B next/phase/reason \u2014 \u5F62\u72B6\u6307\u5F15\uFF0C\u975E schema \u95F8"
8547
+ prose: typebox_exports.Unknown({
8548
+ description: "\u6E38\u5955\u4F7F\u6563\u6587\u5EFA\u8BAE\uFF0C\u539F\u6837\u5448\u73B0\u3002\u4E0D\u8981\u6C42 candidates/next \u7B49\u7ED3\u6784\u5316\u5B57\u6BB5\u3002\u5F62\u72B6\u6307\u5F15\uFF0C\u975E schema \u95F8"
8556
8549
  })
8557
8550
  })
8558
8551
  )
@@ -9443,21 +9436,21 @@ var init_reducer = __esm({
9443
9436
 
9444
9437
  // node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/schema/engine/allOf.mjs
9445
9438
  function CheckAllOf(stack, context, schema, value) {
9446
- const results = schema.allOf.reduce((result2, schema2) => {
9439
+ const results = schema.allOf.reduce((result, schema2) => {
9447
9440
  const nextContext = new CheckContext();
9448
- return CheckSchema(stack, nextContext, schema2, value) ? [...result2, nextContext] : result2;
9441
+ return CheckSchema(stack, nextContext, schema2, value) ? [...result, nextContext] : result;
9449
9442
  }, []);
9450
9443
  return guard_exports.IsEqual(results.length, schema.allOf.length) && context.Merge(results);
9451
9444
  }
9452
9445
  function ErrorAllOf(stack, context, schemaPath, instancePath, schema, value) {
9453
9446
  const failedContexts = [];
9454
- const results = schema.allOf.reduce((result2, schema2, index) => {
9447
+ const results = schema.allOf.reduce((result, schema2, index) => {
9455
9448
  const nextSchemaPath = `${schemaPath}/allOf/${index}`;
9456
9449
  const nextContext = new AccumulatedErrorContext();
9457
9450
  const isSchema = ErrorSchema(stack, nextContext, nextSchemaPath, instancePath, schema2, value);
9458
9451
  if (!isSchema)
9459
9452
  failedContexts.push(nextContext);
9460
- return isSchema ? [...result2, nextContext] : result2;
9453
+ return isSchema ? [...result, nextContext] : result;
9461
9454
  }, []);
9462
9455
  const isAllOf = guard_exports.IsEqual(results.length, schema.allOf.length) && context.Merge(results);
9463
9456
  if (!isAllOf)
@@ -9475,21 +9468,21 @@ var init_allOf2 = __esm({
9475
9468
 
9476
9469
  // node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/schema/engine/anyOf.mjs
9477
9470
  function CheckAnyOf(stack, context, schema, value) {
9478
- const results = schema.anyOf.reduce((result2, schema2) => {
9471
+ const results = schema.anyOf.reduce((result, schema2) => {
9479
9472
  const nextContext = new CheckContext();
9480
- return CheckSchema(stack, nextContext, schema2, value) ? [...result2, nextContext] : result2;
9473
+ return CheckSchema(stack, nextContext, schema2, value) ? [...result, nextContext] : result;
9481
9474
  }, []);
9482
9475
  return guard_exports.IsGreaterThan(results.length, 0) && context.Merge(results);
9483
9476
  }
9484
9477
  function ErrorAnyOf(stack, context, schemaPath, instancePath, schema, value) {
9485
9478
  const failedContexts = [];
9486
- const results = schema.anyOf.reduce((result2, schema2, index) => {
9479
+ const results = schema.anyOf.reduce((result, schema2, index) => {
9487
9480
  const nextContext = new AccumulatedErrorContext();
9488
9481
  const nextSchemaPath = `${schemaPath}/anyOf/${index}`;
9489
9482
  const isSchema = ErrorSchema(stack, nextContext, nextSchemaPath, instancePath, schema2, value);
9490
9483
  if (!isSchema)
9491
9484
  failedContexts.push(nextContext);
9492
- return isSchema ? [...result2, nextContext] : result2;
9485
+ return isSchema ? [...result, nextContext] : result;
9493
9486
  }, []);
9494
9487
  const isAnyOf = guard_exports.IsGreaterThan(results.length, 0) && context.Merge(results);
9495
9488
  if (!isAnyOf)
@@ -10977,16 +10970,16 @@ var init_not2 = __esm({
10977
10970
 
10978
10971
  // node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/schema/engine/oneOf.mjs
10979
10972
  function CheckOneOf(stack, context, schema, value) {
10980
- const passedContexts = schema.oneOf.reduce((result2, schema2) => {
10973
+ const passedContexts = schema.oneOf.reduce((result, schema2) => {
10981
10974
  const nextContext = new CheckContext();
10982
- return CheckSchema(stack, nextContext, schema2, value) ? [...result2, nextContext] : result2;
10975
+ return CheckSchema(stack, nextContext, schema2, value) ? [...result, nextContext] : result;
10983
10976
  }, []);
10984
10977
  return guard_exports.IsEqual(passedContexts.length, 1) && context.Merge(passedContexts);
10985
10978
  }
10986
10979
  function ErrorOneOf(stack, context, schemaPath, instancePath, schema, value) {
10987
10980
  const failedContexts = [];
10988
10981
  const passingSchemas = [];
10989
- const passedContexts = schema.oneOf.reduce((result2, schema2, index) => {
10982
+ const passedContexts = schema.oneOf.reduce((result, schema2, index) => {
10990
10983
  const nextContext = new AccumulatedErrorContext();
10991
10984
  const nextSchemaPath = `${schemaPath}/oneOf/${index}`;
10992
10985
  const isSchema = ErrorSchema(stack, nextContext, nextSchemaPath, instancePath, schema2, value);
@@ -10994,7 +10987,7 @@ function ErrorOneOf(stack, context, schemaPath, instancePath, schema, value) {
10994
10987
  passingSchemas.push(index);
10995
10988
  if (!isSchema)
10996
10989
  failedContexts.push(nextContext);
10997
- return isSchema ? [...result2, nextContext] : result2;
10990
+ return isSchema ? [...result, nextContext] : result;
10998
10991
  }, []);
10999
10992
  const isOneOf = guard_exports.IsEqual(passedContexts.length, 1) && context.Merge(passedContexts);
11000
10993
  if (!isOneOf && guard_exports.IsEqual(passingSchemas.length, 0))
@@ -11179,20 +11172,20 @@ var init_recursiveRef2 = __esm({
11179
11172
  function CheckRef(stack, context, schema, value) {
11180
11173
  const target = stack.Ref(schema) ?? false;
11181
11174
  const nextContext = new CheckContext();
11182
- const result2 = IsSchema2(target) && CheckSchema(stack, nextContext, target, value);
11183
- if (result2)
11175
+ const result = IsSchema2(target) && CheckSchema(stack, nextContext, target, value);
11176
+ if (result)
11184
11177
  context.Merge([nextContext]);
11185
- return result2;
11178
+ return result;
11186
11179
  }
11187
11180
  function ErrorRef(stack, context, _schemaPath, instancePath, schema, value) {
11188
11181
  const target = stack.Ref(schema) ?? false;
11189
11182
  const nextContext = new AccumulatedErrorContext();
11190
- const result2 = IsSchema2(target) && ErrorSchema(stack, nextContext, "#", instancePath, target, value);
11191
- if (result2)
11183
+ const result = IsSchema2(target) && ErrorSchema(stack, nextContext, "#", instancePath, target, value);
11184
+ if (result)
11192
11185
  context.Merge([nextContext]);
11193
- if (!result2)
11186
+ if (!result)
11194
11187
  nextContext.GetErrors().forEach((error) => context.AddError(error));
11195
- return result2;
11188
+ return result;
11196
11189
  }
11197
11190
  var init_ref4 = __esm({
11198
11191
  "node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/schema/engine/ref.mjs"() {
@@ -11341,12 +11334,12 @@ function ErrorUniqueItems(_stack, context, schemaPath, instancePath, schema, val
11341
11334
  if (!IsValid5(schema))
11342
11335
  return true;
11343
11336
  const set = /* @__PURE__ */ new Set();
11344
- const duplicateItems = value.reduce((result2, value2, index) => {
11337
+ const duplicateItems = value.reduce((result, value2, index) => {
11345
11338
  const hash = hash_exports.Hash(value2);
11346
11339
  if (set.has(hash))
11347
- return [...result2, index];
11340
+ return [...result, index];
11348
11341
  set.add(hash);
11349
- return result2;
11342
+ return result;
11350
11343
  }, []);
11351
11344
  const isUniqueItems = guard_exports.IsEqual(duplicateItems.length, 0);
11352
11345
  return isUniqueItems || context.AddError({
@@ -11369,18 +11362,18 @@ function CheckSchemaPushStack(stack, context, schema, value) {
11369
11362
  }
11370
11363
  function CheckSchema(stack, context, schema, value) {
11371
11364
  stack.Push(schema);
11372
- const result2 = 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));
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));
11373
11366
  stack.Pop(schema);
11374
- return result2;
11367
+ return result;
11375
11368
  }
11376
11369
  function ErrorSchemaPushStack(stack, context, schemaPath, instancePath, schema, value) {
11377
11370
  return context.Push() && ErrorSchema(stack, context, schemaPath, instancePath, schema, value) && context.Pop();
11378
11371
  }
11379
11372
  function ErrorSchema(stack, context, schemaPath, instancePath, schema, value) {
11380
11373
  stack.Push(schema);
11381
- const result2 = 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));
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));
11382
11375
  stack.Pop(schema);
11383
- return result2;
11376
+ return result;
11384
11377
  }
11385
11378
  var init_schema3 = __esm({
11386
11379
  "node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/schema/engine/schema.mjs"() {
@@ -11579,40 +11572,40 @@ function MatchHash(schema, _base, ref) {
11579
11572
  }
11580
11573
  function Match4(schema, base, ref) {
11581
11574
  if (IsId(schema)) {
11582
- const result2 = MatchId(schema, base, ref);
11583
- if (!guard_exports.IsUndefined(result2))
11584
- return result2;
11575
+ const result = MatchId(schema, base, ref);
11576
+ if (!guard_exports.IsUndefined(result))
11577
+ return result;
11585
11578
  }
11586
11579
  if (IsAnchor(schema)) {
11587
- const result2 = MatchAnchor(schema, base, ref);
11588
- if (!guard_exports.IsUndefined(result2))
11589
- return result2;
11580
+ const result = MatchAnchor(schema, base, ref);
11581
+ if (!guard_exports.IsUndefined(result))
11582
+ return result;
11590
11583
  }
11591
11584
  if (IsDynamicAnchor(schema)) {
11592
- const result2 = MatchDynamicAnchor(schema, base, ref);
11593
- if (!guard_exports.IsUndefined(result2))
11594
- return result2;
11585
+ const result = MatchDynamicAnchor(schema, base, ref);
11586
+ if (!guard_exports.IsUndefined(result))
11587
+ return result;
11595
11588
  }
11596
11589
  return MatchHash(schema, base, ref);
11597
11590
  }
11598
11591
  function FromArray6(schema, base, ref) {
11599
- return schema.reduce((result2, item) => {
11592
+ return schema.reduce((result, item) => {
11600
11593
  const match = FromValue3(item, base, ref);
11601
- return !guard_exports.IsUndefined(match) ? match : result2;
11594
+ return !guard_exports.IsUndefined(match) ? match : result;
11602
11595
  }, void 0);
11603
11596
  }
11604
11597
  function FromObject10(schema, base, ref) {
11605
- return guard_exports.Keys(schema).reduce((result2, key) => {
11598
+ return guard_exports.Keys(schema).reduce((result, key) => {
11606
11599
  const match = FromValue3(schema[key], base, ref);
11607
- return !guard_exports.IsUndefined(match) ? match : result2;
11600
+ return !guard_exports.IsUndefined(match) ? match : result;
11608
11601
  }, void 0);
11609
11602
  }
11610
11603
  function FromValue3(schema, base, ref) {
11611
11604
  const nextBase = IsSchemaObject(schema) && IsId(schema) ? new URL(schema.$id, base.href) : base;
11612
11605
  if (IsSchemaObject(schema)) {
11613
- const result2 = Match4(schema, nextBase, ref);
11614
- if (!guard_exports.IsUndefined(result2))
11615
- return result2;
11606
+ const result = Match4(schema, nextBase, ref);
11607
+ if (!guard_exports.IsUndefined(result))
11608
+ return result;
11616
11609
  }
11617
11610
  if (guard_exports.IsArray(schema))
11618
11611
  return FromArray6(schema, nextBase, ref);
@@ -11691,7 +11684,7 @@ var init_stack = __esm({
11691
11684
  // Base
11692
11685
  // ----------------------------------------------------------------
11693
11686
  BaseURL() {
11694
- return this.ids.reduce((result2, schema) => new URL(schema.$id, result2), new URL("http://unknown"));
11687
+ return this.ids.reduce((result, schema) => new URL(schema.$id, result), new URL("http://unknown"));
11695
11688
  }
11696
11689
  Base() {
11697
11690
  return this.ids[this.ids.length - 1] ?? this.schema;
@@ -11860,8 +11853,8 @@ function Errors(...args) {
11860
11853
  return;
11861
11854
  return errors.push({ ...error, message: locale2(error) });
11862
11855
  });
11863
- const result2 = ErrorSchema(stack, errorContext, "#", "", schema, value);
11864
- return [result2, errors];
11856
+ const result = ErrorSchema(stack, errorContext, "#", "", schema, value);
11857
+ return [result, errors];
11865
11858
  }
11866
11859
  var init_errors = __esm({
11867
11860
  "node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/schema/errors.mjs"() {
@@ -12235,10 +12228,10 @@ function Modifiers(type, next) {
12235
12228
  return next;
12236
12229
  }
12237
12230
  function FromProperties4(properties) {
12238
- const result2 = {};
12231
+ const result = {};
12239
12232
  for (const key of guard_default.Keys(properties))
12240
- result2[key] = FromType20(properties[key]);
12241
- return result2;
12233
+ result[key] = FromType20(properties[key]);
12234
+ return result;
12242
12235
  }
12243
12236
  function FromPriorityTypes(types) {
12244
12237
  return FromTypes6(Priority(types));
@@ -12251,8 +12244,8 @@ function FromType20(type) {
12251
12244
  return Modifiers(type, next);
12252
12245
  }
12253
12246
  function UnionPrioritySort(type) {
12254
- const result2 = FromType20(type);
12255
- return result2;
12247
+ const result = FromType20(type);
12248
+ return result;
12256
12249
  }
12257
12250
  var init_union_priority_sort = __esm({
12258
12251
  "node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/shared/union_priority_sort.mjs"() {
@@ -12410,9 +12403,9 @@ function FromString5(value) {
12410
12403
  return Ok(0);
12411
12404
  if (guard_exports.IsEqual(lowercase, "true"))
12412
12405
  return Ok(1);
12413
- const result2 = TryBigInt(value);
12414
- if (IsOk(result2))
12415
- return result2.value <= maxBigInt && result2.value >= minBigInt ? Ok(Number(result2.value)) : Fail();
12406
+ const result = TryBigInt(value);
12407
+ if (IsOk(result))
12408
+ return result.value <= maxBigInt && result.value >= minBigInt ? Ok(Number(result.value)) : Fail();
12416
12409
  return Fail();
12417
12410
  }
12418
12411
  function TryNumber(value) {
@@ -12501,8 +12494,8 @@ var init_try2 = __esm({
12501
12494
 
12502
12495
  // node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_array.mjs
12503
12496
  function FromArray8(context, type, value) {
12504
- const result2 = try_exports.TryArray(value);
12505
- return result2.value.map((value2) => FromType21(context, type.items, value2));
12497
+ const result = try_exports.TryArray(value);
12498
+ return result.value.map((value2) => FromType21(context, type.items, value2));
12506
12499
  }
12507
12500
  var init_from_array5 = __esm({
12508
12501
  "node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_array.mjs"() {
@@ -12513,8 +12506,8 @@ var init_from_array5 = __esm({
12513
12506
 
12514
12507
  // node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_bigint.mjs
12515
12508
  function FromBigInt6(_context, _type, value) {
12516
- const result2 = try_exports.TryBigInt(value);
12517
- return try_exports.IsOk(result2) ? result2.value : value;
12509
+ const result = try_exports.TryBigInt(value);
12510
+ return try_exports.IsOk(result) ? result.value : value;
12518
12511
  }
12519
12512
  var init_from_bigint = __esm({
12520
12513
  "node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_bigint.mjs"() {
@@ -12524,8 +12517,8 @@ var init_from_bigint = __esm({
12524
12517
 
12525
12518
  // node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_boolean.mjs
12526
12519
  function FromBoolean6(_context, _type, value) {
12527
- const result2 = try_exports.TryBoolean(value);
12528
- return try_exports.IsOk(result2) ? result2.value : value;
12520
+ const result = try_exports.TryBoolean(value);
12521
+ return try_exports.IsOk(result) ? result.value : value;
12529
12522
  }
12530
12523
  var init_from_boolean = __esm({
12531
12524
  "node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_boolean.mjs"() {
@@ -12557,8 +12550,8 @@ var init_from_enum2 = __esm({
12557
12550
 
12558
12551
  // node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_integer.mjs
12559
12552
  function FromInteger(_context, _type, value) {
12560
- const result2 = try_exports.TryNumber(value);
12561
- return try_exports.IsOk(result2) ? Math.trunc(result2.value) : value;
12553
+ const result = try_exports.TryNumber(value);
12554
+ return try_exports.IsOk(result) ? Math.trunc(result.value) : value;
12562
12555
  }
12563
12556
  var init_from_integer = __esm({
12564
12557
  "node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_integer.mjs"() {
@@ -12581,20 +12574,20 @@ var init_from_intersect7 = __esm({
12581
12574
 
12582
12575
  // node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_literal.mjs
12583
12576
  function FromLiteralBigInt(_context, type, value) {
12584
- const result2 = try_exports.TryBigInt(value);
12585
- return try_exports.IsOk(result2) && guard_exports.IsEqual(type.const, result2.value) ? result2.value : value;
12577
+ const result = try_exports.TryBigInt(value);
12578
+ return try_exports.IsOk(result) && guard_exports.IsEqual(type.const, result.value) ? result.value : value;
12586
12579
  }
12587
12580
  function FromLiteralBoolean(_context, type, value) {
12588
- const result2 = try_exports.TryBoolean(value);
12589
- return try_exports.IsOk(result2) && guard_exports.IsEqual(type.const, result2.value) ? result2.value : value;
12581
+ const result = try_exports.TryBoolean(value);
12582
+ return try_exports.IsOk(result) && guard_exports.IsEqual(type.const, result.value) ? result.value : value;
12590
12583
  }
12591
12584
  function FromLiteralNumber(_context, type, value) {
12592
- const result2 = try_exports.TryNumber(value);
12593
- return try_exports.IsOk(result2) && guard_exports.IsEqual(type.const, result2.value) ? result2.value : value;
12585
+ const result = try_exports.TryNumber(value);
12586
+ return try_exports.IsOk(result) && guard_exports.IsEqual(type.const, result.value) ? result.value : value;
12594
12587
  }
12595
12588
  function FromLiteralString(_context, type, value) {
12596
- const result2 = try_exports.TryString(value);
12597
- return try_exports.IsOk(result2) && guard_exports.IsEqual(type.const, result2.value) ? result2.value : value;
12589
+ const result = try_exports.TryString(value);
12590
+ return try_exports.IsOk(result) && guard_exports.IsEqual(type.const, result.value) ? result.value : value;
12598
12591
  }
12599
12592
  function FromLiteral6(context, type, value) {
12600
12593
  if (guard_exports.IsEqual(type.const, value))
@@ -12612,8 +12605,8 @@ var init_from_literal3 = __esm({
12612
12605
 
12613
12606
  // node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_null.mjs
12614
12607
  function FromNull2(_context, _type, value) {
12615
- const result2 = try_exports.TryNull(value);
12616
- return try_exports.IsOk(result2) ? result2.value : value;
12608
+ const result = try_exports.TryNull(value);
12609
+ return try_exports.IsOk(result) ? result.value : value;
12617
12610
  }
12618
12611
  var init_from_null = __esm({
12619
12612
  "node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_null.mjs"() {
@@ -12623,8 +12616,8 @@ var init_from_null = __esm({
12623
12616
 
12624
12617
  // node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_number.mjs
12625
12618
  function FromNumber5(_context, _type, value) {
12626
- const result2 = try_exports.TryNumber(value);
12627
- return try_exports.IsOk(result2) ? result2.value : value;
12619
+ const result = try_exports.TryNumber(value);
12620
+ return try_exports.IsOk(result) ? result.value : value;
12628
12621
  }
12629
12622
  var init_from_number = __esm({
12630
12623
  "node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_number.mjs"() {
@@ -12724,8 +12717,8 @@ var init_from_ref2 = __esm({
12724
12717
 
12725
12718
  // node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_string.mjs
12726
12719
  function FromString7(_context, _type, value) {
12727
- const result2 = try_exports.TryString(value);
12728
- return try_exports.IsOk(result2) ? result2.value : value;
12720
+ const result = try_exports.TryString(value);
12721
+ return try_exports.IsOk(result) ? result.value : value;
12729
12722
  }
12730
12723
  var init_from_string = __esm({
12731
12724
  "node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_string.mjs"() {
@@ -12762,8 +12755,8 @@ var init_from_tuple6 = __esm({
12762
12755
 
12763
12756
  // node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_undefined.mjs
12764
12757
  function FromUndefined2(_context, _type, value) {
12765
- const result2 = try_exports.TryUndefined(value);
12766
- return try_exports.IsOk(result2) ? result2.value : value;
12758
+ const result = try_exports.TryUndefined(value);
12759
+ return try_exports.IsOk(result) ? result.value : value;
12767
12760
  }
12768
12761
  var init_from_undefined = __esm({
12769
12762
  "node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_undefined.mjs"() {
@@ -12791,8 +12784,8 @@ var init_from_union8 = __esm({
12791
12784
 
12792
12785
  // node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_void.mjs
12793
12786
  function FromVoid(_context, _type, value) {
12794
- const result2 = try_exports.TryUndefined(value);
12795
- return try_exports.IsOk(result2) ? void 0 : value;
12787
+ const result = try_exports.TryUndefined(value);
12788
+ return try_exports.IsOk(result) ? void 0 : value;
12796
12789
  }
12797
12790
  var init_from_void = __esm({
12798
12791
  "node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/convert/from_void.mjs"() {
@@ -12994,9 +12987,9 @@ var init_from_tuple7 = __esm({
12994
12987
  // node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/default/from_union.mjs
12995
12988
  function FromUnion11(context, schema, value) {
12996
12989
  for (const inner of schema.anyOf) {
12997
- const result2 = FromType22(context, inner, Clone2(value));
12998
- if (Check2(context, inner, result2)) {
12999
- return result2;
12990
+ const result = FromType22(context, inner, Clone2(value));
12991
+ if (Check2(context, inner, result)) {
12992
+ return result;
13000
12993
  }
13001
12994
  }
13002
12995
  return value;
@@ -13059,7 +13052,7 @@ function Pipeline(pipeline) {
13059
13052
  3: (context2, type2, value2) => [context2, type2, value2],
13060
13053
  2: (type2, value2) => [{}, type2, value2]
13061
13054
  });
13062
- return pipeline.reduce((result2, func) => func(context, type, result2), value);
13055
+ return pipeline.reduce((result, func) => func(context, type, result), value);
13063
13056
  };
13064
13057
  }
13065
13058
  var init_pipeline = __esm({
@@ -13150,7 +13143,7 @@ function Decode5(direction, context, type, value) {
13150
13143
  if (guard_exports.IsEqual(type.allOf.length, 0))
13151
13144
  return Callback(direction, context, type, value);
13152
13145
  const interiors = type.allOf.map((schema) => FromType23(direction, context, schema, Clean(schema, Clone2(value))));
13153
- const structural = interiors.every((result2) => guard_exports.IsObject(result2));
13146
+ const structural = interiors.every((result) => guard_exports.IsObject(result));
13154
13147
  const exterior = structural ? MergeInteriors(interiors) : NonMatchingInterior(value, interiors);
13155
13148
  return Callback(direction, context, type, exterior);
13156
13149
  }
@@ -13159,7 +13152,7 @@ function Encode4(direction, context, type, value) {
13159
13152
  return Callback(direction, context, type, value);
13160
13153
  const exterior = Callback(direction, context, type, value);
13161
13154
  const interiors = type.allOf.map((schema) => FromType23(direction, context, schema, Clean(schema, Clone2(exterior))));
13162
- const structural = interiors.every((result2) => guard_exports.IsObject(result2));
13155
+ const structural = interiors.every((result) => guard_exports.IsObject(result));
13163
13156
  if (structural)
13164
13157
  return MergeInteriors(interiors);
13165
13158
  return NonMatchingInterior(exterior, interiors);
@@ -13677,8 +13670,8 @@ var init_from_number2 = __esm({
13677
13670
  // node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/create/from_object.mjs
13678
13671
  function FromObject16(context, type) {
13679
13672
  const required = guard_exports.IsUndefined(type.required) ? [] : type.required;
13680
- return required.reduce((result2, key) => {
13681
- return { ...result2, [key]: FromType25(context, type.properties[key]) };
13673
+ return required.reduce((result, key) => {
13674
+ return { ...result, [key]: FromType25(context, type.properties[key]) };
13682
13675
  }, {});
13683
13676
  }
13684
13677
  var init_from_object11 = __esm({
@@ -14138,15 +14131,15 @@ var init_error2 = __esm({
14138
14131
 
14139
14132
  // node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/repair/from_array.mjs
14140
14133
  function MakeUnique(values) {
14141
- const [hashes, result2] = [/* @__PURE__ */ new Set(), []];
14134
+ const [hashes, result] = [/* @__PURE__ */ new Set(), []];
14142
14135
  for (const value of values) {
14143
14136
  const hash = Hash2(value);
14144
14137
  if (hashes.has(hash))
14145
14138
  continue;
14146
14139
  hashes.add(hash);
14147
- result2.push(value);
14140
+ result.push(value);
14148
14141
  }
14149
- return result2;
14142
+ return result;
14150
14143
  }
14151
14144
  function FromArray14(context, type, value) {
14152
14145
  if (Check2(context, type, value))
@@ -14205,21 +14198,21 @@ function FromObject18(context, type, value) {
14205
14198
  if (!guard_exports.IsObjectNotArray(value))
14206
14199
  return Create2(context, type);
14207
14200
  const required = new Set(guard_exports.IsUndefined(type.required) ? [] : type.required);
14208
- const result2 = {};
14201
+ const result = {};
14209
14202
  for (const [key, schema] of guard_exports.Entries(type.properties)) {
14210
14203
  if (!required.has(key) && guard_exports.IsUndefined(value[key]))
14211
14204
  continue;
14212
- result2[key] = key in value ? FromType26(context, schema, value[key]) : Create2(context, schema);
14205
+ result[key] = key in value ? FromType26(context, schema, value[key]) : Create2(context, schema);
14213
14206
  }
14214
14207
  const evaluatedKeys = guard_exports.Keys(type.properties);
14215
14208
  if (IsAdditionalProperties(type) && guard_exports.IsObject(type.additionalProperties)) {
14216
14209
  for (const key of guard_exports.Keys(value)) {
14217
14210
  if (evaluatedKeys.includes(key))
14218
14211
  continue;
14219
- result2[key] = FromType26(context, type.additionalProperties, value[key]);
14212
+ result[key] = FromType26(context, type.additionalProperties, value[key]);
14220
14213
  }
14221
14214
  }
14222
- return result2;
14215
+ return result;
14223
14216
  }
14224
14217
  var init_from_object12 = __esm({
14225
14218
  "node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/repair/from_object.mjs"() {
@@ -14240,21 +14233,21 @@ function FromRecord9(context, type, value) {
14240
14233
  const recordKey = new RegExp(RecordPattern(type));
14241
14234
  const recordValue = RecordValue(type);
14242
14235
  const evaluatedKeys = /* @__PURE__ */ new Set();
14243
- const result2 = {};
14236
+ const result = {};
14244
14237
  for (const [key, value_] of guard_exports.Entries(value)) {
14245
14238
  if (!recordKey.test(key))
14246
14239
  continue;
14247
- result2[key] = FromType26(context, recordValue, value_);
14240
+ result[key] = FromType26(context, recordValue, value_);
14248
14241
  evaluatedKeys.add(key);
14249
14242
  }
14250
14243
  if (IsAdditionalProperties(type)) {
14251
14244
  for (const key of guard_exports.Keys(value)) {
14252
14245
  if (evaluatedKeys.has(key))
14253
14246
  continue;
14254
- result2[key] = FromType26(context, type.additionalProperties, value[key]);
14247
+ result[key] = FromType26(context, type.additionalProperties, value[key]);
14255
14248
  }
14256
14249
  }
14257
- return result2;
14250
+ return result;
14258
14251
  }
14259
14252
  var init_from_record7 = __esm({
14260
14253
  "node_modules/.pnpm/typebox@1.3.8/node_modules/typebox/build/value/repair/from_record.mjs"() {
@@ -14321,11 +14314,11 @@ function ScoreVariant(context, type, value) {
14321
14314
  return 0;
14322
14315
  const keys = guard_exports.Keys(value);
14323
14316
  const entries = guard_exports.Entries(type.properties);
14324
- return entries.reduce((result2, [key, schema]) => {
14317
+ return entries.reduce((result, [key, schema]) => {
14325
14318
  const literal = IsLiteral(schema) && guard_exports.IsEqual(schema.const, value[key]) ? 100 : 0;
14326
14319
  const checks = Check2(context, schema, value[key]) ? 10 : 0;
14327
14320
  const exists = keys.includes(key) ? 1 : 0;
14328
- return result2 + (literal + checks + exists);
14321
+ return result + (literal + checks + exists);
14329
14322
  }, 0);
14330
14323
  }
14331
14324
  function UnionScoreSelect(context, type, value) {
@@ -16333,7 +16326,7 @@ function appendWithIdentityClaim(recordFile, record4, row) {
16333
16326
  );
16334
16327
  }
16335
16328
  let primaryFailure;
16336
- let result2;
16329
+ let result;
16337
16330
  let cleanupFailure;
16338
16331
  try {
16339
16332
  sealTornTail(recordFile);
@@ -16344,10 +16337,10 @@ function appendWithIdentityClaim(recordFile, record4, row) {
16344
16337
  record4.level
16345
16338
  );
16346
16339
  if (raced !== void 0) {
16347
- result2 = raced;
16340
+ result = raced;
16348
16341
  } else {
16349
16342
  appendFileSync(recordFile, row, "utf8");
16350
- result2 = {
16343
+ result = {
16351
16344
  identity: record4.identity,
16352
16345
  recordFile,
16353
16346
  kind: record4.kind,
@@ -16372,7 +16365,7 @@ function appendWithIdentityClaim(recordFile, record4, row) {
16372
16365
  { cause: cleanupFailure }
16373
16366
  );
16374
16367
  }
16375
- return result2;
16368
+ return result;
16376
16369
  }
16377
16370
  function resolveSitianVolumeCategory(kind) {
16378
16371
  if (S4_SUBMISSION_LEDGER_KINDS.has(kind)) {
@@ -16804,9 +16797,6 @@ ${paths.join("\n")}`
16804
16797
  if (typeof process.env.AK_ROLE_AUDITOR_SUBJECT === "string" && process.env.AK_ROLE_AUDITOR_SUBJECT.trim() !== "") {
16805
16798
  env.AK_ROLE_AUDITOR_SUBJECT = process.env.AK_ROLE_AUDITOR_SUBJECT;
16806
16799
  }
16807
- if (request.correlationId !== void 0 && request.correlationId.trim() !== "") {
16808
- env.AK_CORRELATION_ID = request.correlationId;
16809
- }
16810
16800
  if (config.recordLaunchedRolePackageIdentity !== void 0 && config.observeLaunchedRolePackageIdentity !== void 0) {
16811
16801
  await config.recordLaunchedRolePackageIdentity(
16812
16802
  request.runDirectory,
@@ -17522,13 +17512,13 @@ async function loadDoctorCase(runsPath) {
17522
17512
  const kind = id.endsWith(".jsonl") ? "session" : "stderr";
17523
17513
  evidence.push({ id, kind, byteLength: bytes.byteLength, contentLength: content.length, sha256: sha256Hex(bytes), content });
17524
17514
  if (kind === "stderr") continue;
17525
- const result2 = deriveSession(content, id);
17526
- sessions.push(result2.session);
17527
- statuses.push(...result2.statuses);
17528
- commits.push(...result2.commits);
17529
- accumulate(turns, result2.turns, id);
17530
- accumulate(calls, result2.calls, id);
17531
- accumulate(tokens, result2.tokens, id);
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);
17532
17522
  }
17533
17523
  const runDirs = (await readdir3(root, { withFileTypes: true })).filter((item) => item.isDirectory()).map((item) => item.name).sort();
17534
17524
  const legs = evidence.filter((entry) => entry.kind === "session").map((entry) => entry.id);
@@ -18165,6 +18155,15 @@ function buildResumeContinuationPrompt(options) {
18165
18155
  })
18166
18156
  );
18167
18157
  }
18158
+ function buildAutoResumeContinuationPrompt(options) {
18159
+ return selectResumeContinuationPrompt(
18160
+ RESUME_TRANSPORT_ENVELOPE,
18161
+ engineSessionMaterialFromOptions({
18162
+ packageRoot: options.packageRoot,
18163
+ ...pickEngineAxis(options)
18164
+ })
18165
+ );
18166
+ }
18168
18167
  function isV1ResumableProvider(provider) {
18169
18168
  return V1_RESUMABLE_PROVIDERS.includes(provider);
18170
18169
  }
@@ -19397,7 +19396,7 @@ var init_run_lifecycle = __esm({
19397
19396
  init_invocation();
19398
19397
  V1_RESUMABLE_PROVIDERS = ["openai-codex", "xai"];
19399
19398
  AUTO_RESUME_LIMIT = 2;
19400
- RESUME_TRANSPORT_ENVELOPE = "[ak-role:resume-continue]";
19399
+ RESUME_TRANSPORT_ENVELOPE = "\u7EE7\u7EED\u3002";
19401
19400
  RUN_STATE_FILE = "run-state.json";
19402
19401
  WRITER_LOCK_FILE = "writer.lock";
19403
19402
  RunWriterLeaseHeldError = class extends Error {
@@ -20512,7 +20511,7 @@ var init_option_definitions = __esm({
20512
20511
  },
20513
20512
  navigator: {
20514
20513
  command: "navigator",
20515
- summary: "Direct Navigator (\u6E38\u5955\u4F7F) route advice: ordered next-role candidates.",
20514
+ summary: "Direct Navigator (\u6E38\u5955\u4F7F) free-form prose route advice.",
20516
20515
  usage: ["ak-role navigator [options] [instruction]"],
20517
20516
  examples: [
20518
20517
  'ak-role navigator "\u521A\u5B8C\u6210 coder apply \u6536\u655B\uFF0C\u4E0B\u4E00\u6B65\uFF1F"'
@@ -21310,7 +21309,7 @@ async function withPreparedAttachments(attachmentPaths, use) {
21310
21309
  if (attachmentPaths.length === 0) return await use([]);
21311
21310
  const stagingDirectory = await mkdtemp(join15(tmpdir(), "ak-role-attachments-"));
21312
21311
  const prepared = [];
21313
- let result2;
21312
+ let result;
21314
21313
  try {
21315
21314
  for (let index = 0; index < attachmentPaths.length; index += 1) {
21316
21315
  const { absolute, bytes } = await readRegularFileAttachment(attachmentPaths[index]);
@@ -21318,7 +21317,7 @@ async function withPreparedAttachments(attachmentPaths, use) {
21318
21317
  await writeFile5(snapshotPath, bytes);
21319
21318
  prepared.push({ absolute, snapshotPath });
21320
21319
  }
21321
- result2 = await use(prepared);
21320
+ result = await use(prepared);
21322
21321
  } catch (primary) {
21323
21322
  try {
21324
21323
  await removePreparedAttachmentDirectory(stagingDirectory);
@@ -21332,7 +21331,7 @@ async function withPreparedAttachments(attachmentPaths, use) {
21332
21331
  throw primary;
21333
21332
  }
21334
21333
  await removePreparedAttachmentDirectory(stagingDirectory);
21335
- return result2;
21334
+ return result;
21336
21335
  }
21337
21336
  async function freezeAttachmentBytes(provenancePath, bytes, destinationDir, index) {
21338
21337
  const frozenPath = join15(
@@ -24882,44 +24881,6 @@ var init_receipt_delivery_policy = __esm({
24882
24881
  }
24883
24882
  });
24884
24883
 
24885
- // src/public-command-renderer.ts
24886
- function isPublicCallableRole2(role) {
24887
- return PUBLIC_CALLABLE_ROLES3.has(role);
24888
- }
24889
- function renderPublicAkRoleCommand(target) {
24890
- if (!isPublicCallableRole2(target.role)) return void 0;
24891
- const role = target.role;
24892
- const metadata = packagedRoleMetadata(role);
24893
- if (metadata !== void 0 && "bareCommand" in metadata && metadata.bareCommand === false) {
24894
- return void 0;
24895
- }
24896
- if (target.phase === null || target.phase === void 0) {
24897
- return `ak-role ${role}`;
24898
- }
24899
- if (role === "coder" || role === "fixer") {
24900
- return `ak-role ${role} ${target.phase}`;
24901
- }
24902
- return `ak-role ${role}`;
24903
- }
24904
- var PUBLIC_CALLABLE_ROLES3;
24905
- var init_public_command_renderer = __esm({
24906
- "src/public-command-renderer.ts"() {
24907
- "use strict";
24908
- init_packaged_role_registry();
24909
- PUBLIC_CALLABLE_ROLES3 = new Set(
24910
- PACKAGED_ROLE_REGISTRY.map((entry) => entry.role)
24911
- );
24912
- }
24913
- });
24914
-
24915
- // src/public-cli/command-renderer.ts
24916
- var init_command_renderer = __esm({
24917
- "src/public-cli/command-renderer.ts"() {
24918
- "use strict";
24919
- init_public_command_renderer();
24920
- }
24921
- });
24922
-
24923
24884
  // src/public-cli/terminal.ts
24924
24885
  function encodeTerminalField(value) {
24925
24886
  return JSON.stringify(value);
@@ -24930,86 +24891,76 @@ function isLawfulTypedTerminalOutcome(outcome) {
24930
24891
  function exitCodeForTerminalOutcome(outcome) {
24931
24892
  return isLawfulTypedTerminalOutcome(outcome) ? 0 : 1;
24932
24893
  }
24933
- function recommendationNavigatorFact(input) {
24934
- const command = typeof input.modelCommand === "string" && input.modelCommand.trim() !== "" ? input.modelCommand : isPublicCallableRole2(input.next.role) ? renderPublicAkRoleCommand(input.next) : void 0;
24894
+ function adviceNavigatorFact(input) {
24935
24895
  return {
24936
- disposition: "recommendation",
24937
- next: input.next,
24938
- reason: input.reason,
24939
- ...command === void 0 ? {} : { command },
24940
- ...input.route === void 0 ? {} : { route: input.route },
24896
+ disposition: "advice",
24897
+ prose: input.prose,
24941
24898
  ...input.advisoryDiagnostic === void 0 ? {} : { advisoryDiagnostic: input.advisoryDiagnostic }
24942
24899
  };
24943
24900
  }
24944
- function formatTerminalResult(result2) {
24901
+ function formatTerminalResult(result) {
24945
24902
  const lines = [];
24946
24903
  lines.push("role outcome status");
24947
- const outcomeStatus = result2.roleOutcome.kind === "failure" ? result2.roleOutcome.cause ?? "" : result2.roleOutcome.kind === "accepted" ? "accepted" : result2.roleOutcome.status;
24904
+ const outcomeStatus = result.roleOutcome.kind === "failure" ? result.roleOutcome.cause ?? "" : result.roleOutcome.kind === "accepted" ? "accepted" : result.roleOutcome.status;
24948
24905
  lines.push(
24949
- `${result2.roleOutcome.role} ${result2.roleOutcome.kind} ${encodeTerminalField(outcomeStatus)}`
24906
+ `${result.roleOutcome.role} ${result.roleOutcome.kind} ${encodeTerminalField(outcomeStatus)}`
24950
24907
  );
24951
- if (result2.roleOutcome.kind === "failure") {
24908
+ if (result.roleOutcome.kind === "failure") {
24952
24909
  lines.push(
24953
- `diagnostic ${encodeTerminalField(result2.roleOutcome.diagnostic)}`
24910
+ `diagnostic ${encodeTerminalField(result.roleOutcome.diagnostic)}`
24954
24911
  );
24955
24912
  }
24956
- if (result2.roleOutcome.kind === "failure" || result2.roleOutcome.kind === "no_receipt") {
24957
- const facts = result2.roleOutcome.decisiveFacts;
24913
+ if (result.roleOutcome.kind === "failure" || result.roleOutcome.kind === "no_receipt") {
24914
+ const facts = result.roleOutcome.decisiveFacts;
24958
24915
  for (const [key, value] of Object.entries(facts)) {
24959
24916
  if (value === void 0) continue;
24960
24917
  const rendered = typeof value === "string" ? value : JSON.stringify(value);
24961
24918
  lines.push(`fact ${encodeTerminalField(key)} ${encodeTerminalField(rendered)}`);
24962
24919
  }
24963
24920
  }
24964
- lines.push(`navigator ${result2.navigator.disposition}`);
24965
- if (result2.navigator.advisoryDiagnostic !== void 0) {
24966
- lines.push(`navigator-advisory ${encodeTerminalField(result2.navigator.advisoryDiagnostic)}`);
24921
+ lines.push(`navigator ${result.navigator.disposition}`);
24922
+ if (result.navigator.advisoryDiagnostic !== void 0) {
24923
+ lines.push(`navigator-advisory ${encodeTerminalField(result.navigator.advisoryDiagnostic)}`);
24967
24924
  }
24968
- if (result2.navigator.disposition === "recommendation") {
24925
+ if (result.navigator.disposition === "advice") {
24926
+ lines.push(`prose ${encodeTerminalField(result.navigator.prose)}`);
24927
+ } else if (result.navigator.disposition === "unavailable") {
24969
24928
  lines.push(
24970
- `next ${result2.navigator.next.role} ${result2.navigator.next.phase ?? "none"}`
24971
- );
24972
- lines.push(`reason ${encodeTerminalField(result2.navigator.reason)}`);
24973
- if (result2.navigator.command !== void 0) {
24974
- lines.push(`command ${encodeTerminalField(result2.navigator.command)}`);
24975
- }
24976
- } else if (result2.navigator.disposition === "unavailable") {
24977
- lines.push(
24978
- `unavailable ${result2.navigator.source} ${encodeTerminalField(result2.navigator.reason)}`
24929
+ `unavailable ${result.navigator.source} ${encodeTerminalField(result.navigator.reason)}`
24979
24930
  );
24980
24931
  }
24981
- for (const artifact of result2.artifacts) {
24932
+ for (const artifact of result.artifacts) {
24982
24933
  lines.push(`artifact ${artifact.kind} ${encodeTerminalField(artifact.path)}`);
24983
24934
  }
24984
- if (result2.gate !== void 0) {
24935
+ if (result.gate !== void 0) {
24985
24936
  lines.push(
24986
- `gate ${encodeTerminalField(result2.gate.actualSeats.join(","))} ${result2.gate.rounds.length}`
24937
+ `gate ${encodeTerminalField(result.gate.actualSeats.join(","))} ${result.gate.rounds.length}`
24987
24938
  );
24988
- for (const round of result2.gate.rounds) {
24939
+ for (const round of result.gate.rounds) {
24989
24940
  const reason = round.dispatch.kind === "historical_dispatch" && round.dispatch.reason !== void 0 ? encodeTerminalField(round.dispatch.reason) : "";
24990
24941
  lines.push(
24991
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))}`
24992
24943
  );
24993
24944
  }
24994
24945
  }
24995
- if (result2.reviewerChildOutcomes !== void 0) {
24946
+ if (result.reviewerChildOutcomes !== void 0) {
24996
24947
  for (const axis of ["completeness", "correctness"]) {
24997
- const child = result2.reviewerChildOutcomes[axis];
24948
+ const child = result.reviewerChildOutcomes[axis];
24998
24949
  lines.push(`reviewer-child ${axis} ${child.exitCode}`);
24999
24950
  if (child.stderr !== void 0 && child.stderr !== "") {
25000
24951
  lines.push(`reviewer-child-diagnostic ${axis} ${encodeTerminalField(child.stderr)}`);
25001
24952
  }
25002
24953
  }
25003
24954
  }
25004
- if (result2.resume !== void 0) {
25005
- lines.push(`resume ${encodeTerminalField(result2.resume.command)}`);
25006
- } else if (result2.runId !== void 0) {
25007
- lines.push(`run ${encodeTerminalField(result2.runId)}`);
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)}`);
25008
24959
  }
25009
- if (result2.autoResumeCount !== void 0) {
25010
- lines.push(`autoResumeCount ${encodeTerminalField(String(result2.autoResumeCount))}`);
24960
+ if (result.autoResumeCount !== void 0) {
24961
+ lines.push(`autoResumeCount ${encodeTerminalField(String(result.autoResumeCount))}`);
25011
24962
  }
25012
- const payloads = result2.roleOutcome.kind === "accepted" || result2.roleOutcome.kind === "audit_escalation" ? result2.roleOutcome.payloads ?? result2.submissions ?? [] : result2.roleOutcome.kind === "failure" ? result2.roleOutcome.payloads ?? result2.submissions ?? [] : result2.submissions ?? [];
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 ?? [];
25013
24964
  for (let i = payloads.length - 1; i >= 0; i -= 1) {
25014
24965
  const payload = payloads[i];
25015
24966
  const rendered = typeof payload === "string" ? payload : JSON.stringify(payload);
@@ -25021,7 +24972,6 @@ function formatTerminalResult(result2) {
25021
24972
  var init_terminal = __esm({
25022
24973
  "src/public-cli/terminal.ts"() {
25023
24974
  "use strict";
25024
- init_command_renderer();
25025
24975
  }
25026
24976
  });
25027
24977
 
@@ -26001,10 +25951,6 @@ async function appendRunAttemptHistory(source, outcome) {
26001
25951
  } catch {
26002
25952
  }
26003
25953
  }
26004
- function navigatorPhaseValue(value) {
26005
- if (value === "plan" || value === "apply") return value;
26006
- return null;
26007
- }
26008
25954
  function navigatorAttendanceCorrelatedWithBoundMarker(details, attendanceIndex, terminalIndex, marker) {
26009
25955
  if (attendanceIndex <= terminalIndex) return false;
26010
25956
  if (details.invocationId !== marker.invocationId) return false;
@@ -26013,29 +25959,33 @@ function navigatorAttendanceCorrelatedWithBoundMarker(details, attendanceIndex,
26013
25959
  function parseNavigatorAttendanceDetails(details) {
26014
25960
  const disposition = details.disposition;
26015
25961
  const advisoryDiagnostic = typeof details.routePlaybookReadFailure === "string" ? { advisoryDiagnostic: details.routePlaybookReadFailure } : {};
26016
- if (disposition === "recommendation") {
26017
- const next = details.next;
26018
- if (!isRecord10(next) || typeof next.role !== "string") {
25962
+ if (disposition === "advice" || disposition === "recommendation") {
25963
+ let prose;
25964
+ if (typeof details.prose === "string" && details.prose.trim() !== "") {
25965
+ prose = details.prose;
25966
+ } else {
25967
+ const next = isRecord10(details.next) && typeof details.next.role === "string" ? details.next.role : void 0;
25968
+ const reason = typeof details.reason === "string" && details.reason.trim() !== "" ? details.reason : void 0;
25969
+ const command = typeof details.command === "string" && details.command.trim() !== "" ? details.command : void 0;
25970
+ if (reason !== void 0 && next !== void 0) {
25971
+ prose = `${reason}\uFF08\u4E0B\u4E00\u6B65\uFF1A${next}\uFF09`;
25972
+ } else if (reason !== void 0) {
25973
+ prose = reason;
25974
+ } else if (next !== void 0) {
25975
+ prose = `\u4E0B\u4E00\u6B65\uFF1A${next}`;
25976
+ } else if (command !== void 0) {
25977
+ prose = command;
25978
+ }
25979
+ }
25980
+ if (prose === void 0 || prose.trim() === "") {
26019
25981
  return {
26020
- disposition: "unavailable",
26021
- source: "unknown",
26022
- reason: "navigator recommendation missing typed next role"
25982
+ disposition: "no-advice",
25983
+ ...advisoryDiagnostic
26023
25984
  };
26024
25985
  }
26025
- const reason = typeof details.reason === "string" ? details.reason : "";
26026
- const route = Array.isArray(details.route) ? details.route.filter(isRecord10).map((target) => ({
26027
- role: String(target.role),
26028
- phase: navigatorPhaseValue(target.phase)
26029
- })) : void 0;
26030
- return recommendationNavigatorFact({
26031
- ...advisoryDiagnostic,
26032
- next: {
26033
- role: next.role,
26034
- phase: navigatorPhaseValue(next.phase)
26035
- },
26036
- reason,
26037
- ...route === void 0 ? {} : { route },
26038
- ...typeof details.command === "string" ? { modelCommand: details.command } : {}
25986
+ return adviceNavigatorFact({
25987
+ prose,
25988
+ ...advisoryDiagnostic
26039
25989
  });
26040
25990
  }
26041
25991
  if (disposition === "unavailable") {
@@ -27819,8 +27769,8 @@ function missingCredentialPreDispatchFailure(model, credentials) {
27819
27769
  knownFailure
27820
27770
  };
27821
27771
  }
27822
- function postRunMissingCredentialFailure(result2, model, credentials) {
27823
- if (!(result2.timedOut || result2.code !== 0)) return void 0;
27772
+ function postRunMissingCredentialFailure(result, model, credentials) {
27773
+ if (!(result.timedOut || result.code !== 0)) return void 0;
27824
27774
  return knownFailureForMissingProviderCredential(model, credentials);
27825
27775
  }
27826
27776
  var init_public_run_credentials = __esm({
@@ -27830,6 +27780,59 @@ var init_public_run_credentials = __esm({
27830
27780
  }
27831
27781
  });
27832
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
+
27833
27836
  // src/public-cli/auto-resume.ts
27834
27837
  import { constants as fsConstants2 } from "node:fs";
27835
27838
  import { randomUUID as randomUUID5 } from "node:crypto";
@@ -28080,10 +28083,10 @@ async function runWithAutoResumeLoop(options) {
28080
28083
  }
28081
28084
  throw error;
28082
28085
  }
28083
- let result2;
28086
+ let result;
28084
28087
  let turnStartedBeforeThrow = false;
28085
28088
  try {
28086
- result2 = await options.dispatch(currentPayload, lease, isFirst, dummyIo);
28089
+ result = await options.dispatch(currentPayload, lease, isFirst, dummyIo);
28087
28090
  } catch (error) {
28088
28091
  lastThrownError = error;
28089
28092
  turnStartedBeforeThrow = error instanceof TurnDispatchedFailure;
@@ -28115,9 +28118,9 @@ async function runWithAutoResumeLoop(options) {
28115
28118
  }
28116
28119
  }
28117
28120
  dispatchOrdinal += 1;
28118
- if (result2 !== void 0) {
28121
+ if (result !== void 0) {
28119
28122
  everyAttemptThrew = false;
28120
- const terminal = result2.terminal;
28123
+ const terminal = result.terminal;
28121
28124
  if (terminal !== void 0) {
28122
28125
  terminal.autoResumeCount = autoResumeAttempts;
28123
28126
  }
@@ -28126,22 +28129,26 @@ async function runWithAutoResumeLoop(options) {
28126
28129
  if (terminal !== void 0) {
28127
28130
  options.io.stdout(formatTerminalResult(terminal));
28128
28131
  }
28129
- return result2;
28132
+ return result;
28133
+ }
28134
+ if (result.skipAutoResume === true) {
28135
+ if (terminal !== void 0) presentTerminal(terminal, options.io);
28136
+ return result;
28130
28137
  }
28131
- if (result2.skipAutoResume === true) {
28138
+ if (processCancelSignalName(options.signal) !== void 0) {
28132
28139
  if (terminal !== void 0) presentTerminal(terminal, options.io);
28133
- return result2;
28140
+ return result;
28134
28141
  }
28135
28142
  }
28136
- if (result2 !== void 0) {
28137
- const terminal = result2.terminal;
28143
+ if (result !== void 0) {
28144
+ const terminal = result.terminal;
28138
28145
  if (autoResumeAttempts >= limit) {
28139
28146
  if (terminal !== void 0) presentTerminal(terminal, options.io);
28140
- return result2;
28147
+ return result;
28141
28148
  }
28142
- if (result2.turnDispatched === true && !await isPrincipalAvailable(options.admitted.principal)) {
28149
+ if (result.turnDispatched === true && !await isPrincipalAvailable(options.admitted.principal)) {
28143
28150
  if (terminal !== void 0) presentTerminal(terminal, options.io);
28144
- return result2;
28151
+ return result;
28145
28152
  }
28146
28153
  } else {
28147
28154
  if (autoResumeAttempts >= limit) {
@@ -28165,6 +28172,28 @@ async function runWithAutoResumeLoop(options) {
28165
28172
  terminal
28166
28173
  };
28167
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
+ }
28168
28197
  if (!await isPrincipalAvailable(options.admitted.principal)) {
28169
28198
  const terminal = await attachDispatchExceptionTerminal(
28170
28199
  options.admitted,
@@ -28188,7 +28217,7 @@ async function runWithAutoResumeLoop(options) {
28188
28217
  }
28189
28218
  }
28190
28219
  autoResumeAttempts++;
28191
- if (result2?.turnDispatched === true || turnStartedBeforeThrow) {
28220
+ if (result?.turnDispatched === true || turnStartedBeforeThrow) {
28192
28221
  currentPayload = options.buildResumePayload();
28193
28222
  }
28194
28223
  isFirst = false;
@@ -28201,6 +28230,7 @@ var init_auto_resume = __esm({
28201
28230
  init_role_run_placement();
28202
28231
  init_run_lifecycle();
28203
28232
  init_config2();
28233
+ init_process_cancel();
28204
28234
  init_terminal();
28205
28235
  init_settlement();
28206
28236
  dummyIo = { stdout: () => {
@@ -28233,6 +28263,36 @@ function describeCaughtError(error) {
28233
28263
  function isStationChildOfficerDialogue(role, env) {
28234
28264
  return env.stationChild === true && isOfficerReviewSeat(role);
28235
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
+ }
28236
28296
  function withOnceSuccessfulBeforeDispatch(adapters) {
28237
28297
  const hook = adapters.beforeDispatch;
28238
28298
  if (hook === void 0) return adapters;
@@ -28365,10 +28425,10 @@ async function settleAfterTurnStarted(admitted, failureInput, adapters, authorit
28365
28425
  throw new TurnDispatchedFailure(error);
28366
28426
  }
28367
28427
  }
28368
- async function settleDeferredPersist(admitted, authority, adapters, io, result2) {
28369
- if (result2.needsPersist !== true || result2.terminal === void 0) return result2;
28370
- const { needsPersist: _needsPersist, ...settledResult } = result2;
28371
- const lawful = isLawfulTypedTerminalOutcome(result2.terminal.roleOutcome);
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);
28372
28432
  try {
28373
28433
  await persistReturnedRunState(admitted, authority, lawful ? { lawful: true } : void 0);
28374
28434
  return settledResult;
@@ -28390,9 +28450,34 @@ async function dispatchPostAdmissionTurn(input) {
28390
28450
  const deferredPersist = persistRunState ? {} : { needsPersist: true };
28391
28451
  const shouldPresent = adapters.shouldPresentSettled ?? ((terminal) => isLawfulTypedTerminalOutcome(terminal.roleOutcome));
28392
28452
  let afterDispatchApplied = false;
28393
- const finishAfterTurn = async (result2) => {
28394
- if (afterDispatchApplied) return result2;
28453
+ const finishAfterTurn = async (result) => {
28454
+ if (afterDispatchApplied) return result;
28395
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
+ }
28396
28481
  try {
28397
28482
  if (admitted.ticketNumber === void 0) {
28398
28483
  const rows = await readRecordedSubmissionRows(
@@ -28409,9 +28494,9 @@ async function dispatchPostAdmissionTurn(input) {
28409
28494
  if (ticketNumber !== void 0) await bindAdmittedTicketNumber(admitted, ticketNumber);
28410
28495
  }
28411
28496
  if (adapters.afterDispatch !== void 0) await adapters.afterDispatch(admitted, lease);
28412
- return result2;
28497
+ return result;
28413
28498
  } catch (error) {
28414
- const primaryFailure = result2.terminal !== void 0 && !isLawfulTypedTerminalOutcome(result2.terminal.roleOutcome);
28499
+ const primaryFailure = result.terminal !== void 0 && !isLawfulTypedTerminalOutcome(result.terminal.roleOutcome);
28415
28500
  if (primaryFailure) {
28416
28501
  await recordBestEffortPostDispatchDiagnostic(
28417
28502
  admitted,
@@ -28419,7 +28504,7 @@ async function dispatchPostAdmissionTurn(input) {
28419
28504
  `afterDispatch failed beside primary terminal (best-effort continue): ${describeErrorIdentity(error)}`,
28420
28505
  io
28421
28506
  );
28422
- return result2;
28507
+ return result;
28423
28508
  }
28424
28509
  return {
28425
28510
  ...await presentControlledFailure2(
@@ -28435,8 +28520,8 @@ async function dispatchPostAdmissionTurn(input) {
28435
28520
  io,
28436
28521
  persistRunState
28437
28522
  ),
28438
- ...result2.turnDispatched === true ? { turnDispatched: true } : {},
28439
- ...result2.skipAutoResume === true ? { skipAutoResume: true } : {},
28523
+ ...result.turnDispatched === true ? { turnDispatched: true } : {},
28524
+ ...result.skipAutoResume === true ? { skipAutoResume: true } : {},
28440
28525
  ...deferredPersist
28441
28526
  };
28442
28527
  }
@@ -28535,30 +28620,36 @@ async function dispatchPostAdmissionTurn(input) {
28535
28620
  env.host,
28536
28621
  env.engineModel
28537
28622
  );
28538
- let result2;
28623
+ let result;
28539
28624
  try {
28540
- result2 = await env.roleTurnHost.executeTurn(turnRequest);
28625
+ result = await env.roleTurnHost.executeTurn(turnRequest);
28541
28626
  } catch (error) {
28627
+ const processCancelName = processCancelSignalName(env.signal);
28542
28628
  const settled2 = await settleAfterTurnStarted(
28543
28629
  admitted,
28544
28630
  withEngineDetourInvocationScope({
28545
28631
  timedOut: false,
28546
28632
  code: null,
28547
28633
  stderr: "",
28548
- thrown: error
28634
+ thrown: processCancelName === void 0 ? error : new Error(processCancelDiagnostic(processCancelName), { cause: error })
28549
28635
  }, request.invocationScopeId),
28550
28636
  adapters,
28551
28637
  env.principalAuthority,
28552
28638
  io,
28553
28639
  persistRunState
28554
28640
  );
28555
- return await finishAfterTurn({ ...settled2, turnDispatched: true, ...deferredPersist });
28641
+ return await finishAfterTurn(
28642
+ withProcessCancelSkipAutoResume(
28643
+ { ...settled2, turnDispatched: true, ...deferredPersist },
28644
+ env.signal
28645
+ )
28646
+ );
28556
28647
  }
28557
28648
  let stderrLogWriteFailure;
28558
28649
  try {
28559
28650
  await writeFile9(
28560
28651
  join29(admitted.runDirectory, "stderr.log"),
28561
- result2.stderr,
28652
+ result.stderr,
28562
28653
  "utf8"
28563
28654
  );
28564
28655
  } catch (error) {
@@ -28580,9 +28671,9 @@ async function dispatchPostAdmissionTurn(input) {
28580
28671
  let resolution;
28581
28672
  try {
28582
28673
  const sessionFile = admitted.principal !== void 0 ? env.principalAuthority.decode(admitted.principal).sessionFile : "";
28583
- const runnerKnownFailure = adapters.resolveRunnerKnownFailure !== void 0 && sessionFile !== "" ? await adapters.resolveRunnerKnownFailure({ result: result2, sessionFile }) : result2.knownFailure;
28674
+ const runnerKnownFailure = adapters.resolveRunnerKnownFailure !== void 0 && sessionFile !== "" ? await adapters.resolveRunnerKnownFailure({ result, sessionFile }) : result.knownFailure;
28584
28675
  const credentialFailure = postRunMissingCredentialFailure(
28585
- result2,
28676
+ result,
28586
28677
  env.model,
28587
28678
  env.credentials
28588
28679
  );
@@ -28592,15 +28683,17 @@ async function dispatchPostAdmissionTurn(input) {
28592
28683
  credential: credentialFailure,
28593
28684
  runDirectory: admitted.runDirectory
28594
28685
  });
28595
- const directHostFailureSignal = result2.timedOut || result2.knownFailure !== void 0 || runnerKnownFailure !== void 0 || credentialFailure !== void 0;
28596
- hostSignalFailed = directHostFailureSignal || result2.code !== null && result2.code !== 0 || resolution.knownFailure !== void 0;
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;
28597
28689
  settled = await adapters.trySettle(admitted, env.principalAuthority, courtScope);
28598
28690
  if (settled !== void 0) {
28599
28691
  settled = await attachRecordedSubmissions(admitted, settled, courtScope);
28600
28692
  }
28601
28693
  const settledIsFreshThisAttempt = settled === void 0 || settled.roleOutcome.kind !== "accepted" && settled.roleOutcome.kind !== "audit_escalation" ? true : await attemptProducedFreshSubmission(admitted, courtScope);
28602
28694
  const staleAcceptanceOutranksRealFailure = !settledIsFreshThisAttempt && hostSignalFailed;
28603
- if (settled !== void 0 && shouldPresent(settled) && !directHostFailureSignal && !staleAcceptanceOutranksRealFailure && stderrLogWriteFailure === void 0) {
28695
+ const cancelAfterSettle = processCancelSignalName(env.signal);
28696
+ if (settled !== void 0 && shouldPresent(settled) && !directHostFailureSignal && !staleAcceptanceOutranksRealFailure && stderrLogWriteFailure === void 0 && cancelAfterSettle === void 0) {
28604
28697
  if (settled.roleOutcome.kind === "accepted" && request.courtAttemptId !== void 0 && request.courtAttemptId.length > 0) {
28605
28698
  try {
28606
28699
  await clearCurrentCourt(admitted.runDirectory, request.courtAttemptId);
@@ -28625,8 +28718,8 @@ async function dispatchPostAdmissionTurn(input) {
28625
28718
  admitted,
28626
28719
  withEngineDetourInvocationScope({
28627
28720
  timedOut: false,
28628
- code: result2.code,
28629
- stderr: result2.stderr,
28721
+ code: result.code,
28722
+ stderr: result.stderr,
28630
28723
  thrown: error
28631
28724
  }, request.invocationScopeId),
28632
28725
  adapters,
@@ -28637,6 +28730,22 @@ async function dispatchPostAdmissionTurn(input) {
28637
28730
  return await finishAfterTurn({ ...settledFailure, turnDispatched: true, ...deferredPersist });
28638
28731
  }
28639
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
+ }
28640
28749
  if (persistRunState) {
28641
28750
  try {
28642
28751
  await persistReturnedRunState(admitted, env.principalAuthority, { lawful: true });
@@ -28655,21 +28764,28 @@ async function dispatchPostAdmissionTurn(input) {
28655
28764
  io,
28656
28765
  persistRunState
28657
28766
  );
28658
- return await finishAfterTurn({ ...failed, turnDispatched: true, ...deferredPersist });
28767
+ return await finishAfterTurn(
28768
+ withProcessCancelSkipAutoResume(
28769
+ { ...failed, turnDispatched: true, ...deferredPersist },
28770
+ env.signal
28771
+ )
28772
+ );
28659
28773
  }
28660
28774
  }
28661
28775
  return await finishAfterTurn({ ...settledOutcome, ...deferredPersist });
28662
28776
  }
28663
28777
  if (hostSignalFailed) {
28664
28778
  const resolutionInput = controlledFailureInputFromResolution(resolution);
28779
+ const processCancelName = processCancelSignalName(env.signal);
28665
28780
  const stderrLogWriteDetails = stderrLogWriteFailure === void 0 ? void 0 : { stderrLogWriteFailure: describeCaughtError(stderrLogWriteFailure) };
28666
28781
  const failed = await settleAfterTurnStarted(
28667
28782
  admitted,
28668
28783
  withEngineDetourInvocationScope({
28669
- timedOut: result2.timedOut,
28670
- code: result2.code,
28671
- stderr: result2.stderr,
28784
+ timedOut: result.timedOut,
28785
+ code: result.code,
28786
+ stderr: result.stderr,
28672
28787
  ...resolutionInput,
28788
+ ...processCancelName === void 0 ? {} : { knownDiagnostic: processCancelDiagnostic(processCancelName) },
28673
28789
  // Secondary fact only — never the cause. Rides on whichever channel
28674
28790
  // classification actually reads (knownFailure.details owns it when
28675
28791
  // a knownFailure exists; the top-level knownDetails otherwise).
@@ -28685,15 +28801,20 @@ async function dispatchPostAdmissionTurn(input) {
28685
28801
  io,
28686
28802
  persistRunState
28687
28803
  );
28688
- return await finishAfterTurn({ ...failed, turnDispatched: true, ...deferredPersist });
28804
+ return await finishAfterTurn(
28805
+ withProcessCancelSkipAutoResume(
28806
+ { ...failed, turnDispatched: true, ...deferredPersist },
28807
+ env.signal
28808
+ )
28809
+ );
28689
28810
  }
28690
28811
  if (stderrLogWriteFailure !== void 0) {
28691
28812
  const failed = await settleAfterTurnStarted(
28692
28813
  admitted,
28693
28814
  withEngineDetourInvocationScope({
28694
28815
  timedOut: false,
28695
- code: result2.code,
28696
- stderr: result2.stderr,
28816
+ code: result.code,
28817
+ stderr: result.stderr,
28697
28818
  thrown: stderrLogWriteFailure
28698
28819
  }, request.invocationScopeId),
28699
28820
  adapters,
@@ -28708,6 +28829,22 @@ async function dispatchPostAdmissionTurn(input) {
28708
28829
  await settleHostEndedNoReceipt(admitted, env.principalAuthority, courtScope),
28709
28830
  courtScope
28710
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
+ }
28711
28848
  if (persistRunState) {
28712
28849
  try {
28713
28850
  await persistReturnedRunState(admitted, env.principalAuthority, { lawful: true });
@@ -28726,7 +28863,12 @@ async function dispatchPostAdmissionTurn(input) {
28726
28863
  io,
28727
28864
  persistRunState
28728
28865
  );
28729
- return await finishAfterTurn({ ...failed, turnDispatched: true, ...deferredPersist });
28866
+ return await finishAfterTurn(
28867
+ withProcessCancelSkipAutoResume(
28868
+ { ...failed, turnDispatched: true, ...deferredPersist },
28869
+ env.signal
28870
+ )
28871
+ );
28730
28872
  }
28731
28873
  }
28732
28874
  return await finishAfterTurn({
@@ -28922,6 +29064,7 @@ async function runPostAdmissionSeatResume(input) {
28922
29064
  io: input.io,
28923
29065
  sessionAppender: env.sessionAppender,
28924
29066
  autoResumeLimit: env.autoResumeLimit,
29067
+ ...env.signal === void 0 ? {} : { signal: env.signal },
28925
29068
  buildInitialPayload: () => ({ resumeTurn: false }),
28926
29069
  buildResumePayload: () => ({ resumeTurn: true }),
28927
29070
  // Same as public manual resume: prior-court sealed acceptance is not a
@@ -28946,7 +29089,7 @@ async function runPostAdmissionSeatResume(input) {
28946
29089
  return turnRequest;
28947
29090
  },
28948
29091
  dispatch: async (turnRequest) => {
28949
- const result2 = await dispatchPostAdmissionTurn({
29092
+ const result = await dispatchPostAdmissionTurn({
28950
29093
  admitted: loaded.admitted,
28951
29094
  env,
28952
29095
  io: attemptIo,
@@ -28961,7 +29104,7 @@ async function runPostAdmissionSeatResume(input) {
28961
29104
  env.principalAuthority,
28962
29105
  stationAdapters,
28963
29106
  attemptIo,
28964
- result2
29107
+ result
28965
29108
  );
28966
29109
  }
28967
29110
  })
@@ -28997,7 +29140,7 @@ async function runPostAdmissionOneShot(input) {
28997
29140
  ...input.request,
28998
29141
  continuation: {
28999
29142
  kind: "resume",
29000
- prompt: buildResumeContinuationPrompt({
29143
+ prompt: buildAutoResumeContinuationPrompt({
29001
29144
  packageRoot: input.env.packageRoot,
29002
29145
  ...pickEngineAxis({
29003
29146
  engine: input.effectiveEngine ?? input.env.engine,
@@ -29025,10 +29168,11 @@ async function runPostAdmissionResumable(input) {
29025
29168
  io,
29026
29169
  sessionAppender: env.sessionAppender,
29027
29170
  autoResumeLimit: env.autoResumeLimit,
29171
+ ...env.signal === void 0 ? {} : { signal: env.signal },
29028
29172
  buildInitialPayload: buildScopedInitial,
29029
29173
  buildResumePayload: buildScopedResume,
29030
29174
  dispatch: async (request, lease, _isFirst, attemptIo) => {
29031
- const result2 = await dispatchPostAdmissionTurn({
29175
+ const result = await dispatchPostAdmissionTurn({
29032
29176
  admitted,
29033
29177
  env: {
29034
29178
  ...env,
@@ -29042,7 +29186,7 @@ async function runPostAdmissionResumable(input) {
29042
29186
  // #600: every attempt (initial + auto-resume) writes seat engine when present.
29043
29187
  ...effectiveEngine === void 0 ? {} : { effectiveEngine }
29044
29188
  });
29045
- return settleDeferredPersist(admitted, env.principalAuthority, adapters, attemptIo, result2);
29189
+ return settleDeferredPersist(admitted, env.principalAuthority, adapters, attemptIo, result);
29046
29190
  }
29047
29191
  });
29048
29192
  }
@@ -29077,7 +29221,7 @@ async function runPostAdmissionManualResume(input) {
29077
29221
  const invocationScopeId = mintEngineDetourInvocationScope({
29078
29222
  ...effectiveEngine === void 0 ? {} : { effectiveEngine }
29079
29223
  });
29080
- const result2 = await dispatchAfterWriterLease({
29224
+ const result = await dispatchAfterWriterLease({
29081
29225
  lease,
29082
29226
  build: async () => {
29083
29227
  if (request === void 0) {
@@ -29105,14 +29249,14 @@ async function runPostAdmissionManualResume(input) {
29105
29249
  ...effectiveEngine === void 0 ? {} : { effectiveEngine }
29106
29250
  })
29107
29251
  });
29108
- if (result2.terminal !== void 0 && isLawfulTypedTerminalOutcome(result2.terminal.roleOutcome)) {
29109
- io.stdout(formatTerminalResult(result2.terminal));
29252
+ if (result.terminal !== void 0 && isLawfulTypedTerminalOutcome(result.terminal.roleOutcome)) {
29253
+ io.stdout(formatTerminalResult(result.terminal));
29110
29254
  }
29111
- if (result2.terminal !== void 0) {
29112
- result2.terminal.autoResumeCount = 0;
29255
+ if (result.terminal !== void 0) {
29256
+ result.terminal.autoResumeCount = 0;
29113
29257
  }
29114
29258
  return {
29115
- ...result2,
29259
+ ...result,
29116
29260
  ...staleWriterLeaseReclaimed === true ? { staleWriterLeaseReclaimed: true } : {}
29117
29261
  };
29118
29262
  }
@@ -29133,6 +29277,7 @@ var init_post_admission = __esm({
29133
29277
  init_host_transition_prior_native();
29134
29278
  init_public_run_credentials();
29135
29279
  init_run_lifecycle();
29280
+ init_process_cancel();
29136
29281
  init_activation_ledger_topology();
29137
29282
  init_settlement();
29138
29283
  init_terminal();
@@ -29174,10 +29319,10 @@ function coderAdapters(methodProvenance) {
29174
29319
  )
29175
29320
  };
29176
29321
  }
29177
- async function runPublicCoder(argv, env, io, parseCoderArgv2) {
29322
+ async function runPublicCoder(argv2, env, io, parseCoderArgv2) {
29178
29323
  let admitted;
29179
29324
  try {
29180
- const parsed = parseCoderArgv2(argv);
29325
+ const parsed = parseCoderArgv2(argv2);
29181
29326
  admitted = await admitCoderInvocation({
29182
29327
  home: env.home,
29183
29328
  principalAuthority: env.principalAuthority,
@@ -29254,7 +29399,7 @@ async function runPublicCoder(argv, env, io, parseCoderArgv2) {
29254
29399
  ...admitted.correlationId === void 0 && env.correlationId === void 0 ? {} : { correlationId: admitted.correlationId ?? env.correlationId },
29255
29400
  continuation: {
29256
29401
  kind: "resume",
29257
- prompt: buildResumeContinuationPrompt({
29402
+ prompt: buildAutoResumeContinuationPrompt({
29258
29403
  packageRoot: env.packageRoot,
29259
29404
  ...pickEngineAxis(env)
29260
29405
  })
@@ -29362,11 +29507,11 @@ function instructionSeatAdapters(options) {
29362
29507
  // #675 / #357 T2: failInfrastructure abort after engine-detour tool failure must not
29363
29508
  // wash the durable toolResult diagnostic (same seam as reviewer-run / judge-run).
29364
29509
  resolveRunnerKnownFailure: async ({
29365
- result: result2,
29510
+ result,
29366
29511
  sessionFile
29367
29512
  }) => {
29368
29513
  const infrastructureFailure = await readEngineDetourInfrastructureFailure(sessionFile);
29369
- return infrastructureFailure === void 0 ? result2.knownFailure : {
29514
+ return infrastructureFailure === void 0 ? result.knownFailure : {
29370
29515
  ...infrastructureFailure.cause === void 0 ? {} : { cause: infrastructureFailure.cause },
29371
29516
  diagnostic: infrastructureFailure.diagnostic,
29372
29517
  ...infrastructureFailure.identity === void 0 ? {} : { identity: infrastructureFailure.identity }
@@ -29440,10 +29585,10 @@ async function withAuditorSoulEnv(options) {
29440
29585
  }
29441
29586
  }
29442
29587
  }
29443
- async function runPublicInstructionSeat(argv, env, io, role, parseArgv2) {
29588
+ async function runPublicInstructionSeat(argv2, env, io, role, parseArgv2) {
29444
29589
  let parsed;
29445
29590
  try {
29446
- parsed = parseArgv2(argv);
29591
+ parsed = parseArgv2(argv2);
29447
29592
  } catch (error) {
29448
29593
  if (error instanceof CliUsageError) {
29449
29594
  presentStructuralRejection(error, io);
@@ -29609,10 +29754,10 @@ function buildCollectorTurnRequest(admitted, options) {
29609
29754
  options
29610
29755
  );
29611
29756
  }
29612
- async function runPublicCollector(argv, env, io, parseCollectorArgv2) {
29757
+ async function runPublicCollector(argv2, env, io, parseCollectorArgv2) {
29613
29758
  let admitted;
29614
29759
  try {
29615
- const parsed = parseCollectorArgv2(argv);
29760
+ const parsed = parseCollectorArgv2(argv2);
29616
29761
  admitted = await admitCollectorInvocation({
29617
29762
  home: env.home,
29618
29763
  principalAuthority: env.principalAuthority,
@@ -29667,9 +29812,9 @@ function collectorAdapters() {
29667
29812
  return {
29668
29813
  trySettle: (admitted, authority, scope) => trySettleCollectorTerminalResult(admitted, authority, scope),
29669
29814
  shouldPresentSettled: () => true,
29670
- resolveRunnerKnownFailure: async ({ result: result2, sessionFile }) => {
29815
+ resolveRunnerKnownFailure: async ({ result, sessionFile }) => {
29671
29816
  const infrastructureFailure = await readCollectorInfrastructureFailure(sessionFile);
29672
- return result2.knownFailure ?? (infrastructureFailure === void 0 ? void 0 : {
29817
+ return result.knownFailure ?? (infrastructureFailure === void 0 ? void 0 : {
29673
29818
  ...infrastructureFailure.cause === void 0 ? {} : { cause: infrastructureFailure.cause },
29674
29819
  diagnostic: infrastructureFailure.diagnostic,
29675
29820
  ...infrastructureFailure.identity === void 0 ? {} : { identity: infrastructureFailure.identity }
@@ -29729,10 +29874,10 @@ function buildNotaryTurnRequest(admitted, options) {
29729
29874
  options
29730
29875
  );
29731
29876
  }
29732
- async function runPublicNotary(argv, env, io, parseNotaryArgv2) {
29877
+ async function runPublicNotary(argv2, env, io, parseNotaryArgv2) {
29733
29878
  let parsed;
29734
29879
  try {
29735
- parsed = parseNotaryArgv2(argv);
29880
+ parsed = parseNotaryArgv2(argv2);
29736
29881
  } catch (error) {
29737
29882
  if (error instanceof CliUsageError) {
29738
29883
  presentStructuralRejection(error, io);
@@ -29920,10 +30065,10 @@ function buildInspectorTurnRequest(admitted, options) {
29920
30065
  options
29921
30066
  );
29922
30067
  }
29923
- async function runPublicInspector(argv, env, io, parseInspectorArgv2) {
30068
+ async function runPublicInspector(argv2, env, io, parseInspectorArgv2) {
29924
30069
  let parsed;
29925
30070
  try {
29926
- parsed = parseInspectorArgv2(argv);
30071
+ parsed = parseInspectorArgv2(argv2);
29927
30072
  } catch (error) {
29928
30073
  if (error instanceof CliUsageError) {
29929
30074
  presentStructuralRejection(error, io);
@@ -30073,9 +30218,9 @@ function buildJudgeTurnRequest(admitted, options) {
30073
30218
  function judgeAdapters() {
30074
30219
  return {
30075
30220
  trySettle: (admitted, authority, scope) => trySettleJudgeTerminalResult(admitted, authority, scope),
30076
- resolveRunnerKnownFailure: async ({ result: result2, sessionFile }) => {
30221
+ resolveRunnerKnownFailure: async ({ result, sessionFile }) => {
30077
30222
  const infrastructureFailure = await readEngineDetourInfrastructureFailure(sessionFile);
30078
- return result2.knownFailure ?? (infrastructureFailure === void 0 ? void 0 : {
30223
+ return result.knownFailure ?? (infrastructureFailure === void 0 ? void 0 : {
30079
30224
  ...infrastructureFailure.cause === void 0 ? {} : { cause: infrastructureFailure.cause },
30080
30225
  diagnostic: infrastructureFailure.diagnostic,
30081
30226
  ...infrastructureFailure.identity === void 0 ? {} : { identity: infrastructureFailure.identity }
@@ -30083,10 +30228,10 @@ function judgeAdapters() {
30083
30228
  }
30084
30229
  };
30085
30230
  }
30086
- async function runPublicJudge(argv, env, io, parseJudgeArgv2) {
30231
+ async function runPublicJudge(argv2, env, io, parseJudgeArgv2) {
30087
30232
  let admitted;
30088
30233
  try {
30089
- const parsed = parseJudgeArgv2(argv);
30234
+ const parsed = parseJudgeArgv2(argv2);
30090
30235
  admitted = await admitJudgeInvocation({
30091
30236
  home: env.home,
30092
30237
  principalAuthority: env.principalAuthority,
@@ -30138,7 +30283,7 @@ async function runPublicJudge(argv, env, io, parseJudgeArgv2) {
30138
30283
  ...admitted.correlationId === void 0 && env.correlationId === void 0 ? {} : { correlationId: admitted.correlationId ?? env.correlationId },
30139
30284
  continuation: {
30140
30285
  kind: "resume",
30141
- prompt: buildResumeContinuationPrompt({
30286
+ prompt: buildAutoResumeContinuationPrompt({
30142
30287
  packageRoot: env.packageRoot,
30143
30288
  ...pickEngineAxis(env)
30144
30289
  })
@@ -30191,10 +30336,10 @@ function buildDoctorTurnRequest(admitted, options) {
30191
30336
  options
30192
30337
  );
30193
30338
  }
30194
- async function runPublicDoctor(argv, env, io, parseDoctorArgv2) {
30339
+ async function runPublicDoctor(argv2, env, io, parseDoctorArgv2) {
30195
30340
  let admitted;
30196
30341
  try {
30197
- const parsed = parseDoctorArgv2(argv);
30342
+ const parsed = parseDoctorArgv2(argv2);
30198
30343
  admitted = await admitDoctorInvocation({
30199
30344
  home: env.home,
30200
30345
  principalAuthority: env.principalAuthority,
@@ -30320,10 +30465,10 @@ function diaristAdapters(env) {
30320
30465
  }
30321
30466
  };
30322
30467
  }
30323
- async function runPublicDiarist(argv, env, io, parseDiaristArgv2) {
30468
+ async function runPublicDiarist(argv2, env, io, parseDiaristArgv2) {
30324
30469
  let parsed;
30325
30470
  try {
30326
- parsed = parseDiaristArgv2(argv);
30471
+ parsed = parseDiaristArgv2(argv2);
30327
30472
  } catch (error) {
30328
30473
  if (error instanceof CliUsageError) {
30329
30474
  presentStructuralRejection(error, io);
@@ -30501,9 +30646,9 @@ function reviewerAdapters(packageRoot2, methodMaterial) {
30501
30646
  },
30502
30647
  scope
30503
30648
  ),
30504
- resolveRunnerKnownFailure: async ({ result: result2, sessionFile }) => {
30649
+ resolveRunnerKnownFailure: async ({ result, sessionFile }) => {
30505
30650
  const infrastructureFailure = await readEngineDetourInfrastructureFailure(sessionFile);
30506
- return infrastructureFailure === void 0 ? result2.knownFailure : {
30651
+ return infrastructureFailure === void 0 ? result.knownFailure : {
30507
30652
  ...infrastructureFailure.cause === void 0 ? {} : { cause: infrastructureFailure.cause },
30508
30653
  diagnostic: infrastructureFailure.diagnostic,
30509
30654
  ...infrastructureFailure.identity === void 0 ? {} : { identity: infrastructureFailure.identity }
@@ -30525,10 +30670,10 @@ function reviewerResumePrompt(env, message) {
30525
30670
  })
30526
30671
  ).join("\n");
30527
30672
  }
30528
- async function runPublicReviewer(argv, env, io, parseReviewerArgv2) {
30673
+ async function runPublicReviewer(argv2, env, io, parseReviewerArgv2) {
30529
30674
  let parsed;
30530
30675
  try {
30531
- parsed = parseReviewerArgv2(argv);
30676
+ parsed = parseReviewerArgv2(argv2);
30532
30677
  } catch (error) {
30533
30678
  if (error instanceof CliUsageError) {
30534
30679
  presentStructuralRejection(error, io);
@@ -30539,7 +30684,7 @@ async function runPublicReviewer(argv, env, io, parseReviewerArgv2) {
30539
30684
  if (parsed.lens === void 0) {
30540
30685
  const { summonParallelReviewerLenses: summonParallelReviewerLenses2 } = await Promise.resolve().then(() => (init_public_role_summons(), public_role_summons_exports));
30541
30686
  const children = await summonParallelReviewerLenses2({
30542
- argv,
30687
+ argv: argv2,
30543
30688
  // Replay argv under the same cwd the single-axis entry would see (10a).
30544
30689
  // Do not substitute the resolved project path — relative --project must
30545
30690
  // not be re-resolved against a shifted cwd.
@@ -31021,7 +31166,7 @@ async function summonPublicRole(options) {
31021
31166
  if (!prepared.ok) return { fail: projectPrepareFailure(prepared) };
31022
31167
  return { ok: await run(prepared.env, () => parsedArgv) };
31023
31168
  }
31024
- let result2;
31169
+ let result;
31025
31170
  switch (options.role) {
31026
31171
  case "notary": {
31027
31172
  const [{ runPublicNotary: runPublicNotary2 }, { parseNotaryArgv: parseNotaryArgv2 }] = await Promise.all([
@@ -31030,7 +31175,7 @@ async function summonPublicRole(options) {
31030
31175
  ]);
31031
31176
  const stepped = await runPrepared(parseNotaryArgv2, (env, once) => runPublicNotary2(options.argv, env, io, once));
31032
31177
  if ("fail" in stepped) return stepped.fail;
31033
- result2 = stepped.ok;
31178
+ result = stepped.ok;
31034
31179
  break;
31035
31180
  }
31036
31181
  case "inspector": {
@@ -31040,21 +31185,39 @@ async function summonPublicRole(options) {
31040
31185
  ]);
31041
31186
  const stepped = await runPrepared(parseInspectorArgv2, (env, once) => runPublicInspector2(options.argv, env, io, once));
31042
31187
  if ("fail" in stepped) return stepped.fail;
31043
- result2 = stepped.ok;
31188
+ result = stepped.ok;
31044
31189
  break;
31045
31190
  }
31046
31191
  case "auditor":
31047
31192
  case "navigator":
31048
31193
  case "gatekeeper": {
31049
31194
  const seat2 = options.role;
31050
- const [{ runPublicInstructionSeat: runPublicInstructionSeat2 }, invocation] = await Promise.all([
31195
+ const [{ runPublicInstructionSeat: runPublicInstructionSeat2, runPublicInstructionSeatResume: runPublicInstructionSeatResume2 }, invocation] = await Promise.all([
31051
31196
  Promise.resolve().then(() => (init_instruction_seat_run(), instruction_seat_run_exports)),
31052
31197
  Promise.resolve().then(() => (init_invocation(), invocation_exports))
31053
31198
  ]);
31054
31199
  const parse = seat2 === "auditor" ? invocation.parseAuditorArgv : seat2 === "navigator" ? invocation.parseNavigatorArgv : invocation.parseGatekeeperArgv;
31055
- const stepped = await runPrepared(parse, (env, once) => runPublicInstructionSeat2(options.argv, env, io, seat2, once));
31056
- if ("fail" in stepped) return stepped.fail;
31057
- result2 = stepped.ok;
31200
+ const resumeRunId = typeof options.resumeRunId === "string" && options.resumeRunId.trim() !== "" ? options.resumeRunId.trim() : void 0;
31201
+ if (resumeRunId !== void 0) {
31202
+ const instruction = options.argv[0] ?? "";
31203
+ const stepped = await runPrepared(parse, (env) => runPublicInstructionSeatResume2(
31204
+ {
31205
+ runId: resumeRunId,
31206
+ summons: {
31207
+ instruction,
31208
+ instructionEmpty: instruction.trim() === ""
31209
+ }
31210
+ },
31211
+ env,
31212
+ io
31213
+ ));
31214
+ if ("fail" in stepped) return stepped.fail;
31215
+ result = stepped.ok;
31216
+ } else {
31217
+ const stepped = await runPrepared(parse, (env, once) => runPublicInstructionSeat2(options.argv, env, io, seat2, once));
31218
+ if ("fail" in stepped) return stepped.fail;
31219
+ result = stepped.ok;
31220
+ }
31058
31221
  break;
31059
31222
  }
31060
31223
  case "judge": {
@@ -31064,7 +31227,7 @@ async function summonPublicRole(options) {
31064
31227
  ]);
31065
31228
  const stepped = await runPrepared(parseJudgeArgv2, (env, once) => runPublicJudge2(options.argv, env, io, once));
31066
31229
  if ("fail" in stepped) return stepped.fail;
31067
- result2 = stepped.ok;
31230
+ result = stepped.ok;
31068
31231
  break;
31069
31232
  }
31070
31233
  case "doctor": {
@@ -31074,7 +31237,7 @@ async function summonPublicRole(options) {
31074
31237
  ]);
31075
31238
  const stepped = await runPrepared(parseDoctorArgv2, (env, once) => runPublicDoctor2(options.argv, env, io, once));
31076
31239
  if ("fail" in stepped) return stepped.fail;
31077
- result2 = stepped.ok;
31240
+ result = stepped.ok;
31078
31241
  break;
31079
31242
  }
31080
31243
  case "diarist": {
@@ -31084,7 +31247,7 @@ async function summonPublicRole(options) {
31084
31247
  ]);
31085
31248
  const stepped = await runPrepared(parseDiaristArgv2, (env, once) => runPublicDiarist2(options.argv, env, io, once));
31086
31249
  if ("fail" in stepped) return stepped.fail;
31087
- result2 = stepped.ok;
31250
+ result = stepped.ok;
31088
31251
  break;
31089
31252
  }
31090
31253
  case "countersign": {
@@ -31094,7 +31257,7 @@ async function summonPublicRole(options) {
31094
31257
  ]);
31095
31258
  const stepped = await runPrepared(parseCountersignArgv2, (env, once) => runPublicCountersign2(options.argv, env, io, once));
31096
31259
  if ("fail" in stepped) return stepped.fail;
31097
- result2 = stepped.ok;
31260
+ result = stepped.ok;
31098
31261
  break;
31099
31262
  }
31100
31263
  case "reviewer": {
@@ -31104,24 +31267,24 @@ async function summonPublicRole(options) {
31104
31267
  ]);
31105
31268
  const stepped = await runPrepared(parseReviewerArgv2, (env, once) => runPublicReviewer2(options.argv, env, io, once));
31106
31269
  if ("fail" in stepped) return stepped.fail;
31107
- result2 = stepped.ok;
31270
+ result = stepped.ok;
31108
31271
  break;
31109
31272
  }
31110
31273
  }
31111
31274
  const stderr = captured?.stderrText();
31112
- const runDirectory = result2.admitted?.runDirectory;
31275
+ const runDirectory = result.admitted?.runDirectory;
31113
31276
  return {
31114
- exitCode: result2.exitCode,
31115
- ...result2.terminal === void 0 ? {} : { terminal: result2.terminal },
31116
- ...result2.admitted === void 0 ? {} : { admitted: result2.admitted },
31277
+ exitCode: result.exitCode,
31278
+ ...result.terminal === void 0 ? {} : { terminal: result.terminal },
31279
+ ...result.admitted === void 0 ? {} : { admitted: result.admitted },
31117
31280
  ...typeof runDirectory === "string" && runDirectory.trim() !== "" ? { runDirectory } : {},
31118
31281
  ...stderr === void 0 || stderr === "" ? {} : { stderr }
31119
31282
  };
31120
31283
  }
31121
- function withReviewerLens(argv, lens) {
31122
- const separator = argv.indexOf("--");
31123
- if (separator === -1) return [...argv, "--lens", lens];
31124
- return [...argv.slice(0, separator), "--lens", lens, ...argv.slice(separator)];
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)];
31125
31288
  }
31126
31289
  async function resolveReviewerWorktreeRoots(projectRoot) {
31127
31290
  const callerProjectRoot = await realpath6(projectRoot);
@@ -31296,7 +31459,7 @@ async function summonParallelReviewerLenses(options) {
31296
31459
  }
31297
31460
  })
31298
31461
  );
31299
- const creationFailures = creation.flatMap((result2) => result2.status === "rejected" ? [result2.reason] : []);
31462
+ const creationFailures = creation.flatMap((result) => result.status === "rejected" ? [result.reason] : []);
31300
31463
  if (creationFailures.length > 0) {
31301
31464
  const failure = failedResult(new AggregateError(
31302
31465
  creationFailures,
@@ -31370,10 +31533,10 @@ async function summonParallelReviewerLenses(options) {
31370
31533
  ${describeFailure(error)}`;
31371
31534
  }
31372
31535
  if (sealDiagnostic !== void 0) {
31373
- const withSealFailure = (result2) => ({
31374
- ...result2,
31536
+ const withSealFailure = (result) => ({
31537
+ ...result,
31375
31538
  exitCode: 1,
31376
- stderr: [result2.stderr, sealDiagnostic].filter(
31539
+ stderr: [result.stderr, sealDiagnostic].filter(
31377
31540
  (text) => typeof text === "string" && text !== ""
31378
31541
  ).join("\n")
31379
31542
  });
@@ -31385,19 +31548,19 @@ ${describeFailure(error)}`;
31385
31548
  const cleanup = await Promise.allSettled(
31386
31549
  [...created].map((path) => execFileAsync3("git", ["worktree", "remove", path], { cwd: sourceProjectRoot }))
31387
31550
  );
31388
- const cleanupFailures = cleanup.flatMap((result2) => result2.status === "rejected" ? [result2.reason] : []);
31551
+ const cleanupFailures = cleanup.flatMap((result) => result.status === "rejected" ? [result.reason] : []);
31389
31552
  if (cleanupFailures.length === 0) {
31390
31553
  const rootCleanup = await Promise.allSettled([rm3(root, { recursive: true, force: true })]);
31391
- cleanupFailures.push(...rootCleanup.flatMap((result2) => result2.status === "rejected" ? [result2.reason] : []));
31554
+ cleanupFailures.push(...rootCleanup.flatMap((result) => result.status === "rejected" ? [result.reason] : []));
31392
31555
  }
31393
31556
  if (cleanupFailures.length > 0) {
31394
31557
  const diagnostic = [
31395
31558
  "parallel reviewer worktree cleanup failed",
31396
31559
  ...cleanupFailures.map((failure) => failure instanceof Error ? failure.message : String(failure))
31397
31560
  ].join("\n");
31398
- const withCleanupDiagnostic = (result2) => ({
31399
- ...result2,
31400
- stderr: [result2.stderr, diagnostic].filter(
31561
+ const withCleanupDiagnostic = (result) => ({
31562
+ ...result,
31563
+ stderr: [result.stderr, diagnostic].filter(
31401
31564
  (text) => typeof text === "string" && text !== ""
31402
31565
  ).join("\n")
31403
31566
  });
@@ -31533,7 +31696,7 @@ async function invokeCourtDiarist(input, env, io) {
31533
31696
  }
31534
31697
  };
31535
31698
  const { summonPublicRole: summonPublicRole2 } = await Promise.resolve().then(() => (init_public_role_summons(), public_role_summons_exports));
31536
- const result2 = await summonPublicRole2({
31699
+ const result = await summonPublicRole2({
31537
31700
  role: "diarist",
31538
31701
  argv: [
31539
31702
  "--project",
@@ -31555,14 +31718,14 @@ async function invokeCourtDiarist(input, env, io) {
31555
31718
  // already-selected parent adapter (#840 / ADR 0082: --host 旗标>席位配置>缺省 pi).
31556
31719
  ...env.hostAdapters === void 0 ? {} : { hostAdapters: env.hostAdapters }
31557
31720
  });
31558
- const roleOutcome = result2.terminal?.roleOutcome;
31721
+ const roleOutcome = result.terminal?.roleOutcome;
31559
31722
  if (courtDiaristEscalated(roleOutcome)) {
31560
31723
  return {
31561
31724
  identity: { kind: "escalate" }
31562
31725
  };
31563
31726
  }
31564
- if (result2.exitCode !== 0) {
31565
- const diagnostic = roleOutcome?.kind === "failure" ? roleOutcome.diagnostic : result2.stderr?.trim() || `exit ${result2.exitCode}`;
31727
+ if (result.exitCode !== 0) {
31728
+ const diagnostic = roleOutcome?.kind === "failure" ? roleOutcome.diagnostic : result.stderr?.trim() || `exit ${result.exitCode}`;
31566
31729
  return {
31567
31730
  identity: { kind: "unbound" },
31568
31731
  failedWithoutEscalate: {
@@ -31570,7 +31733,7 @@ async function invokeCourtDiarist(input, env, io) {
31570
31733
  }
31571
31734
  };
31572
31735
  }
31573
- const asserted = result2.admitted?.ticketNumber;
31736
+ const asserted = result.admitted?.ticketNumber;
31574
31737
  if (isSafePositiveTicketNumber(asserted)) {
31575
31738
  const courtTicketNumbers = courtTicketNumbersFromOutcome(
31576
31739
  roleOutcome,
@@ -31630,10 +31793,10 @@ async function runCountersignCourtDiaristStation(admitted, env, io) {
31630
31793
  }
31631
31794
  }
31632
31795
  }
31633
- async function runPublicCountersign(argv, env, io, parseCountersignArgv2) {
31796
+ async function runPublicCountersign(argv2, env, io, parseCountersignArgv2) {
31634
31797
  let parsed;
31635
31798
  try {
31636
- parsed = parseCountersignArgv2(argv);
31799
+ parsed = parseCountersignArgv2(argv2);
31637
31800
  } catch (error) {
31638
31801
  if (error instanceof CliUsageError) {
31639
31802
  presentStructuralRejection(error, io);
@@ -31836,7 +31999,7 @@ async function runPublicCountersign(argv, env, io, parseCountersignArgv2) {
31836
31999
  admitted,
31837
32000
  turnProjection
31838
32001
  );
31839
- const result2 = await runPostAdmissionOneShot({
32002
+ const result = await runPostAdmissionOneShot({
31840
32003
  admitted,
31841
32004
  env,
31842
32005
  io,
@@ -31862,7 +32025,7 @@ async function runPublicCountersign(argv, env, io, parseCountersignArgv2) {
31862
32025
  ...env.engine === void 0 ? {} : { effectiveEngine: env.engine }
31863
32026
  });
31864
32027
  await relocateAdmittedRunToTicket(admitted, env.principalAuthority);
31865
- return result2;
32028
+ return result;
31866
32029
  }
31867
32030
  );
31868
32031
  } catch (error) {
@@ -31965,10 +32128,10 @@ function diaristEnv(env) {
31965
32128
  ...env.hostAdapters === void 0 ? {} : { hostAdapters: env.hostAdapters }
31966
32129
  };
31967
32130
  }
31968
- async function runPublicSecretariat(argv, env, io, parseSecretariatArgv2) {
32131
+ async function runPublicSecretariat(argv2, env, io, parseSecretariatArgv2) {
31969
32132
  let parsed;
31970
32133
  try {
31971
- parsed = parseSecretariatArgv2(argv);
32134
+ parsed = parseSecretariatArgv2(argv2);
31972
32135
  } catch (error) {
31973
32136
  if (error instanceof CliUsageError) {
31974
32137
  presentStructuralRejection(error, io);
@@ -32136,10 +32299,10 @@ function buildGleanerLeftTurnRequest(admitted, options) {
32136
32299
  options
32137
32300
  );
32138
32301
  }
32139
- async function runPublicGleanerLeft(argv, env, io, parseGleanerLeftArgv2) {
32302
+ async function runPublicGleanerLeft(argv2, env, io, parseGleanerLeftArgv2) {
32140
32303
  let admitted;
32141
32304
  try {
32142
- const parsed = parseGleanerLeftArgv2(argv);
32305
+ const parsed = parseGleanerLeftArgv2(argv2);
32143
32306
  admitted = await admitGleanerLeftInvocation({
32144
32307
  home: env.home,
32145
32308
  principalAuthority: env.principalAuthority,
@@ -32266,10 +32429,10 @@ function fixerAdapters(packageRoot2, methodMaterial) {
32266
32429
  async function loadFixerMethodMaterial(packageRoot2) {
32267
32430
  return await loadPackagedMethodSkillMaterial(packageRoot2, "diagnosing-bugs");
32268
32431
  }
32269
- async function runPublicFixer(argv, env, io, parseFixerArgv2) {
32432
+ async function runPublicFixer(argv2, env, io, parseFixerArgv2) {
32270
32433
  let admitted;
32271
32434
  try {
32272
- const parsed = parseFixerArgv2(argv);
32435
+ const parsed = parseFixerArgv2(argv2);
32273
32436
  admitted = await admitFixerInvocation({
32274
32437
  home: env.home,
32275
32438
  principalAuthority: env.principalAuthority,
@@ -32340,7 +32503,7 @@ async function runPublicFixer(argv, env, io, parseFixerArgv2) {
32340
32503
  ...admitted.correlationId === void 0 && env.correlationId === void 0 ? {} : { correlationId: admitted.correlationId ?? env.correlationId },
32341
32504
  continuation: {
32342
32505
  kind: "resume",
32343
- prompt: buildResumeContinuationPrompt({
32506
+ prompt: buildAutoResumeContinuationPrompt({
32344
32507
  packageRoot: env.packageRoot,
32345
32508
  ...pickEngineAxis(env)
32346
32509
  })
@@ -32443,10 +32606,10 @@ function mergerTurnOptions(admitted, env) {
32443
32606
  ...admitted.correlationId === void 0 && env.correlationId === void 0 ? {} : { correlationId: admitted.correlationId ?? env.correlationId }
32444
32607
  };
32445
32608
  }
32446
- async function runPublicMerger(argv, env, io, parseMergerArgv2) {
32609
+ async function runPublicMerger(argv2, env, io, parseMergerArgv2) {
32447
32610
  let parsed;
32448
32611
  try {
32449
- parsed = parseMergerArgv2(argv);
32612
+ parsed = parseMergerArgv2(argv2);
32450
32613
  } catch (error) {
32451
32614
  if (error instanceof CliUsageError) {
32452
32615
  presentStructuralRejection(error, io);
@@ -32519,7 +32682,7 @@ async function runPublicMerger(argv, env, io, parseMergerArgv2) {
32519
32682
  ...admitted.correlationId === void 0 && env.correlationId === void 0 ? {} : { correlationId: admitted.correlationId ?? env.correlationId },
32520
32683
  continuation: {
32521
32684
  kind: "resume",
32522
- prompt: buildResumeContinuationPrompt({
32685
+ prompt: buildAutoResumeContinuationPrompt({
32523
32686
  packageRoot: env.packageRoot,
32524
32687
  ...pickEngineAxis(env)
32525
32688
  })
@@ -32976,6 +33139,34 @@ async function readExistingRunLifecycleState(runDirectory) {
32976
33139
  return void 0;
32977
33140
  }
32978
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
+ }
32979
33170
  function parseRunDirectoryName2(name) {
32980
33171
  const at = name.lastIndexOf("@");
32981
33172
  if (at <= 0 || at === name.length - 1) return void 0;
@@ -33168,13 +33359,26 @@ async function classifyScopedRun(input) {
33168
33359
  reasons.push(errorText3(error));
33169
33360
  }
33170
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
+ }
33171
33372
  try {
33172
33373
  const artifact = await readRunTerminalArtifact(input.runDirectory);
33173
33374
  if (artifact.status === "unreadable") {
33174
33375
  missingSources.push("terminal-artifact");
33175
33376
  reasons.push(`${artifact.file}: ${artifact.reason}`);
33176
33377
  } else if (artifact.status === "absent") {
33177
- const lifecycle = await readExistingRunLifecycleState(input.runDirectory);
33378
+ if (lifecycle === "admitted" || lifecycle === "running") {
33379
+ if (ghostLeg !== void 0) return { kind: "ghost", leg: ghostLeg };
33380
+ return { kind: "live" };
33381
+ }
33178
33382
  if (lifecycle !== void 0 && LIVE_RUN_STATES.has(lifecycle)) {
33179
33383
  return { kind: "live" };
33180
33384
  }
@@ -33203,7 +33407,8 @@ async function classifyScopedRun(input) {
33203
33407
  reason: reasons.join("; "),
33204
33408
  firstFrameAt,
33205
33409
  lastFrameAt
33206
- }
33410
+ },
33411
+ ...ghostLeg !== void 0 ? { ghostLeg } : {}
33207
33412
  };
33208
33413
  }
33209
33414
  if (frameSpan === void 0 || toolIntervals === void 0 || terminal === void 0) {
@@ -33228,7 +33433,8 @@ async function classifyScopedRun(input) {
33228
33433
  reason: errorText3(error),
33229
33434
  firstFrameAt: { status: "present", at: frameSpan.startedAt },
33230
33435
  lastFrameAt: { status: "present", at: frameSpan.endedAt }
33231
- }
33436
+ },
33437
+ ...ghostLeg !== void 0 ? { ghostLeg } : {}
33232
33438
  };
33233
33439
  }
33234
33440
  return {
@@ -33242,7 +33448,8 @@ async function classifyScopedRun(input) {
33242
33448
  terminal,
33243
33449
  models,
33244
33450
  gateCycles
33245
- }
33451
+ },
33452
+ ...ghostLeg !== void 0 ? { ghostLeg } : {}
33246
33453
  };
33247
33454
  }
33248
33455
  async function scanAnalystIssueRuns(input) {
@@ -33274,10 +33481,11 @@ async function scanAnalystIssueRuns(input) {
33274
33481
  wholeBook = true;
33275
33482
  }
33276
33483
  if (bookNames.length === 0) {
33277
- return { runs: [], unreadable: [], scopeConflicts: [] };
33484
+ return { runs: [], unreadable: [], scopeConflicts: [], ghostLegs: [] };
33278
33485
  }
33279
33486
  const runs = [];
33280
33487
  const unreadable = [];
33488
+ const ghostLegs = [];
33281
33489
  const scopeConflicts = [];
33282
33490
  for (const book of bookNames) {
33283
33491
  const bookDir = join33(booksRoot, book);
@@ -33315,14 +33523,22 @@ async function scanAnalystIssueRuns(input) {
33315
33523
  role: parsed.role,
33316
33524
  runDirectory
33317
33525
  });
33318
- if (classified.kind === "readable") runs.push(classified.facts);
33319
- else if (classified.kind === "unreadable") unreadable.push(classified.entry);
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
+ }
33320
33535
  }
33321
33536
  }
33322
33537
  return {
33323
33538
  runs,
33324
33539
  unreadable,
33325
- scopeConflicts
33540
+ scopeConflicts,
33541
+ ghostLegs
33326
33542
  };
33327
33543
  }
33328
33544
  var LIVE_RUN_STATES;
@@ -33332,6 +33548,7 @@ var init_analyst_ledger = __esm({
33332
33548
  init_activation_ledger_git();
33333
33549
  init_activation_ledger_topology();
33334
33550
  init_role_run_placement();
33551
+ init_run_lifecycle();
33335
33552
  init_run_ticket_number();
33336
33553
  init_ledger_session_read();
33337
33554
  init_run_terminal_artifacts();
@@ -34327,7 +34544,13 @@ async function readOrComputeAnalystIssuePage(input, options) {
34327
34544
  const raw = await readFile21(pagePath, "utf8");
34328
34545
  const page = JSON.parse(raw);
34329
34546
  if (cachedPageMatchesRequestedScope(page, { bookKey, ...input })) {
34330
- return { mode: "issue", page, pagePath };
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 };
34331
34554
  }
34332
34555
  } catch (error) {
34333
34556
  if (!isMissingPathError7(error)) {
@@ -34385,7 +34608,7 @@ async function runAnalystIssueMode(input, precomputedScan, scanProjectRoot, home
34385
34608
  rowFromIssueMetricsPage(page)
34386
34609
  ]);
34387
34610
  }
34388
- return { mode: "issue", page, pagePath };
34611
+ return { mode: "issue", page, pagePath, ghostLegs: scan.ghostLegs };
34389
34612
  }
34390
34613
  async function runAnalystSweepMode(input, home) {
34391
34614
  const ledgerHome = resolveActivationLedgerHome(home);
@@ -34393,7 +34616,7 @@ async function runAnalystSweepMode(input, home) {
34393
34616
  for (const entry of input.mergedPullRequests) {
34394
34617
  issuePages.push(await runAnalystIssueMode(entry, void 0, void 0, home));
34395
34618
  }
34396
- const upserts = issuePages.map((result2) => rowFromIssueMetricsPage(result2.page));
34619
+ const upserts = issuePages.map((result) => rowFromIssueMetricsPage(result.page));
34397
34620
  const { index, indexPath } = await mergeAnalystLibraryIndexRows(ledgerHome, upserts);
34398
34621
  return { mode: "sweep", issuePages, index, indexPath };
34399
34622
  }
@@ -34596,16 +34819,16 @@ async function buildAnalystSweepModeInputFromAttachmentPaths(attachmentPaths) {
34596
34819
  }
34597
34820
  return parseAnalystSweepModeInputFromJsonValue(parsed);
34598
34821
  }
34599
- async function runPublicAnalyst(argv, _env, io, parseAnalystArgv2) {
34822
+ async function runPublicAnalyst(argv2, _env, io, parseAnalystArgv2) {
34600
34823
  try {
34601
- const parsed = parseAnalystArgv2(argv);
34824
+ const parsed = parseAnalystArgv2(argv2);
34602
34825
  const ledgerHome = resolveActivationLedgerHome(_env.home);
34603
34826
  if (parsed.query === "sweep") {
34604
34827
  const input2 = await buildAnalystSweepModeInputFromAttachmentPaths(
34605
34828
  parsed.attachmentPaths
34606
34829
  );
34607
- const result3 = await runAnalyst(input2, { home: _env.home });
34608
- io.stdout(`${JSON.stringify(result3, null, 2)}
34830
+ const result2 = await runAnalyst(input2, { home: _env.home });
34831
+ io.stdout(`${JSON.stringify(result2, null, 2)}
34609
34832
  `);
34610
34833
  return { exitCode: 0 };
34611
34834
  }
@@ -34618,7 +34841,7 @@ async function runPublicAnalyst(argv, _env, io, parseAnalystArgv2) {
34618
34841
  defaultBookKey ??= resolveAnalystIssueBookKeyFromCwd();
34619
34842
  return { bookKey: defaultBookKey, issueNumber: token.issueNumber };
34620
34843
  };
34621
- const result3 = await runAnalyst({
34844
+ const result2 = await runAnalyst({
34622
34845
  mode: "cohort",
34623
34846
  groups: [
34624
34847
  {
@@ -34631,13 +34854,13 @@ async function runPublicAnalyst(argv, _env, io, parseAnalystArgv2) {
34631
34854
  }
34632
34855
  ]
34633
34856
  }, { home: _env.home });
34634
- io.stdout(`${JSON.stringify(result3, null, 2)}
34857
+ io.stdout(`${JSON.stringify(result2, null, 2)}
34635
34858
  `);
34636
34859
  return { exitCode: 0 };
34637
34860
  }
34638
34861
  const input = await buildAnalystIssueModeInputFromPublicArgv(parsed, ledgerHome);
34639
- const result2 = await readOrComputeAnalystIssuePage(input, { home: _env.home });
34640
- io.stdout(`${JSON.stringify(result2, null, 2)}
34862
+ const result = await readOrComputeAnalystIssuePage(input, { home: _env.home });
34863
+ io.stdout(`${JSON.stringify(result, null, 2)}
34641
34864
  `);
34642
34865
  return { exitCode: 0 };
34643
34866
  } catch (error) {
@@ -34683,6 +34906,7 @@ __export(cli_exports, {
34683
34906
  PUBLIC_GLOBAL_OPTIONS: () => PUBLIC_GLOBAL_OPTIONS,
34684
34907
  PUBLIC_ROLE_ARGV: () => PUBLIC_ROLE_ARGV,
34685
34908
  buildExplicitInternalActivationArgs: () => buildExplicitInternalActivationArgs,
34909
+ commandNeedsProcessCancel: () => commandNeedsProcessCancel,
34686
34910
  helpDocument: () => helpDocument,
34687
34911
  helpDocumentForCommand: () => helpDocumentForCommand,
34688
34912
  projectConfigDisplaySeats: () => projectConfigDisplaySeats,
@@ -34692,11 +34916,11 @@ __export(cli_exports, {
34692
34916
  });
34693
34917
  import { realpath as realpath7 } from "node:fs/promises";
34694
34918
  import { join as join35 } from "node:path";
34695
- function takePublicGlobalFlag(argv, index, options) {
34696
- const tokens = argv.slice(index);
34919
+ function takePublicGlobalFlag(argv2, index, options) {
34920
+ const tokens = argv2.slice(index);
34697
34921
  const taken = options.takeDashed(tokens);
34698
34922
  if (taken === void 0) return void 0;
34699
- const consumed = argv.length - index - tokens.length;
34923
+ const consumed = argv2.length - index - tokens.length;
34700
34924
  if (taken.def.id === "help") {
34701
34925
  return { flag: "help", consume: consumed };
34702
34926
  }
@@ -34771,7 +34995,8 @@ function createRoleEnvironment(env, options, afterHost) {
34771
34995
  ...timeoutMs === void 0 ? {} : { timeoutMs },
34772
34996
  ...env.createRunId === void 0 ? {} : { createRunId: env.createRunId },
34773
34997
  ...options.config?.autoResumeLimit === void 0 ? {} : { autoResumeLimit: options.config.autoResumeLimit },
34774
- ...env.freshSummons === true ? { freshSummons: true } : {}
34998
+ ...env.freshSummons === true ? { freshSummons: true } : {},
34999
+ ...env.signal === void 0 ? {} : { signal: env.signal }
34775
35000
  };
34776
35001
  }
34777
35002
  async function dispatchPublicRoleCommand(env, home, io, parsed, role, parse, run) {
@@ -34786,7 +35011,7 @@ async function dispatchPublicRoleCommand(env, home, io, parsed, role, parse, run
34786
35011
  invocationFromParsed(parsed)
34787
35012
  );
34788
35013
  let parsedRoleArgv;
34789
- const result2 = await run(
35014
+ const result = await run(
34790
35015
  parsed.args,
34791
35016
  createRoleEnvironment(
34792
35017
  env,
@@ -34798,15 +35023,15 @@ async function dispatchPublicRoleCommand(env, home, io, parsed, role, parse, run
34798
35023
  () => parsedRoleArgv
34799
35024
  );
34800
35025
  return {
34801
- exitCode: result2.exitCode,
34802
- ...result2.terminal === void 0 ? {} : { terminal: result2.terminal }
35026
+ exitCode: result.exitCode,
35027
+ ...result.terminal === void 0 ? {} : { terminal: result.terminal }
34803
35028
  };
34804
35029
  }
34805
- function cliResultFromRoleRun(result2) {
35030
+ function cliResultFromRoleRun(result) {
34806
35031
  return {
34807
- exitCode: result2.exitCode,
34808
- ...result2.terminal === void 0 ? {} : { terminal: result2.terminal },
34809
- ...result2.staleWriterLeaseReclaimed === true ? { staleWriterLeaseReclaimed: true } : {}
35032
+ exitCode: result.exitCode,
35033
+ ...result.terminal === void 0 ? {} : { terminal: result.terminal },
35034
+ ...result.staleWriterLeaseReclaimed === true ? { staleWriterLeaseReclaimed: true } : {}
34810
35035
  };
34811
35036
  }
34812
35037
  function defaultIo() {
@@ -34828,8 +35053,8 @@ function resolveAgentDir(env, home) {
34828
35053
  function parseThinking(value) {
34829
35054
  return value;
34830
35055
  }
34831
- function parseArgv(argv) {
34832
- const args = [...argv];
35056
+ function parseArgv(argv2) {
35057
+ const args = [...argv2];
34833
35058
  let model;
34834
35059
  let thinking;
34835
35060
  let engine;
@@ -35339,7 +35564,21 @@ async function runConfigCommand(args, home, packageRoot2, io) {
35339
35564
  }
35340
35565
  throw new CliUsageError(`unknown config subcommand: ${args[0]}`);
35341
35566
  }
35342
- async function runAkRole(argv, env) {
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) {
35343
35582
  const io = env.io ?? defaultIo();
35344
35583
  try {
35345
35584
  env = {
@@ -35347,7 +35586,7 @@ async function runAkRole(argv, env) {
35347
35586
  packageRoot: await realpath7(env.packageRoot),
35348
35587
  principalAuthority: env.principalAuthority ?? piDurablePrincipalAuthority
35349
35588
  };
35350
- let parsed = parseArgv(argv);
35589
+ let parsed = parseArgv(argv2);
35351
35590
  const acceptsSeatAxes = parsed.command !== void 0 && (isPublicCallableRole(parsed.command) || parsed.command === "resume" || parsed.command === "new");
35352
35591
  if (parsed.host !== void 0 && !parsed.help && parsed.command !== void 0 && parsed.command !== "help" && !acceptsSeatAxes) {
35353
35592
  throw new CliUsageError(`host axis is role commands only; refused command ${parsed.command}`);
@@ -35422,7 +35661,7 @@ async function runAkRole(argv, env) {
35422
35661
  credentials,
35423
35662
  invocationFromParsed(parsed)
35424
35663
  );
35425
- const result2 = await dispatch.run(
35664
+ const result = await dispatch.run(
35426
35665
  resumeRequest,
35427
35666
  createRoleEnvironment(env, {
35428
35667
  role: dispatch.seat,
@@ -35435,7 +35674,7 @@ async function runAkRole(argv, env) {
35435
35674
  }),
35436
35675
  io
35437
35676
  );
35438
- return cliResultFromRoleRun(result2);
35677
+ return cliResultFromRoleRun(result);
35439
35678
  }
35440
35679
  if (parsed.command !== void 0 && isPublicCliSupportCommand(parsed.command)) {
35441
35680
  throw new CliUsageError(`unhandled support command: ${parsed.command}`);
@@ -35596,13 +35835,13 @@ async function runAkRole(argv, env) {
35596
35835
  );
35597
35836
  }
35598
35837
  if (parsed.command === "analyst") {
35599
- const result2 = await runPublicAnalyst(
35838
+ const result = await runPublicAnalyst(
35600
35839
  parsed.args,
35601
35840
  { home },
35602
35841
  io,
35603
35842
  PUBLIC_ROLE_ARGV.analyst.parse
35604
35843
  );
35605
- return { exitCode: result2.exitCode };
35844
+ return { exitCode: result.exitCode };
35606
35845
  }
35607
35846
  throw new CliUsageError(`unknown command: ${parsed.command}`);
35608
35847
  } catch (error) {
@@ -35808,6 +36047,16 @@ function resolvePackageRoot(binDir) {
35808
36047
  var packageRoot = resolvePackageRoot(here);
35809
36048
  process.env.AK_ROLE_PACKAGE_ROOT = packageRoot;
35810
36049
  ensureHostPiRuntimeResolvable(packageRoot);
35811
- var { runAkRole: runAkRole2 } = await Promise.resolve().then(() => (init_cli(), cli_exports));
35812
- var result = await runAkRole2(process.argv.slice(2), { packageRoot });
35813
- process.exitCode = result.exitCode;
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
+ }