@mrrlin-dev/mcp 0.4.99 → 0.4.100
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 +192 -49
- package/package.json +1 -1
package/dist/bin.cjs
CHANGED
|
@@ -9776,7 +9776,7 @@ var require_cross_spawn = __commonJS({
|
|
|
9776
9776
|
var cp = require("child_process");
|
|
9777
9777
|
var parse8 = require_parse2();
|
|
9778
9778
|
var enoent = require_enoent();
|
|
9779
|
-
function
|
|
9779
|
+
function spawn7(command, args, options) {
|
|
9780
9780
|
const parsed = parse8(command, args, options);
|
|
9781
9781
|
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
9782
9782
|
enoent.hookChildProcess(spawned, parsed);
|
|
@@ -9788,8 +9788,8 @@ var require_cross_spawn = __commonJS({
|
|
|
9788
9788
|
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
9789
9789
|
return result;
|
|
9790
9790
|
}
|
|
9791
|
-
module2.exports =
|
|
9792
|
-
module2.exports.spawn =
|
|
9791
|
+
module2.exports = spawn7;
|
|
9792
|
+
module2.exports.spawn = spawn7;
|
|
9793
9793
|
module2.exports.sync = spawnSync7;
|
|
9794
9794
|
module2.exports._parse = parse8;
|
|
9795
9795
|
module2.exports._enoent = enoent;
|
|
@@ -21662,7 +21662,7 @@ __export(bin_exports, {
|
|
|
21662
21662
|
});
|
|
21663
21663
|
module.exports = __toCommonJS(bin_exports);
|
|
21664
21664
|
var import_node_path42 = __toESM(require("node:path"), 1);
|
|
21665
|
-
var
|
|
21665
|
+
var import_node_child_process23 = require("node:child_process");
|
|
21666
21666
|
var import_node_fs25 = require("node:fs");
|
|
21667
21667
|
var import_node_os20 = require("node:os");
|
|
21668
21668
|
var import_node_path43 = __toESM(require("node:path"), 1);
|
|
@@ -44765,7 +44765,7 @@ function firstString(...values) {
|
|
|
44765
44765
|
return null;
|
|
44766
44766
|
}
|
|
44767
44767
|
function runCodexExec(input, deps) {
|
|
44768
|
-
const
|
|
44768
|
+
const spawn7 = deps?.spawn ?? import_node_child_process6.spawn;
|
|
44769
44769
|
const executable = input.codexExecutable ?? "codex";
|
|
44770
44770
|
const sandbox = input.sandbox ?? "read-only";
|
|
44771
44771
|
const fullPrompt = input.developerInstructions.trim() ? `${input.developerInstructions.trim()}
|
|
@@ -44811,7 +44811,7 @@ ${input.prompt}` : input.prompt;
|
|
|
44811
44811
|
}
|
|
44812
44812
|
let child;
|
|
44813
44813
|
try {
|
|
44814
|
-
child =
|
|
44814
|
+
child = spawn7(spawnCmd, spawnArgs, options);
|
|
44815
44815
|
} catch (err) {
|
|
44816
44816
|
finish({ ok: false, error: `Failed to spawn codex exec: ${errMessage(err)}` });
|
|
44817
44817
|
return;
|
|
@@ -44854,7 +44854,7 @@ function errMessage(err) {
|
|
|
44854
44854
|
// ../../packages/agent-client/dist/providers/claude/exec.js
|
|
44855
44855
|
var import_node_child_process7 = require("node:child_process");
|
|
44856
44856
|
function runClaudeExec(input, deps) {
|
|
44857
|
-
const
|
|
44857
|
+
const spawn7 = deps?.spawn ?? import_node_child_process7.spawn;
|
|
44858
44858
|
const executable = input.codexExecutable ?? "claude";
|
|
44859
44859
|
const args = ["--print", "--output-format", "json", "--strict-mcp-config"];
|
|
44860
44860
|
if (input.mcpConfig) {
|
|
@@ -44898,7 +44898,7 @@ function runClaudeExec(input, deps) {
|
|
|
44898
44898
|
}
|
|
44899
44899
|
let child;
|
|
44900
44900
|
try {
|
|
44901
|
-
child =
|
|
44901
|
+
child = spawn7(spawnCmd, spawnArgs, options);
|
|
44902
44902
|
} catch (err) {
|
|
44903
44903
|
finish({ ok: false, error: `Failed to spawn ${executable} exec: ${errMessage2(err)}` });
|
|
44904
44904
|
return;
|
|
@@ -44966,7 +44966,7 @@ function errMessage2(err) {
|
|
|
44966
44966
|
// ../../packages/agent-client/dist/providers/agy/exec.js
|
|
44967
44967
|
var import_node_child_process8 = require("node:child_process");
|
|
44968
44968
|
function runAgyExec(input, deps) {
|
|
44969
|
-
const
|
|
44969
|
+
const spawn7 = deps?.spawn ?? import_node_child_process8.spawn;
|
|
44970
44970
|
const executable = input.codexExecutable ?? "agy";
|
|
44971
44971
|
const args = ["--output-format", "json"];
|
|
44972
44972
|
if (input.sandbox === "read-only") {
|
|
@@ -45019,7 +45019,7 @@ function runAgyExec(input, deps) {
|
|
|
45019
45019
|
}
|
|
45020
45020
|
let child;
|
|
45021
45021
|
try {
|
|
45022
|
-
child =
|
|
45022
|
+
child = spawn7(spawnCmd, spawnArgs, options);
|
|
45023
45023
|
} catch (err) {
|
|
45024
45024
|
finish({ ok: false, error: `Failed to spawn ${executable} exec: ${err instanceof Error ? err.message : String(err)}` });
|
|
45025
45025
|
return;
|
|
@@ -46267,7 +46267,7 @@ var DEFAULT_STATUS_TIMEOUT_MS = 1e4;
|
|
|
46267
46267
|
function errMessage3(err) {
|
|
46268
46268
|
return err instanceof Error ? err.message : String(err);
|
|
46269
46269
|
}
|
|
46270
|
-
function runExternalAgentsStatus(bin, args, timeoutMs,
|
|
46270
|
+
function runExternalAgentsStatus(bin, args, timeoutMs, spawn7) {
|
|
46271
46271
|
return new Promise((resolve2) => {
|
|
46272
46272
|
let settled = false;
|
|
46273
46273
|
const timerRef = { id: void 0 };
|
|
@@ -46280,7 +46280,7 @@ function runExternalAgentsStatus(bin, args, timeoutMs, spawn6) {
|
|
|
46280
46280
|
const options = { stdio: ["ignore", "pipe", "pipe"], env: process.env, shell: false };
|
|
46281
46281
|
let child;
|
|
46282
46282
|
try {
|
|
46283
|
-
child =
|
|
46283
|
+
child = spawn7(bin, args, options);
|
|
46284
46284
|
} catch (err) {
|
|
46285
46285
|
finish({ stdout: "", error: `spawn ${bin} failed: ${errMessage3(err)}` });
|
|
46286
46286
|
return;
|
|
@@ -46304,13 +46304,13 @@ function runExternalAgentsStatus(bin, args, timeoutMs, spawn6) {
|
|
|
46304
46304
|
});
|
|
46305
46305
|
}
|
|
46306
46306
|
async function fetchRegistrySnapshot(deps) {
|
|
46307
|
-
const
|
|
46307
|
+
const spawn7 = deps?.spawn ?? import_node_child_process10.spawn;
|
|
46308
46308
|
const { command, prefixArgs } = resolveExternalAgentsCliInvocation(deps?.externalAgentsBin);
|
|
46309
46309
|
const { stdout, error: error51 } = await runExternalAgentsStatus(
|
|
46310
46310
|
command,
|
|
46311
46311
|
[...prefixArgs, "status", "--json"],
|
|
46312
46312
|
deps?.statusTimeoutMs ?? DEFAULT_STATUS_TIMEOUT_MS,
|
|
46313
|
-
|
|
46313
|
+
spawn7
|
|
46314
46314
|
);
|
|
46315
46315
|
if (error51) return { ok: false, error: error51 };
|
|
46316
46316
|
try {
|
|
@@ -46354,7 +46354,7 @@ function estimateTokenCount(text) {
|
|
|
46354
46354
|
function errMessage4(err) {
|
|
46355
46355
|
return err instanceof Error ? err.message : String(err);
|
|
46356
46356
|
}
|
|
46357
|
-
function runExternalAgents(bin, args, label, timeoutMs,
|
|
46357
|
+
function runExternalAgents(bin, args, label, timeoutMs, spawn7) {
|
|
46358
46358
|
return new Promise((resolve2) => {
|
|
46359
46359
|
let settled = false;
|
|
46360
46360
|
const timerRef = { id: void 0 };
|
|
@@ -46372,7 +46372,7 @@ function runExternalAgents(bin, args, label, timeoutMs, spawn6) {
|
|
|
46372
46372
|
};
|
|
46373
46373
|
let child;
|
|
46374
46374
|
try {
|
|
46375
|
-
child =
|
|
46375
|
+
child = spawn7(bin, args, options);
|
|
46376
46376
|
} catch (err) {
|
|
46377
46377
|
finish({ code: null, stdout: "", error: `spawn ${bin} failed: ${errMessage4(err)}` });
|
|
46378
46378
|
return;
|
|
@@ -46392,7 +46392,7 @@ function runExternalAgents(bin, args, label, timeoutMs, spawn6) {
|
|
|
46392
46392
|
});
|
|
46393
46393
|
}
|
|
46394
46394
|
async function pickPanel(input, deps) {
|
|
46395
|
-
const
|
|
46395
|
+
const spawn7 = deps?.spawn ?? import_node_child_process11.spawn;
|
|
46396
46396
|
const { command, prefixArgs } = resolveExternalAgentsCliInvocation(deps?.externalAgentsBin);
|
|
46397
46397
|
const args = [
|
|
46398
46398
|
"pick",
|
|
@@ -46405,7 +46405,7 @@ async function pickPanel(input, deps) {
|
|
|
46405
46405
|
"--exclude-providers",
|
|
46406
46406
|
input.excludeProvider
|
|
46407
46407
|
];
|
|
46408
|
-
const r = await runExternalAgents(command, [...prefixArgs, ...args], "pick", input.timeoutMs,
|
|
46408
|
+
const r = await runExternalAgents(command, [...prefixArgs, ...args], "pick", input.timeoutMs, spawn7);
|
|
46409
46409
|
if (r.error) return { ok: false, error: r.error };
|
|
46410
46410
|
if (r.code === 3) return { ok: true, agents: [] };
|
|
46411
46411
|
if (r.code !== 0) return { ok: false, error: `external-agents pick exited ${r.code}` };
|
|
@@ -46439,10 +46439,10 @@ function parseDispatch(agentId, stdout, exitCode) {
|
|
|
46439
46439
|
return { ok: true, text: parsed.text, usage };
|
|
46440
46440
|
}
|
|
46441
46441
|
async function dispatchHead(agentId, prompt, timeoutMs, deps) {
|
|
46442
|
-
const
|
|
46442
|
+
const spawn7 = deps?.spawn ?? import_node_child_process11.spawn;
|
|
46443
46443
|
const { command, prefixArgs } = resolveExternalAgentsCliInvocation(deps?.externalAgentsBin);
|
|
46444
46444
|
const args = ["dispatch", agentId, "--json", prompt];
|
|
46445
|
-
const r = await runExternalAgents(command, [...prefixArgs, ...args], "dispatch", timeoutMs,
|
|
46445
|
+
const r = await runExternalAgents(command, [...prefixArgs, ...args], "dispatch", timeoutMs, spawn7);
|
|
46446
46446
|
if (r.error) return { ok: false, error: r.error };
|
|
46447
46447
|
return parseDispatch(agentId, r.stdout, r.code);
|
|
46448
46448
|
}
|
|
@@ -57769,12 +57769,155 @@ async function verifyProviderReadiness(provider, run3, opts = {}) {
|
|
|
57769
57769
|
return { ready, checks, details };
|
|
57770
57770
|
}
|
|
57771
57771
|
|
|
57772
|
+
// src/browser-interceptor.ts
|
|
57773
|
+
var import_node_readline = __toESM(require("node:readline"), 1);
|
|
57774
|
+
var import_node_child_process14 = require("node:child_process");
|
|
57775
|
+
var INTERNAL_HOST_PATTERNS = [
|
|
57776
|
+
/^(?:.*\.)?mrrlin\.(?:com|internal|local)$/i,
|
|
57777
|
+
/^(?:localhost|127\.0\.0\.1)(?::\d+)?$/i
|
|
57778
|
+
];
|
|
57779
|
+
var INTERNAL_ROUTE_PREFIXES = [
|
|
57780
|
+
"/wiki",
|
|
57781
|
+
"/deliverables",
|
|
57782
|
+
"/specs",
|
|
57783
|
+
"/items",
|
|
57784
|
+
"/memory",
|
|
57785
|
+
"/tasks",
|
|
57786
|
+
"/autopilot",
|
|
57787
|
+
"/settings"
|
|
57788
|
+
];
|
|
57789
|
+
function isInternalMrrlinUrl(urlString) {
|
|
57790
|
+
if (!urlString || typeof urlString !== "string") {
|
|
57791
|
+
return { isInternal: false };
|
|
57792
|
+
}
|
|
57793
|
+
const trimmed = urlString.trim();
|
|
57794
|
+
try {
|
|
57795
|
+
const isRelative = trimmed.startsWith("/");
|
|
57796
|
+
const parsedPathname = isRelative ? (trimmed.split("?")[0] ?? "").split("#")[0] ?? "" : "";
|
|
57797
|
+
const parsed = isRelative ? { pathname: parsedPathname, hostname: "localhost" } : new URL(trimmed);
|
|
57798
|
+
const isInternalHost = isRelative || INTERNAL_HOST_PATTERNS.some((p) => p.test(parsed.hostname));
|
|
57799
|
+
if (!isInternalHost) {
|
|
57800
|
+
return { isInternal: false };
|
|
57801
|
+
}
|
|
57802
|
+
const pathname = (parsed.pathname ?? "").toLowerCase();
|
|
57803
|
+
const matchedPrefix = INTERNAL_ROUTE_PREFIXES.find(
|
|
57804
|
+
(prefix) => pathname === prefix || pathname.startsWith(`${prefix}/`)
|
|
57805
|
+
);
|
|
57806
|
+
if (matchedPrefix) {
|
|
57807
|
+
let suggestedTool = "get_wiki_page / search_wiki_pages";
|
|
57808
|
+
if (matchedPrefix === "/items" || matchedPrefix === "/deliverables" || matchedPrefix === "/tasks") {
|
|
57809
|
+
suggestedTool = "get_task / list_tasks";
|
|
57810
|
+
} else if (matchedPrefix === "/autopilot") {
|
|
57811
|
+
suggestedTool = "list_inbox_items (filtering kind='handoff') / list_tasks";
|
|
57812
|
+
}
|
|
57813
|
+
return {
|
|
57814
|
+
isInternal: true,
|
|
57815
|
+
reason: `Route '${matchedPrefix}' belongs to internal Mrrlin domain/state.`,
|
|
57816
|
+
suggestedTool
|
|
57817
|
+
};
|
|
57818
|
+
}
|
|
57819
|
+
} catch {
|
|
57820
|
+
}
|
|
57821
|
+
return { isInternal: false };
|
|
57822
|
+
}
|
|
57823
|
+
function formatInternalRouteRejectionMessage(url2, suggestedTool) {
|
|
57824
|
+
return `[Preflight Guard] Refused to navigate browser to internal route "${url2}". Internal entities must be accessed via fast typed MCP tools directly against the database/API. Suggested tool: ${suggestedTool}. Do NOT open Chromium for internal data retrieval. If browser rendering is strictly required for visual UI testing, pass force_internal: true.`;
|
|
57825
|
+
}
|
|
57826
|
+
function interceptJsonRpcLine(rawLine) {
|
|
57827
|
+
const trimmed = rawLine.trim();
|
|
57828
|
+
if (!trimmed) return null;
|
|
57829
|
+
try {
|
|
57830
|
+
const msg = JSON.parse(trimmed);
|
|
57831
|
+
if (msg && msg.jsonrpc === "2.0" && msg.method === "tools/call" && msg.params?.name === "browser_navigate") {
|
|
57832
|
+
const args = msg.params.arguments;
|
|
57833
|
+
const url2 = typeof args?.url === "string" ? args.url : "";
|
|
57834
|
+
const forceInternal = Boolean(args?.force_internal);
|
|
57835
|
+
if (!forceInternal && url2) {
|
|
57836
|
+
const check2 = isInternalMrrlinUrl(url2);
|
|
57837
|
+
if (check2.isInternal) {
|
|
57838
|
+
const rejectionText = formatInternalRouteRejectionMessage(
|
|
57839
|
+
url2,
|
|
57840
|
+
check2.suggestedTool ?? "get_wiki_page / get_task"
|
|
57841
|
+
);
|
|
57842
|
+
return JSON.stringify({
|
|
57843
|
+
jsonrpc: "2.0",
|
|
57844
|
+
id: msg.id,
|
|
57845
|
+
result: {
|
|
57846
|
+
isError: true,
|
|
57847
|
+
content: [
|
|
57848
|
+
{
|
|
57849
|
+
type: "text",
|
|
57850
|
+
text: rejectionText
|
|
57851
|
+
}
|
|
57852
|
+
]
|
|
57853
|
+
}
|
|
57854
|
+
});
|
|
57855
|
+
}
|
|
57856
|
+
}
|
|
57857
|
+
}
|
|
57858
|
+
} catch {
|
|
57859
|
+
}
|
|
57860
|
+
return null;
|
|
57861
|
+
}
|
|
57862
|
+
function wireBrowserServeProxy(streams) {
|
|
57863
|
+
const { input, output: output3, childIn, childOut } = streams;
|
|
57864
|
+
const rl = import_node_readline.default.createInterface({
|
|
57865
|
+
input,
|
|
57866
|
+
crlfDelay: Infinity,
|
|
57867
|
+
terminal: false
|
|
57868
|
+
});
|
|
57869
|
+
rl.on("line", (line) => {
|
|
57870
|
+
const intercepted = interceptJsonRpcLine(line);
|
|
57871
|
+
if (intercepted) {
|
|
57872
|
+
output3.write(intercepted + "\n");
|
|
57873
|
+
} else {
|
|
57874
|
+
childIn.write(line + "\n");
|
|
57875
|
+
}
|
|
57876
|
+
});
|
|
57877
|
+
rl.on("close", () => {
|
|
57878
|
+
try {
|
|
57879
|
+
childIn.end();
|
|
57880
|
+
} catch {
|
|
57881
|
+
}
|
|
57882
|
+
});
|
|
57883
|
+
childOut.on("data", (chunk) => {
|
|
57884
|
+
output3.write(chunk);
|
|
57885
|
+
});
|
|
57886
|
+
}
|
|
57887
|
+
async function runBrowserServeProxy(opts) {
|
|
57888
|
+
const input = opts.input ?? process.stdin;
|
|
57889
|
+
const output3 = opts.output ?? process.stdout;
|
|
57890
|
+
const child = (0, import_node_child_process14.spawn)(opts.command, opts.args, {
|
|
57891
|
+
stdio: ["pipe", "pipe", "inherit"],
|
|
57892
|
+
env: { ...process.env, ...opts.env }
|
|
57893
|
+
});
|
|
57894
|
+
if (!child.stdin || !child.stdout) {
|
|
57895
|
+
throw new Error("Failed to open stdio pipes to @playwright/mcp child process");
|
|
57896
|
+
}
|
|
57897
|
+
wireBrowserServeProxy({
|
|
57898
|
+
input,
|
|
57899
|
+
output: output3,
|
|
57900
|
+
childIn: child.stdin,
|
|
57901
|
+
childOut: child.stdout
|
|
57902
|
+
});
|
|
57903
|
+
return new Promise((resolve2) => {
|
|
57904
|
+
child.on("close", (code) => {
|
|
57905
|
+
resolve2(code ?? 0);
|
|
57906
|
+
});
|
|
57907
|
+
child.on("error", (err) => {
|
|
57908
|
+
process.stderr.write(`[browser-serve proxy error]: ${err.message}
|
|
57909
|
+
`);
|
|
57910
|
+
resolve2(1);
|
|
57911
|
+
});
|
|
57912
|
+
});
|
|
57913
|
+
}
|
|
57914
|
+
|
|
57772
57915
|
// src/director-bridge.ts
|
|
57773
57916
|
var import_node_fs23 = __toESM(require("node:fs"), 1);
|
|
57774
57917
|
var import_node_http = __toESM(require("node:http"), 1);
|
|
57775
57918
|
var import_node_os17 = __toESM(require("node:os"), 1);
|
|
57776
57919
|
var import_node_path38 = __toESM(require("node:path"), 1);
|
|
57777
|
-
var
|
|
57920
|
+
var import_node_child_process22 = require("node:child_process");
|
|
57778
57921
|
var import_node_crypto16 = __toESM(require("node:crypto"), 1);
|
|
57779
57922
|
|
|
57780
57923
|
// src/turn-replay-buffer.ts
|
|
@@ -58319,14 +58462,14 @@ function createTurnLock() {
|
|
|
58319
58462
|
}
|
|
58320
58463
|
|
|
58321
58464
|
// src/self-update.ts
|
|
58322
|
-
var
|
|
58465
|
+
var import_node_child_process16 = require("node:child_process");
|
|
58323
58466
|
var import_node_crypto10 = require("node:crypto");
|
|
58324
58467
|
var import_node_fs12 = require("node:fs");
|
|
58325
58468
|
var import_node_path21 = __toESM(require("node:path"), 1);
|
|
58326
58469
|
var import_semver3 = __toESM(require_semver2(), 1);
|
|
58327
58470
|
|
|
58328
58471
|
// src/codex-auth-preflight.ts
|
|
58329
|
-
var
|
|
58472
|
+
var import_node_child_process15 = require("node:child_process");
|
|
58330
58473
|
var import_node_fs11 = require("node:fs");
|
|
58331
58474
|
var import_node_os12 = __toESM(require("node:os"), 1);
|
|
58332
58475
|
var import_node_path20 = __toESM(require("node:path"), 1);
|
|
@@ -58417,7 +58560,7 @@ function runCodexAuthRefreshSmokeForBridgeUpdate(opts = {}) {
|
|
|
58417
58560
|
CODEX_AUTH_SMOKE_PROMPT
|
|
58418
58561
|
];
|
|
58419
58562
|
const command = commandForSmoke(executable, model);
|
|
58420
|
-
const execFileSync5 = opts.execFileSyncImpl ??
|
|
58563
|
+
const execFileSync5 = opts.execFileSyncImpl ?? import_node_child_process15.execFileSync;
|
|
58421
58564
|
try {
|
|
58422
58565
|
execFileSync5(executable, args, {
|
|
58423
58566
|
cwd,
|
|
@@ -58573,7 +58716,7 @@ function resolveBinPath(opts) {
|
|
|
58573
58716
|
}
|
|
58574
58717
|
const whichSync = opts.whichSync ?? ((name) => {
|
|
58575
58718
|
try {
|
|
58576
|
-
return (0,
|
|
58719
|
+
return (0, import_node_child_process16.execFileSync)("which", [name], { encoding: "utf8", timeout: 3e3 }).trim() || null;
|
|
58577
58720
|
} catch {
|
|
58578
58721
|
return null;
|
|
58579
58722
|
}
|
|
@@ -58904,7 +59047,7 @@ Do NOT derail the current task - if the operator has an in-flight question, answ
|
|
|
58904
59047
|
}
|
|
58905
59048
|
|
|
58906
59049
|
// src/_generated/version.ts
|
|
58907
|
-
var PKG_VERSION = "0.4.
|
|
59050
|
+
var PKG_VERSION = "0.4.100";
|
|
58908
59051
|
|
|
58909
59052
|
// src/director-closure.ts
|
|
58910
59053
|
var CLOSURE_SNAPSHOT_TIMEOUT_MS = 2e3;
|
|
@@ -61031,7 +61174,7 @@ async function collectAgentPoolSnapshot(deps) {
|
|
|
61031
61174
|
}
|
|
61032
61175
|
|
|
61033
61176
|
// src/external-agents-spawn.ts
|
|
61034
|
-
var
|
|
61177
|
+
var import_node_child_process17 = require("node:child_process");
|
|
61035
61178
|
function runExternalAgentsCli(args, opts) {
|
|
61036
61179
|
let command;
|
|
61037
61180
|
let prefixArgs;
|
|
@@ -61062,7 +61205,7 @@ function runExternalAgentsCli(args, opts) {
|
|
|
61062
61205
|
};
|
|
61063
61206
|
let spawned;
|
|
61064
61207
|
try {
|
|
61065
|
-
spawned = (0,
|
|
61208
|
+
spawned = (0, import_node_child_process17.spawn)(command, [...prefixArgs, ...args], { stdio: stdioConfig });
|
|
61066
61209
|
} catch {
|
|
61067
61210
|
done(1);
|
|
61068
61211
|
return;
|
|
@@ -61174,14 +61317,14 @@ function startAgentPoolLoop(deps) {
|
|
|
61174
61317
|
}
|
|
61175
61318
|
|
|
61176
61319
|
// src/provider-readiness-loop.ts
|
|
61177
|
-
var
|
|
61320
|
+
var import_node_child_process18 = require("node:child_process");
|
|
61178
61321
|
var DEFAULT_INTERVAL_MS3 = 6e4;
|
|
61179
61322
|
function providerReadinessLoopDisabled(env = process.env) {
|
|
61180
61323
|
return env["MRRLIN_BRIDGE_PROVIDER_READINESS_DISABLE"] === "1";
|
|
61181
61324
|
}
|
|
61182
61325
|
function defaultRunnerFor(command) {
|
|
61183
61326
|
return (args) => {
|
|
61184
|
-
const r = (0,
|
|
61327
|
+
const r = (0, import_node_child_process18.spawnSync)(command, args, { encoding: "utf8", timeout: 8e3 });
|
|
61185
61328
|
return { status: r.status, stdout: r.stdout ?? "", stderr: r.stderr ?? "" };
|
|
61186
61329
|
};
|
|
61187
61330
|
}
|
|
@@ -61224,7 +61367,7 @@ function startProviderReadinessLoop(deps) {
|
|
|
61224
61367
|
}
|
|
61225
61368
|
|
|
61226
61369
|
// src/execution-consumer.ts
|
|
61227
|
-
var
|
|
61370
|
+
var import_node_child_process20 = require("node:child_process");
|
|
61228
61371
|
var import_node_crypto14 = __toESM(require("node:crypto"), 1);
|
|
61229
61372
|
var import_node_path31 = __toESM(require("node:path"), 1);
|
|
61230
61373
|
var import_node_util2 = require("node:util");
|
|
@@ -62080,7 +62223,7 @@ async function awaitTurnWithDeadline(opts) {
|
|
|
62080
62223
|
}
|
|
62081
62224
|
|
|
62082
62225
|
// src/worktree.ts
|
|
62083
|
-
var
|
|
62226
|
+
var import_node_child_process19 = require("node:child_process");
|
|
62084
62227
|
var import_node_crypto13 = require("node:crypto");
|
|
62085
62228
|
var import_node_fs17 = require("node:fs");
|
|
62086
62229
|
var import_node_path30 = require("node:path");
|
|
@@ -62108,7 +62251,7 @@ async function withCheckoutLock(locksDir, slug, fn) {
|
|
|
62108
62251
|
function worktreeBranch(runId) {
|
|
62109
62252
|
return `mrrlin/run-${runId}`;
|
|
62110
62253
|
}
|
|
62111
|
-
var defaultGitExec = (args, env) => (0,
|
|
62254
|
+
var defaultGitExec = (args, env) => (0, import_node_child_process19.execFileSync)("git", args, { encoding: "utf8", timeout: 3e4, env });
|
|
62112
62255
|
function disabledGitHooksPath(locksDir, scope) {
|
|
62113
62256
|
const scopeKey = (0, import_node_crypto13.createHash)("sha256").update(scope).digest("hex").slice(0, 32);
|
|
62114
62257
|
return (0, import_node_path30.resolve)(locksDir, "..", "disabled-git-hooks", scopeKey);
|
|
@@ -62145,7 +62288,7 @@ function withDisabledGitHooksEnv(env, hooksDir) {
|
|
|
62145
62288
|
};
|
|
62146
62289
|
}
|
|
62147
62290
|
function git(checkout, args, hooksDir) {
|
|
62148
|
-
return (0,
|
|
62291
|
+
return (0, import_node_child_process19.execFileSync)("git", ["-C", checkout, "-c", `core.hooksPath=${hooksDir}`, ...args], {
|
|
62149
62292
|
encoding: "utf8",
|
|
62150
62293
|
timeout: 3e4,
|
|
62151
62294
|
env: { ...process.env, GIT_TERMINAL_PROMPT: "0" }
|
|
@@ -62833,7 +62976,7 @@ var BLAST_RADIUS_FLOOR_PATTERNS = [/^supabase\/migrations\//, /^packages\/db\/sr
|
|
|
62833
62976
|
function isBlastRadiusFloorPath(path29) {
|
|
62834
62977
|
return BLAST_RADIUS_FLOOR_PATTERNS.some((re) => re.test(path29));
|
|
62835
62978
|
}
|
|
62836
|
-
var execFileAsync2 = (0, import_node_util2.promisify)(
|
|
62979
|
+
var execFileAsync2 = (0, import_node_util2.promisify)(import_node_child_process20.execFile);
|
|
62837
62980
|
async function defaultListRunDiffPaths(opts) {
|
|
62838
62981
|
const parse8 = (stdout) => stdout.split("\n").map((line) => line.trim()).filter((line) => line.length > 0);
|
|
62839
62982
|
try {
|
|
@@ -69170,14 +69313,14 @@ async function renderPairingQrSvg(payload) {
|
|
|
69170
69313
|
}
|
|
69171
69314
|
|
|
69172
69315
|
// src/executor-server.ts
|
|
69173
|
-
var
|
|
69316
|
+
var import_node_child_process21 = require("node:child_process");
|
|
69174
69317
|
function defaultReadinessRunner(provider) {
|
|
69175
69318
|
if (provider !== "codex" && provider !== "claude" && provider !== "agy") {
|
|
69176
69319
|
throw new Error(`unsupported executor provider: ${String(provider)}`);
|
|
69177
69320
|
}
|
|
69178
69321
|
const command = provider === "claude" ? "claude" : provider === "agy" ? "agy" : "codex";
|
|
69179
69322
|
return (args) => {
|
|
69180
|
-
const r = (0,
|
|
69323
|
+
const r = (0, import_node_child_process21.spawnSync)(command, args, { encoding: "utf8", timeout: 8e3, shell: true });
|
|
69181
69324
|
return { status: r.status, stdout: r.stdout ?? "", stderr: r.stderr ?? "" };
|
|
69182
69325
|
};
|
|
69183
69326
|
}
|
|
@@ -69320,7 +69463,7 @@ function createSelfReviewTurn(deps) {
|
|
|
69320
69463
|
|
|
69321
69464
|
// src/director-reseed.ts
|
|
69322
69465
|
var import_node_fs21 = require("node:fs");
|
|
69323
|
-
var
|
|
69466
|
+
var import_node_readline2 = require("node:readline");
|
|
69324
69467
|
var import_node_path35 = require("node:path");
|
|
69325
69468
|
function estimateTokens(s) {
|
|
69326
69469
|
return Buffer.byteLength(s, "utf8");
|
|
@@ -69473,7 +69616,7 @@ async function readSessionRows(logsDir, files, sessionIds) {
|
|
|
69473
69616
|
const filePath = (0, import_node_path35.join)(logsDir, f);
|
|
69474
69617
|
try {
|
|
69475
69618
|
const stream = (0, import_node_fs21.createReadStream)(filePath, { encoding: "utf8" });
|
|
69476
|
-
const rl = (0,
|
|
69619
|
+
const rl = (0, import_node_readline2.createInterface)({ input: stream, crlfDelay: Infinity });
|
|
69477
69620
|
try {
|
|
69478
69621
|
for await (const line of rl) {
|
|
69479
69622
|
if (line.trim() === "") continue;
|
|
@@ -70046,7 +70189,7 @@ function neutralCheckoutCwd(stateDir) {
|
|
|
70046
70189
|
import_node_fs23.default.mkdirSync(dir, { recursive: true });
|
|
70047
70190
|
if (!import_node_fs23.default.existsSync(import_node_path38.default.join(dir, ".git"))) {
|
|
70048
70191
|
try {
|
|
70049
|
-
(0,
|
|
70192
|
+
(0, import_node_child_process22.spawnSync)("git", ["init", "-b", "main"], { cwd: dir, stdio: "ignore" });
|
|
70050
70193
|
} catch {
|
|
70051
70194
|
}
|
|
70052
70195
|
}
|
|
@@ -70557,7 +70700,7 @@ function resolveDefaultBranch(checkoutPath) {
|
|
|
70557
70700
|
if (!checkoutPath) return "main";
|
|
70558
70701
|
const runGit = (args) => {
|
|
70559
70702
|
try {
|
|
70560
|
-
return (0,
|
|
70703
|
+
return (0, import_node_child_process22.execFileSync)("git", ["-C", checkoutPath, ...args], {
|
|
70561
70704
|
encoding: "utf8",
|
|
70562
70705
|
stdio: ["ignore", "pipe", "ignore"],
|
|
70563
70706
|
timeout: 15e3,
|
|
@@ -72325,7 +72468,7 @@ function parseConfig() {
|
|
|
72325
72468
|
}
|
|
72326
72469
|
function scanForOtherBridges() {
|
|
72327
72470
|
try {
|
|
72328
|
-
const result = (0,
|
|
72471
|
+
const result = (0, import_node_child_process22.spawnSync)("pgrep", ["-f", "mrrlin-mcp director-bridge"], {
|
|
72329
72472
|
encoding: "utf8"
|
|
72330
72473
|
});
|
|
72331
72474
|
if (result.status !== 0) return [];
|
|
@@ -75037,13 +75180,13 @@ function augmentProcessPathWithCommonDirs() {
|
|
|
75037
75180
|
}
|
|
75038
75181
|
augmentProcessPathWithCommonDirs();
|
|
75039
75182
|
function pm2Runner(args) {
|
|
75040
|
-
const r = (0,
|
|
75183
|
+
const r = (0, import_node_child_process23.spawnSync)("pm2", args, { encoding: "utf8" });
|
|
75041
75184
|
process.stderr.write(r.stdout ?? "");
|
|
75042
75185
|
process.stderr.write(r.stderr ?? "");
|
|
75043
75186
|
return { code: r.status ?? 1, stdout: r.stdout ?? "" };
|
|
75044
75187
|
}
|
|
75045
75188
|
function whichBin(bin) {
|
|
75046
|
-
const r = (0,
|
|
75189
|
+
const r = (0, import_node_child_process23.spawnSync)("which", [bin], { encoding: "utf8" });
|
|
75047
75190
|
const out = (r.stdout ?? "").trim();
|
|
75048
75191
|
return r.status === 0 && out ? out.split("\n")[0] ?? null : null;
|
|
75049
75192
|
}
|
|
@@ -75058,7 +75201,7 @@ function bootHookStatus() {
|
|
|
75058
75201
|
{ label: "com.PM2", plist: import_node_path43.default.join(agents, `pm2.${(0, import_node_os20.userInfo)().username}.plist`) }
|
|
75059
75202
|
];
|
|
75060
75203
|
for (const candidate of candidates) {
|
|
75061
|
-
const printed = (0,
|
|
75204
|
+
const printed = (0, import_node_child_process23.spawnSync)("launchctl", ["print", `gui/${uid}/${candidate.label}`], { encoding: "utf8" });
|
|
75062
75205
|
if (printed.status !== 0) continue;
|
|
75063
75206
|
if (!(0, import_node_fs25.existsSync)(candidate.plist)) continue;
|
|
75064
75207
|
const out = printed.stdout ?? "";
|
|
@@ -75272,8 +75415,8 @@ async function main() {
|
|
|
75272
75415
|
);
|
|
75273
75416
|
}
|
|
75274
75417
|
const { command: command2, args, env } = browserServeArgs();
|
|
75275
|
-
const
|
|
75276
|
-
process.exitCode =
|
|
75418
|
+
const exitCode = await runBrowserServeProxy({ command: command2, args, env });
|
|
75419
|
+
process.exitCode = exitCode;
|
|
75277
75420
|
return;
|
|
75278
75421
|
}
|
|
75279
75422
|
case "browser-status": {
|
|
@@ -75283,7 +75426,7 @@ async function main() {
|
|
|
75283
75426
|
}
|
|
75284
75427
|
case "external-agents-serve": {
|
|
75285
75428
|
const { command: command2, args } = externalAgentsServeArgs();
|
|
75286
|
-
const r = (0,
|
|
75429
|
+
const r = (0, import_node_child_process23.spawnSync)(command2, args, { stdio: "inherit", env: process.env });
|
|
75287
75430
|
process.exitCode = r.status ?? 1;
|
|
75288
75431
|
return;
|
|
75289
75432
|
}
|
|
@@ -75360,7 +75503,7 @@ async function main() {
|
|
|
75360
75503
|
);
|
|
75361
75504
|
}
|
|
75362
75505
|
const realProviderRunner = (command2) => (args) => {
|
|
75363
|
-
const r = (0,
|
|
75506
|
+
const r = (0, import_node_child_process23.spawnSync)(command2, args, { encoding: "utf8", timeout: 8e3 });
|
|
75364
75507
|
return { status: r.status, stdout: r.stdout ?? "", stderr: r.stderr ?? "" };
|
|
75365
75508
|
};
|
|
75366
75509
|
for (const provider of ["codex", "claude", "agy"]) {
|