@skillrecordings/cli 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -424,8 +424,8 @@ var require_url_state_machine = __commonJS({
424
424
  function countSymbols(str2) {
425
425
  return punycode.ucs2.decode(str2).length;
426
426
  }
427
- function at(input2, idx) {
428
- const c = input2[idx];
427
+ function at(input3, idx) {
428
+ const c = input3[idx];
429
429
  return isNaN(c) ? void 0 : String.fromCodePoint(c);
430
430
  }
431
431
  function isASCIIDigit(c) {
@@ -487,16 +487,16 @@ var require_url_state_machine = __commonJS({
487
487
  return str2;
488
488
  }
489
489
  function utf8PercentDecode(str2) {
490
- const input2 = new Buffer(str2);
490
+ const input3 = new Buffer(str2);
491
491
  const output = [];
492
- for (let i = 0; i < input2.length; ++i) {
493
- if (input2[i] !== 37) {
494
- output.push(input2[i]);
495
- } else if (input2[i] === 37 && isASCIIHex(input2[i + 1]) && isASCIIHex(input2[i + 2])) {
496
- output.push(parseInt(input2.slice(i + 1, i + 3).toString(), 16));
492
+ for (let i = 0; i < input3.length; ++i) {
493
+ if (input3[i] !== 37) {
494
+ output.push(input3[i]);
495
+ } else if (input3[i] === 37 && isASCIIHex(input3[i + 1]) && isASCIIHex(input3[i + 2])) {
496
+ output.push(parseInt(input3.slice(i + 1, i + 3).toString(), 16));
497
497
  i += 2;
498
498
  } else {
499
- output.push(input2[i]);
499
+ output.push(input3[i]);
500
500
  }
501
501
  }
502
502
  return new Buffer(output).toString();
@@ -519,42 +519,42 @@ var require_url_state_machine = __commonJS({
519
519
  }
520
520
  return cStr;
521
521
  }
522
- function parseIPv4Number(input2) {
522
+ function parseIPv4Number(input3) {
523
523
  let R = 10;
524
- if (input2.length >= 2 && input2.charAt(0) === "0" && input2.charAt(1).toLowerCase() === "x") {
525
- input2 = input2.substring(2);
524
+ if (input3.length >= 2 && input3.charAt(0) === "0" && input3.charAt(1).toLowerCase() === "x") {
525
+ input3 = input3.substring(2);
526
526
  R = 16;
527
- } else if (input2.length >= 2 && input2.charAt(0) === "0") {
528
- input2 = input2.substring(1);
527
+ } else if (input3.length >= 2 && input3.charAt(0) === "0") {
528
+ input3 = input3.substring(1);
529
529
  R = 8;
530
530
  }
531
- if (input2 === "") {
531
+ if (input3 === "") {
532
532
  return 0;
533
533
  }
534
534
  const regex = R === 10 ? /[^0-9]/ : R === 16 ? /[^0-9A-Fa-f]/ : /[^0-7]/;
535
- if (regex.test(input2)) {
535
+ if (regex.test(input3)) {
536
536
  return failure;
537
537
  }
538
- return parseInt(input2, R);
538
+ return parseInt(input3, R);
539
539
  }
540
- function parseIPv4(input2) {
541
- const parts = input2.split(".");
540
+ function parseIPv4(input3) {
541
+ const parts = input3.split(".");
542
542
  if (parts[parts.length - 1] === "") {
543
543
  if (parts.length > 1) {
544
544
  parts.pop();
545
545
  }
546
546
  }
547
547
  if (parts.length > 4) {
548
- return input2;
548
+ return input3;
549
549
  }
550
550
  const numbers = [];
551
551
  for (const part of parts) {
552
552
  if (part === "") {
553
- return input2;
553
+ return input3;
554
554
  }
555
555
  const n = parseIPv4Number(part);
556
556
  if (n === failure) {
557
- return input2;
557
+ return input3;
558
558
  }
559
559
  numbers.push(n);
560
560
  }
@@ -586,25 +586,25 @@ var require_url_state_machine = __commonJS({
586
586
  }
587
587
  return output;
588
588
  }
589
- function parseIPv6(input2) {
589
+ function parseIPv6(input3) {
590
590
  const address = [0, 0, 0, 0, 0, 0, 0, 0];
591
591
  let pieceIndex = 0;
592
592
  let compress = null;
593
593
  let pointer = 0;
594
- input2 = punycode.ucs2.decode(input2);
595
- if (input2[pointer] === 58) {
596
- if (input2[pointer + 1] !== 58) {
594
+ input3 = punycode.ucs2.decode(input3);
595
+ if (input3[pointer] === 58) {
596
+ if (input3[pointer + 1] !== 58) {
597
597
  return failure;
598
598
  }
599
599
  pointer += 2;
600
600
  ++pieceIndex;
601
601
  compress = pieceIndex;
602
602
  }
603
- while (pointer < input2.length) {
603
+ while (pointer < input3.length) {
604
604
  if (pieceIndex === 8) {
605
605
  return failure;
606
606
  }
607
- if (input2[pointer] === 58) {
607
+ if (input3[pointer] === 58) {
608
608
  if (compress !== null) {
609
609
  return failure;
610
610
  }
@@ -615,12 +615,12 @@ var require_url_state_machine = __commonJS({
615
615
  }
616
616
  let value = 0;
617
617
  let length = 0;
618
- while (length < 4 && isASCIIHex(input2[pointer])) {
619
- value = value * 16 + parseInt(at(input2, pointer), 16);
618
+ while (length < 4 && isASCIIHex(input3[pointer])) {
619
+ value = value * 16 + parseInt(at(input3, pointer), 16);
620
620
  ++pointer;
621
621
  ++length;
622
622
  }
623
- if (input2[pointer] === 46) {
623
+ if (input3[pointer] === 46) {
624
624
  if (length === 0) {
625
625
  return failure;
626
626
  }
@@ -629,20 +629,20 @@ var require_url_state_machine = __commonJS({
629
629
  return failure;
630
630
  }
631
631
  let numbersSeen = 0;
632
- while (input2[pointer] !== void 0) {
632
+ while (input3[pointer] !== void 0) {
633
633
  let ipv4Piece = null;
634
634
  if (numbersSeen > 0) {
635
- if (input2[pointer] === 46 && numbersSeen < 4) {
635
+ if (input3[pointer] === 46 && numbersSeen < 4) {
636
636
  ++pointer;
637
637
  } else {
638
638
  return failure;
639
639
  }
640
640
  }
641
- if (!isASCIIDigit(input2[pointer])) {
641
+ if (!isASCIIDigit(input3[pointer])) {
642
642
  return failure;
643
643
  }
644
- while (isASCIIDigit(input2[pointer])) {
645
- const number = parseInt(at(input2, pointer));
644
+ while (isASCIIDigit(input3[pointer])) {
645
+ const number = parseInt(at(input3, pointer));
646
646
  if (ipv4Piece === null) {
647
647
  ipv4Piece = number;
648
648
  } else if (ipv4Piece === 0) {
@@ -665,12 +665,12 @@ var require_url_state_machine = __commonJS({
665
665
  return failure;
666
666
  }
667
667
  break;
668
- } else if (input2[pointer] === 58) {
668
+ } else if (input3[pointer] === 58) {
669
669
  ++pointer;
670
- if (input2[pointer] === void 0) {
670
+ if (input3[pointer] === void 0) {
671
671
  return failure;
672
672
  }
673
- } else if (input2[pointer] !== void 0) {
673
+ } else if (input3[pointer] !== void 0) {
674
674
  return failure;
675
675
  }
676
676
  address[pieceIndex] = value;
@@ -715,17 +715,17 @@ var require_url_state_machine = __commonJS({
715
715
  }
716
716
  return output;
717
717
  }
718
- function parseHost(input2, isSpecialArg) {
719
- if (input2[0] === "[") {
720
- if (input2[input2.length - 1] !== "]") {
718
+ function parseHost(input3, isSpecialArg) {
719
+ if (input3[0] === "[") {
720
+ if (input3[input3.length - 1] !== "]") {
721
721
  return failure;
722
722
  }
723
- return parseIPv6(input2.substring(1, input2.length - 1));
723
+ return parseIPv6(input3.substring(1, input3.length - 1));
724
724
  }
725
725
  if (!isSpecialArg) {
726
- return parseOpaqueHost(input2);
726
+ return parseOpaqueHost(input3);
727
727
  }
728
- const domain = utf8PercentDecode(input2);
728
+ const domain = utf8PercentDecode(input3);
729
729
  const asciiDomain = tr46.toASCII(domain, false, tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, false);
730
730
  if (asciiDomain === null) {
731
731
  return failure;
@@ -739,12 +739,12 @@ var require_url_state_machine = __commonJS({
739
739
  }
740
740
  return asciiDomain;
741
741
  }
742
- function parseOpaqueHost(input2) {
743
- if (containsForbiddenHostCodePointExcludingPercent(input2)) {
742
+ function parseOpaqueHost(input3) {
743
+ if (containsForbiddenHostCodePointExcludingPercent(input3)) {
744
744
  return failure;
745
745
  }
746
746
  let output = "";
747
- const decoded = punycode.ucs2.decode(input2);
747
+ const decoded = punycode.ucs2.decode(input3);
748
748
  for (let i = 0; i < decoded.length; ++i) {
749
749
  output += percentEncodeChar(decoded[i], isC0ControlPercentEncode);
750
750
  }
@@ -813,9 +813,9 @@ var require_url_state_machine = __commonJS({
813
813
  function isNormalizedWindowsDriveLetter(string) {
814
814
  return /^[A-Za-z]:$/.test(string);
815
815
  }
816
- function URLStateMachine(input2, base, encodingOverride, url, stateOverride) {
816
+ function URLStateMachine(input3, base, encodingOverride, url, stateOverride) {
817
817
  this.pointer = 0;
818
- this.input = input2;
818
+ this.input = input3;
819
819
  this.base = base || null;
820
820
  this.encodingOverride = encodingOverride || "utf-8";
821
821
  this.stateOverride = stateOverride;
@@ -1439,11 +1439,11 @@ var require_url_state_machine = __commonJS({
1439
1439
  return "null";
1440
1440
  }
1441
1441
  };
1442
- module.exports.basicURLParse = function(input2, options) {
1442
+ module.exports.basicURLParse = function(input3, options) {
1443
1443
  if (options === void 0) {
1444
1444
  options = {};
1445
1445
  }
1446
- const usm = new URLStateMachine(input2, options.baseURL, options.encodingOverride, options.url, options.stateOverride);
1446
+ const usm = new URLStateMachine(input3, options.baseURL, options.encodingOverride, options.url, options.stateOverride);
1447
1447
  if (usm.failure) {
1448
1448
  return "failure";
1449
1449
  }
@@ -1456,9 +1456,9 @@ var require_url_state_machine = __commonJS({
1456
1456
  url.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode);
1457
1457
  }
1458
1458
  };
1459
- module.exports.setThePassword = function(url, password) {
1459
+ module.exports.setThePassword = function(url, password2) {
1460
1460
  url.password = "";
1461
- const decoded = punycode.ucs2.decode(password);
1461
+ const decoded = punycode.ucs2.decode(password2);
1462
1462
  for (let i = 0; i < decoded.length; ++i) {
1463
1463
  url.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode);
1464
1464
  }
@@ -1468,11 +1468,11 @@ var require_url_state_machine = __commonJS({
1468
1468
  module.exports.serializeInteger = function(integer) {
1469
1469
  return String(integer);
1470
1470
  };
1471
- module.exports.parseURL = function(input2, options) {
1471
+ module.exports.parseURL = function(input3, options) {
1472
1472
  if (options === void 0) {
1473
1473
  options = {};
1474
1474
  }
1475
- return module.exports.basicURLParse(input2, { baseURL: options.baseURL, encodingOverride: options.encodingOverride });
1475
+ return module.exports.basicURLParse(input3, { baseURL: options.baseURL, encodingOverride: options.encodingOverride });
1476
1476
  };
1477
1477
  }
1478
1478
  });
@@ -1609,9 +1609,9 @@ var require_URL_impl = __commonJS({
1609
1609
  url.query = null;
1610
1610
  return;
1611
1611
  }
1612
- const input2 = v[0] === "?" ? v.substring(1) : v;
1612
+ const input3 = v[0] === "?" ? v.substring(1) : v;
1613
1613
  url.query = "";
1614
- usm.basicURLParse(input2, { url, stateOverride: "query" });
1614
+ usm.basicURLParse(input3, { url, stateOverride: "query" });
1615
1615
  }
1616
1616
  get hash() {
1617
1617
  if (this._url.fragment === null || this._url.fragment === "") {
@@ -1624,9 +1624,9 @@ var require_URL_impl = __commonJS({
1624
1624
  this._url.fragment = null;
1625
1625
  return;
1626
1626
  }
1627
- const input2 = v[0] === "#" ? v.substring(1) : v;
1627
+ const input3 = v[0] === "#" ? v.substring(1) : v;
1628
1628
  this._url.fragment = "";
1629
- usm.basicURLParse(input2, { url: this._url, stateOverride: "fragment" });
1629
+ usm.basicURLParse(input3, { url: this._url, stateOverride: "fragment" });
1630
1630
  }
1631
1631
  toJSON() {
1632
1632
  return this.href;
@@ -10860,23 +10860,23 @@ var require_infra = __commonJS({
10860
10860
  init_esm_shims();
10861
10861
  var assert = __require("assert");
10862
10862
  var { utf8DecodeBytes } = require_encoding2();
10863
- function collectASequenceOfCodePoints(condition, input2, position) {
10863
+ function collectASequenceOfCodePoints(condition, input3, position) {
10864
10864
  let result = "";
10865
- while (position.position < input2.length && condition(input2[position.position])) {
10866
- result += input2[position.position];
10865
+ while (position.position < input3.length && condition(input3[position.position])) {
10866
+ result += input3[position.position];
10867
10867
  position.position++;
10868
10868
  }
10869
10869
  return result;
10870
10870
  }
10871
- function collectASequenceOfCodePointsFast(char, input2, position) {
10872
- const idx = input2.indexOf(char, position.position);
10871
+ function collectASequenceOfCodePointsFast(char, input3, position) {
10872
+ const idx = input3.indexOf(char, position.position);
10873
10873
  const start = position.position;
10874
10874
  if (idx === -1) {
10875
- position.position = input2.length;
10876
- return input2.slice(start);
10875
+ position.position = input3.length;
10876
+ return input3.slice(start);
10877
10877
  }
10878
10878
  position.position = idx;
10879
- return input2.slice(start, position.position);
10879
+ return input3.slice(start, position.position);
10880
10880
  }
10881
10881
  var ASCII_WHITESPACE_REPLACE_REGEX = /[\u0009\u000A\u000C\u000D\u0020]/g;
10882
10882
  function forgivingBase64(data2) {
@@ -10906,10 +10906,10 @@ var require_infra = __commonJS({
10906
10906
  char === 13 || // \r
10907
10907
  char === 32;
10908
10908
  }
10909
- function isomorphicDecode(input2) {
10910
- const length = input2.length;
10909
+ function isomorphicDecode(input3) {
10910
+ const length = input3.length;
10911
10911
  if ((2 << 15) - 1 > length) {
10912
- return String.fromCharCode.apply(null, input2);
10912
+ return String.fromCharCode.apply(null, input3);
10913
10913
  }
10914
10914
  let result = "";
10915
10915
  let i = 0;
@@ -10918,14 +10918,14 @@ var require_infra = __commonJS({
10918
10918
  if (i + addition > length) {
10919
10919
  addition = length - i;
10920
10920
  }
10921
- result += String.fromCharCode.apply(null, input2.subarray(i, i += addition));
10921
+ result += String.fromCharCode.apply(null, input3.subarray(i, i += addition));
10922
10922
  }
10923
10923
  return result;
10924
10924
  }
10925
10925
  var invalidIsomorphicEncodeValueRegex = /[^\x00-\xFF]/;
10926
- function isomorphicEncode(input2) {
10927
- assert(!invalidIsomorphicEncodeValueRegex.test(input2));
10928
- return input2;
10926
+ function isomorphicEncode(input3) {
10927
+ assert(!invalidIsomorphicEncodeValueRegex.test(input3));
10928
+ return input3;
10929
10929
  }
10930
10930
  function parseJSONFromBytes(bytes) {
10931
10931
  return JSON.parse(utf8DecodeBytes(bytes));
@@ -10980,21 +10980,21 @@ var require_data_url = __commonJS({
10980
10980
  var HTTP_QUOTED_STRING_TOKENS = /^[\u0009\u0020-\u007E\u0080-\u00FF]+$/u;
10981
10981
  function dataURLProcessor(dataURL) {
10982
10982
  assert(dataURL.protocol === "data:");
10983
- let input2 = URLSerializer(dataURL, true);
10984
- input2 = input2.slice(5);
10983
+ let input3 = URLSerializer(dataURL, true);
10984
+ input3 = input3.slice(5);
10985
10985
  const position = { position: 0 };
10986
10986
  let mimeType = collectASequenceOfCodePointsFast(
10987
10987
  ",",
10988
- input2,
10988
+ input3,
10989
10989
  position
10990
10990
  );
10991
10991
  const mimeTypeLength = mimeType.length;
10992
10992
  mimeType = removeASCIIWhitespace(mimeType, true, true);
10993
- if (position.position >= input2.length) {
10993
+ if (position.position >= input3.length) {
10994
10994
  return "failure";
10995
10995
  }
10996
10996
  position.position++;
10997
- const encodedBody = input2.slice(mimeTypeLength + 1);
10997
+ const encodedBody = input3.slice(mimeTypeLength + 1);
10998
10998
  let body = stringPercentDecode(encodedBody);
10999
10999
  if (/;(?:\u0020*)base64$/ui.test(mimeType)) {
11000
11000
  const stringBody = isomorphicDecode(body);
@@ -11027,8 +11027,8 @@ var require_data_url = __commonJS({
11027
11027
  }
11028
11028
  return serialized;
11029
11029
  }
11030
- function stringPercentDecode(input2) {
11031
- const bytes = encoder.encode(input2);
11030
+ function stringPercentDecode(input3) {
11031
+ const bytes = encoder.encode(input3);
11032
11032
  return percentDecode(bytes);
11033
11033
  }
11034
11034
  function isHexCharByte(byte) {
@@ -11040,43 +11040,43 @@ var require_data_url = __commonJS({
11040
11040
  byte >= 48 && byte <= 57 ? byte - 48 : (byte & 223) - 55
11041
11041
  );
11042
11042
  }
11043
- function percentDecode(input2) {
11044
- const length = input2.length;
11043
+ function percentDecode(input3) {
11044
+ const length = input3.length;
11045
11045
  const output = new Uint8Array(length);
11046
11046
  let j = 0;
11047
11047
  let i = 0;
11048
11048
  while (i < length) {
11049
- const byte = input2[i];
11049
+ const byte = input3[i];
11050
11050
  if (byte !== 37) {
11051
11051
  output[j++] = byte;
11052
- } else if (byte === 37 && !(isHexCharByte(input2[i + 1]) && isHexCharByte(input2[i + 2]))) {
11052
+ } else if (byte === 37 && !(isHexCharByte(input3[i + 1]) && isHexCharByte(input3[i + 2]))) {
11053
11053
  output[j++] = 37;
11054
11054
  } else {
11055
- output[j++] = hexByteToNumber(input2[i + 1]) << 4 | hexByteToNumber(input2[i + 2]);
11055
+ output[j++] = hexByteToNumber(input3[i + 1]) << 4 | hexByteToNumber(input3[i + 2]);
11056
11056
  i += 2;
11057
11057
  }
11058
11058
  ++i;
11059
11059
  }
11060
11060
  return length === j ? output : output.subarray(0, j);
11061
11061
  }
11062
- function parseMIMEType(input2) {
11063
- input2 = removeHTTPWhitespace(input2, true, true);
11062
+ function parseMIMEType(input3) {
11063
+ input3 = removeHTTPWhitespace(input3, true, true);
11064
11064
  const position = { position: 0 };
11065
11065
  const type = collectASequenceOfCodePointsFast(
11066
11066
  "/",
11067
- input2,
11067
+ input3,
11068
11068
  position
11069
11069
  );
11070
11070
  if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) {
11071
11071
  return "failure";
11072
11072
  }
11073
- if (position.position >= input2.length) {
11073
+ if (position.position >= input3.length) {
11074
11074
  return "failure";
11075
11075
  }
11076
11076
  position.position++;
11077
11077
  let subtype = collectASequenceOfCodePointsFast(
11078
11078
  ";",
11079
- input2,
11079
+ input3,
11080
11080
  position
11081
11081
  );
11082
11082
  subtype = removeHTTPWhitespace(subtype, false, true);
@@ -11093,41 +11093,41 @@ var require_data_url = __commonJS({
11093
11093
  // https://mimesniff.spec.whatwg.org/#mime-type-essence
11094
11094
  essence: `${typeLowercase}/${subtypeLowercase}`
11095
11095
  };
11096
- while (position.position < input2.length) {
11096
+ while (position.position < input3.length) {
11097
11097
  position.position++;
11098
11098
  collectASequenceOfCodePoints(
11099
11099
  // https://fetch.spec.whatwg.org/#http-whitespace
11100
11100
  (char) => HTTP_WHITESPACE_REGEX.test(char),
11101
- input2,
11101
+ input3,
11102
11102
  position
11103
11103
  );
11104
11104
  let parameterName = collectASequenceOfCodePoints(
11105
11105
  (char) => char !== ";" && char !== "=",
11106
- input2,
11106
+ input3,
11107
11107
  position
11108
11108
  );
11109
11109
  parameterName = parameterName.toLowerCase();
11110
- if (position.position < input2.length) {
11111
- if (input2[position.position] === ";") {
11110
+ if (position.position < input3.length) {
11111
+ if (input3[position.position] === ";") {
11112
11112
  continue;
11113
11113
  }
11114
11114
  position.position++;
11115
11115
  }
11116
- if (position.position >= input2.length) {
11116
+ if (position.position >= input3.length) {
11117
11117
  break;
11118
11118
  }
11119
11119
  let parameterValue = null;
11120
- if (input2[position.position] === '"') {
11121
- parameterValue = collectAnHTTPQuotedString(input2, position, true);
11120
+ if (input3[position.position] === '"') {
11121
+ parameterValue = collectAnHTTPQuotedString(input3, position, true);
11122
11122
  collectASequenceOfCodePointsFast(
11123
11123
  ";",
11124
- input2,
11124
+ input3,
11125
11125
  position
11126
11126
  );
11127
11127
  } else {
11128
11128
  parameterValue = collectASequenceOfCodePointsFast(
11129
11129
  ";",
11130
- input2,
11130
+ input3,
11131
11131
  position
11132
11132
  );
11133
11133
  parameterValue = removeHTTPWhitespace(parameterValue, false, true);
@@ -11141,28 +11141,28 @@ var require_data_url = __commonJS({
11141
11141
  }
11142
11142
  return mimeType;
11143
11143
  }
11144
- function collectAnHTTPQuotedString(input2, position, extractValue = false) {
11144
+ function collectAnHTTPQuotedString(input3, position, extractValue = false) {
11145
11145
  const positionStart = position.position;
11146
11146
  let value = "";
11147
- assert(input2[position.position] === '"');
11147
+ assert(input3[position.position] === '"');
11148
11148
  position.position++;
11149
11149
  while (true) {
11150
11150
  value += collectASequenceOfCodePoints(
11151
11151
  (char) => char !== '"' && char !== "\\",
11152
- input2,
11152
+ input3,
11153
11153
  position
11154
11154
  );
11155
- if (position.position >= input2.length) {
11155
+ if (position.position >= input3.length) {
11156
11156
  break;
11157
11157
  }
11158
- const quoteOrBackslash = input2[position.position];
11158
+ const quoteOrBackslash = input3[position.position];
11159
11159
  position.position++;
11160
11160
  if (quoteOrBackslash === "\\") {
11161
- if (position.position >= input2.length) {
11161
+ if (position.position >= input3.length) {
11162
11162
  value += "\\";
11163
11163
  break;
11164
11164
  }
11165
- value += input2[position.position];
11165
+ value += input3[position.position];
11166
11166
  position.position++;
11167
11167
  } else {
11168
11168
  assert(quoteOrBackslash === '"');
@@ -11172,7 +11172,7 @@ var require_data_url = __commonJS({
11172
11172
  if (extractValue) {
11173
11173
  return value;
11174
11174
  }
11175
- return input2.slice(positionStart, position.position);
11175
+ return input3.slice(positionStart, position.position);
11176
11176
  }
11177
11177
  function serializeAMimeType(mimeType) {
11178
11178
  assert(mimeType !== "failure");
@@ -12609,27 +12609,27 @@ var require_util2 = __commonJS({
12609
12609
  return mimeType;
12610
12610
  }
12611
12611
  function gettingDecodingSplitting(value) {
12612
- const input2 = value;
12612
+ const input3 = value;
12613
12613
  const position = { position: 0 };
12614
12614
  const values = [];
12615
12615
  let temporaryValue = "";
12616
- while (position.position < input2.length) {
12616
+ while (position.position < input3.length) {
12617
12617
  temporaryValue += collectASequenceOfCodePoints(
12618
12618
  (char) => char !== '"' && char !== ",",
12619
- input2,
12619
+ input3,
12620
12620
  position
12621
12621
  );
12622
- if (position.position < input2.length) {
12623
- if (input2.charCodeAt(position.position) === 34) {
12622
+ if (position.position < input3.length) {
12623
+ if (input3.charCodeAt(position.position) === 34) {
12624
12624
  temporaryValue += collectAnHTTPQuotedString(
12625
- input2,
12625
+ input3,
12626
12626
  position
12627
12627
  );
12628
- if (position.position < input2.length) {
12628
+ if (position.position < input3.length) {
12629
12629
  continue;
12630
12630
  }
12631
12631
  } else {
12632
- assert(input2.charCodeAt(position.position) === 44);
12632
+ assert(input3.charCodeAt(position.position) === 44);
12633
12633
  position.position++;
12634
12634
  }
12635
12635
  }
@@ -12918,7 +12918,7 @@ var require_formdata_parser = __commonJS({
12918
12918
  }
12919
12919
  return true;
12920
12920
  }
12921
- function multipartFormDataParser(input2, mimeType) {
12921
+ function multipartFormDataParser(input3, mimeType) {
12922
12922
  assert(mimeType !== "failure" && mimeType.essence === "multipart/form-data");
12923
12923
  const boundaryString = mimeType.parameters.get("boundary");
12924
12924
  if (boundaryString === void 0) {
@@ -12927,40 +12927,40 @@ var require_formdata_parser = __commonJS({
12927
12927
  const boundary = Buffer.from(`--${boundaryString}`, "utf8");
12928
12928
  const entryList = [];
12929
12929
  const position = { position: 0 };
12930
- const firstBoundaryIndex = input2.indexOf(boundary);
12930
+ const firstBoundaryIndex = input3.indexOf(boundary);
12931
12931
  if (firstBoundaryIndex === -1) {
12932
12932
  throw parsingError("no boundary found in multipart body");
12933
12933
  }
12934
12934
  position.position = firstBoundaryIndex;
12935
12935
  while (true) {
12936
- if (input2.subarray(position.position, position.position + boundary.length).equals(boundary)) {
12936
+ if (input3.subarray(position.position, position.position + boundary.length).equals(boundary)) {
12937
12937
  position.position += boundary.length;
12938
12938
  } else {
12939
12939
  throw parsingError("expected a value starting with -- and the boundary");
12940
12940
  }
12941
- if (bufferStartsWith(input2, dd, position)) {
12941
+ if (bufferStartsWith(input3, dd, position)) {
12942
12942
  return entryList;
12943
12943
  }
12944
- if (input2[position.position] !== 13 || input2[position.position + 1] !== 10) {
12944
+ if (input3[position.position] !== 13 || input3[position.position + 1] !== 10) {
12945
12945
  throw parsingError("expected CRLF");
12946
12946
  }
12947
12947
  position.position += 2;
12948
- const result = parseMultipartFormDataHeaders(input2, position);
12948
+ const result = parseMultipartFormDataHeaders(input3, position);
12949
12949
  let { name, filename, contentType, encoding } = result;
12950
12950
  position.position += 2;
12951
12951
  let body;
12952
12952
  {
12953
- const boundaryIndex = input2.indexOf(boundary.subarray(2), position.position);
12953
+ const boundaryIndex = input3.indexOf(boundary.subarray(2), position.position);
12954
12954
  if (boundaryIndex === -1) {
12955
12955
  throw parsingError("expected boundary after body");
12956
12956
  }
12957
- body = input2.subarray(position.position, boundaryIndex - 4);
12957
+ body = input3.subarray(position.position, boundaryIndex - 4);
12958
12958
  position.position += body.length;
12959
12959
  if (encoding === "base64") {
12960
12960
  body = Buffer.from(body.toString(), "base64");
12961
12961
  }
12962
12962
  }
12963
- if (input2[position.position] !== 13 || input2[position.position + 1] !== 10) {
12963
+ if (input3[position.position] !== 13 || input3[position.position + 1] !== 10) {
12964
12964
  throw parsingError("expected CRLF");
12965
12965
  } else {
12966
12966
  position.position += 2;
@@ -12980,36 +12980,36 @@ var require_formdata_parser = __commonJS({
12980
12980
  entryList.push(makeEntry(name, value, filename));
12981
12981
  }
12982
12982
  }
12983
- function parseContentDispositionAttribute(input2, position) {
12984
- if (input2[position.position] === 59) {
12983
+ function parseContentDispositionAttribute(input3, position) {
12984
+ if (input3[position.position] === 59) {
12985
12985
  position.position++;
12986
12986
  }
12987
12987
  collectASequenceOfBytes(
12988
12988
  (char) => char === 32 || char === 9,
12989
- input2,
12989
+ input3,
12990
12990
  position
12991
12991
  );
12992
12992
  const attributeName = collectASequenceOfBytes(
12993
12993
  (char) => isToken(char) && char !== 61 && char !== 42,
12994
12994
  // not = or *
12995
- input2,
12995
+ input3,
12996
12996
  position
12997
12997
  );
12998
12998
  if (attributeName.length === 0) {
12999
12999
  return null;
13000
13000
  }
13001
13001
  const attrNameStr = attributeName.toString("ascii").toLowerCase();
13002
- const isExtended = input2[position.position] === 42;
13002
+ const isExtended = input3[position.position] === 42;
13003
13003
  if (isExtended) {
13004
13004
  position.position++;
13005
13005
  }
13006
- if (input2[position.position] !== 61) {
13006
+ if (input3[position.position] !== 61) {
13007
13007
  return null;
13008
13008
  }
13009
13009
  position.position++;
13010
13010
  collectASequenceOfBytes(
13011
13011
  (char) => char === 32 || char === 9,
13012
- input2,
13012
+ input3,
13013
13013
  position
13014
13014
  );
13015
13015
  let value;
@@ -13017,7 +13017,7 @@ var require_formdata_parser = __commonJS({
13017
13017
  const headerValue = collectASequenceOfBytes(
13018
13018
  (char) => char !== 32 && char !== 13 && char !== 10 && char !== 59,
13019
13019
  // not space, CRLF, or ;
13020
- input2,
13020
+ input3,
13021
13021
  position
13022
13022
  );
13023
13023
  if (headerValue[0] !== 117 && headerValue[0] !== 85 || // u or U
@@ -13028,15 +13028,15 @@ var require_formdata_parser = __commonJS({
13028
13028
  throw parsingError("unknown encoding, expected utf-8''");
13029
13029
  }
13030
13030
  value = decodeURIComponent(decoder.decode(headerValue.subarray(7)));
13031
- } else if (input2[position.position] === 34) {
13031
+ } else if (input3[position.position] === 34) {
13032
13032
  position.position++;
13033
13033
  const quotedValue = collectASequenceOfBytes(
13034
13034
  (char) => char !== 10 && char !== 13 && char !== 34,
13035
13035
  // not LF, CR, or "
13036
- input2,
13036
+ input3,
13037
13037
  position
13038
13038
  );
13039
- if (input2[position.position] !== 34) {
13039
+ if (input3[position.position] !== 34) {
13040
13040
  throw parsingError("Closing quote not found");
13041
13041
  }
13042
13042
  position.position++;
@@ -13045,20 +13045,20 @@ var require_formdata_parser = __commonJS({
13045
13045
  const tokenValue = collectASequenceOfBytes(
13046
13046
  (char) => isToken(char) && char !== 59,
13047
13047
  // not ;
13048
- input2,
13048
+ input3,
13049
13049
  position
13050
13050
  );
13051
13051
  value = decoder.decode(tokenValue);
13052
13052
  }
13053
13053
  return { name: attrNameStr, value };
13054
13054
  }
13055
- function parseMultipartFormDataHeaders(input2, position) {
13055
+ function parseMultipartFormDataHeaders(input3, position) {
13056
13056
  let name = null;
13057
13057
  let filename = null;
13058
13058
  let contentType = null;
13059
13059
  let encoding = null;
13060
13060
  while (true) {
13061
- if (input2[position.position] === 13 && input2[position.position + 1] === 10) {
13061
+ if (input3[position.position] === 13 && input3[position.position + 1] === 10) {
13062
13062
  if (name === null) {
13063
13063
  throw parsingError("header name is null");
13064
13064
  }
@@ -13066,20 +13066,20 @@ var require_formdata_parser = __commonJS({
13066
13066
  }
13067
13067
  let headerName = collectASequenceOfBytes(
13068
13068
  (char) => char !== 10 && char !== 13 && char !== 58,
13069
- input2,
13069
+ input3,
13070
13070
  position
13071
13071
  );
13072
13072
  headerName = removeChars(headerName, true, true, (char) => char === 9 || char === 32);
13073
13073
  if (!HTTP_TOKEN_CODEPOINTS.test(headerName.toString())) {
13074
13074
  throw parsingError("header name does not match the field-name token production");
13075
13075
  }
13076
- if (input2[position.position] !== 58) {
13076
+ if (input3[position.position] !== 58) {
13077
13077
  throw parsingError("expected :");
13078
13078
  }
13079
13079
  position.position++;
13080
13080
  collectASequenceOfBytes(
13081
13081
  (char) => char === 32 || char === 9,
13082
- input2,
13082
+ input3,
13083
13083
  position
13084
13084
  );
13085
13085
  switch (bufferToLowerCasedHeaderName(headerName)) {
@@ -13087,14 +13087,14 @@ var require_formdata_parser = __commonJS({
13087
13087
  name = filename = null;
13088
13088
  const dispositionType = collectASequenceOfBytes(
13089
13089
  (char) => isToken(char),
13090
- input2,
13090
+ input3,
13091
13091
  position
13092
13092
  );
13093
13093
  if (dispositionType.toString("ascii").toLowerCase() !== "form-data") {
13094
13094
  throw parsingError("expected form-data for content-disposition header");
13095
13095
  }
13096
- while (position.position < input2.length && input2[position.position] !== 13 && input2[position.position + 1] !== 10) {
13097
- const attribute = parseContentDispositionAttribute(input2, position);
13096
+ while (position.position < input3.length && input3[position.position] !== 13 && input3[position.position + 1] !== 10) {
13097
+ const attribute = parseContentDispositionAttribute(input3, position);
13098
13098
  if (!attribute) {
13099
13099
  break;
13100
13100
  }
@@ -13112,7 +13112,7 @@ var require_formdata_parser = __commonJS({
13112
13112
  case "content-type": {
13113
13113
  let headerValue = collectASequenceOfBytes(
13114
13114
  (char) => char !== 10 && char !== 13,
13115
- input2,
13115
+ input3,
13116
13116
  position
13117
13117
  );
13118
13118
  headerValue = removeChars(headerValue, false, true, (char) => char === 9 || char === 32);
@@ -13122,7 +13122,7 @@ var require_formdata_parser = __commonJS({
13122
13122
  case "content-transfer-encoding": {
13123
13123
  let headerValue = collectASequenceOfBytes(
13124
13124
  (char) => char !== 10 && char !== 13,
13125
- input2,
13125
+ input3,
13126
13126
  position
13127
13127
  );
13128
13128
  headerValue = removeChars(headerValue, false, true, (char) => char === 9 || char === 32);
@@ -13132,24 +13132,24 @@ var require_formdata_parser = __commonJS({
13132
13132
  default: {
13133
13133
  collectASequenceOfBytes(
13134
13134
  (char) => char !== 10 && char !== 13,
13135
- input2,
13135
+ input3,
13136
13136
  position
13137
13137
  );
13138
13138
  }
13139
13139
  }
13140
- if (input2[position.position] !== 13 && input2[position.position + 1] !== 10) {
13140
+ if (input3[position.position] !== 13 && input3[position.position + 1] !== 10) {
13141
13141
  throw parsingError("expected CRLF");
13142
13142
  } else {
13143
13143
  position.position += 2;
13144
13144
  }
13145
13145
  }
13146
13146
  }
13147
- function collectASequenceOfBytes(condition, input2, position) {
13147
+ function collectASequenceOfBytes(condition, input3, position) {
13148
13148
  let start = position.position;
13149
- while (start < input2.length && condition(input2[start])) {
13149
+ while (start < input3.length && condition(input3[start])) {
13150
13150
  ++start;
13151
13151
  }
13152
- return input2.subarray(position.position, position.position = start);
13152
+ return input3.subarray(position.position, position.position = start);
13153
13153
  }
13154
13154
  function removeChars(buf, leading, trailing, predicate) {
13155
13155
  let lead = 0;
@@ -16713,7 +16713,7 @@ var require_proxy_agent = __commonJS({
16713
16713
  const { proxyTunnel = true } = opts;
16714
16714
  super();
16715
16715
  const url = this.#getUrl(opts);
16716
- const { href, origin, port, protocol, username, password, hostname: proxyHostname } = url;
16716
+ const { href, origin, port, protocol, username, password: password2, hostname: proxyHostname } = url;
16717
16717
  this[kProxy] = { uri: href, protocol };
16718
16718
  this[kRequestTls] = opts.requestTls;
16719
16719
  this[kProxyTls] = opts.proxyTls;
@@ -16725,8 +16725,8 @@ var require_proxy_agent = __commonJS({
16725
16725
  this[kProxyHeaders]["proxy-authorization"] = `Basic ${opts.auth}`;
16726
16726
  } else if (opts.token) {
16727
16727
  this[kProxyHeaders]["proxy-authorization"] = opts.token;
16728
- } else if (username && password) {
16729
- this[kProxyHeaders]["proxy-authorization"] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString("base64")}`;
16728
+ } else if (username && password2) {
16729
+ this[kProxyHeaders]["proxy-authorization"] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password2)}`).toString("base64")}`;
16730
16730
  }
16731
16731
  const connect = buildConnector({ ...opts.proxyTls });
16732
16732
  this[kConnectEndpoint] = buildConnector({ ...opts.requestTls });
@@ -24851,39 +24851,39 @@ var require_request2 = __commonJS({
24851
24851
  #headers;
24852
24852
  #state;
24853
24853
  // https://fetch.spec.whatwg.org/#dom-request
24854
- constructor(input2, init3 = void 0) {
24854
+ constructor(input3, init3 = void 0) {
24855
24855
  webidl.util.markAsUncloneable(this);
24856
- if (input2 === kConstruct) {
24856
+ if (input3 === kConstruct) {
24857
24857
  return;
24858
24858
  }
24859
24859
  const prefix = "Request constructor";
24860
24860
  webidl.argumentLengthCheck(arguments, 1, prefix);
24861
- input2 = webidl.converters.RequestInfo(input2);
24861
+ input3 = webidl.converters.RequestInfo(input3);
24862
24862
  init3 = webidl.converters.RequestInit(init3);
24863
24863
  let request = null;
24864
24864
  let fallbackMode = null;
24865
24865
  const baseUrl = environmentSettingsObject.settingsObject.baseUrl;
24866
24866
  let signal = null;
24867
- if (typeof input2 === "string") {
24867
+ if (typeof input3 === "string") {
24868
24868
  this.#dispatcher = init3.dispatcher;
24869
24869
  let parsedURL;
24870
24870
  try {
24871
- parsedURL = new URL(input2, baseUrl);
24871
+ parsedURL = new URL(input3, baseUrl);
24872
24872
  } catch (err) {
24873
- throw new TypeError("Failed to parse URL from " + input2, { cause: err });
24873
+ throw new TypeError("Failed to parse URL from " + input3, { cause: err });
24874
24874
  }
24875
24875
  if (parsedURL.username || parsedURL.password) {
24876
24876
  throw new TypeError(
24877
- "Request cannot be constructed from a URL that includes credentials: " + input2
24877
+ "Request cannot be constructed from a URL that includes credentials: " + input3
24878
24878
  );
24879
24879
  }
24880
24880
  request = makeRequest({ urlList: [parsedURL] });
24881
24881
  fallbackMode = "cors";
24882
24882
  } else {
24883
- assert(webidl.is.Request(input2));
24884
- request = input2.#state;
24885
- signal = input2.#signal;
24886
- this.#dispatcher = init3.dispatcher || input2.#dispatcher;
24883
+ assert(webidl.is.Request(input3));
24884
+ request = input3.#state;
24885
+ signal = input3.#signal;
24886
+ this.#dispatcher = init3.dispatcher || input3.#dispatcher;
24887
24887
  }
24888
24888
  const origin = environmentSettingsObject.settingsObject.origin;
24889
24889
  let window2 = "client";
@@ -25075,7 +25075,7 @@ var require_request2 = __commonJS({
25075
25075
  fillHeaders(this.#headers, headers);
25076
25076
  }
25077
25077
  }
25078
- const inputBody = webidl.is.Request(input2) ? input2.#state.body : null;
25078
+ const inputBody = webidl.is.Request(input3) ? input3.#state.body : null;
25079
25079
  if ((init3.body != null || inputBody != null) && (request.method === "GET" || request.method === "HEAD")) {
25080
25080
  throw new TypeError("Request with GET/HEAD method cannot have body.");
25081
25081
  }
@@ -25104,7 +25104,7 @@ var require_request2 = __commonJS({
25104
25104
  }
25105
25105
  let finalBody = inputOrInitBody;
25106
25106
  if (initBody == null && inputBody != null) {
25107
- if (bodyUnusable(input2.#state)) {
25107
+ if (bodyUnusable(input3.#state)) {
25108
25108
  throw new TypeError(
25109
25109
  "Cannot construct a Request with a Request object that has already been used."
25110
25110
  );
@@ -25780,12 +25780,12 @@ var require_fetch = __commonJS({
25780
25780
  function handleFetchDone(response) {
25781
25781
  finalizeAndReportTiming(response, "fetch");
25782
25782
  }
25783
- function fetch5(input2, init3 = void 0) {
25783
+ function fetch5(input3, init3 = void 0) {
25784
25784
  webidl.argumentLengthCheck(arguments, 1, "globalThis.fetch");
25785
25785
  let p = createDeferredPromise();
25786
25786
  let requestObject;
25787
25787
  try {
25788
- requestObject = new Request3(input2, init3);
25788
+ requestObject = new Request3(input3, init3);
25789
25789
  } catch (e) {
25790
25790
  p.reject(e);
25791
25791
  return p.promise;
@@ -26383,8 +26383,8 @@ var require_fetch = __commonJS({
26383
26383
  let authorizationValue = null;
26384
26384
  if (hasAuthenticationEntry(httpRequest) && (httpRequest.useURLCredentials === void 0 || !includesCredentials(requestCurrentURL(httpRequest)))) {
26385
26385
  } else if (includesCredentials(requestCurrentURL(httpRequest)) && isAuthenticationFetch) {
26386
- const { username, password } = requestCurrentURL(httpRequest);
26387
- authorizationValue = `Basic ${Buffer.from(`${username}:${password}`).toString("base64")}`;
26386
+ const { username, password: password2 } = requestCurrentURL(httpRequest);
26387
+ authorizationValue = `Basic ${Buffer.from(`${username}:${password2}`).toString("base64")}`;
26388
26388
  }
26389
26389
  if (authorizationValue !== null) {
26390
26390
  httpRequest.headersList.append("Authorization", authorizationValue, false);
@@ -30801,25 +30801,25 @@ var require_utils3 = __commonJS({
30801
30801
  exports.asciiLowercase = (string) => {
30802
30802
  return string.replace(/[A-Z]/ug, (l) => l.toLowerCase());
30803
30803
  };
30804
- exports.collectAnHTTPQuotedString = (input2, position) => {
30804
+ exports.collectAnHTTPQuotedString = (input3, position) => {
30805
30805
  let value = "";
30806
30806
  position++;
30807
30807
  while (true) {
30808
- while (position < input2.length && input2[position] !== '"' && input2[position] !== "\\") {
30809
- value += input2[position];
30808
+ while (position < input3.length && input3[position] !== '"' && input3[position] !== "\\") {
30809
+ value += input3[position];
30810
30810
  ++position;
30811
30811
  }
30812
- if (position >= input2.length) {
30812
+ if (position >= input3.length) {
30813
30813
  break;
30814
30814
  }
30815
- const quoteOrBackslash = input2[position];
30815
+ const quoteOrBackslash = input3[position];
30816
30816
  ++position;
30817
30817
  if (quoteOrBackslash === "\\") {
30818
- if (position >= input2.length) {
30818
+ if (position >= input3.length) {
30819
30819
  value += "\\";
30820
30820
  break;
30821
30821
  }
30822
- value += input2[position];
30822
+ value += input3[position];
30823
30823
  ++position;
30824
30824
  } else {
30825
30825
  break;
@@ -30906,24 +30906,24 @@ var require_parser = __commonJS({
30906
30906
  asciiLowercase,
30907
30907
  collectAnHTTPQuotedString
30908
30908
  } = require_utils3();
30909
- module.exports = (input2) => {
30910
- input2 = removeLeadingAndTrailingHTTPWhitespace(input2);
30909
+ module.exports = (input3) => {
30910
+ input3 = removeLeadingAndTrailingHTTPWhitespace(input3);
30911
30911
  let position = 0;
30912
30912
  let type = "";
30913
- while (position < input2.length && input2[position] !== "/") {
30914
- type += input2[position];
30913
+ while (position < input3.length && input3[position] !== "/") {
30914
+ type += input3[position];
30915
30915
  ++position;
30916
30916
  }
30917
30917
  if (type.length === 0 || !solelyContainsHTTPTokenCodePoints(type)) {
30918
30918
  return null;
30919
30919
  }
30920
- if (position >= input2.length) {
30920
+ if (position >= input3.length) {
30921
30921
  return null;
30922
30922
  }
30923
30923
  ++position;
30924
30924
  let subtype = "";
30925
- while (position < input2.length && input2[position] !== ";") {
30926
- subtype += input2[position];
30925
+ while (position < input3.length && input3[position] !== ";") {
30926
+ subtype += input3[position];
30927
30927
  ++position;
30928
30928
  }
30929
30929
  subtype = removeTrailingHTTPWhitespace(subtype);
@@ -30935,33 +30935,33 @@ var require_parser = __commonJS({
30935
30935
  subtype: asciiLowercase(subtype),
30936
30936
  parameters: /* @__PURE__ */ new Map()
30937
30937
  };
30938
- while (position < input2.length) {
30938
+ while (position < input3.length) {
30939
30939
  ++position;
30940
- while (isHTTPWhitespaceChar(input2[position])) {
30940
+ while (isHTTPWhitespaceChar(input3[position])) {
30941
30941
  ++position;
30942
30942
  }
30943
30943
  let parameterName = "";
30944
- while (position < input2.length && input2[position] !== ";" && input2[position] !== "=") {
30945
- parameterName += input2[position];
30944
+ while (position < input3.length && input3[position] !== ";" && input3[position] !== "=") {
30945
+ parameterName += input3[position];
30946
30946
  ++position;
30947
30947
  }
30948
30948
  parameterName = asciiLowercase(parameterName);
30949
- if (position < input2.length) {
30950
- if (input2[position] === ";") {
30949
+ if (position < input3.length) {
30950
+ if (input3[position] === ";") {
30951
30951
  continue;
30952
30952
  }
30953
30953
  ++position;
30954
30954
  }
30955
30955
  let parameterValue = null;
30956
- if (input2[position] === '"') {
30957
- [parameterValue, position] = collectAnHTTPQuotedString(input2, position);
30958
- while (position < input2.length && input2[position] !== ";") {
30956
+ if (input3[position] === '"') {
30957
+ [parameterValue, position] = collectAnHTTPQuotedString(input3, position);
30958
+ while (position < input3.length && input3[position] !== ";") {
30959
30959
  ++position;
30960
30960
  }
30961
30961
  } else {
30962
30962
  parameterValue = "";
30963
- while (position < input2.length && input2[position] !== ";") {
30964
- parameterValue += input2[position];
30963
+ while (position < input3.length && input3[position] !== ";") {
30964
+ parameterValue += input3[position];
30965
30965
  ++position;
30966
30966
  }
30967
30967
  parameterValue = removeTrailingHTTPWhitespace(parameterValue);
@@ -35488,9 +35488,9 @@ var require_lib3 = __commonJS({
35488
35488
  return false;
35489
35489
  }
35490
35490
  }
35491
- function hasNewLine(input2, start, end2) {
35491
+ function hasNewLine(input3, start, end2) {
35492
35492
  for (let i = start; i < end2; i++) {
35493
- if (isNewLine(input2.charCodeAt(i))) {
35493
+ if (isNewLine(input3.charCodeAt(i))) {
35494
35494
  return true;
35495
35495
  }
35496
35496
  }
@@ -36478,7 +36478,7 @@ var require_lib3 = __commonJS({
36478
36478
  dec: (ch) => ch >= 48 && ch <= 57,
36479
36479
  hex: (ch) => ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102
36480
36480
  };
36481
- function readStringContents(type, input2, pos, lineStart, curLine, errors2) {
36481
+ function readStringContents(type, input3, pos, lineStart, curLine, errors2) {
36482
36482
  const initialPos = pos;
36483
36483
  const initialLineStart = lineStart;
36484
36484
  const initialCurLine = curLine;
@@ -36487,21 +36487,21 @@ var require_lib3 = __commonJS({
36487
36487
  let chunkStart = pos;
36488
36488
  const {
36489
36489
  length
36490
- } = input2;
36490
+ } = input3;
36491
36491
  for (; ; ) {
36492
36492
  if (pos >= length) {
36493
36493
  errors2.unterminated(initialPos, initialLineStart, initialCurLine);
36494
- out += input2.slice(chunkStart, pos);
36494
+ out += input3.slice(chunkStart, pos);
36495
36495
  break;
36496
36496
  }
36497
- const ch = input2.charCodeAt(pos);
36498
- if (isStringEnd(type, ch, input2, pos)) {
36499
- out += input2.slice(chunkStart, pos);
36497
+ const ch = input3.charCodeAt(pos);
36498
+ if (isStringEnd(type, ch, input3, pos)) {
36499
+ out += input3.slice(chunkStart, pos);
36500
36500
  break;
36501
36501
  }
36502
36502
  if (ch === 92) {
36503
- out += input2.slice(chunkStart, pos);
36504
- const res = readEscapedChar(input2, pos, lineStart, curLine, type === "template", errors2);
36503
+ out += input3.slice(chunkStart, pos);
36504
+ const res = readEscapedChar(input3, pos, lineStart, curLine, type === "template", errors2);
36505
36505
  if (res.ch === null && !firstInvalidLoc) {
36506
36506
  firstInvalidLoc = {
36507
36507
  pos,
@@ -36523,9 +36523,9 @@ var require_lib3 = __commonJS({
36523
36523
  lineStart = pos;
36524
36524
  } else if (ch === 10 || ch === 13) {
36525
36525
  if (type === "template") {
36526
- out += input2.slice(chunkStart, pos) + "\n";
36526
+ out += input3.slice(chunkStart, pos) + "\n";
36527
36527
  ++pos;
36528
- if (ch === 13 && input2.charCodeAt(pos) === 10) {
36528
+ if (ch === 13 && input3.charCodeAt(pos) === 10) {
36529
36529
  ++pos;
36530
36530
  }
36531
36531
  ++curLine;
@@ -36546,13 +36546,13 @@ var require_lib3 = __commonJS({
36546
36546
  containsInvalid: !!firstInvalidLoc
36547
36547
  };
36548
36548
  }
36549
- function isStringEnd(type, ch, input2, pos) {
36549
+ function isStringEnd(type, ch, input3, pos) {
36550
36550
  if (type === "template") {
36551
- return ch === 96 || ch === 36 && input2.charCodeAt(pos + 1) === 123;
36551
+ return ch === 96 || ch === 36 && input3.charCodeAt(pos + 1) === 123;
36552
36552
  }
36553
36553
  return ch === (type === "double" ? 34 : 39);
36554
36554
  }
36555
- function readEscapedChar(input2, pos, lineStart, curLine, inTemplate, errors2) {
36555
+ function readEscapedChar(input3, pos, lineStart, curLine, inTemplate, errors2) {
36556
36556
  const throwOnInvalid = !inTemplate;
36557
36557
  pos++;
36558
36558
  const res = (ch2) => ({
@@ -36561,7 +36561,7 @@ var require_lib3 = __commonJS({
36561
36561
  lineStart,
36562
36562
  curLine
36563
36563
  });
36564
- const ch = input2.charCodeAt(pos++);
36564
+ const ch = input3.charCodeAt(pos++);
36565
36565
  switch (ch) {
36566
36566
  case 110:
36567
36567
  return res("\n");
@@ -36572,7 +36572,7 @@ var require_lib3 = __commonJS({
36572
36572
  ({
36573
36573
  code: code2,
36574
36574
  pos
36575
- } = readHexChar(input2, pos, lineStart, curLine, 2, false, throwOnInvalid, errors2));
36575
+ } = readHexChar(input3, pos, lineStart, curLine, 2, false, throwOnInvalid, errors2));
36576
36576
  return res(code2 === null ? null : String.fromCharCode(code2));
36577
36577
  }
36578
36578
  case 117: {
@@ -36580,7 +36580,7 @@ var require_lib3 = __commonJS({
36580
36580
  ({
36581
36581
  code: code2,
36582
36582
  pos
36583
- } = readCodePoint(input2, pos, lineStart, curLine, throwOnInvalid, errors2));
36583
+ } = readCodePoint(input3, pos, lineStart, curLine, throwOnInvalid, errors2));
36584
36584
  return res(code2 === null ? null : String.fromCodePoint(code2));
36585
36585
  }
36586
36586
  case 116:
@@ -36592,7 +36592,7 @@ var require_lib3 = __commonJS({
36592
36592
  case 102:
36593
36593
  return res("\f");
36594
36594
  case 13:
36595
- if (input2.charCodeAt(pos) === 10) {
36595
+ if (input3.charCodeAt(pos) === 10) {
36596
36596
  ++pos;
36597
36597
  }
36598
36598
  case 10:
@@ -36611,7 +36611,7 @@ var require_lib3 = __commonJS({
36611
36611
  default:
36612
36612
  if (ch >= 48 && ch <= 55) {
36613
36613
  const startPos = pos - 1;
36614
- const match = /^[0-7]+/.exec(input2.slice(startPos, pos + 2));
36614
+ const match = /^[0-7]+/.exec(input3.slice(startPos, pos + 2));
36615
36615
  let octalStr = match[0];
36616
36616
  let octal = parseInt(octalStr, 8);
36617
36617
  if (octal > 255) {
@@ -36619,7 +36619,7 @@ var require_lib3 = __commonJS({
36619
36619
  octal = parseInt(octalStr, 8);
36620
36620
  }
36621
36621
  pos += octalStr.length - 1;
36622
- const next2 = input2.charCodeAt(pos);
36622
+ const next2 = input3.charCodeAt(pos);
36623
36623
  if (octalStr !== "0" || next2 === 56 || next2 === 57) {
36624
36624
  if (inTemplate) {
36625
36625
  return res(null);
@@ -36632,13 +36632,13 @@ var require_lib3 = __commonJS({
36632
36632
  return res(String.fromCharCode(ch));
36633
36633
  }
36634
36634
  }
36635
- function readHexChar(input2, pos, lineStart, curLine, len, forceLen, throwOnInvalid, errors2) {
36635
+ function readHexChar(input3, pos, lineStart, curLine, len, forceLen, throwOnInvalid, errors2) {
36636
36636
  const initialPos = pos;
36637
36637
  let n;
36638
36638
  ({
36639
36639
  n,
36640
36640
  pos
36641
- } = readInt(input2, pos, lineStart, curLine, 16, len, forceLen, false, errors2, !throwOnInvalid));
36641
+ } = readInt(input3, pos, lineStart, curLine, 16, len, forceLen, false, errors2, !throwOnInvalid));
36642
36642
  if (n === null) {
36643
36643
  if (throwOnInvalid) {
36644
36644
  errors2.invalidEscapeSequence(initialPos, lineStart, curLine);
@@ -36651,18 +36651,18 @@ var require_lib3 = __commonJS({
36651
36651
  pos
36652
36652
  };
36653
36653
  }
36654
- function readInt(input2, pos, lineStart, curLine, radix, len, forceLen, allowNumSeparator, errors2, bailOnError) {
36654
+ function readInt(input3, pos, lineStart, curLine, radix, len, forceLen, allowNumSeparator, errors2, bailOnError) {
36655
36655
  const start = pos;
36656
36656
  const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct;
36657
36657
  const isAllowedSibling = radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 ? isAllowedNumericSeparatorSibling.dec : radix === 8 ? isAllowedNumericSeparatorSibling.oct : isAllowedNumericSeparatorSibling.bin;
36658
36658
  let invalid = false;
36659
36659
  let total = 0;
36660
36660
  for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {
36661
- const code2 = input2.charCodeAt(pos);
36661
+ const code2 = input3.charCodeAt(pos);
36662
36662
  let val2;
36663
36663
  if (code2 === 95 && allowNumSeparator !== "bail") {
36664
- const prev2 = input2.charCodeAt(pos - 1);
36665
- const next2 = input2.charCodeAt(pos + 1);
36664
+ const prev2 = input3.charCodeAt(pos - 1);
36665
+ const next2 = input3.charCodeAt(pos + 1);
36666
36666
  if (!allowNumSeparator) {
36667
36667
  if (bailOnError) return {
36668
36668
  n: null,
@@ -36717,15 +36717,15 @@ var require_lib3 = __commonJS({
36717
36717
  pos
36718
36718
  };
36719
36719
  }
36720
- function readCodePoint(input2, pos, lineStart, curLine, throwOnInvalid, errors2) {
36721
- const ch = input2.charCodeAt(pos);
36720
+ function readCodePoint(input3, pos, lineStart, curLine, throwOnInvalid, errors2) {
36721
+ const ch = input3.charCodeAt(pos);
36722
36722
  let code2;
36723
36723
  if (ch === 123) {
36724
36724
  ++pos;
36725
36725
  ({
36726
36726
  code: code2,
36727
36727
  pos
36728
- } = readHexChar(input2, pos, lineStart, curLine, input2.indexOf("}", pos) - pos, true, throwOnInvalid, errors2));
36728
+ } = readHexChar(input3, pos, lineStart, curLine, input3.indexOf("}", pos) - pos, true, throwOnInvalid, errors2));
36729
36729
  ++pos;
36730
36730
  if (code2 !== null && code2 > 1114111) {
36731
36731
  if (throwOnInvalid) {
@@ -36741,7 +36741,7 @@ var require_lib3 = __commonJS({
36741
36741
  ({
36742
36742
  code: code2,
36743
36743
  pos
36744
- } = readHexChar(input2, pos, lineStart, curLine, 4, false, throwOnInvalid, errors2));
36744
+ } = readHexChar(input3, pos, lineStart, curLine, 4, false, throwOnInvalid, errors2));
36745
36745
  }
36746
36746
  return {
36747
36747
  code: code2,
@@ -36763,7 +36763,7 @@ var require_lib3 = __commonJS({
36763
36763
  }
36764
36764
  };
36765
36765
  var Tokenizer3 = class extends CommentsParser {
36766
- constructor(options, input2) {
36766
+ constructor(options, input3) {
36767
36767
  super();
36768
36768
  this.isLookahead = void 0;
36769
36769
  this.tokens = [];
@@ -36798,8 +36798,8 @@ var require_lib3 = __commonJS({
36798
36798
  });
36799
36799
  this.state = new State4();
36800
36800
  this.state.init(options);
36801
- this.input = input2;
36802
- this.length = input2.length;
36801
+ this.input = input3;
36802
+ this.length = input3.length;
36803
36803
  this.comments = [];
36804
36804
  this.isLookahead = false;
36805
36805
  }
@@ -43602,7 +43602,7 @@ var require_lib3 = __commonJS({
43602
43602
  };
43603
43603
  var loneSurrogate = /[\uD800-\uDFFF]/u;
43604
43604
  var keywordRelationalOperator = /in(?:stanceof)?/y;
43605
- function babel7CompatTokens(tokens, input2, startIndex) {
43605
+ function babel7CompatTokens(tokens, input3, startIndex) {
43606
43606
  for (let i = 0; i < tokens.length; i++) {
43607
43607
  const token = tokens[i];
43608
43608
  const {
@@ -43646,7 +43646,7 @@ var require_lib3 = __commonJS({
43646
43646
  const backquoteEnd = start + 1;
43647
43647
  const backquoteEndLoc = createPositionWithColumnOffset(loc.start, 1);
43648
43648
  let startToken;
43649
- if (input2.charCodeAt(start - startIndex) === 96) {
43649
+ if (input3.charCodeAt(start - startIndex) === 96) {
43650
43650
  startToken = new Token({
43651
43651
  type: getExportedToken(22),
43652
43652
  value: "`",
@@ -45518,9 +45518,9 @@ var require_lib3 = __commonJS({
45518
45518
  }
45519
45519
  };
45520
45520
  var Parser3 = class extends StatementParser {
45521
- constructor(options, input2, pluginsMap) {
45521
+ constructor(options, input3, pluginsMap) {
45522
45522
  const normalizedOptions = getOptions(options);
45523
- super(normalizedOptions, input2);
45523
+ super(normalizedOptions, input3);
45524
45524
  this.options = normalizedOptions;
45525
45525
  this.initializeScopes();
45526
45526
  this.plugins = pluginsMap;
@@ -45586,13 +45586,13 @@ var require_lib3 = __commonJS({
45586
45586
  return result;
45587
45587
  }
45588
45588
  };
45589
- function parse7(input2, options) {
45589
+ function parse7(input3, options) {
45590
45590
  var _options;
45591
45591
  if (((_options = options) == null ? void 0 : _options.sourceType) === "unambiguous") {
45592
45592
  options = Object.assign({}, options);
45593
45593
  try {
45594
45594
  options.sourceType = "module";
45595
- const parser2 = getParser(options, input2);
45595
+ const parser2 = getParser(options, input3);
45596
45596
  const ast = parser2.parse();
45597
45597
  if (parser2.sawUnambiguousESM) {
45598
45598
  return ast;
@@ -45600,7 +45600,7 @@ var require_lib3 = __commonJS({
45600
45600
  if (parser2.ambiguousScriptDifferentAst) {
45601
45601
  try {
45602
45602
  options.sourceType = "script";
45603
- return getParser(options, input2).parse();
45603
+ return getParser(options, input3).parse();
45604
45604
  } catch (_unused) {
45605
45605
  }
45606
45606
  } else {
@@ -45610,17 +45610,17 @@ var require_lib3 = __commonJS({
45610
45610
  } catch (moduleError) {
45611
45611
  try {
45612
45612
  options.sourceType = "script";
45613
- return getParser(options, input2).parse();
45613
+ return getParser(options, input3).parse();
45614
45614
  } catch (_unused2) {
45615
45615
  }
45616
45616
  throw moduleError;
45617
45617
  }
45618
45618
  } else {
45619
- return getParser(options, input2).parse();
45619
+ return getParser(options, input3).parse();
45620
45620
  }
45621
45621
  }
45622
- function parseExpression(input2, options) {
45623
- const parser2 = getParser(options, input2);
45622
+ function parseExpression(input3, options) {
45623
+ const parser2 = getParser(options, input3);
45624
45624
  if (parser2.options.strictMode) {
45625
45625
  parser2.state.strict = true;
45626
45626
  }
@@ -45634,7 +45634,7 @@ var require_lib3 = __commonJS({
45634
45634
  return tokenTypes2;
45635
45635
  }
45636
45636
  var tokTypes = generateExportedTokenTypes(tt);
45637
- function getParser(options, input2) {
45637
+ function getParser(options, input3) {
45638
45638
  let cls = Parser3;
45639
45639
  const pluginsMap = /* @__PURE__ */ new Map();
45640
45640
  if (options != null && options.plugins) {
@@ -45652,7 +45652,7 @@ var require_lib3 = __commonJS({
45652
45652
  validatePlugins(pluginsMap);
45653
45653
  cls = getParserClass(pluginsMap);
45654
45654
  }
45655
- return new cls(options, input2, pluginsMap);
45655
+ return new cls(options, input3, pluginsMap);
45656
45656
  }
45657
45657
  var parserClassCache = /* @__PURE__ */ new Map();
45658
45658
  function getParserClass(pluginsMap) {
@@ -49623,7 +49623,7 @@ var require_lib5 = __commonJS({
49623
49623
  dec: (ch) => ch >= 48 && ch <= 57,
49624
49624
  hex: (ch) => ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102
49625
49625
  };
49626
- function readStringContents(type, input2, pos, lineStart, curLine, errors2) {
49626
+ function readStringContents(type, input3, pos, lineStart, curLine, errors2) {
49627
49627
  const initialPos = pos;
49628
49628
  const initialLineStart = lineStart;
49629
49629
  const initialCurLine = curLine;
@@ -49632,21 +49632,21 @@ var require_lib5 = __commonJS({
49632
49632
  let chunkStart = pos;
49633
49633
  const {
49634
49634
  length
49635
- } = input2;
49635
+ } = input3;
49636
49636
  for (; ; ) {
49637
49637
  if (pos >= length) {
49638
49638
  errors2.unterminated(initialPos, initialLineStart, initialCurLine);
49639
- out += input2.slice(chunkStart, pos);
49639
+ out += input3.slice(chunkStart, pos);
49640
49640
  break;
49641
49641
  }
49642
- const ch = input2.charCodeAt(pos);
49643
- if (isStringEnd(type, ch, input2, pos)) {
49644
- out += input2.slice(chunkStart, pos);
49642
+ const ch = input3.charCodeAt(pos);
49643
+ if (isStringEnd(type, ch, input3, pos)) {
49644
+ out += input3.slice(chunkStart, pos);
49645
49645
  break;
49646
49646
  }
49647
49647
  if (ch === 92) {
49648
- out += input2.slice(chunkStart, pos);
49649
- const res = readEscapedChar(input2, pos, lineStart, curLine, type === "template", errors2);
49648
+ out += input3.slice(chunkStart, pos);
49649
+ const res = readEscapedChar(input3, pos, lineStart, curLine, type === "template", errors2);
49650
49650
  if (res.ch === null && !firstInvalidLoc) {
49651
49651
  firstInvalidLoc = {
49652
49652
  pos,
@@ -49668,9 +49668,9 @@ var require_lib5 = __commonJS({
49668
49668
  lineStart = pos;
49669
49669
  } else if (ch === 10 || ch === 13) {
49670
49670
  if (type === "template") {
49671
- out += input2.slice(chunkStart, pos) + "\n";
49671
+ out += input3.slice(chunkStart, pos) + "\n";
49672
49672
  ++pos;
49673
- if (ch === 13 && input2.charCodeAt(pos) === 10) {
49673
+ if (ch === 13 && input3.charCodeAt(pos) === 10) {
49674
49674
  ++pos;
49675
49675
  }
49676
49676
  ++curLine;
@@ -49691,13 +49691,13 @@ var require_lib5 = __commonJS({
49691
49691
  containsInvalid: !!firstInvalidLoc
49692
49692
  };
49693
49693
  }
49694
- function isStringEnd(type, ch, input2, pos) {
49694
+ function isStringEnd(type, ch, input3, pos) {
49695
49695
  if (type === "template") {
49696
- return ch === 96 || ch === 36 && input2.charCodeAt(pos + 1) === 123;
49696
+ return ch === 96 || ch === 36 && input3.charCodeAt(pos + 1) === 123;
49697
49697
  }
49698
49698
  return ch === (type === "double" ? 34 : 39);
49699
49699
  }
49700
- function readEscapedChar(input2, pos, lineStart, curLine, inTemplate, errors2) {
49700
+ function readEscapedChar(input3, pos, lineStart, curLine, inTemplate, errors2) {
49701
49701
  const throwOnInvalid = !inTemplate;
49702
49702
  pos++;
49703
49703
  const res = (ch2) => ({
@@ -49706,7 +49706,7 @@ var require_lib5 = __commonJS({
49706
49706
  lineStart,
49707
49707
  curLine
49708
49708
  });
49709
- const ch = input2.charCodeAt(pos++);
49709
+ const ch = input3.charCodeAt(pos++);
49710
49710
  switch (ch) {
49711
49711
  case 110:
49712
49712
  return res("\n");
@@ -49717,7 +49717,7 @@ var require_lib5 = __commonJS({
49717
49717
  ({
49718
49718
  code,
49719
49719
  pos
49720
- } = readHexChar(input2, pos, lineStart, curLine, 2, false, throwOnInvalid, errors2));
49720
+ } = readHexChar(input3, pos, lineStart, curLine, 2, false, throwOnInvalid, errors2));
49721
49721
  return res(code === null ? null : String.fromCharCode(code));
49722
49722
  }
49723
49723
  case 117: {
@@ -49725,7 +49725,7 @@ var require_lib5 = __commonJS({
49725
49725
  ({
49726
49726
  code,
49727
49727
  pos
49728
- } = readCodePoint(input2, pos, lineStart, curLine, throwOnInvalid, errors2));
49728
+ } = readCodePoint(input3, pos, lineStart, curLine, throwOnInvalid, errors2));
49729
49729
  return res(code === null ? null : String.fromCodePoint(code));
49730
49730
  }
49731
49731
  case 116:
@@ -49737,7 +49737,7 @@ var require_lib5 = __commonJS({
49737
49737
  case 102:
49738
49738
  return res("\f");
49739
49739
  case 13:
49740
- if (input2.charCodeAt(pos) === 10) {
49740
+ if (input3.charCodeAt(pos) === 10) {
49741
49741
  ++pos;
49742
49742
  }
49743
49743
  case 10:
@@ -49756,7 +49756,7 @@ var require_lib5 = __commonJS({
49756
49756
  default:
49757
49757
  if (ch >= 48 && ch <= 55) {
49758
49758
  const startPos = pos - 1;
49759
- const match = /^[0-7]+/.exec(input2.slice(startPos, pos + 2));
49759
+ const match = /^[0-7]+/.exec(input3.slice(startPos, pos + 2));
49760
49760
  let octalStr = match[0];
49761
49761
  let octal = parseInt(octalStr, 8);
49762
49762
  if (octal > 255) {
@@ -49764,7 +49764,7 @@ var require_lib5 = __commonJS({
49764
49764
  octal = parseInt(octalStr, 8);
49765
49765
  }
49766
49766
  pos += octalStr.length - 1;
49767
- const next2 = input2.charCodeAt(pos);
49767
+ const next2 = input3.charCodeAt(pos);
49768
49768
  if (octalStr !== "0" || next2 === 56 || next2 === 57) {
49769
49769
  if (inTemplate) {
49770
49770
  return res(null);
@@ -49777,13 +49777,13 @@ var require_lib5 = __commonJS({
49777
49777
  return res(String.fromCharCode(ch));
49778
49778
  }
49779
49779
  }
49780
- function readHexChar(input2, pos, lineStart, curLine, len, forceLen, throwOnInvalid, errors2) {
49780
+ function readHexChar(input3, pos, lineStart, curLine, len, forceLen, throwOnInvalid, errors2) {
49781
49781
  const initialPos = pos;
49782
49782
  let n;
49783
49783
  ({
49784
49784
  n,
49785
49785
  pos
49786
- } = readInt(input2, pos, lineStart, curLine, 16, len, forceLen, false, errors2, !throwOnInvalid));
49786
+ } = readInt(input3, pos, lineStart, curLine, 16, len, forceLen, false, errors2, !throwOnInvalid));
49787
49787
  if (n === null) {
49788
49788
  if (throwOnInvalid) {
49789
49789
  errors2.invalidEscapeSequence(initialPos, lineStart, curLine);
@@ -49796,18 +49796,18 @@ var require_lib5 = __commonJS({
49796
49796
  pos
49797
49797
  };
49798
49798
  }
49799
- function readInt(input2, pos, lineStart, curLine, radix, len, forceLen, allowNumSeparator, errors2, bailOnError) {
49799
+ function readInt(input3, pos, lineStart, curLine, radix, len, forceLen, allowNumSeparator, errors2, bailOnError) {
49800
49800
  const start = pos;
49801
49801
  const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct;
49802
49802
  const isAllowedSibling = radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 ? isAllowedNumericSeparatorSibling.dec : radix === 8 ? isAllowedNumericSeparatorSibling.oct : isAllowedNumericSeparatorSibling.bin;
49803
49803
  let invalid = false;
49804
49804
  let total = 0;
49805
49805
  for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {
49806
- const code = input2.charCodeAt(pos);
49806
+ const code = input3.charCodeAt(pos);
49807
49807
  let val2;
49808
49808
  if (code === 95 && allowNumSeparator !== "bail") {
49809
- const prev2 = input2.charCodeAt(pos - 1);
49810
- const next2 = input2.charCodeAt(pos + 1);
49809
+ const prev2 = input3.charCodeAt(pos - 1);
49810
+ const next2 = input3.charCodeAt(pos + 1);
49811
49811
  if (!allowNumSeparator) {
49812
49812
  if (bailOnError) return {
49813
49813
  n: null,
@@ -49862,15 +49862,15 @@ var require_lib5 = __commonJS({
49862
49862
  pos
49863
49863
  };
49864
49864
  }
49865
- function readCodePoint(input2, pos, lineStart, curLine, throwOnInvalid, errors2) {
49866
- const ch = input2.charCodeAt(pos);
49865
+ function readCodePoint(input3, pos, lineStart, curLine, throwOnInvalid, errors2) {
49866
+ const ch = input3.charCodeAt(pos);
49867
49867
  let code;
49868
49868
  if (ch === 123) {
49869
49869
  ++pos;
49870
49870
  ({
49871
49871
  code,
49872
49872
  pos
49873
- } = readHexChar(input2, pos, lineStart, curLine, input2.indexOf("}", pos) - pos, true, throwOnInvalid, errors2));
49873
+ } = readHexChar(input3, pos, lineStart, curLine, input3.indexOf("}", pos) - pos, true, throwOnInvalid, errors2));
49874
49874
  ++pos;
49875
49875
  if (code !== null && code > 1114111) {
49876
49876
  if (throwOnInvalid) {
@@ -49886,7 +49886,7 @@ var require_lib5 = __commonJS({
49886
49886
  ({
49887
49887
  code,
49888
49888
  pos
49889
- } = readHexChar(input2, pos, lineStart, curLine, 4, false, throwOnInvalid, errors2));
49889
+ } = readHexChar(input3, pos, lineStart, curLine, 4, false, throwOnInvalid, errors2));
49890
49890
  }
49891
49891
  return {
49892
49892
  code,
@@ -58792,10 +58792,10 @@ var require_toIdentifier = __commonJS({
58792
58792
  exports.default = toIdentifier;
58793
58793
  var _isValidIdentifier = require_isValidIdentifier();
58794
58794
  var _helperValidatorIdentifier = require_lib4();
58795
- function toIdentifier(input2) {
58796
- input2 = input2 + "";
58795
+ function toIdentifier(input3) {
58796
+ input3 = input3 + "";
58797
58797
  let name = "";
58798
- for (const c of input2) {
58798
+ for (const c of input3) {
58799
58799
  name += (0, _helperValidatorIdentifier.isIdentifierChar)(c.codePointAt(0)) ? c : "-";
58800
58800
  }
58801
58801
  name = name.replace(/^[-0-9]+/, "");
@@ -62524,9 +62524,9 @@ var require_sourcemap_codec_umd = __commonJS({
62524
62524
  }
62525
62525
  };
62526
62526
  var EMPTY = [];
62527
- function decodeOriginalScopes(input2) {
62528
- const { length } = input2;
62529
- const reader = new StringReader(input2);
62527
+ function decodeOriginalScopes(input3) {
62528
+ const { length } = input3;
62529
+ const reader = new StringReader(input3);
62530
62530
  const scopes = [];
62531
62531
  const stack = [];
62532
62532
  let line = 0;
@@ -62590,9 +62590,9 @@ var require_sourcemap_codec_umd = __commonJS({
62590
62590
  encodeInteger(writer, endColumn, 0);
62591
62591
  return index2;
62592
62592
  }
62593
- function decodeGeneratedRanges(input2) {
62594
- const { length } = input2;
62595
- const reader = new StringReader(input2);
62593
+ function decodeGeneratedRanges(input3) {
62594
+ const { length } = input3;
62595
+ const reader = new StringReader(input3);
62596
62596
  const ranges = [];
62597
62597
  const stack = [];
62598
62598
  let genLine = 0;
@@ -62853,27 +62853,27 @@ var require_resolve_uri_umd = __commonJS({
62853
62853
  const schemeRegex = /^[\w+.-]+:\/\//;
62854
62854
  const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/;
62855
62855
  const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;
62856
- function isAbsoluteUrl(input2) {
62857
- return schemeRegex.test(input2);
62856
+ function isAbsoluteUrl(input3) {
62857
+ return schemeRegex.test(input3);
62858
62858
  }
62859
- function isSchemeRelativeUrl(input2) {
62860
- return input2.startsWith("//");
62859
+ function isSchemeRelativeUrl(input3) {
62860
+ return input3.startsWith("//");
62861
62861
  }
62862
- function isAbsolutePath(input2) {
62863
- return input2.startsWith("/");
62862
+ function isAbsolutePath(input3) {
62863
+ return input3.startsWith("/");
62864
62864
  }
62865
- function isFileUrl(input2) {
62866
- return input2.startsWith("file:");
62865
+ function isFileUrl(input3) {
62866
+ return input3.startsWith("file:");
62867
62867
  }
62868
- function isRelative(input2) {
62869
- return /^[.?#]/.test(input2);
62868
+ function isRelative(input3) {
62869
+ return /^[.?#]/.test(input3);
62870
62870
  }
62871
- function parseAbsoluteUrl(input2) {
62872
- const match = urlRegex.exec(input2);
62871
+ function parseAbsoluteUrl(input3) {
62872
+ const match = urlRegex.exec(input3);
62873
62873
  return makeUrl(match[1], match[2] || "", match[3], match[4] || "", match[5] || "/", match[6] || "", match[7] || "");
62874
62874
  }
62875
- function parseFileUrl(input2) {
62876
- const match = fileRegex.exec(input2);
62875
+ function parseFileUrl(input3) {
62876
+ const match = fileRegex.exec(input3);
62877
62877
  const path2 = match[2];
62878
62878
  return makeUrl("file:", "", match[1] || "", "", isAbsolutePath(path2) ? path2 : "/" + path2, match[3] || "", match[4] || "");
62879
62879
  }
@@ -62889,28 +62889,28 @@ var require_resolve_uri_umd = __commonJS({
62889
62889
  type: 7
62890
62890
  };
62891
62891
  }
62892
- function parseUrl(input2) {
62893
- if (isSchemeRelativeUrl(input2)) {
62894
- const url2 = parseAbsoluteUrl("http:" + input2);
62892
+ function parseUrl(input3) {
62893
+ if (isSchemeRelativeUrl(input3)) {
62894
+ const url2 = parseAbsoluteUrl("http:" + input3);
62895
62895
  url2.scheme = "";
62896
62896
  url2.type = 6;
62897
62897
  return url2;
62898
62898
  }
62899
- if (isAbsolutePath(input2)) {
62900
- const url2 = parseAbsoluteUrl("http://foo.com" + input2);
62899
+ if (isAbsolutePath(input3)) {
62900
+ const url2 = parseAbsoluteUrl("http://foo.com" + input3);
62901
62901
  url2.scheme = "";
62902
62902
  url2.host = "";
62903
62903
  url2.type = 5;
62904
62904
  return url2;
62905
62905
  }
62906
- if (isFileUrl(input2))
62907
- return parseFileUrl(input2);
62908
- if (isAbsoluteUrl(input2))
62909
- return parseAbsoluteUrl(input2);
62910
- const url = parseAbsoluteUrl("http://foo.com/" + input2);
62906
+ if (isFileUrl(input3))
62907
+ return parseFileUrl(input3);
62908
+ if (isAbsoluteUrl(input3))
62909
+ return parseAbsoluteUrl(input3);
62910
+ const url = parseAbsoluteUrl("http://foo.com/" + input3);
62911
62911
  url.scheme = "";
62912
62912
  url.host = "";
62913
- url.type = input2 ? input2.startsWith("?") ? 3 : input2.startsWith("#") ? 2 : 4 : 1;
62913
+ url.type = input3 ? input3.startsWith("?") ? 3 : input3.startsWith("#") ? 2 : 4 : 1;
62914
62914
  return url;
62915
62915
  }
62916
62916
  function stripPathFilename(path2) {
@@ -62964,10 +62964,10 @@ var require_resolve_uri_umd = __commonJS({
62964
62964
  }
62965
62965
  url.path = path2;
62966
62966
  }
62967
- function resolve4(input2, base) {
62968
- if (!input2 && !base)
62967
+ function resolve4(input3, base) {
62968
+ if (!input3 && !base)
62969
62969
  return "";
62970
- const url = parseUrl(input2);
62970
+ const url = parseUrl(input3);
62971
62971
  let inputType = url.type;
62972
62972
  if (base && inputType !== 7) {
62973
62973
  const baseUrl = parseUrl(base);
@@ -63006,7 +63006,7 @@ var require_resolve_uri_umd = __commonJS({
63006
63006
  const path2 = url.path.slice(1);
63007
63007
  if (!path2)
63008
63008
  return queryHash || ".";
63009
- if (isRelative(base || input2) && !isRelative(path2)) {
63009
+ if (isRelative(base || input3) && !isRelative(path2)) {
63010
63010
  return "./" + path2 + queryHash;
63011
63011
  }
63012
63012
  return path2 + queryHash;
@@ -63274,8 +63274,8 @@ var require_trace_mapping_umd = __commonJS({
63274
63274
  };
63275
63275
  return presortedDecodedMap(joined);
63276
63276
  };
63277
- function recurse(input2, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) {
63278
- const { sections } = input2;
63277
+ function recurse(input3, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) {
63278
+ const { sections } = input3;
63279
63279
  for (let i = 0; i < sections.length; i++) {
63280
63280
  const { map: map2, offset } = sections[i];
63281
63281
  let sl = stopLine;
@@ -63304,8 +63304,8 @@ var require_trace_mapping_umd = __commonJS({
63304
63304
  );
63305
63305
  }
63306
63306
  }
63307
- function addSection(input2, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) {
63308
- const parsed = parse7(input2);
63307
+ function addSection(input3, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) {
63308
+ const parsed = parse7(input3);
63309
63309
  if ("sections" in parsed) return recurse(...arguments);
63310
63310
  const map2 = new TraceMap(parsed, mapUrl);
63311
63311
  const sourcesOffset = sources.length;
@@ -63782,8 +63782,8 @@ var require_gen_mapping_umd = __commonJS({
63782
63782
  mappings: (0, import_sourcemap_codec.encode)(decoded.mappings)
63783
63783
  });
63784
63784
  }
63785
- function fromMap(input2) {
63786
- const map2 = new import_trace_mapping.TraceMap(input2);
63785
+ function fromMap(input3) {
63786
+ const map2 = new import_trace_mapping.TraceMap(input3);
63787
63787
  const gen = new GenMapping({ file: map2.file, sourceRoot: map2.sourceRoot });
63788
63788
  putAll(cast2(gen)._names, map2.names);
63789
63789
  putAll(cast2(gen)._sources, map2.sources);
@@ -70131,8 +70131,8 @@ var require_picocolors = __commonJS({
70131
70131
  var argv = p.argv || [];
70132
70132
  var env = p.env || {};
70133
70133
  var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
70134
- var formatter = (open, close, replace = open) => (input2) => {
70135
- let string = "" + input2, index2 = string.indexOf(close, open.length);
70134
+ var formatter = (open, close, replace = open) => (input3) => {
70135
+ let string = "" + input3, index2 = string.indexOf(close, open.length);
70136
70136
  return ~index2 ? open + replaceClose(string, close, replace, index2) + close : open + string + close;
70137
70137
  };
70138
70138
  var replaceClose = (string, close, replace, index2) => {
@@ -74524,19 +74524,412 @@ import { Command as Command4 } from "commander";
74524
74524
  // src/commands/auth/index.ts
74525
74525
  init_esm_shims();
74526
74526
 
74527
- // src/commands/auth/status.ts
74527
+ // src/commands/auth/setup.ts
74528
74528
  init_esm_shims();
74529
- import fs from "fs/promises";
74530
- import path from "path";
74529
+ import { execSync as execSync3 } from "child_process";
74530
+ import { appendFileSync, existsSync as existsSync2 } from "fs";
74531
+ import { confirm, input, password, select } from "@inquirer/prompts";
74532
+
74533
+ // src/lib/keychain.ts
74534
+ init_esm_shims();
74535
+ import { execSync } from "child_process";
74536
+ import { existsSync, readFileSync } from "fs";
74537
+ import { homedir } from "os";
74538
+ import { join } from "path";
74539
+ function detectPlatform() {
74540
+ switch (process.platform) {
74541
+ case "darwin":
74542
+ return "macos";
74543
+ case "linux":
74544
+ return "linux";
74545
+ default:
74546
+ return "unsupported";
74547
+ }
74548
+ }
74549
+ function isKeychainAvailable() {
74550
+ const platform = detectPlatform();
74551
+ try {
74552
+ if (platform === "macos") {
74553
+ execSync("which security", { stdio: "pipe" });
74554
+ return true;
74555
+ }
74556
+ if (platform === "linux") {
74557
+ execSync("which secret-tool", { stdio: "pipe" });
74558
+ return true;
74559
+ }
74560
+ return false;
74561
+ } catch {
74562
+ return false;
74563
+ }
74564
+ }
74565
+ function storeInKeychain(key, value) {
74566
+ const platform = detectPlatform();
74567
+ if (platform === "macos") {
74568
+ execSync(
74569
+ `security add-generic-password -a "$USER" -s ${JSON.stringify(key)} -w ${JSON.stringify(value)} -U`,
74570
+ { stdio: "pipe" }
74571
+ );
74572
+ return;
74573
+ }
74574
+ if (platform === "linux") {
74575
+ execSync(
74576
+ `echo -n ${JSON.stringify(value)} | secret-tool store --label ${JSON.stringify(key)} service skill-cli key ${JSON.stringify(key)}`,
74577
+ { stdio: "pipe" }
74578
+ );
74579
+ return;
74580
+ }
74581
+ throw new Error(`Unsupported platform: ${process.platform}`);
74582
+ }
74583
+ function readFromKeychain(key) {
74584
+ const platform = detectPlatform();
74585
+ try {
74586
+ if (platform === "macos") {
74587
+ return execSync(
74588
+ `security find-generic-password -a "$USER" -s ${JSON.stringify(key)} -w`,
74589
+ { stdio: "pipe" }
74590
+ ).toString().trim();
74591
+ }
74592
+ if (platform === "linux") {
74593
+ return execSync(
74594
+ `secret-tool lookup service skill-cli key ${JSON.stringify(key)}`,
74595
+ { stdio: "pipe" }
74596
+ ).toString().trim();
74597
+ }
74598
+ return null;
74599
+ } catch {
74600
+ return null;
74601
+ }
74602
+ }
74603
+ function getShellProfileExportLine(key) {
74604
+ const platform = detectPlatform();
74605
+ if (platform === "macos") {
74606
+ return `export ${key}=$(security find-generic-password -a "$USER" -s "${key}" -w 2>/dev/null)`;
74607
+ }
74608
+ if (platform === "linux") {
74609
+ return `export ${key}=$(secret-tool lookup service skill-cli key "${key}" 2>/dev/null)`;
74610
+ }
74611
+ throw new Error(`Unsupported platform: ${process.platform}`);
74612
+ }
74613
+ function detectShellProfile() {
74614
+ const shell = process.env.SHELL || "";
74615
+ const home = homedir();
74616
+ if (shell.includes("zsh")) {
74617
+ return join(home, ".zshrc");
74618
+ }
74619
+ if (shell.includes("bash")) {
74620
+ const bashrc = join(home, ".bashrc");
74621
+ const bashProfile = join(home, ".bash_profile");
74622
+ if (existsSync(bashrc)) return bashrc;
74623
+ if (existsSync(bashProfile)) return bashProfile;
74624
+ return bashrc;
74625
+ }
74626
+ return null;
74627
+ }
74628
+ function shellProfileHasExport(profilePath, key) {
74629
+ try {
74630
+ const content = readFileSync(profilePath, "utf-8");
74631
+ return content.includes(`export ${key}=`);
74632
+ } catch {
74633
+ return false;
74634
+ }
74635
+ }
74531
74636
 
74532
74637
  // src/lib/onepassword.ts
74533
74638
  init_esm_shims();
74534
- import { execSync, spawn } from "child_process";
74639
+ import { execSync as execSync2, spawn } from "child_process";
74640
+ var OP_ACCOUNT = "egghead.1password.com";
74641
+ var OP_VAULT_ID = "u3ujzar6l3nahlahsuzfvg7vcq";
74642
+ var OP_AGE_KEY_ITEM_ID = "lxndka3exn475vqdiqq5heg2wm";
74643
+ var OP_AGE_KEY_LINK = `https://start.1password.com/open/i?a=GCTJE4MRGFHKRAYXCEXKZKCEFU&v=${OP_VAULT_ID}&i=${OP_AGE_KEY_ITEM_ID}&h=${OP_ACCOUNT}`;
74644
+ function isOpCliAvailable() {
74645
+ try {
74646
+ execSync2("which op", { stdio: "pipe" });
74647
+ return true;
74648
+ } catch {
74649
+ return false;
74650
+ }
74651
+ }
74652
+ function isOpSignedIn() {
74653
+ try {
74654
+ execSync2(`op account get --account ${OP_ACCOUNT}`, {
74655
+ stdio: "pipe",
74656
+ timeout: 5e3
74657
+ });
74658
+ return true;
74659
+ } catch {
74660
+ return false;
74661
+ }
74662
+ }
74663
+ function fetchFromOp(itemId, field) {
74664
+ try {
74665
+ const result = execSync2(
74666
+ `op item get ${itemId} --vault ${OP_VAULT_ID} --account ${OP_ACCOUNT} --fields ${field} --reveal`,
74667
+ { stdio: "pipe", timeout: 15e3 }
74668
+ );
74669
+ const value = result.toString().trim();
74670
+ return value || null;
74671
+ } catch {
74672
+ return null;
74673
+ }
74674
+ }
74675
+ function getOpInstallInstructions() {
74676
+ switch (process.platform) {
74677
+ case "darwin":
74678
+ return "brew install 1password-cli";
74679
+ case "linux":
74680
+ return "https://developer.1password.com/docs/cli/get-started/#install";
74681
+ default:
74682
+ return "https://developer.1password.com/docs/cli/get-started/#install";
74683
+ }
74684
+ }
74535
74685
  function isServiceAccountConfigured() {
74536
74686
  return Boolean(process.env.OP_SERVICE_ACCOUNT_TOKEN);
74537
74687
  }
74538
74688
 
74689
+ // src/commands/auth/setup.ts
74690
+ var KEY_NAME = "AGE_SECRET_KEY";
74691
+ var KEY_PREFIX = "AGE-SECRET-KEY-1";
74692
+ function validateAgeKey(value) {
74693
+ const trimmed = value.trim();
74694
+ if (!trimmed) return "Key cannot be empty";
74695
+ if (!trimmed.startsWith(KEY_PREFIX)) {
74696
+ return `Invalid format \u2014 must start with ${KEY_PREFIX}`;
74697
+ }
74698
+ return true;
74699
+ }
74700
+ function registerSetupCommand(auth) {
74701
+ auth.command("setup").description("Store AGE_SECRET_KEY in OS keychain and configure shell").option("--json", "Output result as JSON").action(async (options) => {
74702
+ try {
74703
+ await runSetup(options);
74704
+ } catch (error) {
74705
+ const message = error instanceof Error ? error.message : "Unknown error";
74706
+ if (options.json) {
74707
+ console.error(JSON.stringify({ success: false, error: message }));
74708
+ } else {
74709
+ console.error(`Error: ${message}`);
74710
+ }
74711
+ process.exit(1);
74712
+ }
74713
+ });
74714
+ }
74715
+ async function runSetup(options) {
74716
+ const platform = detectPlatform();
74717
+ if (platform === "unsupported") {
74718
+ throw new Error(
74719
+ `Unsupported platform: ${process.platform}. Only macOS and Linux are supported.`
74720
+ );
74721
+ }
74722
+ if (!isKeychainAvailable()) {
74723
+ const tool5 = platform === "macos" ? "security" : "secret-tool";
74724
+ throw new Error(
74725
+ `Keychain CLI not found: ${tool5}. Install it before running setup.`
74726
+ );
74727
+ }
74728
+ if (!process.stdin.isTTY && !options.json) {
74729
+ throw new Error(
74730
+ "Setup requires an interactive terminal. Use --json for non-interactive mode."
74731
+ );
74732
+ }
74733
+ if (!options.json) {
74734
+ console.log("\nSkill Recordings CLI \u2014 Auth Setup\n");
74735
+ }
74736
+ const existingEnv = process.env[KEY_NAME];
74737
+ const existingKeychain = readFromKeychain(KEY_NAME);
74738
+ if (existingEnv || existingKeychain) {
74739
+ if (!options.json) {
74740
+ if (existingEnv) {
74741
+ console.log(` ${KEY_NAME} is already set in your environment.`);
74742
+ }
74743
+ if (existingKeychain) {
74744
+ console.log(` ${KEY_NAME} is already stored in the keychain.`);
74745
+ }
74746
+ }
74747
+ const overwrite = await confirm({
74748
+ message: "Overwrite existing key?",
74749
+ default: false
74750
+ });
74751
+ if (!overwrite) {
74752
+ if (options.json) {
74753
+ console.log(JSON.stringify({ success: true, skipped: true }));
74754
+ } else {
74755
+ console.log("\nSetup cancelled.");
74756
+ }
74757
+ return;
74758
+ }
74759
+ }
74760
+ const trimmedKey = await obtainKey(options);
74761
+ if (!options.json) {
74762
+ console.log(` \u2713 Valid age key format`);
74763
+ }
74764
+ storeInKeychain(KEY_NAME, trimmedKey);
74765
+ const stored = readFromKeychain(KEY_NAME);
74766
+ if (stored !== trimmedKey) {
74767
+ throw new Error(
74768
+ "Keychain verification failed \u2014 stored value does not match"
74769
+ );
74770
+ }
74771
+ const keychainLabel = platform === "macos" ? "macOS Keychain" : "Linux secret-tool";
74772
+ if (!options.json) {
74773
+ console.log(` \u2713 Stored in ${keychainLabel}`);
74774
+ }
74775
+ let profilePath = detectShellProfile();
74776
+ let profileUpdated = false;
74777
+ if (!profilePath) {
74778
+ if (!options.json) {
74779
+ console.log(
74780
+ `
74781
+ Could not detect shell profile from $SHELL (${process.env.SHELL || "unset"}).`
74782
+ );
74783
+ }
74784
+ profilePath = await input({
74785
+ message: "Path to your shell profile (e.g., ~/.zshrc):",
74786
+ validate: (v) => v.trim().length > 0 || "Path is required"
74787
+ });
74788
+ profilePath = profilePath.replace(/^~/, process.env.HOME || "");
74789
+ }
74790
+ if (profilePath && !shellProfileHasExport(profilePath, KEY_NAME)) {
74791
+ const exportLine = getShellProfileExportLine(KEY_NAME);
74792
+ const comment = platform === "macos" ? "# age encryption key (stored in macOS Keychain)" : "# age encryption key (stored in Linux secret-tool)";
74793
+ appendFileSync(profilePath, `
74794
+ ${comment}
74795
+ ${exportLine}
74796
+ `);
74797
+ profileUpdated = true;
74798
+ if (!options.json) {
74799
+ console.log(` \u2713 Added export line to ${profilePath}`);
74800
+ }
74801
+ } else if (profilePath) {
74802
+ if (!options.json) {
74803
+ console.log(` \u2713 Export line already in ${profilePath}`);
74804
+ }
74805
+ }
74806
+ let decryptOk = null;
74807
+ const cliDir = findCliDir();
74808
+ if (cliDir) {
74809
+ const encryptedPath = `${cliDir}/.env.encrypted`;
74810
+ if (existsSync2(encryptedPath)) {
74811
+ try {
74812
+ process.env[KEY_NAME] = trimmedKey;
74813
+ execSync3(`rage -d -i - ${JSON.stringify(encryptedPath)}`, {
74814
+ input: trimmedKey,
74815
+ stdio: ["pipe", "pipe", "pipe"]
74816
+ });
74817
+ decryptOk = true;
74818
+ if (!options.json) {
74819
+ console.log(` \u2713 Decryption test passed (.env.encrypted)`);
74820
+ }
74821
+ } catch {
74822
+ decryptOk = false;
74823
+ if (!options.json) {
74824
+ console.log(
74825
+ ` \u26A0 Decryption test failed \u2014 key may not match .env.encrypted`
74826
+ );
74827
+ }
74828
+ }
74829
+ }
74830
+ }
74831
+ if (options.json) {
74832
+ console.log(
74833
+ JSON.stringify({
74834
+ success: true,
74835
+ keychain: keychainLabel,
74836
+ profilePath,
74837
+ profileUpdated,
74838
+ decryptOk
74839
+ })
74840
+ );
74841
+ } else {
74842
+ console.log(`
74843
+ Done! Restart your shell or run:`);
74844
+ console.log(` source ${profilePath}`);
74845
+ console.log(`
74846
+ Then verify with:`);
74847
+ console.log(` skill auth status
74848
+ `);
74849
+ }
74850
+ }
74851
+ async function obtainKey(options) {
74852
+ const hasOp = isOpCliAvailable();
74853
+ if (hasOp) {
74854
+ if (!options.json) {
74855
+ console.log(" Checking 1Password CLI...");
74856
+ }
74857
+ const signedIn = isOpSignedIn();
74858
+ if (signedIn) {
74859
+ const method = await select({
74860
+ message: "How do you want to provide the key?",
74861
+ choices: [
74862
+ {
74863
+ name: "Fetch from 1Password automatically",
74864
+ value: "auto"
74865
+ },
74866
+ { name: "Paste manually", value: "manual" }
74867
+ ]
74868
+ });
74869
+ if (method === "auto") {
74870
+ if (!options.json) {
74871
+ console.log(" Fetching AGE_SECRET_KEY from 1Password...");
74872
+ }
74873
+ const value = fetchFromOp(OP_AGE_KEY_ITEM_ID, "password");
74874
+ if (value && validateAgeKey(value) === true) {
74875
+ if (!options.json) {
74876
+ console.log(" \u2713 Retrieved from 1Password");
74877
+ }
74878
+ return value;
74879
+ }
74880
+ const alt = fetchFromOp(OP_AGE_KEY_ITEM_ID, "credential");
74881
+ if (alt && validateAgeKey(alt) === true) {
74882
+ if (!options.json) {
74883
+ console.log(" \u2713 Retrieved from 1Password");
74884
+ }
74885
+ return alt;
74886
+ }
74887
+ if (!options.json) {
74888
+ console.log(
74889
+ " \u26A0 Could not auto-fetch key. Falling back to manual paste."
74890
+ );
74891
+ }
74892
+ }
74893
+ } else if (!options.json) {
74894
+ console.log(" 1Password CLI found but not signed in to egghead account.");
74895
+ console.log(" Sign in with: op signin --account egghead.1password.com");
74896
+ console.log("");
74897
+ }
74898
+ } else if (!options.json) {
74899
+ console.log(" 1Password CLI not installed.");
74900
+ console.log(` Install it: ${getOpInstallInstructions()}`);
74901
+ console.log(" (optional \u2014 you can paste the key manually below)\n");
74902
+ }
74903
+ if (!options.json) {
74904
+ console.log(` Get the key from 1Password:`);
74905
+ console.log(` ${OP_AGE_KEY_LINK}
74906
+ `);
74907
+ }
74908
+ const key = await password({
74909
+ message: `Paste your ${KEY_NAME}:`,
74910
+ mask: "*",
74911
+ validate: validateAgeKey
74912
+ });
74913
+ return key.trim();
74914
+ }
74915
+ function findCliDir() {
74916
+ const candidates = [
74917
+ process.cwd(),
74918
+ new URL("../../..", import.meta.url).pathname
74919
+ ];
74920
+ for (const dir of candidates) {
74921
+ if (existsSync2(`${dir}/.env.encrypted`)) {
74922
+ return dir;
74923
+ }
74924
+ }
74925
+ return null;
74926
+ }
74927
+
74539
74928
  // src/commands/auth/status.ts
74929
+ init_esm_shims();
74930
+ import fs from "fs/promises";
74931
+ import path from "path";
74932
+ var KEY_NAME2 = "AGE_SECRET_KEY";
74540
74933
  async function fileExists(filePath) {
74541
74934
  try {
74542
74935
  await fs.access(filePath);
@@ -74554,86 +74947,128 @@ function maskAgeKey(key) {
74554
74947
  return `${prefix}...${suffix}`;
74555
74948
  }
74556
74949
  function determineEnvSource(localExists, encryptedExists, ageKeyConfigured) {
74557
- if (localExists) {
74558
- return "local";
74559
- }
74560
- if (encryptedExists && ageKeyConfigured) {
74561
- return "encrypted";
74562
- }
74950
+ if (localExists) return "local";
74951
+ if (encryptedExists && ageKeyConfigured) return "encrypted";
74563
74952
  return "none";
74564
74953
  }
74565
- async function statusAction(options) {
74954
+ function registerStatusCommand(auth) {
74955
+ auth.command("status").description("Show auth configuration status").option("--json", "Output as JSON").action(async (options) => {
74956
+ const status = await getAuthStatus();
74957
+ if (options.json) {
74958
+ console.log(JSON.stringify(status, null, 2));
74959
+ return;
74960
+ }
74961
+ printStatus(status);
74962
+ });
74963
+ }
74964
+ async function getAuthStatus() {
74965
+ const platform = detectPlatform();
74566
74966
  const cliDir = path.resolve(import.meta.dirname, "../../..");
74567
74967
  const envLocalPath = path.join(cliDir, ".env.local");
74568
74968
  const envLocalExists = await fileExists(envLocalPath);
74569
74969
  const envEncryptedPath = path.join(cliDir, ".env.encrypted");
74570
74970
  const envEncryptedExists = await fileExists(envEncryptedPath);
74571
- const ageSecretKey = process.env.AGE_SECRET_KEY;
74971
+ const ageSecretKey = process.env[KEY_NAME2];
74572
74972
  const ageKeyConfigured = Boolean(ageSecretKey);
74573
- const opConfigured = isServiceAccountConfigured();
74973
+ const keychainAvailable = isKeychainAvailable();
74974
+ const keychainValue = keychainAvailable ? readFromKeychain(KEY_NAME2) : null;
74975
+ const opInstalled = isOpCliAvailable();
74976
+ const profilePath = detectShellProfile();
74574
74977
  const envSource = determineEnvSource(
74575
74978
  envLocalExists,
74576
74979
  envEncryptedExists,
74577
74980
  ageKeyConfigured
74578
74981
  );
74579
- const status = {
74580
- envLocal: {
74581
- exists: envLocalExists,
74582
- path: envLocalPath
74583
- },
74584
- envEncrypted: {
74585
- exists: envEncryptedExists,
74586
- path: envEncryptedPath
74587
- },
74982
+ return {
74983
+ envLocal: { exists: envLocalExists, path: envLocalPath },
74984
+ envEncrypted: { exists: envEncryptedExists, path: envEncryptedPath },
74588
74985
  ageSecretKey: {
74589
74986
  configured: ageKeyConfigured,
74590
74987
  masked: ageKeyConfigured && ageSecretKey ? maskAgeKey(ageSecretKey) : void 0
74591
74988
  },
74592
- opServiceAccountToken: {
74593
- configured: opConfigured
74989
+ keychain: {
74990
+ available: keychainAvailable,
74991
+ platform: platform === "macos" ? "macOS Keychain" : platform === "linux" ? "Linux secret-tool" : "unsupported",
74992
+ stored: !!keychainValue
74993
+ },
74994
+ onepassword: {
74995
+ cliInstalled: opInstalled,
74996
+ signedIn: opInstalled ? isOpSignedIn() : false,
74997
+ serviceAccountConfigured: isServiceAccountConfigured()
74998
+ },
74999
+ shellProfile: {
75000
+ path: profilePath,
75001
+ hasExport: profilePath ? shellProfileHasExport(profilePath, KEY_NAME2) : false
74594
75002
  },
74595
75003
  envSource
74596
75004
  };
74597
- if (options.json) {
74598
- console.log(JSON.stringify(status, null, 2));
74599
- return;
74600
- }
74601
- console.log("Auth Configuration Status\n");
74602
- console.log("Environment Files:");
75005
+ }
75006
+ function printStatus(status) {
75007
+ console.log("\nAuth Status:\n");
75008
+ console.log(" Environment Files:");
74603
75009
  console.log(
74604
- ` .env.local: ${envLocalExists ? "\u2713" : "\u2717"} ${envLocalExists ? "(exists)" : "(not found)"}`
75010
+ ` .env.local: ${status.envLocal.exists ? "\u2713 (exists)" : "\u2717 (not found)"}`
74605
75011
  );
74606
- console.log(` Path: ${envLocalPath}`);
74607
75012
  console.log(
74608
- ` .env.encrypted: ${envEncryptedExists ? "\u2713" : "\u2717"} ${envEncryptedExists ? "(exists)" : "(not found)"}`
75013
+ ` .env.encrypted: ${status.envEncrypted.exists ? "\u2713 (exists)" : "\u2717 (not found)"}`
74609
75014
  );
74610
- console.log(` Path: ${envEncryptedPath}`);
74611
- console.log("\nEnvironment Variables:");
75015
+ console.log("\n AGE_SECRET_KEY:");
75016
+ const envIcon = status.ageSecretKey.configured ? "\u2713" : "\u2717";
74612
75017
  console.log(
74613
- ` AGE_SECRET_KEY: ${ageKeyConfigured ? "\u2713" : "\u2717"} ${ageKeyConfigured ? `(${status.ageSecretKey.masked})` : "(not set)"}`
75018
+ ` env: ${envIcon} ${status.ageSecretKey.configured ? `(${status.ageSecretKey.masked})` : "not set"}`
74614
75019
  );
75020
+ console.log(`
75021
+ Keychain (${status.keychain.platform}):`);
75022
+ if (!status.keychain.available) {
75023
+ console.log(` ${KEY_NAME2}: \u2717 (keychain CLI not available)`);
75024
+ } else {
75025
+ const kcIcon = status.keychain.stored ? "\u2713" : "\u2717";
75026
+ console.log(
75027
+ ` ${KEY_NAME2}: ${kcIcon} ${status.keychain.stored ? "(stored)" : "not found"}`
75028
+ );
75029
+ }
75030
+ console.log("\n 1Password:");
75031
+ if (!status.onepassword.cliInstalled) {
75032
+ console.log(` op CLI: \u2717 not installed (${getOpInstallInstructions()})`);
75033
+ } else {
75034
+ const signedInIcon = status.onepassword.signedIn ? "\u2713" : "\u2717";
75035
+ console.log(
75036
+ ` op CLI: \u2713 installed, ${signedInIcon} ${status.onepassword.signedIn ? "signed in" : "not signed in"}`
75037
+ );
75038
+ }
74615
75039
  console.log(
74616
- ` OP_SERVICE_ACCOUNT_TOKEN: ${opConfigured ? "\u2713" : "\u2717"} ${opConfigured ? "(configured)" : "(not set)"}`
75040
+ ` service account: ${status.onepassword.serviceAccountConfigured ? "\u2713 configured" : "\u2717 not set"}`
74617
75041
  );
74618
- console.log("\nEnv Source Priority:");
74619
- if (envSource === "local") {
74620
- console.log(" \u2192 Using local .env.local file");
74621
- } else if (envSource === "encrypted") {
74622
- console.log(" \u2192 Using encrypted .env.encrypted file");
75042
+ console.log("\n Shell Profile:");
75043
+ if (status.shellProfile.path) {
75044
+ const spIcon = status.shellProfile.hasExport ? "\u2713" : "\u2717";
75045
+ console.log(
75046
+ ` ${status.shellProfile.path}: ${spIcon} ${status.shellProfile.hasExport ? "export configured" : "no export line"}`
75047
+ );
75048
+ } else {
75049
+ console.log(" Could not detect shell profile");
75050
+ }
75051
+ console.log("\n Env Source:");
75052
+ if (status.envSource === "local") {
75053
+ console.log(" \u2192 Using .env.local");
75054
+ } else if (status.envSource === "encrypted") {
75055
+ console.log(" \u2192 Using .env.encrypted");
74623
75056
  } else {
74624
- console.log(" \u2192 No env source available");
74625
- console.log("\n\u26A0 No environment configuration found.");
74626
- console.log("\nOptions:");
74627
- console.log(" 1. Create .env.local with your secrets");
74628
- console.log(" 2. Use encrypted .env.encrypted (requires AGE_SECRET_KEY)");
74629
- console.log("\nSee docs/ENV.md for setup instructions.");
75057
+ console.log(" \u2192 No env source available");
75058
+ }
75059
+ const allGood = status.ageSecretKey.configured && status.keychain.stored && status.shellProfile.hasExport;
75060
+ if (allGood) {
75061
+ console.log("\n Everything looks good.\n");
75062
+ } else if (!status.keychain.stored) {
75063
+ console.log("\n Run 'skill auth setup' to configure.\n");
74630
75064
  }
74631
75065
  }
74632
75066
 
74633
75067
  // src/commands/auth/index.ts
74634
75068
  function registerAuthCommands(program3) {
74635
- const auth = program3.command("auth").description("Manage CLI auth status");
74636
- auth.command("status").description("Check encryption setup status").option("--json", "Output as JSON").action(statusAction);
75069
+ const auth = program3.command("auth").description("Auth and secret management");
75070
+ registerSetupCommand(auth);
75071
+ registerStatusCommand(auth);
74637
75072
  }
74638
75073
 
74639
75074
  // src/commands/axiom/index.ts
@@ -75819,9 +76254,9 @@ Saved to ${options.output}`);
75819
76254
  }
75820
76255
  }
75821
76256
  async function toEvalite(options) {
75822
- const { readFileSync: readFileSync8 } = await import("fs");
76257
+ const { readFileSync: readFileSync9 } = await import("fs");
75823
76258
  const data2 = JSON.parse(
75824
- readFileSync8(options.input, "utf-8")
76259
+ readFileSync9(options.input, "utf-8")
75825
76260
  );
75826
76261
  const evaliteData = data2.map((d) => ({
75827
76262
  input: d.triggerMessage.body,
@@ -75880,7 +76315,7 @@ var registerDbStatusCommand = (prog) => {
75880
76315
 
75881
76316
  // src/commands/deploys.ts
75882
76317
  init_esm_shims();
75883
- import { execSync as execSync2 } from "child_process";
76318
+ import { execSync as execSync4 } from "child_process";
75884
76319
  import "commander";
75885
76320
  var VERCEL_SCOPE = "skillrecordings";
75886
76321
  var APPS = {
@@ -75898,7 +76333,7 @@ function stripAnsi(str2) {
75898
76333
  }
75899
76334
  function runVercel(args) {
75900
76335
  try {
75901
- const raw = execSync2(`vercel ${args} --scope ${VERCEL_SCOPE} --yes 2>&1`, {
76336
+ const raw = execSync4(`vercel ${args} --scope ${VERCEL_SCOPE} --yes 2>&1`, {
75902
76337
  encoding: "utf-8",
75903
76338
  timeout: 3e4,
75904
76339
  stdio: ["pipe", "pipe", "pipe"],
@@ -75980,7 +76415,7 @@ async function deploysLogs(appName, options) {
75980
76415
  console.log(` Deployment: ${url}
75981
76416
  `);
75982
76417
  try {
75983
- const logsOutput = execSync2(
76418
+ const logsOutput = execSync4(
75984
76419
  `vercel logs ${url} --scope ${VERCEL_SCOPE} --output short 2>&1 | tail -${options.lines || "30"}`,
75985
76420
  { encoding: "utf-8", timeout: 3e4 }
75986
76421
  );
@@ -77500,7 +77935,7 @@ async function runScenario(scenario, systemPrompt, model, verbose, useRealTools)
77500
77935
  const startTime = Date.now();
77501
77936
  const failureReasons = [];
77502
77937
  const trigger = scenario.trigger || scenario.triggerMessage || { subject: "", body: "" };
77503
- const input2 = `Subject: ${trigger.subject}
77938
+ const input3 = `Subject: ${trigger.subject}
77504
77939
 
77505
77940
  ${trigger.body}`;
77506
77941
  const name = scenario.name || trigger.subject || scenario.id;
@@ -77544,7 +77979,7 @@ App: ${scenario.appId || "total-typescript"}`;
77544
77979
  const result = await generateText({
77545
77980
  model,
77546
77981
  system: evalSystemPrompt,
77547
- messages: [{ role: "user", content: input2 }],
77982
+ messages: [{ role: "user", content: input3 }],
77548
77983
  tools,
77549
77984
  stopWhen: stepCountIs(10)
77550
77985
  // Match production - use stopWhen for multi-step
@@ -77955,12 +78390,12 @@ async function scoreProduction(options) {
77955
78390
 
77956
78391
  // src/commands/eval-local/seed.ts
77957
78392
  init_esm_shims();
77958
- import { join as join2 } from "path";
78393
+ import { join as join3 } from "path";
77959
78394
  import { glob as glob3 } from "glob";
77960
78395
 
77961
78396
  // src/lib/eval-seed.ts
77962
78397
  init_esm_shims();
77963
- import { join } from "path";
78398
+ import { join as join2 } from "path";
77964
78399
  import { readFile as readFile4, readdir } from "fs/promises";
77965
78400
  import { glob as glob2 } from "glob";
77966
78401
  import matter from "gray-matter";
@@ -77996,7 +78431,7 @@ async function loadJsonFiles(dirPath) {
77996
78431
  const jsonFiles = files.filter((f) => f.endsWith(".json"));
77997
78432
  const items = await Promise.all(
77998
78433
  jsonFiles.map(async (file) => {
77999
- const content = await readFile4(join(dirPath, file), "utf-8");
78434
+ const content = await readFile4(join2(dirPath, file), "utf-8");
78000
78435
  return JSON.parse(content);
78001
78436
  })
78002
78437
  );
@@ -78006,7 +78441,7 @@ async function loadJsonFiles(dirPath) {
78006
78441
  }
78007
78442
  }
78008
78443
  async function loadKnowledgeFiles(basePath) {
78009
- const files = await glob2(join(basePath, "**/*.md"));
78444
+ const files = await glob2(join2(basePath, "**/*.md"));
78010
78445
  const docs = [];
78011
78446
  for (const filePath of files) {
78012
78447
  const content = await readFile4(filePath, "utf-8");
@@ -78201,16 +78636,16 @@ async function seed(options) {
78201
78636
  }
78202
78637
  }
78203
78638
  if (!options.json) console.log("\u{1F4E6} Seeding apps...");
78204
- const apps = await loadJsonFiles(join2(fixturesPath, "apps"));
78639
+ const apps = await loadJsonFiles(join3(fixturesPath, "apps"));
78205
78640
  result.apps = await seedApps(connection, apps);
78206
78641
  if (!options.json) console.log("\u{1F465} Loading customer fixtures...");
78207
- const customers = await loadJsonFiles(join2(fixturesPath, "customers"));
78642
+ const customers = await loadJsonFiles(join3(fixturesPath, "customers"));
78208
78643
  result.customers = customers.length;
78209
78644
  if (!options.json) console.log("\u{1F4DA} Seeding knowledge base...");
78210
- const knowledge = await loadKnowledgeFiles(join2(fixturesPath, "knowledge"));
78645
+ const knowledge = await loadKnowledgeFiles(join3(fixturesPath, "knowledge"));
78211
78646
  result.knowledge = knowledge.length;
78212
78647
  result.embeddings = await seedKnowledgeBase(knowledge, !options.json);
78213
- const scenarioFiles = await glob3(join2(fixturesPath, "scenarios/**/*.json"));
78648
+ const scenarioFiles = await glob3(join3(fixturesPath, "scenarios/**/*.json"));
78214
78649
  result.scenarios = scenarioFiles.length;
78215
78650
  await connection.end();
78216
78651
  if (options.json) {
@@ -78263,8 +78698,8 @@ init_esm_shims();
78263
78698
  // src/commands/eval-pipeline/run.ts
78264
78699
  init_esm_shims();
78265
78700
  import { createHash } from "crypto";
78266
- import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync as writeFileSync2 } from "fs";
78267
- import { join as join3 } from "path";
78701
+ import { existsSync as existsSync3, mkdirSync, readFileSync as readFileSync2, rmSync, writeFileSync as writeFileSync2 } from "fs";
78702
+ import { join as join4 } from "path";
78268
78703
  import { readFile as readFile5 } from "fs/promises";
78269
78704
  import { glob as glob4 } from "glob";
78270
78705
 
@@ -78670,12 +79105,12 @@ function getCacheKey(scenarioId, classifySourceHash) {
78670
79105
  function getClassifySourceHash() {
78671
79106
  try {
78672
79107
  const possiblePaths = [
78673
- join3(process.cwd(), "packages/core/src/pipeline/classify.ts"),
78674
- join3(process.cwd(), "../core/src/pipeline/classify.ts")
79108
+ join4(process.cwd(), "packages/core/src/pipeline/classify.ts"),
79109
+ join4(process.cwd(), "../core/src/pipeline/classify.ts")
78675
79110
  ];
78676
79111
  for (const path2 of possiblePaths) {
78677
- if (existsSync(path2)) {
78678
- const content = readFileSync(path2, "utf-8");
79112
+ if (existsSync3(path2)) {
79113
+ const content = readFileSync2(path2, "utf-8");
78679
79114
  return createHash("md5").update(content).digest("hex");
78680
79115
  }
78681
79116
  }
@@ -78684,10 +79119,10 @@ function getClassifySourceHash() {
78684
79119
  return createHash("md5").update(Math.floor(Date.now() / 3e5).toString()).digest("hex");
78685
79120
  }
78686
79121
  function loadCachedClassify(cacheKey) {
78687
- const cachePath = join3(CACHE_DIR, `${cacheKey}.json`);
79122
+ const cachePath = join4(CACHE_DIR, `${cacheKey}.json`);
78688
79123
  try {
78689
- if (existsSync(cachePath)) {
78690
- return JSON.parse(readFileSync(cachePath, "utf-8"));
79124
+ if (existsSync3(cachePath)) {
79125
+ return JSON.parse(readFileSync2(cachePath, "utf-8"));
78691
79126
  }
78692
79127
  } catch {
78693
79128
  }
@@ -78695,17 +79130,17 @@ function loadCachedClassify(cacheKey) {
78695
79130
  }
78696
79131
  function saveCachedClassify(cacheKey, result) {
78697
79132
  try {
78698
- if (!existsSync(CACHE_DIR)) {
79133
+ if (!existsSync3(CACHE_DIR)) {
78699
79134
  mkdirSync(CACHE_DIR, { recursive: true });
78700
79135
  }
78701
- const cachePath = join3(CACHE_DIR, `${cacheKey}.json`);
79136
+ const cachePath = join4(CACHE_DIR, `${cacheKey}.json`);
78702
79137
  writeFileSync2(cachePath, JSON.stringify(result));
78703
79138
  } catch {
78704
79139
  }
78705
79140
  }
78706
79141
  function clearClassifyCache() {
78707
79142
  try {
78708
- if (existsSync(CACHE_DIR)) {
79143
+ if (existsSync3(CACHE_DIR)) {
78709
79144
  rmSync(CACHE_DIR, { recursive: true, force: true });
78710
79145
  }
78711
79146
  } catch {
@@ -78921,7 +79356,7 @@ async function runClassifyEval(scenarios, options) {
78921
79356
  durationMs: 0
78922
79357
  };
78923
79358
  }
78924
- const input2 = {
79359
+ const input3 = {
78925
79360
  subject: trigger.subject,
78926
79361
  body: trigger.body,
78927
79362
  appId: scenario.appId
@@ -78935,14 +79370,14 @@ async function runClassifyEval(scenarios, options) {
78935
79370
  if (cached) {
78936
79371
  result = cached;
78937
79372
  } else {
78938
- result = await classify(input2, {
79373
+ result = await classify(input3, {
78939
79374
  forceLLM: options.forceLlm,
78940
79375
  model: options.model
78941
79376
  });
78942
79377
  saveCachedClassify(cacheKey, result);
78943
79378
  }
78944
79379
  } else {
78945
- result = await classify(input2, {
79380
+ result = await classify(input3, {
78946
79381
  forceLLM: options.forceLlm,
78947
79382
  model: options.model
78948
79383
  });
@@ -79011,7 +79446,7 @@ async function runRouteEval(scenarios, options) {
79011
79446
  durationMs: 0
79012
79447
  };
79013
79448
  }
79014
- const input2 = {
79449
+ const input3 = {
79015
79450
  subject: trigger.subject,
79016
79451
  body: trigger.body,
79017
79452
  appId: scenario.appId
@@ -79025,20 +79460,20 @@ async function runRouteEval(scenarios, options) {
79025
79460
  if (cached) {
79026
79461
  classification = cached;
79027
79462
  } else {
79028
- classification = await classify(input2, {
79463
+ classification = await classify(input3, {
79029
79464
  forceLLM: options.forceLlm,
79030
79465
  model: options.model
79031
79466
  });
79032
79467
  saveCachedClassify(cacheKey, classification);
79033
79468
  }
79034
79469
  } else {
79035
- classification = await classify(input2, {
79470
+ classification = await classify(input3, {
79036
79471
  forceLLM: options.forceLlm,
79037
79472
  model: options.model
79038
79473
  });
79039
79474
  }
79040
79475
  const routeResult = route({
79041
- message: input2,
79476
+ message: input3,
79042
79477
  classification,
79043
79478
  appConfig: {
79044
79479
  appId: scenario.appId || "eval",
@@ -79556,7 +79991,7 @@ Latency: ${avgLatency.toFixed(0)}ms avg`);
79556
79991
 
79557
79992
  // src/commands/eval-pipeline/seed.ts
79558
79993
  init_esm_shims();
79559
- import { join as join4 } from "path";
79994
+ import { join as join5 } from "path";
79560
79995
  import { glob as glob5 } from "glob";
79561
79996
  async function seed2(options) {
79562
79997
  const fixturesPath = options.fixtures || "fixtures";
@@ -79586,20 +80021,20 @@ async function seed2(options) {
79586
80021
  await cleanQdrant();
79587
80022
  }
79588
80023
  if (!options.json) console.log("\u{1F4E6} Seeding apps...");
79589
- const apps = await loadJsonFiles(join4(fixturesPath, "apps"));
80024
+ const apps = await loadJsonFiles(join5(fixturesPath, "apps"));
79590
80025
  result.apps = await seedApps(connection, apps);
79591
80026
  const [trustRows] = await connection.execute(
79592
80027
  "SELECT COUNT(*) as count FROM SUPPORT_trust_scores"
79593
80028
  );
79594
80029
  result.trustScores = trustRows[0].count;
79595
80030
  if (!options.json) console.log("\u{1F465} Loading customer fixtures...");
79596
- const customers = await loadJsonFiles(join4(fixturesPath, "customers"));
80031
+ const customers = await loadJsonFiles(join5(fixturesPath, "customers"));
79597
80032
  result.customers = customers.length;
79598
80033
  if (!options.json) console.log("\u{1F4DA} Seeding knowledge base...");
79599
- const knowledge = await loadKnowledgeFiles(join4(fixturesPath, "knowledge"));
80034
+ const knowledge = await loadKnowledgeFiles(join5(fixturesPath, "knowledge"));
79600
80035
  result.knowledge = knowledge.length;
79601
80036
  result.embeddings = await seedKnowledgeBase(knowledge, !options.json);
79602
- const scenarioFiles = await glob5(join4(fixturesPath, "scenarios/**/*.json"));
80037
+ const scenarioFiles = await glob5(join5(fixturesPath, "scenarios/**/*.json"));
79603
80038
  result.scenarios = scenarioFiles.length;
79604
80039
  await connection.end();
79605
80040
  if (options.json) {
@@ -79656,7 +80091,7 @@ function registerEvalPipelineCommands(program3) {
79656
80091
 
79657
80092
  // src/commands/eval-prompt.ts
79658
80093
  init_esm_shims();
79659
- import { readFileSync as readFileSync2, writeFileSync as writeFileSync3, existsSync as existsSync2 } from "fs";
80094
+ import { readFileSync as readFileSync3, writeFileSync as writeFileSync3, existsSync as existsSync4 } from "fs";
79660
80095
  import { generateText as generateText2, stepCountIs as stepCountIs2, tool as tool4 } from "ai";
79661
80096
  import { z as z5 } from "zod";
79662
80097
  var leakPatterns = [
@@ -79789,14 +80224,14 @@ var mockTools = {
79789
80224
  };
79790
80225
  async function runSingleEval(prompt, sample, model) {
79791
80226
  const startTime = Date.now();
79792
- const input2 = `Subject: ${sample.triggerMessage.subject}
80227
+ const input3 = `Subject: ${sample.triggerMessage.subject}
79793
80228
 
79794
80229
  ${sample.triggerMessage.body}`;
79795
80230
  try {
79796
80231
  const result = await generateText2({
79797
80232
  model,
79798
80233
  system: prompt + "\n\nApp: total-typescript",
79799
- messages: [{ role: "user", content: input2 }],
80234
+ messages: [{ role: "user", content: input3 }],
79800
80235
  tools: mockTools,
79801
80236
  stopWhen: stepCountIs2(10)
79802
80237
  });
@@ -79805,7 +80240,7 @@ ${sample.triggerMessage.body}`;
79805
80240
  const output = draftCall ? draftCall.input.body : "";
79806
80241
  return {
79807
80242
  id: sample.id.slice(0, 8),
79808
- input: input2.slice(0, 100),
80243
+ input: input3.slice(0, 100),
79809
80244
  output,
79810
80245
  score: scoreResponse(output),
79811
80246
  durationMs: Date.now() - startTime,
@@ -79815,7 +80250,7 @@ ${sample.triggerMessage.body}`;
79815
80250
  } catch (error) {
79816
80251
  return {
79817
80252
  id: sample.id.slice(0, 8),
79818
- input: input2.slice(0, 100),
80253
+ input: input3.slice(0, 100),
79819
80254
  output: `ERROR: ${error instanceof Error ? error.message : "Unknown"}`,
79820
80255
  score: { leaks: [], meta: [], banned: [], passed: false },
79821
80256
  durationMs: Date.now() - startTime,
@@ -79836,20 +80271,20 @@ async function runEval2(options) {
79836
80271
  } = options;
79837
80272
  let prompt = SUPPORT_AGENT_PROMPT;
79838
80273
  if (promptPath) {
79839
- if (!existsSync2(promptPath)) {
80274
+ if (!existsSync4(promptPath)) {
79840
80275
  console.error(`Prompt file not found: ${promptPath}`);
79841
80276
  process.exit(1);
79842
80277
  }
79843
- prompt = readFileSync2(promptPath, "utf-8");
80278
+ prompt = readFileSync3(promptPath, "utf-8");
79844
80279
  console.log(`Using prompt from: ${promptPath}`);
79845
80280
  } else {
79846
80281
  console.log("Using production prompt");
79847
80282
  }
79848
- if (!existsSync2(datasetPath)) {
80283
+ if (!existsSync4(datasetPath)) {
79849
80284
  console.error(`Dataset not found: ${datasetPath}`);
79850
80285
  process.exit(1);
79851
80286
  }
79852
- const dataset = JSON.parse(readFileSync2(datasetPath, "utf-8"));
80287
+ const dataset = JSON.parse(readFileSync3(datasetPath, "utf-8"));
79853
80288
  const samples = dataset.slice(0, limit2);
79854
80289
  console.log(`
79855
80290
  \u{1F9EA} Running eval on ${samples.length} samples (model: ${model})
@@ -79921,9 +80356,9 @@ async function comparePrompts(options) {
79921
80356
  limit: limit2 = 10,
79922
80357
  model = "anthropic/claude-haiku-4-5"
79923
80358
  } = options;
79924
- const baselinePrompt = baseline ? readFileSync2(baseline, "utf-8") : SUPPORT_AGENT_PROMPT;
79925
- const candidatePrompt = readFileSync2(candidate, "utf-8");
79926
- const dataset = JSON.parse(readFileSync2(datasetPath, "utf-8"));
80359
+ const baselinePrompt = baseline ? readFileSync3(baseline, "utf-8") : SUPPORT_AGENT_PROMPT;
80360
+ const candidatePrompt = readFileSync3(candidate, "utf-8");
80361
+ const dataset = JSON.parse(readFileSync3(datasetPath, "utf-8"));
79927
80362
  const samples = dataset.slice(0, limit2);
79928
80363
  console.log(`
79929
80364
  \u{1F52C} Comparing prompts on ${samples.length} samples
@@ -79985,20 +80420,20 @@ init_esm_shims();
79985
80420
 
79986
80421
  // src/commands/faq/classify.ts
79987
80422
  init_esm_shims();
79988
- import { appendFileSync, existsSync as existsSync3, mkdirSync as mkdirSync2, readFileSync as readFileSync3 } from "fs";
79989
- import { dirname as dirname2, join as join5, resolve } from "path";
80423
+ import { appendFileSync as appendFileSync2, existsSync as existsSync5, mkdirSync as mkdirSync2, readFileSync as readFileSync4 } from "fs";
80424
+ import { dirname as dirname2, join as join6, resolve } from "path";
79990
80425
  import { generateObject } from "ai";
79991
80426
  import { z as z6 } from "zod";
79992
80427
  var PROJECT_ROOT = resolve(__dirname, "../../../..");
79993
- var DEFAULT_PARQUET_PATH = join5(
80428
+ var DEFAULT_PARQUET_PATH = join6(
79994
80429
  PROJECT_ROOT,
79995
80430
  "artifacts/phase-0/embeddings/v2/conversations.parquet"
79996
80431
  );
79997
- var DEFAULT_TAXONOMY_PATH = join5(
80432
+ var DEFAULT_TAXONOMY_PATH = join6(
79998
80433
  PROJECT_ROOT,
79999
80434
  "artifacts/phase-1/llm-topics/taxonomy.json"
80000
80435
  );
80001
- var DEFAULT_OUTPUT_PATH = join5(
80436
+ var DEFAULT_OUTPUT_PATH = join6(
80002
80437
  PROJECT_ROOT,
80003
80438
  "artifacts/phase-1/llm-topics/classifications.jsonl"
80004
80439
  );
@@ -80007,7 +80442,7 @@ var CONCURRENT_LIMIT = 10;
80007
80442
  var DELAY_BETWEEN_BATCHES_MS = 100;
80008
80443
  var MODEL = "anthropic/claude-haiku-4-5";
80009
80444
  async function loadConversationsFromParquet(parquetPath) {
80010
- const { execSync: execSync3 } = await import("child_process");
80445
+ const { execSync: execSync5 } = await import("child_process");
80011
80446
  const query = `
80012
80447
  SELECT
80013
80448
  conversation_id,
@@ -80018,7 +80453,7 @@ async function loadConversationsFromParquet(parquetPath) {
80018
80453
  WHERE first_message IS NOT NULL
80019
80454
  ORDER BY conversation_id
80020
80455
  `;
80021
- const result = execSync3(`duckdb -json -c "${query.replace(/"/g, '\\"')}"`, {
80456
+ const result = execSync5(`duckdb -json -c "${query.replace(/"/g, '\\"')}"`, {
80022
80457
  encoding: "utf-8",
80023
80458
  maxBuffer: 100 * 1024 * 1024
80024
80459
  // 100MB buffer for large datasets
@@ -80028,10 +80463,10 @@ async function loadConversationsFromParquet(parquetPath) {
80028
80463
  }
80029
80464
  function loadExistingClassifications(outputPath) {
80030
80465
  const classifiedIds = /* @__PURE__ */ new Set();
80031
- if (!existsSync3(outputPath)) {
80466
+ if (!existsSync5(outputPath)) {
80032
80467
  return classifiedIds;
80033
80468
  }
80034
- const content = readFileSync3(outputPath, "utf-8");
80469
+ const content = readFileSync4(outputPath, "utf-8");
80035
80470
  const lines = content.split("\n").filter((line) => line.trim());
80036
80471
  for (const line of lines) {
80037
80472
  try {
@@ -80043,7 +80478,7 @@ function loadExistingClassifications(outputPath) {
80043
80478
  return classifiedIds;
80044
80479
  }
80045
80480
  function appendClassification(outputPath, classification) {
80046
- appendFileSync(outputPath, JSON.stringify(classification) + "\n");
80481
+ appendFileSync2(outputPath, JSON.stringify(classification) + "\n");
80047
80482
  }
80048
80483
  var classifySchema = z6.object({
80049
80484
  topicId: z6.string(),
@@ -80172,20 +80607,20 @@ async function faqClassify(options) {
80172
80607
  console.log(` Concurrency: ${CONCURRENT_LIMIT}`);
80173
80608
  console.log(` Dry run: ${options.dryRun ?? false}`);
80174
80609
  console.log("");
80175
- if (!existsSync3(parquetPath)) {
80610
+ if (!existsSync5(parquetPath)) {
80176
80611
  console.error(`\u274C Parquet file not found: ${parquetPath}`);
80177
80612
  process.exit(1);
80178
80613
  }
80179
- if (!existsSync3(taxonomyPath)) {
80614
+ if (!existsSync5(taxonomyPath)) {
80180
80615
  console.error(`\u274C Taxonomy file not found: ${taxonomyPath}`);
80181
80616
  process.exit(1);
80182
80617
  }
80183
80618
  const outputDir = dirname2(outputPath);
80184
- if (!existsSync3(outputDir)) {
80619
+ if (!existsSync5(outputDir)) {
80185
80620
  mkdirSync2(outputDir, { recursive: true });
80186
80621
  }
80187
80622
  console.log("\u{1F4DA} Loading taxonomy...");
80188
- const taxonomy = JSON.parse(readFileSync3(taxonomyPath, "utf-8"));
80623
+ const taxonomy = JSON.parse(readFileSync4(taxonomyPath, "utf-8"));
80189
80624
  const validTopicIds = new Set(taxonomy.topics.map((t2) => t2.id));
80190
80625
  validTopicIds.add("unknown");
80191
80626
  console.log(` Found ${taxonomy.topics.length} topics`);
@@ -80278,51 +80713,51 @@ function registerFaqClassifyCommands(program3) {
80278
80713
 
80279
80714
  // src/commands/faq/cluster.ts
80280
80715
  init_esm_shims();
80281
- import { existsSync as existsSync5 } from "fs";
80282
- import { join as join7, resolve as resolve2 } from "path";
80716
+ import { existsSync as existsSync7 } from "fs";
80717
+ import { join as join8, resolve as resolve2 } from "path";
80283
80718
 
80284
80719
  // ../core/src/faq/production-clusterer.ts
80285
80720
  init_esm_shims();
80286
- import { existsSync as existsSync4, mkdirSync as mkdirSync3, readFileSync as readFileSync4, writeFileSync as writeFileSync4 } from "fs";
80287
- import { join as join6 } from "path";
80721
+ import { existsSync as existsSync6, mkdirSync as mkdirSync3, readFileSync as readFileSync5, writeFileSync as writeFileSync4 } from "fs";
80722
+ import { join as join7 } from "path";
80288
80723
  function readPhase0Assignments(phase0Path) {
80289
- const assignmentsPath = join6(phase0Path, "clusters/v1/assignments.json");
80290
- if (!existsSync4(assignmentsPath)) {
80291
- const latestPath = join6(phase0Path, "clusters/latest/assignments.json");
80292
- if (!existsSync4(latestPath)) {
80724
+ const assignmentsPath = join7(phase0Path, "clusters/v1/assignments.json");
80725
+ if (!existsSync6(assignmentsPath)) {
80726
+ const latestPath = join7(phase0Path, "clusters/latest/assignments.json");
80727
+ if (!existsSync6(latestPath)) {
80293
80728
  throw new Error(`Phase 0 assignments not found at ${assignmentsPath}`);
80294
80729
  }
80295
- const content2 = readFileSync4(latestPath, "utf-8");
80730
+ const content2 = readFileSync5(latestPath, "utf-8");
80296
80731
  return JSON.parse(content2);
80297
80732
  }
80298
- const content = readFileSync4(assignmentsPath, "utf-8");
80733
+ const content = readFileSync5(assignmentsPath, "utf-8");
80299
80734
  return JSON.parse(content);
80300
80735
  }
80301
80736
  function readPhase0Labels(phase0Path) {
80302
- const labelsPath = join6(phase0Path, "clusters/v1/labels.json");
80303
- if (!existsSync4(labelsPath)) {
80304
- const latestPath = join6(phase0Path, "clusters/latest/labels.json");
80305
- if (!existsSync4(latestPath)) {
80737
+ const labelsPath = join7(phase0Path, "clusters/v1/labels.json");
80738
+ if (!existsSync6(labelsPath)) {
80739
+ const latestPath = join7(phase0Path, "clusters/latest/labels.json");
80740
+ if (!existsSync6(latestPath)) {
80306
80741
  throw new Error(`Phase 0 labels not found at ${labelsPath}`);
80307
80742
  }
80308
- const content2 = readFileSync4(latestPath, "utf-8");
80743
+ const content2 = readFileSync5(latestPath, "utf-8");
80309
80744
  const parsed2 = JSON.parse(content2);
80310
80745
  return parsed2.clusters || [];
80311
80746
  }
80312
- const content = readFileSync4(labelsPath, "utf-8");
80747
+ const content = readFileSync5(labelsPath, "utf-8");
80313
80748
  const parsed = JSON.parse(content);
80314
80749
  return parsed.clusters || [];
80315
80750
  }
80316
80751
  function readPhase0Metrics(phase0Path) {
80317
- const metricsPath = join6(phase0Path, "clusters/v1/metrics.json");
80318
- if (!existsSync4(metricsPath)) {
80319
- const latestPath = join6(phase0Path, "clusters/latest/metrics.json");
80320
- if (!existsSync4(latestPath)) {
80752
+ const metricsPath = join7(phase0Path, "clusters/v1/metrics.json");
80753
+ if (!existsSync6(metricsPath)) {
80754
+ const latestPath = join7(phase0Path, "clusters/latest/metrics.json");
80755
+ if (!existsSync6(latestPath)) {
80321
80756
  throw new Error(`Phase 0 metrics not found at ${metricsPath}`);
80322
80757
  }
80323
- return JSON.parse(readFileSync4(latestPath, "utf-8"));
80758
+ return JSON.parse(readFileSync5(latestPath, "utf-8"));
80324
80759
  }
80325
- return JSON.parse(readFileSync4(metricsPath, "utf-8"));
80760
+ return JSON.parse(readFileSync5(metricsPath, "utf-8"));
80326
80761
  }
80327
80762
  function calculateConfidence2(distance) {
80328
80763
  if (distance === null) return 0;
@@ -80437,17 +80872,17 @@ async function generateProductionClustering(options) {
80437
80872
  return result;
80438
80873
  }
80439
80874
  function writeProductionArtifacts(result, outputPath) {
80440
- const versionPath = join6(outputPath, result.version);
80441
- if (!existsSync4(versionPath)) {
80875
+ const versionPath = join7(outputPath, result.version);
80876
+ if (!existsSync6(versionPath)) {
80442
80877
  mkdirSync3(versionPath, { recursive: true });
80443
80878
  }
80444
- const resultPath = join6(versionPath, "clustering-result.json");
80879
+ const resultPath = join7(versionPath, "clustering-result.json");
80445
80880
  writeFileSync4(resultPath, JSON.stringify(result, null, 2));
80446
80881
  console.log(`\u2705 Written: ${resultPath}`);
80447
- const assignmentsPath = join6(versionPath, "assignments.json");
80882
+ const assignmentsPath = join7(versionPath, "assignments.json");
80448
80883
  writeFileSync4(assignmentsPath, JSON.stringify(result.assignments, null, 2));
80449
80884
  console.log(`\u2705 Written: ${assignmentsPath}`);
80450
- const clustersPath = join6(versionPath, "clusters.json");
80885
+ const clustersPath = join7(versionPath, "clusters.json");
80451
80886
  writeFileSync4(
80452
80887
  clustersPath,
80453
80888
  JSON.stringify(
@@ -80462,7 +80897,7 @@ function writeProductionArtifacts(result, outputPath) {
80462
80897
  )
80463
80898
  );
80464
80899
  console.log(`\u2705 Written: ${clustersPath}`);
80465
- const summaryPath = join6(versionPath, "summary.json");
80900
+ const summaryPath = join7(versionPath, "summary.json");
80466
80901
  const summary = {
80467
80902
  version: result.version,
80468
80903
  generatedAt: result.generatedAt,
@@ -80476,8 +80911,8 @@ function writeProductionArtifacts(result, outputPath) {
80476
80911
  };
80477
80912
  writeFileSync4(summaryPath, JSON.stringify(summary, null, 2));
80478
80913
  console.log(`\u2705 Written: ${summaryPath}`);
80479
- const latestPath = join6(outputPath, "latest");
80480
- if (existsSync4(latestPath)) {
80914
+ const latestPath = join7(outputPath, "latest");
80915
+ if (existsSync6(latestPath)) {
80481
80916
  const { rmSync: rmSync2 } = __require("fs");
80482
80917
  rmSync2(latestPath, { recursive: true, force: true });
80483
80918
  }
@@ -80488,9 +80923,9 @@ function writeProductionArtifacts(result, outputPath) {
80488
80923
  "clusters.json",
80489
80924
  "summary.json"
80490
80925
  ]) {
80491
- const src = join6(versionPath, file);
80492
- const dst = join6(latestPath, file);
80493
- writeFileSync4(dst, readFileSync4(src));
80926
+ const src = join7(versionPath, file);
80927
+ const dst = join7(latestPath, file);
80928
+ writeFileSync4(dst, readFileSync5(src));
80494
80929
  }
80495
80930
  console.log(`\u2705 Updated: ${latestPath}`);
80496
80931
  }
@@ -80542,22 +80977,22 @@ function displayClusteringSummary(result) {
80542
80977
 
80543
80978
  // src/commands/faq/cluster.ts
80544
80979
  var PROJECT_ROOT2 = resolve2(__dirname, "../../../..");
80545
- var DEFAULT_PHASE0_PATH = join7(PROJECT_ROOT2, "artifacts/phase-0");
80546
- var DEFAULT_OUTPUT_PATH2 = join7(PROJECT_ROOT2, "artifacts/phase-1/clustering");
80980
+ var DEFAULT_PHASE0_PATH = join8(PROJECT_ROOT2, "artifacts/phase-0");
80981
+ var DEFAULT_OUTPUT_PATH2 = join8(PROJECT_ROOT2, "artifacts/phase-1/clustering");
80547
80982
  function validatePaths(phase0Path) {
80548
- const assignmentsPath = join7(phase0Path, "clusters/v1/assignments.json");
80549
- const labelsPath = join7(phase0Path, "clusters/v1/labels.json");
80550
- const metricsPath = join7(phase0Path, "clusters/v1/metrics.json");
80551
- if (!existsSync5(assignmentsPath)) {
80983
+ const assignmentsPath = join8(phase0Path, "clusters/v1/assignments.json");
80984
+ const labelsPath = join8(phase0Path, "clusters/v1/labels.json");
80985
+ const metricsPath = join8(phase0Path, "clusters/v1/metrics.json");
80986
+ if (!existsSync7(assignmentsPath)) {
80552
80987
  throw new Error(
80553
80988
  `Phase 0 assignments not found at ${assignmentsPath}
80554
80989
  Run Phase 0 clustering first or specify correct --phase0-path`
80555
80990
  );
80556
80991
  }
80557
- if (!existsSync5(labelsPath)) {
80992
+ if (!existsSync7(labelsPath)) {
80558
80993
  throw new Error(`Phase 0 labels not found at ${labelsPath}`);
80559
80994
  }
80560
- if (!existsSync5(metricsPath)) {
80995
+ if (!existsSync7(metricsPath)) {
80561
80996
  throw new Error(`Phase 0 metrics not found at ${metricsPath}`);
80562
80997
  }
80563
80998
  }
@@ -80586,7 +81021,7 @@ async function faqCluster(options) {
80586
81021
  console.log("\n\u{1F4DD} Writing artifacts...");
80587
81022
  writeProductionArtifacts(result, outputPath);
80588
81023
  console.log("\n\u2705 Production clustering complete!");
80589
- console.log(` Artifacts written to: ${join7(outputPath, version)}`);
81024
+ console.log(` Artifacts written to: ${join8(outputPath, version)}`);
80590
81025
  } else {
80591
81026
  console.log("\n\u{1F9EA} Dry run - no artifacts written");
80592
81027
  }
@@ -80620,8 +81055,8 @@ function registerFaqClusterCommands(program3) {
80620
81055
 
80621
81056
  // src/commands/faq/extract.ts
80622
81057
  init_esm_shims();
80623
- import { existsSync as existsSync7 } from "fs";
80624
- import { join as join9, resolve as resolve3 } from "path";
81058
+ import { existsSync as existsSync9 } from "fs";
81059
+ import { join as join10, resolve as resolve3 } from "path";
80625
81060
 
80626
81061
  // ../core/src/faq/duckdb-source.ts
80627
81062
  init_esm_shims();
@@ -81149,8 +81584,8 @@ async function createDuckDBSource(config) {
81149
81584
 
81150
81585
  // ../core/src/faq/extractor.ts
81151
81586
  init_esm_shims();
81152
- import { existsSync as existsSync6, mkdirSync as mkdirSync4, readFileSync as readFileSync5, writeFileSync as writeFileSync5 } from "fs";
81153
- import { join as join8 } from "path";
81587
+ import { existsSync as existsSync8, mkdirSync as mkdirSync4, readFileSync as readFileSync6, writeFileSync as writeFileSync5 } from "fs";
81588
+ import { join as join9 } from "path";
81154
81589
 
81155
81590
  // ../core/src/faq/review.ts
81156
81591
  init_esm_shims();
@@ -81175,39 +81610,39 @@ function getKnowledgeRedisKey(id, namespace) {
81175
81610
  }
81176
81611
 
81177
81612
  // ../core/src/knowledge/search.ts
81178
- async function storeKnowledgeArticle(input2) {
81613
+ async function storeKnowledgeArticle(input3) {
81179
81614
  const now = (/* @__PURE__ */ new Date()).toISOString();
81180
81615
  const id = randomUUID();
81181
- const namespace = input2.shared ? KNOWLEDGE_NAMESPACE.SHARED : getKnowledgeNamespace(input2.appId);
81616
+ const namespace = input3.shared ? KNOWLEDGE_NAMESPACE.SHARED : getKnowledgeNamespace(input3.appId);
81182
81617
  const article = {
81183
81618
  id,
81184
- title: input2.title,
81185
- question: input2.question,
81186
- answer: input2.answer,
81187
- appId: input2.appId,
81619
+ title: input3.title,
81620
+ question: input3.question,
81621
+ answer: input3.answer,
81622
+ appId: input3.appId,
81188
81623
  metadata: {
81189
- source: input2.source,
81190
- category: input2.category,
81624
+ source: input3.source,
81625
+ category: input3.category,
81191
81626
  created_at: now,
81192
81627
  updated_at: now,
81193
- tags: input2.tags ?? [],
81194
- trust_score: input2.trust_score ?? 1,
81628
+ tags: input3.tags ?? [],
81629
+ trust_score: input3.trust_score ?? 1,
81195
81630
  usage_count: 0
81196
81631
  }
81197
81632
  };
81198
- const searchableText = `${input2.title}
81633
+ const searchableText = `${input3.title}
81199
81634
 
81200
- ${input2.question}`;
81635
+ ${input3.question}`;
81201
81636
  await upsertVector({
81202
81637
  id,
81203
81638
  data: searchableText,
81204
81639
  metadata: {
81205
81640
  type: "knowledge",
81206
- appId: input2.shared ? "shared" : input2.appId,
81641
+ appId: input3.shared ? "shared" : input3.appId,
81207
81642
  // Map knowledge categories to vector categories where possible
81208
- category: input2.category,
81209
- source: input2.source,
81210
- trustScore: input2.trust_score ?? 1
81643
+ category: input3.category,
81644
+ source: input3.source,
81645
+ trustScore: input3.trust_score ?? 1
81211
81646
  }
81212
81647
  });
81213
81648
  const redis = getRedis();
@@ -81532,12 +81967,12 @@ function deduplicateCandidates(candidates, threshold) {
81532
81967
  };
81533
81968
  }
81534
81969
  function readClusteringResult(path2) {
81535
- const content = readFileSync5(path2, "utf-8");
81970
+ const content = readFileSync6(path2, "utf-8");
81536
81971
  return JSON.parse(content);
81537
81972
  }
81538
81973
  function readGoldenResponses(path2) {
81539
81974
  try {
81540
- const content = readFileSync5(path2, "utf-8");
81975
+ const content = readFileSync6(path2, "utf-8");
81541
81976
  const parsed = JSON.parse(content);
81542
81977
  return parsed.responses || parsed;
81543
81978
  } catch {
@@ -81764,14 +82199,14 @@ async function extractFaqCandidates(options) {
81764
82199
  return result;
81765
82200
  }
81766
82201
  function writeExtractionArtifacts(result, outputPath) {
81767
- const versionPath = join8(outputPath, result.version);
81768
- if (!existsSync6(versionPath)) {
82202
+ const versionPath = join9(outputPath, result.version);
82203
+ if (!existsSync8(versionPath)) {
81769
82204
  mkdirSync4(versionPath, { recursive: true });
81770
82205
  }
81771
- const resultPath = join8(versionPath, "extraction-result.json");
82206
+ const resultPath = join9(versionPath, "extraction-result.json");
81772
82207
  writeFileSync5(resultPath, JSON.stringify(result, null, 2));
81773
82208
  console.log(`\u2705 Written: ${resultPath}`);
81774
- const candidatesPath = join8(versionPath, "candidates.json");
82209
+ const candidatesPath = join9(versionPath, "candidates.json");
81775
82210
  const candidatesData = {
81776
82211
  version: result.version,
81777
82212
  extractedAt: result.extractedAt,
@@ -81791,7 +82226,7 @@ function writeExtractionArtifacts(result, outputPath) {
81791
82226
  };
81792
82227
  writeFileSync5(candidatesPath, JSON.stringify(candidatesData, null, 2));
81793
82228
  console.log(`\u2705 Written: ${candidatesPath}`);
81794
- const statsPath = join8(versionPath, "stats.json");
82229
+ const statsPath = join9(versionPath, "stats.json");
81795
82230
  writeFileSync5(
81796
82231
  statsPath,
81797
82232
  JSON.stringify(
@@ -81805,8 +82240,8 @@ function writeExtractionArtifacts(result, outputPath) {
81805
82240
  )
81806
82241
  );
81807
82242
  console.log(`\u2705 Written: ${statsPath}`);
81808
- const latestPath = join8(outputPath, "latest");
81809
- if (existsSync6(latestPath)) {
82243
+ const latestPath = join9(outputPath, "latest");
82244
+ if (existsSync8(latestPath)) {
81810
82245
  const { rmSync: rmSync2 } = __require("fs");
81811
82246
  rmSync2(latestPath, { recursive: true, force: true });
81812
82247
  }
@@ -81816,10 +82251,10 @@ function writeExtractionArtifacts(result, outputPath) {
81816
82251
  "candidates.json",
81817
82252
  "stats.json"
81818
82253
  ]) {
81819
- const src = join8(versionPath, file);
81820
- const dst = join8(latestPath, file);
81821
- if (existsSync6(src)) {
81822
- writeFileSync5(dst, readFileSync5(src));
82254
+ const src = join9(versionPath, file);
82255
+ const dst = join9(latestPath, file);
82256
+ if (existsSync8(src)) {
82257
+ writeFileSync5(dst, readFileSync6(src));
81823
82258
  }
81824
82259
  }
81825
82260
  console.log(`\u2705 Updated: ${latestPath}`);
@@ -81872,24 +82307,24 @@ ${i + 1}. [${confPct}%]${golden} ${candidate.suggestedCategory}`
81872
82307
 
81873
82308
  // src/commands/faq/extract.ts
81874
82309
  var PROJECT_ROOT3 = resolve3(__dirname, "../../../..");
81875
- var DEFAULT_CLUSTERING_PATH = join9(
82310
+ var DEFAULT_CLUSTERING_PATH = join10(
81876
82311
  PROJECT_ROOT3,
81877
82312
  "artifacts/phase-1/clustering/v1/clustering-result.json"
81878
82313
  );
81879
- var DEFAULT_GOLDEN_PATH = join9(
82314
+ var DEFAULT_GOLDEN_PATH = join10(
81880
82315
  PROJECT_ROOT3,
81881
82316
  "artifacts/phase-0/golden/latest/responses.json"
81882
82317
  );
81883
- var DEFAULT_OUTPUT_PATH3 = join9(PROJECT_ROOT3, "artifacts/phase-1/extraction");
82318
+ var DEFAULT_OUTPUT_PATH3 = join10(PROJECT_ROOT3, "artifacts/phase-1/extraction");
81884
82319
  var DEFAULT_CACHE_PATH = `${process.env.HOME}/skill/data/front-cache.db`;
81885
82320
  function validatePaths2(clusteringPath, goldenPath) {
81886
- if (!existsSync7(clusteringPath)) {
82321
+ if (!existsSync9(clusteringPath)) {
81887
82322
  throw new Error(
81888
82323
  `Clustering result not found at ${clusteringPath}
81889
82324
  Run \`bun src/index.ts faq cluster\` first to generate clustering.`
81890
82325
  );
81891
82326
  }
81892
- if (goldenPath && !existsSync7(goldenPath)) {
82327
+ if (goldenPath && !existsSync9(goldenPath)) {
81893
82328
  console.warn(`\u26A0\uFE0F Golden responses not found at ${goldenPath}`);
81894
82329
  console.warn(" Golden matching will be disabled.");
81895
82330
  }
@@ -81913,7 +82348,7 @@ async function faqExtract(options) {
81913
82348
  console.log(` Dry run: ${options.dryRun ?? false}`);
81914
82349
  console.log("");
81915
82350
  validatePaths2(clusteringPath, goldenPath);
81916
- if (!existsSync7(cachePath)) {
82351
+ if (!existsSync9(cachePath)) {
81917
82352
  throw new Error(
81918
82353
  `DuckDB cache not found at ${cachePath}
81919
82354
  Run \`bun src/index.ts front-cache sync\` first to populate cache.`
@@ -81931,7 +82366,7 @@ Run \`bun src/index.ts front-cache sync\` first to populate cache.`
81931
82366
  }
81932
82367
  const extractionOptions = {
81933
82368
  clusteringPath,
81934
- goldenPath: existsSync7(goldenPath) ? goldenPath : void 0,
82369
+ goldenPath: existsSync9(goldenPath) ? goldenPath : void 0,
81935
82370
  source,
81936
82371
  outputPath,
81937
82372
  version,
@@ -81972,7 +82407,7 @@ Run \`bun src/index.ts front-cache sync\` first to populate cache.`
81972
82407
  if (!options.dryRun) {
81973
82408
  console.log(`
81974
82409
  \u2705 Extraction complete!`);
81975
- console.log(` Artifacts written to: ${join9(outputPath, version)}`);
82410
+ console.log(` Artifacts written to: ${join10(outputPath, version)}`);
81976
82411
  if (options.pushRedis && options.app) {
81977
82412
  console.log(
81978
82413
  ` Candidates pushed to Redis queue: faq:pending:${options.app}`
@@ -83323,60 +83758,60 @@ function parseURL(urlStr) {
83323
83758
  return parse_url(urlStr);
83324
83759
  }
83325
83760
  var streamDestructionSupported = "destroy" in Stream.Readable.prototype;
83326
- function isRequest(input2) {
83327
- return typeof input2 === "object" && typeof input2[INTERNALS$2] === "object";
83761
+ function isRequest(input3) {
83762
+ return typeof input3 === "object" && typeof input3[INTERNALS$2] === "object";
83328
83763
  }
83329
83764
  function isAbortSignal(signal) {
83330
83765
  const proto = signal && typeof signal === "object" && Object.getPrototypeOf(signal);
83331
83766
  return !!(proto && proto.constructor.name === "AbortSignal");
83332
83767
  }
83333
83768
  var Request2 = class _Request {
83334
- constructor(input2) {
83769
+ constructor(input3) {
83335
83770
  let init3 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
83336
83771
  let parsedURL;
83337
- if (!isRequest(input2)) {
83338
- if (input2 && input2.href) {
83339
- parsedURL = parseURL(input2.href);
83772
+ if (!isRequest(input3)) {
83773
+ if (input3 && input3.href) {
83774
+ parsedURL = parseURL(input3.href);
83340
83775
  } else {
83341
- parsedURL = parseURL(`${input2}`);
83776
+ parsedURL = parseURL(`${input3}`);
83342
83777
  }
83343
- input2 = {};
83778
+ input3 = {};
83344
83779
  } else {
83345
- parsedURL = parseURL(input2.url);
83780
+ parsedURL = parseURL(input3.url);
83346
83781
  }
83347
- let method = init3.method || input2.method || "GET";
83782
+ let method = init3.method || input3.method || "GET";
83348
83783
  method = method.toUpperCase();
83349
- if ((init3.body != null || isRequest(input2) && input2.body !== null) && (method === "GET" || method === "HEAD")) {
83784
+ if ((init3.body != null || isRequest(input3) && input3.body !== null) && (method === "GET" || method === "HEAD")) {
83350
83785
  throw new TypeError("Request with GET/HEAD method cannot have body");
83351
83786
  }
83352
- let inputBody = init3.body != null ? init3.body : isRequest(input2) && input2.body !== null ? clone(input2) : null;
83787
+ let inputBody = init3.body != null ? init3.body : isRequest(input3) && input3.body !== null ? clone(input3) : null;
83353
83788
  Body.call(this, inputBody, {
83354
- timeout: init3.timeout || input2.timeout || 0,
83355
- size: init3.size || input2.size || 0
83789
+ timeout: init3.timeout || input3.timeout || 0,
83790
+ size: init3.size || input3.size || 0
83356
83791
  });
83357
- const headers = new Headers2(init3.headers || input2.headers || {});
83792
+ const headers = new Headers2(init3.headers || input3.headers || {});
83358
83793
  if (inputBody != null && !headers.has("Content-Type")) {
83359
83794
  const contentType = extractContentType(inputBody);
83360
83795
  if (contentType) {
83361
83796
  headers.append("Content-Type", contentType);
83362
83797
  }
83363
83798
  }
83364
- let signal = isRequest(input2) ? input2.signal : null;
83799
+ let signal = isRequest(input3) ? input3.signal : null;
83365
83800
  if ("signal" in init3) signal = init3.signal;
83366
83801
  if (signal != null && !isAbortSignal(signal)) {
83367
83802
  throw new TypeError("Expected signal to be an instanceof AbortSignal");
83368
83803
  }
83369
83804
  this[INTERNALS$2] = {
83370
83805
  method,
83371
- redirect: init3.redirect || input2.redirect || "follow",
83806
+ redirect: init3.redirect || input3.redirect || "follow",
83372
83807
  headers,
83373
83808
  parsedURL,
83374
83809
  signal
83375
83810
  };
83376
- this.follow = init3.follow !== void 0 ? init3.follow : input2.follow !== void 0 ? input2.follow : 20;
83377
- this.compress = init3.compress !== void 0 ? init3.compress : input2.compress !== void 0 ? input2.compress : true;
83378
- this.counter = init3.counter || input2.counter || 0;
83379
- this.agent = init3.agent || input2.agent;
83811
+ this.follow = init3.follow !== void 0 ? init3.follow : input3.follow !== void 0 ? input3.follow : 20;
83812
+ this.compress = init3.compress !== void 0 ? init3.compress : input3.compress !== void 0 ? input3.compress : true;
83813
+ this.counter = init3.counter || input3.counter || 0;
83814
+ this.agent = init3.agent || input3.agent;
83380
83815
  }
83381
83816
  get method() {
83382
83817
  return this[INTERNALS$2].method;
@@ -87306,7 +87741,7 @@ var _parseJSON = (jsonString, allow) => {
87306
87741
  };
87307
87742
  return parseAny();
87308
87743
  };
87309
- var partialParse = (input2) => parseJSON(input2, Allow.ALL ^ Allow.NUM);
87744
+ var partialParse = (input3) => parseJSON(input3, Allow.ALL ^ Allow.NUM);
87310
87745
 
87311
87746
  // ../../node_modules/.bun/openai@4.104.0+c05f8f6c4f18bd47/node_modules/openai/lib/ChatCompletionStream.mjs
87312
87747
  var __classPrivateFieldSet6 = function(receiver, state, value, kind2, f) {
@@ -90924,10 +91359,10 @@ function registerFaqMineCommands(program3) {
90924
91359
  // src/commands/faq/review.ts
90925
91360
  init_esm_shims();
90926
91361
  import { spawnSync } from "child_process";
90927
- import { existsSync as existsSync8, readFileSync as readFileSync6, unlinkSync, writeFileSync as writeFileSync7 } from "fs";
91362
+ import { existsSync as existsSync10, readFileSync as readFileSync7, unlinkSync, writeFileSync as writeFileSync7 } from "fs";
90928
91363
  import { tmpdir } from "os";
90929
- import { join as join10 } from "path";
90930
- import { confirm, select } from "@inquirer/prompts";
91364
+ import { join as join11 } from "path";
91365
+ import { confirm as confirm2, select as select2 } from "@inquirer/prompts";
90931
91366
  var COLORS2 = {
90932
91367
  reset: "\x1B[0m",
90933
91368
  green: "\x1B[32m",
@@ -90987,7 +91422,7 @@ function getEditor() {
90987
91422
  }
90988
91423
  function editInEditor(question, answer) {
90989
91424
  const editor = getEditor();
90990
- const tmpFile = join10(tmpdir(), `faq-edit-${Date.now()}.md`);
91425
+ const tmpFile = join11(tmpdir(), `faq-edit-${Date.now()}.md`);
90991
91426
  const content = `# FAQ Edit
90992
91427
 
90993
91428
  ## Question
@@ -91012,7 +91447,7 @@ The sections are separated by "## Question" and "## Answer" headers.
91012
91447
  console.log(`${COLORS2.red}Editor exited with error${COLORS2.reset}`);
91013
91448
  return null;
91014
91449
  }
91015
- const edited = readFileSync6(tmpFile, "utf-8");
91450
+ const edited = readFileSync7(tmpFile, "utf-8");
91016
91451
  const questionMatch = edited.match(
91017
91452
  /## Question\s*\n([\s\S]*?)(?=\n## Answer|$)/
91018
91453
  );
@@ -91030,7 +91465,7 @@ The sections are separated by "## Question" and "## Answer" headers.
91030
91465
  answer: editedAnswer
91031
91466
  };
91032
91467
  } finally {
91033
- if (existsSync8(tmpFile)) {
91468
+ if (existsSync10(tmpFile)) {
91034
91469
  unlinkSync(tmpFile);
91035
91470
  }
91036
91471
  }
@@ -91060,7 +91495,7 @@ ${COLORS2.bold}\u{1F4CB} FAQ Review Session${COLORS2.reset}`);
91060
91495
  for (let i = 0; i < candidates.length; i++) {
91061
91496
  const candidate = candidates[i];
91062
91497
  displayCandidate(candidate, i, candidates.length);
91063
- const action = await select({
91498
+ const action = await select2({
91064
91499
  message: "Action:",
91065
91500
  choices: [
91066
91501
  {
@@ -91132,7 +91567,7 @@ ${COLORS2.bold}New Question:${COLORS2.reset}`);
91132
91567
  console.log(`
91133
91568
  ${COLORS2.bold}New Answer:${COLORS2.reset}`);
91134
91569
  console.log(wordWrap(finalAnswer, 68));
91135
- const confirmPublish = await confirm({
91570
+ const confirmPublish = await confirm2({
91136
91571
  message: "Publish edited FAQ?",
91137
91572
  default: true
91138
91573
  });
@@ -92365,7 +92800,7 @@ function registerReportCommand(front) {
92365
92800
 
92366
92801
  // src/commands/front/tags.ts
92367
92802
  init_esm_shims();
92368
- import { confirm as confirm2 } from "@inquirer/prompts";
92803
+ import { confirm as confirm3 } from "@inquirer/prompts";
92369
92804
 
92370
92805
  // ../core/src/tags/audit.ts
92371
92806
  init_esm_shims();
@@ -92577,7 +93012,7 @@ async function deleteTag(id, options) {
92577
93012
  " Deleting it will remove the tag from those conversations."
92578
93013
  );
92579
93014
  }
92580
- const confirmed = await confirm2({
93015
+ const confirmed = await confirm3({
92581
93016
  message: `Are you sure you want to delete tag "${tag.name}"?`,
92582
93017
  default: false
92583
93018
  });
@@ -92885,7 +93320,7 @@ async function cleanupTags(options) {
92885
93320
  return;
92886
93321
  }
92887
93322
  console.log("");
92888
- const confirmed = await confirm2({
93323
+ const confirmed = await confirm3({
92889
93324
  message: `Apply ${totalChanges} change(s)?`,
92890
93325
  default: false
92891
93326
  });
@@ -93761,8 +94196,8 @@ var EventResponseSchema = z7.object({
93761
94196
  var EventRunsResponseSchema = z7.object({
93762
94197
  data: z7.array(RunSchema).nullable()
93763
94198
  });
93764
- function parseTimeArg(input2) {
93765
- const match = input2.match(/^(\d+)([hmd])$/);
94199
+ function parseTimeArg(input3) {
94200
+ const match = input3.match(/^(\d+)([hmd])$/);
93766
94201
  if (match) {
93767
94202
  const [, num, unit] = match;
93768
94203
  const msPerUnit = {
@@ -93772,11 +94207,11 @@ function parseTimeArg(input2) {
93772
94207
  };
93773
94208
  const ms = unit ? msPerUnit[unit] : void 0;
93774
94209
  if (!ms || !num) {
93775
- return input2;
94210
+ return input3;
93776
94211
  }
93777
94212
  return new Date(Date.now() - parseInt(num) * ms).toISOString();
93778
94213
  }
93779
- return input2;
94214
+ return input3;
93780
94215
  }
93781
94216
  async function detectDevServer() {
93782
94217
  try {
@@ -94350,7 +94785,7 @@ function registerInvestigateCommands(inngest) {
94350
94785
 
94351
94786
  // src/commands/inngest/runs.ts
94352
94787
  init_esm_shims();
94353
- import { confirm as confirm3 } from "@inquirer/prompts";
94788
+ import { confirm as confirm4 } from "@inquirer/prompts";
94354
94789
  import "commander";
94355
94790
  function formatRun(run3) {
94356
94791
  const startedAt = new Date(run3.run_started_at).toLocaleString();
@@ -94396,7 +94831,7 @@ async function cancelCommand(id, options) {
94396
94831
  try {
94397
94832
  const isDev = options.dev ?? await detectDevServer();
94398
94833
  if (!options.force) {
94399
- const confirmed = await confirm3({
94834
+ const confirmed = await confirm4({
94400
94835
  message: `Cancel run ${id}?`,
94401
94836
  default: false
94402
94837
  });
@@ -94422,14 +94857,14 @@ function registerRunsCommands(inngest) {
94422
94857
 
94423
94858
  // src/commands/inngest/signal.ts
94424
94859
  init_esm_shims();
94425
- import { readFileSync as readFileSync7 } from "fs";
94860
+ import { readFileSync as readFileSync8 } from "fs";
94426
94861
  import "commander";
94427
94862
  async function signalCommand(signal, options) {
94428
94863
  const { data: dataString, dataFile, dev = false, json = false } = options;
94429
94864
  let data2 = null;
94430
94865
  if (dataFile) {
94431
94866
  try {
94432
- const fileContent = readFileSync7(dataFile, "utf-8");
94867
+ const fileContent = readFileSync8(dataFile, "utf-8");
94433
94868
  data2 = JSON.parse(fileContent);
94434
94869
  } catch (err) {
94435
94870
  const error = {
@@ -96585,22 +97020,22 @@ init_esm_shims();
96585
97020
 
96586
97021
  // ../../node_modules/.bun/entities@7.0.1/node_modules/entities/dist/esm/internal/decode-shared.js
96587
97022
  init_esm_shims();
96588
- function decodeBase64(input2) {
97023
+ function decodeBase64(input3) {
96589
97024
  const binary = (
96590
97025
  // eslint-disable-next-line n/no-unsupported-features/node-builtins
96591
97026
  typeof atob === "function" ? (
96592
97027
  // Browser (and Node >=16)
96593
97028
  // eslint-disable-next-line n/no-unsupported-features/node-builtins
96594
- atob(input2)
97029
+ atob(input3)
96595
97030
  ) : (
96596
97031
  // Older Node versions (<16)
96597
97032
  // eslint-disable-next-line n/no-unsupported-features/node-builtins
96598
97033
  typeof Buffer.from === "function" ? (
96599
97034
  // eslint-disable-next-line n/no-unsupported-features/node-builtins
96600
- Buffer.from(input2, "base64").toString("binary")
97035
+ Buffer.from(input3, "base64").toString("binary")
96601
97036
  ) : (
96602
97037
  // eslint-disable-next-line unicorn/no-new-buffer, n/no-deprecated-api
96603
- new Buffer(input2, "base64").toString("binary")
97038
+ new Buffer(input3, "base64").toString("binary")
96604
97039
  )
96605
97040
  )
96606
97041
  );
@@ -96708,28 +97143,28 @@ var EntityDecoder2 = class {
96708
97143
  * @param offset The offset at which the entity begins. Should be 0 if this is not the first call.
96709
97144
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
96710
97145
  */
96711
- write(input2, offset) {
97146
+ write(input3, offset) {
96712
97147
  switch (this.state) {
96713
97148
  case EntityDecoderState2.EntityStart: {
96714
- if (input2.charCodeAt(offset) === CharCodes2.NUM) {
97149
+ if (input3.charCodeAt(offset) === CharCodes2.NUM) {
96715
97150
  this.state = EntityDecoderState2.NumericStart;
96716
97151
  this.consumed += 1;
96717
- return this.stateNumericStart(input2, offset + 1);
97152
+ return this.stateNumericStart(input3, offset + 1);
96718
97153
  }
96719
97154
  this.state = EntityDecoderState2.NamedEntity;
96720
- return this.stateNamedEntity(input2, offset);
97155
+ return this.stateNamedEntity(input3, offset);
96721
97156
  }
96722
97157
  case EntityDecoderState2.NumericStart: {
96723
- return this.stateNumericStart(input2, offset);
97158
+ return this.stateNumericStart(input3, offset);
96724
97159
  }
96725
97160
  case EntityDecoderState2.NumericDecimal: {
96726
- return this.stateNumericDecimal(input2, offset);
97161
+ return this.stateNumericDecimal(input3, offset);
96727
97162
  }
96728
97163
  case EntityDecoderState2.NumericHex: {
96729
- return this.stateNumericHex(input2, offset);
97164
+ return this.stateNumericHex(input3, offset);
96730
97165
  }
96731
97166
  case EntityDecoderState2.NamedEntity: {
96732
- return this.stateNamedEntity(input2, offset);
97167
+ return this.stateNamedEntity(input3, offset);
96733
97168
  }
96734
97169
  }
96735
97170
  }
@@ -96742,17 +97177,17 @@ var EntityDecoder2 = class {
96742
97177
  * @param offset The current offset.
96743
97178
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
96744
97179
  */
96745
- stateNumericStart(input2, offset) {
96746
- if (offset >= input2.length) {
97180
+ stateNumericStart(input3, offset) {
97181
+ if (offset >= input3.length) {
96747
97182
  return -1;
96748
97183
  }
96749
- if ((input2.charCodeAt(offset) | TO_LOWER_BIT2) === CharCodes2.LOWER_X) {
97184
+ if ((input3.charCodeAt(offset) | TO_LOWER_BIT2) === CharCodes2.LOWER_X) {
96750
97185
  this.state = EntityDecoderState2.NumericHex;
96751
97186
  this.consumed += 1;
96752
- return this.stateNumericHex(input2, offset + 1);
97187
+ return this.stateNumericHex(input3, offset + 1);
96753
97188
  }
96754
97189
  this.state = EntityDecoderState2.NumericDecimal;
96755
- return this.stateNumericDecimal(input2, offset);
97190
+ return this.stateNumericDecimal(input3, offset);
96756
97191
  }
96757
97192
  /**
96758
97193
  * Parses a hexadecimal numeric entity.
@@ -96763,9 +97198,9 @@ var EntityDecoder2 = class {
96763
97198
  * @param offset The current offset.
96764
97199
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
96765
97200
  */
96766
- stateNumericHex(input2, offset) {
96767
- while (offset < input2.length) {
96768
- const char = input2.charCodeAt(offset);
97201
+ stateNumericHex(input3, offset) {
97202
+ while (offset < input3.length) {
97203
+ const char = input3.charCodeAt(offset);
96769
97204
  if (isNumber2(char) || isHexadecimalCharacter2(char)) {
96770
97205
  const digit = char <= CharCodes2.NINE ? char - CharCodes2.ZERO : (char | TO_LOWER_BIT2) - CharCodes2.LOWER_A + 10;
96771
97206
  this.result = this.result * 16 + digit;
@@ -96786,9 +97221,9 @@ var EntityDecoder2 = class {
96786
97221
  * @param offset The current offset.
96787
97222
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
96788
97223
  */
96789
- stateNumericDecimal(input2, offset) {
96790
- while (offset < input2.length) {
96791
- const char = input2.charCodeAt(offset);
97224
+ stateNumericDecimal(input3, offset) {
97225
+ while (offset < input3.length) {
97226
+ const char = input3.charCodeAt(offset);
96792
97227
  if (isNumber2(char)) {
96793
97228
  this.result = this.result * 10 + (char - CharCodes2.ZERO);
96794
97229
  this.consumed++;
@@ -96841,16 +97276,16 @@ var EntityDecoder2 = class {
96841
97276
  * @param offset The current offset.
96842
97277
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
96843
97278
  */
96844
- stateNamedEntity(input2, offset) {
97279
+ stateNamedEntity(input3, offset) {
96845
97280
  const { decodeTree } = this;
96846
97281
  let current = decodeTree[this.treeIndex];
96847
97282
  let valueLength = (current & BinTrieFlags2.VALUE_LENGTH) >> 14;
96848
- while (offset < input2.length) {
97283
+ while (offset < input3.length) {
96849
97284
  if (valueLength === 0 && (current & BinTrieFlags2.FLAG13) !== 0) {
96850
97285
  const runLength = (current & BinTrieFlags2.BRANCH_LENGTH) >> 7;
96851
97286
  if (this.runConsumed === 0) {
96852
97287
  const firstChar = current & BinTrieFlags2.JUMP_TABLE;
96853
- if (input2.charCodeAt(offset) !== firstChar) {
97288
+ if (input3.charCodeAt(offset) !== firstChar) {
96854
97289
  return this.result === 0 ? 0 : this.emitNotTerminatedNamedEntity();
96855
97290
  }
96856
97291
  offset++;
@@ -96858,13 +97293,13 @@ var EntityDecoder2 = class {
96858
97293
  this.runConsumed++;
96859
97294
  }
96860
97295
  while (this.runConsumed < runLength) {
96861
- if (offset >= input2.length) {
97296
+ if (offset >= input3.length) {
96862
97297
  return -1;
96863
97298
  }
96864
97299
  const charIndexInPacked = this.runConsumed - 1;
96865
97300
  const packedWord = decodeTree[this.treeIndex + 1 + (charIndexInPacked >> 1)];
96866
97301
  const expectedChar = charIndexInPacked % 2 === 0 ? packedWord & 255 : packedWord >> 8 & 255;
96867
- if (input2.charCodeAt(offset) !== expectedChar) {
97302
+ if (input3.charCodeAt(offset) !== expectedChar) {
96868
97303
  this.runConsumed = 0;
96869
97304
  return this.result === 0 ? 0 : this.emitNotTerminatedNamedEntity();
96870
97305
  }
@@ -96877,9 +97312,9 @@ var EntityDecoder2 = class {
96877
97312
  current = decodeTree[this.treeIndex];
96878
97313
  valueLength = (current & BinTrieFlags2.VALUE_LENGTH) >> 14;
96879
97314
  }
96880
- if (offset >= input2.length)
97315
+ if (offset >= input3.length)
96881
97316
  break;
96882
- const char = input2.charCodeAt(offset);
97317
+ const char = input3.charCodeAt(offset);
96883
97318
  if (char === CharCodes2.SEMI && valueLength !== 0 && (current & BinTrieFlags2.FLAG13) !== 0) {
96884
97319
  return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);
96885
97320
  }
@@ -99886,7 +100321,7 @@ var compile3 = wrapCompile(compile2);
99886
100321
  var _compileUnsafe = wrapCompile(compileUnsafe);
99887
100322
  var _compileToken = wrapCompile(compileToken);
99888
100323
  function getSelectorFunc(searchFunc) {
99889
- return function select4(query, elements, options) {
100324
+ return function select5(query, elements, options) {
99890
100325
  const opts = convertOptionFormats(options);
99891
100326
  if (typeof query !== "function") {
99892
100327
  query = compileUnsafe(query, opts, elements);
@@ -100073,7 +100508,7 @@ function filterBySelector(selector, elements, options) {
100073
100508
  }
100074
100509
  return findFilterElements(elements, selector, options, false, elements.length);
100075
100510
  }
100076
- function select2(selector, root2, options = {}, limit2 = Infinity) {
100511
+ function select3(selector, root2, options = {}, limit2 = Infinity) {
100077
100512
  if (typeof selector === "function") {
100078
100513
  return find3(root2, selector);
100079
100514
  }
@@ -100178,7 +100613,7 @@ function _findBySelector(selector, limit2) {
100178
100613
  pseudos: this.options.pseudos,
100179
100614
  quirksMode: this.options.quirksMode
100180
100615
  };
100181
- return this._make(select2(selector, elems, options, limit2));
100616
+ return this._make(select3(selector, elems, options, limit2));
100182
100617
  }
100183
100618
  function _getMatcher(matchMap) {
100184
100619
  return function(fn, ...postFns) {
@@ -101603,28 +102038,28 @@ var EntityDecoder3 = class {
101603
102038
  * @param offset The offset at which the entity begins. Should be 0 if this is not the first call.
101604
102039
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
101605
102040
  */
101606
- write(input2, offset) {
102041
+ write(input3, offset) {
101607
102042
  switch (this.state) {
101608
102043
  case EntityDecoderState3.EntityStart: {
101609
- if (input2.charCodeAt(offset) === CharCodes4.NUM) {
102044
+ if (input3.charCodeAt(offset) === CharCodes4.NUM) {
101610
102045
  this.state = EntityDecoderState3.NumericStart;
101611
102046
  this.consumed += 1;
101612
- return this.stateNumericStart(input2, offset + 1);
102047
+ return this.stateNumericStart(input3, offset + 1);
101613
102048
  }
101614
102049
  this.state = EntityDecoderState3.NamedEntity;
101615
- return this.stateNamedEntity(input2, offset);
102050
+ return this.stateNamedEntity(input3, offset);
101616
102051
  }
101617
102052
  case EntityDecoderState3.NumericStart: {
101618
- return this.stateNumericStart(input2, offset);
102053
+ return this.stateNumericStart(input3, offset);
101619
102054
  }
101620
102055
  case EntityDecoderState3.NumericDecimal: {
101621
- return this.stateNumericDecimal(input2, offset);
102056
+ return this.stateNumericDecimal(input3, offset);
101622
102057
  }
101623
102058
  case EntityDecoderState3.NumericHex: {
101624
- return this.stateNumericHex(input2, offset);
102059
+ return this.stateNumericHex(input3, offset);
101625
102060
  }
101626
102061
  case EntityDecoderState3.NamedEntity: {
101627
- return this.stateNamedEntity(input2, offset);
102062
+ return this.stateNamedEntity(input3, offset);
101628
102063
  }
101629
102064
  }
101630
102065
  }
@@ -101637,22 +102072,22 @@ var EntityDecoder3 = class {
101637
102072
  * @param offset The current offset.
101638
102073
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
101639
102074
  */
101640
- stateNumericStart(input2, offset) {
101641
- if (offset >= input2.length) {
102075
+ stateNumericStart(input3, offset) {
102076
+ if (offset >= input3.length) {
101642
102077
  return -1;
101643
102078
  }
101644
- if ((input2.charCodeAt(offset) | TO_LOWER_BIT3) === CharCodes4.LOWER_X) {
102079
+ if ((input3.charCodeAt(offset) | TO_LOWER_BIT3) === CharCodes4.LOWER_X) {
101645
102080
  this.state = EntityDecoderState3.NumericHex;
101646
102081
  this.consumed += 1;
101647
- return this.stateNumericHex(input2, offset + 1);
102082
+ return this.stateNumericHex(input3, offset + 1);
101648
102083
  }
101649
102084
  this.state = EntityDecoderState3.NumericDecimal;
101650
- return this.stateNumericDecimal(input2, offset);
102085
+ return this.stateNumericDecimal(input3, offset);
101651
102086
  }
101652
- addToNumericResult(input2, start, end2, base) {
102087
+ addToNumericResult(input3, start, end2, base) {
101653
102088
  if (start !== end2) {
101654
102089
  const digitCount = end2 - start;
101655
- this.result = this.result * Math.pow(base, digitCount) + Number.parseInt(input2.substr(start, digitCount), base);
102090
+ this.result = this.result * Math.pow(base, digitCount) + Number.parseInt(input3.substr(start, digitCount), base);
101656
102091
  this.consumed += digitCount;
101657
102092
  }
101658
102093
  }
@@ -101665,18 +102100,18 @@ var EntityDecoder3 = class {
101665
102100
  * @param offset The current offset.
101666
102101
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
101667
102102
  */
101668
- stateNumericHex(input2, offset) {
102103
+ stateNumericHex(input3, offset) {
101669
102104
  const startIndex = offset;
101670
- while (offset < input2.length) {
101671
- const char = input2.charCodeAt(offset);
102105
+ while (offset < input3.length) {
102106
+ const char = input3.charCodeAt(offset);
101672
102107
  if (isNumber3(char) || isHexadecimalCharacter3(char)) {
101673
102108
  offset += 1;
101674
102109
  } else {
101675
- this.addToNumericResult(input2, startIndex, offset, 16);
102110
+ this.addToNumericResult(input3, startIndex, offset, 16);
101676
102111
  return this.emitNumericEntity(char, 3);
101677
102112
  }
101678
102113
  }
101679
- this.addToNumericResult(input2, startIndex, offset, 16);
102114
+ this.addToNumericResult(input3, startIndex, offset, 16);
101680
102115
  return -1;
101681
102116
  }
101682
102117
  /**
@@ -101688,18 +102123,18 @@ var EntityDecoder3 = class {
101688
102123
  * @param offset The current offset.
101689
102124
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
101690
102125
  */
101691
- stateNumericDecimal(input2, offset) {
102126
+ stateNumericDecimal(input3, offset) {
101692
102127
  const startIndex = offset;
101693
- while (offset < input2.length) {
101694
- const char = input2.charCodeAt(offset);
102128
+ while (offset < input3.length) {
102129
+ const char = input3.charCodeAt(offset);
101695
102130
  if (isNumber3(char)) {
101696
102131
  offset += 1;
101697
102132
  } else {
101698
- this.addToNumericResult(input2, startIndex, offset, 10);
102133
+ this.addToNumericResult(input3, startIndex, offset, 10);
101699
102134
  return this.emitNumericEntity(char, 2);
101700
102135
  }
101701
102136
  }
101702
- this.addToNumericResult(input2, startIndex, offset, 10);
102137
+ this.addToNumericResult(input3, startIndex, offset, 10);
101703
102138
  return -1;
101704
102139
  }
101705
102140
  /**
@@ -101744,12 +102179,12 @@ var EntityDecoder3 = class {
101744
102179
  * @param offset The current offset.
101745
102180
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
101746
102181
  */
101747
- stateNamedEntity(input2, offset) {
102182
+ stateNamedEntity(input3, offset) {
101748
102183
  const { decodeTree } = this;
101749
102184
  let current = decodeTree[this.treeIndex];
101750
102185
  let valueLength = (current & BinTrieFlags3.VALUE_LENGTH) >> 14;
101751
- for (; offset < input2.length; offset++, this.excess++) {
101752
- const char = input2.charCodeAt(offset);
102186
+ for (; offset < input3.length; offset++, this.excess++) {
102187
+ const char = input3.charCodeAt(offset);
101753
102188
  this.treeIndex = determineBranch3(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char);
101754
102189
  if (this.treeIndex < 0) {
101755
102190
  return this.result === 0 || // If we are parsing an attribute
@@ -108963,7 +109398,7 @@ var getCodePoint2 = (
108963
109398
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
108964
109399
  String.prototype.codePointAt == null ? (c, index2) => (c.charCodeAt(index2) & 64512) === 55296 ? (c.charCodeAt(index2) - 55296) * 1024 + c.charCodeAt(index2 + 1) - 56320 + 65536 : c.charCodeAt(index2) : (
108965
109400
  // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
108966
- (input2, index2) => input2.codePointAt(index2)
109401
+ (input3, index2) => input3.codePointAt(index2)
108967
109402
  )
108968
109403
  );
108969
109404
  function getEscaper2(regex, map2) {
@@ -110149,19 +110584,19 @@ async function ingest(options) {
110149
110584
  }
110150
110585
  case "database": {
110151
110586
  const now = (/* @__PURE__ */ new Date()).toISOString();
110152
- articles = inputArticles.map((input2, index2) => ({
110153
- id: `kb-${appId}-db-${index2}-${slugify4(input2.title)}`,
110154
- title: input2.title,
110155
- question: input2.question,
110156
- answer: input2.answer,
110587
+ articles = inputArticles.map((input3, index2) => ({
110588
+ id: `kb-${appId}-db-${index2}-${slugify4(input3.title)}`,
110589
+ title: input3.title,
110590
+ question: input3.question,
110591
+ answer: input3.answer,
110157
110592
  appId,
110158
110593
  metadata: {
110159
110594
  source: defaultSource,
110160
- category: input2.category || defaultCategory,
110595
+ category: input3.category || defaultCategory,
110161
110596
  created_at: now,
110162
110597
  updated_at: now,
110163
- tags: input2.tags || [],
110164
- trust_score: input2.trust_score ?? 1
110598
+ tags: input3.tags || [],
110599
+ trust_score: input3.trust_score ?? 1
110165
110600
  }
110166
110601
  }));
110167
110602
  break;
@@ -112295,7 +112730,7 @@ function registerToolsCommands(program3) {
112295
112730
  // src/commands/wizard.ts
112296
112731
  init_esm_shims();
112297
112732
  import { randomBytes as randomBytes2, randomUUID as randomUUID3 } from "crypto";
112298
- import { checkbox, confirm as confirm4, input } from "@inquirer/prompts";
112733
+ import { checkbox, confirm as confirm5, input as input2 } from "@inquirer/prompts";
112299
112734
  var ALL_CAPABILITIES = [
112300
112735
  {
112301
112736
  value: "lookupUser",
@@ -112359,21 +112794,21 @@ async function wizard(options = {}) {
112359
112794
  console.log(
112360
112795
  "This will walk you through setting up a new app in the support platform.\n"
112361
112796
  );
112362
- const name = await input({
112797
+ const name = await input2({
112363
112798
  message: 'App name (e.g., "Total TypeScript"):',
112364
112799
  validate: (v) => v.trim().length > 0 || "Name is required"
112365
112800
  });
112366
112801
  const suggestedSlug = slugify5(name);
112367
- const slug = await input({
112802
+ const slug = await input2({
112368
112803
  message: "URL slug:",
112369
112804
  default: suggestedSlug,
112370
112805
  validate: (v) => /^[a-z0-9-]+$/.test(v) || "Slug must be lowercase alphanumeric with dashes"
112371
112806
  });
112372
- const frontInboxId = await input({
112807
+ const frontInboxId = await input2({
112373
112808
  message: 'Front inbox ID (e.g., "inb_abc123"):',
112374
112809
  validate: (v) => v.startsWith("inb_") || "Must be a valid Front inbox ID (starts with inb_)"
112375
112810
  });
112376
- const integrationBaseUrl = await input({
112811
+ const integrationBaseUrl = await input2({
112377
112812
  message: "Integration base URL (where SDK endpoints live):",
112378
112813
  default: `https://${slug}.com`,
112379
112814
  validate: (v) => {
@@ -112393,42 +112828,42 @@ async function wizard(options = {}) {
112393
112828
  checked: c.checked
112394
112829
  }))
112395
112830
  });
112396
- const useStripe = await confirm4({
112831
+ const useStripe = await confirm5({
112397
112832
  message: "Enable Stripe Connect for refund processing?",
112398
112833
  default: true
112399
112834
  });
112400
112835
  let stripeAccountId;
112401
112836
  if (useStripe) {
112402
- stripeAccountId = await input({
112837
+ stripeAccountId = await input2({
112403
112838
  message: 'Stripe Connect account ID (e.g., "acct_xxx") or leave blank to connect later:',
112404
112839
  default: ""
112405
112840
  }) || void 0;
112406
112841
  }
112407
- const useSlackEscalation = await confirm4({
112842
+ const useSlackEscalation = await confirm5({
112408
112843
  message: "Configure Slack escalation channel?",
112409
112844
  default: false
112410
112845
  });
112411
112846
  let escalationSlackChannel;
112412
112847
  if (useSlackEscalation) {
112413
- escalationSlackChannel = await input({
112848
+ escalationSlackChannel = await input2({
112414
112849
  message: 'Slack channel ID for escalations (e.g., "C0123456789"):',
112415
112850
  validate: (v) => v.startsWith("C") || "Must be a valid Slack channel ID"
112416
112851
  });
112417
112852
  }
112418
- const configureAutoApproval = await confirm4({
112853
+ const configureAutoApproval = await confirm5({
112419
112854
  message: "Configure auto-approval thresholds? (default: 30 days refund, 14 days transfer)",
112420
112855
  default: false
112421
112856
  });
112422
112857
  let autoApproveRefundDays = 30;
112423
112858
  let autoApproveTransferDays = 14;
112424
112859
  if (configureAutoApproval) {
112425
- const refundDaysStr = await input({
112860
+ const refundDaysStr = await input2({
112426
112861
  message: "Auto-approve refunds within X days of purchase:",
112427
112862
  default: "30",
112428
112863
  validate: (v) => !isNaN(parseInt(v)) && parseInt(v) >= 0 || "Must be a non-negative number"
112429
112864
  });
112430
112865
  autoApproveRefundDays = parseInt(refundDaysStr);
112431
- const transferDaysStr = await input({
112866
+ const transferDaysStr = await input2({
112432
112867
  message: "Auto-approve transfers within X days of purchase:",
112433
112868
  default: "14",
112434
112869
  validate: (v) => !isNaN(parseInt(v)) && parseInt(v) >= 0 || "Must be a non-negative number"