@supatest/cypress-reporter 0.0.6 → 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());
@@ -912,34 +894,501 @@ var require_dist2 = __commonJS({
912
894
  import fs2 from "fs";
913
895
  import path from "path";
914
896
 
915
- // ../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
916
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
917
914
  var import_debug = __toESM(require_src(), 1);
915
+ import { spawn } from "child_process";
918
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
919
1386
  var import_promise_deferred2 = __toESM(require_dist2(), 1);
920
- import { spawn } from "child_process";
921
1387
  import { EventEmitter } from "events";
922
1388
  var __defProp2 = Object.defineProperty;
923
- var __defProps = Object.defineProperties;
924
1389
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
925
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
926
1390
  var __getOwnPropNames2 = Object.getOwnPropertyNames;
927
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
928
1391
  var __hasOwnProp2 = Object.prototype.hasOwnProperty;
929
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
930
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
931
- var __spreadValues = (a, b) => {
932
- for (var prop in b || (b = {}))
933
- if (__hasOwnProp2.call(b, prop))
934
- __defNormalProp(a, prop, b[prop]);
935
- if (__getOwnPropSymbols)
936
- for (var prop of __getOwnPropSymbols(b)) {
937
- if (__propIsEnum.call(b, prop))
938
- __defNormalProp(a, prop, b[prop]);
939
- }
940
- return a;
941
- };
942
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
943
1392
  var __esm = (fn, res) => function __init() {
944
1393
  return fn && (res = (0, fn[__getOwnPropNames2(fn)[0]])(fn = 0)), res;
945
1394
  };
@@ -959,44 +1408,6 @@ var __copyProps2 = (to, from, except, desc) => {
959
1408
  return to;
960
1409
  };
961
1410
  var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
962
- var __async = (__this, __arguments, generator) => {
963
- return new Promise((resolve, reject) => {
964
- var fulfilled = (value) => {
965
- try {
966
- step(generator.next(value));
967
- } catch (e) {
968
- reject(e);
969
- }
970
- };
971
- var rejected = (value) => {
972
- try {
973
- step(generator.throw(value));
974
- } catch (e) {
975
- reject(e);
976
- }
977
- };
978
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
979
- step((generator = generator.apply(__this, __arguments)).next());
980
- });
981
- };
982
- function pathspec(...paths) {
983
- const key = new String(paths);
984
- cache.set(key, paths);
985
- return key;
986
- }
987
- function isPathSpec(path2) {
988
- return path2 instanceof String && cache.has(path2);
989
- }
990
- function toPaths(pathSpec) {
991
- return cache.get(pathSpec) || [];
992
- }
993
- var cache;
994
- var init_pathspec = __esm({
995
- "src/lib/args/pathspec.ts"() {
996
- "use strict";
997
- cache = /* @__PURE__ */ new WeakMap();
998
- }
999
- });
1000
1411
  var GitError;
1001
1412
  var init_git_error = __esm({
1002
1413
  "src/lib/errors/git-error.ts"() {
@@ -1036,7 +1447,10 @@ var init_task_configuration_error = __esm({
1036
1447
  }
1037
1448
  });
1038
1449
  function asFunction(source) {
1039
- return typeof source === "function" ? source : NOOP;
1450
+ if (typeof source !== "function") {
1451
+ return NOOP;
1452
+ }
1453
+ return source;
1040
1454
  }
1041
1455
  function isUserFunction(source) {
1042
1456
  return typeof source === "function" && source !== NOOP;
@@ -1057,7 +1471,7 @@ function last(input, offset = 0) {
1057
1471
  }
1058
1472
  }
1059
1473
  function isArrayLike(input) {
1060
- return !!(input && typeof input.length === "number");
1474
+ return filterHasLength(input);
1061
1475
  }
1062
1476
  function toLinesWithContent(input = "", trimmed2 = true, separator = "\n") {
1063
1477
  return input.split(separator).reduce((output, line) => {
@@ -1110,19 +1524,21 @@ function asCamelCase(str) {
1110
1524
  });
1111
1525
  }
1112
1526
  function asStringArray(source) {
1113
- return asArray(source).map(String);
1527
+ return asArray(source).map((item) => {
1528
+ return item instanceof String ? item : String(item);
1529
+ });
1114
1530
  }
1115
1531
  function asNumber(source, onNaN = 0) {
1116
1532
  if (source == null) {
1117
1533
  return onNaN;
1118
1534
  }
1119
1535
  const num = parseInt(source, 10);
1120
- return isNaN(num) ? onNaN : num;
1536
+ return Number.isNaN(num) ? onNaN : num;
1121
1537
  }
1122
1538
  function prefixedArray(input, prefix) {
1123
1539
  const output = [];
1124
- for (let i = 0, max = input.length; i < max; i++) {
1125
- output.push(prefix, input[i]);
1540
+ for (let i2 = 0, max = input.length; i2 < max; i2++) {
1541
+ output.push(prefix, input[i2]);
1126
1542
  }
1127
1543
  return output;
1128
1544
  }
@@ -1130,10 +1546,13 @@ function bufferToString(input) {
1130
1546
  return (Array.isArray(input) ? Buffer.concat(input) : input).toString("utf-8");
1131
1547
  }
1132
1548
  function pick(source, properties) {
1133
- return Object.assign(
1134
- {},
1135
- ...properties.map((property) => property in source ? { [property]: source[property] } : {})
1136
- );
1549
+ const out = {};
1550
+ properties.forEach((key) => {
1551
+ if (source[key] !== void 0) {
1552
+ out[key] = source[key];
1553
+ }
1554
+ });
1555
+ return out;
1137
1556
  }
1138
1557
  function delay(duration = 0) {
1139
1558
  return new Promise((done) => setTimeout(done, duration));
@@ -1150,6 +1569,7 @@ var objectToString;
1150
1569
  var init_util = __esm({
1151
1570
  "src/lib/utils/util.ts"() {
1152
1571
  "use strict";
1572
+ init_argument_filters();
1153
1573
  NULL = "\0";
1154
1574
  NOOP = () => {
1155
1575
  };
@@ -1163,7 +1583,7 @@ function filterType(input, filter, def) {
1163
1583
  return arguments.length > 2 ? def : void 0;
1164
1584
  }
1165
1585
  function filterPrimitives(input, omit) {
1166
- const type = isPathSpec(input) ? "string" : typeof input;
1586
+ const type = r(input) ? "string" : typeof input;
1167
1587
  return /number|string|boolean/.test(type) && (!omit || !omit.includes(type));
1168
1588
  }
1169
1589
  function filterPlainObject(input) {
@@ -1173,23 +1593,22 @@ function filterFunction(input) {
1173
1593
  return typeof input === "function";
1174
1594
  }
1175
1595
  var filterArray;
1596
+ var filterNumber;
1176
1597
  var filterString;
1177
- var filterStringArray;
1178
1598
  var filterStringOrStringArray;
1179
1599
  var filterHasLength;
1180
1600
  var init_argument_filters = __esm({
1181
1601
  "src/lib/utils/argument-filters.ts"() {
1182
1602
  "use strict";
1183
1603
  init_util();
1184
- init_pathspec();
1185
1604
  filterArray = (input) => {
1186
1605
  return Array.isArray(input);
1187
1606
  };
1188
- filterString = (input) => {
1189
- return typeof input === "string";
1607
+ filterNumber = (input) => {
1608
+ return typeof input === "number";
1190
1609
  };
1191
- filterStringArray = (input) => {
1192
- return Array.isArray(input) && input.every(filterString);
1610
+ filterString = (input) => {
1611
+ return typeof input === "string" || r(input);
1193
1612
  };
1194
1613
  filterStringOrStringArray = (input) => {
1195
1614
  return filterString(input) || Array.isArray(input) && input.every(filterString);
@@ -1198,7 +1617,7 @@ var init_argument_filters = __esm({
1198
1617
  if (input == null || "number|boolean|function".includes(typeof input)) {
1199
1618
  return false;
1200
1619
  }
1201
- return Array.isArray(input) || typeof input === "string" || typeof input.length === "number";
1620
+ return typeof input.length === "number";
1202
1621
  };
1203
1622
  }
1204
1623
  });
@@ -1219,17 +1638,20 @@ var GitOutputStreams;
1219
1638
  var init_git_output_streams = __esm({
1220
1639
  "src/lib/utils/git-output-streams.ts"() {
1221
1640
  "use strict";
1222
- GitOutputStreams = class {
1641
+ GitOutputStreams = class _GitOutputStreams {
1223
1642
  constructor(stdOut, stdErr) {
1224
1643
  this.stdOut = stdOut;
1225
1644
  this.stdErr = stdErr;
1226
1645
  }
1227
1646
  asStrings() {
1228
- return new GitOutputStreams(this.stdOut.toString("utf8"), this.stdErr.toString("utf8"));
1647
+ return new _GitOutputStreams(this.stdOut.toString("utf8"), this.stdErr.toString("utf8"));
1229
1648
  }
1230
1649
  };
1231
1650
  }
1232
1651
  });
1652
+ function useMatchesDefault() {
1653
+ throw new Error(`LineParser:useMatches not implemented`);
1654
+ }
1233
1655
  var LineParser;
1234
1656
  var RemoteLineParser;
1235
1657
  var init_line_parser = __esm({
@@ -1238,6 +1660,7 @@ var init_line_parser = __esm({
1238
1660
  LineParser = class {
1239
1661
  constructor(regExp, useMatches) {
1240
1662
  this.matches = [];
1663
+ this.useMatches = useMatchesDefault;
1241
1664
  this.parse = (line, target) => {
1242
1665
  this.resetMatches();
1243
1666
  if (!this._regExp.every((reg, index) => this.addMatch(reg, index, line(index)))) {
@@ -1250,9 +1673,6 @@ var init_line_parser = __esm({
1250
1673
  this.useMatches = useMatches;
1251
1674
  }
1252
1675
  }
1253
- useMatches(target, match) {
1254
- throw new Error(`LineParser:useMatches not implemented`);
1255
- }
1256
1676
  resetMatches() {
1257
1677
  this.matches.length = 0;
1258
1678
  }
@@ -1285,8 +1705,8 @@ var init_line_parser = __esm({
1285
1705
  function createInstanceConfig(...options) {
1286
1706
  const baseDir = process.cwd();
1287
1707
  const config = Object.assign(
1288
- __spreadValues({ baseDir }, defaultOptions),
1289
- ...options.filter((o) => typeof o === "object" && o)
1708
+ { baseDir, ...defaultOptions },
1709
+ ...options.filter((o2) => typeof o2 === "object" && o2)
1290
1710
  );
1291
1711
  config.baseDir = config.baseDir || baseDir;
1292
1712
  config.trimmed = config.trimmed === true;
@@ -1310,10 +1730,16 @@ function appendTaskOptions(options, commands = []) {
1310
1730
  }
1311
1731
  return Object.keys(options).reduce((commands2, key) => {
1312
1732
  const value = options[key];
1313
- if (isPathSpec(value)) {
1733
+ if (r(value)) {
1314
1734
  commands2.push(value);
1315
1735
  } else if (filterPrimitives(value, ["boolean"])) {
1316
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
+ }
1317
1743
  } else {
1318
1744
  commands2.push(key);
1319
1745
  }
@@ -1322,9 +1748,9 @@ function appendTaskOptions(options, commands = []) {
1322
1748
  }
1323
1749
  function getTrailingOptions(args, initialPrimitive = 0, objectOnly = false) {
1324
1750
  const command = [];
1325
- for (let i = 0, max = initialPrimitive < 0 ? args.length : initialPrimitive; i < max; i++) {
1326
- if ("string|number".includes(typeof args[i])) {
1327
- 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]));
1328
1754
  }
1329
1755
  }
1330
1756
  appendTaskOptions(trailingOptionsArgument(args), command);
@@ -1335,7 +1761,7 @@ function getTrailingOptions(args, initialPrimitive = 0, objectOnly = false) {
1335
1761
  }
1336
1762
  function trailingArrayArgument(args) {
1337
1763
  const hasTrailingCallback = typeof last(args) === "function";
1338
- return filterType(last(args, hasTrailingCallback ? 1 : 0), filterArray, []);
1764
+ return asStringArray(filterType(last(args, hasTrailingCallback ? 1 : 0), filterArray, []));
1339
1765
  }
1340
1766
  function trailingOptionsArgument(args) {
1341
1767
  const hasTrailingCallback = filterFunction(last(args));
@@ -1350,7 +1776,6 @@ var init_task_options = __esm({
1350
1776
  "use strict";
1351
1777
  init_argument_filters();
1352
1778
  init_util();
1353
- init_pathspec();
1354
1779
  }
1355
1780
  });
1356
1781
  function callTaskParser(parser4, streams) {
@@ -1358,12 +1783,12 @@ function callTaskParser(parser4, streams) {
1358
1783
  }
1359
1784
  function parseStringResponse(result, parsers12, texts, trim = true) {
1360
1785
  asArray(texts).forEach((text) => {
1361
- 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++) {
1362
1787
  const line = (offset = 0) => {
1363
- if (i + offset >= max) {
1788
+ if (i2 + offset >= max) {
1364
1789
  return;
1365
1790
  }
1366
- return lines[i + offset];
1791
+ return lines[i2 + offset];
1367
1792
  };
1368
1793
  parsers12.some(({ parse }) => parse(line, result));
1369
1794
  }
@@ -1398,10 +1823,10 @@ __export(utils_exports, {
1398
1823
  filterArray: () => filterArray,
1399
1824
  filterFunction: () => filterFunction,
1400
1825
  filterHasLength: () => filterHasLength,
1826
+ filterNumber: () => filterNumber,
1401
1827
  filterPlainObject: () => filterPlainObject,
1402
1828
  filterPrimitives: () => filterPrimitives,
1403
1829
  filterString: () => filterString,
1404
- filterStringArray: () => filterStringArray,
1405
1830
  filterStringOrStringArray: () => filterStringOrStringArray,
1406
1831
  filterType: () => filterType,
1407
1832
  first: () => first,
@@ -1724,9 +2149,9 @@ function configFilePath(filePath) {
1724
2149
  }
1725
2150
  function* configParser(text, requestedKey = null) {
1726
2151
  const lines = text.split("\0");
1727
- for (let i = 0, max = lines.length - 1; i < max; ) {
1728
- const file = configFilePath(lines[i++]);
1729
- 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++];
1730
2155
  let key = requestedKey;
1731
2156
  if (value.includes("\n")) {
1732
2157
  const line = splitOn(value, "\n");
@@ -1764,7 +2189,7 @@ var init_ConfigList = __esm({
1764
2189
  }
1765
2190
  addValue(file, key, value) {
1766
2191
  const values = this.addFile(file);
1767
- if (!values.hasOwnProperty(key)) {
2192
+ if (!Object.hasOwn(values, key)) {
1768
2193
  values[key] = value;
1769
2194
  } else if (Array.isArray(values[key])) {
1770
2195
  values[key].push(value);
@@ -1777,7 +2202,7 @@ var init_ConfigList = __esm({
1777
2202
  }
1778
2203
  });
1779
2204
  function asConfigScope(scope, fallback) {
1780
- if (typeof scope === "string" && GitConfigScope.hasOwnProperty(scope)) {
2205
+ if (typeof scope === "string" && Object.hasOwn(GitConfigScope, scope)) {
1781
2206
  return scope;
1782
2207
  }
1783
2208
  return fallback;
@@ -1998,13 +2423,14 @@ function getResetMode(mode) {
1998
2423
  return;
1999
2424
  }
2000
2425
  function isValidResetMode(mode) {
2001
- return ResetModes.includes(mode);
2426
+ return typeof mode === "string" && validResetModes.includes(mode);
2002
2427
  }
2003
2428
  var ResetMode;
2004
- var ResetModes;
2429
+ var validResetModes;
2005
2430
  var init_reset = __esm({
2006
2431
  "src/lib/tasks/reset.ts"() {
2007
2432
  "use strict";
2433
+ init_utils();
2008
2434
  init_task();
2009
2435
  ResetMode = /* @__PURE__ */ ((ResetMode2) => {
2010
2436
  ResetMode2["MIXED"] = "mixed";
@@ -2014,7 +2440,7 @@ var init_reset = __esm({
2014
2440
  ResetMode2["KEEP"] = "keep";
2015
2441
  return ResetMode2;
2016
2442
  })(ResetMode || {});
2017
- ResetModes = Array.from(Object.values(ResetMode));
2443
+ validResetModes = asStringArray(Object.values(ResetMode));
2018
2444
  }
2019
2445
  });
2020
2446
  function createLog() {
@@ -2081,14 +2507,14 @@ var init_git_logger = __esm({
2081
2507
  };
2082
2508
  }
2083
2509
  });
2084
- var _TasksPendingQueue;
2085
2510
  var TasksPendingQueue;
2086
2511
  var init_tasks_pending_queue = __esm({
2087
2512
  "src/lib/runners/tasks-pending-queue.ts"() {
2088
2513
  "use strict";
2514
+ var _a2;
2089
2515
  init_git_error();
2090
2516
  init_git_logger();
2091
- _TasksPendingQueue = class {
2517
+ TasksPendingQueue = (_a2 = class {
2092
2518
  constructor(logLabel = "GitExecutor") {
2093
2519
  this.logLabel = logLabel;
2094
2520
  this._queue = /* @__PURE__ */ new Map();
@@ -2097,7 +2523,7 @@ var init_tasks_pending_queue = __esm({
2097
2523
  return this._queue.get(task);
2098
2524
  }
2099
2525
  createProgress(task) {
2100
- const name = _TasksPendingQueue.getName(task.commands[0]);
2526
+ const name = _a2.getName(task.commands[0]);
2101
2527
  const logger = createLogger(this.logLabel, name);
2102
2528
  return {
2103
2529
  task,
@@ -2145,11 +2571,9 @@ var init_tasks_pending_queue = __esm({
2145
2571
  return progress;
2146
2572
  }
2147
2573
  static getName(name = "empty") {
2148
- return `task:${name}:${++_TasksPendingQueue.counter}`;
2574
+ return `task:${name}:${++_a2.counter}`;
2149
2575
  }
2150
- };
2151
- TasksPendingQueue = _TasksPendingQueue;
2152
- TasksPendingQueue.counter = 0;
2576
+ }, _a2.counter = 0, _a2);
2153
2577
  }
2154
2578
  });
2155
2579
  function pluginContext(task, commands) {
@@ -2206,20 +2630,18 @@ var init_git_executor_chain = __esm({
2206
2630
  this._queue.push(task);
2207
2631
  return this._chain = this._chain.then(() => this.attemptTask(task));
2208
2632
  }
2209
- attemptTask(task) {
2210
- return __async(this, null, function* () {
2211
- const onScheduleComplete = yield this._scheduler.next();
2212
- const onQueueComplete = () => this._queue.complete(task);
2213
- try {
2214
- const { logger } = this._queue.attempt(task);
2215
- return yield isEmptyTask(task) ? this.attemptEmptyTask(task, logger) : this.attemptRemoteTask(task, logger);
2216
- } catch (e) {
2217
- throw this.onFatalException(task, e);
2218
- } finally {
2219
- onQueueComplete();
2220
- onScheduleComplete();
2221
- }
2222
- });
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
+ }
2223
2645
  }
2224
2646
  onFatalException(task, e) {
2225
2647
  const gitError = e instanceof GitError ? Object.assign(e, { task }) : new GitError(task, e && String(e));
@@ -2227,34 +2649,29 @@ var init_git_executor_chain = __esm({
2227
2649
  this._queue.fatal(gitError);
2228
2650
  return gitError;
2229
2651
  }
2230
- attemptRemoteTask(task, logger) {
2231
- return __async(this, null, function* () {
2232
- const binary = this._plugins.exec("spawn.binary", "", pluginContext(task, task.commands));
2233
- const args = this._plugins.exec(
2234
- "spawn.args",
2235
- [...task.commands],
2236
- pluginContext(task, task.commands)
2237
- );
2238
- const raw = yield this.gitResponse(
2239
- task,
2240
- binary,
2241
- args,
2242
- this.outputHandler,
2243
- logger.step("SPAWN")
2244
- );
2245
- const outputStreams = yield this.handleTaskData(task, args, raw, logger.step("HANDLE"));
2246
- logger(`passing response to task's parser as a %s`, task.format);
2247
- if (isBufferTask(task)) {
2248
- return callTaskParser(task.parser, outputStreams);
2249
- }
2250
- 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 }
2251
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());
2252
2671
  }
2253
- attemptEmptyTask(task, logger) {
2254
- return __async(this, null, function* () {
2255
- logger(`empty task bypassing child process to call to task's parser`);
2256
- return task.parser(this);
2257
- });
2672
+ async attemptEmptyTask(task, logger) {
2673
+ logger(`empty task bypassing child process to call to task's parser`);
2674
+ return task.parser(this);
2258
2675
  }
2259
2676
  handleTaskData(task, args, result, logger) {
2260
2677
  const { exitCode, rejection, stdOut, stdErr } = result;
@@ -2263,7 +2680,10 @@ var init_git_executor_chain = __esm({
2263
2680
  const { error } = this._plugins.exec(
2264
2681
  "task.error",
2265
2682
  { error: rejection },
2266
- __spreadValues(__spreadValues({}, pluginContext(task, args)), result)
2683
+ {
2684
+ ...pluginContext(task, args),
2685
+ ...result
2686
+ }
2267
2687
  );
2268
2688
  if (error && task.onError) {
2269
2689
  logger.info(`exitCode=%s handling with custom error handler`);
@@ -2296,79 +2716,80 @@ var init_git_executor_chain = __esm({
2296
2716
  done(new GitOutputStreams(Buffer.concat(stdOut), Buffer.concat(stdErr)));
2297
2717
  });
2298
2718
  }
2299
- gitResponse(task, command, args, outputHandler, logger) {
2300
- return __async(this, null, function* () {
2301
- const outputLogger = logger.sibling("output");
2302
- const spawnOptions = this._plugins.exec(
2303
- "spawn.options",
2304
- {
2305
- cwd: this.cwd,
2306
- env: this.env,
2307
- windowsHide: true
2308
- },
2309
- 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"))
2310
2758
  );
2311
- return new Promise((done) => {
2312
- const stdOut = [];
2313
- const stdErr = [];
2314
- logger.info(`%s %o`, command, args);
2315
- logger("%O", spawnOptions);
2316
- let rejection = this._beforeSpawn(task, args);
2317
- if (rejection) {
2318
- 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({
2319
2769
  stdOut,
2320
2770
  stdErr,
2321
- exitCode: 9901,
2322
- rejection
2771
+ exitCode,
2772
+ rejection: rejection || reason
2323
2773
  });
2324
- }
2325
- this._plugins.exec("spawn.before", void 0, __spreadProps(__spreadValues({}, pluginContext(task, args)), {
2326
- kill(reason) {
2327
- rejection = reason || rejection;
2774
+ },
2775
+ kill(reason) {
2776
+ if (spawned.killed) {
2777
+ return;
2328
2778
  }
2329
- }));
2330
- const spawned = spawn(command, args, spawnOptions);
2331
- spawned.stdout.on(
2332
- "data",
2333
- onDataReceived(stdOut, "stdOut", logger, outputLogger.step("stdOut"))
2334
- );
2335
- spawned.stderr.on(
2336
- "data",
2337
- onDataReceived(stdErr, "stdErr", logger, outputLogger.step("stdErr"))
2338
- );
2339
- spawned.on("error", onErrorReceived(stdErr, logger));
2340
- if (outputHandler) {
2341
- logger(`Passing child process stdOut/stdErr to custom outputHandler`);
2342
- outputHandler(command, spawned.stdout, spawned.stderr, [...args]);
2779
+ rejection = reason;
2780
+ spawned.kill("SIGINT");
2343
2781
  }
2344
- this._plugins.exec("spawn.after", void 0, __spreadProps(__spreadValues({}, pluginContext(task, args)), {
2345
- spawned,
2346
- close(exitCode, reason) {
2347
- done({
2348
- stdOut,
2349
- stdErr,
2350
- exitCode,
2351
- rejection: rejection || reason
2352
- });
2353
- },
2354
- kill(reason) {
2355
- if (spawned.killed) {
2356
- return;
2357
- }
2358
- rejection = reason;
2359
- spawned.kill("SIGINT");
2360
- }
2361
- }));
2362
2782
  });
2363
2783
  });
2364
2784
  }
2365
2785
  _beforeSpawn(task, args) {
2366
2786
  let rejection;
2367
- this._plugins.exec("spawn.before", void 0, __spreadProps(__spreadValues({}, pluginContext(task, args)), {
2787
+ this._plugins.exec("spawn.before", void 0, {
2788
+ ...pluginContext(task, args),
2368
2789
  kill(reason) {
2369
2790
  rejection = reason || rejection;
2370
2791
  }
2371
- }));
2792
+ });
2372
2793
  return rejection;
2373
2794
  }
2374
2795
  };
@@ -2528,7 +2949,7 @@ var init_count_objects = __esm({
2528
2949
  /([a-z-]+): (\d+)$/,
2529
2950
  (result, [key, value]) => {
2530
2951
  const property = asCamelCase(key);
2531
- if (result.hasOwnProperty(property)) {
2952
+ if (Object.hasOwn(result, property)) {
2532
2953
  result[property] = asNumber(value);
2533
2954
  }
2534
2955
  }
@@ -2616,7 +3037,10 @@ function commit_default() {
2616
3037
  const task = rejectDeprecatedSignatures(message) || commitTask(
2617
3038
  asArray(message),
2618
3039
  asArray(filterType(rest[0], filterStringOrStringArray, [])),
2619
- [...filterType(rest[1], filterArray, []), ...getTrailingOptions(arguments, 0, true)]
3040
+ [
3041
+ ...asStringArray(filterType(rest[1], filterArray, [])),
3042
+ ...getTrailingOptions(arguments, 0, true)
3043
+ ]
2620
3044
  );
2621
3045
  return this._runTask(task, next);
2622
3046
  }
@@ -2728,8 +3152,8 @@ var init_init = __esm({
2728
3152
  }
2729
3153
  });
2730
3154
  function logFormatFromCommand(customArgs) {
2731
- for (let i = 0; i < customArgs.length; i++) {
2732
- const format = logFormatRegex.exec(customArgs[i]);
3155
+ for (let i2 = 0; i2 < customArgs.length; i2++) {
3156
+ const format = logFormatRegex.exec(customArgs[i2]);
2733
3157
  if (format) {
2734
3158
  return `--${format[1]}`;
2735
3159
  }
@@ -2857,7 +3281,7 @@ var init_parse_diff_summary = __esm({
2857
3281
  (result, [status, similarity, from, _to, to]) => {
2858
3282
  result.changed++;
2859
3283
  result.files.push({
2860
- file: to != null ? to : from,
3284
+ file: to ?? from,
2861
3285
  changes: 0,
2862
3286
  insertions: 0,
2863
3287
  deletions: 0,
@@ -2999,7 +3423,7 @@ function userOptions(input) {
2999
3423
  }
3000
3424
  function parseLogOptions(opt = {}, customArgs = []) {
3001
3425
  const splitter = filterType(opt.splitter, filterString, SPLITTER);
3002
- const format = !filterPrimitives(opt.format) && opt.format ? opt.format : {
3426
+ const format = filterPlainObject(opt.format) ? opt.format : {
3003
3427
  hash: "%H",
3004
3428
  date: opt.strictDate === false ? "%ai" : "%aI",
3005
3429
  message: "%s",
@@ -3023,7 +3447,7 @@ function parseLogOptions(opt = {}, customArgs = []) {
3023
3447
  suffix.push(`${opt.from || ""}${rangeOperator}${opt.to || ""}`);
3024
3448
  }
3025
3449
  if (filterString(opt.file)) {
3026
- command.push("--follow", pathspec(opt.file));
3450
+ command.push("--follow", c(opt.file));
3027
3451
  }
3028
3452
  appendTaskOptions(userOptions(opt), command);
3029
3453
  return {
@@ -3046,7 +3470,7 @@ function log_default() {
3046
3470
  const next = trailingFunctionArgument(arguments);
3047
3471
  const options = parseLogOptions(
3048
3472
  trailingOptionsArgument(arguments),
3049
- filterType(arguments[0], filterArray)
3473
+ asStringArray(filterType(arguments[0], filterArray, []))
3050
3474
  );
3051
3475
  const task = rejectDeprecatedSignatures(...rest) || validateLogFormatConfig(options.commands) || createLogTask(options);
3052
3476
  return this._runTask(task, next);
@@ -3066,7 +3490,6 @@ var init_log = __esm({
3066
3490
  "src/lib/tasks/log.ts"() {
3067
3491
  "use strict";
3068
3492
  init_log_format();
3069
- init_pathspec();
3070
3493
  init_parse_list_log_summary();
3071
3494
  init_utils();
3072
3495
  init_task();
@@ -3415,9 +3838,10 @@ var init_parse_push = __esm({
3415
3838
  result.repo = repo;
3416
3839
  }),
3417
3840
  new LineParser(/^updating local tracking ref '(.+)'/, (result, [local]) => {
3418
- result.ref = __spreadProps(__spreadValues({}, result.ref || {}), {
3841
+ result.ref = {
3842
+ ...result.ref || {},
3419
3843
  local
3420
- });
3844
+ };
3421
3845
  }),
3422
3846
  new LineParser(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/, (result, [local, remote, type]) => {
3423
3847
  result.pushed.push(pushResultPushedItem(local, remote, type));
@@ -3425,11 +3849,12 @@ var init_parse_push = __esm({
3425
3849
  new LineParser(
3426
3850
  /^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,
3427
3851
  (result, [local, remote, remoteName]) => {
3428
- result.branch = __spreadProps(__spreadValues({}, result.branch || {}), {
3852
+ result.branch = {
3853
+ ...result.branch || {},
3429
3854
  local,
3430
3855
  remote,
3431
3856
  remoteName
3432
- });
3857
+ };
3433
3858
  }
3434
3859
  ),
3435
3860
  new LineParser(
@@ -3451,7 +3876,10 @@ var init_parse_push = __esm({
3451
3876
  parsePushResult = (stdOut, stdErr) => {
3452
3877
  const pushDetail = parsePushDetail(stdOut, stdErr);
3453
3878
  const responseDetail = parseRemoteMessages(stdOut, stdErr);
3454
- return __spreadValues(__spreadValues({}, pushDetail), responseDetail);
3879
+ return {
3880
+ ...pushDetail,
3881
+ ...responseDetail
3882
+ };
3455
3883
  };
3456
3884
  parsePushDetail = (stdOut, stdErr) => {
3457
3885
  return parseStringResponse({ pushed: [] }, parsers5, [stdOut, stdErr]);
@@ -3550,15 +3978,15 @@ function parser3(indexX, indexY, handler) {
3550
3978
  return [`${indexX}${indexY}`, handler];
3551
3979
  }
3552
3980
  function conflicts(indexX, ...indexY) {
3553
- 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)));
3554
3982
  }
3555
3983
  function splitLine(result, lineStr) {
3556
3984
  const trimmed2 = lineStr.trim();
3557
3985
  switch (" ") {
3558
3986
  case trimmed2.charAt(2):
3559
- return data(trimmed2.charAt(0), trimmed2.charAt(1), trimmed2.substr(3));
3987
+ return data(trimmed2.charAt(0), trimmed2.charAt(1), trimmed2.slice(3));
3560
3988
  case trimmed2.charAt(1):
3561
- return data(" ", trimmed2.charAt(0), trimmed2.substr(2));
3989
+ return data(" ", trimmed2.charAt(0), trimmed2.slice(2));
3562
3990
  default:
3563
3991
  return;
3564
3992
  }
@@ -3606,58 +4034,54 @@ var init_StatusSummary = __esm({
3606
4034
  parser3(
3607
4035
  " ",
3608
4036
  "A",
3609
- (result, file) => append(result.created, file)
4037
+ (result, file) => result.created.push(file)
3610
4038
  ),
3611
4039
  parser3(
3612
4040
  " ",
3613
4041
  "D",
3614
- (result, file) => append(result.deleted, file)
4042
+ (result, file) => result.deleted.push(file)
3615
4043
  ),
3616
4044
  parser3(
3617
4045
  " ",
3618
4046
  "M",
3619
- (result, file) => append(result.modified, file)
3620
- ),
3621
- parser3(
3622
- "A",
3623
- " ",
3624
- (result, file) => append(result.created, file) && append(result.staged, file)
3625
- ),
3626
- parser3(
3627
- "A",
3628
- "M",
3629
- (result, file) => append(result.created, file) && append(result.staged, file) && append(result.modified, file)
3630
- ),
3631
- parser3(
3632
- "D",
3633
- " ",
3634
- (result, file) => append(result.deleted, file) && append(result.staged, file)
3635
- ),
3636
- parser3(
3637
- "M",
3638
- " ",
3639
- (result, file) => append(result.modified, file) && append(result.staged, file)
3640
- ),
3641
- parser3(
3642
- "M",
3643
- "M",
3644
- (result, file) => append(result.modified, file) && append(result.staged, file)
4047
+ (result, file) => result.modified.push(file)
3645
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
+ }),
3646
4070
  parser3("R", " ", (result, file) => {
3647
- append(result.renamed, renamedFile(file));
4071
+ result.renamed.push(renamedFile(file));
3648
4072
  }),
3649
4073
  parser3("R", "M", (result, file) => {
3650
4074
  const renamed = renamedFile(file);
3651
- append(result.renamed, renamed);
3652
- append(result.modified, renamed.to);
4075
+ result.renamed.push(renamed);
4076
+ result.modified.push(renamed.to);
3653
4077
  }),
3654
4078
  parser3("!", "!", (_result, _file) => {
3655
- append(_result.ignored = _result.ignored || [], _file);
4079
+ (_result.ignored = _result.ignored || []).push(_file);
3656
4080
  }),
3657
4081
  parser3(
3658
4082
  "?",
3659
4083
  "?",
3660
- (result, file) => append(result.not_added, file)
4084
+ (result, file) => result.not_added.push(file)
3661
4085
  ),
3662
4086
  ...conflicts(
3663
4087
  "A",
@@ -3685,18 +4109,19 @@ var init_StatusSummary = __esm({
3685
4109
  const behindReg = /behind (\d+)/;
3686
4110
  const currentReg = /^(.+?(?=(?:\.{3}|\s|$)))/;
3687
4111
  const trackingReg = /\.{3}(\S*)/;
3688
- const onEmptyBranchReg = /\son\s([\S]+)$/;
3689
- let regexResult;
3690
- regexResult = aheadReg.exec(line);
4112
+ const onEmptyBranchReg = /\son\s(\S+?)(?=\.{3}|$)/;
4113
+ let regexResult = aheadReg.exec(line);
3691
4114
  result.ahead = regexResult && +regexResult[1] || 0;
3692
4115
  regexResult = behindReg.exec(line);
3693
4116
  result.behind = regexResult && +regexResult[1] || 0;
3694
4117
  regexResult = currentReg.exec(line);
3695
- result.current = regexResult && regexResult[1];
4118
+ result.current = filterType(regexResult == null ? void 0 : regexResult[1], filterString, null);
3696
4119
  regexResult = trackingReg.exec(line);
3697
- result.tracking = regexResult && regexResult[1];
4120
+ result.tracking = filterType(regexResult == null ? void 0 : regexResult[1], filterString, null);
3698
4121
  regexResult = onEmptyBranchReg.exec(line);
3699
- result.current = regexResult && regexResult[1] || result.current;
4122
+ if (regexResult) {
4123
+ result.current = filterType(regexResult == null ? void 0 : regexResult[1], filterString, result.current);
4124
+ }
3700
4125
  result.detached = /\(no branch\)/.test(line);
3701
4126
  }
3702
4127
  ]
@@ -3704,13 +4129,13 @@ var init_StatusSummary = __esm({
3704
4129
  parseStatusSummary = function(text) {
3705
4130
  const lines = text.split(NULL);
3706
4131
  const status = new StatusSummary();
3707
- for (let i = 0, l = lines.length; i < l; ) {
3708
- let line = lines[i++].trim();
4132
+ for (let i2 = 0, l = lines.length; i2 < l; ) {
4133
+ let line = lines[i2++].trim();
3709
4134
  if (!line) {
3710
4135
  continue;
3711
4136
  }
3712
4137
  if (line.charAt(0) === "R") {
3713
- line += NULL + (lines[i++] || "");
4138
+ line += NULL + (lines[i2++] || "");
3714
4139
  }
3715
4140
  splitLine(status, line);
3716
4141
  }
@@ -3814,6 +4239,47 @@ var init_version = __esm({
3814
4239
  ];
3815
4240
  }
3816
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
+ });
3817
4283
  var simple_git_api_exports = {};
3818
4284
  __export(simple_git_api_exports, {
3819
4285
  SimpleGitApi: () => SimpleGitApi
@@ -3840,6 +4306,7 @@ var init_simple_git_api = __esm({
3840
4306
  init_task();
3841
4307
  init_version();
3842
4308
  init_utils();
4309
+ init_clone();
3843
4310
  SimpleGitApi = class {
3844
4311
  constructor(_executor) {
3845
4312
  this._executor = _executor;
@@ -3942,6 +4409,7 @@ var init_simple_git_api = __esm({
3942
4409
  Object.assign(
3943
4410
  SimpleGitApi.prototype,
3944
4411
  checkout_default(),
4412
+ clone_default(),
3945
4413
  commit_default(),
3946
4414
  config_default(),
3947
4415
  count_objects_default(),
@@ -4117,10 +4585,15 @@ var init_BranchSummary = __esm({
4117
4585
  function branchStatus(input) {
4118
4586
  return input ? input.charAt(0) : "";
4119
4587
  }
4120
- function parseBranchSummary(stdOut) {
4121
- 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
+ );
4122
4594
  }
4123
4595
  var parsers9;
4596
+ var currentBranchParser;
4124
4597
  var init_parse_branch = __esm({
4125
4598
  "src/lib/parsers/parse-branch.ts"() {
4126
4599
  "use strict";
@@ -4134,12 +4607,15 @@ var init_parse_branch = __esm({
4134
4607
  }
4135
4608
  ),
4136
4609
  new LineParser(
4137
- new RegExp("^([*+]\\s)?(\\S+)\\s+([a-z0-9]+)\\s?(.*)$", "s"),
4610
+ /^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,
4138
4611
  (result, [current, name, commit, label]) => {
4139
4612
  result.push(branchStatus(current), false, name, commit, label);
4140
4613
  }
4141
4614
  )
4142
4615
  ];
4616
+ currentBranchParser = new LineParser(/^(\S+)$/s, (result, [name]) => {
4617
+ result.push("*", false, name, "", "");
4618
+ });
4143
4619
  }
4144
4620
  });
4145
4621
  var branch_exports = {};
@@ -4156,6 +4632,7 @@ function containsDeleteBranchCommand(commands) {
4156
4632
  }
4157
4633
  function branchTask(customArgs) {
4158
4634
  const isDelete = containsDeleteBranchCommand(customArgs);
4635
+ const isCurrentOnly = customArgs.includes("--show-current");
4159
4636
  const commands = ["branch", ...customArgs];
4160
4637
  if (commands.length === 1) {
4161
4638
  commands.push("-a");
@@ -4170,16 +4647,17 @@ function branchTask(customArgs) {
4170
4647
  if (isDelete) {
4171
4648
  return parseBranchDeletions(stdOut, stdErr).all[0];
4172
4649
  }
4173
- return parseBranchSummary(stdOut);
4650
+ return parseBranchSummary(stdOut, isCurrentOnly);
4174
4651
  }
4175
4652
  };
4176
4653
  }
4177
4654
  function branchLocalTask() {
4178
- const parser4 = parseBranchSummary;
4179
4655
  return {
4180
4656
  format: "utf-8",
4181
4657
  commands: ["branch", "-v"],
4182
- parser: parser4
4658
+ parser(stdOut) {
4659
+ return parseBranchSummary(stdOut);
4660
+ }
4183
4661
  };
4184
4662
  }
4185
4663
  function deleteBranchesTask(branches, forceDelete = false) {
@@ -4204,7 +4682,7 @@ function deleteBranchTask(branch, forceDelete = false) {
4204
4682
  parser(stdOut, stdErr) {
4205
4683
  return parseBranchDeletions(stdOut, stdErr).branches[branch];
4206
4684
  },
4207
- onError({ exitCode, stdErr, stdOut }, error, _, fail) {
4685
+ onError({ exitCode, stdErr, stdOut }, error, _2, fail) {
4208
4686
  if (!hasBranchDeletionError(String(error), exitCode)) {
4209
4687
  return fail(error);
4210
4688
  }
@@ -4225,12 +4703,16 @@ var init_branch = __esm({
4225
4703
  init_utils();
4226
4704
  }
4227
4705
  });
4706
+ function toPath(input) {
4707
+ const path2 = input.trim().replace(/^["']|["']$/g, "");
4708
+ return path2 && normalize(path2);
4709
+ }
4228
4710
  var parseCheckIgnore;
4229
4711
  var init_CheckIgnore = __esm({
4230
4712
  "src/lib/responses/CheckIgnore.ts"() {
4231
4713
  "use strict";
4232
4714
  parseCheckIgnore = (text) => {
4233
- return text.split(/\n/g).map((line) => line.trim()).filter((file) => !!file);
4715
+ return text.split(/\n/g).map(toPath).filter(Boolean);
4234
4716
  };
4235
4717
  }
4236
4718
  });
@@ -4251,35 +4733,6 @@ var init_check_ignore = __esm({
4251
4733
  init_CheckIgnore();
4252
4734
  }
4253
4735
  });
4254
- var clone_exports = {};
4255
- __export(clone_exports, {
4256
- cloneMirrorTask: () => cloneMirrorTask,
4257
- cloneTask: () => cloneTask
4258
- });
4259
- function disallowedCommand(command) {
4260
- return /^--upload-pack(=|$)/.test(command);
4261
- }
4262
- function cloneTask(repo, directory, customArgs) {
4263
- const commands = ["clone", ...customArgs];
4264
- filterString(repo) && commands.push(repo);
4265
- filterString(directory) && commands.push(directory);
4266
- const banned = commands.find(disallowedCommand);
4267
- if (banned) {
4268
- return configurationErrorTask(`git.fetch: potential exploit argument blocked.`);
4269
- }
4270
- return straightThroughStringTask(commands);
4271
- }
4272
- function cloneMirrorTask(repo, directory, customArgs) {
4273
- append(customArgs, "--mirror");
4274
- return cloneTask(repo, directory, customArgs);
4275
- }
4276
- var init_clone = __esm({
4277
- "src/lib/tasks/clone.ts"() {
4278
- "use strict";
4279
- init_task();
4280
- init_utils();
4281
- }
4282
- });
4283
4736
  function parseFetchResult(stdOut, stdErr) {
4284
4737
  const result = {
4285
4738
  raw: stdOut,
@@ -4335,7 +4788,7 @@ var fetch_exports = {};
4335
4788
  __export(fetch_exports, {
4336
4789
  fetchTask: () => fetchTask
4337
4790
  });
4338
- function disallowedCommand2(command) {
4791
+ function disallowedCommand(command) {
4339
4792
  return /^--upload-pack(=|$)/.test(command);
4340
4793
  }
4341
4794
  function fetchTask(remote, branch, customArgs) {
@@ -4343,7 +4796,7 @@ function fetchTask(remote, branch, customArgs) {
4343
4796
  if (remote && branch) {
4344
4797
  commands.push(remote, branch);
4345
4798
  }
4346
- const banned = commands.find(disallowedCommand2);
4799
+ const banned = commands.find(disallowedCommand);
4347
4800
  if (banned) {
4348
4801
  return configurationErrorTask(`git.fetch: potential exploit argument blocked.`);
4349
4802
  }
@@ -4436,7 +4889,7 @@ function parseGetRemotes(text) {
4436
4889
  function parseGetRemotesVerbose(text) {
4437
4890
  const remotes = {};
4438
4891
  forEach(text, ([name, url, purpose]) => {
4439
- if (!remotes.hasOwnProperty(name)) {
4892
+ if (!Object.hasOwn(remotes, name)) {
4440
4893
  remotes[name] = {
4441
4894
  name,
4442
4895
  refs: { fetch: "", push: "" }
@@ -4559,16 +5012,16 @@ var init_sub_module = __esm({
4559
5012
  init_task();
4560
5013
  }
4561
5014
  });
4562
- function singleSorted(a, b) {
4563
- const aIsNum = isNaN(a);
4564
- const bIsNum = isNaN(b);
5015
+ function singleSorted(a, b2) {
5016
+ const aIsNum = Number.isNaN(a);
5017
+ const bIsNum = Number.isNaN(b2);
4565
5018
  if (aIsNum !== bIsNum) {
4566
5019
  return aIsNum ? 1 : -1;
4567
5020
  }
4568
- return aIsNum ? sorted(a, b) : 0;
5021
+ return aIsNum ? sorted(a, b2) : 0;
4569
5022
  }
4570
- function sorted(a, b) {
4571
- return a === b ? 0 : a > b ? 1 : -1;
5023
+ function sorted(a, b2) {
5024
+ return a === b2 ? 0 : a > b2 ? 1 : -1;
4572
5025
  }
4573
5026
  function trimmed(input) {
4574
5027
  return input.trim();
@@ -4599,8 +5052,8 @@ var init_TagList = __esm({
4599
5052
  if (partsA.length === 1 || partsB.length === 1) {
4600
5053
  return singleSorted(toNumber(partsA[0]), toNumber(partsB[0]));
4601
5054
  }
4602
- for (let i = 0, l = Math.max(partsA.length, partsB.length); i < l; i++) {
4603
- 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]));
4604
5057
  if (diff) {
4605
5058
  return diff;
4606
5059
  }
@@ -4659,7 +5112,7 @@ var require_git = __commonJS2({
4659
5112
  var { GitExecutor: GitExecutor2 } = (init_git_executor(), __toCommonJS(git_executor_exports));
4660
5113
  var { SimpleGitApi: SimpleGitApi2 } = (init_simple_git_api(), __toCommonJS(simple_git_api_exports));
4661
5114
  var { Scheduler: Scheduler2 } = (init_scheduler(), __toCommonJS(scheduler_exports));
4662
- var { configurationErrorTask: configurationErrorTask2 } = (init_task(), __toCommonJS(task_exports));
5115
+ var { adhocExecTask: adhocExecTask2, configurationErrorTask: configurationErrorTask2 } = (init_task(), __toCommonJS(task_exports));
4663
5116
  var {
4664
5117
  asArray: asArray2,
4665
5118
  filterArray: filterArray2,
@@ -4680,7 +5133,6 @@ var require_git = __commonJS2({
4680
5133
  } = (init_branch(), __toCommonJS(branch_exports));
4681
5134
  var { checkIgnoreTask: checkIgnoreTask2 } = (init_check_ignore(), __toCommonJS(check_ignore_exports));
4682
5135
  var { checkIsRepoTask: checkIsRepoTask2 } = (init_check_is_repo(), __toCommonJS(check_is_repo_exports));
4683
- var { cloneTask: cloneTask2, cloneMirrorTask: cloneMirrorTask2 } = (init_clone(), __toCommonJS(clone_exports));
4684
5136
  var { cleanWithOptionsTask: cleanWithOptionsTask2, isCleanOptionsArray: isCleanOptionsArray2 } = (init_clean(), __toCommonJS(clean_exports));
4685
5137
  var { diffSummaryTask: diffSummaryTask2 } = (init_diff(), __toCommonJS(diff_exports));
4686
5138
  var { fetchTask: fetchTask2 } = (init_fetch(), __toCommonJS(fetch_exports));
@@ -4735,24 +5187,6 @@ var require_git = __commonJS2({
4735
5187
  trailingFunctionArgument2(arguments)
4736
5188
  );
4737
5189
  };
4738
- function createCloneTask(api, task, repoPath, localPath) {
4739
- if (typeof repoPath !== "string") {
4740
- return configurationErrorTask2(`git.${api}() requires a string 'repoPath'`);
4741
- }
4742
- return task(repoPath, filterType2(localPath, filterString2), getTrailingOptions2(arguments));
4743
- }
4744
- Git2.prototype.clone = function() {
4745
- return this._runTask(
4746
- createCloneTask("clone", cloneTask2, ...arguments),
4747
- trailingFunctionArgument2(arguments)
4748
- );
4749
- };
4750
- Git2.prototype.mirror = function() {
4751
- return this._runTask(
4752
- createCloneTask("mirror", cloneMirrorTask2, ...arguments),
4753
- trailingFunctionArgument2(arguments)
4754
- );
4755
- };
4756
5190
  Git2.prototype.mv = function(from, to) {
4757
5191
  return this._runTask(moveTask2(from, to), trailingFunctionArgument2(arguments));
4758
5192
  };
@@ -4785,10 +5219,13 @@ var require_git = __commonJS2({
4785
5219
  );
4786
5220
  };
4787
5221
  Git2.prototype.silent = function(silence) {
4788
- console.warn(
4789
- "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
+ )
4790
5228
  );
4791
- return this;
4792
5229
  };
4793
5230
  Git2.prototype.tags = function(options, then) {
4794
5231
  return this._runTask(
@@ -4852,9 +5289,9 @@ var require_git = __commonJS2({
4852
5289
  Git2.prototype.raw = function(commands) {
4853
5290
  const createRestCommands = !Array.isArray(commands);
4854
5291
  const command = [].slice.call(createRestCommands ? arguments : commands, 0);
4855
- for (let i = 0; i < command.length && createRestCommands; i++) {
4856
- if (!filterPrimitives2(command[i])) {
4857
- 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);
4858
5295
  break;
4859
5296
  }
4860
5297
  }
@@ -5014,7 +5451,13 @@ var require_git = __commonJS2({
5014
5451
  return this._runTask(task);
5015
5452
  };
5016
5453
  Git2.prototype.clearQueue = function() {
5017
- 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
+ );
5018
5461
  };
5019
5462
  Git2.prototype.checkIgnore = function(pathnames, then) {
5020
5463
  return this._runTask(
@@ -5031,7 +5474,6 @@ var require_git = __commonJS2({
5031
5474
  module.exports = Git2;
5032
5475
  }
5033
5476
  });
5034
- init_pathspec();
5035
5477
  init_git_error();
5036
5478
  var GitConstructError = class extends GitError {
5037
5479
  constructor(config, message) {
@@ -5081,57 +5523,15 @@ function abortPlugin(signal) {
5081
5523
  };
5082
5524
  return [onSpawnBefore, onSpawnAfter];
5083
5525
  }
5084
- function isConfigSwitch(arg) {
5085
- return typeof arg === "string" && arg.trim().toLowerCase() === "-c";
5086
- }
5087
- function preventProtocolOverride(arg, next) {
5088
- if (!isConfigSwitch(arg)) {
5089
- return;
5090
- }
5091
- if (!/^\s*protocol(.[a-z]+)?.allow/.test(next)) {
5092
- return;
5093
- }
5094
- throw new GitPluginError(
5095
- void 0,
5096
- "unsafe",
5097
- "Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol"
5098
- );
5099
- }
5100
- function preventUploadPack(arg, method) {
5101
- if (/^\s*--(upload|receive)-pack/.test(arg)) {
5102
- throw new GitPluginError(
5103
- void 0,
5104
- "unsafe",
5105
- `Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack`
5106
- );
5107
- }
5108
- if (method === "clone" && /^\s*-u\b/.test(arg)) {
5109
- throw new GitPluginError(
5110
- void 0,
5111
- "unsafe",
5112
- `Use of clone with option -u is not permitted without enabling allowUnsafePack`
5113
- );
5114
- }
5115
- if (method === "push" && /^\s*--exec\b/.test(arg)) {
5116
- throw new GitPluginError(
5117
- void 0,
5118
- "unsafe",
5119
- `Use of push with option --exec is not permitted without enabling allowUnsafePack`
5120
- );
5121
- }
5122
- }
5123
- function blockUnsafeOperationsPlugin({
5124
- allowUnsafeProtocolOverride = false,
5125
- allowUnsafePack = false
5126
- } = {}) {
5526
+ function blockUnsafeOperationsPlugin(options = {}) {
5127
5527
  return {
5128
5528
  type: "spawn.args",
5129
- action(args, context) {
5130
- args.forEach((current, index) => {
5131
- const next = index < args.length ? args[index + 1] : "";
5132
- allowUnsafeProtocolOverride || preventProtocolOverride(current, next);
5133
- allowUnsafePack || preventUploadPack(current, context.method);
5134
- });
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
+ }
5135
5535
  return args;
5136
5536
  }
5137
5537
  };
@@ -5189,27 +5589,25 @@ function completionDetectionPlugin({
5189
5589
  }
5190
5590
  return {
5191
5591
  type: "spawn.after",
5192
- action(_0, _1) {
5193
- return __async(this, arguments, function* (_data, { spawned, close }) {
5194
- var _a3, _b;
5195
- const events = createEvents();
5196
- let deferClose = true;
5197
- let quickClose = () => void (deferClose = false);
5198
- (_a3 = spawned.stdout) == null ? void 0 : _a3.on("data", quickClose);
5199
- (_b = spawned.stderr) == null ? void 0 : _b.on("data", quickClose);
5200
- spawned.on("error", quickClose);
5201
- spawned.on("close", (code) => events.close(code));
5202
- spawned.on("exit", (code) => events.exit(code));
5203
- try {
5204
- yield events.result;
5205
- if (deferClose) {
5206
- yield delay(50);
5207
- }
5208
- close(events.exitCode);
5209
- } catch (err) {
5210
- 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);
5211
5606
  }
5212
- });
5607
+ close(events.exitCode);
5608
+ } catch (err) {
5609
+ close(events.exitCode, err);
5610
+ }
5213
5611
  }
5214
5612
  };
5215
5613
  }
@@ -5217,7 +5615,7 @@ init_utils();
5217
5615
  var WRONG_NUMBER_ERR = `Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings`;
5218
5616
  var WRONG_CHARS_ERR = `Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option`;
5219
5617
  function isBadArgument(arg) {
5220
- return !arg || !/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(arg);
5618
+ return !arg || !/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(arg);
5221
5619
  }
5222
5620
  function toBinaryConfig(input, allowUnsafe) {
5223
5621
  if (input.length < 1 || input.length > 2) {
@@ -5362,7 +5760,7 @@ function spawnOptionsPlugin(spawnOptions) {
5362
5760
  return {
5363
5761
  type: "spawn.options",
5364
5762
  action(data) {
5365
- return __spreadValues(__spreadValues({}, options), data);
5763
+ return { ...options, ...data };
5366
5764
  }
5367
5765
  };
5368
5766
  }
@@ -5402,7 +5800,6 @@ function timeoutPlugin({
5402
5800
  };
5403
5801
  }
5404
5802
  }
5405
- init_pathspec();
5406
5803
  function suffixPathsPlugin() {
5407
5804
  return {
5408
5805
  type: "spawn.args",
@@ -5412,15 +5809,15 @@ function suffixPathsPlugin() {
5412
5809
  function append2(args) {
5413
5810
  (suffix = suffix || []).push(...args);
5414
5811
  }
5415
- for (let i = 0; i < data.length; i++) {
5416
- const param = data[i];
5417
- if (isPathSpec(param)) {
5418
- 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));
5419
5816
  continue;
5420
5817
  }
5421
5818
  if (param === "--") {
5422
5819
  append2(
5423
- data.slice(i + 1).flatMap((item) => isPathSpec(item) && toPaths(item) || item)
5820
+ data.slice(i2 + 1).flatMap((item) => r(item) && o(item) || item)
5424
5821
  );
5425
5822
  break;
5426
5823
  }
@@ -5449,12 +5846,12 @@ function gitInstanceFactory(baseDir, options) {
5449
5846
  plugins.add(commandConfigPrefixingPlugin(config.config));
5450
5847
  }
5451
5848
  plugins.add(blockUnsafeOperationsPlugin(config.unsafe));
5452
- plugins.add(suffixPathsPlugin());
5453
5849
  plugins.add(completionDetectionPlugin(config.completion));
5454
5850
  config.abort && plugins.add(abortPlugin(config.abort));
5455
5851
  config.progress && plugins.add(progressMonitorPlugin(config.progress));
5456
5852
  config.timeout && plugins.add(timeoutPlugin(config.timeout));
5457
5853
  config.spawnOptions && plugins.add(spawnOptionsPlugin(config.spawnOptions));
5854
+ plugins.add(suffixPathsPlugin());
5458
5855
  plugins.add(errorDetectionPlugin(errorDetectionHandler(true)));
5459
5856
  config.errors && plugins.add(errorDetectionPlugin(config.errors));
5460
5857
  customBinaryPlugin(plugins, config.binary, (_a2 = config.unsafe) == null ? void 0 : _a2.allowUnsafeCustomBinary);
@@ -5468,11 +5865,11 @@ import { createHash } from "crypto";
5468
5865
  import fs from "fs";
5469
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
  }))
@@ -5931,7 +6328,7 @@ function getBaseEnvironmentInfo() {
5931
6328
  ci: getCIInfo()
5932
6329
  };
5933
6330
  }
5934
- function registerInterruptHandler(client, getRunId) {
6331
+ function registerInterruptHandler(client, getRunId, getShard) {
5935
6332
  let completed = false;
5936
6333
  const handler = async (signal) => {
5937
6334
  if (completed) {
@@ -5944,7 +6341,8 @@ function registerInterruptHandler(client, getRunId) {
5944
6341
  try {
5945
6342
  await client.completeRun(runId, {
5946
6343
  status: "interrupted",
5947
- endedAt: (/* @__PURE__ */ new Date()).toISOString()
6344
+ endedAt: (/* @__PURE__ */ new Date()).toISOString(),
6345
+ shard: getShard == null ? void 0 : getShard()
5948
6346
  });
5949
6347
  } catch {
5950
6348
  }
@@ -6127,6 +6525,8 @@ var SupatestCypressReporter = class {
6127
6525
  projectId: options.projectId || process.env.SUPATEST_PROJECT_ID || "",
6128
6526
  apiKey: options.apiKey || process.env.SUPATEST_API_KEY || "",
6129
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(),
6130
6530
  uploadAssets: options.uploadAssets ?? true,
6131
6531
  maxConcurrentUploads: options.maxConcurrentUploads ?? DEFAULT_MAX_CONCURRENT_UPLOADS,
6132
6532
  retryAttempts: options.retryAttempts ?? DEFAULT_RETRY_ATTEMPTS,
@@ -6163,7 +6563,9 @@ var SupatestCypressReporter = class {
6163
6563
  try {
6164
6564
  const runRequest = {
6165
6565
  projectId: this.options.projectId,
6566
+ runGroupId: this.options.runGroupId,
6166
6567
  startedAt: this.startedAt,
6568
+ shard: this.options.shard,
6167
6569
  cypress: {
6168
6570
  version: this.cypressVersion || "unknown",
6169
6571
  browser: this.browserName || "electron"
@@ -6186,7 +6588,8 @@ var SupatestCypressReporter = class {
6186
6588
  this.runId = response.runId;
6187
6589
  this.unregisterInterruptHandler = registerInterruptHandler(
6188
6590
  this.client,
6189
- () => this.runId
6591
+ () => this.runId,
6592
+ () => this.options.shard
6190
6593
  );
6191
6594
  logInfo(`Run ${this.runId} started (${details.specs.length} spec files)`);
6192
6595
  } catch (error) {
@@ -6228,6 +6631,7 @@ var SupatestCypressReporter = class {
6228
6631
  await this.client.completeRun(this.runId, {
6229
6632
  status: (results == null ? void 0 : results.status) === "finished" ? "complete" : "errored",
6230
6633
  endedAt: (results == null ? void 0 : results.endedTestsAt) ?? (/* @__PURE__ */ new Date()).toISOString(),
6634
+ shard: this.options.shard,
6231
6635
  summary,
6232
6636
  timing: {
6233
6637
  totalDurationMs: (results == null ? void 0 : results.totalDuration) ?? 0,
@@ -6415,19 +6819,19 @@ var SupatestCypressReporter = class {
6415
6819
  testResultId,
6416
6820
  attachments: attachments.map((a) => a.meta)
6417
6821
  });
6418
- const uploadItems = uploads.map((u, i) => ({
6822
+ const uploadItems = uploads.map((u, i2) => ({
6419
6823
  signedUrl: u.signedUrl,
6420
- filePath: attachments[i].path,
6421
- contentType: attachments[i].meta.contentType
6824
+ filePath: attachments[i2].path,
6825
+ contentType: attachments[i2].meta.contentType
6422
6826
  }));
6423
6827
  const results = await this.uploader.uploadBatch(uploadItems, uploads);
6424
- const failures = results.filter((r) => !r.success);
6828
+ const failures = results.filter((r2) => !r2.success);
6425
6829
  if (failures.length > 0) {
6426
6830
  failures.forEach((failure) => {
6427
6831
  const attachment = attachments.find(
6428
- (_, i) => {
6832
+ (_2, i2) => {
6429
6833
  var _a2;
6430
- return ((_a2 = uploads[i]) == null ? void 0 : _a2.attachmentId) === failure.attachmentId;
6834
+ return ((_a2 = uploads[i2]) == null ? void 0 : _a2.attachmentId) === failure.attachmentId;
6431
6835
  }
6432
6836
  );
6433
6837
  this.errorCollector.recordError(
@@ -6456,6 +6860,14 @@ var SupatestCypressReporter = class {
6456
6860
  async getGitInfo() {
6457
6861
  return getGitInfoWithCI(this.rootDir);
6458
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;
6868
+ }
6869
+ return { current, total };
6870
+ }
6459
6871
  };
6460
6872
  function supatestPlugin(on, config, options = {}) {
6461
6873
  const reporter = new SupatestCypressReporter(options);