@cmodjs/core 5.1.1 → 5.2.1

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 (82) hide show
  1. package/docs/commands.md +24 -12
  2. package/docs/dependencies.md +5 -5
  3. package/docs/index.md +2 -1
  4. package/docs/install-steps.md +1 -1
  5. package/docs/mod.md +44 -1
  6. package/docs/options.md +1 -1
  7. package/docs/session.md +5 -1
  8. package/docs/testing.md +7 -3
  9. package/mod.d.ts +11 -0
  10. package/mod.d.ts.map +1 -1
  11. package/mod.js +3 -0
  12. package/package.json +1 -1
  13. package/records.d.ts +2 -2
  14. package/records.d.ts.map +1 -1
  15. package/records.js +5 -4
  16. package/register.d.ts.map +1 -1
  17. package/register.js +4 -2
  18. package/runtime/before.d.ts +1 -1
  19. package/runtime/before.d.ts.map +1 -1
  20. package/runtime/before.js +33 -21
  21. package/runtime/claude.d.ts +4 -0
  22. package/runtime/claude.d.ts.map +1 -1
  23. package/runtime/conversations.d.ts.map +1 -1
  24. package/runtime/conversations.js +58 -26
  25. package/runtime/deadline.d.ts +1 -1
  26. package/runtime/deadline.d.ts.map +1 -1
  27. package/runtime/deadline.js +7 -2
  28. package/runtime/device.d.ts +6 -0
  29. package/runtime/device.d.ts.map +1 -0
  30. package/runtime/device.js +58 -0
  31. package/runtime/hooks.d.ts +1 -1
  32. package/runtime/hooks.d.ts.map +1 -1
  33. package/runtime/hooks.js +1 -1
  34. package/runtime/lifecycle.d.ts +1 -1
  35. package/runtime/lifecycle.d.ts.map +1 -1
  36. package/runtime/lifecycle.js +30 -7
  37. package/runtime/permission-check.d.ts +1 -1
  38. package/runtime/permission-check.d.ts.map +1 -1
  39. package/runtime/permission-check.js +5 -5
  40. package/runtime/router.d.ts +7 -3
  41. package/runtime/router.d.ts.map +1 -1
  42. package/runtime/router.js +5 -3
  43. package/runtime/sessions.d.ts +10 -6
  44. package/runtime/sessions.d.ts.map +1 -1
  45. package/runtime/sessions.js +60 -37
  46. package/session/context/turn/device.d.ts +10 -0
  47. package/session/context/turn/device.d.ts.map +1 -0
  48. package/session/context/turn/device.js +11 -0
  49. package/session/context/turn/turn.d.ts +2 -0
  50. package/session/context/turn/turn.d.ts.map +1 -1
  51. package/session/conversation.d.ts +4 -1
  52. package/session/conversation.d.ts.map +1 -1
  53. package/session/conversation.js +8 -3
  54. package/src/mod.ts +12 -0
  55. package/src/records.ts +5 -4
  56. package/src/register.ts +5 -3
  57. package/src/runtime/before.ts +35 -24
  58. package/src/runtime/claude.ts +2 -0
  59. package/src/runtime/conversations.ts +63 -34
  60. package/src/runtime/deadline.ts +7 -2
  61. package/src/runtime/device.ts +65 -0
  62. package/src/runtime/hooks.ts +3 -3
  63. package/src/runtime/lifecycle.ts +33 -8
  64. package/src/runtime/permission-check.ts +6 -6
  65. package/src/runtime/router.ts +14 -7
  66. package/src/runtime/sessions.ts +67 -39
  67. package/src/session/context/turn/device.ts +21 -0
  68. package/src/session/context/turn/turn.ts +2 -0
  69. package/src/session/conversation.ts +10 -5
  70. package/src/testing/claude-code.ts +2 -2
  71. package/src/testing/fake-claude.ts +6 -1
  72. package/src/testing.ts +50 -13
  73. package/testing/claude-code.d.ts +2 -2
  74. package/testing/claude-code.d.ts.map +1 -1
  75. package/testing/fake-claude.d.ts +3 -0
  76. package/testing/fake-claude.d.ts.map +1 -1
  77. package/testing/fake-claude.js +3 -1
  78. package/testing.d.ts +1 -0
  79. package/testing.d.ts.map +1 -1
  80. package/testing.js +53 -12
  81. package/vendor-markdown.js +744 -738
  82. package/vendor.js +122 -106
