@mrrlin-dev/mcp 0.4.43 → 0.4.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.cjs +327 -249
- package/package.json +5 -5
package/dist/bin.cjs
CHANGED
|
@@ -7729,14 +7729,14 @@ var require_polyfills = __commonJS({
|
|
|
7729
7729
|
fs10.fstatSync = statFixSync(fs10.fstatSync);
|
|
7730
7730
|
fs10.lstatSync = statFixSync(fs10.lstatSync);
|
|
7731
7731
|
if (fs10.chmod && !fs10.lchmod) {
|
|
7732
|
-
fs10.lchmod = function(
|
|
7732
|
+
fs10.lchmod = function(path23, mode, cb) {
|
|
7733
7733
|
if (cb) process.nextTick(cb);
|
|
7734
7734
|
};
|
|
7735
7735
|
fs10.lchmodSync = function() {
|
|
7736
7736
|
};
|
|
7737
7737
|
}
|
|
7738
7738
|
if (fs10.chown && !fs10.lchown) {
|
|
7739
|
-
fs10.lchown = function(
|
|
7739
|
+
fs10.lchown = function(path23, uid, gid, cb) {
|
|
7740
7740
|
if (cb) process.nextTick(cb);
|
|
7741
7741
|
};
|
|
7742
7742
|
fs10.lchownSync = function() {
|
|
@@ -7803,9 +7803,9 @@ var require_polyfills = __commonJS({
|
|
|
7803
7803
|
};
|
|
7804
7804
|
}(fs10.readSync);
|
|
7805
7805
|
function patchLchmod(fs11) {
|
|
7806
|
-
fs11.lchmod = function(
|
|
7806
|
+
fs11.lchmod = function(path23, mode, callback) {
|
|
7807
7807
|
fs11.open(
|
|
7808
|
-
|
|
7808
|
+
path23,
|
|
7809
7809
|
constants2.O_WRONLY | constants2.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
|
-
fs11.lchmodSync = function(
|
|
7825
|
-
var fd = fs11.openSync(
|
|
7824
|
+
fs11.lchmodSync = function(path23, mode) {
|
|
7825
|
+
var fd = fs11.openSync(path23, constants2.O_WRONLY | constants2.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(fs11) {
|
|
7845
7845
|
if (constants2.hasOwnProperty("O_SYMLINK") && fs11.futimes) {
|
|
7846
|
-
fs11.lutimes = function(
|
|
7847
|
-
fs11.open(
|
|
7846
|
+
fs11.lutimes = function(path23, at, mt, cb) {
|
|
7847
|
+
fs11.open(path23, constants2.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
|
-
fs11.lutimesSync = function(
|
|
7860
|
-
var fd = fs11.openSync(
|
|
7859
|
+
fs11.lutimesSync = function(path23, at, mt) {
|
|
7860
|
+
var fd = fs11.openSync(path23, constants2.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(
|
|
7979
|
-
if (!(this instanceof ReadStream)) return new ReadStream(
|
|
7978
|
+
function ReadStream(path23, options) {
|
|
7979
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path23, options);
|
|
7980
7980
|
Stream.call(this);
|
|
7981
7981
|
var self = this;
|
|
7982
|
-
this.path =
|
|
7982
|
+
this.path = path23;
|
|
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(
|
|
8028
|
-
if (!(this instanceof WriteStream)) return new WriteStream(
|
|
8027
|
+
function WriteStream(path23, options) {
|
|
8028
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path23, options);
|
|
8029
8029
|
Stream.call(this);
|
|
8030
|
-
this.path =
|
|
8030
|
+
this.path = path23;
|
|
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
|
fs11.createWriteStream = createWriteStream;
|
|
8171
8171
|
var fs$readFile = fs11.readFile;
|
|
8172
8172
|
fs11.readFile = readFile9;
|
|
8173
|
-
function readFile9(
|
|
8173
|
+
function readFile9(path23, options, cb) {
|
|
8174
8174
|
if (typeof options === "function")
|
|
8175
8175
|
cb = options, options = null;
|
|
8176
|
-
return go$readFile(
|
|
8177
|
-
function go$readFile(
|
|
8178
|
-
return fs$readFile(
|
|
8176
|
+
return go$readFile(path23, options, cb);
|
|
8177
|
+
function go$readFile(path24, options2, cb2, startTime) {
|
|
8178
|
+
return fs$readFile(path24, options2, function(err) {
|
|
8179
8179
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
8180
|
-
enqueue([go$readFile, [
|
|
8180
|
+
enqueue([go$readFile, [path24, 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 = fs11.writeFile;
|
|
8189
8189
|
fs11.writeFile = writeFile5;
|
|
8190
|
-
function writeFile5(
|
|
8190
|
+
function writeFile5(path23, data, options, cb) {
|
|
8191
8191
|
if (typeof options === "function")
|
|
8192
8192
|
cb = options, options = null;
|
|
8193
|
-
return go$writeFile(
|
|
8194
|
-
function go$writeFile(
|
|
8195
|
-
return fs$writeFile(
|
|
8193
|
+
return go$writeFile(path23, data, options, cb);
|
|
8194
|
+
function go$writeFile(path24, data2, options2, cb2, startTime) {
|
|
8195
|
+
return fs$writeFile(path24, data2, options2, function(err) {
|
|
8196
8196
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
8197
|
-
enqueue([go$writeFile, [
|
|
8197
|
+
enqueue([go$writeFile, [path24, 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 = fs11.appendFile;
|
|
8206
8206
|
if (fs$appendFile)
|
|
8207
8207
|
fs11.appendFile = appendFile2;
|
|
8208
|
-
function appendFile2(
|
|
8208
|
+
function appendFile2(path23, data, options, cb) {
|
|
8209
8209
|
if (typeof options === "function")
|
|
8210
8210
|
cb = options, options = null;
|
|
8211
|
-
return go$appendFile(
|
|
8212
|
-
function go$appendFile(
|
|
8213
|
-
return fs$appendFile(
|
|
8211
|
+
return go$appendFile(path23, data, options, cb);
|
|
8212
|
+
function go$appendFile(path24, data2, options2, cb2, startTime) {
|
|
8213
|
+
return fs$appendFile(path24, data2, options2, function(err) {
|
|
8214
8214
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
8215
|
-
enqueue([go$appendFile, [
|
|
8215
|
+
enqueue([go$appendFile, [path24, 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 = fs11.readdir;
|
|
8244
8244
|
fs11.readdir = readdir5;
|
|
8245
8245
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
8246
|
-
function readdir5(
|
|
8246
|
+
function readdir5(path23, 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(
|
|
8250
|
-
return fs$readdir(
|
|
8251
|
-
|
|
8249
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path24, options2, cb2, startTime) {
|
|
8250
|
+
return fs$readdir(path24, fs$readdirCallback(
|
|
8251
|
+
path24,
|
|
8252
8252
|
options2,
|
|
8253
8253
|
cb2,
|
|
8254
8254
|
startTime
|
|
8255
8255
|
));
|
|
8256
|
-
} : function go$readdir2(
|
|
8257
|
-
return fs$readdir(
|
|
8258
|
-
|
|
8256
|
+
} : function go$readdir2(path24, options2, cb2, startTime) {
|
|
8257
|
+
return fs$readdir(path24, options2, fs$readdirCallback(
|
|
8258
|
+
path24,
|
|
8259
8259
|
options2,
|
|
8260
8260
|
cb2,
|
|
8261
8261
|
startTime
|
|
8262
8262
|
));
|
|
8263
8263
|
};
|
|
8264
|
-
return go$readdir(
|
|
8265
|
-
function fs$readdirCallback(
|
|
8264
|
+
return go$readdir(path23, options, cb);
|
|
8265
|
+
function fs$readdirCallback(path24, 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
|
-
[
|
|
8270
|
+
[path24, 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(
|
|
8341
|
+
function ReadStream(path23, 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(
|
|
8361
|
+
function WriteStream(path23, 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 createReadStream2(
|
|
8380
|
-
return new fs11.ReadStream(
|
|
8379
|
+
function createReadStream2(path23, options) {
|
|
8380
|
+
return new fs11.ReadStream(path23, options);
|
|
8381
8381
|
}
|
|
8382
|
-
function createWriteStream(
|
|
8383
|
-
return new fs11.WriteStream(
|
|
8382
|
+
function createWriteStream(path23, options) {
|
|
8383
|
+
return new fs11.WriteStream(path23, options);
|
|
8384
8384
|
}
|
|
8385
8385
|
var fs$open = fs11.open;
|
|
8386
8386
|
fs11.open = open;
|
|
8387
|
-
function open(
|
|
8387
|
+
function open(path23, flags, mode, cb) {
|
|
8388
8388
|
if (typeof mode === "function")
|
|
8389
8389
|
cb = mode, mode = null;
|
|
8390
|
-
return go$open(
|
|
8391
|
-
function go$open(
|
|
8392
|
-
return fs$open(
|
|
8390
|
+
return go$open(path23, flags, mode, cb);
|
|
8391
|
+
function go$open(path24, flags2, mode2, cb2, startTime) {
|
|
8392
|
+
return fs$open(path24, flags2, mode2, function(err, fd) {
|
|
8393
8393
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
8394
|
-
enqueue([go$open, [
|
|
8394
|
+
enqueue([go$open, [path24, 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
|
|
8923
|
+
var path23 = require("path");
|
|
8924
8924
|
var fs10 = 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,
|
|
8934
|
+
return callback(null, path23.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
|
|
10798
|
+
const path23 = dijkstra.find_path(graph.map, "start", "end");
|
|
10799
10799
|
const optimizedSegs = [];
|
|
10800
|
-
for (let i = 1; i <
|
|
10801
|
-
optimizedSegs.push(graph.table[
|
|
10800
|
+
for (let i = 1; i < path23.length - 1; i++) {
|
|
10801
|
+
optimizedSegs.push(graph.table[path23[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(
|
|
13278
|
+
exports2.renderToFile = function renderToFile(path23, 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 = fs10.createWriteStream(
|
|
13289
|
+
const stream = fs10.createWriteStream(path23);
|
|
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(
|
|
13351
|
+
exports2.renderToFile = function renderToFile(path23, qrData, options, cb) {
|
|
13352
13352
|
if (typeof cb === "undefined") {
|
|
13353
13353
|
cb = options;
|
|
13354
13354
|
options = void 0;
|
|
13355
13355
|
}
|
|
13356
13356
|
const fs10 = require("fs");
|
|
13357
13357
|
const utf8 = exports2.render(qrData, options);
|
|
13358
|
-
fs10.writeFile(
|
|
13358
|
+
fs10.writeFile(path23, 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
|
|
13479
|
+
let path23 = "";
|
|
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
|
-
|
|
13490
|
+
path23 += 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
|
-
|
|
13495
|
+
path23 += svgCmd("h", lineLength);
|
|
13496
13496
|
lineLength = 0;
|
|
13497
13497
|
}
|
|
13498
13498
|
} else {
|
|
13499
13499
|
moveBy++;
|
|
13500
13500
|
}
|
|
13501
13501
|
}
|
|
13502
|
-
return
|
|
13502
|
+
return path23;
|
|
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
|
|
13510
|
+
const path23 = "<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 +
|
|
13513
|
+
const svgTag = '<svg xmlns="http://www.w3.org/2000/svg" ' + width + viewBox + ' shape-rendering="crispEdges">' + bg + path23 + "</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(
|
|
13527
|
+
exports2.renderToFile = function renderToFile(path23, 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 fs10 = 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
|
-
fs10.writeFile(
|
|
13535
|
+
fs10.writeFile(path23, 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(
|
|
13694
|
-
return
|
|
13693
|
+
function getTypeFromFilename(path23) {
|
|
13694
|
+
return path23.slice((path23.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(
|
|
13759
|
-
if (typeof
|
|
13758
|
+
exports2.toFile = function toFile(path23, text, opts, cb) {
|
|
13759
|
+
if (typeof path23 !== "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(
|
|
13766
|
+
const type = params.opts.type || getTypeFromFilename(path23);
|
|
13767
13767
|
const renderer = getRendererFromType(type);
|
|
13768
|
-
const renderToFile = renderer.renderToFile.bind(null,
|
|
13768
|
+
const renderToFile = renderer.renderToFile.bind(null, path23);
|
|
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(
|
|
16987
|
-
let input =
|
|
16986
|
+
function removeDotSegments(path23) {
|
|
16987
|
+
let input = path23;
|
|
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 [
|
|
17240
|
-
wsComponent.path =
|
|
17239
|
+
const [path23, query] = wsComponent.resourceName.split("?");
|
|
17240
|
+
wsComponent.path = path23 && path23 !== "/" ? path23 : 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
|
|
20647
|
+
var import_node_path35 = __toESM(require("node:path"), 1);
|
|
20648
20648
|
var import_node_child_process18 = require("node:child_process");
|
|
20649
20649
|
var import_node_fs22 = require("node:fs");
|
|
20650
|
-
var
|
|
20651
|
-
var
|
|
20650
|
+
var import_node_os17 = require("node:os");
|
|
20651
|
+
var import_node_path36 = __toESM(require("node:path"), 1);
|
|
20652
20652
|
|
|
20653
20653
|
// src/install-codex.ts
|
|
20654
20654
|
var import_promises = __toESM(require("node:fs/promises"), 1);
|
|
@@ -21556,8 +21556,8 @@ async function verifyProviderReadiness(provider, run3, opts = {}) {
|
|
|
21556
21556
|
// src/director-bridge.ts
|
|
21557
21557
|
var import_node_fs20 = __toESM(require("node:fs"), 1);
|
|
21558
21558
|
var import_node_http = __toESM(require("node:http"), 1);
|
|
21559
|
-
var
|
|
21560
|
-
var
|
|
21559
|
+
var import_node_os13 = __toESM(require("node:os"), 1);
|
|
21560
|
+
var import_node_path28 = __toESM(require("node:path"), 1);
|
|
21561
21561
|
var import_node_child_process15 = require("node:child_process");
|
|
21562
21562
|
var import_node_crypto11 = __toESM(require("node:crypto"), 1);
|
|
21563
21563
|
|
|
@@ -23051,10 +23051,10 @@ function mergeDefs(...defs) {
|
|
|
23051
23051
|
function cloneDef(schema) {
|
|
23052
23052
|
return mergeDefs(schema._zod.def);
|
|
23053
23053
|
}
|
|
23054
|
-
function getElementAtPath(obj,
|
|
23055
|
-
if (!
|
|
23054
|
+
function getElementAtPath(obj, path23) {
|
|
23055
|
+
if (!path23)
|
|
23056
23056
|
return obj;
|
|
23057
|
-
return
|
|
23057
|
+
return path23.reduce((acc, key) => acc?.[key], obj);
|
|
23058
23058
|
}
|
|
23059
23059
|
function promiseAllObject(promisesObj) {
|
|
23060
23060
|
const keys = Object.keys(promisesObj);
|
|
@@ -23463,11 +23463,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
23463
23463
|
}
|
|
23464
23464
|
return false;
|
|
23465
23465
|
}
|
|
23466
|
-
function prefixIssues(
|
|
23466
|
+
function prefixIssues(path23, issues) {
|
|
23467
23467
|
return issues.map((iss) => {
|
|
23468
23468
|
var _a3;
|
|
23469
23469
|
(_a3 = iss).path ?? (_a3.path = []);
|
|
23470
|
-
iss.path.unshift(
|
|
23470
|
+
iss.path.unshift(path23);
|
|
23471
23471
|
return iss;
|
|
23472
23472
|
});
|
|
23473
23473
|
}
|
|
@@ -23614,16 +23614,16 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
|
|
|
23614
23614
|
}
|
|
23615
23615
|
function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
23616
23616
|
const fieldErrors = { _errors: [] };
|
|
23617
|
-
const processError = (error52,
|
|
23617
|
+
const processError = (error52, path23 = []) => {
|
|
23618
23618
|
for (const issue2 of error52.issues) {
|
|
23619
23619
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
23620
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
23620
|
+
issue2.errors.map((issues) => processError({ issues }, [...path23, ...issue2.path]));
|
|
23621
23621
|
} else if (issue2.code === "invalid_key") {
|
|
23622
|
-
processError({ issues: issue2.issues }, [...
|
|
23622
|
+
processError({ issues: issue2.issues }, [...path23, ...issue2.path]);
|
|
23623
23623
|
} else if (issue2.code === "invalid_element") {
|
|
23624
|
-
processError({ issues: issue2.issues }, [...
|
|
23624
|
+
processError({ issues: issue2.issues }, [...path23, ...issue2.path]);
|
|
23625
23625
|
} else {
|
|
23626
|
-
const fullpath = [...
|
|
23626
|
+
const fullpath = [...path23, ...issue2.path];
|
|
23627
23627
|
if (fullpath.length === 0) {
|
|
23628
23628
|
fieldErrors._errors.push(mapper(issue2));
|
|
23629
23629
|
} else {
|
|
@@ -23650,17 +23650,17 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
|
23650
23650
|
}
|
|
23651
23651
|
function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
23652
23652
|
const result = { errors: [] };
|
|
23653
|
-
const processError = (error52,
|
|
23653
|
+
const processError = (error52, path23 = []) => {
|
|
23654
23654
|
var _a3, _b;
|
|
23655
23655
|
for (const issue2 of error52.issues) {
|
|
23656
23656
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
23657
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
23657
|
+
issue2.errors.map((issues) => processError({ issues }, [...path23, ...issue2.path]));
|
|
23658
23658
|
} else if (issue2.code === "invalid_key") {
|
|
23659
|
-
processError({ issues: issue2.issues }, [...
|
|
23659
|
+
processError({ issues: issue2.issues }, [...path23, ...issue2.path]);
|
|
23660
23660
|
} else if (issue2.code === "invalid_element") {
|
|
23661
|
-
processError({ issues: issue2.issues }, [...
|
|
23661
|
+
processError({ issues: issue2.issues }, [...path23, ...issue2.path]);
|
|
23662
23662
|
} else {
|
|
23663
|
-
const fullpath = [...
|
|
23663
|
+
const fullpath = [...path23, ...issue2.path];
|
|
23664
23664
|
if (fullpath.length === 0) {
|
|
23665
23665
|
result.errors.push(mapper(issue2));
|
|
23666
23666
|
continue;
|
|
@@ -23692,8 +23692,8 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
|
23692
23692
|
}
|
|
23693
23693
|
function toDotPath(_path) {
|
|
23694
23694
|
const segs = [];
|
|
23695
|
-
const
|
|
23696
|
-
for (const seg of
|
|
23695
|
+
const path23 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
23696
|
+
for (const seg of path23) {
|
|
23697
23697
|
if (typeof seg === "number")
|
|
23698
23698
|
segs.push(`[${seg}]`);
|
|
23699
23699
|
else if (typeof seg === "symbol")
|
|
@@ -36385,13 +36385,13 @@ function resolveRef(ref, ctx) {
|
|
|
36385
36385
|
if (!ref.startsWith("#")) {
|
|
36386
36386
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
36387
36387
|
}
|
|
36388
|
-
const
|
|
36389
|
-
if (
|
|
36388
|
+
const path23 = ref.slice(1).split("/").filter(Boolean);
|
|
36389
|
+
if (path23.length === 0) {
|
|
36390
36390
|
return ctx.rootSchema;
|
|
36391
36391
|
}
|
|
36392
36392
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
36393
|
-
if (
|
|
36394
|
-
const key =
|
|
36393
|
+
if (path23[0] === defsKey) {
|
|
36394
|
+
const key = path23[1];
|
|
36395
36395
|
if (!key || !ctx.defs[key]) {
|
|
36396
36396
|
throw new Error(`Reference not found: ${ref}`);
|
|
36397
36397
|
}
|
|
@@ -40662,18 +40662,18 @@ function createMrrlinClient(config2) {
|
|
|
40662
40662
|
const customFetch = config2.fetch ?? globalThis.fetch;
|
|
40663
40663
|
const baseUrl = config2.baseUrl.replace(/\/$/, "");
|
|
40664
40664
|
const token = config2.token;
|
|
40665
|
-
async function request(
|
|
40665
|
+
async function request(path23, init) {
|
|
40666
40666
|
const method = init?.method ?? "GET";
|
|
40667
40667
|
const headers = new Headers(init?.headers ?? {});
|
|
40668
40668
|
if (token && !headers.has("authorization")) {
|
|
40669
40669
|
headers.set("authorization", `Bearer ${token}`);
|
|
40670
40670
|
}
|
|
40671
|
-
const response = await customFetch(`${baseUrl}${
|
|
40671
|
+
const response = await customFetch(`${baseUrl}${path23}`, { ...init, headers });
|
|
40672
40672
|
if (!response.ok) {
|
|
40673
40673
|
const body = await response.text();
|
|
40674
40674
|
let code = `HTTP_${response.status}`;
|
|
40675
40675
|
let violations = null;
|
|
40676
|
-
let message = `Mrrlin API ${method} ${
|
|
40676
|
+
let message = `Mrrlin API ${method} ${path23} failed: ${response.status}`;
|
|
40677
40677
|
try {
|
|
40678
40678
|
const parsed = JSON.parse(body);
|
|
40679
40679
|
const violationsParsed = apiViolationsErrorSchema.safeParse(parsed);
|
|
@@ -40693,7 +40693,7 @@ function createMrrlinClient(config2) {
|
|
|
40693
40693
|
throw new MrrlinApiError({
|
|
40694
40694
|
code,
|
|
40695
40695
|
method,
|
|
40696
|
-
path:
|
|
40696
|
+
path: path23,
|
|
40697
40697
|
responseBody: body,
|
|
40698
40698
|
status: response.status,
|
|
40699
40699
|
violations,
|
|
@@ -40702,18 +40702,18 @@ function createMrrlinClient(config2) {
|
|
|
40702
40702
|
}
|
|
40703
40703
|
return response.json();
|
|
40704
40704
|
}
|
|
40705
|
-
async function requestText(
|
|
40705
|
+
async function requestText(path23, init) {
|
|
40706
40706
|
const method = init?.method ?? "GET";
|
|
40707
40707
|
const headers = new Headers(init?.headers ?? {});
|
|
40708
40708
|
if (token && !headers.has("authorization")) {
|
|
40709
40709
|
headers.set("authorization", `Bearer ${token}`);
|
|
40710
40710
|
}
|
|
40711
|
-
const response = await customFetch(`${baseUrl}${
|
|
40711
|
+
const response = await customFetch(`${baseUrl}${path23}`, { ...init, headers });
|
|
40712
40712
|
if (!response.ok) {
|
|
40713
40713
|
const body = await response.text();
|
|
40714
40714
|
let code = `HTTP_${response.status}`;
|
|
40715
40715
|
let violations = null;
|
|
40716
|
-
let message = `Mrrlin API ${method} ${
|
|
40716
|
+
let message = `Mrrlin API ${method} ${path23} failed: ${response.status}`;
|
|
40717
40717
|
try {
|
|
40718
40718
|
const parsed = JSON.parse(body);
|
|
40719
40719
|
const violationsParsed = apiViolationsErrorSchema.safeParse(parsed);
|
|
@@ -40733,7 +40733,7 @@ function createMrrlinClient(config2) {
|
|
|
40733
40733
|
throw new MrrlinApiError({
|
|
40734
40734
|
code,
|
|
40735
40735
|
method,
|
|
40736
|
-
path:
|
|
40736
|
+
path: path23,
|
|
40737
40737
|
responseBody: body,
|
|
40738
40738
|
status: response.status,
|
|
40739
40739
|
violations,
|
|
@@ -40998,16 +40998,16 @@ function createMrrlinClient(config2) {
|
|
|
40998
40998
|
// rejected against the first, MrrlinTask[]-only overload) -- the `any` here is contained to
|
|
40999
40999
|
// this one implementation signature; MrrlinClient's declared overloads keep callers precise.
|
|
41000
41000
|
async listTasks(projectSlug, filters = {}, options) {
|
|
41001
|
-
const
|
|
41002
|
-
const body = await request(
|
|
41001
|
+
const path23 = buildTaskListPath(projectSlug, filters, options?.view);
|
|
41002
|
+
const body = await request(path23);
|
|
41003
41003
|
if (options?.view === "summary") {
|
|
41004
41004
|
return taskSummaryListResponseSchema.parse(body).data;
|
|
41005
41005
|
}
|
|
41006
41006
|
return taskListResponseSchema.parse(body).data;
|
|
41007
41007
|
},
|
|
41008
41008
|
async listTaskSummaries(projectSlug, filters = {}) {
|
|
41009
|
-
const
|
|
41010
|
-
const body = await request(
|
|
41009
|
+
const path23 = buildTaskListPath(projectSlug, filters, "summary");
|
|
41010
|
+
const body = await request(path23);
|
|
41011
41011
|
return taskSummaryListResponseSchema.parse(body).data;
|
|
41012
41012
|
},
|
|
41013
41013
|
async listTaxonomy(projectSlug) {
|
|
@@ -41015,22 +41015,22 @@ function createMrrlinClient(config2) {
|
|
|
41015
41015
|
return taxonomyListResponseSchema.parse(body).data;
|
|
41016
41016
|
},
|
|
41017
41017
|
async listWikiPages(projectSlug, filters = {}) {
|
|
41018
|
-
const
|
|
41018
|
+
const path23 = appendQuery(`${projectPath(projectSlug)}/wiki`, {
|
|
41019
41019
|
folder: filters.folder,
|
|
41020
41020
|
q: filters.q,
|
|
41021
41021
|
taskId: filters.taskId
|
|
41022
41022
|
});
|
|
41023
|
-
const body = await request(
|
|
41023
|
+
const body = await request(path23);
|
|
41024
41024
|
return wikiPageListResponseSchema.parse(body).data;
|
|
41025
41025
|
},
|
|
41026
41026
|
async searchWikiPages(projectSlug, query) {
|
|
41027
|
-
const
|
|
41027
|
+
const path23 = appendQuery(`${projectPath(projectSlug)}/wiki/search`, {
|
|
41028
41028
|
folder: query.folder,
|
|
41029
41029
|
limit: query.limit === void 0 ? void 0 : String(query.limit),
|
|
41030
41030
|
pathPrefix: query.pathPrefix,
|
|
41031
41031
|
q: query.q
|
|
41032
41032
|
});
|
|
41033
|
-
const body = await request(
|
|
41033
|
+
const body = await request(path23);
|
|
41034
41034
|
return wikiPageSearchResponseSchema.parse(body).data;
|
|
41035
41035
|
},
|
|
41036
41036
|
async updatePlan(projectSlug, planId, patch) {
|
|
@@ -42295,7 +42295,7 @@ Do NOT derail the current task - if the operator has an in-flight question, answ
|
|
|
42295
42295
|
}
|
|
42296
42296
|
|
|
42297
42297
|
// src/_generated/version.ts
|
|
42298
|
-
var PKG_VERSION = "0.4.
|
|
42298
|
+
var PKG_VERSION = "0.4.45";
|
|
42299
42299
|
|
|
42300
42300
|
// src/api-base-url-migrate.ts
|
|
42301
42301
|
var import_node_fs3 = __toESM(require("node:fs"), 1);
|
|
@@ -44369,7 +44369,7 @@ function reviserIdentityInstructions(taskId, title) {
|
|
|
44369
44369
|
function gateCallRecorder(args) {
|
|
44370
44370
|
let round = 0;
|
|
44371
44371
|
let headSinceArbiter = false;
|
|
44372
|
-
return function record2(role, persona, agentId, startedAt, result) {
|
|
44372
|
+
return function record2(role, persona, agentId, startedAt, result, attribution) {
|
|
44373
44373
|
if (role === "head" && !headSinceArbiter) {
|
|
44374
44374
|
round += 1;
|
|
44375
44375
|
headSinceArbiter = true;
|
|
@@ -44384,7 +44384,15 @@ function gateCallRecorder(args) {
|
|
|
44384
44384
|
role,
|
|
44385
44385
|
persona,
|
|
44386
44386
|
agentId,
|
|
44387
|
-
|
|
44387
|
+
// `?? null` on the override's own value, not on the whole expression: an absent override must
|
|
44388
|
+
// still fall through to the factory's provider, and only a PRESENT one means "this call did
|
|
44389
|
+
// not run on the seat". The coalesce is future-proofing for a JavaScript consumer of the same
|
|
44390
|
+
// module, NOT a hole in the type — `{ provider: string | null }` makes `{}` a compile error
|
|
44391
|
+
// today, and both call sites are hard-coded `{ provider: null }` lambdas in this file. It is
|
|
44392
|
+
// worth the character because `provider: undefined` is not a missing provider, it is a key
|
|
44393
|
+
// `JSON.stringify` DROPS, so such a line would fail `gateCallRecordSchema` on ingest with
|
|
44394
|
+
// nothing at the write site to show why.
|
|
44395
|
+
provider: attribution ? attribution.provider ?? null : args.provider,
|
|
44388
44396
|
inputTokens: usage?.inputTokens ?? null,
|
|
44389
44397
|
cachedInputTokens: usage?.cachedInputTokens ?? null,
|
|
44390
44398
|
cacheWriteInputTokens: usage?.cacheWriteInputTokens ?? null,
|
|
@@ -44451,6 +44459,10 @@ function buildSpecGateDeps(args) {
|
|
|
44451
44459
|
return {
|
|
44452
44460
|
rounds,
|
|
44453
44461
|
maxHeadCalls,
|
|
44462
|
+
// The recorder a multi-LLM panel dispatches through when it replaces `runHead` below — see
|
|
44463
|
+
// GateHeadCallRecorder. `{ provider: null }` because a panel head runs on a pool agent, not on
|
|
44464
|
+
// this factory's seat.
|
|
44465
|
+
recordHeadCall: (persona, agentId, startedAt, result) => recordCost("head", persona, agentId, startedAt, result, { provider: null }),
|
|
44454
44466
|
async consensusEnabled() {
|
|
44455
44467
|
const config2 = await client.getConsensusConfig(projectSlug);
|
|
44456
44468
|
return config2.consensusEnabled;
|
|
@@ -44624,6 +44636,10 @@ function buildCodeGateDeps(args) {
|
|
|
44624
44636
|
rounds,
|
|
44625
44637
|
maxHeadCalls,
|
|
44626
44638
|
heads,
|
|
44639
|
+
// This is the gate that actually gets a panel today: tools.ts resolves one and calls
|
|
44640
|
+
// `applyActivePanel`, which replaces `runHead` below. Without this hook the panel's head calls
|
|
44641
|
+
// were recorded nowhere at all — see GateHeadCallRecorder.
|
|
44642
|
+
recordHeadCall: (persona, agentId, startedAt, result) => recordCost("head", persona, agentId, startedAt, result, { provider: null }),
|
|
44627
44643
|
async consensusEnabled() {
|
|
44628
44644
|
const config2 = await client.getConsensusConfig(projectSlug);
|
|
44629
44645
|
return config2.consensusEnabled;
|
|
@@ -44901,8 +44917,8 @@ You revise a deliverable to address the accepted issues so it satisfies the acce
|
|
|
44901
44917
|
function isRecord(v) {
|
|
44902
44918
|
return v !== null && typeof v === "object";
|
|
44903
44919
|
}
|
|
44904
|
-
function resolvePath(root,
|
|
44905
|
-
const parts =
|
|
44920
|
+
function resolvePath(root, path23) {
|
|
44921
|
+
const parts = path23.split(".");
|
|
44906
44922
|
let cur = root;
|
|
44907
44923
|
for (let i = 0; i < parts.length - 1; i += 1) {
|
|
44908
44924
|
const part = parts[i];
|
|
@@ -44970,9 +44986,9 @@ async function gate(artifact, prose, ctx) {
|
|
|
44970
44986
|
return { ok: true, gated: true, artifact: withheldExcerptClone(artifact) };
|
|
44971
44987
|
}
|
|
44972
44988
|
const maskedClone = typeof structuredClone === "function" ? structuredClone(artifact) : JSON.parse(JSON.stringify(artifact));
|
|
44973
|
-
for (const { path:
|
|
44974
|
-
const target = resolvePath(maskedClone,
|
|
44975
|
-
if (!target) throw new Error(`pii-gate: path "${
|
|
44989
|
+
for (const { path: path23, masked } of fields) {
|
|
44990
|
+
const target = resolvePath(maskedClone, path23);
|
|
44991
|
+
if (!target) throw new Error(`pii-gate: path "${path23}" failed to resolve on the clone after validating on the original`);
|
|
44976
44992
|
target.parent[target.key] = masked;
|
|
44977
44993
|
}
|
|
44978
44994
|
return { ok: true, gated: false, artifact: maskedClone };
|
|
@@ -44988,15 +45004,15 @@ var cache = /* @__PURE__ */ new Map();
|
|
|
44988
45004
|
function resolveInstallationId(stateDir) {
|
|
44989
45005
|
const cached2 = cache.get(stateDir);
|
|
44990
45006
|
if (cached2 !== void 0) return cached2;
|
|
44991
|
-
const
|
|
45007
|
+
const path23 = (0, import_node_path14.join)(stateDir, FILE_NAME);
|
|
44992
45008
|
let id;
|
|
44993
45009
|
try {
|
|
44994
|
-
id = (0, import_node_fs8.readFileSync)(
|
|
45010
|
+
id = (0, import_node_fs8.readFileSync)(path23, "utf8").trim();
|
|
44995
45011
|
if (!UUID.test(id)) throw new Error("unusable");
|
|
44996
45012
|
} catch {
|
|
44997
45013
|
id = (0, import_node_crypto5.randomUUID)();
|
|
44998
|
-
(0, import_node_fs8.mkdirSync)((0, import_node_path14.dirname)(
|
|
44999
|
-
(0, import_node_fs8.writeFileSync)(
|
|
45014
|
+
(0, import_node_fs8.mkdirSync)((0, import_node_path14.dirname)(path23), { recursive: true });
|
|
45015
|
+
(0, import_node_fs8.writeFileSync)(path23, `${id}
|
|
45000
45016
|
`, "utf8");
|
|
45001
45017
|
}
|
|
45002
45018
|
cache.set(stateDir, id);
|
|
@@ -45005,6 +45021,7 @@ function resolveInstallationId(stateDir) {
|
|
|
45005
45021
|
|
|
45006
45022
|
// src/telemetry/daily-uploader.ts
|
|
45007
45023
|
var ROWS_FILE_RE = /^rows-(.+)-(\d{4}-\d{2}-\d{2})\.jsonl$/;
|
|
45024
|
+
var GATE_FILE_RE = /^gate-(.+)-(\d{4}-\d{2}-\d{2})\.jsonl$/;
|
|
45008
45025
|
async function uploadPendingDays(stateDir, client, bridgeHealth, gateCtx) {
|
|
45009
45026
|
const telemetryDir = (0, import_node_path15.join)(stateDir, "telemetry");
|
|
45010
45027
|
let files;
|
|
@@ -45014,21 +45031,39 @@ async function uploadPendingDays(stateDir, client, bridgeHealth, gateCtx) {
|
|
|
45014
45031
|
if (err?.code === "ENOENT") return;
|
|
45015
45032
|
throw err;
|
|
45016
45033
|
}
|
|
45017
|
-
const
|
|
45034
|
+
const discovered = /* @__PURE__ */ new Map();
|
|
45018
45035
|
for (const file2 of files) {
|
|
45019
|
-
const
|
|
45036
|
+
const rowsMatch = ROWS_FILE_RE.exec(file2);
|
|
45037
|
+
const match = rowsMatch ?? GATE_FILE_RE.exec(file2);
|
|
45020
45038
|
if (!match) continue;
|
|
45021
45039
|
const [, projectSlug, day] = match;
|
|
45040
|
+
const key = `${projectSlug}\0${day}`;
|
|
45041
|
+
const entry = discovered.get(key) ?? { projectSlug, day, rowsPath: null };
|
|
45042
|
+
if (rowsMatch) entry.rowsPath = (0, import_node_path15.join)(telemetryDir, file2);
|
|
45043
|
+
discovered.set(key, entry);
|
|
45044
|
+
}
|
|
45045
|
+
const today = telemetryDay();
|
|
45046
|
+
const pending = [];
|
|
45047
|
+
const deferred = [];
|
|
45048
|
+
for (const { projectSlug, day, rowsPath } of discovered.values()) {
|
|
45022
45049
|
const markerPath = (0, import_node_path15.join)(telemetryDir, `.processed-${projectSlug}-${day}`);
|
|
45050
|
+
if (rowsPath === null && day >= today) {
|
|
45051
|
+
try {
|
|
45052
|
+
await (0, import_promises6.access)(markerPath);
|
|
45053
|
+
} catch {
|
|
45054
|
+
deferred.push({ projectSlug, day });
|
|
45055
|
+
}
|
|
45056
|
+
continue;
|
|
45057
|
+
}
|
|
45023
45058
|
try {
|
|
45024
45059
|
await (0, import_promises6.access)(markerPath);
|
|
45025
45060
|
} catch {
|
|
45026
|
-
pending.push({ projectSlug, day, rowsPath
|
|
45061
|
+
pending.push({ projectSlug, day, rowsPath, markerPath });
|
|
45027
45062
|
}
|
|
45028
45063
|
}
|
|
45029
45064
|
if (pending.length === 0) return;
|
|
45030
45065
|
const knownCrashCount = bridgeHealth.knownCrashCount() ?? 0;
|
|
45031
|
-
const fullUnprocessed = pending.map((p) => ({ projectSlug: p.projectSlug, day: p.day }));
|
|
45066
|
+
const fullUnprocessed = [...pending.map((p) => ({ projectSlug: p.projectSlug, day: p.day })), ...deferred];
|
|
45032
45067
|
pending.sort((a, b) => a.day.localeCompare(b.day));
|
|
45033
45068
|
for (const cur of pending) {
|
|
45034
45069
|
const failurePath = (0, import_node_path15.join)(telemetryDir, `.failed-${cur.projectSlug}-${cur.day}.json`);
|
|
@@ -45045,12 +45080,14 @@ async function uploadPendingDays(stateDir, client, bridgeHealth, gateCtx) {
|
|
|
45045
45080
|
}
|
|
45046
45081
|
let success2 = false;
|
|
45047
45082
|
try {
|
|
45048
|
-
let raw;
|
|
45049
|
-
|
|
45050
|
-
|
|
45051
|
-
|
|
45052
|
-
|
|
45053
|
-
|
|
45083
|
+
let raw = "";
|
|
45084
|
+
if (cur.rowsPath !== null) {
|
|
45085
|
+
try {
|
|
45086
|
+
raw = await (0, import_promises6.readFile)(cur.rowsPath, "utf8");
|
|
45087
|
+
} catch (err) {
|
|
45088
|
+
console.error(`uploadPendingDays: failed to read ${cur.rowsPath}`, err);
|
|
45089
|
+
throw err;
|
|
45090
|
+
}
|
|
45054
45091
|
}
|
|
45055
45092
|
const rows = [];
|
|
45056
45093
|
for (const line of raw.split("\n")) {
|
|
@@ -45072,6 +45109,7 @@ async function uploadPendingDays(stateDir, client, bridgeHealth, gateCtx) {
|
|
|
45072
45109
|
}
|
|
45073
45110
|
} catch {
|
|
45074
45111
|
}
|
|
45112
|
+
if (cur.rowsPath === null && gateCalls.length === 0) continue;
|
|
45075
45113
|
const batch = {
|
|
45076
45114
|
day: cur.day,
|
|
45077
45115
|
bridgeVersion: PKG_VERSION,
|
|
@@ -47449,8 +47487,8 @@ function newArtifactId() {
|
|
|
47449
47487
|
return `EA-${import_node_crypto7.default.randomUUID()}`;
|
|
47450
47488
|
}
|
|
47451
47489
|
var BLAST_RADIUS_FLOOR_PATTERNS = [/^supabase\/migrations\//, /^packages\/db\/src\/schema\.ts$/];
|
|
47452
|
-
function isBlastRadiusFloorPath(
|
|
47453
|
-
return BLAST_RADIUS_FLOOR_PATTERNS.some((re) => re.test(
|
|
47490
|
+
function isBlastRadiusFloorPath(path23) {
|
|
47491
|
+
return BLAST_RADIUS_FLOOR_PATTERNS.some((re) => re.test(path23));
|
|
47454
47492
|
}
|
|
47455
47493
|
var execFileAsync = (0, import_node_util.promisify)(import_node_child_process12.execFile);
|
|
47456
47494
|
async function defaultListRunDiffPaths(opts) {
|
|
@@ -49744,6 +49782,15 @@ async function runAsyncBackstopSweep(deps, drive = (slug, jobId) => driveAsyncJo
|
|
|
49744
49782
|
}
|
|
49745
49783
|
}
|
|
49746
49784
|
|
|
49785
|
+
// src/state-dir.ts
|
|
49786
|
+
var import_node_os8 = __toESM(require("node:os"), 1);
|
|
49787
|
+
var import_node_path20 = __toESM(require("node:path"), 1);
|
|
49788
|
+
function resolveStateDir(env = process.env) {
|
|
49789
|
+
const codexHome = env.CODEX_HOME;
|
|
49790
|
+
if (codexHome) return import_node_path20.default.join(codexHome, "mrrlin", "director-bridge");
|
|
49791
|
+
return import_node_path20.default.join(import_node_os8.default.homedir(), ".mrrlin", "director-bridge");
|
|
49792
|
+
}
|
|
49793
|
+
|
|
49747
49794
|
// src/consensus/deliverable-gate.ts
|
|
49748
49795
|
async function runDeliverableGate(target, deps) {
|
|
49749
49796
|
if (!await deps.consensusEnabled()) return { outcome: "SKIPPED" };
|
|
@@ -49998,14 +50045,14 @@ function agentIdleMs(provider) {
|
|
|
49998
50045
|
|
|
49999
50046
|
// src/operator-token.ts
|
|
50000
50047
|
var import_node_fs12 = require("node:fs");
|
|
50001
|
-
var
|
|
50002
|
-
var
|
|
50048
|
+
var import_node_os9 = __toESM(require("node:os"), 1);
|
|
50049
|
+
var import_node_path21 = __toESM(require("node:path"), 1);
|
|
50003
50050
|
function operatorDir() {
|
|
50004
|
-
const base = process.env.CODEX_HOME ?
|
|
50051
|
+
const base = process.env.CODEX_HOME ? import_node_path21.default.join(process.env.CODEX_HOME, "mrrlin") : import_node_path21.default.join(import_node_os9.default.homedir(), ".mrrlin");
|
|
50005
50052
|
return base;
|
|
50006
50053
|
}
|
|
50007
50054
|
function operatorTokenPath() {
|
|
50008
|
-
return
|
|
50055
|
+
return import_node_path21.default.join(operatorDir(), "operator-token");
|
|
50009
50056
|
}
|
|
50010
50057
|
function readOperatorToken() {
|
|
50011
50058
|
try {
|
|
@@ -50022,7 +50069,7 @@ function persistOperatorToken(token) {
|
|
|
50022
50069
|
`, { encoding: "utf8", mode: 384 });
|
|
50023
50070
|
}
|
|
50024
50071
|
function agentCredentialPath() {
|
|
50025
|
-
return
|
|
50072
|
+
return import_node_path21.default.join(operatorDir(), "agent-credential");
|
|
50026
50073
|
}
|
|
50027
50074
|
function persistAgentSecret(secret) {
|
|
50028
50075
|
const dir = operatorDir();
|
|
@@ -50043,9 +50090,9 @@ function readAgentSecret() {
|
|
|
50043
50090
|
|
|
50044
50091
|
// src/thread-index.ts
|
|
50045
50092
|
var import_node_fs13 = require("node:fs");
|
|
50046
|
-
var
|
|
50093
|
+
var import_node_path22 = __toESM(require("node:path"), 1);
|
|
50047
50094
|
function threadIndexPath(stateDir) {
|
|
50048
|
-
return
|
|
50095
|
+
return import_node_path22.default.join(stateDir, "threads.json");
|
|
50049
50096
|
}
|
|
50050
50097
|
function loadThreadIndex(stateDir, ttlMs, now) {
|
|
50051
50098
|
const result = /* @__PURE__ */ new Map();
|
|
@@ -50212,8 +50259,8 @@ function createToolBusyClock(opts) {
|
|
|
50212
50259
|
// src/worker-token.ts
|
|
50213
50260
|
var import_node_crypto10 = require("node:crypto");
|
|
50214
50261
|
var import_node_fs14 = require("node:fs");
|
|
50215
|
-
var
|
|
50216
|
-
var
|
|
50262
|
+
var import_node_os10 = __toESM(require("node:os"), 1);
|
|
50263
|
+
var import_node_path23 = __toESM(require("node:path"), 1);
|
|
50217
50264
|
var DEFAULT_WORKER_PORT = 8792;
|
|
50218
50265
|
function workerPort() {
|
|
50219
50266
|
const raw = process.env.MRRLIN_WORKER_PORT;
|
|
@@ -50222,11 +50269,11 @@ function workerPort() {
|
|
|
50222
50269
|
return Number.isFinite(parsed) && parsed > 0 ? parsed : DEFAULT_WORKER_PORT;
|
|
50223
50270
|
}
|
|
50224
50271
|
function workerDir() {
|
|
50225
|
-
const base = process.env.CODEX_HOME ?
|
|
50226
|
-
return
|
|
50272
|
+
const base = process.env.CODEX_HOME ? import_node_path23.default.join(process.env.CODEX_HOME, "mrrlin") : import_node_path23.default.join(import_node_os10.default.homedir(), ".mrrlin");
|
|
50273
|
+
return import_node_path23.default.join(base, "worker");
|
|
50227
50274
|
}
|
|
50228
50275
|
function workerTokenPath() {
|
|
50229
|
-
return
|
|
50276
|
+
return import_node_path23.default.join(workerDir(), "token");
|
|
50230
50277
|
}
|
|
50231
50278
|
function readWorkerToken() {
|
|
50232
50279
|
try {
|
|
@@ -50250,8 +50297,8 @@ function readOrCreateWorkerToken() {
|
|
|
50250
50297
|
// src/remote-phone-relay.ts
|
|
50251
50298
|
var import_node_events2 = require("node:events");
|
|
50252
50299
|
var import_node_fs15 = require("node:fs");
|
|
50253
|
-
var
|
|
50254
|
-
var
|
|
50300
|
+
var import_node_os11 = require("node:os");
|
|
50301
|
+
var import_node_path24 = require("node:path");
|
|
50255
50302
|
|
|
50256
50303
|
// ../../node_modules/.pnpm/@noble+hashes@1.3.3/node_modules/@noble/hashes/esm/cryptoNode.js
|
|
50257
50304
|
var nc = __toESM(require("node:crypto"), 1);
|
|
@@ -53822,9 +53869,9 @@ var DirectorRelay = class {
|
|
|
53822
53869
|
|
|
53823
53870
|
// src/remote-phone-relay.ts
|
|
53824
53871
|
function loadOrCreateAgentDeviceKey() {
|
|
53825
|
-
const
|
|
53872
|
+
const path23 = (0, import_node_path24.join)((0, import_node_os11.homedir)(), ".mrrlin", "agent-device-key");
|
|
53826
53873
|
try {
|
|
53827
|
-
const raw = JSON.parse((0, import_node_fs15.readFileSync)(
|
|
53874
|
+
const raw = JSON.parse((0, import_node_fs15.readFileSync)(path23, "utf8"));
|
|
53828
53875
|
if (typeof raw.priv === "string" && typeof raw.pub === "string") {
|
|
53829
53876
|
return { privateKey: fromBase64Url(raw.priv), publicKey: fromBase64Url(raw.pub) };
|
|
53830
53877
|
}
|
|
@@ -53832,9 +53879,9 @@ function loadOrCreateAgentDeviceKey() {
|
|
|
53832
53879
|
}
|
|
53833
53880
|
const kp = generateIdentityKeyPair();
|
|
53834
53881
|
try {
|
|
53835
|
-
(0, import_node_fs15.mkdirSync)((0,
|
|
53882
|
+
(0, import_node_fs15.mkdirSync)((0, import_node_path24.join)((0, import_node_os11.homedir)(), ".mrrlin"), { recursive: true });
|
|
53836
53883
|
(0, import_node_fs15.writeFileSync)(
|
|
53837
|
-
|
|
53884
|
+
path23,
|
|
53838
53885
|
JSON.stringify({ priv: toBase64Url(kp.privateKey), pub: toBase64Url(kp.publicKey) }),
|
|
53839
53886
|
{ mode: 384 }
|
|
53840
53887
|
);
|
|
@@ -53842,7 +53889,7 @@ function loadOrCreateAgentDeviceKey() {
|
|
|
53842
53889
|
}
|
|
53843
53890
|
return kp;
|
|
53844
53891
|
}
|
|
53845
|
-
var AGENT_PAIRING_PATH = (0,
|
|
53892
|
+
var AGENT_PAIRING_PATH = (0, import_node_path24.join)((0, import_node_os11.homedir)(), ".mrrlin", "agent-pairing.json");
|
|
53846
53893
|
function loadAgentPairing() {
|
|
53847
53894
|
try {
|
|
53848
53895
|
const raw = JSON.parse((0, import_node_fs15.readFileSync)(AGENT_PAIRING_PATH, "utf8"));
|
|
@@ -53860,7 +53907,7 @@ function loadAgentPairing() {
|
|
|
53860
53907
|
}
|
|
53861
53908
|
function saveAgentPairing(record2) {
|
|
53862
53909
|
try {
|
|
53863
|
-
(0, import_node_fs15.mkdirSync)((0,
|
|
53910
|
+
(0, import_node_fs15.mkdirSync)((0, import_node_path24.join)((0, import_node_os11.homedir)(), ".mrrlin"), { recursive: true });
|
|
53864
53911
|
(0, import_node_fs15.writeFileSync)(AGENT_PAIRING_PATH, JSON.stringify(record2), { mode: 384 });
|
|
53865
53912
|
} catch {
|
|
53866
53913
|
}
|
|
@@ -54040,11 +54087,11 @@ async function renderPairingQrSvg(payload) {
|
|
|
54040
54087
|
|
|
54041
54088
|
// src/checkout-registry.ts
|
|
54042
54089
|
var import_node_fs16 = require("node:fs");
|
|
54043
|
-
var
|
|
54090
|
+
var import_node_path25 = require("node:path");
|
|
54044
54091
|
var CheckoutRegistry = class {
|
|
54045
54092
|
file;
|
|
54046
54093
|
constructor(stateDir) {
|
|
54047
|
-
this.file = (0,
|
|
54094
|
+
this.file = (0, import_node_path25.join)(stateDir, "checkouts.json");
|
|
54048
54095
|
(0, import_node_fs16.mkdirSync)(stateDir, { recursive: true });
|
|
54049
54096
|
}
|
|
54050
54097
|
read() {
|
|
@@ -54058,9 +54105,9 @@ var CheckoutRegistry = class {
|
|
|
54058
54105
|
get(slug) {
|
|
54059
54106
|
return this.read()[slug] ?? null;
|
|
54060
54107
|
}
|
|
54061
|
-
confirm(slug,
|
|
54108
|
+
confirm(slug, path23, now) {
|
|
54062
54109
|
const all = this.read();
|
|
54063
|
-
all[slug] = { path:
|
|
54110
|
+
all[slug] = { path: path23, confirmedAt: now };
|
|
54064
54111
|
(0, import_node_fs16.writeFileSync)(this.file, JSON.stringify(all, null, 2));
|
|
54065
54112
|
}
|
|
54066
54113
|
};
|
|
@@ -54410,7 +54457,7 @@ function extractVerificationSection(markdown) {
|
|
|
54410
54457
|
// src/director-reseed.ts
|
|
54411
54458
|
var import_node_fs18 = require("node:fs");
|
|
54412
54459
|
var import_node_readline = require("node:readline");
|
|
54413
|
-
var
|
|
54460
|
+
var import_node_path26 = require("node:path");
|
|
54414
54461
|
function estimateTokens(s) {
|
|
54415
54462
|
return Buffer.byteLength(s, "utf8");
|
|
54416
54463
|
}
|
|
@@ -54542,7 +54589,7 @@ async function readSessionRows(logsDir, files, sessionIds) {
|
|
|
54542
54589
|
const lines2 = [];
|
|
54543
54590
|
let missingFiles = 0;
|
|
54544
54591
|
for (const f of files) {
|
|
54545
|
-
const filePath = (0,
|
|
54592
|
+
const filePath = (0, import_node_path26.join)(logsDir, f);
|
|
54546
54593
|
try {
|
|
54547
54594
|
const stream = (0, import_node_fs18.createReadStream)(filePath, { encoding: "utf8" });
|
|
54548
54595
|
const rl = (0, import_node_readline.createInterface)({ input: stream, crlfDelay: Infinity });
|
|
@@ -54569,11 +54616,11 @@ async function readSessionRows(logsDir, files, sessionIds) {
|
|
|
54569
54616
|
|
|
54570
54617
|
// src/external-agents-scrub.ts
|
|
54571
54618
|
var import_node_fs19 = __toESM(require("node:fs"), 1);
|
|
54572
|
-
var
|
|
54573
|
-
var
|
|
54619
|
+
var import_node_os12 = __toESM(require("node:os"), 1);
|
|
54620
|
+
var import_node_path27 = __toESM(require("node:path"), 1);
|
|
54574
54621
|
var REDACTION = "[REDACTED]";
|
|
54575
54622
|
var SHORT_VALUE_THRESHOLD = 8;
|
|
54576
|
-
var KEYS_ENV_PATH = () =>
|
|
54623
|
+
var KEYS_ENV_PATH = () => import_node_path27.default.join(import_node_os12.default.homedir(), ".local", "state", "external-agents", "keys.env");
|
|
54577
54624
|
var keysEnvCache = null;
|
|
54578
54625
|
function readKeysEnv() {
|
|
54579
54626
|
const filePath = KEYS_ENV_PATH();
|
|
@@ -55017,9 +55064,9 @@ function readKnownGptSlugsFromTomlFile(filePath) {
|
|
|
55017
55064
|
return Array.from(raw.matchAll(/^\s*model\s*=\s*"([^"]+)"/gm)).map((match) => match[1]?.trim() ?? "").filter(isSelectableModelSlug);
|
|
55018
55065
|
}
|
|
55019
55066
|
function readCodexFallbackModels() {
|
|
55020
|
-
const codexHome = process.env.CODEX_HOME?.trim() ||
|
|
55067
|
+
const codexHome = process.env.CODEX_HOME?.trim() || import_node_path28.default.join(import_node_os13.default.homedir(), ".codex");
|
|
55021
55068
|
const models = /* @__PURE__ */ new Map();
|
|
55022
|
-
const cachePath =
|
|
55069
|
+
const cachePath = import_node_path28.default.join(codexHome, "models_cache.json");
|
|
55023
55070
|
const cacheRaw = readTextIfExists(cachePath);
|
|
55024
55071
|
if (cacheRaw) {
|
|
55025
55072
|
try {
|
|
@@ -55069,7 +55116,7 @@ function readCodexFallbackModels() {
|
|
|
55069
55116
|
);
|
|
55070
55117
|
}
|
|
55071
55118
|
}
|
|
55072
|
-
for (const slug of readKnownGptSlugsFromTomlFile(
|
|
55119
|
+
for (const slug of readKnownGptSlugsFromTomlFile(import_node_path28.default.join(codexHome, "config.toml"))) {
|
|
55073
55120
|
addBridgeModel(
|
|
55074
55121
|
models,
|
|
55075
55122
|
mapBridgeModel({
|
|
@@ -55083,11 +55130,11 @@ function readCodexFallbackModels() {
|
|
|
55083
55130
|
})
|
|
55084
55131
|
);
|
|
55085
55132
|
}
|
|
55086
|
-
const automationsDir =
|
|
55133
|
+
const automationsDir = import_node_path28.default.join(codexHome, "automations");
|
|
55087
55134
|
try {
|
|
55088
55135
|
for (const entry of import_node_fs20.default.readdirSync(automationsDir, { withFileTypes: true })) {
|
|
55089
55136
|
if (!entry.isDirectory()) continue;
|
|
55090
|
-
for (const slug of readKnownGptSlugsFromTomlFile(
|
|
55137
|
+
for (const slug of readKnownGptSlugsFromTomlFile(import_node_path28.default.join(automationsDir, entry.name, "automation.toml"))) {
|
|
55091
55138
|
addBridgeModel(
|
|
55092
55139
|
models,
|
|
55093
55140
|
mapBridgeModel({
|
|
@@ -55113,7 +55160,7 @@ function selfUpdateInboxItemId(offeredVersion) {
|
|
|
55113
55160
|
return `II-MCPUPD-${offeredVersion.replace(/[^A-Za-z0-9._-]/g, "-")}-${hash3}`;
|
|
55114
55161
|
}
|
|
55115
55162
|
function neutralCheckoutCwd(stateDir) {
|
|
55116
|
-
const dir =
|
|
55163
|
+
const dir = import_node_path28.default.join(stateDir, "no-checkout");
|
|
55117
55164
|
try {
|
|
55118
55165
|
import_node_fs20.default.mkdirSync(dir, { recursive: true });
|
|
55119
55166
|
} catch {
|
|
@@ -55663,8 +55710,7 @@ async function runOrphanWorktreeSweep(client, opts) {
|
|
|
55663
55710
|
}
|
|
55664
55711
|
}
|
|
55665
55712
|
function readStateDir() {
|
|
55666
|
-
|
|
55667
|
-
return import_node_path27.default.join(import_node_os12.default.homedir(), ".mrrlin", "director-bridge");
|
|
55713
|
+
return resolveStateDir(process.env);
|
|
55668
55714
|
}
|
|
55669
55715
|
function readAllowedOrigins() {
|
|
55670
55716
|
const raw = (process.env.MRRLIN_DIRECTOR_BRIDGE_ALLOWED_ORIGINS ?? "").trim();
|
|
@@ -56100,7 +56146,7 @@ function createBridgeMessageHandler(deps) {
|
|
|
56100
56146
|
sendForSpan({ type: "checkout-state", ok: false, error: { code: "invalid_input", fields: { projectSlug: "required" } } });
|
|
56101
56147
|
return;
|
|
56102
56148
|
}
|
|
56103
|
-
const state = readCheckoutState(deps.checkoutRegistry, projectSlug,
|
|
56149
|
+
const state = readCheckoutState(deps.checkoutRegistry, projectSlug, import_node_os13.default.hostname());
|
|
56104
56150
|
if (!state) {
|
|
56105
56151
|
sendForSpan({ type: "checkout-state", ok: false, error: { code: "checkout_missing" } });
|
|
56106
56152
|
return;
|
|
@@ -56132,7 +56178,7 @@ function createBridgeMessageHandler(deps) {
|
|
|
56132
56178
|
const result = registerCheckout(
|
|
56133
56179
|
deps.checkoutRegistry,
|
|
56134
56180
|
{ projectSlug, path: typeof msg.path === "string" ? msg.path : "", repo },
|
|
56135
|
-
|
|
56181
|
+
import_node_os13.default.hostname()
|
|
56136
56182
|
);
|
|
56137
56183
|
if (!result.ok) {
|
|
56138
56184
|
sendForSpan({ type: "checkout-register", ok: false, error: { code: result.code, detail: result.detail } });
|
|
@@ -57199,8 +57245,8 @@ async function startDirectorBridge() {
|
|
|
57199
57245
|
codexCwd: config2.codexCwd,
|
|
57200
57246
|
codexExecutable: config2.codexExecutable,
|
|
57201
57247
|
checkoutRegistry,
|
|
57202
|
-
worktreeRoot:
|
|
57203
|
-
locksDir:
|
|
57248
|
+
worktreeRoot: import_node_path28.default.join(config2.stateDir, "worktrees"),
|
|
57249
|
+
locksDir: import_node_path28.default.join(config2.stateDir, "locks"),
|
|
57204
57250
|
// Wire the executor server for code-execution runs. Each run gets its own provider process
|
|
57205
57251
|
// (app-server for codex, a resident CLI child for claude) at the run worktree, running
|
|
57206
57252
|
// UNRESTRICTED from the real operator config (owner no-sandbox decision — auth + mrrlin MCP
|
|
@@ -57244,7 +57290,7 @@ async function startDirectorBridge() {
|
|
|
57244
57290
|
// egressDomains is retained in the seam signature (verification-turn.ts still computes the
|
|
57245
57291
|
// env host) but no longer constrains anything — the executor is unrestricted.
|
|
57246
57292
|
startSandbox: async (_egressDomains, providerId) => {
|
|
57247
|
-
const cwd = import_node_fs20.default.mkdtempSync(
|
|
57293
|
+
const cwd = import_node_fs20.default.mkdtempSync(import_node_path28.default.join(import_node_os13.default.tmpdir(), "mrrlin-verify-"));
|
|
57248
57294
|
let executor;
|
|
57249
57295
|
try {
|
|
57250
57296
|
executor = await startExecutorServer({ worktree: cwd, provider: providerId });
|
|
@@ -57283,7 +57329,11 @@ async function startDirectorBridge() {
|
|
|
57283
57329
|
attemptOutcome,
|
|
57284
57330
|
cwd: config2.codexCwd ?? process.cwd(),
|
|
57285
57331
|
codexExecutable: config2.codexExecutable,
|
|
57286
|
-
runId
|
|
57332
|
+
runId,
|
|
57333
|
+
// Where this gate records what each of its provider calls cost. The same directory the
|
|
57334
|
+
// uploader reads from (`uploadPendingDays(config.stateDir, ...)` further down this file),
|
|
57335
|
+
// so a record written here is picked up by the very next telemetry tick.
|
|
57336
|
+
stateDir: config2.stateDir
|
|
57287
57337
|
});
|
|
57288
57338
|
return runDeliverableGate({ projectSlug, deliverablePageId, attemptOutcome }, gateDeps);
|
|
57289
57339
|
}
|
|
@@ -57468,7 +57518,7 @@ async function startDirectorBridge() {
|
|
|
57468
57518
|
}
|
|
57469
57519
|
const files = dayFilesInWindow(/* @__PURE__ */ new Date(), reseedWindowMs);
|
|
57470
57520
|
const sessionIds = [args.directorSessionId, ...args.priorSessionIds];
|
|
57471
|
-
const { lines: lines2, missingFiles } = await readSessionRows(
|
|
57521
|
+
const { lines: lines2, missingFiles } = await readSessionRows(import_node_path28.default.join(config2.stateDir, "logs"), files, sessionIds);
|
|
57472
57522
|
const { items, skipped: skipped2 } = extractItems(lines2, sessionIds);
|
|
57473
57523
|
if (items.length === 0) return refuse2("no-rows");
|
|
57474
57524
|
const budget = Math.max(0, Math.min(config2.reseedMaxTokens, config2.turnMaxTokens - args.otherBytes));
|
|
@@ -57701,8 +57751,8 @@ async function startDirectorBridge() {
|
|
|
57701
57751
|
);
|
|
57702
57752
|
void runOrphanWorktreeSweep(client, {
|
|
57703
57753
|
checkoutRegistry,
|
|
57704
|
-
worktreeRoot:
|
|
57705
|
-
locksDir:
|
|
57754
|
+
worktreeRoot: import_node_path28.default.join(config2.stateDir, "worktrees"),
|
|
57755
|
+
locksDir: import_node_path28.default.join(config2.stateDir, "locks")
|
|
57706
57756
|
});
|
|
57707
57757
|
{
|
|
57708
57758
|
const { retainedBuffers, retainedBytes, tombstonesRemoved } = sweepReplayBuffers(threads, tombstones, {
|
|
@@ -58032,7 +58082,7 @@ function readDispatchBody(req) {
|
|
|
58032
58082
|
function readOrCreateBridgeToken(stateDir) {
|
|
58033
58083
|
const explicit = (process.env.MRRLIN_DIRECTOR_BRIDGE_TOKEN ?? "").trim();
|
|
58034
58084
|
if (explicit) return explicit;
|
|
58035
|
-
const tokenPath =
|
|
58085
|
+
const tokenPath = import_node_path28.default.join(stateDir, "token.txt");
|
|
58036
58086
|
try {
|
|
58037
58087
|
const existing = import_node_fs20.default.readFileSync(tokenPath, "utf8").trim();
|
|
58038
58088
|
if (existing) return existing;
|
|
@@ -61430,15 +61480,15 @@ var StdioServerTransport = class {
|
|
|
61430
61480
|
// src/tools.ts
|
|
61431
61481
|
var import_node_crypto14 = require("node:crypto");
|
|
61432
61482
|
var import_promises10 = require("node:fs/promises");
|
|
61433
|
-
var
|
|
61434
|
-
var
|
|
61483
|
+
var import_node_path31 = __toESM(require("node:path"), 1);
|
|
61484
|
+
var import_node_os14 = __toESM(require("node:os"), 1);
|
|
61435
61485
|
|
|
61436
61486
|
// ../../packages/wiki/dist/index.js
|
|
61437
61487
|
var import_promises8 = __toESM(require("node:fs/promises"), 1);
|
|
61438
|
-
var
|
|
61488
|
+
var import_node_path29 = __toESM(require("node:path"), 1);
|
|
61439
61489
|
var INCLUDED_DOC_FOLDERS = /* @__PURE__ */ new Set(["_meta", "explanation", "how-to", "reference", "sdd", "tutorials"]);
|
|
61440
61490
|
function toPosixPath(input) {
|
|
61441
|
-
return input.split(
|
|
61491
|
+
return input.split(import_node_path29.default.sep).join("/");
|
|
61442
61492
|
}
|
|
61443
61493
|
function slugifyWikiSegment(input) {
|
|
61444
61494
|
return input.trim().toLowerCase().replace(/`/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
@@ -61452,12 +61502,12 @@ async function pathExists3(input) {
|
|
|
61452
61502
|
}
|
|
61453
61503
|
}
|
|
61454
61504
|
async function findWorkspaceRoot(start = process.cwd()) {
|
|
61455
|
-
let current2 =
|
|
61505
|
+
let current2 = import_node_path29.default.resolve(start);
|
|
61456
61506
|
while (true) {
|
|
61457
|
-
if (await pathExists3(
|
|
61507
|
+
if (await pathExists3(import_node_path29.default.join(current2, "pnpm-workspace.yaml")) && await pathExists3(import_node_path29.default.join(current2, "docs"))) {
|
|
61458
61508
|
return current2;
|
|
61459
61509
|
}
|
|
61460
|
-
const parent =
|
|
61510
|
+
const parent = import_node_path29.default.dirname(current2);
|
|
61461
61511
|
if (parent === current2) {
|
|
61462
61512
|
throw new Error(`Unable to find Mrrlin workspace root from ${start}`);
|
|
61463
61513
|
}
|
|
@@ -61466,28 +61516,28 @@ async function findWorkspaceRoot(start = process.cwd()) {
|
|
|
61466
61516
|
}
|
|
61467
61517
|
async function resolveDocsRoot(input) {
|
|
61468
61518
|
if (input) {
|
|
61469
|
-
return
|
|
61519
|
+
return import_node_path29.default.resolve(input);
|
|
61470
61520
|
}
|
|
61471
61521
|
if (process.env.MRRLIN_DOCS_ROOT) {
|
|
61472
|
-
return
|
|
61522
|
+
return import_node_path29.default.resolve(process.env.MRRLIN_DOCS_ROOT);
|
|
61473
61523
|
}
|
|
61474
|
-
return
|
|
61524
|
+
return import_node_path29.default.join(await findWorkspaceRoot(), "docs");
|
|
61475
61525
|
}
|
|
61476
61526
|
async function resolveIndexPath(input) {
|
|
61477
61527
|
if (input) {
|
|
61478
|
-
return
|
|
61528
|
+
return import_node_path29.default.resolve(input);
|
|
61479
61529
|
}
|
|
61480
61530
|
if (process.env.MRRLIN_WIKI_INDEX_PATH) {
|
|
61481
|
-
return
|
|
61531
|
+
return import_node_path29.default.resolve(process.env.MRRLIN_WIKI_INDEX_PATH);
|
|
61482
61532
|
}
|
|
61483
61533
|
const workspaceRoot = await findWorkspaceRoot();
|
|
61484
|
-
return
|
|
61534
|
+
return import_node_path29.default.join(workspaceRoot, "apps", "web", "public", "wiki-index.json");
|
|
61485
61535
|
}
|
|
61486
61536
|
async function walkMarkdownFiles(root, dir = root) {
|
|
61487
61537
|
const entries = await import_promises8.default.readdir(dir, { withFileTypes: true });
|
|
61488
61538
|
const files = [];
|
|
61489
61539
|
for (const entry of entries) {
|
|
61490
|
-
const absolute =
|
|
61540
|
+
const absolute = import_node_path29.default.join(dir, entry.name);
|
|
61491
61541
|
if (entry.isDirectory()) {
|
|
61492
61542
|
files.push(...await walkMarkdownFiles(root, absolute));
|
|
61493
61543
|
continue;
|
|
@@ -61506,7 +61556,7 @@ function parseTitle(markdown, sourcePath) {
|
|
|
61506
61556
|
return title;
|
|
61507
61557
|
}
|
|
61508
61558
|
function documentFromFile(docsRoot, absolutePath, markdown) {
|
|
61509
|
-
const relativePath = toPosixPath(
|
|
61559
|
+
const relativePath = toPosixPath(import_node_path29.default.relative(docsRoot, absolutePath));
|
|
61510
61560
|
const [section, fileName] = relativePath.split("/");
|
|
61511
61561
|
if (!section || !fileName || !INCLUDED_DOC_FOLDERS.has(section)) {
|
|
61512
61562
|
return null;
|
|
@@ -61949,7 +61999,12 @@ ${artifact}${dismissedBlock}` : `${artifact}${dismissedBlock}`;
|
|
|
61949
61999
|
const rePicked = await pickOnce();
|
|
61950
62000
|
if (!rePicked.ok || rePicked.agents.length <= built.agents.length) return { ok: false };
|
|
61951
62001
|
const rebuilt = buildFromAgents(rePicked.agents);
|
|
61952
|
-
return {
|
|
62002
|
+
return {
|
|
62003
|
+
ok: true,
|
|
62004
|
+
composition: rebuilt.composition,
|
|
62005
|
+
runHead: rebuilt.runHead,
|
|
62006
|
+
assignment: rebuilt.assignment
|
|
62007
|
+
};
|
|
61953
62008
|
};
|
|
61954
62009
|
return { ok: true, runner: { ...built, repick } };
|
|
61955
62010
|
}
|
|
@@ -62092,7 +62147,19 @@ function multiLlmActive(_env = process.env) {
|
|
|
62092
62147
|
}
|
|
62093
62148
|
function applyActivePanel(deps, panel) {
|
|
62094
62149
|
if (!panel) return;
|
|
62095
|
-
|
|
62150
|
+
const record2 = deps.recordHeadCall;
|
|
62151
|
+
deps.runHead = record2 === void 0 ? panel.runHead : async (persona, artifact, dismissed) => {
|
|
62152
|
+
const agentId = panel.assignment[persona] ?? null;
|
|
62153
|
+
const startedAt = Date.now();
|
|
62154
|
+
try {
|
|
62155
|
+
const result = await panel.runHead(persona, artifact, dismissed);
|
|
62156
|
+
record2(persona, agentId, startedAt, result);
|
|
62157
|
+
return result;
|
|
62158
|
+
} catch (error51) {
|
|
62159
|
+
record2(persona, agentId, startedAt, { ok: false, error: error51 instanceof Error ? error51.message : String(error51) });
|
|
62160
|
+
throw error51;
|
|
62161
|
+
}
|
|
62162
|
+
};
|
|
62096
62163
|
deps.panelComposition = panel.composition;
|
|
62097
62164
|
}
|
|
62098
62165
|
async function resolveActivePanel(input, deps) {
|
|
@@ -62127,7 +62194,11 @@ async function resolveActivePanel(input, deps) {
|
|
|
62127
62194
|
deps
|
|
62128
62195
|
);
|
|
62129
62196
|
if (!built.ok) return null;
|
|
62130
|
-
return {
|
|
62197
|
+
return {
|
|
62198
|
+
runHead: built.runner.runHead,
|
|
62199
|
+
composition: built.runner.composition,
|
|
62200
|
+
assignment: built.runner.assignment
|
|
62201
|
+
};
|
|
62131
62202
|
} catch {
|
|
62132
62203
|
return null;
|
|
62133
62204
|
}
|
|
@@ -62709,9 +62780,9 @@ async function runNativeSpecGate(ctx, input, builders = defaultNativeSpecGateBui
|
|
|
62709
62780
|
specPageId: input.pageId,
|
|
62710
62781
|
cwd: ctx.cwd,
|
|
62711
62782
|
codexExecutable: ctx.codexExecutable,
|
|
62712
|
-
// Where the gate records what each of its provider calls cost.
|
|
62713
|
-
// four gate-deps call sites
|
|
62714
|
-
//
|
|
62783
|
+
// Where the gate records what each of its provider calls cost. Without it the recorder is a
|
|
62784
|
+
// no-op, which is how three of the four gate-deps call sites once ran silent; all four pass one
|
|
62785
|
+
// now, and `consensus/gate-cost-call-sites.test.ts` fails if a fifth appears without it.
|
|
62715
62786
|
stateDir: ctx.stateDir,
|
|
62716
62787
|
extraHeadCount: input.extraHeads?.length ?? 0,
|
|
62717
62788
|
// model-tier-planning-and-arbiter task 1.21: the seat minted at the async-job claim.
|
|
@@ -63157,6 +63228,9 @@ async function run2(ctx, input) {
|
|
|
63157
63228
|
deliverablePageId: input.pageId,
|
|
63158
63229
|
cwd: ctx.cwd,
|
|
63159
63230
|
codexExecutable: ctx.codexExecutable,
|
|
63231
|
+
// Where the gate records what each of its provider calls cost — the same `ctx.stateDir` the
|
|
63232
|
+
// spec gate next door already passes.
|
|
63233
|
+
stateDir: ctx.stateDir,
|
|
63160
63234
|
// model-tier-planning-and-arbiter task 1.21: the seat minted at the async-job claim.
|
|
63161
63235
|
seat: ctx.seat
|
|
63162
63236
|
});
|
|
@@ -63411,7 +63485,7 @@ var intentCheckDescriptor = createIntentCheckDescriptor();
|
|
|
63411
63485
|
|
|
63412
63486
|
// src/evidence/assembler.ts
|
|
63413
63487
|
var import_promises9 = require("node:fs/promises");
|
|
63414
|
-
var
|
|
63488
|
+
var import_node_path30 = require("node:path");
|
|
63415
63489
|
function evidenceDedupKey(sessionId, reportId) {
|
|
63416
63490
|
return `${sessionId}:${reportId}`;
|
|
63417
63491
|
}
|
|
@@ -63421,7 +63495,7 @@ function isRecord5(v) {
|
|
|
63421
63495
|
async function readDayLines(stateDir, day, sessionId) {
|
|
63422
63496
|
let raw;
|
|
63423
63497
|
try {
|
|
63424
|
-
raw = await (0, import_promises9.readFile)((0,
|
|
63498
|
+
raw = await (0, import_promises9.readFile)((0, import_node_path30.join)(stateDir, "logs", `bridge-${day}.jsonl`), "utf8");
|
|
63425
63499
|
} catch {
|
|
63426
63500
|
return [];
|
|
63427
63501
|
}
|
|
@@ -63495,7 +63569,7 @@ async function assembleEvidence(stateDir, sessionId, reportId, gateCtx) {
|
|
|
63495
63569
|
}
|
|
63496
63570
|
let windowPruned = false;
|
|
63497
63571
|
try {
|
|
63498
|
-
const raw = await (0, import_promises9.readFile)((0,
|
|
63572
|
+
const raw = await (0, import_promises9.readFile)((0, import_node_path30.join)(stateDir, "logs", ".pruned.jsonl"), "utf8");
|
|
63499
63573
|
outer: for (const line of raw.split("\n")) {
|
|
63500
63574
|
if (!line.trim()) continue;
|
|
63501
63575
|
let rec;
|
|
@@ -65167,7 +65241,12 @@ function createMrrlinTools(options) {
|
|
|
65167
65241
|
baseRef,
|
|
65168
65242
|
cwd: process.cwd(),
|
|
65169
65243
|
codexExecutable: process.env.MRRLIN_DIRECTOR_BRIDGE_CODEX_BIN?.trim() || void 0,
|
|
65170
|
-
extraHeads
|
|
65244
|
+
extraHeads,
|
|
65245
|
+
// Where this gate records what each of its provider calls cost. Unlike the two async
|
|
65246
|
+
// gates, this handler runs in the `serve` process, which holds no config object — so the
|
|
65247
|
+
// directory is resolved from the same env fact the bridge resolves it from, which is why
|
|
65248
|
+
// that fact now lives in one module instead of three copies.
|
|
65249
|
+
stateDir: resolveStateDir()
|
|
65171
65250
|
});
|
|
65172
65251
|
const persistedProvider = await getAgentProviderForPanel(c);
|
|
65173
65252
|
let activeCodePanel = null;
|
|
@@ -65329,7 +65408,7 @@ function createMrrlinTools(options) {
|
|
|
65329
65408
|
"ARTIFACT_FILE_UPLOAD_FAILED",
|
|
65330
65409
|
"Unable to upload artifact file.",
|
|
65331
65410
|
async (c, { projectSlug, path: filePath, class: artifactClass, taskId, runId, description }) => {
|
|
65332
|
-
const extension2 =
|
|
65411
|
+
const extension2 = import_node_path31.default.extname(filePath).toLowerCase();
|
|
65333
65412
|
const contentType = ARTIFACT_EXTENSION_TYPES[extension2];
|
|
65334
65413
|
if (!contentType) {
|
|
65335
65414
|
throw new McpToolCodedError(
|
|
@@ -65357,7 +65436,7 @@ function createMrrlinTools(options) {
|
|
|
65357
65436
|
"Artifact exceeds 5MB; split or summarize instead."
|
|
65358
65437
|
);
|
|
65359
65438
|
}
|
|
65360
|
-
const filename =
|
|
65439
|
+
const filename = import_node_path31.default.basename(filePath);
|
|
65361
65440
|
return uploadArtifactBytes(c, {
|
|
65362
65441
|
bytes: bytes3,
|
|
65363
65442
|
class: artifactClass,
|
|
@@ -65382,7 +65461,7 @@ function createMrrlinTools(options) {
|
|
|
65382
65461
|
`Invalid filename '${filename}'; provide a bare filename with no path separators or '..'.`
|
|
65383
65462
|
);
|
|
65384
65463
|
}
|
|
65385
|
-
const extension2 =
|
|
65464
|
+
const extension2 = import_node_path31.default.extname(filename).toLowerCase();
|
|
65386
65465
|
const contentType = ARTIFACT_EXTENSION_TYPES[extension2];
|
|
65387
65466
|
if (!contentType) {
|
|
65388
65467
|
throw new McpToolCodedError(
|
|
@@ -65456,9 +65535,8 @@ function createMrrlinTools(options) {
|
|
|
65456
65535
|
"LOCAL_CHECKOUT_REGISTER_FAILED",
|
|
65457
65536
|
"Unable to register local checkout.",
|
|
65458
65537
|
async (_c, { projectSlug, path: checkoutPath, repo }) => {
|
|
65459
|
-
const
|
|
65460
|
-
const
|
|
65461
|
-
const result = registerCheckout(registry3, { projectSlug, path: checkoutPath, repo }, import_node_os13.default.hostname());
|
|
65538
|
+
const registry3 = new CheckoutRegistry(resolveStateDir());
|
|
65539
|
+
const result = registerCheckout(registry3, { projectSlug, path: checkoutPath, repo }, import_node_os14.default.hostname());
|
|
65462
65540
|
if (!result.ok) {
|
|
65463
65541
|
const codeMap = {
|
|
65464
65542
|
not_absolute: "LOCAL_CHECKOUT_PATH_NOT_ABSOLUTE",
|
|
@@ -65695,9 +65773,9 @@ function runSetCredential(args) {
|
|
|
65695
65773
|
}
|
|
65696
65774
|
|
|
65697
65775
|
// src/install-service.ts
|
|
65698
|
-
var
|
|
65776
|
+
var import_node_os15 = __toESM(require("node:os"), 1);
|
|
65699
65777
|
var import_node_fs21 = require("node:fs");
|
|
65700
|
-
var
|
|
65778
|
+
var import_node_path32 = __toESM(require("node:path"), 1);
|
|
65701
65779
|
var SYSTEM_PATH_DIRS = ["/usr/bin", "/bin", "/usr/sbin", "/sbin"];
|
|
65702
65780
|
function defaultHomeOwnerUid(home) {
|
|
65703
65781
|
try {
|
|
@@ -65742,11 +65820,11 @@ function installService(deps) {
|
|
|
65742
65820
|
deps.log(resolved.reason);
|
|
65743
65821
|
return { ok: false };
|
|
65744
65822
|
}
|
|
65745
|
-
const home = deps.env.HOME ??
|
|
65823
|
+
const home = deps.env.HOME ?? import_node_os15.default.homedir();
|
|
65746
65824
|
const user = resolveBridgeUser({
|
|
65747
65825
|
env: deps.env,
|
|
65748
65826
|
home,
|
|
65749
|
-
userInfo: deps.userInfo ?? (() =>
|
|
65827
|
+
userInfo: deps.userInfo ?? (() => import_node_os15.default.userInfo()),
|
|
65750
65828
|
homeOwnerUid: deps.homeOwnerUid ?? defaultHomeOwnerUid,
|
|
65751
65829
|
log: deps.log
|
|
65752
65830
|
});
|
|
@@ -65762,7 +65840,7 @@ function installService(deps) {
|
|
|
65762
65840
|
const claudeBin = deps.which("claude");
|
|
65763
65841
|
const resolvedBins = [...bins, claudeBin].filter((b) => b !== null);
|
|
65764
65842
|
const pathEnv = Array.from(
|
|
65765
|
-
/* @__PURE__ */ new Set([...resolvedBins.map((b) =>
|
|
65843
|
+
/* @__PURE__ */ new Set([...resolvedBins.map((b) => import_node_path32.default.dirname(b)), ...SYSTEM_PATH_DIRS])
|
|
65766
65844
|
).join(":");
|
|
65767
65845
|
const apiBaseUrl = deps.env.MRRLIN_API_BASE_URL?.trim() || void 0;
|
|
65768
65846
|
const staging = deps.env.MRRLIN_STAGING === "1" || !apiBaseUrl && bridgeUrlImpliesStaging(deps.env.MRRLIN_BRIDGE_URL);
|
|
@@ -65775,7 +65853,7 @@ function installService(deps) {
|
|
|
65775
65853
|
staging,
|
|
65776
65854
|
apiBaseUrl
|
|
65777
65855
|
});
|
|
65778
|
-
const ecoPath =
|
|
65856
|
+
const ecoPath = import_node_path32.default.join(home, ".mrrlin", "ecosystem.config.cjs");
|
|
65779
65857
|
deps.writeFile(ecoPath, text);
|
|
65780
65858
|
const start = deps.runPm2(["startOrReload", ecoPath]);
|
|
65781
65859
|
if (start.code !== 0) {
|
|
@@ -65827,13 +65905,13 @@ function uninstallService(deps) {
|
|
|
65827
65905
|
|
|
65828
65906
|
// src/uninstall-codex.ts
|
|
65829
65907
|
var import_promises11 = __toESM(require("node:fs/promises"), 1);
|
|
65830
|
-
var
|
|
65831
|
-
var
|
|
65908
|
+
var import_node_os16 = __toESM(require("node:os"), 1);
|
|
65909
|
+
var import_node_path33 = __toESM(require("node:path"), 1);
|
|
65832
65910
|
var toml3 = __toESM(require_toml(), 1);
|
|
65833
65911
|
function resolveCodexHome3(options) {
|
|
65834
65912
|
if (options.codexHome) return options.codexHome;
|
|
65835
65913
|
if (process.env.CODEX_HOME) return process.env.CODEX_HOME;
|
|
65836
|
-
return
|
|
65914
|
+
return import_node_path33.default.join(options.homeDir ?? import_node_os16.default.homedir(), ".codex");
|
|
65837
65915
|
}
|
|
65838
65916
|
async function pathExists4(target) {
|
|
65839
65917
|
try {
|
|
@@ -65846,7 +65924,7 @@ async function pathExists4(target) {
|
|
|
65846
65924
|
var MRRLIN_BLOCK_RE = /(^|\n)\[mcp_servers\.(?:mrrlin(?:-browser)?|external-agents)(?:\]|\.[^\]\n]*\])[\s\S]*?(?=\n\[|$)/g;
|
|
65847
65925
|
async function uninstallCodex(options = {}) {
|
|
65848
65926
|
const codexHome = resolveCodexHome3(options);
|
|
65849
|
-
const configPath =
|
|
65927
|
+
const configPath = import_node_path33.default.join(codexHome, "config.toml");
|
|
65850
65928
|
const removePrompts = async () => uninstallPrompts(codexHome, options.promptNames ?? []);
|
|
65851
65929
|
if (!await pathExists4(configPath)) {
|
|
65852
65930
|
return { action: "missing", configPath, prompts: await removePrompts() };
|
|
@@ -65874,10 +65952,10 @@ async function uninstallCodex(options = {}) {
|
|
|
65874
65952
|
}
|
|
65875
65953
|
async function uninstallPrompts(codexHome, names) {
|
|
65876
65954
|
if (names.length === 0) return [];
|
|
65877
|
-
const promptsDir =
|
|
65955
|
+
const promptsDir = import_node_path33.default.join(codexHome, "prompts");
|
|
65878
65956
|
const out = [];
|
|
65879
65957
|
for (const name of names) {
|
|
65880
|
-
const promptPath =
|
|
65958
|
+
const promptPath = import_node_path33.default.join(promptsDir, `${name}.md`);
|
|
65881
65959
|
try {
|
|
65882
65960
|
await import_promises11.default.unlink(promptPath);
|
|
65883
65961
|
out.push({ name, action: "removed", promptPath });
|
|
@@ -65895,7 +65973,7 @@ async function uninstallPrompts(codexHome, names) {
|
|
|
65895
65973
|
|
|
65896
65974
|
// src/extract/command.ts
|
|
65897
65975
|
var import_promises12 = require("node:fs/promises");
|
|
65898
|
-
var
|
|
65976
|
+
var import_node_path34 = require("node:path");
|
|
65899
65977
|
function parseArgs(args) {
|
|
65900
65978
|
const map2 = /* @__PURE__ */ new Map();
|
|
65901
65979
|
for (let i = 0; i < args.length; i++) {
|
|
@@ -65932,7 +66010,7 @@ Missing required flag(s): ${missing.join(
|
|
|
65932
66010
|
const days = await findSessionDays(deps.stateDir, sessionId);
|
|
65933
66011
|
const matchingLines = [];
|
|
65934
66012
|
for (const day of days) {
|
|
65935
|
-
const logPath = (0,
|
|
66013
|
+
const logPath = (0, import_node_path34.join)(deps.stateDir, "logs", `bridge-${day}.jsonl`);
|
|
65936
66014
|
let raw;
|
|
65937
66015
|
try {
|
|
65938
66016
|
raw = await (0, import_promises12.readFile)(logPath, "utf8");
|
|
@@ -66032,11 +66110,11 @@ function bootHookStatus() {
|
|
|
66032
66110
|
if (process.platform !== "darwin") return { status: "unknown" };
|
|
66033
66111
|
const uid = process.getuid?.();
|
|
66034
66112
|
if (uid === void 0 || uid === 0) return { status: "unknown" };
|
|
66035
|
-
const home = process.env.HOME ?? (0,
|
|
66036
|
-
const agents =
|
|
66113
|
+
const home = process.env.HOME ?? (0, import_node_os17.homedir)();
|
|
66114
|
+
const agents = import_node_path36.default.join(home, "Library", "LaunchAgents");
|
|
66037
66115
|
const candidates = [
|
|
66038
|
-
{ label: "com.mrrlin.director-bridge", plist:
|
|
66039
|
-
{ label: "com.PM2", plist:
|
|
66116
|
+
{ label: "com.mrrlin.director-bridge", plist: import_node_path36.default.join(agents, "com.mrrlin.director-bridge.plist") },
|
|
66117
|
+
{ label: "com.PM2", plist: import_node_path36.default.join(agents, `pm2.${(0, import_node_os17.userInfo)().username}.plist`) }
|
|
66040
66118
|
];
|
|
66041
66119
|
for (const candidate of candidates) {
|
|
66042
66120
|
const printed = (0, import_node_child_process18.spawnSync)("launchctl", ["print", `gui/${uid}/${candidate.label}`], { encoding: "utf8" });
|
|
@@ -66324,8 +66402,8 @@ async function main() {
|
|
|
66324
66402
|
}
|
|
66325
66403
|
}
|
|
66326
66404
|
try {
|
|
66327
|
-
const codexHome = process.env.CODEX_HOME ??
|
|
66328
|
-
(0, import_node_fs22.rmSync)(
|
|
66405
|
+
const codexHome = process.env.CODEX_HOME ?? import_node_path36.default.join(process.env.HOME ?? (0, import_node_os17.homedir)(), ".codex");
|
|
66406
|
+
(0, import_node_fs22.rmSync)(import_node_path36.default.join(codexHome, "prompts", "report-issue.md"), { force: true });
|
|
66329
66407
|
} catch {
|
|
66330
66408
|
}
|
|
66331
66409
|
const claudeResult = await installClaude({ binPath, force, serveEnv });
|
|
@@ -66386,7 +66464,7 @@ async function main() {
|
|
|
66386
66464
|
env: process.env,
|
|
66387
66465
|
cwd: process.cwd(),
|
|
66388
66466
|
writeFile: (p, c) => {
|
|
66389
|
-
(0, import_node_fs22.mkdirSync)(
|
|
66467
|
+
(0, import_node_fs22.mkdirSync)(import_node_path36.default.dirname(p), { recursive: true, mode: 448 });
|
|
66390
66468
|
(0, import_node_fs22.writeFileSync)(p, c, { mode: 384 });
|
|
66391
66469
|
},
|
|
66392
66470
|
runPm2: pm2Runner,
|
|
@@ -66412,14 +66490,14 @@ async function main() {
|
|
|
66412
66490
|
purgeSecret: purge,
|
|
66413
66491
|
secretPath: agentCredentialPath(),
|
|
66414
66492
|
tokenPath: operatorTokenPath(),
|
|
66415
|
-
ecoPath:
|
|
66493
|
+
ecoPath: import_node_path36.default.join(process.env.HOME ?? (0, import_node_os17.homedir)(), ".mrrlin", "ecosystem.config.cjs"),
|
|
66416
66494
|
log: (m) => process.stderr.write(`[mrrlin-mcp uninstall-service] ${m}
|
|
66417
66495
|
`)
|
|
66418
66496
|
});
|
|
66419
66497
|
return;
|
|
66420
66498
|
}
|
|
66421
66499
|
case "uninstall": {
|
|
66422
|
-
const home = process.env.HOME ?? (0,
|
|
66500
|
+
const home = process.env.HOME ?? (0, import_node_os17.homedir)();
|
|
66423
66501
|
const log = (m) => process.stderr.write(`[mrrlin-mcp uninstall] ${m}
|
|
66424
66502
|
`);
|
|
66425
66503
|
uninstallService({
|
|
@@ -66433,7 +66511,7 @@ async function main() {
|
|
|
66433
66511
|
purgeSecret: true,
|
|
66434
66512
|
secretPath: agentCredentialPath(),
|
|
66435
66513
|
tokenPath: operatorTokenPath(),
|
|
66436
|
-
ecoPath:
|
|
66514
|
+
ecoPath: import_node_path36.default.join(home, ".mrrlin", "ecosystem.config.cjs"),
|
|
66437
66515
|
log
|
|
66438
66516
|
});
|
|
66439
66517
|
let codexOk = true;
|
|
@@ -66453,7 +66531,7 @@ async function main() {
|
|
|
66453
66531
|
log(`codex config NOT modified: ${error51 instanceof Error ? error51.message : String(error51)}`);
|
|
66454
66532
|
}
|
|
66455
66533
|
try {
|
|
66456
|
-
(0, import_node_fs22.rmSync)(
|
|
66534
|
+
(0, import_node_fs22.rmSync)(import_node_path36.default.join(home, ".mrrlin"), { recursive: true, force: true });
|
|
66457
66535
|
} catch {
|
|
66458
66536
|
}
|
|
66459
66537
|
log("removed ~/.mrrlin");
|
|
@@ -66494,7 +66572,7 @@ ${HELP_TEXT}`);
|
|
|
66494
66572
|
}
|
|
66495
66573
|
}
|
|
66496
66574
|
function resolveSelfBinPath() {
|
|
66497
|
-
return
|
|
66575
|
+
return import_node_path35.default.resolve(process.argv[1] ?? process.execPath);
|
|
66498
66576
|
}
|
|
66499
66577
|
main().catch((error51) => {
|
|
66500
66578
|
process.stderr.write(`mrrlin-mcp fatal error: ${error51 instanceof Error ? error51.message : String(error51)}
|