@mrrlin-dev/mcp 0.4.224 → 0.4.225
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 +31 -23
- package/package.json +1 -1
package/dist/bin.cjs
CHANGED
|
@@ -69839,10 +69839,11 @@ var init_linux_service = __esm({
|
|
|
69839
69839
|
(0, import_node_fs32.unlinkSync)(this.config.socketPath);
|
|
69840
69840
|
} catch {
|
|
69841
69841
|
}
|
|
69842
|
-
|
|
69842
|
+
const server = import_node_net9.default.createServer((socket) => this.connection(socket));
|
|
69843
|
+
this.server = server;
|
|
69843
69844
|
await new Promise((resolve4, reject) => {
|
|
69844
|
-
|
|
69845
|
-
|
|
69845
|
+
server.once("error", reject);
|
|
69846
|
+
server.listen(this.config.socketPath, () => resolve4());
|
|
69846
69847
|
});
|
|
69847
69848
|
(0, import_node_fs32.chmodSync)(this.config.socketPath, 432);
|
|
69848
69849
|
}
|
|
@@ -69993,6 +69994,11 @@ __export(cli_exports, {
|
|
|
69993
69994
|
readDrainServiceEndpoint: () => readDrainServiceEndpoint,
|
|
69994
69995
|
runDrainServiceCli: () => runDrainServiceCli
|
|
69995
69996
|
});
|
|
69997
|
+
function runArgv(argv, options) {
|
|
69998
|
+
const [file2, ...rest] = argv;
|
|
69999
|
+
if (!file2) throw new Error("empty command");
|
|
70000
|
+
(0, import_node_child_process27.execFileSync)(file2, rest, options);
|
|
70001
|
+
}
|
|
69996
70002
|
function flag(args, name) {
|
|
69997
70003
|
const index = args.indexOf(`--${name}`);
|
|
69998
70004
|
return index >= 0 ? args[index + 1] : void 0;
|
|
@@ -70032,7 +70038,7 @@ async function runDrainServiceCli(args, out = process.stdout, version2) {
|
|
|
70032
70038
|
["rm", "-rf", PREFIX]
|
|
70033
70039
|
]) {
|
|
70034
70040
|
try {
|
|
70035
|
-
(
|
|
70041
|
+
runArgv(argv, { stdio: "inherit" });
|
|
70036
70042
|
} catch {
|
|
70037
70043
|
}
|
|
70038
70044
|
}
|
|
@@ -70061,12 +70067,17 @@ function installLinux(args, out, version2) {
|
|
|
70061
70067
|
out.write("drain-service install needs --provider-user <the bridge's user> and --credential <agent credential id>\n");
|
|
70062
70068
|
return 1;
|
|
70063
70069
|
}
|
|
70070
|
+
const bundlePath = process.argv[1];
|
|
70071
|
+
if (!bundlePath) {
|
|
70072
|
+
out.write("drain-service install: cannot locate the running mrrlin-mcp bundle\n");
|
|
70073
|
+
return 1;
|
|
70074
|
+
}
|
|
70064
70075
|
const options = {
|
|
70065
70076
|
serviceUser: flag(args, "service-user") ?? "mrrlin-drain",
|
|
70066
70077
|
providerUser,
|
|
70067
70078
|
nodePath: process.execPath,
|
|
70068
|
-
bundlePath
|
|
70069
|
-
helperSourcePath: (0, import_node_path43.join)(
|
|
70079
|
+
bundlePath,
|
|
70080
|
+
helperSourcePath: (0, import_node_path43.join)(bundlePath, "..", "..", "native", "mrrlin-drain-ns.c"),
|
|
70070
70081
|
version: version2
|
|
70071
70082
|
};
|
|
70072
70083
|
const providerUid = Number((0, import_node_child_process27.execFileSync)("id", ["-u", providerUser]).toString().trim());
|
|
@@ -70074,7 +70085,7 @@ function installLinux(args, out, version2) {
|
|
|
70074
70085
|
const plan = planLinuxInstall(options, { providerUid, providerGid });
|
|
70075
70086
|
for (const argv of plan.commands) {
|
|
70076
70087
|
try {
|
|
70077
|
-
(
|
|
70088
|
+
runArgv(argv, { stdio: "inherit" });
|
|
70078
70089
|
} catch (error51) {
|
|
70079
70090
|
if (argv[0] === "useradd") continue;
|
|
70080
70091
|
if (argv[0] === "cc" && argv[1] === "-static") {
|
|
@@ -89741,7 +89752,7 @@ async function invokeCapability(server, toolName2, payload, executionSignal) {
|
|
|
89741
89752
|
env[key] = expandedValue;
|
|
89742
89753
|
}
|
|
89743
89754
|
const tree = attemptTreeFor(executionSignal);
|
|
89744
|
-
if (tree) {
|
|
89755
|
+
if (tree && executionSignal) {
|
|
89745
89756
|
const transport = new AttemptStdioClientTransport(tree, { command: server.command, args: server.args ?? [], env });
|
|
89746
89757
|
stopStdio = () => void transport.close();
|
|
89747
89758
|
executionSignal.addEventListener("abort", stopStdio, { once: true });
|
|
@@ -105481,7 +105492,7 @@ Do NOT derail the current task - if the operator has an in-flight question, answ
|
|
|
105481
105492
|
}
|
|
105482
105493
|
|
|
105483
105494
|
// src/_generated/version.ts
|
|
105484
|
-
var PKG_VERSION = "0.4.
|
|
105495
|
+
var PKG_VERSION = "0.4.225";
|
|
105485
105496
|
|
|
105486
105497
|
// src/bridge-allowed-origins.ts
|
|
105487
105498
|
var DEFAULT_DIRECTOR_BRIDGE_ALLOWED_ORIGINS = [
|
|
@@ -108553,7 +108564,8 @@ async function connect(socketPath, onData, timeoutMs) {
|
|
|
108553
108564
|
for (const listener of onClose) listener();
|
|
108554
108565
|
});
|
|
108555
108566
|
const next = (limitMs) => new Promise((resolve4) => {
|
|
108556
|
-
|
|
108567
|
+
const head = queued.shift();
|
|
108568
|
+
if (head) return resolve4(head);
|
|
108557
108569
|
if (closed) return resolve4({ type: "closed" });
|
|
108558
108570
|
let timer;
|
|
108559
108571
|
const waiter = (message) => {
|
|
@@ -108687,7 +108699,9 @@ function worktreeGitdir(checkout) {
|
|
|
108687
108699
|
const text = (0, import_node_fs34.readFileSync)(dotGit, "utf8").trim();
|
|
108688
108700
|
const match2 = /^gitdir: (.+)$/.exec(text);
|
|
108689
108701
|
if (!match2) throw new Error("not a linked worktree");
|
|
108690
|
-
const
|
|
108702
|
+
const target = match2[1];
|
|
108703
|
+
if (!target) throw new Error("not a linked worktree");
|
|
108704
|
+
const gitdir = (0, import_node_path44.isAbsolute)(target) ? target : (0, import_node_path44.resolve)(checkout, target);
|
|
108691
108705
|
return (0, import_node_fs34.realpathSync)(gitdir);
|
|
108692
108706
|
}
|
|
108693
108707
|
function writeWorktreePin(worktreeRoot, checkout, owner, generation) {
|
|
@@ -111598,7 +111612,7 @@ async function driveRun(deps, projectSlug, runId, shutdown) {
|
|
|
111598
111612
|
shutdown
|
|
111599
111613
|
);
|
|
111600
111614
|
} finally {
|
|
111601
|
-
if (supervision) await closeDrainSupervision(runDeps, supervisor, supervision, projectSlug, runId);
|
|
111615
|
+
if (supervision && supervisor) await closeDrainSupervision(runDeps, supervisor, supervision, projectSlug, runId);
|
|
111602
111616
|
}
|
|
111603
111617
|
}
|
|
111604
111618
|
async function driveLeasedRun(deps, projectSlug, runId, claimed, leaseId, claimStartedMonotonicMs, elapsed, releaseUnstartedClaim, shutdown) {
|
|
@@ -112751,7 +112765,9 @@ ${coldClosureInstruction}` : workInstruction;
|
|
|
112751
112765
|
begin: async (preflightSignal, checkDeadline) => {
|
|
112752
112766
|
checkDeadline();
|
|
112753
112767
|
const supervised = deps.attemptSupervision;
|
|
112754
|
-
|
|
112768
|
+
const beginV3 = deps.client.beginColdWorkV3?.bind(deps.client);
|
|
112769
|
+
const beginV2 = deps.client.beginColdWorkV2?.bind(deps.client);
|
|
112770
|
+
if (supervised ? !beginV3 : !beginV2) return false;
|
|
112755
112771
|
let pin = null;
|
|
112756
112772
|
if (worktreePath) {
|
|
112757
112773
|
const worktreeRoot = deps.worktreeRoot ?? "/tmp/mrrlin-worktrees";
|
|
@@ -112769,21 +112785,13 @@ ${coldClosureInstruction}` : workInstruction;
|
|
|
112769
112785
|
}
|
|
112770
112786
|
checkDeadline();
|
|
112771
112787
|
coldReservation.outcome = "unknown";
|
|
112772
|
-
const applied = supervised ? await
|
|
112788
|
+
const applied = supervised && beginV3 ? await beginV3(projectSlug, runId, {
|
|
112773
112789
|
taskId: task.id,
|
|
112774
112790
|
leaseId,
|
|
112775
112791
|
threadId,
|
|
112776
112792
|
expectedWorktreeId: worktreePath,
|
|
112777
112793
|
supervisionId: supervised.supervisionId
|
|
112778
|
-
}, { signal: preflightSignal }) : await
|
|
112779
|
-
projectSlug,
|
|
112780
|
-
task.id,
|
|
112781
|
-
runId,
|
|
112782
|
-
leaseId,
|
|
112783
|
-
threadId,
|
|
112784
|
-
worktreePath,
|
|
112785
|
-
{ signal: preflightSignal }
|
|
112786
|
-
);
|
|
112794
|
+
}, { signal: preflightSignal }) : !supervised && beginV2 ? await beginV2(projectSlug, task.id, runId, leaseId, threadId, worktreePath, { signal: preflightSignal }) : false;
|
|
112787
112795
|
preflightSignal.throwIfAborted();
|
|
112788
112796
|
if (applied === false) {
|
|
112789
112797
|
coldReservation.outcome = "refused";
|