@supatest/cypress-reporter 0.0.5 → 0.0.7

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.cjs CHANGED
@@ -36,10 +36,10 @@ var require_ms = __commonJS({
36
36
  "use strict";
37
37
  var s = 1e3;
38
38
  var m = s * 60;
39
- var h = m * 60;
40
- var d = h * 24;
39
+ var h2 = m * 60;
40
+ var d = h2 * 24;
41
41
  var w = d * 7;
42
- var y = d * 365.25;
42
+ var y2 = d * 365.25;
43
43
  module2.exports = function(val, options) {
44
44
  options = options || {};
45
45
  var type = typeof val;
@@ -71,7 +71,7 @@ var require_ms = __commonJS({
71
71
  case "yrs":
72
72
  case "yr":
73
73
  case "y":
74
- return n * y;
74
+ return n * y2;
75
75
  case "weeks":
76
76
  case "week":
77
77
  case "w":
@@ -85,7 +85,7 @@ var require_ms = __commonJS({
85
85
  case "hrs":
86
86
  case "hr":
87
87
  case "h":
88
- return n * h;
88
+ return n * h2;
89
89
  case "minutes":
90
90
  case "minute":
91
91
  case "mins":
@@ -113,8 +113,8 @@ var require_ms = __commonJS({
113
113
  if (msAbs >= d) {
114
114
  return Math.round(ms / d) + "d";
115
115
  }
116
- if (msAbs >= h) {
117
- return Math.round(ms / h) + "h";
116
+ if (msAbs >= h2) {
117
+ return Math.round(ms / h2) + "h";
118
118
  }
119
119
  if (msAbs >= m) {
120
120
  return Math.round(ms / m) + "m";
@@ -129,8 +129,8 @@ var require_ms = __commonJS({
129
129
  if (msAbs >= d) {
130
130
  return plural(ms, msAbs, d, "day");
131
131
  }
132
- if (msAbs >= h) {
133
- return plural(ms, msAbs, h, "hour");
132
+ if (msAbs >= h2) {
133
+ return plural(ms, msAbs, h2, "hour");
134
134
  }
135
135
  if (msAbs >= m) {
136
136
  return plural(ms, msAbs, m, "minute");
@@ -168,8 +168,8 @@ var require_common = __commonJS({
168
168
  createDebug.formatters = {};
169
169
  function selectColor(namespace) {
170
170
  let hash = 0;
171
- for (let i = 0; i < namespace.length; i++) {
172
- hash = (hash << 5) - hash + namespace.charCodeAt(i);
171
+ for (let i2 = 0; i2 < namespace.length; i2++) {
172
+ hash = (hash << 5) - hash + namespace.charCodeAt(i2);
173
173
  hash |= 0;
174
174
  }
175
175
  return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
@@ -440,8 +440,8 @@ var require_browser = __commonJS({
440
440
  if (!this.useColors) {
441
441
  return;
442
442
  }
443
- const c = "color: " + this.color;
444
- args.splice(1, 0, c, "color: inherit");
443
+ const c3 = "color: " + this.color;
444
+ args.splice(1, 0, c3, "color: inherit");
445
445
  let index = 0;
446
446
  let lastC = 0;
447
447
  args[0].replace(/%[a-zA-Z%]/g, (match) => {
@@ -453,7 +453,7 @@ var require_browser = __commonJS({
453
453
  lastC = index;
454
454
  }
455
455
  });
456
- args.splice(lastC, 0, c);
456
+ args.splice(lastC, 0, c3);
457
457
  }
458
458
  exports2.log = console.debug || console.log || (() => {
459
459
  });
@@ -468,15 +468,15 @@ var require_browser = __commonJS({
468
468
  }
469
469
  }
470
470
  function load() {
471
- let r;
471
+ let r2;
472
472
  try {
473
- r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG");
473
+ r2 = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG");
474
474
  } catch (error) {
475
475
  }
476
- if (!r && typeof process !== "undefined" && "env" in process) {
477
- r = process.env.DEBUG;
476
+ if (!r2 && typeof process !== "undefined" && "env" in process) {
477
+ r2 = process.env.DEBUG;
478
478
  }
479
- return r;
479
+ return r2;
480
480
  }
481
481
  function localstorage() {
482
482
  try {
@@ -496,43 +496,35 @@ var require_browser = __commonJS({
496
496
  }
497
497
  });
498
498
 
499
- // ../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js
499
+ // ../node_modules/.pnpm/has-flag@3.0.0/node_modules/has-flag/index.js
500
500
  var require_has_flag = __commonJS({
501
- "../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports2, module2) {
501
+ "../node_modules/.pnpm/has-flag@3.0.0/node_modules/has-flag/index.js"(exports2, module2) {
502
502
  "use strict";
503
- module2.exports = (flag, argv = process.argv) => {
503
+ module2.exports = (flag, argv) => {
504
+ argv = argv || process.argv;
504
505
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
505
- const position = argv.indexOf(prefix + flag);
506
- const terminatorPosition = argv.indexOf("--");
507
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
506
+ const pos = argv.indexOf(prefix + flag);
507
+ const terminatorPos = argv.indexOf("--");
508
+ return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
508
509
  };
509
510
  }
510
511
  });
511
512
 
512
- // ../node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js
513
+ // ../node_modules/.pnpm/supports-color@5.5.0/node_modules/supports-color/index.js
513
514
  var require_supports_color = __commonJS({
514
- "../node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js"(exports2, module2) {
515
+ "../node_modules/.pnpm/supports-color@5.5.0/node_modules/supports-color/index.js"(exports2, module2) {
515
516
  "use strict";
516
517
  var os2 = require("os");
517
- var tty = require("tty");
518
518
  var hasFlag = require_has_flag();
519
- var { env } = process;
520
- var flagForceColor;
521
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
522
- flagForceColor = 0;
519
+ var env = process.env;
520
+ var forceColor;
521
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) {
522
+ forceColor = false;
523
523
  } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
524
- flagForceColor = 1;
524
+ forceColor = true;
525
525
  }
526
- function envForceColor() {
527
- if ("FORCE_COLOR" in env) {
528
- if (env.FORCE_COLOR === "true") {
529
- return 1;
530
- }
531
- if (env.FORCE_COLOR === "false") {
532
- return 0;
533
- }
534
- return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
535
- }
526
+ if ("FORCE_COLOR" in env) {
527
+ forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
536
528
  }
537
529
  function translateLevel(level) {
538
530
  if (level === 0) {
@@ -545,39 +537,29 @@ var require_supports_color = __commonJS({
545
537
  has16m: level >= 3
546
538
  };
547
539
  }
548
- function supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
549
- const noFlagForceColor = envForceColor();
550
- if (noFlagForceColor !== void 0) {
551
- flagForceColor = noFlagForceColor;
552
- }
553
- const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
554
- if (forceColor === 0) {
540
+ function supportsColor(stream) {
541
+ if (forceColor === false) {
555
542
  return 0;
556
543
  }
557
- if (sniffFlags) {
558
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
559
- return 3;
560
- }
561
- if (hasFlag("color=256")) {
562
- return 2;
563
- }
544
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
545
+ return 3;
564
546
  }
565
- if (haveStream && !streamIsTTY && forceColor === void 0) {
566
- return 0;
547
+ if (hasFlag("color=256")) {
548
+ return 2;
567
549
  }
568
- const min = forceColor || 0;
569
- if (env.TERM === "dumb") {
570
- return min;
550
+ if (stream && !stream.isTTY && forceColor !== true) {
551
+ return 0;
571
552
  }
553
+ const min = forceColor ? 1 : 0;
572
554
  if (process.platform === "win32") {
573
555
  const osRelease = os2.release().split(".");
574
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
556
+ if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
575
557
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
576
558
  }
577
559
  return 1;
578
560
  }
579
561
  if ("CI" in env) {
580
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
562
+ if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
581
563
  return 1;
582
564
  }
583
565
  return min;
@@ -589,7 +571,7 @@ var require_supports_color = __commonJS({
589
571
  return 3;
590
572
  }
591
573
  if ("TERM_PROGRAM" in env) {
592
- const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
574
+ const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
593
575
  switch (env.TERM_PROGRAM) {
594
576
  case "iTerm.app":
595
577
  return version >= 3 ? 3 : 2;
@@ -606,19 +588,19 @@ var require_supports_color = __commonJS({
606
588
  if ("COLORTERM" in env) {
607
589
  return 1;
608
590
  }
591
+ if (env.TERM === "dumb") {
592
+ return min;
593
+ }
609
594
  return min;
610
595
  }
611
- function getSupportLevel(stream, options = {}) {
612
- const level = supportsColor(stream, {
613
- streamIsTTY: stream && stream.isTTY,
614
- ...options
615
- });
596
+ function getSupportLevel(stream) {
597
+ const level = supportsColor(stream);
616
598
  return translateLevel(level);
617
599
  }
618
600
  module2.exports = {
619
601
  supportsColor: getSupportLevel,
620
- stdout: getSupportLevel({ isTTY: tty.isatty(1) }),
621
- stderr: getSupportLevel({ isTTY: tty.isatty(2) })
602
+ stdout: getSupportLevel(process.stdout),
603
+ stderr: getSupportLevel(process.stderr)
622
604
  };
623
605
  }
624
606
  });
@@ -728,8 +710,8 @@ var require_node = __commonJS({
728
710
  exports2.inspectOpts = Object.keys(process.env).filter((key) => {
729
711
  return /^debug_/i.test(key);
730
712
  }).reduce((obj, key) => {
731
- const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
732
- return k.toUpperCase();
713
+ const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_2, k2) => {
714
+ return k2.toUpperCase();
733
715
  });
734
716
  let val = process.env[key];
735
717
  if (/^(yes|on|true|enabled)$/i.test(val)) {
@@ -750,8 +732,8 @@ var require_node = __commonJS({
750
732
  function formatArgs(args) {
751
733
  const { namespace: name, useColors: useColors2 } = this;
752
734
  if (useColors2) {
753
- const c = this.color;
754
- const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
735
+ const c3 = this.color;
736
+ const colorCode = "\x1B[3" + (c3 < 8 ? c3 : "8;5;" + c3);
755
737
  const prefix = ` ${colorCode};1m${name} \x1B[0m`;
756
738
  args[0] = prefix + args[0].split("\n").join("\n" + prefix);
757
739
  args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m");
@@ -781,8 +763,8 @@ var require_node = __commonJS({
781
763
  function init(debug2) {
782
764
  debug2.inspectOpts = {};
783
765
  const keys = Object.keys(exports2.inspectOpts);
784
- for (let i = 0; i < keys.length; i++) {
785
- debug2.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]];
766
+ for (let i2 = 0; i2 < keys.length; i2++) {
767
+ debug2.inspectOpts[keys[i2]] = exports2.inspectOpts[keys[i2]];
786
768
  }
787
769
  }
788
770
  module2.exports = require_common()(exports2);
@@ -859,7 +841,7 @@ var require_dist = __commonJS({
859
841
  "../node_modules/.pnpm/@kwsites+file-exists@1.1.1/node_modules/@kwsites/file-exists/dist/index.js"(exports2) {
860
842
  "use strict";
861
843
  function __export3(m) {
862
- for (var p in m) if (!exports2.hasOwnProperty(p)) exports2[p] = m[p];
844
+ for (var p2 in m) if (!exports2.hasOwnProperty(p2)) exports2[p2] = m[p2];
863
845
  }
864
846
  Object.defineProperty(exports2, "__esModule", { value: true });
865
847
  __export3(require_src2());
@@ -916,37 +898,503 @@ __export(index_exports, {
916
898
  });
917
899
  module.exports = __toCommonJS(index_exports);
918
900
  var import_node_fs = __toESM(require("fs"), 1);
919
- var import_node_os = __toESM(require("os"), 1);
920
- var import_node_path = __toESM(require("path"), 1);
901
+ var import_node_path2 = __toESM(require("path"), 1);
921
902
 
922
- // ../node_modules/.pnpm/simple-git@3.27.0/node_modules/simple-git/dist/esm/index.js
903
+ // ../node_modules/.pnpm/simple-git@3.36.0/node_modules/simple-git/dist/esm/index.js
923
904
  var import_file_exists = __toESM(require_dist(), 1);
905
+
906
+ // ../node_modules/.pnpm/@simple-git+args-pathspec@1.0.3/node_modules/@simple-git/args-pathspec/dist/index.mjs
907
+ var t = /* @__PURE__ */ new WeakMap();
908
+ function c(...n) {
909
+ const e = new String(n);
910
+ return t.set(e, n), e;
911
+ }
912
+ function r(n) {
913
+ return n instanceof String && t.has(n);
914
+ }
915
+ function o(n) {
916
+ return t.get(n) ?? [];
917
+ }
918
+
919
+ // ../node_modules/.pnpm/simple-git@3.36.0/node_modules/simple-git/dist/esm/index.js
924
920
  var import_debug = __toESM(require_src(), 1);
925
921
  var import_child_process = require("child_process");
926
922
  var import_promise_deferred = __toESM(require_dist2(), 1);
923
+ var import_node_path = require("path");
924
+
925
+ // ../node_modules/.pnpm/@simple-git+argv-parser@1.1.1/node_modules/@simple-git/argv-parser/dist/index.mjs
926
+ function* U(e, t2) {
927
+ const n = t2 === "global";
928
+ for (const o2 of e)
929
+ o2.isGlobal === n && (yield o2);
930
+ }
931
+ var k = /* @__PURE__ */ new Set([
932
+ "--add",
933
+ "--edit",
934
+ "--remove-section",
935
+ "--rename-section",
936
+ "--replace-all",
937
+ "--unset",
938
+ "--unset-all",
939
+ "-e"
940
+ ]);
941
+ var S = /* @__PURE__ */ new Set([
942
+ "--get",
943
+ "--get-all",
944
+ "--get-color",
945
+ "--get-colorbool",
946
+ "--get-regexp",
947
+ "--get-urlmatch",
948
+ "--list",
949
+ "-l"
950
+ ]);
951
+ var P = /* @__PURE__ */ new Set([
952
+ "edit",
953
+ "remove-section",
954
+ "rename-section",
955
+ "set",
956
+ "unset"
957
+ ]);
958
+ var E = /* @__PURE__ */ new Set(["get", "get-color", "get-colorbool", "list"]);
959
+ function F(e, t2) {
960
+ var _a2;
961
+ for (const { name: o2 } of U(e, "task")) {
962
+ if (k.has(o2))
963
+ return p(true, t2);
964
+ if (S.has(o2))
965
+ return p(false, t2);
966
+ }
967
+ const n = (_a2 = t2.at(0)) == null ? void 0 : _a2.toLowerCase();
968
+ return n === void 0 ? null : P.has(n) ? p(true, t2.slice(1)) : E.has(n) ? p(false, t2.slice(1)) : t2.length === 1 ? p(false, t2) : p(true, t2);
969
+ }
970
+ function p(e = false, t2 = []) {
971
+ var _a2;
972
+ const n = (_a2 = t2.at(0)) == null ? void 0 : _a2.toLowerCase();
973
+ return n === void 0 ? null : {
974
+ isWrite: e,
975
+ isRead: !e,
976
+ key: n,
977
+ value: t2.at(1)
978
+ };
979
+ }
980
+ function A(e, t2) {
981
+ return t2.isWrite && t2.value !== void 0 ? { key: t2.key, value: t2.value, scope: e } : { key: t2.key, scope: e };
982
+ }
983
+ function M(e) {
984
+ const t2 = (e == null ? void 0 : e.indexOf("=")) || -1;
985
+ return !e || t2 < 0 ? null : {
986
+ key: e.slice(0, t2).trim().toLowerCase(),
987
+ value: e.slice(t2 + 1)
988
+ };
989
+ }
990
+ function N(e) {
991
+ for (const { name: t2 } of U(e, "task"))
992
+ switch (t2) {
993
+ case "--global":
994
+ return "global";
995
+ case "--system":
996
+ return "system";
997
+ case "--worktree":
998
+ return "worktree";
999
+ case "--local":
1000
+ return "local";
1001
+ case "--file":
1002
+ case "-f":
1003
+ return "file";
1004
+ }
1005
+ return "local";
1006
+ }
1007
+ function G({ name: e }) {
1008
+ if (e === "-c" || e === "--config")
1009
+ return "inline";
1010
+ if (e === "--config-env")
1011
+ return "env";
1012
+ }
1013
+ function* O(e) {
1014
+ for (const t2 of e) {
1015
+ const n = G(t2), o2 = n && M(t2.value);
1016
+ o2 && (yield {
1017
+ ...o2,
1018
+ scope: n
1019
+ });
1020
+ }
1021
+ }
1022
+ function L(e, t2, n) {
1023
+ const o2 = {
1024
+ read: [],
1025
+ write: [...O(t2)]
1026
+ };
1027
+ return e === "config" && $(
1028
+ o2,
1029
+ N(t2),
1030
+ F(t2, n)
1031
+ ), o2;
1032
+ }
1033
+ function $(e, t2, n) {
1034
+ if (n === null)
1035
+ return;
1036
+ const o2 = A(t2, n);
1037
+ n.isWrite ? e.write.push(o2) : e.read.push(o2);
1038
+ }
1039
+ var x = {
1040
+ short: /* @__PURE__ */ new Map([
1041
+ ["c", true]
1042
+ // -c <k=v> set config key for this invocation
1043
+ ])
1044
+ };
1045
+ var D = {
1046
+ short: new Map([
1047
+ ["C", true],
1048
+ // -C <path> change working directory
1049
+ ["P", false],
1050
+ // -P no pager (alias for --no-pager)
1051
+ ["h", false],
1052
+ // -h help
1053
+ ["p", false],
1054
+ // -p paginate
1055
+ ["v", false],
1056
+ // -v version
1057
+ ...x.short.entries()
1058
+ ]),
1059
+ long: /* @__PURE__ */ new Set([
1060
+ "attr-source",
1061
+ "config-env",
1062
+ "exec-path",
1063
+ "git-dir",
1064
+ "list-cmds",
1065
+ "namespace",
1066
+ "super-prefix",
1067
+ "work-tree"
1068
+ ])
1069
+ };
1070
+ var R = {
1071
+ clone: {
1072
+ short: /* @__PURE__ */ new Map([
1073
+ ["b", true],
1074
+ // -b <branch>
1075
+ ["j", true],
1076
+ // -j <n> parallel jobs
1077
+ ["l", false],
1078
+ // -l local
1079
+ ["n", false],
1080
+ // -n no-checkout
1081
+ ["o", true],
1082
+ // -o <name> remote name
1083
+ ["q", false],
1084
+ // -q quiet
1085
+ ["s", false],
1086
+ // -s shared
1087
+ ["u", true]
1088
+ // -u <upload-pack>
1089
+ ]),
1090
+ long: /* @__PURE__ */ new Set(["branch", "config", "jobs", "origin", "upload-pack", "u", "template"])
1091
+ },
1092
+ commit: {
1093
+ short: /* @__PURE__ */ new Map([
1094
+ ["C", true],
1095
+ // -C <commit> reuse message
1096
+ ["F", true],
1097
+ // -F <file> read message from file
1098
+ ["c", true],
1099
+ // -c <commit> reedit message
1100
+ ["m", true],
1101
+ // -m <msg>
1102
+ ["t", true]
1103
+ // -t <template>
1104
+ ]),
1105
+ long: /* @__PURE__ */ new Set(["file", "message", "reedit-message", "reuse-message", "template"])
1106
+ },
1107
+ config: {
1108
+ short: /* @__PURE__ */ new Map([
1109
+ ["e", false],
1110
+ // -e open editor
1111
+ ["f", true],
1112
+ // -f <file>
1113
+ ["l", false]
1114
+ // -l list
1115
+ ]),
1116
+ long: /* @__PURE__ */ new Set(["blob", "comment", "default", "file", "type", "value"])
1117
+ },
1118
+ fetch: {
1119
+ short: /* @__PURE__ */ new Map(),
1120
+ long: /* @__PURE__ */ new Set(["upload-pack"])
1121
+ },
1122
+ init: {
1123
+ short: /* @__PURE__ */ new Map(),
1124
+ long: /* @__PURE__ */ new Set(["template"])
1125
+ },
1126
+ pull: {
1127
+ short: /* @__PURE__ */ new Map(),
1128
+ long: /* @__PURE__ */ new Set(["upload-pack"])
1129
+ },
1130
+ push: {
1131
+ short: /* @__PURE__ */ new Map(),
1132
+ long: /* @__PURE__ */ new Set(["exec", "receive-pack"])
1133
+ }
1134
+ };
1135
+ var T = { short: /* @__PURE__ */ new Map(), long: /* @__PURE__ */ new Set() };
1136
+ function I(e) {
1137
+ const t2 = R[e ?? ""] ?? T;
1138
+ return {
1139
+ short: new Map([...x.short.entries(), ...t2.short.entries()]),
1140
+ long: t2.long
1141
+ };
1142
+ }
1143
+ function b(e, t2 = D) {
1144
+ if (e.startsWith("--")) {
1145
+ const n = e.indexOf("=");
1146
+ if (n > 2)
1147
+ return [{ name: e.slice(0, n), value: e.slice(n + 1), needsNext: false }];
1148
+ const o2 = e.slice(2);
1149
+ return [{ name: e, needsNext: t2.long.has(o2) }];
1150
+ }
1151
+ if (e.length === 2) {
1152
+ const n = e.charAt(1), o2 = t2.short.get(n);
1153
+ return [{ name: e, needsNext: o2 === true }];
1154
+ }
1155
+ return W(e, t2.short);
1156
+ }
1157
+ function W(e, t2) {
1158
+ const n = e.slice(1).split(""), o2 = [];
1159
+ for (let s = 0; s < n.length; s++) {
1160
+ const r2 = n[s], l = t2.get(r2);
1161
+ if (l === void 0)
1162
+ return [{ name: e, needsNext: false }];
1163
+ if (l) {
1164
+ const a = n.slice(s + 1).join("");
1165
+ if (a && ![...a].every((w) => t2.has(w)))
1166
+ return o2.push({ name: `-${r2}`, value: a, needsNext: false }), o2;
1167
+ }
1168
+ o2.push({ name: `-${r2}`, needsNext: l });
1169
+ }
1170
+ return o2;
1171
+ }
1172
+ function j(e, t2 = []) {
1173
+ let n = 0;
1174
+ for (; n < e.length; ) {
1175
+ const o2 = String(e[n]);
1176
+ if (!o2.startsWith("-") || o2.length < 2) break;
1177
+ const s = b(o2);
1178
+ let r2 = n + 1;
1179
+ for (const l of s) {
1180
+ const a = {
1181
+ name: l.name,
1182
+ value: l.value,
1183
+ absorbedNext: false,
1184
+ isGlobal: true
1185
+ };
1186
+ l.needsNext && a.value === void 0 && r2 < e.length && (a.value = String(e[r2]), a.absorbedNext = true, r2++), t2.push(a);
1187
+ }
1188
+ n = r2;
1189
+ }
1190
+ return { flags: t2, taskIndex: n };
1191
+ }
1192
+ function B(e, t2, n = []) {
1193
+ const o2 = I(t2), s = [], r2 = [];
1194
+ let l = 0;
1195
+ for (; l < e.length; ) {
1196
+ const a = e[l];
1197
+ if (r(a)) {
1198
+ r2.push(...o(a)), l++;
1199
+ continue;
1200
+ }
1201
+ const f = String(a);
1202
+ if (f === "--") {
1203
+ for (let g = l + 1; g < e.length; g++) {
1204
+ const u = e[g];
1205
+ r(u) ? r2.push(...o(u)) : r2.push(String(u));
1206
+ }
1207
+ break;
1208
+ }
1209
+ if (!f.startsWith("-") || f.length < 2) {
1210
+ s.push(f), l++;
1211
+ continue;
1212
+ }
1213
+ const w = b(f, o2);
1214
+ let d = l + 1;
1215
+ for (const g of w) {
1216
+ const u = {
1217
+ name: g.name,
1218
+ value: g.value,
1219
+ absorbedNext: false,
1220
+ isGlobal: false
1221
+ };
1222
+ g.needsNext && u.value === void 0 && d < e.length && !r(e[d]) && (u.value = String(e[d]), u.absorbedNext = true, d++), n.push(u);
1223
+ }
1224
+ l = d;
1225
+ }
1226
+ return { flags: n, positionals: s, pathspecs: r2 };
1227
+ }
1228
+ function* V({
1229
+ write: e
1230
+ }) {
1231
+ for (const t2 of e)
1232
+ for (const n of q) {
1233
+ const o2 = n(t2.key);
1234
+ o2 && (yield o2);
1235
+ }
1236
+ }
1237
+ function c2(e, t2, n = String(e)) {
1238
+ const o2 = typeof e == "string" ? new RegExp(`\\s*${e.toLowerCase()}`) : e;
1239
+ return function(r2) {
1240
+ if (o2.test(r2))
1241
+ return {
1242
+ category: t2,
1243
+ message: `Configuring ${n} is not permitted without enabling ${t2}`
1244
+ };
1245
+ };
1246
+ }
1247
+ function i(e, t2) {
1248
+ const n = new RegExp(`\\s*${e.toLowerCase().replace(/\./g, "(..+)?.")}`);
1249
+ return c2(n, t2, e);
1250
+ }
1251
+ var q = [
1252
+ c2("alias", "allowUnsafeAlias"),
1253
+ c2("core.askPass", "allowUnsafeAskPass"),
1254
+ c2("core.editor", "allowUnsafeEditor"),
1255
+ c2("core.fsmonitor", "allowUnsafeFsMonitor"),
1256
+ c2("core.gitProxy", "allowUnsafeGitProxy"),
1257
+ c2("core.hooksPath", "allowUnsafeHooksPath"),
1258
+ c2("core.pager", "allowUnsafePager"),
1259
+ c2("core.sshCommand", "allowUnsafeSshCommand"),
1260
+ i("credential.helper", "allowUnsafeCredentialHelper"),
1261
+ i("diff.command", "allowUnsafeDiffExternal"),
1262
+ c2("diff.external", "allowUnsafeDiffExternal"),
1263
+ i("diff.textconv", "allowUnsafeDiffTextConv"),
1264
+ i("filter.clean", "allowUnsafeFilter"),
1265
+ i("filter.smudge", "allowUnsafeFilter"),
1266
+ i("gpg.program", "allowUnsafeGpgProgram"),
1267
+ c2("init.templateDir", "allowUnsafeTemplateDir"),
1268
+ i("merge.driver", "allowUnsafeMergeDriver"),
1269
+ i("mergetool.path", "allowUnsafeMergeDriver"),
1270
+ i("mergetool.cmd", "allowUnsafeMergeDriver"),
1271
+ i("protocol.allow", "allowUnsafeProtocolOverride"),
1272
+ i("remote.receivepack", "allowUnsafePack"),
1273
+ i("remote.uploadpack", "allowUnsafePack"),
1274
+ c2("sequence.editor", "allowUnsafeEditor")
1275
+ ];
1276
+ function* K(e, t2) {
1277
+ for (const n of t2)
1278
+ for (const o2 of H) {
1279
+ const s = o2(e, n.name);
1280
+ s && (yield s);
1281
+ }
1282
+ }
1283
+ function h(e, t2, n, o2 = String(t2)) {
1284
+ const s = typeof t2 == "string" ? new RegExp(`\\s*${t2.toLowerCase()}`) : t2, r2 = `Use of ${e ? `${e} with option ` : ""}${o2} is not permitted without enabling ${n}`;
1285
+ return function(a, f) {
1286
+ if ((!e || a === e) && s.test(f))
1287
+ return {
1288
+ category: n,
1289
+ message: r2
1290
+ };
1291
+ };
1292
+ }
1293
+ var H = [
1294
+ h(
1295
+ null,
1296
+ /--(upload|receive)-pack/,
1297
+ "allowUnsafePack",
1298
+ "--upload-pack or --receive-pack"
1299
+ ),
1300
+ h("clone", /^-\w*u/, "allowUnsafePack"),
1301
+ h("clone", "--u", "allowUnsafePack"),
1302
+ h("push", "--exec", "allowUnsafePack"),
1303
+ h(null, "--template", "allowUnsafeTemplateDir")
1304
+ ];
1305
+ function C(e, t2, n) {
1306
+ return [...K(e, t2), ...V(n)];
1307
+ }
1308
+ function Y(...e) {
1309
+ const { flags: t2, taskIndex: n } = j(e), o2 = n < e.length ? String(e[n]).toLowerCase() : null, s = o2 !== null ? e.slice(n + 1) : [], { positionals: r2, pathspecs: l } = B(s, o2, t2), a = L(o2, t2, r2);
1310
+ return {
1311
+ task: o2,
1312
+ flags: t2.map(J),
1313
+ paths: l,
1314
+ config: a,
1315
+ vulnerabilities: z(C(o2, t2, a))
1316
+ };
1317
+ }
1318
+ function z(e) {
1319
+ return Object.defineProperty(e, "vulnerabilities", {
1320
+ value: e
1321
+ });
1322
+ }
1323
+ function J({ value: e, name: t2 }) {
1324
+ return e !== void 0 ? { name: t2, value: e } : { name: t2 };
1325
+ }
1326
+ var y = {
1327
+ editor: "allowUnsafeEditor",
1328
+ git_askpass: "allowUnsafeAskPass",
1329
+ git_config_global: "allowUnsafeConfigPaths",
1330
+ git_config_system: "allowUnsafeConfigPaths",
1331
+ git_config_count: "allowUnsafeConfigEnvCount",
1332
+ git_config: "allowUnsafeConfigPaths",
1333
+ git_editor: "allowUnsafeEditor",
1334
+ git_exec_path: "allowUnsafeConfigPaths",
1335
+ git_external_diff: "allowUnsafeDiffExternal",
1336
+ git_pager: "allowUnsafePager",
1337
+ git_proxy_command: "allowUnsafeGitProxy",
1338
+ git_template_dir: "allowUnsafeTemplateDir",
1339
+ git_sequence_editor: "allowUnsafeEditor",
1340
+ git_ssh: "allowUnsafeSshCommand",
1341
+ git_ssh_command: "allowUnsafeSshCommand",
1342
+ pager: "allowUnsafePager",
1343
+ prefix: "allowUnsafeConfigPaths",
1344
+ ssh_askpass: "allowUnsafeAskPass"
1345
+ };
1346
+ function* Q(e) {
1347
+ const t2 = parseInt(e.git_config_count ?? "0", 10);
1348
+ for (let n = 0; n < t2; n++) {
1349
+ const o2 = e[`git_config_key_${n}`], s = e[`git_config_value_${n}`];
1350
+ o2 !== void 0 && (yield { key: o2.toLowerCase().trim(), value: s, scope: "env" });
1351
+ }
1352
+ }
1353
+ function* X(e) {
1354
+ for (const t2 of Object.keys(e))
1355
+ if (_(t2)) {
1356
+ const n = y[t2];
1357
+ yield {
1358
+ category: n,
1359
+ message: `Use of "${t2.toUpperCase()}" is not permitted without enabling ${n}`
1360
+ };
1361
+ }
1362
+ }
1363
+ function _(e) {
1364
+ return Object.hasOwn(y, e);
1365
+ }
1366
+ function Z(e) {
1367
+ const t2 = {};
1368
+ for (const [n, o2] of Object.entries(e)) {
1369
+ const s = n.toLowerCase().trim();
1370
+ (_(s) || s.startsWith("git")) && (t2[s] = String(o2));
1371
+ }
1372
+ return t2;
1373
+ }
1374
+ function ee(e) {
1375
+ const t2 = Z(e), n = {
1376
+ read: [],
1377
+ write: [...Q(t2)]
1378
+ }, o2 = [
1379
+ ...X(t2),
1380
+ ...C(null, [], n)
1381
+ ];
1382
+ return {
1383
+ config: n,
1384
+ vulnerabilities: o2
1385
+ };
1386
+ }
1387
+ function ne(e, t2) {
1388
+ return [...Y(...e).vulnerabilities, ...ee(t2).vulnerabilities];
1389
+ }
1390
+
1391
+ // ../node_modules/.pnpm/simple-git@3.36.0/node_modules/simple-git/dist/esm/index.js
927
1392
  var import_promise_deferred2 = __toESM(require_dist2(), 1);
928
1393
  var import_node_events = require("events");
929
1394
  var __defProp2 = Object.defineProperty;
930
- var __defProps = Object.defineProperties;
931
1395
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
932
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
933
1396
  var __getOwnPropNames2 = Object.getOwnPropertyNames;
934
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
935
1397
  var __hasOwnProp2 = Object.prototype.hasOwnProperty;
936
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
937
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
938
- var __spreadValues = (a, b) => {
939
- for (var prop in b || (b = {}))
940
- if (__hasOwnProp2.call(b, prop))
941
- __defNormalProp(a, prop, b[prop]);
942
- if (__getOwnPropSymbols)
943
- for (var prop of __getOwnPropSymbols(b)) {
944
- if (__propIsEnum.call(b, prop))
945
- __defNormalProp(a, prop, b[prop]);
946
- }
947
- return a;
948
- };
949
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
950
1398
  var __esm = (fn, res) => function __init() {
951
1399
  return fn && (res = (0, fn[__getOwnPropNames2(fn)[0]])(fn = 0)), res;
952
1400
  };
@@ -966,44 +1414,6 @@ var __copyProps2 = (to, from, except, desc) => {
966
1414
  return to;
967
1415
  };
968
1416
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
969
- var __async = (__this, __arguments, generator) => {
970
- return new Promise((resolve, reject) => {
971
- var fulfilled = (value) => {
972
- try {
973
- step(generator.next(value));
974
- } catch (e) {
975
- reject(e);
976
- }
977
- };
978
- var rejected = (value) => {
979
- try {
980
- step(generator.throw(value));
981
- } catch (e) {
982
- reject(e);
983
- }
984
- };
985
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
986
- step((generator = generator.apply(__this, __arguments)).next());
987
- });
988
- };
989
- function pathspec(...paths) {
990
- const key = new String(paths);
991
- cache.set(key, paths);
992
- return key;
993
- }
994
- function isPathSpec(path2) {
995
- return path2 instanceof String && cache.has(path2);
996
- }
997
- function toPaths(pathSpec) {
998
- return cache.get(pathSpec) || [];
999
- }
1000
- var cache;
1001
- var init_pathspec = __esm({
1002
- "src/lib/args/pathspec.ts"() {
1003
- "use strict";
1004
- cache = /* @__PURE__ */ new WeakMap();
1005
- }
1006
- });
1007
1417
  var GitError;
1008
1418
  var init_git_error = __esm({
1009
1419
  "src/lib/errors/git-error.ts"() {
@@ -1043,7 +1453,10 @@ var init_task_configuration_error = __esm({
1043
1453
  }
1044
1454
  });
1045
1455
  function asFunction(source) {
1046
- return typeof source === "function" ? source : NOOP;
1456
+ if (typeof source !== "function") {
1457
+ return NOOP;
1458
+ }
1459
+ return source;
1047
1460
  }
1048
1461
  function isUserFunction(source) {
1049
1462
  return typeof source === "function" && source !== NOOP;
@@ -1064,7 +1477,7 @@ function last(input, offset = 0) {
1064
1477
  }
1065
1478
  }
1066
1479
  function isArrayLike(input) {
1067
- return !!(input && typeof input.length === "number");
1480
+ return filterHasLength(input);
1068
1481
  }
1069
1482
  function toLinesWithContent(input = "", trimmed2 = true, separator = "\n") {
1070
1483
  return input.split(separator).reduce((output, line) => {
@@ -1117,19 +1530,21 @@ function asCamelCase(str) {
1117
1530
  });
1118
1531
  }
1119
1532
  function asStringArray(source) {
1120
- return asArray(source).map(String);
1533
+ return asArray(source).map((item) => {
1534
+ return item instanceof String ? item : String(item);
1535
+ });
1121
1536
  }
1122
1537
  function asNumber(source, onNaN = 0) {
1123
1538
  if (source == null) {
1124
1539
  return onNaN;
1125
1540
  }
1126
1541
  const num = parseInt(source, 10);
1127
- return isNaN(num) ? onNaN : num;
1542
+ return Number.isNaN(num) ? onNaN : num;
1128
1543
  }
1129
1544
  function prefixedArray(input, prefix) {
1130
1545
  const output = [];
1131
- for (let i = 0, max = input.length; i < max; i++) {
1132
- output.push(prefix, input[i]);
1546
+ for (let i2 = 0, max = input.length; i2 < max; i2++) {
1547
+ output.push(prefix, input[i2]);
1133
1548
  }
1134
1549
  return output;
1135
1550
  }
@@ -1137,10 +1552,13 @@ function bufferToString(input) {
1137
1552
  return (Array.isArray(input) ? Buffer.concat(input) : input).toString("utf-8");
1138
1553
  }
1139
1554
  function pick(source, properties) {
1140
- return Object.assign(
1141
- {},
1142
- ...properties.map((property) => property in source ? { [property]: source[property] } : {})
1143
- );
1555
+ const out = {};
1556
+ properties.forEach((key) => {
1557
+ if (source[key] !== void 0) {
1558
+ out[key] = source[key];
1559
+ }
1560
+ });
1561
+ return out;
1144
1562
  }
1145
1563
  function delay(duration = 0) {
1146
1564
  return new Promise((done) => setTimeout(done, duration));
@@ -1157,6 +1575,7 @@ var objectToString;
1157
1575
  var init_util = __esm({
1158
1576
  "src/lib/utils/util.ts"() {
1159
1577
  "use strict";
1578
+ init_argument_filters();
1160
1579
  NULL = "\0";
1161
1580
  NOOP = () => {
1162
1581
  };
@@ -1170,7 +1589,7 @@ function filterType(input, filter, def) {
1170
1589
  return arguments.length > 2 ? def : void 0;
1171
1590
  }
1172
1591
  function filterPrimitives(input, omit) {
1173
- const type = isPathSpec(input) ? "string" : typeof input;
1592
+ const type = r(input) ? "string" : typeof input;
1174
1593
  return /number|string|boolean/.test(type) && (!omit || !omit.includes(type));
1175
1594
  }
1176
1595
  function filterPlainObject(input) {
@@ -1180,23 +1599,22 @@ function filterFunction(input) {
1180
1599
  return typeof input === "function";
1181
1600
  }
1182
1601
  var filterArray;
1602
+ var filterNumber;
1183
1603
  var filterString;
1184
- var filterStringArray;
1185
1604
  var filterStringOrStringArray;
1186
1605
  var filterHasLength;
1187
1606
  var init_argument_filters = __esm({
1188
1607
  "src/lib/utils/argument-filters.ts"() {
1189
1608
  "use strict";
1190
1609
  init_util();
1191
- init_pathspec();
1192
1610
  filterArray = (input) => {
1193
1611
  return Array.isArray(input);
1194
1612
  };
1195
- filterString = (input) => {
1196
- return typeof input === "string";
1613
+ filterNumber = (input) => {
1614
+ return typeof input === "number";
1197
1615
  };
1198
- filterStringArray = (input) => {
1199
- return Array.isArray(input) && input.every(filterString);
1616
+ filterString = (input) => {
1617
+ return typeof input === "string" || r(input);
1200
1618
  };
1201
1619
  filterStringOrStringArray = (input) => {
1202
1620
  return filterString(input) || Array.isArray(input) && input.every(filterString);
@@ -1205,7 +1623,7 @@ var init_argument_filters = __esm({
1205
1623
  if (input == null || "number|boolean|function".includes(typeof input)) {
1206
1624
  return false;
1207
1625
  }
1208
- return Array.isArray(input) || typeof input === "string" || typeof input.length === "number";
1626
+ return typeof input.length === "number";
1209
1627
  };
1210
1628
  }
1211
1629
  });
@@ -1226,17 +1644,20 @@ var GitOutputStreams;
1226
1644
  var init_git_output_streams = __esm({
1227
1645
  "src/lib/utils/git-output-streams.ts"() {
1228
1646
  "use strict";
1229
- GitOutputStreams = class {
1647
+ GitOutputStreams = class _GitOutputStreams {
1230
1648
  constructor(stdOut, stdErr) {
1231
1649
  this.stdOut = stdOut;
1232
1650
  this.stdErr = stdErr;
1233
1651
  }
1234
1652
  asStrings() {
1235
- return new GitOutputStreams(this.stdOut.toString("utf8"), this.stdErr.toString("utf8"));
1653
+ return new _GitOutputStreams(this.stdOut.toString("utf8"), this.stdErr.toString("utf8"));
1236
1654
  }
1237
1655
  };
1238
1656
  }
1239
1657
  });
1658
+ function useMatchesDefault() {
1659
+ throw new Error(`LineParser:useMatches not implemented`);
1660
+ }
1240
1661
  var LineParser;
1241
1662
  var RemoteLineParser;
1242
1663
  var init_line_parser = __esm({
@@ -1245,6 +1666,7 @@ var init_line_parser = __esm({
1245
1666
  LineParser = class {
1246
1667
  constructor(regExp, useMatches) {
1247
1668
  this.matches = [];
1669
+ this.useMatches = useMatchesDefault;
1248
1670
  this.parse = (line, target) => {
1249
1671
  this.resetMatches();
1250
1672
  if (!this._regExp.every((reg, index) => this.addMatch(reg, index, line(index)))) {
@@ -1257,9 +1679,6 @@ var init_line_parser = __esm({
1257
1679
  this.useMatches = useMatches;
1258
1680
  }
1259
1681
  }
1260
- useMatches(target, match) {
1261
- throw new Error(`LineParser:useMatches not implemented`);
1262
- }
1263
1682
  resetMatches() {
1264
1683
  this.matches.length = 0;
1265
1684
  }
@@ -1292,8 +1711,8 @@ var init_line_parser = __esm({
1292
1711
  function createInstanceConfig(...options) {
1293
1712
  const baseDir = process.cwd();
1294
1713
  const config = Object.assign(
1295
- __spreadValues({ baseDir }, defaultOptions),
1296
- ...options.filter((o) => typeof o === "object" && o)
1714
+ { baseDir, ...defaultOptions },
1715
+ ...options.filter((o2) => typeof o2 === "object" && o2)
1297
1716
  );
1298
1717
  config.baseDir = config.baseDir || baseDir;
1299
1718
  config.trimmed = config.trimmed === true;
@@ -1317,10 +1736,16 @@ function appendTaskOptions(options, commands = []) {
1317
1736
  }
1318
1737
  return Object.keys(options).reduce((commands2, key) => {
1319
1738
  const value = options[key];
1320
- if (isPathSpec(value)) {
1739
+ if (r(value)) {
1321
1740
  commands2.push(value);
1322
1741
  } else if (filterPrimitives(value, ["boolean"])) {
1323
1742
  commands2.push(key + "=" + value);
1743
+ } else if (Array.isArray(value)) {
1744
+ for (const v of value) {
1745
+ if (!filterPrimitives(v, ["string", "number"])) {
1746
+ commands2.push(key + "=" + v);
1747
+ }
1748
+ }
1324
1749
  } else {
1325
1750
  commands2.push(key);
1326
1751
  }
@@ -1329,9 +1754,9 @@ function appendTaskOptions(options, commands = []) {
1329
1754
  }
1330
1755
  function getTrailingOptions(args, initialPrimitive = 0, objectOnly = false) {
1331
1756
  const command = [];
1332
- for (let i = 0, max = initialPrimitive < 0 ? args.length : initialPrimitive; i < max; i++) {
1333
- if ("string|number".includes(typeof args[i])) {
1334
- command.push(String(args[i]));
1757
+ for (let i2 = 0, max = initialPrimitive < 0 ? args.length : initialPrimitive; i2 < max; i2++) {
1758
+ if ("string|number".includes(typeof args[i2])) {
1759
+ command.push(String(args[i2]));
1335
1760
  }
1336
1761
  }
1337
1762
  appendTaskOptions(trailingOptionsArgument(args), command);
@@ -1342,7 +1767,7 @@ function getTrailingOptions(args, initialPrimitive = 0, objectOnly = false) {
1342
1767
  }
1343
1768
  function trailingArrayArgument(args) {
1344
1769
  const hasTrailingCallback = typeof last(args) === "function";
1345
- return filterType(last(args, hasTrailingCallback ? 1 : 0), filterArray, []);
1770
+ return asStringArray(filterType(last(args, hasTrailingCallback ? 1 : 0), filterArray, []));
1346
1771
  }
1347
1772
  function trailingOptionsArgument(args) {
1348
1773
  const hasTrailingCallback = filterFunction(last(args));
@@ -1357,7 +1782,6 @@ var init_task_options = __esm({
1357
1782
  "use strict";
1358
1783
  init_argument_filters();
1359
1784
  init_util();
1360
- init_pathspec();
1361
1785
  }
1362
1786
  });
1363
1787
  function callTaskParser(parser4, streams) {
@@ -1365,12 +1789,12 @@ function callTaskParser(parser4, streams) {
1365
1789
  }
1366
1790
  function parseStringResponse(result, parsers12, texts, trim = true) {
1367
1791
  asArray(texts).forEach((text) => {
1368
- for (let lines = toLinesWithContent(text, trim), i = 0, max = lines.length; i < max; i++) {
1792
+ for (let lines = toLinesWithContent(text, trim), i2 = 0, max = lines.length; i2 < max; i2++) {
1369
1793
  const line = (offset = 0) => {
1370
- if (i + offset >= max) {
1794
+ if (i2 + offset >= max) {
1371
1795
  return;
1372
1796
  }
1373
- return lines[i + offset];
1797
+ return lines[i2 + offset];
1374
1798
  };
1375
1799
  parsers12.some(({ parse }) => parse(line, result));
1376
1800
  }
@@ -1405,10 +1829,10 @@ __export2(utils_exports, {
1405
1829
  filterArray: () => filterArray,
1406
1830
  filterFunction: () => filterFunction,
1407
1831
  filterHasLength: () => filterHasLength,
1832
+ filterNumber: () => filterNumber,
1408
1833
  filterPlainObject: () => filterPlainObject,
1409
1834
  filterPrimitives: () => filterPrimitives,
1410
1835
  filterString: () => filterString,
1411
- filterStringArray: () => filterStringArray,
1412
1836
  filterStringOrStringArray: () => filterStringOrStringArray,
1413
1837
  filterType: () => filterType,
1414
1838
  first: () => first,
@@ -1731,9 +2155,9 @@ function configFilePath(filePath) {
1731
2155
  }
1732
2156
  function* configParser(text, requestedKey = null) {
1733
2157
  const lines = text.split("\0");
1734
- for (let i = 0, max = lines.length - 1; i < max; ) {
1735
- const file = configFilePath(lines[i++]);
1736
- let value = lines[i++];
2158
+ for (let i2 = 0, max = lines.length - 1; i2 < max; ) {
2159
+ const file = configFilePath(lines[i2++]);
2160
+ let value = lines[i2++];
1737
2161
  let key = requestedKey;
1738
2162
  if (value.includes("\n")) {
1739
2163
  const line = splitOn(value, "\n");
@@ -1771,7 +2195,7 @@ var init_ConfigList = __esm({
1771
2195
  }
1772
2196
  addValue(file, key, value) {
1773
2197
  const values = this.addFile(file);
1774
- if (!values.hasOwnProperty(key)) {
2198
+ if (!Object.hasOwn(values, key)) {
1775
2199
  values[key] = value;
1776
2200
  } else if (Array.isArray(values[key])) {
1777
2201
  values[key].push(value);
@@ -1784,7 +2208,7 @@ var init_ConfigList = __esm({
1784
2208
  }
1785
2209
  });
1786
2210
  function asConfigScope(scope, fallback) {
1787
- if (typeof scope === "string" && GitConfigScope.hasOwnProperty(scope)) {
2211
+ if (typeof scope === "string" && Object.hasOwn(GitConfigScope, scope)) {
1788
2212
  return scope;
1789
2213
  }
1790
2214
  return fallback;
@@ -2005,13 +2429,14 @@ function getResetMode(mode) {
2005
2429
  return;
2006
2430
  }
2007
2431
  function isValidResetMode(mode) {
2008
- return ResetModes.includes(mode);
2432
+ return typeof mode === "string" && validResetModes.includes(mode);
2009
2433
  }
2010
2434
  var ResetMode;
2011
- var ResetModes;
2435
+ var validResetModes;
2012
2436
  var init_reset = __esm({
2013
2437
  "src/lib/tasks/reset.ts"() {
2014
2438
  "use strict";
2439
+ init_utils();
2015
2440
  init_task();
2016
2441
  ResetMode = /* @__PURE__ */ ((ResetMode2) => {
2017
2442
  ResetMode2["MIXED"] = "mixed";
@@ -2021,7 +2446,7 @@ var init_reset = __esm({
2021
2446
  ResetMode2["KEEP"] = "keep";
2022
2447
  return ResetMode2;
2023
2448
  })(ResetMode || {});
2024
- ResetModes = Array.from(Object.values(ResetMode));
2449
+ validResetModes = asStringArray(Object.values(ResetMode));
2025
2450
  }
2026
2451
  });
2027
2452
  function createLog() {
@@ -2088,14 +2513,14 @@ var init_git_logger = __esm({
2088
2513
  };
2089
2514
  }
2090
2515
  });
2091
- var _TasksPendingQueue;
2092
2516
  var TasksPendingQueue;
2093
2517
  var init_tasks_pending_queue = __esm({
2094
2518
  "src/lib/runners/tasks-pending-queue.ts"() {
2095
2519
  "use strict";
2520
+ var _a2;
2096
2521
  init_git_error();
2097
2522
  init_git_logger();
2098
- _TasksPendingQueue = class {
2523
+ TasksPendingQueue = (_a2 = class {
2099
2524
  constructor(logLabel = "GitExecutor") {
2100
2525
  this.logLabel = logLabel;
2101
2526
  this._queue = /* @__PURE__ */ new Map();
@@ -2104,7 +2529,7 @@ var init_tasks_pending_queue = __esm({
2104
2529
  return this._queue.get(task);
2105
2530
  }
2106
2531
  createProgress(task) {
2107
- const name = _TasksPendingQueue.getName(task.commands[0]);
2532
+ const name = _a2.getName(task.commands[0]);
2108
2533
  const logger = createLogger(this.logLabel, name);
2109
2534
  return {
2110
2535
  task,
@@ -2152,11 +2577,9 @@ var init_tasks_pending_queue = __esm({
2152
2577
  return progress;
2153
2578
  }
2154
2579
  static getName(name = "empty") {
2155
- return `task:${name}:${++_TasksPendingQueue.counter}`;
2580
+ return `task:${name}:${++_a2.counter}`;
2156
2581
  }
2157
- };
2158
- TasksPendingQueue = _TasksPendingQueue;
2159
- TasksPendingQueue.counter = 0;
2582
+ }, _a2.counter = 0, _a2);
2160
2583
  }
2161
2584
  });
2162
2585
  function pluginContext(task, commands) {
@@ -2213,20 +2636,18 @@ var init_git_executor_chain = __esm({
2213
2636
  this._queue.push(task);
2214
2637
  return this._chain = this._chain.then(() => this.attemptTask(task));
2215
2638
  }
2216
- attemptTask(task) {
2217
- return __async(this, null, function* () {
2218
- const onScheduleComplete = yield this._scheduler.next();
2219
- const onQueueComplete = () => this._queue.complete(task);
2220
- try {
2221
- const { logger } = this._queue.attempt(task);
2222
- return yield isEmptyTask(task) ? this.attemptEmptyTask(task, logger) : this.attemptRemoteTask(task, logger);
2223
- } catch (e) {
2224
- throw this.onFatalException(task, e);
2225
- } finally {
2226
- onQueueComplete();
2227
- onScheduleComplete();
2228
- }
2229
- });
2639
+ async attemptTask(task) {
2640
+ const onScheduleComplete = await this._scheduler.next();
2641
+ const onQueueComplete = () => this._queue.complete(task);
2642
+ try {
2643
+ const { logger } = this._queue.attempt(task);
2644
+ return await (isEmptyTask(task) ? this.attemptEmptyTask(task, logger) : this.attemptRemoteTask(task, logger));
2645
+ } catch (e) {
2646
+ throw this.onFatalException(task, e);
2647
+ } finally {
2648
+ onQueueComplete();
2649
+ onScheduleComplete();
2650
+ }
2230
2651
  }
2231
2652
  onFatalException(task, e) {
2232
2653
  const gitError = e instanceof GitError ? Object.assign(e, { task }) : new GitError(task, e && String(e));
@@ -2234,34 +2655,29 @@ var init_git_executor_chain = __esm({
2234
2655
  this._queue.fatal(gitError);
2235
2656
  return gitError;
2236
2657
  }
2237
- attemptRemoteTask(task, logger) {
2238
- return __async(this, null, function* () {
2239
- const binary = this._plugins.exec("spawn.binary", "", pluginContext(task, task.commands));
2240
- const args = this._plugins.exec(
2241
- "spawn.args",
2242
- [...task.commands],
2243
- pluginContext(task, task.commands)
2244
- );
2245
- const raw = yield this.gitResponse(
2246
- task,
2247
- binary,
2248
- args,
2249
- this.outputHandler,
2250
- logger.step("SPAWN")
2251
- );
2252
- const outputStreams = yield this.handleTaskData(task, args, raw, logger.step("HANDLE"));
2253
- logger(`passing response to task's parser as a %s`, task.format);
2254
- if (isBufferTask(task)) {
2255
- return callTaskParser(task.parser, outputStreams);
2256
- }
2257
- return callTaskParser(task.parser, outputStreams.asStrings());
2658
+ async attemptRemoteTask(task, logger) {
2659
+ const binary = this._plugins.exec("spawn.binary", "", pluginContext(task, task.commands));
2660
+ const args = this._plugins.exec("spawn.args", [...task.commands], {
2661
+ ...pluginContext(task, task.commands),
2662
+ env: { ...this.env }
2258
2663
  });
2664
+ const raw = await this.gitResponse(
2665
+ task,
2666
+ binary,
2667
+ args,
2668
+ this.outputHandler,
2669
+ logger.step("SPAWN")
2670
+ );
2671
+ const outputStreams = await this.handleTaskData(task, args, raw, logger.step("HANDLE"));
2672
+ logger(`passing response to task's parser as a %s`, task.format);
2673
+ if (isBufferTask(task)) {
2674
+ return callTaskParser(task.parser, outputStreams);
2675
+ }
2676
+ return callTaskParser(task.parser, outputStreams.asStrings());
2259
2677
  }
2260
- attemptEmptyTask(task, logger) {
2261
- return __async(this, null, function* () {
2262
- logger(`empty task bypassing child process to call to task's parser`);
2263
- return task.parser(this);
2264
- });
2678
+ async attemptEmptyTask(task, logger) {
2679
+ logger(`empty task bypassing child process to call to task's parser`);
2680
+ return task.parser(this);
2265
2681
  }
2266
2682
  handleTaskData(task, args, result, logger) {
2267
2683
  const { exitCode, rejection, stdOut, stdErr } = result;
@@ -2270,7 +2686,10 @@ var init_git_executor_chain = __esm({
2270
2686
  const { error } = this._plugins.exec(
2271
2687
  "task.error",
2272
2688
  { error: rejection },
2273
- __spreadValues(__spreadValues({}, pluginContext(task, args)), result)
2689
+ {
2690
+ ...pluginContext(task, args),
2691
+ ...result
2692
+ }
2274
2693
  );
2275
2694
  if (error && task.onError) {
2276
2695
  logger.info(`exitCode=%s handling with custom error handler`);
@@ -2303,79 +2722,80 @@ var init_git_executor_chain = __esm({
2303
2722
  done(new GitOutputStreams(Buffer.concat(stdOut), Buffer.concat(stdErr)));
2304
2723
  });
2305
2724
  }
2306
- gitResponse(task, command, args, outputHandler, logger) {
2307
- return __async(this, null, function* () {
2308
- const outputLogger = logger.sibling("output");
2309
- const spawnOptions = this._plugins.exec(
2310
- "spawn.options",
2311
- {
2312
- cwd: this.cwd,
2313
- env: this.env,
2314
- windowsHide: true
2315
- },
2316
- pluginContext(task, task.commands)
2725
+ async gitResponse(task, command, args, outputHandler, logger) {
2726
+ const outputLogger = logger.sibling("output");
2727
+ const spawnOptions = this._plugins.exec(
2728
+ "spawn.options",
2729
+ {
2730
+ cwd: this.cwd,
2731
+ env: this.env,
2732
+ windowsHide: true
2733
+ },
2734
+ pluginContext(task, task.commands)
2735
+ );
2736
+ return new Promise((done) => {
2737
+ const stdOut = [];
2738
+ const stdErr = [];
2739
+ logger.info(`%s %o`, command, args);
2740
+ logger("%O", spawnOptions);
2741
+ let rejection = this._beforeSpawn(task, args);
2742
+ if (rejection) {
2743
+ return done({
2744
+ stdOut,
2745
+ stdErr,
2746
+ exitCode: 9901,
2747
+ rejection
2748
+ });
2749
+ }
2750
+ this._plugins.exec("spawn.before", void 0, {
2751
+ ...pluginContext(task, args),
2752
+ kill(reason) {
2753
+ rejection = reason || rejection;
2754
+ }
2755
+ });
2756
+ const spawned = (0, import_child_process.spawn)(command, args, spawnOptions);
2757
+ spawned.stdout.on(
2758
+ "data",
2759
+ onDataReceived(stdOut, "stdOut", logger, outputLogger.step("stdOut"))
2317
2760
  );
2318
- return new Promise((done) => {
2319
- const stdOut = [];
2320
- const stdErr = [];
2321
- logger.info(`%s %o`, command, args);
2322
- logger("%O", spawnOptions);
2323
- let rejection = this._beforeSpawn(task, args);
2324
- if (rejection) {
2325
- return done({
2761
+ spawned.stderr.on(
2762
+ "data",
2763
+ onDataReceived(stdErr, "stdErr", logger, outputLogger.step("stdErr"))
2764
+ );
2765
+ spawned.on("error", onErrorReceived(stdErr, logger));
2766
+ if (outputHandler) {
2767
+ logger(`Passing child process stdOut/stdErr to custom outputHandler`);
2768
+ outputHandler(command, spawned.stdout, spawned.stderr, [...args]);
2769
+ }
2770
+ this._plugins.exec("spawn.after", void 0, {
2771
+ ...pluginContext(task, args),
2772
+ spawned,
2773
+ close(exitCode, reason) {
2774
+ done({
2326
2775
  stdOut,
2327
2776
  stdErr,
2328
- exitCode: 9901,
2329
- rejection
2777
+ exitCode,
2778
+ rejection: rejection || reason
2330
2779
  });
2331
- }
2332
- this._plugins.exec("spawn.before", void 0, __spreadProps(__spreadValues({}, pluginContext(task, args)), {
2333
- kill(reason) {
2334
- rejection = reason || rejection;
2780
+ },
2781
+ kill(reason) {
2782
+ if (spawned.killed) {
2783
+ return;
2335
2784
  }
2336
- }));
2337
- const spawned = (0, import_child_process.spawn)(command, args, spawnOptions);
2338
- spawned.stdout.on(
2339
- "data",
2340
- onDataReceived(stdOut, "stdOut", logger, outputLogger.step("stdOut"))
2341
- );
2342
- spawned.stderr.on(
2343
- "data",
2344
- onDataReceived(stdErr, "stdErr", logger, outputLogger.step("stdErr"))
2345
- );
2346
- spawned.on("error", onErrorReceived(stdErr, logger));
2347
- if (outputHandler) {
2348
- logger(`Passing child process stdOut/stdErr to custom outputHandler`);
2349
- outputHandler(command, spawned.stdout, spawned.stderr, [...args]);
2785
+ rejection = reason;
2786
+ spawned.kill("SIGINT");
2350
2787
  }
2351
- this._plugins.exec("spawn.after", void 0, __spreadProps(__spreadValues({}, pluginContext(task, args)), {
2352
- spawned,
2353
- close(exitCode, reason) {
2354
- done({
2355
- stdOut,
2356
- stdErr,
2357
- exitCode,
2358
- rejection: rejection || reason
2359
- });
2360
- },
2361
- kill(reason) {
2362
- if (spawned.killed) {
2363
- return;
2364
- }
2365
- rejection = reason;
2366
- spawned.kill("SIGINT");
2367
- }
2368
- }));
2369
2788
  });
2370
2789
  });
2371
2790
  }
2372
2791
  _beforeSpawn(task, args) {
2373
2792
  let rejection;
2374
- this._plugins.exec("spawn.before", void 0, __spreadProps(__spreadValues({}, pluginContext(task, args)), {
2793
+ this._plugins.exec("spawn.before", void 0, {
2794
+ ...pluginContext(task, args),
2375
2795
  kill(reason) {
2376
2796
  rejection = reason || rejection;
2377
2797
  }
2378
- }));
2798
+ });
2379
2799
  return rejection;
2380
2800
  }
2381
2801
  };
@@ -2535,7 +2955,7 @@ var init_count_objects = __esm({
2535
2955
  /([a-z-]+): (\d+)$/,
2536
2956
  (result, [key, value]) => {
2537
2957
  const property = asCamelCase(key);
2538
- if (result.hasOwnProperty(property)) {
2958
+ if (Object.hasOwn(result, property)) {
2539
2959
  result[property] = asNumber(value);
2540
2960
  }
2541
2961
  }
@@ -2623,7 +3043,10 @@ function commit_default() {
2623
3043
  const task = rejectDeprecatedSignatures(message) || commitTask(
2624
3044
  asArray(message),
2625
3045
  asArray(filterType(rest[0], filterStringOrStringArray, [])),
2626
- [...filterType(rest[1], filterArray, []), ...getTrailingOptions(arguments, 0, true)]
3046
+ [
3047
+ ...asStringArray(filterType(rest[1], filterArray, [])),
3048
+ ...getTrailingOptions(arguments, 0, true)
3049
+ ]
2627
3050
  );
2628
3051
  return this._runTask(task, next);
2629
3052
  }
@@ -2735,8 +3158,8 @@ var init_init = __esm({
2735
3158
  }
2736
3159
  });
2737
3160
  function logFormatFromCommand(customArgs) {
2738
- for (let i = 0; i < customArgs.length; i++) {
2739
- const format = logFormatRegex.exec(customArgs[i]);
3161
+ for (let i2 = 0; i2 < customArgs.length; i2++) {
3162
+ const format = logFormatRegex.exec(customArgs[i2]);
2740
3163
  if (format) {
2741
3164
  return `--${format[1]}`;
2742
3165
  }
@@ -2864,7 +3287,7 @@ var init_parse_diff_summary = __esm({
2864
3287
  (result, [status, similarity, from, _to, to]) => {
2865
3288
  result.changed++;
2866
3289
  result.files.push({
2867
- file: to != null ? to : from,
3290
+ file: to ?? from,
2868
3291
  changes: 0,
2869
3292
  insertions: 0,
2870
3293
  deletions: 0,
@@ -3006,7 +3429,7 @@ function userOptions(input) {
3006
3429
  }
3007
3430
  function parseLogOptions(opt = {}, customArgs = []) {
3008
3431
  const splitter = filterType(opt.splitter, filterString, SPLITTER);
3009
- const format = !filterPrimitives(opt.format) && opt.format ? opt.format : {
3432
+ const format = filterPlainObject(opt.format) ? opt.format : {
3010
3433
  hash: "%H",
3011
3434
  date: opt.strictDate === false ? "%ai" : "%aI",
3012
3435
  message: "%s",
@@ -3030,7 +3453,7 @@ function parseLogOptions(opt = {}, customArgs = []) {
3030
3453
  suffix.push(`${opt.from || ""}${rangeOperator}${opt.to || ""}`);
3031
3454
  }
3032
3455
  if (filterString(opt.file)) {
3033
- command.push("--follow", pathspec(opt.file));
3456
+ command.push("--follow", c(opt.file));
3034
3457
  }
3035
3458
  appendTaskOptions(userOptions(opt), command);
3036
3459
  return {
@@ -3053,7 +3476,7 @@ function log_default() {
3053
3476
  const next = trailingFunctionArgument(arguments);
3054
3477
  const options = parseLogOptions(
3055
3478
  trailingOptionsArgument(arguments),
3056
- filterType(arguments[0], filterArray)
3479
+ asStringArray(filterType(arguments[0], filterArray, []))
3057
3480
  );
3058
3481
  const task = rejectDeprecatedSignatures(...rest) || validateLogFormatConfig(options.commands) || createLogTask(options);
3059
3482
  return this._runTask(task, next);
@@ -3073,7 +3496,6 @@ var init_log = __esm({
3073
3496
  "src/lib/tasks/log.ts"() {
3074
3497
  "use strict";
3075
3498
  init_log_format();
3076
- init_pathspec();
3077
3499
  init_parse_list_log_summary();
3078
3500
  init_utils();
3079
3501
  init_task();
@@ -3422,9 +3844,10 @@ var init_parse_push = __esm({
3422
3844
  result.repo = repo;
3423
3845
  }),
3424
3846
  new LineParser(/^updating local tracking ref '(.+)'/, (result, [local]) => {
3425
- result.ref = __spreadProps(__spreadValues({}, result.ref || {}), {
3847
+ result.ref = {
3848
+ ...result.ref || {},
3426
3849
  local
3427
- });
3850
+ };
3428
3851
  }),
3429
3852
  new LineParser(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/, (result, [local, remote, type]) => {
3430
3853
  result.pushed.push(pushResultPushedItem(local, remote, type));
@@ -3432,11 +3855,12 @@ var init_parse_push = __esm({
3432
3855
  new LineParser(
3433
3856
  /^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,
3434
3857
  (result, [local, remote, remoteName]) => {
3435
- result.branch = __spreadProps(__spreadValues({}, result.branch || {}), {
3858
+ result.branch = {
3859
+ ...result.branch || {},
3436
3860
  local,
3437
3861
  remote,
3438
3862
  remoteName
3439
- });
3863
+ };
3440
3864
  }
3441
3865
  ),
3442
3866
  new LineParser(
@@ -3458,7 +3882,10 @@ var init_parse_push = __esm({
3458
3882
  parsePushResult = (stdOut, stdErr) => {
3459
3883
  const pushDetail = parsePushDetail(stdOut, stdErr);
3460
3884
  const responseDetail = parseRemoteMessages(stdOut, stdErr);
3461
- return __spreadValues(__spreadValues({}, pushDetail), responseDetail);
3885
+ return {
3886
+ ...pushDetail,
3887
+ ...responseDetail
3888
+ };
3462
3889
  };
3463
3890
  parsePushDetail = (stdOut, stdErr) => {
3464
3891
  return parseStringResponse({ pushed: [] }, parsers5, [stdOut, stdErr]);
@@ -3557,15 +3984,15 @@ function parser3(indexX, indexY, handler) {
3557
3984
  return [`${indexX}${indexY}`, handler];
3558
3985
  }
3559
3986
  function conflicts(indexX, ...indexY) {
3560
- return indexY.map((y) => parser3(indexX, y, (result, file) => append(result.conflicted, file)));
3987
+ return indexY.map((y2) => parser3(indexX, y2, (result, file) => result.conflicted.push(file)));
3561
3988
  }
3562
3989
  function splitLine(result, lineStr) {
3563
3990
  const trimmed2 = lineStr.trim();
3564
3991
  switch (" ") {
3565
3992
  case trimmed2.charAt(2):
3566
- return data(trimmed2.charAt(0), trimmed2.charAt(1), trimmed2.substr(3));
3993
+ return data(trimmed2.charAt(0), trimmed2.charAt(1), trimmed2.slice(3));
3567
3994
  case trimmed2.charAt(1):
3568
- return data(" ", trimmed2.charAt(0), trimmed2.substr(2));
3995
+ return data(" ", trimmed2.charAt(0), trimmed2.slice(2));
3569
3996
  default:
3570
3997
  return;
3571
3998
  }
@@ -3613,58 +4040,54 @@ var init_StatusSummary = __esm({
3613
4040
  parser3(
3614
4041
  " ",
3615
4042
  "A",
3616
- (result, file) => append(result.created, file)
4043
+ (result, file) => result.created.push(file)
3617
4044
  ),
3618
4045
  parser3(
3619
4046
  " ",
3620
4047
  "D",
3621
- (result, file) => append(result.deleted, file)
4048
+ (result, file) => result.deleted.push(file)
3622
4049
  ),
3623
4050
  parser3(
3624
4051
  " ",
3625
4052
  "M",
3626
- (result, file) => append(result.modified, file)
3627
- ),
3628
- parser3(
3629
- "A",
3630
- " ",
3631
- (result, file) => append(result.created, file) && append(result.staged, file)
3632
- ),
3633
- parser3(
3634
- "A",
3635
- "M",
3636
- (result, file) => append(result.created, file) && append(result.staged, file) && append(result.modified, file)
3637
- ),
3638
- parser3(
3639
- "D",
3640
- " ",
3641
- (result, file) => append(result.deleted, file) && append(result.staged, file)
3642
- ),
3643
- parser3(
3644
- "M",
3645
- " ",
3646
- (result, file) => append(result.modified, file) && append(result.staged, file)
3647
- ),
3648
- parser3(
3649
- "M",
3650
- "M",
3651
- (result, file) => append(result.modified, file) && append(result.staged, file)
4053
+ (result, file) => result.modified.push(file)
3652
4054
  ),
4055
+ parser3("A", " ", (result, file) => {
4056
+ result.created.push(file);
4057
+ result.staged.push(file);
4058
+ }),
4059
+ parser3("A", "M", (result, file) => {
4060
+ result.created.push(file);
4061
+ result.staged.push(file);
4062
+ result.modified.push(file);
4063
+ }),
4064
+ parser3("D", " ", (result, file) => {
4065
+ result.deleted.push(file);
4066
+ result.staged.push(file);
4067
+ }),
4068
+ parser3("M", " ", (result, file) => {
4069
+ result.modified.push(file);
4070
+ result.staged.push(file);
4071
+ }),
4072
+ parser3("M", "M", (result, file) => {
4073
+ result.modified.push(file);
4074
+ result.staged.push(file);
4075
+ }),
3653
4076
  parser3("R", " ", (result, file) => {
3654
- append(result.renamed, renamedFile(file));
4077
+ result.renamed.push(renamedFile(file));
3655
4078
  }),
3656
4079
  parser3("R", "M", (result, file) => {
3657
4080
  const renamed = renamedFile(file);
3658
- append(result.renamed, renamed);
3659
- append(result.modified, renamed.to);
4081
+ result.renamed.push(renamed);
4082
+ result.modified.push(renamed.to);
3660
4083
  }),
3661
4084
  parser3("!", "!", (_result, _file) => {
3662
- append(_result.ignored = _result.ignored || [], _file);
4085
+ (_result.ignored = _result.ignored || []).push(_file);
3663
4086
  }),
3664
4087
  parser3(
3665
4088
  "?",
3666
4089
  "?",
3667
- (result, file) => append(result.not_added, file)
4090
+ (result, file) => result.not_added.push(file)
3668
4091
  ),
3669
4092
  ...conflicts(
3670
4093
  "A",
@@ -3692,18 +4115,19 @@ var init_StatusSummary = __esm({
3692
4115
  const behindReg = /behind (\d+)/;
3693
4116
  const currentReg = /^(.+?(?=(?:\.{3}|\s|$)))/;
3694
4117
  const trackingReg = /\.{3}(\S*)/;
3695
- const onEmptyBranchReg = /\son\s([\S]+)$/;
3696
- let regexResult;
3697
- regexResult = aheadReg.exec(line);
4118
+ const onEmptyBranchReg = /\son\s(\S+?)(?=\.{3}|$)/;
4119
+ let regexResult = aheadReg.exec(line);
3698
4120
  result.ahead = regexResult && +regexResult[1] || 0;
3699
4121
  regexResult = behindReg.exec(line);
3700
4122
  result.behind = regexResult && +regexResult[1] || 0;
3701
4123
  regexResult = currentReg.exec(line);
3702
- result.current = regexResult && regexResult[1];
4124
+ result.current = filterType(regexResult == null ? void 0 : regexResult[1], filterString, null);
3703
4125
  regexResult = trackingReg.exec(line);
3704
- result.tracking = regexResult && regexResult[1];
4126
+ result.tracking = filterType(regexResult == null ? void 0 : regexResult[1], filterString, null);
3705
4127
  regexResult = onEmptyBranchReg.exec(line);
3706
- result.current = regexResult && regexResult[1] || result.current;
4128
+ if (regexResult) {
4129
+ result.current = filterType(regexResult == null ? void 0 : regexResult[1], filterString, result.current);
4130
+ }
3707
4131
  result.detached = /\(no branch\)/.test(line);
3708
4132
  }
3709
4133
  ]
@@ -3711,13 +4135,13 @@ var init_StatusSummary = __esm({
3711
4135
  parseStatusSummary = function(text) {
3712
4136
  const lines = text.split(NULL);
3713
4137
  const status = new StatusSummary();
3714
- for (let i = 0, l = lines.length; i < l; ) {
3715
- let line = lines[i++].trim();
4138
+ for (let i2 = 0, l = lines.length; i2 < l; ) {
4139
+ let line = lines[i2++].trim();
3716
4140
  if (!line) {
3717
4141
  continue;
3718
4142
  }
3719
4143
  if (line.charAt(0) === "R") {
3720
- line += NULL + (lines[i++] || "");
4144
+ line += NULL + (lines[i2++] || "");
3721
4145
  }
3722
4146
  splitLine(status, line);
3723
4147
  }
@@ -3821,6 +4245,47 @@ var init_version = __esm({
3821
4245
  ];
3822
4246
  }
3823
4247
  });
4248
+ function createCloneTask(api, task, repoPath, ...args) {
4249
+ if (!filterString(repoPath)) {
4250
+ return configurationErrorTask(`git.${api}() requires a string 'repoPath'`);
4251
+ }
4252
+ return task(repoPath, filterType(args[0], filterString), getTrailingOptions(arguments));
4253
+ }
4254
+ function clone_default() {
4255
+ return {
4256
+ clone(repo, ...rest) {
4257
+ return this._runTask(
4258
+ createCloneTask("clone", cloneTask, filterType(repo, filterString), ...rest),
4259
+ trailingFunctionArgument(arguments)
4260
+ );
4261
+ },
4262
+ mirror(repo, ...rest) {
4263
+ return this._runTask(
4264
+ createCloneTask("mirror", cloneMirrorTask, filterType(repo, filterString), ...rest),
4265
+ trailingFunctionArgument(arguments)
4266
+ );
4267
+ }
4268
+ };
4269
+ }
4270
+ var cloneTask;
4271
+ var cloneMirrorTask;
4272
+ var init_clone = __esm({
4273
+ "src/lib/tasks/clone.ts"() {
4274
+ "use strict";
4275
+ init_task();
4276
+ init_utils();
4277
+ cloneTask = (repo, directory, customArgs) => {
4278
+ const commands = ["clone", ...customArgs];
4279
+ filterString(repo) && commands.push(c(repo));
4280
+ filterString(directory) && commands.push(c(directory));
4281
+ return straightThroughStringTask(commands);
4282
+ };
4283
+ cloneMirrorTask = (repo, directory, customArgs) => {
4284
+ append(customArgs, "--mirror");
4285
+ return cloneTask(repo, directory, customArgs);
4286
+ };
4287
+ }
4288
+ });
3824
4289
  var simple_git_api_exports = {};
3825
4290
  __export2(simple_git_api_exports, {
3826
4291
  SimpleGitApi: () => SimpleGitApi
@@ -3847,6 +4312,7 @@ var init_simple_git_api = __esm({
3847
4312
  init_task();
3848
4313
  init_version();
3849
4314
  init_utils();
4315
+ init_clone();
3850
4316
  SimpleGitApi = class {
3851
4317
  constructor(_executor) {
3852
4318
  this._executor = _executor;
@@ -3949,6 +4415,7 @@ var init_simple_git_api = __esm({
3949
4415
  Object.assign(
3950
4416
  SimpleGitApi.prototype,
3951
4417
  checkout_default(),
4418
+ clone_default(),
3952
4419
  commit_default(),
3953
4420
  config_default(),
3954
4421
  count_objects_default(),
@@ -4124,10 +4591,15 @@ var init_BranchSummary = __esm({
4124
4591
  function branchStatus(input) {
4125
4592
  return input ? input.charAt(0) : "";
4126
4593
  }
4127
- function parseBranchSummary(stdOut) {
4128
- return parseStringResponse(new BranchSummaryResult(), parsers9, stdOut);
4594
+ function parseBranchSummary(stdOut, currentOnly = false) {
4595
+ return parseStringResponse(
4596
+ new BranchSummaryResult(),
4597
+ currentOnly ? [currentBranchParser] : parsers9,
4598
+ stdOut
4599
+ );
4129
4600
  }
4130
4601
  var parsers9;
4602
+ var currentBranchParser;
4131
4603
  var init_parse_branch = __esm({
4132
4604
  "src/lib/parsers/parse-branch.ts"() {
4133
4605
  "use strict";
@@ -4141,12 +4613,15 @@ var init_parse_branch = __esm({
4141
4613
  }
4142
4614
  ),
4143
4615
  new LineParser(
4144
- new RegExp("^([*+]\\s)?(\\S+)\\s+([a-z0-9]+)\\s?(.*)$", "s"),
4616
+ /^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,
4145
4617
  (result, [current, name, commit, label]) => {
4146
4618
  result.push(branchStatus(current), false, name, commit, label);
4147
4619
  }
4148
4620
  )
4149
4621
  ];
4622
+ currentBranchParser = new LineParser(/^(\S+)$/s, (result, [name]) => {
4623
+ result.push("*", false, name, "", "");
4624
+ });
4150
4625
  }
4151
4626
  });
4152
4627
  var branch_exports = {};
@@ -4163,6 +4638,7 @@ function containsDeleteBranchCommand(commands) {
4163
4638
  }
4164
4639
  function branchTask(customArgs) {
4165
4640
  const isDelete = containsDeleteBranchCommand(customArgs);
4641
+ const isCurrentOnly = customArgs.includes("--show-current");
4166
4642
  const commands = ["branch", ...customArgs];
4167
4643
  if (commands.length === 1) {
4168
4644
  commands.push("-a");
@@ -4177,16 +4653,17 @@ function branchTask(customArgs) {
4177
4653
  if (isDelete) {
4178
4654
  return parseBranchDeletions(stdOut, stdErr).all[0];
4179
4655
  }
4180
- return parseBranchSummary(stdOut);
4656
+ return parseBranchSummary(stdOut, isCurrentOnly);
4181
4657
  }
4182
4658
  };
4183
4659
  }
4184
4660
  function branchLocalTask() {
4185
- const parser4 = parseBranchSummary;
4186
4661
  return {
4187
4662
  format: "utf-8",
4188
4663
  commands: ["branch", "-v"],
4189
- parser: parser4
4664
+ parser(stdOut) {
4665
+ return parseBranchSummary(stdOut);
4666
+ }
4190
4667
  };
4191
4668
  }
4192
4669
  function deleteBranchesTask(branches, forceDelete = false) {
@@ -4211,7 +4688,7 @@ function deleteBranchTask(branch, forceDelete = false) {
4211
4688
  parser(stdOut, stdErr) {
4212
4689
  return parseBranchDeletions(stdOut, stdErr).branches[branch];
4213
4690
  },
4214
- onError({ exitCode, stdErr, stdOut }, error, _, fail) {
4691
+ onError({ exitCode, stdErr, stdOut }, error, _2, fail) {
4215
4692
  if (!hasBranchDeletionError(String(error), exitCode)) {
4216
4693
  return fail(error);
4217
4694
  }
@@ -4232,12 +4709,16 @@ var init_branch = __esm({
4232
4709
  init_utils();
4233
4710
  }
4234
4711
  });
4712
+ function toPath(input) {
4713
+ const path2 = input.trim().replace(/^["']|["']$/g, "");
4714
+ return path2 && (0, import_node_path.normalize)(path2);
4715
+ }
4235
4716
  var parseCheckIgnore;
4236
4717
  var init_CheckIgnore = __esm({
4237
4718
  "src/lib/responses/CheckIgnore.ts"() {
4238
4719
  "use strict";
4239
4720
  parseCheckIgnore = (text) => {
4240
- return text.split(/\n/g).map((line) => line.trim()).filter((file) => !!file);
4721
+ return text.split(/\n/g).map(toPath).filter(Boolean);
4241
4722
  };
4242
4723
  }
4243
4724
  });
@@ -4258,35 +4739,6 @@ var init_check_ignore = __esm({
4258
4739
  init_CheckIgnore();
4259
4740
  }
4260
4741
  });
4261
- var clone_exports = {};
4262
- __export2(clone_exports, {
4263
- cloneMirrorTask: () => cloneMirrorTask,
4264
- cloneTask: () => cloneTask
4265
- });
4266
- function disallowedCommand(command) {
4267
- return /^--upload-pack(=|$)/.test(command);
4268
- }
4269
- function cloneTask(repo, directory, customArgs) {
4270
- const commands = ["clone", ...customArgs];
4271
- filterString(repo) && commands.push(repo);
4272
- filterString(directory) && commands.push(directory);
4273
- const banned = commands.find(disallowedCommand);
4274
- if (banned) {
4275
- return configurationErrorTask(`git.fetch: potential exploit argument blocked.`);
4276
- }
4277
- return straightThroughStringTask(commands);
4278
- }
4279
- function cloneMirrorTask(repo, directory, customArgs) {
4280
- append(customArgs, "--mirror");
4281
- return cloneTask(repo, directory, customArgs);
4282
- }
4283
- var init_clone = __esm({
4284
- "src/lib/tasks/clone.ts"() {
4285
- "use strict";
4286
- init_task();
4287
- init_utils();
4288
- }
4289
- });
4290
4742
  function parseFetchResult(stdOut, stdErr) {
4291
4743
  const result = {
4292
4744
  raw: stdOut,
@@ -4342,7 +4794,7 @@ var fetch_exports = {};
4342
4794
  __export2(fetch_exports, {
4343
4795
  fetchTask: () => fetchTask
4344
4796
  });
4345
- function disallowedCommand2(command) {
4797
+ function disallowedCommand(command) {
4346
4798
  return /^--upload-pack(=|$)/.test(command);
4347
4799
  }
4348
4800
  function fetchTask(remote, branch, customArgs) {
@@ -4350,7 +4802,7 @@ function fetchTask(remote, branch, customArgs) {
4350
4802
  if (remote && branch) {
4351
4803
  commands.push(remote, branch);
4352
4804
  }
4353
- const banned = commands.find(disallowedCommand2);
4805
+ const banned = commands.find(disallowedCommand);
4354
4806
  if (banned) {
4355
4807
  return configurationErrorTask(`git.fetch: potential exploit argument blocked.`);
4356
4808
  }
@@ -4443,7 +4895,7 @@ function parseGetRemotes(text) {
4443
4895
  function parseGetRemotesVerbose(text) {
4444
4896
  const remotes = {};
4445
4897
  forEach(text, ([name, url, purpose]) => {
4446
- if (!remotes.hasOwnProperty(name)) {
4898
+ if (!Object.hasOwn(remotes, name)) {
4447
4899
  remotes[name] = {
4448
4900
  name,
4449
4901
  refs: { fetch: "", push: "" }
@@ -4566,16 +5018,16 @@ var init_sub_module = __esm({
4566
5018
  init_task();
4567
5019
  }
4568
5020
  });
4569
- function singleSorted(a, b) {
4570
- const aIsNum = isNaN(a);
4571
- const bIsNum = isNaN(b);
5021
+ function singleSorted(a, b2) {
5022
+ const aIsNum = Number.isNaN(a);
5023
+ const bIsNum = Number.isNaN(b2);
4572
5024
  if (aIsNum !== bIsNum) {
4573
5025
  return aIsNum ? 1 : -1;
4574
5026
  }
4575
- return aIsNum ? sorted(a, b) : 0;
5027
+ return aIsNum ? sorted(a, b2) : 0;
4576
5028
  }
4577
- function sorted(a, b) {
4578
- return a === b ? 0 : a > b ? 1 : -1;
5029
+ function sorted(a, b2) {
5030
+ return a === b2 ? 0 : a > b2 ? 1 : -1;
4579
5031
  }
4580
5032
  function trimmed(input) {
4581
5033
  return input.trim();
@@ -4606,8 +5058,8 @@ var init_TagList = __esm({
4606
5058
  if (partsA.length === 1 || partsB.length === 1) {
4607
5059
  return singleSorted(toNumber(partsA[0]), toNumber(partsB[0]));
4608
5060
  }
4609
- for (let i = 0, l = Math.max(partsA.length, partsB.length); i < l; i++) {
4610
- const diff = sorted(toNumber(partsA[i]), toNumber(partsB[i]));
5061
+ for (let i2 = 0, l = Math.max(partsA.length, partsB.length); i2 < l; i2++) {
5062
+ const diff = sorted(toNumber(partsA[i2]), toNumber(partsB[i2]));
4611
5063
  if (diff) {
4612
5064
  return diff;
4613
5065
  }
@@ -4666,7 +5118,7 @@ var require_git = __commonJS2({
4666
5118
  var { GitExecutor: GitExecutor2 } = (init_git_executor(), __toCommonJS2(git_executor_exports));
4667
5119
  var { SimpleGitApi: SimpleGitApi2 } = (init_simple_git_api(), __toCommonJS2(simple_git_api_exports));
4668
5120
  var { Scheduler: Scheduler2 } = (init_scheduler(), __toCommonJS2(scheduler_exports));
4669
- var { configurationErrorTask: configurationErrorTask2 } = (init_task(), __toCommonJS2(task_exports));
5121
+ var { adhocExecTask: adhocExecTask2, configurationErrorTask: configurationErrorTask2 } = (init_task(), __toCommonJS2(task_exports));
4670
5122
  var {
4671
5123
  asArray: asArray2,
4672
5124
  filterArray: filterArray2,
@@ -4687,7 +5139,6 @@ var require_git = __commonJS2({
4687
5139
  } = (init_branch(), __toCommonJS2(branch_exports));
4688
5140
  var { checkIgnoreTask: checkIgnoreTask2 } = (init_check_ignore(), __toCommonJS2(check_ignore_exports));
4689
5141
  var { checkIsRepoTask: checkIsRepoTask2 } = (init_check_is_repo(), __toCommonJS2(check_is_repo_exports));
4690
- var { cloneTask: cloneTask2, cloneMirrorTask: cloneMirrorTask2 } = (init_clone(), __toCommonJS2(clone_exports));
4691
5142
  var { cleanWithOptionsTask: cleanWithOptionsTask2, isCleanOptionsArray: isCleanOptionsArray2 } = (init_clean(), __toCommonJS2(clean_exports));
4692
5143
  var { diffSummaryTask: diffSummaryTask2 } = (init_diff(), __toCommonJS2(diff_exports));
4693
5144
  var { fetchTask: fetchTask2 } = (init_fetch(), __toCommonJS2(fetch_exports));
@@ -4742,24 +5193,6 @@ var require_git = __commonJS2({
4742
5193
  trailingFunctionArgument2(arguments)
4743
5194
  );
4744
5195
  };
4745
- function createCloneTask(api, task, repoPath, localPath) {
4746
- if (typeof repoPath !== "string") {
4747
- return configurationErrorTask2(`git.${api}() requires a string 'repoPath'`);
4748
- }
4749
- return task(repoPath, filterType2(localPath, filterString2), getTrailingOptions2(arguments));
4750
- }
4751
- Git2.prototype.clone = function() {
4752
- return this._runTask(
4753
- createCloneTask("clone", cloneTask2, ...arguments),
4754
- trailingFunctionArgument2(arguments)
4755
- );
4756
- };
4757
- Git2.prototype.mirror = function() {
4758
- return this._runTask(
4759
- createCloneTask("mirror", cloneMirrorTask2, ...arguments),
4760
- trailingFunctionArgument2(arguments)
4761
- );
4762
- };
4763
5196
  Git2.prototype.mv = function(from, to) {
4764
5197
  return this._runTask(moveTask2(from, to), trailingFunctionArgument2(arguments));
4765
5198
  };
@@ -4792,10 +5225,13 @@ var require_git = __commonJS2({
4792
5225
  );
4793
5226
  };
4794
5227
  Git2.prototype.silent = function(silence) {
4795
- console.warn(
4796
- "simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"
5228
+ return this._runTask(
5229
+ adhocExecTask2(
5230
+ () => console.warn(
5231
+ "simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed."
5232
+ )
5233
+ )
4797
5234
  );
4798
- return this;
4799
5235
  };
4800
5236
  Git2.prototype.tags = function(options, then) {
4801
5237
  return this._runTask(
@@ -4859,9 +5295,9 @@ var require_git = __commonJS2({
4859
5295
  Git2.prototype.raw = function(commands) {
4860
5296
  const createRestCommands = !Array.isArray(commands);
4861
5297
  const command = [].slice.call(createRestCommands ? arguments : commands, 0);
4862
- for (let i = 0; i < command.length && createRestCommands; i++) {
4863
- if (!filterPrimitives2(command[i])) {
4864
- command.splice(i, command.length - i);
5298
+ for (let i2 = 0; i2 < command.length && createRestCommands; i2++) {
5299
+ if (!filterPrimitives2(command[i2])) {
5300
+ command.splice(i2, command.length - i2);
4865
5301
  break;
4866
5302
  }
4867
5303
  }
@@ -5021,7 +5457,13 @@ var require_git = __commonJS2({
5021
5457
  return this._runTask(task);
5022
5458
  };
5023
5459
  Git2.prototype.clearQueue = function() {
5024
- return this;
5460
+ return this._runTask(
5461
+ adhocExecTask2(
5462
+ () => console.warn(
5463
+ "simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead."
5464
+ )
5465
+ )
5466
+ );
5025
5467
  };
5026
5468
  Git2.prototype.checkIgnore = function(pathnames, then) {
5027
5469
  return this._runTask(
@@ -5038,7 +5480,6 @@ var require_git = __commonJS2({
5038
5480
  module2.exports = Git2;
5039
5481
  }
5040
5482
  });
5041
- init_pathspec();
5042
5483
  init_git_error();
5043
5484
  var GitConstructError = class extends GitError {
5044
5485
  constructor(config, message) {
@@ -5088,57 +5529,15 @@ function abortPlugin(signal) {
5088
5529
  };
5089
5530
  return [onSpawnBefore, onSpawnAfter];
5090
5531
  }
5091
- function isConfigSwitch(arg) {
5092
- return typeof arg === "string" && arg.trim().toLowerCase() === "-c";
5093
- }
5094
- function preventProtocolOverride(arg, next) {
5095
- if (!isConfigSwitch(arg)) {
5096
- return;
5097
- }
5098
- if (!/^\s*protocol(.[a-z]+)?.allow/.test(next)) {
5099
- return;
5100
- }
5101
- throw new GitPluginError(
5102
- void 0,
5103
- "unsafe",
5104
- "Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol"
5105
- );
5106
- }
5107
- function preventUploadPack(arg, method) {
5108
- if (/^\s*--(upload|receive)-pack/.test(arg)) {
5109
- throw new GitPluginError(
5110
- void 0,
5111
- "unsafe",
5112
- `Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack`
5113
- );
5114
- }
5115
- if (method === "clone" && /^\s*-u\b/.test(arg)) {
5116
- throw new GitPluginError(
5117
- void 0,
5118
- "unsafe",
5119
- `Use of clone with option -u is not permitted without enabling allowUnsafePack`
5120
- );
5121
- }
5122
- if (method === "push" && /^\s*--exec\b/.test(arg)) {
5123
- throw new GitPluginError(
5124
- void 0,
5125
- "unsafe",
5126
- `Use of push with option --exec is not permitted without enabling allowUnsafePack`
5127
- );
5128
- }
5129
- }
5130
- function blockUnsafeOperationsPlugin({
5131
- allowUnsafeProtocolOverride = false,
5132
- allowUnsafePack = false
5133
- } = {}) {
5532
+ function blockUnsafeOperationsPlugin(options = {}) {
5134
5533
  return {
5135
5534
  type: "spawn.args",
5136
- action(args, context) {
5137
- args.forEach((current, index) => {
5138
- const next = index < args.length ? args[index + 1] : "";
5139
- allowUnsafeProtocolOverride || preventProtocolOverride(current, next);
5140
- allowUnsafePack || preventUploadPack(current, context.method);
5141
- });
5535
+ action(args, { env }) {
5536
+ for (const vulnerability of ne(args, env)) {
5537
+ if (options[vulnerability.category] !== true) {
5538
+ throw new GitPluginError(void 0, "unsafe", vulnerability.message);
5539
+ }
5540
+ }
5142
5541
  return args;
5143
5542
  }
5144
5543
  };
@@ -5196,27 +5595,25 @@ function completionDetectionPlugin({
5196
5595
  }
5197
5596
  return {
5198
5597
  type: "spawn.after",
5199
- action(_0, _1) {
5200
- return __async(this, arguments, function* (_data, { spawned, close }) {
5201
- var _a3, _b;
5202
- const events = createEvents();
5203
- let deferClose = true;
5204
- let quickClose = () => void (deferClose = false);
5205
- (_a3 = spawned.stdout) == null ? void 0 : _a3.on("data", quickClose);
5206
- (_b = spawned.stderr) == null ? void 0 : _b.on("data", quickClose);
5207
- spawned.on("error", quickClose);
5208
- spawned.on("close", (code) => events.close(code));
5209
- spawned.on("exit", (code) => events.exit(code));
5210
- try {
5211
- yield events.result;
5212
- if (deferClose) {
5213
- yield delay(50);
5214
- }
5215
- close(events.exitCode);
5216
- } catch (err) {
5217
- close(events.exitCode, err);
5598
+ async action(_data, { spawned, close }) {
5599
+ var _a2, _b;
5600
+ const events = createEvents();
5601
+ let deferClose = true;
5602
+ let quickClose = () => void (deferClose = false);
5603
+ (_a2 = spawned.stdout) == null ? void 0 : _a2.on("data", quickClose);
5604
+ (_b = spawned.stderr) == null ? void 0 : _b.on("data", quickClose);
5605
+ spawned.on("error", quickClose);
5606
+ spawned.on("close", (code) => events.close(code));
5607
+ spawned.on("exit", (code) => events.exit(code));
5608
+ try {
5609
+ await events.result;
5610
+ if (deferClose) {
5611
+ await delay(50);
5218
5612
  }
5219
- });
5613
+ close(events.exitCode);
5614
+ } catch (err) {
5615
+ close(events.exitCode, err);
5616
+ }
5220
5617
  }
5221
5618
  };
5222
5619
  }
@@ -5224,7 +5621,7 @@ init_utils();
5224
5621
  var WRONG_NUMBER_ERR = `Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings`;
5225
5622
  var WRONG_CHARS_ERR = `Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option`;
5226
5623
  function isBadArgument(arg) {
5227
- return !arg || !/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(arg);
5624
+ return !arg || !/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(arg);
5228
5625
  }
5229
5626
  function toBinaryConfig(input, allowUnsafe) {
5230
5627
  if (input.length < 1 || input.length > 2) {
@@ -5369,7 +5766,7 @@ function spawnOptionsPlugin(spawnOptions) {
5369
5766
  return {
5370
5767
  type: "spawn.options",
5371
5768
  action(data) {
5372
- return __spreadValues(__spreadValues({}, options), data);
5769
+ return { ...options, ...data };
5373
5770
  }
5374
5771
  };
5375
5772
  }
@@ -5409,7 +5806,6 @@ function timeoutPlugin({
5409
5806
  };
5410
5807
  }
5411
5808
  }
5412
- init_pathspec();
5413
5809
  function suffixPathsPlugin() {
5414
5810
  return {
5415
5811
  type: "spawn.args",
@@ -5419,15 +5815,15 @@ function suffixPathsPlugin() {
5419
5815
  function append2(args) {
5420
5816
  (suffix = suffix || []).push(...args);
5421
5817
  }
5422
- for (let i = 0; i < data.length; i++) {
5423
- const param = data[i];
5424
- if (isPathSpec(param)) {
5425
- append2(toPaths(param));
5818
+ for (let i2 = 0; i2 < data.length; i2++) {
5819
+ const param = data[i2];
5820
+ if (r(param)) {
5821
+ append2(o(param));
5426
5822
  continue;
5427
5823
  }
5428
5824
  if (param === "--") {
5429
5825
  append2(
5430
- data.slice(i + 1).flatMap((item) => isPathSpec(item) && toPaths(item) || item)
5826
+ data.slice(i2 + 1).flatMap((item) => r(item) && o(item) || item)
5431
5827
  );
5432
5828
  break;
5433
5829
  }
@@ -5456,12 +5852,12 @@ function gitInstanceFactory(baseDir, options) {
5456
5852
  plugins.add(commandConfigPrefixingPlugin(config.config));
5457
5853
  }
5458
5854
  plugins.add(blockUnsafeOperationsPlugin(config.unsafe));
5459
- plugins.add(suffixPathsPlugin());
5460
5855
  plugins.add(completionDetectionPlugin(config.completion));
5461
5856
  config.abort && plugins.add(abortPlugin(config.abort));
5462
5857
  config.progress && plugins.add(progressMonitorPlugin(config.progress));
5463
5858
  config.timeout && plugins.add(timeoutPlugin(config.timeout));
5464
5859
  config.spawnOptions && plugins.add(spawnOptionsPlugin(config.spawnOptions));
5860
+ plugins.add(suffixPathsPlugin());
5465
5861
  plugins.add(errorDetectionPlugin(errorDetectionHandler(true)));
5466
5862
  config.errors && plugins.add(errorDetectionPlugin(config.errors));
5467
5863
  customBinaryPlugin(plugins, config.binary, (_a2 = config.unsafe) == null ? void 0 : _a2.allowUnsafeCustomBinary);
@@ -5473,12 +5869,13 @@ var simpleGit = gitInstanceFactory;
5473
5869
  // ../reporter-core/dist/index.js
5474
5870
  var import_crypto = require("crypto");
5475
5871
  var import_fs = __toESM(require("fs"), 1);
5872
+ var import_os = __toESM(require("os"), 1);
5476
5873
  var import_fs2 = __toESM(require("fs"), 1);
5477
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
5478
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
5479
- }) : x)(function(x) {
5874
+ var __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, {
5875
+ get: (a, b2) => (typeof require !== "undefined" ? require : a)[b2]
5876
+ }) : x2)(function(x2) {
5480
5877
  if (typeof require !== "undefined") return require.apply(this, arguments);
5481
- throw Error('Dynamic require of "' + x + '" is not supported');
5878
+ throw Error('Dynamic require of "' + x2 + '" is not supported');
5482
5879
  });
5483
5880
  var _fetch = typeof globalThis.fetch !== "undefined" ? globalThis.fetch : __require("node-fetch");
5484
5881
  var _AbortController = typeof globalThis.AbortController !== "undefined" ? globalThis.AbortController : __require("abort-controller").AbortController;
@@ -5555,8 +5952,8 @@ var SupatestApiClient = class {
5555
5952
  if (this.options.dryRun) {
5556
5953
  this.logPayload(`POST /v1/runs/${runId}/attachments/sign`, data);
5557
5954
  return {
5558
- uploads: data.attachments.map((att, i) => ({
5559
- attachmentId: `mock_att_${i}_${Date.now()}`,
5955
+ uploads: data.attachments.map((att, i2) => ({
5956
+ attachmentId: `mock_att_${i2}_${Date.now()}`,
5560
5957
  signedUrl: `https://mock-s3.example.com/uploads/${att.filename}`,
5561
5958
  expiresAt: new Date(Date.now() + 15 * 60 * 1e3).toISOString()
5562
5959
  }))
@@ -5584,12 +5981,16 @@ var SupatestApiClient = class {
5584
5981
  this.options.timeoutMs
5585
5982
  );
5586
5983
  try {
5984
+ const headers = {
5985
+ "Content-Type": "application/json",
5986
+ Authorization: `Bearer ${this.options.apiKey}`
5987
+ };
5988
+ if (this.options.projectId) {
5989
+ headers["X-Project-Id"] = this.options.projectId;
5990
+ }
5587
5991
  const response = await _fetch(url, {
5588
5992
  method,
5589
- headers: {
5590
- "Content-Type": "application/json",
5591
- Authorization: `Bearer ${this.options.apiKey}`
5592
- },
5993
+ headers,
5593
5994
  body: body ? JSON.stringify(body) : void 0,
5594
5995
  signal: controller.signal
5595
5996
  });
@@ -5613,6 +6014,10 @@ var SupatestApiClient = class {
5613
6014
  console.log(JSON.stringify(data, null, 2));
5614
6015
  }
5615
6016
  };
6017
+ var DEFAULT_API_URL = "https://code-api.supatest.ai";
6018
+ var DEFAULT_MAX_CONCURRENT_UPLOADS = 5;
6019
+ var DEFAULT_RETRY_ATTEMPTS = 3;
6020
+ var DEFAULT_TIMEOUT_MS = 3e4;
5616
6021
  var ErrorCollector = class {
5617
6022
  errors = [];
5618
6023
  recordError(category, message, context) {
@@ -5778,6 +6183,31 @@ async function getLocalGitInfo(rootDir) {
5778
6183
  return {};
5779
6184
  }
5780
6185
  }
6186
+ async function getGitInfoWithCI(rootDir) {
6187
+ const ciGitInfo = {
6188
+ branch: process.env.GITHUB_REF_NAME ?? process.env.GITHUB_HEAD_REF ?? process.env.CI_COMMIT_BRANCH ?? process.env.GITLAB_CI_COMMIT_BRANCH ?? process.env.GIT_BRANCH,
6189
+ commit: process.env.GITHUB_SHA ?? process.env.CI_COMMIT_SHA ?? process.env.GITLAB_CI_COMMIT_SHA ?? process.env.GIT_COMMIT,
6190
+ commitMessage: process.env.CI_COMMIT_MESSAGE ?? process.env.GITLAB_CI_COMMIT_MESSAGE,
6191
+ repo: process.env.GITHUB_REPOSITORY ?? process.env.CI_PROJECT_PATH ?? process.env.GITLAB_CI_PROJECT_PATH ?? process.env.GIT_REPO,
6192
+ author: process.env.GITHUB_ACTOR ?? process.env.GITLAB_USER_NAME,
6193
+ authorEmail: process.env.GITLAB_USER_EMAIL,
6194
+ tag: process.env.GITHUB_REF_TYPE === "tag" ? process.env.GITHUB_REF_NAME : void 0
6195
+ };
6196
+ if (ciGitInfo.branch || ciGitInfo.commit) {
6197
+ return ciGitInfo;
6198
+ }
6199
+ const localGitInfo = await getLocalGitInfo(rootDir);
6200
+ return {
6201
+ branch: ciGitInfo.branch ?? localGitInfo.branch,
6202
+ commit: ciGitInfo.commit ?? localGitInfo.commit,
6203
+ commitMessage: ciGitInfo.commitMessage ?? localGitInfo.commitMessage,
6204
+ repo: ciGitInfo.repo ?? localGitInfo.repo,
6205
+ author: ciGitInfo.author ?? localGitInfo.author,
6206
+ authorEmail: ciGitInfo.authorEmail ?? localGitInfo.authorEmail,
6207
+ tag: ciGitInfo.tag ?? localGitInfo.tag,
6208
+ dirty: localGitInfo.dirty
6209
+ };
6210
+ }
5781
6211
  function hashKey(value) {
5782
6212
  return (0, import_crypto.createHash)("sha256").update(value).digest("hex").slice(0, 12);
5783
6213
  }
@@ -5886,7 +6316,25 @@ function getCIInfo() {
5886
6316
  }
5887
6317
  return void 0;
5888
6318
  }
5889
- function registerInterruptHandler(client, getRunId) {
6319
+ function getBaseEnvironmentInfo() {
6320
+ return {
6321
+ os: {
6322
+ platform: import_os.default.platform(),
6323
+ release: import_os.default.release(),
6324
+ arch: import_os.default.arch()
6325
+ },
6326
+ node: {
6327
+ version: process.version
6328
+ },
6329
+ machine: {
6330
+ cpus: import_os.default.cpus().length,
6331
+ memory: import_os.default.totalmem(),
6332
+ hostname: import_os.default.hostname()
6333
+ },
6334
+ ci: getCIInfo()
6335
+ };
6336
+ }
6337
+ function registerInterruptHandler(client, getRunId, getShard) {
5890
6338
  let completed = false;
5891
6339
  const handler = async (signal) => {
5892
6340
  if (completed) {
@@ -5899,7 +6347,8 @@ function registerInterruptHandler(client, getRunId) {
5899
6347
  try {
5900
6348
  await client.completeRun(runId, {
5901
6349
  status: "interrupted",
5902
- endedAt: (/* @__PURE__ */ new Date()).toISOString()
6350
+ endedAt: (/* @__PURE__ */ new Date()).toISOString(),
6351
+ shard: getShard == null ? void 0 : getShard()
5903
6352
  });
5904
6353
  } catch {
5905
6354
  }
@@ -5918,6 +6367,52 @@ function registerInterruptHandler(client, getRunId) {
5918
6367
  process.removeListener("SIGTERM", sigtermHandler);
5919
6368
  };
5920
6369
  }
6370
+ var TAG_PATTERNS = {
6371
+ owner: /@owner:([^\s@]+)/,
6372
+ priority: /@priority:(critical|high|medium|low)/i,
6373
+ feature: /@feature:([^\s@]+)/,
6374
+ ticketId: /@ticket:([^\s@]+)/,
6375
+ testType: /@test_type:(smoke|e2e|regression|integration|unit)/i
6376
+ };
6377
+ var KNOWN_KEYS = ["owner", "priority", "feature", "ticket", "test_type", "id", "slow", "flaky"];
6378
+ function parseTestMetadata(tags) {
6379
+ const metadata = {
6380
+ isSlow: false,
6381
+ isFlakyTagged: false,
6382
+ customMetadata: {}
6383
+ };
6384
+ for (const tag of tags) {
6385
+ const lowerTag = tag.toLowerCase();
6386
+ if (lowerTag === "@slow") {
6387
+ metadata.isSlow = true;
6388
+ } else if (lowerTag === "@flaky") {
6389
+ metadata.isFlakyTagged = true;
6390
+ }
6391
+ }
6392
+ for (const tag of tags) {
6393
+ for (const [key, pattern] of Object.entries(TAG_PATTERNS)) {
6394
+ const match = tag.match(pattern);
6395
+ if (match) {
6396
+ const value = match[1];
6397
+ if (key === "priority") {
6398
+ metadata.priority = value.toLowerCase();
6399
+ } else if (key === "testType") {
6400
+ metadata.testType = value.toLowerCase();
6401
+ } else {
6402
+ metadata[key] = value;
6403
+ }
6404
+ }
6405
+ }
6406
+ const customMatch = tag.match(/@([a-zA-Z][a-zA-Z0-9_-]*):([^\s@]+)/);
6407
+ if (customMatch) {
6408
+ const [, key, value] = customMatch;
6409
+ if (!KNOWN_KEYS.includes(key.toLowerCase())) {
6410
+ metadata.customMetadata[key] = value;
6411
+ }
6412
+ }
6413
+ }
6414
+ return metadata;
6415
+ }
5921
6416
  var AttachmentUploader = class {
5922
6417
  options;
5923
6418
  constructor(options) {
@@ -6013,7 +6508,6 @@ var AttachmentUploader = class {
6013
6508
  };
6014
6509
 
6015
6510
  // src/index.ts
6016
- var DEFAULT_API_URL = "https://code-api.supatest.ai";
6017
6511
  var SupatestCypressReporter = class {
6018
6512
  options;
6019
6513
  client;
@@ -6037,10 +6531,12 @@ var SupatestCypressReporter = class {
6037
6531
  projectId: options.projectId || process.env.SUPATEST_PROJECT_ID || "",
6038
6532
  apiKey: options.apiKey || process.env.SUPATEST_API_KEY || "",
6039
6533
  apiUrl: options.apiUrl || process.env.SUPATEST_API_URL || DEFAULT_API_URL,
6534
+ runGroupId: options.runGroupId || process.env.SUPATEST_RUN_GROUP_ID,
6535
+ shard: options.shard || this.getShardFromEnv(),
6040
6536
  uploadAssets: options.uploadAssets ?? true,
6041
- maxConcurrentUploads: options.maxConcurrentUploads ?? 5,
6042
- retryAttempts: options.retryAttempts ?? 3,
6043
- timeoutMs: options.timeoutMs ?? 3e4,
6537
+ maxConcurrentUploads: options.maxConcurrentUploads ?? DEFAULT_MAX_CONCURRENT_UPLOADS,
6538
+ retryAttempts: options.retryAttempts ?? DEFAULT_RETRY_ATTEMPTS,
6539
+ timeoutMs: options.timeoutMs ?? DEFAULT_TIMEOUT_MS,
6044
6540
  dryRun: options.dryRun ?? process.env.SUPATEST_DRY_RUN === "true"
6045
6541
  };
6046
6542
  }
@@ -6059,6 +6555,7 @@ var SupatestCypressReporter = class {
6059
6555
  this.client = new SupatestApiClient({
6060
6556
  apiKey: this.options.apiKey,
6061
6557
  apiUrl: this.options.apiUrl,
6558
+ projectId: this.options.projectId,
6062
6559
  timeoutMs: this.options.timeoutMs,
6063
6560
  retryAttempts: this.options.retryAttempts,
6064
6561
  dryRun: this.options.dryRun
@@ -6072,7 +6569,9 @@ var SupatestCypressReporter = class {
6072
6569
  try {
6073
6570
  const runRequest = {
6074
6571
  projectId: this.options.projectId,
6572
+ runGroupId: this.options.runGroupId,
6075
6573
  startedAt: this.startedAt,
6574
+ shard: this.options.shard,
6076
6575
  cypress: {
6077
6576
  version: this.cypressVersion || "unknown",
6078
6577
  browser: this.browserName || "electron"
@@ -6095,7 +6594,8 @@ var SupatestCypressReporter = class {
6095
6594
  this.runId = response.runId;
6096
6595
  this.unregisterInterruptHandler = registerInterruptHandler(
6097
6596
  this.client,
6098
- () => this.runId
6597
+ () => this.runId,
6598
+ () => this.options.shard
6099
6599
  );
6100
6600
  logInfo(`Run ${this.runId} started (${details.specs.length} spec files)`);
6101
6601
  } catch (error) {
@@ -6137,6 +6637,7 @@ var SupatestCypressReporter = class {
6137
6637
  await this.client.completeRun(this.runId, {
6138
6638
  status: (results == null ? void 0 : results.status) === "finished" ? "complete" : "errored",
6139
6639
  endedAt: (results == null ? void 0 : results.endedTestsAt) ?? (/* @__PURE__ */ new Date()).toISOString(),
6640
+ shard: this.options.shard,
6140
6641
  summary,
6141
6642
  timing: {
6142
6643
  totalDurationMs: (results == null ? void 0 : results.totalDuration) ?? 0,
@@ -6264,25 +6765,7 @@ var SupatestCypressReporter = class {
6264
6765
  return tags;
6265
6766
  }
6266
6767
  parseTestMetadata(tags) {
6267
- const metadata = {
6268
- isSlow: false,
6269
- isFlakyTagged: false,
6270
- customMetadata: {}
6271
- };
6272
- for (const tag of tags) {
6273
- const lower = tag.toLowerCase();
6274
- if (lower === "@slow") metadata.isSlow = true;
6275
- if (lower === "@flaky") metadata.isFlakyTagged = true;
6276
- const ownerMatch = tag.match(/@owner:([^\s@]+)/i);
6277
- if (ownerMatch) metadata.owner = ownerMatch[1];
6278
- const priorityMatch = tag.match(/@priority:(critical|high|medium|low)/i);
6279
- if (priorityMatch) metadata.priority = priorityMatch[1].toLowerCase();
6280
- const featureMatch = tag.match(/@feature:([^\s@]+)/i);
6281
- if (featureMatch) metadata.feature = featureMatch[1];
6282
- const typeMatch = tag.match(/@test_type:(smoke|e2e|regression|integration|unit)/i);
6283
- if (typeMatch) metadata.testType = typeMatch[1].toLowerCase();
6284
- }
6285
- return metadata;
6768
+ return parseTestMetadata(tags);
6286
6769
  }
6287
6770
  buildAttachmentMeta(test, specResults) {
6288
6771
  const attachments = [];
@@ -6290,7 +6773,7 @@ var SupatestCypressReporter = class {
6290
6773
  if (screenshot.path) {
6291
6774
  attachments.push({
6292
6775
  name: screenshot.name || "screenshot",
6293
- filename: import_node_path.default.basename(screenshot.path),
6776
+ filename: import_node_path2.default.basename(screenshot.path),
6294
6777
  contentType: "image/png",
6295
6778
  sizeBytes: getFileSize(screenshot.path),
6296
6779
  kind: "screenshot"
@@ -6300,7 +6783,7 @@ var SupatestCypressReporter = class {
6300
6783
  if (specResults.video) {
6301
6784
  attachments.push({
6302
6785
  name: "video",
6303
- filename: import_node_path.default.basename(specResults.video),
6786
+ filename: import_node_path2.default.basename(specResults.video),
6304
6787
  contentType: "video/mp4",
6305
6788
  sizeBytes: getFileSize(specResults.video),
6306
6789
  kind: "video"
@@ -6316,7 +6799,7 @@ var SupatestCypressReporter = class {
6316
6799
  path: screenshot.path,
6317
6800
  meta: {
6318
6801
  name: screenshot.name || "screenshot",
6319
- filename: import_node_path.default.basename(screenshot.path),
6802
+ filename: import_node_path2.default.basename(screenshot.path),
6320
6803
  contentType: "image/png",
6321
6804
  sizeBytes: getFileSize(screenshot.path),
6322
6805
  kind: "screenshot"
@@ -6329,7 +6812,7 @@ var SupatestCypressReporter = class {
6329
6812
  path: specResults.video,
6330
6813
  meta: {
6331
6814
  name: "video",
6332
- filename: import_node_path.default.basename(specResults.video),
6815
+ filename: import_node_path2.default.basename(specResults.video),
6333
6816
  contentType: "video/mp4",
6334
6817
  sizeBytes: getFileSize(specResults.video),
6335
6818
  kind: "video"
@@ -6342,48 +6825,54 @@ var SupatestCypressReporter = class {
6342
6825
  testResultId,
6343
6826
  attachments: attachments.map((a) => a.meta)
6344
6827
  });
6345
- const uploadItems = uploads.map((u, i) => ({
6828
+ const uploadItems = uploads.map((u, i2) => ({
6346
6829
  signedUrl: u.signedUrl,
6347
- filePath: attachments[i].path,
6348
- contentType: attachments[i].meta.contentType
6830
+ filePath: attachments[i2].path,
6831
+ contentType: attachments[i2].meta.contentType
6349
6832
  }));
6350
- await this.uploader.uploadBatch(uploadItems, uploads);
6833
+ const results = await this.uploader.uploadBatch(uploadItems, uploads);
6834
+ const failures = results.filter((r2) => !r2.success);
6835
+ if (failures.length > 0) {
6836
+ failures.forEach((failure) => {
6837
+ const attachment = attachments.find(
6838
+ (_2, i2) => {
6839
+ var _a2;
6840
+ return ((_a2 = uploads[i2]) == null ? void 0 : _a2.attachmentId) === failure.attachmentId;
6841
+ }
6842
+ );
6843
+ this.errorCollector.recordError(
6844
+ "ATTACHMENT_UPLOAD",
6845
+ failure.error || "Upload failed",
6846
+ {
6847
+ attachmentName: attachment == null ? void 0 : attachment.meta.name,
6848
+ filePath: attachment == null ? void 0 : attachment.path,
6849
+ error: failure.error
6850
+ }
6851
+ );
6852
+ });
6853
+ }
6351
6854
  } catch (error) {
6352
6855
  this.errorCollector.recordError("ATTACHMENT_SIGN", getErrorMessage2(error), { error });
6353
6856
  }
6354
6857
  }
6355
6858
  getEnvironmentInfo() {
6356
6859
  return {
6357
- os: {
6358
- platform: import_node_os.default.platform(),
6359
- release: import_node_os.default.release(),
6360
- arch: import_node_os.default.arch()
6361
- },
6362
- node: {
6363
- version: process.version
6364
- },
6365
- machine: {
6366
- cpus: import_node_os.default.cpus().length,
6367
- memory: import_node_os.default.totalmem(),
6368
- hostname: import_node_os.default.hostname()
6369
- },
6860
+ ...getBaseEnvironmentInfo(),
6370
6861
  cypress: {
6371
6862
  version: this.cypressVersion || "unknown"
6372
- },
6373
- ci: getCIInfo()
6863
+ }
6374
6864
  };
6375
6865
  }
6376
6866
  async getGitInfo() {
6377
- const ciGitInfo = {
6378
- branch: process.env.GITHUB_REF_NAME ?? process.env.CI_COMMIT_BRANCH ?? process.env.GIT_BRANCH,
6379
- commit: process.env.GITHUB_SHA ?? process.env.CI_COMMIT_SHA ?? process.env.GIT_COMMIT,
6380
- repo: process.env.GITHUB_REPOSITORY ?? process.env.CI_PROJECT_PATH,
6381
- author: process.env.GITHUB_ACTOR ?? process.env.GITLAB_USER_NAME
6382
- };
6383
- if (ciGitInfo.branch || ciGitInfo.commit) {
6384
- return ciGitInfo;
6867
+ return getGitInfoWithCI(this.rootDir);
6868
+ }
6869
+ getShardFromEnv() {
6870
+ const current = Number(process.env.SUPATEST_SHARD_CURRENT);
6871
+ const total = Number(process.env.SUPATEST_SHARD_TOTAL);
6872
+ if (!Number.isInteger(current) || !Number.isInteger(total) || current < 1 || total < 1) {
6873
+ return void 0;
6385
6874
  }
6386
- return await getLocalGitInfo(this.rootDir);
6875
+ return { current, total };
6387
6876
  }
6388
6877
  };
6389
6878
  function supatestPlugin(on, config, options = {}) {