@mrrlin-dev/mcp 0.4.61 → 0.4.63
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 +187 -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.63";
|
|
42713
42845
|
|
|
42714
42846
|
// src/api-base-url-migrate.ts
|
|
42715
42847
|
var import_node_fs5 = __toESM(require("node:fs"), 1);
|
|
@@ -42743,6 +42875,8 @@ function renderEcosystemConfig(opts) {
|
|
|
42743
42875
|
if (telemetryProject) env.MRRLIN_TELEMETRY_DEFAULT_PROJECT = telemetryProject;
|
|
42744
42876
|
if (opts.user) env.USER = opts.user;
|
|
42745
42877
|
if (opts.codexHome) env.CODEX_HOME = opts.codexHome;
|
|
42878
|
+
const claudeConfigDir = opts.claudeConfigDir?.trim();
|
|
42879
|
+
if (claudeConfigDir) env.CLAUDE_CONFIG_DIR = claudeConfigDir;
|
|
42746
42880
|
const apiBaseUrl = opts.apiBaseUrl ? retargetRetiredApiBaseUrl(opts.apiBaseUrl).baseUrl : void 0;
|
|
42747
42881
|
if (apiBaseUrl && !isProductionApiBaseUrl(apiBaseUrl)) {
|
|
42748
42882
|
env.MRRLIN_API_BASE_URL = apiBaseUrl;
|
|
@@ -44682,7 +44816,7 @@ function sterileCwd() {
|
|
|
44682
44816
|
}
|
|
44683
44817
|
|
|
44684
44818
|
// src/consensus/code-gate-git.ts
|
|
44685
|
-
var
|
|
44819
|
+
var import_node_child_process9 = require("node:child_process");
|
|
44686
44820
|
var DIFF_MAX_BYTES = 2e5;
|
|
44687
44821
|
var FASTGATE_OUTPUT_MAX_BYTES = 16e3;
|
|
44688
44822
|
var GIT_TIMEOUT_MS = 6e4;
|
|
@@ -44698,7 +44832,7 @@ var defaultRunCmd = (cmd, args, opts) => new Promise((resolve) => {
|
|
|
44698
44832
|
};
|
|
44699
44833
|
let child;
|
|
44700
44834
|
try {
|
|
44701
|
-
child = (0,
|
|
44835
|
+
child = (0, import_node_child_process9.spawn)(cmd, args, {
|
|
44702
44836
|
cwd: opts.cwd,
|
|
44703
44837
|
env: process.env,
|
|
44704
44838
|
shell: false,
|
|
@@ -45903,7 +46037,7 @@ async function collectAgentPoolSnapshot(deps) {
|
|
|
45903
46037
|
}
|
|
45904
46038
|
|
|
45905
46039
|
// src/external-agents-spawn.ts
|
|
45906
|
-
var
|
|
46040
|
+
var import_node_child_process10 = require("node:child_process");
|
|
45907
46041
|
|
|
45908
46042
|
// src/external-agents-bin.ts
|
|
45909
46043
|
function resolveExternalAgentsCliInvocation(override) {
|
|
@@ -45949,7 +46083,7 @@ function runExternalAgentsCli(args, opts) {
|
|
|
45949
46083
|
};
|
|
45950
46084
|
let spawned;
|
|
45951
46085
|
try {
|
|
45952
|
-
spawned = (0,
|
|
46086
|
+
spawned = (0, import_node_child_process10.spawn)(command, [...prefixArgs, ...args], { stdio: stdioConfig });
|
|
45953
46087
|
} catch {
|
|
45954
46088
|
done(1);
|
|
45955
46089
|
return;
|
|
@@ -46061,14 +46195,14 @@ function startAgentPoolLoop(deps) {
|
|
|
46061
46195
|
}
|
|
46062
46196
|
|
|
46063
46197
|
// src/provider-readiness-loop.ts
|
|
46064
|
-
var
|
|
46198
|
+
var import_node_child_process11 = require("node:child_process");
|
|
46065
46199
|
var DEFAULT_INTERVAL_MS3 = 6e4;
|
|
46066
46200
|
function providerReadinessLoopDisabled(env = process.env) {
|
|
46067
46201
|
return env["MRRLIN_BRIDGE_PROVIDER_READINESS_DISABLE"] === "1";
|
|
46068
46202
|
}
|
|
46069
46203
|
function defaultRunnerFor(command) {
|
|
46070
46204
|
return (args) => {
|
|
46071
|
-
const r = (0,
|
|
46205
|
+
const r = (0, import_node_child_process11.spawnSync)(command, args, { encoding: "utf8", timeout: 8e3 });
|
|
46072
46206
|
return { status: r.status, stdout: r.stdout ?? "", stderr: r.stderr ?? "" };
|
|
46073
46207
|
};
|
|
46074
46208
|
}
|
|
@@ -46119,7 +46253,7 @@ function setSelectedProvider(value) {
|
|
|
46119
46253
|
}
|
|
46120
46254
|
|
|
46121
46255
|
// src/execution-consumer.ts
|
|
46122
|
-
var
|
|
46256
|
+
var import_node_child_process13 = require("node:child_process");
|
|
46123
46257
|
var import_node_crypto7 = __toESM(require("node:crypto"), 1);
|
|
46124
46258
|
var import_node_path20 = __toESM(require("node:path"), 1);
|
|
46125
46259
|
var import_node_util = require("node:util");
|
|
@@ -47416,7 +47550,7 @@ async function awaitTurnWithDeadline(opts) {
|
|
|
47416
47550
|
}
|
|
47417
47551
|
|
|
47418
47552
|
// src/worktree.ts
|
|
47419
|
-
var
|
|
47553
|
+
var import_node_child_process12 = require("node:child_process");
|
|
47420
47554
|
var import_node_fs12 = require("node:fs");
|
|
47421
47555
|
var import_node_os9 = require("node:os");
|
|
47422
47556
|
var import_node_path19 = require("node:path");
|
|
@@ -47444,9 +47578,9 @@ async function withCheckoutLock(locksDir, slug, fn) {
|
|
|
47444
47578
|
function worktreeBranch(runId) {
|
|
47445
47579
|
return `mrrlin/run-${runId}`;
|
|
47446
47580
|
}
|
|
47447
|
-
var defaultGitExec = (args, env) => (0,
|
|
47581
|
+
var defaultGitExec = (args, env) => (0, import_node_child_process12.execFileSync)("git", args, { encoding: "utf8", timeout: 3e4, env });
|
|
47448
47582
|
function git(checkout, args) {
|
|
47449
|
-
return (0,
|
|
47583
|
+
return (0, import_node_child_process12.execFileSync)("git", ["-C", checkout, ...args], {
|
|
47450
47584
|
encoding: "utf8",
|
|
47451
47585
|
timeout: 3e4,
|
|
47452
47586
|
env: { ...process.env, GIT_TERMINAL_PROMPT: "0" }
|
|
@@ -48094,7 +48228,7 @@ var BLAST_RADIUS_FLOOR_PATTERNS = [/^supabase\/migrations\//, /^packages\/db\/sr
|
|
|
48094
48228
|
function isBlastRadiusFloorPath(path25) {
|
|
48095
48229
|
return BLAST_RADIUS_FLOOR_PATTERNS.some((re) => re.test(path25));
|
|
48096
48230
|
}
|
|
48097
|
-
var execFileAsync = (0, import_node_util.promisify)(
|
|
48231
|
+
var execFileAsync = (0, import_node_util.promisify)(import_node_child_process13.execFile);
|
|
48098
48232
|
async function defaultListRunDiffPaths(opts) {
|
|
48099
48233
|
const parse6 = (stdout) => stdout.split("\n").map((line) => line.trim()).filter((line) => line.length > 0);
|
|
48100
48234
|
try {
|
|
@@ -54763,7 +54897,7 @@ var CheckoutRegistry = class {
|
|
|
54763
54897
|
};
|
|
54764
54898
|
|
|
54765
54899
|
// src/checkout-handlers.ts
|
|
54766
|
-
var
|
|
54900
|
+
var import_node_child_process14 = require("node:child_process");
|
|
54767
54901
|
var import_node_fs19 = require("node:fs");
|
|
54768
54902
|
|
|
54769
54903
|
// src/git-remote-match.ts
|
|
@@ -54809,7 +54943,7 @@ function validateCheckoutPath(checkoutPath, repo) {
|
|
|
54809
54943
|
}
|
|
54810
54944
|
let remoteUrl;
|
|
54811
54945
|
try {
|
|
54812
|
-
remoteUrl = (0,
|
|
54946
|
+
remoteUrl = (0, import_node_child_process14.execFileSync)("git", ["-C", resolvedPath, "remote", "get-url", "origin"], {
|
|
54813
54947
|
encoding: "utf8",
|
|
54814
54948
|
stdio: ["ignore", "pipe", "ignore"],
|
|
54815
54949
|
timeout: 15e3,
|
|
@@ -54860,11 +54994,11 @@ function checkoutStateData(projectSlug, entry, machineLabel) {
|
|
|
54860
54994
|
}
|
|
54861
54995
|
|
|
54862
54996
|
// src/executor-server.ts
|
|
54863
|
-
var
|
|
54997
|
+
var import_node_child_process15 = require("node:child_process");
|
|
54864
54998
|
function defaultReadinessRunner(provider) {
|
|
54865
54999
|
const command = provider === "claude" ? "claude" : "codex";
|
|
54866
55000
|
return (args) => {
|
|
54867
|
-
const r = (0,
|
|
55001
|
+
const r = (0, import_node_child_process15.spawnSync)(command, args, { encoding: "utf8", timeout: 8e3, shell: true });
|
|
54868
55002
|
return { status: r.status, stdout: r.stdout ?? "", stderr: r.stderr ?? "" };
|
|
54869
55003
|
};
|
|
54870
55004
|
}
|
|
@@ -56286,7 +56420,7 @@ function resolveDefaultBranch(checkoutPath) {
|
|
|
56286
56420
|
if (!checkoutPath) return "main";
|
|
56287
56421
|
const runGit = (args) => {
|
|
56288
56422
|
try {
|
|
56289
|
-
return (0,
|
|
56423
|
+
return (0, import_node_child_process16.execFileSync)("git", ["-C", checkoutPath, ...args], {
|
|
56290
56424
|
encoding: "utf8",
|
|
56291
56425
|
stdio: ["ignore", "pipe", "ignore"],
|
|
56292
56426
|
timeout: 15e3,
|
|
@@ -57756,7 +57890,7 @@ function parseConfig() {
|
|
|
57756
57890
|
}
|
|
57757
57891
|
function scanForOtherBridges() {
|
|
57758
57892
|
try {
|
|
57759
|
-
const result = (0,
|
|
57893
|
+
const result = (0, import_node_child_process16.spawnSync)("pgrep", ["-f", "mrrlin-mcp director-bridge"], {
|
|
57760
57894
|
encoding: "utf8"
|
|
57761
57895
|
});
|
|
57762
57896
|
if (result.status !== 0) return [];
|
|
@@ -62447,10 +62581,10 @@ async function runCodeGate(_target, deps) {
|
|
|
62447
62581
|
}
|
|
62448
62582
|
|
|
62449
62583
|
// src/consensus/multi-llm-head.ts
|
|
62450
|
-
var
|
|
62584
|
+
var import_node_child_process18 = require("node:child_process");
|
|
62451
62585
|
|
|
62452
62586
|
// src/consensus/provider-limits.ts
|
|
62453
|
-
var
|
|
62587
|
+
var import_node_child_process17 = require("node:child_process");
|
|
62454
62588
|
var DEFAULT_STATUS_TIMEOUT_MS = 1e4;
|
|
62455
62589
|
function errMessage4(err) {
|
|
62456
62590
|
return err instanceof Error ? err.message : String(err);
|
|
@@ -62492,7 +62626,7 @@ function runExternalAgentsStatus(bin, args, timeoutMs, spawn4) {
|
|
|
62492
62626
|
});
|
|
62493
62627
|
}
|
|
62494
62628
|
async function fetchRegistrySnapshot(deps) {
|
|
62495
|
-
const spawn4 = deps?.spawn ??
|
|
62629
|
+
const spawn4 = deps?.spawn ?? import_node_child_process17.spawn;
|
|
62496
62630
|
const { command, prefixArgs } = resolveExternalAgentsCliInvocation(deps?.externalAgentsBin);
|
|
62497
62631
|
const { stdout, error: error51 } = await runExternalAgentsStatus(
|
|
62498
62632
|
command,
|
|
@@ -62580,7 +62714,7 @@ function runExternalAgents(bin, args, label, timeoutMs, spawn4) {
|
|
|
62580
62714
|
});
|
|
62581
62715
|
}
|
|
62582
62716
|
async function pickPanel(input, deps) {
|
|
62583
|
-
const spawn4 = deps?.spawn ??
|
|
62717
|
+
const spawn4 = deps?.spawn ?? import_node_child_process18.spawn;
|
|
62584
62718
|
const { command, prefixArgs } = resolveExternalAgentsCliInvocation(deps?.externalAgentsBin);
|
|
62585
62719
|
const args = [
|
|
62586
62720
|
"pick",
|
|
@@ -62627,7 +62761,7 @@ function parseDispatch(agentId, stdout, exitCode) {
|
|
|
62627
62761
|
return { ok: true, text: parsed.text, usage };
|
|
62628
62762
|
}
|
|
62629
62763
|
async function dispatchHead(agentId, prompt, timeoutMs, deps) {
|
|
62630
|
-
const spawn4 = deps?.spawn ??
|
|
62764
|
+
const spawn4 = deps?.spawn ?? import_node_child_process18.spawn;
|
|
62631
62765
|
const { command, prefixArgs } = resolveExternalAgentsCliInvocation(deps?.externalAgentsBin);
|
|
62632
62766
|
const args = ["dispatch", agentId, "--json", prompt];
|
|
62633
62767
|
const r = await runExternalAgents(command, [...prefixArgs, ...args], "dispatch", timeoutMs, spawn4);
|
|
@@ -68904,6 +69038,7 @@ function installService(deps) {
|
|
|
68904
69038
|
home,
|
|
68905
69039
|
user,
|
|
68906
69040
|
codexHome: deps.env.CODEX_HOME?.trim() || void 0,
|
|
69041
|
+
claudeConfigDir: deps.env.CLAUDE_CONFIG_DIR?.trim() || void 0,
|
|
68907
69042
|
pathEnv,
|
|
68908
69043
|
apiBaseUrl: apiTarget.apiBaseUrl,
|
|
68909
69044
|
apiAllowRemote: apiTarget.apiAllowRemote,
|
|
@@ -69151,13 +69286,13 @@ Missing required flag(s): ${missing.join(
|
|
|
69151
69286
|
|
|
69152
69287
|
// src/bin.ts
|
|
69153
69288
|
function pm2Runner(args) {
|
|
69154
|
-
const r = (0,
|
|
69289
|
+
const r = (0, import_node_child_process19.spawnSync)("pm2", args, { encoding: "utf8" });
|
|
69155
69290
|
process.stderr.write(r.stdout ?? "");
|
|
69156
69291
|
process.stderr.write(r.stderr ?? "");
|
|
69157
69292
|
return { code: r.status ?? 1, stdout: r.stdout ?? "" };
|
|
69158
69293
|
}
|
|
69159
69294
|
function whichBin(bin) {
|
|
69160
|
-
const r = (0,
|
|
69295
|
+
const r = (0, import_node_child_process19.spawnSync)("which", [bin], { encoding: "utf8" });
|
|
69161
69296
|
const out = (r.stdout ?? "").trim();
|
|
69162
69297
|
return r.status === 0 && out ? out.split("\n")[0] ?? null : null;
|
|
69163
69298
|
}
|
|
@@ -69172,7 +69307,7 @@ function bootHookStatus() {
|
|
|
69172
69307
|
{ label: "com.PM2", plist: import_node_path38.default.join(agents, `pm2.${(0, import_node_os19.userInfo)().username}.plist`) }
|
|
69173
69308
|
];
|
|
69174
69309
|
for (const candidate of candidates) {
|
|
69175
|
-
const printed = (0,
|
|
69310
|
+
const printed = (0, import_node_child_process19.spawnSync)("launchctl", ["print", `gui/${uid}/${candidate.label}`], { encoding: "utf8" });
|
|
69176
69311
|
if (printed.status !== 0) continue;
|
|
69177
69312
|
if (!(0, import_node_fs24.existsSync)(candidate.plist)) continue;
|
|
69178
69313
|
const out = printed.stdout ?? "";
|
|
@@ -69394,7 +69529,7 @@ async function main() {
|
|
|
69394
69529
|
);
|
|
69395
69530
|
}
|
|
69396
69531
|
const { command: command2, args, env } = browserServeArgs();
|
|
69397
|
-
const r = (0,
|
|
69532
|
+
const r = (0, import_node_child_process19.spawnSync)(command2, args, { stdio: "inherit", env: { ...process.env, ...env } });
|
|
69398
69533
|
process.exitCode = r.status ?? 1;
|
|
69399
69534
|
return;
|
|
69400
69535
|
}
|
|
@@ -69405,7 +69540,7 @@ async function main() {
|
|
|
69405
69540
|
}
|
|
69406
69541
|
case "external-agents-serve": {
|
|
69407
69542
|
const { command: command2, args } = externalAgentsServeArgs();
|
|
69408
|
-
const r = (0,
|
|
69543
|
+
const r = (0, import_node_child_process19.spawnSync)(command2, args, { stdio: "inherit", env: process.env });
|
|
69409
69544
|
process.exitCode = r.status ?? 1;
|
|
69410
69545
|
return;
|
|
69411
69546
|
}
|
|
@@ -69473,7 +69608,7 @@ async function main() {
|
|
|
69473
69608
|
);
|
|
69474
69609
|
}
|
|
69475
69610
|
const realProviderRunner = (command2) => (args) => {
|
|
69476
|
-
const r = (0,
|
|
69611
|
+
const r = (0, import_node_child_process19.spawnSync)(command2, args, { encoding: "utf8", timeout: 8e3 });
|
|
69477
69612
|
return { status: r.status, stdout: r.stdout ?? "", stderr: r.stderr ?? "" };
|
|
69478
69613
|
};
|
|
69479
69614
|
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.63",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"mrrlin-mcp": "dist/bin.cjs"
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"esbuild": "^0.24.0",
|
|
23
23
|
"tsx": "^4.22.3",
|
|
24
24
|
"@mrrlin/client": "0.0.0",
|
|
25
|
-
"@mrrlin/agent-client": "0.0.0",
|
|
26
25
|
"@mrrlin/director-e2e": "0.0.0",
|
|
26
|
+
"@mrrlin/agent-client": "0.0.0",
|
|
27
27
|
"@mrrlin/schemas": "0.0.0",
|
|
28
28
|
"@mrrlin/tsconfig": "0.0.0",
|
|
29
29
|
"@mrrlin/wiki": "0.0.0"
|