@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.js CHANGED
@@ -4,11 +4,11 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
- }) : x)(function(x) {
7
+ var __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, {
8
+ get: (a, b2) => (typeof require !== "undefined" ? require : a)[b2]
9
+ }) : x2)(function(x2) {
10
10
  if (typeof require !== "undefined") return require.apply(this, arguments);
11
- throw Error('Dynamic require of "' + x + '" is not supported');
11
+ throw Error('Dynamic require of "' + x2 + '" is not supported');
12
12
  });
13
13
  var __commonJS = (cb, mod) => function __require3() {
14
14
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
@@ -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
  module.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
  exports.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 = exports.storage.getItem("debug") || exports.storage.getItem("DEBUG");
473
+ r2 = exports.storage.getItem("debug") || exports.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"(exports, module) {
501
+ "../node_modules/.pnpm/has-flag@3.0.0/node_modules/has-flag/index.js"(exports, module) {
502
502
  "use strict";
503
- module.exports = (flag, argv = process.argv) => {
503
+ module.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"(exports, module) {
515
+ "../node_modules/.pnpm/supports-color@5.5.0/node_modules/supports-color/index.js"(exports, module) {
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
  module.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
  exports.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+" + module.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(exports.inspectOpts);
784
- for (let i = 0; i < keys.length; i++) {
785
- debug2.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
766
+ for (let i2 = 0; i2 < keys.length; i2++) {
767
+ debug2.inspectOpts[keys[i2]] = exports.inspectOpts[keys[i2]];
786
768
  }
787
769
  }
788
770
  module.exports = require_common()(exports);
@@ -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"(exports) {
860
842
  "use strict";
861
843
  function __export2(m) {
862
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
844
+ for (var p2 in m) if (!exports.hasOwnProperty(p2)) exports[p2] = m[p2];
863
845
  }
864
846
  Object.defineProperty(exports, "__esModule", { value: true });
865
847
  __export2(require_src2());
@@ -910,37 +892,503 @@ var require_dist2 = __commonJS({
910
892
 
911
893
  // src/index.ts
912
894
  import fs2 from "fs";
913
- import os from "os";
914
895
  import path from "path";
915
896
 
916
- // ../node_modules/.pnpm/simple-git@3.27.0/node_modules/simple-git/dist/esm/index.js
897
+ // ../node_modules/.pnpm/simple-git@3.36.0/node_modules/simple-git/dist/esm/index.js
917
898
  var import_file_exists = __toESM(require_dist(), 1);
899
+
900
+ // ../node_modules/.pnpm/@simple-git+args-pathspec@1.0.3/node_modules/@simple-git/args-pathspec/dist/index.mjs
901
+ var t = /* @__PURE__ */ new WeakMap();
902
+ function c(...n) {
903
+ const e = new String(n);
904
+ return t.set(e, n), e;
905
+ }
906
+ function r(n) {
907
+ return n instanceof String && t.has(n);
908
+ }
909
+ function o(n) {
910
+ return t.get(n) ?? [];
911
+ }
912
+
913
+ // ../node_modules/.pnpm/simple-git@3.36.0/node_modules/simple-git/dist/esm/index.js
918
914
  var import_debug = __toESM(require_src(), 1);
915
+ import { spawn } from "child_process";
919
916
  var import_promise_deferred = __toESM(require_dist2(), 1);
917
+ import { normalize } from "path";
918
+
919
+ // ../node_modules/.pnpm/@simple-git+argv-parser@1.1.1/node_modules/@simple-git/argv-parser/dist/index.mjs
920
+ function* U(e, t2) {
921
+ const n = t2 === "global";
922
+ for (const o2 of e)
923
+ o2.isGlobal === n && (yield o2);
924
+ }
925
+ var k = /* @__PURE__ */ new Set([
926
+ "--add",
927
+ "--edit",
928
+ "--remove-section",
929
+ "--rename-section",
930
+ "--replace-all",
931
+ "--unset",
932
+ "--unset-all",
933
+ "-e"
934
+ ]);
935
+ var S = /* @__PURE__ */ new Set([
936
+ "--get",
937
+ "--get-all",
938
+ "--get-color",
939
+ "--get-colorbool",
940
+ "--get-regexp",
941
+ "--get-urlmatch",
942
+ "--list",
943
+ "-l"
944
+ ]);
945
+ var P = /* @__PURE__ */ new Set([
946
+ "edit",
947
+ "remove-section",
948
+ "rename-section",
949
+ "set",
950
+ "unset"
951
+ ]);
952
+ var E = /* @__PURE__ */ new Set(["get", "get-color", "get-colorbool", "list"]);
953
+ function F(e, t2) {
954
+ var _a2;
955
+ for (const { name: o2 } of U(e, "task")) {
956
+ if (k.has(o2))
957
+ return p(true, t2);
958
+ if (S.has(o2))
959
+ return p(false, t2);
960
+ }
961
+ const n = (_a2 = t2.at(0)) == null ? void 0 : _a2.toLowerCase();
962
+ 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);
963
+ }
964
+ function p(e = false, t2 = []) {
965
+ var _a2;
966
+ const n = (_a2 = t2.at(0)) == null ? void 0 : _a2.toLowerCase();
967
+ return n === void 0 ? null : {
968
+ isWrite: e,
969
+ isRead: !e,
970
+ key: n,
971
+ value: t2.at(1)
972
+ };
973
+ }
974
+ function A(e, t2) {
975
+ return t2.isWrite && t2.value !== void 0 ? { key: t2.key, value: t2.value, scope: e } : { key: t2.key, scope: e };
976
+ }
977
+ function M(e) {
978
+ const t2 = (e == null ? void 0 : e.indexOf("=")) || -1;
979
+ return !e || t2 < 0 ? null : {
980
+ key: e.slice(0, t2).trim().toLowerCase(),
981
+ value: e.slice(t2 + 1)
982
+ };
983
+ }
984
+ function N(e) {
985
+ for (const { name: t2 } of U(e, "task"))
986
+ switch (t2) {
987
+ case "--global":
988
+ return "global";
989
+ case "--system":
990
+ return "system";
991
+ case "--worktree":
992
+ return "worktree";
993
+ case "--local":
994
+ return "local";
995
+ case "--file":
996
+ case "-f":
997
+ return "file";
998
+ }
999
+ return "local";
1000
+ }
1001
+ function G({ name: e }) {
1002
+ if (e === "-c" || e === "--config")
1003
+ return "inline";
1004
+ if (e === "--config-env")
1005
+ return "env";
1006
+ }
1007
+ function* O(e) {
1008
+ for (const t2 of e) {
1009
+ const n = G(t2), o2 = n && M(t2.value);
1010
+ o2 && (yield {
1011
+ ...o2,
1012
+ scope: n
1013
+ });
1014
+ }
1015
+ }
1016
+ function L(e, t2, n) {
1017
+ const o2 = {
1018
+ read: [],
1019
+ write: [...O(t2)]
1020
+ };
1021
+ return e === "config" && $(
1022
+ o2,
1023
+ N(t2),
1024
+ F(t2, n)
1025
+ ), o2;
1026
+ }
1027
+ function $(e, t2, n) {
1028
+ if (n === null)
1029
+ return;
1030
+ const o2 = A(t2, n);
1031
+ n.isWrite ? e.write.push(o2) : e.read.push(o2);
1032
+ }
1033
+ var x = {
1034
+ short: /* @__PURE__ */ new Map([
1035
+ ["c", true]
1036
+ // -c <k=v> set config key for this invocation
1037
+ ])
1038
+ };
1039
+ var D = {
1040
+ short: new Map([
1041
+ ["C", true],
1042
+ // -C <path> change working directory
1043
+ ["P", false],
1044
+ // -P no pager (alias for --no-pager)
1045
+ ["h", false],
1046
+ // -h help
1047
+ ["p", false],
1048
+ // -p paginate
1049
+ ["v", false],
1050
+ // -v version
1051
+ ...x.short.entries()
1052
+ ]),
1053
+ long: /* @__PURE__ */ new Set([
1054
+ "attr-source",
1055
+ "config-env",
1056
+ "exec-path",
1057
+ "git-dir",
1058
+ "list-cmds",
1059
+ "namespace",
1060
+ "super-prefix",
1061
+ "work-tree"
1062
+ ])
1063
+ };
1064
+ var R = {
1065
+ clone: {
1066
+ short: /* @__PURE__ */ new Map([
1067
+ ["b", true],
1068
+ // -b <branch>
1069
+ ["j", true],
1070
+ // -j <n> parallel jobs
1071
+ ["l", false],
1072
+ // -l local
1073
+ ["n", false],
1074
+ // -n no-checkout
1075
+ ["o", true],
1076
+ // -o <name> remote name
1077
+ ["q", false],
1078
+ // -q quiet
1079
+ ["s", false],
1080
+ // -s shared
1081
+ ["u", true]
1082
+ // -u <upload-pack>
1083
+ ]),
1084
+ long: /* @__PURE__ */ new Set(["branch", "config", "jobs", "origin", "upload-pack", "u", "template"])
1085
+ },
1086
+ commit: {
1087
+ short: /* @__PURE__ */ new Map([
1088
+ ["C", true],
1089
+ // -C <commit> reuse message
1090
+ ["F", true],
1091
+ // -F <file> read message from file
1092
+ ["c", true],
1093
+ // -c <commit> reedit message
1094
+ ["m", true],
1095
+ // -m <msg>
1096
+ ["t", true]
1097
+ // -t <template>
1098
+ ]),
1099
+ long: /* @__PURE__ */ new Set(["file", "message", "reedit-message", "reuse-message", "template"])
1100
+ },
1101
+ config: {
1102
+ short: /* @__PURE__ */ new Map([
1103
+ ["e", false],
1104
+ // -e open editor
1105
+ ["f", true],
1106
+ // -f <file>
1107
+ ["l", false]
1108
+ // -l list
1109
+ ]),
1110
+ long: /* @__PURE__ */ new Set(["blob", "comment", "default", "file", "type", "value"])
1111
+ },
1112
+ fetch: {
1113
+ short: /* @__PURE__ */ new Map(),
1114
+ long: /* @__PURE__ */ new Set(["upload-pack"])
1115
+ },
1116
+ init: {
1117
+ short: /* @__PURE__ */ new Map(),
1118
+ long: /* @__PURE__ */ new Set(["template"])
1119
+ },
1120
+ pull: {
1121
+ short: /* @__PURE__ */ new Map(),
1122
+ long: /* @__PURE__ */ new Set(["upload-pack"])
1123
+ },
1124
+ push: {
1125
+ short: /* @__PURE__ */ new Map(),
1126
+ long: /* @__PURE__ */ new Set(["exec", "receive-pack"])
1127
+ }
1128
+ };
1129
+ var T = { short: /* @__PURE__ */ new Map(), long: /* @__PURE__ */ new Set() };
1130
+ function I(e) {
1131
+ const t2 = R[e ?? ""] ?? T;
1132
+ return {
1133
+ short: new Map([...x.short.entries(), ...t2.short.entries()]),
1134
+ long: t2.long
1135
+ };
1136
+ }
1137
+ function b(e, t2 = D) {
1138
+ if (e.startsWith("--")) {
1139
+ const n = e.indexOf("=");
1140
+ if (n > 2)
1141
+ return [{ name: e.slice(0, n), value: e.slice(n + 1), needsNext: false }];
1142
+ const o2 = e.slice(2);
1143
+ return [{ name: e, needsNext: t2.long.has(o2) }];
1144
+ }
1145
+ if (e.length === 2) {
1146
+ const n = e.charAt(1), o2 = t2.short.get(n);
1147
+ return [{ name: e, needsNext: o2 === true }];
1148
+ }
1149
+ return W(e, t2.short);
1150
+ }
1151
+ function W(e, t2) {
1152
+ const n = e.slice(1).split(""), o2 = [];
1153
+ for (let s = 0; s < n.length; s++) {
1154
+ const r2 = n[s], l = t2.get(r2);
1155
+ if (l === void 0)
1156
+ return [{ name: e, needsNext: false }];
1157
+ if (l) {
1158
+ const a = n.slice(s + 1).join("");
1159
+ if (a && ![...a].every((w) => t2.has(w)))
1160
+ return o2.push({ name: `-${r2}`, value: a, needsNext: false }), o2;
1161
+ }
1162
+ o2.push({ name: `-${r2}`, needsNext: l });
1163
+ }
1164
+ return o2;
1165
+ }
1166
+ function j(e, t2 = []) {
1167
+ let n = 0;
1168
+ for (; n < e.length; ) {
1169
+ const o2 = String(e[n]);
1170
+ if (!o2.startsWith("-") || o2.length < 2) break;
1171
+ const s = b(o2);
1172
+ let r2 = n + 1;
1173
+ for (const l of s) {
1174
+ const a = {
1175
+ name: l.name,
1176
+ value: l.value,
1177
+ absorbedNext: false,
1178
+ isGlobal: true
1179
+ };
1180
+ l.needsNext && a.value === void 0 && r2 < e.length && (a.value = String(e[r2]), a.absorbedNext = true, r2++), t2.push(a);
1181
+ }
1182
+ n = r2;
1183
+ }
1184
+ return { flags: t2, taskIndex: n };
1185
+ }
1186
+ function B(e, t2, n = []) {
1187
+ const o2 = I(t2), s = [], r2 = [];
1188
+ let l = 0;
1189
+ for (; l < e.length; ) {
1190
+ const a = e[l];
1191
+ if (r(a)) {
1192
+ r2.push(...o(a)), l++;
1193
+ continue;
1194
+ }
1195
+ const f = String(a);
1196
+ if (f === "--") {
1197
+ for (let g = l + 1; g < e.length; g++) {
1198
+ const u = e[g];
1199
+ r(u) ? r2.push(...o(u)) : r2.push(String(u));
1200
+ }
1201
+ break;
1202
+ }
1203
+ if (!f.startsWith("-") || f.length < 2) {
1204
+ s.push(f), l++;
1205
+ continue;
1206
+ }
1207
+ const w = b(f, o2);
1208
+ let d = l + 1;
1209
+ for (const g of w) {
1210
+ const u = {
1211
+ name: g.name,
1212
+ value: g.value,
1213
+ absorbedNext: false,
1214
+ isGlobal: false
1215
+ };
1216
+ g.needsNext && u.value === void 0 && d < e.length && !r(e[d]) && (u.value = String(e[d]), u.absorbedNext = true, d++), n.push(u);
1217
+ }
1218
+ l = d;
1219
+ }
1220
+ return { flags: n, positionals: s, pathspecs: r2 };
1221
+ }
1222
+ function* V({
1223
+ write: e
1224
+ }) {
1225
+ for (const t2 of e)
1226
+ for (const n of q) {
1227
+ const o2 = n(t2.key);
1228
+ o2 && (yield o2);
1229
+ }
1230
+ }
1231
+ function c2(e, t2, n = String(e)) {
1232
+ const o2 = typeof e == "string" ? new RegExp(`\\s*${e.toLowerCase()}`) : e;
1233
+ return function(r2) {
1234
+ if (o2.test(r2))
1235
+ return {
1236
+ category: t2,
1237
+ message: `Configuring ${n} is not permitted without enabling ${t2}`
1238
+ };
1239
+ };
1240
+ }
1241
+ function i(e, t2) {
1242
+ const n = new RegExp(`\\s*${e.toLowerCase().replace(/\./g, "(..+)?.")}`);
1243
+ return c2(n, t2, e);
1244
+ }
1245
+ var q = [
1246
+ c2("alias", "allowUnsafeAlias"),
1247
+ c2("core.askPass", "allowUnsafeAskPass"),
1248
+ c2("core.editor", "allowUnsafeEditor"),
1249
+ c2("core.fsmonitor", "allowUnsafeFsMonitor"),
1250
+ c2("core.gitProxy", "allowUnsafeGitProxy"),
1251
+ c2("core.hooksPath", "allowUnsafeHooksPath"),
1252
+ c2("core.pager", "allowUnsafePager"),
1253
+ c2("core.sshCommand", "allowUnsafeSshCommand"),
1254
+ i("credential.helper", "allowUnsafeCredentialHelper"),
1255
+ i("diff.command", "allowUnsafeDiffExternal"),
1256
+ c2("diff.external", "allowUnsafeDiffExternal"),
1257
+ i("diff.textconv", "allowUnsafeDiffTextConv"),
1258
+ i("filter.clean", "allowUnsafeFilter"),
1259
+ i("filter.smudge", "allowUnsafeFilter"),
1260
+ i("gpg.program", "allowUnsafeGpgProgram"),
1261
+ c2("init.templateDir", "allowUnsafeTemplateDir"),
1262
+ i("merge.driver", "allowUnsafeMergeDriver"),
1263
+ i("mergetool.path", "allowUnsafeMergeDriver"),
1264
+ i("mergetool.cmd", "allowUnsafeMergeDriver"),
1265
+ i("protocol.allow", "allowUnsafeProtocolOverride"),
1266
+ i("remote.receivepack", "allowUnsafePack"),
1267
+ i("remote.uploadpack", "allowUnsafePack"),
1268
+ c2("sequence.editor", "allowUnsafeEditor")
1269
+ ];
1270
+ function* K(e, t2) {
1271
+ for (const n of t2)
1272
+ for (const o2 of H) {
1273
+ const s = o2(e, n.name);
1274
+ s && (yield s);
1275
+ }
1276
+ }
1277
+ function h(e, t2, n, o2 = String(t2)) {
1278
+ 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}`;
1279
+ return function(a, f) {
1280
+ if ((!e || a === e) && s.test(f))
1281
+ return {
1282
+ category: n,
1283
+ message: r2
1284
+ };
1285
+ };
1286
+ }
1287
+ var H = [
1288
+ h(
1289
+ null,
1290
+ /--(upload|receive)-pack/,
1291
+ "allowUnsafePack",
1292
+ "--upload-pack or --receive-pack"
1293
+ ),
1294
+ h("clone", /^-\w*u/, "allowUnsafePack"),
1295
+ h("clone", "--u", "allowUnsafePack"),
1296
+ h("push", "--exec", "allowUnsafePack"),
1297
+ h(null, "--template", "allowUnsafeTemplateDir")
1298
+ ];
1299
+ function C(e, t2, n) {
1300
+ return [...K(e, t2), ...V(n)];
1301
+ }
1302
+ function Y(...e) {
1303
+ 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);
1304
+ return {
1305
+ task: o2,
1306
+ flags: t2.map(J),
1307
+ paths: l,
1308
+ config: a,
1309
+ vulnerabilities: z(C(o2, t2, a))
1310
+ };
1311
+ }
1312
+ function z(e) {
1313
+ return Object.defineProperty(e, "vulnerabilities", {
1314
+ value: e
1315
+ });
1316
+ }
1317
+ function J({ value: e, name: t2 }) {
1318
+ return e !== void 0 ? { name: t2, value: e } : { name: t2 };
1319
+ }
1320
+ var y = {
1321
+ editor: "allowUnsafeEditor",
1322
+ git_askpass: "allowUnsafeAskPass",
1323
+ git_config_global: "allowUnsafeConfigPaths",
1324
+ git_config_system: "allowUnsafeConfigPaths",
1325
+ git_config_count: "allowUnsafeConfigEnvCount",
1326
+ git_config: "allowUnsafeConfigPaths",
1327
+ git_editor: "allowUnsafeEditor",
1328
+ git_exec_path: "allowUnsafeConfigPaths",
1329
+ git_external_diff: "allowUnsafeDiffExternal",
1330
+ git_pager: "allowUnsafePager",
1331
+ git_proxy_command: "allowUnsafeGitProxy",
1332
+ git_template_dir: "allowUnsafeTemplateDir",
1333
+ git_sequence_editor: "allowUnsafeEditor",
1334
+ git_ssh: "allowUnsafeSshCommand",
1335
+ git_ssh_command: "allowUnsafeSshCommand",
1336
+ pager: "allowUnsafePager",
1337
+ prefix: "allowUnsafeConfigPaths",
1338
+ ssh_askpass: "allowUnsafeAskPass"
1339
+ };
1340
+ function* Q(e) {
1341
+ const t2 = parseInt(e.git_config_count ?? "0", 10);
1342
+ for (let n = 0; n < t2; n++) {
1343
+ const o2 = e[`git_config_key_${n}`], s = e[`git_config_value_${n}`];
1344
+ o2 !== void 0 && (yield { key: o2.toLowerCase().trim(), value: s, scope: "env" });
1345
+ }
1346
+ }
1347
+ function* X(e) {
1348
+ for (const t2 of Object.keys(e))
1349
+ if (_(t2)) {
1350
+ const n = y[t2];
1351
+ yield {
1352
+ category: n,
1353
+ message: `Use of "${t2.toUpperCase()}" is not permitted without enabling ${n}`
1354
+ };
1355
+ }
1356
+ }
1357
+ function _(e) {
1358
+ return Object.hasOwn(y, e);
1359
+ }
1360
+ function Z(e) {
1361
+ const t2 = {};
1362
+ for (const [n, o2] of Object.entries(e)) {
1363
+ const s = n.toLowerCase().trim();
1364
+ (_(s) || s.startsWith("git")) && (t2[s] = String(o2));
1365
+ }
1366
+ return t2;
1367
+ }
1368
+ function ee(e) {
1369
+ const t2 = Z(e), n = {
1370
+ read: [],
1371
+ write: [...Q(t2)]
1372
+ }, o2 = [
1373
+ ...X(t2),
1374
+ ...C(null, [], n)
1375
+ ];
1376
+ return {
1377
+ config: n,
1378
+ vulnerabilities: o2
1379
+ };
1380
+ }
1381
+ function ne(e, t2) {
1382
+ return [...Y(...e).vulnerabilities, ...ee(t2).vulnerabilities];
1383
+ }
1384
+
1385
+ // ../node_modules/.pnpm/simple-git@3.36.0/node_modules/simple-git/dist/esm/index.js
920
1386
  var import_promise_deferred2 = __toESM(require_dist2(), 1);
921
- import { spawn } from "child_process";
922
1387
  import { EventEmitter } from "events";
923
1388
  var __defProp2 = Object.defineProperty;
924
- var __defProps = Object.defineProperties;
925
1389
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
926
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
927
1390
  var __getOwnPropNames2 = Object.getOwnPropertyNames;
928
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
929
1391
  var __hasOwnProp2 = Object.prototype.hasOwnProperty;
930
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
931
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
932
- var __spreadValues = (a, b) => {
933
- for (var prop in b || (b = {}))
934
- if (__hasOwnProp2.call(b, prop))
935
- __defNormalProp(a, prop, b[prop]);
936
- if (__getOwnPropSymbols)
937
- for (var prop of __getOwnPropSymbols(b)) {
938
- if (__propIsEnum.call(b, prop))
939
- __defNormalProp(a, prop, b[prop]);
940
- }
941
- return a;
942
- };
943
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
944
1392
  var __esm = (fn, res) => function __init() {
945
1393
  return fn && (res = (0, fn[__getOwnPropNames2(fn)[0]])(fn = 0)), res;
946
1394
  };
@@ -960,44 +1408,6 @@ var __copyProps2 = (to, from, except, desc) => {
960
1408
  return to;
961
1409
  };
962
1410
  var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
963
- var __async = (__this, __arguments, generator) => {
964
- return new Promise((resolve, reject) => {
965
- var fulfilled = (value) => {
966
- try {
967
- step(generator.next(value));
968
- } catch (e) {
969
- reject(e);
970
- }
971
- };
972
- var rejected = (value) => {
973
- try {
974
- step(generator.throw(value));
975
- } catch (e) {
976
- reject(e);
977
- }
978
- };
979
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
980
- step((generator = generator.apply(__this, __arguments)).next());
981
- });
982
- };
983
- function pathspec(...paths) {
984
- const key = new String(paths);
985
- cache.set(key, paths);
986
- return key;
987
- }
988
- function isPathSpec(path2) {
989
- return path2 instanceof String && cache.has(path2);
990
- }
991
- function toPaths(pathSpec) {
992
- return cache.get(pathSpec) || [];
993
- }
994
- var cache;
995
- var init_pathspec = __esm({
996
- "src/lib/args/pathspec.ts"() {
997
- "use strict";
998
- cache = /* @__PURE__ */ new WeakMap();
999
- }
1000
- });
1001
1411
  var GitError;
1002
1412
  var init_git_error = __esm({
1003
1413
  "src/lib/errors/git-error.ts"() {
@@ -1037,7 +1447,10 @@ var init_task_configuration_error = __esm({
1037
1447
  }
1038
1448
  });
1039
1449
  function asFunction(source) {
1040
- return typeof source === "function" ? source : NOOP;
1450
+ if (typeof source !== "function") {
1451
+ return NOOP;
1452
+ }
1453
+ return source;
1041
1454
  }
1042
1455
  function isUserFunction(source) {
1043
1456
  return typeof source === "function" && source !== NOOP;
@@ -1058,7 +1471,7 @@ function last(input, offset = 0) {
1058
1471
  }
1059
1472
  }
1060
1473
  function isArrayLike(input) {
1061
- return !!(input && typeof input.length === "number");
1474
+ return filterHasLength(input);
1062
1475
  }
1063
1476
  function toLinesWithContent(input = "", trimmed2 = true, separator = "\n") {
1064
1477
  return input.split(separator).reduce((output, line) => {
@@ -1111,19 +1524,21 @@ function asCamelCase(str) {
1111
1524
  });
1112
1525
  }
1113
1526
  function asStringArray(source) {
1114
- return asArray(source).map(String);
1527
+ return asArray(source).map((item) => {
1528
+ return item instanceof String ? item : String(item);
1529
+ });
1115
1530
  }
1116
1531
  function asNumber(source, onNaN = 0) {
1117
1532
  if (source == null) {
1118
1533
  return onNaN;
1119
1534
  }
1120
1535
  const num = parseInt(source, 10);
1121
- return isNaN(num) ? onNaN : num;
1536
+ return Number.isNaN(num) ? onNaN : num;
1122
1537
  }
1123
1538
  function prefixedArray(input, prefix) {
1124
1539
  const output = [];
1125
- for (let i = 0, max = input.length; i < max; i++) {
1126
- output.push(prefix, input[i]);
1540
+ for (let i2 = 0, max = input.length; i2 < max; i2++) {
1541
+ output.push(prefix, input[i2]);
1127
1542
  }
1128
1543
  return output;
1129
1544
  }
@@ -1131,10 +1546,13 @@ function bufferToString(input) {
1131
1546
  return (Array.isArray(input) ? Buffer.concat(input) : input).toString("utf-8");
1132
1547
  }
1133
1548
  function pick(source, properties) {
1134
- return Object.assign(
1135
- {},
1136
- ...properties.map((property) => property in source ? { [property]: source[property] } : {})
1137
- );
1549
+ const out = {};
1550
+ properties.forEach((key) => {
1551
+ if (source[key] !== void 0) {
1552
+ out[key] = source[key];
1553
+ }
1554
+ });
1555
+ return out;
1138
1556
  }
1139
1557
  function delay(duration = 0) {
1140
1558
  return new Promise((done) => setTimeout(done, duration));
@@ -1151,6 +1569,7 @@ var objectToString;
1151
1569
  var init_util = __esm({
1152
1570
  "src/lib/utils/util.ts"() {
1153
1571
  "use strict";
1572
+ init_argument_filters();
1154
1573
  NULL = "\0";
1155
1574
  NOOP = () => {
1156
1575
  };
@@ -1164,7 +1583,7 @@ function filterType(input, filter, def) {
1164
1583
  return arguments.length > 2 ? def : void 0;
1165
1584
  }
1166
1585
  function filterPrimitives(input, omit) {
1167
- const type = isPathSpec(input) ? "string" : typeof input;
1586
+ const type = r(input) ? "string" : typeof input;
1168
1587
  return /number|string|boolean/.test(type) && (!omit || !omit.includes(type));
1169
1588
  }
1170
1589
  function filterPlainObject(input) {
@@ -1174,23 +1593,22 @@ function filterFunction(input) {
1174
1593
  return typeof input === "function";
1175
1594
  }
1176
1595
  var filterArray;
1596
+ var filterNumber;
1177
1597
  var filterString;
1178
- var filterStringArray;
1179
1598
  var filterStringOrStringArray;
1180
1599
  var filterHasLength;
1181
1600
  var init_argument_filters = __esm({
1182
1601
  "src/lib/utils/argument-filters.ts"() {
1183
1602
  "use strict";
1184
1603
  init_util();
1185
- init_pathspec();
1186
1604
  filterArray = (input) => {
1187
1605
  return Array.isArray(input);
1188
1606
  };
1189
- filterString = (input) => {
1190
- return typeof input === "string";
1607
+ filterNumber = (input) => {
1608
+ return typeof input === "number";
1191
1609
  };
1192
- filterStringArray = (input) => {
1193
- return Array.isArray(input) && input.every(filterString);
1610
+ filterString = (input) => {
1611
+ return typeof input === "string" || r(input);
1194
1612
  };
1195
1613
  filterStringOrStringArray = (input) => {
1196
1614
  return filterString(input) || Array.isArray(input) && input.every(filterString);
@@ -1199,7 +1617,7 @@ var init_argument_filters = __esm({
1199
1617
  if (input == null || "number|boolean|function".includes(typeof input)) {
1200
1618
  return false;
1201
1619
  }
1202
- return Array.isArray(input) || typeof input === "string" || typeof input.length === "number";
1620
+ return typeof input.length === "number";
1203
1621
  };
1204
1622
  }
1205
1623
  });
@@ -1220,17 +1638,20 @@ var GitOutputStreams;
1220
1638
  var init_git_output_streams = __esm({
1221
1639
  "src/lib/utils/git-output-streams.ts"() {
1222
1640
  "use strict";
1223
- GitOutputStreams = class {
1641
+ GitOutputStreams = class _GitOutputStreams {
1224
1642
  constructor(stdOut, stdErr) {
1225
1643
  this.stdOut = stdOut;
1226
1644
  this.stdErr = stdErr;
1227
1645
  }
1228
1646
  asStrings() {
1229
- return new GitOutputStreams(this.stdOut.toString("utf8"), this.stdErr.toString("utf8"));
1647
+ return new _GitOutputStreams(this.stdOut.toString("utf8"), this.stdErr.toString("utf8"));
1230
1648
  }
1231
1649
  };
1232
1650
  }
1233
1651
  });
1652
+ function useMatchesDefault() {
1653
+ throw new Error(`LineParser:useMatches not implemented`);
1654
+ }
1234
1655
  var LineParser;
1235
1656
  var RemoteLineParser;
1236
1657
  var init_line_parser = __esm({
@@ -1239,6 +1660,7 @@ var init_line_parser = __esm({
1239
1660
  LineParser = class {
1240
1661
  constructor(regExp, useMatches) {
1241
1662
  this.matches = [];
1663
+ this.useMatches = useMatchesDefault;
1242
1664
  this.parse = (line, target) => {
1243
1665
  this.resetMatches();
1244
1666
  if (!this._regExp.every((reg, index) => this.addMatch(reg, index, line(index)))) {
@@ -1251,9 +1673,6 @@ var init_line_parser = __esm({
1251
1673
  this.useMatches = useMatches;
1252
1674
  }
1253
1675
  }
1254
- useMatches(target, match) {
1255
- throw new Error(`LineParser:useMatches not implemented`);
1256
- }
1257
1676
  resetMatches() {
1258
1677
  this.matches.length = 0;
1259
1678
  }
@@ -1286,8 +1705,8 @@ var init_line_parser = __esm({
1286
1705
  function createInstanceConfig(...options) {
1287
1706
  const baseDir = process.cwd();
1288
1707
  const config = Object.assign(
1289
- __spreadValues({ baseDir }, defaultOptions),
1290
- ...options.filter((o) => typeof o === "object" && o)
1708
+ { baseDir, ...defaultOptions },
1709
+ ...options.filter((o2) => typeof o2 === "object" && o2)
1291
1710
  );
1292
1711
  config.baseDir = config.baseDir || baseDir;
1293
1712
  config.trimmed = config.trimmed === true;
@@ -1311,10 +1730,16 @@ function appendTaskOptions(options, commands = []) {
1311
1730
  }
1312
1731
  return Object.keys(options).reduce((commands2, key) => {
1313
1732
  const value = options[key];
1314
- if (isPathSpec(value)) {
1733
+ if (r(value)) {
1315
1734
  commands2.push(value);
1316
1735
  } else if (filterPrimitives(value, ["boolean"])) {
1317
1736
  commands2.push(key + "=" + value);
1737
+ } else if (Array.isArray(value)) {
1738
+ for (const v of value) {
1739
+ if (!filterPrimitives(v, ["string", "number"])) {
1740
+ commands2.push(key + "=" + v);
1741
+ }
1742
+ }
1318
1743
  } else {
1319
1744
  commands2.push(key);
1320
1745
  }
@@ -1323,9 +1748,9 @@ function appendTaskOptions(options, commands = []) {
1323
1748
  }
1324
1749
  function getTrailingOptions(args, initialPrimitive = 0, objectOnly = false) {
1325
1750
  const command = [];
1326
- for (let i = 0, max = initialPrimitive < 0 ? args.length : initialPrimitive; i < max; i++) {
1327
- if ("string|number".includes(typeof args[i])) {
1328
- command.push(String(args[i]));
1751
+ for (let i2 = 0, max = initialPrimitive < 0 ? args.length : initialPrimitive; i2 < max; i2++) {
1752
+ if ("string|number".includes(typeof args[i2])) {
1753
+ command.push(String(args[i2]));
1329
1754
  }
1330
1755
  }
1331
1756
  appendTaskOptions(trailingOptionsArgument(args), command);
@@ -1336,7 +1761,7 @@ function getTrailingOptions(args, initialPrimitive = 0, objectOnly = false) {
1336
1761
  }
1337
1762
  function trailingArrayArgument(args) {
1338
1763
  const hasTrailingCallback = typeof last(args) === "function";
1339
- return filterType(last(args, hasTrailingCallback ? 1 : 0), filterArray, []);
1764
+ return asStringArray(filterType(last(args, hasTrailingCallback ? 1 : 0), filterArray, []));
1340
1765
  }
1341
1766
  function trailingOptionsArgument(args) {
1342
1767
  const hasTrailingCallback = filterFunction(last(args));
@@ -1351,7 +1776,6 @@ var init_task_options = __esm({
1351
1776
  "use strict";
1352
1777
  init_argument_filters();
1353
1778
  init_util();
1354
- init_pathspec();
1355
1779
  }
1356
1780
  });
1357
1781
  function callTaskParser(parser4, streams) {
@@ -1359,12 +1783,12 @@ function callTaskParser(parser4, streams) {
1359
1783
  }
1360
1784
  function parseStringResponse(result, parsers12, texts, trim = true) {
1361
1785
  asArray(texts).forEach((text) => {
1362
- for (let lines = toLinesWithContent(text, trim), i = 0, max = lines.length; i < max; i++) {
1786
+ for (let lines = toLinesWithContent(text, trim), i2 = 0, max = lines.length; i2 < max; i2++) {
1363
1787
  const line = (offset = 0) => {
1364
- if (i + offset >= max) {
1788
+ if (i2 + offset >= max) {
1365
1789
  return;
1366
1790
  }
1367
- return lines[i + offset];
1791
+ return lines[i2 + offset];
1368
1792
  };
1369
1793
  parsers12.some(({ parse }) => parse(line, result));
1370
1794
  }
@@ -1399,10 +1823,10 @@ __export(utils_exports, {
1399
1823
  filterArray: () => filterArray,
1400
1824
  filterFunction: () => filterFunction,
1401
1825
  filterHasLength: () => filterHasLength,
1826
+ filterNumber: () => filterNumber,
1402
1827
  filterPlainObject: () => filterPlainObject,
1403
1828
  filterPrimitives: () => filterPrimitives,
1404
1829
  filterString: () => filterString,
1405
- filterStringArray: () => filterStringArray,
1406
1830
  filterStringOrStringArray: () => filterStringOrStringArray,
1407
1831
  filterType: () => filterType,
1408
1832
  first: () => first,
@@ -1725,9 +2149,9 @@ function configFilePath(filePath) {
1725
2149
  }
1726
2150
  function* configParser(text, requestedKey = null) {
1727
2151
  const lines = text.split("\0");
1728
- for (let i = 0, max = lines.length - 1; i < max; ) {
1729
- const file = configFilePath(lines[i++]);
1730
- let value = lines[i++];
2152
+ for (let i2 = 0, max = lines.length - 1; i2 < max; ) {
2153
+ const file = configFilePath(lines[i2++]);
2154
+ let value = lines[i2++];
1731
2155
  let key = requestedKey;
1732
2156
  if (value.includes("\n")) {
1733
2157
  const line = splitOn(value, "\n");
@@ -1765,7 +2189,7 @@ var init_ConfigList = __esm({
1765
2189
  }
1766
2190
  addValue(file, key, value) {
1767
2191
  const values = this.addFile(file);
1768
- if (!values.hasOwnProperty(key)) {
2192
+ if (!Object.hasOwn(values, key)) {
1769
2193
  values[key] = value;
1770
2194
  } else if (Array.isArray(values[key])) {
1771
2195
  values[key].push(value);
@@ -1778,7 +2202,7 @@ var init_ConfigList = __esm({
1778
2202
  }
1779
2203
  });
1780
2204
  function asConfigScope(scope, fallback) {
1781
- if (typeof scope === "string" && GitConfigScope.hasOwnProperty(scope)) {
2205
+ if (typeof scope === "string" && Object.hasOwn(GitConfigScope, scope)) {
1782
2206
  return scope;
1783
2207
  }
1784
2208
  return fallback;
@@ -1999,13 +2423,14 @@ function getResetMode(mode) {
1999
2423
  return;
2000
2424
  }
2001
2425
  function isValidResetMode(mode) {
2002
- return ResetModes.includes(mode);
2426
+ return typeof mode === "string" && validResetModes.includes(mode);
2003
2427
  }
2004
2428
  var ResetMode;
2005
- var ResetModes;
2429
+ var validResetModes;
2006
2430
  var init_reset = __esm({
2007
2431
  "src/lib/tasks/reset.ts"() {
2008
2432
  "use strict";
2433
+ init_utils();
2009
2434
  init_task();
2010
2435
  ResetMode = /* @__PURE__ */ ((ResetMode2) => {
2011
2436
  ResetMode2["MIXED"] = "mixed";
@@ -2015,7 +2440,7 @@ var init_reset = __esm({
2015
2440
  ResetMode2["KEEP"] = "keep";
2016
2441
  return ResetMode2;
2017
2442
  })(ResetMode || {});
2018
- ResetModes = Array.from(Object.values(ResetMode));
2443
+ validResetModes = asStringArray(Object.values(ResetMode));
2019
2444
  }
2020
2445
  });
2021
2446
  function createLog() {
@@ -2082,14 +2507,14 @@ var init_git_logger = __esm({
2082
2507
  };
2083
2508
  }
2084
2509
  });
2085
- var _TasksPendingQueue;
2086
2510
  var TasksPendingQueue;
2087
2511
  var init_tasks_pending_queue = __esm({
2088
2512
  "src/lib/runners/tasks-pending-queue.ts"() {
2089
2513
  "use strict";
2514
+ var _a2;
2090
2515
  init_git_error();
2091
2516
  init_git_logger();
2092
- _TasksPendingQueue = class {
2517
+ TasksPendingQueue = (_a2 = class {
2093
2518
  constructor(logLabel = "GitExecutor") {
2094
2519
  this.logLabel = logLabel;
2095
2520
  this._queue = /* @__PURE__ */ new Map();
@@ -2098,7 +2523,7 @@ var init_tasks_pending_queue = __esm({
2098
2523
  return this._queue.get(task);
2099
2524
  }
2100
2525
  createProgress(task) {
2101
- const name = _TasksPendingQueue.getName(task.commands[0]);
2526
+ const name = _a2.getName(task.commands[0]);
2102
2527
  const logger = createLogger(this.logLabel, name);
2103
2528
  return {
2104
2529
  task,
@@ -2146,11 +2571,9 @@ var init_tasks_pending_queue = __esm({
2146
2571
  return progress;
2147
2572
  }
2148
2573
  static getName(name = "empty") {
2149
- return `task:${name}:${++_TasksPendingQueue.counter}`;
2574
+ return `task:${name}:${++_a2.counter}`;
2150
2575
  }
2151
- };
2152
- TasksPendingQueue = _TasksPendingQueue;
2153
- TasksPendingQueue.counter = 0;
2576
+ }, _a2.counter = 0, _a2);
2154
2577
  }
2155
2578
  });
2156
2579
  function pluginContext(task, commands) {
@@ -2207,20 +2630,18 @@ var init_git_executor_chain = __esm({
2207
2630
  this._queue.push(task);
2208
2631
  return this._chain = this._chain.then(() => this.attemptTask(task));
2209
2632
  }
2210
- attemptTask(task) {
2211
- return __async(this, null, function* () {
2212
- const onScheduleComplete = yield this._scheduler.next();
2213
- const onQueueComplete = () => this._queue.complete(task);
2214
- try {
2215
- const { logger } = this._queue.attempt(task);
2216
- return yield isEmptyTask(task) ? this.attemptEmptyTask(task, logger) : this.attemptRemoteTask(task, logger);
2217
- } catch (e) {
2218
- throw this.onFatalException(task, e);
2219
- } finally {
2220
- onQueueComplete();
2221
- onScheduleComplete();
2222
- }
2223
- });
2633
+ async attemptTask(task) {
2634
+ const onScheduleComplete = await this._scheduler.next();
2635
+ const onQueueComplete = () => this._queue.complete(task);
2636
+ try {
2637
+ const { logger } = this._queue.attempt(task);
2638
+ return await (isEmptyTask(task) ? this.attemptEmptyTask(task, logger) : this.attemptRemoteTask(task, logger));
2639
+ } catch (e) {
2640
+ throw this.onFatalException(task, e);
2641
+ } finally {
2642
+ onQueueComplete();
2643
+ onScheduleComplete();
2644
+ }
2224
2645
  }
2225
2646
  onFatalException(task, e) {
2226
2647
  const gitError = e instanceof GitError ? Object.assign(e, { task }) : new GitError(task, e && String(e));
@@ -2228,34 +2649,29 @@ var init_git_executor_chain = __esm({
2228
2649
  this._queue.fatal(gitError);
2229
2650
  return gitError;
2230
2651
  }
2231
- attemptRemoteTask(task, logger) {
2232
- return __async(this, null, function* () {
2233
- const binary = this._plugins.exec("spawn.binary", "", pluginContext(task, task.commands));
2234
- const args = this._plugins.exec(
2235
- "spawn.args",
2236
- [...task.commands],
2237
- pluginContext(task, task.commands)
2238
- );
2239
- const raw = yield this.gitResponse(
2240
- task,
2241
- binary,
2242
- args,
2243
- this.outputHandler,
2244
- logger.step("SPAWN")
2245
- );
2246
- const outputStreams = yield this.handleTaskData(task, args, raw, logger.step("HANDLE"));
2247
- logger(`passing response to task's parser as a %s`, task.format);
2248
- if (isBufferTask(task)) {
2249
- return callTaskParser(task.parser, outputStreams);
2250
- }
2251
- return callTaskParser(task.parser, outputStreams.asStrings());
2652
+ async attemptRemoteTask(task, logger) {
2653
+ const binary = this._plugins.exec("spawn.binary", "", pluginContext(task, task.commands));
2654
+ const args = this._plugins.exec("spawn.args", [...task.commands], {
2655
+ ...pluginContext(task, task.commands),
2656
+ env: { ...this.env }
2252
2657
  });
2658
+ const raw = await this.gitResponse(
2659
+ task,
2660
+ binary,
2661
+ args,
2662
+ this.outputHandler,
2663
+ logger.step("SPAWN")
2664
+ );
2665
+ const outputStreams = await this.handleTaskData(task, args, raw, logger.step("HANDLE"));
2666
+ logger(`passing response to task's parser as a %s`, task.format);
2667
+ if (isBufferTask(task)) {
2668
+ return callTaskParser(task.parser, outputStreams);
2669
+ }
2670
+ return callTaskParser(task.parser, outputStreams.asStrings());
2253
2671
  }
2254
- attemptEmptyTask(task, logger) {
2255
- return __async(this, null, function* () {
2256
- logger(`empty task bypassing child process to call to task's parser`);
2257
- return task.parser(this);
2258
- });
2672
+ async attemptEmptyTask(task, logger) {
2673
+ logger(`empty task bypassing child process to call to task's parser`);
2674
+ return task.parser(this);
2259
2675
  }
2260
2676
  handleTaskData(task, args, result, logger) {
2261
2677
  const { exitCode, rejection, stdOut, stdErr } = result;
@@ -2264,7 +2680,10 @@ var init_git_executor_chain = __esm({
2264
2680
  const { error } = this._plugins.exec(
2265
2681
  "task.error",
2266
2682
  { error: rejection },
2267
- __spreadValues(__spreadValues({}, pluginContext(task, args)), result)
2683
+ {
2684
+ ...pluginContext(task, args),
2685
+ ...result
2686
+ }
2268
2687
  );
2269
2688
  if (error && task.onError) {
2270
2689
  logger.info(`exitCode=%s handling with custom error handler`);
@@ -2297,79 +2716,80 @@ var init_git_executor_chain = __esm({
2297
2716
  done(new GitOutputStreams(Buffer.concat(stdOut), Buffer.concat(stdErr)));
2298
2717
  });
2299
2718
  }
2300
- gitResponse(task, command, args, outputHandler, logger) {
2301
- return __async(this, null, function* () {
2302
- const outputLogger = logger.sibling("output");
2303
- const spawnOptions = this._plugins.exec(
2304
- "spawn.options",
2305
- {
2306
- cwd: this.cwd,
2307
- env: this.env,
2308
- windowsHide: true
2309
- },
2310
- pluginContext(task, task.commands)
2719
+ async gitResponse(task, command, args, outputHandler, logger) {
2720
+ const outputLogger = logger.sibling("output");
2721
+ const spawnOptions = this._plugins.exec(
2722
+ "spawn.options",
2723
+ {
2724
+ cwd: this.cwd,
2725
+ env: this.env,
2726
+ windowsHide: true
2727
+ },
2728
+ pluginContext(task, task.commands)
2729
+ );
2730
+ return new Promise((done) => {
2731
+ const stdOut = [];
2732
+ const stdErr = [];
2733
+ logger.info(`%s %o`, command, args);
2734
+ logger("%O", spawnOptions);
2735
+ let rejection = this._beforeSpawn(task, args);
2736
+ if (rejection) {
2737
+ return done({
2738
+ stdOut,
2739
+ stdErr,
2740
+ exitCode: 9901,
2741
+ rejection
2742
+ });
2743
+ }
2744
+ this._plugins.exec("spawn.before", void 0, {
2745
+ ...pluginContext(task, args),
2746
+ kill(reason) {
2747
+ rejection = reason || rejection;
2748
+ }
2749
+ });
2750
+ const spawned = spawn(command, args, spawnOptions);
2751
+ spawned.stdout.on(
2752
+ "data",
2753
+ onDataReceived(stdOut, "stdOut", logger, outputLogger.step("stdOut"))
2754
+ );
2755
+ spawned.stderr.on(
2756
+ "data",
2757
+ onDataReceived(stdErr, "stdErr", logger, outputLogger.step("stdErr"))
2311
2758
  );
2312
- return new Promise((done) => {
2313
- const stdOut = [];
2314
- const stdErr = [];
2315
- logger.info(`%s %o`, command, args);
2316
- logger("%O", spawnOptions);
2317
- let rejection = this._beforeSpawn(task, args);
2318
- if (rejection) {
2319
- return done({
2759
+ spawned.on("error", onErrorReceived(stdErr, logger));
2760
+ if (outputHandler) {
2761
+ logger(`Passing child process stdOut/stdErr to custom outputHandler`);
2762
+ outputHandler(command, spawned.stdout, spawned.stderr, [...args]);
2763
+ }
2764
+ this._plugins.exec("spawn.after", void 0, {
2765
+ ...pluginContext(task, args),
2766
+ spawned,
2767
+ close(exitCode, reason) {
2768
+ done({
2320
2769
  stdOut,
2321
2770
  stdErr,
2322
- exitCode: 9901,
2323
- rejection
2771
+ exitCode,
2772
+ rejection: rejection || reason
2324
2773
  });
2325
- }
2326
- this._plugins.exec("spawn.before", void 0, __spreadProps(__spreadValues({}, pluginContext(task, args)), {
2327
- kill(reason) {
2328
- rejection = reason || rejection;
2774
+ },
2775
+ kill(reason) {
2776
+ if (spawned.killed) {
2777
+ return;
2329
2778
  }
2330
- }));
2331
- const spawned = spawn(command, args, spawnOptions);
2332
- spawned.stdout.on(
2333
- "data",
2334
- onDataReceived(stdOut, "stdOut", logger, outputLogger.step("stdOut"))
2335
- );
2336
- spawned.stderr.on(
2337
- "data",
2338
- onDataReceived(stdErr, "stdErr", logger, outputLogger.step("stdErr"))
2339
- );
2340
- spawned.on("error", onErrorReceived(stdErr, logger));
2341
- if (outputHandler) {
2342
- logger(`Passing child process stdOut/stdErr to custom outputHandler`);
2343
- outputHandler(command, spawned.stdout, spawned.stderr, [...args]);
2779
+ rejection = reason;
2780
+ spawned.kill("SIGINT");
2344
2781
  }
2345
- this._plugins.exec("spawn.after", void 0, __spreadProps(__spreadValues({}, pluginContext(task, args)), {
2346
- spawned,
2347
- close(exitCode, reason) {
2348
- done({
2349
- stdOut,
2350
- stdErr,
2351
- exitCode,
2352
- rejection: rejection || reason
2353
- });
2354
- },
2355
- kill(reason) {
2356
- if (spawned.killed) {
2357
- return;
2358
- }
2359
- rejection = reason;
2360
- spawned.kill("SIGINT");
2361
- }
2362
- }));
2363
2782
  });
2364
2783
  });
2365
2784
  }
2366
2785
  _beforeSpawn(task, args) {
2367
2786
  let rejection;
2368
- this._plugins.exec("spawn.before", void 0, __spreadProps(__spreadValues({}, pluginContext(task, args)), {
2787
+ this._plugins.exec("spawn.before", void 0, {
2788
+ ...pluginContext(task, args),
2369
2789
  kill(reason) {
2370
2790
  rejection = reason || rejection;
2371
2791
  }
2372
- }));
2792
+ });
2373
2793
  return rejection;
2374
2794
  }
2375
2795
  };
@@ -2529,7 +2949,7 @@ var init_count_objects = __esm({
2529
2949
  /([a-z-]+): (\d+)$/,
2530
2950
  (result, [key, value]) => {
2531
2951
  const property = asCamelCase(key);
2532
- if (result.hasOwnProperty(property)) {
2952
+ if (Object.hasOwn(result, property)) {
2533
2953
  result[property] = asNumber(value);
2534
2954
  }
2535
2955
  }
@@ -2617,7 +3037,10 @@ function commit_default() {
2617
3037
  const task = rejectDeprecatedSignatures(message) || commitTask(
2618
3038
  asArray(message),
2619
3039
  asArray(filterType(rest[0], filterStringOrStringArray, [])),
2620
- [...filterType(rest[1], filterArray, []), ...getTrailingOptions(arguments, 0, true)]
3040
+ [
3041
+ ...asStringArray(filterType(rest[1], filterArray, [])),
3042
+ ...getTrailingOptions(arguments, 0, true)
3043
+ ]
2621
3044
  );
2622
3045
  return this._runTask(task, next);
2623
3046
  }
@@ -2729,8 +3152,8 @@ var init_init = __esm({
2729
3152
  }
2730
3153
  });
2731
3154
  function logFormatFromCommand(customArgs) {
2732
- for (let i = 0; i < customArgs.length; i++) {
2733
- const format = logFormatRegex.exec(customArgs[i]);
3155
+ for (let i2 = 0; i2 < customArgs.length; i2++) {
3156
+ const format = logFormatRegex.exec(customArgs[i2]);
2734
3157
  if (format) {
2735
3158
  return `--${format[1]}`;
2736
3159
  }
@@ -2858,7 +3281,7 @@ var init_parse_diff_summary = __esm({
2858
3281
  (result, [status, similarity, from, _to, to]) => {
2859
3282
  result.changed++;
2860
3283
  result.files.push({
2861
- file: to != null ? to : from,
3284
+ file: to ?? from,
2862
3285
  changes: 0,
2863
3286
  insertions: 0,
2864
3287
  deletions: 0,
@@ -3000,7 +3423,7 @@ function userOptions(input) {
3000
3423
  }
3001
3424
  function parseLogOptions(opt = {}, customArgs = []) {
3002
3425
  const splitter = filterType(opt.splitter, filterString, SPLITTER);
3003
- const format = !filterPrimitives(opt.format) && opt.format ? opt.format : {
3426
+ const format = filterPlainObject(opt.format) ? opt.format : {
3004
3427
  hash: "%H",
3005
3428
  date: opt.strictDate === false ? "%ai" : "%aI",
3006
3429
  message: "%s",
@@ -3024,7 +3447,7 @@ function parseLogOptions(opt = {}, customArgs = []) {
3024
3447
  suffix.push(`${opt.from || ""}${rangeOperator}${opt.to || ""}`);
3025
3448
  }
3026
3449
  if (filterString(opt.file)) {
3027
- command.push("--follow", pathspec(opt.file));
3450
+ command.push("--follow", c(opt.file));
3028
3451
  }
3029
3452
  appendTaskOptions(userOptions(opt), command);
3030
3453
  return {
@@ -3047,7 +3470,7 @@ function log_default() {
3047
3470
  const next = trailingFunctionArgument(arguments);
3048
3471
  const options = parseLogOptions(
3049
3472
  trailingOptionsArgument(arguments),
3050
- filterType(arguments[0], filterArray)
3473
+ asStringArray(filterType(arguments[0], filterArray, []))
3051
3474
  );
3052
3475
  const task = rejectDeprecatedSignatures(...rest) || validateLogFormatConfig(options.commands) || createLogTask(options);
3053
3476
  return this._runTask(task, next);
@@ -3067,7 +3490,6 @@ var init_log = __esm({
3067
3490
  "src/lib/tasks/log.ts"() {
3068
3491
  "use strict";
3069
3492
  init_log_format();
3070
- init_pathspec();
3071
3493
  init_parse_list_log_summary();
3072
3494
  init_utils();
3073
3495
  init_task();
@@ -3416,9 +3838,10 @@ var init_parse_push = __esm({
3416
3838
  result.repo = repo;
3417
3839
  }),
3418
3840
  new LineParser(/^updating local tracking ref '(.+)'/, (result, [local]) => {
3419
- result.ref = __spreadProps(__spreadValues({}, result.ref || {}), {
3841
+ result.ref = {
3842
+ ...result.ref || {},
3420
3843
  local
3421
- });
3844
+ };
3422
3845
  }),
3423
3846
  new LineParser(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/, (result, [local, remote, type]) => {
3424
3847
  result.pushed.push(pushResultPushedItem(local, remote, type));
@@ -3426,11 +3849,12 @@ var init_parse_push = __esm({
3426
3849
  new LineParser(
3427
3850
  /^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,
3428
3851
  (result, [local, remote, remoteName]) => {
3429
- result.branch = __spreadProps(__spreadValues({}, result.branch || {}), {
3852
+ result.branch = {
3853
+ ...result.branch || {},
3430
3854
  local,
3431
3855
  remote,
3432
3856
  remoteName
3433
- });
3857
+ };
3434
3858
  }
3435
3859
  ),
3436
3860
  new LineParser(
@@ -3452,7 +3876,10 @@ var init_parse_push = __esm({
3452
3876
  parsePushResult = (stdOut, stdErr) => {
3453
3877
  const pushDetail = parsePushDetail(stdOut, stdErr);
3454
3878
  const responseDetail = parseRemoteMessages(stdOut, stdErr);
3455
- return __spreadValues(__spreadValues({}, pushDetail), responseDetail);
3879
+ return {
3880
+ ...pushDetail,
3881
+ ...responseDetail
3882
+ };
3456
3883
  };
3457
3884
  parsePushDetail = (stdOut, stdErr) => {
3458
3885
  return parseStringResponse({ pushed: [] }, parsers5, [stdOut, stdErr]);
@@ -3551,15 +3978,15 @@ function parser3(indexX, indexY, handler) {
3551
3978
  return [`${indexX}${indexY}`, handler];
3552
3979
  }
3553
3980
  function conflicts(indexX, ...indexY) {
3554
- return indexY.map((y) => parser3(indexX, y, (result, file) => append(result.conflicted, file)));
3981
+ return indexY.map((y2) => parser3(indexX, y2, (result, file) => result.conflicted.push(file)));
3555
3982
  }
3556
3983
  function splitLine(result, lineStr) {
3557
3984
  const trimmed2 = lineStr.trim();
3558
3985
  switch (" ") {
3559
3986
  case trimmed2.charAt(2):
3560
- return data(trimmed2.charAt(0), trimmed2.charAt(1), trimmed2.substr(3));
3987
+ return data(trimmed2.charAt(0), trimmed2.charAt(1), trimmed2.slice(3));
3561
3988
  case trimmed2.charAt(1):
3562
- return data(" ", trimmed2.charAt(0), trimmed2.substr(2));
3989
+ return data(" ", trimmed2.charAt(0), trimmed2.slice(2));
3563
3990
  default:
3564
3991
  return;
3565
3992
  }
@@ -3607,58 +4034,54 @@ var init_StatusSummary = __esm({
3607
4034
  parser3(
3608
4035
  " ",
3609
4036
  "A",
3610
- (result, file) => append(result.created, file)
4037
+ (result, file) => result.created.push(file)
3611
4038
  ),
3612
4039
  parser3(
3613
4040
  " ",
3614
4041
  "D",
3615
- (result, file) => append(result.deleted, file)
3616
- ),
3617
- parser3(
3618
- " ",
3619
- "M",
3620
- (result, file) => append(result.modified, file)
4042
+ (result, file) => result.deleted.push(file)
3621
4043
  ),
3622
4044
  parser3(
3623
- "A",
3624
4045
  " ",
3625
- (result, file) => append(result.created, file) && append(result.staged, file)
3626
- ),
3627
- parser3(
3628
- "A",
3629
- "M",
3630
- (result, file) => append(result.created, file) && append(result.staged, file) && append(result.modified, file)
3631
- ),
3632
- parser3(
3633
- "D",
3634
- " ",
3635
- (result, file) => append(result.deleted, file) && append(result.staged, file)
3636
- ),
3637
- parser3(
3638
- "M",
3639
- " ",
3640
- (result, file) => append(result.modified, file) && append(result.staged, file)
3641
- ),
3642
- parser3(
3643
- "M",
3644
4046
  "M",
3645
- (result, file) => append(result.modified, file) && append(result.staged, file)
4047
+ (result, file) => result.modified.push(file)
3646
4048
  ),
4049
+ parser3("A", " ", (result, file) => {
4050
+ result.created.push(file);
4051
+ result.staged.push(file);
4052
+ }),
4053
+ parser3("A", "M", (result, file) => {
4054
+ result.created.push(file);
4055
+ result.staged.push(file);
4056
+ result.modified.push(file);
4057
+ }),
4058
+ parser3("D", " ", (result, file) => {
4059
+ result.deleted.push(file);
4060
+ result.staged.push(file);
4061
+ }),
4062
+ parser3("M", " ", (result, file) => {
4063
+ result.modified.push(file);
4064
+ result.staged.push(file);
4065
+ }),
4066
+ parser3("M", "M", (result, file) => {
4067
+ result.modified.push(file);
4068
+ result.staged.push(file);
4069
+ }),
3647
4070
  parser3("R", " ", (result, file) => {
3648
- append(result.renamed, renamedFile(file));
4071
+ result.renamed.push(renamedFile(file));
3649
4072
  }),
3650
4073
  parser3("R", "M", (result, file) => {
3651
4074
  const renamed = renamedFile(file);
3652
- append(result.renamed, renamed);
3653
- append(result.modified, renamed.to);
4075
+ result.renamed.push(renamed);
4076
+ result.modified.push(renamed.to);
3654
4077
  }),
3655
4078
  parser3("!", "!", (_result, _file) => {
3656
- append(_result.ignored = _result.ignored || [], _file);
4079
+ (_result.ignored = _result.ignored || []).push(_file);
3657
4080
  }),
3658
4081
  parser3(
3659
4082
  "?",
3660
4083
  "?",
3661
- (result, file) => append(result.not_added, file)
4084
+ (result, file) => result.not_added.push(file)
3662
4085
  ),
3663
4086
  ...conflicts(
3664
4087
  "A",
@@ -3686,18 +4109,19 @@ var init_StatusSummary = __esm({
3686
4109
  const behindReg = /behind (\d+)/;
3687
4110
  const currentReg = /^(.+?(?=(?:\.{3}|\s|$)))/;
3688
4111
  const trackingReg = /\.{3}(\S*)/;
3689
- const onEmptyBranchReg = /\son\s([\S]+)$/;
3690
- let regexResult;
3691
- regexResult = aheadReg.exec(line);
4112
+ const onEmptyBranchReg = /\son\s(\S+?)(?=\.{3}|$)/;
4113
+ let regexResult = aheadReg.exec(line);
3692
4114
  result.ahead = regexResult && +regexResult[1] || 0;
3693
4115
  regexResult = behindReg.exec(line);
3694
4116
  result.behind = regexResult && +regexResult[1] || 0;
3695
4117
  regexResult = currentReg.exec(line);
3696
- result.current = regexResult && regexResult[1];
4118
+ result.current = filterType(regexResult == null ? void 0 : regexResult[1], filterString, null);
3697
4119
  regexResult = trackingReg.exec(line);
3698
- result.tracking = regexResult && regexResult[1];
4120
+ result.tracking = filterType(regexResult == null ? void 0 : regexResult[1], filterString, null);
3699
4121
  regexResult = onEmptyBranchReg.exec(line);
3700
- result.current = regexResult && regexResult[1] || result.current;
4122
+ if (regexResult) {
4123
+ result.current = filterType(regexResult == null ? void 0 : regexResult[1], filterString, result.current);
4124
+ }
3701
4125
  result.detached = /\(no branch\)/.test(line);
3702
4126
  }
3703
4127
  ]
@@ -3705,13 +4129,13 @@ var init_StatusSummary = __esm({
3705
4129
  parseStatusSummary = function(text) {
3706
4130
  const lines = text.split(NULL);
3707
4131
  const status = new StatusSummary();
3708
- for (let i = 0, l = lines.length; i < l; ) {
3709
- let line = lines[i++].trim();
4132
+ for (let i2 = 0, l = lines.length; i2 < l; ) {
4133
+ let line = lines[i2++].trim();
3710
4134
  if (!line) {
3711
4135
  continue;
3712
4136
  }
3713
4137
  if (line.charAt(0) === "R") {
3714
- line += NULL + (lines[i++] || "");
4138
+ line += NULL + (lines[i2++] || "");
3715
4139
  }
3716
4140
  splitLine(status, line);
3717
4141
  }
@@ -3815,6 +4239,47 @@ var init_version = __esm({
3815
4239
  ];
3816
4240
  }
3817
4241
  });
4242
+ function createCloneTask(api, task, repoPath, ...args) {
4243
+ if (!filterString(repoPath)) {
4244
+ return configurationErrorTask(`git.${api}() requires a string 'repoPath'`);
4245
+ }
4246
+ return task(repoPath, filterType(args[0], filterString), getTrailingOptions(arguments));
4247
+ }
4248
+ function clone_default() {
4249
+ return {
4250
+ clone(repo, ...rest) {
4251
+ return this._runTask(
4252
+ createCloneTask("clone", cloneTask, filterType(repo, filterString), ...rest),
4253
+ trailingFunctionArgument(arguments)
4254
+ );
4255
+ },
4256
+ mirror(repo, ...rest) {
4257
+ return this._runTask(
4258
+ createCloneTask("mirror", cloneMirrorTask, filterType(repo, filterString), ...rest),
4259
+ trailingFunctionArgument(arguments)
4260
+ );
4261
+ }
4262
+ };
4263
+ }
4264
+ var cloneTask;
4265
+ var cloneMirrorTask;
4266
+ var init_clone = __esm({
4267
+ "src/lib/tasks/clone.ts"() {
4268
+ "use strict";
4269
+ init_task();
4270
+ init_utils();
4271
+ cloneTask = (repo, directory, customArgs) => {
4272
+ const commands = ["clone", ...customArgs];
4273
+ filterString(repo) && commands.push(c(repo));
4274
+ filterString(directory) && commands.push(c(directory));
4275
+ return straightThroughStringTask(commands);
4276
+ };
4277
+ cloneMirrorTask = (repo, directory, customArgs) => {
4278
+ append(customArgs, "--mirror");
4279
+ return cloneTask(repo, directory, customArgs);
4280
+ };
4281
+ }
4282
+ });
3818
4283
  var simple_git_api_exports = {};
3819
4284
  __export(simple_git_api_exports, {
3820
4285
  SimpleGitApi: () => SimpleGitApi
@@ -3841,6 +4306,7 @@ var init_simple_git_api = __esm({
3841
4306
  init_task();
3842
4307
  init_version();
3843
4308
  init_utils();
4309
+ init_clone();
3844
4310
  SimpleGitApi = class {
3845
4311
  constructor(_executor) {
3846
4312
  this._executor = _executor;
@@ -3943,6 +4409,7 @@ var init_simple_git_api = __esm({
3943
4409
  Object.assign(
3944
4410
  SimpleGitApi.prototype,
3945
4411
  checkout_default(),
4412
+ clone_default(),
3946
4413
  commit_default(),
3947
4414
  config_default(),
3948
4415
  count_objects_default(),
@@ -4118,10 +4585,15 @@ var init_BranchSummary = __esm({
4118
4585
  function branchStatus(input) {
4119
4586
  return input ? input.charAt(0) : "";
4120
4587
  }
4121
- function parseBranchSummary(stdOut) {
4122
- return parseStringResponse(new BranchSummaryResult(), parsers9, stdOut);
4588
+ function parseBranchSummary(stdOut, currentOnly = false) {
4589
+ return parseStringResponse(
4590
+ new BranchSummaryResult(),
4591
+ currentOnly ? [currentBranchParser] : parsers9,
4592
+ stdOut
4593
+ );
4123
4594
  }
4124
4595
  var parsers9;
4596
+ var currentBranchParser;
4125
4597
  var init_parse_branch = __esm({
4126
4598
  "src/lib/parsers/parse-branch.ts"() {
4127
4599
  "use strict";
@@ -4135,12 +4607,15 @@ var init_parse_branch = __esm({
4135
4607
  }
4136
4608
  ),
4137
4609
  new LineParser(
4138
- new RegExp("^([*+]\\s)?(\\S+)\\s+([a-z0-9]+)\\s?(.*)$", "s"),
4610
+ /^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,
4139
4611
  (result, [current, name, commit, label]) => {
4140
4612
  result.push(branchStatus(current), false, name, commit, label);
4141
4613
  }
4142
4614
  )
4143
4615
  ];
4616
+ currentBranchParser = new LineParser(/^(\S+)$/s, (result, [name]) => {
4617
+ result.push("*", false, name, "", "");
4618
+ });
4144
4619
  }
4145
4620
  });
4146
4621
  var branch_exports = {};
@@ -4157,6 +4632,7 @@ function containsDeleteBranchCommand(commands) {
4157
4632
  }
4158
4633
  function branchTask(customArgs) {
4159
4634
  const isDelete = containsDeleteBranchCommand(customArgs);
4635
+ const isCurrentOnly = customArgs.includes("--show-current");
4160
4636
  const commands = ["branch", ...customArgs];
4161
4637
  if (commands.length === 1) {
4162
4638
  commands.push("-a");
@@ -4171,16 +4647,17 @@ function branchTask(customArgs) {
4171
4647
  if (isDelete) {
4172
4648
  return parseBranchDeletions(stdOut, stdErr).all[0];
4173
4649
  }
4174
- return parseBranchSummary(stdOut);
4650
+ return parseBranchSummary(stdOut, isCurrentOnly);
4175
4651
  }
4176
4652
  };
4177
4653
  }
4178
4654
  function branchLocalTask() {
4179
- const parser4 = parseBranchSummary;
4180
4655
  return {
4181
4656
  format: "utf-8",
4182
4657
  commands: ["branch", "-v"],
4183
- parser: parser4
4658
+ parser(stdOut) {
4659
+ return parseBranchSummary(stdOut);
4660
+ }
4184
4661
  };
4185
4662
  }
4186
4663
  function deleteBranchesTask(branches, forceDelete = false) {
@@ -4205,7 +4682,7 @@ function deleteBranchTask(branch, forceDelete = false) {
4205
4682
  parser(stdOut, stdErr) {
4206
4683
  return parseBranchDeletions(stdOut, stdErr).branches[branch];
4207
4684
  },
4208
- onError({ exitCode, stdErr, stdOut }, error, _, fail) {
4685
+ onError({ exitCode, stdErr, stdOut }, error, _2, fail) {
4209
4686
  if (!hasBranchDeletionError(String(error), exitCode)) {
4210
4687
  return fail(error);
4211
4688
  }
@@ -4226,12 +4703,16 @@ var init_branch = __esm({
4226
4703
  init_utils();
4227
4704
  }
4228
4705
  });
4706
+ function toPath(input) {
4707
+ const path2 = input.trim().replace(/^["']|["']$/g, "");
4708
+ return path2 && normalize(path2);
4709
+ }
4229
4710
  var parseCheckIgnore;
4230
4711
  var init_CheckIgnore = __esm({
4231
4712
  "src/lib/responses/CheckIgnore.ts"() {
4232
4713
  "use strict";
4233
4714
  parseCheckIgnore = (text) => {
4234
- return text.split(/\n/g).map((line) => line.trim()).filter((file) => !!file);
4715
+ return text.split(/\n/g).map(toPath).filter(Boolean);
4235
4716
  };
4236
4717
  }
4237
4718
  });
@@ -4252,35 +4733,6 @@ var init_check_ignore = __esm({
4252
4733
  init_CheckIgnore();
4253
4734
  }
4254
4735
  });
4255
- var clone_exports = {};
4256
- __export(clone_exports, {
4257
- cloneMirrorTask: () => cloneMirrorTask,
4258
- cloneTask: () => cloneTask
4259
- });
4260
- function disallowedCommand(command) {
4261
- return /^--upload-pack(=|$)/.test(command);
4262
- }
4263
- function cloneTask(repo, directory, customArgs) {
4264
- const commands = ["clone", ...customArgs];
4265
- filterString(repo) && commands.push(repo);
4266
- filterString(directory) && commands.push(directory);
4267
- const banned = commands.find(disallowedCommand);
4268
- if (banned) {
4269
- return configurationErrorTask(`git.fetch: potential exploit argument blocked.`);
4270
- }
4271
- return straightThroughStringTask(commands);
4272
- }
4273
- function cloneMirrorTask(repo, directory, customArgs) {
4274
- append(customArgs, "--mirror");
4275
- return cloneTask(repo, directory, customArgs);
4276
- }
4277
- var init_clone = __esm({
4278
- "src/lib/tasks/clone.ts"() {
4279
- "use strict";
4280
- init_task();
4281
- init_utils();
4282
- }
4283
- });
4284
4736
  function parseFetchResult(stdOut, stdErr) {
4285
4737
  const result = {
4286
4738
  raw: stdOut,
@@ -4336,7 +4788,7 @@ var fetch_exports = {};
4336
4788
  __export(fetch_exports, {
4337
4789
  fetchTask: () => fetchTask
4338
4790
  });
4339
- function disallowedCommand2(command) {
4791
+ function disallowedCommand(command) {
4340
4792
  return /^--upload-pack(=|$)/.test(command);
4341
4793
  }
4342
4794
  function fetchTask(remote, branch, customArgs) {
@@ -4344,7 +4796,7 @@ function fetchTask(remote, branch, customArgs) {
4344
4796
  if (remote && branch) {
4345
4797
  commands.push(remote, branch);
4346
4798
  }
4347
- const banned = commands.find(disallowedCommand2);
4799
+ const banned = commands.find(disallowedCommand);
4348
4800
  if (banned) {
4349
4801
  return configurationErrorTask(`git.fetch: potential exploit argument blocked.`);
4350
4802
  }
@@ -4437,7 +4889,7 @@ function parseGetRemotes(text) {
4437
4889
  function parseGetRemotesVerbose(text) {
4438
4890
  const remotes = {};
4439
4891
  forEach(text, ([name, url, purpose]) => {
4440
- if (!remotes.hasOwnProperty(name)) {
4892
+ if (!Object.hasOwn(remotes, name)) {
4441
4893
  remotes[name] = {
4442
4894
  name,
4443
4895
  refs: { fetch: "", push: "" }
@@ -4560,16 +5012,16 @@ var init_sub_module = __esm({
4560
5012
  init_task();
4561
5013
  }
4562
5014
  });
4563
- function singleSorted(a, b) {
4564
- const aIsNum = isNaN(a);
4565
- const bIsNum = isNaN(b);
5015
+ function singleSorted(a, b2) {
5016
+ const aIsNum = Number.isNaN(a);
5017
+ const bIsNum = Number.isNaN(b2);
4566
5018
  if (aIsNum !== bIsNum) {
4567
5019
  return aIsNum ? 1 : -1;
4568
5020
  }
4569
- return aIsNum ? sorted(a, b) : 0;
5021
+ return aIsNum ? sorted(a, b2) : 0;
4570
5022
  }
4571
- function sorted(a, b) {
4572
- return a === b ? 0 : a > b ? 1 : -1;
5023
+ function sorted(a, b2) {
5024
+ return a === b2 ? 0 : a > b2 ? 1 : -1;
4573
5025
  }
4574
5026
  function trimmed(input) {
4575
5027
  return input.trim();
@@ -4600,8 +5052,8 @@ var init_TagList = __esm({
4600
5052
  if (partsA.length === 1 || partsB.length === 1) {
4601
5053
  return singleSorted(toNumber(partsA[0]), toNumber(partsB[0]));
4602
5054
  }
4603
- for (let i = 0, l = Math.max(partsA.length, partsB.length); i < l; i++) {
4604
- const diff = sorted(toNumber(partsA[i]), toNumber(partsB[i]));
5055
+ for (let i2 = 0, l = Math.max(partsA.length, partsB.length); i2 < l; i2++) {
5056
+ const diff = sorted(toNumber(partsA[i2]), toNumber(partsB[i2]));
4605
5057
  if (diff) {
4606
5058
  return diff;
4607
5059
  }
@@ -4660,7 +5112,7 @@ var require_git = __commonJS2({
4660
5112
  var { GitExecutor: GitExecutor2 } = (init_git_executor(), __toCommonJS(git_executor_exports));
4661
5113
  var { SimpleGitApi: SimpleGitApi2 } = (init_simple_git_api(), __toCommonJS(simple_git_api_exports));
4662
5114
  var { Scheduler: Scheduler2 } = (init_scheduler(), __toCommonJS(scheduler_exports));
4663
- var { configurationErrorTask: configurationErrorTask2 } = (init_task(), __toCommonJS(task_exports));
5115
+ var { adhocExecTask: adhocExecTask2, configurationErrorTask: configurationErrorTask2 } = (init_task(), __toCommonJS(task_exports));
4664
5116
  var {
4665
5117
  asArray: asArray2,
4666
5118
  filterArray: filterArray2,
@@ -4681,7 +5133,6 @@ var require_git = __commonJS2({
4681
5133
  } = (init_branch(), __toCommonJS(branch_exports));
4682
5134
  var { checkIgnoreTask: checkIgnoreTask2 } = (init_check_ignore(), __toCommonJS(check_ignore_exports));
4683
5135
  var { checkIsRepoTask: checkIsRepoTask2 } = (init_check_is_repo(), __toCommonJS(check_is_repo_exports));
4684
- var { cloneTask: cloneTask2, cloneMirrorTask: cloneMirrorTask2 } = (init_clone(), __toCommonJS(clone_exports));
4685
5136
  var { cleanWithOptionsTask: cleanWithOptionsTask2, isCleanOptionsArray: isCleanOptionsArray2 } = (init_clean(), __toCommonJS(clean_exports));
4686
5137
  var { diffSummaryTask: diffSummaryTask2 } = (init_diff(), __toCommonJS(diff_exports));
4687
5138
  var { fetchTask: fetchTask2 } = (init_fetch(), __toCommonJS(fetch_exports));
@@ -4736,24 +5187,6 @@ var require_git = __commonJS2({
4736
5187
  trailingFunctionArgument2(arguments)
4737
5188
  );
4738
5189
  };
4739
- function createCloneTask(api, task, repoPath, localPath) {
4740
- if (typeof repoPath !== "string") {
4741
- return configurationErrorTask2(`git.${api}() requires a string 'repoPath'`);
4742
- }
4743
- return task(repoPath, filterType2(localPath, filterString2), getTrailingOptions2(arguments));
4744
- }
4745
- Git2.prototype.clone = function() {
4746
- return this._runTask(
4747
- createCloneTask("clone", cloneTask2, ...arguments),
4748
- trailingFunctionArgument2(arguments)
4749
- );
4750
- };
4751
- Git2.prototype.mirror = function() {
4752
- return this._runTask(
4753
- createCloneTask("mirror", cloneMirrorTask2, ...arguments),
4754
- trailingFunctionArgument2(arguments)
4755
- );
4756
- };
4757
5190
  Git2.prototype.mv = function(from, to) {
4758
5191
  return this._runTask(moveTask2(from, to), trailingFunctionArgument2(arguments));
4759
5192
  };
@@ -4786,10 +5219,13 @@ var require_git = __commonJS2({
4786
5219
  );
4787
5220
  };
4788
5221
  Git2.prototype.silent = function(silence) {
4789
- console.warn(
4790
- "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"
5222
+ return this._runTask(
5223
+ adhocExecTask2(
5224
+ () => console.warn(
5225
+ "simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed."
5226
+ )
5227
+ )
4791
5228
  );
4792
- return this;
4793
5229
  };
4794
5230
  Git2.prototype.tags = function(options, then) {
4795
5231
  return this._runTask(
@@ -4853,9 +5289,9 @@ var require_git = __commonJS2({
4853
5289
  Git2.prototype.raw = function(commands) {
4854
5290
  const createRestCommands = !Array.isArray(commands);
4855
5291
  const command = [].slice.call(createRestCommands ? arguments : commands, 0);
4856
- for (let i = 0; i < command.length && createRestCommands; i++) {
4857
- if (!filterPrimitives2(command[i])) {
4858
- command.splice(i, command.length - i);
5292
+ for (let i2 = 0; i2 < command.length && createRestCommands; i2++) {
5293
+ if (!filterPrimitives2(command[i2])) {
5294
+ command.splice(i2, command.length - i2);
4859
5295
  break;
4860
5296
  }
4861
5297
  }
@@ -5015,7 +5451,13 @@ var require_git = __commonJS2({
5015
5451
  return this._runTask(task);
5016
5452
  };
5017
5453
  Git2.prototype.clearQueue = function() {
5018
- return this;
5454
+ return this._runTask(
5455
+ adhocExecTask2(
5456
+ () => console.warn(
5457
+ "simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead."
5458
+ )
5459
+ )
5460
+ );
5019
5461
  };
5020
5462
  Git2.prototype.checkIgnore = function(pathnames, then) {
5021
5463
  return this._runTask(
@@ -5032,7 +5474,6 @@ var require_git = __commonJS2({
5032
5474
  module.exports = Git2;
5033
5475
  }
5034
5476
  });
5035
- init_pathspec();
5036
5477
  init_git_error();
5037
5478
  var GitConstructError = class extends GitError {
5038
5479
  constructor(config, message) {
@@ -5082,57 +5523,15 @@ function abortPlugin(signal) {
5082
5523
  };
5083
5524
  return [onSpawnBefore, onSpawnAfter];
5084
5525
  }
5085
- function isConfigSwitch(arg) {
5086
- return typeof arg === "string" && arg.trim().toLowerCase() === "-c";
5087
- }
5088
- function preventProtocolOverride(arg, next) {
5089
- if (!isConfigSwitch(arg)) {
5090
- return;
5091
- }
5092
- if (!/^\s*protocol(.[a-z]+)?.allow/.test(next)) {
5093
- return;
5094
- }
5095
- throw new GitPluginError(
5096
- void 0,
5097
- "unsafe",
5098
- "Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol"
5099
- );
5100
- }
5101
- function preventUploadPack(arg, method) {
5102
- if (/^\s*--(upload|receive)-pack/.test(arg)) {
5103
- throw new GitPluginError(
5104
- void 0,
5105
- "unsafe",
5106
- `Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack`
5107
- );
5108
- }
5109
- if (method === "clone" && /^\s*-u\b/.test(arg)) {
5110
- throw new GitPluginError(
5111
- void 0,
5112
- "unsafe",
5113
- `Use of clone with option -u is not permitted without enabling allowUnsafePack`
5114
- );
5115
- }
5116
- if (method === "push" && /^\s*--exec\b/.test(arg)) {
5117
- throw new GitPluginError(
5118
- void 0,
5119
- "unsafe",
5120
- `Use of push with option --exec is not permitted without enabling allowUnsafePack`
5121
- );
5122
- }
5123
- }
5124
- function blockUnsafeOperationsPlugin({
5125
- allowUnsafeProtocolOverride = false,
5126
- allowUnsafePack = false
5127
- } = {}) {
5526
+ function blockUnsafeOperationsPlugin(options = {}) {
5128
5527
  return {
5129
5528
  type: "spawn.args",
5130
- action(args, context) {
5131
- args.forEach((current, index) => {
5132
- const next = index < args.length ? args[index + 1] : "";
5133
- allowUnsafeProtocolOverride || preventProtocolOverride(current, next);
5134
- allowUnsafePack || preventUploadPack(current, context.method);
5135
- });
5529
+ action(args, { env }) {
5530
+ for (const vulnerability of ne(args, env)) {
5531
+ if (options[vulnerability.category] !== true) {
5532
+ throw new GitPluginError(void 0, "unsafe", vulnerability.message);
5533
+ }
5534
+ }
5136
5535
  return args;
5137
5536
  }
5138
5537
  };
@@ -5190,27 +5589,25 @@ function completionDetectionPlugin({
5190
5589
  }
5191
5590
  return {
5192
5591
  type: "spawn.after",
5193
- action(_0, _1) {
5194
- return __async(this, arguments, function* (_data, { spawned, close }) {
5195
- var _a3, _b;
5196
- const events = createEvents();
5197
- let deferClose = true;
5198
- let quickClose = () => void (deferClose = false);
5199
- (_a3 = spawned.stdout) == null ? void 0 : _a3.on("data", quickClose);
5200
- (_b = spawned.stderr) == null ? void 0 : _b.on("data", quickClose);
5201
- spawned.on("error", quickClose);
5202
- spawned.on("close", (code) => events.close(code));
5203
- spawned.on("exit", (code) => events.exit(code));
5204
- try {
5205
- yield events.result;
5206
- if (deferClose) {
5207
- yield delay(50);
5208
- }
5209
- close(events.exitCode);
5210
- } catch (err) {
5211
- close(events.exitCode, err);
5592
+ async action(_data, { spawned, close }) {
5593
+ var _a2, _b;
5594
+ const events = createEvents();
5595
+ let deferClose = true;
5596
+ let quickClose = () => void (deferClose = false);
5597
+ (_a2 = spawned.stdout) == null ? void 0 : _a2.on("data", quickClose);
5598
+ (_b = spawned.stderr) == null ? void 0 : _b.on("data", quickClose);
5599
+ spawned.on("error", quickClose);
5600
+ spawned.on("close", (code) => events.close(code));
5601
+ spawned.on("exit", (code) => events.exit(code));
5602
+ try {
5603
+ await events.result;
5604
+ if (deferClose) {
5605
+ await delay(50);
5212
5606
  }
5213
- });
5607
+ close(events.exitCode);
5608
+ } catch (err) {
5609
+ close(events.exitCode, err);
5610
+ }
5214
5611
  }
5215
5612
  };
5216
5613
  }
@@ -5218,7 +5615,7 @@ init_utils();
5218
5615
  var WRONG_NUMBER_ERR = `Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings`;
5219
5616
  var WRONG_CHARS_ERR = `Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option`;
5220
5617
  function isBadArgument(arg) {
5221
- return !arg || !/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(arg);
5618
+ return !arg || !/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(arg);
5222
5619
  }
5223
5620
  function toBinaryConfig(input, allowUnsafe) {
5224
5621
  if (input.length < 1 || input.length > 2) {
@@ -5363,7 +5760,7 @@ function spawnOptionsPlugin(spawnOptions) {
5363
5760
  return {
5364
5761
  type: "spawn.options",
5365
5762
  action(data) {
5366
- return __spreadValues(__spreadValues({}, options), data);
5763
+ return { ...options, ...data };
5367
5764
  }
5368
5765
  };
5369
5766
  }
@@ -5403,7 +5800,6 @@ function timeoutPlugin({
5403
5800
  };
5404
5801
  }
5405
5802
  }
5406
- init_pathspec();
5407
5803
  function suffixPathsPlugin() {
5408
5804
  return {
5409
5805
  type: "spawn.args",
@@ -5413,15 +5809,15 @@ function suffixPathsPlugin() {
5413
5809
  function append2(args) {
5414
5810
  (suffix = suffix || []).push(...args);
5415
5811
  }
5416
- for (let i = 0; i < data.length; i++) {
5417
- const param = data[i];
5418
- if (isPathSpec(param)) {
5419
- append2(toPaths(param));
5812
+ for (let i2 = 0; i2 < data.length; i2++) {
5813
+ const param = data[i2];
5814
+ if (r(param)) {
5815
+ append2(o(param));
5420
5816
  continue;
5421
5817
  }
5422
5818
  if (param === "--") {
5423
5819
  append2(
5424
- data.slice(i + 1).flatMap((item) => isPathSpec(item) && toPaths(item) || item)
5820
+ data.slice(i2 + 1).flatMap((item) => r(item) && o(item) || item)
5425
5821
  );
5426
5822
  break;
5427
5823
  }
@@ -5450,12 +5846,12 @@ function gitInstanceFactory(baseDir, options) {
5450
5846
  plugins.add(commandConfigPrefixingPlugin(config.config));
5451
5847
  }
5452
5848
  plugins.add(blockUnsafeOperationsPlugin(config.unsafe));
5453
- plugins.add(suffixPathsPlugin());
5454
5849
  plugins.add(completionDetectionPlugin(config.completion));
5455
5850
  config.abort && plugins.add(abortPlugin(config.abort));
5456
5851
  config.progress && plugins.add(progressMonitorPlugin(config.progress));
5457
5852
  config.timeout && plugins.add(timeoutPlugin(config.timeout));
5458
5853
  config.spawnOptions && plugins.add(spawnOptionsPlugin(config.spawnOptions));
5854
+ plugins.add(suffixPathsPlugin());
5459
5855
  plugins.add(errorDetectionPlugin(errorDetectionHandler(true)));
5460
5856
  config.errors && plugins.add(errorDetectionPlugin(config.errors));
5461
5857
  customBinaryPlugin(plugins, config.binary, (_a2 = config.unsafe) == null ? void 0 : _a2.allowUnsafeCustomBinary);
@@ -5467,12 +5863,13 @@ var simpleGit = gitInstanceFactory;
5467
5863
  // ../reporter-core/dist/index.js
5468
5864
  import { createHash } from "crypto";
5469
5865
  import fs from "fs";
5866
+ import os from "os";
5470
5867
  import fs3 from "fs";
5471
- var __require2 = /* @__PURE__ */ ((x) => typeof __require !== "undefined" ? __require : typeof Proxy !== "undefined" ? new Proxy(x, {
5472
- get: (a, b) => (typeof __require !== "undefined" ? __require : a)[b]
5473
- }) : x)(function(x) {
5868
+ var __require2 = /* @__PURE__ */ ((x2) => typeof __require !== "undefined" ? __require : typeof Proxy !== "undefined" ? new Proxy(x2, {
5869
+ get: (a, b2) => (typeof __require !== "undefined" ? __require : a)[b2]
5870
+ }) : x2)(function(x2) {
5474
5871
  if (typeof __require !== "undefined") return __require.apply(this, arguments);
5475
- throw Error('Dynamic require of "' + x + '" is not supported');
5872
+ throw Error('Dynamic require of "' + x2 + '" is not supported');
5476
5873
  });
5477
5874
  var _fetch = typeof globalThis.fetch !== "undefined" ? globalThis.fetch : __require2("node-fetch");
5478
5875
  var _AbortController = typeof globalThis.AbortController !== "undefined" ? globalThis.AbortController : __require2("abort-controller").AbortController;
@@ -5549,8 +5946,8 @@ var SupatestApiClient = class {
5549
5946
  if (this.options.dryRun) {
5550
5947
  this.logPayload(`POST /v1/runs/${runId}/attachments/sign`, data);
5551
5948
  return {
5552
- uploads: data.attachments.map((att, i) => ({
5553
- attachmentId: `mock_att_${i}_${Date.now()}`,
5949
+ uploads: data.attachments.map((att, i2) => ({
5950
+ attachmentId: `mock_att_${i2}_${Date.now()}`,
5554
5951
  signedUrl: `https://mock-s3.example.com/uploads/${att.filename}`,
5555
5952
  expiresAt: new Date(Date.now() + 15 * 60 * 1e3).toISOString()
5556
5953
  }))
@@ -5578,12 +5975,16 @@ var SupatestApiClient = class {
5578
5975
  this.options.timeoutMs
5579
5976
  );
5580
5977
  try {
5978
+ const headers = {
5979
+ "Content-Type": "application/json",
5980
+ Authorization: `Bearer ${this.options.apiKey}`
5981
+ };
5982
+ if (this.options.projectId) {
5983
+ headers["X-Project-Id"] = this.options.projectId;
5984
+ }
5581
5985
  const response = await _fetch(url, {
5582
5986
  method,
5583
- headers: {
5584
- "Content-Type": "application/json",
5585
- Authorization: `Bearer ${this.options.apiKey}`
5586
- },
5987
+ headers,
5587
5988
  body: body ? JSON.stringify(body) : void 0,
5588
5989
  signal: controller.signal
5589
5990
  });
@@ -5607,6 +6008,10 @@ var SupatestApiClient = class {
5607
6008
  console.log(JSON.stringify(data, null, 2));
5608
6009
  }
5609
6010
  };
6011
+ var DEFAULT_API_URL = "https://code-api.supatest.ai";
6012
+ var DEFAULT_MAX_CONCURRENT_UPLOADS = 5;
6013
+ var DEFAULT_RETRY_ATTEMPTS = 3;
6014
+ var DEFAULT_TIMEOUT_MS = 3e4;
5610
6015
  var ErrorCollector = class {
5611
6016
  errors = [];
5612
6017
  recordError(category, message, context) {
@@ -5772,6 +6177,31 @@ async function getLocalGitInfo(rootDir) {
5772
6177
  return {};
5773
6178
  }
5774
6179
  }
6180
+ async function getGitInfoWithCI(rootDir) {
6181
+ const ciGitInfo = {
6182
+ 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,
6183
+ commit: process.env.GITHUB_SHA ?? process.env.CI_COMMIT_SHA ?? process.env.GITLAB_CI_COMMIT_SHA ?? process.env.GIT_COMMIT,
6184
+ commitMessage: process.env.CI_COMMIT_MESSAGE ?? process.env.GITLAB_CI_COMMIT_MESSAGE,
6185
+ repo: process.env.GITHUB_REPOSITORY ?? process.env.CI_PROJECT_PATH ?? process.env.GITLAB_CI_PROJECT_PATH ?? process.env.GIT_REPO,
6186
+ author: process.env.GITHUB_ACTOR ?? process.env.GITLAB_USER_NAME,
6187
+ authorEmail: process.env.GITLAB_USER_EMAIL,
6188
+ tag: process.env.GITHUB_REF_TYPE === "tag" ? process.env.GITHUB_REF_NAME : void 0
6189
+ };
6190
+ if (ciGitInfo.branch || ciGitInfo.commit) {
6191
+ return ciGitInfo;
6192
+ }
6193
+ const localGitInfo = await getLocalGitInfo(rootDir);
6194
+ return {
6195
+ branch: ciGitInfo.branch ?? localGitInfo.branch,
6196
+ commit: ciGitInfo.commit ?? localGitInfo.commit,
6197
+ commitMessage: ciGitInfo.commitMessage ?? localGitInfo.commitMessage,
6198
+ repo: ciGitInfo.repo ?? localGitInfo.repo,
6199
+ author: ciGitInfo.author ?? localGitInfo.author,
6200
+ authorEmail: ciGitInfo.authorEmail ?? localGitInfo.authorEmail,
6201
+ tag: ciGitInfo.tag ?? localGitInfo.tag,
6202
+ dirty: localGitInfo.dirty
6203
+ };
6204
+ }
5775
6205
  function hashKey(value) {
5776
6206
  return createHash("sha256").update(value).digest("hex").slice(0, 12);
5777
6207
  }
@@ -5880,7 +6310,25 @@ function getCIInfo() {
5880
6310
  }
5881
6311
  return void 0;
5882
6312
  }
5883
- function registerInterruptHandler(client, getRunId) {
6313
+ function getBaseEnvironmentInfo() {
6314
+ return {
6315
+ os: {
6316
+ platform: os.platform(),
6317
+ release: os.release(),
6318
+ arch: os.arch()
6319
+ },
6320
+ node: {
6321
+ version: process.version
6322
+ },
6323
+ machine: {
6324
+ cpus: os.cpus().length,
6325
+ memory: os.totalmem(),
6326
+ hostname: os.hostname()
6327
+ },
6328
+ ci: getCIInfo()
6329
+ };
6330
+ }
6331
+ function registerInterruptHandler(client, getRunId, getShard) {
5884
6332
  let completed = false;
5885
6333
  const handler = async (signal) => {
5886
6334
  if (completed) {
@@ -5893,7 +6341,8 @@ function registerInterruptHandler(client, getRunId) {
5893
6341
  try {
5894
6342
  await client.completeRun(runId, {
5895
6343
  status: "interrupted",
5896
- endedAt: (/* @__PURE__ */ new Date()).toISOString()
6344
+ endedAt: (/* @__PURE__ */ new Date()).toISOString(),
6345
+ shard: getShard == null ? void 0 : getShard()
5897
6346
  });
5898
6347
  } catch {
5899
6348
  }
@@ -5912,6 +6361,52 @@ function registerInterruptHandler(client, getRunId) {
5912
6361
  process.removeListener("SIGTERM", sigtermHandler);
5913
6362
  };
5914
6363
  }
6364
+ var TAG_PATTERNS = {
6365
+ owner: /@owner:([^\s@]+)/,
6366
+ priority: /@priority:(critical|high|medium|low)/i,
6367
+ feature: /@feature:([^\s@]+)/,
6368
+ ticketId: /@ticket:([^\s@]+)/,
6369
+ testType: /@test_type:(smoke|e2e|regression|integration|unit)/i
6370
+ };
6371
+ var KNOWN_KEYS = ["owner", "priority", "feature", "ticket", "test_type", "id", "slow", "flaky"];
6372
+ function parseTestMetadata(tags) {
6373
+ const metadata = {
6374
+ isSlow: false,
6375
+ isFlakyTagged: false,
6376
+ customMetadata: {}
6377
+ };
6378
+ for (const tag of tags) {
6379
+ const lowerTag = tag.toLowerCase();
6380
+ if (lowerTag === "@slow") {
6381
+ metadata.isSlow = true;
6382
+ } else if (lowerTag === "@flaky") {
6383
+ metadata.isFlakyTagged = true;
6384
+ }
6385
+ }
6386
+ for (const tag of tags) {
6387
+ for (const [key, pattern] of Object.entries(TAG_PATTERNS)) {
6388
+ const match = tag.match(pattern);
6389
+ if (match) {
6390
+ const value = match[1];
6391
+ if (key === "priority") {
6392
+ metadata.priority = value.toLowerCase();
6393
+ } else if (key === "testType") {
6394
+ metadata.testType = value.toLowerCase();
6395
+ } else {
6396
+ metadata[key] = value;
6397
+ }
6398
+ }
6399
+ }
6400
+ const customMatch = tag.match(/@([a-zA-Z][a-zA-Z0-9_-]*):([^\s@]+)/);
6401
+ if (customMatch) {
6402
+ const [, key, value] = customMatch;
6403
+ if (!KNOWN_KEYS.includes(key.toLowerCase())) {
6404
+ metadata.customMetadata[key] = value;
6405
+ }
6406
+ }
6407
+ }
6408
+ return metadata;
6409
+ }
5915
6410
  var AttachmentUploader = class {
5916
6411
  options;
5917
6412
  constructor(options) {
@@ -6007,7 +6502,6 @@ var AttachmentUploader = class {
6007
6502
  };
6008
6503
 
6009
6504
  // src/index.ts
6010
- var DEFAULT_API_URL = "https://code-api.supatest.ai";
6011
6505
  var SupatestCypressReporter = class {
6012
6506
  options;
6013
6507
  client;
@@ -6031,10 +6525,12 @@ var SupatestCypressReporter = class {
6031
6525
  projectId: options.projectId || process.env.SUPATEST_PROJECT_ID || "",
6032
6526
  apiKey: options.apiKey || process.env.SUPATEST_API_KEY || "",
6033
6527
  apiUrl: options.apiUrl || process.env.SUPATEST_API_URL || DEFAULT_API_URL,
6528
+ runGroupId: options.runGroupId || process.env.SUPATEST_RUN_GROUP_ID,
6529
+ shard: options.shard || this.getShardFromEnv(),
6034
6530
  uploadAssets: options.uploadAssets ?? true,
6035
- maxConcurrentUploads: options.maxConcurrentUploads ?? 5,
6036
- retryAttempts: options.retryAttempts ?? 3,
6037
- timeoutMs: options.timeoutMs ?? 3e4,
6531
+ maxConcurrentUploads: options.maxConcurrentUploads ?? DEFAULT_MAX_CONCURRENT_UPLOADS,
6532
+ retryAttempts: options.retryAttempts ?? DEFAULT_RETRY_ATTEMPTS,
6533
+ timeoutMs: options.timeoutMs ?? DEFAULT_TIMEOUT_MS,
6038
6534
  dryRun: options.dryRun ?? process.env.SUPATEST_DRY_RUN === "true"
6039
6535
  };
6040
6536
  }
@@ -6053,6 +6549,7 @@ var SupatestCypressReporter = class {
6053
6549
  this.client = new SupatestApiClient({
6054
6550
  apiKey: this.options.apiKey,
6055
6551
  apiUrl: this.options.apiUrl,
6552
+ projectId: this.options.projectId,
6056
6553
  timeoutMs: this.options.timeoutMs,
6057
6554
  retryAttempts: this.options.retryAttempts,
6058
6555
  dryRun: this.options.dryRun
@@ -6066,7 +6563,9 @@ var SupatestCypressReporter = class {
6066
6563
  try {
6067
6564
  const runRequest = {
6068
6565
  projectId: this.options.projectId,
6566
+ runGroupId: this.options.runGroupId,
6069
6567
  startedAt: this.startedAt,
6568
+ shard: this.options.shard,
6070
6569
  cypress: {
6071
6570
  version: this.cypressVersion || "unknown",
6072
6571
  browser: this.browserName || "electron"
@@ -6089,7 +6588,8 @@ var SupatestCypressReporter = class {
6089
6588
  this.runId = response.runId;
6090
6589
  this.unregisterInterruptHandler = registerInterruptHandler(
6091
6590
  this.client,
6092
- () => this.runId
6591
+ () => this.runId,
6592
+ () => this.options.shard
6093
6593
  );
6094
6594
  logInfo(`Run ${this.runId} started (${details.specs.length} spec files)`);
6095
6595
  } catch (error) {
@@ -6131,6 +6631,7 @@ var SupatestCypressReporter = class {
6131
6631
  await this.client.completeRun(this.runId, {
6132
6632
  status: (results == null ? void 0 : results.status) === "finished" ? "complete" : "errored",
6133
6633
  endedAt: (results == null ? void 0 : results.endedTestsAt) ?? (/* @__PURE__ */ new Date()).toISOString(),
6634
+ shard: this.options.shard,
6134
6635
  summary,
6135
6636
  timing: {
6136
6637
  totalDurationMs: (results == null ? void 0 : results.totalDuration) ?? 0,
@@ -6258,25 +6759,7 @@ var SupatestCypressReporter = class {
6258
6759
  return tags;
6259
6760
  }
6260
6761
  parseTestMetadata(tags) {
6261
- const metadata = {
6262
- isSlow: false,
6263
- isFlakyTagged: false,
6264
- customMetadata: {}
6265
- };
6266
- for (const tag of tags) {
6267
- const lower = tag.toLowerCase();
6268
- if (lower === "@slow") metadata.isSlow = true;
6269
- if (lower === "@flaky") metadata.isFlakyTagged = true;
6270
- const ownerMatch = tag.match(/@owner:([^\s@]+)/i);
6271
- if (ownerMatch) metadata.owner = ownerMatch[1];
6272
- const priorityMatch = tag.match(/@priority:(critical|high|medium|low)/i);
6273
- if (priorityMatch) metadata.priority = priorityMatch[1].toLowerCase();
6274
- const featureMatch = tag.match(/@feature:([^\s@]+)/i);
6275
- if (featureMatch) metadata.feature = featureMatch[1];
6276
- const typeMatch = tag.match(/@test_type:(smoke|e2e|regression|integration|unit)/i);
6277
- if (typeMatch) metadata.testType = typeMatch[1].toLowerCase();
6278
- }
6279
- return metadata;
6762
+ return parseTestMetadata(tags);
6280
6763
  }
6281
6764
  buildAttachmentMeta(test, specResults) {
6282
6765
  const attachments = [];
@@ -6336,48 +6819,54 @@ var SupatestCypressReporter = class {
6336
6819
  testResultId,
6337
6820
  attachments: attachments.map((a) => a.meta)
6338
6821
  });
6339
- const uploadItems = uploads.map((u, i) => ({
6822
+ const uploadItems = uploads.map((u, i2) => ({
6340
6823
  signedUrl: u.signedUrl,
6341
- filePath: attachments[i].path,
6342
- contentType: attachments[i].meta.contentType
6824
+ filePath: attachments[i2].path,
6825
+ contentType: attachments[i2].meta.contentType
6343
6826
  }));
6344
- await this.uploader.uploadBatch(uploadItems, uploads);
6827
+ const results = await this.uploader.uploadBatch(uploadItems, uploads);
6828
+ const failures = results.filter((r2) => !r2.success);
6829
+ if (failures.length > 0) {
6830
+ failures.forEach((failure) => {
6831
+ const attachment = attachments.find(
6832
+ (_2, i2) => {
6833
+ var _a2;
6834
+ return ((_a2 = uploads[i2]) == null ? void 0 : _a2.attachmentId) === failure.attachmentId;
6835
+ }
6836
+ );
6837
+ this.errorCollector.recordError(
6838
+ "ATTACHMENT_UPLOAD",
6839
+ failure.error || "Upload failed",
6840
+ {
6841
+ attachmentName: attachment == null ? void 0 : attachment.meta.name,
6842
+ filePath: attachment == null ? void 0 : attachment.path,
6843
+ error: failure.error
6844
+ }
6845
+ );
6846
+ });
6847
+ }
6345
6848
  } catch (error) {
6346
6849
  this.errorCollector.recordError("ATTACHMENT_SIGN", getErrorMessage2(error), { error });
6347
6850
  }
6348
6851
  }
6349
6852
  getEnvironmentInfo() {
6350
6853
  return {
6351
- os: {
6352
- platform: os.platform(),
6353
- release: os.release(),
6354
- arch: os.arch()
6355
- },
6356
- node: {
6357
- version: process.version
6358
- },
6359
- machine: {
6360
- cpus: os.cpus().length,
6361
- memory: os.totalmem(),
6362
- hostname: os.hostname()
6363
- },
6854
+ ...getBaseEnvironmentInfo(),
6364
6855
  cypress: {
6365
6856
  version: this.cypressVersion || "unknown"
6366
- },
6367
- ci: getCIInfo()
6857
+ }
6368
6858
  };
6369
6859
  }
6370
6860
  async getGitInfo() {
6371
- const ciGitInfo = {
6372
- branch: process.env.GITHUB_REF_NAME ?? process.env.CI_COMMIT_BRANCH ?? process.env.GIT_BRANCH,
6373
- commit: process.env.GITHUB_SHA ?? process.env.CI_COMMIT_SHA ?? process.env.GIT_COMMIT,
6374
- repo: process.env.GITHUB_REPOSITORY ?? process.env.CI_PROJECT_PATH,
6375
- author: process.env.GITHUB_ACTOR ?? process.env.GITLAB_USER_NAME
6376
- };
6377
- if (ciGitInfo.branch || ciGitInfo.commit) {
6378
- return ciGitInfo;
6861
+ return getGitInfoWithCI(this.rootDir);
6862
+ }
6863
+ getShardFromEnv() {
6864
+ const current = Number(process.env.SUPATEST_SHARD_CURRENT);
6865
+ const total = Number(process.env.SUPATEST_SHARD_TOTAL);
6866
+ if (!Number.isInteger(current) || !Number.isInteger(total) || current < 1 || total < 1) {
6867
+ return void 0;
6379
6868
  }
6380
- return await getLocalGitInfo(this.rootDir);
6869
+ return { current, total };
6381
6870
  }
6382
6871
  };
6383
6872
  function supatestPlugin(on, config, options = {}) {