@mrrlin-dev/mcp 0.2.1 → 0.2.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.
Files changed (2) hide show
  1. package/dist/bin.cjs +393 -272
  2. package/package.json +3 -3
package/dist/bin.cjs CHANGED
@@ -4120,7 +4120,7 @@ var require_extension = __commonJS({
4120
4120
  if (dest[name] === void 0) dest[name] = [elem];
4121
4121
  else dest[name].push(elem);
4122
4122
  }
4123
- function parse4(header) {
4123
+ function parse5(header) {
4124
4124
  const offers = /* @__PURE__ */ Object.create(null);
4125
4125
  let params = /* @__PURE__ */ Object.create(null);
4126
4126
  let mustUnescape = false;
@@ -4260,7 +4260,7 @@ var require_extension = __commonJS({
4260
4260
  }).join(", ");
4261
4261
  }).join(", ");
4262
4262
  }
4263
- module2.exports = { format, parse: parse4 };
4263
+ module2.exports = { format, parse: parse5 };
4264
4264
  }
4265
4265
  });
4266
4266
 
@@ -4294,7 +4294,7 @@ var require_websocket = __commonJS({
4294
4294
  var {
4295
4295
  EventTarget: { addEventListener, removeEventListener }
4296
4296
  } = require_event_target();
4297
- var { format, parse: parse4 } = require_extension();
4297
+ var { format, parse: parse5 } = require_extension();
4298
4298
  var { toBuffer } = require_buffer_util();
4299
4299
  var kAborted = Symbol("kAborted");
4300
4300
  var protocolVersions = [8, 13];
@@ -4971,7 +4971,7 @@ var require_websocket = __commonJS({
4971
4971
  }
4972
4972
  let extensions;
4973
4973
  try {
4974
- extensions = parse4(secWebSocketExtensions);
4974
+ extensions = parse5(secWebSocketExtensions);
4975
4975
  } catch (err) {
4976
4976
  const message = "Invalid Sec-WebSocket-Extensions header";
4977
4977
  abortHandshake(websocket, socket, message);
@@ -5263,7 +5263,7 @@ var require_subprotocol = __commonJS({
5263
5263
  "../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/subprotocol.js"(exports2, module2) {
5264
5264
  "use strict";
5265
5265
  var { tokenChars } = require_validation();
5266
- function parse4(header) {
5266
+ function parse5(header) {
5267
5267
  const protocols = /* @__PURE__ */ new Set();
5268
5268
  let start = -1;
5269
5269
  let end = -1;
@@ -5299,7 +5299,7 @@ var require_subprotocol = __commonJS({
5299
5299
  protocols.add(protocol);
5300
5300
  return protocols;
5301
5301
  }
5302
- module2.exports = { parse: parse4 };
5302
+ module2.exports = { parse: parse5 };
5303
5303
  }
5304
5304
  });
5305
5305
 
@@ -5730,54 +5730,54 @@ var require_polyfills = __commonJS({
5730
5730
  }
5731
5731
  var chdir;
5732
5732
  module2.exports = patch;
5733
- function patch(fs4) {
5733
+ function patch(fs5) {
5734
5734
  if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
5735
- patchLchmod(fs4);
5736
- }
5737
- if (!fs4.lutimes) {
5738
- patchLutimes(fs4);
5739
- }
5740
- fs4.chown = chownFix(fs4.chown);
5741
- fs4.fchown = chownFix(fs4.fchown);
5742
- fs4.lchown = chownFix(fs4.lchown);
5743
- fs4.chmod = chmodFix(fs4.chmod);
5744
- fs4.fchmod = chmodFix(fs4.fchmod);
5745
- fs4.lchmod = chmodFix(fs4.lchmod);
5746
- fs4.chownSync = chownFixSync(fs4.chownSync);
5747
- fs4.fchownSync = chownFixSync(fs4.fchownSync);
5748
- fs4.lchownSync = chownFixSync(fs4.lchownSync);
5749
- fs4.chmodSync = chmodFixSync(fs4.chmodSync);
5750
- fs4.fchmodSync = chmodFixSync(fs4.fchmodSync);
5751
- fs4.lchmodSync = chmodFixSync(fs4.lchmodSync);
5752
- fs4.stat = statFix(fs4.stat);
5753
- fs4.fstat = statFix(fs4.fstat);
5754
- fs4.lstat = statFix(fs4.lstat);
5755
- fs4.statSync = statFixSync(fs4.statSync);
5756
- fs4.fstatSync = statFixSync(fs4.fstatSync);
5757
- fs4.lstatSync = statFixSync(fs4.lstatSync);
5758
- if (fs4.chmod && !fs4.lchmod) {
5759
- fs4.lchmod = function(path12, mode, cb) {
5735
+ patchLchmod(fs5);
5736
+ }
5737
+ if (!fs5.lutimes) {
5738
+ patchLutimes(fs5);
5739
+ }
5740
+ fs5.chown = chownFix(fs5.chown);
5741
+ fs5.fchown = chownFix(fs5.fchown);
5742
+ fs5.lchown = chownFix(fs5.lchown);
5743
+ fs5.chmod = chmodFix(fs5.chmod);
5744
+ fs5.fchmod = chmodFix(fs5.fchmod);
5745
+ fs5.lchmod = chmodFix(fs5.lchmod);
5746
+ fs5.chownSync = chownFixSync(fs5.chownSync);
5747
+ fs5.fchownSync = chownFixSync(fs5.fchownSync);
5748
+ fs5.lchownSync = chownFixSync(fs5.lchownSync);
5749
+ fs5.chmodSync = chmodFixSync(fs5.chmodSync);
5750
+ fs5.fchmodSync = chmodFixSync(fs5.fchmodSync);
5751
+ fs5.lchmodSync = chmodFixSync(fs5.lchmodSync);
5752
+ fs5.stat = statFix(fs5.stat);
5753
+ fs5.fstat = statFix(fs5.fstat);
5754
+ fs5.lstat = statFix(fs5.lstat);
5755
+ fs5.statSync = statFixSync(fs5.statSync);
5756
+ fs5.fstatSync = statFixSync(fs5.fstatSync);
5757
+ fs5.lstatSync = statFixSync(fs5.lstatSync);
5758
+ if (fs5.chmod && !fs5.lchmod) {
5759
+ fs5.lchmod = function(path13, mode, cb) {
5760
5760
  if (cb) process.nextTick(cb);
5761
5761
  };
5762
- fs4.lchmodSync = function() {
5762
+ fs5.lchmodSync = function() {
5763
5763
  };
5764
5764
  }
5765
- if (fs4.chown && !fs4.lchown) {
5766
- fs4.lchown = function(path12, uid, gid, cb) {
5765
+ if (fs5.chown && !fs5.lchown) {
5766
+ fs5.lchown = function(path13, uid, gid, cb) {
5767
5767
  if (cb) process.nextTick(cb);
5768
5768
  };
5769
- fs4.lchownSync = function() {
5769
+ fs5.lchownSync = function() {
5770
5770
  };
5771
5771
  }
5772
5772
  if (platform === "win32") {
5773
- fs4.rename = typeof fs4.rename !== "function" ? fs4.rename : function(fs$rename) {
5773
+ fs5.rename = typeof fs5.rename !== "function" ? fs5.rename : function(fs$rename) {
5774
5774
  function rename(from, to, cb) {
5775
5775
  var start = Date.now();
5776
5776
  var backoff = 0;
5777
5777
  fs$rename(from, to, function CB(er) {
5778
5778
  if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
5779
5779
  setTimeout(function() {
5780
- fs4.stat(to, function(stater, st) {
5780
+ fs5.stat(to, function(stater, st) {
5781
5781
  if (stater && stater.code === "ENOENT")
5782
5782
  fs$rename(from, to, CB);
5783
5783
  else
@@ -5793,9 +5793,9 @@ var require_polyfills = __commonJS({
5793
5793
  }
5794
5794
  if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
5795
5795
  return rename;
5796
- }(fs4.rename);
5796
+ }(fs5.rename);
5797
5797
  }
5798
- fs4.read = typeof fs4.read !== "function" ? fs4.read : function(fs$read) {
5798
+ fs5.read = typeof fs5.read !== "function" ? fs5.read : function(fs$read) {
5799
5799
  function read(fd, buffer, offset, length, position, callback_) {
5800
5800
  var callback;
5801
5801
  if (callback_ && typeof callback_ === "function") {
@@ -5803,22 +5803,22 @@ var require_polyfills = __commonJS({
5803
5803
  callback = function(er, _, __) {
5804
5804
  if (er && er.code === "EAGAIN" && eagCounter < 10) {
5805
5805
  eagCounter++;
5806
- return fs$read.call(fs4, fd, buffer, offset, length, position, callback);
5806
+ return fs$read.call(fs5, fd, buffer, offset, length, position, callback);
5807
5807
  }
5808
5808
  callback_.apply(this, arguments);
5809
5809
  };
5810
5810
  }
5811
- return fs$read.call(fs4, fd, buffer, offset, length, position, callback);
5811
+ return fs$read.call(fs5, fd, buffer, offset, length, position, callback);
5812
5812
  }
5813
5813
  if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
5814
5814
  return read;
5815
- }(fs4.read);
5816
- fs4.readSync = typeof fs4.readSync !== "function" ? fs4.readSync : /* @__PURE__ */ function(fs$readSync) {
5815
+ }(fs5.read);
5816
+ fs5.readSync = typeof fs5.readSync !== "function" ? fs5.readSync : /* @__PURE__ */ function(fs$readSync) {
5817
5817
  return function(fd, buffer, offset, length, position) {
5818
5818
  var eagCounter = 0;
5819
5819
  while (true) {
5820
5820
  try {
5821
- return fs$readSync.call(fs4, fd, buffer, offset, length, position);
5821
+ return fs$readSync.call(fs5, fd, buffer, offset, length, position);
5822
5822
  } catch (er) {
5823
5823
  if (er.code === "EAGAIN" && eagCounter < 10) {
5824
5824
  eagCounter++;
@@ -5828,11 +5828,11 @@ var require_polyfills = __commonJS({
5828
5828
  }
5829
5829
  }
5830
5830
  };
5831
- }(fs4.readSync);
5832
- function patchLchmod(fs5) {
5833
- fs5.lchmod = function(path12, mode, callback) {
5834
- fs5.open(
5835
- path12,
5831
+ }(fs5.readSync);
5832
+ function patchLchmod(fs6) {
5833
+ fs6.lchmod = function(path13, mode, callback) {
5834
+ fs6.open(
5835
+ path13,
5836
5836
  constants.O_WRONLY | constants.O_SYMLINK,
5837
5837
  mode,
5838
5838
  function(err, fd) {
@@ -5840,80 +5840,80 @@ var require_polyfills = __commonJS({
5840
5840
  if (callback) callback(err);
5841
5841
  return;
5842
5842
  }
5843
- fs5.fchmod(fd, mode, function(err2) {
5844
- fs5.close(fd, function(err22) {
5843
+ fs6.fchmod(fd, mode, function(err2) {
5844
+ fs6.close(fd, function(err22) {
5845
5845
  if (callback) callback(err2 || err22);
5846
5846
  });
5847
5847
  });
5848
5848
  }
5849
5849
  );
5850
5850
  };
5851
- fs5.lchmodSync = function(path12, mode) {
5852
- var fd = fs5.openSync(path12, constants.O_WRONLY | constants.O_SYMLINK, mode);
5851
+ fs6.lchmodSync = function(path13, mode) {
5852
+ var fd = fs6.openSync(path13, constants.O_WRONLY | constants.O_SYMLINK, mode);
5853
5853
  var threw = true;
5854
5854
  var ret;
5855
5855
  try {
5856
- ret = fs5.fchmodSync(fd, mode);
5856
+ ret = fs6.fchmodSync(fd, mode);
5857
5857
  threw = false;
5858
5858
  } finally {
5859
5859
  if (threw) {
5860
5860
  try {
5861
- fs5.closeSync(fd);
5861
+ fs6.closeSync(fd);
5862
5862
  } catch (er) {
5863
5863
  }
5864
5864
  } else {
5865
- fs5.closeSync(fd);
5865
+ fs6.closeSync(fd);
5866
5866
  }
5867
5867
  }
5868
5868
  return ret;
5869
5869
  };
5870
5870
  }
5871
- function patchLutimes(fs5) {
5872
- if (constants.hasOwnProperty("O_SYMLINK") && fs5.futimes) {
5873
- fs5.lutimes = function(path12, at, mt, cb) {
5874
- fs5.open(path12, constants.O_SYMLINK, function(er, fd) {
5871
+ function patchLutimes(fs6) {
5872
+ if (constants.hasOwnProperty("O_SYMLINK") && fs6.futimes) {
5873
+ fs6.lutimes = function(path13, at, mt, cb) {
5874
+ fs6.open(path13, constants.O_SYMLINK, function(er, fd) {
5875
5875
  if (er) {
5876
5876
  if (cb) cb(er);
5877
5877
  return;
5878
5878
  }
5879
- fs5.futimes(fd, at, mt, function(er2) {
5880
- fs5.close(fd, function(er22) {
5879
+ fs6.futimes(fd, at, mt, function(er2) {
5880
+ fs6.close(fd, function(er22) {
5881
5881
  if (cb) cb(er2 || er22);
5882
5882
  });
5883
5883
  });
5884
5884
  });
5885
5885
  };
5886
- fs5.lutimesSync = function(path12, at, mt) {
5887
- var fd = fs5.openSync(path12, constants.O_SYMLINK);
5886
+ fs6.lutimesSync = function(path13, at, mt) {
5887
+ var fd = fs6.openSync(path13, constants.O_SYMLINK);
5888
5888
  var ret;
5889
5889
  var threw = true;
5890
5890
  try {
5891
- ret = fs5.futimesSync(fd, at, mt);
5891
+ ret = fs6.futimesSync(fd, at, mt);
5892
5892
  threw = false;
5893
5893
  } finally {
5894
5894
  if (threw) {
5895
5895
  try {
5896
- fs5.closeSync(fd);
5896
+ fs6.closeSync(fd);
5897
5897
  } catch (er) {
5898
5898
  }
5899
5899
  } else {
5900
- fs5.closeSync(fd);
5900
+ fs6.closeSync(fd);
5901
5901
  }
5902
5902
  }
5903
5903
  return ret;
5904
5904
  };
5905
- } else if (fs5.futimes) {
5906
- fs5.lutimes = function(_a3, _b, _c, cb) {
5905
+ } else if (fs6.futimes) {
5906
+ fs6.lutimes = function(_a3, _b, _c, cb) {
5907
5907
  if (cb) process.nextTick(cb);
5908
5908
  };
5909
- fs5.lutimesSync = function() {
5909
+ fs6.lutimesSync = function() {
5910
5910
  };
5911
5911
  }
5912
5912
  }
5913
5913
  function chmodFix(orig) {
5914
5914
  if (!orig) return orig;
5915
5915
  return function(target, mode, cb) {
5916
- return orig.call(fs4, target, mode, function(er) {
5916
+ return orig.call(fs5, target, mode, function(er) {
5917
5917
  if (chownErOk(er)) er = null;
5918
5918
  if (cb) cb.apply(this, arguments);
5919
5919
  });
@@ -5923,7 +5923,7 @@ var require_polyfills = __commonJS({
5923
5923
  if (!orig) return orig;
5924
5924
  return function(target, mode) {
5925
5925
  try {
5926
- return orig.call(fs4, target, mode);
5926
+ return orig.call(fs5, target, mode);
5927
5927
  } catch (er) {
5928
5928
  if (!chownErOk(er)) throw er;
5929
5929
  }
@@ -5932,7 +5932,7 @@ var require_polyfills = __commonJS({
5932
5932
  function chownFix(orig) {
5933
5933
  if (!orig) return orig;
5934
5934
  return function(target, uid, gid, cb) {
5935
- return orig.call(fs4, target, uid, gid, function(er) {
5935
+ return orig.call(fs5, target, uid, gid, function(er) {
5936
5936
  if (chownErOk(er)) er = null;
5937
5937
  if (cb) cb.apply(this, arguments);
5938
5938
  });
@@ -5942,7 +5942,7 @@ var require_polyfills = __commonJS({
5942
5942
  if (!orig) return orig;
5943
5943
  return function(target, uid, gid) {
5944
5944
  try {
5945
- return orig.call(fs4, target, uid, gid);
5945
+ return orig.call(fs5, target, uid, gid);
5946
5946
  } catch (er) {
5947
5947
  if (!chownErOk(er)) throw er;
5948
5948
  }
@@ -5962,13 +5962,13 @@ var require_polyfills = __commonJS({
5962
5962
  }
5963
5963
  if (cb) cb.apply(this, arguments);
5964
5964
  }
5965
- return options ? orig.call(fs4, target, options, callback) : orig.call(fs4, target, callback);
5965
+ return options ? orig.call(fs5, target, options, callback) : orig.call(fs5, target, callback);
5966
5966
  };
5967
5967
  }
5968
5968
  function statFixSync(orig) {
5969
5969
  if (!orig) return orig;
5970
5970
  return function(target, options) {
5971
- var stats = options ? orig.call(fs4, target, options) : orig.call(fs4, target);
5971
+ var stats = options ? orig.call(fs5, target, options) : orig.call(fs5, target);
5972
5972
  if (stats) {
5973
5973
  if (stats.uid < 0) stats.uid += 4294967296;
5974
5974
  if (stats.gid < 0) stats.gid += 4294967296;
@@ -5997,16 +5997,16 @@ var require_legacy_streams = __commonJS({
5997
5997
  "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports2, module2) {
5998
5998
  var Stream = require("stream").Stream;
5999
5999
  module2.exports = legacy;
6000
- function legacy(fs4) {
6000
+ function legacy(fs5) {
6001
6001
  return {
6002
6002
  ReadStream,
6003
6003
  WriteStream
6004
6004
  };
6005
- function ReadStream(path12, options) {
6006
- if (!(this instanceof ReadStream)) return new ReadStream(path12, options);
6005
+ function ReadStream(path13, options) {
6006
+ if (!(this instanceof ReadStream)) return new ReadStream(path13, options);
6007
6007
  Stream.call(this);
6008
6008
  var self = this;
6009
- this.path = path12;
6009
+ this.path = path13;
6010
6010
  this.fd = null;
6011
6011
  this.readable = true;
6012
6012
  this.paused = false;
@@ -6040,7 +6040,7 @@ var require_legacy_streams = __commonJS({
6040
6040
  });
6041
6041
  return;
6042
6042
  }
6043
- fs4.open(this.path, this.flags, this.mode, function(err, fd) {
6043
+ fs5.open(this.path, this.flags, this.mode, function(err, fd) {
6044
6044
  if (err) {
6045
6045
  self.emit("error", err);
6046
6046
  self.readable = false;
@@ -6051,10 +6051,10 @@ var require_legacy_streams = __commonJS({
6051
6051
  self._read();
6052
6052
  });
6053
6053
  }
6054
- function WriteStream(path12, options) {
6055
- if (!(this instanceof WriteStream)) return new WriteStream(path12, options);
6054
+ function WriteStream(path13, options) {
6055
+ if (!(this instanceof WriteStream)) return new WriteStream(path13, options);
6056
6056
  Stream.call(this);
6057
- this.path = path12;
6057
+ this.path = path13;
6058
6058
  this.fd = null;
6059
6059
  this.writable = true;
6060
6060
  this.flags = "w";
@@ -6079,7 +6079,7 @@ var require_legacy_streams = __commonJS({
6079
6079
  this.busy = false;
6080
6080
  this._queue = [];
6081
6081
  if (this.fd === null) {
6082
- this._open = fs4.open;
6082
+ this._open = fs5.open;
6083
6083
  this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
6084
6084
  this.flush();
6085
6085
  }
@@ -6114,7 +6114,7 @@ var require_clone = __commonJS({
6114
6114
  // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js
6115
6115
  var require_graceful_fs = __commonJS({
6116
6116
  "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports2, module2) {
6117
- var fs4 = require("fs");
6117
+ var fs5 = require("fs");
6118
6118
  var polyfills = require_polyfills();
6119
6119
  var legacy = require_legacy_streams();
6120
6120
  var clone2 = require_clone();
@@ -6146,12 +6146,12 @@ var require_graceful_fs = __commonJS({
6146
6146
  m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
6147
6147
  console.error(m);
6148
6148
  };
6149
- if (!fs4[gracefulQueue]) {
6149
+ if (!fs5[gracefulQueue]) {
6150
6150
  queue = global[gracefulQueue] || [];
6151
- publishQueue(fs4, queue);
6152
- fs4.close = function(fs$close) {
6151
+ publishQueue(fs5, queue);
6152
+ fs5.close = function(fs$close) {
6153
6153
  function close(fd, cb) {
6154
- return fs$close.call(fs4, fd, function(err) {
6154
+ return fs$close.call(fs5, fd, function(err) {
6155
6155
  if (!err) {
6156
6156
  resetQueue();
6157
6157
  }
@@ -6163,48 +6163,48 @@ var require_graceful_fs = __commonJS({
6163
6163
  value: fs$close
6164
6164
  });
6165
6165
  return close;
6166
- }(fs4.close);
6167
- fs4.closeSync = function(fs$closeSync) {
6166
+ }(fs5.close);
6167
+ fs5.closeSync = function(fs$closeSync) {
6168
6168
  function closeSync(fd) {
6169
- fs$closeSync.apply(fs4, arguments);
6169
+ fs$closeSync.apply(fs5, arguments);
6170
6170
  resetQueue();
6171
6171
  }
6172
6172
  Object.defineProperty(closeSync, previousSymbol, {
6173
6173
  value: fs$closeSync
6174
6174
  });
6175
6175
  return closeSync;
6176
- }(fs4.closeSync);
6176
+ }(fs5.closeSync);
6177
6177
  if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
6178
6178
  process.on("exit", function() {
6179
- debug(fs4[gracefulQueue]);
6180
- require("assert").equal(fs4[gracefulQueue].length, 0);
6179
+ debug(fs5[gracefulQueue]);
6180
+ require("assert").equal(fs5[gracefulQueue].length, 0);
6181
6181
  });
6182
6182
  }
6183
6183
  }
6184
6184
  var queue;
6185
6185
  if (!global[gracefulQueue]) {
6186
- publishQueue(global, fs4[gracefulQueue]);
6187
- }
6188
- module2.exports = patch(clone2(fs4));
6189
- if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs4.__patched) {
6190
- module2.exports = patch(fs4);
6191
- fs4.__patched = true;
6192
- }
6193
- function patch(fs5) {
6194
- polyfills(fs5);
6195
- fs5.gracefulify = patch;
6196
- fs5.createReadStream = createReadStream;
6197
- fs5.createWriteStream = createWriteStream;
6198
- var fs$readFile = fs5.readFile;
6199
- fs5.readFile = readFile2;
6200
- function readFile2(path12, options, cb) {
6186
+ publishQueue(global, fs5[gracefulQueue]);
6187
+ }
6188
+ module2.exports = patch(clone2(fs5));
6189
+ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs5.__patched) {
6190
+ module2.exports = patch(fs5);
6191
+ fs5.__patched = true;
6192
+ }
6193
+ function patch(fs6) {
6194
+ polyfills(fs6);
6195
+ fs6.gracefulify = patch;
6196
+ fs6.createReadStream = createReadStream;
6197
+ fs6.createWriteStream = createWriteStream;
6198
+ var fs$readFile = fs6.readFile;
6199
+ fs6.readFile = readFile2;
6200
+ function readFile2(path13, options, cb) {
6201
6201
  if (typeof options === "function")
6202
6202
  cb = options, options = null;
6203
- return go$readFile(path12, options, cb);
6204
- function go$readFile(path13, options2, cb2, startTime) {
6205
- return fs$readFile(path13, options2, function(err) {
6203
+ return go$readFile(path13, options, cb);
6204
+ function go$readFile(path14, options2, cb2, startTime) {
6205
+ return fs$readFile(path14, options2, function(err) {
6206
6206
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
6207
- enqueue([go$readFile, [path13, options2, cb2], err, startTime || Date.now(), Date.now()]);
6207
+ enqueue([go$readFile, [path14, options2, cb2], err, startTime || Date.now(), Date.now()]);
6208
6208
  else {
6209
6209
  if (typeof cb2 === "function")
6210
6210
  cb2.apply(this, arguments);
@@ -6212,16 +6212,16 @@ var require_graceful_fs = __commonJS({
6212
6212
  });
6213
6213
  }
6214
6214
  }
6215
- var fs$writeFile = fs5.writeFile;
6216
- fs5.writeFile = writeFile;
6217
- function writeFile(path12, data, options, cb) {
6215
+ var fs$writeFile = fs6.writeFile;
6216
+ fs6.writeFile = writeFile;
6217
+ function writeFile(path13, data, options, cb) {
6218
6218
  if (typeof options === "function")
6219
6219
  cb = options, options = null;
6220
- return go$writeFile(path12, data, options, cb);
6221
- function go$writeFile(path13, data2, options2, cb2, startTime) {
6222
- return fs$writeFile(path13, data2, options2, function(err) {
6220
+ return go$writeFile(path13, data, options, cb);
6221
+ function go$writeFile(path14, data2, options2, cb2, startTime) {
6222
+ return fs$writeFile(path14, data2, options2, function(err) {
6223
6223
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
6224
- enqueue([go$writeFile, [path13, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
6224
+ enqueue([go$writeFile, [path14, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
6225
6225
  else {
6226
6226
  if (typeof cb2 === "function")
6227
6227
  cb2.apply(this, arguments);
@@ -6229,17 +6229,17 @@ var require_graceful_fs = __commonJS({
6229
6229
  });
6230
6230
  }
6231
6231
  }
6232
- var fs$appendFile = fs5.appendFile;
6232
+ var fs$appendFile = fs6.appendFile;
6233
6233
  if (fs$appendFile)
6234
- fs5.appendFile = appendFile;
6235
- function appendFile(path12, data, options, cb) {
6234
+ fs6.appendFile = appendFile;
6235
+ function appendFile(path13, data, options, cb) {
6236
6236
  if (typeof options === "function")
6237
6237
  cb = options, options = null;
6238
- return go$appendFile(path12, data, options, cb);
6239
- function go$appendFile(path13, data2, options2, cb2, startTime) {
6240
- return fs$appendFile(path13, data2, options2, function(err) {
6238
+ return go$appendFile(path13, data, options, cb);
6239
+ function go$appendFile(path14, data2, options2, cb2, startTime) {
6240
+ return fs$appendFile(path14, data2, options2, function(err) {
6241
6241
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
6242
- enqueue([go$appendFile, [path13, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
6242
+ enqueue([go$appendFile, [path14, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
6243
6243
  else {
6244
6244
  if (typeof cb2 === "function")
6245
6245
  cb2.apply(this, arguments);
@@ -6247,9 +6247,9 @@ var require_graceful_fs = __commonJS({
6247
6247
  });
6248
6248
  }
6249
6249
  }
6250
- var fs$copyFile = fs5.copyFile;
6250
+ var fs$copyFile = fs6.copyFile;
6251
6251
  if (fs$copyFile)
6252
- fs5.copyFile = copyFile;
6252
+ fs6.copyFile = copyFile;
6253
6253
  function copyFile(src, dest, flags, cb) {
6254
6254
  if (typeof flags === "function") {
6255
6255
  cb = flags;
@@ -6267,34 +6267,34 @@ var require_graceful_fs = __commonJS({
6267
6267
  });
6268
6268
  }
6269
6269
  }
6270
- var fs$readdir = fs5.readdir;
6271
- fs5.readdir = readdir;
6270
+ var fs$readdir = fs6.readdir;
6271
+ fs6.readdir = readdir;
6272
6272
  var noReaddirOptionVersions = /^v[0-5]\./;
6273
- function readdir(path12, options, cb) {
6273
+ function readdir(path13, options, cb) {
6274
6274
  if (typeof options === "function")
6275
6275
  cb = options, options = null;
6276
- var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path13, options2, cb2, startTime) {
6277
- return fs$readdir(path13, fs$readdirCallback(
6278
- path13,
6276
+ var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path14, options2, cb2, startTime) {
6277
+ return fs$readdir(path14, fs$readdirCallback(
6278
+ path14,
6279
6279
  options2,
6280
6280
  cb2,
6281
6281
  startTime
6282
6282
  ));
6283
- } : function go$readdir2(path13, options2, cb2, startTime) {
6284
- return fs$readdir(path13, options2, fs$readdirCallback(
6285
- path13,
6283
+ } : function go$readdir2(path14, options2, cb2, startTime) {
6284
+ return fs$readdir(path14, options2, fs$readdirCallback(
6285
+ path14,
6286
6286
  options2,
6287
6287
  cb2,
6288
6288
  startTime
6289
6289
  ));
6290
6290
  };
6291
- return go$readdir(path12, options, cb);
6292
- function fs$readdirCallback(path13, options2, cb2, startTime) {
6291
+ return go$readdir(path13, options, cb);
6292
+ function fs$readdirCallback(path14, options2, cb2, startTime) {
6293
6293
  return function(err, files) {
6294
6294
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
6295
6295
  enqueue([
6296
6296
  go$readdir,
6297
- [path13, options2, cb2],
6297
+ [path14, options2, cb2],
6298
6298
  err,
6299
6299
  startTime || Date.now(),
6300
6300
  Date.now()
@@ -6309,21 +6309,21 @@ var require_graceful_fs = __commonJS({
6309
6309
  }
6310
6310
  }
6311
6311
  if (process.version.substr(0, 4) === "v0.8") {
6312
- var legStreams = legacy(fs5);
6312
+ var legStreams = legacy(fs6);
6313
6313
  ReadStream = legStreams.ReadStream;
6314
6314
  WriteStream = legStreams.WriteStream;
6315
6315
  }
6316
- var fs$ReadStream = fs5.ReadStream;
6316
+ var fs$ReadStream = fs6.ReadStream;
6317
6317
  if (fs$ReadStream) {
6318
6318
  ReadStream.prototype = Object.create(fs$ReadStream.prototype);
6319
6319
  ReadStream.prototype.open = ReadStream$open;
6320
6320
  }
6321
- var fs$WriteStream = fs5.WriteStream;
6321
+ var fs$WriteStream = fs6.WriteStream;
6322
6322
  if (fs$WriteStream) {
6323
6323
  WriteStream.prototype = Object.create(fs$WriteStream.prototype);
6324
6324
  WriteStream.prototype.open = WriteStream$open;
6325
6325
  }
6326
- Object.defineProperty(fs5, "ReadStream", {
6326
+ Object.defineProperty(fs6, "ReadStream", {
6327
6327
  get: function() {
6328
6328
  return ReadStream;
6329
6329
  },
@@ -6333,7 +6333,7 @@ var require_graceful_fs = __commonJS({
6333
6333
  enumerable: true,
6334
6334
  configurable: true
6335
6335
  });
6336
- Object.defineProperty(fs5, "WriteStream", {
6336
+ Object.defineProperty(fs6, "WriteStream", {
6337
6337
  get: function() {
6338
6338
  return WriteStream;
6339
6339
  },
@@ -6344,7 +6344,7 @@ var require_graceful_fs = __commonJS({
6344
6344
  configurable: true
6345
6345
  });
6346
6346
  var FileReadStream = ReadStream;
6347
- Object.defineProperty(fs5, "FileReadStream", {
6347
+ Object.defineProperty(fs6, "FileReadStream", {
6348
6348
  get: function() {
6349
6349
  return FileReadStream;
6350
6350
  },
@@ -6355,7 +6355,7 @@ var require_graceful_fs = __commonJS({
6355
6355
  configurable: true
6356
6356
  });
6357
6357
  var FileWriteStream = WriteStream;
6358
- Object.defineProperty(fs5, "FileWriteStream", {
6358
+ Object.defineProperty(fs6, "FileWriteStream", {
6359
6359
  get: function() {
6360
6360
  return FileWriteStream;
6361
6361
  },
@@ -6365,7 +6365,7 @@ var require_graceful_fs = __commonJS({
6365
6365
  enumerable: true,
6366
6366
  configurable: true
6367
6367
  });
6368
- function ReadStream(path12, options) {
6368
+ function ReadStream(path13, options) {
6369
6369
  if (this instanceof ReadStream)
6370
6370
  return fs$ReadStream.apply(this, arguments), this;
6371
6371
  else
@@ -6385,7 +6385,7 @@ var require_graceful_fs = __commonJS({
6385
6385
  }
6386
6386
  });
6387
6387
  }
6388
- function WriteStream(path12, options) {
6388
+ function WriteStream(path13, options) {
6389
6389
  if (this instanceof WriteStream)
6390
6390
  return fs$WriteStream.apply(this, arguments), this;
6391
6391
  else
@@ -6403,22 +6403,22 @@ var require_graceful_fs = __commonJS({
6403
6403
  }
6404
6404
  });
6405
6405
  }
6406
- function createReadStream(path12, options) {
6407
- return new fs5.ReadStream(path12, options);
6406
+ function createReadStream(path13, options) {
6407
+ return new fs6.ReadStream(path13, options);
6408
6408
  }
6409
- function createWriteStream(path12, options) {
6410
- return new fs5.WriteStream(path12, options);
6409
+ function createWriteStream(path13, options) {
6410
+ return new fs6.WriteStream(path13, options);
6411
6411
  }
6412
- var fs$open = fs5.open;
6413
- fs5.open = open;
6414
- function open(path12, flags, mode, cb) {
6412
+ var fs$open = fs6.open;
6413
+ fs6.open = open;
6414
+ function open(path13, flags, mode, cb) {
6415
6415
  if (typeof mode === "function")
6416
6416
  cb = mode, mode = null;
6417
- return go$open(path12, flags, mode, cb);
6418
- function go$open(path13, flags2, mode2, cb2, startTime) {
6419
- return fs$open(path13, flags2, mode2, function(err, fd) {
6417
+ return go$open(path13, flags, mode, cb);
6418
+ function go$open(path14, flags2, mode2, cb2, startTime) {
6419
+ return fs$open(path14, flags2, mode2, function(err, fd) {
6420
6420
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
6421
- enqueue([go$open, [path13, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
6421
+ enqueue([go$open, [path14, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
6422
6422
  else {
6423
6423
  if (typeof cb2 === "function")
6424
6424
  cb2.apply(this, arguments);
@@ -6426,20 +6426,20 @@ var require_graceful_fs = __commonJS({
6426
6426
  });
6427
6427
  }
6428
6428
  }
6429
- return fs5;
6429
+ return fs6;
6430
6430
  }
6431
6431
  function enqueue(elem) {
6432
6432
  debug("ENQUEUE", elem[0].name, elem[1]);
6433
- fs4[gracefulQueue].push(elem);
6433
+ fs5[gracefulQueue].push(elem);
6434
6434
  retry();
6435
6435
  }
6436
6436
  var retryTimer;
6437
6437
  function resetQueue() {
6438
6438
  var now = Date.now();
6439
- for (var i = 0; i < fs4[gracefulQueue].length; ++i) {
6440
- if (fs4[gracefulQueue][i].length > 2) {
6441
- fs4[gracefulQueue][i][3] = now;
6442
- fs4[gracefulQueue][i][4] = now;
6439
+ for (var i = 0; i < fs5[gracefulQueue].length; ++i) {
6440
+ if (fs5[gracefulQueue][i].length > 2) {
6441
+ fs5[gracefulQueue][i][3] = now;
6442
+ fs5[gracefulQueue][i][4] = now;
6443
6443
  }
6444
6444
  }
6445
6445
  retry();
@@ -6447,9 +6447,9 @@ var require_graceful_fs = __commonJS({
6447
6447
  function retry() {
6448
6448
  clearTimeout(retryTimer);
6449
6449
  retryTimer = void 0;
6450
- if (fs4[gracefulQueue].length === 0)
6450
+ if (fs5[gracefulQueue].length === 0)
6451
6451
  return;
6452
- var elem = fs4[gracefulQueue].shift();
6452
+ var elem = fs5[gracefulQueue].shift();
6453
6453
  var fn = elem[0];
6454
6454
  var args = elem[1];
6455
6455
  var err = elem[2];
@@ -6471,7 +6471,7 @@ var require_graceful_fs = __commonJS({
6471
6471
  debug("RETRY", fn.name, args);
6472
6472
  fn.apply(null, args.concat([startTime]));
6473
6473
  } else {
6474
- fs4[gracefulQueue].push(elem);
6474
+ fs5[gracefulQueue].push(elem);
6475
6475
  }
6476
6476
  }
6477
6477
  if (retryTimer === void 0) {
@@ -6906,10 +6906,10 @@ var require_mtime_precision = __commonJS({
6906
6906
  "../../node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/lib/mtime-precision.js"(exports2, module2) {
6907
6907
  "use strict";
6908
6908
  var cacheSymbol = Symbol();
6909
- function probe(file2, fs4, callback) {
6910
- const cachedPrecision = fs4[cacheSymbol];
6909
+ function probe(file2, fs5, callback) {
6910
+ const cachedPrecision = fs5[cacheSymbol];
6911
6911
  if (cachedPrecision) {
6912
- return fs4.stat(file2, (err, stat2) => {
6912
+ return fs5.stat(file2, (err, stat2) => {
6913
6913
  if (err) {
6914
6914
  return callback(err);
6915
6915
  }
@@ -6917,16 +6917,16 @@ var require_mtime_precision = __commonJS({
6917
6917
  });
6918
6918
  }
6919
6919
  const mtime = new Date(Math.ceil(Date.now() / 1e3) * 1e3 + 5);
6920
- fs4.utimes(file2, mtime, mtime, (err) => {
6920
+ fs5.utimes(file2, mtime, mtime, (err) => {
6921
6921
  if (err) {
6922
6922
  return callback(err);
6923
6923
  }
6924
- fs4.stat(file2, (err2, stat2) => {
6924
+ fs5.stat(file2, (err2, stat2) => {
6925
6925
  if (err2) {
6926
6926
  return callback(err2);
6927
6927
  }
6928
6928
  const precision = stat2.mtime.getTime() % 1e3 === 0 ? "s" : "ms";
6929
- Object.defineProperty(fs4, cacheSymbol, { value: precision });
6929
+ Object.defineProperty(fs5, cacheSymbol, { value: precision });
6930
6930
  callback(null, stat2.mtime, precision);
6931
6931
  });
6932
6932
  });
@@ -6947,8 +6947,8 @@ var require_mtime_precision = __commonJS({
6947
6947
  var require_lockfile = __commonJS({
6948
6948
  "../../node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/lib/lockfile.js"(exports2, module2) {
6949
6949
  "use strict";
6950
- var path12 = require("path");
6951
- var fs4 = require_graceful_fs();
6950
+ var path13 = require("path");
6951
+ var fs5 = require_graceful_fs();
6952
6952
  var retry = require_retry2();
6953
6953
  var onExit = require_signal_exit();
6954
6954
  var mtimePrecision = require_mtime_precision();
@@ -6958,7 +6958,7 @@ var require_lockfile = __commonJS({
6958
6958
  }
6959
6959
  function resolveCanonicalPath(file2, options, callback) {
6960
6960
  if (!options.realpath) {
6961
- return callback(null, path12.resolve(file2));
6961
+ return callback(null, path13.resolve(file2));
6962
6962
  }
6963
6963
  options.fs.realpath(file2, callback);
6964
6964
  }
@@ -7079,7 +7079,7 @@ var require_lockfile = __commonJS({
7079
7079
  update: null,
7080
7080
  realpath: true,
7081
7081
  retries: 0,
7082
- fs: fs4,
7082
+ fs: fs5,
7083
7083
  onCompromised: (err) => {
7084
7084
  throw err;
7085
7085
  },
@@ -7123,7 +7123,7 @@ var require_lockfile = __commonJS({
7123
7123
  }
7124
7124
  function unlock(file2, options, callback) {
7125
7125
  options = {
7126
- fs: fs4,
7126
+ fs: fs5,
7127
7127
  realpath: true,
7128
7128
  ...options
7129
7129
  };
@@ -7145,7 +7145,7 @@ var require_lockfile = __commonJS({
7145
7145
  options = {
7146
7146
  stale: 1e4,
7147
7147
  realpath: true,
7148
- fs: fs4,
7148
+ fs: fs5,
7149
7149
  ...options
7150
7150
  };
7151
7151
  options.stale = Math.max(options.stale || 0, 2e3);
@@ -7184,16 +7184,16 @@ var require_lockfile = __commonJS({
7184
7184
  var require_adapter = __commonJS({
7185
7185
  "../../node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/lib/adapter.js"(exports2, module2) {
7186
7186
  "use strict";
7187
- var fs4 = require_graceful_fs();
7188
- function createSyncFs(fs5) {
7187
+ var fs5 = require_graceful_fs();
7188
+ function createSyncFs(fs6) {
7189
7189
  const methods = ["mkdir", "realpath", "stat", "rmdir", "utimes"];
7190
- const newFs = { ...fs5 };
7190
+ const newFs = { ...fs6 };
7191
7191
  methods.forEach((method) => {
7192
7192
  newFs[method] = (...args) => {
7193
7193
  const callback = args.pop();
7194
7194
  let ret;
7195
7195
  try {
7196
- ret = fs5[`${method}Sync`](...args);
7196
+ ret = fs6[`${method}Sync`](...args);
7197
7197
  } catch (err) {
7198
7198
  return callback(err);
7199
7199
  }
@@ -7231,7 +7231,7 @@ var require_adapter = __commonJS({
7231
7231
  }
7232
7232
  function toSyncOptions(options) {
7233
7233
  options = { ...options };
7234
- options.fs = createSyncFs(options.fs || fs4);
7234
+ options.fs = createSyncFs(options.fs || fs5);
7235
7235
  if (typeof options.retries === "number" && options.retries > 0 || options.retries && typeof options.retries.retries === "number" && options.retries.retries > 0) {
7236
7236
  throw Object.assign(new Error("Cannot use retries with the sync api"), { code: "ESYNC" });
7237
7237
  }
@@ -8822,10 +8822,10 @@ var require_segments = __commonJS({
8822
8822
  const segs = getSegmentsFromString(data, Utils.isKanjiModeEnabled());
8823
8823
  const nodes = buildNodes(segs);
8824
8824
  const graph = buildGraph(nodes, version2);
8825
- const path12 = dijkstra.find_path(graph.map, "start", "end");
8825
+ const path13 = dijkstra.find_path(graph.map, "start", "end");
8826
8826
  const optimizedSegs = [];
8827
- for (let i = 1; i < path12.length - 1; i++) {
8828
- optimizedSegs.push(graph.table[path12[i]].node);
8827
+ for (let i = 1; i < path13.length - 1; i++) {
8828
+ optimizedSegs.push(graph.table[path13[i]].node);
8829
8829
  }
8830
8830
  return exports2.fromArray(mergeSegments(optimizedSegs));
8831
8831
  };
@@ -11030,10 +11030,10 @@ var require_packer_sync = __commonJS({
11030
11030
  var require_png_sync = __commonJS({
11031
11031
  "../../node_modules/.pnpm/pngjs@5.0.0/node_modules/pngjs/lib/png-sync.js"(exports2) {
11032
11032
  "use strict";
11033
- var parse4 = require_parser_sync();
11033
+ var parse5 = require_parser_sync();
11034
11034
  var pack = require_packer_sync();
11035
11035
  exports2.read = function(buffer, options) {
11036
- return parse4(buffer, options || {});
11036
+ return parse5(buffer, options || {});
11037
11037
  };
11038
11038
  exports2.write = function(png, options) {
11039
11039
  return pack(png, options);
@@ -11261,7 +11261,7 @@ var require_utils2 = __commonJS({
11261
11261
  // ../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/png.js
11262
11262
  var require_png2 = __commonJS({
11263
11263
  "../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/png.js"(exports2) {
11264
- var fs4 = require("fs");
11264
+ var fs5 = require("fs");
11265
11265
  var PNG = require_png().PNG;
11266
11266
  var Utils = require_utils2();
11267
11267
  exports2.render = function render(qrData, options) {
@@ -11302,7 +11302,7 @@ var require_png2 = __commonJS({
11302
11302
  });
11303
11303
  png.pack();
11304
11304
  };
11305
- exports2.renderToFile = function renderToFile(path12, qrData, options, cb) {
11305
+ exports2.renderToFile = function renderToFile(path13, qrData, options, cb) {
11306
11306
  if (typeof cb === "undefined") {
11307
11307
  cb = options;
11308
11308
  options = void 0;
@@ -11313,7 +11313,7 @@ var require_png2 = __commonJS({
11313
11313
  called = true;
11314
11314
  cb.apply(null, args);
11315
11315
  };
11316
- const stream = fs4.createWriteStream(path12);
11316
+ const stream = fs5.createWriteStream(path13);
11317
11317
  stream.on("error", done);
11318
11318
  stream.on("close", done);
11319
11319
  exports2.renderToFileStream(stream, qrData, options);
@@ -11375,14 +11375,14 @@ var require_utf8 = __commonJS({
11375
11375
  }
11376
11376
  return output3;
11377
11377
  };
11378
- exports2.renderToFile = function renderToFile(path12, qrData, options, cb) {
11378
+ exports2.renderToFile = function renderToFile(path13, qrData, options, cb) {
11379
11379
  if (typeof cb === "undefined") {
11380
11380
  cb = options;
11381
11381
  options = void 0;
11382
11382
  }
11383
- const fs4 = require("fs");
11383
+ const fs5 = require("fs");
11384
11384
  const utf8 = exports2.render(qrData, options);
11385
- fs4.writeFile(path12, utf8, cb);
11385
+ fs5.writeFile(path13, utf8, cb);
11386
11386
  };
11387
11387
  }
11388
11388
  });
@@ -11503,7 +11503,7 @@ var require_svg_tag = __commonJS({
11503
11503
  return str;
11504
11504
  }
11505
11505
  function qrToPath(data, size, margin) {
11506
- let path12 = "";
11506
+ let path13 = "";
11507
11507
  let moveBy = 0;
11508
11508
  let newRow = false;
11509
11509
  let lineLength = 0;
@@ -11514,19 +11514,19 @@ var require_svg_tag = __commonJS({
11514
11514
  if (data[i]) {
11515
11515
  lineLength++;
11516
11516
  if (!(i > 0 && col > 0 && data[i - 1])) {
11517
- path12 += newRow ? svgCmd("M", col + margin, 0.5 + row + margin) : svgCmd("m", moveBy, 0);
11517
+ path13 += newRow ? svgCmd("M", col + margin, 0.5 + row + margin) : svgCmd("m", moveBy, 0);
11518
11518
  moveBy = 0;
11519
11519
  newRow = false;
11520
11520
  }
11521
11521
  if (!(col + 1 < size && data[i + 1])) {
11522
- path12 += svgCmd("h", lineLength);
11522
+ path13 += svgCmd("h", lineLength);
11523
11523
  lineLength = 0;
11524
11524
  }
11525
11525
  } else {
11526
11526
  moveBy++;
11527
11527
  }
11528
11528
  }
11529
- return path12;
11529
+ return path13;
11530
11530
  }
11531
11531
  exports2.render = function render(qrData, options, cb) {
11532
11532
  const opts = Utils.getOptions(options);
@@ -11534,10 +11534,10 @@ var require_svg_tag = __commonJS({
11534
11534
  const data = qrData.modules.data;
11535
11535
  const qrcodesize = size + opts.margin * 2;
11536
11536
  const bg = !opts.color.light.a ? "" : "<path " + getColorAttrib(opts.color.light, "fill") + ' d="M0 0h' + qrcodesize + "v" + qrcodesize + 'H0z"/>';
11537
- const path12 = "<path " + getColorAttrib(opts.color.dark, "stroke") + ' d="' + qrToPath(data, size, opts.margin) + '"/>';
11537
+ const path13 = "<path " + getColorAttrib(opts.color.dark, "stroke") + ' d="' + qrToPath(data, size, opts.margin) + '"/>';
11538
11538
  const viewBox = 'viewBox="0 0 ' + qrcodesize + " " + qrcodesize + '"';
11539
11539
  const width = !opts.width ? "" : 'width="' + opts.width + '" height="' + opts.width + '" ';
11540
- const svgTag = '<svg xmlns="http://www.w3.org/2000/svg" ' + width + viewBox + ' shape-rendering="crispEdges">' + bg + path12 + "</svg>\n";
11540
+ const svgTag = '<svg xmlns="http://www.w3.org/2000/svg" ' + width + viewBox + ' shape-rendering="crispEdges">' + bg + path13 + "</svg>\n";
11541
11541
  if (typeof cb === "function") {
11542
11542
  cb(null, svgTag);
11543
11543
  }
@@ -11551,15 +11551,15 @@ var require_svg = __commonJS({
11551
11551
  "../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/svg.js"(exports2) {
11552
11552
  var svgTagRenderer = require_svg_tag();
11553
11553
  exports2.render = svgTagRenderer.render;
11554
- exports2.renderToFile = function renderToFile(path12, qrData, options, cb) {
11554
+ exports2.renderToFile = function renderToFile(path13, qrData, options, cb) {
11555
11555
  if (typeof cb === "undefined") {
11556
11556
  cb = options;
11557
11557
  options = void 0;
11558
11558
  }
11559
- const fs4 = require("fs");
11559
+ const fs5 = require("fs");
11560
11560
  const svgTag = exports2.render(qrData, options);
11561
11561
  const xmlStr = '<?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">' + svgTag;
11562
- fs4.writeFile(path12, xmlStr, cb);
11562
+ fs5.writeFile(path13, xmlStr, cb);
11563
11563
  };
11564
11564
  }
11565
11565
  });
@@ -11717,8 +11717,8 @@ var require_server = __commonJS({
11717
11717
  cb
11718
11718
  };
11719
11719
  }
11720
- function getTypeFromFilename(path12) {
11721
- return path12.slice((path12.lastIndexOf(".") - 1 >>> 0) + 2).toLowerCase();
11720
+ function getTypeFromFilename(path13) {
11721
+ return path13.slice((path13.lastIndexOf(".") - 1 >>> 0) + 2).toLowerCase();
11722
11722
  }
11723
11723
  function getRendererFromType(type) {
11724
11724
  switch (type) {
@@ -11782,17 +11782,17 @@ var require_server = __commonJS({
11782
11782
  const renderer = getRendererFromType(params.opts.type);
11783
11783
  return render(renderer.renderToBuffer, text, params);
11784
11784
  };
11785
- exports2.toFile = function toFile(path12, text, opts, cb) {
11786
- if (typeof path12 !== "string" || !(typeof text === "string" || typeof text === "object")) {
11785
+ exports2.toFile = function toFile(path13, text, opts, cb) {
11786
+ if (typeof path13 !== "string" || !(typeof text === "string" || typeof text === "object")) {
11787
11787
  throw new Error("Invalid argument");
11788
11788
  }
11789
11789
  if (arguments.length < 3 && !canPromise()) {
11790
11790
  throw new Error("Too few arguments provided");
11791
11791
  }
11792
11792
  const params = checkParams(text, opts, cb);
11793
- const type = params.opts.type || getTypeFromFilename(path12);
11793
+ const type = params.opts.type || getTypeFromFilename(path13);
11794
11794
  const renderer = getRendererFromType(type);
11795
- const renderToFile = renderer.renderToFile.bind(null, path12);
11795
+ const renderToFile = renderer.renderToFile.bind(null, path13);
11796
11796
  return render(renderToFile, text, params);
11797
11797
  };
11798
11798
  exports2.toFileStream = function toFileStream(stream, text, opts) {
@@ -15010,8 +15010,8 @@ var require_utils3 = __commonJS({
15010
15010
  }
15011
15011
  return ind;
15012
15012
  }
15013
- function removeDotSegments(path12) {
15014
- let input = path12;
15013
+ function removeDotSegments(path13) {
15014
+ let input = path13;
15015
15015
  const output3 = [];
15016
15016
  let nextSlash = -1;
15017
15017
  let len = 0;
@@ -15263,8 +15263,8 @@ var require_schemes = __commonJS({
15263
15263
  wsComponent.secure = void 0;
15264
15264
  }
15265
15265
  if (wsComponent.resourceName) {
15266
- const [path12, query] = wsComponent.resourceName.split("?");
15267
- wsComponent.path = path12 && path12 !== "/" ? path12 : void 0;
15266
+ const [path13, query] = wsComponent.resourceName.split("?");
15267
+ wsComponent.path = path13 && path13 !== "/" ? path13 : void 0;
15268
15268
  wsComponent.query = query;
15269
15269
  wsComponent.resourceName = void 0;
15270
15270
  }
@@ -15419,21 +15419,21 @@ var require_fast_uri = __commonJS({
15419
15419
  normalizeString(uri, options);
15420
15420
  } else if (typeof uri === "object") {
15421
15421
  uri = /** @type {T} */
15422
- parse4(serialize(uri, options), options);
15422
+ parse5(serialize(uri, options), options);
15423
15423
  }
15424
15424
  return uri;
15425
15425
  }
15426
15426
  function resolve(baseURI, relativeURI, options) {
15427
15427
  const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
15428
- const resolved = resolveComponent(parse4(baseURI, schemelessOptions), parse4(relativeURI, schemelessOptions), schemelessOptions, true);
15428
+ const resolved = resolveComponent(parse5(baseURI, schemelessOptions), parse5(relativeURI, schemelessOptions), schemelessOptions, true);
15429
15429
  schemelessOptions.skipEscape = true;
15430
15430
  return serialize(resolved, schemelessOptions);
15431
15431
  }
15432
15432
  function resolveComponent(base, relative, options, skipNormalization) {
15433
15433
  const target = {};
15434
15434
  if (!skipNormalization) {
15435
- base = parse4(serialize(base, options), options);
15436
- relative = parse4(serialize(relative, options), options);
15435
+ base = parse5(serialize(base, options), options);
15436
+ relative = parse5(serialize(relative, options), options);
15437
15437
  }
15438
15438
  options = options || {};
15439
15439
  if (!options.tolerant && relative.scheme) {
@@ -15656,7 +15656,7 @@ var require_fast_uri = __commonJS({
15656
15656
  }
15657
15657
  return { parsed, malformedAuthorityOrPort };
15658
15658
  }
15659
- function parse4(uri, opts) {
15659
+ function parse5(uri, opts) {
15660
15660
  return parseWithStatus(uri, opts).parsed;
15661
15661
  }
15662
15662
  function normalizeString(uri, opts) {
@@ -15685,7 +15685,7 @@ var require_fast_uri = __commonJS({
15685
15685
  resolveComponent,
15686
15686
  equal,
15687
15687
  serialize,
15688
- parse: parse4
15688
+ parse: parse5
15689
15689
  };
15690
15690
  module2.exports = fastUri;
15691
15691
  module2.exports.default = fastUri;
@@ -18657,12 +18657,12 @@ var require_dist = __commonJS({
18657
18657
  throw new Error(`Unknown format "${name}"`);
18658
18658
  return f;
18659
18659
  };
18660
- function addFormats(ajv, list, fs4, exportName) {
18660
+ function addFormats(ajv, list, fs5, exportName) {
18661
18661
  var _a3;
18662
18662
  var _b;
18663
18663
  (_a3 = (_b = ajv.opts.code).formats) !== null && _a3 !== void 0 ? _a3 : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
18664
18664
  for (const f of list)
18665
- ajv.addFormat(f, fs4[f]);
18665
+ ajv.addFormat(f, fs5[f]);
18666
18666
  }
18667
18667
  module2.exports = exports2 = formatsPlugin;
18668
18668
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -18671,11 +18671,11 @@ var require_dist = __commonJS({
18671
18671
  });
18672
18672
 
18673
18673
  // src/bin.ts
18674
- var import_node_path18 = __toESM(require("node:path"), 1);
18674
+ var import_node_path19 = __toESM(require("node:path"), 1);
18675
18675
  var import_node_child_process7 = require("node:child_process");
18676
18676
  var import_node_fs13 = require("node:fs");
18677
- var import_node_os9 = require("node:os");
18678
- var import_node_path19 = __toESM(require("node:path"), 1);
18677
+ var import_node_os10 = require("node:os");
18678
+ var import_node_path20 = __toESM(require("node:path"), 1);
18679
18679
 
18680
18680
  // src/install-codex.ts
18681
18681
  var import_promises = __toESM(require("node:fs/promises"), 1);
@@ -20073,10 +20073,10 @@ function mergeDefs(...defs) {
20073
20073
  function cloneDef(schema) {
20074
20074
  return mergeDefs(schema._zod.def);
20075
20075
  }
20076
- function getElementAtPath(obj, path12) {
20077
- if (!path12)
20076
+ function getElementAtPath(obj, path13) {
20077
+ if (!path13)
20078
20078
  return obj;
20079
- return path12.reduce((acc, key) => acc?.[key], obj);
20079
+ return path13.reduce((acc, key) => acc?.[key], obj);
20080
20080
  }
20081
20081
  function promiseAllObject(promisesObj) {
20082
20082
  const keys = Object.keys(promisesObj);
@@ -20485,11 +20485,11 @@ function explicitlyAborted(x, startIndex = 0) {
20485
20485
  }
20486
20486
  return false;
20487
20487
  }
20488
- function prefixIssues(path12, issues) {
20488
+ function prefixIssues(path13, issues) {
20489
20489
  return issues.map((iss) => {
20490
20490
  var _a3;
20491
20491
  (_a3 = iss).path ?? (_a3.path = []);
20492
- iss.path.unshift(path12);
20492
+ iss.path.unshift(path13);
20493
20493
  return iss;
20494
20494
  });
20495
20495
  }
@@ -20636,16 +20636,16 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
20636
20636
  }
20637
20637
  function formatError(error51, mapper = (issue2) => issue2.message) {
20638
20638
  const fieldErrors = { _errors: [] };
20639
- const processError = (error52, path12 = []) => {
20639
+ const processError = (error52, path13 = []) => {
20640
20640
  for (const issue2 of error52.issues) {
20641
20641
  if (issue2.code === "invalid_union" && issue2.errors.length) {
20642
- issue2.errors.map((issues) => processError({ issues }, [...path12, ...issue2.path]));
20642
+ issue2.errors.map((issues) => processError({ issues }, [...path13, ...issue2.path]));
20643
20643
  } else if (issue2.code === "invalid_key") {
20644
- processError({ issues: issue2.issues }, [...path12, ...issue2.path]);
20644
+ processError({ issues: issue2.issues }, [...path13, ...issue2.path]);
20645
20645
  } else if (issue2.code === "invalid_element") {
20646
- processError({ issues: issue2.issues }, [...path12, ...issue2.path]);
20646
+ processError({ issues: issue2.issues }, [...path13, ...issue2.path]);
20647
20647
  } else {
20648
- const fullpath = [...path12, ...issue2.path];
20648
+ const fullpath = [...path13, ...issue2.path];
20649
20649
  if (fullpath.length === 0) {
20650
20650
  fieldErrors._errors.push(mapper(issue2));
20651
20651
  } else {
@@ -20672,17 +20672,17 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
20672
20672
  }
20673
20673
  function treeifyError(error51, mapper = (issue2) => issue2.message) {
20674
20674
  const result = { errors: [] };
20675
- const processError = (error52, path12 = []) => {
20675
+ const processError = (error52, path13 = []) => {
20676
20676
  var _a3, _b;
20677
20677
  for (const issue2 of error52.issues) {
20678
20678
  if (issue2.code === "invalid_union" && issue2.errors.length) {
20679
- issue2.errors.map((issues) => processError({ issues }, [...path12, ...issue2.path]));
20679
+ issue2.errors.map((issues) => processError({ issues }, [...path13, ...issue2.path]));
20680
20680
  } else if (issue2.code === "invalid_key") {
20681
- processError({ issues: issue2.issues }, [...path12, ...issue2.path]);
20681
+ processError({ issues: issue2.issues }, [...path13, ...issue2.path]);
20682
20682
  } else if (issue2.code === "invalid_element") {
20683
- processError({ issues: issue2.issues }, [...path12, ...issue2.path]);
20683
+ processError({ issues: issue2.issues }, [...path13, ...issue2.path]);
20684
20684
  } else {
20685
- const fullpath = [...path12, ...issue2.path];
20685
+ const fullpath = [...path13, ...issue2.path];
20686
20686
  if (fullpath.length === 0) {
20687
20687
  result.errors.push(mapper(issue2));
20688
20688
  continue;
@@ -20714,8 +20714,8 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
20714
20714
  }
20715
20715
  function toDotPath(_path) {
20716
20716
  const segs = [];
20717
- const path12 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
20718
- for (const seg of path12) {
20717
+ const path13 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
20718
+ for (const seg of path13) {
20719
20719
  if (typeof seg === "number")
20720
20720
  segs.push(`[${seg}]`);
20721
20721
  else if (typeof seg === "symbol")
@@ -33407,13 +33407,13 @@ function resolveRef(ref, ctx) {
33407
33407
  if (!ref.startsWith("#")) {
33408
33408
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
33409
33409
  }
33410
- const path12 = ref.slice(1).split("/").filter(Boolean);
33411
- if (path12.length === 0) {
33410
+ const path13 = ref.slice(1).split("/").filter(Boolean);
33411
+ if (path13.length === 0) {
33412
33412
  return ctx.rootSchema;
33413
33413
  }
33414
33414
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
33415
- if (path12[0] === defsKey) {
33416
- const key = path12[1];
33415
+ if (path13[0] === defsKey) {
33416
+ const key = path13[1];
33417
33417
  if (!key || !ctx.defs[key]) {
33418
33418
  throw new Error(`Reference not found: ${ref}`);
33419
33419
  }
@@ -35035,18 +35035,18 @@ function createMrrlinClient(config2) {
35035
35035
  const customFetch = config2.fetch ?? globalThis.fetch;
35036
35036
  const baseUrl = config2.baseUrl.replace(/\/$/, "");
35037
35037
  const token = config2.token;
35038
- async function request(path12, init) {
35038
+ async function request(path13, init) {
35039
35039
  const method = init?.method ?? "GET";
35040
35040
  const headers = new Headers(init?.headers ?? {});
35041
35041
  if (token && !headers.has("authorization")) {
35042
35042
  headers.set("authorization", `Bearer ${token}`);
35043
35043
  }
35044
- const response = await customFetch(`${baseUrl}${path12}`, { ...init, headers });
35044
+ const response = await customFetch(`${baseUrl}${path13}`, { ...init, headers });
35045
35045
  if (!response.ok) {
35046
35046
  const body = await response.text();
35047
35047
  let code = `HTTP_${response.status}`;
35048
35048
  let violations = null;
35049
- let message = `Mrrlin API ${method} ${path12} failed: ${response.status}`;
35049
+ let message = `Mrrlin API ${method} ${path13} failed: ${response.status}`;
35050
35050
  try {
35051
35051
  const parsed = JSON.parse(body);
35052
35052
  const violationsParsed = apiViolationsErrorSchema.safeParse(parsed);
@@ -35066,7 +35066,7 @@ function createMrrlinClient(config2) {
35066
35066
  throw new MrrlinApiError({
35067
35067
  code,
35068
35068
  method,
35069
- path: path12,
35069
+ path: path13,
35070
35070
  responseBody: body,
35071
35071
  status: response.status,
35072
35072
  violations,
@@ -35317,7 +35317,7 @@ function createMrrlinClient(config2) {
35317
35317
  return taskEventListResponseSchema.parse(body).data;
35318
35318
  },
35319
35319
  async listTasks(projectSlug, filters = {}) {
35320
- const path12 = appendQuery(`${projectPath(projectSlug)}/tasks`, {
35320
+ const path13 = appendQuery(`${projectPath(projectSlug)}/tasks`, {
35321
35321
  assignee: filters.assignee,
35322
35322
  autonomyLevel: filters.autonomyLevel,
35323
35323
  blockedBy: filters.blockedBy,
@@ -35329,7 +35329,7 @@ function createMrrlinClient(config2) {
35329
35329
  subcategory: filters.subcategory,
35330
35330
  type: filters.type
35331
35331
  });
35332
- const body = await request(path12);
35332
+ const body = await request(path13);
35333
35333
  return taskListResponseSchema.parse(body).data;
35334
35334
  },
35335
35335
  async listTaxonomy(projectSlug) {
@@ -35337,22 +35337,22 @@ function createMrrlinClient(config2) {
35337
35337
  return taxonomyListResponseSchema.parse(body).data;
35338
35338
  },
35339
35339
  async listWikiPages(projectSlug, filters = {}) {
35340
- const path12 = appendQuery(`${projectPath(projectSlug)}/wiki`, {
35340
+ const path13 = appendQuery(`${projectPath(projectSlug)}/wiki`, {
35341
35341
  folder: filters.folder,
35342
35342
  q: filters.q,
35343
35343
  taskId: filters.taskId
35344
35344
  });
35345
- const body = await request(path12);
35345
+ const body = await request(path13);
35346
35346
  return wikiPageListResponseSchema.parse(body).data;
35347
35347
  },
35348
35348
  async searchWikiPages(projectSlug, query) {
35349
- const path12 = appendQuery(`${projectPath(projectSlug)}/wiki/search`, {
35349
+ const path13 = appendQuery(`${projectPath(projectSlug)}/wiki/search`, {
35350
35350
  folder: query.folder,
35351
35351
  limit: query.limit === void 0 ? void 0 : String(query.limit),
35352
35352
  pathPrefix: query.pathPrefix,
35353
35353
  q: query.q
35354
35354
  });
35355
- const body = await request(path12);
35355
+ const body = await request(path13);
35356
35356
  return wikiPageSearchResponseSchema.parse(body).data;
35357
35357
  },
35358
35358
  async updatePlan(projectSlug, planId, patch) {
@@ -40661,9 +40661,9 @@ var DirectorRelay = class {
40661
40661
 
40662
40662
  // src/remote-phone-relay.ts
40663
40663
  function loadOrCreateAgentDeviceKey() {
40664
- const path12 = (0, import_node_path7.join)((0, import_node_os5.homedir)(), ".mrrlin", "agent-device-key");
40664
+ const path13 = (0, import_node_path7.join)((0, import_node_os5.homedir)(), ".mrrlin", "agent-device-key");
40665
40665
  try {
40666
- const raw = JSON.parse((0, import_node_fs6.readFileSync)(path12, "utf8"));
40666
+ const raw = JSON.parse((0, import_node_fs6.readFileSync)(path13, "utf8"));
40667
40667
  if (typeof raw.priv === "string" && typeof raw.pub === "string") {
40668
40668
  return { privateKey: fromBase64Url(raw.priv), publicKey: fromBase64Url(raw.pub) };
40669
40669
  }
@@ -40673,7 +40673,7 @@ function loadOrCreateAgentDeviceKey() {
40673
40673
  try {
40674
40674
  (0, import_node_fs6.mkdirSync)((0, import_node_path7.join)((0, import_node_os5.homedir)(), ".mrrlin"), { recursive: true });
40675
40675
  (0, import_node_fs6.writeFileSync)(
40676
- path12,
40676
+ path13,
40677
40677
  JSON.stringify({ priv: toBase64Url(kp.privateKey), pub: toBase64Url(kp.publicKey) }),
40678
40678
  { mode: 384 }
40679
40679
  );
@@ -40888,9 +40888,9 @@ var CheckoutRegistry = class {
40888
40888
  get(slug) {
40889
40889
  return this.read()[slug] ?? null;
40890
40890
  }
40891
- confirm(slug, path12, now) {
40891
+ confirm(slug, path13, now) {
40892
40892
  const all = this.read();
40893
- all[slug] = { path: path12, confirmedAt: now };
40893
+ all[slug] = { path: path13, confirmedAt: now };
40894
40894
  (0, import_node_fs7.writeFileSync)(this.file, JSON.stringify(all, null, 2));
40895
40895
  }
40896
40896
  };
@@ -41034,7 +41034,7 @@ function writeExecutorCodexHome(scratchDir, opts) {
41034
41034
  '[permissions.executor.filesystem.":workspace_roots"]',
41035
41035
  '"**/.env*" = "deny"'
41036
41036
  ].join("\n");
41037
- const toml2 = [
41037
+ const toml3 = [
41038
41038
  'default_permissions = "executor"',
41039
41039
  "",
41040
41040
  "[permissions.executor]",
@@ -41049,7 +41049,7 @@ function writeExecutorCodexHome(scratchDir, opts) {
41049
41049
  networkSection,
41050
41050
  ""
41051
41051
  ].join("\n");
41052
- (0, import_node_fs9.writeFileSync)((0, import_node_path10.join)(codexHome, "config.toml"), toml2, "utf8");
41052
+ (0, import_node_fs9.writeFileSync)((0, import_node_path10.join)(codexHome, "config.toml"), toml3, "utf8");
41053
41053
  return codexHome;
41054
41054
  }
41055
41055
  async function startExecutorServer(opts) {
@@ -48531,6 +48531,53 @@ function uninstallService(deps) {
48531
48531
  return { ok: true };
48532
48532
  }
48533
48533
 
48534
+ // src/uninstall-codex.ts
48535
+ var import_promises4 = __toESM(require("node:fs/promises"), 1);
48536
+ var import_node_os9 = __toESM(require("node:os"), 1);
48537
+ var import_node_path18 = __toESM(require("node:path"), 1);
48538
+ var toml2 = __toESM(require_toml(), 1);
48539
+ function resolveCodexHome2(options) {
48540
+ if (options.codexHome) return options.codexHome;
48541
+ if (process.env.CODEX_HOME) return process.env.CODEX_HOME;
48542
+ return import_node_path18.default.join(options.homeDir ?? import_node_os9.default.homedir(), ".codex");
48543
+ }
48544
+ async function pathExists3(target) {
48545
+ try {
48546
+ await import_promises4.default.access(target);
48547
+ return true;
48548
+ } catch {
48549
+ return false;
48550
+ }
48551
+ }
48552
+ var MRRLIN_BLOCK_RE2 = /(^|\n)\[mcp_servers\.mrrlin(?:\]|\.[^\]\n]*\])[\s\S]*?(?=\n\[|$)/g;
48553
+ async function uninstallCodex(options = {}) {
48554
+ const codexHome = resolveCodexHome2(options);
48555
+ const configPath = import_node_path18.default.join(codexHome, "config.toml");
48556
+ if (!await pathExists3(configPath)) {
48557
+ return { action: "missing", configPath };
48558
+ }
48559
+ const realPath = await import_promises4.default.realpath(configPath).catch(() => configPath);
48560
+ const existing = await import_promises4.default.readFile(realPath, "utf8");
48561
+ let parsed = null;
48562
+ try {
48563
+ parsed = toml2.parse(existing);
48564
+ } catch (error51) {
48565
+ const detail = error51 instanceof Error ? error51.message : String(error51);
48566
+ const err = {
48567
+ code: "CODEX_CONFIG_PARSE_FAILED",
48568
+ configPath: realPath,
48569
+ detail: `Refusing to edit a config.toml we cannot parse: ${detail}`
48570
+ };
48571
+ throw Object.assign(new Error(err.detail), err);
48572
+ }
48573
+ if (parsed?.mcp_servers?.["mrrlin"] === void 0) {
48574
+ return { action: "noop", configPath: realPath };
48575
+ }
48576
+ const stripped = existing.replace(MRRLIN_BLOCK_RE2, (match) => match.startsWith("\n") ? "\n" : "").replace(/\n{3,}/g, "\n\n").replace(/^\n+/, "");
48577
+ await import_promises4.default.writeFile(realPath, stripped, { mode: 384 });
48578
+ return { action: "removed", configPath: realPath };
48579
+ }
48580
+
48534
48581
  // src/bin.ts
48535
48582
  function pm2Runner(args) {
48536
48583
  const r = (0, import_node_child_process7.spawnSync)("pm2", args, { encoding: "utf8" });
@@ -48627,6 +48674,16 @@ Usage:
48627
48674
  active server-side; revoke it in Settings to
48628
48675
  fully retire it.
48629
48676
 
48677
+ mrrlin-mcp uninstall Full teardown of Mrrlin's local footprint:
48678
+ the pm2 service, the [mcp_servers.mrrlin] block
48679
+ in ~/.codex/config.toml (other servers untouched),
48680
+ and the whole ~/.mrrlin dir (credential, token,
48681
+ bridge/worker state). Then prints the two steps
48682
+ it cannot do for you: 'npm uninstall -g
48683
+ @mrrlin-dev/mcp' (a process can't delete its own
48684
+ binary) and the Settings credential revoke. Leaves
48685
+ global pm2 alone (it may be used elsewhere).
48686
+
48630
48687
  mrrlin-mcp --help Show this help.
48631
48688
 
48632
48689
  Operator notes:
@@ -48672,7 +48729,7 @@ async function main() {
48672
48729
  env: process.env,
48673
48730
  cwd: process.cwd(),
48674
48731
  writeFile: (p, c) => {
48675
- (0, import_node_fs13.mkdirSync)(import_node_path19.default.dirname(p), { recursive: true, mode: 448 });
48732
+ (0, import_node_fs13.mkdirSync)(import_node_path20.default.dirname(p), { recursive: true, mode: 448 });
48676
48733
  (0, import_node_fs13.writeFileSync)(p, c, { mode: 384 });
48677
48734
  },
48678
48735
  runPm2: pm2Runner,
@@ -48697,12 +48754,76 @@ async function main() {
48697
48754
  purgeSecret: purge,
48698
48755
  secretPath: agentCredentialPath(),
48699
48756
  tokenPath: operatorTokenPath(),
48700
- ecoPath: import_node_path19.default.join(process.env.HOME ?? (0, import_node_os9.homedir)(), ".mrrlin", "ecosystem.config.cjs"),
48757
+ ecoPath: import_node_path20.default.join(process.env.HOME ?? (0, import_node_os10.homedir)(), ".mrrlin", "ecosystem.config.cjs"),
48701
48758
  log: (m) => process.stderr.write(`[mrrlin-mcp uninstall-service] ${m}
48702
48759
  `)
48703
48760
  });
48704
48761
  return;
48705
48762
  }
48763
+ case "uninstall": {
48764
+ const home = process.env.HOME ?? (0, import_node_os10.homedir)();
48765
+ const log = (m) => process.stderr.write(`[mrrlin-mcp uninstall] ${m}
48766
+ `);
48767
+ uninstallService({
48768
+ runPm2: (a) => ({ code: pm2Runner(a).code }),
48769
+ removeFile: (p) => {
48770
+ try {
48771
+ (0, import_node_fs13.rmSync)(p, { force: true });
48772
+ } catch {
48773
+ }
48774
+ },
48775
+ purgeSecret: true,
48776
+ secretPath: agentCredentialPath(),
48777
+ tokenPath: operatorTokenPath(),
48778
+ ecoPath: import_node_path20.default.join(home, ".mrrlin", "ecosystem.config.cjs"),
48779
+ log
48780
+ });
48781
+ let codexOk = true;
48782
+ let codexConfigPath = "~/.codex/config.toml";
48783
+ try {
48784
+ const res = await uninstallCodex({});
48785
+ codexConfigPath = res.configPath;
48786
+ log(`codex config: ${res.action} (${res.configPath})`);
48787
+ } catch (error51) {
48788
+ codexOk = false;
48789
+ if (error51 && typeof error51 === "object" && typeof error51.configPath === "string") {
48790
+ codexConfigPath = error51.configPath;
48791
+ }
48792
+ log(`codex config NOT modified: ${error51 instanceof Error ? error51.message : String(error51)}`);
48793
+ }
48794
+ try {
48795
+ (0, import_node_fs13.rmSync)(import_node_path20.default.join(home, ".mrrlin"), { recursive: true, force: true });
48796
+ } catch {
48797
+ }
48798
+ log("removed ~/.mrrlin");
48799
+ if (codexOk) {
48800
+ process.stderr.write(
48801
+ [
48802
+ "",
48803
+ "Mrrlin's local footprint is gone. Two manual steps remain:",
48804
+ " 1) Remove the CLI \u2014 a running process can't delete its own binary:",
48805
+ " npm uninstall -g @mrrlin-dev/mcp",
48806
+ " 2) Revoke the agent credential in Mrrlin Settings \u2014 the local copy is",
48807
+ " wiped, but the server-side credential stays ACTIVE until revoked.",
48808
+ " \u2022 Optional: if you installed pm2 only for Mrrlin: npm uninstall -g pm2",
48809
+ ""
48810
+ ].join("\n")
48811
+ );
48812
+ } else {
48813
+ process.stderr.write(
48814
+ [
48815
+ "",
48816
+ "PARTIAL UNINSTALL \u2014 the codex config could not be edited (see the error above).",
48817
+ `The [mcp_servers.mrrlin] block is still live. Remove it from ${codexConfigPath}`,
48818
+ "by hand, then run: npm uninstall -g @mrrlin-dev/mcp",
48819
+ "Also revoke the agent credential in Mrrlin Settings.",
48820
+ ""
48821
+ ].join("\n")
48822
+ );
48823
+ process.exitCode = 2;
48824
+ }
48825
+ return;
48826
+ }
48706
48827
  default: {
48707
48828
  process.stderr.write(`Unknown command: ${command}
48708
48829
 
@@ -48712,7 +48833,7 @@ ${HELP_TEXT}`);
48712
48833
  }
48713
48834
  }
48714
48835
  function resolveSelfBinPath() {
48715
- return import_node_path18.default.resolve(process.argv[1] ?? process.execPath);
48836
+ return import_node_path19.default.resolve(process.argv[1] ?? process.execPath);
48716
48837
  }
48717
48838
  main().catch((error51) => {
48718
48839
  process.stderr.write(`mrrlin-mcp fatal error: ${error51 instanceof Error ? error51.message : String(error51)}