xtrm-tools 2.1.16 → 2.1.20

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.
@@ -1202,8 +1202,8 @@ var require_command = __commonJS({
1202
1202
  "use strict";
1203
1203
  var EventEmitter2 = require("events").EventEmitter;
1204
1204
  var childProcess = require("child_process");
1205
- var path17 = require("path");
1206
- var fs18 = require("fs");
1205
+ var path18 = require("path");
1206
+ var fs19 = require("fs");
1207
1207
  var process19 = require("process");
1208
1208
  var { Argument: Argument2, humanReadableArgName } = require_argument();
1209
1209
  var { CommanderError: CommanderError2 } = require_error();
@@ -2197,7 +2197,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2197
2197
  * @param {string} subcommandName
2198
2198
  */
2199
2199
  _checkForMissingExecutable(executableFile, executableDir, subcommandName) {
2200
- if (fs18.existsSync(executableFile)) return;
2200
+ if (fs19.existsSync(executableFile)) return;
2201
2201
  const executableDirMessage = executableDir ? `searched for local subcommand relative to directory '${executableDir}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory";
2202
2202
  const executableMissing = `'${executableFile}' does not exist
2203
2203
  - if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
@@ -2215,11 +2215,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
2215
2215
  let launchWithNode = false;
2216
2216
  const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
2217
2217
  function findFile(baseDir, baseName) {
2218
- const localBin = path17.resolve(baseDir, baseName);
2219
- if (fs18.existsSync(localBin)) return localBin;
2220
- if (sourceExt.includes(path17.extname(baseName))) return void 0;
2218
+ const localBin = path18.resolve(baseDir, baseName);
2219
+ if (fs19.existsSync(localBin)) return localBin;
2220
+ if (sourceExt.includes(path18.extname(baseName))) return void 0;
2221
2221
  const foundExt = sourceExt.find(
2222
- (ext) => fs18.existsSync(`${localBin}${ext}`)
2222
+ (ext) => fs19.existsSync(`${localBin}${ext}`)
2223
2223
  );
2224
2224
  if (foundExt) return `${localBin}${foundExt}`;
2225
2225
  return void 0;
@@ -2231,21 +2231,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
2231
2231
  if (this._scriptPath) {
2232
2232
  let resolvedScriptPath;
2233
2233
  try {
2234
- resolvedScriptPath = fs18.realpathSync(this._scriptPath);
2234
+ resolvedScriptPath = fs19.realpathSync(this._scriptPath);
2235
2235
  } catch {
2236
2236
  resolvedScriptPath = this._scriptPath;
2237
2237
  }
2238
- executableDir = path17.resolve(
2239
- path17.dirname(resolvedScriptPath),
2238
+ executableDir = path18.resolve(
2239
+ path18.dirname(resolvedScriptPath),
2240
2240
  executableDir
2241
2241
  );
2242
2242
  }
2243
2243
  if (executableDir) {
2244
2244
  let localFile = findFile(executableDir, executableFile);
2245
2245
  if (!localFile && !subcommand._executableFile && this._scriptPath) {
2246
- const legacyName = path17.basename(
2246
+ const legacyName = path18.basename(
2247
2247
  this._scriptPath,
2248
- path17.extname(this._scriptPath)
2248
+ path18.extname(this._scriptPath)
2249
2249
  );
2250
2250
  if (legacyName !== this._name) {
2251
2251
  localFile = findFile(
@@ -2256,7 +2256,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2256
2256
  }
2257
2257
  executableFile = localFile || executableFile;
2258
2258
  }
2259
- launchWithNode = sourceExt.includes(path17.extname(executableFile));
2259
+ launchWithNode = sourceExt.includes(path18.extname(executableFile));
2260
2260
  let proc;
2261
2261
  if (process19.platform !== "win32") {
2262
2262
  if (launchWithNode) {
@@ -3171,7 +3171,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
3171
3171
  * @return {Command}
3172
3172
  */
3173
3173
  nameFromFilename(filename) {
3174
- this._name = path17.basename(filename, path17.extname(filename));
3174
+ this._name = path18.basename(filename, path18.extname(filename));
3175
3175
  return this;
3176
3176
  }
3177
3177
  /**
@@ -3185,9 +3185,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
3185
3185
  * @param {string} [path]
3186
3186
  * @return {(string|null|Command)}
3187
3187
  */
3188
- executableDir(path18) {
3189
- if (path18 === void 0) return this._executableDir;
3190
- this._executableDir = path18;
3188
+ executableDir(path19) {
3189
+ if (path19 === void 0) return this._executableDir;
3190
+ this._executableDir = path19;
3191
3191
  return this;
3192
3192
  }
3193
3193
  /**
@@ -5943,8 +5943,8 @@ var require_dist = __commonJS({
5943
5943
  if (Object.getOwnPropertySymbols) {
5944
5944
  var symbols = Object.getOwnPropertySymbols(object2);
5945
5945
  if (enumerableOnly) {
5946
- symbols = symbols.filter(function(sym2) {
5947
- return Object.getOwnPropertyDescriptor(object2, sym2).enumerable;
5946
+ symbols = symbols.filter(function(sym3) {
5947
+ return Object.getOwnPropertyDescriptor(object2, sym3).enumerable;
5948
5948
  });
5949
5949
  }
5950
5950
  keys.push.apply(keys, symbols);
@@ -11639,54 +11639,54 @@ var require_polyfills = __commonJS({
11639
11639
  }
11640
11640
  var chdir;
11641
11641
  module2.exports = patch;
11642
- function patch(fs18) {
11642
+ function patch(fs19) {
11643
11643
  if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
11644
- patchLchmod(fs18);
11645
- }
11646
- if (!fs18.lutimes) {
11647
- patchLutimes(fs18);
11648
- }
11649
- fs18.chown = chownFix(fs18.chown);
11650
- fs18.fchown = chownFix(fs18.fchown);
11651
- fs18.lchown = chownFix(fs18.lchown);
11652
- fs18.chmod = chmodFix(fs18.chmod);
11653
- fs18.fchmod = chmodFix(fs18.fchmod);
11654
- fs18.lchmod = chmodFix(fs18.lchmod);
11655
- fs18.chownSync = chownFixSync(fs18.chownSync);
11656
- fs18.fchownSync = chownFixSync(fs18.fchownSync);
11657
- fs18.lchownSync = chownFixSync(fs18.lchownSync);
11658
- fs18.chmodSync = chmodFixSync(fs18.chmodSync);
11659
- fs18.fchmodSync = chmodFixSync(fs18.fchmodSync);
11660
- fs18.lchmodSync = chmodFixSync(fs18.lchmodSync);
11661
- fs18.stat = statFix(fs18.stat);
11662
- fs18.fstat = statFix(fs18.fstat);
11663
- fs18.lstat = statFix(fs18.lstat);
11664
- fs18.statSync = statFixSync(fs18.statSync);
11665
- fs18.fstatSync = statFixSync(fs18.fstatSync);
11666
- fs18.lstatSync = statFixSync(fs18.lstatSync);
11667
- if (fs18.chmod && !fs18.lchmod) {
11668
- fs18.lchmod = function(path17, mode, cb) {
11644
+ patchLchmod(fs19);
11645
+ }
11646
+ if (!fs19.lutimes) {
11647
+ patchLutimes(fs19);
11648
+ }
11649
+ fs19.chown = chownFix(fs19.chown);
11650
+ fs19.fchown = chownFix(fs19.fchown);
11651
+ fs19.lchown = chownFix(fs19.lchown);
11652
+ fs19.chmod = chmodFix(fs19.chmod);
11653
+ fs19.fchmod = chmodFix(fs19.fchmod);
11654
+ fs19.lchmod = chmodFix(fs19.lchmod);
11655
+ fs19.chownSync = chownFixSync(fs19.chownSync);
11656
+ fs19.fchownSync = chownFixSync(fs19.fchownSync);
11657
+ fs19.lchownSync = chownFixSync(fs19.lchownSync);
11658
+ fs19.chmodSync = chmodFixSync(fs19.chmodSync);
11659
+ fs19.fchmodSync = chmodFixSync(fs19.fchmodSync);
11660
+ fs19.lchmodSync = chmodFixSync(fs19.lchmodSync);
11661
+ fs19.stat = statFix(fs19.stat);
11662
+ fs19.fstat = statFix(fs19.fstat);
11663
+ fs19.lstat = statFix(fs19.lstat);
11664
+ fs19.statSync = statFixSync(fs19.statSync);
11665
+ fs19.fstatSync = statFixSync(fs19.fstatSync);
11666
+ fs19.lstatSync = statFixSync(fs19.lstatSync);
11667
+ if (fs19.chmod && !fs19.lchmod) {
11668
+ fs19.lchmod = function(path18, mode, cb) {
11669
11669
  if (cb) process.nextTick(cb);
11670
11670
  };
11671
- fs18.lchmodSync = function() {
11671
+ fs19.lchmodSync = function() {
11672
11672
  };
11673
11673
  }
11674
- if (fs18.chown && !fs18.lchown) {
11675
- fs18.lchown = function(path17, uid, gid, cb) {
11674
+ if (fs19.chown && !fs19.lchown) {
11675
+ fs19.lchown = function(path18, uid, gid, cb) {
11676
11676
  if (cb) process.nextTick(cb);
11677
11677
  };
11678
- fs18.lchownSync = function() {
11678
+ fs19.lchownSync = function() {
11679
11679
  };
11680
11680
  }
11681
11681
  if (platform2 === "win32") {
11682
- fs18.rename = typeof fs18.rename !== "function" ? fs18.rename : (function(fs$rename) {
11682
+ fs19.rename = typeof fs19.rename !== "function" ? fs19.rename : (function(fs$rename) {
11683
11683
  function rename(from, to, cb) {
11684
11684
  var start = Date.now();
11685
11685
  var backoff = 0;
11686
11686
  fs$rename(from, to, function CB(er) {
11687
11687
  if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
11688
11688
  setTimeout(function() {
11689
- fs18.stat(to, function(stater, st) {
11689
+ fs19.stat(to, function(stater, st) {
11690
11690
  if (stater && stater.code === "ENOENT")
11691
11691
  fs$rename(from, to, CB);
11692
11692
  else
@@ -11702,9 +11702,9 @@ var require_polyfills = __commonJS({
11702
11702
  }
11703
11703
  if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
11704
11704
  return rename;
11705
- })(fs18.rename);
11705
+ })(fs19.rename);
11706
11706
  }
11707
- fs18.read = typeof fs18.read !== "function" ? fs18.read : (function(fs$read) {
11707
+ fs19.read = typeof fs19.read !== "function" ? fs19.read : (function(fs$read) {
11708
11708
  function read(fd, buffer, offset, length, position, callback_) {
11709
11709
  var callback;
11710
11710
  if (callback_ && typeof callback_ === "function") {
@@ -11712,22 +11712,22 @@ var require_polyfills = __commonJS({
11712
11712
  callback = function(er, _, __) {
11713
11713
  if (er && er.code === "EAGAIN" && eagCounter < 10) {
11714
11714
  eagCounter++;
11715
- return fs$read.call(fs18, fd, buffer, offset, length, position, callback);
11715
+ return fs$read.call(fs19, fd, buffer, offset, length, position, callback);
11716
11716
  }
11717
11717
  callback_.apply(this, arguments);
11718
11718
  };
11719
11719
  }
11720
- return fs$read.call(fs18, fd, buffer, offset, length, position, callback);
11720
+ return fs$read.call(fs19, fd, buffer, offset, length, position, callback);
11721
11721
  }
11722
11722
  if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
11723
11723
  return read;
11724
- })(fs18.read);
11725
- fs18.readSync = typeof fs18.readSync !== "function" ? fs18.readSync : /* @__PURE__ */ (function(fs$readSync) {
11724
+ })(fs19.read);
11725
+ fs19.readSync = typeof fs19.readSync !== "function" ? fs19.readSync : /* @__PURE__ */ (function(fs$readSync) {
11726
11726
  return function(fd, buffer, offset, length, position) {
11727
11727
  var eagCounter = 0;
11728
11728
  while (true) {
11729
11729
  try {
11730
- return fs$readSync.call(fs18, fd, buffer, offset, length, position);
11730
+ return fs$readSync.call(fs19, fd, buffer, offset, length, position);
11731
11731
  } catch (er) {
11732
11732
  if (er.code === "EAGAIN" && eagCounter < 10) {
11733
11733
  eagCounter++;
@@ -11737,11 +11737,11 @@ var require_polyfills = __commonJS({
11737
11737
  }
11738
11738
  }
11739
11739
  };
11740
- })(fs18.readSync);
11741
- function patchLchmod(fs19) {
11742
- fs19.lchmod = function(path17, mode, callback) {
11743
- fs19.open(
11744
- path17,
11740
+ })(fs19.readSync);
11741
+ function patchLchmod(fs20) {
11742
+ fs20.lchmod = function(path18, mode, callback) {
11743
+ fs20.open(
11744
+ path18,
11745
11745
  constants.O_WRONLY | constants.O_SYMLINK,
11746
11746
  mode,
11747
11747
  function(err, fd) {
@@ -11749,80 +11749,80 @@ var require_polyfills = __commonJS({
11749
11749
  if (callback) callback(err);
11750
11750
  return;
11751
11751
  }
11752
- fs19.fchmod(fd, mode, function(err2) {
11753
- fs19.close(fd, function(err22) {
11752
+ fs20.fchmod(fd, mode, function(err2) {
11753
+ fs20.close(fd, function(err22) {
11754
11754
  if (callback) callback(err2 || err22);
11755
11755
  });
11756
11756
  });
11757
11757
  }
11758
11758
  );
11759
11759
  };
11760
- fs19.lchmodSync = function(path17, mode) {
11761
- var fd = fs19.openSync(path17, constants.O_WRONLY | constants.O_SYMLINK, mode);
11760
+ fs20.lchmodSync = function(path18, mode) {
11761
+ var fd = fs20.openSync(path18, constants.O_WRONLY | constants.O_SYMLINK, mode);
11762
11762
  var threw = true;
11763
11763
  var ret;
11764
11764
  try {
11765
- ret = fs19.fchmodSync(fd, mode);
11765
+ ret = fs20.fchmodSync(fd, mode);
11766
11766
  threw = false;
11767
11767
  } finally {
11768
11768
  if (threw) {
11769
11769
  try {
11770
- fs19.closeSync(fd);
11770
+ fs20.closeSync(fd);
11771
11771
  } catch (er) {
11772
11772
  }
11773
11773
  } else {
11774
- fs19.closeSync(fd);
11774
+ fs20.closeSync(fd);
11775
11775
  }
11776
11776
  }
11777
11777
  return ret;
11778
11778
  };
11779
11779
  }
11780
- function patchLutimes(fs19) {
11781
- if (constants.hasOwnProperty("O_SYMLINK") && fs19.futimes) {
11782
- fs19.lutimes = function(path17, at, mt, cb) {
11783
- fs19.open(path17, constants.O_SYMLINK, function(er, fd) {
11780
+ function patchLutimes(fs20) {
11781
+ if (constants.hasOwnProperty("O_SYMLINK") && fs20.futimes) {
11782
+ fs20.lutimes = function(path18, at, mt, cb) {
11783
+ fs20.open(path18, constants.O_SYMLINK, function(er, fd) {
11784
11784
  if (er) {
11785
11785
  if (cb) cb(er);
11786
11786
  return;
11787
11787
  }
11788
- fs19.futimes(fd, at, mt, function(er2) {
11789
- fs19.close(fd, function(er22) {
11788
+ fs20.futimes(fd, at, mt, function(er2) {
11789
+ fs20.close(fd, function(er22) {
11790
11790
  if (cb) cb(er2 || er22);
11791
11791
  });
11792
11792
  });
11793
11793
  });
11794
11794
  };
11795
- fs19.lutimesSync = function(path17, at, mt) {
11796
- var fd = fs19.openSync(path17, constants.O_SYMLINK);
11795
+ fs20.lutimesSync = function(path18, at, mt) {
11796
+ var fd = fs20.openSync(path18, constants.O_SYMLINK);
11797
11797
  var ret;
11798
11798
  var threw = true;
11799
11799
  try {
11800
- ret = fs19.futimesSync(fd, at, mt);
11800
+ ret = fs20.futimesSync(fd, at, mt);
11801
11801
  threw = false;
11802
11802
  } finally {
11803
11803
  if (threw) {
11804
11804
  try {
11805
- fs19.closeSync(fd);
11805
+ fs20.closeSync(fd);
11806
11806
  } catch (er) {
11807
11807
  }
11808
11808
  } else {
11809
- fs19.closeSync(fd);
11809
+ fs20.closeSync(fd);
11810
11810
  }
11811
11811
  }
11812
11812
  return ret;
11813
11813
  };
11814
- } else if (fs19.futimes) {
11815
- fs19.lutimes = function(_a2, _b, _c, cb) {
11814
+ } else if (fs20.futimes) {
11815
+ fs20.lutimes = function(_a2, _b, _c, cb) {
11816
11816
  if (cb) process.nextTick(cb);
11817
11817
  };
11818
- fs19.lutimesSync = function() {
11818
+ fs20.lutimesSync = function() {
11819
11819
  };
11820
11820
  }
11821
11821
  }
11822
11822
  function chmodFix(orig) {
11823
11823
  if (!orig) return orig;
11824
11824
  return function(target, mode, cb) {
11825
- return orig.call(fs18, target, mode, function(er) {
11825
+ return orig.call(fs19, target, mode, function(er) {
11826
11826
  if (chownErOk(er)) er = null;
11827
11827
  if (cb) cb.apply(this, arguments);
11828
11828
  });
@@ -11832,7 +11832,7 @@ var require_polyfills = __commonJS({
11832
11832
  if (!orig) return orig;
11833
11833
  return function(target, mode) {
11834
11834
  try {
11835
- return orig.call(fs18, target, mode);
11835
+ return orig.call(fs19, target, mode);
11836
11836
  } catch (er) {
11837
11837
  if (!chownErOk(er)) throw er;
11838
11838
  }
@@ -11841,7 +11841,7 @@ var require_polyfills = __commonJS({
11841
11841
  function chownFix(orig) {
11842
11842
  if (!orig) return orig;
11843
11843
  return function(target, uid, gid, cb) {
11844
- return orig.call(fs18, target, uid, gid, function(er) {
11844
+ return orig.call(fs19, target, uid, gid, function(er) {
11845
11845
  if (chownErOk(er)) er = null;
11846
11846
  if (cb) cb.apply(this, arguments);
11847
11847
  });
@@ -11851,7 +11851,7 @@ var require_polyfills = __commonJS({
11851
11851
  if (!orig) return orig;
11852
11852
  return function(target, uid, gid) {
11853
11853
  try {
11854
- return orig.call(fs18, target, uid, gid);
11854
+ return orig.call(fs19, target, uid, gid);
11855
11855
  } catch (er) {
11856
11856
  if (!chownErOk(er)) throw er;
11857
11857
  }
@@ -11871,13 +11871,13 @@ var require_polyfills = __commonJS({
11871
11871
  }
11872
11872
  if (cb) cb.apply(this, arguments);
11873
11873
  }
11874
- return options ? orig.call(fs18, target, options, callback) : orig.call(fs18, target, callback);
11874
+ return options ? orig.call(fs19, target, options, callback) : orig.call(fs19, target, callback);
11875
11875
  };
11876
11876
  }
11877
11877
  function statFixSync(orig) {
11878
11878
  if (!orig) return orig;
11879
11879
  return function(target, options) {
11880
- var stats = options ? orig.call(fs18, target, options) : orig.call(fs18, target);
11880
+ var stats = options ? orig.call(fs19, target, options) : orig.call(fs19, target);
11881
11881
  if (stats) {
11882
11882
  if (stats.uid < 0) stats.uid += 4294967296;
11883
11883
  if (stats.gid < 0) stats.gid += 4294967296;
@@ -11907,16 +11907,16 @@ var require_legacy_streams = __commonJS({
11907
11907
  "use strict";
11908
11908
  var Stream = require("stream").Stream;
11909
11909
  module2.exports = legacy;
11910
- function legacy(fs18) {
11910
+ function legacy(fs19) {
11911
11911
  return {
11912
11912
  ReadStream,
11913
11913
  WriteStream
11914
11914
  };
11915
- function ReadStream(path17, options) {
11916
- if (!(this instanceof ReadStream)) return new ReadStream(path17, options);
11915
+ function ReadStream(path18, options) {
11916
+ if (!(this instanceof ReadStream)) return new ReadStream(path18, options);
11917
11917
  Stream.call(this);
11918
11918
  var self = this;
11919
- this.path = path17;
11919
+ this.path = path18;
11920
11920
  this.fd = null;
11921
11921
  this.readable = true;
11922
11922
  this.paused = false;
@@ -11950,7 +11950,7 @@ var require_legacy_streams = __commonJS({
11950
11950
  });
11951
11951
  return;
11952
11952
  }
11953
- fs18.open(this.path, this.flags, this.mode, function(err, fd) {
11953
+ fs19.open(this.path, this.flags, this.mode, function(err, fd) {
11954
11954
  if (err) {
11955
11955
  self.emit("error", err);
11956
11956
  self.readable = false;
@@ -11961,10 +11961,10 @@ var require_legacy_streams = __commonJS({
11961
11961
  self._read();
11962
11962
  });
11963
11963
  }
11964
- function WriteStream(path17, options) {
11965
- if (!(this instanceof WriteStream)) return new WriteStream(path17, options);
11964
+ function WriteStream(path18, options) {
11965
+ if (!(this instanceof WriteStream)) return new WriteStream(path18, options);
11966
11966
  Stream.call(this);
11967
- this.path = path17;
11967
+ this.path = path18;
11968
11968
  this.fd = null;
11969
11969
  this.writable = true;
11970
11970
  this.flags = "w";
@@ -11989,7 +11989,7 @@ var require_legacy_streams = __commonJS({
11989
11989
  this.busy = false;
11990
11990
  this._queue = [];
11991
11991
  if (this.fd === null) {
11992
- this._open = fs18.open;
11992
+ this._open = fs19.open;
11993
11993
  this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
11994
11994
  this.flush();
11995
11995
  }
@@ -12025,7 +12025,7 @@ var require_clone = __commonJS({
12025
12025
  var require_graceful_fs = __commonJS({
12026
12026
  "../node_modules/graceful-fs/graceful-fs.js"(exports2, module2) {
12027
12027
  "use strict";
12028
- var fs18 = require("fs");
12028
+ var fs19 = require("fs");
12029
12029
  var polyfills = require_polyfills();
12030
12030
  var legacy = require_legacy_streams();
12031
12031
  var clone3 = require_clone();
@@ -12057,12 +12057,12 @@ var require_graceful_fs = __commonJS({
12057
12057
  m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
12058
12058
  console.error(m);
12059
12059
  };
12060
- if (!fs18[gracefulQueue]) {
12060
+ if (!fs19[gracefulQueue]) {
12061
12061
  queue = global[gracefulQueue] || [];
12062
- publishQueue(fs18, queue);
12063
- fs18.close = (function(fs$close) {
12062
+ publishQueue(fs19, queue);
12063
+ fs19.close = (function(fs$close) {
12064
12064
  function close(fd, cb) {
12065
- return fs$close.call(fs18, fd, function(err) {
12065
+ return fs$close.call(fs19, fd, function(err) {
12066
12066
  if (!err) {
12067
12067
  resetQueue();
12068
12068
  }
@@ -12074,48 +12074,48 @@ var require_graceful_fs = __commonJS({
12074
12074
  value: fs$close
12075
12075
  });
12076
12076
  return close;
12077
- })(fs18.close);
12078
- fs18.closeSync = (function(fs$closeSync) {
12077
+ })(fs19.close);
12078
+ fs19.closeSync = (function(fs$closeSync) {
12079
12079
  function closeSync(fd) {
12080
- fs$closeSync.apply(fs18, arguments);
12080
+ fs$closeSync.apply(fs19, arguments);
12081
12081
  resetQueue();
12082
12082
  }
12083
12083
  Object.defineProperty(closeSync, previousSymbol, {
12084
12084
  value: fs$closeSync
12085
12085
  });
12086
12086
  return closeSync;
12087
- })(fs18.closeSync);
12087
+ })(fs19.closeSync);
12088
12088
  if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
12089
12089
  process.on("exit", function() {
12090
- debug(fs18[gracefulQueue]);
12091
- require("assert").equal(fs18[gracefulQueue].length, 0);
12090
+ debug(fs19[gracefulQueue]);
12091
+ require("assert").equal(fs19[gracefulQueue].length, 0);
12092
12092
  });
12093
12093
  }
12094
12094
  }
12095
12095
  var queue;
12096
12096
  if (!global[gracefulQueue]) {
12097
- publishQueue(global, fs18[gracefulQueue]);
12098
- }
12099
- module2.exports = patch(clone3(fs18));
12100
- if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs18.__patched) {
12101
- module2.exports = patch(fs18);
12102
- fs18.__patched = true;
12103
- }
12104
- function patch(fs19) {
12105
- polyfills(fs19);
12106
- fs19.gracefulify = patch;
12107
- fs19.createReadStream = createReadStream;
12108
- fs19.createWriteStream = createWriteStream2;
12109
- var fs$readFile = fs19.readFile;
12110
- fs19.readFile = readFile;
12111
- function readFile(path17, options, cb) {
12097
+ publishQueue(global, fs19[gracefulQueue]);
12098
+ }
12099
+ module2.exports = patch(clone3(fs19));
12100
+ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs19.__patched) {
12101
+ module2.exports = patch(fs19);
12102
+ fs19.__patched = true;
12103
+ }
12104
+ function patch(fs20) {
12105
+ polyfills(fs20);
12106
+ fs20.gracefulify = patch;
12107
+ fs20.createReadStream = createReadStream;
12108
+ fs20.createWriteStream = createWriteStream2;
12109
+ var fs$readFile = fs20.readFile;
12110
+ fs20.readFile = readFile;
12111
+ function readFile(path18, options, cb) {
12112
12112
  if (typeof options === "function")
12113
12113
  cb = options, options = null;
12114
- return go$readFile(path17, options, cb);
12115
- function go$readFile(path18, options2, cb2, startTime) {
12116
- return fs$readFile(path18, options2, function(err) {
12114
+ return go$readFile(path18, options, cb);
12115
+ function go$readFile(path19, options2, cb2, startTime) {
12116
+ return fs$readFile(path19, options2, function(err) {
12117
12117
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
12118
- enqueue([go$readFile, [path18, options2, cb2], err, startTime || Date.now(), Date.now()]);
12118
+ enqueue([go$readFile, [path19, options2, cb2], err, startTime || Date.now(), Date.now()]);
12119
12119
  else {
12120
12120
  if (typeof cb2 === "function")
12121
12121
  cb2.apply(this, arguments);
@@ -12123,16 +12123,16 @@ var require_graceful_fs = __commonJS({
12123
12123
  });
12124
12124
  }
12125
12125
  }
12126
- var fs$writeFile = fs19.writeFile;
12127
- fs19.writeFile = writeFile;
12128
- function writeFile(path17, data, options, cb) {
12126
+ var fs$writeFile = fs20.writeFile;
12127
+ fs20.writeFile = writeFile;
12128
+ function writeFile(path18, data, options, cb) {
12129
12129
  if (typeof options === "function")
12130
12130
  cb = options, options = null;
12131
- return go$writeFile(path17, data, options, cb);
12132
- function go$writeFile(path18, data2, options2, cb2, startTime) {
12133
- return fs$writeFile(path18, data2, options2, function(err) {
12131
+ return go$writeFile(path18, data, options, cb);
12132
+ function go$writeFile(path19, data2, options2, cb2, startTime) {
12133
+ return fs$writeFile(path19, data2, options2, function(err) {
12134
12134
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
12135
- enqueue([go$writeFile, [path18, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
12135
+ enqueue([go$writeFile, [path19, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
12136
12136
  else {
12137
12137
  if (typeof cb2 === "function")
12138
12138
  cb2.apply(this, arguments);
@@ -12140,17 +12140,17 @@ var require_graceful_fs = __commonJS({
12140
12140
  });
12141
12141
  }
12142
12142
  }
12143
- var fs$appendFile = fs19.appendFile;
12143
+ var fs$appendFile = fs20.appendFile;
12144
12144
  if (fs$appendFile)
12145
- fs19.appendFile = appendFile;
12146
- function appendFile(path17, data, options, cb) {
12145
+ fs20.appendFile = appendFile;
12146
+ function appendFile(path18, data, options, cb) {
12147
12147
  if (typeof options === "function")
12148
12148
  cb = options, options = null;
12149
- return go$appendFile(path17, data, options, cb);
12150
- function go$appendFile(path18, data2, options2, cb2, startTime) {
12151
- return fs$appendFile(path18, data2, options2, function(err) {
12149
+ return go$appendFile(path18, data, options, cb);
12150
+ function go$appendFile(path19, data2, options2, cb2, startTime) {
12151
+ return fs$appendFile(path19, data2, options2, function(err) {
12152
12152
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
12153
- enqueue([go$appendFile, [path18, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
12153
+ enqueue([go$appendFile, [path19, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
12154
12154
  else {
12155
12155
  if (typeof cb2 === "function")
12156
12156
  cb2.apply(this, arguments);
@@ -12158,9 +12158,9 @@ var require_graceful_fs = __commonJS({
12158
12158
  });
12159
12159
  }
12160
12160
  }
12161
- var fs$copyFile = fs19.copyFile;
12161
+ var fs$copyFile = fs20.copyFile;
12162
12162
  if (fs$copyFile)
12163
- fs19.copyFile = copyFile;
12163
+ fs20.copyFile = copyFile;
12164
12164
  function copyFile(src, dest, flags, cb) {
12165
12165
  if (typeof flags === "function") {
12166
12166
  cb = flags;
@@ -12178,34 +12178,34 @@ var require_graceful_fs = __commonJS({
12178
12178
  });
12179
12179
  }
12180
12180
  }
12181
- var fs$readdir = fs19.readdir;
12182
- fs19.readdir = readdir;
12181
+ var fs$readdir = fs20.readdir;
12182
+ fs20.readdir = readdir;
12183
12183
  var noReaddirOptionVersions = /^v[0-5]\./;
12184
- function readdir(path17, options, cb) {
12184
+ function readdir(path18, options, cb) {
12185
12185
  if (typeof options === "function")
12186
12186
  cb = options, options = null;
12187
- var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path18, options2, cb2, startTime) {
12188
- return fs$readdir(path18, fs$readdirCallback(
12189
- path18,
12187
+ var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path19, options2, cb2, startTime) {
12188
+ return fs$readdir(path19, fs$readdirCallback(
12189
+ path19,
12190
12190
  options2,
12191
12191
  cb2,
12192
12192
  startTime
12193
12193
  ));
12194
- } : function go$readdir2(path18, options2, cb2, startTime) {
12195
- return fs$readdir(path18, options2, fs$readdirCallback(
12196
- path18,
12194
+ } : function go$readdir2(path19, options2, cb2, startTime) {
12195
+ return fs$readdir(path19, options2, fs$readdirCallback(
12196
+ path19,
12197
12197
  options2,
12198
12198
  cb2,
12199
12199
  startTime
12200
12200
  ));
12201
12201
  };
12202
- return go$readdir(path17, options, cb);
12203
- function fs$readdirCallback(path18, options2, cb2, startTime) {
12202
+ return go$readdir(path18, options, cb);
12203
+ function fs$readdirCallback(path19, options2, cb2, startTime) {
12204
12204
  return function(err, files) {
12205
12205
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
12206
12206
  enqueue([
12207
12207
  go$readdir,
12208
- [path18, options2, cb2],
12208
+ [path19, options2, cb2],
12209
12209
  err,
12210
12210
  startTime || Date.now(),
12211
12211
  Date.now()
@@ -12220,21 +12220,21 @@ var require_graceful_fs = __commonJS({
12220
12220
  }
12221
12221
  }
12222
12222
  if (process.version.substr(0, 4) === "v0.8") {
12223
- var legStreams = legacy(fs19);
12223
+ var legStreams = legacy(fs20);
12224
12224
  ReadStream = legStreams.ReadStream;
12225
12225
  WriteStream = legStreams.WriteStream;
12226
12226
  }
12227
- var fs$ReadStream = fs19.ReadStream;
12227
+ var fs$ReadStream = fs20.ReadStream;
12228
12228
  if (fs$ReadStream) {
12229
12229
  ReadStream.prototype = Object.create(fs$ReadStream.prototype);
12230
12230
  ReadStream.prototype.open = ReadStream$open;
12231
12231
  }
12232
- var fs$WriteStream = fs19.WriteStream;
12232
+ var fs$WriteStream = fs20.WriteStream;
12233
12233
  if (fs$WriteStream) {
12234
12234
  WriteStream.prototype = Object.create(fs$WriteStream.prototype);
12235
12235
  WriteStream.prototype.open = WriteStream$open;
12236
12236
  }
12237
- Object.defineProperty(fs19, "ReadStream", {
12237
+ Object.defineProperty(fs20, "ReadStream", {
12238
12238
  get: function() {
12239
12239
  return ReadStream;
12240
12240
  },
@@ -12244,7 +12244,7 @@ var require_graceful_fs = __commonJS({
12244
12244
  enumerable: true,
12245
12245
  configurable: true
12246
12246
  });
12247
- Object.defineProperty(fs19, "WriteStream", {
12247
+ Object.defineProperty(fs20, "WriteStream", {
12248
12248
  get: function() {
12249
12249
  return WriteStream;
12250
12250
  },
@@ -12255,7 +12255,7 @@ var require_graceful_fs = __commonJS({
12255
12255
  configurable: true
12256
12256
  });
12257
12257
  var FileReadStream = ReadStream;
12258
- Object.defineProperty(fs19, "FileReadStream", {
12258
+ Object.defineProperty(fs20, "FileReadStream", {
12259
12259
  get: function() {
12260
12260
  return FileReadStream;
12261
12261
  },
@@ -12266,7 +12266,7 @@ var require_graceful_fs = __commonJS({
12266
12266
  configurable: true
12267
12267
  });
12268
12268
  var FileWriteStream = WriteStream;
12269
- Object.defineProperty(fs19, "FileWriteStream", {
12269
+ Object.defineProperty(fs20, "FileWriteStream", {
12270
12270
  get: function() {
12271
12271
  return FileWriteStream;
12272
12272
  },
@@ -12276,7 +12276,7 @@ var require_graceful_fs = __commonJS({
12276
12276
  enumerable: true,
12277
12277
  configurable: true
12278
12278
  });
12279
- function ReadStream(path17, options) {
12279
+ function ReadStream(path18, options) {
12280
12280
  if (this instanceof ReadStream)
12281
12281
  return fs$ReadStream.apply(this, arguments), this;
12282
12282
  else
@@ -12296,7 +12296,7 @@ var require_graceful_fs = __commonJS({
12296
12296
  }
12297
12297
  });
12298
12298
  }
12299
- function WriteStream(path17, options) {
12299
+ function WriteStream(path18, options) {
12300
12300
  if (this instanceof WriteStream)
12301
12301
  return fs$WriteStream.apply(this, arguments), this;
12302
12302
  else
@@ -12314,22 +12314,22 @@ var require_graceful_fs = __commonJS({
12314
12314
  }
12315
12315
  });
12316
12316
  }
12317
- function createReadStream(path17, options) {
12318
- return new fs19.ReadStream(path17, options);
12317
+ function createReadStream(path18, options) {
12318
+ return new fs20.ReadStream(path18, options);
12319
12319
  }
12320
- function createWriteStream2(path17, options) {
12321
- return new fs19.WriteStream(path17, options);
12320
+ function createWriteStream2(path18, options) {
12321
+ return new fs20.WriteStream(path18, options);
12322
12322
  }
12323
- var fs$open = fs19.open;
12324
- fs19.open = open;
12325
- function open(path17, flags, mode, cb) {
12323
+ var fs$open = fs20.open;
12324
+ fs20.open = open;
12325
+ function open(path18, flags, mode, cb) {
12326
12326
  if (typeof mode === "function")
12327
12327
  cb = mode, mode = null;
12328
- return go$open(path17, flags, mode, cb);
12329
- function go$open(path18, flags2, mode2, cb2, startTime) {
12330
- return fs$open(path18, flags2, mode2, function(err, fd) {
12328
+ return go$open(path18, flags, mode, cb);
12329
+ function go$open(path19, flags2, mode2, cb2, startTime) {
12330
+ return fs$open(path19, flags2, mode2, function(err, fd) {
12331
12331
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
12332
- enqueue([go$open, [path18, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
12332
+ enqueue([go$open, [path19, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
12333
12333
  else {
12334
12334
  if (typeof cb2 === "function")
12335
12335
  cb2.apply(this, arguments);
@@ -12337,20 +12337,20 @@ var require_graceful_fs = __commonJS({
12337
12337
  });
12338
12338
  }
12339
12339
  }
12340
- return fs19;
12340
+ return fs20;
12341
12341
  }
12342
12342
  function enqueue(elem) {
12343
12343
  debug("ENQUEUE", elem[0].name, elem[1]);
12344
- fs18[gracefulQueue].push(elem);
12344
+ fs19[gracefulQueue].push(elem);
12345
12345
  retry();
12346
12346
  }
12347
12347
  var retryTimer;
12348
12348
  function resetQueue() {
12349
12349
  var now = Date.now();
12350
- for (var i = 0; i < fs18[gracefulQueue].length; ++i) {
12351
- if (fs18[gracefulQueue][i].length > 2) {
12352
- fs18[gracefulQueue][i][3] = now;
12353
- fs18[gracefulQueue][i][4] = now;
12350
+ for (var i = 0; i < fs19[gracefulQueue].length; ++i) {
12351
+ if (fs19[gracefulQueue][i].length > 2) {
12352
+ fs19[gracefulQueue][i][3] = now;
12353
+ fs19[gracefulQueue][i][4] = now;
12354
12354
  }
12355
12355
  }
12356
12356
  retry();
@@ -12358,9 +12358,9 @@ var require_graceful_fs = __commonJS({
12358
12358
  function retry() {
12359
12359
  clearTimeout(retryTimer);
12360
12360
  retryTimer = void 0;
12361
- if (fs18[gracefulQueue].length === 0)
12361
+ if (fs19[gracefulQueue].length === 0)
12362
12362
  return;
12363
- var elem = fs18[gracefulQueue].shift();
12363
+ var elem = fs19[gracefulQueue].shift();
12364
12364
  var fn = elem[0];
12365
12365
  var args = elem[1];
12366
12366
  var err = elem[2];
@@ -12382,7 +12382,7 @@ var require_graceful_fs = __commonJS({
12382
12382
  debug("RETRY", fn.name, args);
12383
12383
  fn.apply(null, args.concat([startTime]));
12384
12384
  } else {
12385
- fs18[gracefulQueue].push(elem);
12385
+ fs19[gracefulQueue].push(elem);
12386
12386
  }
12387
12387
  }
12388
12388
  if (retryTimer === void 0) {
@@ -12397,7 +12397,7 @@ var require_fs = __commonJS({
12397
12397
  "../node_modules/fs-extra/lib/fs/index.js"(exports2) {
12398
12398
  "use strict";
12399
12399
  var u = require_universalify().fromCallback;
12400
- var fs18 = require_graceful_fs();
12400
+ var fs19 = require_graceful_fs();
12401
12401
  var api = [
12402
12402
  "access",
12403
12403
  "appendFile",
@@ -12438,26 +12438,26 @@ var require_fs = __commonJS({
12438
12438
  "utimes",
12439
12439
  "writeFile"
12440
12440
  ].filter((key) => {
12441
- return typeof fs18[key] === "function";
12441
+ return typeof fs19[key] === "function";
12442
12442
  });
12443
- Object.assign(exports2, fs18);
12443
+ Object.assign(exports2, fs19);
12444
12444
  api.forEach((method) => {
12445
- exports2[method] = u(fs18[method]);
12445
+ exports2[method] = u(fs19[method]);
12446
12446
  });
12447
12447
  exports2.exists = function(filename, callback) {
12448
12448
  if (typeof callback === "function") {
12449
- return fs18.exists(filename, callback);
12449
+ return fs19.exists(filename, callback);
12450
12450
  }
12451
12451
  return new Promise((resolve2) => {
12452
- return fs18.exists(filename, resolve2);
12452
+ return fs19.exists(filename, resolve2);
12453
12453
  });
12454
12454
  };
12455
12455
  exports2.read = function(fd, buffer, offset, length, position, callback) {
12456
12456
  if (typeof callback === "function") {
12457
- return fs18.read(fd, buffer, offset, length, position, callback);
12457
+ return fs19.read(fd, buffer, offset, length, position, callback);
12458
12458
  }
12459
12459
  return new Promise((resolve2, reject) => {
12460
- fs18.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
12460
+ fs19.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
12461
12461
  if (err) return reject(err);
12462
12462
  resolve2({ bytesRead, buffer: buffer2 });
12463
12463
  });
@@ -12465,10 +12465,10 @@ var require_fs = __commonJS({
12465
12465
  };
12466
12466
  exports2.write = function(fd, buffer, ...args) {
12467
12467
  if (typeof args[args.length - 1] === "function") {
12468
- return fs18.write(fd, buffer, ...args);
12468
+ return fs19.write(fd, buffer, ...args);
12469
12469
  }
12470
12470
  return new Promise((resolve2, reject) => {
12471
- fs18.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
12471
+ fs19.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
12472
12472
  if (err) return reject(err);
12473
12473
  resolve2({ bytesWritten, buffer: buffer2 });
12474
12474
  });
@@ -12476,10 +12476,10 @@ var require_fs = __commonJS({
12476
12476
  };
12477
12477
  exports2.readv = function(fd, buffers, ...args) {
12478
12478
  if (typeof args[args.length - 1] === "function") {
12479
- return fs18.readv(fd, buffers, ...args);
12479
+ return fs19.readv(fd, buffers, ...args);
12480
12480
  }
12481
12481
  return new Promise((resolve2, reject) => {
12482
- fs18.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
12482
+ fs19.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
12483
12483
  if (err) return reject(err);
12484
12484
  resolve2({ bytesRead, buffers: buffers2 });
12485
12485
  });
@@ -12487,17 +12487,17 @@ var require_fs = __commonJS({
12487
12487
  };
12488
12488
  exports2.writev = function(fd, buffers, ...args) {
12489
12489
  if (typeof args[args.length - 1] === "function") {
12490
- return fs18.writev(fd, buffers, ...args);
12490
+ return fs19.writev(fd, buffers, ...args);
12491
12491
  }
12492
12492
  return new Promise((resolve2, reject) => {
12493
- fs18.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
12493
+ fs19.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
12494
12494
  if (err) return reject(err);
12495
12495
  resolve2({ bytesWritten, buffers: buffers2 });
12496
12496
  });
12497
12497
  });
12498
12498
  };
12499
- if (typeof fs18.realpath.native === "function") {
12500
- exports2.realpath.native = u(fs18.realpath.native);
12499
+ if (typeof fs19.realpath.native === "function") {
12500
+ exports2.realpath.native = u(fs19.realpath.native);
12501
12501
  } else {
12502
12502
  process.emitWarning(
12503
12503
  "fs.realpath.native is not a function. Is fs being monkey-patched?",
@@ -12512,10 +12512,10 @@ var require_fs = __commonJS({
12512
12512
  var require_utils = __commonJS({
12513
12513
  "../node_modules/fs-extra/lib/mkdirs/utils.js"(exports2, module2) {
12514
12514
  "use strict";
12515
- var path17 = require("path");
12515
+ var path18 = require("path");
12516
12516
  module2.exports.checkPath = function checkPath(pth) {
12517
12517
  if (process.platform === "win32") {
12518
- const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path17.parse(pth).root, ""));
12518
+ const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path18.parse(pth).root, ""));
12519
12519
  if (pathHasInvalidWinCharacters) {
12520
12520
  const error49 = new Error(`Path contains invalid characters: ${pth}`);
12521
12521
  error49.code = "EINVAL";
@@ -12530,7 +12530,7 @@ var require_utils = __commonJS({
12530
12530
  var require_make_dir = __commonJS({
12531
12531
  "../node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports2, module2) {
12532
12532
  "use strict";
12533
- var fs18 = require_fs();
12533
+ var fs19 = require_fs();
12534
12534
  var { checkPath } = require_utils();
12535
12535
  var getMode = (options) => {
12536
12536
  const defaults = { mode: 511 };
@@ -12539,14 +12539,14 @@ var require_make_dir = __commonJS({
12539
12539
  };
12540
12540
  module2.exports.makeDir = async (dir, options) => {
12541
12541
  checkPath(dir);
12542
- return fs18.mkdir(dir, {
12542
+ return fs19.mkdir(dir, {
12543
12543
  mode: getMode(options),
12544
12544
  recursive: true
12545
12545
  });
12546
12546
  };
12547
12547
  module2.exports.makeDirSync = (dir, options) => {
12548
12548
  checkPath(dir);
12549
- return fs18.mkdirSync(dir, {
12549
+ return fs19.mkdirSync(dir, {
12550
12550
  mode: getMode(options),
12551
12551
  recursive: true
12552
12552
  });
@@ -12578,13 +12578,13 @@ var require_path_exists = __commonJS({
12578
12578
  "../node_modules/fs-extra/lib/path-exists/index.js"(exports2, module2) {
12579
12579
  "use strict";
12580
12580
  var u = require_universalify().fromPromise;
12581
- var fs18 = require_fs();
12582
- function pathExists(path17) {
12583
- return fs18.access(path17).then(() => true).catch(() => false);
12581
+ var fs19 = require_fs();
12582
+ function pathExists(path18) {
12583
+ return fs19.access(path18).then(() => true).catch(() => false);
12584
12584
  }
12585
12585
  module2.exports = {
12586
12586
  pathExists: u(pathExists),
12587
- pathExistsSync: fs18.existsSync
12587
+ pathExistsSync: fs19.existsSync
12588
12588
  };
12589
12589
  }
12590
12590
  });
@@ -12593,16 +12593,16 @@ var require_path_exists = __commonJS({
12593
12593
  var require_utimes = __commonJS({
12594
12594
  "../node_modules/fs-extra/lib/util/utimes.js"(exports2, module2) {
12595
12595
  "use strict";
12596
- var fs18 = require_fs();
12596
+ var fs19 = require_fs();
12597
12597
  var u = require_universalify().fromPromise;
12598
- async function utimesMillis(path17, atime, mtime) {
12599
- const fd = await fs18.open(path17, "r+");
12598
+ async function utimesMillis(path18, atime, mtime) {
12599
+ const fd = await fs19.open(path18, "r+");
12600
12600
  let closeErr = null;
12601
12601
  try {
12602
- await fs18.futimes(fd, atime, mtime);
12602
+ await fs19.futimes(fd, atime, mtime);
12603
12603
  } finally {
12604
12604
  try {
12605
- await fs18.close(fd);
12605
+ await fs19.close(fd);
12606
12606
  } catch (e) {
12607
12607
  closeErr = e;
12608
12608
  }
@@ -12611,10 +12611,10 @@ var require_utimes = __commonJS({
12611
12611
  throw closeErr;
12612
12612
  }
12613
12613
  }
12614
- function utimesMillisSync(path17, atime, mtime) {
12615
- const fd = fs18.openSync(path17, "r+");
12616
- fs18.futimesSync(fd, atime, mtime);
12617
- return fs18.closeSync(fd);
12614
+ function utimesMillisSync(path18, atime, mtime) {
12615
+ const fd = fs19.openSync(path18, "r+");
12616
+ fs19.futimesSync(fd, atime, mtime);
12617
+ return fs19.closeSync(fd);
12618
12618
  }
12619
12619
  module2.exports = {
12620
12620
  utimesMillis: u(utimesMillis),
@@ -12627,11 +12627,11 @@ var require_utimes = __commonJS({
12627
12627
  var require_stat = __commonJS({
12628
12628
  "../node_modules/fs-extra/lib/util/stat.js"(exports2, module2) {
12629
12629
  "use strict";
12630
- var fs18 = require_fs();
12631
- var path17 = require("path");
12630
+ var fs19 = require_fs();
12631
+ var path18 = require("path");
12632
12632
  var u = require_universalify().fromPromise;
12633
12633
  function getStats(src, dest, opts) {
12634
- const statFunc = opts.dereference ? (file2) => fs18.stat(file2, { bigint: true }) : (file2) => fs18.lstat(file2, { bigint: true });
12634
+ const statFunc = opts.dereference ? (file2) => fs19.stat(file2, { bigint: true }) : (file2) => fs19.lstat(file2, { bigint: true });
12635
12635
  return Promise.all([
12636
12636
  statFunc(src),
12637
12637
  statFunc(dest).catch((err) => {
@@ -12642,7 +12642,7 @@ var require_stat = __commonJS({
12642
12642
  }
12643
12643
  function getStatsSync(src, dest, opts) {
12644
12644
  let destStat;
12645
- const statFunc = opts.dereference ? (file2) => fs18.statSync(file2, { bigint: true }) : (file2) => fs18.lstatSync(file2, { bigint: true });
12645
+ const statFunc = opts.dereference ? (file2) => fs19.statSync(file2, { bigint: true }) : (file2) => fs19.lstatSync(file2, { bigint: true });
12646
12646
  const srcStat = statFunc(src);
12647
12647
  try {
12648
12648
  destStat = statFunc(dest);
@@ -12656,8 +12656,8 @@ var require_stat = __commonJS({
12656
12656
  const { srcStat, destStat } = await getStats(src, dest, opts);
12657
12657
  if (destStat) {
12658
12658
  if (areIdentical(srcStat, destStat)) {
12659
- const srcBaseName = path17.basename(src);
12660
- const destBaseName = path17.basename(dest);
12659
+ const srcBaseName = path18.basename(src);
12660
+ const destBaseName = path18.basename(dest);
12661
12661
  if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
12662
12662
  return { srcStat, destStat, isChangingCase: true };
12663
12663
  }
@@ -12679,8 +12679,8 @@ var require_stat = __commonJS({
12679
12679
  const { srcStat, destStat } = getStatsSync(src, dest, opts);
12680
12680
  if (destStat) {
12681
12681
  if (areIdentical(srcStat, destStat)) {
12682
- const srcBaseName = path17.basename(src);
12683
- const destBaseName = path17.basename(dest);
12682
+ const srcBaseName = path18.basename(src);
12683
+ const destBaseName = path18.basename(dest);
12684
12684
  if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
12685
12685
  return { srcStat, destStat, isChangingCase: true };
12686
12686
  }
@@ -12699,12 +12699,12 @@ var require_stat = __commonJS({
12699
12699
  return { srcStat, destStat };
12700
12700
  }
12701
12701
  async function checkParentPaths(src, srcStat, dest, funcName) {
12702
- const srcParent = path17.resolve(path17.dirname(src));
12703
- const destParent = path17.resolve(path17.dirname(dest));
12704
- if (destParent === srcParent || destParent === path17.parse(destParent).root) return;
12702
+ const srcParent = path18.resolve(path18.dirname(src));
12703
+ const destParent = path18.resolve(path18.dirname(dest));
12704
+ if (destParent === srcParent || destParent === path18.parse(destParent).root) return;
12705
12705
  let destStat;
12706
12706
  try {
12707
- destStat = await fs18.stat(destParent, { bigint: true });
12707
+ destStat = await fs19.stat(destParent, { bigint: true });
12708
12708
  } catch (err) {
12709
12709
  if (err.code === "ENOENT") return;
12710
12710
  throw err;
@@ -12715,12 +12715,12 @@ var require_stat = __commonJS({
12715
12715
  return checkParentPaths(src, srcStat, destParent, funcName);
12716
12716
  }
12717
12717
  function checkParentPathsSync(src, srcStat, dest, funcName) {
12718
- const srcParent = path17.resolve(path17.dirname(src));
12719
- const destParent = path17.resolve(path17.dirname(dest));
12720
- if (destParent === srcParent || destParent === path17.parse(destParent).root) return;
12718
+ const srcParent = path18.resolve(path18.dirname(src));
12719
+ const destParent = path18.resolve(path18.dirname(dest));
12720
+ if (destParent === srcParent || destParent === path18.parse(destParent).root) return;
12721
12721
  let destStat;
12722
12722
  try {
12723
- destStat = fs18.statSync(destParent, { bigint: true });
12723
+ destStat = fs19.statSync(destParent, { bigint: true });
12724
12724
  } catch (err) {
12725
12725
  if (err.code === "ENOENT") return;
12726
12726
  throw err;
@@ -12734,8 +12734,8 @@ var require_stat = __commonJS({
12734
12734
  return destStat.ino !== void 0 && destStat.dev !== void 0 && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
12735
12735
  }
12736
12736
  function isSrcSubdir(src, dest) {
12737
- const srcArr = path17.resolve(src).split(path17.sep).filter((i) => i);
12738
- const destArr = path17.resolve(dest).split(path17.sep).filter((i) => i);
12737
+ const srcArr = path18.resolve(src).split(path18.sep).filter((i) => i);
12738
+ const destArr = path18.resolve(dest).split(path18.sep).filter((i) => i);
12739
12739
  return srcArr.every((cur, i) => destArr[i] === cur);
12740
12740
  }
12741
12741
  function errMsg(src, dest, funcName) {
@@ -12787,8 +12787,8 @@ var require_async = __commonJS({
12787
12787
  var require_copy = __commonJS({
12788
12788
  "../node_modules/fs-extra/lib/copy/copy.js"(exports2, module2) {
12789
12789
  "use strict";
12790
- var fs18 = require_fs();
12791
- var path17 = require("path");
12790
+ var fs19 = require_fs();
12791
+ var path18 = require("path");
12792
12792
  var { mkdirs } = require_mkdirs();
12793
12793
  var { pathExists } = require_path_exists();
12794
12794
  var { utimesMillis } = require_utimes();
@@ -12811,7 +12811,7 @@ var require_copy = __commonJS({
12811
12811
  await stat.checkParentPaths(src, srcStat, dest, "copy");
12812
12812
  const include = await runFilter(src, dest, opts);
12813
12813
  if (!include) return;
12814
- const destParent = path17.dirname(dest);
12814
+ const destParent = path18.dirname(dest);
12815
12815
  const dirExists = await pathExists(destParent);
12816
12816
  if (!dirExists) {
12817
12817
  await mkdirs(destParent);
@@ -12823,7 +12823,7 @@ var require_copy = __commonJS({
12823
12823
  return opts.filter(src, dest);
12824
12824
  }
12825
12825
  async function getStatsAndPerformCopy(destStat, src, dest, opts) {
12826
- const statFn = opts.dereference ? fs18.stat : fs18.lstat;
12826
+ const statFn = opts.dereference ? fs19.stat : fs19.lstat;
12827
12827
  const srcStat = await statFn(src);
12828
12828
  if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
12829
12829
  if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
@@ -12835,7 +12835,7 @@ var require_copy = __commonJS({
12835
12835
  async function onFile(srcStat, destStat, src, dest, opts) {
12836
12836
  if (!destStat) return copyFile(srcStat, src, dest, opts);
12837
12837
  if (opts.overwrite) {
12838
- await fs18.unlink(dest);
12838
+ await fs19.unlink(dest);
12839
12839
  return copyFile(srcStat, src, dest, opts);
12840
12840
  }
12841
12841
  if (opts.errorOnExist) {
@@ -12843,29 +12843,29 @@ var require_copy = __commonJS({
12843
12843
  }
12844
12844
  }
12845
12845
  async function copyFile(srcStat, src, dest, opts) {
12846
- await fs18.copyFile(src, dest);
12846
+ await fs19.copyFile(src, dest);
12847
12847
  if (opts.preserveTimestamps) {
12848
12848
  if (fileIsNotWritable(srcStat.mode)) {
12849
12849
  await makeFileWritable(dest, srcStat.mode);
12850
12850
  }
12851
- const updatedSrcStat = await fs18.stat(src);
12851
+ const updatedSrcStat = await fs19.stat(src);
12852
12852
  await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
12853
12853
  }
12854
- return fs18.chmod(dest, srcStat.mode);
12854
+ return fs19.chmod(dest, srcStat.mode);
12855
12855
  }
12856
12856
  function fileIsNotWritable(srcMode) {
12857
12857
  return (srcMode & 128) === 0;
12858
12858
  }
12859
12859
  function makeFileWritable(dest, srcMode) {
12860
- return fs18.chmod(dest, srcMode | 128);
12860
+ return fs19.chmod(dest, srcMode | 128);
12861
12861
  }
12862
12862
  async function onDir(srcStat, destStat, src, dest, opts) {
12863
12863
  if (!destStat) {
12864
- await fs18.mkdir(dest);
12864
+ await fs19.mkdir(dest);
12865
12865
  }
12866
- await asyncIteratorConcurrentProcess(await fs18.opendir(src), async (item) => {
12867
- const srcItem = path17.join(src, item.name);
12868
- const destItem = path17.join(dest, item.name);
12866
+ await asyncIteratorConcurrentProcess(await fs19.opendir(src), async (item) => {
12867
+ const srcItem = path18.join(src, item.name);
12868
+ const destItem = path18.join(dest, item.name);
12869
12869
  const include = await runFilter(srcItem, destItem, opts);
12870
12870
  if (include) {
12871
12871
  const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts);
@@ -12873,26 +12873,26 @@ var require_copy = __commonJS({
12873
12873
  }
12874
12874
  });
12875
12875
  if (!destStat) {
12876
- await fs18.chmod(dest, srcStat.mode);
12876
+ await fs19.chmod(dest, srcStat.mode);
12877
12877
  }
12878
12878
  }
12879
12879
  async function onLink(destStat, src, dest, opts) {
12880
- let resolvedSrc = await fs18.readlink(src);
12880
+ let resolvedSrc = await fs19.readlink(src);
12881
12881
  if (opts.dereference) {
12882
- resolvedSrc = path17.resolve(process.cwd(), resolvedSrc);
12882
+ resolvedSrc = path18.resolve(process.cwd(), resolvedSrc);
12883
12883
  }
12884
12884
  if (!destStat) {
12885
- return fs18.symlink(resolvedSrc, dest);
12885
+ return fs19.symlink(resolvedSrc, dest);
12886
12886
  }
12887
12887
  let resolvedDest = null;
12888
12888
  try {
12889
- resolvedDest = await fs18.readlink(dest);
12889
+ resolvedDest = await fs19.readlink(dest);
12890
12890
  } catch (e) {
12891
- if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs18.symlink(resolvedSrc, dest);
12891
+ if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs19.symlink(resolvedSrc, dest);
12892
12892
  throw e;
12893
12893
  }
12894
12894
  if (opts.dereference) {
12895
- resolvedDest = path17.resolve(process.cwd(), resolvedDest);
12895
+ resolvedDest = path18.resolve(process.cwd(), resolvedDest);
12896
12896
  }
12897
12897
  if (resolvedSrc !== resolvedDest) {
12898
12898
  if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
@@ -12902,8 +12902,8 @@ var require_copy = __commonJS({
12902
12902
  throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
12903
12903
  }
12904
12904
  }
12905
- await fs18.unlink(dest);
12906
- return fs18.symlink(resolvedSrc, dest);
12905
+ await fs19.unlink(dest);
12906
+ return fs19.symlink(resolvedSrc, dest);
12907
12907
  }
12908
12908
  module2.exports = copy;
12909
12909
  }
@@ -12913,8 +12913,8 @@ var require_copy = __commonJS({
12913
12913
  var require_copy_sync = __commonJS({
12914
12914
  "../node_modules/fs-extra/lib/copy/copy-sync.js"(exports2, module2) {
12915
12915
  "use strict";
12916
- var fs18 = require_graceful_fs();
12917
- var path17 = require("path");
12916
+ var fs19 = require_graceful_fs();
12917
+ var path18 = require("path");
12918
12918
  var mkdirsSync = require_mkdirs().mkdirsSync;
12919
12919
  var utimesMillisSync = require_utimes().utimesMillisSync;
12920
12920
  var stat = require_stat();
@@ -12935,12 +12935,12 @@ var require_copy_sync = __commonJS({
12935
12935
  const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
12936
12936
  stat.checkParentPathsSync(src, srcStat, dest, "copy");
12937
12937
  if (opts.filter && !opts.filter(src, dest)) return;
12938
- const destParent = path17.dirname(dest);
12939
- if (!fs18.existsSync(destParent)) mkdirsSync(destParent);
12938
+ const destParent = path18.dirname(dest);
12939
+ if (!fs19.existsSync(destParent)) mkdirsSync(destParent);
12940
12940
  return getStats(destStat, src, dest, opts);
12941
12941
  }
12942
12942
  function getStats(destStat, src, dest, opts) {
12943
- const statSync = opts.dereference ? fs18.statSync : fs18.lstatSync;
12943
+ const statSync = opts.dereference ? fs19.statSync : fs19.lstatSync;
12944
12944
  const srcStat = statSync(src);
12945
12945
  if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
12946
12946
  else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
@@ -12955,14 +12955,14 @@ var require_copy_sync = __commonJS({
12955
12955
  }
12956
12956
  function mayCopyFile(srcStat, src, dest, opts) {
12957
12957
  if (opts.overwrite) {
12958
- fs18.unlinkSync(dest);
12958
+ fs19.unlinkSync(dest);
12959
12959
  return copyFile(srcStat, src, dest, opts);
12960
12960
  } else if (opts.errorOnExist) {
12961
12961
  throw new Error(`'${dest}' already exists`);
12962
12962
  }
12963
12963
  }
12964
12964
  function copyFile(srcStat, src, dest, opts) {
12965
- fs18.copyFileSync(src, dest);
12965
+ fs19.copyFileSync(src, dest);
12966
12966
  if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
12967
12967
  return setDestMode(dest, srcStat.mode);
12968
12968
  }
@@ -12977,10 +12977,10 @@ var require_copy_sync = __commonJS({
12977
12977
  return setDestMode(dest, srcMode | 128);
12978
12978
  }
12979
12979
  function setDestMode(dest, srcMode) {
12980
- return fs18.chmodSync(dest, srcMode);
12980
+ return fs19.chmodSync(dest, srcMode);
12981
12981
  }
12982
12982
  function setDestTimestamps(src, dest) {
12983
- const updatedSrcStat = fs18.statSync(src);
12983
+ const updatedSrcStat = fs19.statSync(src);
12984
12984
  return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
12985
12985
  }
12986
12986
  function onDir(srcStat, destStat, src, dest, opts) {
@@ -12988,12 +12988,12 @@ var require_copy_sync = __commonJS({
12988
12988
  return copyDir(src, dest, opts);
12989
12989
  }
12990
12990
  function mkDirAndCopy(srcMode, src, dest, opts) {
12991
- fs18.mkdirSync(dest);
12991
+ fs19.mkdirSync(dest);
12992
12992
  copyDir(src, dest, opts);
12993
12993
  return setDestMode(dest, srcMode);
12994
12994
  }
12995
12995
  function copyDir(src, dest, opts) {
12996
- const dir = fs18.opendirSync(src);
12996
+ const dir = fs19.opendirSync(src);
12997
12997
  try {
12998
12998
  let dirent;
12999
12999
  while ((dirent = dir.readSync()) !== null) {
@@ -13004,29 +13004,29 @@ var require_copy_sync = __commonJS({
13004
13004
  }
13005
13005
  }
13006
13006
  function copyDirItem(item, src, dest, opts) {
13007
- const srcItem = path17.join(src, item);
13008
- const destItem = path17.join(dest, item);
13007
+ const srcItem = path18.join(src, item);
13008
+ const destItem = path18.join(dest, item);
13009
13009
  if (opts.filter && !opts.filter(srcItem, destItem)) return;
13010
13010
  const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
13011
13011
  return getStats(destStat, srcItem, destItem, opts);
13012
13012
  }
13013
13013
  function onLink(destStat, src, dest, opts) {
13014
- let resolvedSrc = fs18.readlinkSync(src);
13014
+ let resolvedSrc = fs19.readlinkSync(src);
13015
13015
  if (opts.dereference) {
13016
- resolvedSrc = path17.resolve(process.cwd(), resolvedSrc);
13016
+ resolvedSrc = path18.resolve(process.cwd(), resolvedSrc);
13017
13017
  }
13018
13018
  if (!destStat) {
13019
- return fs18.symlinkSync(resolvedSrc, dest);
13019
+ return fs19.symlinkSync(resolvedSrc, dest);
13020
13020
  } else {
13021
13021
  let resolvedDest;
13022
13022
  try {
13023
- resolvedDest = fs18.readlinkSync(dest);
13023
+ resolvedDest = fs19.readlinkSync(dest);
13024
13024
  } catch (err) {
13025
- if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs18.symlinkSync(resolvedSrc, dest);
13025
+ if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs19.symlinkSync(resolvedSrc, dest);
13026
13026
  throw err;
13027
13027
  }
13028
13028
  if (opts.dereference) {
13029
- resolvedDest = path17.resolve(process.cwd(), resolvedDest);
13029
+ resolvedDest = path18.resolve(process.cwd(), resolvedDest);
13030
13030
  }
13031
13031
  if (resolvedSrc !== resolvedDest) {
13032
13032
  if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
@@ -13040,8 +13040,8 @@ var require_copy_sync = __commonJS({
13040
13040
  }
13041
13041
  }
13042
13042
  function copyLink(resolvedSrc, dest) {
13043
- fs18.unlinkSync(dest);
13044
- return fs18.symlinkSync(resolvedSrc, dest);
13043
+ fs19.unlinkSync(dest);
13044
+ return fs19.symlinkSync(resolvedSrc, dest);
13045
13045
  }
13046
13046
  module2.exports = copySync;
13047
13047
  }
@@ -13063,13 +13063,13 @@ var require_copy2 = __commonJS({
13063
13063
  var require_remove = __commonJS({
13064
13064
  "../node_modules/fs-extra/lib/remove/index.js"(exports2, module2) {
13065
13065
  "use strict";
13066
- var fs18 = require_graceful_fs();
13066
+ var fs19 = require_graceful_fs();
13067
13067
  var u = require_universalify().fromCallback;
13068
- function remove(path17, callback) {
13069
- fs18.rm(path17, { recursive: true, force: true }, callback);
13068
+ function remove(path18, callback) {
13069
+ fs19.rm(path18, { recursive: true, force: true }, callback);
13070
13070
  }
13071
- function removeSync(path17) {
13072
- fs18.rmSync(path17, { recursive: true, force: true });
13071
+ function removeSync(path18) {
13072
+ fs19.rmSync(path18, { recursive: true, force: true });
13073
13073
  }
13074
13074
  module2.exports = {
13075
13075
  remove: u(remove),
@@ -13083,28 +13083,28 @@ var require_empty = __commonJS({
13083
13083
  "../node_modules/fs-extra/lib/empty/index.js"(exports2, module2) {
13084
13084
  "use strict";
13085
13085
  var u = require_universalify().fromPromise;
13086
- var fs18 = require_fs();
13087
- var path17 = require("path");
13086
+ var fs19 = require_fs();
13087
+ var path18 = require("path");
13088
13088
  var mkdir = require_mkdirs();
13089
13089
  var remove = require_remove();
13090
13090
  var emptyDir = u(async function emptyDir2(dir) {
13091
13091
  let items;
13092
13092
  try {
13093
- items = await fs18.readdir(dir);
13093
+ items = await fs19.readdir(dir);
13094
13094
  } catch {
13095
13095
  return mkdir.mkdirs(dir);
13096
13096
  }
13097
- return Promise.all(items.map((item) => remove.remove(path17.join(dir, item))));
13097
+ return Promise.all(items.map((item) => remove.remove(path18.join(dir, item))));
13098
13098
  });
13099
13099
  function emptyDirSync(dir) {
13100
13100
  let items;
13101
13101
  try {
13102
- items = fs18.readdirSync(dir);
13102
+ items = fs19.readdirSync(dir);
13103
13103
  } catch {
13104
13104
  return mkdir.mkdirsSync(dir);
13105
13105
  }
13106
13106
  items.forEach((item) => {
13107
- item = path17.join(dir, item);
13107
+ item = path18.join(dir, item);
13108
13108
  remove.removeSync(item);
13109
13109
  });
13110
13110
  }
@@ -13122,52 +13122,52 @@ var require_file = __commonJS({
13122
13122
  "../node_modules/fs-extra/lib/ensure/file.js"(exports2, module2) {
13123
13123
  "use strict";
13124
13124
  var u = require_universalify().fromPromise;
13125
- var path17 = require("path");
13126
- var fs18 = require_fs();
13125
+ var path18 = require("path");
13126
+ var fs19 = require_fs();
13127
13127
  var mkdir = require_mkdirs();
13128
13128
  async function createFile(file2) {
13129
13129
  let stats;
13130
13130
  try {
13131
- stats = await fs18.stat(file2);
13131
+ stats = await fs19.stat(file2);
13132
13132
  } catch {
13133
13133
  }
13134
13134
  if (stats && stats.isFile()) return;
13135
- const dir = path17.dirname(file2);
13135
+ const dir = path18.dirname(file2);
13136
13136
  let dirStats = null;
13137
13137
  try {
13138
- dirStats = await fs18.stat(dir);
13138
+ dirStats = await fs19.stat(dir);
13139
13139
  } catch (err) {
13140
13140
  if (err.code === "ENOENT") {
13141
13141
  await mkdir.mkdirs(dir);
13142
- await fs18.writeFile(file2, "");
13142
+ await fs19.writeFile(file2, "");
13143
13143
  return;
13144
13144
  } else {
13145
13145
  throw err;
13146
13146
  }
13147
13147
  }
13148
13148
  if (dirStats.isDirectory()) {
13149
- await fs18.writeFile(file2, "");
13149
+ await fs19.writeFile(file2, "");
13150
13150
  } else {
13151
- await fs18.readdir(dir);
13151
+ await fs19.readdir(dir);
13152
13152
  }
13153
13153
  }
13154
13154
  function createFileSync(file2) {
13155
13155
  let stats;
13156
13156
  try {
13157
- stats = fs18.statSync(file2);
13157
+ stats = fs19.statSync(file2);
13158
13158
  } catch {
13159
13159
  }
13160
13160
  if (stats && stats.isFile()) return;
13161
- const dir = path17.dirname(file2);
13161
+ const dir = path18.dirname(file2);
13162
13162
  try {
13163
- if (!fs18.statSync(dir).isDirectory()) {
13164
- fs18.readdirSync(dir);
13163
+ if (!fs19.statSync(dir).isDirectory()) {
13164
+ fs19.readdirSync(dir);
13165
13165
  }
13166
13166
  } catch (err) {
13167
13167
  if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
13168
13168
  else throw err;
13169
13169
  }
13170
- fs18.writeFileSync(file2, "");
13170
+ fs19.writeFileSync(file2, "");
13171
13171
  }
13172
13172
  module2.exports = {
13173
13173
  createFile: u(createFile),
@@ -13181,50 +13181,50 @@ var require_link = __commonJS({
13181
13181
  "../node_modules/fs-extra/lib/ensure/link.js"(exports2, module2) {
13182
13182
  "use strict";
13183
13183
  var u = require_universalify().fromPromise;
13184
- var path17 = require("path");
13185
- var fs18 = require_fs();
13184
+ var path18 = require("path");
13185
+ var fs19 = require_fs();
13186
13186
  var mkdir = require_mkdirs();
13187
13187
  var { pathExists } = require_path_exists();
13188
13188
  var { areIdentical } = require_stat();
13189
13189
  async function createLink(srcpath, dstpath) {
13190
13190
  let dstStat;
13191
13191
  try {
13192
- dstStat = await fs18.lstat(dstpath);
13192
+ dstStat = await fs19.lstat(dstpath);
13193
13193
  } catch {
13194
13194
  }
13195
13195
  let srcStat;
13196
13196
  try {
13197
- srcStat = await fs18.lstat(srcpath);
13197
+ srcStat = await fs19.lstat(srcpath);
13198
13198
  } catch (err) {
13199
13199
  err.message = err.message.replace("lstat", "ensureLink");
13200
13200
  throw err;
13201
13201
  }
13202
13202
  if (dstStat && areIdentical(srcStat, dstStat)) return;
13203
- const dir = path17.dirname(dstpath);
13203
+ const dir = path18.dirname(dstpath);
13204
13204
  const dirExists = await pathExists(dir);
13205
13205
  if (!dirExists) {
13206
13206
  await mkdir.mkdirs(dir);
13207
13207
  }
13208
- await fs18.link(srcpath, dstpath);
13208
+ await fs19.link(srcpath, dstpath);
13209
13209
  }
13210
13210
  function createLinkSync(srcpath, dstpath) {
13211
13211
  let dstStat;
13212
13212
  try {
13213
- dstStat = fs18.lstatSync(dstpath);
13213
+ dstStat = fs19.lstatSync(dstpath);
13214
13214
  } catch {
13215
13215
  }
13216
13216
  try {
13217
- const srcStat = fs18.lstatSync(srcpath);
13217
+ const srcStat = fs19.lstatSync(srcpath);
13218
13218
  if (dstStat && areIdentical(srcStat, dstStat)) return;
13219
13219
  } catch (err) {
13220
13220
  err.message = err.message.replace("lstat", "ensureLink");
13221
13221
  throw err;
13222
13222
  }
13223
- const dir = path17.dirname(dstpath);
13224
- const dirExists = fs18.existsSync(dir);
13225
- if (dirExists) return fs18.linkSync(srcpath, dstpath);
13223
+ const dir = path18.dirname(dstpath);
13224
+ const dirExists = fs19.existsSync(dir);
13225
+ if (dirExists) return fs19.linkSync(srcpath, dstpath);
13226
13226
  mkdir.mkdirsSync(dir);
13227
- return fs18.linkSync(srcpath, dstpath);
13227
+ return fs19.linkSync(srcpath, dstpath);
13228
13228
  }
13229
13229
  module2.exports = {
13230
13230
  createLink: u(createLink),
@@ -13237,14 +13237,14 @@ var require_link = __commonJS({
13237
13237
  var require_symlink_paths = __commonJS({
13238
13238
  "../node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports2, module2) {
13239
13239
  "use strict";
13240
- var path17 = require("path");
13241
- var fs18 = require_fs();
13240
+ var path18 = require("path");
13241
+ var fs19 = require_fs();
13242
13242
  var { pathExists } = require_path_exists();
13243
13243
  var u = require_universalify().fromPromise;
13244
13244
  async function symlinkPaths(srcpath, dstpath) {
13245
- if (path17.isAbsolute(srcpath)) {
13245
+ if (path18.isAbsolute(srcpath)) {
13246
13246
  try {
13247
- await fs18.lstat(srcpath);
13247
+ await fs19.lstat(srcpath);
13248
13248
  } catch (err) {
13249
13249
  err.message = err.message.replace("lstat", "ensureSymlink");
13250
13250
  throw err;
@@ -13254,8 +13254,8 @@ var require_symlink_paths = __commonJS({
13254
13254
  toDst: srcpath
13255
13255
  };
13256
13256
  }
13257
- const dstdir = path17.dirname(dstpath);
13258
- const relativeToDst = path17.join(dstdir, srcpath);
13257
+ const dstdir = path18.dirname(dstpath);
13258
+ const relativeToDst = path18.join(dstdir, srcpath);
13259
13259
  const exists = await pathExists(relativeToDst);
13260
13260
  if (exists) {
13261
13261
  return {
@@ -13264,39 +13264,39 @@ var require_symlink_paths = __commonJS({
13264
13264
  };
13265
13265
  }
13266
13266
  try {
13267
- await fs18.lstat(srcpath);
13267
+ await fs19.lstat(srcpath);
13268
13268
  } catch (err) {
13269
13269
  err.message = err.message.replace("lstat", "ensureSymlink");
13270
13270
  throw err;
13271
13271
  }
13272
13272
  return {
13273
13273
  toCwd: srcpath,
13274
- toDst: path17.relative(dstdir, srcpath)
13274
+ toDst: path18.relative(dstdir, srcpath)
13275
13275
  };
13276
13276
  }
13277
13277
  function symlinkPathsSync(srcpath, dstpath) {
13278
- if (path17.isAbsolute(srcpath)) {
13279
- const exists2 = fs18.existsSync(srcpath);
13278
+ if (path18.isAbsolute(srcpath)) {
13279
+ const exists2 = fs19.existsSync(srcpath);
13280
13280
  if (!exists2) throw new Error("absolute srcpath does not exist");
13281
13281
  return {
13282
13282
  toCwd: srcpath,
13283
13283
  toDst: srcpath
13284
13284
  };
13285
13285
  }
13286
- const dstdir = path17.dirname(dstpath);
13287
- const relativeToDst = path17.join(dstdir, srcpath);
13288
- const exists = fs18.existsSync(relativeToDst);
13286
+ const dstdir = path18.dirname(dstpath);
13287
+ const relativeToDst = path18.join(dstdir, srcpath);
13288
+ const exists = fs19.existsSync(relativeToDst);
13289
13289
  if (exists) {
13290
13290
  return {
13291
13291
  toCwd: relativeToDst,
13292
13292
  toDst: srcpath
13293
13293
  };
13294
13294
  }
13295
- const srcExists = fs18.existsSync(srcpath);
13295
+ const srcExists = fs19.existsSync(srcpath);
13296
13296
  if (!srcExists) throw new Error("relative srcpath does not exist");
13297
13297
  return {
13298
13298
  toCwd: srcpath,
13299
- toDst: path17.relative(dstdir, srcpath)
13299
+ toDst: path18.relative(dstdir, srcpath)
13300
13300
  };
13301
13301
  }
13302
13302
  module2.exports = {
@@ -13310,13 +13310,13 @@ var require_symlink_paths = __commonJS({
13310
13310
  var require_symlink_type = __commonJS({
13311
13311
  "../node_modules/fs-extra/lib/ensure/symlink-type.js"(exports2, module2) {
13312
13312
  "use strict";
13313
- var fs18 = require_fs();
13313
+ var fs19 = require_fs();
13314
13314
  var u = require_universalify().fromPromise;
13315
13315
  async function symlinkType(srcpath, type) {
13316
13316
  if (type) return type;
13317
13317
  let stats;
13318
13318
  try {
13319
- stats = await fs18.lstat(srcpath);
13319
+ stats = await fs19.lstat(srcpath);
13320
13320
  } catch {
13321
13321
  return "file";
13322
13322
  }
@@ -13326,7 +13326,7 @@ var require_symlink_type = __commonJS({
13326
13326
  if (type) return type;
13327
13327
  let stats;
13328
13328
  try {
13329
- stats = fs18.lstatSync(srcpath);
13329
+ stats = fs19.lstatSync(srcpath);
13330
13330
  } catch {
13331
13331
  return "file";
13332
13332
  }
@@ -13344,8 +13344,8 @@ var require_symlink = __commonJS({
13344
13344
  "../node_modules/fs-extra/lib/ensure/symlink.js"(exports2, module2) {
13345
13345
  "use strict";
13346
13346
  var u = require_universalify().fromPromise;
13347
- var path17 = require("path");
13348
- var fs18 = require_fs();
13347
+ var path18 = require("path");
13348
+ var fs19 = require_fs();
13349
13349
  var { mkdirs, mkdirsSync } = require_mkdirs();
13350
13350
  var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
13351
13351
  var { symlinkType, symlinkTypeSync } = require_symlink_type();
@@ -13354,44 +13354,44 @@ var require_symlink = __commonJS({
13354
13354
  async function createSymlink(srcpath, dstpath, type) {
13355
13355
  let stats;
13356
13356
  try {
13357
- stats = await fs18.lstat(dstpath);
13357
+ stats = await fs19.lstat(dstpath);
13358
13358
  } catch {
13359
13359
  }
13360
13360
  if (stats && stats.isSymbolicLink()) {
13361
13361
  const [srcStat, dstStat] = await Promise.all([
13362
- fs18.stat(srcpath),
13363
- fs18.stat(dstpath)
13362
+ fs19.stat(srcpath),
13363
+ fs19.stat(dstpath)
13364
13364
  ]);
13365
13365
  if (areIdentical(srcStat, dstStat)) return;
13366
13366
  }
13367
13367
  const relative = await symlinkPaths(srcpath, dstpath);
13368
13368
  srcpath = relative.toDst;
13369
13369
  const toType = await symlinkType(relative.toCwd, type);
13370
- const dir = path17.dirname(dstpath);
13370
+ const dir = path18.dirname(dstpath);
13371
13371
  if (!await pathExists(dir)) {
13372
13372
  await mkdirs(dir);
13373
13373
  }
13374
- return fs18.symlink(srcpath, dstpath, toType);
13374
+ return fs19.symlink(srcpath, dstpath, toType);
13375
13375
  }
13376
13376
  function createSymlinkSync(srcpath, dstpath, type) {
13377
13377
  let stats;
13378
13378
  try {
13379
- stats = fs18.lstatSync(dstpath);
13379
+ stats = fs19.lstatSync(dstpath);
13380
13380
  } catch {
13381
13381
  }
13382
13382
  if (stats && stats.isSymbolicLink()) {
13383
- const srcStat = fs18.statSync(srcpath);
13384
- const dstStat = fs18.statSync(dstpath);
13383
+ const srcStat = fs19.statSync(srcpath);
13384
+ const dstStat = fs19.statSync(dstpath);
13385
13385
  if (areIdentical(srcStat, dstStat)) return;
13386
13386
  }
13387
13387
  const relative = symlinkPathsSync(srcpath, dstpath);
13388
13388
  srcpath = relative.toDst;
13389
13389
  type = symlinkTypeSync(relative.toCwd, type);
13390
- const dir = path17.dirname(dstpath);
13391
- const exists = fs18.existsSync(dir);
13392
- if (exists) return fs18.symlinkSync(srcpath, dstpath, type);
13390
+ const dir = path18.dirname(dstpath);
13391
+ const exists = fs19.existsSync(dir);
13392
+ if (exists) return fs19.symlinkSync(srcpath, dstpath, type);
13393
13393
  mkdirsSync(dir);
13394
- return fs18.symlinkSync(srcpath, dstpath, type);
13394
+ return fs19.symlinkSync(srcpath, dstpath, type);
13395
13395
  }
13396
13396
  module2.exports = {
13397
13397
  createSymlink: u(createSymlink),
@@ -13460,9 +13460,9 @@ var require_jsonfile = __commonJS({
13460
13460
  if (typeof options === "string") {
13461
13461
  options = { encoding: options };
13462
13462
  }
13463
- const fs18 = options.fs || _fs;
13463
+ const fs19 = options.fs || _fs;
13464
13464
  const shouldThrow = "throws" in options ? options.throws : true;
13465
- let data = await universalify.fromCallback(fs18.readFile)(file2, options);
13465
+ let data = await universalify.fromCallback(fs19.readFile)(file2, options);
13466
13466
  data = stripBom(data);
13467
13467
  let obj;
13468
13468
  try {
@@ -13482,10 +13482,10 @@ var require_jsonfile = __commonJS({
13482
13482
  if (typeof options === "string") {
13483
13483
  options = { encoding: options };
13484
13484
  }
13485
- const fs18 = options.fs || _fs;
13485
+ const fs19 = options.fs || _fs;
13486
13486
  const shouldThrow = "throws" in options ? options.throws : true;
13487
13487
  try {
13488
- let content = fs18.readFileSync(file2, options);
13488
+ let content = fs19.readFileSync(file2, options);
13489
13489
  content = stripBom(content);
13490
13490
  return JSON.parse(content, options.reviver);
13491
13491
  } catch (err) {
@@ -13498,15 +13498,15 @@ var require_jsonfile = __commonJS({
13498
13498
  }
13499
13499
  }
13500
13500
  async function _writeFile(file2, obj, options = {}) {
13501
- const fs18 = options.fs || _fs;
13501
+ const fs19 = options.fs || _fs;
13502
13502
  const str = stringify2(obj, options);
13503
- await universalify.fromCallback(fs18.writeFile)(file2, str, options);
13503
+ await universalify.fromCallback(fs19.writeFile)(file2, str, options);
13504
13504
  }
13505
13505
  var writeFile = universalify.fromPromise(_writeFile);
13506
13506
  function writeFileSync2(file2, obj, options = {}) {
13507
- const fs18 = options.fs || _fs;
13507
+ const fs19 = options.fs || _fs;
13508
13508
  const str = stringify2(obj, options);
13509
- return fs18.writeFileSync(file2, str, options);
13509
+ return fs19.writeFileSync(file2, str, options);
13510
13510
  }
13511
13511
  module2.exports = {
13512
13512
  readFile,
@@ -13537,23 +13537,23 @@ var require_output_file = __commonJS({
13537
13537
  "../node_modules/fs-extra/lib/output-file/index.js"(exports2, module2) {
13538
13538
  "use strict";
13539
13539
  var u = require_universalify().fromPromise;
13540
- var fs18 = require_fs();
13541
- var path17 = require("path");
13540
+ var fs19 = require_fs();
13541
+ var path18 = require("path");
13542
13542
  var mkdir = require_mkdirs();
13543
13543
  var pathExists = require_path_exists().pathExists;
13544
13544
  async function outputFile(file2, data, encoding = "utf-8") {
13545
- const dir = path17.dirname(file2);
13545
+ const dir = path18.dirname(file2);
13546
13546
  if (!await pathExists(dir)) {
13547
13547
  await mkdir.mkdirs(dir);
13548
13548
  }
13549
- return fs18.writeFile(file2, data, encoding);
13549
+ return fs19.writeFile(file2, data, encoding);
13550
13550
  }
13551
13551
  function outputFileSync(file2, ...args) {
13552
- const dir = path17.dirname(file2);
13553
- if (!fs18.existsSync(dir)) {
13552
+ const dir = path18.dirname(file2);
13553
+ if (!fs19.existsSync(dir)) {
13554
13554
  mkdir.mkdirsSync(dir);
13555
13555
  }
13556
- fs18.writeFileSync(file2, ...args);
13556
+ fs19.writeFileSync(file2, ...args);
13557
13557
  }
13558
13558
  module2.exports = {
13559
13559
  outputFile: u(outputFile),
@@ -13612,8 +13612,8 @@ var require_json = __commonJS({
13612
13612
  var require_move = __commonJS({
13613
13613
  "../node_modules/fs-extra/lib/move/move.js"(exports2, module2) {
13614
13614
  "use strict";
13615
- var fs18 = require_fs();
13616
- var path17 = require("path");
13615
+ var fs19 = require_fs();
13616
+ var path18 = require("path");
13617
13617
  var { copy } = require_copy2();
13618
13618
  var { remove } = require_remove();
13619
13619
  var { mkdirp } = require_mkdirs();
@@ -13623,8 +13623,8 @@ var require_move = __commonJS({
13623
13623
  const overwrite = opts.overwrite || opts.clobber || false;
13624
13624
  const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
13625
13625
  await stat.checkParentPaths(src, srcStat, dest, "move");
13626
- const destParent = path17.dirname(dest);
13627
- const parsedParentPath = path17.parse(destParent);
13626
+ const destParent = path18.dirname(dest);
13627
+ const parsedParentPath = path18.parse(destParent);
13628
13628
  if (parsedParentPath.root !== destParent) {
13629
13629
  await mkdirp(destParent);
13630
13630
  }
@@ -13639,7 +13639,7 @@ var require_move = __commonJS({
13639
13639
  }
13640
13640
  }
13641
13641
  try {
13642
- await fs18.rename(src, dest);
13642
+ await fs19.rename(src, dest);
13643
13643
  } catch (err) {
13644
13644
  if (err.code !== "EXDEV") {
13645
13645
  throw err;
@@ -13664,8 +13664,8 @@ var require_move = __commonJS({
13664
13664
  var require_move_sync = __commonJS({
13665
13665
  "../node_modules/fs-extra/lib/move/move-sync.js"(exports2, module2) {
13666
13666
  "use strict";
13667
- var fs18 = require_graceful_fs();
13668
- var path17 = require("path");
13667
+ var fs19 = require_graceful_fs();
13668
+ var path18 = require("path");
13669
13669
  var copySync = require_copy2().copySync;
13670
13670
  var removeSync = require_remove().removeSync;
13671
13671
  var mkdirpSync = require_mkdirs().mkdirpSync;
@@ -13675,12 +13675,12 @@ var require_move_sync = __commonJS({
13675
13675
  const overwrite = opts.overwrite || opts.clobber || false;
13676
13676
  const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
13677
13677
  stat.checkParentPathsSync(src, srcStat, dest, "move");
13678
- if (!isParentRoot(dest)) mkdirpSync(path17.dirname(dest));
13678
+ if (!isParentRoot(dest)) mkdirpSync(path18.dirname(dest));
13679
13679
  return doRename(src, dest, overwrite, isChangingCase);
13680
13680
  }
13681
13681
  function isParentRoot(dest) {
13682
- const parent = path17.dirname(dest);
13683
- const parsedPath = path17.parse(parent);
13682
+ const parent = path18.dirname(dest);
13683
+ const parsedPath = path18.parse(parent);
13684
13684
  return parsedPath.root === parent;
13685
13685
  }
13686
13686
  function doRename(src, dest, overwrite, isChangingCase) {
@@ -13689,12 +13689,12 @@ var require_move_sync = __commonJS({
13689
13689
  removeSync(dest);
13690
13690
  return rename(src, dest, overwrite);
13691
13691
  }
13692
- if (fs18.existsSync(dest)) throw new Error("dest already exists.");
13692
+ if (fs19.existsSync(dest)) throw new Error("dest already exists.");
13693
13693
  return rename(src, dest, overwrite);
13694
13694
  }
13695
13695
  function rename(src, dest, overwrite) {
13696
13696
  try {
13697
- fs18.renameSync(src, dest);
13697
+ fs19.renameSync(src, dest);
13698
13698
  } catch (err) {
13699
13699
  if (err.code !== "EXDEV") throw err;
13700
13700
  return moveAcrossDevice(src, dest, overwrite);
@@ -16939,8 +16939,8 @@ var require_utils3 = __commonJS({
16939
16939
  }
16940
16940
  return ind;
16941
16941
  }
16942
- function removeDotSegments(path17) {
16943
- let input = path17;
16942
+ function removeDotSegments(path18) {
16943
+ let input = path18;
16944
16944
  const output = [];
16945
16945
  let nextSlash = -1;
16946
16946
  let len = 0;
@@ -17139,8 +17139,8 @@ var require_schemes = __commonJS({
17139
17139
  wsComponent.secure = void 0;
17140
17140
  }
17141
17141
  if (wsComponent.resourceName) {
17142
- const [path17, query] = wsComponent.resourceName.split("?");
17143
- wsComponent.path = path17 && path17 !== "/" ? path17 : void 0;
17142
+ const [path18, query] = wsComponent.resourceName.split("?");
17143
+ wsComponent.path = path18 && path18 !== "/" ? path18 : void 0;
17144
17144
  wsComponent.query = query;
17145
17145
  wsComponent.resourceName = void 0;
17146
17146
  }
@@ -20466,12 +20466,12 @@ var require_dist2 = __commonJS({
20466
20466
  throw new Error(`Unknown format "${name}"`);
20467
20467
  return f;
20468
20468
  };
20469
- function addFormats(ajv, list, fs18, exportName) {
20469
+ function addFormats(ajv, list, fs19, exportName) {
20470
20470
  var _a2;
20471
20471
  var _b;
20472
20472
  (_a2 = (_b = ajv.opts.code).formats) !== null && _a2 !== void 0 ? _a2 : _b.formats = codegen_1._`require("ajv-formats/dist/formats").${exportName}`;
20473
20473
  for (const f of list)
20474
- ajv.addFormat(f, fs18[f]);
20474
+ ajv.addFormat(f, fs19[f]);
20475
20475
  }
20476
20476
  module2.exports = exports2 = formatsPlugin;
20477
20477
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -31073,8 +31073,8 @@ var require_package = __commonJS({
31073
31073
  var require_main = __commonJS({
31074
31074
  "node_modules/dotenv/lib/main.js"(exports2, module2) {
31075
31075
  "use strict";
31076
- var fs18 = require("fs");
31077
- var path17 = require("path");
31076
+ var fs19 = require("fs");
31077
+ var path18 = require("path");
31078
31078
  var os7 = require("os");
31079
31079
  var crypto2 = require("crypto");
31080
31080
  var packageJson = require_package();
@@ -31182,7 +31182,7 @@ var require_main = __commonJS({
31182
31182
  if (options && options.path && options.path.length > 0) {
31183
31183
  if (Array.isArray(options.path)) {
31184
31184
  for (const filepath of options.path) {
31185
- if (fs18.existsSync(filepath)) {
31185
+ if (fs19.existsSync(filepath)) {
31186
31186
  possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
31187
31187
  }
31188
31188
  }
@@ -31190,15 +31190,15 @@ var require_main = __commonJS({
31190
31190
  possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
31191
31191
  }
31192
31192
  } else {
31193
- possibleVaultPath = path17.resolve(process.cwd(), ".env.vault");
31193
+ possibleVaultPath = path18.resolve(process.cwd(), ".env.vault");
31194
31194
  }
31195
- if (fs18.existsSync(possibleVaultPath)) {
31195
+ if (fs19.existsSync(possibleVaultPath)) {
31196
31196
  return possibleVaultPath;
31197
31197
  }
31198
31198
  return null;
31199
31199
  }
31200
31200
  function _resolveHome(envPath) {
31201
- return envPath[0] === "~" ? path17.join(os7.homedir(), envPath.slice(1)) : envPath;
31201
+ return envPath[0] === "~" ? path18.join(os7.homedir(), envPath.slice(1)) : envPath;
31202
31202
  }
31203
31203
  function _configVault(options) {
31204
31204
  const debug = Boolean(options && options.debug);
@@ -31215,7 +31215,7 @@ var require_main = __commonJS({
31215
31215
  return { parsed };
31216
31216
  }
31217
31217
  function configDotenv(options) {
31218
- const dotenvPath = path17.resolve(process.cwd(), ".env");
31218
+ const dotenvPath = path18.resolve(process.cwd(), ".env");
31219
31219
  let encoding = "utf8";
31220
31220
  const debug = Boolean(options && options.debug);
31221
31221
  const quiet = options && "quiet" in options ? options.quiet : true;
@@ -31239,13 +31239,13 @@ var require_main = __commonJS({
31239
31239
  }
31240
31240
  let lastError;
31241
31241
  const parsedAll = {};
31242
- for (const path18 of optionPaths) {
31242
+ for (const path19 of optionPaths) {
31243
31243
  try {
31244
- const parsed = DotenvModule.parse(fs18.readFileSync(path18, { encoding }));
31244
+ const parsed = DotenvModule.parse(fs19.readFileSync(path19, { encoding }));
31245
31245
  DotenvModule.populate(parsedAll, parsed, options);
31246
31246
  } catch (e) {
31247
31247
  if (debug) {
31248
- _debug(`Failed to load ${path18} ${e.message}`);
31248
+ _debug(`Failed to load ${path19} ${e.message}`);
31249
31249
  }
31250
31250
  lastError = e;
31251
31251
  }
@@ -31260,7 +31260,7 @@ var require_main = __commonJS({
31260
31260
  const shortPaths = [];
31261
31261
  for (const filePath of optionPaths) {
31262
31262
  try {
31263
- const relative = path17.relative(process.cwd(), filePath);
31263
+ const relative = path18.relative(process.cwd(), filePath);
31264
31264
  shortPaths.push(relative);
31265
31265
  } catch (e) {
31266
31266
  if (debug) {
@@ -35772,12 +35772,12 @@ var disallowedKeys = /* @__PURE__ */ new Set([
35772
35772
  "constructor"
35773
35773
  ]);
35774
35774
  var digits = new Set("0123456789");
35775
- function getPathSegments(path17) {
35775
+ function getPathSegments(path18) {
35776
35776
  const parts = [];
35777
35777
  let currentSegment = "";
35778
35778
  let currentPart = "start";
35779
35779
  let isIgnoring = false;
35780
- for (const character of path17) {
35780
+ for (const character of path18) {
35781
35781
  switch (character) {
35782
35782
  case "\\": {
35783
35783
  if (currentPart === "index") {
@@ -35899,11 +35899,11 @@ function assertNotStringIndex(object2, key) {
35899
35899
  throw new Error("Cannot use string index");
35900
35900
  }
35901
35901
  }
35902
- function getProperty(object2, path17, value) {
35903
- if (!isObject(object2) || typeof path17 !== "string") {
35902
+ function getProperty(object2, path18, value) {
35903
+ if (!isObject(object2) || typeof path18 !== "string") {
35904
35904
  return value === void 0 ? object2 : value;
35905
35905
  }
35906
- const pathArray = getPathSegments(path17);
35906
+ const pathArray = getPathSegments(path18);
35907
35907
  if (pathArray.length === 0) {
35908
35908
  return value;
35909
35909
  }
@@ -35923,12 +35923,12 @@ function getProperty(object2, path17, value) {
35923
35923
  }
35924
35924
  return object2 === void 0 ? value : object2;
35925
35925
  }
35926
- function setProperty(object2, path17, value) {
35927
- if (!isObject(object2) || typeof path17 !== "string") {
35926
+ function setProperty(object2, path18, value) {
35927
+ if (!isObject(object2) || typeof path18 !== "string") {
35928
35928
  return object2;
35929
35929
  }
35930
35930
  const root = object2;
35931
- const pathArray = getPathSegments(path17);
35931
+ const pathArray = getPathSegments(path18);
35932
35932
  for (let index = 0; index < pathArray.length; index++) {
35933
35933
  const key = pathArray[index];
35934
35934
  assertNotStringIndex(object2, key);
@@ -35941,11 +35941,11 @@ function setProperty(object2, path17, value) {
35941
35941
  }
35942
35942
  return root;
35943
35943
  }
35944
- function deleteProperty(object2, path17) {
35945
- if (!isObject(object2) || typeof path17 !== "string") {
35944
+ function deleteProperty(object2, path18) {
35945
+ if (!isObject(object2) || typeof path18 !== "string") {
35946
35946
  return false;
35947
35947
  }
35948
- const pathArray = getPathSegments(path17);
35948
+ const pathArray = getPathSegments(path18);
35949
35949
  for (let index = 0; index < pathArray.length; index++) {
35950
35950
  const key = pathArray[index];
35951
35951
  assertNotStringIndex(object2, key);
@@ -35959,11 +35959,11 @@ function deleteProperty(object2, path17) {
35959
35959
  }
35960
35960
  }
35961
35961
  }
35962
- function hasProperty(object2, path17) {
35963
- if (!isObject(object2) || typeof path17 !== "string") {
35962
+ function hasProperty(object2, path18) {
35963
+ if (!isObject(object2) || typeof path18 !== "string") {
35964
35964
  return false;
35965
35965
  }
35966
- const pathArray = getPathSegments(path17);
35966
+ const pathArray = getPathSegments(path18);
35967
35967
  if (pathArray.length === 0) {
35968
35968
  return false;
35969
35969
  }
@@ -37174,8 +37174,8 @@ function detectAdapter(systemRoot) {
37174
37174
  // src/core/diff.ts
37175
37175
  var IGNORED_ITEMS = /* @__PURE__ */ new Set(["__pycache__", ".DS_Store", "Thumbs.db", ".gitkeep", "node_modules"]);
37176
37176
  var PruneModeReadError = class extends Error {
37177
- constructor(path17) {
37178
- super(`Cannot read ${path17} in prune mode \u2014 aborting to prevent accidental deletion`);
37177
+ constructor(path18) {
37178
+ super(`Cannot read ${path18} in prune mode \u2014 aborting to prevent accidental deletion`);
37179
37179
  this.name = "PruneModeReadError";
37180
37180
  }
37181
37181
  };
@@ -37314,6 +37314,63 @@ function commandKey(command) {
37314
37314
  const m = command.match(/([A-Za-z0-9._-]+\.(?:py|cjs|mjs|js))(?!.*[A-Za-z0-9._-]+\.(?:py|cjs|mjs|js))/);
37315
37315
  return m?.[1] || command.trim();
37316
37316
  }
37317
+ function scriptKey(command) {
37318
+ const m = command.match(/\/hooks\/([A-Za-z0-9_/-]+\.(?:py|cjs|mjs|js))/);
37319
+ if (m) return m[1];
37320
+ const m2 = command.match(/([A-Za-z0-9_-]+\.(?:py|cjs|mjs|js))(?!.*[A-Za-z0-9._-]+\.(?:py|cjs|mjs|js))/);
37321
+ return m2?.[1] || null;
37322
+ }
37323
+ function collectCanonicalScripts(incomingHooks) {
37324
+ const scripts = /* @__PURE__ */ new Set();
37325
+ if (!incomingHooks || typeof incomingHooks !== "object") return scripts;
37326
+ for (const wrappers of Object.values(incomingHooks)) {
37327
+ if (!Array.isArray(wrappers)) continue;
37328
+ for (const wrapper of wrappers) {
37329
+ const commands = extractHookCommands(wrapper);
37330
+ for (const cmd of commands) {
37331
+ const script = scriptKey(cmd);
37332
+ if (script) scripts.add(script);
37333
+ }
37334
+ }
37335
+ }
37336
+ return scripts;
37337
+ }
37338
+ function pruneStaleWrappers(existing, canonicalScripts) {
37339
+ if (canonicalScripts.size === 0) {
37340
+ return { pruned: existing, removed: [] };
37341
+ }
37342
+ const removed = [];
37343
+ const pruned = [];
37344
+ for (const wrapper of existing) {
37345
+ if (!Array.isArray(wrapper.hooks)) {
37346
+ pruned.push(wrapper);
37347
+ continue;
37348
+ }
37349
+ const keptHooks = [];
37350
+ for (const hook of wrapper.hooks) {
37351
+ const cmd = hook?.command;
37352
+ if (typeof cmd !== "string") {
37353
+ keptHooks.push(hook);
37354
+ continue;
37355
+ }
37356
+ const isXtrmManaged = /\/hooks\//.test(cmd);
37357
+ if (!isXtrmManaged) {
37358
+ keptHooks.push(hook);
37359
+ continue;
37360
+ }
37361
+ const script = scriptKey(cmd);
37362
+ if (!script || canonicalScripts.has(script)) {
37363
+ keptHooks.push(hook);
37364
+ } else {
37365
+ removed.push(script);
37366
+ }
37367
+ }
37368
+ if (keptHooks.length > 0) {
37369
+ pruned.push({ ...wrapper, hooks: keptHooks });
37370
+ }
37371
+ }
37372
+ return { pruned, removed };
37373
+ }
37317
37374
  function mergeMatcher(existingMatcher, incomingMatcher) {
37318
37375
  const parts = [
37319
37376
  ...existingMatcher.split("|").map((s) => s.trim()),
@@ -37330,9 +37387,18 @@ function mergeHookWrappers(existing, incoming) {
37330
37387
  continue;
37331
37388
  }
37332
37389
  const incomingKeys = new Set(incomingCommands.map(commandKey));
37390
+ const incomingTokens = new Set(
37391
+ typeof incomingWrapper.matcher === "string" ? incomingWrapper.matcher.split("|").map((s) => s.trim()).filter(Boolean) : []
37392
+ );
37333
37393
  const existingIndex = merged.findIndex((existingWrapper2) => {
37334
37394
  const existingCommands = extractHookCommands(existingWrapper2);
37335
- return existingCommands.some((c) => incomingKeys.has(commandKey(c)));
37395
+ if (!existingCommands.some((c) => incomingKeys.has(commandKey(c)))) return false;
37396
+ if (typeof existingWrapper2.matcher === "string" && typeof incomingWrapper.matcher === "string" && incomingTokens.size > 0) {
37397
+ const existingTokens = existingWrapper2.matcher.split("|").map((s) => s.trim()).filter(Boolean);
37398
+ const hasOverlap = existingTokens.some((t2) => incomingTokens.has(t2));
37399
+ if (!hasOverlap) return false;
37400
+ }
37401
+ return true;
37336
37402
  });
37337
37403
  if (existingIndex === -1) {
37338
37404
  merged.push(incomingWrapper);
@@ -37355,7 +37421,18 @@ function mergeHookWrappers(existing, incoming) {
37355
37421
  return merged;
37356
37422
  }
37357
37423
  function mergeHooksObject(existingHooks, incomingHooks) {
37358
- const result = { ...existingHooks || {} };
37424
+ const canonicalScripts = collectCanonicalScripts(incomingHooks);
37425
+ const result = {};
37426
+ for (const [event, existingWrappers] of Object.entries(existingHooks || {})) {
37427
+ if (!Array.isArray(existingWrappers)) {
37428
+ result[event] = existingWrappers;
37429
+ continue;
37430
+ }
37431
+ const { pruned } = pruneStaleWrappers(existingWrappers, canonicalScripts);
37432
+ if (pruned.length > 0) {
37433
+ result[event] = pruned;
37434
+ }
37435
+ }
37359
37436
  for (const [event, incomingWrappers] of Object.entries(incomingHooks || {})) {
37360
37437
  const existingWrappers = Array.isArray(result[event]) ? result[event] : [];
37361
37438
  const incomingArray = Array.isArray(incomingWrappers) ? incomingWrappers : [];
@@ -40998,6 +41075,66 @@ async function getAvailableProjectSkills() {
40998
41075
  }
40999
41076
  return skills.sort();
41000
41077
  }
41078
+ function getScriptFilename(hook) {
41079
+ const cmd = hook.command || hook.hooks?.[0]?.command || "";
41080
+ if (typeof cmd !== "string") return null;
41081
+ const m = cmd.match(/\/hooks\/([A-Za-z0-9_/-]+\.(?:py|cjs|mjs|js))/);
41082
+ if (m) return m[1];
41083
+ const m2 = cmd.match(/([A-Za-z0-9_-]+\.(?:py|cjs|mjs|js))(?!.*[A-Za-z0-9._-]+\.(?:py|cjs|mjs|js))/);
41084
+ return m2?.[1] ?? null;
41085
+ }
41086
+ function pruneStaleHooks(existing, canonical) {
41087
+ const result = { ...existing };
41088
+ const removed = [];
41089
+ if (!result.hooks || typeof result.hooks !== "object") {
41090
+ return { result, removed };
41091
+ }
41092
+ if (!canonical.hooks || typeof canonical.hooks !== "object") {
41093
+ return { result, removed };
41094
+ }
41095
+ const canonicalScripts = /* @__PURE__ */ new Set();
41096
+ for (const [event, hooks] of Object.entries(canonical.hooks)) {
41097
+ const hookList = Array.isArray(hooks) ? hooks : [hooks];
41098
+ for (const wrapper of hookList) {
41099
+ const innerHooks = wrapper.hooks || [wrapper];
41100
+ for (const hook of innerHooks) {
41101
+ const script = getScriptFilename(hook);
41102
+ if (script) canonicalScripts.add(script);
41103
+ }
41104
+ }
41105
+ }
41106
+ for (const [event, hooks] of Object.entries(result.hooks)) {
41107
+ if (!Array.isArray(hooks)) continue;
41108
+ const prunedWrappers = [];
41109
+ for (const wrapper of hooks) {
41110
+ const innerHooks = wrapper.hooks || [wrapper];
41111
+ const keptInner = [];
41112
+ for (const hook of innerHooks) {
41113
+ const script = getScriptFilename(hook);
41114
+ if (!script || canonicalScripts.has(script)) {
41115
+ keptInner.push(hook);
41116
+ } else {
41117
+ removed.push(`${event}:${script}`);
41118
+ }
41119
+ }
41120
+ if (keptInner.length > 0) {
41121
+ if (wrapper.hooks) {
41122
+ prunedWrappers.push({ ...wrapper, hooks: keptInner });
41123
+ } else if (keptInner.length === 1) {
41124
+ prunedWrappers.push(keptInner[0]);
41125
+ } else {
41126
+ prunedWrappers.push({ ...wrapper, hooks: keptInner });
41127
+ }
41128
+ }
41129
+ }
41130
+ if (prunedWrappers.length > 0) {
41131
+ result.hooks[event] = prunedWrappers;
41132
+ } else {
41133
+ delete result.hooks[event];
41134
+ }
41135
+ }
41136
+ return { result, removed };
41137
+ }
41001
41138
  function deepMergeHooks(existing, incoming) {
41002
41139
  const result = { ...existing };
41003
41140
  if (!result.hooks) result.hooks = {};
@@ -41097,7 +41234,11 @@ async function installProjectSkill(toolName, projectRootOverride) {
41097
41234
  }
41098
41235
  }
41099
41236
  const incomingSettings = JSON.parse(await import_fs_extra11.default.readFile(skillSettingsPath, "utf8"));
41100
- const mergedSettings = deepMergeHooks(existingSettings, incomingSettings);
41237
+ const { result: prunedSettings, removed } = pruneStaleHooks(existingSettings, incomingSettings);
41238
+ if (removed.length > 0) {
41239
+ console.log(kleur_default.yellow(` \u21B3 Pruned ${removed.length} stale hook(s): ${removed.join(", ")}`));
41240
+ }
41241
+ const mergedSettings = deepMergeHooks(prunedSettings, incomingSettings);
41101
41242
  await import_fs_extra11.default.writeFile(targetSettingsPath, JSON.stringify(mergedSettings, null, 2) + "\n");
41102
41243
  console.log(`${kleur_default.green(" \u2713")} settings.json (hooks merged)`);
41103
41244
  }
@@ -42728,10 +42869,10 @@ function mergeDefs(...defs) {
42728
42869
  function cloneDef(schema) {
42729
42870
  return mergeDefs(schema._zod.def);
42730
42871
  }
42731
- function getElementAtPath(obj, path17) {
42732
- if (!path17)
42872
+ function getElementAtPath(obj, path18) {
42873
+ if (!path18)
42733
42874
  return obj;
42734
- return path17.reduce((acc, key) => acc?.[key], obj);
42875
+ return path18.reduce((acc, key) => acc?.[key], obj);
42735
42876
  }
42736
42877
  function promiseAllObject(promisesObj) {
42737
42878
  const keys = Object.keys(promisesObj);
@@ -43114,11 +43255,11 @@ function aborted(x, startIndex = 0) {
43114
43255
  }
43115
43256
  return false;
43116
43257
  }
43117
- function prefixIssues(path17, issues) {
43258
+ function prefixIssues(path18, issues) {
43118
43259
  return issues.map((iss) => {
43119
43260
  var _a2;
43120
43261
  (_a2 = iss).path ?? (_a2.path = []);
43121
- iss.path.unshift(path17);
43262
+ iss.path.unshift(path18);
43122
43263
  return iss;
43123
43264
  });
43124
43265
  }
@@ -43301,7 +43442,7 @@ function formatError(error49, mapper = (issue2) => issue2.message) {
43301
43442
  }
43302
43443
  function treeifyError(error49, mapper = (issue2) => issue2.message) {
43303
43444
  const result = { errors: [] };
43304
- const processError = (error50, path17 = []) => {
43445
+ const processError = (error50, path18 = []) => {
43305
43446
  var _a2, _b;
43306
43447
  for (const issue2 of error50.issues) {
43307
43448
  if (issue2.code === "invalid_union" && issue2.errors.length) {
@@ -43311,7 +43452,7 @@ function treeifyError(error49, mapper = (issue2) => issue2.message) {
43311
43452
  } else if (issue2.code === "invalid_element") {
43312
43453
  processError({ issues: issue2.issues }, issue2.path);
43313
43454
  } else {
43314
- const fullpath = [...path17, ...issue2.path];
43455
+ const fullpath = [...path18, ...issue2.path];
43315
43456
  if (fullpath.length === 0) {
43316
43457
  result.errors.push(mapper(issue2));
43317
43458
  continue;
@@ -43343,8 +43484,8 @@ function treeifyError(error49, mapper = (issue2) => issue2.message) {
43343
43484
  }
43344
43485
  function toDotPath(_path) {
43345
43486
  const segs = [];
43346
- const path17 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
43347
- for (const seg of path17) {
43487
+ const path18 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
43488
+ for (const seg of path18) {
43348
43489
  if (typeof seg === "number")
43349
43490
  segs.push(`[${seg}]`);
43350
43491
  else if (typeof seg === "symbol")
@@ -55321,13 +55462,13 @@ function resolveRef(ref, ctx) {
55321
55462
  if (!ref.startsWith("#")) {
55322
55463
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
55323
55464
  }
55324
- const path17 = ref.slice(1).split("/").filter(Boolean);
55325
- if (path17.length === 0) {
55465
+ const path18 = ref.slice(1).split("/").filter(Boolean);
55466
+ if (path18.length === 0) {
55326
55467
  return ctx.rootSchema;
55327
55468
  }
55328
55469
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
55329
- if (path17[0] === defsKey) {
55330
- const key = path17[1];
55470
+ if (path18[0] === defsKey) {
55471
+ const key = path18[1];
55331
55472
  if (!key || !ctx.defs[key]) {
55332
55473
  throw new Error(`Reference not found: ${ref}`);
55333
55474
  }
@@ -56057,6 +56198,251 @@ ${hr}`;
56057
56198
  });
56058
56199
  }
56059
56200
 
56201
+ // src/commands/clean.ts
56202
+ var import_fs_extra16 = __toESM(require_lib2(), 1);
56203
+ var import_path17 = __toESM(require("path"), 1);
56204
+ var import_os5 = require("os");
56205
+ var CANONICAL_HOOKS = /* @__PURE__ */ new Set([
56206
+ "agent_context.py",
56207
+ "serena-workflow-reminder.py",
56208
+ "main-guard.mjs",
56209
+ "main-guard-post-push.mjs",
56210
+ "beads-gate-core.mjs",
56211
+ "beads-gate-utils.mjs",
56212
+ "beads-gate-messages.mjs",
56213
+ "beads-edit-gate.mjs",
56214
+ "beads-commit-gate.mjs",
56215
+ "beads-stop-gate.mjs",
56216
+ "beads-memory-gate.mjs",
56217
+ "beads-compact-save.mjs",
56218
+ "beads-compact-restore.mjs",
56219
+ "gitnexus",
56220
+ // directory
56221
+ "statusline-starship.sh",
56222
+ "README.md"
56223
+ ]);
56224
+ var CANONICAL_SKILLS = /* @__PURE__ */ new Set([
56225
+ "clean-code",
56226
+ "delegating",
56227
+ "docker-expert",
56228
+ "documenting",
56229
+ "find-skills",
56230
+ "gitnexus-debugging",
56231
+ "gitnexus-exploring",
56232
+ "gitnexus-impact-analysis",
56233
+ "gitnexus-refactoring",
56234
+ "hook-development",
56235
+ "obsidian-cli",
56236
+ "orchestrating-agents",
56237
+ "prompt-improving",
56238
+ "python-testing",
56239
+ "senior-backend",
56240
+ "senior-data-scientist",
56241
+ "senior-devops",
56242
+ "senior-security",
56243
+ "skill-creator",
56244
+ "using-serena-lsp",
56245
+ "using-TDD",
56246
+ "using-xtrm"
56247
+ ]);
56248
+ var IGNORED_ITEMS2 = /* @__PURE__ */ new Set([
56249
+ "__pycache__",
56250
+ ".DS_Store",
56251
+ "Thumbs.db",
56252
+ ".gitkeep",
56253
+ "node_modules"
56254
+ ]);
56255
+ async function cleanHooks(dryRun) {
56256
+ const hooksDir = import_path17.default.join((0, import_os5.homedir)(), ".claude", "hooks");
56257
+ const removed = [];
56258
+ const cache = [];
56259
+ if (!await import_fs_extra16.default.pathExists(hooksDir)) {
56260
+ return { removed, cache };
56261
+ }
56262
+ const entries = await import_fs_extra16.default.readdir(hooksDir);
56263
+ for (const entry of entries) {
56264
+ if (IGNORED_ITEMS2.has(entry)) {
56265
+ if (!dryRun) {
56266
+ const fullPath2 = import_path17.default.join(hooksDir, entry);
56267
+ await import_fs_extra16.default.remove(fullPath2);
56268
+ }
56269
+ cache.push(entry);
56270
+ continue;
56271
+ }
56272
+ if (CANONICAL_HOOKS.has(entry)) {
56273
+ continue;
56274
+ }
56275
+ const fullPath = import_path17.default.join(hooksDir, entry);
56276
+ const stat = await import_fs_extra16.default.stat(fullPath);
56277
+ if (stat.isFile() || stat.isDirectory() && IGNORED_ITEMS2.has(entry)) {
56278
+ if (!dryRun) {
56279
+ await import_fs_extra16.default.remove(fullPath);
56280
+ }
56281
+ removed.push(entry);
56282
+ }
56283
+ }
56284
+ return { removed, cache };
56285
+ }
56286
+ async function cleanSkills(dryRun) {
56287
+ const skillsDir = import_path17.default.join((0, import_os5.homedir)(), ".agents", "skills");
56288
+ const removed = [];
56289
+ if (!await import_fs_extra16.default.pathExists(skillsDir)) {
56290
+ return removed;
56291
+ }
56292
+ const entries = await import_fs_extra16.default.readdir(skillsDir);
56293
+ for (const entry of entries) {
56294
+ if (IGNORED_ITEMS2.has(entry)) {
56295
+ continue;
56296
+ }
56297
+ if (entry === "README.txt") {
56298
+ continue;
56299
+ }
56300
+ if (CANONICAL_SKILLS.has(entry)) {
56301
+ continue;
56302
+ }
56303
+ const fullPath = import_path17.default.join(skillsDir, entry);
56304
+ const stat = await import_fs_extra16.default.stat(fullPath);
56305
+ if (stat.isDirectory()) {
56306
+ if (!dryRun) {
56307
+ await import_fs_extra16.default.remove(fullPath);
56308
+ }
56309
+ removed.push(entry);
56310
+ }
56311
+ }
56312
+ return removed;
56313
+ }
56314
+ async function cleanOrphanedHookEntries(dryRun) {
56315
+ const settingsPath = import_path17.default.join((0, import_os5.homedir)(), ".claude", "settings.json");
56316
+ const removed = [];
56317
+ if (!await import_fs_extra16.default.pathExists(settingsPath)) {
56318
+ return removed;
56319
+ }
56320
+ let settings = {};
56321
+ try {
56322
+ settings = await import_fs_extra16.default.readJson(settingsPath);
56323
+ } catch {
56324
+ return removed;
56325
+ }
56326
+ if (!settings.hooks || typeof settings.hooks !== "object") {
56327
+ return removed;
56328
+ }
56329
+ const canonicalScripts = /* @__PURE__ */ new Set();
56330
+ for (const hook of CANONICAL_HOOKS) {
56331
+ if (hook.endsWith(".py") || hook.endsWith(".mjs") || hook.endsWith(".cjs") || hook.endsWith(".js")) {
56332
+ canonicalScripts.add(hook);
56333
+ }
56334
+ }
56335
+ canonicalScripts.add("gitnexus/gitnexus-hook.cjs");
56336
+ let modified = false;
56337
+ for (const [event, wrappers] of Object.entries(settings.hooks)) {
56338
+ if (!Array.isArray(wrappers)) continue;
56339
+ const keptWrappers = [];
56340
+ for (const wrapper of wrappers) {
56341
+ const innerHooks = wrapper.hooks || [wrapper];
56342
+ const keptInner = [];
56343
+ for (const hook of innerHooks) {
56344
+ const cmd = hook?.command || "";
56345
+ const m = cmd.match(/\/hooks\/([A-Za-z0-9_/-]+\.(?:py|cjs|mjs|js))/);
56346
+ const script = m?.[1];
56347
+ if (!script || canonicalScripts.has(script)) {
56348
+ keptInner.push(hook);
56349
+ } else {
56350
+ removed.push(`${event}:${script}`);
56351
+ modified = true;
56352
+ }
56353
+ }
56354
+ if (keptInner.length > 0) {
56355
+ if (wrapper.hooks) {
56356
+ keptWrappers.push({ ...wrapper, hooks: keptInner });
56357
+ } else if (keptInner.length === 1) {
56358
+ keptWrappers.push(keptInner[0]);
56359
+ }
56360
+ }
56361
+ }
56362
+ if (keptWrappers.length > 0) {
56363
+ settings.hooks[event] = keptWrappers;
56364
+ } else {
56365
+ delete settings.hooks[event];
56366
+ modified = true;
56367
+ }
56368
+ }
56369
+ if (modified && !dryRun) {
56370
+ await import_fs_extra16.default.writeJson(settingsPath, settings, { spaces: 2 });
56371
+ }
56372
+ return removed;
56373
+ }
56374
+ function createCleanCommand() {
56375
+ return new Command("clean").description("Remove orphaned hooks and skills not in the canonical repository").option("--dry-run", "Preview what would be removed without making changes", false).option("--hooks-only", "Only clean hooks, skip skills", false).option("--skills-only", "Only clean skills, skip hooks", false).option("-y, --yes", "Skip confirmation prompt", false).action(async (opts) => {
56376
+ const { dryRun, hooksOnly, skillsOnly, yes } = opts;
56377
+ console.log(t.bold("\n XTRM Clean \u2014 Remove Orphaned Components\n"));
56378
+ if (dryRun) {
56379
+ console.log(kleur_default.yellow(" DRY RUN \u2014 No changes will be made\n"));
56380
+ }
56381
+ const result = {
56382
+ hooksRemoved: [],
56383
+ skillsRemoved: [],
56384
+ cacheRemoved: []
56385
+ };
56386
+ if (!skillsOnly) {
56387
+ console.log(kleur_default.bold(" Scanning ~/.claude/hooks/..."));
56388
+ const { removed, cache } = await cleanHooks(dryRun);
56389
+ result.hooksRemoved = removed;
56390
+ result.cacheRemoved = cache;
56391
+ if (removed.length > 0) {
56392
+ for (const f of removed) {
56393
+ console.log(kleur_default.red(` \u2717 ${f}`));
56394
+ }
56395
+ } else {
56396
+ console.log(kleur_default.dim(" \u2713 No orphaned hooks found"));
56397
+ }
56398
+ if (cache.length > 0) {
56399
+ console.log(kleur_default.dim(` \u21B3 Cleaned ${cache.length} cache directory(ies)`));
56400
+ }
56401
+ console.log(kleur_default.bold("\n Scanning settings.json for orphaned hook entries..."));
56402
+ const orphanedEntries = await cleanOrphanedHookEntries(dryRun);
56403
+ if (orphanedEntries.length > 0) {
56404
+ for (const entry of orphanedEntries) {
56405
+ console.log(kleur_default.red(` \u2717 ${entry}`));
56406
+ }
56407
+ } else {
56408
+ console.log(kleur_default.dim(" \u2713 No orphaned hook entries found"));
56409
+ }
56410
+ }
56411
+ if (!hooksOnly) {
56412
+ console.log(kleur_default.bold("\n Scanning ~/.agents/skills/..."));
56413
+ result.skillsRemoved = await cleanSkills(dryRun);
56414
+ if (result.skillsRemoved.length > 0) {
56415
+ for (const d of result.skillsRemoved) {
56416
+ console.log(kleur_default.red(` \u2717 ${d}/`));
56417
+ }
56418
+ } else {
56419
+ console.log(kleur_default.dim(" \u2713 No orphaned skills found"));
56420
+ }
56421
+ }
56422
+ const totalRemoved = result.hooksRemoved.length + result.skillsRemoved.length + result.cacheRemoved.length;
56423
+ if (totalRemoved === 0) {
56424
+ console.log(t.boldGreen("\n \u2713 All components are canonical \u2014 nothing to clean\n"));
56425
+ return;
56426
+ }
56427
+ console.log(kleur_default.bold("\n Summary:"));
56428
+ if (result.hooksRemoved.length > 0) {
56429
+ console.log(kleur_default.red(` ${result.hooksRemoved.length} orphaned hook(s)`));
56430
+ }
56431
+ if (result.skillsRemoved.length > 0) {
56432
+ console.log(kleur_default.red(` ${result.skillsRemoved.length} orphaned skill(s)`));
56433
+ }
56434
+ if (result.cacheRemoved.length > 0) {
56435
+ console.log(kleur_default.dim(` ${result.cacheRemoved.length} cache director(y/ies)`));
56436
+ }
56437
+ if (!dryRun) {
56438
+ console.log(t.boldGreen("\n \u2713 Cleanup complete\n"));
56439
+ console.log(kleur_default.dim(" Run `xtrm install all -y` to reinstall canonical components\n"));
56440
+ } else {
56441
+ console.log(kleur_default.yellow("\n \u2139 Dry run \u2014 run without --dry-run to apply changes\n"));
56442
+ }
56443
+ });
56444
+ }
56445
+
56060
56446
  // src/utils/banner.ts
56061
56447
  var ART = [
56062
56448
  " \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557",
@@ -56247,6 +56633,7 @@ program2.addCommand(createInstallCommand());
56247
56633
  program2.addCommand(createProjectCommand());
56248
56634
  program2.addCommand(createStatusCommand());
56249
56635
  program2.addCommand(createResetCommand());
56636
+ program2.addCommand(createCleanCommand());
56250
56637
  program2.addCommand(createHelpCommand());
56251
56638
  program2.action(async () => {
56252
56639
  program2.help();