@mrrlin-dev/mcp 0.3.24 → 0.3.25

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 +289 -244
  2. package/package.json +3 -3
package/dist/bin.cjs CHANGED
@@ -7729,14 +7729,14 @@ var require_polyfills = __commonJS({
7729
7729
  fs7.fstatSync = statFixSync(fs7.fstatSync);
7730
7730
  fs7.lstatSync = statFixSync(fs7.lstatSync);
7731
7731
  if (fs7.chmod && !fs7.lchmod) {
7732
- fs7.lchmod = function(path15, mode, cb) {
7732
+ fs7.lchmod = function(path16, mode, cb) {
7733
7733
  if (cb) process.nextTick(cb);
7734
7734
  };
7735
7735
  fs7.lchmodSync = function() {
7736
7736
  };
7737
7737
  }
7738
7738
  if (fs7.chown && !fs7.lchown) {
7739
- fs7.lchown = function(path15, uid, gid, cb) {
7739
+ fs7.lchown = function(path16, uid, gid, cb) {
7740
7740
  if (cb) process.nextTick(cb);
7741
7741
  };
7742
7742
  fs7.lchownSync = function() {
@@ -7803,9 +7803,9 @@ var require_polyfills = __commonJS({
7803
7803
  };
7804
7804
  }(fs7.readSync);
7805
7805
  function patchLchmod(fs8) {
7806
- fs8.lchmod = function(path15, mode, callback) {
7806
+ fs8.lchmod = function(path16, mode, callback) {
7807
7807
  fs8.open(
7808
- path15,
7808
+ path16,
7809
7809
  constants.O_WRONLY | constants.O_SYMLINK,
7810
7810
  mode,
7811
7811
  function(err, fd) {
@@ -7821,8 +7821,8 @@ var require_polyfills = __commonJS({
7821
7821
  }
7822
7822
  );
7823
7823
  };
7824
- fs8.lchmodSync = function(path15, mode) {
7825
- var fd = fs8.openSync(path15, constants.O_WRONLY | constants.O_SYMLINK, mode);
7824
+ fs8.lchmodSync = function(path16, mode) {
7825
+ var fd = fs8.openSync(path16, constants.O_WRONLY | constants.O_SYMLINK, mode);
7826
7826
  var threw = true;
7827
7827
  var ret;
7828
7828
  try {
@@ -7843,8 +7843,8 @@ var require_polyfills = __commonJS({
7843
7843
  }
7844
7844
  function patchLutimes(fs8) {
7845
7845
  if (constants.hasOwnProperty("O_SYMLINK") && fs8.futimes) {
7846
- fs8.lutimes = function(path15, at, mt, cb) {
7847
- fs8.open(path15, constants.O_SYMLINK, function(er, fd) {
7846
+ fs8.lutimes = function(path16, at, mt, cb) {
7847
+ fs8.open(path16, constants.O_SYMLINK, function(er, fd) {
7848
7848
  if (er) {
7849
7849
  if (cb) cb(er);
7850
7850
  return;
@@ -7856,8 +7856,8 @@ var require_polyfills = __commonJS({
7856
7856
  });
7857
7857
  });
7858
7858
  };
7859
- fs8.lutimesSync = function(path15, at, mt) {
7860
- var fd = fs8.openSync(path15, constants.O_SYMLINK);
7859
+ fs8.lutimesSync = function(path16, at, mt) {
7860
+ var fd = fs8.openSync(path16, constants.O_SYMLINK);
7861
7861
  var ret;
7862
7862
  var threw = true;
7863
7863
  try {
@@ -7975,11 +7975,11 @@ var require_legacy_streams = __commonJS({
7975
7975
  ReadStream,
7976
7976
  WriteStream
7977
7977
  };
7978
- function ReadStream(path15, options) {
7979
- if (!(this instanceof ReadStream)) return new ReadStream(path15, options);
7978
+ function ReadStream(path16, options) {
7979
+ if (!(this instanceof ReadStream)) return new ReadStream(path16, options);
7980
7980
  Stream.call(this);
7981
7981
  var self = this;
7982
- this.path = path15;
7982
+ this.path = path16;
7983
7983
  this.fd = null;
7984
7984
  this.readable = true;
7985
7985
  this.paused = false;
@@ -8024,10 +8024,10 @@ var require_legacy_streams = __commonJS({
8024
8024
  self._read();
8025
8025
  });
8026
8026
  }
8027
- function WriteStream(path15, options) {
8028
- if (!(this instanceof WriteStream)) return new WriteStream(path15, options);
8027
+ function WriteStream(path16, options) {
8028
+ if (!(this instanceof WriteStream)) return new WriteStream(path16, options);
8029
8029
  Stream.call(this);
8030
- this.path = path15;
8030
+ this.path = path16;
8031
8031
  this.fd = null;
8032
8032
  this.writable = true;
8033
8033
  this.flags = "w";
@@ -8170,14 +8170,14 @@ var require_graceful_fs = __commonJS({
8170
8170
  fs8.createWriteStream = createWriteStream;
8171
8171
  var fs$readFile = fs8.readFile;
8172
8172
  fs8.readFile = readFile2;
8173
- function readFile2(path15, options, cb) {
8173
+ function readFile2(path16, options, cb) {
8174
8174
  if (typeof options === "function")
8175
8175
  cb = options, options = null;
8176
- return go$readFile(path15, options, cb);
8177
- function go$readFile(path16, options2, cb2, startTime) {
8178
- return fs$readFile(path16, options2, function(err) {
8176
+ return go$readFile(path16, options, cb);
8177
+ function go$readFile(path17, options2, cb2, startTime) {
8178
+ return fs$readFile(path17, options2, function(err) {
8179
8179
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
8180
- enqueue([go$readFile, [path16, options2, cb2], err, startTime || Date.now(), Date.now()]);
8180
+ enqueue([go$readFile, [path17, options2, cb2], err, startTime || Date.now(), Date.now()]);
8181
8181
  else {
8182
8182
  if (typeof cb2 === "function")
8183
8183
  cb2.apply(this, arguments);
@@ -8187,14 +8187,14 @@ var require_graceful_fs = __commonJS({
8187
8187
  }
8188
8188
  var fs$writeFile = fs8.writeFile;
8189
8189
  fs8.writeFile = writeFile;
8190
- function writeFile(path15, data, options, cb) {
8190
+ function writeFile(path16, data, options, cb) {
8191
8191
  if (typeof options === "function")
8192
8192
  cb = options, options = null;
8193
- return go$writeFile(path15, data, options, cb);
8194
- function go$writeFile(path16, data2, options2, cb2, startTime) {
8195
- return fs$writeFile(path16, data2, options2, function(err) {
8193
+ return go$writeFile(path16, data, options, cb);
8194
+ function go$writeFile(path17, data2, options2, cb2, startTime) {
8195
+ return fs$writeFile(path17, data2, options2, function(err) {
8196
8196
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
8197
- enqueue([go$writeFile, [path16, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
8197
+ enqueue([go$writeFile, [path17, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
8198
8198
  else {
8199
8199
  if (typeof cb2 === "function")
8200
8200
  cb2.apply(this, arguments);
@@ -8205,14 +8205,14 @@ var require_graceful_fs = __commonJS({
8205
8205
  var fs$appendFile = fs8.appendFile;
8206
8206
  if (fs$appendFile)
8207
8207
  fs8.appendFile = appendFile;
8208
- function appendFile(path15, data, options, cb) {
8208
+ function appendFile(path16, data, options, cb) {
8209
8209
  if (typeof options === "function")
8210
8210
  cb = options, options = null;
8211
- return go$appendFile(path15, data, options, cb);
8212
- function go$appendFile(path16, data2, options2, cb2, startTime) {
8213
- return fs$appendFile(path16, data2, options2, function(err) {
8211
+ return go$appendFile(path16, data, options, cb);
8212
+ function go$appendFile(path17, data2, options2, cb2, startTime) {
8213
+ return fs$appendFile(path17, data2, options2, function(err) {
8214
8214
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
8215
- enqueue([go$appendFile, [path16, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
8215
+ enqueue([go$appendFile, [path17, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
8216
8216
  else {
8217
8217
  if (typeof cb2 === "function")
8218
8218
  cb2.apply(this, arguments);
@@ -8243,31 +8243,31 @@ var require_graceful_fs = __commonJS({
8243
8243
  var fs$readdir = fs8.readdir;
8244
8244
  fs8.readdir = readdir2;
8245
8245
  var noReaddirOptionVersions = /^v[0-5]\./;
8246
- function readdir2(path15, options, cb) {
8246
+ function readdir2(path16, options, cb) {
8247
8247
  if (typeof options === "function")
8248
8248
  cb = options, options = null;
8249
- var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path16, options2, cb2, startTime) {
8250
- return fs$readdir(path16, fs$readdirCallback(
8251
- path16,
8249
+ var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path17, options2, cb2, startTime) {
8250
+ return fs$readdir(path17, fs$readdirCallback(
8251
+ path17,
8252
8252
  options2,
8253
8253
  cb2,
8254
8254
  startTime
8255
8255
  ));
8256
- } : function go$readdir2(path16, options2, cb2, startTime) {
8257
- return fs$readdir(path16, options2, fs$readdirCallback(
8258
- path16,
8256
+ } : function go$readdir2(path17, options2, cb2, startTime) {
8257
+ return fs$readdir(path17, options2, fs$readdirCallback(
8258
+ path17,
8259
8259
  options2,
8260
8260
  cb2,
8261
8261
  startTime
8262
8262
  ));
8263
8263
  };
8264
- return go$readdir(path15, options, cb);
8265
- function fs$readdirCallback(path16, options2, cb2, startTime) {
8264
+ return go$readdir(path16, options, cb);
8265
+ function fs$readdirCallback(path17, options2, cb2, startTime) {
8266
8266
  return function(err, files) {
8267
8267
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
8268
8268
  enqueue([
8269
8269
  go$readdir,
8270
- [path16, options2, cb2],
8270
+ [path17, options2, cb2],
8271
8271
  err,
8272
8272
  startTime || Date.now(),
8273
8273
  Date.now()
@@ -8338,7 +8338,7 @@ var require_graceful_fs = __commonJS({
8338
8338
  enumerable: true,
8339
8339
  configurable: true
8340
8340
  });
8341
- function ReadStream(path15, options) {
8341
+ function ReadStream(path16, options) {
8342
8342
  if (this instanceof ReadStream)
8343
8343
  return fs$ReadStream.apply(this, arguments), this;
8344
8344
  else
@@ -8358,7 +8358,7 @@ var require_graceful_fs = __commonJS({
8358
8358
  }
8359
8359
  });
8360
8360
  }
8361
- function WriteStream(path15, options) {
8361
+ function WriteStream(path16, options) {
8362
8362
  if (this instanceof WriteStream)
8363
8363
  return fs$WriteStream.apply(this, arguments), this;
8364
8364
  else
@@ -8376,22 +8376,22 @@ var require_graceful_fs = __commonJS({
8376
8376
  }
8377
8377
  });
8378
8378
  }
8379
- function createReadStream(path15, options) {
8380
- return new fs8.ReadStream(path15, options);
8379
+ function createReadStream(path16, options) {
8380
+ return new fs8.ReadStream(path16, options);
8381
8381
  }
8382
- function createWriteStream(path15, options) {
8383
- return new fs8.WriteStream(path15, options);
8382
+ function createWriteStream(path16, options) {
8383
+ return new fs8.WriteStream(path16, options);
8384
8384
  }
8385
8385
  var fs$open = fs8.open;
8386
8386
  fs8.open = open;
8387
- function open(path15, flags, mode, cb) {
8387
+ function open(path16, flags, mode, cb) {
8388
8388
  if (typeof mode === "function")
8389
8389
  cb = mode, mode = null;
8390
- return go$open(path15, flags, mode, cb);
8391
- function go$open(path16, flags2, mode2, cb2, startTime) {
8392
- return fs$open(path16, flags2, mode2, function(err, fd) {
8390
+ return go$open(path16, flags, mode, cb);
8391
+ function go$open(path17, flags2, mode2, cb2, startTime) {
8392
+ return fs$open(path17, flags2, mode2, function(err, fd) {
8393
8393
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
8394
- enqueue([go$open, [path16, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
8394
+ enqueue([go$open, [path17, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
8395
8395
  else {
8396
8396
  if (typeof cb2 === "function")
8397
8397
  cb2.apply(this, arguments);
@@ -8920,7 +8920,7 @@ var require_mtime_precision = __commonJS({
8920
8920
  var require_lockfile = __commonJS({
8921
8921
  "../../node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/lib/lockfile.js"(exports2, module2) {
8922
8922
  "use strict";
8923
- var path15 = require("path");
8923
+ var path16 = require("path");
8924
8924
  var fs7 = require_graceful_fs();
8925
8925
  var retry = require_retry2();
8926
8926
  var onExit = require_signal_exit();
@@ -8931,7 +8931,7 @@ var require_lockfile = __commonJS({
8931
8931
  }
8932
8932
  function resolveCanonicalPath(file2, options, callback) {
8933
8933
  if (!options.realpath) {
8934
- return callback(null, path15.resolve(file2));
8934
+ return callback(null, path16.resolve(file2));
8935
8935
  }
8936
8936
  options.fs.realpath(file2, callback);
8937
8937
  }
@@ -10795,10 +10795,10 @@ var require_segments = __commonJS({
10795
10795
  const segs = getSegmentsFromString(data, Utils.isKanjiModeEnabled());
10796
10796
  const nodes = buildNodes(segs);
10797
10797
  const graph = buildGraph(nodes, version2);
10798
- const path15 = dijkstra.find_path(graph.map, "start", "end");
10798
+ const path16 = dijkstra.find_path(graph.map, "start", "end");
10799
10799
  const optimizedSegs = [];
10800
- for (let i = 1; i < path15.length - 1; i++) {
10801
- optimizedSegs.push(graph.table[path15[i]].node);
10800
+ for (let i = 1; i < path16.length - 1; i++) {
10801
+ optimizedSegs.push(graph.table[path16[i]].node);
10802
10802
  }
10803
10803
  return exports2.fromArray(mergeSegments(optimizedSegs));
10804
10804
  };
@@ -13275,7 +13275,7 @@ var require_png2 = __commonJS({
13275
13275
  });
13276
13276
  png.pack();
13277
13277
  };
13278
- exports2.renderToFile = function renderToFile(path15, qrData, options, cb) {
13278
+ exports2.renderToFile = function renderToFile(path16, qrData, options, cb) {
13279
13279
  if (typeof cb === "undefined") {
13280
13280
  cb = options;
13281
13281
  options = void 0;
@@ -13286,7 +13286,7 @@ var require_png2 = __commonJS({
13286
13286
  called = true;
13287
13287
  cb.apply(null, args);
13288
13288
  };
13289
- const stream = fs7.createWriteStream(path15);
13289
+ const stream = fs7.createWriteStream(path16);
13290
13290
  stream.on("error", done);
13291
13291
  stream.on("close", done);
13292
13292
  exports2.renderToFileStream(stream, qrData, options);
@@ -13348,14 +13348,14 @@ var require_utf8 = __commonJS({
13348
13348
  }
13349
13349
  return output3;
13350
13350
  };
13351
- exports2.renderToFile = function renderToFile(path15, qrData, options, cb) {
13351
+ exports2.renderToFile = function renderToFile(path16, qrData, options, cb) {
13352
13352
  if (typeof cb === "undefined") {
13353
13353
  cb = options;
13354
13354
  options = void 0;
13355
13355
  }
13356
13356
  const fs7 = require("fs");
13357
13357
  const utf8 = exports2.render(qrData, options);
13358
- fs7.writeFile(path15, utf8, cb);
13358
+ fs7.writeFile(path16, utf8, cb);
13359
13359
  };
13360
13360
  }
13361
13361
  });
@@ -13476,7 +13476,7 @@ var require_svg_tag = __commonJS({
13476
13476
  return str;
13477
13477
  }
13478
13478
  function qrToPath(data, size, margin) {
13479
- let path15 = "";
13479
+ let path16 = "";
13480
13480
  let moveBy = 0;
13481
13481
  let newRow = false;
13482
13482
  let lineLength = 0;
@@ -13487,19 +13487,19 @@ var require_svg_tag = __commonJS({
13487
13487
  if (data[i]) {
13488
13488
  lineLength++;
13489
13489
  if (!(i > 0 && col > 0 && data[i - 1])) {
13490
- path15 += newRow ? svgCmd("M", col + margin, 0.5 + row + margin) : svgCmd("m", moveBy, 0);
13490
+ path16 += newRow ? svgCmd("M", col + margin, 0.5 + row + margin) : svgCmd("m", moveBy, 0);
13491
13491
  moveBy = 0;
13492
13492
  newRow = false;
13493
13493
  }
13494
13494
  if (!(col + 1 < size && data[i + 1])) {
13495
- path15 += svgCmd("h", lineLength);
13495
+ path16 += svgCmd("h", lineLength);
13496
13496
  lineLength = 0;
13497
13497
  }
13498
13498
  } else {
13499
13499
  moveBy++;
13500
13500
  }
13501
13501
  }
13502
- return path15;
13502
+ return path16;
13503
13503
  }
13504
13504
  exports2.render = function render(qrData, options, cb) {
13505
13505
  const opts = Utils.getOptions(options);
@@ -13507,10 +13507,10 @@ var require_svg_tag = __commonJS({
13507
13507
  const data = qrData.modules.data;
13508
13508
  const qrcodesize = size + opts.margin * 2;
13509
13509
  const bg = !opts.color.light.a ? "" : "<path " + getColorAttrib(opts.color.light, "fill") + ' d="M0 0h' + qrcodesize + "v" + qrcodesize + 'H0z"/>';
13510
- const path15 = "<path " + getColorAttrib(opts.color.dark, "stroke") + ' d="' + qrToPath(data, size, opts.margin) + '"/>';
13510
+ const path16 = "<path " + getColorAttrib(opts.color.dark, "stroke") + ' d="' + qrToPath(data, size, opts.margin) + '"/>';
13511
13511
  const viewBox = 'viewBox="0 0 ' + qrcodesize + " " + qrcodesize + '"';
13512
13512
  const width = !opts.width ? "" : 'width="' + opts.width + '" height="' + opts.width + '" ';
13513
- const svgTag = '<svg xmlns="http://www.w3.org/2000/svg" ' + width + viewBox + ' shape-rendering="crispEdges">' + bg + path15 + "</svg>\n";
13513
+ const svgTag = '<svg xmlns="http://www.w3.org/2000/svg" ' + width + viewBox + ' shape-rendering="crispEdges">' + bg + path16 + "</svg>\n";
13514
13514
  if (typeof cb === "function") {
13515
13515
  cb(null, svgTag);
13516
13516
  }
@@ -13524,7 +13524,7 @@ var require_svg = __commonJS({
13524
13524
  "../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/svg.js"(exports2) {
13525
13525
  var svgTagRenderer = require_svg_tag();
13526
13526
  exports2.render = svgTagRenderer.render;
13527
- exports2.renderToFile = function renderToFile(path15, qrData, options, cb) {
13527
+ exports2.renderToFile = function renderToFile(path16, qrData, options, cb) {
13528
13528
  if (typeof cb === "undefined") {
13529
13529
  cb = options;
13530
13530
  options = void 0;
@@ -13532,7 +13532,7 @@ var require_svg = __commonJS({
13532
13532
  const fs7 = require("fs");
13533
13533
  const svgTag = exports2.render(qrData, options);
13534
13534
  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;
13535
- fs7.writeFile(path15, xmlStr, cb);
13535
+ fs7.writeFile(path16, xmlStr, cb);
13536
13536
  };
13537
13537
  }
13538
13538
  });
@@ -13690,8 +13690,8 @@ var require_server = __commonJS({
13690
13690
  cb
13691
13691
  };
13692
13692
  }
13693
- function getTypeFromFilename(path15) {
13694
- return path15.slice((path15.lastIndexOf(".") - 1 >>> 0) + 2).toLowerCase();
13693
+ function getTypeFromFilename(path16) {
13694
+ return path16.slice((path16.lastIndexOf(".") - 1 >>> 0) + 2).toLowerCase();
13695
13695
  }
13696
13696
  function getRendererFromType(type) {
13697
13697
  switch (type) {
@@ -13755,17 +13755,17 @@ var require_server = __commonJS({
13755
13755
  const renderer = getRendererFromType(params.opts.type);
13756
13756
  return render(renderer.renderToBuffer, text, params);
13757
13757
  };
13758
- exports2.toFile = function toFile(path15, text, opts, cb) {
13759
- if (typeof path15 !== "string" || !(typeof text === "string" || typeof text === "object")) {
13758
+ exports2.toFile = function toFile(path16, text, opts, cb) {
13759
+ if (typeof path16 !== "string" || !(typeof text === "string" || typeof text === "object")) {
13760
13760
  throw new Error("Invalid argument");
13761
13761
  }
13762
13762
  if (arguments.length < 3 && !canPromise()) {
13763
13763
  throw new Error("Too few arguments provided");
13764
13764
  }
13765
13765
  const params = checkParams(text, opts, cb);
13766
- const type = params.opts.type || getTypeFromFilename(path15);
13766
+ const type = params.opts.type || getTypeFromFilename(path16);
13767
13767
  const renderer = getRendererFromType(type);
13768
- const renderToFile = renderer.renderToFile.bind(null, path15);
13768
+ const renderToFile = renderer.renderToFile.bind(null, path16);
13769
13769
  return render(renderToFile, text, params);
13770
13770
  };
13771
13771
  exports2.toFileStream = function toFileStream(stream, text, opts) {
@@ -16983,8 +16983,8 @@ var require_utils3 = __commonJS({
16983
16983
  }
16984
16984
  return ind;
16985
16985
  }
16986
- function removeDotSegments(path15) {
16987
- let input = path15;
16986
+ function removeDotSegments(path16) {
16987
+ let input = path16;
16988
16988
  const output3 = [];
16989
16989
  let nextSlash = -1;
16990
16990
  let len = 0;
@@ -17236,8 +17236,8 @@ var require_schemes = __commonJS({
17236
17236
  wsComponent.secure = void 0;
17237
17237
  }
17238
17238
  if (wsComponent.resourceName) {
17239
- const [path15, query] = wsComponent.resourceName.split("?");
17240
- wsComponent.path = path15 && path15 !== "/" ? path15 : void 0;
17239
+ const [path16, query] = wsComponent.resourceName.split("?");
17240
+ wsComponent.path = path16 && path16 !== "/" ? path16 : void 0;
17241
17241
  wsComponent.query = query;
17242
17242
  wsComponent.resourceName = void 0;
17243
17243
  }
@@ -20644,11 +20644,11 @@ var require_dist = __commonJS({
20644
20644
  });
20645
20645
 
20646
20646
  // src/bin.ts
20647
- var import_node_path19 = __toESM(require("node:path"), 1);
20647
+ var import_node_path20 = __toESM(require("node:path"), 1);
20648
20648
  var import_node_child_process9 = require("node:child_process");
20649
20649
  var import_node_fs14 = require("node:fs");
20650
20650
  var import_node_os11 = require("node:os");
20651
- var import_node_path20 = __toESM(require("node:path"), 1);
20651
+ var import_node_path21 = __toESM(require("node:path"), 1);
20652
20652
 
20653
20653
  // src/install-codex.ts
20654
20654
  var import_promises = __toESM(require("node:fs/promises"), 1);
@@ -20980,7 +20980,7 @@ ${block}`;
20980
20980
  var import_node_fs11 = __toESM(require("node:fs"), 1);
20981
20981
  var import_node_http = __toESM(require("node:http"), 1);
20982
20982
  var import_node_os7 = __toESM(require("node:os"), 1);
20983
- var import_node_path12 = __toESM(require("node:path"), 1);
20983
+ var import_node_path13 = __toESM(require("node:path"), 1);
20984
20984
  var import_node_child_process7 = require("node:child_process");
20985
20985
  var import_node_crypto7 = __toESM(require("node:crypto"), 1);
20986
20986
 
@@ -22537,10 +22537,10 @@ function mergeDefs(...defs) {
22537
22537
  function cloneDef(schema) {
22538
22538
  return mergeDefs(schema._zod.def);
22539
22539
  }
22540
- function getElementAtPath(obj, path15) {
22541
- if (!path15)
22540
+ function getElementAtPath(obj, path16) {
22541
+ if (!path16)
22542
22542
  return obj;
22543
- return path15.reduce((acc, key) => acc?.[key], obj);
22543
+ return path16.reduce((acc, key) => acc?.[key], obj);
22544
22544
  }
22545
22545
  function promiseAllObject(promisesObj) {
22546
22546
  const keys = Object.keys(promisesObj);
@@ -22949,11 +22949,11 @@ function explicitlyAborted(x, startIndex = 0) {
22949
22949
  }
22950
22950
  return false;
22951
22951
  }
22952
- function prefixIssues(path15, issues) {
22952
+ function prefixIssues(path16, issues) {
22953
22953
  return issues.map((iss) => {
22954
22954
  var _a3;
22955
22955
  (_a3 = iss).path ?? (_a3.path = []);
22956
- iss.path.unshift(path15);
22956
+ iss.path.unshift(path16);
22957
22957
  return iss;
22958
22958
  });
22959
22959
  }
@@ -23100,16 +23100,16 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
23100
23100
  }
23101
23101
  function formatError(error51, mapper = (issue2) => issue2.message) {
23102
23102
  const fieldErrors = { _errors: [] };
23103
- const processError = (error52, path15 = []) => {
23103
+ const processError = (error52, path16 = []) => {
23104
23104
  for (const issue2 of error52.issues) {
23105
23105
  if (issue2.code === "invalid_union" && issue2.errors.length) {
23106
- issue2.errors.map((issues) => processError({ issues }, [...path15, ...issue2.path]));
23106
+ issue2.errors.map((issues) => processError({ issues }, [...path16, ...issue2.path]));
23107
23107
  } else if (issue2.code === "invalid_key") {
23108
- processError({ issues: issue2.issues }, [...path15, ...issue2.path]);
23108
+ processError({ issues: issue2.issues }, [...path16, ...issue2.path]);
23109
23109
  } else if (issue2.code === "invalid_element") {
23110
- processError({ issues: issue2.issues }, [...path15, ...issue2.path]);
23110
+ processError({ issues: issue2.issues }, [...path16, ...issue2.path]);
23111
23111
  } else {
23112
- const fullpath = [...path15, ...issue2.path];
23112
+ const fullpath = [...path16, ...issue2.path];
23113
23113
  if (fullpath.length === 0) {
23114
23114
  fieldErrors._errors.push(mapper(issue2));
23115
23115
  } else {
@@ -23136,17 +23136,17 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
23136
23136
  }
23137
23137
  function treeifyError(error51, mapper = (issue2) => issue2.message) {
23138
23138
  const result = { errors: [] };
23139
- const processError = (error52, path15 = []) => {
23139
+ const processError = (error52, path16 = []) => {
23140
23140
  var _a3, _b;
23141
23141
  for (const issue2 of error52.issues) {
23142
23142
  if (issue2.code === "invalid_union" && issue2.errors.length) {
23143
- issue2.errors.map((issues) => processError({ issues }, [...path15, ...issue2.path]));
23143
+ issue2.errors.map((issues) => processError({ issues }, [...path16, ...issue2.path]));
23144
23144
  } else if (issue2.code === "invalid_key") {
23145
- processError({ issues: issue2.issues }, [...path15, ...issue2.path]);
23145
+ processError({ issues: issue2.issues }, [...path16, ...issue2.path]);
23146
23146
  } else if (issue2.code === "invalid_element") {
23147
- processError({ issues: issue2.issues }, [...path15, ...issue2.path]);
23147
+ processError({ issues: issue2.issues }, [...path16, ...issue2.path]);
23148
23148
  } else {
23149
- const fullpath = [...path15, ...issue2.path];
23149
+ const fullpath = [...path16, ...issue2.path];
23150
23150
  if (fullpath.length === 0) {
23151
23151
  result.errors.push(mapper(issue2));
23152
23152
  continue;
@@ -23178,8 +23178,8 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
23178
23178
  }
23179
23179
  function toDotPath(_path) {
23180
23180
  const segs = [];
23181
- const path15 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
23182
- for (const seg of path15) {
23181
+ const path16 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
23182
+ for (const seg of path16) {
23183
23183
  if (typeof seg === "number")
23184
23184
  segs.push(`[${seg}]`);
23185
23185
  else if (typeof seg === "symbol")
@@ -35871,13 +35871,13 @@ function resolveRef(ref, ctx) {
35871
35871
  if (!ref.startsWith("#")) {
35872
35872
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
35873
35873
  }
35874
- const path15 = ref.slice(1).split("/").filter(Boolean);
35875
- if (path15.length === 0) {
35874
+ const path16 = ref.slice(1).split("/").filter(Boolean);
35875
+ if (path16.length === 0) {
35876
35876
  return ctx.rootSchema;
35877
35877
  }
35878
35878
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
35879
- if (path15[0] === defsKey) {
35880
- const key = path15[1];
35879
+ if (path16[0] === defsKey) {
35880
+ const key = path16[1];
35881
35881
  if (!key || !ctx.defs[key]) {
35882
35882
  throw new Error(`Reference not found: ${ref}`);
35883
35883
  }
@@ -37718,18 +37718,18 @@ function createMrrlinClient(config2) {
37718
37718
  const customFetch = config2.fetch ?? globalThis.fetch;
37719
37719
  const baseUrl = config2.baseUrl.replace(/\/$/, "");
37720
37720
  const token = config2.token;
37721
- async function request(path15, init) {
37721
+ async function request(path16, init) {
37722
37722
  const method = init?.method ?? "GET";
37723
37723
  const headers = new Headers(init?.headers ?? {});
37724
37724
  if (token && !headers.has("authorization")) {
37725
37725
  headers.set("authorization", `Bearer ${token}`);
37726
37726
  }
37727
- const response = await customFetch(`${baseUrl}${path15}`, { ...init, headers });
37727
+ const response = await customFetch(`${baseUrl}${path16}`, { ...init, headers });
37728
37728
  if (!response.ok) {
37729
37729
  const body = await response.text();
37730
37730
  let code = `HTTP_${response.status}`;
37731
37731
  let violations = null;
37732
- let message = `Mrrlin API ${method} ${path15} failed: ${response.status}`;
37732
+ let message = `Mrrlin API ${method} ${path16} failed: ${response.status}`;
37733
37733
  try {
37734
37734
  const parsed = JSON.parse(body);
37735
37735
  const violationsParsed = apiViolationsErrorSchema.safeParse(parsed);
@@ -37749,7 +37749,7 @@ function createMrrlinClient(config2) {
37749
37749
  throw new MrrlinApiError({
37750
37750
  code,
37751
37751
  method,
37752
- path: path15,
37752
+ path: path16,
37753
37753
  responseBody: body,
37754
37754
  status: response.status,
37755
37755
  violations,
@@ -38004,7 +38004,7 @@ function createMrrlinClient(config2) {
38004
38004
  return taskEventListResponseSchema.parse(body).data;
38005
38005
  },
38006
38006
  async listTasks(projectSlug, filters = {}) {
38007
- const path15 = appendQuery(`${projectPath(projectSlug)}/tasks`, {
38007
+ const path16 = appendQuery(`${projectPath(projectSlug)}/tasks`, {
38008
38008
  assignee: filters.assignee,
38009
38009
  autonomyLevel: filters.autonomyLevel,
38010
38010
  blockedBy: filters.blockedBy,
@@ -38016,7 +38016,7 @@ function createMrrlinClient(config2) {
38016
38016
  subcategory: filters.subcategory,
38017
38017
  type: filters.type
38018
38018
  });
38019
- const body = await request(path15);
38019
+ const body = await request(path16);
38020
38020
  return taskListResponseSchema.parse(body).data;
38021
38021
  },
38022
38022
  async listTaxonomy(projectSlug) {
@@ -38024,22 +38024,22 @@ function createMrrlinClient(config2) {
38024
38024
  return taxonomyListResponseSchema.parse(body).data;
38025
38025
  },
38026
38026
  async listWikiPages(projectSlug, filters = {}) {
38027
- const path15 = appendQuery(`${projectPath(projectSlug)}/wiki`, {
38027
+ const path16 = appendQuery(`${projectPath(projectSlug)}/wiki`, {
38028
38028
  folder: filters.folder,
38029
38029
  q: filters.q,
38030
38030
  taskId: filters.taskId
38031
38031
  });
38032
- const body = await request(path15);
38032
+ const body = await request(path16);
38033
38033
  return wikiPageListResponseSchema.parse(body).data;
38034
38034
  },
38035
38035
  async searchWikiPages(projectSlug, query) {
38036
- const path15 = appendQuery(`${projectPath(projectSlug)}/wiki/search`, {
38036
+ const path16 = appendQuery(`${projectPath(projectSlug)}/wiki/search`, {
38037
38037
  folder: query.folder,
38038
38038
  limit: query.limit === void 0 ? void 0 : String(query.limit),
38039
38039
  pathPrefix: query.pathPrefix,
38040
38040
  q: query.q
38041
38041
  });
38042
- const body = await request(path15);
38042
+ const body = await request(path16);
38043
38043
  return wikiPageSearchResponseSchema.parse(body).data;
38044
38044
  },
38045
38045
  async updatePlan(projectSlug, planId, patch) {
@@ -38781,7 +38781,7 @@ Do NOT derail the current task - if the operator has an in-flight question, answ
38781
38781
  }
38782
38782
 
38783
38783
  // src/_generated/version.ts
38784
- var PKG_VERSION = "0.3.24";
38784
+ var PKG_VERSION = "0.3.25";
38785
38785
 
38786
38786
  // src/api-base-url.ts
38787
38787
  var DEFAULT_API_BASE_URL = "http://127.0.0.1:8787";
@@ -38847,7 +38847,6 @@ async function resolveApiBaseUrlDynamic(opts = {}) {
38847
38847
 
38848
38848
  // src/scheduler-tick.ts
38849
38849
  var SCHEDULER_TICK_MIN_MS = 6e4;
38850
- var SCHEDULER_TICK_MAX_MS = 9e5;
38851
38850
  var SCHEDULER_TICK_FALLBACK_MS = 3e5;
38852
38851
  function schedulerTickDisabled(env = process.env) {
38853
38852
  return (env.MRRLIN_BRIDGE_SCHEDULER_TICK_DISABLE ?? "").trim() === "1";
@@ -38862,7 +38861,7 @@ function computeNextTickDelayMs(nextWakeAt, nowMs, opts = {}) {
38862
38861
  if (typeof nextWakeAt === "string" && nextWakeAt.trim().length > 0) {
38863
38862
  const wakeMs = Date.parse(nextWakeAt);
38864
38863
  if (!Number.isNaN(wakeMs)) {
38865
- base = Math.min(Math.max(wakeMs - nowMs, SCHEDULER_TICK_MIN_MS), SCHEDULER_TICK_MAX_MS);
38864
+ base = Math.max(wakeMs - nowMs, SCHEDULER_TICK_MIN_MS);
38866
38865
  }
38867
38866
  }
38868
38867
  const jitter = base * 0.25 * (random() * 2 - 1);
@@ -38871,15 +38870,25 @@ function computeNextTickDelayMs(nextWakeAt, nowMs, opts = {}) {
38871
38870
  function count(value) {
38872
38871
  return Array.isArray(value) ? value.length : 0;
38873
38872
  }
38873
+ function dispatchTickWork(deps, results) {
38874
+ if (!deps.dispatchEnqueued) return;
38875
+ for (const result of results) {
38876
+ if (typeof result.projectSlug !== "string") continue;
38877
+ for (const run3 of result.createdRuns ?? []) {
38878
+ if (typeof run3.runId === "string") deps.dispatchEnqueued(result.projectSlug, { kind: "execution_run", runId: run3.runId });
38879
+ }
38880
+ for (const job of [...result.enqueuedSpecDrafts ?? [], ...result.enqueuedConsensus ?? []]) {
38881
+ if (typeof job.jobId === "string") deps.dispatchEnqueued(result.projectSlug, { kind: "async_job", jobId: job.jobId });
38882
+ }
38883
+ }
38884
+ }
38874
38885
  async function fireSchedulerTick(deps) {
38875
38886
  const fetchImpl = deps.fetchImpl ?? fetch;
38876
38887
  try {
38877
- const response = await fetchImpl(`${deps.apiBaseUrl}/cron/scheduler/run`, {
38878
- headers: { authorization: `Bearer ${deps.token}` }
38879
- });
38888
+ const response = await fetchImpl(`${deps.apiBaseUrl}/internal/scheduler/run`, { method: "POST" });
38880
38889
  if (!response.ok) {
38881
38890
  process.stderr.write(
38882
- `[mrrlin-mcp director-bridge] scheduler tick failed: HTTP ${response.status} from /cron/scheduler/run
38891
+ `[mrrlin-mcp director-bridge] scheduler tick failed: HTTP ${response.status} from /internal/scheduler/run
38883
38892
  `
38884
38893
  );
38885
38894
  return { nextWakeAt: null };
@@ -38917,6 +38926,7 @@ async function fireSchedulerTick(deps) {
38917
38926
  nextWakeAt: typeof data.nextWakeAt === "string" ? data.nextWakeAt : null
38918
38927
  }
38919
38928
  });
38929
+ dispatchTickWork(deps, results);
38920
38930
  return { nextWakeAt: typeof data.nextWakeAt === "string" ? data.nextWakeAt : null };
38921
38931
  } catch (error51) {
38922
38932
  process.stderr.write(
@@ -38952,6 +38962,7 @@ function startSchedulerTickLoop(deps) {
38952
38962
  // src/execution-consumer.ts
38953
38963
  var import_node_child_process6 = require("node:child_process");
38954
38964
  var import_node_crypto4 = __toESM(require("node:crypto"), 1);
38965
+ var import_node_path6 = __toESM(require("node:path"), 1);
38955
38966
  var import_node_util = require("node:util");
38956
38967
 
38957
38968
  // src/consensus/heads.ts
@@ -39835,7 +39846,7 @@ function enforceSpecOutputContract(markdown, taskId, title) {
39835
39846
  ${body}`;
39836
39847
  }
39837
39848
  let tldrChars = 0;
39838
- const tldrMatch = body.match(/(^## Коротко\s*\n)([\s\S]*?)(?=\n## |$)/m);
39849
+ const tldrMatch = body.match(/(^## Summary\s*\n)([\s\S]*?)(?=\n## |$)/im);
39839
39850
  if (tldrMatch && tldrMatch.index !== void 0) {
39840
39851
  const heading = tldrMatch[1] ?? "";
39841
39852
  const section = (tldrMatch[2] ?? "").trim();
@@ -39883,7 +39894,7 @@ function buildDraftSpecPrompt(task, constitution) {
39883
39894
  `Return ONLY the full spec markdown, no commentary. Required structure:`,
39884
39895
  `- First line heading: \`# ${task.id} \u2014 ${task.title}\``,
39885
39896
  `- Sections: Problem, Scope, Non-goals, Acceptance criteria, Verification.`,
39886
- `- Final section \`## \u041A\u043E\u0440\u043E\u0442\u043A\u043E\`: a plain-Ukrainian TL;DR of what will be done and how it`,
39897
+ `- Final section \`## Summary\`: a plain-English TL;DR of what will be done and how it`,
39887
39898
  ` will be verified, at most ${DRAFT_SPEC_TLDR_MAX_CHARS} characters.`
39888
39899
  );
39889
39900
  return lines2.join("\n");
@@ -40090,7 +40101,7 @@ function onComplete(outcome, input) {
40090
40101
  }
40091
40102
  return {
40092
40103
  kind: "info",
40093
- body: `\u0421\u043F\u0435\u043A\u0443 \u0434\u043B\u044F ${input.taskId} \u0437\u0440\u043E\u0431\u043B\u0435\u043D\u043E \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u043D\u043E \u2014 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430 ${parsed.pageId ?? "?"} \u0443 Specs/. \u041D\u0430\u0441\u0442\u0443\u043F\u043D\u0438\u0439 \u0442\u0456\u043A \u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u044C consensus-\u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0443.`
40104
+ body: `Spec for ${input.taskId} was drafted automatically \u2014 page ${parsed.pageId ?? "?"} in Specs/. The next scheduler tick will run the consensus review.`
40094
40105
  };
40095
40106
  }
40096
40107
  const summary = outcome.error;
@@ -40099,7 +40110,7 @@ function onComplete(outcome, input) {
40099
40110
  kind: "info",
40100
40111
  id: `II-sched-draft-failed-${input.taskId}-${hash3}`,
40101
40112
  taskId: input.taskId,
40102
- body: `\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u043D\u0430\u043F\u0438\u0441\u0430\u0442\u0438 \u0441\u043F\u0435\u043A\u0443 \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u043D\u043E \u0434\u043B\u044F ${input.taskId} \u2014 \u0433\u043B\u044F\u043D\u044C \u0437\u0430\u0434\u0430\u0447\u0443, \u0431\u0443\u0434\u044C \u043B\u0430\u0441\u043A\u0430. \u041F\u0440\u0438\u0447\u0438\u043D\u0430: ${summary}`
40113
+ body: `Failed to draft a spec automatically for ${input.taskId} \u2014 please review the task. Reason: ${summary}`
40103
40114
  };
40104
40115
  }
40105
40116
  function createDraftSpecDescriptor(deps = {}) {
@@ -40120,48 +40131,48 @@ function errMessage2(error51) {
40120
40131
  function renderMilestone(m, ctx) {
40121
40132
  switch (m) {
40122
40133
  case "spec_drafted": {
40123
- let s = "\u041D\u0430\u043F\u0438\u0441\u0430\u0432 \u0441\u043F\u0435\u043A\u0443, \u0432\u0456\u0434\u0434\u0430\u0432 \u043D\u0430 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0443";
40134
+ let s = "Drafted the spec and sent it for review";
40124
40135
  if (ctx.specUrl) s += ` \u2014 ${ctx.specUrl}`;
40125
- if (ctx.tldr) s += `. \u041A\u043E\u0440\u043E\u0442\u043A\u043E: ${ctx.tldr}`;
40136
+ if (ctx.tldr) s += `. Summary: ${ctx.tldr}`;
40126
40137
  return s;
40127
40138
  }
40128
40139
  case "consensus_converged":
40129
- return "\u0412\u0441\u0435 \u043E\u043A \u2014 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0438\u0432 \u0441\u043F\u0435\u043A\u0443, \u043F\u0440\u043E\u0431\u043B\u0435\u043C \u043D\u0435 \u0431\u0430\u0447\u0443";
40140
+ return "Spec review passed \u2014 no issues found";
40130
40141
  case "consensus_converged_needs_approval": {
40131
- let s = "\u0412\u0441\u0435 \u043E\u043A \u2014 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0438\u0432 \u0441\u043F\u0435\u043A\u0443. \u041C\u043E\u0436\u0435\u0448 \u0433\u043B\u044F\u043D\u0443\u0442\u0438 \u0439 \u0430\u043F\u0440\u0443\u0432\u043D\u0443\u0442\u0438";
40142
+ let s = "Spec review passed. Please review and approve";
40132
40143
  if (ctx.specUrl) s += ` \u2014 ${ctx.specUrl}`;
40133
- if (ctx.tldr) s += `. \u041A\u043E\u0440\u043E\u0442\u043A\u043E: ${ctx.tldr}`;
40144
+ if (ctx.tldr) s += `. Summary: ${ctx.tldr}`;
40134
40145
  return s;
40135
40146
  }
40136
40147
  case "gate_question":
40137
- return "\u0404 \u043F\u0438\u0442\u0430\u043D\u043D\u044F \u043F\u043E \u0437\u0430\u0434\u0430\u0447\u0456 \u2014 \u0433\u043B\u044F\u043D\u044C, \u0431\u0443\u0434\u044C \u043B\u0430\u0441\u043A\u0430";
40148
+ return "I have a question about this task \u2014 please take a look";
40138
40149
  case "run_started":
40139
- return "\u041F\u043E\u0447\u0430\u0432 \u0440\u043E\u0431\u0438\u0442\u0438";
40150
+ return "Started working";
40140
40151
  case "pr_opened":
40141
- return "\u0417\u0440\u043E\u0431\u0438\u0432, \u0432\u0456\u0434\u043A\u0440\u0438\u0432 PR";
40152
+ return "Done and opened a PR";
40142
40153
  case "dev_deployed_verified":
40143
- return "\u0412\u0438\u043A\u043B\u0430\u0432 \u043D\u0430 dev \u0456 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0438\u0432 \u2014 \u043F\u0440\u0430\u0446\u044E\u0454";
40154
+ return "Deployed to dev and verified \u2014 it works";
40144
40155
  case "grace_started": {
40145
- let s = "\u0412\u0438\u043A\u043B\u0430\u0432 \u043D\u0430 dev, \u0432\u0441\u0435 \u043E\u043A. \u0412\u0438\u043A\u043E\u0447\u0443 \u043D\u0430 prod";
40146
- if (ctx.graceUntilHHMM) s += ` \u043E ${ctx.graceUntilHHMM}`;
40147
- s += " \u2014 \u0437\u0443\u043F\u0438\u043D\u0438, \u044F\u043A\u0449\u043E \u043D\u0435 \u0442\u0440\u0435\u0431\u0430";
40156
+ let s = "Deployed to dev and verified. I will promote to prod";
40157
+ if (ctx.graceUntilHHMM) s += ` at ${ctx.graceUntilHHMM}`;
40158
+ s += " \u2014 stop me if this is not needed";
40148
40159
  return s;
40149
40160
  }
40150
40161
  case "prod_deployed_verified":
40151
- return "\u0412\u0438\u043A\u043B\u0430\u0432 \u043D\u0430 prod, \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0438\u0432 \u2014 \u0432\u0441\u0435 \u043F\u0440\u0430\u0446\u044E\u0454 \u2705";
40162
+ return "Deployed to prod and verified \u2014 everything works";
40152
40163
  case "demoted_blast_radius": {
40153
- let s = "\u0417\u043C\u0456\u043D\u0430 \u0432\u0438\u0433\u043B\u044F\u0434\u0430\u0454 \u0441\u0435\u0440\u0439\u043E\u0437\u043D\u043E\u044E \u2014 \u043F\u043E\u0447\u0435\u043A\u0430\u044E \u043D\u0430 \u0442\u0432\u0456\u0439 \u0430\u043F\u0440\u0443\u0432 \u043F\u0435\u0440\u0435\u0434 \u0432\u0438\u043A\u0430\u0442\u043E\u043C";
40154
- if (ctx.reason) s += `. \u041F\u0440\u0438\u0447\u0438\u043D\u0430: ${ctx.reason}`;
40164
+ let s = "This change looks significant \u2014 waiting for your approval before deploy";
40165
+ if (ctx.reason) s += `. Reason: ${ctx.reason}`;
40155
40166
  return s;
40156
40167
  }
40157
40168
  case "reverted":
40158
- return "\u041F\u0440\u043E\u0434-\u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0430 \u0432\u043F\u0430\u043B\u0430 \u2014 \u0432\u0456\u0434\u043A\u043E\u0442\u0438\u0432 \u043D\u0430\u0437\u0430\u0434, \u0433\u043B\u044F\u043D\u044C \u043A\u043E\u043B\u0438 \u0437\u043C\u043E\u0436\u0435\u0448";
40169
+ return "Production verification failed \u2014 rolled back, please review when you can";
40159
40170
  case "revert_pr_failed":
40160
- return "\u041F\u0440\u043E\u0434 \u0432\u0456\u0434\u043A\u043E\u0442\u0438\u0432, \u0430\u043B\u0435 revert-PR \u043D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u0442\u0432\u043E\u0440\u0438\u0442\u0438 \u2014 \u0437\u0440\u043E\u0431\u0438 \u0432\u0440\u0443\u0447\u043D\u0443";
40171
+ return "Production rollback completed, but creating a revert PR failed \u2014 please handle manually";
40161
40172
  case "autodeploy_inert_non_code":
40162
- return "\u0410\u0432\u0442\u043E\u0434\u0435\u043F\u043B\u043E\u0439 \u0443\u0432\u0456\u043C\u043A\u043D\u0435\u043D\u043E, \u0430\u043B\u0435 \u0432 \u0446\u0456\u0439 \u0437\u0430\u0434\u0430\u0447\u0456 \u043D\u0435\u043C\u0430 \u0449\u043E \u0434\u0435\u043F\u043B\u043E\u0457\u0442\u0438 \u2014 \u043F\u0440\u043E\u043F\u0443\u0441\u043A\u0430\u044E";
40173
+ return "Autodeploy is enabled, but this task has nothing deployable \u2014 skipping";
40163
40174
  case "daily_limit_reached":
40164
- return "\u0414\u0435\u043D\u043D\u0438\u0439 \u043B\u0456\u043C\u0456\u0442 \u0430\u0432\u0442\u043E\u043D\u043E\u043C\u043D\u0438\u0445 \u043E\u043F\u0435\u0440\u0430\u0446\u0456\u0439 \u0432\u0438\u0447\u0435\u0440\u043F\u0430\u043D\u043E \u2014 \u043F\u0440\u043E\u0434\u043E\u0432\u0436\u0443 \u0437\u0430\u0432\u0442\u0440\u0430";
40175
+ return "Daily autonomous operations limit reached \u2014 I will continue tomorrow";
40165
40176
  }
40166
40177
  }
40167
40178
 
@@ -40225,9 +40236,9 @@ function deployApprovalItemId(runId, env) {
40225
40236
  function graceCancelItemId(runId) {
40226
40237
  return `II-grace-cancel-${runId}`;
40227
40238
  }
40228
- var APPROVE_ANSWER = "\u0422\u0430\u043A";
40229
- var REJECT_ANSWER = "\u041D\u0456";
40230
- var GRACE_CANCEL_ANSWER = "\u0437\u0443\u043F\u0438\u043D\u0438\u0442\u0438";
40239
+ var APPROVE_ANSWER = "Approve";
40240
+ var REJECT_ANSWER = "Reject";
40241
+ var GRACE_CANCEL_ANSWER = "stop";
40231
40242
  async function findInboxQuestion(client, projectSlug, itemId) {
40232
40243
  const items = await client.listInboxItems(projectSlug, { kind: "question" });
40233
40244
  return items.find((item) => item.id === itemId) ?? null;
@@ -40263,11 +40274,11 @@ async function resolveDeployApproval(deps, projectSlug, run3, task, env) {
40263
40274
  id: itemId,
40264
40275
  kind: "question",
40265
40276
  taskId: task.id,
40266
- body: `\u0412\u0441\u0435 \u0433\u043E\u0442\u043E\u0432\u043E \u2014 \u0432\u0438\u043B\u0438\u0432\u0430\u044E \u043D\u0430 ${env}? (\u0437\u0430\u0434\u0430\u0447\u0430 ${task.id} \u2014 ${task.title}, run ${run3.id})`,
40277
+ body: `Ready to deploy to ${env}? (task ${task.id} \u2014 ${task.title}, run ${run3.id})`,
40267
40278
  origin: "deploy-gate",
40268
40279
  questionOptions: [
40269
- { label: APPROVE_ANSWER, answer: APPROVE_ANSWER, description: `\u0412\u0438\u043A\u043E\u0442\u0438\u0442\u0438 \u043D\u0430 ${env}`, recommended: true },
40270
- { label: REJECT_ANSWER, answer: REJECT_ANSWER, description: "\u041D\u0435 \u0432\u0438\u043A\u043E\u0447\u0443\u0432\u0430\u0442\u0438 \u2014 \u043F\u0435\u0440\u0435\u0434\u0430\u0442\u0438 \u043C\u0435\u043D\u0456" }
40280
+ { label: APPROVE_ANSWER, answer: APPROVE_ANSWER, description: `Deploy to ${env}`, recommended: true },
40281
+ { label: REJECT_ANSWER, answer: REJECT_ANSWER, description: "Do not deploy \u2014 hand it off to me" }
40271
40282
  ]
40272
40283
  }).catch(() => {
40273
40284
  });
@@ -40300,11 +40311,11 @@ async function resolveProdGrace(deps, projectSlug, run3, task, artifacts) {
40300
40311
  id: cancelId,
40301
40312
  kind: "question",
40302
40313
  taskId: task.id,
40303
- body: `\u0412\u0438\u043A\u043E\u0447\u0443 \u043D\u0430 prod \u043E ${formatGraceHHMM(graceUntil)} (\u0437\u0430\u0434\u0430\u0447\u0430 ${task.id} \u2014 ${task.title}). \u0417\u0443\u043F\u0438\u043D\u0438\u0442\u0438?`,
40314
+ body: `I will promote to prod at ${formatGraceHHMM(graceUntil)} (task ${task.id} \u2014 ${task.title}). Stop it?`,
40304
40315
  origin: "deploy-gate",
40305
40316
  questionOptions: [
40306
- { label: "\u0417\u0443\u043F\u0438\u043D\u0438\u0442\u0438", answer: GRACE_CANCEL_ANSWER, description: "\u041D\u0435 \u0432\u0438\u043A\u043E\u0447\u0443\u0432\u0430\u0442\u0438 \u043D\u0430 prod \u2014 \u043F\u0435\u0440\u0435\u0434\u0430\u0442\u0438 \u043C\u0435\u043D\u0456" },
40307
- { label: "\u0412\u0438\u043A\u043E\u0447\u0443\u0439", answer: "\u0432\u0438\u043A\u043E\u0447\u0443\u0439", description: "\u0412\u0441\u0435 \u043E\u043A, \u0432\u0438\u043A\u043E\u0447\u0443\u0439 \u0437\u0430 \u0440\u043E\u0437\u043A\u043B\u0430\u0434\u043E\u043C", recommended: true }
40317
+ { label: "Stop", answer: GRACE_CANCEL_ANSWER, description: "Do not deploy to prod \u2014 hand it off to me" },
40318
+ { label: "Deploy", answer: "deploy", description: "Looks good, deploy on schedule", recommended: true }
40308
40319
  ]
40309
40320
  }).catch(() => {
40310
40321
  });
@@ -40499,7 +40510,7 @@ async function runDeployGateTick(deps, projectSlug, run3, task) {
40499
40510
  projectSlug,
40500
40511
  task,
40501
40512
  run3,
40502
- `verification_failed:prod (\u0430\u0432\u0442\u043E-\u0432\u0456\u0434\u043A\u0430\u0442: prod \u043F\u043E\u0432\u0435\u0440\u043D\u0443\u0442\u043E \u043D\u0430 ${reverted.branch})`
40513
+ `verification_failed:prod (auto-rollback: prod restored to ${reverted.branch})`
40503
40514
  );
40504
40515
  return { kind: "handoff", reason: "verification_failed:prod:reverted" };
40505
40516
  }
@@ -40906,8 +40917,8 @@ function newArtifactId() {
40906
40917
  return `EA-${import_node_crypto4.default.randomUUID()}`;
40907
40918
  }
40908
40919
  var BLAST_RADIUS_FLOOR_PATTERNS = [/^supabase\/migrations\//, /^packages\/db\/src\/schema\.ts$/];
40909
- function isBlastRadiusFloorPath(path15) {
40910
- return BLAST_RADIUS_FLOOR_PATTERNS.some((re) => re.test(path15));
40920
+ function isBlastRadiusFloorPath(path16) {
40921
+ return BLAST_RADIUS_FLOOR_PATTERNS.some((re) => re.test(path16));
40911
40922
  }
40912
40923
  var execFileAsync = (0, import_node_util.promisify)(import_node_child_process6.execFile);
40913
40924
  async function defaultListRunDiffPaths(opts) {
@@ -40928,11 +40939,11 @@ async function defaultListRunDiffPaths(opts) {
40928
40939
  return parse5(stdout);
40929
40940
  }
40930
40941
  }
40931
- var BLAST_RADIUS_FLOOR_REASON = "\u043C\u0456\u0433\u0440\u0430\u0446\u0456\u0457/\u0441\u0445\u0435\u043C\u0430 \u0411\u0414 \u0443 \u0434\u0456\u0444\u0456";
40932
- var BLAST_RADIUS_UNKNOWN_REASON = "\u043D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u043F\u043E\u0440\u0430\u0445\u0443\u0432\u0430\u0442\u0438 diff \u0434\u043B\u044F \u043E\u0446\u0456\u043D\u043A\u0438 \u0440\u0438\u0437\u0438\u043A\u0443";
40942
+ var BLAST_RADIUS_FLOOR_REASON = "migration or database schema files changed";
40943
+ var BLAST_RADIUS_UNKNOWN_REASON = "could not inspect the diff for risk scoring";
40933
40944
  async function resolveEffectiveRisk(deps, worktreePath, projectSlug, review) {
40934
40945
  let risk = review?.risk ?? "trivial";
40935
- let reason = review?.riskReason ?? "\u043D\u0435\u0442\u0440\u0438\u0432\u0456\u0430\u043B\u044C\u043D\u0430 \u0437\u043C\u0456\u043D\u0430 \u0437\u0430 \u043E\u0446\u0456\u043D\u043A\u043E\u044E self-review";
40946
+ let reason = review?.riskReason ?? "self-review marked the change as nontrivial";
40936
40947
  try {
40937
40948
  const getDefaultBranch = deps.getDefaultBranch ?? (async () => "main");
40938
40949
  const listPaths = deps.listRunDiffPaths ?? defaultListRunDiffPaths;
@@ -41726,6 +41737,13 @@ async function runBackstopSweep(deps, drive = (slug, id) => driveRun(deps, slug,
41726
41737
  running = [];
41727
41738
  }
41728
41739
  for (const run3 of running) {
41740
+ if (!isRunRecoverableByThisBridge(run3, deps.worktreeRoot)) {
41741
+ process.stderr.write(
41742
+ `[mrrlin] skipping foreign stale run ${slug}/${run3.id}; worktree is owned by another bridge
41743
+ `
41744
+ );
41745
+ continue;
41746
+ }
41729
41747
  await deps.client.requeueExecutionRun(slug, run3.id, deps.staleSeconds).catch(() => null);
41730
41748
  }
41731
41749
  let pending = [];
@@ -41767,6 +41785,12 @@ async function runBackstopSweep(deps, drive = (slug, id) => driveRun(deps, slug,
41767
41785
  }
41768
41786
  }
41769
41787
  }
41788
+ function isRunRecoverableByThisBridge(run3, worktreeRoot) {
41789
+ if (!worktreeRoot) return true;
41790
+ if (!run3.worktreeId) return false;
41791
+ const relative = import_node_path6.default.relative(import_node_path6.default.resolve(worktreeRoot), import_node_path6.default.resolve(run3.worktreeId));
41792
+ return relative === "" || relative.length > 0 && !relative.startsWith("..") && !import_node_path6.default.isAbsolute(relative);
41793
+ }
41770
41794
  async function deployGateHandoff(deps, projectSlug, task, runId, reason, leaseId) {
41771
41795
  await deps.client.updateExecutionRun(projectSlug, runId, { status: "failed", finishedAt: (/* @__PURE__ */ new Date()).toISOString(), leaseId: leaseId ?? void 0 }).catch(() => {
41772
41796
  });
@@ -42215,13 +42239,13 @@ function codexIdleMs() {
42215
42239
  // src/operator-token.ts
42216
42240
  var import_node_fs5 = require("node:fs");
42217
42241
  var import_node_os4 = __toESM(require("node:os"), 1);
42218
- var import_node_path6 = __toESM(require("node:path"), 1);
42242
+ var import_node_path7 = __toESM(require("node:path"), 1);
42219
42243
  function operatorDir() {
42220
- const base = process.env.CODEX_HOME ? import_node_path6.default.join(process.env.CODEX_HOME, "mrrlin") : import_node_path6.default.join(import_node_os4.default.homedir(), ".mrrlin");
42244
+ const base = process.env.CODEX_HOME ? import_node_path7.default.join(process.env.CODEX_HOME, "mrrlin") : import_node_path7.default.join(import_node_os4.default.homedir(), ".mrrlin");
42221
42245
  return base;
42222
42246
  }
42223
42247
  function operatorTokenPath() {
42224
- return import_node_path6.default.join(operatorDir(), "operator-token");
42248
+ return import_node_path7.default.join(operatorDir(), "operator-token");
42225
42249
  }
42226
42250
  function readOperatorToken() {
42227
42251
  try {
@@ -42238,7 +42262,7 @@ function persistOperatorToken(token) {
42238
42262
  `, { encoding: "utf8", mode: 384 });
42239
42263
  }
42240
42264
  function agentCredentialPath() {
42241
- return import_node_path6.default.join(operatorDir(), "agent-credential");
42265
+ return import_node_path7.default.join(operatorDir(), "agent-credential");
42242
42266
  }
42243
42267
  function persistAgentSecret(secret) {
42244
42268
  const dir = operatorDir();
@@ -42259,9 +42283,9 @@ function readAgentSecret() {
42259
42283
 
42260
42284
  // src/thread-index.ts
42261
42285
  var import_node_fs6 = require("node:fs");
42262
- var import_node_path7 = __toESM(require("node:path"), 1);
42286
+ var import_node_path8 = __toESM(require("node:path"), 1);
42263
42287
  function threadIndexPath(stateDir) {
42264
- return import_node_path7.default.join(stateDir, "threads.json");
42288
+ return import_node_path8.default.join(stateDir, "threads.json");
42265
42289
  }
42266
42290
  function loadThreadIndex(stateDir, ttlMs, now) {
42267
42291
  const result = /* @__PURE__ */ new Map();
@@ -42378,7 +42402,7 @@ function chatTurnMaxMs() {
42378
42402
  var import_node_crypto6 = require("node:crypto");
42379
42403
  var import_node_fs7 = require("node:fs");
42380
42404
  var import_node_os5 = __toESM(require("node:os"), 1);
42381
- var import_node_path8 = __toESM(require("node:path"), 1);
42405
+ var import_node_path9 = __toESM(require("node:path"), 1);
42382
42406
  var DEFAULT_WORKER_PORT = 8792;
42383
42407
  function workerPort() {
42384
42408
  const raw = process.env.MRRLIN_WORKER_PORT;
@@ -42387,11 +42411,11 @@ function workerPort() {
42387
42411
  return Number.isFinite(parsed) && parsed > 0 ? parsed : DEFAULT_WORKER_PORT;
42388
42412
  }
42389
42413
  function workerDir() {
42390
- const base = process.env.CODEX_HOME ? import_node_path8.default.join(process.env.CODEX_HOME, "mrrlin") : import_node_path8.default.join(import_node_os5.default.homedir(), ".mrrlin");
42391
- return import_node_path8.default.join(base, "worker");
42414
+ const base = process.env.CODEX_HOME ? import_node_path9.default.join(process.env.CODEX_HOME, "mrrlin") : import_node_path9.default.join(import_node_os5.default.homedir(), ".mrrlin");
42415
+ return import_node_path9.default.join(base, "worker");
42392
42416
  }
42393
42417
  function workerTokenPath() {
42394
- return import_node_path8.default.join(workerDir(), "token");
42418
+ return import_node_path9.default.join(workerDir(), "token");
42395
42419
  }
42396
42420
  function readWorkerToken() {
42397
42421
  try {
@@ -42416,7 +42440,7 @@ function readOrCreateWorkerToken() {
42416
42440
  var import_node_events2 = require("node:events");
42417
42441
  var import_node_fs8 = require("node:fs");
42418
42442
  var import_node_os6 = require("node:os");
42419
- var import_node_path9 = require("node:path");
42443
+ var import_node_path10 = require("node:path");
42420
42444
 
42421
42445
  // ../../node_modules/.pnpm/@noble+hashes@1.3.3/node_modules/@noble/hashes/esm/cryptoNode.js
42422
42446
  var nc = __toESM(require("node:crypto"), 1);
@@ -45987,9 +46011,9 @@ var DirectorRelay = class {
45987
46011
 
45988
46012
  // src/remote-phone-relay.ts
45989
46013
  function loadOrCreateAgentDeviceKey() {
45990
- const path15 = (0, import_node_path9.join)((0, import_node_os6.homedir)(), ".mrrlin", "agent-device-key");
46014
+ const path16 = (0, import_node_path10.join)((0, import_node_os6.homedir)(), ".mrrlin", "agent-device-key");
45991
46015
  try {
45992
- const raw = JSON.parse((0, import_node_fs8.readFileSync)(path15, "utf8"));
46016
+ const raw = JSON.parse((0, import_node_fs8.readFileSync)(path16, "utf8"));
45993
46017
  if (typeof raw.priv === "string" && typeof raw.pub === "string") {
45994
46018
  return { privateKey: fromBase64Url(raw.priv), publicKey: fromBase64Url(raw.pub) };
45995
46019
  }
@@ -45997,9 +46021,9 @@ function loadOrCreateAgentDeviceKey() {
45997
46021
  }
45998
46022
  const kp = generateIdentityKeyPair();
45999
46023
  try {
46000
- (0, import_node_fs8.mkdirSync)((0, import_node_path9.join)((0, import_node_os6.homedir)(), ".mrrlin"), { recursive: true });
46024
+ (0, import_node_fs8.mkdirSync)((0, import_node_path10.join)((0, import_node_os6.homedir)(), ".mrrlin"), { recursive: true });
46001
46025
  (0, import_node_fs8.writeFileSync)(
46002
- path15,
46026
+ path16,
46003
46027
  JSON.stringify({ priv: toBase64Url(kp.privateKey), pub: toBase64Url(kp.publicKey) }),
46004
46028
  { mode: 384 }
46005
46029
  );
@@ -46007,7 +46031,7 @@ function loadOrCreateAgentDeviceKey() {
46007
46031
  }
46008
46032
  return kp;
46009
46033
  }
46010
- var AGENT_PAIRING_PATH = (0, import_node_path9.join)((0, import_node_os6.homedir)(), ".mrrlin", "agent-pairing.json");
46034
+ var AGENT_PAIRING_PATH = (0, import_node_path10.join)((0, import_node_os6.homedir)(), ".mrrlin", "agent-pairing.json");
46011
46035
  function loadAgentPairing() {
46012
46036
  try {
46013
46037
  const raw = JSON.parse((0, import_node_fs8.readFileSync)(AGENT_PAIRING_PATH, "utf8"));
@@ -46025,7 +46049,7 @@ function loadAgentPairing() {
46025
46049
  }
46026
46050
  function saveAgentPairing(record2) {
46027
46051
  try {
46028
- (0, import_node_fs8.mkdirSync)((0, import_node_path9.join)((0, import_node_os6.homedir)(), ".mrrlin"), { recursive: true });
46052
+ (0, import_node_fs8.mkdirSync)((0, import_node_path10.join)((0, import_node_os6.homedir)(), ".mrrlin"), { recursive: true });
46029
46053
  (0, import_node_fs8.writeFileSync)(AGENT_PAIRING_PATH, JSON.stringify(record2), { mode: 384 });
46030
46054
  } catch {
46031
46055
  }
@@ -46204,11 +46228,11 @@ async function renderPairingQrSvg(payload) {
46204
46228
 
46205
46229
  // src/checkout-registry.ts
46206
46230
  var import_node_fs9 = require("node:fs");
46207
- var import_node_path10 = require("node:path");
46231
+ var import_node_path11 = require("node:path");
46208
46232
  var CheckoutRegistry = class {
46209
46233
  file;
46210
46234
  constructor(stateDir) {
46211
- this.file = (0, import_node_path10.join)(stateDir, "checkouts.json");
46235
+ this.file = (0, import_node_path11.join)(stateDir, "checkouts.json");
46212
46236
  (0, import_node_fs9.mkdirSync)(stateDir, { recursive: true });
46213
46237
  }
46214
46238
  read() {
@@ -46222,9 +46246,9 @@ var CheckoutRegistry = class {
46222
46246
  get(slug) {
46223
46247
  return this.read()[slug] ?? null;
46224
46248
  }
46225
- confirm(slug, path15, now) {
46249
+ confirm(slug, path16, now) {
46226
46250
  const all = this.read();
46227
- all[slug] = { path: path15, confirmedAt: now };
46251
+ all[slug] = { path: path16, confirmedAt: now };
46228
46252
  (0, import_node_fs9.writeFileSync)(this.file, JSON.stringify(all, null, 2));
46229
46253
  }
46230
46254
  };
@@ -46437,7 +46461,7 @@ function extractVerificationSection(markdown) {
46437
46461
 
46438
46462
  // src/bridge-log.ts
46439
46463
  var import_node_fs10 = require("node:fs");
46440
- var import_node_path11 = require("node:path");
46464
+ var import_node_path12 = require("node:path");
46441
46465
 
46442
46466
  // src/redact.ts
46443
46467
  var REDACTED = "[REDACTED]";
@@ -46522,14 +46546,14 @@ function resolvePromptsEnabled(env) {
46522
46546
  }
46523
46547
  function createBridgeLogger(stateDir, env = process.env) {
46524
46548
  if (!resolveBridgeLogEnabled(env)) return NOOP_LOGGER;
46525
- const logsDir = (0, import_node_path11.join)(stateDir, "logs");
46549
+ const logsDir = (0, import_node_path12.join)(stateDir, "logs");
46526
46550
  try {
46527
46551
  (0, import_node_fs10.mkdirSync)(logsDir, { recursive: true });
46528
46552
  } catch {
46529
46553
  return NOOP_LOGGER;
46530
46554
  }
46531
46555
  const includePrompts = resolvePromptsEnabled(env);
46532
- const fileFor = () => (0, import_node_path11.join)(logsDir, `bridge-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.jsonl`);
46556
+ const fileFor = () => (0, import_node_path12.join)(logsDir, `bridge-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.jsonl`);
46533
46557
  const write = (dir, rec) => {
46534
46558
  try {
46535
46559
  const line = JSON.stringify({
@@ -46619,9 +46643,9 @@ function readKnownGptSlugsFromTomlFile(filePath) {
46619
46643
  return Array.from(raw.matchAll(/^\s*model\s*=\s*"([^"]+)"/gm)).map((match) => match[1]?.trim() ?? "").filter(isSelectableModelSlug);
46620
46644
  }
46621
46645
  function readCodexFallbackModels() {
46622
- const codexHome = process.env.CODEX_HOME?.trim() || import_node_path12.default.join(import_node_os7.default.homedir(), ".codex");
46646
+ const codexHome = process.env.CODEX_HOME?.trim() || import_node_path13.default.join(import_node_os7.default.homedir(), ".codex");
46623
46647
  const models = /* @__PURE__ */ new Map();
46624
- const cachePath = import_node_path12.default.join(codexHome, "models_cache.json");
46648
+ const cachePath = import_node_path13.default.join(codexHome, "models_cache.json");
46625
46649
  const cacheRaw = readTextIfExists(cachePath);
46626
46650
  if (cacheRaw) {
46627
46651
  try {
@@ -46671,7 +46695,7 @@ function readCodexFallbackModels() {
46671
46695
  );
46672
46696
  }
46673
46697
  }
46674
- for (const slug of readKnownGptSlugsFromTomlFile(import_node_path12.default.join(codexHome, "config.toml"))) {
46698
+ for (const slug of readKnownGptSlugsFromTomlFile(import_node_path13.default.join(codexHome, "config.toml"))) {
46675
46699
  addBridgeModel(
46676
46700
  models,
46677
46701
  mapBridgeModel({
@@ -46685,11 +46709,11 @@ function readCodexFallbackModels() {
46685
46709
  })
46686
46710
  );
46687
46711
  }
46688
- const automationsDir = import_node_path12.default.join(codexHome, "automations");
46712
+ const automationsDir = import_node_path13.default.join(codexHome, "automations");
46689
46713
  try {
46690
46714
  for (const entry of import_node_fs11.default.readdirSync(automationsDir, { withFileTypes: true })) {
46691
46715
  if (!entry.isDirectory()) continue;
46692
- for (const slug of readKnownGptSlugsFromTomlFile(import_node_path12.default.join(automationsDir, entry.name, "automation.toml"))) {
46716
+ for (const slug of readKnownGptSlugsFromTomlFile(import_node_path13.default.join(automationsDir, entry.name, "automation.toml"))) {
46693
46717
  addBridgeModel(
46694
46718
  models,
46695
46719
  mapBridgeModel({
@@ -46709,7 +46733,7 @@ function readCodexFallbackModels() {
46709
46733
  return [...models.values()];
46710
46734
  }
46711
46735
  function neutralCheckoutCwd(stateDir) {
46712
- const dir = import_node_path12.default.join(stateDir, "no-checkout");
46736
+ const dir = import_node_path13.default.join(stateDir, "no-checkout");
46713
46737
  try {
46714
46738
  import_node_fs11.default.mkdirSync(dir, { recursive: true });
46715
46739
  } catch {
@@ -46725,7 +46749,7 @@ function buildThreadStartParams(msg, config2, desiredModel) {
46725
46749
  "required before the result LANDS (merge/deploy); it does not authorize building on unvalidated",
46726
46750
  "assumptions. Judge clarification on requirement clarity, independently of autonomy_level.",
46727
46751
  "Never announce or pre-narrate that you are about to use tools, and never name the toolset in",
46728
- `prose. Do NOT write openers like "I'll use the Mrrlin tools to\u2026", "\u0412\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u044E Mrrlin tools\u2026",`,
46752
+ `prose. Do NOT write openers like "I'll use the Mrrlin tools to\u2026",`,
46729
46753
  'or "let me call the \u2026 tool" in ANY language. The operator already sees tool calls in the',
46730
46754
  "transcript. Just call the tools and reply with the outcome \u2014 start your reply with the result.",
46731
46755
  "When creating or updating tasks, always provide `autonomyLevel` and `autonomyReason`.",
@@ -47047,8 +47071,8 @@ async function runOrphanWorktreeSweep(client, opts) {
47047
47071
  }
47048
47072
  }
47049
47073
  function readStateDir() {
47050
- if (process.env.CODEX_HOME) return import_node_path12.default.join(process.env.CODEX_HOME, "mrrlin", "director-bridge");
47051
- return import_node_path12.default.join(import_node_os7.default.homedir(), ".mrrlin", "director-bridge");
47074
+ if (process.env.CODEX_HOME) return import_node_path13.default.join(process.env.CODEX_HOME, "mrrlin", "director-bridge");
47075
+ return import_node_path13.default.join(import_node_os7.default.homedir(), ".mrrlin", "director-bridge");
47052
47076
  }
47053
47077
  function readAllowedOrigins() {
47054
47078
  const raw = (process.env.MRRLIN_DIRECTOR_BRIDGE_ALLOWED_ORIGINS ?? "").trim();
@@ -48025,8 +48049,8 @@ async function startDirectorBridge() {
48025
48049
  codexCwd: config2.codexCwd,
48026
48050
  codexExecutable: config2.codexExecutable,
48027
48051
  checkoutRegistry,
48028
- worktreeRoot: import_node_path12.default.join(config2.stateDir, "worktrees"),
48029
- locksDir: import_node_path12.default.join(config2.stateDir, "locks"),
48052
+ worktreeRoot: import_node_path13.default.join(config2.stateDir, "worktrees"),
48053
+ locksDir: import_node_path13.default.join(config2.stateDir, "locks"),
48030
48054
  // Wire the executor server for code-execution runs. Each run gets its own app-server
48031
48055
  // process at the run worktree, running UNRESTRICTED from the real ~/.codex (owner
48032
48056
  // no-sandbox decision — auth + mrrlin MCP come from the operator config).
@@ -48062,7 +48086,7 @@ async function startDirectorBridge() {
48062
48086
  // egressDomains is retained in the seam signature (verification-turn.ts still computes the
48063
48087
  // env host) but no longer constrains anything — the executor is unrestricted.
48064
48088
  startSandbox: async (_egressDomains) => {
48065
- const cwd = import_node_fs11.default.mkdtempSync(import_node_path12.default.join(import_node_os7.default.tmpdir(), "mrrlin-verify-"));
48089
+ const cwd = import_node_fs11.default.mkdtempSync(import_node_path13.default.join(import_node_os7.default.tmpdir(), "mrrlin-verify-"));
48066
48090
  let handle;
48067
48091
  try {
48068
48092
  handle = await startExecutorServer({ worktree: cwd });
@@ -48142,6 +48166,16 @@ async function startDirectorBridge() {
48142
48166
  consumerState.inFlightRunId = null;
48143
48167
  }
48144
48168
  });
48169
+ const driveRunNow = (slug, runId) => {
48170
+ consumerState.inFlightRunId = runId;
48171
+ consumerState.lastClaimAt = (/* @__PURE__ */ new Date()).toISOString();
48172
+ void driveRun(consumerDeps, slug, runId).catch((error51) => {
48173
+ process.stderr.write(`[mrrlin-mcp director-bridge] drive failed for ${slug}/${runId}: ${error51 instanceof Error ? error51.message : String(error51)}
48174
+ `);
48175
+ }).finally(() => {
48176
+ consumerState.inFlightRunId = null;
48177
+ });
48178
+ };
48145
48179
  const driveAsyncTracked = (slug, jobId) => enqueueRun(async () => {
48146
48180
  try {
48147
48181
  await driveAsyncJob(asyncConsumerDeps, slug, jobId);
@@ -48150,6 +48184,12 @@ async function startDirectorBridge() {
48150
48184
  `);
48151
48185
  }
48152
48186
  });
48187
+ const driveAsyncNow = (slug, jobId) => {
48188
+ void driveAsyncJob(asyncConsumerDeps, slug, jobId).catch((error51) => {
48189
+ process.stderr.write(`[mrrlin-mcp director-bridge] async drive failed for ${slug}/${jobId}: ${error51 instanceof Error ? error51.message : String(error51)}
48190
+ `);
48191
+ });
48192
+ };
48153
48193
  const server = import_node_http.default.createServer(
48154
48194
  createBridgeRequestListener({
48155
48195
  host: config2.host,
@@ -48344,8 +48384,8 @@ async function startDirectorBridge() {
48344
48384
  }
48345
48385
  res.writeHead(202, { "content-type": "application/json" });
48346
48386
  res.end(JSON.stringify({ ok: true }));
48347
- if (jobId) driveAsyncTracked(slug, jobId);
48348
- else driveTracked(slug, runId);
48387
+ if (jobId) driveAsyncNow(slug, jobId);
48388
+ else driveRunNow(slug, runId);
48349
48389
  }).catch(() => {
48350
48390
  res.writeHead(400).end();
48351
48391
  });
@@ -48380,8 +48420,8 @@ async function startDirectorBridge() {
48380
48420
  enqueueRun(
48381
48421
  () => runOrphanWorktreeSweep(client, {
48382
48422
  checkoutRegistry,
48383
- worktreeRoot: import_node_path12.default.join(config2.stateDir, "worktrees"),
48384
- locksDir: import_node_path12.default.join(config2.stateDir, "locks")
48423
+ worktreeRoot: import_node_path13.default.join(config2.stateDir, "worktrees"),
48424
+ locksDir: import_node_path13.default.join(config2.stateDir, "locks")
48385
48425
  })
48386
48426
  );
48387
48427
  enqueueRun(async () => {
@@ -48437,12 +48477,19 @@ async function startDirectorBridge() {
48437
48477
  );
48438
48478
  }
48439
48479
  let schedulerTickHandle = null;
48440
- const schedulerToken = process.env.MRRLIN_SCHEDULER_TOKEN?.trim();
48441
- if (schedulerToken && !schedulerTickDisabled(process.env)) {
48442
- schedulerTickHandle = startSchedulerTickLoop({ apiBaseUrl, token: schedulerToken, logger: bridgeLogger });
48443
- } else if (!schedulerToken) {
48480
+ if (tokenProvider && !schedulerTickDisabled(process.env)) {
48481
+ schedulerTickHandle = startSchedulerTickLoop({
48482
+ apiBaseUrl,
48483
+ fetchImpl: authedFetch,
48484
+ logger: bridgeLogger,
48485
+ dispatchEnqueued: (projectSlug, work) => {
48486
+ if (work.kind === "execution_run") driveRunNow(projectSlug, work.runId);
48487
+ else driveAsyncNow(projectSlug, work.jobId);
48488
+ }
48489
+ });
48490
+ } else if (!tokenProvider) {
48444
48491
  process.stderr.write(
48445
- "[mrrlin-mcp director-bridge] no scheduler token (MRRLIN_SCHEDULER_TOKEN unset); skipping scheduler tick loop. Tasks advance only when an external cron hits /cron/scheduler/run.\n"
48492
+ "[mrrlin-mcp director-bridge] no durable agent credential; skipping bridge scheduler tick loop.\n"
48446
48493
  );
48447
48494
  } else {
48448
48495
  process.stderr.write(
@@ -48623,7 +48670,7 @@ function readDispatchBody(req) {
48623
48670
  function readOrCreateBridgeToken(stateDir) {
48624
48671
  const explicit = (process.env.MRRLIN_DIRECTOR_BRIDGE_TOKEN ?? "").trim();
48625
48672
  if (explicit) return explicit;
48626
- const tokenPath = import_node_path12.default.join(stateDir, "token.txt");
48673
+ const tokenPath = import_node_path13.default.join(stateDir, "token.txt");
48627
48674
  try {
48628
48675
  const existing = import_node_fs11.default.readFileSync(tokenPath, "utf8").trim();
48629
48676
  if (existing) return existing;
@@ -52016,16 +52063,16 @@ var StdioServerTransport = class {
52016
52063
  var import_node_crypto10 = require("node:crypto");
52017
52064
  var import_promises3 = require("node:fs/promises");
52018
52065
  var import_node_fs12 = require("node:fs");
52019
- var import_node_path14 = __toESM(require("node:path"), 1);
52066
+ var import_node_path15 = __toESM(require("node:path"), 1);
52020
52067
  var import_node_os8 = __toESM(require("node:os"), 1);
52021
52068
  var import_node_child_process8 = require("node:child_process");
52022
52069
 
52023
52070
  // ../../packages/wiki/dist/index.js
52024
52071
  var import_promises2 = __toESM(require("node:fs/promises"), 1);
52025
- var import_node_path13 = __toESM(require("node:path"), 1);
52072
+ var import_node_path14 = __toESM(require("node:path"), 1);
52026
52073
  var INCLUDED_DOC_FOLDERS = /* @__PURE__ */ new Set(["_meta", "explanation", "how-to", "reference", "sdd", "tutorials"]);
52027
52074
  function toPosixPath(input) {
52028
- return input.split(import_node_path13.default.sep).join("/");
52075
+ return input.split(import_node_path14.default.sep).join("/");
52029
52076
  }
52030
52077
  function slugifyWikiSegment(input) {
52031
52078
  return input.trim().toLowerCase().replace(/`/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
@@ -52039,12 +52086,12 @@ async function pathExists2(input) {
52039
52086
  }
52040
52087
  }
52041
52088
  async function findWorkspaceRoot(start = process.cwd()) {
52042
- let current = import_node_path13.default.resolve(start);
52089
+ let current = import_node_path14.default.resolve(start);
52043
52090
  while (true) {
52044
- if (await pathExists2(import_node_path13.default.join(current, "pnpm-workspace.yaml")) && await pathExists2(import_node_path13.default.join(current, "docs"))) {
52091
+ if (await pathExists2(import_node_path14.default.join(current, "pnpm-workspace.yaml")) && await pathExists2(import_node_path14.default.join(current, "docs"))) {
52045
52092
  return current;
52046
52093
  }
52047
- const parent = import_node_path13.default.dirname(current);
52094
+ const parent = import_node_path14.default.dirname(current);
52048
52095
  if (parent === current) {
52049
52096
  throw new Error(`Unable to find Mrrlin workspace root from ${start}`);
52050
52097
  }
@@ -52053,28 +52100,28 @@ async function findWorkspaceRoot(start = process.cwd()) {
52053
52100
  }
52054
52101
  async function resolveDocsRoot(input) {
52055
52102
  if (input) {
52056
- return import_node_path13.default.resolve(input);
52103
+ return import_node_path14.default.resolve(input);
52057
52104
  }
52058
52105
  if (process.env.MRRLIN_DOCS_ROOT) {
52059
- return import_node_path13.default.resolve(process.env.MRRLIN_DOCS_ROOT);
52106
+ return import_node_path14.default.resolve(process.env.MRRLIN_DOCS_ROOT);
52060
52107
  }
52061
- return import_node_path13.default.join(await findWorkspaceRoot(), "docs");
52108
+ return import_node_path14.default.join(await findWorkspaceRoot(), "docs");
52062
52109
  }
52063
52110
  async function resolveIndexPath(input) {
52064
52111
  if (input) {
52065
- return import_node_path13.default.resolve(input);
52112
+ return import_node_path14.default.resolve(input);
52066
52113
  }
52067
52114
  if (process.env.MRRLIN_WIKI_INDEX_PATH) {
52068
- return import_node_path13.default.resolve(process.env.MRRLIN_WIKI_INDEX_PATH);
52115
+ return import_node_path14.default.resolve(process.env.MRRLIN_WIKI_INDEX_PATH);
52069
52116
  }
52070
52117
  const workspaceRoot = await findWorkspaceRoot();
52071
- return import_node_path13.default.join(workspaceRoot, "apps", "web", "public", "wiki-index.json");
52118
+ return import_node_path14.default.join(workspaceRoot, "apps", "web", "public", "wiki-index.json");
52072
52119
  }
52073
52120
  async function walkMarkdownFiles(root, dir = root) {
52074
52121
  const entries = await import_promises2.default.readdir(dir, { withFileTypes: true });
52075
52122
  const files = [];
52076
52123
  for (const entry of entries) {
52077
- const absolute = import_node_path13.default.join(dir, entry.name);
52124
+ const absolute = import_node_path14.default.join(dir, entry.name);
52078
52125
  if (entry.isDirectory()) {
52079
52126
  files.push(...await walkMarkdownFiles(root, absolute));
52080
52127
  continue;
@@ -52093,7 +52140,7 @@ function parseTitle(markdown, sourcePath) {
52093
52140
  return title;
52094
52141
  }
52095
52142
  function documentFromFile(docsRoot, absolutePath, markdown) {
52096
- const relativePath = toPosixPath(import_node_path13.default.relative(docsRoot, absolutePath));
52143
+ const relativePath = toPosixPath(import_node_path14.default.relative(docsRoot, absolutePath));
52097
52144
  const [section, fileName] = relativePath.split("/");
52098
52145
  if (!section || !fileName || !INCLUDED_DOC_FOLDERS.has(section)) {
52099
52146
  return null;
@@ -54230,7 +54277,7 @@ function createMrrlinTools(options) {
54230
54277
  "ARTIFACT_FILE_UPLOAD_FAILED",
54231
54278
  "Unable to upload artifact file.",
54232
54279
  async (c, { projectSlug, path: filePath, class: artifactClass, taskId, runId, description }) => {
54233
- const extension2 = import_node_path14.default.extname(filePath).toLowerCase();
54280
+ const extension2 = import_node_path15.default.extname(filePath).toLowerCase();
54234
54281
  const contentType = ARTIFACT_EXTENSION_TYPES[extension2];
54235
54282
  if (!contentType) {
54236
54283
  throw new McpToolCodedError(
@@ -54258,7 +54305,7 @@ function createMrrlinTools(options) {
54258
54305
  "Artifact exceeds 5MB; split or summarize instead."
54259
54306
  );
54260
54307
  }
54261
- const filename = import_node_path14.default.basename(filePath);
54308
+ const filename = import_node_path15.default.basename(filePath);
54262
54309
  const created = await c.createArtifactFile(projectSlug, {
54263
54310
  class: artifactClass,
54264
54311
  contentType,
@@ -54341,7 +54388,7 @@ function createMrrlinTools(options) {
54341
54388
  "Unable to register local checkout.",
54342
54389
  async (_c, { projectSlug, path: checkoutPath, repo }) => {
54343
54390
  const trimmedPath = checkoutPath.trim();
54344
- if (!import_node_path14.default.isAbsolute(trimmedPath)) {
54391
+ if (!import_node_path15.default.isAbsolute(trimmedPath)) {
54345
54392
  throw new McpToolCodedError(
54346
54393
  "LOCAL_CHECKOUT_PATH_NOT_ABSOLUTE",
54347
54394
  `Path must be absolute, got: ${trimmedPath}`
@@ -54376,7 +54423,7 @@ function createMrrlinTools(options) {
54376
54423
  `Origin remote ${remoteUrl} does not match repo ${repo}.`
54377
54424
  );
54378
54425
  }
54379
- const stateDir = process.env.CODEX_HOME ? import_node_path14.default.join(process.env.CODEX_HOME, "mrrlin", "director-bridge") : import_node_path14.default.join(import_node_os8.default.homedir(), ".mrrlin", "director-bridge");
54426
+ const stateDir = process.env.CODEX_HOME ? import_node_path15.default.join(process.env.CODEX_HOME, "mrrlin", "director-bridge") : import_node_path15.default.join(import_node_os8.default.homedir(), ".mrrlin", "director-bridge");
54380
54427
  const registry3 = new CheckoutRegistry(stateDir);
54381
54428
  const confirmedAt = (/* @__PURE__ */ new Date()).toISOString();
54382
54429
  registry3.confirm(projectSlug, resolvedPath, confirmedAt);
@@ -54584,12 +54631,12 @@ function runSetCredential(args) {
54584
54631
 
54585
54632
  // src/install-service.ts
54586
54633
  var import_node_os9 = __toESM(require("node:os"), 1);
54587
- var import_node_path16 = __toESM(require("node:path"), 1);
54634
+ var import_node_path17 = __toESM(require("node:path"), 1);
54588
54635
 
54589
54636
  // src/service-paths.ts
54590
- var import_node_path15 = __toESM(require("node:path"), 1);
54637
+ var import_node_path16 = __toESM(require("node:path"), 1);
54591
54638
  function isWorktreePath(p) {
54592
- const norm = import_node_path15.default.normalize(p).split(import_node_path15.default.sep).join("/");
54639
+ const norm = import_node_path16.default.normalize(p).split(import_node_path16.default.sep).join("/");
54593
54640
  return norm.includes("/.claude/worktrees/");
54594
54641
  }
54595
54642
  function resolveServiceCwd(opts) {
@@ -54612,7 +54659,6 @@ function renderEcosystemConfig(opts) {
54612
54659
  if (opts.codexHome) env.CODEX_HOME = opts.codexHome;
54613
54660
  if (opts.staging) env.MRRLIN_STAGING = "1";
54614
54661
  else if (opts.apiBaseUrl) env.MRRLIN_API_BASE_URL = opts.apiBaseUrl;
54615
- if (opts.schedulerToken) env.MRRLIN_SCHEDULER_TOKEN = opts.schedulerToken;
54616
54662
  const envLines = Object.entries(env).map(([k, v]) => ` ${k}: ${JSON.stringify(v)},`).join("\n");
54617
54663
  return `module.exports = {
54618
54664
  apps: [{
@@ -54655,17 +54701,16 @@ function installService(deps) {
54655
54701
  return { ok: false };
54656
54702
  }
54657
54703
  const resolvedBins = bins.filter((b) => b !== null);
54658
- const pathEnv = Array.from(new Set(resolvedBins.map((b) => import_node_path16.default.dirname(b)))).join(":");
54704
+ const pathEnv = Array.from(new Set(resolvedBins.map((b) => import_node_path17.default.dirname(b)))).join(":");
54659
54705
  const text = renderEcosystemConfig({
54660
54706
  cwd: resolved.cwd,
54661
54707
  home,
54662
54708
  codexHome: deps.env.CODEX_HOME?.trim() || void 0,
54663
54709
  pathEnv,
54664
54710
  staging: deps.env.MRRLIN_STAGING === "1",
54665
- apiBaseUrl: deps.env.MRRLIN_API_BASE_URL?.trim() || void 0,
54666
- schedulerToken: deps.env.MRRLIN_SCHEDULER_TOKEN?.trim() || void 0
54711
+ apiBaseUrl: deps.env.MRRLIN_API_BASE_URL?.trim() || void 0
54667
54712
  });
54668
- const ecoPath = import_node_path16.default.join(home, ".mrrlin", "ecosystem.config.cjs");
54713
+ const ecoPath = import_node_path17.default.join(home, ".mrrlin", "ecosystem.config.cjs");
54669
54714
  deps.writeFile(ecoPath, text);
54670
54715
  const start = deps.runPm2(["startOrReload", ecoPath]);
54671
54716
  if (start.code !== 0) {
@@ -54697,12 +54742,12 @@ function uninstallService(deps) {
54697
54742
  // src/uninstall-codex.ts
54698
54743
  var import_promises4 = __toESM(require("node:fs/promises"), 1);
54699
54744
  var import_node_os10 = __toESM(require("node:os"), 1);
54700
- var import_node_path17 = __toESM(require("node:path"), 1);
54745
+ var import_node_path18 = __toESM(require("node:path"), 1);
54701
54746
  var toml2 = __toESM(require_toml(), 1);
54702
54747
  function resolveCodexHome2(options) {
54703
54748
  if (options.codexHome) return options.codexHome;
54704
54749
  if (process.env.CODEX_HOME) return process.env.CODEX_HOME;
54705
- return import_node_path17.default.join(options.homeDir ?? import_node_os10.default.homedir(), ".codex");
54750
+ return import_node_path18.default.join(options.homeDir ?? import_node_os10.default.homedir(), ".codex");
54706
54751
  }
54707
54752
  async function pathExists3(target) {
54708
54753
  try {
@@ -54715,7 +54760,7 @@ async function pathExists3(target) {
54715
54760
  var MRRLIN_BLOCK_RE = /(^|\n)\[mcp_servers\.mrrlin(?:-browser)?(?:\]|\.[^\]\n]*\])[\s\S]*?(?=\n\[|$)/g;
54716
54761
  async function uninstallCodex(options = {}) {
54717
54762
  const codexHome = resolveCodexHome2(options);
54718
- const configPath = import_node_path17.default.join(codexHome, "config.toml");
54763
+ const configPath = import_node_path18.default.join(codexHome, "config.toml");
54719
54764
  const removePrompts = async () => uninstallPrompts(codexHome, options.promptNames ?? []);
54720
54765
  if (!await pathExists3(configPath)) {
54721
54766
  return { action: "missing", configPath, prompts: await removePrompts() };
@@ -54743,10 +54788,10 @@ async function uninstallCodex(options = {}) {
54743
54788
  }
54744
54789
  async function uninstallPrompts(codexHome, names) {
54745
54790
  if (names.length === 0) return [];
54746
- const promptsDir2 = import_node_path17.default.join(codexHome, "prompts");
54791
+ const promptsDir2 = import_node_path18.default.join(codexHome, "prompts");
54747
54792
  const out = [];
54748
54793
  for (const name of names) {
54749
- const promptPath = import_node_path17.default.join(promptsDir2, `${name}.md`);
54794
+ const promptPath = import_node_path18.default.join(promptsDir2, `${name}.md`);
54750
54795
  try {
54751
54796
  await import_promises4.default.unlink(promptPath);
54752
54797
  out.push({ name, action: "removed", promptPath });
@@ -54764,15 +54809,15 @@ async function uninstallPrompts(codexHome, names) {
54764
54809
 
54765
54810
  // src/report-issue-prompt.ts
54766
54811
  var import_node_fs13 = __toESM(require("node:fs"), 1);
54767
- var import_node_path18 = __toESM(require("node:path"), 1);
54812
+ var import_node_path19 = __toESM(require("node:path"), 1);
54768
54813
  var import_node_url3 = require("node:url");
54769
54814
  var import_meta3 = {};
54770
54815
  function promptsDir() {
54771
- if (typeof __dirname !== "undefined") return import_node_path18.default.join(__dirname, "prompts");
54772
- return import_node_path18.default.join(import_node_path18.default.dirname((0, import_node_url3.fileURLToPath)(import_meta3.url)), "prompts");
54816
+ if (typeof __dirname !== "undefined") return import_node_path19.default.join(__dirname, "prompts");
54817
+ return import_node_path19.default.join(import_node_path19.default.dirname((0, import_node_url3.fileURLToPath)(import_meta3.url)), "prompts");
54773
54818
  }
54774
54819
  function readReportIssuePrompt() {
54775
- return import_node_fs13.default.readFileSync(import_node_path18.default.join(promptsDir(), "report-issue.md"), "utf8");
54820
+ return import_node_fs13.default.readFileSync(import_node_path19.default.join(promptsDir(), "report-issue.md"), "utf8");
54776
54821
  }
54777
54822
 
54778
54823
  // src/bin.ts
@@ -55053,7 +55098,7 @@ async function main() {
55053
55098
  env: process.env,
55054
55099
  cwd: process.cwd(),
55055
55100
  writeFile: (p, c) => {
55056
- (0, import_node_fs14.mkdirSync)(import_node_path20.default.dirname(p), { recursive: true, mode: 448 });
55101
+ (0, import_node_fs14.mkdirSync)(import_node_path21.default.dirname(p), { recursive: true, mode: 448 });
55057
55102
  (0, import_node_fs14.writeFileSync)(p, c, { mode: 384 });
55058
55103
  },
55059
55104
  runPm2: pm2Runner,
@@ -55078,7 +55123,7 @@ async function main() {
55078
55123
  purgeSecret: purge,
55079
55124
  secretPath: agentCredentialPath(),
55080
55125
  tokenPath: operatorTokenPath(),
55081
- ecoPath: import_node_path20.default.join(process.env.HOME ?? (0, import_node_os11.homedir)(), ".mrrlin", "ecosystem.config.cjs"),
55126
+ ecoPath: import_node_path21.default.join(process.env.HOME ?? (0, import_node_os11.homedir)(), ".mrrlin", "ecosystem.config.cjs"),
55082
55127
  log: (m) => process.stderr.write(`[mrrlin-mcp uninstall-service] ${m}
55083
55128
  `)
55084
55129
  });
@@ -55099,7 +55144,7 @@ async function main() {
55099
55144
  purgeSecret: true,
55100
55145
  secretPath: agentCredentialPath(),
55101
55146
  tokenPath: operatorTokenPath(),
55102
- ecoPath: import_node_path20.default.join(home, ".mrrlin", "ecosystem.config.cjs"),
55147
+ ecoPath: import_node_path21.default.join(home, ".mrrlin", "ecosystem.config.cjs"),
55103
55148
  log
55104
55149
  });
55105
55150
  let codexOk = true;
@@ -55119,7 +55164,7 @@ async function main() {
55119
55164
  log(`codex config NOT modified: ${error51 instanceof Error ? error51.message : String(error51)}`);
55120
55165
  }
55121
55166
  try {
55122
- (0, import_node_fs14.rmSync)(import_node_path20.default.join(home, ".mrrlin"), { recursive: true, force: true });
55167
+ (0, import_node_fs14.rmSync)(import_node_path21.default.join(home, ".mrrlin"), { recursive: true, force: true });
55123
55168
  } catch {
55124
55169
  }
55125
55170
  log("removed ~/.mrrlin");
@@ -55160,7 +55205,7 @@ ${HELP_TEXT}`);
55160
55205
  }
55161
55206
  }
55162
55207
  function resolveSelfBinPath() {
55163
- return import_node_path19.default.resolve(process.argv[1] ?? process.execPath);
55208
+ return import_node_path20.default.resolve(process.argv[1] ?? process.execPath);
55164
55209
  }
55165
55210
  main().catch((error51) => {
55166
55211
  process.stderr.write(`mrrlin-mcp fatal error: ${error51 instanceof Error ? error51.message : String(error51)}