@mrrlin-dev/mcp 0.4.60 → 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 +185 -55
- 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);
|
|
@@ -20669,9 +20669,7 @@ var RETIRED_API_BASE_URLS = {
|
|
|
20669
20669
|
"mrrlin-api-fnnzzz-fnnzzzs-projects.vercel.app": STAGING_API_BASE_URL,
|
|
20670
20670
|
// Retired 2026-08-14 when staging decoupled onto the stable custom domain api-staging.mrrlin.com.
|
|
20671
20671
|
// A persisted operator configuration may still pin the mrrlin3 Vercel alias; retarget it in one hop.
|
|
20672
|
-
"mrrlin-api-mrrlin3.vercel.app": STAGING_API_BASE_URL
|
|
20673
|
-
// Retired 2026-09-07 when production moved from the transitional api-prod host to api.mrrlin.com.
|
|
20674
|
-
"api-prod.mrrlin.com": PRODUCTION_API_BASE_URL
|
|
20672
|
+
"mrrlin-api-mrrlin3.vercel.app": STAGING_API_BASE_URL
|
|
20675
20673
|
};
|
|
20676
20674
|
function isSameApiHost(a, b) {
|
|
20677
20675
|
const origin = (value) => {
|
|
@@ -21640,7 +21638,7 @@ var import_node_fs22 = __toESM(require("node:fs"), 1);
|
|
|
21640
21638
|
var import_node_http = __toESM(require("node:http"), 1);
|
|
21641
21639
|
var import_node_os15 = __toESM(require("node:os"), 1);
|
|
21642
21640
|
var import_node_path30 = __toESM(require("node:path"), 1);
|
|
21643
|
-
var
|
|
21641
|
+
var import_node_child_process16 = require("node:child_process");
|
|
21644
21642
|
var import_node_crypto11 = __toESM(require("node:crypto"), 1);
|
|
21645
21643
|
|
|
21646
21644
|
// src/turn-replay-buffer.ts
|
|
@@ -42258,17 +42256,21 @@ function createTurnLock() {
|
|
|
42258
42256
|
}
|
|
42259
42257
|
|
|
42260
42258
|
// src/self-update.ts
|
|
42261
|
-
var
|
|
42259
|
+
var import_node_child_process8 = require("node:child_process");
|
|
42262
42260
|
var import_node_crypto2 = require("node:crypto");
|
|
42263
42261
|
var import_node_fs4 = require("node:fs");
|
|
42264
42262
|
var import_node_path7 = __toESM(require("node:path"), 1);
|
|
42265
42263
|
var import_semver3 = __toESM(require_semver2(), 1);
|
|
42266
42264
|
|
|
42267
42265
|
// src/codex-auth-preflight.ts
|
|
42266
|
+
var import_node_child_process7 = require("node:child_process");
|
|
42268
42267
|
var import_node_fs3 = require("node:fs");
|
|
42269
42268
|
var import_node_os6 = __toESM(require("node:os"), 1);
|
|
42270
42269
|
var import_node_path6 = __toESM(require("node:path"), 1);
|
|
42271
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";
|
|
42272
42274
|
function positiveInt(raw) {
|
|
42273
42275
|
if (!raw) return null;
|
|
42274
42276
|
const parsed = Number.parseInt(raw, 10);
|
|
@@ -42277,6 +42279,9 @@ function positiveInt(raw) {
|
|
|
42277
42279
|
function codexAuthMinTtlSeconds(env = process.env) {
|
|
42278
42280
|
return positiveInt(env.MRRLIN_DIRECTOR_BRIDGE_UPDATE_AUTH_MIN_TTL_SECONDS) ?? DEFAULT_CODEX_AUTH_MIN_TTL_SECONDS;
|
|
42279
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
|
+
}
|
|
42280
42285
|
function resolveCodexAuthPath(opts = {}) {
|
|
42281
42286
|
const env = opts.env ?? process.env;
|
|
42282
42287
|
const codexHome = env.CODEX_HOME?.trim();
|
|
@@ -42292,6 +42297,97 @@ function decodeJwtExpMs(token) {
|
|
|
42292
42297
|
return null;
|
|
42293
42298
|
}
|
|
42294
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
|
+
}
|
|
42295
42391
|
function inspectCodexAuthForBridgeUpdate(opts = {}) {
|
|
42296
42392
|
const env = opts.env ?? process.env;
|
|
42297
42393
|
const nowMs = opts.nowMs ?? Date.now();
|
|
@@ -42313,6 +42409,7 @@ function inspectCodexAuthForBridgeUpdate(opts = {}) {
|
|
|
42313
42409
|
tokenKinds: [],
|
|
42314
42410
|
expiresAtMs: null,
|
|
42315
42411
|
expiresInSeconds: null,
|
|
42412
|
+
requiresSmoke: true,
|
|
42316
42413
|
detail: status === "missing" ? "Codex CLI auth file is missing." : "Codex CLI auth file could not be read."
|
|
42317
42414
|
};
|
|
42318
42415
|
}
|
|
@@ -42329,6 +42426,7 @@ function inspectCodexAuthForBridgeUpdate(opts = {}) {
|
|
|
42329
42426
|
tokenKinds: [],
|
|
42330
42427
|
expiresAtMs: null,
|
|
42331
42428
|
expiresInSeconds: null,
|
|
42429
|
+
requiresSmoke: true,
|
|
42332
42430
|
detail: "Codex CLI auth file is not valid JSON."
|
|
42333
42431
|
};
|
|
42334
42432
|
}
|
|
@@ -42355,6 +42453,7 @@ function inspectCodexAuthForBridgeUpdate(opts = {}) {
|
|
|
42355
42453
|
tokenKinds: [],
|
|
42356
42454
|
expiresAtMs: null,
|
|
42357
42455
|
expiresInSeconds: null,
|
|
42456
|
+
requiresSmoke: true,
|
|
42358
42457
|
detail: "Codex CLI auth file has no access_token or id_token JWT expiry to verify."
|
|
42359
42458
|
};
|
|
42360
42459
|
}
|
|
@@ -42370,6 +42469,7 @@ function inspectCodexAuthForBridgeUpdate(opts = {}) {
|
|
|
42370
42469
|
tokenKinds,
|
|
42371
42470
|
expiresAtMs: earliest.expMs,
|
|
42372
42471
|
expiresInSeconds,
|
|
42472
|
+
requiresSmoke: true,
|
|
42373
42473
|
detail: `Codex CLI ${earliest.kind} JWT is expired.`
|
|
42374
42474
|
};
|
|
42375
42475
|
}
|
|
@@ -42383,6 +42483,7 @@ function inspectCodexAuthForBridgeUpdate(opts = {}) {
|
|
|
42383
42483
|
tokenKinds,
|
|
42384
42484
|
expiresAtMs: earliest.expMs,
|
|
42385
42485
|
expiresInSeconds,
|
|
42486
|
+
requiresSmoke: true,
|
|
42386
42487
|
detail: `Codex CLI ${earliest.kind} JWT expires too soon for a bridge update restart.`
|
|
42387
42488
|
};
|
|
42388
42489
|
}
|
|
@@ -42395,6 +42496,7 @@ function inspectCodexAuthForBridgeUpdate(opts = {}) {
|
|
|
42395
42496
|
tokenKinds,
|
|
42396
42497
|
expiresAtMs: earliest.expMs,
|
|
42397
42498
|
expiresInSeconds,
|
|
42499
|
+
requiresSmoke: false,
|
|
42398
42500
|
detail: "Codex CLI JWT expiry is far enough in the future for a bridge update restart."
|
|
42399
42501
|
};
|
|
42400
42502
|
}
|
|
@@ -42408,7 +42510,7 @@ function resolveBinPath(opts) {
|
|
|
42408
42510
|
}
|
|
42409
42511
|
const whichSync = opts.whichSync ?? ((name) => {
|
|
42410
42512
|
try {
|
|
42411
|
-
return (0,
|
|
42513
|
+
return (0, import_node_child_process8.execFileSync)("which", [name], { encoding: "utf8", timeout: 3e3 }).trim() || null;
|
|
42412
42514
|
} catch {
|
|
42413
42515
|
return null;
|
|
42414
42516
|
}
|
|
@@ -42470,6 +42572,7 @@ function startSelfUpdate(deps) {
|
|
|
42470
42572
|
const codexAuthPreflight = deps.codexAuthPreflight ?? (() => inspectCodexAuthForBridgeUpdate({
|
|
42471
42573
|
nowMs: nowFn()
|
|
42472
42574
|
}));
|
|
42575
|
+
const codexAuthSmoke = deps.codexAuthSmoke ?? (() => runCodexAuthRefreshSmokeForBridgeUpdate());
|
|
42473
42576
|
const disabled = isDisabled();
|
|
42474
42577
|
let drainOnQuiet = false;
|
|
42475
42578
|
let drainSource = null;
|
|
@@ -42477,44 +42580,71 @@ function startSelfUpdate(deps) {
|
|
|
42477
42580
|
let latestVersion = null;
|
|
42478
42581
|
let lastUpdateMentionAt = null;
|
|
42479
42582
|
let lastAuthBlockMentionAt = null;
|
|
42480
|
-
function blockedAuthOffer(auth2) {
|
|
42583
|
+
function blockedAuthOffer(auth2, smoke) {
|
|
42481
42584
|
const expires = auth2.expiresInSeconds === null ? "unknown" : `${auth2.expiresInSeconds}s`;
|
|
42482
42585
|
return `${SELF_UPDATE_AUTH_PREFLIGHT_OFFER_PREFIX} An update for @mrrlin-dev/mcp is available: ${pkgVersion} -> ${latestVersion}.
|
|
42483
42586
|
|
|
42484
|
-
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:
|
|
42485
42590
|
- status: ${auth2.status}
|
|
42486
42591
|
- auth file: ${auth2.authPath}
|
|
42487
42592
|
- nearest JWT expiry: ${expires}
|
|
42488
42593
|
- detail: ${auth2.detail}
|
|
42489
42594
|
|
|
42490
|
-
|
|
42595
|
+
Smoke check:
|
|
42596
|
+
- status: ${smoke.status}
|
|
42597
|
+
- command: ${smoke.command}
|
|
42598
|
+
- detail: ${smoke.detail}
|
|
42491
42599
|
|
|
42492
|
-
|
|
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.
|
|
42493
42601
|
|
|
42494
|
-
|
|
42495
|
-
\`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.
|
|
42496
42603
|
|
|
42497
|
-
|
|
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\`.`;
|
|
42498
42607
|
}
|
|
42499
42608
|
function maybeUpdateOffer() {
|
|
42500
42609
|
if (disabled) return null;
|
|
42501
42610
|
if (latestVersion === null) return null;
|
|
42502
42611
|
if (!import_semver3.default.gt(latestVersion, pkgVersion)) return null;
|
|
42612
|
+
if (lastUpdateMentionAt !== null && nowFn() - lastUpdateMentionAt < cooldownMs) return null;
|
|
42503
42613
|
const auth2 = codexAuthPreflight();
|
|
42504
42614
|
if (!auth2.ok) {
|
|
42505
|
-
|
|
42506
|
-
|
|
42507
|
-
|
|
42508
|
-
|
|
42509
|
-
|
|
42510
|
-
|
|
42511
|
-
|
|
42512
|
-
|
|
42513
|
-
|
|
42514
|
-
|
|
42515
|
-
|
|
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
|
+
}
|
|
42516
42647
|
}
|
|
42517
|
-
if (lastUpdateMentionAt !== null && nowFn() - lastUpdateMentionAt < cooldownMs) return null;
|
|
42518
42648
|
lastUpdateMentionAt = nowFn();
|
|
42519
42649
|
log("info", "bridge.self_update.hint_injected", {
|
|
42520
42650
|
version: pkgVersion,
|
|
@@ -42711,7 +42841,7 @@ Do NOT derail the current task - if the operator has an in-flight question, answ
|
|
|
42711
42841
|
}
|
|
42712
42842
|
|
|
42713
42843
|
// src/_generated/version.ts
|
|
42714
|
-
var PKG_VERSION = "0.4.
|
|
42844
|
+
var PKG_VERSION = "0.4.62";
|
|
42715
42845
|
|
|
42716
42846
|
// src/api-base-url-migrate.ts
|
|
42717
42847
|
var import_node_fs5 = __toESM(require("node:fs"), 1);
|
|
@@ -44684,7 +44814,7 @@ function sterileCwd() {
|
|
|
44684
44814
|
}
|
|
44685
44815
|
|
|
44686
44816
|
// src/consensus/code-gate-git.ts
|
|
44687
|
-
var
|
|
44817
|
+
var import_node_child_process9 = require("node:child_process");
|
|
44688
44818
|
var DIFF_MAX_BYTES = 2e5;
|
|
44689
44819
|
var FASTGATE_OUTPUT_MAX_BYTES = 16e3;
|
|
44690
44820
|
var GIT_TIMEOUT_MS = 6e4;
|
|
@@ -44700,7 +44830,7 @@ var defaultRunCmd = (cmd, args, opts) => new Promise((resolve) => {
|
|
|
44700
44830
|
};
|
|
44701
44831
|
let child;
|
|
44702
44832
|
try {
|
|
44703
|
-
child = (0,
|
|
44833
|
+
child = (0, import_node_child_process9.spawn)(cmd, args, {
|
|
44704
44834
|
cwd: opts.cwd,
|
|
44705
44835
|
env: process.env,
|
|
44706
44836
|
shell: false,
|
|
@@ -45905,7 +46035,7 @@ async function collectAgentPoolSnapshot(deps) {
|
|
|
45905
46035
|
}
|
|
45906
46036
|
|
|
45907
46037
|
// src/external-agents-spawn.ts
|
|
45908
|
-
var
|
|
46038
|
+
var import_node_child_process10 = require("node:child_process");
|
|
45909
46039
|
|
|
45910
46040
|
// src/external-agents-bin.ts
|
|
45911
46041
|
function resolveExternalAgentsCliInvocation(override) {
|
|
@@ -45951,7 +46081,7 @@ function runExternalAgentsCli(args, opts) {
|
|
|
45951
46081
|
};
|
|
45952
46082
|
let spawned;
|
|
45953
46083
|
try {
|
|
45954
|
-
spawned = (0,
|
|
46084
|
+
spawned = (0, import_node_child_process10.spawn)(command, [...prefixArgs, ...args], { stdio: stdioConfig });
|
|
45955
46085
|
} catch {
|
|
45956
46086
|
done(1);
|
|
45957
46087
|
return;
|
|
@@ -46063,14 +46193,14 @@ function startAgentPoolLoop(deps) {
|
|
|
46063
46193
|
}
|
|
46064
46194
|
|
|
46065
46195
|
// src/provider-readiness-loop.ts
|
|
46066
|
-
var
|
|
46196
|
+
var import_node_child_process11 = require("node:child_process");
|
|
46067
46197
|
var DEFAULT_INTERVAL_MS3 = 6e4;
|
|
46068
46198
|
function providerReadinessLoopDisabled(env = process.env) {
|
|
46069
46199
|
return env["MRRLIN_BRIDGE_PROVIDER_READINESS_DISABLE"] === "1";
|
|
46070
46200
|
}
|
|
46071
46201
|
function defaultRunnerFor(command) {
|
|
46072
46202
|
return (args) => {
|
|
46073
|
-
const r = (0,
|
|
46203
|
+
const r = (0, import_node_child_process11.spawnSync)(command, args, { encoding: "utf8", timeout: 8e3 });
|
|
46074
46204
|
return { status: r.status, stdout: r.stdout ?? "", stderr: r.stderr ?? "" };
|
|
46075
46205
|
};
|
|
46076
46206
|
}
|
|
@@ -46121,7 +46251,7 @@ function setSelectedProvider(value) {
|
|
|
46121
46251
|
}
|
|
46122
46252
|
|
|
46123
46253
|
// src/execution-consumer.ts
|
|
46124
|
-
var
|
|
46254
|
+
var import_node_child_process13 = require("node:child_process");
|
|
46125
46255
|
var import_node_crypto7 = __toESM(require("node:crypto"), 1);
|
|
46126
46256
|
var import_node_path20 = __toESM(require("node:path"), 1);
|
|
46127
46257
|
var import_node_util = require("node:util");
|
|
@@ -47418,7 +47548,7 @@ async function awaitTurnWithDeadline(opts) {
|
|
|
47418
47548
|
}
|
|
47419
47549
|
|
|
47420
47550
|
// src/worktree.ts
|
|
47421
|
-
var
|
|
47551
|
+
var import_node_child_process12 = require("node:child_process");
|
|
47422
47552
|
var import_node_fs12 = require("node:fs");
|
|
47423
47553
|
var import_node_os9 = require("node:os");
|
|
47424
47554
|
var import_node_path19 = require("node:path");
|
|
@@ -47446,9 +47576,9 @@ async function withCheckoutLock(locksDir, slug, fn) {
|
|
|
47446
47576
|
function worktreeBranch(runId) {
|
|
47447
47577
|
return `mrrlin/run-${runId}`;
|
|
47448
47578
|
}
|
|
47449
|
-
var defaultGitExec = (args, env) => (0,
|
|
47579
|
+
var defaultGitExec = (args, env) => (0, import_node_child_process12.execFileSync)("git", args, { encoding: "utf8", timeout: 3e4, env });
|
|
47450
47580
|
function git(checkout, args) {
|
|
47451
|
-
return (0,
|
|
47581
|
+
return (0, import_node_child_process12.execFileSync)("git", ["-C", checkout, ...args], {
|
|
47452
47582
|
encoding: "utf8",
|
|
47453
47583
|
timeout: 3e4,
|
|
47454
47584
|
env: { ...process.env, GIT_TERMINAL_PROMPT: "0" }
|
|
@@ -48096,7 +48226,7 @@ var BLAST_RADIUS_FLOOR_PATTERNS = [/^supabase\/migrations\//, /^packages\/db\/sr
|
|
|
48096
48226
|
function isBlastRadiusFloorPath(path25) {
|
|
48097
48227
|
return BLAST_RADIUS_FLOOR_PATTERNS.some((re) => re.test(path25));
|
|
48098
48228
|
}
|
|
48099
|
-
var execFileAsync = (0, import_node_util.promisify)(
|
|
48229
|
+
var execFileAsync = (0, import_node_util.promisify)(import_node_child_process13.execFile);
|
|
48100
48230
|
async function defaultListRunDiffPaths(opts) {
|
|
48101
48231
|
const parse6 = (stdout) => stdout.split("\n").map((line) => line.trim()).filter((line) => line.length > 0);
|
|
48102
48232
|
try {
|
|
@@ -54765,7 +54895,7 @@ var CheckoutRegistry = class {
|
|
|
54765
54895
|
};
|
|
54766
54896
|
|
|
54767
54897
|
// src/checkout-handlers.ts
|
|
54768
|
-
var
|
|
54898
|
+
var import_node_child_process14 = require("node:child_process");
|
|
54769
54899
|
var import_node_fs19 = require("node:fs");
|
|
54770
54900
|
|
|
54771
54901
|
// src/git-remote-match.ts
|
|
@@ -54811,7 +54941,7 @@ function validateCheckoutPath(checkoutPath, repo) {
|
|
|
54811
54941
|
}
|
|
54812
54942
|
let remoteUrl;
|
|
54813
54943
|
try {
|
|
54814
|
-
remoteUrl = (0,
|
|
54944
|
+
remoteUrl = (0, import_node_child_process14.execFileSync)("git", ["-C", resolvedPath, "remote", "get-url", "origin"], {
|
|
54815
54945
|
encoding: "utf8",
|
|
54816
54946
|
stdio: ["ignore", "pipe", "ignore"],
|
|
54817
54947
|
timeout: 15e3,
|
|
@@ -54862,11 +54992,11 @@ function checkoutStateData(projectSlug, entry, machineLabel) {
|
|
|
54862
54992
|
}
|
|
54863
54993
|
|
|
54864
54994
|
// src/executor-server.ts
|
|
54865
|
-
var
|
|
54995
|
+
var import_node_child_process15 = require("node:child_process");
|
|
54866
54996
|
function defaultReadinessRunner(provider) {
|
|
54867
54997
|
const command = provider === "claude" ? "claude" : "codex";
|
|
54868
54998
|
return (args) => {
|
|
54869
|
-
const r = (0,
|
|
54999
|
+
const r = (0, import_node_child_process15.spawnSync)(command, args, { encoding: "utf8", timeout: 8e3, shell: true });
|
|
54870
55000
|
return { status: r.status, stdout: r.stdout ?? "", stderr: r.stderr ?? "" };
|
|
54871
55001
|
};
|
|
54872
55002
|
}
|
|
@@ -56288,7 +56418,7 @@ function resolveDefaultBranch(checkoutPath) {
|
|
|
56288
56418
|
if (!checkoutPath) return "main";
|
|
56289
56419
|
const runGit = (args) => {
|
|
56290
56420
|
try {
|
|
56291
|
-
return (0,
|
|
56421
|
+
return (0, import_node_child_process16.execFileSync)("git", ["-C", checkoutPath, ...args], {
|
|
56292
56422
|
encoding: "utf8",
|
|
56293
56423
|
stdio: ["ignore", "pipe", "ignore"],
|
|
56294
56424
|
timeout: 15e3,
|
|
@@ -57758,7 +57888,7 @@ function parseConfig() {
|
|
|
57758
57888
|
}
|
|
57759
57889
|
function scanForOtherBridges() {
|
|
57760
57890
|
try {
|
|
57761
|
-
const result = (0,
|
|
57891
|
+
const result = (0, import_node_child_process16.spawnSync)("pgrep", ["-f", "mrrlin-mcp director-bridge"], {
|
|
57762
57892
|
encoding: "utf8"
|
|
57763
57893
|
});
|
|
57764
57894
|
if (result.status !== 0) return [];
|
|
@@ -62449,10 +62579,10 @@ async function runCodeGate(_target, deps) {
|
|
|
62449
62579
|
}
|
|
62450
62580
|
|
|
62451
62581
|
// src/consensus/multi-llm-head.ts
|
|
62452
|
-
var
|
|
62582
|
+
var import_node_child_process18 = require("node:child_process");
|
|
62453
62583
|
|
|
62454
62584
|
// src/consensus/provider-limits.ts
|
|
62455
|
-
var
|
|
62585
|
+
var import_node_child_process17 = require("node:child_process");
|
|
62456
62586
|
var DEFAULT_STATUS_TIMEOUT_MS = 1e4;
|
|
62457
62587
|
function errMessage4(err) {
|
|
62458
62588
|
return err instanceof Error ? err.message : String(err);
|
|
@@ -62494,7 +62624,7 @@ function runExternalAgentsStatus(bin, args, timeoutMs, spawn4) {
|
|
|
62494
62624
|
});
|
|
62495
62625
|
}
|
|
62496
62626
|
async function fetchRegistrySnapshot(deps) {
|
|
62497
|
-
const spawn4 = deps?.spawn ??
|
|
62627
|
+
const spawn4 = deps?.spawn ?? import_node_child_process17.spawn;
|
|
62498
62628
|
const { command, prefixArgs } = resolveExternalAgentsCliInvocation(deps?.externalAgentsBin);
|
|
62499
62629
|
const { stdout, error: error51 } = await runExternalAgentsStatus(
|
|
62500
62630
|
command,
|
|
@@ -62582,7 +62712,7 @@ function runExternalAgents(bin, args, label, timeoutMs, spawn4) {
|
|
|
62582
62712
|
});
|
|
62583
62713
|
}
|
|
62584
62714
|
async function pickPanel(input, deps) {
|
|
62585
|
-
const spawn4 = deps?.spawn ??
|
|
62715
|
+
const spawn4 = deps?.spawn ?? import_node_child_process18.spawn;
|
|
62586
62716
|
const { command, prefixArgs } = resolveExternalAgentsCliInvocation(deps?.externalAgentsBin);
|
|
62587
62717
|
const args = [
|
|
62588
62718
|
"pick",
|
|
@@ -62629,7 +62759,7 @@ function parseDispatch(agentId, stdout, exitCode) {
|
|
|
62629
62759
|
return { ok: true, text: parsed.text, usage };
|
|
62630
62760
|
}
|
|
62631
62761
|
async function dispatchHead(agentId, prompt, timeoutMs, deps) {
|
|
62632
|
-
const spawn4 = deps?.spawn ??
|
|
62762
|
+
const spawn4 = deps?.spawn ?? import_node_child_process18.spawn;
|
|
62633
62763
|
const { command, prefixArgs } = resolveExternalAgentsCliInvocation(deps?.externalAgentsBin);
|
|
62634
62764
|
const args = ["dispatch", agentId, "--json", prompt];
|
|
62635
62765
|
const r = await runExternalAgents(command, [...prefixArgs, ...args], "dispatch", timeoutMs, spawn4);
|
|
@@ -69153,13 +69283,13 @@ Missing required flag(s): ${missing.join(
|
|
|
69153
69283
|
|
|
69154
69284
|
// src/bin.ts
|
|
69155
69285
|
function pm2Runner(args) {
|
|
69156
|
-
const r = (0,
|
|
69286
|
+
const r = (0, import_node_child_process19.spawnSync)("pm2", args, { encoding: "utf8" });
|
|
69157
69287
|
process.stderr.write(r.stdout ?? "");
|
|
69158
69288
|
process.stderr.write(r.stderr ?? "");
|
|
69159
69289
|
return { code: r.status ?? 1, stdout: r.stdout ?? "" };
|
|
69160
69290
|
}
|
|
69161
69291
|
function whichBin(bin) {
|
|
69162
|
-
const r = (0,
|
|
69292
|
+
const r = (0, import_node_child_process19.spawnSync)("which", [bin], { encoding: "utf8" });
|
|
69163
69293
|
const out = (r.stdout ?? "").trim();
|
|
69164
69294
|
return r.status === 0 && out ? out.split("\n")[0] ?? null : null;
|
|
69165
69295
|
}
|
|
@@ -69174,7 +69304,7 @@ function bootHookStatus() {
|
|
|
69174
69304
|
{ label: "com.PM2", plist: import_node_path38.default.join(agents, `pm2.${(0, import_node_os19.userInfo)().username}.plist`) }
|
|
69175
69305
|
];
|
|
69176
69306
|
for (const candidate of candidates) {
|
|
69177
|
-
const printed = (0,
|
|
69307
|
+
const printed = (0, import_node_child_process19.spawnSync)("launchctl", ["print", `gui/${uid}/${candidate.label}`], { encoding: "utf8" });
|
|
69178
69308
|
if (printed.status !== 0) continue;
|
|
69179
69309
|
if (!(0, import_node_fs24.existsSync)(candidate.plist)) continue;
|
|
69180
69310
|
const out = printed.stdout ?? "";
|
|
@@ -69396,7 +69526,7 @@ async function main() {
|
|
|
69396
69526
|
);
|
|
69397
69527
|
}
|
|
69398
69528
|
const { command: command2, args, env } = browserServeArgs();
|
|
69399
|
-
const r = (0,
|
|
69529
|
+
const r = (0, import_node_child_process19.spawnSync)(command2, args, { stdio: "inherit", env: { ...process.env, ...env } });
|
|
69400
69530
|
process.exitCode = r.status ?? 1;
|
|
69401
69531
|
return;
|
|
69402
69532
|
}
|
|
@@ -69407,7 +69537,7 @@ async function main() {
|
|
|
69407
69537
|
}
|
|
69408
69538
|
case "external-agents-serve": {
|
|
69409
69539
|
const { command: command2, args } = externalAgentsServeArgs();
|
|
69410
|
-
const r = (0,
|
|
69540
|
+
const r = (0, import_node_child_process19.spawnSync)(command2, args, { stdio: "inherit", env: process.env });
|
|
69411
69541
|
process.exitCode = r.status ?? 1;
|
|
69412
69542
|
return;
|
|
69413
69543
|
}
|
|
@@ -69475,7 +69605,7 @@ async function main() {
|
|
|
69475
69605
|
);
|
|
69476
69606
|
}
|
|
69477
69607
|
const realProviderRunner = (command2) => (args) => {
|
|
69478
|
-
const r = (0,
|
|
69608
|
+
const r = (0, import_node_child_process19.spawnSync)(command2, args, { encoding: "utf8", timeout: 8e3 });
|
|
69479
69609
|
return { status: r.status, stdout: r.stdout ?? "", stderr: r.stderr ?? "" };
|
|
69480
69610
|
};
|
|
69481
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": {
|