ghost-bridge 0.5.0 → 0.5.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.
package/dist/cli.js CHANGED
@@ -934,8 +934,8 @@ var require_command = __commonJS({
934
934
  "node_modules/commander/lib/command.js"(exports) {
935
935
  var EventEmitter = __require("events").EventEmitter;
936
936
  var childProcess = __require("child_process");
937
- var path4 = __require("path");
938
- var fs5 = __require("fs");
937
+ var path5 = __require("path");
938
+ var fs6 = __require("fs");
939
939
  var process3 = __require("process");
940
940
  var { Argument: Argument2, humanReadableArgName } = require_argument();
941
941
  var { CommanderError: CommanderError2 } = require_error();
@@ -1758,10 +1758,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
1758
1758
  let launchWithNode = false;
1759
1759
  const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
1760
1760
  function findFile(baseDir, baseName) {
1761
- const localBin = path4.resolve(baseDir, baseName);
1762
- if (fs5.existsSync(localBin)) return localBin;
1763
- if (sourceExt.includes(path4.extname(baseName))) return void 0;
1764
- const foundExt = sourceExt.find((ext) => fs5.existsSync(`${localBin}${ext}`));
1761
+ const localBin = path5.resolve(baseDir, baseName);
1762
+ if (fs6.existsSync(localBin)) return localBin;
1763
+ if (sourceExt.includes(path5.extname(baseName))) return void 0;
1764
+ const foundExt = sourceExt.find((ext) => fs6.existsSync(`${localBin}${ext}`));
1765
1765
  if (foundExt) return `${localBin}${foundExt}`;
1766
1766
  return void 0;
1767
1767
  }
@@ -1772,23 +1772,23 @@ Expecting one of '${allowedValues.join("', '")}'`);
1772
1772
  if (this._scriptPath) {
1773
1773
  let resolvedScriptPath;
1774
1774
  try {
1775
- resolvedScriptPath = fs5.realpathSync(this._scriptPath);
1775
+ resolvedScriptPath = fs6.realpathSync(this._scriptPath);
1776
1776
  } catch (err) {
1777
1777
  resolvedScriptPath = this._scriptPath;
1778
1778
  }
1779
- executableDir = path4.resolve(path4.dirname(resolvedScriptPath), executableDir);
1779
+ executableDir = path5.resolve(path5.dirname(resolvedScriptPath), executableDir);
1780
1780
  }
1781
1781
  if (executableDir) {
1782
1782
  let localFile = findFile(executableDir, executableFile);
1783
1783
  if (!localFile && !subcommand._executableFile && this._scriptPath) {
1784
- const legacyName = path4.basename(this._scriptPath, path4.extname(this._scriptPath));
1784
+ const legacyName = path5.basename(this._scriptPath, path5.extname(this._scriptPath));
1785
1785
  if (legacyName !== this._name) {
1786
1786
  localFile = findFile(executableDir, `${legacyName}-${subcommand._name}`);
1787
1787
  }
1788
1788
  }
1789
1789
  executableFile = localFile || executableFile;
1790
1790
  }
1791
- launchWithNode = sourceExt.includes(path4.extname(executableFile));
1791
+ launchWithNode = sourceExt.includes(path5.extname(executableFile));
1792
1792
  let proc;
1793
1793
  if (process3.platform !== "win32") {
1794
1794
  if (launchWithNode) {
@@ -2571,7 +2571,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2571
2571
  * @return {Command}
2572
2572
  */
2573
2573
  nameFromFilename(filename) {
2574
- this._name = path4.basename(filename, path4.extname(filename));
2574
+ this._name = path5.basename(filename, path5.extname(filename));
2575
2575
  return this;
2576
2576
  }
2577
2577
  /**
@@ -2585,9 +2585,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
2585
2585
  * @param {string} [path]
2586
2586
  * @return {string|null|Command}
2587
2587
  */
2588
- executableDir(path5) {
2589
- if (path5 === void 0) return this._executableDir;
2590
- this._executableDir = path5;
2588
+ executableDir(path6) {
2589
+ if (path6 === void 0) return this._executableDir;
2590
+ this._executableDir = path6;
2591
2591
  return this;
2592
2592
  }
2593
2593
  /**
@@ -3347,54 +3347,54 @@ var require_polyfills = __commonJS({
3347
3347
  }
3348
3348
  var chdir;
3349
3349
  module.exports = patch;
3350
- function patch(fs5) {
3350
+ function patch(fs6) {
3351
3351
  if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
3352
- patchLchmod(fs5);
3353
- }
3354
- if (!fs5.lutimes) {
3355
- patchLutimes(fs5);
3356
- }
3357
- fs5.chown = chownFix(fs5.chown);
3358
- fs5.fchown = chownFix(fs5.fchown);
3359
- fs5.lchown = chownFix(fs5.lchown);
3360
- fs5.chmod = chmodFix(fs5.chmod);
3361
- fs5.fchmod = chmodFix(fs5.fchmod);
3362
- fs5.lchmod = chmodFix(fs5.lchmod);
3363
- fs5.chownSync = chownFixSync(fs5.chownSync);
3364
- fs5.fchownSync = chownFixSync(fs5.fchownSync);
3365
- fs5.lchownSync = chownFixSync(fs5.lchownSync);
3366
- fs5.chmodSync = chmodFixSync(fs5.chmodSync);
3367
- fs5.fchmodSync = chmodFixSync(fs5.fchmodSync);
3368
- fs5.lchmodSync = chmodFixSync(fs5.lchmodSync);
3369
- fs5.stat = statFix(fs5.stat);
3370
- fs5.fstat = statFix(fs5.fstat);
3371
- fs5.lstat = statFix(fs5.lstat);
3372
- fs5.statSync = statFixSync(fs5.statSync);
3373
- fs5.fstatSync = statFixSync(fs5.fstatSync);
3374
- fs5.lstatSync = statFixSync(fs5.lstatSync);
3375
- if (fs5.chmod && !fs5.lchmod) {
3376
- fs5.lchmod = function(path4, mode, cb) {
3352
+ patchLchmod(fs6);
3353
+ }
3354
+ if (!fs6.lutimes) {
3355
+ patchLutimes(fs6);
3356
+ }
3357
+ fs6.chown = chownFix(fs6.chown);
3358
+ fs6.fchown = chownFix(fs6.fchown);
3359
+ fs6.lchown = chownFix(fs6.lchown);
3360
+ fs6.chmod = chmodFix(fs6.chmod);
3361
+ fs6.fchmod = chmodFix(fs6.fchmod);
3362
+ fs6.lchmod = chmodFix(fs6.lchmod);
3363
+ fs6.chownSync = chownFixSync(fs6.chownSync);
3364
+ fs6.fchownSync = chownFixSync(fs6.fchownSync);
3365
+ fs6.lchownSync = chownFixSync(fs6.lchownSync);
3366
+ fs6.chmodSync = chmodFixSync(fs6.chmodSync);
3367
+ fs6.fchmodSync = chmodFixSync(fs6.fchmodSync);
3368
+ fs6.lchmodSync = chmodFixSync(fs6.lchmodSync);
3369
+ fs6.stat = statFix(fs6.stat);
3370
+ fs6.fstat = statFix(fs6.fstat);
3371
+ fs6.lstat = statFix(fs6.lstat);
3372
+ fs6.statSync = statFixSync(fs6.statSync);
3373
+ fs6.fstatSync = statFixSync(fs6.fstatSync);
3374
+ fs6.lstatSync = statFixSync(fs6.lstatSync);
3375
+ if (fs6.chmod && !fs6.lchmod) {
3376
+ fs6.lchmod = function(path5, mode, cb) {
3377
3377
  if (cb) process.nextTick(cb);
3378
3378
  };
3379
- fs5.lchmodSync = function() {
3379
+ fs6.lchmodSync = function() {
3380
3380
  };
3381
3381
  }
3382
- if (fs5.chown && !fs5.lchown) {
3383
- fs5.lchown = function(path4, uid, gid, cb) {
3382
+ if (fs6.chown && !fs6.lchown) {
3383
+ fs6.lchown = function(path5, uid, gid, cb) {
3384
3384
  if (cb) process.nextTick(cb);
3385
3385
  };
3386
- fs5.lchownSync = function() {
3386
+ fs6.lchownSync = function() {
3387
3387
  };
3388
3388
  }
3389
3389
  if (platform === "win32") {
3390
- fs5.rename = typeof fs5.rename !== "function" ? fs5.rename : (function(fs$rename) {
3390
+ fs6.rename = typeof fs6.rename !== "function" ? fs6.rename : (function(fs$rename) {
3391
3391
  function rename(from, to, cb) {
3392
3392
  var start = Date.now();
3393
3393
  var backoff = 0;
3394
3394
  fs$rename(from, to, function CB(er) {
3395
3395
  if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
3396
3396
  setTimeout(function() {
3397
- fs5.stat(to, function(stater, st) {
3397
+ fs6.stat(to, function(stater, st) {
3398
3398
  if (stater && stater.code === "ENOENT")
3399
3399
  fs$rename(from, to, CB);
3400
3400
  else
@@ -3410,9 +3410,9 @@ var require_polyfills = __commonJS({
3410
3410
  }
3411
3411
  if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
3412
3412
  return rename;
3413
- })(fs5.rename);
3413
+ })(fs6.rename);
3414
3414
  }
3415
- fs5.read = typeof fs5.read !== "function" ? fs5.read : (function(fs$read) {
3415
+ fs6.read = typeof fs6.read !== "function" ? fs6.read : (function(fs$read) {
3416
3416
  function read(fd, buffer, offset, length, position, callback_) {
3417
3417
  var callback;
3418
3418
  if (callback_ && typeof callback_ === "function") {
@@ -3420,22 +3420,22 @@ var require_polyfills = __commonJS({
3420
3420
  callback = function(er, _, __) {
3421
3421
  if (er && er.code === "EAGAIN" && eagCounter < 10) {
3422
3422
  eagCounter++;
3423
- return fs$read.call(fs5, fd, buffer, offset, length, position, callback);
3423
+ return fs$read.call(fs6, fd, buffer, offset, length, position, callback);
3424
3424
  }
3425
3425
  callback_.apply(this, arguments);
3426
3426
  };
3427
3427
  }
3428
- return fs$read.call(fs5, fd, buffer, offset, length, position, callback);
3428
+ return fs$read.call(fs6, fd, buffer, offset, length, position, callback);
3429
3429
  }
3430
3430
  if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
3431
3431
  return read;
3432
- })(fs5.read);
3433
- fs5.readSync = typeof fs5.readSync !== "function" ? fs5.readSync : /* @__PURE__ */ (function(fs$readSync) {
3432
+ })(fs6.read);
3433
+ fs6.readSync = typeof fs6.readSync !== "function" ? fs6.readSync : /* @__PURE__ */ (function(fs$readSync) {
3434
3434
  return function(fd, buffer, offset, length, position) {
3435
3435
  var eagCounter = 0;
3436
3436
  while (true) {
3437
3437
  try {
3438
- return fs$readSync.call(fs5, fd, buffer, offset, length, position);
3438
+ return fs$readSync.call(fs6, fd, buffer, offset, length, position);
3439
3439
  } catch (er) {
3440
3440
  if (er.code === "EAGAIN" && eagCounter < 10) {
3441
3441
  eagCounter++;
@@ -3445,11 +3445,11 @@ var require_polyfills = __commonJS({
3445
3445
  }
3446
3446
  }
3447
3447
  };
3448
- })(fs5.readSync);
3449
- function patchLchmod(fs6) {
3450
- fs6.lchmod = function(path4, mode, callback) {
3451
- fs6.open(
3452
- path4,
3448
+ })(fs6.readSync);
3449
+ function patchLchmod(fs7) {
3450
+ fs7.lchmod = function(path5, mode, callback) {
3451
+ fs7.open(
3452
+ path5,
3453
3453
  constants.O_WRONLY | constants.O_SYMLINK,
3454
3454
  mode,
3455
3455
  function(err, fd) {
@@ -3457,80 +3457,80 @@ var require_polyfills = __commonJS({
3457
3457
  if (callback) callback(err);
3458
3458
  return;
3459
3459
  }
3460
- fs6.fchmod(fd, mode, function(err2) {
3461
- fs6.close(fd, function(err22) {
3460
+ fs7.fchmod(fd, mode, function(err2) {
3461
+ fs7.close(fd, function(err22) {
3462
3462
  if (callback) callback(err2 || err22);
3463
3463
  });
3464
3464
  });
3465
3465
  }
3466
3466
  );
3467
3467
  };
3468
- fs6.lchmodSync = function(path4, mode) {
3469
- var fd = fs6.openSync(path4, constants.O_WRONLY | constants.O_SYMLINK, mode);
3468
+ fs7.lchmodSync = function(path5, mode) {
3469
+ var fd = fs7.openSync(path5, constants.O_WRONLY | constants.O_SYMLINK, mode);
3470
3470
  var threw = true;
3471
3471
  var ret;
3472
3472
  try {
3473
- ret = fs6.fchmodSync(fd, mode);
3473
+ ret = fs7.fchmodSync(fd, mode);
3474
3474
  threw = false;
3475
3475
  } finally {
3476
3476
  if (threw) {
3477
3477
  try {
3478
- fs6.closeSync(fd);
3478
+ fs7.closeSync(fd);
3479
3479
  } catch (er) {
3480
3480
  }
3481
3481
  } else {
3482
- fs6.closeSync(fd);
3482
+ fs7.closeSync(fd);
3483
3483
  }
3484
3484
  }
3485
3485
  return ret;
3486
3486
  };
3487
3487
  }
3488
- function patchLutimes(fs6) {
3489
- if (constants.hasOwnProperty("O_SYMLINK") && fs6.futimes) {
3490
- fs6.lutimes = function(path4, at, mt, cb) {
3491
- fs6.open(path4, constants.O_SYMLINK, function(er, fd) {
3488
+ function patchLutimes(fs7) {
3489
+ if (constants.hasOwnProperty("O_SYMLINK") && fs7.futimes) {
3490
+ fs7.lutimes = function(path5, at, mt, cb) {
3491
+ fs7.open(path5, constants.O_SYMLINK, function(er, fd) {
3492
3492
  if (er) {
3493
3493
  if (cb) cb(er);
3494
3494
  return;
3495
3495
  }
3496
- fs6.futimes(fd, at, mt, function(er2) {
3497
- fs6.close(fd, function(er22) {
3496
+ fs7.futimes(fd, at, mt, function(er2) {
3497
+ fs7.close(fd, function(er22) {
3498
3498
  if (cb) cb(er2 || er22);
3499
3499
  });
3500
3500
  });
3501
3501
  });
3502
3502
  };
3503
- fs6.lutimesSync = function(path4, at, mt) {
3504
- var fd = fs6.openSync(path4, constants.O_SYMLINK);
3503
+ fs7.lutimesSync = function(path5, at, mt) {
3504
+ var fd = fs7.openSync(path5, constants.O_SYMLINK);
3505
3505
  var ret;
3506
3506
  var threw = true;
3507
3507
  try {
3508
- ret = fs6.futimesSync(fd, at, mt);
3508
+ ret = fs7.futimesSync(fd, at, mt);
3509
3509
  threw = false;
3510
3510
  } finally {
3511
3511
  if (threw) {
3512
3512
  try {
3513
- fs6.closeSync(fd);
3513
+ fs7.closeSync(fd);
3514
3514
  } catch (er) {
3515
3515
  }
3516
3516
  } else {
3517
- fs6.closeSync(fd);
3517
+ fs7.closeSync(fd);
3518
3518
  }
3519
3519
  }
3520
3520
  return ret;
3521
3521
  };
3522
- } else if (fs6.futimes) {
3523
- fs6.lutimes = function(_a, _b, _c, cb) {
3522
+ } else if (fs7.futimes) {
3523
+ fs7.lutimes = function(_a, _b, _c, cb) {
3524
3524
  if (cb) process.nextTick(cb);
3525
3525
  };
3526
- fs6.lutimesSync = function() {
3526
+ fs7.lutimesSync = function() {
3527
3527
  };
3528
3528
  }
3529
3529
  }
3530
3530
  function chmodFix(orig) {
3531
3531
  if (!orig) return orig;
3532
3532
  return function(target, mode, cb) {
3533
- return orig.call(fs5, target, mode, function(er) {
3533
+ return orig.call(fs6, target, mode, function(er) {
3534
3534
  if (chownErOk(er)) er = null;
3535
3535
  if (cb) cb.apply(this, arguments);
3536
3536
  });
@@ -3540,7 +3540,7 @@ var require_polyfills = __commonJS({
3540
3540
  if (!orig) return orig;
3541
3541
  return function(target, mode) {
3542
3542
  try {
3543
- return orig.call(fs5, target, mode);
3543
+ return orig.call(fs6, target, mode);
3544
3544
  } catch (er) {
3545
3545
  if (!chownErOk(er)) throw er;
3546
3546
  }
@@ -3549,7 +3549,7 @@ var require_polyfills = __commonJS({
3549
3549
  function chownFix(orig) {
3550
3550
  if (!orig) return orig;
3551
3551
  return function(target, uid, gid, cb) {
3552
- return orig.call(fs5, target, uid, gid, function(er) {
3552
+ return orig.call(fs6, target, uid, gid, function(er) {
3553
3553
  if (chownErOk(er)) er = null;
3554
3554
  if (cb) cb.apply(this, arguments);
3555
3555
  });
@@ -3559,7 +3559,7 @@ var require_polyfills = __commonJS({
3559
3559
  if (!orig) return orig;
3560
3560
  return function(target, uid, gid) {
3561
3561
  try {
3562
- return orig.call(fs5, target, uid, gid);
3562
+ return orig.call(fs6, target, uid, gid);
3563
3563
  } catch (er) {
3564
3564
  if (!chownErOk(er)) throw er;
3565
3565
  }
@@ -3579,13 +3579,13 @@ var require_polyfills = __commonJS({
3579
3579
  }
3580
3580
  if (cb) cb.apply(this, arguments);
3581
3581
  }
3582
- return options ? orig.call(fs5, target, options, callback) : orig.call(fs5, target, callback);
3582
+ return options ? orig.call(fs6, target, options, callback) : orig.call(fs6, target, callback);
3583
3583
  };
3584
3584
  }
3585
3585
  function statFixSync(orig) {
3586
3586
  if (!orig) return orig;
3587
3587
  return function(target, options) {
3588
- var stats = options ? orig.call(fs5, target, options) : orig.call(fs5, target);
3588
+ var stats = options ? orig.call(fs6, target, options) : orig.call(fs6, target);
3589
3589
  if (stats) {
3590
3590
  if (stats.uid < 0) stats.uid += 4294967296;
3591
3591
  if (stats.gid < 0) stats.gid += 4294967296;
@@ -3614,16 +3614,16 @@ var require_legacy_streams = __commonJS({
3614
3614
  "node_modules/graceful-fs/legacy-streams.js"(exports, module) {
3615
3615
  var Stream = __require("stream").Stream;
3616
3616
  module.exports = legacy;
3617
- function legacy(fs5) {
3617
+ function legacy(fs6) {
3618
3618
  return {
3619
3619
  ReadStream,
3620
3620
  WriteStream
3621
3621
  };
3622
- function ReadStream(path4, options) {
3623
- if (!(this instanceof ReadStream)) return new ReadStream(path4, options);
3622
+ function ReadStream(path5, options) {
3623
+ if (!(this instanceof ReadStream)) return new ReadStream(path5, options);
3624
3624
  Stream.call(this);
3625
3625
  var self = this;
3626
- this.path = path4;
3626
+ this.path = path5;
3627
3627
  this.fd = null;
3628
3628
  this.readable = true;
3629
3629
  this.paused = false;
@@ -3657,7 +3657,7 @@ var require_legacy_streams = __commonJS({
3657
3657
  });
3658
3658
  return;
3659
3659
  }
3660
- fs5.open(this.path, this.flags, this.mode, function(err, fd) {
3660
+ fs6.open(this.path, this.flags, this.mode, function(err, fd) {
3661
3661
  if (err) {
3662
3662
  self.emit("error", err);
3663
3663
  self.readable = false;
@@ -3668,10 +3668,10 @@ var require_legacy_streams = __commonJS({
3668
3668
  self._read();
3669
3669
  });
3670
3670
  }
3671
- function WriteStream(path4, options) {
3672
- if (!(this instanceof WriteStream)) return new WriteStream(path4, options);
3671
+ function WriteStream(path5, options) {
3672
+ if (!(this instanceof WriteStream)) return new WriteStream(path5, options);
3673
3673
  Stream.call(this);
3674
- this.path = path4;
3674
+ this.path = path5;
3675
3675
  this.fd = null;
3676
3676
  this.writable = true;
3677
3677
  this.flags = "w";
@@ -3696,7 +3696,7 @@ var require_legacy_streams = __commonJS({
3696
3696
  this.busy = false;
3697
3697
  this._queue = [];
3698
3698
  if (this.fd === null) {
3699
- this._open = fs5.open;
3699
+ this._open = fs6.open;
3700
3700
  this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
3701
3701
  this.flush();
3702
3702
  }
@@ -3731,7 +3731,7 @@ var require_clone = __commonJS({
3731
3731
  // node_modules/graceful-fs/graceful-fs.js
3732
3732
  var require_graceful_fs = __commonJS({
3733
3733
  "node_modules/graceful-fs/graceful-fs.js"(exports, module) {
3734
- var fs5 = __require("fs");
3734
+ var fs6 = __require("fs");
3735
3735
  var polyfills = require_polyfills();
3736
3736
  var legacy = require_legacy_streams();
3737
3737
  var clone = require_clone();
@@ -3763,12 +3763,12 @@ var require_graceful_fs = __commonJS({
3763
3763
  m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
3764
3764
  console.error(m);
3765
3765
  };
3766
- if (!fs5[gracefulQueue]) {
3766
+ if (!fs6[gracefulQueue]) {
3767
3767
  queue = global[gracefulQueue] || [];
3768
- publishQueue(fs5, queue);
3769
- fs5.close = (function(fs$close) {
3768
+ publishQueue(fs6, queue);
3769
+ fs6.close = (function(fs$close) {
3770
3770
  function close(fd, cb) {
3771
- return fs$close.call(fs5, fd, function(err) {
3771
+ return fs$close.call(fs6, fd, function(err) {
3772
3772
  if (!err) {
3773
3773
  resetQueue();
3774
3774
  }
@@ -3780,48 +3780,48 @@ var require_graceful_fs = __commonJS({
3780
3780
  value: fs$close
3781
3781
  });
3782
3782
  return close;
3783
- })(fs5.close);
3784
- fs5.closeSync = (function(fs$closeSync) {
3783
+ })(fs6.close);
3784
+ fs6.closeSync = (function(fs$closeSync) {
3785
3785
  function closeSync(fd) {
3786
- fs$closeSync.apply(fs5, arguments);
3786
+ fs$closeSync.apply(fs6, arguments);
3787
3787
  resetQueue();
3788
3788
  }
3789
3789
  Object.defineProperty(closeSync, previousSymbol, {
3790
3790
  value: fs$closeSync
3791
3791
  });
3792
3792
  return closeSync;
3793
- })(fs5.closeSync);
3793
+ })(fs6.closeSync);
3794
3794
  if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
3795
3795
  process.on("exit", function() {
3796
- debug(fs5[gracefulQueue]);
3797
- __require("assert").equal(fs5[gracefulQueue].length, 0);
3796
+ debug(fs6[gracefulQueue]);
3797
+ __require("assert").equal(fs6[gracefulQueue].length, 0);
3798
3798
  });
3799
3799
  }
3800
3800
  }
3801
3801
  var queue;
3802
3802
  if (!global[gracefulQueue]) {
3803
- publishQueue(global, fs5[gracefulQueue]);
3803
+ publishQueue(global, fs6[gracefulQueue]);
3804
3804
  }
3805
- module.exports = patch(clone(fs5));
3806
- if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs5.__patched) {
3807
- module.exports = patch(fs5);
3808
- fs5.__patched = true;
3805
+ module.exports = patch(clone(fs6));
3806
+ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs6.__patched) {
3807
+ module.exports = patch(fs6);
3808
+ fs6.__patched = true;
3809
3809
  }
3810
- function patch(fs6) {
3811
- polyfills(fs6);
3812
- fs6.gracefulify = patch;
3813
- fs6.createReadStream = createReadStream;
3814
- fs6.createWriteStream = createWriteStream;
3815
- var fs$readFile = fs6.readFile;
3816
- fs6.readFile = readFile;
3817
- function readFile(path4, options, cb) {
3810
+ function patch(fs7) {
3811
+ polyfills(fs7);
3812
+ fs7.gracefulify = patch;
3813
+ fs7.createReadStream = createReadStream;
3814
+ fs7.createWriteStream = createWriteStream;
3815
+ var fs$readFile = fs7.readFile;
3816
+ fs7.readFile = readFile;
3817
+ function readFile(path5, options, cb) {
3818
3818
  if (typeof options === "function")
3819
3819
  cb = options, options = null;
3820
- return go$readFile(path4, options, cb);
3821
- function go$readFile(path5, options2, cb2, startTime) {
3822
- return fs$readFile(path5, options2, function(err) {
3820
+ return go$readFile(path5, options, cb);
3821
+ function go$readFile(path6, options2, cb2, startTime) {
3822
+ return fs$readFile(path6, options2, function(err) {
3823
3823
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
3824
- enqueue([go$readFile, [path5, options2, cb2], err, startTime || Date.now(), Date.now()]);
3824
+ enqueue([go$readFile, [path6, options2, cb2], err, startTime || Date.now(), Date.now()]);
3825
3825
  else {
3826
3826
  if (typeof cb2 === "function")
3827
3827
  cb2.apply(this, arguments);
@@ -3829,16 +3829,16 @@ var require_graceful_fs = __commonJS({
3829
3829
  });
3830
3830
  }
3831
3831
  }
3832
- var fs$writeFile = fs6.writeFile;
3833
- fs6.writeFile = writeFile;
3834
- function writeFile(path4, data, options, cb) {
3832
+ var fs$writeFile = fs7.writeFile;
3833
+ fs7.writeFile = writeFile;
3834
+ function writeFile(path5, data, options, cb) {
3835
3835
  if (typeof options === "function")
3836
3836
  cb = options, options = null;
3837
- return go$writeFile(path4, data, options, cb);
3838
- function go$writeFile(path5, data2, options2, cb2, startTime) {
3839
- return fs$writeFile(path5, data2, options2, function(err) {
3837
+ return go$writeFile(path5, data, options, cb);
3838
+ function go$writeFile(path6, data2, options2, cb2, startTime) {
3839
+ return fs$writeFile(path6, data2, options2, function(err) {
3840
3840
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
3841
- enqueue([go$writeFile, [path5, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
3841
+ enqueue([go$writeFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
3842
3842
  else {
3843
3843
  if (typeof cb2 === "function")
3844
3844
  cb2.apply(this, arguments);
@@ -3846,17 +3846,17 @@ var require_graceful_fs = __commonJS({
3846
3846
  });
3847
3847
  }
3848
3848
  }
3849
- var fs$appendFile = fs6.appendFile;
3849
+ var fs$appendFile = fs7.appendFile;
3850
3850
  if (fs$appendFile)
3851
- fs6.appendFile = appendFile;
3852
- function appendFile(path4, data, options, cb) {
3851
+ fs7.appendFile = appendFile;
3852
+ function appendFile(path5, data, options, cb) {
3853
3853
  if (typeof options === "function")
3854
3854
  cb = options, options = null;
3855
- return go$appendFile(path4, data, options, cb);
3856
- function go$appendFile(path5, data2, options2, cb2, startTime) {
3857
- return fs$appendFile(path5, data2, options2, function(err) {
3855
+ return go$appendFile(path5, data, options, cb);
3856
+ function go$appendFile(path6, data2, options2, cb2, startTime) {
3857
+ return fs$appendFile(path6, data2, options2, function(err) {
3858
3858
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
3859
- enqueue([go$appendFile, [path5, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
3859
+ enqueue([go$appendFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
3860
3860
  else {
3861
3861
  if (typeof cb2 === "function")
3862
3862
  cb2.apply(this, arguments);
@@ -3864,9 +3864,9 @@ var require_graceful_fs = __commonJS({
3864
3864
  });
3865
3865
  }
3866
3866
  }
3867
- var fs$copyFile = fs6.copyFile;
3867
+ var fs$copyFile = fs7.copyFile;
3868
3868
  if (fs$copyFile)
3869
- fs6.copyFile = copyFile;
3869
+ fs7.copyFile = copyFile;
3870
3870
  function copyFile(src, dest, flags, cb) {
3871
3871
  if (typeof flags === "function") {
3872
3872
  cb = flags;
@@ -3884,34 +3884,34 @@ var require_graceful_fs = __commonJS({
3884
3884
  });
3885
3885
  }
3886
3886
  }
3887
- var fs$readdir = fs6.readdir;
3888
- fs6.readdir = readdir;
3887
+ var fs$readdir = fs7.readdir;
3888
+ fs7.readdir = readdir;
3889
3889
  var noReaddirOptionVersions = /^v[0-5]\./;
3890
- function readdir(path4, options, cb) {
3890
+ function readdir(path5, options, cb) {
3891
3891
  if (typeof options === "function")
3892
3892
  cb = options, options = null;
3893
- var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path5, options2, cb2, startTime) {
3894
- return fs$readdir(path5, fs$readdirCallback(
3895
- path5,
3893
+ var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path6, options2, cb2, startTime) {
3894
+ return fs$readdir(path6, fs$readdirCallback(
3895
+ path6,
3896
3896
  options2,
3897
3897
  cb2,
3898
3898
  startTime
3899
3899
  ));
3900
- } : function go$readdir2(path5, options2, cb2, startTime) {
3901
- return fs$readdir(path5, options2, fs$readdirCallback(
3902
- path5,
3900
+ } : function go$readdir2(path6, options2, cb2, startTime) {
3901
+ return fs$readdir(path6, options2, fs$readdirCallback(
3902
+ path6,
3903
3903
  options2,
3904
3904
  cb2,
3905
3905
  startTime
3906
3906
  ));
3907
3907
  };
3908
- return go$readdir(path4, options, cb);
3909
- function fs$readdirCallback(path5, options2, cb2, startTime) {
3908
+ return go$readdir(path5, options, cb);
3909
+ function fs$readdirCallback(path6, options2, cb2, startTime) {
3910
3910
  return function(err, files) {
3911
3911
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
3912
3912
  enqueue([
3913
3913
  go$readdir,
3914
- [path5, options2, cb2],
3914
+ [path6, options2, cb2],
3915
3915
  err,
3916
3916
  startTime || Date.now(),
3917
3917
  Date.now()
@@ -3926,21 +3926,21 @@ var require_graceful_fs = __commonJS({
3926
3926
  }
3927
3927
  }
3928
3928
  if (process.version.substr(0, 4) === "v0.8") {
3929
- var legStreams = legacy(fs6);
3929
+ var legStreams = legacy(fs7);
3930
3930
  ReadStream = legStreams.ReadStream;
3931
3931
  WriteStream = legStreams.WriteStream;
3932
3932
  }
3933
- var fs$ReadStream = fs6.ReadStream;
3933
+ var fs$ReadStream = fs7.ReadStream;
3934
3934
  if (fs$ReadStream) {
3935
3935
  ReadStream.prototype = Object.create(fs$ReadStream.prototype);
3936
3936
  ReadStream.prototype.open = ReadStream$open;
3937
3937
  }
3938
- var fs$WriteStream = fs6.WriteStream;
3938
+ var fs$WriteStream = fs7.WriteStream;
3939
3939
  if (fs$WriteStream) {
3940
3940
  WriteStream.prototype = Object.create(fs$WriteStream.prototype);
3941
3941
  WriteStream.prototype.open = WriteStream$open;
3942
3942
  }
3943
- Object.defineProperty(fs6, "ReadStream", {
3943
+ Object.defineProperty(fs7, "ReadStream", {
3944
3944
  get: function() {
3945
3945
  return ReadStream;
3946
3946
  },
@@ -3950,7 +3950,7 @@ var require_graceful_fs = __commonJS({
3950
3950
  enumerable: true,
3951
3951
  configurable: true
3952
3952
  });
3953
- Object.defineProperty(fs6, "WriteStream", {
3953
+ Object.defineProperty(fs7, "WriteStream", {
3954
3954
  get: function() {
3955
3955
  return WriteStream;
3956
3956
  },
@@ -3961,7 +3961,7 @@ var require_graceful_fs = __commonJS({
3961
3961
  configurable: true
3962
3962
  });
3963
3963
  var FileReadStream = ReadStream;
3964
- Object.defineProperty(fs6, "FileReadStream", {
3964
+ Object.defineProperty(fs7, "FileReadStream", {
3965
3965
  get: function() {
3966
3966
  return FileReadStream;
3967
3967
  },
@@ -3972,7 +3972,7 @@ var require_graceful_fs = __commonJS({
3972
3972
  configurable: true
3973
3973
  });
3974
3974
  var FileWriteStream = WriteStream;
3975
- Object.defineProperty(fs6, "FileWriteStream", {
3975
+ Object.defineProperty(fs7, "FileWriteStream", {
3976
3976
  get: function() {
3977
3977
  return FileWriteStream;
3978
3978
  },
@@ -3982,7 +3982,7 @@ var require_graceful_fs = __commonJS({
3982
3982
  enumerable: true,
3983
3983
  configurable: true
3984
3984
  });
3985
- function ReadStream(path4, options) {
3985
+ function ReadStream(path5, options) {
3986
3986
  if (this instanceof ReadStream)
3987
3987
  return fs$ReadStream.apply(this, arguments), this;
3988
3988
  else
@@ -4002,7 +4002,7 @@ var require_graceful_fs = __commonJS({
4002
4002
  }
4003
4003
  });
4004
4004
  }
4005
- function WriteStream(path4, options) {
4005
+ function WriteStream(path5, options) {
4006
4006
  if (this instanceof WriteStream)
4007
4007
  return fs$WriteStream.apply(this, arguments), this;
4008
4008
  else
@@ -4020,22 +4020,22 @@ var require_graceful_fs = __commonJS({
4020
4020
  }
4021
4021
  });
4022
4022
  }
4023
- function createReadStream(path4, options) {
4024
- return new fs6.ReadStream(path4, options);
4023
+ function createReadStream(path5, options) {
4024
+ return new fs7.ReadStream(path5, options);
4025
4025
  }
4026
- function createWriteStream(path4, options) {
4027
- return new fs6.WriteStream(path4, options);
4026
+ function createWriteStream(path5, options) {
4027
+ return new fs7.WriteStream(path5, options);
4028
4028
  }
4029
- var fs$open = fs6.open;
4030
- fs6.open = open;
4031
- function open(path4, flags, mode, cb) {
4029
+ var fs$open = fs7.open;
4030
+ fs7.open = open;
4031
+ function open(path5, flags, mode, cb) {
4032
4032
  if (typeof mode === "function")
4033
4033
  cb = mode, mode = null;
4034
- return go$open(path4, flags, mode, cb);
4035
- function go$open(path5, flags2, mode2, cb2, startTime) {
4036
- return fs$open(path5, flags2, mode2, function(err, fd) {
4034
+ return go$open(path5, flags, mode, cb);
4035
+ function go$open(path6, flags2, mode2, cb2, startTime) {
4036
+ return fs$open(path6, flags2, mode2, function(err, fd) {
4037
4037
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
4038
- enqueue([go$open, [path5, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
4038
+ enqueue([go$open, [path6, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
4039
4039
  else {
4040
4040
  if (typeof cb2 === "function")
4041
4041
  cb2.apply(this, arguments);
@@ -4043,20 +4043,20 @@ var require_graceful_fs = __commonJS({
4043
4043
  });
4044
4044
  }
4045
4045
  }
4046
- return fs6;
4046
+ return fs7;
4047
4047
  }
4048
4048
  function enqueue(elem) {
4049
4049
  debug("ENQUEUE", elem[0].name, elem[1]);
4050
- fs5[gracefulQueue].push(elem);
4050
+ fs6[gracefulQueue].push(elem);
4051
4051
  retry();
4052
4052
  }
4053
4053
  var retryTimer;
4054
4054
  function resetQueue() {
4055
4055
  var now = Date.now();
4056
- for (var i = 0; i < fs5[gracefulQueue].length; ++i) {
4057
- if (fs5[gracefulQueue][i].length > 2) {
4058
- fs5[gracefulQueue][i][3] = now;
4059
- fs5[gracefulQueue][i][4] = now;
4056
+ for (var i = 0; i < fs6[gracefulQueue].length; ++i) {
4057
+ if (fs6[gracefulQueue][i].length > 2) {
4058
+ fs6[gracefulQueue][i][3] = now;
4059
+ fs6[gracefulQueue][i][4] = now;
4060
4060
  }
4061
4061
  }
4062
4062
  retry();
@@ -4064,9 +4064,9 @@ var require_graceful_fs = __commonJS({
4064
4064
  function retry() {
4065
4065
  clearTimeout(retryTimer);
4066
4066
  retryTimer = void 0;
4067
- if (fs5[gracefulQueue].length === 0)
4067
+ if (fs6[gracefulQueue].length === 0)
4068
4068
  return;
4069
- var elem = fs5[gracefulQueue].shift();
4069
+ var elem = fs6[gracefulQueue].shift();
4070
4070
  var fn = elem[0];
4071
4071
  var args = elem[1];
4072
4072
  var err = elem[2];
@@ -4088,7 +4088,7 @@ var require_graceful_fs = __commonJS({
4088
4088
  debug("RETRY", fn.name, args);
4089
4089
  fn.apply(null, args.concat([startTime]));
4090
4090
  } else {
4091
- fs5[gracefulQueue].push(elem);
4091
+ fs6[gracefulQueue].push(elem);
4092
4092
  }
4093
4093
  }
4094
4094
  if (retryTimer === void 0) {
@@ -4103,7 +4103,7 @@ var require_fs = __commonJS({
4103
4103
  "node_modules/fs-extra/lib/fs/index.js"(exports) {
4104
4104
  "use strict";
4105
4105
  var u = require_universalify().fromCallback;
4106
- var fs5 = require_graceful_fs();
4106
+ var fs6 = require_graceful_fs();
4107
4107
  var api = [
4108
4108
  "access",
4109
4109
  "appendFile",
@@ -4144,26 +4144,26 @@ var require_fs = __commonJS({
4144
4144
  "utimes",
4145
4145
  "writeFile"
4146
4146
  ].filter((key) => {
4147
- return typeof fs5[key] === "function";
4147
+ return typeof fs6[key] === "function";
4148
4148
  });
4149
- Object.assign(exports, fs5);
4149
+ Object.assign(exports, fs6);
4150
4150
  api.forEach((method) => {
4151
- exports[method] = u(fs5[method]);
4151
+ exports[method] = u(fs6[method]);
4152
4152
  });
4153
4153
  exports.exists = function(filename, callback) {
4154
4154
  if (typeof callback === "function") {
4155
- return fs5.exists(filename, callback);
4155
+ return fs6.exists(filename, callback);
4156
4156
  }
4157
4157
  return new Promise((resolve) => {
4158
- return fs5.exists(filename, resolve);
4158
+ return fs6.exists(filename, resolve);
4159
4159
  });
4160
4160
  };
4161
4161
  exports.read = function(fd, buffer, offset, length, position, callback) {
4162
4162
  if (typeof callback === "function") {
4163
- return fs5.read(fd, buffer, offset, length, position, callback);
4163
+ return fs6.read(fd, buffer, offset, length, position, callback);
4164
4164
  }
4165
4165
  return new Promise((resolve, reject) => {
4166
- fs5.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
4166
+ fs6.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
4167
4167
  if (err) return reject(err);
4168
4168
  resolve({ bytesRead, buffer: buffer2 });
4169
4169
  });
@@ -4171,10 +4171,10 @@ var require_fs = __commonJS({
4171
4171
  };
4172
4172
  exports.write = function(fd, buffer, ...args) {
4173
4173
  if (typeof args[args.length - 1] === "function") {
4174
- return fs5.write(fd, buffer, ...args);
4174
+ return fs6.write(fd, buffer, ...args);
4175
4175
  }
4176
4176
  return new Promise((resolve, reject) => {
4177
- fs5.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
4177
+ fs6.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
4178
4178
  if (err) return reject(err);
4179
4179
  resolve({ bytesWritten, buffer: buffer2 });
4180
4180
  });
@@ -4182,10 +4182,10 @@ var require_fs = __commonJS({
4182
4182
  };
4183
4183
  exports.readv = function(fd, buffers, ...args) {
4184
4184
  if (typeof args[args.length - 1] === "function") {
4185
- return fs5.readv(fd, buffers, ...args);
4185
+ return fs6.readv(fd, buffers, ...args);
4186
4186
  }
4187
4187
  return new Promise((resolve, reject) => {
4188
- fs5.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
4188
+ fs6.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
4189
4189
  if (err) return reject(err);
4190
4190
  resolve({ bytesRead, buffers: buffers2 });
4191
4191
  });
@@ -4193,17 +4193,17 @@ var require_fs = __commonJS({
4193
4193
  };
4194
4194
  exports.writev = function(fd, buffers, ...args) {
4195
4195
  if (typeof args[args.length - 1] === "function") {
4196
- return fs5.writev(fd, buffers, ...args);
4196
+ return fs6.writev(fd, buffers, ...args);
4197
4197
  }
4198
4198
  return new Promise((resolve, reject) => {
4199
- fs5.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
4199
+ fs6.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
4200
4200
  if (err) return reject(err);
4201
4201
  resolve({ bytesWritten, buffers: buffers2 });
4202
4202
  });
4203
4203
  });
4204
4204
  };
4205
- if (typeof fs5.realpath.native === "function") {
4206
- exports.realpath.native = u(fs5.realpath.native);
4205
+ if (typeof fs6.realpath.native === "function") {
4206
+ exports.realpath.native = u(fs6.realpath.native);
4207
4207
  } else {
4208
4208
  process.emitWarning(
4209
4209
  "fs.realpath.native is not a function. Is fs being monkey-patched?",
@@ -4218,10 +4218,10 @@ var require_fs = __commonJS({
4218
4218
  var require_utils = __commonJS({
4219
4219
  "node_modules/fs-extra/lib/mkdirs/utils.js"(exports, module) {
4220
4220
  "use strict";
4221
- var path4 = __require("path");
4221
+ var path5 = __require("path");
4222
4222
  module.exports.checkPath = function checkPath(pth) {
4223
4223
  if (process.platform === "win32") {
4224
- const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path4.parse(pth).root, ""));
4224
+ const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path5.parse(pth).root, ""));
4225
4225
  if (pathHasInvalidWinCharacters) {
4226
4226
  const error = new Error(`Path contains invalid characters: ${pth}`);
4227
4227
  error.code = "EINVAL";
@@ -4236,7 +4236,7 @@ var require_utils = __commonJS({
4236
4236
  var require_make_dir = __commonJS({
4237
4237
  "node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports, module) {
4238
4238
  "use strict";
4239
- var fs5 = require_fs();
4239
+ var fs6 = require_fs();
4240
4240
  var { checkPath } = require_utils();
4241
4241
  var getMode = (options) => {
4242
4242
  const defaults = { mode: 511 };
@@ -4245,14 +4245,14 @@ var require_make_dir = __commonJS({
4245
4245
  };
4246
4246
  module.exports.makeDir = async (dir, options) => {
4247
4247
  checkPath(dir);
4248
- return fs5.mkdir(dir, {
4248
+ return fs6.mkdir(dir, {
4249
4249
  mode: getMode(options),
4250
4250
  recursive: true
4251
4251
  });
4252
4252
  };
4253
4253
  module.exports.makeDirSync = (dir, options) => {
4254
4254
  checkPath(dir);
4255
- return fs5.mkdirSync(dir, {
4255
+ return fs6.mkdirSync(dir, {
4256
4256
  mode: getMode(options),
4257
4257
  recursive: true
4258
4258
  });
@@ -4284,13 +4284,13 @@ var require_path_exists = __commonJS({
4284
4284
  "node_modules/fs-extra/lib/path-exists/index.js"(exports, module) {
4285
4285
  "use strict";
4286
4286
  var u = require_universalify().fromPromise;
4287
- var fs5 = require_fs();
4288
- function pathExists(path4) {
4289
- return fs5.access(path4).then(() => true).catch(() => false);
4287
+ var fs6 = require_fs();
4288
+ function pathExists(path5) {
4289
+ return fs6.access(path5).then(() => true).catch(() => false);
4290
4290
  }
4291
4291
  module.exports = {
4292
4292
  pathExists: u(pathExists),
4293
- pathExistsSync: fs5.existsSync
4293
+ pathExistsSync: fs6.existsSync
4294
4294
  };
4295
4295
  }
4296
4296
  });
@@ -4299,16 +4299,16 @@ var require_path_exists = __commonJS({
4299
4299
  var require_utimes = __commonJS({
4300
4300
  "node_modules/fs-extra/lib/util/utimes.js"(exports, module) {
4301
4301
  "use strict";
4302
- var fs5 = require_fs();
4302
+ var fs6 = require_fs();
4303
4303
  var u = require_universalify().fromPromise;
4304
- async function utimesMillis(path4, atime, mtime) {
4305
- const fd = await fs5.open(path4, "r+");
4304
+ async function utimesMillis(path5, atime, mtime) {
4305
+ const fd = await fs6.open(path5, "r+");
4306
4306
  let closeErr = null;
4307
4307
  try {
4308
- await fs5.futimes(fd, atime, mtime);
4308
+ await fs6.futimes(fd, atime, mtime);
4309
4309
  } finally {
4310
4310
  try {
4311
- await fs5.close(fd);
4311
+ await fs6.close(fd);
4312
4312
  } catch (e) {
4313
4313
  closeErr = e;
4314
4314
  }
@@ -4317,10 +4317,10 @@ var require_utimes = __commonJS({
4317
4317
  throw closeErr;
4318
4318
  }
4319
4319
  }
4320
- function utimesMillisSync(path4, atime, mtime) {
4321
- const fd = fs5.openSync(path4, "r+");
4322
- fs5.futimesSync(fd, atime, mtime);
4323
- return fs5.closeSync(fd);
4320
+ function utimesMillisSync(path5, atime, mtime) {
4321
+ const fd = fs6.openSync(path5, "r+");
4322
+ fs6.futimesSync(fd, atime, mtime);
4323
+ return fs6.closeSync(fd);
4324
4324
  }
4325
4325
  module.exports = {
4326
4326
  utimesMillis: u(utimesMillis),
@@ -4333,11 +4333,11 @@ var require_utimes = __commonJS({
4333
4333
  var require_stat = __commonJS({
4334
4334
  "node_modules/fs-extra/lib/util/stat.js"(exports, module) {
4335
4335
  "use strict";
4336
- var fs5 = require_fs();
4337
- var path4 = __require("path");
4336
+ var fs6 = require_fs();
4337
+ var path5 = __require("path");
4338
4338
  var u = require_universalify().fromPromise;
4339
4339
  function getStats(src, dest, opts) {
4340
- const statFunc = opts.dereference ? (file) => fs5.stat(file, { bigint: true }) : (file) => fs5.lstat(file, { bigint: true });
4340
+ const statFunc = opts.dereference ? (file) => fs6.stat(file, { bigint: true }) : (file) => fs6.lstat(file, { bigint: true });
4341
4341
  return Promise.all([
4342
4342
  statFunc(src),
4343
4343
  statFunc(dest).catch((err) => {
@@ -4348,7 +4348,7 @@ var require_stat = __commonJS({
4348
4348
  }
4349
4349
  function getStatsSync(src, dest, opts) {
4350
4350
  let destStat;
4351
- const statFunc = opts.dereference ? (file) => fs5.statSync(file, { bigint: true }) : (file) => fs5.lstatSync(file, { bigint: true });
4351
+ const statFunc = opts.dereference ? (file) => fs6.statSync(file, { bigint: true }) : (file) => fs6.lstatSync(file, { bigint: true });
4352
4352
  const srcStat = statFunc(src);
4353
4353
  try {
4354
4354
  destStat = statFunc(dest);
@@ -4362,8 +4362,8 @@ var require_stat = __commonJS({
4362
4362
  const { srcStat, destStat } = await getStats(src, dest, opts);
4363
4363
  if (destStat) {
4364
4364
  if (areIdentical(srcStat, destStat)) {
4365
- const srcBaseName = path4.basename(src);
4366
- const destBaseName = path4.basename(dest);
4365
+ const srcBaseName = path5.basename(src);
4366
+ const destBaseName = path5.basename(dest);
4367
4367
  if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
4368
4368
  return { srcStat, destStat, isChangingCase: true };
4369
4369
  }
@@ -4385,8 +4385,8 @@ var require_stat = __commonJS({
4385
4385
  const { srcStat, destStat } = getStatsSync(src, dest, opts);
4386
4386
  if (destStat) {
4387
4387
  if (areIdentical(srcStat, destStat)) {
4388
- const srcBaseName = path4.basename(src);
4389
- const destBaseName = path4.basename(dest);
4388
+ const srcBaseName = path5.basename(src);
4389
+ const destBaseName = path5.basename(dest);
4390
4390
  if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
4391
4391
  return { srcStat, destStat, isChangingCase: true };
4392
4392
  }
@@ -4405,12 +4405,12 @@ var require_stat = __commonJS({
4405
4405
  return { srcStat, destStat };
4406
4406
  }
4407
4407
  async function checkParentPaths(src, srcStat, dest, funcName) {
4408
- const srcParent = path4.resolve(path4.dirname(src));
4409
- const destParent = path4.resolve(path4.dirname(dest));
4410
- if (destParent === srcParent || destParent === path4.parse(destParent).root) return;
4408
+ const srcParent = path5.resolve(path5.dirname(src));
4409
+ const destParent = path5.resolve(path5.dirname(dest));
4410
+ if (destParent === srcParent || destParent === path5.parse(destParent).root) return;
4411
4411
  let destStat;
4412
4412
  try {
4413
- destStat = await fs5.stat(destParent, { bigint: true });
4413
+ destStat = await fs6.stat(destParent, { bigint: true });
4414
4414
  } catch (err) {
4415
4415
  if (err.code === "ENOENT") return;
4416
4416
  throw err;
@@ -4421,12 +4421,12 @@ var require_stat = __commonJS({
4421
4421
  return checkParentPaths(src, srcStat, destParent, funcName);
4422
4422
  }
4423
4423
  function checkParentPathsSync(src, srcStat, dest, funcName) {
4424
- const srcParent = path4.resolve(path4.dirname(src));
4425
- const destParent = path4.resolve(path4.dirname(dest));
4426
- if (destParent === srcParent || destParent === path4.parse(destParent).root) return;
4424
+ const srcParent = path5.resolve(path5.dirname(src));
4425
+ const destParent = path5.resolve(path5.dirname(dest));
4426
+ if (destParent === srcParent || destParent === path5.parse(destParent).root) return;
4427
4427
  let destStat;
4428
4428
  try {
4429
- destStat = fs5.statSync(destParent, { bigint: true });
4429
+ destStat = fs6.statSync(destParent, { bigint: true });
4430
4430
  } catch (err) {
4431
4431
  if (err.code === "ENOENT") return;
4432
4432
  throw err;
@@ -4440,8 +4440,8 @@ var require_stat = __commonJS({
4440
4440
  return destStat.ino !== void 0 && destStat.dev !== void 0 && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
4441
4441
  }
4442
4442
  function isSrcSubdir(src, dest) {
4443
- const srcArr = path4.resolve(src).split(path4.sep).filter((i) => i);
4444
- const destArr = path4.resolve(dest).split(path4.sep).filter((i) => i);
4443
+ const srcArr = path5.resolve(src).split(path5.sep).filter((i) => i);
4444
+ const destArr = path5.resolve(dest).split(path5.sep).filter((i) => i);
4445
4445
  return srcArr.every((cur, i) => destArr[i] === cur);
4446
4446
  }
4447
4447
  function errMsg(src, dest, funcName) {
@@ -4493,8 +4493,8 @@ var require_async = __commonJS({
4493
4493
  var require_copy = __commonJS({
4494
4494
  "node_modules/fs-extra/lib/copy/copy.js"(exports, module) {
4495
4495
  "use strict";
4496
- var fs5 = require_fs();
4497
- var path4 = __require("path");
4496
+ var fs6 = require_fs();
4497
+ var path5 = __require("path");
4498
4498
  var { mkdirs } = require_mkdirs();
4499
4499
  var { pathExists } = require_path_exists();
4500
4500
  var { utimesMillis } = require_utimes();
@@ -4517,7 +4517,7 @@ var require_copy = __commonJS({
4517
4517
  await stat.checkParentPaths(src, srcStat, dest, "copy");
4518
4518
  const include = await runFilter(src, dest, opts);
4519
4519
  if (!include) return;
4520
- const destParent = path4.dirname(dest);
4520
+ const destParent = path5.dirname(dest);
4521
4521
  const dirExists = await pathExists(destParent);
4522
4522
  if (!dirExists) {
4523
4523
  await mkdirs(destParent);
@@ -4529,7 +4529,7 @@ var require_copy = __commonJS({
4529
4529
  return opts.filter(src, dest);
4530
4530
  }
4531
4531
  async function getStatsAndPerformCopy(destStat, src, dest, opts) {
4532
- const statFn = opts.dereference ? fs5.stat : fs5.lstat;
4532
+ const statFn = opts.dereference ? fs6.stat : fs6.lstat;
4533
4533
  const srcStat = await statFn(src);
4534
4534
  if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
4535
4535
  if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
@@ -4541,7 +4541,7 @@ var require_copy = __commonJS({
4541
4541
  async function onFile(srcStat, destStat, src, dest, opts) {
4542
4542
  if (!destStat) return copyFile(srcStat, src, dest, opts);
4543
4543
  if (opts.overwrite) {
4544
- await fs5.unlink(dest);
4544
+ await fs6.unlink(dest);
4545
4545
  return copyFile(srcStat, src, dest, opts);
4546
4546
  }
4547
4547
  if (opts.errorOnExist) {
@@ -4549,29 +4549,29 @@ var require_copy = __commonJS({
4549
4549
  }
4550
4550
  }
4551
4551
  async function copyFile(srcStat, src, dest, opts) {
4552
- await fs5.copyFile(src, dest);
4552
+ await fs6.copyFile(src, dest);
4553
4553
  if (opts.preserveTimestamps) {
4554
4554
  if (fileIsNotWritable(srcStat.mode)) {
4555
4555
  await makeFileWritable(dest, srcStat.mode);
4556
4556
  }
4557
- const updatedSrcStat = await fs5.stat(src);
4557
+ const updatedSrcStat = await fs6.stat(src);
4558
4558
  await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
4559
4559
  }
4560
- return fs5.chmod(dest, srcStat.mode);
4560
+ return fs6.chmod(dest, srcStat.mode);
4561
4561
  }
4562
4562
  function fileIsNotWritable(srcMode) {
4563
4563
  return (srcMode & 128) === 0;
4564
4564
  }
4565
4565
  function makeFileWritable(dest, srcMode) {
4566
- return fs5.chmod(dest, srcMode | 128);
4566
+ return fs6.chmod(dest, srcMode | 128);
4567
4567
  }
4568
4568
  async function onDir(srcStat, destStat, src, dest, opts) {
4569
4569
  if (!destStat) {
4570
- await fs5.mkdir(dest);
4570
+ await fs6.mkdir(dest);
4571
4571
  }
4572
- await asyncIteratorConcurrentProcess(await fs5.opendir(src), async (item) => {
4573
- const srcItem = path4.join(src, item.name);
4574
- const destItem = path4.join(dest, item.name);
4572
+ await asyncIteratorConcurrentProcess(await fs6.opendir(src), async (item) => {
4573
+ const srcItem = path5.join(src, item.name);
4574
+ const destItem = path5.join(dest, item.name);
4575
4575
  const include = await runFilter(srcItem, destItem, opts);
4576
4576
  if (include) {
4577
4577
  const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts);
@@ -4579,26 +4579,26 @@ var require_copy = __commonJS({
4579
4579
  }
4580
4580
  });
4581
4581
  if (!destStat) {
4582
- await fs5.chmod(dest, srcStat.mode);
4582
+ await fs6.chmod(dest, srcStat.mode);
4583
4583
  }
4584
4584
  }
4585
4585
  async function onLink(destStat, src, dest, opts) {
4586
- let resolvedSrc = await fs5.readlink(src);
4586
+ let resolvedSrc = await fs6.readlink(src);
4587
4587
  if (opts.dereference) {
4588
- resolvedSrc = path4.resolve(process.cwd(), resolvedSrc);
4588
+ resolvedSrc = path5.resolve(process.cwd(), resolvedSrc);
4589
4589
  }
4590
4590
  if (!destStat) {
4591
- return fs5.symlink(resolvedSrc, dest);
4591
+ return fs6.symlink(resolvedSrc, dest);
4592
4592
  }
4593
4593
  let resolvedDest = null;
4594
4594
  try {
4595
- resolvedDest = await fs5.readlink(dest);
4595
+ resolvedDest = await fs6.readlink(dest);
4596
4596
  } catch (e) {
4597
- if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs5.symlink(resolvedSrc, dest);
4597
+ if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs6.symlink(resolvedSrc, dest);
4598
4598
  throw e;
4599
4599
  }
4600
4600
  if (opts.dereference) {
4601
- resolvedDest = path4.resolve(process.cwd(), resolvedDest);
4601
+ resolvedDest = path5.resolve(process.cwd(), resolvedDest);
4602
4602
  }
4603
4603
  if (resolvedSrc !== resolvedDest) {
4604
4604
  if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
@@ -4608,8 +4608,8 @@ var require_copy = __commonJS({
4608
4608
  throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
4609
4609
  }
4610
4610
  }
4611
- await fs5.unlink(dest);
4612
- return fs5.symlink(resolvedSrc, dest);
4611
+ await fs6.unlink(dest);
4612
+ return fs6.symlink(resolvedSrc, dest);
4613
4613
  }
4614
4614
  module.exports = copy;
4615
4615
  }
@@ -4619,8 +4619,8 @@ var require_copy = __commonJS({
4619
4619
  var require_copy_sync = __commonJS({
4620
4620
  "node_modules/fs-extra/lib/copy/copy-sync.js"(exports, module) {
4621
4621
  "use strict";
4622
- var fs5 = require_graceful_fs();
4623
- var path4 = __require("path");
4622
+ var fs6 = require_graceful_fs();
4623
+ var path5 = __require("path");
4624
4624
  var mkdirsSync = require_mkdirs().mkdirsSync;
4625
4625
  var utimesMillisSync = require_utimes().utimesMillisSync;
4626
4626
  var stat = require_stat();
@@ -4641,12 +4641,12 @@ var require_copy_sync = __commonJS({
4641
4641
  const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
4642
4642
  stat.checkParentPathsSync(src, srcStat, dest, "copy");
4643
4643
  if (opts.filter && !opts.filter(src, dest)) return;
4644
- const destParent = path4.dirname(dest);
4645
- if (!fs5.existsSync(destParent)) mkdirsSync(destParent);
4644
+ const destParent = path5.dirname(dest);
4645
+ if (!fs6.existsSync(destParent)) mkdirsSync(destParent);
4646
4646
  return getStats(destStat, src, dest, opts);
4647
4647
  }
4648
4648
  function getStats(destStat, src, dest, opts) {
4649
- const statSync = opts.dereference ? fs5.statSync : fs5.lstatSync;
4649
+ const statSync = opts.dereference ? fs6.statSync : fs6.lstatSync;
4650
4650
  const srcStat = statSync(src);
4651
4651
  if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
4652
4652
  else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
@@ -4661,14 +4661,14 @@ var require_copy_sync = __commonJS({
4661
4661
  }
4662
4662
  function mayCopyFile(srcStat, src, dest, opts) {
4663
4663
  if (opts.overwrite) {
4664
- fs5.unlinkSync(dest);
4664
+ fs6.unlinkSync(dest);
4665
4665
  return copyFile(srcStat, src, dest, opts);
4666
4666
  } else if (opts.errorOnExist) {
4667
4667
  throw new Error(`'${dest}' already exists`);
4668
4668
  }
4669
4669
  }
4670
4670
  function copyFile(srcStat, src, dest, opts) {
4671
- fs5.copyFileSync(src, dest);
4671
+ fs6.copyFileSync(src, dest);
4672
4672
  if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
4673
4673
  return setDestMode(dest, srcStat.mode);
4674
4674
  }
@@ -4683,10 +4683,10 @@ var require_copy_sync = __commonJS({
4683
4683
  return setDestMode(dest, srcMode | 128);
4684
4684
  }
4685
4685
  function setDestMode(dest, srcMode) {
4686
- return fs5.chmodSync(dest, srcMode);
4686
+ return fs6.chmodSync(dest, srcMode);
4687
4687
  }
4688
4688
  function setDestTimestamps(src, dest) {
4689
- const updatedSrcStat = fs5.statSync(src);
4689
+ const updatedSrcStat = fs6.statSync(src);
4690
4690
  return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
4691
4691
  }
4692
4692
  function onDir(srcStat, destStat, src, dest, opts) {
@@ -4694,12 +4694,12 @@ var require_copy_sync = __commonJS({
4694
4694
  return copyDir(src, dest, opts);
4695
4695
  }
4696
4696
  function mkDirAndCopy(srcMode, src, dest, opts) {
4697
- fs5.mkdirSync(dest);
4697
+ fs6.mkdirSync(dest);
4698
4698
  copyDir(src, dest, opts);
4699
4699
  return setDestMode(dest, srcMode);
4700
4700
  }
4701
4701
  function copyDir(src, dest, opts) {
4702
- const dir = fs5.opendirSync(src);
4702
+ const dir = fs6.opendirSync(src);
4703
4703
  try {
4704
4704
  let dirent;
4705
4705
  while ((dirent = dir.readSync()) !== null) {
@@ -4710,29 +4710,29 @@ var require_copy_sync = __commonJS({
4710
4710
  }
4711
4711
  }
4712
4712
  function copyDirItem(item, src, dest, opts) {
4713
- const srcItem = path4.join(src, item);
4714
- const destItem = path4.join(dest, item);
4713
+ const srcItem = path5.join(src, item);
4714
+ const destItem = path5.join(dest, item);
4715
4715
  if (opts.filter && !opts.filter(srcItem, destItem)) return;
4716
4716
  const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
4717
4717
  return getStats(destStat, srcItem, destItem, opts);
4718
4718
  }
4719
4719
  function onLink(destStat, src, dest, opts) {
4720
- let resolvedSrc = fs5.readlinkSync(src);
4720
+ let resolvedSrc = fs6.readlinkSync(src);
4721
4721
  if (opts.dereference) {
4722
- resolvedSrc = path4.resolve(process.cwd(), resolvedSrc);
4722
+ resolvedSrc = path5.resolve(process.cwd(), resolvedSrc);
4723
4723
  }
4724
4724
  if (!destStat) {
4725
- return fs5.symlinkSync(resolvedSrc, dest);
4725
+ return fs6.symlinkSync(resolvedSrc, dest);
4726
4726
  } else {
4727
4727
  let resolvedDest;
4728
4728
  try {
4729
- resolvedDest = fs5.readlinkSync(dest);
4729
+ resolvedDest = fs6.readlinkSync(dest);
4730
4730
  } catch (err) {
4731
- if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs5.symlinkSync(resolvedSrc, dest);
4731
+ if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs6.symlinkSync(resolvedSrc, dest);
4732
4732
  throw err;
4733
4733
  }
4734
4734
  if (opts.dereference) {
4735
- resolvedDest = path4.resolve(process.cwd(), resolvedDest);
4735
+ resolvedDest = path5.resolve(process.cwd(), resolvedDest);
4736
4736
  }
4737
4737
  if (resolvedSrc !== resolvedDest) {
4738
4738
  if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
@@ -4746,8 +4746,8 @@ var require_copy_sync = __commonJS({
4746
4746
  }
4747
4747
  }
4748
4748
  function copyLink(resolvedSrc, dest) {
4749
- fs5.unlinkSync(dest);
4750
- return fs5.symlinkSync(resolvedSrc, dest);
4749
+ fs6.unlinkSync(dest);
4750
+ return fs6.symlinkSync(resolvedSrc, dest);
4751
4751
  }
4752
4752
  module.exports = copySync;
4753
4753
  }
@@ -4769,13 +4769,13 @@ var require_copy2 = __commonJS({
4769
4769
  var require_remove = __commonJS({
4770
4770
  "node_modules/fs-extra/lib/remove/index.js"(exports, module) {
4771
4771
  "use strict";
4772
- var fs5 = require_graceful_fs();
4772
+ var fs6 = require_graceful_fs();
4773
4773
  var u = require_universalify().fromCallback;
4774
- function remove(path4, callback) {
4775
- fs5.rm(path4, { recursive: true, force: true }, callback);
4774
+ function remove(path5, callback) {
4775
+ fs6.rm(path5, { recursive: true, force: true }, callback);
4776
4776
  }
4777
- function removeSync(path4) {
4778
- fs5.rmSync(path4, { recursive: true, force: true });
4777
+ function removeSync(path5) {
4778
+ fs6.rmSync(path5, { recursive: true, force: true });
4779
4779
  }
4780
4780
  module.exports = {
4781
4781
  remove: u(remove),
@@ -4789,28 +4789,28 @@ var require_empty = __commonJS({
4789
4789
  "node_modules/fs-extra/lib/empty/index.js"(exports, module) {
4790
4790
  "use strict";
4791
4791
  var u = require_universalify().fromPromise;
4792
- var fs5 = require_fs();
4793
- var path4 = __require("path");
4792
+ var fs6 = require_fs();
4793
+ var path5 = __require("path");
4794
4794
  var mkdir = require_mkdirs();
4795
4795
  var remove = require_remove();
4796
4796
  var emptyDir = u(async function emptyDir2(dir) {
4797
4797
  let items;
4798
4798
  try {
4799
- items = await fs5.readdir(dir);
4799
+ items = await fs6.readdir(dir);
4800
4800
  } catch {
4801
4801
  return mkdir.mkdirs(dir);
4802
4802
  }
4803
- return Promise.all(items.map((item) => remove.remove(path4.join(dir, item))));
4803
+ return Promise.all(items.map((item) => remove.remove(path5.join(dir, item))));
4804
4804
  });
4805
4805
  function emptyDirSync(dir) {
4806
4806
  let items;
4807
4807
  try {
4808
- items = fs5.readdirSync(dir);
4808
+ items = fs6.readdirSync(dir);
4809
4809
  } catch {
4810
4810
  return mkdir.mkdirsSync(dir);
4811
4811
  }
4812
4812
  items.forEach((item) => {
4813
- item = path4.join(dir, item);
4813
+ item = path5.join(dir, item);
4814
4814
  remove.removeSync(item);
4815
4815
  });
4816
4816
  }
@@ -4828,52 +4828,52 @@ var require_file = __commonJS({
4828
4828
  "node_modules/fs-extra/lib/ensure/file.js"(exports, module) {
4829
4829
  "use strict";
4830
4830
  var u = require_universalify().fromPromise;
4831
- var path4 = __require("path");
4832
- var fs5 = require_fs();
4831
+ var path5 = __require("path");
4832
+ var fs6 = require_fs();
4833
4833
  var mkdir = require_mkdirs();
4834
4834
  async function createFile(file) {
4835
4835
  let stats;
4836
4836
  try {
4837
- stats = await fs5.stat(file);
4837
+ stats = await fs6.stat(file);
4838
4838
  } catch {
4839
4839
  }
4840
4840
  if (stats && stats.isFile()) return;
4841
- const dir = path4.dirname(file);
4841
+ const dir = path5.dirname(file);
4842
4842
  let dirStats = null;
4843
4843
  try {
4844
- dirStats = await fs5.stat(dir);
4844
+ dirStats = await fs6.stat(dir);
4845
4845
  } catch (err) {
4846
4846
  if (err.code === "ENOENT") {
4847
4847
  await mkdir.mkdirs(dir);
4848
- await fs5.writeFile(file, "");
4848
+ await fs6.writeFile(file, "");
4849
4849
  return;
4850
4850
  } else {
4851
4851
  throw err;
4852
4852
  }
4853
4853
  }
4854
4854
  if (dirStats.isDirectory()) {
4855
- await fs5.writeFile(file, "");
4855
+ await fs6.writeFile(file, "");
4856
4856
  } else {
4857
- await fs5.readdir(dir);
4857
+ await fs6.readdir(dir);
4858
4858
  }
4859
4859
  }
4860
4860
  function createFileSync(file) {
4861
4861
  let stats;
4862
4862
  try {
4863
- stats = fs5.statSync(file);
4863
+ stats = fs6.statSync(file);
4864
4864
  } catch {
4865
4865
  }
4866
4866
  if (stats && stats.isFile()) return;
4867
- const dir = path4.dirname(file);
4867
+ const dir = path5.dirname(file);
4868
4868
  try {
4869
- if (!fs5.statSync(dir).isDirectory()) {
4870
- fs5.readdirSync(dir);
4869
+ if (!fs6.statSync(dir).isDirectory()) {
4870
+ fs6.readdirSync(dir);
4871
4871
  }
4872
4872
  } catch (err) {
4873
4873
  if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
4874
4874
  else throw err;
4875
4875
  }
4876
- fs5.writeFileSync(file, "");
4876
+ fs6.writeFileSync(file, "");
4877
4877
  }
4878
4878
  module.exports = {
4879
4879
  createFile: u(createFile),
@@ -4887,50 +4887,50 @@ var require_link = __commonJS({
4887
4887
  "node_modules/fs-extra/lib/ensure/link.js"(exports, module) {
4888
4888
  "use strict";
4889
4889
  var u = require_universalify().fromPromise;
4890
- var path4 = __require("path");
4891
- var fs5 = require_fs();
4890
+ var path5 = __require("path");
4891
+ var fs6 = require_fs();
4892
4892
  var mkdir = require_mkdirs();
4893
4893
  var { pathExists } = require_path_exists();
4894
4894
  var { areIdentical } = require_stat();
4895
4895
  async function createLink(srcpath, dstpath) {
4896
4896
  let dstStat;
4897
4897
  try {
4898
- dstStat = await fs5.lstat(dstpath);
4898
+ dstStat = await fs6.lstat(dstpath);
4899
4899
  } catch {
4900
4900
  }
4901
4901
  let srcStat;
4902
4902
  try {
4903
- srcStat = await fs5.lstat(srcpath);
4903
+ srcStat = await fs6.lstat(srcpath);
4904
4904
  } catch (err) {
4905
4905
  err.message = err.message.replace("lstat", "ensureLink");
4906
4906
  throw err;
4907
4907
  }
4908
4908
  if (dstStat && areIdentical(srcStat, dstStat)) return;
4909
- const dir = path4.dirname(dstpath);
4909
+ const dir = path5.dirname(dstpath);
4910
4910
  const dirExists = await pathExists(dir);
4911
4911
  if (!dirExists) {
4912
4912
  await mkdir.mkdirs(dir);
4913
4913
  }
4914
- await fs5.link(srcpath, dstpath);
4914
+ await fs6.link(srcpath, dstpath);
4915
4915
  }
4916
4916
  function createLinkSync(srcpath, dstpath) {
4917
4917
  let dstStat;
4918
4918
  try {
4919
- dstStat = fs5.lstatSync(dstpath);
4919
+ dstStat = fs6.lstatSync(dstpath);
4920
4920
  } catch {
4921
4921
  }
4922
4922
  try {
4923
- const srcStat = fs5.lstatSync(srcpath);
4923
+ const srcStat = fs6.lstatSync(srcpath);
4924
4924
  if (dstStat && areIdentical(srcStat, dstStat)) return;
4925
4925
  } catch (err) {
4926
4926
  err.message = err.message.replace("lstat", "ensureLink");
4927
4927
  throw err;
4928
4928
  }
4929
- const dir = path4.dirname(dstpath);
4930
- const dirExists = fs5.existsSync(dir);
4931
- if (dirExists) return fs5.linkSync(srcpath, dstpath);
4929
+ const dir = path5.dirname(dstpath);
4930
+ const dirExists = fs6.existsSync(dir);
4931
+ if (dirExists) return fs6.linkSync(srcpath, dstpath);
4932
4932
  mkdir.mkdirsSync(dir);
4933
- return fs5.linkSync(srcpath, dstpath);
4933
+ return fs6.linkSync(srcpath, dstpath);
4934
4934
  }
4935
4935
  module.exports = {
4936
4936
  createLink: u(createLink),
@@ -4943,14 +4943,14 @@ var require_link = __commonJS({
4943
4943
  var require_symlink_paths = __commonJS({
4944
4944
  "node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports, module) {
4945
4945
  "use strict";
4946
- var path4 = __require("path");
4947
- var fs5 = require_fs();
4946
+ var path5 = __require("path");
4947
+ var fs6 = require_fs();
4948
4948
  var { pathExists } = require_path_exists();
4949
4949
  var u = require_universalify().fromPromise;
4950
4950
  async function symlinkPaths(srcpath, dstpath) {
4951
- if (path4.isAbsolute(srcpath)) {
4951
+ if (path5.isAbsolute(srcpath)) {
4952
4952
  try {
4953
- await fs5.lstat(srcpath);
4953
+ await fs6.lstat(srcpath);
4954
4954
  } catch (err) {
4955
4955
  err.message = err.message.replace("lstat", "ensureSymlink");
4956
4956
  throw err;
@@ -4960,8 +4960,8 @@ var require_symlink_paths = __commonJS({
4960
4960
  toDst: srcpath
4961
4961
  };
4962
4962
  }
4963
- const dstdir = path4.dirname(dstpath);
4964
- const relativeToDst = path4.join(dstdir, srcpath);
4963
+ const dstdir = path5.dirname(dstpath);
4964
+ const relativeToDst = path5.join(dstdir, srcpath);
4965
4965
  const exists = await pathExists(relativeToDst);
4966
4966
  if (exists) {
4967
4967
  return {
@@ -4970,39 +4970,39 @@ var require_symlink_paths = __commonJS({
4970
4970
  };
4971
4971
  }
4972
4972
  try {
4973
- await fs5.lstat(srcpath);
4973
+ await fs6.lstat(srcpath);
4974
4974
  } catch (err) {
4975
4975
  err.message = err.message.replace("lstat", "ensureSymlink");
4976
4976
  throw err;
4977
4977
  }
4978
4978
  return {
4979
4979
  toCwd: srcpath,
4980
- toDst: path4.relative(dstdir, srcpath)
4980
+ toDst: path5.relative(dstdir, srcpath)
4981
4981
  };
4982
4982
  }
4983
4983
  function symlinkPathsSync(srcpath, dstpath) {
4984
- if (path4.isAbsolute(srcpath)) {
4985
- const exists2 = fs5.existsSync(srcpath);
4984
+ if (path5.isAbsolute(srcpath)) {
4985
+ const exists2 = fs6.existsSync(srcpath);
4986
4986
  if (!exists2) throw new Error("absolute srcpath does not exist");
4987
4987
  return {
4988
4988
  toCwd: srcpath,
4989
4989
  toDst: srcpath
4990
4990
  };
4991
4991
  }
4992
- const dstdir = path4.dirname(dstpath);
4993
- const relativeToDst = path4.join(dstdir, srcpath);
4994
- const exists = fs5.existsSync(relativeToDst);
4992
+ const dstdir = path5.dirname(dstpath);
4993
+ const relativeToDst = path5.join(dstdir, srcpath);
4994
+ const exists = fs6.existsSync(relativeToDst);
4995
4995
  if (exists) {
4996
4996
  return {
4997
4997
  toCwd: relativeToDst,
4998
4998
  toDst: srcpath
4999
4999
  };
5000
5000
  }
5001
- const srcExists = fs5.existsSync(srcpath);
5001
+ const srcExists = fs6.existsSync(srcpath);
5002
5002
  if (!srcExists) throw new Error("relative srcpath does not exist");
5003
5003
  return {
5004
5004
  toCwd: srcpath,
5005
- toDst: path4.relative(dstdir, srcpath)
5005
+ toDst: path5.relative(dstdir, srcpath)
5006
5006
  };
5007
5007
  }
5008
5008
  module.exports = {
@@ -5016,13 +5016,13 @@ var require_symlink_paths = __commonJS({
5016
5016
  var require_symlink_type = __commonJS({
5017
5017
  "node_modules/fs-extra/lib/ensure/symlink-type.js"(exports, module) {
5018
5018
  "use strict";
5019
- var fs5 = require_fs();
5019
+ var fs6 = require_fs();
5020
5020
  var u = require_universalify().fromPromise;
5021
5021
  async function symlinkType(srcpath, type) {
5022
5022
  if (type) return type;
5023
5023
  let stats;
5024
5024
  try {
5025
- stats = await fs5.lstat(srcpath);
5025
+ stats = await fs6.lstat(srcpath);
5026
5026
  } catch {
5027
5027
  return "file";
5028
5028
  }
@@ -5032,7 +5032,7 @@ var require_symlink_type = __commonJS({
5032
5032
  if (type) return type;
5033
5033
  let stats;
5034
5034
  try {
5035
- stats = fs5.lstatSync(srcpath);
5035
+ stats = fs6.lstatSync(srcpath);
5036
5036
  } catch {
5037
5037
  return "file";
5038
5038
  }
@@ -5050,8 +5050,8 @@ var require_symlink = __commonJS({
5050
5050
  "node_modules/fs-extra/lib/ensure/symlink.js"(exports, module) {
5051
5051
  "use strict";
5052
5052
  var u = require_universalify().fromPromise;
5053
- var path4 = __require("path");
5054
- var fs5 = require_fs();
5053
+ var path5 = __require("path");
5054
+ var fs6 = require_fs();
5055
5055
  var { mkdirs, mkdirsSync } = require_mkdirs();
5056
5056
  var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
5057
5057
  var { symlinkType, symlinkTypeSync } = require_symlink_type();
@@ -5060,44 +5060,44 @@ var require_symlink = __commonJS({
5060
5060
  async function createSymlink(srcpath, dstpath, type) {
5061
5061
  let stats;
5062
5062
  try {
5063
- stats = await fs5.lstat(dstpath);
5063
+ stats = await fs6.lstat(dstpath);
5064
5064
  } catch {
5065
5065
  }
5066
5066
  if (stats && stats.isSymbolicLink()) {
5067
5067
  const [srcStat, dstStat] = await Promise.all([
5068
- fs5.stat(srcpath),
5069
- fs5.stat(dstpath)
5068
+ fs6.stat(srcpath),
5069
+ fs6.stat(dstpath)
5070
5070
  ]);
5071
5071
  if (areIdentical(srcStat, dstStat)) return;
5072
5072
  }
5073
5073
  const relative = await symlinkPaths(srcpath, dstpath);
5074
5074
  srcpath = relative.toDst;
5075
5075
  const toType = await symlinkType(relative.toCwd, type);
5076
- const dir = path4.dirname(dstpath);
5076
+ const dir = path5.dirname(dstpath);
5077
5077
  if (!await pathExists(dir)) {
5078
5078
  await mkdirs(dir);
5079
5079
  }
5080
- return fs5.symlink(srcpath, dstpath, toType);
5080
+ return fs6.symlink(srcpath, dstpath, toType);
5081
5081
  }
5082
5082
  function createSymlinkSync(srcpath, dstpath, type) {
5083
5083
  let stats;
5084
5084
  try {
5085
- stats = fs5.lstatSync(dstpath);
5085
+ stats = fs6.lstatSync(dstpath);
5086
5086
  } catch {
5087
5087
  }
5088
5088
  if (stats && stats.isSymbolicLink()) {
5089
- const srcStat = fs5.statSync(srcpath);
5090
- const dstStat = fs5.statSync(dstpath);
5089
+ const srcStat = fs6.statSync(srcpath);
5090
+ const dstStat = fs6.statSync(dstpath);
5091
5091
  if (areIdentical(srcStat, dstStat)) return;
5092
5092
  }
5093
5093
  const relative = symlinkPathsSync(srcpath, dstpath);
5094
5094
  srcpath = relative.toDst;
5095
5095
  type = symlinkTypeSync(relative.toCwd, type);
5096
- const dir = path4.dirname(dstpath);
5097
- const exists = fs5.existsSync(dir);
5098
- if (exists) return fs5.symlinkSync(srcpath, dstpath, type);
5096
+ const dir = path5.dirname(dstpath);
5097
+ const exists = fs6.existsSync(dir);
5098
+ if (exists) return fs6.symlinkSync(srcpath, dstpath, type);
5099
5099
  mkdirsSync(dir);
5100
- return fs5.symlinkSync(srcpath, dstpath, type);
5100
+ return fs6.symlinkSync(srcpath, dstpath, type);
5101
5101
  }
5102
5102
  module.exports = {
5103
5103
  createSymlink: u(createSymlink),
@@ -5164,9 +5164,9 @@ var require_jsonfile = __commonJS({
5164
5164
  if (typeof options === "string") {
5165
5165
  options = { encoding: options };
5166
5166
  }
5167
- const fs5 = options.fs || _fs;
5167
+ const fs6 = options.fs || _fs;
5168
5168
  const shouldThrow = "throws" in options ? options.throws : true;
5169
- let data = await universalify.fromCallback(fs5.readFile)(file, options);
5169
+ let data = await universalify.fromCallback(fs6.readFile)(file, options);
5170
5170
  data = stripBom(data);
5171
5171
  let obj;
5172
5172
  try {
@@ -5186,10 +5186,10 @@ var require_jsonfile = __commonJS({
5186
5186
  if (typeof options === "string") {
5187
5187
  options = { encoding: options };
5188
5188
  }
5189
- const fs5 = options.fs || _fs;
5189
+ const fs6 = options.fs || _fs;
5190
5190
  const shouldThrow = "throws" in options ? options.throws : true;
5191
5191
  try {
5192
- let content = fs5.readFileSync(file, options);
5192
+ let content = fs6.readFileSync(file, options);
5193
5193
  content = stripBom(content);
5194
5194
  return JSON.parse(content, options.reviver);
5195
5195
  } catch (err) {
@@ -5202,15 +5202,15 @@ var require_jsonfile = __commonJS({
5202
5202
  }
5203
5203
  }
5204
5204
  async function _writeFile(file, obj, options = {}) {
5205
- const fs5 = options.fs || _fs;
5205
+ const fs6 = options.fs || _fs;
5206
5206
  const str = stringify(obj, options);
5207
- await universalify.fromCallback(fs5.writeFile)(file, str, options);
5207
+ await universalify.fromCallback(fs6.writeFile)(file, str, options);
5208
5208
  }
5209
5209
  var writeFile = universalify.fromPromise(_writeFile);
5210
5210
  function writeFileSync(file, obj, options = {}) {
5211
- const fs5 = options.fs || _fs;
5211
+ const fs6 = options.fs || _fs;
5212
5212
  const str = stringify(obj, options);
5213
- return fs5.writeFileSync(file, str, options);
5213
+ return fs6.writeFileSync(file, str, options);
5214
5214
  }
5215
5215
  module.exports = {
5216
5216
  readFile,
@@ -5241,23 +5241,23 @@ var require_output_file = __commonJS({
5241
5241
  "node_modules/fs-extra/lib/output-file/index.js"(exports, module) {
5242
5242
  "use strict";
5243
5243
  var u = require_universalify().fromPromise;
5244
- var fs5 = require_fs();
5245
- var path4 = __require("path");
5244
+ var fs6 = require_fs();
5245
+ var path5 = __require("path");
5246
5246
  var mkdir = require_mkdirs();
5247
5247
  var pathExists = require_path_exists().pathExists;
5248
5248
  async function outputFile(file, data, encoding = "utf-8") {
5249
- const dir = path4.dirname(file);
5249
+ const dir = path5.dirname(file);
5250
5250
  if (!await pathExists(dir)) {
5251
5251
  await mkdir.mkdirs(dir);
5252
5252
  }
5253
- return fs5.writeFile(file, data, encoding);
5253
+ return fs6.writeFile(file, data, encoding);
5254
5254
  }
5255
5255
  function outputFileSync(file, ...args) {
5256
- const dir = path4.dirname(file);
5257
- if (!fs5.existsSync(dir)) {
5256
+ const dir = path5.dirname(file);
5257
+ if (!fs6.existsSync(dir)) {
5258
5258
  mkdir.mkdirsSync(dir);
5259
5259
  }
5260
- fs5.writeFileSync(file, ...args);
5260
+ fs6.writeFileSync(file, ...args);
5261
5261
  }
5262
5262
  module.exports = {
5263
5263
  outputFile: u(outputFile),
@@ -5316,8 +5316,8 @@ var require_json = __commonJS({
5316
5316
  var require_move = __commonJS({
5317
5317
  "node_modules/fs-extra/lib/move/move.js"(exports, module) {
5318
5318
  "use strict";
5319
- var fs5 = require_fs();
5320
- var path4 = __require("path");
5319
+ var fs6 = require_fs();
5320
+ var path5 = __require("path");
5321
5321
  var { copy } = require_copy2();
5322
5322
  var { remove } = require_remove();
5323
5323
  var { mkdirp } = require_mkdirs();
@@ -5327,8 +5327,8 @@ var require_move = __commonJS({
5327
5327
  const overwrite = opts.overwrite || opts.clobber || false;
5328
5328
  const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
5329
5329
  await stat.checkParentPaths(src, srcStat, dest, "move");
5330
- const destParent = path4.dirname(dest);
5331
- const parsedParentPath = path4.parse(destParent);
5330
+ const destParent = path5.dirname(dest);
5331
+ const parsedParentPath = path5.parse(destParent);
5332
5332
  if (parsedParentPath.root !== destParent) {
5333
5333
  await mkdirp(destParent);
5334
5334
  }
@@ -5343,7 +5343,7 @@ var require_move = __commonJS({
5343
5343
  }
5344
5344
  }
5345
5345
  try {
5346
- await fs5.rename(src, dest);
5346
+ await fs6.rename(src, dest);
5347
5347
  } catch (err) {
5348
5348
  if (err.code !== "EXDEV") {
5349
5349
  throw err;
@@ -5368,8 +5368,8 @@ var require_move = __commonJS({
5368
5368
  var require_move_sync = __commonJS({
5369
5369
  "node_modules/fs-extra/lib/move/move-sync.js"(exports, module) {
5370
5370
  "use strict";
5371
- var fs5 = require_graceful_fs();
5372
- var path4 = __require("path");
5371
+ var fs6 = require_graceful_fs();
5372
+ var path5 = __require("path");
5373
5373
  var copySync = require_copy2().copySync;
5374
5374
  var removeSync = require_remove().removeSync;
5375
5375
  var mkdirpSync = require_mkdirs().mkdirpSync;
@@ -5379,12 +5379,12 @@ var require_move_sync = __commonJS({
5379
5379
  const overwrite = opts.overwrite || opts.clobber || false;
5380
5380
  const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
5381
5381
  stat.checkParentPathsSync(src, srcStat, dest, "move");
5382
- if (!isParentRoot(dest)) mkdirpSync(path4.dirname(dest));
5382
+ if (!isParentRoot(dest)) mkdirpSync(path5.dirname(dest));
5383
5383
  return doRename(src, dest, overwrite, isChangingCase);
5384
5384
  }
5385
5385
  function isParentRoot(dest) {
5386
- const parent = path4.dirname(dest);
5387
- const parsedPath = path4.parse(parent);
5386
+ const parent = path5.dirname(dest);
5387
+ const parsedPath = path5.parse(parent);
5388
5388
  return parsedPath.root === parent;
5389
5389
  }
5390
5390
  function doRename(src, dest, overwrite, isChangingCase) {
@@ -5393,12 +5393,12 @@ var require_move_sync = __commonJS({
5393
5393
  removeSync(dest);
5394
5394
  return rename(src, dest, overwrite);
5395
5395
  }
5396
- if (fs5.existsSync(dest)) throw new Error("dest already exists.");
5396
+ if (fs6.existsSync(dest)) throw new Error("dest already exists.");
5397
5397
  return rename(src, dest, overwrite);
5398
5398
  }
5399
5399
  function rename(src, dest, overwrite) {
5400
5400
  try {
5401
- fs5.renameSync(src, dest);
5401
+ fs6.renameSync(src, dest);
5402
5402
  } catch (err) {
5403
5403
  if (err.code !== "EXDEV") throw err;
5404
5404
  return moveAcrossDevice(src, dest, overwrite);
@@ -5454,16 +5454,6 @@ var require_lib = __commonJS({
5454
5454
  import path from "path";
5455
5455
  import os2 from "os";
5456
5456
  import { fileURLToPath } from "url";
5457
- function getClientConfigPaths() {
5458
- const homeDir = os2.homedir();
5459
- return [
5460
- { name: "Claude Code", path: path.join(homeDir, ".claude.json") },
5461
- { name: "Antigravity", path: path.join(homeDir, ".gemini", "antigravity", "mcp.json") },
5462
- // Codex config placeholder - exact path depends on how Codex stores user config.
5463
- // Assuming a common pattern here like ~/.codex/mcp.json or similar.
5464
- { name: "Codex", path: path.join(homeDir, ".codex", "mcp.json") }
5465
- ];
5466
- }
5467
5457
  function getExtensionPath() {
5468
5458
  const __filename2 = fileURLToPath(import.meta.url);
5469
5459
  const currentDir = path.dirname(__filename2);
@@ -5481,23 +5471,208 @@ function getServerPath() {
5481
5471
  return path.resolve(currentDir, "../dist/server.js");
5482
5472
  }
5483
5473
  function getUserExtensionDir() {
5484
- return path.join(os2.homedir(), "ghost-bridge", "extension");
5474
+ return path.join(os2.homedir(), ".ghost-bridge", "extension");
5475
+ }
5476
+ function getServerCommandConfig() {
5477
+ return {
5478
+ type: "stdio",
5479
+ command: process.execPath,
5480
+ args: [getServerPath()]
5481
+ };
5485
5482
  }
5486
5483
  var init_utils = __esm({
5487
5484
  "lib/utils.js"() {
5488
5485
  }
5489
5486
  });
5490
5487
 
5488
+ // lib/clients.js
5489
+ import os3 from "os";
5490
+ import path2 from "path";
5491
+ function getHomeDir() {
5492
+ return os3.homedir();
5493
+ }
5494
+ function getJsonClientDefinition(name, configPath, options = {}) {
5495
+ return {
5496
+ name,
5497
+ kind: "json",
5498
+ configPath,
5499
+ shouldCreate: Boolean(options.shouldCreate),
5500
+ isAvailable() {
5501
+ return options.isAvailable ? options.isAvailable() : import_fs_extra.default.existsSync(configPath);
5502
+ }
5503
+ };
5504
+ }
5505
+ function getClientDefinitions() {
5506
+ const homeDir = getHomeDir();
5507
+ const claudeDir = path2.join(homeDir, ".claude");
5508
+ const claudeSettingsPath = path2.join(claudeDir, "settings.json");
5509
+ const claudeLegacyPath = path2.join(homeDir, ".claude.json");
5510
+ const cursorDir = path2.join(homeDir, ".cursor");
5511
+ const antigravityDir = path2.join(homeDir, ".gemini", "antigravity");
5512
+ return [
5513
+ getJsonClientDefinition("Claude Code", import_fs_extra.default.existsSync(claudeSettingsPath) ? claudeSettingsPath : claudeLegacyPath, {
5514
+ shouldCreate: true,
5515
+ isAvailable: () => import_fs_extra.default.existsSync(claudeDir) || import_fs_extra.default.existsSync(claudeLegacyPath)
5516
+ }),
5517
+ {
5518
+ name: "Codex",
5519
+ kind: "toml",
5520
+ configPath: path2.join(homeDir, ".codex", "config.toml"),
5521
+ shouldCreate: import_fs_extra.default.existsSync(path2.join(homeDir, ".codex")),
5522
+ isAvailable() {
5523
+ return import_fs_extra.default.existsSync(path2.join(homeDir, ".codex"));
5524
+ }
5525
+ },
5526
+ getJsonClientDefinition("Cursor", path2.join(cursorDir, "mcp.json"), {
5527
+ shouldCreate: import_fs_extra.default.existsSync(cursorDir),
5528
+ isAvailable: () => import_fs_extra.default.existsSync(cursorDir)
5529
+ }),
5530
+ getJsonClientDefinition("Antigravity", path2.join(antigravityDir, "mcp.json"), {
5531
+ shouldCreate: import_fs_extra.default.existsSync(antigravityDir),
5532
+ isAvailable: () => import_fs_extra.default.existsSync(antigravityDir)
5533
+ })
5534
+ ];
5535
+ }
5536
+ function getTomlSectionHeader(serverName = SERVER_NAME) {
5537
+ return `[mcp_servers.${serverName}]`;
5538
+ }
5539
+ function buildTomlSection(config, serverName = SERVER_NAME) {
5540
+ return [
5541
+ getTomlSectionHeader(serverName),
5542
+ `type = ${JSON.stringify(config.type || "stdio")}`,
5543
+ `command = ${JSON.stringify(config.command)}`,
5544
+ `args = ${JSON.stringify(config.args || [])}`
5545
+ ].join("\n");
5546
+ }
5547
+ function findTomlSectionRange(content, serverName = SERVER_NAME) {
5548
+ const header = getTomlSectionHeader(serverName);
5549
+ const lines = content.split("\n");
5550
+ const start = lines.findIndex((line) => line.trim() === header);
5551
+ if (start === -1) {
5552
+ return null;
5553
+ }
5554
+ let end = lines.length;
5555
+ for (let index = start + 1; index < lines.length; index++) {
5556
+ if (/^\s*\[/.test(lines[index])) {
5557
+ end = index;
5558
+ break;
5559
+ }
5560
+ }
5561
+ return { start, end, lines };
5562
+ }
5563
+ function parseTomlStringValue(line, key) {
5564
+ const match = line.match(new RegExp(`^\\s*${key}\\s*=\\s*"(.*)"\\s*$`));
5565
+ return match ? JSON.parse(`"${match[1].replace(/"/g, '\\"')}"`) : null;
5566
+ }
5567
+ function parseTomlArgsValue(line) {
5568
+ const match = line.match(/^\s*args\s*=\s*(\[.*\])\s*$/);
5569
+ if (!match) {
5570
+ return null;
5571
+ }
5572
+ try {
5573
+ return JSON.parse(match[1]);
5574
+ } catch {
5575
+ return null;
5576
+ }
5577
+ }
5578
+ function readTomlMcpServer(content, serverName = SERVER_NAME) {
5579
+ const range = findTomlSectionRange(content, serverName);
5580
+ if (!range) {
5581
+ return null;
5582
+ }
5583
+ const sectionLines = range.lines.slice(range.start + 1, range.end);
5584
+ const config = {
5585
+ type: "stdio",
5586
+ command: null,
5587
+ args: []
5588
+ };
5589
+ for (const line of sectionLines) {
5590
+ const type = parseTomlStringValue(line, "type");
5591
+ if (type) {
5592
+ config.type = type;
5593
+ continue;
5594
+ }
5595
+ const command = parseTomlStringValue(line, "command");
5596
+ if (command) {
5597
+ config.command = command;
5598
+ continue;
5599
+ }
5600
+ const args = parseTomlArgsValue(line);
5601
+ if (args) {
5602
+ config.args = args;
5603
+ }
5604
+ }
5605
+ return config.command ? config : null;
5606
+ }
5607
+ function upsertTomlMcpServer(content, config, serverName = SERVER_NAME) {
5608
+ const section = buildTomlSection(config, serverName);
5609
+ const range = findTomlSectionRange(content, serverName);
5610
+ if (!range) {
5611
+ const trimmed = content.trimEnd();
5612
+ return trimmed ? `${trimmed}
5613
+
5614
+ ${section}
5615
+ ` : `${section}
5616
+ `;
5617
+ }
5618
+ const before = range.lines.slice(0, range.start).join("\n");
5619
+ const after = range.lines.slice(range.end).join("\n");
5620
+ const parts = [before.trimEnd(), section, after.trimStart()].filter(Boolean);
5621
+ return `${parts.join("\n\n")}
5622
+ `;
5623
+ }
5624
+ async function readClientConfiguration(client) {
5625
+ if (!import_fs_extra.default.existsSync(client.configPath)) {
5626
+ return null;
5627
+ }
5628
+ if (client.kind === "toml") {
5629
+ const content = await import_fs_extra.default.readFile(client.configPath, "utf8");
5630
+ return readTomlMcpServer(content);
5631
+ }
5632
+ try {
5633
+ const json = await import_fs_extra.default.readJson(client.configPath);
5634
+ return json.mcpServers?.[SERVER_NAME] || null;
5635
+ } catch {
5636
+ return null;
5637
+ }
5638
+ }
5639
+ async function writeClientConfiguration(client, config) {
5640
+ await import_fs_extra.default.ensureDir(path2.dirname(client.configPath));
5641
+ if (client.kind === "toml") {
5642
+ const content = import_fs_extra.default.existsSync(client.configPath) ? await import_fs_extra.default.readFile(client.configPath, "utf8") : "";
5643
+ const nextContent = upsertTomlMcpServer(content, config);
5644
+ await import_fs_extra.default.writeFile(client.configPath, nextContent, "utf8");
5645
+ return;
5646
+ }
5647
+ const json = import_fs_extra.default.existsSync(client.configPath) ? await import_fs_extra.default.readJson(client.configPath) : {};
5648
+ json.mcpServers = json.mcpServers || {};
5649
+ json.mcpServers[SERVER_NAME] = {
5650
+ command: config.command,
5651
+ args: config.args
5652
+ };
5653
+ await import_fs_extra.default.writeJson(client.configPath, json, { spaces: 2 });
5654
+ }
5655
+ function isClientManaged(client) {
5656
+ return client.shouldCreate || client.isAvailable();
5657
+ }
5658
+ var import_fs_extra, SERVER_NAME;
5659
+ var init_clients = __esm({
5660
+ "lib/clients.js"() {
5661
+ import_fs_extra = __toESM(require_lib(), 1);
5662
+ SERVER_NAME = "ghost-bridge";
5663
+ }
5664
+ });
5665
+
5491
5666
  // lib/init.js