package/vendor.js CHANGED
@@ -3,21 +3,37 @@ var __getProtoOf = Object.getPrototypeOf;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ function __accessProp(key) {
7
+ return this[key];
8
+ }
9
+ var __toESMCache_node;
10
+ var __toESMCache_esm;
6
11
  var __toESM = (mod, isNodeMode, target) => {
12
+ var canCache = mod != null && typeof mod === "object";
13
+ if (canCache) {
14
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
15
+ var cached = cache.get(mod);
16
+ if (cached)
17
+ return cached;
18
+ }
7
19
  target = mod != null ? __create(__getProtoOf(mod)) : {};
8
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
9
- for (let key of __getOwnPropNames(mod))
10
- if (!__hasOwnProp.call(to, key))
11
- __defProp(to, key, {
12
- get: () => mod[key],
13
- enumerable: true
14
- });
20
+ const to = isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
21
+ if (mod && typeof mod === "object" || typeof mod === "function") {
22
+ for (let key of __getOwnPropNames(mod))
23
+ if (!__hasOwnProp.call(to, key))
24
+ __defProp(to, key, {
25
+ get: __accessProp.bind(mod, key),
26
+ enumerable: true
27
+ });
28
+ }
29
+ if (canCache)
30
+ cache.set(mod, to);
15
31
  return to;
16
32
  };
17
33
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
18
34
 
19
35
  // node_modules/picomatch/lib/constants.js
