xtrm-tools 2.1.0 → 2.1.2

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 path14 = require("path");
1206
- var fs14 = require("fs");
1205
+ var path15 = require("path");
1206
+ var fs16 = 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 (fs14.existsSync(executableFile)) return;
2200
+ if (fs16.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 = path14.resolve(baseDir, baseName);
2219
- if (fs14.existsSync(localBin)) return localBin;
2220
- if (sourceExt.includes(path14.extname(baseName))) return void 0;
2218
+ const localBin = path15.resolve(baseDir, baseName);
2219
+ if (fs16.existsSync(localBin)) return localBin;
2220
+ if (sourceExt.includes(path15.extname(baseName))) return void 0;
2221
2221
  const foundExt = sourceExt.find(
2222
- (ext) => fs14.existsSync(`${localBin}${ext}`)
2222
+ (ext) => fs16.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 = fs14.realpathSync(this._scriptPath);
2234
+ resolvedScriptPath = fs16.realpathSync(this._scriptPath);
2235
2235
  } catch {
2236
2236
  resolvedScriptPath = this._scriptPath;
2237
2237
  }
2238
- executableDir = path14.resolve(
2239
- path14.dirname(resolvedScriptPath),
2238
+ executableDir = path15.resolve(
2239
+ path15.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 = path14.basename(
2246
+ const legacyName = path15.basename(
2247
2247
  this._scriptPath,
2248
- path14.extname(this._scriptPath)
2248
+ path15.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(path14.extname(executableFile));
2259
+ launchWithNode = sourceExt.includes(path15.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 = path14.basename(filename, path14.extname(filename));
3174
+ this._name = path15.basename(filename, path15.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(path15) {
3189
- if (path15 === void 0) return this._executableDir;
3190
- this._executableDir = path15;
3188
+ executableDir(path16) {
3189
+ if (path16 === void 0) return this._executableDir;
3190
+ this._executableDir = path16;
3191
3191
  return this;
3192
3192
  }
3193
3193
  /**
@@ -11556,54 +11556,54 @@ var require_polyfills = __commonJS({
11556
11556
  }
11557
11557
  var chdir;
11558
11558
  module2.exports = patch;
11559
- function patch(fs14) {
11559
+ function patch(fs16) {
11560
11560
  if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
11561
- patchLchmod(fs14);
11562
- }
11563
- if (!fs14.lutimes) {
11564
- patchLutimes(fs14);
11565
- }
11566
- fs14.chown = chownFix(fs14.chown);
11567
- fs14.fchown = chownFix(fs14.fchown);
11568
- fs14.lchown = chownFix(fs14.lchown);
11569
- fs14.chmod = chmodFix(fs14.chmod);
11570
- fs14.fchmod = chmodFix(fs14.fchmod);
11571
- fs14.lchmod = chmodFix(fs14.lchmod);
11572
- fs14.chownSync = chownFixSync(fs14.chownSync);
11573
- fs14.fchownSync = chownFixSync(fs14.fchownSync);
11574
- fs14.lchownSync = chownFixSync(fs14.lchownSync);
11575
- fs14.chmodSync = chmodFixSync(fs14.chmodSync);
11576
- fs14.fchmodSync = chmodFixSync(fs14.fchmodSync);
11577
- fs14.lchmodSync = chmodFixSync(fs14.lchmodSync);
11578
- fs14.stat = statFix(fs14.stat);
11579
- fs14.fstat = statFix(fs14.fstat);
11580
- fs14.lstat = statFix(fs14.lstat);
11581
- fs14.statSync = statFixSync(fs14.statSync);
11582
- fs14.fstatSync = statFixSync(fs14.fstatSync);
11583
- fs14.lstatSync = statFixSync(fs14.lstatSync);
11584
- if (fs14.chmod && !fs14.lchmod) {
11585
- fs14.lchmod = function(path14, mode, cb) {
11561
+ patchLchmod(fs16);
11562
+ }
11563
+ if (!fs16.lutimes) {
11564
+ patchLutimes(fs16);
11565
+ }
11566
+ fs16.chown = chownFix(fs16.chown);
11567
+ fs16.fchown = chownFix(fs16.fchown);
11568
+ fs16.lchown = chownFix(fs16.lchown);
11569
+ fs16.chmod = chmodFix(fs16.chmod);
11570
+ fs16.fchmod = chmodFix(fs16.fchmod);
11571
+ fs16.lchmod = chmodFix(fs16.lchmod);
11572
+ fs16.chownSync = chownFixSync(fs16.chownSync);
11573
+ fs16.fchownSync = chownFixSync(fs16.fchownSync);
11574
+ fs16.lchownSync = chownFixSync(fs16.lchownSync);
11575
+ fs16.chmodSync = chmodFixSync(fs16.chmodSync);
11576
+ fs16.fchmodSync = chmodFixSync(fs16.fchmodSync);
11577
+ fs16.lchmodSync = chmodFixSync(fs16.lchmodSync);
11578
+ fs16.stat = statFix(fs16.stat);
11579
+ fs16.fstat = statFix(fs16.fstat);
11580
+ fs16.lstat = statFix(fs16.lstat);
11581
+ fs16.statSync = statFixSync(fs16.statSync);
11582
+ fs16.fstatSync = statFixSync(fs16.fstatSync);
11583
+ fs16.lstatSync = statFixSync(fs16.lstatSync);
11584
+ if (fs16.chmod && !fs16.lchmod) {
11585
+ fs16.lchmod = function(path15, mode, cb) {
11586
11586
  if (cb) process.nextTick(cb);
11587
11587
  };
11588
- fs14.lchmodSync = function() {
11588
+ fs16.lchmodSync = function() {
11589
11589
  };
11590
11590
  }
11591
- if (fs14.chown && !fs14.lchown) {
11592
- fs14.lchown = function(path14, uid, gid, cb) {
11591
+ if (fs16.chown && !fs16.lchown) {
11592
+ fs16.lchown = function(path15, uid, gid, cb) {
11593
11593
  if (cb) process.nextTick(cb);
11594
11594
  };
11595
- fs14.lchownSync = function() {
11595
+ fs16.lchownSync = function() {
11596
11596
  };
11597
11597
  }
11598
11598
  if (platform2 === "win32") {
11599
- fs14.rename = typeof fs14.rename !== "function" ? fs14.rename : (function(fs$rename) {
11599
+ fs16.rename = typeof fs16.rename !== "function" ? fs16.rename : (function(fs$rename) {
11600
11600
  function rename(from, to, cb) {
11601
11601
  var start = Date.now();
11602
11602
  var backoff = 0;
11603
11603
  fs$rename(from, to, function CB(er) {
11604
11604
  if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
11605
11605
  setTimeout(function() {
11606
- fs14.stat(to, function(stater, st) {
11606
+ fs16.stat(to, function(stater, st) {
11607
11607
  if (stater && stater.code === "ENOENT")
11608
11608
  fs$rename(from, to, CB);
11609
11609
  else
@@ -11619,9 +11619,9 @@ var require_polyfills = __commonJS({
11619
11619
  }
11620
11620
  if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
11621
11621
  return rename;
11622
- })(fs14.rename);
11622
+ })(fs16.rename);
11623
11623
  }
11624
- fs14.read = typeof fs14.read !== "function" ? fs14.read : (function(fs$read) {
11624
+ fs16.read = typeof fs16.read !== "function" ? fs16.read : (function(fs$read) {
11625
11625
  function read(fd, buffer, offset, length, position, callback_) {
11626
11626
  var callback;
11627
11627
  if (callback_ && typeof callback_ === "function") {
@@ -11629,22 +11629,22 @@ var require_polyfills = __commonJS({
11629
11629
  callback = function(er, _, __) {
11630
11630
  if (er && er.code === "EAGAIN" && eagCounter < 10) {
11631
11631
  eagCounter++;
11632
- return fs$read.call(fs14, fd, buffer, offset, length, position, callback);
11632
+ return fs$read.call(fs16, fd, buffer, offset, length, position, callback);
11633
11633
  }
11634
11634
  callback_.apply(this, arguments);
11635
11635
  };
11636
11636
  }
11637
- return fs$read.call(fs14, fd, buffer, offset, length, position, callback);
11637
+ return fs$read.call(fs16, fd, buffer, offset, length, position, callback);
11638
11638
  }
11639
11639
  if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
11640
11640
  return read;
11641
- })(fs14.read);
11642
- fs14.readSync = typeof fs14.readSync !== "function" ? fs14.readSync : /* @__PURE__ */ (function(fs$readSync) {
11641
+ })(fs16.read);
11642
+ fs16.readSync = typeof fs16.readSync !== "function" ? fs16.readSync : /* @__PURE__ */ (function(fs$readSync) {
11643
11643
  return function(fd, buffer, offset, length, position) {
11644
11644
  var eagCounter = 0;
11645
11645
  while (true) {
11646
11646
  try {
11647
- return fs$readSync.call(fs14, fd, buffer, offset, length, position);
11647
+ return fs$readSync.call(fs16, fd, buffer, offset, length, position);
11648
11648
  } catch (er) {
11649
11649
  if (er.code === "EAGAIN" && eagCounter < 10) {
11650
11650
  eagCounter++;
@@ -11654,11 +11654,11 @@ var require_polyfills = __commonJS({
11654
11654
  }
11655
11655
  }
11656
11656
  };
11657
- })(fs14.readSync);
11658
- function patchLchmod(fs15) {
11659
- fs15.lchmod = function(path14, mode, callback) {
11660
- fs15.open(
11661
- path14,
11657
+ })(fs16.readSync);
11658
+ function patchLchmod(fs17) {
11659
+ fs17.lchmod = function(path15, mode, callback) {
11660
+ fs17.open(
11661
+ path15,
11662
11662
  constants.O_WRONLY | constants.O_SYMLINK,
11663
11663
  mode,
11664
11664
  function(err, fd) {
@@ -11666,80 +11666,80 @@ var require_polyfills = __commonJS({
11666
11666
  if (callback) callback(err);
11667
11667
  return;
11668
11668
  }
11669
- fs15.fchmod(fd, mode, function(err2) {
11670
- fs15.close(fd, function(err22) {
11669
+ fs17.fchmod(fd, mode, function(err2) {
11670
+ fs17.close(fd, function(err22) {
11671
11671
  if (callback) callback(err2 || err22);
11672
11672
  });
11673
11673
  });
11674
11674
  }
11675
11675
  );
11676
11676
  };
11677
- fs15.lchmodSync = function(path14, mode) {
11678
- var fd = fs15.openSync(path14, constants.O_WRONLY | constants.O_SYMLINK, mode);
11677
+ fs17.lchmodSync = function(path15, mode) {
11678
+ var fd = fs17.openSync(path15, constants.O_WRONLY | constants.O_SYMLINK, mode);
11679
11679
  var threw = true;
11680
11680
  var ret;
11681
11681
  try {
11682
- ret = fs15.fchmodSync(fd, mode);
11682
+ ret = fs17.fchmodSync(fd, mode);
11683
11683
  threw = false;
11684
11684
  } finally {
11685
11685
  if (threw) {
11686
11686
  try {
11687
- fs15.closeSync(fd);
11687
+ fs17.closeSync(fd);
11688
11688
  } catch (er) {
11689
11689
  }
11690
11690
  } else {
11691
- fs15.closeSync(fd);
11691
+ fs17.closeSync(fd);
11692
11692
  }
11693
11693
  }
11694
11694
  return ret;
11695
11695
  };
11696
11696
  }
11697
- function patchLutimes(fs15) {
11698
- if (constants.hasOwnProperty("O_SYMLINK") && fs15.futimes) {
11699
- fs15.lutimes = function(path14, at, mt, cb) {
11700
- fs15.open(path14, constants.O_SYMLINK, function(er, fd) {
11697
+ function patchLutimes(fs17) {
11698
+ if (constants.hasOwnProperty("O_SYMLINK") && fs17.futimes) {
11699
+ fs17.lutimes = function(path15, at, mt, cb) {
11700
+ fs17.open(path15, constants.O_SYMLINK, function(er, fd) {
11701
11701
  if (er) {
11702
11702
  if (cb) cb(er);
11703
11703
  return;
11704
11704
  }
11705
- fs15.futimes(fd, at, mt, function(er2) {
11706
- fs15.close(fd, function(er22) {
11705
+ fs17.futimes(fd, at, mt, function(er2) {
11706
+ fs17.close(fd, function(er22) {
11707
11707
  if (cb) cb(er2 || er22);
11708
11708
  });
11709
11709
  });
11710
11710
  });
11711
11711
  };
11712
- fs15.lutimesSync = function(path14, at, mt) {
11713
- var fd = fs15.openSync(path14, constants.O_SYMLINK);
11712
+ fs17.lutimesSync = function(path15, at, mt) {
11713
+ var fd = fs17.openSync(path15, constants.O_SYMLINK);
11714
11714
  var ret;
11715
11715
  var threw = true;
11716
11716
  try {
11717
- ret = fs15.futimesSync(fd, at, mt);
11717
+ ret = fs17.futimesSync(fd, at, mt);
11718
11718
  threw = false;
11719
11719
  } finally {
11720
11720
  if (threw) {
11721
11721
  try {
11722
- fs15.closeSync(fd);
11722
+ fs17.closeSync(fd);
11723
11723
  } catch (er) {
11724
11724
  }
11725
11725
  } else {
11726
- fs15.closeSync(fd);
11726
+ fs17.closeSync(fd);
11727
11727
  }
11728
11728
  }
11729
11729
  return ret;
11730
11730
  };
11731
- } else if (fs15.futimes) {
11732
- fs15.lutimes = function(_a2, _b, _c, cb) {
11731
+ } else if (fs17.futimes) {
11732
+ fs17.lutimes = function(_a2, _b, _c, cb) {
11733
11733
  if (cb) process.nextTick(cb);
11734
11734
  };
11735
- fs15.lutimesSync = function() {
11735
+ fs17.lutimesSync = function() {
11736
11736
  };
11737
11737
  }
11738
11738
  }
11739
11739
  function chmodFix(orig) {
11740
11740
  if (!orig) return orig;
11741
11741
  return function(target, mode, cb) {
11742
- return orig.call(fs14, target, mode, function(er) {
11742
+ return orig.call(fs16, target, mode, function(er) {
11743
11743
  if (chownErOk(er)) er = null;
11744
11744
  if (cb) cb.apply(this, arguments);
11745
11745
  });
@@ -11749,7 +11749,7 @@ var require_polyfills = __commonJS({
11749
11749
  if (!orig) return orig;
11750
11750
  return function(target, mode) {
11751
11751
  try {
11752
- return orig.call(fs14, target, mode);
11752
+ return orig.call(fs16, target, mode);
11753
11753
  } catch (er) {
11754
11754
  if (!chownErOk(er)) throw er;
11755
11755
  }
@@ -11758,7 +11758,7 @@ var require_polyfills = __commonJS({
11758
11758
  function chownFix(orig) {
11759
11759
  if (!orig) return orig;
11760
11760
  return function(target, uid, gid, cb) {
11761
- return orig.call(fs14, target, uid, gid, function(er) {
11761
+ return orig.call(fs16, target, uid, gid, function(er) {
11762
11762
  if (chownErOk(er)) er = null;
11763
11763
  if (cb) cb.apply(this, arguments);
11764
11764
  });
@@ -11768,7 +11768,7 @@ var require_polyfills = __commonJS({
11768
11768
  if (!orig) return orig;
11769
11769
  return function(target, uid, gid) {
11770
11770
  try {
11771
- return orig.call(fs14, target, uid, gid);
11771
+ return orig.call(fs16, target, uid, gid);
11772
11772
  } catch (er) {
11773
11773
  if (!chownErOk(er)) throw er;
11774
11774
  }
@@ -11788,13 +11788,13 @@ var require_polyfills = __commonJS({
11788
11788
  }
11789
11789
  if (cb) cb.apply(this, arguments);
11790
11790
  }
11791
- return options ? orig.call(fs14, target, options, callback) : orig.call(fs14, target, callback);
11791
+ return options ? orig.call(fs16, target, options, callback) : orig.call(fs16, target, callback);
11792
11792
  };
11793
11793
  }
11794
11794
  function statFixSync(orig) {
11795
11795
  if (!orig) return orig;
11796
11796
  return function(target, options) {
11797
- var stats = options ? orig.call(fs14, target, options) : orig.call(fs14, target);
11797
+ var stats = options ? orig.call(fs16, target, options) : orig.call(fs16, target);
11798
11798
  if (stats) {
11799
11799
  if (stats.uid < 0) stats.uid += 4294967296;
11800
11800
  if (stats.gid < 0) stats.gid += 4294967296;
@@ -11824,16 +11824,16 @@ var require_legacy_streams = __commonJS({
11824
11824
  "use strict";
11825
11825
  var Stream = require("stream").Stream;
11826
11826
  module2.exports = legacy;
11827
- function legacy(fs14) {
11827
+ function legacy(fs16) {
11828
11828
  return {
11829
11829
  ReadStream,
11830
11830
  WriteStream
11831
11831
  };
11832
- function ReadStream(path14, options) {
11833
- if (!(this instanceof ReadStream)) return new ReadStream(path14, options);
11832
+ function ReadStream(path15, options) {
11833
+ if (!(this instanceof ReadStream)) return new ReadStream(path15, options);
11834
11834
  Stream.call(this);
11835
11835
  var self = this;
11836
- this.path = path14;
11836
+ this.path = path15;
11837
11837
  this.fd = null;
11838
11838
  this.readable = true;
11839
11839
  this.paused = false;
@@ -11867,7 +11867,7 @@ var require_legacy_streams = __commonJS({
11867
11867
  });
11868
11868
  return;
11869
11869
  }
11870
- fs14.open(this.path, this.flags, this.mode, function(err, fd) {
11870
+ fs16.open(this.path, this.flags, this.mode, function(err, fd) {
11871
11871
  if (err) {
11872
11872
  self.emit("error", err);
11873
11873
  self.readable = false;
@@ -11878,10 +11878,10 @@ var require_legacy_streams = __commonJS({
11878
11878
  self._read();
11879
11879
  });
11880
11880
  }
11881
- function WriteStream(path14, options) {
11882
- if (!(this instanceof WriteStream)) return new WriteStream(path14, options);
11881
+ function WriteStream(path15, options) {
11882
+ if (!(this instanceof WriteStream)) return new WriteStream(path15, options);
11883
11883
  Stream.call(this);
11884
- this.path = path14;
11884
+ this.path = path15;
11885
11885
  this.fd = null;
11886
11886
  this.writable = true;
11887
11887
  this.flags = "w";
@@ -11906,7 +11906,7 @@ var require_legacy_streams = __commonJS({
11906
11906
  this.busy = false;
11907
11907
  this._queue = [];
11908
11908
  if (this.fd === null) {
11909
- this._open = fs14.open;
11909
+ this._open = fs16.open;
11910
11910
  this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
11911
11911
  this.flush();
11912
11912
  }
@@ -11942,7 +11942,7 @@ var require_clone = __commonJS({
11942
11942
  var require_graceful_fs = __commonJS({
11943
11943
  "node_modules/graceful-fs/graceful-fs.js"(exports2, module2) {
11944
11944
  "use strict";
11945
- var fs14 = require("fs");
11945
+ var fs16 = require("fs");
11946
11946
  var polyfills = require_polyfills();
11947
11947
  var legacy = require_legacy_streams();
11948
11948
  var clone3 = require_clone();
@@ -11974,12 +11974,12 @@ var require_graceful_fs = __commonJS({
11974
11974
  m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
11975
11975
  console.error(m);
11976
11976
  };
11977
- if (!fs14[gracefulQueue]) {
11977
+ if (!fs16[gracefulQueue]) {
11978
11978
  queue = global[gracefulQueue] || [];
11979
- publishQueue(fs14, queue);
11980
- fs14.close = (function(fs$close) {
11979
+ publishQueue(fs16, queue);
11980
+ fs16.close = (function(fs$close) {
11981
11981
  function close(fd, cb) {
11982
- return fs$close.call(fs14, fd, function(err) {
11982
+ return fs$close.call(fs16, fd, function(err) {
11983
11983
  if (!err) {
11984
11984
  resetQueue();
11985
11985
  }
@@ -11991,48 +11991,48 @@ var require_graceful_fs = __commonJS({
11991
11991
  value: fs$close
11992
11992
  });
11993
11993
  return close;
11994
- })(fs14.close);
11995
- fs14.closeSync = (function(fs$closeSync) {
11994
+ })(fs16.close);
11995
+ fs16.closeSync = (function(fs$closeSync) {
11996
11996
  function closeSync(fd) {
11997
- fs$closeSync.apply(fs14, arguments);
11997
+ fs$closeSync.apply(fs16, arguments);
11998
11998
  resetQueue();
11999
11999
  }
12000
12000
  Object.defineProperty(closeSync, previousSymbol, {
12001
12001
  value: fs$closeSync
12002
12002
  });
12003
12003
  return closeSync;
12004
- })(fs14.closeSync);
12004
+ })(fs16.closeSync);
12005
12005
  if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
12006
12006
  process.on("exit", function() {
12007
- debug(fs14[gracefulQueue]);
12008
- require("assert").equal(fs14[gracefulQueue].length, 0);
12007
+ debug(fs16[gracefulQueue]);
12008
+ require("assert").equal(fs16[gracefulQueue].length, 0);
12009
12009
  });
12010
12010
  }
12011
12011
  }
12012
12012
  var queue;
12013
12013
  if (!global[gracefulQueue]) {
12014
- publishQueue(global, fs14[gracefulQueue]);
12015
- }
12016
- module2.exports = patch(clone3(fs14));
12017
- if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs14.__patched) {
12018
- module2.exports = patch(fs14);
12019
- fs14.__patched = true;
12020
- }
12021
- function patch(fs15) {
12022
- polyfills(fs15);
12023
- fs15.gracefulify = patch;
12024
- fs15.createReadStream = createReadStream;
12025
- fs15.createWriteStream = createWriteStream2;
12026
- var fs$readFile = fs15.readFile;
12027
- fs15.readFile = readFile;
12028
- function readFile(path14, options, cb) {
12014
+ publishQueue(global, fs16[gracefulQueue]);
12015
+ }
12016
+ module2.exports = patch(clone3(fs16));
12017
+ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs16.__patched) {
12018
+ module2.exports = patch(fs16);
12019
+ fs16.__patched = true;
12020
+ }
12021
+ function patch(fs17) {
12022
+ polyfills(fs17);
12023
+ fs17.gracefulify = patch;
12024
+ fs17.createReadStream = createReadStream;
12025
+ fs17.createWriteStream = createWriteStream2;
12026
+ var fs$readFile = fs17.readFile;
12027
+ fs17.readFile = readFile;
12028
+ function readFile(path15, options, cb) {
12029
12029
  if (typeof options === "function")
12030
12030
  cb = options, options = null;
12031
- return go$readFile(path14, options, cb);
12032
- function go$readFile(path15, options2, cb2, startTime) {
12033
- return fs$readFile(path15, options2, function(err) {
12031
+ return go$readFile(path15, options, cb);
12032
+ function go$readFile(path16, options2, cb2, startTime) {
12033
+ return fs$readFile(path16, options2, function(err) {
12034
12034
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
12035
- enqueue([go$readFile, [path15, options2, cb2], err, startTime || Date.now(), Date.now()]);
12035
+ enqueue([go$readFile, [path16, options2, cb2], err, startTime || Date.now(), Date.now()]);
12036
12036
  else {
12037
12037
  if (typeof cb2 === "function")
12038
12038
  cb2.apply(this, arguments);
@@ -12040,16 +12040,16 @@ var require_graceful_fs = __commonJS({
12040
12040
  });
12041
12041
  }
12042
12042
  }
12043
- var fs$writeFile = fs15.writeFile;
12044
- fs15.writeFile = writeFile;
12045
- function writeFile(path14, data, options, cb) {
12043
+ var fs$writeFile = fs17.writeFile;
12044
+ fs17.writeFile = writeFile;
12045
+ function writeFile(path15, data, options, cb) {
12046
12046
  if (typeof options === "function")
12047
12047
  cb = options, options = null;
12048
- return go$writeFile(path14, data, options, cb);
12049
- function go$writeFile(path15, data2, options2, cb2, startTime) {
12050
- return fs$writeFile(path15, data2, options2, function(err) {
12048
+ return go$writeFile(path15, data, options, cb);
12049
+ function go$writeFile(path16, data2, options2, cb2, startTime) {
12050
+ return fs$writeFile(path16, data2, options2, function(err) {
12051
12051
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
12052
- enqueue([go$writeFile, [path15, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
12052
+ enqueue([go$writeFile, [path16, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
12053
12053
  else {
12054
12054
  if (typeof cb2 === "function")
12055
12055
  cb2.apply(this, arguments);
@@ -12057,17 +12057,17 @@ var require_graceful_fs = __commonJS({
12057
12057
  });
12058
12058
  }
12059
12059
  }
12060
- var fs$appendFile = fs15.appendFile;
12060
+ var fs$appendFile = fs17.appendFile;
12061
12061
  if (fs$appendFile)
12062
- fs15.appendFile = appendFile;
12063
- function appendFile(path14, data, options, cb) {
12062
+ fs17.appendFile = appendFile;
12063
+ function appendFile(path15, data, options, cb) {
12064
12064
  if (typeof options === "function")
12065
12065
  cb = options, options = null;
12066
- return go$appendFile(path14, data, options, cb);
12067
- function go$appendFile(path15, data2, options2, cb2, startTime) {
12068
- return fs$appendFile(path15, data2, options2, function(err) {
12066
+ return go$appendFile(path15, data, options, cb);
12067
+ function go$appendFile(path16, data2, options2, cb2, startTime) {
12068
+ return fs$appendFile(path16, data2, options2, function(err) {
12069
12069
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
12070
- enqueue([go$appendFile, [path15, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
12070
+ enqueue([go$appendFile, [path16, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
12071
12071
  else {
12072
12072
  if (typeof cb2 === "function")
12073
12073
  cb2.apply(this, arguments);
@@ -12075,9 +12075,9 @@ var require_graceful_fs = __commonJS({
12075
12075
  });
12076
12076
  }
12077
12077
  }
12078
- var fs$copyFile = fs15.copyFile;
12078
+ var fs$copyFile = fs17.copyFile;
12079
12079
  if (fs$copyFile)
12080
- fs15.copyFile = copyFile;
12080
+ fs17.copyFile = copyFile;
12081
12081
  function copyFile(src, dest, flags, cb) {
12082
12082
  if (typeof flags === "function") {
12083
12083
  cb = flags;
@@ -12095,34 +12095,34 @@ var require_graceful_fs = __commonJS({
12095
12095
  });
12096
12096
  }
12097
12097
  }
12098
- var fs$readdir = fs15.readdir;
12099
- fs15.readdir = readdir;
12098
+ var fs$readdir = fs17.readdir;
12099
+ fs17.readdir = readdir;
12100
12100
  var noReaddirOptionVersions = /^v[0-5]\./;
12101
- function readdir(path14, options, cb) {
12101
+ function readdir(path15, options, cb) {
12102
12102
  if (typeof options === "function")
12103
12103
  cb = options, options = null;
12104
- var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path15, options2, cb2, startTime) {
12105
- return fs$readdir(path15, fs$readdirCallback(
12106
- path15,
12104
+ var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path16, options2, cb2, startTime) {
12105
+ return fs$readdir(path16, fs$readdirCallback(
12106
+ path16,
12107
12107
  options2,
12108
12108
  cb2,
12109
12109
  startTime
12110
12110
  ));
12111
- } : function go$readdir2(path15, options2, cb2, startTime) {
12112
- return fs$readdir(path15, options2, fs$readdirCallback(
12113
- path15,
12111
+ } : function go$readdir2(path16, options2, cb2, startTime) {
12112
+ return fs$readdir(path16, options2, fs$readdirCallback(
12113
+ path16,
12114
12114
  options2,
12115
12115
  cb2,
12116
12116
  startTime
12117
12117
  ));
12118
12118
  };
12119
- return go$readdir(path14, options, cb);
12120
- function fs$readdirCallback(path15, options2, cb2, startTime) {
12119
+ return go$readdir(path15, options, cb);
12120
+ function fs$readdirCallback(path16, options2, cb2, startTime) {
12121
12121
  return function(err, files) {
12122
12122
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
12123
12123
  enqueue([
12124
12124
  go$readdir,
12125
- [path15, options2, cb2],
12125
+ [path16, options2, cb2],
12126
12126
  err,
12127
12127
  startTime || Date.now(),
12128
12128
  Date.now()
@@ -12137,21 +12137,21 @@ var require_graceful_fs = __commonJS({
12137
12137
  }
12138
12138
  }
12139
12139
  if (process.version.substr(0, 4) === "v0.8") {
12140
- var legStreams = legacy(fs15);
12140
+ var legStreams = legacy(fs17);
12141
12141
  ReadStream = legStreams.ReadStream;
12142
12142
  WriteStream = legStreams.WriteStream;
12143
12143
  }
12144
- var fs$ReadStream = fs15.ReadStream;
12144
+ var fs$ReadStream = fs17.ReadStream;
12145
12145
  if (fs$ReadStream) {
12146
12146
  ReadStream.prototype = Object.create(fs$ReadStream.prototype);
12147
12147
  ReadStream.prototype.open = ReadStream$open;
12148
12148
  }
12149
- var fs$WriteStream = fs15.WriteStream;
12149
+ var fs$WriteStream = fs17.WriteStream;
12150
12150
  if (fs$WriteStream) {
12151
12151
  WriteStream.prototype = Object.create(fs$WriteStream.prototype);
12152
12152
  WriteStream.prototype.open = WriteStream$open;
12153
12153
  }
12154
- Object.defineProperty(fs15, "ReadStream", {
12154
+ Object.defineProperty(fs17, "ReadStream", {
12155
12155
  get: function() {
12156
12156
  return ReadStream;
12157
12157
  },
@@ -12161,7 +12161,7 @@ var require_graceful_fs = __commonJS({
12161
12161
  enumerable: true,
12162
12162
  configurable: true
12163
12163
  });
12164
- Object.defineProperty(fs15, "WriteStream", {
12164
+ Object.defineProperty(fs17, "WriteStream", {
12165
12165
  get: function() {
12166
12166
  return WriteStream;
12167
12167
  },
@@ -12172,7 +12172,7 @@ var require_graceful_fs = __commonJS({
12172
12172
  configurable: true
12173
12173
  });
12174
12174
  var FileReadStream = ReadStream;
12175
- Object.defineProperty(fs15, "FileReadStream", {
12175
+ Object.defineProperty(fs17, "FileReadStream", {
12176
12176
  get: function() {
12177
12177
  return FileReadStream;
12178
12178
  },
@@ -12183,7 +12183,7 @@ var require_graceful_fs = __commonJS({
12183
12183
  configurable: true
12184
12184
  });
12185
12185
  var FileWriteStream = WriteStream;
12186
- Object.defineProperty(fs15, "FileWriteStream", {
12186
+ Object.defineProperty(fs17, "FileWriteStream", {
12187
12187
  get: function() {
12188
12188
  return FileWriteStream;
12189
12189
  },
@@ -12193,7 +12193,7 @@ var require_graceful_fs = __commonJS({
12193
12193
  enumerable: true,
12194
12194
  configurable: true
12195
12195
  });
12196
- function ReadStream(path14, options) {
12196
+ function ReadStream(path15, options) {
12197
12197
  if (this instanceof ReadStream)
12198
12198
  return fs$ReadStream.apply(this, arguments), this;
12199
12199
  else
@@ -12213,7 +12213,7 @@ var require_graceful_fs = __commonJS({
12213
12213
  }
12214
12214
  });
12215
12215
  }
12216
- function WriteStream(path14, options) {
12216
+ function WriteStream(path15, options) {
12217
12217
  if (this instanceof WriteStream)
12218
12218
  return fs$WriteStream.apply(this, arguments), this;
12219
12219
  else
@@ -12231,22 +12231,22 @@ var require_graceful_fs = __commonJS({
12231
12231
  }
12232
12232
  });
12233
12233
  }
12234
- function createReadStream(path14, options) {
12235
- return new fs15.ReadStream(path14, options);
12234
+ function createReadStream(path15, options) {
12235
+ return new fs17.ReadStream(path15, options);
12236
12236
  }
12237
- function createWriteStream2(path14, options) {
12238
- return new fs15.WriteStream(path14, options);
12237
+ function createWriteStream2(path15, options) {
12238
+ return new fs17.WriteStream(path15, options);
12239
12239
  }
12240
- var fs$open = fs15.open;
12241
- fs15.open = open;
12242
- function open(path14, flags, mode, cb) {
12240
+ var fs$open = fs17.open;
12241
+ fs17.open = open;
12242
+ function open(path15, flags, mode, cb) {
12243
12243
  if (typeof mode === "function")
12244
12244
  cb = mode, mode = null;
12245
- return go$open(path14, flags, mode, cb);
12246
- function go$open(path15, flags2, mode2, cb2, startTime) {
12247
- return fs$open(path15, flags2, mode2, function(err, fd) {
12245
+ return go$open(path15, flags, mode, cb);
12246
+ function go$open(path16, flags2, mode2, cb2, startTime) {
12247
+ return fs$open(path16, flags2, mode2, function(err, fd) {
12248
12248
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
12249
- enqueue([go$open, [path15, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
12249
+ enqueue([go$open, [path16, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
12250
12250
  else {
12251
12251
  if (typeof cb2 === "function")
12252
12252
  cb2.apply(this, arguments);
@@ -12254,20 +12254,20 @@ var require_graceful_fs = __commonJS({
12254
12254
  });
12255
12255
  }
12256
12256
  }
12257
- return fs15;
12257
+ return fs17;
12258
12258
  }
12259
12259
  function enqueue(elem) {
12260
12260
  debug("ENQUEUE", elem[0].name, elem[1]);
12261
- fs14[gracefulQueue].push(elem);
12261
+ fs16[gracefulQueue].push(elem);
12262
12262
  retry();
12263
12263
  }
12264
12264
  var retryTimer;
12265
12265
  function resetQueue() {
12266
12266
  var now = Date.now();
12267
- for (var i = 0; i < fs14[gracefulQueue].length; ++i) {
12268
- if (fs14[gracefulQueue][i].length > 2) {
12269
- fs14[gracefulQueue][i][3] = now;
12270
- fs14[gracefulQueue][i][4] = now;
12267
+ for (var i = 0; i < fs16[gracefulQueue].length; ++i) {
12268
+ if (fs16[gracefulQueue][i].length > 2) {
12269
+ fs16[gracefulQueue][i][3] = now;
12270
+ fs16[gracefulQueue][i][4] = now;
12271
12271
  }
12272
12272
  }
12273
12273
  retry();
@@ -12275,9 +12275,9 @@ var require_graceful_fs = __commonJS({
12275
12275
  function retry() {
12276
12276
  clearTimeout(retryTimer);
12277
12277
  retryTimer = void 0;
12278
- if (fs14[gracefulQueue].length === 0)
12278
+ if (fs16[gracefulQueue].length === 0)
12279
12279
  return;
12280
- var elem = fs14[gracefulQueue].shift();
12280
+ var elem = fs16[gracefulQueue].shift();
12281
12281
  var fn = elem[0];
12282
12282
  var args = elem[1];
12283
12283
  var err = elem[2];
@@ -12299,7 +12299,7 @@ var require_graceful_fs = __commonJS({
12299
12299
  debug("RETRY", fn.name, args);
12300
12300
  fn.apply(null, args.concat([startTime]));
12301
12301
  } else {
12302
- fs14[gracefulQueue].push(elem);
12302
+ fs16[gracefulQueue].push(elem);
12303
12303
  }
12304
12304
  }
12305
12305
  if (retryTimer === void 0) {
@@ -12314,7 +12314,7 @@ var require_fs = __commonJS({
12314
12314
  "node_modules/fs-extra/lib/fs/index.js"(exports2) {
12315
12315
  "use strict";
12316
12316
  var u = require_universalify().fromCallback;
12317
- var fs14 = require_graceful_fs();
12317
+ var fs16 = require_graceful_fs();
12318
12318
  var api = [
12319
12319
  "access",
12320
12320
  "appendFile",
@@ -12355,26 +12355,26 @@ var require_fs = __commonJS({
12355
12355
  "utimes",
12356
12356
  "writeFile"
12357
12357
  ].filter((key) => {
12358
- return typeof fs14[key] === "function";
12358
+ return typeof fs16[key] === "function";
12359
12359
  });
12360
- Object.assign(exports2, fs14);
12360
+ Object.assign(exports2, fs16);
12361
12361
  api.forEach((method) => {
12362
- exports2[method] = u(fs14[method]);
12362
+ exports2[method] = u(fs16[method]);
12363
12363
  });
12364
12364
  exports2.exists = function(filename, callback) {
12365
12365
  if (typeof callback === "function") {
12366
- return fs14.exists(filename, callback);
12366
+ return fs16.exists(filename, callback);
12367
12367
  }
12368
12368
  return new Promise((resolve2) => {
12369
- return fs14.exists(filename, resolve2);
12369
+ return fs16.exists(filename, resolve2);
12370
12370
  });
12371
12371
  };
12372
12372
  exports2.read = function(fd, buffer, offset, length, position, callback) {
12373
12373
  if (typeof callback === "function") {
12374
- return fs14.read(fd, buffer, offset, length, position, callback);
12374
+ return fs16.read(fd, buffer, offset, length, position, callback);
12375
12375
  }
12376
12376
  return new Promise((resolve2, reject) => {
12377
- fs14.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
12377
+ fs16.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
12378
12378
  if (err) return reject(err);
12379
12379
  resolve2({ bytesRead, buffer: buffer2 });
12380
12380
  });
@@ -12382,10 +12382,10 @@ var require_fs = __commonJS({
12382
12382
  };
12383
12383
  exports2.write = function(fd, buffer, ...args) {
12384
12384
  if (typeof args[args.length - 1] === "function") {
12385
- return fs14.write(fd, buffer, ...args);
12385
+ return fs16.write(fd, buffer, ...args);
12386
12386
  }
12387
12387
  return new Promise((resolve2, reject) => {
12388
- fs14.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
12388
+ fs16.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
12389
12389
  if (err) return reject(err);
12390
12390
  resolve2({ bytesWritten, buffer: buffer2 });
12391
12391
  });
@@ -12393,10 +12393,10 @@ var require_fs = __commonJS({
12393
12393
  };
12394
12394
  exports2.readv = function(fd, buffers, ...args) {
12395
12395
  if (typeof args[args.length - 1] === "function") {
12396
- return fs14.readv(fd, buffers, ...args);
12396
+ return fs16.readv(fd, buffers, ...args);
12397
12397
  }
12398
12398
  return new Promise((resolve2, reject) => {
12399
- fs14.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
12399
+ fs16.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
12400
12400
  if (err) return reject(err);
12401
12401
  resolve2({ bytesRead, buffers: buffers2 });
12402
12402
  });
@@ -12404,17 +12404,17 @@ var require_fs = __commonJS({
12404
12404
  };
12405
12405
  exports2.writev = function(fd, buffers, ...args) {
12406
12406
  if (typeof args[args.length - 1] === "function") {
12407
- return fs14.writev(fd, buffers, ...args);
12407
+ return fs16.writev(fd, buffers, ...args);
12408
12408
  }
12409
12409
  return new Promise((resolve2, reject) => {
12410
- fs14.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
12410
+ fs16.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
12411
12411
  if (err) return reject(err);
12412
12412
  resolve2({ bytesWritten, buffers: buffers2 });
12413
12413
  });
12414
12414
  });
12415
12415
  };
12416
- if (typeof fs14.realpath.native === "function") {
12417
- exports2.realpath.native = u(fs14.realpath.native);
12416
+ if (typeof fs16.realpath.native === "function") {
12417
+ exports2.realpath.native = u(fs16.realpath.native);
12418
12418
  } else {
12419
12419
  process.emitWarning(
12420
12420
  "fs.realpath.native is not a function. Is fs being monkey-patched?",
@@ -12429,10 +12429,10 @@ var require_fs = __commonJS({
12429
12429
  var require_utils = __commonJS({
12430
12430
  "node_modules/fs-extra/lib/mkdirs/utils.js"(exports2, module2) {
12431
12431
  "use strict";
12432
- var path14 = require("path");
12432
+ var path15 = require("path");
12433
12433
  module2.exports.checkPath = function checkPath(pth) {
12434
12434
  if (process.platform === "win32") {
12435
- const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path14.parse(pth).root, ""));
12435
+ const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path15.parse(pth).root, ""));
12436
12436
  if (pathHasInvalidWinCharacters) {
12437
12437
  const error49 = new Error(`Path contains invalid characters: ${pth}`);
12438
12438
  error49.code = "EINVAL";
@@ -12447,7 +12447,7 @@ var require_utils = __commonJS({
12447
12447
  var require_make_dir = __commonJS({
12448
12448
  "node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports2, module2) {
12449
12449
  "use strict";
12450
- var fs14 = require_fs();
12450
+ var fs16 = require_fs();
12451
12451
  var { checkPath } = require_utils();
12452
12452
  var getMode = (options) => {
12453
12453
  const defaults = { mode: 511 };
@@ -12456,14 +12456,14 @@ var require_make_dir = __commonJS({
12456
12456
  };
12457
12457
  module2.exports.makeDir = async (dir, options) => {
12458
12458
  checkPath(dir);
12459
- return fs14.mkdir(dir, {
12459
+ return fs16.mkdir(dir, {
12460
12460
  mode: getMode(options),
12461
12461
  recursive: true
12462
12462
  });
12463
12463
  };
12464
12464
  module2.exports.makeDirSync = (dir, options) => {
12465
12465
  checkPath(dir);
12466
- return fs14.mkdirSync(dir, {
12466
+ return fs16.mkdirSync(dir, {
12467
12467
  mode: getMode(options),
12468
12468
  recursive: true
12469
12469
  });
@@ -12495,13 +12495,13 @@ var require_path_exists = __commonJS({
12495
12495
  "node_modules/fs-extra/lib/path-exists/index.js"(exports2, module2) {
12496
12496
  "use strict";
12497
12497
  var u = require_universalify().fromPromise;
12498
- var fs14 = require_fs();
12499
- function pathExists(path14) {
12500
- return fs14.access(path14).then(() => true).catch(() => false);
12498
+ var fs16 = require_fs();
12499
+ function pathExists(path15) {
12500
+ return fs16.access(path15).then(() => true).catch(() => false);
12501
12501
  }
12502
12502
  module2.exports = {
12503
12503
  pathExists: u(pathExists),
12504
- pathExistsSync: fs14.existsSync
12504
+ pathExistsSync: fs16.existsSync
12505
12505
  };
12506
12506
  }
12507
12507
  });
@@ -12510,16 +12510,16 @@ var require_path_exists = __commonJS({
12510
12510
  var require_utimes = __commonJS({
12511
12511
  "node_modules/fs-extra/lib/util/utimes.js"(exports2, module2) {
12512
12512
  "use strict";
12513
- var fs14 = require_fs();
12513
+ var fs16 = require_fs();
12514
12514
  var u = require_universalify().fromPromise;
12515
- async function utimesMillis(path14, atime, mtime) {
12516
- const fd = await fs14.open(path14, "r+");
12515
+ async function utimesMillis(path15, atime, mtime) {
12516
+ const fd = await fs16.open(path15, "r+");
12517
12517
  let closeErr = null;
12518
12518
  try {
12519
- await fs14.futimes(fd, atime, mtime);
12519
+ await fs16.futimes(fd, atime, mtime);
12520
12520
  } finally {
12521
12521
  try {
12522
- await fs14.close(fd);
12522
+ await fs16.close(fd);
12523
12523
  } catch (e) {
12524
12524
  closeErr = e;
12525
12525
  }
@@ -12528,10 +12528,10 @@ var require_utimes = __commonJS({
12528
12528
  throw closeErr;
12529
12529
  }
12530
12530
  }
12531
- function utimesMillisSync(path14, atime, mtime) {
12532
- const fd = fs14.openSync(path14, "r+");
12533
- fs14.futimesSync(fd, atime, mtime);
12534
- return fs14.closeSync(fd);
12531
+ function utimesMillisSync(path15, atime, mtime) {
12532
+ const fd = fs16.openSync(path15, "r+");
12533
+ fs16.futimesSync(fd, atime, mtime);
12534
+ return fs16.closeSync(fd);
12535
12535
  }
12536
12536
  module2.exports = {
12537
12537
  utimesMillis: u(utimesMillis),
@@ -12544,11 +12544,11 @@ var require_utimes = __commonJS({
12544
12544
  var require_stat = __commonJS({
12545
12545
  "node_modules/fs-extra/lib/util/stat.js"(exports2, module2) {
12546
12546
  "use strict";
12547
- var fs14 = require_fs();
12548
- var path14 = require("path");
12547
+ var fs16 = require_fs();
12548
+ var path15 = require("path");
12549
12549
  var u = require_universalify().fromPromise;
12550
12550
  function getStats(src, dest, opts) {
12551
- const statFunc = opts.dereference ? (file2) => fs14.stat(file2, { bigint: true }) : (file2) => fs14.lstat(file2, { bigint: true });
12551
+ const statFunc = opts.dereference ? (file2) => fs16.stat(file2, { bigint: true }) : (file2) => fs16.lstat(file2, { bigint: true });
12552
12552
  return Promise.all([
12553
12553
  statFunc(src),
12554
12554
  statFunc(dest).catch((err) => {
@@ -12559,7 +12559,7 @@ var require_stat = __commonJS({
12559
12559
  }
12560
12560
  function getStatsSync(src, dest, opts) {
12561
12561
  let destStat;
12562
- const statFunc = opts.dereference ? (file2) => fs14.statSync(file2, { bigint: true }) : (file2) => fs14.lstatSync(file2, { bigint: true });
12562
+ const statFunc = opts.dereference ? (file2) => fs16.statSync(file2, { bigint: true }) : (file2) => fs16.lstatSync(file2, { bigint: true });
12563
12563
  const srcStat = statFunc(src);
12564
12564
  try {
12565
12565
  destStat = statFunc(dest);
@@ -12573,8 +12573,8 @@ var require_stat = __commonJS({
12573
12573
  const { srcStat, destStat } = await getStats(src, dest, opts);
12574
12574
  if (destStat) {
12575
12575
  if (areIdentical(srcStat, destStat)) {
12576
- const srcBaseName = path14.basename(src);
12577
- const destBaseName = path14.basename(dest);
12576
+ const srcBaseName = path15.basename(src);
12577
+ const destBaseName = path15.basename(dest);
12578
12578
  if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
12579
12579
  return { srcStat, destStat, isChangingCase: true };
12580
12580
  }
@@ -12596,8 +12596,8 @@ var require_stat = __commonJS({
12596
12596
  const { srcStat, destStat } = getStatsSync(src, dest, opts);
12597
12597
  if (destStat) {
12598
12598
  if (areIdentical(srcStat, destStat)) {
12599
- const srcBaseName = path14.basename(src);
12600
- const destBaseName = path14.basename(dest);
12599
+ const srcBaseName = path15.basename(src);
12600
+ const destBaseName = path15.basename(dest);
12601
12601
  if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
12602
12602
  return { srcStat, destStat, isChangingCase: true };
12603
12603
  }
@@ -12616,12 +12616,12 @@ var require_stat = __commonJS({
12616
12616
  return { srcStat, destStat };
12617
12617
  }
12618
12618
  async function checkParentPaths(src, srcStat, dest, funcName) {
12619
- const srcParent = path14.resolve(path14.dirname(src));
12620
- const destParent = path14.resolve(path14.dirname(dest));
12621
- if (destParent === srcParent || destParent === path14.parse(destParent).root) return;
12619
+ const srcParent = path15.resolve(path15.dirname(src));
12620
+ const destParent = path15.resolve(path15.dirname(dest));
12621
+ if (destParent === srcParent || destParent === path15.parse(destParent).root) return;
12622
12622
  let destStat;
12623
12623
  try {
12624
- destStat = await fs14.stat(destParent, { bigint: true });
12624
+ destStat = await fs16.stat(destParent, { bigint: true });
12625
12625
  } catch (err) {
12626
12626
  if (err.code === "ENOENT") return;
12627
12627
  throw err;
@@ -12632,12 +12632,12 @@ var require_stat = __commonJS({
12632
12632
  return checkParentPaths(src, srcStat, destParent, funcName);
12633
12633
  }
12634
12634
  function checkParentPathsSync(src, srcStat, dest, funcName) {
12635
- const srcParent = path14.resolve(path14.dirname(src));
12636
- const destParent = path14.resolve(path14.dirname(dest));
12637
- if (destParent === srcParent || destParent === path14.parse(destParent).root) return;
12635
+ const srcParent = path15.resolve(path15.dirname(src));
12636
+ const destParent = path15.resolve(path15.dirname(dest));
12637
+ if (destParent === srcParent || destParent === path15.parse(destParent).root) return;
12638
12638
  let destStat;
12639
12639
  try {
12640
- destStat = fs14.statSync(destParent, { bigint: true });
12640
+ destStat = fs16.statSync(destParent, { bigint: true });
12641
12641
  } catch (err) {
12642
12642
  if (err.code === "ENOENT") return;
12643
12643
  throw err;
@@ -12651,8 +12651,8 @@ var require_stat = __commonJS({
12651
12651
  return destStat.ino !== void 0 && destStat.dev !== void 0 && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
12652
12652
  }
12653
12653
  function isSrcSubdir(src, dest) {
12654
- const srcArr = path14.resolve(src).split(path14.sep).filter((i) => i);
12655
- const destArr = path14.resolve(dest).split(path14.sep).filter((i) => i);
12654
+ const srcArr = path15.resolve(src).split(path15.sep).filter((i) => i);
12655
+ const destArr = path15.resolve(dest).split(path15.sep).filter((i) => i);
12656
12656
  return srcArr.every((cur, i) => destArr[i] === cur);
12657
12657
  }
12658
12658
  function errMsg(src, dest, funcName) {
@@ -12704,8 +12704,8 @@ var require_async = __commonJS({
12704
12704
  var require_copy = __commonJS({
12705
12705
  "node_modules/fs-extra/lib/copy/copy.js"(exports2, module2) {
12706
12706
  "use strict";
12707
- var fs14 = require_fs();
12708
- var path14 = require("path");
12707
+ var fs16 = require_fs();
12708
+ var path15 = require("path");
12709
12709
  var { mkdirs } = require_mkdirs();
12710
12710
  var { pathExists } = require_path_exists();
12711
12711
  var { utimesMillis } = require_utimes();
@@ -12728,7 +12728,7 @@ var require_copy = __commonJS({
12728
12728
  await stat.checkParentPaths(src, srcStat, dest, "copy");
12729
12729
  const include = await runFilter(src, dest, opts);
12730
12730
  if (!include) return;
12731
- const destParent = path14.dirname(dest);
12731
+ const destParent = path15.dirname(dest);
12732
12732
  const dirExists = await pathExists(destParent);
12733
12733
  if (!dirExists) {
12734
12734
  await mkdirs(destParent);
@@ -12740,7 +12740,7 @@ var require_copy = __commonJS({
12740
12740
  return opts.filter(src, dest);
12741
12741
  }
12742
12742
  async function getStatsAndPerformCopy(destStat, src, dest, opts) {
12743
- const statFn = opts.dereference ? fs14.stat : fs14.lstat;
12743
+ const statFn = opts.dereference ? fs16.stat : fs16.lstat;
12744
12744
  const srcStat = await statFn(src);
12745
12745
  if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
12746
12746
  if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
@@ -12752,7 +12752,7 @@ var require_copy = __commonJS({
12752
12752
  async function onFile(srcStat, destStat, src, dest, opts) {
12753
12753
  if (!destStat) return copyFile(srcStat, src, dest, opts);
12754
12754
  if (opts.overwrite) {
12755
- await fs14.unlink(dest);
12755
+ await fs16.unlink(dest);
12756
12756
  return copyFile(srcStat, src, dest, opts);
12757
12757
  }
12758
12758
  if (opts.errorOnExist) {
@@ -12760,29 +12760,29 @@ var require_copy = __commonJS({
12760
12760
  }
12761
12761
  }
12762
12762
  async function copyFile(srcStat, src, dest, opts) {
12763
- await fs14.copyFile(src, dest);
12763
+ await fs16.copyFile(src, dest);
12764
12764
  if (opts.preserveTimestamps) {
12765
12765
  if (fileIsNotWritable(srcStat.mode)) {
12766
12766
  await makeFileWritable(dest, srcStat.mode);
12767
12767
  }
12768
- const updatedSrcStat = await fs14.stat(src);
12768
+ const updatedSrcStat = await fs16.stat(src);
12769
12769
  await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
12770
12770
  }
12771
- return fs14.chmod(dest, srcStat.mode);
12771
+ return fs16.chmod(dest, srcStat.mode);
12772
12772
  }
12773
12773
  function fileIsNotWritable(srcMode) {
12774
12774
  return (srcMode & 128) === 0;
12775
12775
  }
12776
12776
  function makeFileWritable(dest, srcMode) {
12777
- return fs14.chmod(dest, srcMode | 128);
12777
+ return fs16.chmod(dest, srcMode | 128);
12778
12778
  }
12779
12779
  async function onDir(srcStat, destStat, src, dest, opts) {
12780
12780
  if (!destStat) {
12781
- await fs14.mkdir(dest);
12781
+ await fs16.mkdir(dest);
12782
12782
  }
12783
- await asyncIteratorConcurrentProcess(await fs14.opendir(src), async (item) => {
12784
- const srcItem = path14.join(src, item.name);
12785
- const destItem = path14.join(dest, item.name);
12783
+ await asyncIteratorConcurrentProcess(await fs16.opendir(src), async (item) => {
12784
+ const srcItem = path15.join(src, item.name);
12785
+ const destItem = path15.join(dest, item.name);
12786
12786
  const include = await runFilter(srcItem, destItem, opts);
12787
12787
  if (include) {
12788
12788
  const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts);
@@ -12790,26 +12790,26 @@ var require_copy = __commonJS({
12790
12790
  }
12791
12791
  });
12792
12792
  if (!destStat) {
12793
- await fs14.chmod(dest, srcStat.mode);
12793
+ await fs16.chmod(dest, srcStat.mode);
12794
12794
  }
12795
12795
  }
12796
12796
  async function onLink(destStat, src, dest, opts) {
12797
- let resolvedSrc = await fs14.readlink(src);
12797
+ let resolvedSrc = await fs16.readlink(src);
12798
12798
  if (opts.dereference) {
12799
- resolvedSrc = path14.resolve(process.cwd(), resolvedSrc);
12799
+ resolvedSrc = path15.resolve(process.cwd(), resolvedSrc);
12800
12800
  }
12801
12801
  if (!destStat) {
12802
- return fs14.symlink(resolvedSrc, dest);
12802
+ return fs16.symlink(resolvedSrc, dest);
12803
12803
  }
12804
12804
  let resolvedDest = null;
12805
12805
  try {
12806
- resolvedDest = await fs14.readlink(dest);
12806
+ resolvedDest = await fs16.readlink(dest);
12807
12807
  } catch (e) {
12808
- if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs14.symlink(resolvedSrc, dest);
12808
+ if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs16.symlink(resolvedSrc, dest);
12809
12809
  throw e;
12810
12810
  }
12811
12811
  if (opts.dereference) {
12812
- resolvedDest = path14.resolve(process.cwd(), resolvedDest);
12812
+ resolvedDest = path15.resolve(process.cwd(), resolvedDest);
12813
12813
  }
12814
12814
  if (resolvedSrc !== resolvedDest) {
12815
12815
  if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
@@ -12819,8 +12819,8 @@ var require_copy = __commonJS({
12819
12819
  throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
12820
12820
  }
12821
12821
  }
12822
- await fs14.unlink(dest);
12823
- return fs14.symlink(resolvedSrc, dest);
12822
+ await fs16.unlink(dest);
12823
+ return fs16.symlink(resolvedSrc, dest);
12824
12824
  }
12825
12825
  module2.exports = copy;
12826
12826
  }
@@ -12830,8 +12830,8 @@ var require_copy = __commonJS({
12830
12830
  var require_copy_sync = __commonJS({
12831
12831
  "node_modules/fs-extra/lib/copy/copy-sync.js"(exports2, module2) {
12832
12832
  "use strict";
12833
- var fs14 = require_graceful_fs();
12834
- var path14 = require("path");
12833
+ var fs16 = require_graceful_fs();
12834
+ var path15 = require("path");
12835
12835
  var mkdirsSync = require_mkdirs().mkdirsSync;
12836
12836
  var utimesMillisSync = require_utimes().utimesMillisSync;
12837
12837
  var stat = require_stat();
@@ -12852,12 +12852,12 @@ var require_copy_sync = __commonJS({
12852
12852
  const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
12853
12853
  stat.checkParentPathsSync(src, srcStat, dest, "copy");
12854
12854
  if (opts.filter && !opts.filter(src, dest)) return;
12855
- const destParent = path14.dirname(dest);
12856
- if (!fs14.existsSync(destParent)) mkdirsSync(destParent);
12855
+ const destParent = path15.dirname(dest);
12856
+ if (!fs16.existsSync(destParent)) mkdirsSync(destParent);
12857
12857
  return getStats(destStat, src, dest, opts);
12858
12858
  }
12859
12859
  function getStats(destStat, src, dest, opts) {
12860
- const statSync = opts.dereference ? fs14.statSync : fs14.lstatSync;
12860
+ const statSync = opts.dereference ? fs16.statSync : fs16.lstatSync;
12861
12861
  const srcStat = statSync(src);
12862
12862
  if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
12863
12863
  else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
@@ -12872,14 +12872,14 @@ var require_copy_sync = __commonJS({
12872
12872
  }
12873
12873
  function mayCopyFile(srcStat, src, dest, opts) {
12874
12874
  if (opts.overwrite) {
12875
- fs14.unlinkSync(dest);
12875
+ fs16.unlinkSync(dest);
12876
12876
  return copyFile(srcStat, src, dest, opts);
12877
12877
  } else if (opts.errorOnExist) {
12878
12878
  throw new Error(`'${dest}' already exists`);
12879
12879
  }
12880
12880
  }
12881
12881
  function copyFile(srcStat, src, dest, opts) {
12882
- fs14.copyFileSync(src, dest);
12882
+ fs16.copyFileSync(src, dest);
12883
12883
  if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
12884
12884
  return setDestMode(dest, srcStat.mode);
12885
12885
  }
@@ -12894,10 +12894,10 @@ var require_copy_sync = __commonJS({
12894
12894
  return setDestMode(dest, srcMode | 128);
12895
12895
  }
12896
12896
  function setDestMode(dest, srcMode) {
12897
- return fs14.chmodSync(dest, srcMode);
12897
+ return fs16.chmodSync(dest, srcMode);
12898
12898
  }
12899
12899
  function setDestTimestamps(src, dest) {
12900
- const updatedSrcStat = fs14.statSync(src);
12900
+ const updatedSrcStat = fs16.statSync(src);
12901
12901
  return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
12902
12902
  }
12903
12903
  function onDir(srcStat, destStat, src, dest, opts) {
@@ -12905,12 +12905,12 @@ var require_copy_sync = __commonJS({
12905
12905
  return copyDir(src, dest, opts);
12906
12906
  }
12907
12907
  function mkDirAndCopy(srcMode, src, dest, opts) {
12908
- fs14.mkdirSync(dest);
12908
+ fs16.mkdirSync(dest);
12909
12909
  copyDir(src, dest, opts);
12910
12910
  return setDestMode(dest, srcMode);
12911
12911
  }
12912
12912
  function copyDir(src, dest, opts) {
12913
- const dir = fs14.opendirSync(src);
12913
+ const dir = fs16.opendirSync(src);
12914
12914
  try {
12915
12915
  let dirent;
12916
12916
  while ((dirent = dir.readSync()) !== null) {
@@ -12921,29 +12921,29 @@ var require_copy_sync = __commonJS({
12921
12921
  }
12922
12922
  }
12923
12923
  function copyDirItem(item, src, dest, opts) {
12924
- const srcItem = path14.join(src, item);
12925
- const destItem = path14.join(dest, item);
12924
+ const srcItem = path15.join(src, item);
12925
+ const destItem = path15.join(dest, item);
12926
12926
  if (opts.filter && !opts.filter(srcItem, destItem)) return;
12927
12927
  const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
12928
12928
  return getStats(destStat, srcItem, destItem, opts);
12929
12929
  }
12930
12930
  function onLink(destStat, src, dest, opts) {
12931
- let resolvedSrc = fs14.readlinkSync(src);
12931
+ let resolvedSrc = fs16.readlinkSync(src);
12932
12932
  if (opts.dereference) {
12933
- resolvedSrc = path14.resolve(process.cwd(), resolvedSrc);
12933
+ resolvedSrc = path15.resolve(process.cwd(), resolvedSrc);
12934
12934
  }
12935
12935
  if (!destStat) {
12936
- return fs14.symlinkSync(resolvedSrc, dest);
12936
+ return fs16.symlinkSync(resolvedSrc, dest);
12937
12937
  } else {
12938
12938
  let resolvedDest;
12939
12939
  try {
12940
- resolvedDest = fs14.readlinkSync(dest);
12940
+ resolvedDest = fs16.readlinkSync(dest);
12941
12941
  } catch (err) {
12942
- if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs14.symlinkSync(resolvedSrc, dest);
12942
+ if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs16.symlinkSync(resolvedSrc, dest);
12943
12943
  throw err;
12944
12944
  }
12945
12945
  if (opts.dereference) {
12946
- resolvedDest = path14.resolve(process.cwd(), resolvedDest);
12946
+ resolvedDest = path15.resolve(process.cwd(), resolvedDest);
12947
12947
  }
12948
12948
  if (resolvedSrc !== resolvedDest) {
12949
12949
  if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
@@ -12957,8 +12957,8 @@ var require_copy_sync = __commonJS({
12957
12957
  }
12958
12958
  }
12959
12959
  function copyLink(resolvedSrc, dest) {
12960
- fs14.unlinkSync(dest);
12961
- return fs14.symlinkSync(resolvedSrc, dest);
12960
+ fs16.unlinkSync(dest);
12961
+ return fs16.symlinkSync(resolvedSrc, dest);
12962
12962
  }
12963
12963
  module2.exports = copySync;
12964
12964
  }
@@ -12980,13 +12980,13 @@ var require_copy2 = __commonJS({
12980
12980
  var require_remove = __commonJS({
12981
12981
  "node_modules/fs-extra/lib/remove/index.js"(exports2, module2) {
12982
12982
  "use strict";
12983
- var fs14 = require_graceful_fs();
12983
+ var fs16 = require_graceful_fs();
12984
12984
  var u = require_universalify().fromCallback;
12985
- function remove(path14, callback) {
12986
- fs14.rm(path14, { recursive: true, force: true }, callback);
12985
+ function remove(path15, callback) {
12986
+ fs16.rm(path15, { recursive: true, force: true }, callback);
12987
12987
  }
12988
- function removeSync(path14) {
12989
- fs14.rmSync(path14, { recursive: true, force: true });
12988
+ function removeSync(path15) {
12989
+ fs16.rmSync(path15, { recursive: true, force: true });
12990
12990
  }
12991
12991
  module2.exports = {
12992
12992
  remove: u(remove),
@@ -13000,28 +13000,28 @@ var require_empty = __commonJS({
13000
13000
  "node_modules/fs-extra/lib/empty/index.js"(exports2, module2) {
13001
13001
  "use strict";
13002
13002
  var u = require_universalify().fromPromise;
13003
- var fs14 = require_fs();
13004
- var path14 = require("path");
13003
+ var fs16 = require_fs();
13004
+ var path15 = require("path");
13005
13005
  var mkdir = require_mkdirs();
13006
13006
  var remove = require_remove();
13007
13007
  var emptyDir = u(async function emptyDir2(dir) {
13008
13008
  let items;
13009
13009
  try {
13010
- items = await fs14.readdir(dir);
13010
+ items = await fs16.readdir(dir);
13011
13011
  } catch {
13012
13012
  return mkdir.mkdirs(dir);
13013
13013
  }
13014
- return Promise.all(items.map((item) => remove.remove(path14.join(dir, item))));
13014
+ return Promise.all(items.map((item) => remove.remove(path15.join(dir, item))));
13015
13015
  });
13016
13016
  function emptyDirSync(dir) {
13017
13017
  let items;
13018
13018
  try {
13019
- items = fs14.readdirSync(dir);
13019
+ items = fs16.readdirSync(dir);
13020
13020
  } catch {
13021
13021
  return mkdir.mkdirsSync(dir);
13022
13022
  }
13023
13023
  items.forEach((item) => {
13024
- item = path14.join(dir, item);
13024
+ item = path15.join(dir, item);
13025
13025
  remove.removeSync(item);
13026
13026
  });
13027
13027
  }
@@ -13039,52 +13039,52 @@ var require_file = __commonJS({
13039
13039
  "node_modules/fs-extra/lib/ensure/file.js"(exports2, module2) {
13040
13040
  "use strict";
13041
13041
  var u = require_universalify().fromPromise;
13042
- var path14 = require("path");
13043
- var fs14 = require_fs();
13042
+ var path15 = require("path");
13043
+ var fs16 = require_fs();
13044
13044
  var mkdir = require_mkdirs();
13045
13045
  async function createFile(file2) {
13046
13046
  let stats;
13047
13047
  try {
13048
- stats = await fs14.stat(file2);
13048
+ stats = await fs16.stat(file2);
13049
13049
  } catch {
13050
13050
  }
13051
13051
  if (stats && stats.isFile()) return;
13052
- const dir = path14.dirname(file2);
13052
+ const dir = path15.dirname(file2);
13053
13053
  let dirStats = null;
13054
13054
  try {
13055
- dirStats = await fs14.stat(dir);
13055
+ dirStats = await fs16.stat(dir);
13056
13056
  } catch (err) {
13057
13057
  if (err.code === "ENOENT") {
13058
13058
  await mkdir.mkdirs(dir);
13059
- await fs14.writeFile(file2, "");
13059
+ await fs16.writeFile(file2, "");
13060
13060
  return;
13061
13061
  } else {
13062
13062
  throw err;
13063
13063
  }
13064
13064
  }
13065
13065
  if (dirStats.isDirectory()) {
13066
- await fs14.writeFile(file2, "");
13066
+ await fs16.writeFile(file2, "");
13067
13067
  } else {
13068
- await fs14.readdir(dir);
13068
+ await fs16.readdir(dir);
13069
13069
  }
13070
13070
  }
13071
13071
  function createFileSync(file2) {
13072
13072
  let stats;
13073
13073
  try {
13074
- stats = fs14.statSync(file2);
13074
+ stats = fs16.statSync(file2);
13075
13075
  } catch {
13076
13076
  }
13077
13077
  if (stats && stats.isFile()) return;
13078
- const dir = path14.dirname(file2);
13078
+ const dir = path15.dirname(file2);
13079
13079
  try {
13080
- if (!fs14.statSync(dir).isDirectory()) {
13081
- fs14.readdirSync(dir);
13080
+ if (!fs16.statSync(dir).isDirectory()) {
13081
+ fs16.readdirSync(dir);
13082
13082
  }
13083
13083
  } catch (err) {
13084
13084
  if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
13085
13085
  else throw err;
13086
13086
  }
13087
- fs14.writeFileSync(file2, "");
13087
+ fs16.writeFileSync(file2, "");
13088
13088
  }
13089
13089
  module2.exports = {
13090
13090
  createFile: u(createFile),
@@ -13098,50 +13098,50 @@ var require_link = __commonJS({
13098
13098
  "node_modules/fs-extra/lib/ensure/link.js"(exports2, module2) {
13099
13099
  "use strict";
13100
13100
  var u = require_universalify().fromPromise;
13101
- var path14 = require("path");
13102
- var fs14 = require_fs();
13101
+ var path15 = require("path");
13102
+ var fs16 = require_fs();
13103
13103
  var mkdir = require_mkdirs();
13104
13104
  var { pathExists } = require_path_exists();
13105
13105
  var { areIdentical } = require_stat();
13106
13106
  async function createLink(srcpath, dstpath) {
13107
13107
  let dstStat;
13108
13108
  try {
13109
- dstStat = await fs14.lstat(dstpath);
13109
+ dstStat = await fs16.lstat(dstpath);
13110
13110
  } catch {
13111
13111
  }
13112
13112
  let srcStat;
13113
13113
  try {
13114
- srcStat = await fs14.lstat(srcpath);
13114
+ srcStat = await fs16.lstat(srcpath);
13115
13115
  } catch (err) {
13116
13116
  err.message = err.message.replace("lstat", "ensureLink");
13117
13117
  throw err;
13118
13118
  }
13119
13119
  if (dstStat && areIdentical(srcStat, dstStat)) return;
13120
- const dir = path14.dirname(dstpath);
13120
+ const dir = path15.dirname(dstpath);
13121
13121
  const dirExists = await pathExists(dir);
13122
13122
  if (!dirExists) {
13123
13123
  await mkdir.mkdirs(dir);
13124
13124
  }
13125
- await fs14.link(srcpath, dstpath);
13125
+ await fs16.link(srcpath, dstpath);
13126
13126
  }
13127
13127
  function createLinkSync(srcpath, dstpath) {
13128
13128
  let dstStat;
13129
13129
  try {
13130
- dstStat = fs14.lstatSync(dstpath);
13130
+ dstStat = fs16.lstatSync(dstpath);
13131
13131
  } catch {
13132
13132
  }
13133
13133
  try {
13134
- const srcStat = fs14.lstatSync(srcpath);
13134
+ const srcStat = fs16.lstatSync(srcpath);
13135
13135
  if (dstStat && areIdentical(srcStat, dstStat)) return;
13136
13136
  } catch (err) {
13137
13137
  err.message = err.message.replace("lstat", "ensureLink");
13138
13138
  throw err;
13139
13139
  }
13140
- const dir = path14.dirname(dstpath);
13141
- const dirExists = fs14.existsSync(dir);
13142
- if (dirExists) return fs14.linkSync(srcpath, dstpath);
13140
+ const dir = path15.dirname(dstpath);
13141
+ const dirExists = fs16.existsSync(dir);
13142
+ if (dirExists) return fs16.linkSync(srcpath, dstpath);
13143
13143
  mkdir.mkdirsSync(dir);
13144
- return fs14.linkSync(srcpath, dstpath);
13144
+ return fs16.linkSync(srcpath, dstpath);
13145
13145
  }
13146
13146
  module2.exports = {
13147
13147
  createLink: u(createLink),
@@ -13154,14 +13154,14 @@ var require_link = __commonJS({
13154
13154
  var require_symlink_paths = __commonJS({
13155
13155
  "node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports2, module2) {
13156
13156
  "use strict";
13157
- var path14 = require("path");
13158
- var fs14 = require_fs();
13157
+ var path15 = require("path");
13158
+ var fs16 = require_fs();
13159
13159
  var { pathExists } = require_path_exists();
13160
13160
  var u = require_universalify().fromPromise;
13161
13161
  async function symlinkPaths(srcpath, dstpath) {
13162
- if (path14.isAbsolute(srcpath)) {
13162
+ if (path15.isAbsolute(srcpath)) {
13163
13163
  try {
13164
- await fs14.lstat(srcpath);
13164
+ await fs16.lstat(srcpath);
13165
13165
  } catch (err) {
13166
13166
  err.message = err.message.replace("lstat", "ensureSymlink");
13167
13167
  throw err;
@@ -13171,8 +13171,8 @@ var require_symlink_paths = __commonJS({
13171
13171
  toDst: srcpath
13172
13172
  };
13173
13173
  }
13174
- const dstdir = path14.dirname(dstpath);
13175
- const relativeToDst = path14.join(dstdir, srcpath);
13174
+ const dstdir = path15.dirname(dstpath);
13175
+ const relativeToDst = path15.join(dstdir, srcpath);
13176
13176
  const exists = await pathExists(relativeToDst);
13177
13177
  if (exists) {
13178
13178
  return {
@@ -13181,39 +13181,39 @@ var require_symlink_paths = __commonJS({
13181
13181
  };
13182
13182
  }
13183
13183
  try {
13184
- await fs14.lstat(srcpath);
13184
+ await fs16.lstat(srcpath);
13185
13185
  } catch (err) {
13186
13186
  err.message = err.message.replace("lstat", "ensureSymlink");
13187
13187
  throw err;
13188
13188
  }
13189
13189
  return {
13190
13190
  toCwd: srcpath,
13191
- toDst: path14.relative(dstdir, srcpath)
13191
+ toDst: path15.relative(dstdir, srcpath)
13192
13192
  };
13193
13193
  }
13194
13194
  function symlinkPathsSync(srcpath, dstpath) {
13195
- if (path14.isAbsolute(srcpath)) {
13196
- const exists2 = fs14.existsSync(srcpath);
13195
+ if (path15.isAbsolute(srcpath)) {
13196
+ const exists2 = fs16.existsSync(srcpath);
13197
13197
  if (!exists2) throw new Error("absolute srcpath does not exist");
13198
13198
  return {
13199
13199
  toCwd: srcpath,
13200
13200
  toDst: srcpath
13201
13201
  };
13202
13202
  }
13203
- const dstdir = path14.dirname(dstpath);
13204
- const relativeToDst = path14.join(dstdir, srcpath);
13205
- const exists = fs14.existsSync(relativeToDst);
13203
+ const dstdir = path15.dirname(dstpath);
13204
+ const relativeToDst = path15.join(dstdir, srcpath);
13205
+ const exists = fs16.existsSync(relativeToDst);
13206
13206
  if (exists) {
13207
13207
  return {
13208
13208
  toCwd: relativeToDst,
13209
13209
  toDst: srcpath
13210
13210
  };
13211
13211
  }
13212
- const srcExists = fs14.existsSync(srcpath);
13212
+ const srcExists = fs16.existsSync(srcpath);
13213
13213
  if (!srcExists) throw new Error("relative srcpath does not exist");
13214
13214
  return {
13215
13215
  toCwd: srcpath,
13216
- toDst: path14.relative(dstdir, srcpath)
13216
+ toDst: path15.relative(dstdir, srcpath)
13217
13217
  };
13218
13218
  }
13219
13219
  module2.exports = {
@@ -13227,13 +13227,13 @@ var require_symlink_paths = __commonJS({
13227
13227
  var require_symlink_type = __commonJS({
13228
13228
  "node_modules/fs-extra/lib/ensure/symlink-type.js"(exports2, module2) {
13229
13229
  "use strict";
13230
- var fs14 = require_fs();
13230
+ var fs16 = require_fs();
13231
13231
  var u = require_universalify().fromPromise;
13232
13232
  async function symlinkType(srcpath, type) {
13233
13233
  if (type) return type;
13234
13234
  let stats;
13235
13235
  try {
13236
- stats = await fs14.lstat(srcpath);
13236
+ stats = await fs16.lstat(srcpath);
13237
13237
  } catch {
13238
13238
  return "file";
13239
13239
  }
@@ -13243,7 +13243,7 @@ var require_symlink_type = __commonJS({
13243
13243
  if (type) return type;
13244
13244
  let stats;
13245
13245
  try {
13246
- stats = fs14.lstatSync(srcpath);
13246
+ stats = fs16.lstatSync(srcpath);
13247
13247
  } catch {
13248
13248
  return "file";
13249
13249
  }
@@ -13261,8 +13261,8 @@ var require_symlink = __commonJS({
13261
13261
  "node_modules/fs-extra/lib/ensure/symlink.js"(exports2, module2) {
13262
13262
  "use strict";
13263
13263
  var u = require_universalify().fromPromise;
13264
- var path14 = require("path");
13265
- var fs14 = require_fs();
13264
+ var path15 = require("path");
13265
+ var fs16 = require_fs();
13266
13266
  var { mkdirs, mkdirsSync } = require_mkdirs();
13267
13267
  var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
13268
13268
  var { symlinkType, symlinkTypeSync } = require_symlink_type();
@@ -13271,44 +13271,44 @@ var require_symlink = __commonJS({
13271
13271
  async function createSymlink(srcpath, dstpath, type) {
13272
13272
  let stats;
13273
13273
  try {
13274
- stats = await fs14.lstat(dstpath);
13274
+ stats = await fs16.lstat(dstpath);
13275
13275
  } catch {
13276
13276
  }
13277
13277
  if (stats && stats.isSymbolicLink()) {
13278
13278
  const [srcStat, dstStat] = await Promise.all([
13279
- fs14.stat(srcpath),
13280
- fs14.stat(dstpath)
13279
+ fs16.stat(srcpath),
13280
+ fs16.stat(dstpath)
13281
13281
  ]);
13282
13282
  if (areIdentical(srcStat, dstStat)) return;
13283
13283
  }
13284
13284
  const relative = await symlinkPaths(srcpath, dstpath);
13285
13285
  srcpath = relative.toDst;
13286
13286
  const toType = await symlinkType(relative.toCwd, type);
13287
- const dir = path14.dirname(dstpath);
13287
+ const dir = path15.dirname(dstpath);
13288
13288
  if (!await pathExists(dir)) {
13289
13289
  await mkdirs(dir);
13290
13290
  }
13291
- return fs14.symlink(srcpath, dstpath, toType);
13291
+ return fs16.symlink(srcpath, dstpath, toType);
13292
13292
  }
13293
13293
  function createSymlinkSync(srcpath, dstpath, type) {
13294
13294
  let stats;
13295
13295
  try {
13296
- stats = fs14.lstatSync(dstpath);
13296
+ stats = fs16.lstatSync(dstpath);
13297
13297
  } catch {
13298
13298
  }
13299
13299
  if (stats && stats.isSymbolicLink()) {
13300
- const srcStat = fs14.statSync(srcpath);
13301
- const dstStat = fs14.statSync(dstpath);
13300
+ const srcStat = fs16.statSync(srcpath);
13301
+ const dstStat = fs16.statSync(dstpath);
13302
13302
  if (areIdentical(srcStat, dstStat)) return;
13303
13303
  }
13304
13304
  const relative = symlinkPathsSync(srcpath, dstpath);
13305
13305
  srcpath = relative.toDst;
13306
13306
  type = symlinkTypeSync(relative.toCwd, type);
13307
- const dir = path14.dirname(dstpath);
13308
- const exists = fs14.existsSync(dir);
13309
- if (exists) return fs14.symlinkSync(srcpath, dstpath, type);
13307
+ const dir = path15.dirname(dstpath);
13308
+ const exists = fs16.existsSync(dir);
13309
+ if (exists) return fs16.symlinkSync(srcpath, dstpath, type);
13310
13310
  mkdirsSync(dir);
13311
- return fs14.symlinkSync(srcpath, dstpath, type);
13311
+ return fs16.symlinkSync(srcpath, dstpath, type);
13312
13312
  }
13313
13313
  module2.exports = {
13314
13314
  createSymlink: u(createSymlink),
@@ -13377,9 +13377,9 @@ var require_jsonfile = __commonJS({
13377
13377
  if (typeof options === "string") {
13378
13378
  options = { encoding: options };
13379
13379
  }
13380
- const fs14 = options.fs || _fs;
13380
+ const fs16 = options.fs || _fs;
13381
13381
  const shouldThrow = "throws" in options ? options.throws : true;
13382
- let data = await universalify.fromCallback(fs14.readFile)(file2, options);
13382
+ let data = await universalify.fromCallback(fs16.readFile)(file2, options);
13383
13383
  data = stripBom(data);
13384
13384
  let obj;
13385
13385
  try {
@@ -13399,10 +13399,10 @@ var require_jsonfile = __commonJS({
13399
13399
  if (typeof options === "string") {
13400
13400
  options = { encoding: options };
13401
13401
  }
13402
- const fs14 = options.fs || _fs;
13402
+ const fs16 = options.fs || _fs;
13403
13403
  const shouldThrow = "throws" in options ? options.throws : true;
13404
13404
  try {
13405
- let content = fs14.readFileSync(file2, options);
13405
+ let content = fs16.readFileSync(file2, options);
13406
13406
  content = stripBom(content);
13407
13407
  return JSON.parse(content, options.reviver);
13408
13408
  } catch (err) {
@@ -13415,15 +13415,15 @@ var require_jsonfile = __commonJS({
13415
13415
  }
13416
13416
  }
13417
13417
  async function _writeFile(file2, obj, options = {}) {
13418
- const fs14 = options.fs || _fs;
13418
+ const fs16 = options.fs || _fs;
13419
13419
  const str = stringify2(obj, options);
13420
- await universalify.fromCallback(fs14.writeFile)(file2, str, options);
13420
+ await universalify.fromCallback(fs16.writeFile)(file2, str, options);
13421
13421
  }
13422
13422
  var writeFile = universalify.fromPromise(_writeFile);
13423
13423
  function writeFileSync2(file2, obj, options = {}) {
13424
- const fs14 = options.fs || _fs;
13424
+ const fs16 = options.fs || _fs;
13425
13425
  const str = stringify2(obj, options);
13426
- return fs14.writeFileSync(file2, str, options);
13426
+ return fs16.writeFileSync(file2, str, options);
13427
13427
  }
13428
13428
  module2.exports = {
13429
13429
  readFile,
@@ -13454,23 +13454,23 @@ var require_output_file = __commonJS({
13454
13454
  "node_modules/fs-extra/lib/output-file/index.js"(exports2, module2) {
13455
13455
  "use strict";
13456
13456
  var u = require_universalify().fromPromise;
13457
- var fs14 = require_fs();
13458
- var path14 = require("path");
13457
+ var fs16 = require_fs();
13458
+ var path15 = require("path");
13459
13459
  var mkdir = require_mkdirs();
13460
13460
  var pathExists = require_path_exists().pathExists;
13461
13461
  async function outputFile(file2, data, encoding = "utf-8") {
13462
- const dir = path14.dirname(file2);
13462
+ const dir = path15.dirname(file2);
13463
13463
  if (!await pathExists(dir)) {
13464
13464
  await mkdir.mkdirs(dir);
13465
13465
  }
13466
- return fs14.writeFile(file2, data, encoding);
13466
+ return fs16.writeFile(file2, data, encoding);
13467
13467
  }
13468
13468
  function outputFileSync(file2, ...args) {
13469
- const dir = path14.dirname(file2);
13470
- if (!fs14.existsSync(dir)) {
13469
+ const dir = path15.dirname(file2);
13470
+ if (!fs16.existsSync(dir)) {
13471
13471
  mkdir.mkdirsSync(dir);
13472
13472
  }
13473
- fs14.writeFileSync(file2, ...args);
13473
+ fs16.writeFileSync(file2, ...args);
13474
13474
  }
13475
13475
  module2.exports = {
13476
13476
  outputFile: u(outputFile),
@@ -13529,8 +13529,8 @@ var require_json = __commonJS({
13529
13529
  var require_move = __commonJS({
13530
13530
  "node_modules/fs-extra/lib/move/move.js"(exports2, module2) {
13531
13531
  "use strict";
13532
- var fs14 = require_fs();
13533
- var path14 = require("path");
13532
+ var fs16 = require_fs();
13533
+ var path15 = require("path");
13534
13534
  var { copy } = require_copy2();
13535
13535
  var { remove } = require_remove();
13536
13536
  var { mkdirp } = require_mkdirs();
@@ -13540,8 +13540,8 @@ var require_move = __commonJS({
13540
13540
  const overwrite = opts.overwrite || opts.clobber || false;
13541
13541
  const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
13542
13542
  await stat.checkParentPaths(src, srcStat, dest, "move");
13543
- const destParent = path14.dirname(dest);
13544
- const parsedParentPath = path14.parse(destParent);
13543
+ const destParent = path15.dirname(dest);
13544
+ const parsedParentPath = path15.parse(destParent);
13545
13545
  if (parsedParentPath.root !== destParent) {
13546
13546
  await mkdirp(destParent);
13547
13547
  }
@@ -13556,7 +13556,7 @@ var require_move = __commonJS({
13556
13556
  }
13557
13557
  }
13558
13558
  try {
13559
- await fs14.rename(src, dest);
13559
+ await fs16.rename(src, dest);
13560
13560
  } catch (err) {
13561
13561
  if (err.code !== "EXDEV") {
13562
13562
  throw err;
@@ -13581,8 +13581,8 @@ var require_move = __commonJS({
13581
13581
  var require_move_sync = __commonJS({
13582
13582
  "node_modules/fs-extra/lib/move/move-sync.js"(exports2, module2) {
13583
13583
  "use strict";
13584
- var fs14 = require_graceful_fs();
13585
- var path14 = require("path");
13584
+ var fs16 = require_graceful_fs();
13585
+ var path15 = require("path");
13586
13586
  var copySync = require_copy2().copySync;
13587
13587
  var removeSync = require_remove().removeSync;
13588
13588
  var mkdirpSync = require_mkdirs().mkdirpSync;
@@ -13592,12 +13592,12 @@ var require_move_sync = __commonJS({
13592
13592
  const overwrite = opts.overwrite || opts.clobber || false;
13593
13593
  const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
13594
13594
  stat.checkParentPathsSync(src, srcStat, dest, "move");
13595
- if (!isParentRoot(dest)) mkdirpSync(path14.dirname(dest));
13595
+ if (!isParentRoot(dest)) mkdirpSync(path15.dirname(dest));
13596
13596
  return doRename(src, dest, overwrite, isChangingCase);
13597
13597
  }
13598
13598
  function isParentRoot(dest) {
13599
- const parent = path14.dirname(dest);
13600
- const parsedPath = path14.parse(parent);
13599
+ const parent = path15.dirname(dest);
13600
+ const parsedPath = path15.parse(parent);
13601
13601
  return parsedPath.root === parent;
13602
13602
  }
13603
13603
  function doRename(src, dest, overwrite, isChangingCase) {
@@ -13606,12 +13606,12 @@ var require_move_sync = __commonJS({
13606
13606
  removeSync(dest);
13607
13607
  return rename(src, dest, overwrite);
13608
13608
  }
13609
- if (fs14.existsSync(dest)) throw new Error("dest already exists.");
13609
+ if (fs16.existsSync(dest)) throw new Error("dest already exists.");
13610
13610
  return rename(src, dest, overwrite);
13611
13611
  }
13612
13612
  function rename(src, dest, overwrite) {
13613
13613
  try {
13614
- fs14.renameSync(src, dest);
13614
+ fs16.renameSync(src, dest);
13615
13615
  } catch (err) {
13616
13616
  if (err.code !== "EXDEV") throw err;
13617
13617
  return moveAcrossDevice(src, dest, overwrite);
@@ -16856,8 +16856,8 @@ var require_utils3 = __commonJS({
16856
16856
  }
16857
16857
  return ind;
16858
16858
  }
16859
- function removeDotSegments(path14) {
16860
- let input = path14;
16859
+ function removeDotSegments(path15) {
16860
+ let input = path15;
16861
16861
  const output = [];
16862
16862
  let nextSlash = -1;
16863
16863
  let len = 0;
@@ -17056,8 +17056,8 @@ var require_schemes = __commonJS({
17056
17056
  wsComponent.secure = void 0;
17057
17057
  }
17058
17058
  if (wsComponent.resourceName) {
17059
- const [path14, query] = wsComponent.resourceName.split("?");
17060
- wsComponent.path = path14 && path14 !== "/" ? path14 : void 0;
17059
+ const [path15, query] = wsComponent.resourceName.split("?");
17060
+ wsComponent.path = path15 && path15 !== "/" ? path15 : void 0;
17061
17061
  wsComponent.query = query;
17062
17062
  wsComponent.resourceName = void 0;
17063
17063
  }
@@ -20383,12 +20383,12 @@ var require_dist2 = __commonJS({
20383
20383
  throw new Error(`Unknown format "${name}"`);
20384
20384
  return f;
20385
20385
  };
20386
- function addFormats(ajv, list, fs14, exportName) {
20386
+ function addFormats(ajv, list, fs16, exportName) {
20387
20387
  var _a2;
20388
20388
  var _b;
20389
20389
  (_a2 = (_b = ajv.opts.code).formats) !== null && _a2 !== void 0 ? _a2 : _b.formats = codegen_1._`require("ajv-formats/dist/formats").${exportName}`;
20390
20390
  for (const f of list)
20391
- ajv.addFormat(f, fs14[f]);
20391
+ ajv.addFormat(f, fs16[f]);
20392
20392
  }
20393
20393
  module2.exports = exports2 = formatsPlugin;
20394
20394
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -26938,19 +26938,19 @@ var require_esprima = __commonJS({
26938
26938
  }
26939
26939
  return error49;
26940
26940
  };
26941
- ErrorHandler2.prototype.createError = function(index, line, col, description) {
26941
+ ErrorHandler2.prototype.createError = function(index, line, col2, description) {
26942
26942
  var msg = "Line " + line + ": " + description;
26943
- var error49 = this.constructError(msg, col);
26943
+ var error49 = this.constructError(msg, col2);
26944
26944
  error49.index = index;
26945
26945
  error49.lineNumber = line;
26946
26946
  error49.description = description;
26947
26947
  return error49;
26948
26948
  };
26949
- ErrorHandler2.prototype.throwError = function(index, line, col, description) {
26950
- throw this.createError(index, line, col, description);
26949
+ ErrorHandler2.prototype.throwError = function(index, line, col2, description) {
26950
+ throw this.createError(index, line, col2, description);
26951
26951
  };
26952
- ErrorHandler2.prototype.tolerateError = function(index, line, col, description) {
26953
- var error49 = this.createError(index, line, col, description);
26952
+ ErrorHandler2.prototype.tolerateError = function(index, line, col2, description) {
26953
+ var error49 = this.createError(index, line, col2, description);
26954
26954
  if (this.tolerant) {
26955
26955
  this.recordError(error49);
26956
26956
  } else {
@@ -30990,8 +30990,8 @@ var require_package = __commonJS({
30990
30990
  var require_main = __commonJS({
30991
30991
  "node_modules/dotenv/lib/main.js"(exports2, module2) {
30992
30992
  "use strict";
30993
- var fs14 = require("fs");
30994
- var path14 = require("path");
30993
+ var fs16 = require("fs");
30994
+ var path15 = require("path");
30995
30995
  var os7 = require("os");
30996
30996
  var crypto2 = require("crypto");
30997
30997
  var packageJson = require_package();
@@ -31099,7 +31099,7 @@ var require_main = __commonJS({
31099
31099
  if (options && options.path && options.path.length > 0) {
31100
31100
  if (Array.isArray(options.path)) {
31101
31101
  for (const filepath of options.path) {
31102
- if (fs14.existsSync(filepath)) {
31102
+ if (fs16.existsSync(filepath)) {
31103
31103
  possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
31104
31104
  }
31105
31105
  }
@@ -31107,15 +31107,15 @@ var require_main = __commonJS({
31107
31107
  possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
31108
31108
  }
31109
31109
  } else {
31110
- possibleVaultPath = path14.resolve(process.cwd(), ".env.vault");
31110
+ possibleVaultPath = path15.resolve(process.cwd(), ".env.vault");
31111
31111
  }
31112
- if (fs14.existsSync(possibleVaultPath)) {
31112
+ if (fs16.existsSync(possibleVaultPath)) {
31113
31113
  return possibleVaultPath;
31114
31114
  }
31115
31115
  return null;
31116
31116
  }
31117
31117
  function _resolveHome(envPath) {
31118
- return envPath[0] === "~" ? path14.join(os7.homedir(), envPath.slice(1)) : envPath;
31118
+ return envPath[0] === "~" ? path15.join(os7.homedir(), envPath.slice(1)) : envPath;
31119
31119
  }
31120
31120
  function _configVault(options) {
31121
31121
  const debug = Boolean(options && options.debug);
@@ -31132,7 +31132,7 @@ var require_main = __commonJS({
31132
31132
  return { parsed };
31133
31133
  }
31134
31134
  function configDotenv(options) {
31135
- const dotenvPath = path14.resolve(process.cwd(), ".env");
31135
+ const dotenvPath = path15.resolve(process.cwd(), ".env");
31136
31136
  let encoding = "utf8";
31137
31137
  const debug = Boolean(options && options.debug);
31138
31138
  const quiet = options && "quiet" in options ? options.quiet : true;
@@ -31156,13 +31156,13 @@ var require_main = __commonJS({
31156
31156
  }
31157
31157
  let lastError;
31158
31158
  const parsedAll = {};
31159
- for (const path15 of optionPaths) {
31159
+ for (const path16 of optionPaths) {
31160
31160
  try {
31161
- const parsed = DotenvModule.parse(fs14.readFileSync(path15, { encoding }));
31161
+ const parsed = DotenvModule.parse(fs16.readFileSync(path16, { encoding }));
31162
31162
  DotenvModule.populate(parsedAll, parsed, options);
31163
31163
  } catch (e) {
31164
31164
  if (debug) {
31165
- _debug(`Failed to load ${path15} ${e.message}`);
31165
+ _debug(`Failed to load ${path16} ${e.message}`);
31166
31166
  }
31167
31167
  lastError = e;
31168
31168
  }
@@ -31177,7 +31177,7 @@ var require_main = __commonJS({
31177
31177
  const shortPaths = [];
31178
31178
  for (const filePath of optionPaths) {
31179
31179
  try {
31180
- const relative = path14.relative(process.cwd(), filePath);
31180
+ const relative = path15.relative(process.cwd(), filePath);
31181
31181
  shortPaths.push(relative);
31182
31182
  } catch (e) {
31183
31183
  if (debug) {
@@ -32764,19 +32764,19 @@ var require_layout_manager = __commonJS({
32764
32764
  var Cell = require_cell();
32765
32765
  var { ColSpanCell, RowSpanCell } = Cell;
32766
32766
  (function() {
32767
- function next(alloc, col) {
32768
- if (alloc[col] > 0) {
32769
- return next(alloc, col + 1);
32767
+ function next(alloc, col2) {
32768
+ if (alloc[col2] > 0) {
32769
+ return next(alloc, col2 + 1);
32770
32770
  }
32771
- return col;
32771
+ return col2;
32772
32772
  }
32773
32773
  function layoutTable(table) {
32774
32774
  let alloc = {};
32775
32775
  table.forEach(function(row, rowIndex) {
32776
- let col = 0;
32776
+ let col2 = 0;
32777
32777
  row.forEach(function(cell) {
32778
32778
  cell.y = rowIndex;
32779
- cell.x = rowIndex ? next(alloc, col) : col;
32779
+ cell.x = rowIndex ? next(alloc, col2) : col2;
32780
32780
  const rowSpan = cell.rowSpan || 1;
32781
32781
  const colSpan = cell.colSpan || 1;
32782
32782
  if (rowSpan > 1) {
@@ -32784,7 +32784,7 @@ var require_layout_manager = __commonJS({
32784
32784
  alloc[cell.x + cs] = rowSpan;
32785
32785
  }
32786
32786
  }
32787
- col = cell.x + colSpan;
32787
+ col2 = cell.x + colSpan;
32788
32788
  });
32789
32789
  Object.keys(alloc).forEach((idx) => {
32790
32790
  alloc[idx]--;
@@ -32956,29 +32956,29 @@ var require_layout_manager = __commonJS({
32956
32956
  for (let k = spanners.length - 1; k >= 0; k--) {
32957
32957
  let cell = spanners[k];
32958
32958
  let span = cell[colSpan];
32959
- let col = cell[x];
32960
- let existingWidth = result[col];
32961
- let editableCols = typeof vals[col] === "number" ? 0 : 1;
32959
+ let col2 = cell[x];
32960
+ let existingWidth = result[col2];
32961
+ let editableCols = typeof vals[col2] === "number" ? 0 : 1;
32962
32962
  if (typeof existingWidth === "number") {
32963
32963
  for (let i = 1; i < span; i++) {
32964
- existingWidth += 1 + result[col + i];
32965
- if (typeof vals[col + i] !== "number") {
32964
+ existingWidth += 1 + result[col2 + i];
32965
+ if (typeof vals[col2 + i] !== "number") {
32966
32966
  editableCols++;
32967
32967
  }
32968
32968
  }
32969
32969
  } else {
32970
32970
  existingWidth = desiredWidth === "desiredWidth" ? cell.desiredWidth - 1 : 1;
32971
- if (!auto[col] || auto[col] < existingWidth) {
32972
- auto[col] = existingWidth;
32971
+ if (!auto[col2] || auto[col2] < existingWidth) {
32972
+ auto[col2] = existingWidth;
32973
32973
  }
32974
32974
  }
32975
32975
  if (cell[desiredWidth] > existingWidth) {
32976
32976
  let i = 0;
32977
32977
  while (editableCols > 0 && cell[desiredWidth] > existingWidth) {
32978
- if (typeof vals[col + i] !== "number") {
32978
+ if (typeof vals[col2 + i] !== "number") {
32979
32979
  let dif = Math.round((cell[desiredWidth] - existingWidth) / editableCols);
32980
32980
  existingWidth += dif;
32981
- result[col + i] += dif;
32981
+ result[col2 + i] += dif;
32982
32982
  editableCols--;
32983
32983
  }
32984
32984
  i++;
@@ -35788,6 +35788,9 @@ var Listr = class {
35788
35788
  }
35789
35789
  };
35790
35790
 
35791
+ // src/commands/install.ts
35792
+ var import_fs_extra11 = __toESM(require_lib2(), 1);
35793
+
35791
35794
  // src/core/context.ts
35792
35795
  var import_os2 = __toESM(require("os"), 1);
35793
35796
  var import_path = __toESM(require("path"), 1);
@@ -35812,12 +35815,12 @@ var disallowedKeys = /* @__PURE__ */ new Set([
35812
35815
  "constructor"
35813
35816
  ]);
35814
35817
  var digits = new Set("0123456789");
35815
- function getPathSegments(path14) {
35818
+ function getPathSegments(path15) {
35816
35819
  const parts = [];
35817
35820
  let currentSegment = "";
35818
35821
  let currentPart = "start";
35819
35822
  let isIgnoring = false;
35820
- for (const character of path14) {
35823
+ for (const character of path15) {
35821
35824
  switch (character) {
35822
35825
  case "\\": {
35823
35826
  if (currentPart === "index") {
@@ -35939,11 +35942,11 @@ function assertNotStringIndex(object2, key) {
35939
35942
  throw new Error("Cannot use string index");
35940
35943
  }
35941
35944
  }
35942
- function getProperty(object2, path14, value) {
35943
- if (!isObject(object2) || typeof path14 !== "string") {
35945
+ function getProperty(object2, path15, value) {
35946
+ if (!isObject(object2) || typeof path15 !== "string") {
35944
35947
  return value === void 0 ? object2 : value;
35945
35948
  }
35946
- const pathArray = getPathSegments(path14);
35949
+ const pathArray = getPathSegments(path15);
35947
35950
  if (pathArray.length === 0) {
35948
35951
  return value;
35949
35952
  }
@@ -35963,12 +35966,12 @@ function getProperty(object2, path14, value) {
35963
35966
  }
35964
35967
  return object2 === void 0 ? value : object2;
35965
35968
  }
35966
- function setProperty(object2, path14, value) {
35967
- if (!isObject(object2) || typeof path14 !== "string") {
35969
+ function setProperty(object2, path15, value) {
35970
+ if (!isObject(object2) || typeof path15 !== "string") {
35968
35971
  return object2;
35969
35972
  }
35970
35973
  const root = object2;
35971
- const pathArray = getPathSegments(path14);
35974
+ const pathArray = getPathSegments(path15);
35972
35975
  for (let index = 0; index < pathArray.length; index++) {
35973
35976
  const key = pathArray[index];
35974
35977
  assertNotStringIndex(object2, key);
@@ -35981,11 +35984,11 @@ function setProperty(object2, path14, value) {
35981
35984
  }
35982
35985
  return root;
35983
35986
  }
35984
- function deleteProperty(object2, path14) {
35985
- if (!isObject(object2) || typeof path14 !== "string") {
35987
+ function deleteProperty(object2, path15) {
35988
+ if (!isObject(object2) || typeof path15 !== "string") {
35986
35989
  return false;
35987
35990
  }
35988
- const pathArray = getPathSegments(path14);
35991
+ const pathArray = getPathSegments(path15);
35989
35992
  for (let index = 0; index < pathArray.length; index++) {
35990
35993
  const key = pathArray[index];
35991
35994
  assertNotStringIndex(object2, key);
@@ -35999,11 +36002,11 @@ function deleteProperty(object2, path14) {
35999
36002
  }
36000
36003
  }
36001
36004
  }
36002
- function hasProperty(object2, path14) {
36003
- if (!isObject(object2) || typeof path14 !== "string") {
36005
+ function hasProperty(object2, path15) {
36006
+ if (!isObject(object2) || typeof path15 !== "string") {
36004
36007
  return false;
36005
36008
  }
36006
- const pathArray = getPathSegments(path14);
36009
+ const pathArray = getPathSegments(path15);
36007
36010
  if (pathArray.length === 0) {
36008
36011
  return false;
36009
36012
  }
@@ -37043,8 +37046,8 @@ function getCandidatePaths() {
37043
37046
  const appData = process.env.APPDATA;
37044
37047
  const isWindows3 = process.platform === "win32";
37045
37048
  const paths = [
37046
- { label: ".claude", path: import_path.default.join(home, ".claude") },
37047
- { label: ".agents/skills", path: import_path.default.join(home, ".agents", "skills") }
37049
+ { label: "~/.claude (hooks + skills)", path: import_path.default.join(home, ".claude") },
37050
+ { label: "~/.agents/skills", path: import_path.default.join(home, ".agents", "skills") }
37048
37051
  ];
37049
37052
  if (isWindows3 && appData) {
37050
37053
  paths.push({ label: "Claude (AppData)", path: import_path.default.join(appData, "Claude") });
@@ -37214,8 +37217,8 @@ function detectAdapter(systemRoot) {
37214
37217
  // src/core/diff.ts
37215
37218
  var IGNORED_ITEMS = /* @__PURE__ */ new Set(["__pycache__", ".DS_Store", "Thumbs.db", ".gitkeep", "node_modules"]);
37216
37219
  var PruneModeReadError = class extends Error {
37217
- constructor(path14) {
37218
- super(`Cannot read ${path14} in prune mode \u2014 aborting to prevent accidental deletion`);
37220
+ constructor(path15) {
37221
+ super(`Cannot read ${path15} in prune mode \u2014 aborting to prevent accidental deletion`);
37219
37222
  this.name = "PruneModeReadError";
37220
37223
  }
37221
37224
  };
@@ -40342,7 +40345,42 @@ async function cleanupBackup(backup) {
40342
40345
 
40343
40346
  // src/core/sync-executor.ts
40344
40347
  var syncedMcpAgents = /* @__PURE__ */ new Set();
40345
- async function executeSync(repoRoot, systemRoot, changeSet, mode, actionType, isDryRun = false, selectedMcpServers) {
40348
+ function extractHookCommandPath(command) {
40349
+ const quoted = command.match(/"([^"]+)"/);
40350
+ if (quoted?.[1]) return quoted[1];
40351
+ const singleQuoted = command.match(/'([^']+)'/);
40352
+ if (singleQuoted?.[1]) return singleQuoted[1];
40353
+ const bare = command.trim().split(/\s+/).slice(1).join(" ").trim();
40354
+ return bare || null;
40355
+ }
40356
+ async function filterHooksByInstalledScripts(hooksConfig) {
40357
+ if (!hooksConfig || typeof hooksConfig !== "object" || !hooksConfig.hooks) {
40358
+ return hooksConfig;
40359
+ }
40360
+ for (const [event, wrappers] of Object.entries(hooksConfig.hooks)) {
40361
+ if (!Array.isArray(wrappers)) continue;
40362
+ const keptWrappers = [];
40363
+ for (const wrapper of wrappers) {
40364
+ if (!wrapper || !Array.isArray(wrapper.hooks)) continue;
40365
+ const keptInner = [];
40366
+ for (const inner of wrapper.hooks) {
40367
+ const command = inner?.command;
40368
+ if (typeof command !== "string" || !command.trim()) continue;
40369
+ const scriptPath = extractHookCommandPath(command);
40370
+ if (!scriptPath) continue;
40371
+ if (await import_fs_extra8.default.pathExists(scriptPath)) {
40372
+ keptInner.push(inner);
40373
+ }
40374
+ }
40375
+ if (keptInner.length > 0) {
40376
+ keptWrappers.push({ ...wrapper, hooks: keptInner });
40377
+ }
40378
+ }
40379
+ hooksConfig.hooks[event] = keptWrappers;
40380
+ }
40381
+ return hooksConfig;
40382
+ }
40383
+ async function executeSync(repoRoot, systemRoot, changeSet, mode, actionType, isDryRun = false, selectedMcpServers, options) {
40346
40384
  const normalizedRoot = import_path8.default.normalize(systemRoot).replace(/\\/g, "/");
40347
40385
  const isAgentsSkills = normalizedRoot.includes(".agents/skills");
40348
40386
  const isClaude = systemRoot.includes(".claude") || systemRoot.includes("Claude");
@@ -40355,7 +40393,7 @@ async function executeSync(repoRoot, systemRoot, changeSet, mode, actionType, is
40355
40393
  const backups = [];
40356
40394
  try {
40357
40395
  const agent = detectAgent(systemRoot);
40358
- if (agent && actionType === "sync" && !syncedMcpAgents.has(agent)) {
40396
+ if (agent && actionType === "sync" && !syncedMcpAgents.has(agent) && !options?.skipMcp) {
40359
40397
  const coreConfig = loadCanonicalMcpConfig(repoRoot);
40360
40398
  const mcpToSync = { mcpServers: { ...coreConfig.mcpServers } };
40361
40399
  if (selectedMcpServers && selectedMcpServers.length > 0) {
@@ -40380,6 +40418,9 @@ async function executeSync(repoRoot, systemRoot, changeSet, mode, actionType, is
40380
40418
  const cat = changeSet[category];
40381
40419
  itemsToProcess.push(...cat.missing);
40382
40420
  itemsToProcess.push(...cat.outdated);
40421
+ if (options?.force) {
40422
+ itemsToProcess.push(...cat.drifted);
40423
+ }
40383
40424
  if (mode === "prune") {
40384
40425
  for (const itemToDelete of cat.drifted || []) {
40385
40426
  const dest = import_path8.default.join(systemRoot, category, itemToDelete);
@@ -40403,9 +40444,6 @@ async function executeSync(repoRoot, systemRoot, changeSet, mode, actionType, is
40403
40444
  src = import_path8.default.join(repoRoot, "config", "settings.json");
40404
40445
  dest = import_path8.default.join(systemRoot, "settings.json");
40405
40446
  const agent2 = detectAgent(systemRoot);
40406
- if (agent2) {
40407
- continue;
40408
- }
40409
40447
  console.log(kleur_default.gray(` --> config/settings.json`));
40410
40448
  if (!isDryRun && await import_fs_extra8.default.pathExists(dest)) {
40411
40449
  backups.push(await createBackup(dest));
@@ -40419,7 +40457,7 @@ async function executeSync(repoRoot, systemRoot, changeSet, mode, actionType, is
40419
40457
  const hooksSrc = import_path8.default.join(repoRoot, "config", "hooks.json");
40420
40458
  if (await import_fs_extra8.default.pathExists(hooksSrc)) {
40421
40459
  const hooksRaw = await import_fs_extra8.default.readJson(hooksSrc);
40422
- const hooksAdapted = adapter.adaptHooksConfig(hooksRaw);
40460
+ const hooksAdapted = await filterHooksByInstalledScripts(adapter.adaptHooksConfig(hooksRaw));
40423
40461
  if (hooksAdapted.hooks) {
40424
40462
  finalRepoConfig.hooks = hooksAdapted.hooks;
40425
40463
  if (!isDryRun) console.log(kleur_default.dim(` (Injected hooks)`));
@@ -40676,6 +40714,82 @@ function resolvePkgRoot() {
40676
40714
  }
40677
40715
  var PKG_ROOT = resolvePkgRoot();
40678
40716
  var PROJECT_SKILLS_DIR = import_path10.default.join(PKG_ROOT, "project-skills");
40717
+ var MCP_CORE_CONFIG_PATH = import_path10.default.join(PKG_ROOT, "config", "mcp_servers.json");
40718
+ var syncedProjectMcpRoots = /* @__PURE__ */ new Set();
40719
+ function resolveEnvVars(value) {
40720
+ if (typeof value !== "string") return value;
40721
+ return value.replace(/\$\{([A-Z0-9_]+)\}/g, (_m, name) => process.env[name] || "");
40722
+ }
40723
+ function hasClaudeCli() {
40724
+ const r = (0, import_child_process2.spawnSync)("claude", ["--version"], { stdio: "pipe" });
40725
+ return r.status === 0;
40726
+ }
40727
+ function buildProjectMcpArgs(name, server) {
40728
+ const transport = server.type || (server.url?.includes("/sse") ? "sse" : "http");
40729
+ if (server.command) {
40730
+ const args = ["mcp", "add", "-s", "project"];
40731
+ if (server.env && typeof server.env === "object") {
40732
+ for (const [k, v] of Object.entries(server.env)) {
40733
+ args.push("-e", `${k}=${resolveEnvVars(String(v))}`);
40734
+ }
40735
+ }
40736
+ args.push(name, "--", server.command, ...server.args || []);
40737
+ return args;
40738
+ }
40739
+ if (server.url || server.serverUrl) {
40740
+ const url2 = server.url || server.serverUrl;
40741
+ const args = ["mcp", "add", "-s", "project", "--transport", transport, name, url2];
40742
+ if (server.headers && typeof server.headers === "object") {
40743
+ for (const [k, v] of Object.entries(server.headers)) {
40744
+ args.push("--header", `${k}: ${resolveEnvVars(String(v))}`);
40745
+ }
40746
+ }
40747
+ return args;
40748
+ }
40749
+ return null;
40750
+ }
40751
+ async function syncProjectMcpServers(projectRoot) {
40752
+ if (syncedProjectMcpRoots.has(projectRoot)) return;
40753
+ syncedProjectMcpRoots.add(projectRoot);
40754
+ if (!await import_fs_extra10.default.pathExists(MCP_CORE_CONFIG_PATH)) return;
40755
+ console.log(kleur_default.bold("\n\u2500\u2500 Installing MCP (project scope) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
40756
+ if (!hasClaudeCli()) {
40757
+ console.log(kleur_default.yellow(" \u26A0 Claude CLI not found; skipping project-scope MCP registration."));
40758
+ return;
40759
+ }
40760
+ const mcpConfig = await import_fs_extra10.default.readJson(MCP_CORE_CONFIG_PATH);
40761
+ const servers = Object.entries(mcpConfig?.mcpServers ?? {});
40762
+ if (servers.length === 0) {
40763
+ console.log(kleur_default.dim(" \u2139 No core MCP servers configured."));
40764
+ return;
40765
+ }
40766
+ let added = 0;
40767
+ let existing = 0;
40768
+ let failed = 0;
40769
+ for (const [name, server] of servers) {
40770
+ const args = buildProjectMcpArgs(name, server);
40771
+ if (!args) continue;
40772
+ const r = (0, import_child_process2.spawnSync)("claude", args, {
40773
+ cwd: projectRoot,
40774
+ encoding: "utf8",
40775
+ stdio: ["pipe", "pipe", "pipe"]
40776
+ });
40777
+ if (r.status === 0) {
40778
+ added++;
40779
+ console.log(`${kleur_default.green(" \u2713")} ${name}`);
40780
+ continue;
40781
+ }
40782
+ const stderr = `${r.stderr || ""}`.toLowerCase();
40783
+ if (stderr.includes("already exists") || stderr.includes("already configured")) {
40784
+ existing++;
40785
+ console.log(kleur_default.dim(` \u2713 ${name} (already configured)`));
40786
+ continue;
40787
+ }
40788
+ failed++;
40789
+ console.log(kleur_default.red(` \u2717 ${name} (${(r.stderr || r.stdout || "failed").toString().trim()})`));
40790
+ }
40791
+ console.log(kleur_default.dim(` \u21B3 MCP project-scope result: ${added} added, ${existing} existing, ${failed} failed`));
40792
+ }
40679
40793
  async function getAvailableProjectSkills() {
40680
40794
  if (!await import_fs_extra10.default.pathExists(PROJECT_SKILLS_DIR)) {
40681
40795
  return [];
@@ -40763,6 +40877,7 @@ async function installProjectSkill(toolName, projectRootOverride) {
40763
40877
  await import_fs_extra10.default.writeFile(targetSettingsPath, JSON.stringify(mergedSettings, null, 2) + "\n");
40764
40878
  console.log(`${kleur_default.green(" \u2713")} settings.json (hooks merged)`);
40765
40879
  }
40880
+ await syncProjectMcpServers(projectRoot);
40766
40881
  if (await import_fs_extra10.default.pathExists(skillSkillsDir)) {
40767
40882
  console.log(kleur_default.bold("\n\u2500\u2500 Installing Skills \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
40768
40883
  const targetSkillsDir = import_path10.default.join(claudeDir, "skills");
@@ -40899,6 +41014,8 @@ function createInstallProjectCommand() {
40899
41014
  }
40900
41015
 
40901
41016
  // src/commands/install.ts
41017
+ var import_child_process3 = require("child_process");
41018
+ var import_child_process4 = require("child_process");
40902
41019
  function renderPlanTable(allChanges) {
40903
41020
  const Table = require_cli_table3();
40904
41021
  const table = new Table({
@@ -40914,7 +41031,7 @@ function renderPlanTable(allChanges) {
40914
41031
  const missing = Object.values(changeSet).reduce((s, c) => s + c.missing.length, 0);
40915
41032
  const outdated = Object.values(changeSet).reduce((s, c) => s + c.outdated.length, 0);
40916
41033
  table.push([
40917
- kleur_default.white(import_path11.default.basename(target)),
41034
+ kleur_default.white(formatTargetLabel(target)),
40918
41035
  missing > 0 ? kleur_default.green(String(missing)) : t.label("\u2014"),
40919
41036
  outdated > 0 ? kleur_default.yellow(String(outdated)) : t.label("\u2014"),
40920
41037
  kleur_default.bold().white(String(totalChanges))
@@ -40942,33 +41059,292 @@ async function renderSummaryCard(allChanges, totalCount, allSkipped, isDryRun) {
40942
41059
  borderColor: hasDrift ? "yellow" : "green"
40943
41060
  }) + "\n");
40944
41061
  }
41062
+ var BEADS_HOOK_PATTERN = /^beads-/;
41063
+ function formatTargetLabel(target) {
41064
+ const normalized = target.replace(/\\/g, "/").toLowerCase();
41065
+ if (normalized.endsWith("/.agents/skills") || normalized.includes("/.agents/skills/")) return "~/.agents/skills";
41066
+ if (normalized.endsWith("/.claude") || normalized.includes("/.claude/")) return "~/.claude";
41067
+ return import_path11.default.basename(target);
41068
+ }
41069
+ function filterBeadsFromChangeSet(changeSet) {
41070
+ return {
41071
+ ...changeSet,
41072
+ hooks: {
41073
+ ...changeSet.hooks,
41074
+ missing: changeSet.hooks.missing.filter((h) => !BEADS_HOOK_PATTERN.test(h)),
41075
+ outdated: changeSet.hooks.outdated.filter((h) => !BEADS_HOOK_PATTERN.test(h)),
41076
+ drifted: changeSet.hooks.drifted.filter((h) => !BEADS_HOOK_PATTERN.test(h)),
41077
+ total: changeSet.hooks.total
41078
+ }
41079
+ };
41080
+ }
41081
+ function isBeadsInstalled() {
41082
+ try {
41083
+ (0, import_child_process3.execSync)("bd --version", { stdio: "ignore" });
41084
+ return true;
41085
+ } catch {
41086
+ return false;
41087
+ }
41088
+ }
41089
+ function isDoltInstalled() {
41090
+ try {
41091
+ (0, import_child_process3.execSync)("dolt version", { stdio: "ignore" });
41092
+ return true;
41093
+ } catch {
41094
+ return false;
41095
+ }
41096
+ }
41097
+ async function needsSettingsSync(repoRoot, target) {
41098
+ const normalizedTarget = target.replace(/\\/g, "/").toLowerCase();
41099
+ if (normalizedTarget.includes(".agents/skills")) return false;
41100
+ const hooksTemplatePath = import_path11.default.join(repoRoot, "config", "hooks.json");
41101
+ if (!await import_fs_extra11.default.pathExists(hooksTemplatePath)) return false;
41102
+ const requiredEvents = Object.keys((await import_fs_extra11.default.readJson(hooksTemplatePath)).hooks ?? {});
41103
+ if (requiredEvents.length === 0) return false;
41104
+ const targetSettingsPath = import_path11.default.join(target, "settings.json");
41105
+ if (!await import_fs_extra11.default.pathExists(targetSettingsPath)) return true;
41106
+ let settings = {};
41107
+ try {
41108
+ settings = await import_fs_extra11.default.readJson(targetSettingsPath);
41109
+ } catch {
41110
+ return true;
41111
+ }
41112
+ const targetHooks = settings?.hooks;
41113
+ if (!targetHooks || typeof targetHooks !== "object" || Object.keys(targetHooks).length === 0) {
41114
+ return true;
41115
+ }
41116
+ return requiredEvents.some((event) => !(event in targetHooks));
41117
+ }
41118
+ async function runGlobalInstall(flags, installOpts = {}) {
41119
+ const { dryRun, yes, noMcp, force } = flags;
41120
+ const effectiveYes = yes || process.argv.includes("--yes") || process.argv.includes("-y");
41121
+ const repoRoot = await findRepoRoot();
41122
+ const ctx = await getContext({ selector: "all", createMissingDirs: !dryRun });
41123
+ const { targets, syncMode } = ctx;
41124
+ let skipBeads = installOpts.excludeBeads ?? false;
41125
+ if (installOpts.checkBeads && !skipBeads) {
41126
+ console.log(t.bold("\n \u2699 beads + dolt (workflow enforcement backend)"));
41127
+ console.log(t.muted(" beads is a git-backed issue tracker; dolt is its SQL+git storage backend."));
41128
+ console.log(t.muted(" Without them the gate hooks install but provide no enforcement.\n"));
41129
+ const beadsOk = isBeadsInstalled();
41130
+ const doltOk = isDoltInstalled();
41131
+ if (beadsOk && doltOk) {
41132
+ console.log(t.success(" \u2713 beads + dolt already installed\n"));
41133
+ } else {
41134
+ const missing = [!beadsOk && "bd", !doltOk && "dolt"].filter(Boolean).join(", ");
41135
+ let doInstall = effectiveYes;
41136
+ if (!effectiveYes) {
41137
+ const { install } = await (0, import_prompts2.default)({
41138
+ type: "confirm",
41139
+ name: "install",
41140
+ message: `Install beads + dolt? (${missing} not found) \u2014 required for workflow enforcement hooks`,
41141
+ initial: true
41142
+ });
41143
+ doInstall = install;
41144
+ }
41145
+ if (doInstall) {
41146
+ if (!beadsOk) {
41147
+ console.log(t.muted("\n Installing @beads/bd..."));
41148
+ (0, import_child_process4.spawnSync)("npm", ["install", "-g", "@beads/bd"], { stdio: "inherit" });
41149
+ console.log(t.success(" \u2713 bd installed"));
41150
+ }
41151
+ if (!doltOk) {
41152
+ console.log(t.muted("\n Installing dolt..."));
41153
+ if (process.platform === "darwin") {
41154
+ (0, import_child_process4.spawnSync)("brew", ["install", "dolt"], { stdio: "inherit" });
41155
+ } else {
41156
+ (0, import_child_process4.spawnSync)("sudo", [
41157
+ "bash",
41158
+ "-c",
41159
+ "curl -L https://github.com/dolthub/dolt/releases/latest/download/install.sh | bash"
41160
+ ], { stdio: "inherit" });
41161
+ }
41162
+ console.log(t.success(" \u2713 dolt installed"));
41163
+ }
41164
+ console.log("");
41165
+ } else {
41166
+ console.log(t.muted(" \u2139 Skipping beads gate hooks. Re-run xtrm install all after installing beads+dolt.\n"));
41167
+ skipBeads = true;
41168
+ }
41169
+ }
41170
+ }
41171
+ const diffTasks = new Listr(
41172
+ targets.map((target) => ({
41173
+ title: formatTargetLabel(target),
41174
+ task: async (listCtx, task) => {
41175
+ try {
41176
+ let changeSet = await calculateDiff(repoRoot, target, false);
41177
+ if (skipBeads) {
41178
+ changeSet = filterBeadsFromChangeSet(changeSet);
41179
+ }
41180
+ const hasSettingsDiff = changeSet.config.missing.includes("settings.json") || changeSet.config.outdated.includes("settings.json") || changeSet.config.drifted.includes("settings.json");
41181
+ if (!hasSettingsDiff && await needsSettingsSync(repoRoot, target)) {
41182
+ changeSet.config.outdated.push("settings.json");
41183
+ }
41184
+ const totalChanges = Object.values(changeSet).reduce(
41185
+ (sum, c) => sum + c.missing.length + c.outdated.length + c.drifted.length,
41186
+ 0
41187
+ );
41188
+ task.title = `${formatTargetLabel(target)}${t.muted(` \u2014 ${totalChanges} change${totalChanges !== 1 ? "s" : ""}`)}`;
41189
+ if (totalChanges > 0) {
41190
+ listCtx.allChanges.push({ target, changeSet, totalChanges, skippedDrifted: [] });
41191
+ }
41192
+ } catch (err) {
41193
+ if (err instanceof PruneModeReadError) {
41194
+ task.title = `${formatTargetLabel(target)} ${kleur_default.red("(skipped \u2014 cannot read in prune mode)")}`;
41195
+ } else {
41196
+ throw err;
41197
+ }
41198
+ }
41199
+ }
41200
+ })),
41201
+ { concurrent: true, exitOnError: false }
41202
+ );
41203
+ const diffCtx = await diffTasks.run({ allChanges: [] });
41204
+ const allChanges = diffCtx.allChanges;
41205
+ if (allChanges.length === 0) {
41206
+ console.log("\n" + t.boldGreen("\u2713 Files are up-to-date") + "\n");
41207
+ return;
41208
+ }
41209
+ renderPlanTable(allChanges);
41210
+ if (dryRun) {
41211
+ console.log(t.accent("\u{1F4A1} Dry run \u2014 no changes written\n"));
41212
+ return;
41213
+ }
41214
+ if (!effectiveYes) {
41215
+ const totalChangesCount = allChanges.reduce((s, c) => s + c.totalChanges, 0);
41216
+ const { confirm } = await (0, import_prompts2.default)({
41217
+ type: "confirm",
41218
+ name: "confirm",
41219
+ message: `Proceed with install (${totalChangesCount} total changes)?`,
41220
+ initial: true
41221
+ });
41222
+ if (!confirm) {
41223
+ console.log(t.muted(" Install cancelled.\n"));
41224
+ return;
41225
+ }
41226
+ }
41227
+ let totalCount = 0;
41228
+ for (const { target, changeSet, skippedDrifted } of allChanges) {
41229
+ console.log(t.bold(`
41230
+ ${sym.arrow} ${formatTargetLabel(target)}`));
41231
+ const count = await executeSync(repoRoot, target, changeSet, syncMode, "sync", dryRun, void 0, {
41232
+ skipMcp: noMcp,
41233
+ force
41234
+ });
41235
+ totalCount += count;
41236
+ for (const [category, cat] of Object.entries(changeSet)) {
41237
+ const c = cat;
41238
+ if (c.drifted.length > 0 && !force) {
41239
+ skippedDrifted.push(...c.drifted.map((item) => `${category}/${item}`));
41240
+ }
41241
+ }
41242
+ console.log(t.success(` ${sym.ok} ${count} item${count !== 1 ? "s" : ""} installed`));
41243
+ }
41244
+ const allSkipped = allChanges.flatMap((c) => c.skippedDrifted);
41245
+ await renderSummaryCard(allChanges, totalCount, allSkipped, dryRun);
41246
+ }
41247
+ function createInstallAllCommand() {
41248
+ return new Command("all").description("Install everything: skills, all hooks (including beads gates), and MCP servers").option("--dry-run", "Preview changes without making any modifications", false).option("-y, --yes", "Skip confirmation prompts", false).option("--no-mcp", "Skip MCP server registration", false).option("--force", "Overwrite locally drifted files", false).action(async (opts) => {
41249
+ await runGlobalInstall(
41250
+ { dryRun: opts.dryRun, yes: opts.yes, noMcp: opts.mcp === false, force: opts.force },
41251
+ { checkBeads: true }
41252
+ );
41253
+ });
41254
+ }
41255
+ function createInstallBasicCommand() {
41256
+ return new Command("basic").description("Install skills, general hooks, and MCP servers (no beads gate hooks)").option("--dry-run", "Preview changes without making any modifications", false).option("-y, --yes", "Skip confirmation prompts", false).option("--no-mcp", "Skip MCP server registration", false).option("--force", "Overwrite locally drifted files", false).action(async (opts) => {
41257
+ await runGlobalInstall(
41258
+ { dryRun: opts.dryRun, yes: opts.yes, noMcp: opts.mcp === false, force: opts.force },
41259
+ { excludeBeads: true }
41260
+ );
41261
+ });
41262
+ }
40945
41263
  function createInstallCommand() {
40946
41264
  const installCmd = new Command("install").description("Install Claude Code tools (skills, hooks, MCP servers)").argument("[target-selector]", 'Install targets: use "*" or "all" to skip interactive target selection').option("--dry-run", "Preview changes without making any modifications", false).option("-y, --yes", "Skip confirmation prompts", false).option("--prune", "Remove items not in the canonical repository", false).option("--backport", "Backport drifted local changes back to the repository", false).action(async (targetSelector, opts) => {
40947
41265
  const { dryRun, yes, prune, backport } = opts;
40948
- const actionType = backport ? "backport" : "install";
41266
+ const effectiveYes = yes || process.argv.includes("--yes") || process.argv.includes("-y");
41267
+ const syncType = backport ? "backport" : "sync";
41268
+ const actionLabel = backport ? "backport" : "install";
40949
41269
  const repoRoot = await findRepoRoot();
40950
41270
  const ctx = await getContext({
40951
41271
  selector: targetSelector,
40952
41272
  createMissingDirs: !dryRun
40953
41273
  });
40954
41274
  const { targets, syncMode } = ctx;
41275
+ let skipBeads = false;
41276
+ if (!backport) {
41277
+ console.log(t.bold("\n \u2699 beads + dolt (workflow enforcement backend)"));
41278
+ console.log(t.muted(" beads is a git-backed issue tracker; dolt is its SQL+git storage backend."));
41279
+ console.log(t.muted(" Without them the gate hooks install but provide no enforcement.\n"));
41280
+ const beadsOk = isBeadsInstalled();
41281
+ const doltOk = isDoltInstalled();
41282
+ if (beadsOk && doltOk) {
41283
+ console.log(t.success(" \u2713 beads + dolt already installed\n"));
41284
+ } else {
41285
+ const missing = [!beadsOk && "bd", !doltOk && "dolt"].filter(Boolean).join(", ");
41286
+ let doInstall = effectiveYes;
41287
+ if (!effectiveYes) {
41288
+ const { install } = await (0, import_prompts2.default)({
41289
+ type: "confirm",
41290
+ name: "install",
41291
+ message: `Install beads + dolt? (${missing} not found) \u2014 required for workflow enforcement hooks`,
41292
+ initial: true
41293
+ });
41294
+ doInstall = install;
41295
+ }
41296
+ if (doInstall) {
41297
+ if (!beadsOk) {
41298
+ console.log(t.muted("\n Installing @beads/bd..."));
41299
+ (0, import_child_process4.spawnSync)("npm", ["install", "-g", "@beads/bd"], { stdio: "inherit" });
41300
+ console.log(t.success(" \u2713 bd installed"));
41301
+ }
41302
+ if (!doltOk) {
41303
+ console.log(t.muted("\n Installing dolt..."));
41304
+ if (process.platform === "darwin") {
41305
+ (0, import_child_process4.spawnSync)("brew", ["install", "dolt"], { stdio: "inherit" });
41306
+ } else {
41307
+ (0, import_child_process4.spawnSync)("sudo", [
41308
+ "bash",
41309
+ "-c",
41310
+ "curl -L https://github.com/dolthub/dolt/releases/latest/download/install.sh | bash"
41311
+ ], { stdio: "inherit" });
41312
+ }
41313
+ console.log(t.success(" \u2713 dolt installed"));
41314
+ }
41315
+ console.log("");
41316
+ } else {
41317
+ console.log(t.muted(" \u2139 Skipping beads gate hooks for this install run.\n"));
41318
+ skipBeads = true;
41319
+ }
41320
+ }
41321
+ }
40955
41322
  const diffTasks = new Listr(
40956
41323
  targets.map((target) => ({
40957
- title: import_path11.default.basename(target),
41324
+ title: formatTargetLabel(target),
40958
41325
  task: async (listCtx, task) => {
40959
41326
  try {
40960
- const changeSet = await calculateDiff(repoRoot, target, prune);
41327
+ let changeSet = await calculateDiff(repoRoot, target, prune);
41328
+ if (skipBeads) {
41329
+ changeSet = filterBeadsFromChangeSet(changeSet);
41330
+ }
41331
+ if (syncType === "sync" && !prune) {
41332
+ const hasSettingsDiff = changeSet.config.missing.includes("settings.json") || changeSet.config.outdated.includes("settings.json") || changeSet.config.drifted.includes("settings.json");
41333
+ if (!hasSettingsDiff && await needsSettingsSync(repoRoot, target)) {
41334
+ changeSet.config.outdated.push("settings.json");
41335
+ }
41336
+ }
40961
41337
  const totalChanges = Object.values(changeSet).reduce(
40962
41338
  (sum, c) => sum + c.missing.length + c.outdated.length + c.drifted.length,
40963
41339
  0
40964
41340
  );
40965
- task.title = `${import_path11.default.basename(target)}${t.muted(` \u2014 ${totalChanges} change${totalChanges !== 1 ? "s" : ""}`)}`;
41341
+ task.title = `${formatTargetLabel(target)}${t.muted(` \u2014 ${totalChanges} change${totalChanges !== 1 ? "s" : ""}`)}`;
40966
41342
  if (totalChanges > 0) {
40967
41343
  listCtx.allChanges.push({ target, changeSet, totalChanges, skippedDrifted: [] });
40968
41344
  }
40969
41345
  } catch (err) {
40970
41346
  if (err instanceof PruneModeReadError) {
40971
- task.title = `${import_path11.default.basename(target)} ${kleur_default.red("(skipped \u2014 cannot read in prune mode)")}`;
41347
+ task.title = `${formatTargetLabel(target)} ${kleur_default.red("(skipped \u2014 cannot read in prune mode)")}`;
40972
41348
  } else {
40973
41349
  throw err;
40974
41350
  }
@@ -40983,12 +41359,15 @@ function createInstallCommand() {
40983
41359
  const emptyChangeSet = {
40984
41360
  skills: { missing: [], outdated: [], drifted: [], total: 0 },
40985
41361
  hooks: { missing: [], outdated: [], drifted: [], total: 0 },
40986
- config: { missing: [], outdated: [], drifted: [], total: 0 }
41362
+ config: { missing: [], outdated: [], drifted: [], total: 0 },
41363
+ commands: { missing: [], outdated: [], drifted: [], total: 0 },
41364
+ "qwen-commands": { missing: [], outdated: [], drifted: [], total: 0 },
41365
+ "antigravity-workflows": { missing: [], outdated: [], drifted: [], total: 0 }
40987
41366
  };
40988
41367
  for (const target of targets) {
40989
41368
  console.log(t.bold(`
40990
- ${sym.arrow} ${import_path11.default.basename(target)}`));
40991
- await executeSync(repoRoot, target, emptyChangeSet, syncMode, "install", false);
41369
+ ${sym.arrow} ${formatTargetLabel(target)}`));
41370
+ await executeSync(repoRoot, target, emptyChangeSet, syncMode, "sync", false);
40992
41371
  }
40993
41372
  }
40994
41373
  if (allChanges.length === 0) {
@@ -41000,12 +41379,12 @@ function createInstallCommand() {
41000
41379
  console.log(t.accent("\u{1F4A1} Dry run \u2014 no changes written\n"));
41001
41380
  return;
41002
41381
  }
41003
- if (!yes) {
41382
+ if (!effectiveYes) {
41004
41383
  const totalChangesCount = allChanges.reduce((s, c) => s + c.totalChanges, 0);
41005
41384
  const { confirm } = await (0, import_prompts2.default)({
41006
41385
  type: "confirm",
41007
41386
  name: "confirm",
41008
- message: `Proceed with ${actionType} (${totalChangesCount} total changes)?`,
41387
+ message: `Proceed with ${actionLabel} (${totalChangesCount} total changes)?`,
41009
41388
  initial: true
41010
41389
  });
41011
41390
  if (!confirm) {
@@ -41016,12 +41395,12 @@ function createInstallCommand() {
41016
41395
  let totalCount = 0;
41017
41396
  for (const { target, changeSet, skippedDrifted } of allChanges) {
41018
41397
  console.log(t.bold(`
41019
- ${sym.arrow} ${import_path11.default.basename(target)}`));
41020
- const count = await executeSync(repoRoot, target, changeSet, syncMode, actionType, dryRun);
41398
+ ${sym.arrow} ${formatTargetLabel(target)}`));
41399
+ const count = await executeSync(repoRoot, target, changeSet, syncMode, syncType, dryRun);
41021
41400
  totalCount += count;
41022
41401
  for (const [category, cat] of Object.entries(changeSet)) {
41023
41402
  const c = cat;
41024
- if (c.drifted.length > 0 && actionType === "install") {
41403
+ if (c.drifted.length > 0 && syncType === "sync") {
41025
41404
  skippedDrifted.push(...c.drifted.map((item) => `${category}/${item}`));
41026
41405
  }
41027
41406
  }
@@ -41030,6 +41409,8 @@ function createInstallCommand() {
41030
41409
  const allSkipped = allChanges.flatMap((c) => c.skippedDrifted);
41031
41410
  await renderSummaryCard(allChanges, totalCount, allSkipped, dryRun);
41032
41411
  });
41412
+ installCmd.addCommand(createInstallAllCommand());
41413
+ installCmd.addCommand(createInstallBasicCommand());
41033
41414
  installCmd.addCommand(createInstallProjectCommand());
41034
41415
  return installCmd;
41035
41416
  }
@@ -41807,10 +42188,10 @@ function mergeDefs(...defs) {
41807
42188
  function cloneDef(schema) {
41808
42189
  return mergeDefs(schema._zod.def);
41809
42190
  }
41810
- function getElementAtPath(obj, path14) {
41811
- if (!path14)
42191
+ function getElementAtPath(obj, path15) {
42192
+ if (!path15)
41812
42193
  return obj;
41813
- return path14.reduce((acc, key) => acc?.[key], obj);
42194
+ return path15.reduce((acc, key) => acc?.[key], obj);
41814
42195
  }
41815
42196
  function promiseAllObject(promisesObj) {
41816
42197
  const keys = Object.keys(promisesObj);
@@ -42193,11 +42574,11 @@ function aborted(x, startIndex = 0) {
42193
42574
  }
42194
42575
  return false;
42195
42576
  }
42196
- function prefixIssues(path14, issues) {
42577
+ function prefixIssues(path15, issues) {
42197
42578
  return issues.map((iss) => {
42198
42579
  var _a2;
42199
42580
  (_a2 = iss).path ?? (_a2.path = []);
42200
- iss.path.unshift(path14);
42581
+ iss.path.unshift(path15);
42201
42582
  return iss;
42202
42583
  });
42203
42584
  }
@@ -42380,7 +42761,7 @@ function formatError(error49, mapper = (issue2) => issue2.message) {
42380
42761
  }
42381
42762
  function treeifyError(error49, mapper = (issue2) => issue2.message) {
42382
42763
  const result = { errors: [] };
42383
- const processError = (error50, path14 = []) => {
42764
+ const processError = (error50, path15 = []) => {
42384
42765
  var _a2, _b;
42385
42766
  for (const issue2 of error50.issues) {
42386
42767
  if (issue2.code === "invalid_union" && issue2.errors.length) {
@@ -42390,7 +42771,7 @@ function treeifyError(error49, mapper = (issue2) => issue2.message) {
42390
42771
  } else if (issue2.code === "invalid_element") {
42391
42772
  processError({ issues: issue2.issues }, issue2.path);
42392
42773
  } else {
42393
- const fullpath = [...path14, ...issue2.path];
42774
+ const fullpath = [...path15, ...issue2.path];
42394
42775
  if (fullpath.length === 0) {
42395
42776
  result.errors.push(mapper(issue2));
42396
42777
  continue;
@@ -42422,8 +42803,8 @@ function treeifyError(error49, mapper = (issue2) => issue2.message) {
42422
42803
  }
42423
42804
  function toDotPath(_path) {
42424
42805
  const segs = [];
42425
- const path14 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
42426
- for (const seg of path14) {
42806
+ const path15 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
42807
+ for (const seg of path15) {
42427
42808
  if (typeof seg === "number")
42428
42809
  segs.push(`[${seg}]`);
42429
42810
  else if (typeof seg === "symbol")
@@ -54400,13 +54781,13 @@ function resolveRef(ref, ctx) {
54400
54781
  if (!ref.startsWith("#")) {
54401
54782
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
54402
54783
  }
54403
- const path14 = ref.slice(1).split("/").filter(Boolean);
54404
- if (path14.length === 0) {
54784
+ const path15 = ref.slice(1).split("/").filter(Boolean);
54785
+ if (path15.length === 0) {
54405
54786
  return ctx.rootSchema;
54406
54787
  }
54407
54788
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
54408
- if (path14[0] === defsKey) {
54409
- const key = path14[1];
54789
+ if (path15[0] === defsKey) {
54790
+ const key = path15[1];
54410
54791
  if (!key || !ctx.defs[key]) {
54411
54792
  throw new Error(`Reference not found: ${ref}`);
54412
54793
  }
@@ -54853,8 +55234,14 @@ function getManifestPath(projectDir) {
54853
55234
  }
54854
55235
 
54855
55236
  // src/commands/status.ts
54856
- var import_fs_extra11 = __toESM(require_lib2(), 1);
55237
+ var import_fs_extra12 = __toESM(require_lib2(), 1);
54857
55238
  var import_path13 = __toESM(require("path"), 1);
55239
+ function formatTargetLabel2(target) {
55240
+ const normalized = target.replace(/\\/g, "/").toLowerCase();
55241
+ if (normalized.endsWith("/.agents/skills") || normalized.includes("/.agents/skills/")) return "~/.agents/skills";
55242
+ if (normalized.endsWith("/.claude") || normalized.includes("/.claude/")) return "~/.claude";
55243
+ return import_path13.default.basename(target);
55244
+ }
54858
55245
  function formatRelativeTime(timestamp) {
54859
55246
  const now = Date.now();
54860
55247
  const diff = now - timestamp;
@@ -54873,7 +55260,7 @@ function createStatusCommand() {
54873
55260
  const candidates = getCandidatePaths();
54874
55261
  const targets = [];
54875
55262
  for (const c of candidates) {
54876
- if (await import_fs_extra11.default.pathExists(c.path)) targets.push(c.path);
55263
+ if (await import_fs_extra12.default.pathExists(c.path)) targets.push(c.path);
54877
55264
  }
54878
55265
  if (targets.length === 0) {
54879
55266
  console.log(kleur_default.yellow("\n No agent environments found (~/.claude, ~/.gemini, ~/.qwen)\n"));
@@ -54884,8 +55271,8 @@ function createStatusCommand() {
54884
55271
  const manifestPath = getManifestPath(target);
54885
55272
  let lastSync = null;
54886
55273
  try {
54887
- if (await import_fs_extra11.default.pathExists(manifestPath)) {
54888
- const manifest = await import_fs_extra11.default.readJson(manifestPath);
55274
+ if (await import_fs_extra12.default.pathExists(manifestPath)) {
55275
+ const manifest = await import_fs_extra12.default.readJson(manifestPath);
54889
55276
  if (manifest.lastSync) lastSync = manifest.lastSync;
54890
55277
  }
54891
55278
  } catch {
@@ -54895,7 +55282,7 @@ function createStatusCommand() {
54895
55282
  (sum, c) => sum + c.missing.length + c.outdated.length + c.drifted.length,
54896
55283
  0
54897
55284
  );
54898
- results.push({ path: target, name: import_path13.default.basename(target), lastSync, changes: changeSet, totalChanges });
55285
+ results.push({ path: target, name: formatTargetLabel2(target), lastSync, changes: changeSet, totalChanges });
54899
55286
  }
54900
55287
  if (json2) {
54901
55288
  console.log(JSON.stringify({ targets: results }, null, 2));
@@ -54977,102 +55364,155 @@ function createResetCommand() {
54977
55364
  }
54978
55365
 
54979
55366
  // src/commands/help.ts
55367
+ var import_path14 = __toESM(require("path"), 1);
55368
+ var import_fs_extra13 = __toESM(require_lib2(), 1);
55369
+ var HOOK_CATALOG = [
55370
+ { file: "main-guard.mjs", event: "PreToolUse", desc: "Blocks direct edits on protected branches" },
55371
+ { file: "skill-suggestion.py", event: "UserPromptSubmit", desc: "Suggests relevant skills based on user prompt" },
55372
+ { file: "serena-workflow-reminder.py", event: "SessionStart", desc: "Injects Serena semantic editing workflow reminder" },
55373
+ { file: "type-safety-enforcement.py", event: "PreToolUse", desc: "Prevents risky Bash and enforces safe edit patterns" },
55374
+ { file: "gitnexus/gitnexus-hook.cjs", event: "PreToolUse", desc: "Adds GitNexus context for Grep/Glob/Bash searches" },
55375
+ { file: "skill-discovery.py", event: "UserPromptSubmit", desc: "Discovers available skills for user requests" },
55376
+ { file: "agent_context.py", event: "Support module", desc: "Shared hook I/O helper used by Python hook scripts" },
55377
+ { file: "beads-edit-gate.mjs", event: "PreToolUse", desc: "Blocks file edits if no beads issue is claimed", beads: true },
55378
+ { file: "beads-commit-gate.mjs", event: "PreToolUse", desc: "Blocks commits when no beads issue is in progress", beads: true },
55379
+ { file: "beads-stop-gate.mjs", event: "Stop", desc: "Blocks session stop with an unclosed beads claim", beads: true },
55380
+ { file: "beads-close-memory-prompt.mjs", event: "PostToolUse", desc: "Prompts memory save when closing a beads issue", beads: true }
55381
+ ];
55382
+ async function readSkillsFromDir(dir) {
55383
+ if (!await import_fs_extra13.default.pathExists(dir)) return [];
55384
+ const entries = await import_fs_extra13.default.readdir(dir);
55385
+ const skills = [];
55386
+ for (const name of entries.sort()) {
55387
+ const skillMd = import_path14.default.join(dir, name, "SKILL.md");
55388
+ if (!await import_fs_extra13.default.pathExists(skillMd)) continue;
55389
+ const content = await import_fs_extra13.default.readFile(skillMd, "utf8");
55390
+ const m = content.match(/^description:\s*(.+)$/m);
55391
+ skills.push({ name, desc: m ? m[1].replace(/^["']|["']$/g, "").trim() : "" });
55392
+ }
55393
+ return skills;
55394
+ }
55395
+ async function readProjectSkillsFromDir(dir) {
55396
+ if (!await import_fs_extra13.default.pathExists(dir)) return [];
55397
+ const entries = await import_fs_extra13.default.readdir(dir);
55398
+ const skills = [];
55399
+ for (const name of entries.sort()) {
55400
+ const readme = import_path14.default.join(dir, name, "README.md");
55401
+ if (!await import_fs_extra13.default.pathExists(readme)) continue;
55402
+ const content = await import_fs_extra13.default.readFile(readme, "utf8");
55403
+ const descLine = content.split("\n").find((line) => {
55404
+ const trimmed = line.trim();
55405
+ return Boolean(trimmed) && !trimmed.startsWith("#") && !trimmed.startsWith("[") && !trimmed.startsWith("<");
55406
+ }) || "";
55407
+ skills.push({ name, desc: descLine.replace(/[*_`]/g, "").trim() });
55408
+ }
55409
+ return skills;
55410
+ }
55411
+ function resolvePkgRootFallback() {
55412
+ const candidates = [
55413
+ import_path14.default.resolve(__dirname, "../.."),
55414
+ import_path14.default.resolve(__dirname, "../../..")
55415
+ ];
55416
+ const match = candidates.find(
55417
+ (candidate) => import_fs_extra13.default.existsSync(import_path14.default.join(candidate, "skills")) || import_fs_extra13.default.existsSync(import_path14.default.join(candidate, "project-skills"))
55418
+ );
55419
+ return match || null;
55420
+ }
55421
+ function col(s, width) {
55422
+ return s.length >= width ? s.slice(0, width - 1) + "\u2026" : s.padEnd(width);
55423
+ }
54980
55424
  function createHelpCommand() {
54981
- return new Command("help").description("Show help information").action(() => {
54982
- console.log(`
54983
- ${kleur_default.bold("XTRM - Claude Code Tools Installer")}
54984
-
54985
- ${kleur_default.cyan("USAGE:")}
54986
- xtrm <command> [options]
54987
-
54988
- ${kleur_default.cyan("COMMANDS:")}
54989
-
54990
- ${kleur_default.bold("install")} [target-selector] [options]
54991
- Install Claude Code tools (skills, hooks, MCP servers) to your environment.
54992
-
54993
- Options:
54994
- --dry-run Preview changes without making modifications
54995
- -y, --yes Skip confirmation prompts
54996
- --prune Remove items not in the canonical repository
54997
- --backport Backport drifted local changes to the repository
54998
-
54999
- Examples:
55000
- xtrm install # Interactive install with confirmation
55001
- xtrm install all # Install to all Claude Code targets without prompting
55002
- xtrm install '*' # Same as above; quote to avoid shell expansion
55003
- xtrm install --dry-run # Preview what would be installed
55004
- xtrm install all --dry-run -y # CI-friendly preview across all Claude targets
55005
- xtrm install -y # Non-interactive install
55006
-
55007
- ${kleur_default.bold("install project")} <tool-name>
55008
- Install a project-specific skill package into the current project.
55009
-
55010
- This command installs modular tools (like tdd-guard, ts-quality-gate, etc.)
55011
- into your project's .claude/ directory with proper hook injection.
55012
-
55013
- Examples:
55014
- xtrm install project tdd-guard # Install TDD Guard
55015
- xtrm install project ts-quality-gate # Install TypeScript Quality Gate
55016
- xtrm install project all # Install every available project skill
55017
- xtrm install project '*' # Same as above; quote to avoid shell expansion
55018
-
55019
- ${kleur_default.bold("install project list")}
55020
- List all available project skills with descriptions and usage examples.
55021
-
55022
- Shows a table of installable project-specific tools that can enhance
55023
- Claude's capabilities for your specific project needs.
55024
-
55025
- ${kleur_default.bold("status")}
55026
- Show diff of pending changes without making modifications.
55027
-
55028
- Displays what skills, hooks, and config would be updated if you ran
55029
- 'xtrm install'. Useful for reviewing changes before applying them.
55030
-
55031
- ${kleur_default.bold("reset")}
55032
- Clear saved preferences (sync mode, target selections, etc.).
55033
-
55034
- Use this to reset the CLI configuration and start fresh.
55035
-
55036
- ${kleur_default.cyan("PROJECT SKILLS:")}
55037
-
55038
- Project skills are modular, plug-and-play tool packages that extend
55039
- Claude's capabilities for specific workflows. Each skill includes:
55040
-
55041
- \u2022 Pre-configured hooks for Claude Code
55042
- \u2022 Skills to provide context and guidance
55043
- \u2022 Documentation for manual setup steps
55044
-
55045
- Available project skills:
55046
- \u2022 ${kleur_default.white("service-skills-set")} \u2014 Docker service expertise (SessionStart, PreToolUse, PostToolUse)
55047
- \u2022 ${kleur_default.white("tdd-guard")} \u2014 Enforce Test-Driven Development (PreToolUse, UserPromptSubmit)
55048
- \u2022 ${kleur_default.white("ts-quality-gate")} \u2014 TypeScript/ESLint/Prettier quality gate (PostToolUse)
55049
- \u2022 ${kleur_default.white("py-quality-gate")} \u2014 Python ruff/mypy quality gate (PostToolUse)
55050
- \u2022 ${kleur_default.white("main-guard")} \u2014 Git branch protection (PreToolUse)
55051
-
55052
- ${kleur_default.cyan("INSTALL TARGETS:")}
55053
-
55054
- xtrm-tools v2.0.0 installs into Claude Code targets and the .agents/skills cache:
55055
- \u2022 ~/.claude
55056
- \u2022 %APPDATA%/Claude on Windows
55057
- \u2022 ~/.agents/skills (skills-only copy)
55058
-
55059
- ${kleur_default.cyan("ARCHITECTURE:")}
55060
-
55061
- xtrm-tools v2.0.0 supports Claude Code exclusively. This decision was made
55062
- to focus on providing a robust, well-tested installation engine rather than
55063
- maintaining fragile translations for unofficial hook ecosystems.
55064
-
55065
- For Gemini CLI or Qwen CLI, users must manually configure their environments.
55066
- See the repository README for manual setup instructions.
55067
-
55068
- ${kleur_default.cyan("RESOURCES:")}
55069
-
55070
- \u2022 Repository: https://github.com/Jaggerxtrm/xtrm-tools
55071
- \u2022 Documentation: See README.md in the repository
55072
- \u2022 Report Issues: https://github.com/Jaggerxtrm/xtrm-tools/issues
55073
-
55074
- ${kleur_default.dim("Run 'xtrm <command> --help' for more information on a specific command.")}
55075
- `);
55425
+ return new Command("help").description("Show help information and component catalogue").action(async () => {
55426
+ let repoRoot;
55427
+ try {
55428
+ repoRoot = await findRepoRoot();
55429
+ } catch {
55430
+ repoRoot = "";
55431
+ }
55432
+ const pkgRoot = resolvePkgRootFallback();
55433
+ const skillsRoot = repoRoot || pkgRoot || "";
55434
+ const projectSkillsRoot = repoRoot || pkgRoot || "";
55435
+ const skills = skillsRoot ? await readSkillsFromDir(import_path14.default.join(skillsRoot, "skills")) : [];
55436
+ const projectSkills = projectSkillsRoot ? await readProjectSkillsFromDir(import_path14.default.join(projectSkillsRoot, "project-skills")) : [];
55437
+ const W = 80;
55438
+ const hr = kleur_default.dim("-".repeat(W));
55439
+ const section = (title) => `
55440
+ ${kleur_default.bold().cyan(title)}
55441
+ ${hr}`;
55442
+ const installSection = [
55443
+ section("INSTALL COMMANDS"),
55444
+ "",
55445
+ ` ${kleur_default.bold("xtrm install all")}`,
55446
+ ` ${kleur_default.dim("Global install: skills + all hooks (including beads gates) + MCP servers.")}`,
55447
+ ` ${kleur_default.dim("Checks for beads+dolt and prompts to install if missing.")}`,
55448
+ "",
55449
+ ` ${kleur_default.bold("xtrm install basic")}`,
55450
+ ` ${kleur_default.dim("Global install: skills + general hooks + MCP servers.")}`,
55451
+ ` ${kleur_default.dim("No beads dependency -- safe to run with zero external deps.")}`,
55452
+ "",
55453
+ ` ${kleur_default.bold("xtrm install project")} ${kleur_default.dim("<tool-name | all>")}`,
55454
+ ` ${kleur_default.dim("Project-scoped install into .claude/ of current git root.")}`,
55455
+ ` ${kleur_default.dim("Run xtrm install project list to see available project skills.")}`,
55456
+ "",
55457
+ ` ${kleur_default.dim("Default target directories:")}`,
55458
+ ` ${kleur_default.dim("~/.claude/hooks (global hook scripts)")}`,
55459
+ ` ${kleur_default.dim("~/.claude/skills (global Claude skills)")}`,
55460
+ ` ${kleur_default.dim("~/.agents/skills (agents skills cache mirror)")}`,
55461
+ "",
55462
+ ` ${kleur_default.dim("Flags (all profiles): --dry-run --yes / -y --no-mcp --force --prune --backport")}`
55463
+ ].join("\n");
55464
+ const general = HOOK_CATALOG.filter((h) => !h.beads);
55465
+ const beads = HOOK_CATALOG.filter((h) => h.beads);
55466
+ const hookRows = (hooks) => hooks.map(
55467
+ (h) => ` ${kleur_default.white(col(h.file, 34))}${kleur_default.yellow(col(h.event, 20))}${kleur_default.dim(h.desc)}`
55468
+ ).join("\n");
55469
+ const hooksSection = [
55470
+ section("GLOBAL HOOKS"),
55471
+ "",
55472
+ kleur_default.dim(" " + col("File", 34) + col("Event", 20) + "Description"),
55473
+ "",
55474
+ hookRows(general),
55475
+ "",
55476
+ ` ${kleur_default.dim("beads gate hooks (xtrm install all -- require beads+dolt):")}`,
55477
+ hookRows(beads)
55478
+ ].join("\n");
55479
+ const skillRows = skills.map((s) => {
55480
+ const desc = s.desc.length > 46 ? s.desc.slice(0, 45) + "\u2026" : s.desc;
55481
+ return ` ${kleur_default.white(col(s.name, 30))}${kleur_default.dim(desc)}`;
55482
+ }).join("\n");
55483
+ const skillsSection = [
55484
+ section(`SKILLS ${kleur_default.dim("(" + skills.length + " available)")}`),
55485
+ "",
55486
+ skills.length ? skillRows : kleur_default.dim(" (none found -- run from repo root to see skills)")
55487
+ ].join("\n");
55488
+ const psRows = projectSkills.map(
55489
+ (s) => ` ${kleur_default.white(col(s.name, 30))}${kleur_default.dim(s.desc)}`
55490
+ ).join("\n");
55491
+ const psSection = [
55492
+ section("PROJECT SKILLS + HOOKS"),
55493
+ "",
55494
+ projectSkills.length ? psRows : kleur_default.dim(" (none found in package)"),
55495
+ "",
55496
+ ` ${kleur_default.dim("Install: xtrm install project <name> | xtrm install project list")}`,
55497
+ ` ${kleur_default.dim("Each project skill can install .claude/skills plus project hooks/settings.")}`
55498
+ ].join("\n");
55499
+ const otherSection = [
55500
+ section("OTHER COMMANDS"),
55501
+ "",
55502
+ ` ${kleur_default.bold("xtrm status")} ${kleur_default.dim("Show pending changes without applying them")}`,
55503
+ ` ${kleur_default.bold("xtrm reset")} ${kleur_default.dim("Clear saved preferences and start fresh")}`,
55504
+ ` ${kleur_default.bold("xtrm help")} ${kleur_default.dim("Show this overview")}`
55505
+ ].join("\n");
55506
+ const resourcesSection = [
55507
+ section("RESOURCES"),
55508
+ "",
55509
+ ` Repository https://github.com/Jaggerxtrm/xtrm-tools`,
55510
+ ` Issues https://github.com/Jaggerxtrm/xtrm-tools/issues`,
55511
+ "",
55512
+ ` ${kleur_default.dim("Run 'xtrm <command> --help' for command-specific options.")}`,
55513
+ ""
55514
+ ].join("\n");
55515
+ console.log([installSection, hooksSection, skillsSection, psSection, otherSection, resourcesSection].join("\n"));
55076
55516
  });
55077
55517
  }
55078
55518