5492
5667
  var init_exports = {};
5493
5668
  __export(init_exports, {
5494
5669
  init: () => init
5495
5670
  });
5496
- import path2 from "path";
5671
+ import path3 from "path";
5497
5672
  import { exec } from "child_process";
5498
- import os3 from "os";
5673
+ import os4 from "os";
5499
5674
  function openFolder(folderPath) {
5500
- const platform = os3.platform();
5675
+ const platform = os4.platform();
5501
5676
  let command = "";
5502
5677
  if (platform === "darwin") command = `open "${folderPath}"`;
5503
5678
  else if (platform === "win32") command = `start "" "${folderPath}"`;
@@ -5508,37 +5683,28 @@ function openFolder(folderPath) {
5508
5683
  }
5509
5684
  async function init(options) {
5510
5685
  console.log(source_default.bold("\u{1F47B} Ghost Bridge Initialization"));
5511
- const clientConfigs = getClientConfigPaths();
5512
- const serverPath = getServerPath();
5686
+ const clients = getClientDefinitions();
5687
+ const serverConfig = getServerCommandConfig();
5513
5688
  const isDryRun = options.dryRun;
5514
5689
  console.log(source_default.dim("Checking MCP Client configurations..."));
5515
5690
  let configuredCount = 0;
5516
- for (const client of clientConfigs) {
5517
- const configPath = client.path;
5691
+ for (const client of clients) {
5692
+ const configPath = client.configPath;
5518
5693
  if (isDryRun) {
5519
5694
  console.log(source_default.yellow(`[Dry Run] Would check ${client.name} config at: ${configPath}`));
5520
- if (import_fs_extra.default.existsSync(configPath) || client.name === "Claude Code") {
5695
+ if (isClientManaged(client)) {
5521
5696
  console.log(source_default.yellow(`[Dry Run] Would add MCP server logic for ${client.name}`));
5522
5697
  }
5523
5698
  continue;
5524
5699
  }
5525
- const exists = import_fs_extra.default.existsSync(configPath);
5526
- if (!exists && client.name !== "Claude Code") {
5700
+ if (!isClientManaged(client)) {
5527
5701
  continue;
5528
5702
  }
5529
- if (!exists) {
5530
- console.log(source_default.yellow(`Configuration file not found for ${client.name} at ${configPath}, creating...`));
5531
- await import_fs_extra.default.ensureDir(path2.dirname(configPath));
5532
- await import_fs_extra.default.writeJson(configPath, { mcpServers: {} }, { spaces: 2 });
5533
- }
5534
5703
  try {
5535
- const config = await import_fs_extra.default.readJson(configPath);
5536
- config.mcpServers = config.mcpServers || {};
5537
- config.mcpServers["ghost-bridge"] = {
5538
- command: "node",
5539
- args: [serverPath]
5540
- };
5541
- await import_fs_extra.default.writeJson(configPath, config, { spaces: 2 });
5704
+ if (!import_fs_extra2.default.existsSync(configPath)) {
5705
+ console.log(source_default.yellow(`Configuration file not found for ${client.name} at ${configPath}, creating...`));
5706
+ }
5707
+ await writeClientConfiguration(client, serverConfig);
5542
5708
  console.log(source_default.green(`\u2705 MCP Server configured for ${source_default.bold(client.name)} in ${configPath}`));
5543
5709
  configuredCount++;
5544
5710
  } catch (err) {
@@ -5555,8 +5721,8 @@ async function init(options) {
5555
5721
  console.log(source_default.yellow(`[Dry Run] Would copy extension from ${sourceExt} to ${targetExt}`));
5556
5722
  } else {
5557
5723
  try {
5558
- await import_fs_extra.default.ensureDir(targetExt);
5559
- await import_fs_extra.default.copy(sourceExt, targetExt, { overwrite: true });
5724
+ await import_fs_extra2.default.ensureDir(targetExt);
5725
+ await import_fs_extra2.default.copy(sourceExt, targetExt, { overwrite: true });
5560
5726
  console.log(source_default.green(`\u2705 Extension files copied to ${targetExt}`));
5561
5727
  } catch (err) {
5562
5728
  console.error(source_default.red(`Failed to copy extension files: ${err.message}`));
@@ -5569,17 +5735,18 @@ async function init(options) {
5569
5735
  console.log('3. Click "Load unpacked"');
5570
5736
  console.log(`4. Select the folder: ${source_default.bold(targetExt)}`);
5571
5737
  if (!isDryRun) {
5572
- await import_fs_extra.default.outputFile(path2.join(targetExt, ".ghost-bridge-managed"), "This folder is managed by ghost-bridge CLI. Do not edit manually.");
5738
+ await import_fs_extra2.default.outputFile(path3.join(targetExt, ".ghost-bridge-managed"), "This folder is managed by ghost-bridge CLI. Do not edit manually.");
5573
5739
  console.log(source_default.dim("\n\u{1F4C2} Opening extension folder..."));
5574
5740
  openFolder(targetExt);
5575
5741
  }
5576
5742
  }
5577
- var import_fs_extra;
5743
+ var import_fs_extra2;
5578
5744
  var init_init = __esm({
5579
5745
  "lib/init.js"() {
5580
- import_fs_extra = __toESM(require_lib(), 1);
5746
+ import_fs_extra2 = __toESM(require_lib(), 1);
5581
5747
  init_source();
5582
5748
  init_utils();
5749
+ init_clients();
5583
5750
  }
5584
5751
  });
5585
5752
 
@@ -5589,20 +5756,20 @@ __export(extension_exports, {
5589
5756
  showExtension: () => showExtension
5590
5757
  });
5591
5758
  import { exec as exec2 } from "child_process";
5592
- import os4 from "os";
5593
- function openFolder2(path4) {
5594
- const platform = os4.platform();
5759
+ import os5 from "os";
5760
+ function openFolder2(path5) {
5761
+ const platform = os5.platform();
5595
5762
  let command = "";
5596
- if (platform === "darwin") command = `open "${path4}"`;
5597
- else if (platform === "win32") command = `start "" "${path4}"`;
5598
- else command = `xdg-open "${path4}"`;
5763
+ if (platform === "darwin") command = `open "${path5}"`;
5764
+ else if (platform === "win32") command = `start "" "${path5}"`;
5765
+ else command = `xdg-open "${path5}"`;
5599
5766
  exec2(command, (err) => {
5600
5767
  if (err) console.error("Failed to open folder:", err);
5601
5768
  });
5602
5769
  }
5603
5770
  async function showExtension(options) {
5604
5771
  const extDir = getUserExtensionDir();
5605
- if (!import_fs_extra2.default.existsSync(extDir)) {
5772
+ if (!import_fs_extra3.default.existsSync(extDir)) {
5606
5773
  console.log(source_default.yellow(`Extension directory not found at: ${extDir}`));
5607
5774
  console.log(source_default.white("Have you run `ghost-bridge init` yet?"));
5608
5775
  return;
@@ -5619,12 +5786,12 @@ async function showExtension(options) {
5619
5786
  openFolder2(extDir);
5620
5787
  }
5621
5788
  }
5622
- var import_fs_extra2;
5789
+ var import_fs_extra3;
5623
5790
  var init_extension = __esm({
5624
5791
  "lib/extension.js"() {
5625
5792
  init_source();
5626
5793
  init_utils();
5627
- import_fs_extra2 = __toESM(require_lib(), 1);
5794
+ import_fs_extra3 = __toESM(require_lib(), 1);
5628
5795
  }
5629
5796
  });
5630
5797
 
@@ -5635,28 +5802,30 @@ __export(status_exports, {
5635
5802
  });
5636
5803
  async function status() {
5637
5804
  console.log(source_default.bold("\u{1F47B} Ghost Bridge Status"));
5638
- const clientConfigs = getClientConfigPaths();
5805
+ const clients = getClientDefinitions();
5639
5806
  const extDir = getUserExtensionDir();
5640
- const serverPath = getServerPath();
5807
+ const serverConfig = getServerCommandConfig();
5641
5808
  console.log(source_default.bold.blue("\nMCP Client Configurations:"));
5642
5809
  let configuredCount = 0;
5643
- for (const client of clientConfigs) {
5810
+ for (const client of clients) {
5644
5811
  let mcpStatus = source_default.gray("Not Configured");
5645
5812
  let mcpDetails = "";
5646
- const configPath = client.path;
5647
- if (import_fs_extra3.default.existsSync(configPath)) {
5813
+ const configPath = client.configPath;
5814
+ if (import_fs_extra4.default.existsSync(configPath)) {
5648
5815
  try {
5649
- const config = await import_fs_extra3.default.readJson(configPath);
5650
- if (config.mcpServers && config.mcpServers["ghost-bridge"]) {
5816
+ const config = await readClientConfiguration(client);
5817
+ if (config) {
5651
5818
  mcpStatus = source_default.green("Configured");
5652
- const cfg = config.mcpServers["ghost-bridge"];
5653
- const configuredPath = cfg.args[0];
5654
- if (configuredPath === serverPath) {
5819
+ const configuredCommand = config.command;
5820
+ const configuredPath = config.args?.[0];
5821
+ if (configuredCommand === serverConfig.command && configuredPath === serverConfig.args[0]) {
5655
5822
  mcpDetails = source_default.dim("(Paths match)");
5656
5823
  } else {
5657
- mcpDetails = source_default.yellow(`(Path mismatch)
5658
- Configured: ${configuredPath}
5659
- Current: ${serverPath}`);
5824
+ mcpDetails = source_default.yellow(
5825
+ `(Path mismatch)
5826
+ Configured: ${configuredCommand} ${configuredPath || ""}
5827
+ Current: ${serverConfig.command} ${serverConfig.args[0]}`
5828
+ );
5660
5829
  }
5661
5830
  configuredCount++;
5662
5831
  }
@@ -5664,7 +5833,7 @@ async function status() {
5664
5833
  mcpStatus = source_default.red("Error reading config");
5665
5834
  }
5666
5835
  } else {
5667
- if (client.name === "Claude Code") {
5836
+ if (client.shouldCreate) {
5668
5837
  mcpStatus = source_default.yellow("Config file not found");
5669
5838
  } else {
5670
5839
  mcpStatus = source_default.gray("Not Installed");
@@ -5677,18 +5846,19 @@ async function status() {
5677
5846
  console.log(source_default.yellow("\n No MCP clients currently have ghost-bridge configured. Run `ghost-bridge init`."));
5678
5847
  }
5679
5848
  let extStatus = source_default.red("Not Installed (Run init)");
5680
- if (import_fs_extra3.default.existsSync(extDir)) {
5849
+ if (import_fs_extra4.default.existsSync(extDir)) {
5681
5850
  extStatus = source_default.green("Installed");
5682
5851
  }
5683
5852
  console.log(`Extension: ${extStatus}`);
5684
5853
  console.log(` Path: ${extDir}`);
5685
5854
  }
5686
- var import_fs_extra3;
5855
+ var import_fs_extra4;
5687
5856
  var init_status = __esm({
5688
5857
  "lib/status.js"() {
5689
5858
  init_source();
5690
- import_fs_extra3 = __toESM(require_lib(), 1);
5859
+ import_fs_extra4 = __toESM(require_lib(), 1);
5691
5860
  init_utils();
5861
+ init_clients();
5692
5862
  }
5693
5863
  });
5694
5864
 
@@ -5712,16 +5882,16 @@ var {
5712
5882
  // bin/ghost-bridge.js
5713
5883
  init_source();
5714
5884
  import { fileURLToPath as fileURLToPath2 } from "url";
5715
- import path3 from "path";
5716
- import fs4 from "fs";
5885
+ import path4 from "path";
5886
+ import fs5 from "fs";
5717
5887
  var __filename = fileURLToPath2(import.meta.url);
5718
- var __dirname = path3.dirname(__filename);
5888
+ var __dirname = path4.dirname(__filename);
5719
5889
  var packageJsonParams = JSON.parse(
5720
- fs4.readFileSync(path3.join(__dirname, "../package.json"), "utf-8")
5890
+ fs5.readFileSync(path4.join(__dirname, "../package.json"), "utf-8")
5721
5891
  );
5722
5892
  var program2 = new Command();
5723
5893
  program2.name("ghost-bridge").description(packageJsonParams.description).version(packageJsonParams.version);
5724
- program2.command("init").description("Initialize Ghost Bridge: Configure Claude MCP and setup extension").option("--dry-run", "Show what would be done without making changes").action(async (options) => {
5894
+ program2.command("init").description("Initialize Ghost Bridge: Configure supported MCP clients and setup extension").option("--dry-run", "Show what would be done without making changes").action(async (options) => {
5725
5895
  try {
5726
5896
  const { init: init2 } = await Promise.resolve().then(() => (init_init(), init_exports));
5727
5897
  await init2(options);
@@ -5742,12 +5912,12 @@ program2.command("extension").description("Show the path to the Chrome extension
5742
5912
  program2.command("start").description("Start the Ghost Bridge MCP server directly").action(async () => {
5743
5913
  try {
5744
5914
  console.log(source_default.blue("Starting Ghost Bridge Server..."));
5745
- const serverPath = path3.join(__dirname, "../src/server.js");
5746
- if (fs4.existsSync(serverPath)) {
5915
+ const serverPath = path4.join(__dirname, "../src/server.js");
5916
+ if (fs5.existsSync(serverPath)) {
5747
5917
  await import(serverPath);
5748
5918
  } else {
5749
- const rootServerPath = path3.join(__dirname, "../server.js");
5750
- if (fs4.existsSync(rootServerPath)) {
5919
+ const rootServerPath = path4.join(__dirname, "../server.js");
5920
+ if (fs5.existsSync(rootServerPath)) {
5751
5921
  await import(rootServerPath);
5752
5922
  } else {
5753
5923
  throw new Error("Could not find server.js");