20
- var require_constants = __commonJS((exports, module) => {
36
+ var require_constants = __commonJS(function(exports, module) {
21
37
  var WIN_SLASH = "\\\\/";
22
38
  var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
23
39
  var DEFAULT_MAX_EXTGLOB_RECURSION = 0;
@@ -162,7 +178,7 @@ var require_constants = __commonJS((exports, module) => {
162
178
  });
163
179
 
164
180
  // node_modules/picomatch/lib/utils.js
165
- var require_utils = __commonJS((exports) => {
181
+ var require_utils = __commonJS(function(exports) {
166
182
  var {
167
183
  REGEX_BACKSLASH,
168
184
  REGEX_REMOVE_BACKSLASH,
@@ -223,7 +239,7 @@ var require_utils = __commonJS((exports) => {
223
239
  });
224
240
 
225
241
  // node_modules/picomatch/lib/scan.js
226
- var require_scan = __commonJS((exports, module) => {
242
+ var require_scan = __commonJS(function(exports, module) {
227
243
  var utils = require_utils();
228
244
  var {
229
245
  CHAR_ASTERISK,
@@ -511,21 +527,21 @@ var require_scan = __commonJS((exports, module) => {
511
527
  if (opts.parts === true || opts.tokens === true) {
512
528
  let prevIndex;
513
529
  for (let idx = 0;idx < slashes.length; idx++) {
514
- const n2 = prevIndex !== undefined ? prevIndex + 1 : start;
530
+ const n = prevIndex !== undefined ? prevIndex + 1 : start;
515
531
  const i = slashes[idx];
516
- const value2 = input.slice(n2, i);
532
+ const value = input.slice(n, i);
517
533
  if (opts.tokens) {
518
534
  if (idx === 0 && start !== 0) {
519
535
  tokens[idx].isPrefix = true;
520
536
  tokens[idx].value = prefix;
521
537
  } else {
522
- tokens[idx].value = value2;
538
+ tokens[idx].value = value;
523
539
  }
524
540
  depth(tokens[idx]);
525
541
  state.maxDepth += tokens[idx].depth;
526
542
  }
527
543
  if (i >= start) {
528
- parts.push(value2);
544
+ parts.push(value);
529
545
  prevIndex = i;
530
546
  }
531
547
  }
@@ -546,7 +562,7 @@ var require_scan = __commonJS((exports, module) => {
546
562
  });
547
563
 
548
564
  // node_modules/picomatch/lib/parse.js
549
- var require_parse = __commonJS((exports, module) => {
565
+ var require_parse = __commonJS(function(exports, module) {
550
566
  var constants = require_constants();
551
567
  var utils = require_utils();
552
568
  var {
@@ -733,7 +749,7 @@ var require_parse = __commonJS((exports, module) => {
733
749
  if (!match || match.type !== "*") {
734
750
  return;
735
751
  }
736
- const branches = splitTopLevel(match.body).map((branch2) => branch2.trim());
752
+ const branches = splitTopLevel(match.body).map((branch) => branch.trim());
737
753
  if (branches.length !== 1) {
738
754
  return;
739
755
  }
@@ -796,7 +812,7 @@ var require_parse = __commonJS((exports, module) => {
796
812
  }
797
813
  return { risky: false };
798
814
  };
799
- var parse2 = (input, options) => {
815
+ var parse = (input, options) => {
800
816
  if (typeof input !== "string") {
801
817
  throw new TypeError("Expected a string");
802
818
  }
@@ -826,8 +842,8 @@ var require_parse = __commonJS((exports, module) => {
826
842
  STAR,
827
843
  START_ANCHOR
828
844
  } = PLATFORM_CHARS;
829
- const globstar = (opts2) => {
830
- return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
845
+ const globstar = (opts) => {
846
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
831
847
  };
832
848
  const nodot = opts.dot ? "" : NO_DOT;
833
849
  const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
@@ -866,8 +882,8 @@ var require_parse = __commonJS((exports, module) => {
866
882
  const peek = state.peek = (n = 1) => input[state.index + n];
867
883
  const advance = state.advance = () => input[++state.index] || "";
868
884
  const remaining = () => input.slice(state.index + 1);
869
- const consume = (value2 = "", num = 0) => {
870
- state.consumed += value2;
885
+ const consume = (value = "", num = 0) => {
886
+ state.consumed += value;
871
887
  state.index += num;
872
888
  };
873
889
  const append = (token) => {
@@ -922,8 +938,8 @@ var require_parse = __commonJS((exports, module) => {
922
938
  tokens.push(tok);
923
939
  prev = tok;
924
940
  };
925
- const extglobOpen = (type, value2) => {
926
- const token = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" };
941
+ const extglobOpen = (type, value) => {
942
+ const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: "" };
927
943
  token.prev = prev;
928
944
  token.parens = state.parens;
929
945
  token.output = state.output;
@@ -931,7 +947,7 @@ var require_parse = __commonJS((exports, module) => {
931
947
  token.tokensIndex = tokens.length;
932
948
  const output = (opts.capture ? "(" : "") + token.open;
933
949
  increment("parens");
934
- push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
950
+ push({ type, value, output: state.output ? "" : ONE_CHAR });
935
951
  push({ type: "paren", extglob: true, value: advance(), output });
936
952
  extglobs.push(token);
937
953
  };
@@ -967,7 +983,7 @@ var require_parse = __commonJS((exports, module) => {
967
983
  output = token.close = `)$))${extglobStar}`;
968
984
  }
969
985
  if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
970
- const expression = parse2(rest, { ...options, fastpaths: false }).output;
986
+ const expression = parse(rest, { ...options, fastpaths: false }).output;
971
987
  output = token.close = `)${expression})${extglobStar})`;
972
988
  }
973
989
  if (token.prev.type === "bos") {
@@ -1065,8 +1081,8 @@ var require_parse = __commonJS((exports, module) => {
1065
1081
  if (inner.includes(":")) {
1066
1082
  const idx = prev.value.lastIndexOf("[");
1067
1083
  const pre = prev.value.slice(0, idx);
1068
- const rest2 = prev.value.slice(idx + 2);
1069
- const posix = POSIX_REGEX_SOURCE[rest2];
1084
+ const rest = prev.value.slice(idx + 2);
1085
+ const posix = POSIX_REGEX_SOURCE[rest];
1070
1086
  if (posix) {
1071
1087
  prev.value = pre + posix;
1072
1088
  state.backtrack = true;
@@ -1494,7 +1510,7 @@ var require_parse = __commonJS((exports, module) => {
1494
1510
  }
1495
1511
  return state;
1496
1512
  };
1497
- parse2.fastpaths = (input, options) => {
1513
+ parse.fastpaths = (input, options) => {
1498
1514
  const opts = { ...options };
1499
1515
  const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
1500
1516
  const len = input.length;
@@ -1521,10 +1537,10 @@ var require_parse = __commonJS((exports, module) => {
1521
1537
  if (opts.capture) {
1522
1538
  star = `(${star})`;
1523
1539
  }
1524
- const globstar = (opts2) => {
1525
- if (opts2.noglobstar === true)
1540
+ const globstar = (opts) => {
1541
+ if (opts.noglobstar === true)
1526
1542
  return star;
1527
- return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
1543
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
1528
1544
  };
1529
1545
  const create = (str) => {
1530
1546
  switch (str) {
@@ -1548,10 +1564,10 @@ var require_parse = __commonJS((exports, module) => {
1548
1564
  const match = /^(.*?)\.(\w+)$/.exec(str);
1549
1565
  if (!match)
1550
1566
  return;
1551
- const source2 = create(match[1]);
1552
- if (!source2)
1567
+ const source = create(match[1]);
1568
+ if (!source)
1553
1569
  return;
1554
- return source2 + DOT_LITERAL + match[2];
1570
+ return source + DOT_LITERAL + match[2];
1555
1571
  }
1556
1572
  }
1557
1573
  };
@@ -1562,13 +1578,13 @@ var require_parse = __commonJS((exports, module) => {
1562
1578
  }
1563
1579
  return source;
1564
1580
  };
1565
- module.exports = parse2;
1581
+ module.exports = parse;
1566
1582
  });
1567
1583
 
1568
1584
  // node_modules/picomatch/lib/picomatch.js
1569
- var require_picomatch = __commonJS((exports, module) => {
1585
+ var require_picomatch = __commonJS(function(exports, module) {
1570
1586
  var scan = require_scan();
1571
- var parse2 = require_parse();
1587
+ var parse = require_parse();
1572
1588
  var utils = require_utils();
1573
1589
  var constants = require_constants();
1574
1590
  var isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
@@ -1577,9 +1593,9 @@ var require_picomatch = __commonJS((exports, module) => {
1577
1593
  const fns = glob.map((input) => picomatch(input, options, returnState));
1578
1594
  const arrayMatcher = (str) => {
1579
1595
  for (const isMatch of fns) {
1580
- const state2 = isMatch(str);
1581
- if (state2)
1582
- return state2;
1596
+ const state = isMatch(str);
1597
+ if (state)
1598
+ return state;
1583
1599
  }
1584
1600
  return false;
1585
1601
  };
@@ -1591,17 +1607,17 @@ var require_picomatch = __commonJS((exports, module) => {
1591
1607
  }
1592
1608
  const opts = options || {};
1593
1609
  const posix = opts.windows;
1594
- const regex2 = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
1595
- const state = regex2.state;
1596
- delete regex2.state;
1610
+ const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
1611
+ const state = regex.state;
1612
+ delete regex.state;
1597
1613
  let isIgnored = () => false;
1598
1614
  if (opts.ignore) {
1599
1615
  const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
1600
1616
  isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
1601
1617
  }
1602
1618
  const matcher = (input, returnObject = false) => {
1603
- const { isMatch, match, output } = picomatch.test(input, regex2, options, { glob, posix });
1604
- const result = { glob, state, regex: regex2, posix, input, output, match, isMatch };
1619
+ const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });
1620
+ const result = { glob, state, regex, posix, input, output, match, isMatch };
1605
1621
  if (typeof opts.onResult === "function") {
1606
1622
  opts.onResult(result);
1607
1623
  }
@@ -1626,7 +1642,7 @@ var require_picomatch = __commonJS((exports, module) => {
1626
1642
  }
1627
1643
  return matcher;
1628
1644
  };
1629
- picomatch.test = (input, regex2, options, { glob, posix } = {}) => {
1645
+ picomatch.test = (input, regex, options, { glob, posix } = {}) => {
1630
1646
  if (typeof input !== "string") {
1631
1647
  throw new TypeError("Expected input to be a string");
1632
1648
  }
@@ -1634,31 +1650,31 @@ var require_picomatch = __commonJS((exports, module) => {
1634
1650
  return { isMatch: false, output: "" };
1635
1651
  }
1636
1652
  const opts = options || {};
1637
- const format3 = opts.format || (posix ? utils.toPosixSlashes : null);
1653
+ const format = opts.format || (posix ? utils.toPosixSlashes : null);
1638
1654
  let match = input === glob;
1639
- let output = match && format3 ? format3(input) : input;
1655
+ let output = match && format ? format(input) : input;
1640
1656
  if (match === false) {
1641
- output = format3 ? format3(input) : input;
1657
+ output = format ? format(input) : input;
1642
1658
  match = output === glob;
1643
1659
  }
1644
1660
  if (match === false || opts.capture === true) {
1645
1661
  if (opts.matchBase === true || opts.basename === true) {
1646
- match = picomatch.matchBase(input, regex2, options, posix);
1662
+ match = picomatch.matchBase(input, regex, options, posix);
1647
1663
  } else {
1648
- match = regex2.exec(output);
1664
+ match = regex.exec(output);
1649
1665
  }
1650
1666
  }
1651
1667
  return { isMatch: Boolean(match), match, output };
1652
1668
  };
1653
1669
  picomatch.matchBase = (input, glob, options, posix = options && options.windows) => {
1654
- const regex2 = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
1655
- return regex2.test(utils.basename(input, { windows: posix }));
1670
+ const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
1671
+ return regex.test(utils.basename(input, { windows: posix }));
1656
1672
  };
1657
1673
  picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
1658
1674
  picomatch.parse = (pattern, options) => {
1659
1675
  if (Array.isArray(pattern))
1660
1676
  return pattern.map((p) => picomatch.parse(p, options));
1661
- return parse2(pattern, { ...options, fastpaths: false });
1677
+ return parse(pattern, { ...options, fastpaths: false });
1662
1678
  };
1663
1679
  picomatch.scan = (input, options) => scan(input, options);
1664
1680
  picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
@@ -1672,11 +1688,11 @@ var require_picomatch = __commonJS((exports, module) => {
1672
1688
  if (state && state.negated === true) {
1673
1689
  source = `^(?!${source}).*$`;
1674
1690
  }
1675
- const regex2 = picomatch.toRegex(source, options);
1691
+ const regex = picomatch.toRegex(source, options);
1676
1692
  if (returnState === true) {
1677
- regex2.state = state;
1693
+ regex.state = state;
1678
1694
  }
1679
- return regex2;
1695
+ return regex;
1680
1696
  };
1681
1697
  picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
1682
1698
  if (!input || typeof input !== "string") {
@@ -1684,10 +1700,10 @@ var require_picomatch = __commonJS((exports, module) => {
1684
1700
  }
1685
1701
  let parsed = { negated: false, fastpaths: true };
1686
1702
  if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
1687
- parsed.output = parse2.fastpaths(input, options);
1703
+ parsed.output = parse.fastpaths(input, options);
1688
1704
  }
1689
1705
  if (!parsed.output) {
1690
- parsed = parse2(input, options);
1706
+ parsed = parse(input, options);
1691
1707
  }
1692
1708
  return picomatch.compileRe(parsed, options, returnOutput, returnState);
1693
1709
  };
@@ -1706,7 +1722,7 @@ var require_picomatch = __commonJS((exports, module) => {
1706
1722
  });
1707
1723
 
1708
1724
  // node_modules/shell-quote/quote.js
1709
- var require_quote = __commonJS((exports, module) => {
1725
+ var require_quote = __commonJS(function(exports, module) {
1710
1726
  var OPS = [
1711
1727
  "||",
1712
1728
  "&&",
@@ -1788,7 +1804,7 @@ var require_quote = __commonJS((exports, module) => {
1788
1804
  });
1789
1805
 
1790
1806
  // node_modules/shell-quote/parse.js
1791
- var require_parse2 = __commonJS((exports, module) => {
1807
+ var require_parse2 = __commonJS(function(exports, module) {
1792
1808
  var CONTROL = "(?:" + [
1793
1809
  "\\|\\|",
1794
1810
  "\\&(?:\\&|>>?)",
@@ -1871,8 +1887,8 @@ var require_parse2 = __commonJS((exports, module) => {
1871
1887
  function expandAnsiC(body) {
1872
1888
  return body.replace(ansiCEscape, expandAnsiCEscape).split("\x00")[0];
1873
1889
  }
1874
- function closesAnsiC(s, i2) {
1875
- ansiCAt.lastIndex = i2;
1890
+ function closesAnsiC(s, i) {
1891
+ ansiCAt.lastIndex = i;
1876
1892
  return !!ansiCAt.exec(s)[1];
1877
1893
  }
1878
1894
  function parseInternal(string, env, opts) {
@@ -1911,19 +1927,19 @@ var require_parse2 = __commonJS((exports, module) => {
1911
1927
  var sawQuote = false;
1912
1928
  var pendingNw = null;
1913
1929
  var isGlob = false;
1914
- var i2;
1930
+ var i;
1915
1931
  function parseEnvVar() {
1916
- i2 += 1;
1932
+ i += 1;
1917
1933
  var varend;
1918
1934
  var varname;
1919
- var char = s.charAt(i2);
1935
+ var char = s.charAt(i);
1920
1936
  if (char === "{") {
1921
- i2 += 1;
1922
- if (s.charAt(i2) === "}") {
1923
- throw new Error("Bad substitution: " + s.slice(i2 - 2, i2 + 1));
1937
+ i += 1;
1938
+ if (s.charAt(i) === "}") {
1939
+ throw new Error("Bad substitution: " + s.slice(i - 2, i + 1));
1924
1940
  }
1925
1941
  var depth = 1;
1926
- varend = i2;
1942
+ varend = i;
1927
1943
  while (depth > 0 && varend < s.length) {
1928
1944
  if (s.charAt(varend) === "{" && s.charAt(varend - 1) === "$") {
1929
1945
  depth += 1;
@@ -1933,22 +1949,22 @@ var require_parse2 = __commonJS((exports, module) => {
1933
1949
  varend += 1;
1934
1950
  }
1935
1951
  if (depth !== 0) {
1936
- throw new Error("Bad substitution: " + s.slice(i2));
1952
+ throw new Error("Bad substitution: " + s.slice(i));
1937
1953
  }
1938
1954
  varend -= 1;
1939
- varname = s.slice(i2, varend);
1940
- i2 = varend;
1955
+ varname = s.slice(i, varend);
1956
+ i = varend;
1941
1957
  } else if (/[*@#?$!-]/.test(char)) {
1942
1958
  varname = char;
1943
1959
  } else {
1944
- var slicedFromI = s.slice(i2);
1960
+ var slicedFromI = s.slice(i);
1945
1961
  varend = slicedFromI.match(/[^\w\d_]/);
1946
1962
  if (!varend) {
1947
1963
  varname = slicedFromI;
1948
- i2 = s.length;
1964
+ i = s.length;
1949
1965
  } else {
1950
1966
  varname = slicedFromI.slice(0, varend.index);
1951
- i2 += varend.index - 1;
1967
+ i += varend.index - 1;
1952
1968
  }
1953
1969
  }
1954
1970
  return getVar(env, "", varname);
@@ -1971,8 +1987,8 @@ var require_parse2 = __commonJS((exports, module) => {
1971
1987
  }
1972
1988
  pendingNw = null;
1973
1989
  }
1974
- for (i2 = 0;i2 < s.length; i2++) {
1975
- var c = s.charAt(i2);
1990
+ for (i = 0;i < s.length; i++) {
1991
+ var c = s.charAt(i);
1976
1992
  if (ifs && c !== DS) {
1977
1993
  flushRun();
1978
1994
  }
@@ -1987,8 +2003,8 @@ var require_parse2 = __commonJS((exports, module) => {
1987
2003
  out += c;
1988
2004
  } else {
1989
2005
  if (c === BS) {
1990
- i2 += 1;
1991
- c = s.charAt(i2);
2006
+ i += 1;
2007
+ c = s.charAt(i);
1992
2008
  if (c === DQ || c === BS || c === DS) {
1993
2009
  out += c;
1994
2010
  } else {
@@ -2007,18 +2023,18 @@ var require_parse2 = __commonJS((exports, module) => {
2007
2023
  return { op: s };
2008
2024
  } else if (hash.test(c)) {
2009
2025
  commented = true;
2010
- var commentObj = { comment: string.slice(match.index + i2 + 1) };
2026
+ var commentObj = { comment: string.slice(match.index + i + 1) };
2011
2027
  if (out.length) {
2012
2028
  return [out, commentObj];
2013
2029
  }
2014
2030
  return [commentObj];
2015
2031
  } else if (c === BS) {
2016
2032
  esc = true;
2017
- } else if (c === DS && s.charAt(i2 + 1) === SQ && closesAnsiC(s, i2)) {
2033
+ } else if (c === DS && s.charAt(i + 1) === SQ && closesAnsiC(s, i)) {
2018
2034
  flushRun();
2019
2035
  sawQuote = true;
2020
- out += expandAnsiC(s.slice(i2 + 2, ansiCAt.lastIndex - 1));
2021
- i2 = ansiCAt.lastIndex - 1;
2036
+ out += expandAnsiC(s.slice(i + 2, ansiCAt.lastIndex - 1));
2037
+ i = ansiCAt.lastIndex - 1;
2022
2038
  } else if (c === DS) {
2023
2039
  var value = parseEnvVar();
2024
2040
  if (!ifs) {
@@ -2074,12 +2090,12 @@ var require_parse2 = __commonJS((exports, module) => {
2074
2090
  if (typeof env !== "function") {
2075
2091
  return mapped;
2076
2092
  }
2077
- return mapped.reduce(function(acc, s2) {
2078
- if (typeof s2 === "object") {
2079
- acc[acc.length] = s2;
2093
+ return mapped.reduce(function(acc, s) {
2094
+ if (typeof s === "object") {
2095
+ acc[acc.length] = s;
2080
2096
  return acc;
2081
2097
  }
2082
- var xs = s2.split(RegExp("(" + TOKEN + ".*?" + TOKEN + ")", "g"));
2098
+ var xs = s.split(RegExp("(" + TOKEN + ".*?" + TOKEN + ")", "g"));
2083
2099
  if (xs.length === 1) {
2084
2100
  acc[acc.length] = xs[0];
2085
2101
  return acc;
@@ -2431,8 +2447,8 @@ function validate(instance, schema, draft = "2019-09", lookup = dereference(sche
2431
2447
  }
2432
2448
  }
2433
2449
  if ($ref !== undefined) {
2434
- const uri2 = __absolute_ref__ || $ref;
2435
- const refSchema = lookup[uri2];
2450
+ const uri = __absolute_ref__ || $ref;
2451
+ const refSchema = lookup[uri];
2436
2452
  if (refSchema === undefined) {
2437
2453
  let message = `Unresolved $ref "${$ref}".`;
2438
2454
  if (__absolute_ref__ && __absolute_ref__ !== $ref) {
@@ -2783,10 +2799,10 @@ Known schemas:
2783
2799
  if (!stop && $patternProperties !== undefined) {
2784
2800
  const keywordLocation = `${schemaLocation}/patternProperties`;
2785
2801
  for (const pattern in $patternProperties) {
2786
- const regex2 = new RegExp(pattern, "u");
2802
+ const regex = new RegExp(pattern, "u");
2787
2803
  const subSchema = $patternProperties[pattern];
2788
2804
  for (const key in instance) {
2789
- if (!regex2.test(key)) {
2805
+ if (!regex.test(key)) {
2790
2806
  continue;
2791
2807
  }
2792
2808
  const subInstancePointer = `${instanceLocation}/${encodePointer(key)}`;
@@ -2920,16 +2936,16 @@ Known schemas:
2920
2936
  }
2921
2937
  }
2922
2938
  if (!stop && $additionalItems !== undefined) {
2923
- const keywordLocation2 = `${schemaLocation}/additionalItems`;
2939
+ const keywordLocation = `${schemaLocation}/additionalItems`;
2924
2940
  for (;i < length; i++) {
2925
- const result = validate(instance[i], $additionalItems, draft, lookup, shortCircuit, recursiveAnchor, `${instanceLocation}/${i}`, keywordLocation2);
2941
+ const result = validate(instance[i], $additionalItems, draft, lookup, shortCircuit, recursiveAnchor, `${instanceLocation}/${i}`, keywordLocation);
2926
2942
  evaluated[i] = true;
2927
2943
  if (!result.valid) {
2928
2944
  stop = shortCircuit;
2929
2945
  errors.push({
2930
2946
  instanceLocation,
2931
2947
  keyword: "additionalItems",
2932
- keywordLocation: keywordLocation2,
2948
+ keywordLocation,
2933
2949
  error: `Items did not match additional items schema.`
2934
2950
  }, ...result.errors);
2935
2951
  }
@@ -3354,16 +3370,16 @@ var $parse = require_parse2();
3354
3370
  var export_picomatch = import_posix.default;
3355
3371
 
3356
3372
  export {
3357
- resolve,
3358
- relative,
3359
- $quote as quote,
3360
- export_picomatch as picomatch,
3361
- $parse as parse,
3362
- normalize,
3363
- join,
3364
- isAbsolute,
3365
- extname,
3366
- dirname,
3373
+ Validator,
3367
3374
  basename,
3368
- Validator
3375
+ dirname,
3376
+ extname,
3377
+ isAbsolute,
3378
+ join,
3379
+ normalize,
3380
+ $parse as parse,
3381
+ export_picomatch as picomatch,
3382
+ $quote as quote,
3383
+ relative,
3384
+ resolve
3369
3385
  };