@mrrlin-dev/mcp 0.4.61 → 0.4.62
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 +184 -52
- package/package.json +2 -2
package/dist/bin.cjs
CHANGED
|
@@ -20645,7 +20645,7 @@ var require_dist = __commonJS({
|
|
|
20645
20645
|
|
|
20646
20646
|
// src/bin.ts
|
|
20647
20647
|
var import_node_path37 = __toESM(require("node:path"), 1);
|
|
20648
|
-
var
|
|
20648
|
+
var import_node_child_process19 = require("node:child_process");
|
|
20649
20649
|
var import_node_fs24 = require("node:fs");
|
|
20650
20650
|
var import_node_os19 = require("node:os");
|
|
20651
20651
|
var import_node_path38 = __toESM(require("node:path"), 1);
|
|
@@ -21638,7 +21638,7 @@ var import_node_fs22 = __toESM(require("node:fs"), 1);
|
|
|
21638
21638
|
var import_node_http = __toESM(require("node:http"), 1);
|
|
21639
21639
|
var import_node_os15 = __toESM(require("node:os"), 1);
|
|
21640
21640
|
var import_node_path30 = __toESM(require("node:path"), 1);
|
|
21641
|
-
var
|
|
21641
|
+
var import_node_child_process16 = require("node:child_process");
|
|
21642
21642
|
var import_node_crypto11 = __toESM(require("node:crypto"), 1);
|
|
21643
21643
|
|
|
21644
21644
|
// src/turn-replay-buffer.ts
|
|
@@ -42256,17 +42256,21 @@ function createTurnLock() {
|
|
|
42256
42256
|
}
|
|
42257
42257
|
|
|
42258
42258
|
// src/self-update.ts
|
|
42259
|
-
var
|
|
42259
|
+
var import_node_child_process8 = require("node:child_process");
|
|
42260
42260
|
var import_node_crypto2 = require("node:crypto");
|
|
42261
42261
|
var import_node_fs4 = require("node:fs");
|
|
42262
42262
|
var import_node_path7 = __toESM(require("node:path"), 1);
|
|
42263
42263
|
var import_semver3 = __toESM(require_semver2(), 1);
|
|
42264
42264
|
|
|
42265
42265
|
// src/codex-auth-preflight.ts
|
|
42266
|
+
var import_node_child_process7 = require("node:child_process");
|
|
42266
42267
|
var import_node_fs3 = require("node:fs");
|
|
42267
42268
|
var import_node_os6 = __toESM(require("node:os"), 1);
|
|
42268
42269
|
var import_node_path6 = __toESM(require("node:path"), 1);
|
|
42269
42270
|
var DEFAULT_CODEX_AUTH_MIN_TTL_SECONDS = 15 * 60;
|
|
42271
|
+
var DEFAULT_CODEX_AUTH_SMOKE_TIMEOUT_MS = 2e4;
|
|
42272
|
+
var DEFAULT_CODEX_AUTH_SMOKE_MODEL = "gpt-5.4-mini";
|
|
42273
|
+
var CODEX_AUTH_SMOKE_PROMPT = "Reply with exactly: OK";
|
|
42270
42274
|
function positiveInt(raw) {
|
|
42271
42275
|
if (!raw) return null;
|
|
42272
42276
|
const parsed = Number.parseInt(raw, 10);
|
|
@@ -42275,6 +42279,9 @@ function positiveInt(raw) {
|
|
|
42275
42279
|
function codexAuthMinTtlSeconds(env = process.env) {
|
|
42276
42280
|
return positiveInt(env.MRRLIN_DIRECTOR_BRIDGE_UPDATE_AUTH_MIN_TTL_SECONDS) ?? DEFAULT_CODEX_AUTH_MIN_TTL_SECONDS;
|
|
42277
42281
|
}
|
|
42282
|
+
function codexAuthSmokeTimeoutMs(env = process.env) {
|
|
42283
|
+
return positiveInt(env.MRRLIN_DIRECTOR_BRIDGE_UPDATE_AUTH_SMOKE_TIMEOUT_MS) ?? DEFAULT_CODEX_AUTH_SMOKE_TIMEOUT_MS;
|
|
42284
|
+
}
|
|
42278
42285
|
function resolveCodexAuthPath(opts = {}) {
|
|
42279
42286
|
const env = opts.env ?? process.env;
|
|
42280
42287
|
const codexHome = env.CODEX_HOME?.trim();
|
|
@@ -42290,6 +42297,97 @@ function decodeJwtExpMs(token) {
|
|
|
42290
42297
|
return null;
|
|
42291
42298
|
}
|
|
42292
42299
|
}
|
|
42300
|
+
function shellQuote(value) {
|
|
42301
|
+
if (/^[A-Za-z0-9_./:@%+=,-]+$/.test(value)) return value;
|
|
42302
|
+
return `'${value.replaceAll("'", "'\\''")}'`;
|
|
42303
|
+
}
|
|
42304
|
+
function commandForSmoke(executable, model) {
|
|
42305
|
+
return [
|
|
42306
|
+
executable,
|
|
42307
|
+
"exec",
|
|
42308
|
+
"--sandbox",
|
|
42309
|
+
"read-only",
|
|
42310
|
+
"--skip-git-repo-check",
|
|
42311
|
+
"--model",
|
|
42312
|
+
model,
|
|
42313
|
+
CODEX_AUTH_SMOKE_PROMPT
|
|
42314
|
+
].map(shellQuote).join(" ");
|
|
42315
|
+
}
|
|
42316
|
+
function codexAuthRefreshSmokeCommandForBridgeUpdate(opts = {}) {
|
|
42317
|
+
const env = { ...process.env, ...opts.env ?? {} };
|
|
42318
|
+
const configuredModel = opts.model ?? env.MRRLIN_DIRECTOR_BRIDGE_UPDATE_AUTH_SMOKE_MODEL?.trim();
|
|
42319
|
+
const model = configuredModel || DEFAULT_CODEX_AUTH_SMOKE_MODEL;
|
|
42320
|
+
const configuredExecutable = opts.codexExecutable ?? env.MRRLIN_DIRECTOR_BRIDGE_CODEX_BIN?.trim();
|
|
42321
|
+
const executable = configuredExecutable || "codex";
|
|
42322
|
+
return commandForSmoke(executable, model);
|
|
42323
|
+
}
|
|
42324
|
+
function errorField(err, key) {
|
|
42325
|
+
const value = typeof err === "object" && err !== null && key in err ? err[key] : "";
|
|
42326
|
+
return Buffer.isBuffer(value) ? value.toString("utf8") : typeof value === "string" ? value : "";
|
|
42327
|
+
}
|
|
42328
|
+
function errorStatus(err) {
|
|
42329
|
+
if (typeof err !== "object" || err === null) return null;
|
|
42330
|
+
const status = "status" in err ? err.status : void 0;
|
|
42331
|
+
const signal = "signal" in err ? err.signal : void 0;
|
|
42332
|
+
if (typeof status === "number") return `exit ${status}`;
|
|
42333
|
+
if (typeof signal === "string") return `signal ${signal}`;
|
|
42334
|
+
return null;
|
|
42335
|
+
}
|
|
42336
|
+
function isAuthLikeSmokeFailure(raw) {
|
|
42337
|
+
return /\baccess token\b|\bauth(?:entication)?\b|\binvalid[_ -]refresh[_ -]token\b|\brefresh token\b|\bsign in again\b|\blog out and sign in\b|\bnot logged in\b|\bunauthori[sz]ed\b/i.test(raw);
|
|
42338
|
+
}
|
|
42339
|
+
function runCodexAuthRefreshSmokeForBridgeUpdate(opts = {}) {
|
|
42340
|
+
const env = { ...process.env, ...opts.env ?? {} };
|
|
42341
|
+
const configuredModel = opts.model ?? env.MRRLIN_DIRECTOR_BRIDGE_UPDATE_AUTH_SMOKE_MODEL?.trim();
|
|
42342
|
+
const model = configuredModel || DEFAULT_CODEX_AUTH_SMOKE_MODEL;
|
|
42343
|
+
const configuredExecutable = opts.codexExecutable ?? env.MRRLIN_DIRECTOR_BRIDGE_CODEX_BIN?.trim();
|
|
42344
|
+
const executable = configuredExecutable || "codex";
|
|
42345
|
+
const timeoutMs = opts.timeoutMs ?? codexAuthSmokeTimeoutMs(env);
|
|
42346
|
+
const cwd = opts.cwd ?? import_node_os6.default.tmpdir();
|
|
42347
|
+
const args = [
|
|
42348
|
+
"exec",
|
|
42349
|
+
"--sandbox",
|
|
42350
|
+
"read-only",
|
|
42351
|
+
"--skip-git-repo-check",
|
|
42352
|
+
"--model",
|
|
42353
|
+
model,
|
|
42354
|
+
CODEX_AUTH_SMOKE_PROMPT
|
|
42355
|
+
];
|
|
42356
|
+
const command = commandForSmoke(executable, model);
|
|
42357
|
+
const execFileSync5 = opts.execFileSyncImpl ?? import_node_child_process7.execFileSync;
|
|
42358
|
+
try {
|
|
42359
|
+
execFileSync5(executable, args, {
|
|
42360
|
+
cwd,
|
|
42361
|
+
env,
|
|
42362
|
+
encoding: "utf8",
|
|
42363
|
+
timeout: timeoutMs,
|
|
42364
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
42365
|
+
});
|
|
42366
|
+
return {
|
|
42367
|
+
ok: true,
|
|
42368
|
+
status: "ok",
|
|
42369
|
+
command,
|
|
42370
|
+
timeoutMs,
|
|
42371
|
+
authLikely: false,
|
|
42372
|
+
detail: "Codex CLI smoke succeeded; any needed token refresh completed before the bridge update offer."
|
|
42373
|
+
};
|
|
42374
|
+
} catch (err) {
|
|
42375
|
+
const raw = `${err instanceof Error ? err.message : String(err)}
|
|
42376
|
+
${errorField(err, "stdout")}
|
|
42377
|
+
${errorField(err, "stderr")}`;
|
|
42378
|
+
const timedOut = /timed out|ETIMEDOUT/i.test(raw) || errorStatus(err) === "signal SIGTERM";
|
|
42379
|
+
const authLikely = isAuthLikeSmokeFailure(raw);
|
|
42380
|
+
const statusText = errorStatus(err);
|
|
42381
|
+
return {
|
|
42382
|
+
ok: false,
|
|
42383
|
+
status: timedOut ? "timed_out" : "failed",
|
|
42384
|
+
command,
|
|
42385
|
+
timeoutMs,
|
|
42386
|
+
authLikely,
|
|
42387
|
+
detail: authLikely ? "Codex CLI smoke failed with an authentication or token-refresh error." : `Codex CLI smoke failed${statusText ? ` (${statusText})` : ""}; update readiness could not be verified.`
|
|
42388
|
+
};
|
|
42389
|
+
}
|
|
42390
|
+
}
|
|
42293
42391
|
function inspectCodexAuthForBridgeUpdate(opts = {}) {
|
|
42294
42392
|
const env = opts.env ?? process.env;
|
|
42295
42393
|
const nowMs = opts.nowMs ?? Date.now();
|
|
@@ -42311,6 +42409,7 @@ function inspectCodexAuthForBridgeUpdate(opts = {}) {
|
|
|
42311
42409
|
tokenKinds: [],
|
|
42312
42410
|
expiresAtMs: null,
|
|
42313
42411
|
expiresInSeconds: null,
|
|
42412
|
+
requiresSmoke: true,
|
|
42314
42413
|
detail: status === "missing" ? "Codex CLI auth file is missing." : "Codex CLI auth file could not be read."
|
|
42315
42414
|
};
|
|
42316
42415
|
}
|
|
@@ -42327,6 +42426,7 @@ function inspectCodexAuthForBridgeUpdate(opts = {}) {
|
|
|
42327
42426
|
tokenKinds: [],
|
|
42328
42427
|
expiresAtMs: null,
|
|
42329
42428
|
expiresInSeconds: null,
|
|
42429
|
+
requiresSmoke: true,
|
|
42330
42430
|
detail: "Codex CLI auth file is not valid JSON."
|
|
42331
42431
|
};
|
|
42332
42432
|
}
|
|
@@ -42353,6 +42453,7 @@ function inspectCodexAuthForBridgeUpdate(opts = {}) {
|
|
|
42353
42453
|
tokenKinds: [],
|
|
42354
42454
|
expiresAtMs: null,
|
|
42355
42455
|
expiresInSeconds: null,
|
|
42456
|
+
requiresSmoke: true,
|
|
42356
42457
|
detail: "Codex CLI auth file has no access_token or id_token JWT expiry to verify."
|
|
42357
42458
|
};
|
|
42358
42459
|
}
|
|
@@ -42368,6 +42469,7 @@ function inspectCodexAuthForBridgeUpdate(opts = {}) {
|
|
|
42368
42469
|
tokenKinds,
|
|
42369
42470
|
expiresAtMs: earliest.expMs,
|
|
42370
42471
|
expiresInSeconds,
|
|
42472
|
+
requiresSmoke: true,
|
|
42371
42473
|
detail: `Codex CLI ${earliest.kind} JWT is expired.`
|
|
42372
42474
|
};
|
|
42373
42475
|
}
|
|
@@ -42381,6 +42483,7 @@ function inspectCodexAuthForBridgeUpdate(opts = {}) {
|
|
|
42381
42483
|
tokenKinds,
|
|
42382
42484
|
expiresAtMs: earliest.expMs,
|
|
42383
42485
|
expiresInSeconds,
|
|
42486
|
+
requiresSmoke: true,
|
|
42384
42487
|
detail: `Codex CLI ${earliest.kind} JWT expires too soon for a bridge update restart.`
|
|
42385
42488
|
};
|
|
42386
42489
|
}
|
|
@@ -42393,6 +42496,7 @@ function inspectCodexAuthForBridgeUpdate(opts = {}) {
|
|
|
42393
42496
|
tokenKinds,
|
|
42394
42497
|
expiresAtMs: earliest.expMs,
|
|
42395
42498
|
expiresInSeconds,
|
|
42499
|
+
requiresSmoke: false,
|
|
42396
42500
|
detail: "Codex CLI JWT expiry is far enough in the future for a bridge update restart."
|
|
42397
42501
|
};
|
|
42398
42502
|
}
|
|
@@ -42406,7 +42510,7 @@ function resolveBinPath(opts) {
|
|
|
42406
42510
|
}
|
|
42407
42511
|
const whichSync = opts.whichSync ?? ((name) => {
|
|
42408
42512
|
try {
|
|
42409
|
-
return (0,
|
|
42513
|
+
return (0, import_node_child_process8.execFileSync)("which", [name], { encoding: "utf8", timeout: 3e3 }).trim() || null;
|
|
42410
42514
|
} catch {
|
|
42411
42515
|
return null;
|
|
42412
42516
|
}
|
|
@@ -42468,6 +42572,7 @@ function startSelfUpdate(deps) {
|
|
|
42468
42572
|
const codexAuthPreflight = deps.codexAuthPreflight ?? (() => inspectCodexAuthForBridgeUpdate({
|
|
42469
42573
|
nowMs: nowFn()
|
|
42470
42574
|
}));
|
|
42575
|
+
const codexAuthSmoke = deps.codexAuthSmoke ?? (() => runCodexAuthRefreshSmokeForBridgeUpdate());
|
|
42471
42576
|
const disabled = isDisabled();
|
|
42472
42577
|
let drainOnQuiet = false;
|
|
42473
42578
|
let drainSource = null;
|
|
@@ -42475,44 +42580,71 @@ function startSelfUpdate(deps) {
|
|
|
42475
42580
|
let latestVersion = null;
|
|
42476
42581
|
let lastUpdateMentionAt = null;
|
|
42477
42582
|
let lastAuthBlockMentionAt = null;
|
|
42478
|
-
function blockedAuthOffer(auth2) {
|
|
42583
|
+
function blockedAuthOffer(auth2, smoke) {
|
|
42479
42584
|
const expires = auth2.expiresInSeconds === null ? "unknown" : `${auth2.expiresInSeconds}s`;
|
|
42480
42585
|
return `${SELF_UPDATE_AUTH_PREFLIGHT_OFFER_PREFIX} An update for @mrrlin-dev/mcp is available: ${pkgVersion} -> ${latestVersion}.
|
|
42481
42586
|
|
|
42482
|
-
Do NOT install it yet. The local Codex CLI
|
|
42587
|
+
Do NOT install it yet. The bridge already tried to verify the local Codex CLI by running a headless smoke command, which gives Codex a chance to refresh an expired access token with its stored refresh token. That smoke did not pass, so the restarted bridge may not be able to authenticate.
|
|
42588
|
+
|
|
42589
|
+
Static auth read:
|
|
42483
42590
|
- status: ${auth2.status}
|
|
42484
42591
|
- auth file: ${auth2.authPath}
|
|
42485
42592
|
- nearest JWT expiry: ${expires}
|
|
42486
42593
|
- detail: ${auth2.detail}
|
|
42487
42594
|
|
|
42488
|
-
|
|
42595
|
+
Smoke check:
|
|
42596
|
+
- status: ${smoke.status}
|
|
42597
|
+
- command: ${smoke.command}
|
|
42598
|
+
- detail: ${smoke.detail}
|
|
42489
42599
|
|
|
42490
|
-
|
|
42600
|
+
Tell the operator, in their language, that the bridge update is ready but the Codex CLI must pass the smoke check first because the update restarts the bridge and starts a fresh headless Codex process.
|
|
42491
42601
|
|
|
42492
|
-
|
|
42493
|
-
\`codex exec --model gpt-5.4-mini 'Reply with exactly: OK'\`
|
|
42602
|
+
If the smoke failed with an authentication or token-refresh error, ask the operator to run \`codex login\` as the re-auth action only. Do not present \`codex login\` as a readiness check; it opens the login flow even when auth is already fine.
|
|
42494
42603
|
|
|
42495
|
-
|
|
42604
|
+
If the smoke failed for another reason, ask the operator to fix that Codex CLI error first instead of logging in blindly.
|
|
42605
|
+
|
|
42606
|
+
The readiness check is the smoke command returning OK. Once it does, they can ask again and you may offer the normal update command \`npm install -g @mrrlin-dev/mcp@latest\`.`;
|
|
42496
42607
|
}
|
|
42497
42608
|
function maybeUpdateOffer() {
|
|
42498
42609
|
if (disabled) return null;
|
|
42499
42610
|
if (latestVersion === null) return null;
|
|
42500
42611
|
if (!import_semver3.default.gt(latestVersion, pkgVersion)) return null;
|
|
42612
|
+
if (lastUpdateMentionAt !== null && nowFn() - lastUpdateMentionAt < cooldownMs) return null;
|
|
42501
42613
|
const auth2 = codexAuthPreflight();
|
|
42502
42614
|
if (!auth2.ok) {
|
|
42503
|
-
|
|
42504
|
-
|
|
42505
|
-
|
|
42506
|
-
|
|
42507
|
-
|
|
42508
|
-
|
|
42509
|
-
|
|
42510
|
-
|
|
42511
|
-
|
|
42512
|
-
|
|
42513
|
-
|
|
42615
|
+
const smoke = auth2.requiresSmoke ? codexAuthSmoke() : null;
|
|
42616
|
+
if (smoke?.ok) {
|
|
42617
|
+
log("info", "bridge.self_update.auth_preflight_smoke_passed", {
|
|
42618
|
+
version: pkgVersion,
|
|
42619
|
+
latestVersion,
|
|
42620
|
+
status: auth2.status,
|
|
42621
|
+
authPath: auth2.authPath,
|
|
42622
|
+
expiresInSeconds: auth2.expiresInSeconds,
|
|
42623
|
+
minTtlSeconds: auth2.minTtlSeconds
|
|
42624
|
+
});
|
|
42625
|
+
} else {
|
|
42626
|
+
if (lastAuthBlockMentionAt !== null && nowFn() - lastAuthBlockMentionAt < authBlockCooldownMs) return null;
|
|
42627
|
+
lastAuthBlockMentionAt = nowFn();
|
|
42628
|
+
log("warn", "bridge.self_update.auth_preflight_blocked", {
|
|
42629
|
+
version: pkgVersion,
|
|
42630
|
+
latestVersion,
|
|
42631
|
+
status: auth2.status,
|
|
42632
|
+
authPath: auth2.authPath,
|
|
42633
|
+
expiresInSeconds: auth2.expiresInSeconds,
|
|
42634
|
+
minTtlSeconds: auth2.minTtlSeconds,
|
|
42635
|
+
smokeStatus: smoke?.status ?? null,
|
|
42636
|
+
smokeAuthLikely: smoke?.authLikely ?? null
|
|
42637
|
+
});
|
|
42638
|
+
return blockedAuthOffer(auth2, smoke ?? {
|
|
42639
|
+
ok: false,
|
|
42640
|
+
status: "failed",
|
|
42641
|
+
command: codexAuthRefreshSmokeCommandForBridgeUpdate(),
|
|
42642
|
+
timeoutMs: 0,
|
|
42643
|
+
authLikely: true,
|
|
42644
|
+
detail: "Codex CLI smoke was not available."
|
|
42645
|
+
});
|
|
42646
|
+
}
|
|
42514
42647
|
}
|
|
42515
|
-
if (lastUpdateMentionAt !== null && nowFn() - lastUpdateMentionAt < cooldownMs) return null;
|
|
42516
42648
|
lastUpdateMentionAt = nowFn();
|
|
42517
42649
|
log("info", "bridge.self_update.hint_injected", {
|
|
42518
42650
|
version: pkgVersion,
|
|
@@ -42709,7 +42841,7 @@ Do NOT derail the current task - if the operator has an in-flight question, answ
|
|
|
42709
42841
|
}
|
|
42710
42842
|
|
|
42711
42843
|
// src/_generated/version.ts
|
|
42712
|
-
var PKG_VERSION = "0.4.
|
|
42844
|
+
var PKG_VERSION = "0.4.62";
|
|
42713
42845
|
|
|
42714
42846
|
// src/api-base-url-migrate.ts
|
|
42715
42847
|
var import_node_fs5 = __toESM(require("node:fs"), 1);
|
|
@@ -44682,7 +44814,7 @@ function sterileCwd() {
|
|
|
44682
44814
|
}
|
|
44683
44815
|
|
|
44684
44816
|
// src/consensus/code-gate-git.ts
|
|
44685
|
-
var
|
|
44817
|
+
var import_node_child_process9 = require("node:child_process");
|
|
44686
44818
|
var DIFF_MAX_BYTES = 2e5;
|
|
44687
44819
|
var FASTGATE_OUTPUT_MAX_BYTES = 16e3;
|
|
44688
44820
|
var GIT_TIMEOUT_MS = 6e4;
|
|
@@ -44698,7 +44830,7 @@ var defaultRunCmd = (cmd, args, opts) => new Promise((resolve) => {
|
|
|
44698
44830
|
};
|
|
44699
44831
|
let child;
|
|
44700
44832
|
try {
|
|
44701
|
-
child = (0,
|
|
44833
|
+
child = (0, import_node_child_process9.spawn)(cmd, args, {
|
|
44702
44834
|
cwd: opts.cwd,
|
|
44703
44835
|
env: process.env,
|
|
44704
44836
|
shell: false,
|
|
@@ -45903,7 +46035,7 @@ async function collectAgentPoolSnapshot(deps) {
|
|
|
45903
46035
|
}
|
|
45904
46036
|
|
|
45905
46037
|
// src/external-agents-spawn.ts
|
|
45906
|
-
var
|
|
46038
|
+
var import_node_child_process10 = require("node:child_process");
|
|
45907
46039
|
|
|
45908
46040
|
// src/external-agents-bin.ts
|
|
45909
46041
|
function resolveExternalAgentsCliInvocation(override) {
|
|
@@ -45949,7 +46081,7 @@ function runExternalAgentsCli(args, opts) {
|
|
|
45949
46081
|
};
|
|
45950
46082
|
let spawned;
|
|
45951
46083
|
try {
|
|
45952
|
-
spawned = (0,
|
|
46084
|
+
spawned = (0, import_node_child_process10.spawn)(command, [...prefixArgs, ...args], { stdio: stdioConfig });
|
|
45953
46085
|
} catch {
|
|
45954
46086
|
done(1);
|
|
45955
46087
|
return;
|
|
@@ -46061,14 +46193,14 @@ function startAgentPoolLoop(deps) {
|
|
|
46061
46193
|
}
|
|
46062
46194
|
|
|
46063
46195
|
// src/provider-readiness-loop.ts
|
|
46064
|
-
var
|
|
46196
|
+
var import_node_child_process11 = require("node:child_process");
|
|
46065
46197
|
var DEFAULT_INTERVAL_MS3 = 6e4;
|
|
46066
46198
|
function providerReadinessLoopDisabled(env = process.env) {
|
|
46067
46199
|
return env["MRRLIN_BRIDGE_PROVIDER_READINESS_DISABLE"] === "1";
|
|
46068
46200
|
}
|
|
46069
46201
|
function defaultRunnerFor(command) {
|
|
46070
46202
|
return (args) => {
|
|
46071
|
-
const r = (0,
|
|
46203
|
+
const r = (0, import_node_child_process11.spawnSync)(command, args, { encoding: "utf8", timeout: 8e3 });
|
|
46072
46204
|
return { status: r.status, stdout: r.stdout ?? "", stderr: r.stderr ?? "" };
|
|
46073
46205
|
};
|
|
46074
46206
|
}
|
|
@@ -46119,7 +46251,7 @@ function setSelectedProvider(value) {
|
|
|
46119
46251
|
}
|
|
46120
46252
|
|
|
46121
46253
|
// src/execution-consumer.ts
|
|
46122
|
-
var
|
|
46254
|
+
var import_node_child_process13 = require("node:child_process");
|
|
46123
46255
|
var import_node_crypto7 = __toESM(require("node:crypto"), 1);
|
|
46124
46256
|
var import_node_path20 = __toESM(require("node:path"), 1);
|
|
46125
46257
|
var import_node_util = require("node:util");
|
|
@@ -47416,7 +47548,7 @@ async function awaitTurnWithDeadline(opts) {
|
|
|
47416
47548
|
}
|
|
47417
47549
|
|
|
47418
47550
|
// src/worktree.ts
|
|
47419
|
-
var
|
|
47551
|
+
var import_node_child_process12 = require("node:child_process");
|
|
47420
47552
|
var import_node_fs12 = require("node:fs");
|
|
47421
47553
|
var import_node_os9 = require("node:os");
|
|
47422
47554
|
var import_node_path19 = require("node:path");
|
|
@@ -47444,9 +47576,9 @@ async function withCheckoutLock(locksDir, slug, fn) {
|
|
|
47444
47576
|
function worktreeBranch(runId) {
|
|
47445
47577
|
return `mrrlin/run-${runId}`;
|
|
47446
47578
|
}
|
|
47447
|
-
var defaultGitExec = (args, env) => (0,
|
|
47579
|
+
var defaultGitExec = (args, env) => (0, import_node_child_process12.execFileSync)("git", args, { encoding: "utf8", timeout: 3e4, env });
|
|
47448
47580
|
function git(checkout, args) {
|
|
47449
|
-
return (0,
|
|
47581
|
+
return (0, import_node_child_process12.execFileSync)("git", ["-C", checkout, ...args], {
|
|
47450
47582
|
encoding: "utf8",
|
|
47451
47583
|
timeout: 3e4,
|
|
47452
47584
|
env: { ...process.env, GIT_TERMINAL_PROMPT: "0" }
|
|
@@ -48094,7 +48226,7 @@ var BLAST_RADIUS_FLOOR_PATTERNS = [/^supabase\/migrations\//, /^packages\/db\/sr
|
|
|
48094
48226
|
function isBlastRadiusFloorPath(path25) {
|
|
48095
48227
|
return BLAST_RADIUS_FLOOR_PATTERNS.some((re) => re.test(path25));
|
|
48096
48228
|
}
|
|
48097
|
-
var execFileAsync = (0, import_node_util.promisify)(
|
|
48229
|
+
var execFileAsync = (0, import_node_util.promisify)(import_node_child_process13.execFile);
|
|
48098
48230
|
async function defaultListRunDiffPaths(opts) {
|
|
48099
48231
|
const parse6 = (stdout) => stdout.split("\n").map((line) => line.trim()).filter((line) => line.length > 0);
|
|
48100
48232
|
try {
|
|
@@ -54763,7 +54895,7 @@ var CheckoutRegistry = class {
|
|
|
54763
54895
|
};
|
|
54764
54896
|
|
|
54765
54897
|
// src/checkout-handlers.ts
|
|
54766
|
-
var
|
|
54898
|
+
var import_node_child_process14 = require("node:child_process");
|
|
54767
54899
|
var import_node_fs19 = require("node:fs");
|
|
54768
54900
|
|
|
54769
54901
|
// src/git-remote-match.ts
|
|
@@ -54809,7 +54941,7 @@ function validateCheckoutPath(checkoutPath, repo) {
|
|
|
54809
54941
|
}
|
|
54810
54942
|
let remoteUrl;
|
|
54811
54943
|
try {
|
|
54812
|
-
remoteUrl = (0,
|
|
54944
|
+
remoteUrl = (0, import_node_child_process14.execFileSync)("git", ["-C", resolvedPath, "remote", "get-url", "origin"], {
|
|
54813
54945
|
encoding: "utf8",
|
|
54814
54946
|
stdio: ["ignore", "pipe", "ignore"],
|
|
54815
54947
|
timeout: 15e3,
|
|
@@ -54860,11 +54992,11 @@ function checkoutStateData(projectSlug, entry, machineLabel) {
|
|
|
54860
54992
|
}
|
|
54861
54993
|
|
|
54862
54994
|
// src/executor-server.ts
|
|
54863
|
-
var
|
|
54995
|
+
var import_node_child_process15 = require("node:child_process");
|
|
54864
54996
|
function defaultReadinessRunner(provider) {
|
|
54865
54997
|
const command = provider === "claude" ? "claude" : "codex";
|
|
54866
54998
|
return (args) => {
|
|
54867
|
-
const r = (0,
|
|
54999
|
+
const r = (0, import_node_child_process15.spawnSync)(command, args, { encoding: "utf8", timeout: 8e3, shell: true });
|
|
54868
55000
|
return { status: r.status, stdout: r.stdout ?? "", stderr: r.stderr ?? "" };
|
|
54869
55001
|
};
|
|
54870
55002
|
}
|
|
@@ -56286,7 +56418,7 @@ function resolveDefaultBranch(checkoutPath) {
|
|
|
56286
56418
|
if (!checkoutPath) return "main";
|
|
56287
56419
|
const runGit = (args) => {
|
|
56288
56420
|
try {
|
|
56289
|
-
return (0,
|
|
56421
|
+
return (0, import_node_child_process16.execFileSync)("git", ["-C", checkoutPath, ...args], {
|
|
56290
56422
|
encoding: "utf8",
|
|
56291
56423
|
stdio: ["ignore", "pipe", "ignore"],
|
|
56292
56424
|
timeout: 15e3,
|
|
@@ -57756,7 +57888,7 @@ function parseConfig() {
|
|
|
57756
57888
|
}
|
|
57757
57889
|
function scanForOtherBridges() {
|
|
57758
57890
|
try {
|
|
57759
|
-
const result = (0,
|
|
57891
|
+
const result = (0, import_node_child_process16.spawnSync)("pgrep", ["-f", "mrrlin-mcp director-bridge"], {
|
|
57760
57892
|
encoding: "utf8"
|
|
57761
57893
|
});
|
|
57762
57894
|
if (result.status !== 0) return [];
|
|
@@ -62447,10 +62579,10 @@ async function runCodeGate(_target, deps) {
|
|
|
62447
62579
|
}
|
|
62448
62580
|
|
|
62449
62581
|
// src/consensus/multi-llm-head.ts
|
|
62450
|
-
var
|
|
62582
|
+
var import_node_child_process18 = require("node:child_process");
|
|
62451
62583
|
|
|
62452
62584
|
// src/consensus/provider-limits.ts
|
|
62453
|
-
var
|
|
62585
|
+
var import_node_child_process17 = require("node:child_process");
|
|
62454
62586
|
var DEFAULT_STATUS_TIMEOUT_MS = 1e4;
|
|
62455
62587
|
function errMessage4(err) {
|
|
62456
62588
|
return err instanceof Error ? err.message : String(err);
|
|
@@ -62492,7 +62624,7 @@ function runExternalAgentsStatus(bin, args, timeoutMs, spawn4) {
|
|
|
62492
62624
|
});
|
|
62493
62625
|
}
|
|
62494
62626
|
async function fetchRegistrySnapshot(deps) {
|
|
62495
|
-
const spawn4 = deps?.spawn ??
|
|
62627
|
+
const spawn4 = deps?.spawn ?? import_node_child_process17.spawn;
|
|
62496
62628
|
const { command, prefixArgs } = resolveExternalAgentsCliInvocation(deps?.externalAgentsBin);
|
|
62497
62629
|
const { stdout, error: error51 } = await runExternalAgentsStatus(
|
|
62498
62630
|
command,
|
|
@@ -62580,7 +62712,7 @@ function runExternalAgents(bin, args, label, timeoutMs, spawn4) {
|
|
|
62580
62712
|
});
|
|
62581
62713
|
}
|
|
62582
62714
|
async function pickPanel(input, deps) {
|
|
62583
|
-
const spawn4 = deps?.spawn ??
|
|
62715
|
+
const spawn4 = deps?.spawn ?? import_node_child_process18.spawn;
|
|
62584
62716
|
const { command, prefixArgs } = resolveExternalAgentsCliInvocation(deps?.externalAgentsBin);
|
|
62585
62717
|
const args = [
|
|
62586
62718
|
"pick",
|
|
@@ -62627,7 +62759,7 @@ function parseDispatch(agentId, stdout, exitCode) {
|
|
|
62627
62759
|
return { ok: true, text: parsed.text, usage };
|
|
62628
62760
|
}
|
|
62629
62761
|
async function dispatchHead(agentId, prompt, timeoutMs, deps) {
|
|
62630
|
-
const spawn4 = deps?.spawn ??
|
|
62762
|
+
const spawn4 = deps?.spawn ?? import_node_child_process18.spawn;
|
|
62631
62763
|
const { command, prefixArgs } = resolveExternalAgentsCliInvocation(deps?.externalAgentsBin);
|
|
62632
62764
|
const args = ["dispatch", agentId, "--json", prompt];
|
|
62633
62765
|
const r = await runExternalAgents(command, [...prefixArgs, ...args], "dispatch", timeoutMs, spawn4);
|
|
@@ -69151,13 +69283,13 @@ Missing required flag(s): ${missing.join(
|
|
|
69151
69283
|
|
|
69152
69284
|
// src/bin.ts
|
|
69153
69285
|
function pm2Runner(args) {
|
|
69154
|
-
const r = (0,
|
|
69286
|
+
const r = (0, import_node_child_process19.spawnSync)("pm2", args, { encoding: "utf8" });
|
|
69155
69287
|
process.stderr.write(r.stdout ?? "");
|
|
69156
69288
|
process.stderr.write(r.stderr ?? "");
|
|
69157
69289
|
return { code: r.status ?? 1, stdout: r.stdout ?? "" };
|
|
69158
69290
|
}
|
|
69159
69291
|
function whichBin(bin) {
|
|
69160
|
-
const r = (0,
|
|
69292
|
+
const r = (0, import_node_child_process19.spawnSync)("which", [bin], { encoding: "utf8" });
|
|
69161
69293
|
const out = (r.stdout ?? "").trim();
|
|
69162
69294
|
return r.status === 0 && out ? out.split("\n")[0] ?? null : null;
|
|
69163
69295
|
}
|
|
@@ -69172,7 +69304,7 @@ function bootHookStatus() {
|
|
|
69172
69304
|
{ label: "com.PM2", plist: import_node_path38.default.join(agents, `pm2.${(0, import_node_os19.userInfo)().username}.plist`) }
|
|
69173
69305
|
];
|
|
69174
69306
|
for (const candidate of candidates) {
|
|
69175
|
-
const printed = (0,
|
|
69307
|
+
const printed = (0, import_node_child_process19.spawnSync)("launchctl", ["print", `gui/${uid}/${candidate.label}`], { encoding: "utf8" });
|
|
69176
69308
|
if (printed.status !== 0) continue;
|
|
69177
69309
|
if (!(0, import_node_fs24.existsSync)(candidate.plist)) continue;
|
|
69178
69310
|
const out = printed.stdout ?? "";
|
|
@@ -69394,7 +69526,7 @@ async function main() {
|
|
|
69394
69526
|
);
|
|
69395
69527
|
}
|
|
69396
69528
|
const { command: command2, args, env } = browserServeArgs();
|
|
69397
|
-
const r = (0,
|
|
69529
|
+
const r = (0, import_node_child_process19.spawnSync)(command2, args, { stdio: "inherit", env: { ...process.env, ...env } });
|
|
69398
69530
|
process.exitCode = r.status ?? 1;
|
|
69399
69531
|
return;
|
|
69400
69532
|
}
|
|
@@ -69405,7 +69537,7 @@ async function main() {
|
|
|
69405
69537
|
}
|
|
69406
69538
|
case "external-agents-serve": {
|
|
69407
69539
|
const { command: command2, args } = externalAgentsServeArgs();
|
|
69408
|
-
const r = (0,
|
|
69540
|
+
const r = (0, import_node_child_process19.spawnSync)(command2, args, { stdio: "inherit", env: process.env });
|
|
69409
69541
|
process.exitCode = r.status ?? 1;
|
|
69410
69542
|
return;
|
|
69411
69543
|
}
|
|
@@ -69473,7 +69605,7 @@ async function main() {
|
|
|
69473
69605
|
);
|
|
69474
69606
|
}
|
|
69475
69607
|
const realProviderRunner = (command2) => (args) => {
|
|
69476
|
-
const r = (0,
|
|
69608
|
+
const r = (0, import_node_child_process19.spawnSync)(command2, args, { encoding: "utf8", timeout: 8e3 });
|
|
69477
69609
|
return { status: r.status, stdout: r.stdout ?? "", stderr: r.stderr ?? "" };
|
|
69478
69610
|
};
|
|
69479
69611
|
for (const provider of ["codex", "claude"]) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrrlin-dev/mcp",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.62",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"mrrlin-mcp": "dist/bin.cjs"
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"@mrrlin/client": "0.0.0",
|
|
25
25
|
"@mrrlin/agent-client": "0.0.0",
|
|
26
26
|
"@mrrlin/director-e2e": "0.0.0",
|
|
27
|
-
"@mrrlin/schemas": "0.0.0",
|
|
28
27
|
"@mrrlin/tsconfig": "0.0.0",
|
|
28
|
+
"@mrrlin/schemas": "0.0.0",
|
|
29
29
|
"@mrrlin/wiki": "0.0.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|