@mrrlin-dev/mcp 0.4.100 → 0.4.101
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 +150 -63
- package/package.json +1 -1
package/dist/bin.cjs
CHANGED
|
@@ -21593,7 +21593,7 @@ args = ${JSON.stringify(expected.args)}
|
|
|
21593
21593
|
return tomlStr;
|
|
21594
21594
|
}
|
|
21595
21595
|
async function installPublicMcpServerToConfigs(serverId, expected) {
|
|
21596
|
-
const homeDir =
|
|
21596
|
+
const homeDir = import_node_os17.default.homedir();
|
|
21597
21597
|
const claudePath = import_node_path37.default.join(homeDir, ".claude.json");
|
|
21598
21598
|
if (await pathExists5(claudePath)) {
|
|
21599
21599
|
try {
|
|
@@ -21644,12 +21644,12 @@ async function installPublicMcpServerToConfigs(serverId, expected) {
|
|
|
21644
21644
|
await writeAtomic(agyPath, JSON.stringify({ mcpServers: { [serverId]: expected } }, null, 2) + "\n");
|
|
21645
21645
|
}
|
|
21646
21646
|
}
|
|
21647
|
-
var import_promises15,
|
|
21647
|
+
var import_promises15, import_node_os17, import_node_path37, toml4;
|
|
21648
21648
|
var init_install_public_mcp = __esm({
|
|
21649
21649
|
"src/install-public-mcp.ts"() {
|
|
21650
21650
|
"use strict";
|
|
21651
21651
|
import_promises15 = __toESM(require("node:fs/promises"), 1);
|
|
21652
|
-
|
|
21652
|
+
import_node_os17 = __toESM(require("node:os"), 1);
|
|
21653
21653
|
import_node_path37 = __toESM(require("node:path"), 1);
|
|
21654
21654
|
toml4 = __toESM(require_toml(), 1);
|
|
21655
21655
|
}
|
|
@@ -21664,7 +21664,7 @@ module.exports = __toCommonJS(bin_exports);
|
|
|
21664
21664
|
var import_node_path42 = __toESM(require("node:path"), 1);
|
|
21665
21665
|
var import_node_child_process23 = require("node:child_process");
|
|
21666
21666
|
var import_node_fs25 = require("node:fs");
|
|
21667
|
-
var
|
|
21667
|
+
var import_node_os21 = require("node:os");
|
|
21668
21668
|
var import_node_path43 = __toESM(require("node:path"), 1);
|
|
21669
21669
|
|
|
21670
21670
|
// src/install-codex.ts
|
|
@@ -57770,6 +57770,7 @@ async function verifyProviderReadiness(provider, run3, opts = {}) {
|
|
|
57770
57770
|
}
|
|
57771
57771
|
|
|
57772
57772
|
// src/browser-interceptor.ts
|
|
57773
|
+
var import_node_os12 = __toESM(require("node:os"), 1);
|
|
57773
57774
|
var import_node_readline = __toESM(require("node:readline"), 1);
|
|
57774
57775
|
var import_node_child_process14 = require("node:child_process");
|
|
57775
57776
|
var INTERNAL_HOST_PATTERNS = [
|
|
@@ -57793,8 +57794,7 @@ function isInternalMrrlinUrl(urlString) {
|
|
|
57793
57794
|
const trimmed = urlString.trim();
|
|
57794
57795
|
try {
|
|
57795
57796
|
const isRelative = trimmed.startsWith("/");
|
|
57796
|
-
const
|
|
57797
|
-
const parsed = isRelative ? { pathname: parsedPathname, hostname: "localhost" } : new URL(trimmed);
|
|
57797
|
+
const parsed = isRelative ? new URL(trimmed, "http://localhost") : new URL(trimmed);
|
|
57798
57798
|
const isInternalHost = isRelative || INTERNAL_HOST_PATTERNS.some((p) => p.test(parsed.hostname));
|
|
57799
57799
|
if (!isInternalHost) {
|
|
57800
57800
|
return { isInternal: false };
|
|
@@ -57823,66 +57823,132 @@ function isInternalMrrlinUrl(urlString) {
|
|
|
57823
57823
|
function formatInternalRouteRejectionMessage(url2, suggestedTool) {
|
|
57824
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
57825
|
}
|
|
57826
|
-
function
|
|
57826
|
+
function processClientJsonRpcLine(rawLine) {
|
|
57827
57827
|
const trimmed = rawLine.trim();
|
|
57828
|
-
if (!trimmed) return
|
|
57828
|
+
if (!trimmed) return { type: "forward", payload: rawLine };
|
|
57829
57829
|
try {
|
|
57830
57830
|
const msg = JSON.parse(trimmed);
|
|
57831
57831
|
if (msg && msg.jsonrpc === "2.0" && msg.method === "tools/call" && msg.params?.name === "browser_navigate") {
|
|
57832
57832
|
const args = msg.params.arguments;
|
|
57833
57833
|
const url2 = typeof args?.url === "string" ? args.url : "";
|
|
57834
|
-
const forceInternal =
|
|
57835
|
-
|
|
57834
|
+
const forceInternal = args?.force_internal === true;
|
|
57835
|
+
const hadForceInternal = args && typeof args === "object" && "force_internal" in args;
|
|
57836
|
+
if (hadForceInternal) {
|
|
57837
|
+
delete args.force_internal;
|
|
57838
|
+
}
|
|
57839
|
+
if (forceInternal) {
|
|
57840
|
+
return { type: "forward", payload: JSON.stringify(msg) };
|
|
57841
|
+
}
|
|
57842
|
+
if (url2) {
|
|
57836
57843
|
const check2 = isInternalMrrlinUrl(url2);
|
|
57837
57844
|
if (check2.isInternal) {
|
|
57838
57845
|
const rejectionText = formatInternalRouteRejectionMessage(
|
|
57839
57846
|
url2,
|
|
57840
57847
|
check2.suggestedTool ?? "get_wiki_page / get_task"
|
|
57841
57848
|
);
|
|
57842
|
-
return
|
|
57843
|
-
|
|
57844
|
-
|
|
57845
|
-
|
|
57846
|
-
|
|
57847
|
-
|
|
57848
|
-
|
|
57849
|
-
|
|
57850
|
-
|
|
57851
|
-
|
|
57852
|
-
|
|
57853
|
-
|
|
57854
|
-
|
|
57849
|
+
return {
|
|
57850
|
+
type: "respond",
|
|
57851
|
+
payload: JSON.stringify({
|
|
57852
|
+
jsonrpc: "2.0",
|
|
57853
|
+
id: msg.id,
|
|
57854
|
+
result: {
|
|
57855
|
+
isError: true,
|
|
57856
|
+
content: [
|
|
57857
|
+
{
|
|
57858
|
+
type: "text",
|
|
57859
|
+
text: rejectionText
|
|
57860
|
+
}
|
|
57861
|
+
]
|
|
57862
|
+
}
|
|
57863
|
+
})
|
|
57864
|
+
};
|
|
57855
57865
|
}
|
|
57856
57866
|
}
|
|
57867
|
+
if (hadForceInternal) {
|
|
57868
|
+
return { type: "forward", payload: JSON.stringify(msg) };
|
|
57869
|
+
}
|
|
57857
57870
|
}
|
|
57858
57871
|
} catch {
|
|
57859
57872
|
}
|
|
57860
|
-
return
|
|
57873
|
+
return { type: "forward", payload: rawLine };
|
|
57874
|
+
}
|
|
57875
|
+
function processChildJsonRpcLine(rawLine) {
|
|
57876
|
+
const trimmed = rawLine.trim();
|
|
57877
|
+
if (!trimmed) return rawLine;
|
|
57878
|
+
try {
|
|
57879
|
+
const msg = JSON.parse(trimmed);
|
|
57880
|
+
if (msg && msg.result && Array.isArray(msg.result.tools)) {
|
|
57881
|
+
const navTool = msg.result.tools.find((t) => t.name === "browser_navigate");
|
|
57882
|
+
if (navTool && navTool.inputSchema) {
|
|
57883
|
+
if (!navTool.inputSchema.properties) {
|
|
57884
|
+
navTool.inputSchema.properties = {};
|
|
57885
|
+
}
|
|
57886
|
+
navTool.inputSchema.properties.force_internal = {
|
|
57887
|
+
type: "boolean",
|
|
57888
|
+
description: "Bypass the preflight guard for internal Mrrlin routes when visual browser rendering is strictly required."
|
|
57889
|
+
};
|
|
57890
|
+
return JSON.stringify(msg);
|
|
57891
|
+
}
|
|
57892
|
+
}
|
|
57893
|
+
} catch {
|
|
57894
|
+
}
|
|
57895
|
+
return rawLine;
|
|
57861
57896
|
}
|
|
57862
57897
|
function wireBrowserServeProxy(streams) {
|
|
57863
57898
|
const { input, output: output3, childIn, childOut } = streams;
|
|
57899
|
+
childIn.on("error", () => {
|
|
57900
|
+
});
|
|
57864
57901
|
const rl = import_node_readline.default.createInterface({
|
|
57865
57902
|
input,
|
|
57866
57903
|
crlfDelay: Infinity,
|
|
57867
57904
|
terminal: false
|
|
57868
57905
|
});
|
|
57906
|
+
const childRl = import_node_readline.default.createInterface({
|
|
57907
|
+
input: childOut,
|
|
57908
|
+
crlfDelay: Infinity,
|
|
57909
|
+
terminal: false
|
|
57910
|
+
});
|
|
57869
57911
|
rl.on("line", (line) => {
|
|
57870
|
-
const
|
|
57871
|
-
if (
|
|
57872
|
-
output3.write(
|
|
57912
|
+
const action = processClientJsonRpcLine(line);
|
|
57913
|
+
if (action.type === "respond") {
|
|
57914
|
+
output3.write(action.payload + "\n");
|
|
57873
57915
|
} else {
|
|
57874
|
-
|
|
57916
|
+
try {
|
|
57917
|
+
childIn.write(action.payload + "\n");
|
|
57918
|
+
} catch {
|
|
57919
|
+
}
|
|
57920
|
+
}
|
|
57921
|
+
});
|
|
57922
|
+
childRl.on("line", (line) => {
|
|
57923
|
+
const augmented = processChildJsonRpcLine(line);
|
|
57924
|
+
try {
|
|
57925
|
+
output3.write(augmented + "\n");
|
|
57926
|
+
} catch {
|
|
57875
57927
|
}
|
|
57876
57928
|
});
|
|
57929
|
+
const close = () => {
|
|
57930
|
+
rl.close();
|
|
57931
|
+
childRl.close();
|
|
57932
|
+
try {
|
|
57933
|
+
childIn.end();
|
|
57934
|
+
} catch {
|
|
57935
|
+
}
|
|
57936
|
+
};
|
|
57877
57937
|
rl.on("close", () => {
|
|
57878
57938
|
try {
|
|
57879
57939
|
childIn.end();
|
|
57880
57940
|
} catch {
|
|
57881
57941
|
}
|
|
57882
57942
|
});
|
|
57883
|
-
|
|
57884
|
-
|
|
57885
|
-
|
|
57943
|
+
return { close };
|
|
57944
|
+
}
|
|
57945
|
+
function signalToExitCode(signal) {
|
|
57946
|
+
if (!signal) return 1;
|
|
57947
|
+
const sigNum = import_node_os12.default.constants.signals[signal];
|
|
57948
|
+
if (typeof sigNum === "number") {
|
|
57949
|
+
return 128 + sigNum;
|
|
57950
|
+
}
|
|
57951
|
+
return 128 + 15;
|
|
57886
57952
|
}
|
|
57887
57953
|
async function runBrowserServeProxy(opts) {
|
|
57888
57954
|
const input = opts.input ?? process.stdin;
|
|
@@ -57894,17 +57960,38 @@ async function runBrowserServeProxy(opts) {
|
|
|
57894
57960
|
if (!child.stdin || !child.stdout) {
|
|
57895
57961
|
throw new Error("Failed to open stdio pipes to @playwright/mcp child process");
|
|
57896
57962
|
}
|
|
57897
|
-
wireBrowserServeProxy({
|
|
57963
|
+
const proxy = wireBrowserServeProxy({
|
|
57898
57964
|
input,
|
|
57899
57965
|
output: output3,
|
|
57900
57966
|
childIn: child.stdin,
|
|
57901
57967
|
childOut: child.stdout
|
|
57902
57968
|
});
|
|
57969
|
+
const sigintHandler = () => {
|
|
57970
|
+
try {
|
|
57971
|
+
child.kill("SIGINT");
|
|
57972
|
+
} catch {
|
|
57973
|
+
}
|
|
57974
|
+
};
|
|
57975
|
+
const sigtermHandler = () => {
|
|
57976
|
+
try {
|
|
57977
|
+
child.kill("SIGTERM");
|
|
57978
|
+
} catch {
|
|
57979
|
+
}
|
|
57980
|
+
};
|
|
57981
|
+
process.on("SIGINT", sigintHandler);
|
|
57982
|
+
process.on("SIGTERM", sigtermHandler);
|
|
57903
57983
|
return new Promise((resolve2) => {
|
|
57904
|
-
child.on("close", (code) => {
|
|
57905
|
-
|
|
57984
|
+
child.on("close", (code, signal) => {
|
|
57985
|
+
process.off("SIGINT", sigintHandler);
|
|
57986
|
+
process.off("SIGTERM", sigtermHandler);
|
|
57987
|
+
proxy.close();
|
|
57988
|
+
const exitCode = code !== null ? code : signalToExitCode(signal);
|
|
57989
|
+
resolve2(exitCode);
|
|
57906
57990
|
});
|
|
57907
57991
|
child.on("error", (err) => {
|
|
57992
|
+
process.off("SIGINT", sigintHandler);
|
|
57993
|
+
process.off("SIGTERM", sigtermHandler);
|
|
57994
|
+
proxy.close();
|
|
57908
57995
|
process.stderr.write(`[browser-serve proxy error]: ${err.message}
|
|
57909
57996
|
`);
|
|
57910
57997
|
resolve2(1);
|
|
@@ -57915,7 +58002,7 @@ async function runBrowserServeProxy(opts) {
|
|
|
57915
58002
|
// src/director-bridge.ts
|
|
57916
58003
|
var import_node_fs23 = __toESM(require("node:fs"), 1);
|
|
57917
58004
|
var import_node_http = __toESM(require("node:http"), 1);
|
|
57918
|
-
var
|
|
58005
|
+
var import_node_os18 = __toESM(require("node:os"), 1);
|
|
57919
58006
|
var import_node_path38 = __toESM(require("node:path"), 1);
|
|
57920
58007
|
var import_node_child_process22 = require("node:child_process");
|
|
57921
58008
|
var import_node_crypto16 = __toESM(require("node:crypto"), 1);
|
|
@@ -58471,7 +58558,7 @@ var import_semver3 = __toESM(require_semver2(), 1);
|
|
|
58471
58558
|
// src/codex-auth-preflight.ts
|
|
58472
58559
|
var import_node_child_process15 = require("node:child_process");
|
|
58473
58560
|
var import_node_fs11 = require("node:fs");
|
|
58474
|
-
var
|
|
58561
|
+
var import_node_os13 = __toESM(require("node:os"), 1);
|
|
58475
58562
|
var import_node_path20 = __toESM(require("node:path"), 1);
|
|
58476
58563
|
var DEFAULT_CODEX_AUTH_MIN_TTL_SECONDS = 15 * 60;
|
|
58477
58564
|
var DEFAULT_CODEX_AUTH_SMOKE_TIMEOUT_MS = 2e4;
|
|
@@ -58491,7 +58578,7 @@ function codexAuthSmokeTimeoutMs(env = process.env) {
|
|
|
58491
58578
|
function resolveCodexAuthPath(opts = {}) {
|
|
58492
58579
|
const env = opts.env ?? process.env;
|
|
58493
58580
|
const codexHome = env.CODEX_HOME?.trim();
|
|
58494
|
-
return import_node_path20.default.join(codexHome || import_node_path20.default.join(opts.homeDir ??
|
|
58581
|
+
return import_node_path20.default.join(codexHome || import_node_path20.default.join(opts.homeDir ?? import_node_os13.default.homedir(), ".codex"), "auth.json");
|
|
58495
58582
|
}
|
|
58496
58583
|
function decodeJwtExpMs(token) {
|
|
58497
58584
|
const parts = token.split(".");
|
|
@@ -58549,7 +58636,7 @@ function runCodexAuthRefreshSmokeForBridgeUpdate(opts = {}) {
|
|
|
58549
58636
|
const configuredExecutable = opts.codexExecutable ?? env.MRRLIN_DIRECTOR_BRIDGE_CODEX_BIN?.trim();
|
|
58550
58637
|
const executable = configuredExecutable || "codex";
|
|
58551
58638
|
const timeoutMs = opts.timeoutMs ?? codexAuthSmokeTimeoutMs(env);
|
|
58552
|
-
const cwd = opts.cwd ??
|
|
58639
|
+
const cwd = opts.cwd ?? import_node_os13.default.tmpdir();
|
|
58553
58640
|
const args = [
|
|
58554
58641
|
"exec",
|
|
58555
58642
|
"--sandbox",
|
|
@@ -59047,7 +59134,7 @@ Do NOT derail the current task - if the operator has an in-flight question, answ
|
|
|
59047
59134
|
}
|
|
59048
59135
|
|
|
59049
59136
|
// src/_generated/version.ts
|
|
59050
|
-
var PKG_VERSION = "0.4.
|
|
59137
|
+
var PKG_VERSION = "0.4.101";
|
|
59051
59138
|
|
|
59052
59139
|
// src/director-closure.ts
|
|
59053
59140
|
var CLOSURE_SNAPSHOT_TIMEOUT_MS = 2e3;
|
|
@@ -59761,7 +59848,7 @@ function parseLedger(value) {
|
|
|
59761
59848
|
|
|
59762
59849
|
// src/api-base-url-migrate.ts
|
|
59763
59850
|
var import_node_fs13 = __toESM(require("node:fs"), 1);
|
|
59764
|
-
var
|
|
59851
|
+
var import_node_os14 = __toESM(require("node:os"), 1);
|
|
59765
59852
|
var import_node_path23 = __toESM(require("node:path"), 1);
|
|
59766
59853
|
|
|
59767
59854
|
// src/service-paths.ts
|
|
@@ -59839,7 +59926,7 @@ ${envLines}
|
|
|
59839
59926
|
|
|
59840
59927
|
// src/api-base-url-migrate.ts
|
|
59841
59928
|
function defaultDeps(deps) {
|
|
59842
|
-
const home = deps.home ?? process.env.HOME ??
|
|
59929
|
+
const home = deps.home ?? process.env.HOME ?? import_node_os14.default.homedir();
|
|
59843
59930
|
return {
|
|
59844
59931
|
home,
|
|
59845
59932
|
codexHome: deps.codexHome ?? process.env.CODEX_HOME?.trim() ?? import_node_path23.default.join(home, ".codex"),
|
|
@@ -65524,7 +65611,7 @@ function createToolBusyClock(opts) {
|
|
|
65524
65611
|
// src/remote-phone-relay.ts
|
|
65525
65612
|
var import_node_events3 = require("node:events");
|
|
65526
65613
|
var import_node_fs20 = require("node:fs");
|
|
65527
|
-
var
|
|
65614
|
+
var import_node_os15 = require("node:os");
|
|
65528
65615
|
var import_node_path34 = require("node:path");
|
|
65529
65616
|
|
|
65530
65617
|
// ../../node_modules/.pnpm/@noble+hashes@1.3.3/node_modules/@noble/hashes/esm/cryptoNode.js
|
|
@@ -69096,7 +69183,7 @@ var DirectorRelay = class {
|
|
|
69096
69183
|
|
|
69097
69184
|
// src/remote-phone-relay.ts
|
|
69098
69185
|
function loadOrCreateAgentDeviceKey() {
|
|
69099
|
-
const path29 = (0, import_node_path34.join)((0,
|
|
69186
|
+
const path29 = (0, import_node_path34.join)((0, import_node_os15.homedir)(), ".mrrlin", "agent-device-key");
|
|
69100
69187
|
try {
|
|
69101
69188
|
const raw = JSON.parse((0, import_node_fs20.readFileSync)(path29, "utf8"));
|
|
69102
69189
|
if (typeof raw.priv === "string" && typeof raw.pub === "string") {
|
|
@@ -69106,7 +69193,7 @@ function loadOrCreateAgentDeviceKey() {
|
|
|
69106
69193
|
}
|
|
69107
69194
|
const kp = generateIdentityKeyPair();
|
|
69108
69195
|
try {
|
|
69109
|
-
(0, import_node_fs20.mkdirSync)((0, import_node_path34.join)((0,
|
|
69196
|
+
(0, import_node_fs20.mkdirSync)((0, import_node_path34.join)((0, import_node_os15.homedir)(), ".mrrlin"), { recursive: true });
|
|
69110
69197
|
(0, import_node_fs20.writeFileSync)(
|
|
69111
69198
|
path29,
|
|
69112
69199
|
JSON.stringify({ priv: toBase64Url(kp.privateKey), pub: toBase64Url(kp.publicKey) }),
|
|
@@ -69116,7 +69203,7 @@ function loadOrCreateAgentDeviceKey() {
|
|
|
69116
69203
|
}
|
|
69117
69204
|
return kp;
|
|
69118
69205
|
}
|
|
69119
|
-
var AGENT_PAIRING_PATH = (0, import_node_path34.join)((0,
|
|
69206
|
+
var AGENT_PAIRING_PATH = (0, import_node_path34.join)((0, import_node_os15.homedir)(), ".mrrlin", "agent-pairing.json");
|
|
69120
69207
|
function loadAgentPairing() {
|
|
69121
69208
|
try {
|
|
69122
69209
|
const raw = JSON.parse((0, import_node_fs20.readFileSync)(AGENT_PAIRING_PATH, "utf8"));
|
|
@@ -69134,7 +69221,7 @@ function loadAgentPairing() {
|
|
|
69134
69221
|
}
|
|
69135
69222
|
function saveAgentPairing(record2) {
|
|
69136
69223
|
try {
|
|
69137
|
-
(0, import_node_fs20.mkdirSync)((0, import_node_path34.join)((0,
|
|
69224
|
+
(0, import_node_fs20.mkdirSync)((0, import_node_path34.join)((0, import_node_os15.homedir)(), ".mrrlin"), { recursive: true });
|
|
69138
69225
|
(0, import_node_fs20.writeFileSync)(AGENT_PAIRING_PATH, JSON.stringify(record2), { mode: 384 });
|
|
69139
69226
|
} catch {
|
|
69140
69227
|
}
|
|
@@ -69640,11 +69727,11 @@ async function readSessionRows(logsDir, files, sessionIds) {
|
|
|
69640
69727
|
|
|
69641
69728
|
// src/external-agents-scrub.ts
|
|
69642
69729
|
var import_node_fs22 = __toESM(require("node:fs"), 1);
|
|
69643
|
-
var
|
|
69730
|
+
var import_node_os16 = __toESM(require("node:os"), 1);
|
|
69644
69731
|
var import_node_path36 = __toESM(require("node:path"), 1);
|
|
69645
69732
|
var REDACTION = "[REDACTED]";
|
|
69646
69733
|
var SHORT_VALUE_THRESHOLD = 8;
|
|
69647
|
-
var KEYS_ENV_PATH = () => import_node_path36.default.join(
|
|
69734
|
+
var KEYS_ENV_PATH = () => import_node_path36.default.join(import_node_os16.default.homedir(), ".local", "state", "external-agents", "keys.env");
|
|
69648
69735
|
var keysEnvCache = null;
|
|
69649
69736
|
function readKeysEnv() {
|
|
69650
69737
|
const filePath = KEYS_ENV_PATH();
|
|
@@ -70088,7 +70175,7 @@ function readKnownGptSlugsFromTomlFile(filePath) {
|
|
|
70088
70175
|
return Array.from(raw.matchAll(/^\s*model\s*=\s*"([^"]+)"/gm)).map((match) => match[1]?.trim() ?? "").filter(isSelectableModelSlug);
|
|
70089
70176
|
}
|
|
70090
70177
|
function readCodexFallbackModels() {
|
|
70091
|
-
const codexHome = process.env.CODEX_HOME?.trim() || import_node_path38.default.join(
|
|
70178
|
+
const codexHome = process.env.CODEX_HOME?.trim() || import_node_path38.default.join(import_node_os18.default.homedir(), ".codex");
|
|
70092
70179
|
const models = /* @__PURE__ */ new Map();
|
|
70093
70180
|
const cachePath = import_node_path38.default.join(codexHome, "models_cache.json");
|
|
70094
70181
|
const cacheRaw = readTextIfExists(cachePath);
|
|
@@ -71254,7 +71341,7 @@ function createBridgeMessageHandler(deps) {
|
|
|
71254
71341
|
sendForSpan({ type: "checkout-state", ok: false, error: { code: "invalid_input", fields: { projectSlug: "required" } } });
|
|
71255
71342
|
return;
|
|
71256
71343
|
}
|
|
71257
|
-
const state = readCheckoutState(deps.checkoutRegistry, projectSlug,
|
|
71344
|
+
const state = readCheckoutState(deps.checkoutRegistry, projectSlug, import_node_os18.default.hostname());
|
|
71258
71345
|
if (!state) {
|
|
71259
71346
|
sendForSpan({ type: "checkout-state", ok: false, error: { code: "checkout_missing" } });
|
|
71260
71347
|
return;
|
|
@@ -71286,7 +71373,7 @@ function createBridgeMessageHandler(deps) {
|
|
|
71286
71373
|
const result = registerCheckout(
|
|
71287
71374
|
deps.checkoutRegistry,
|
|
71288
71375
|
{ projectSlug, path: typeof msg.path === "string" ? msg.path : "", repo },
|
|
71289
|
-
|
|
71376
|
+
import_node_os18.default.hostname()
|
|
71290
71377
|
);
|
|
71291
71378
|
if (!result.ok) {
|
|
71292
71379
|
sendForSpan({ type: "checkout-register", ok: false, error: { code: result.code, detail: result.detail } });
|
|
@@ -74383,7 +74470,7 @@ function runSetCredential(args) {
|
|
|
74383
74470
|
}
|
|
74384
74471
|
|
|
74385
74472
|
// src/install-service.ts
|
|
74386
|
-
var
|
|
74473
|
+
var import_node_os19 = __toESM(require("node:os"), 1);
|
|
74387
74474
|
var import_node_fs24 = require("node:fs");
|
|
74388
74475
|
var import_node_path39 = __toESM(require("node:path"), 1);
|
|
74389
74476
|
function parseEnvLine(line, env) {
|
|
@@ -74862,11 +74949,11 @@ function installService(deps) {
|
|
|
74862
74949
|
deps.log(resolved.reason);
|
|
74863
74950
|
return { ok: false };
|
|
74864
74951
|
}
|
|
74865
|
-
const home = deps.env.HOME ??
|
|
74952
|
+
const home = deps.env.HOME ?? import_node_os19.default.homedir();
|
|
74866
74953
|
const user = resolveBridgeUser({
|
|
74867
74954
|
env: deps.env,
|
|
74868
74955
|
home,
|
|
74869
|
-
userInfo: deps.userInfo ?? (() =>
|
|
74956
|
+
userInfo: deps.userInfo ?? (() => import_node_os19.default.userInfo()),
|
|
74870
74957
|
homeOwnerUid: deps.homeOwnerUid ?? defaultHomeOwnerUid,
|
|
74871
74958
|
log: deps.log
|
|
74872
74959
|
});
|
|
@@ -74887,7 +74974,7 @@ function installService(deps) {
|
|
|
74887
74974
|
const claudeBin = deps.which("claude");
|
|
74888
74975
|
const agyBin = deps.which("agy");
|
|
74889
74976
|
const resolvedBins = [...bins, claudeBin, agyBin].filter((b) => b !== null);
|
|
74890
|
-
const isWin =
|
|
74977
|
+
const isWin = import_node_os19.default.platform() === "win32";
|
|
74891
74978
|
const systemDirs = isWin ? (deps.env.PATH || "").split(import_node_path39.default.delimiter).filter(Boolean) : SYSTEM_PATH_DIRS;
|
|
74892
74979
|
const pathEnv = Array.from(
|
|
74893
74980
|
/* @__PURE__ */ new Set([...resolvedBins.map((b) => import_node_path39.default.dirname(b)), ...systemDirs])
|
|
@@ -74970,14 +75057,14 @@ function uninstallService(deps) {
|
|
|
74970
75057
|
|
|
74971
75058
|
// src/uninstall-codex.ts
|
|
74972
75059
|
var import_promises16 = __toESM(require("node:fs/promises"), 1);
|
|
74973
|
-
var
|
|
75060
|
+
var import_node_os20 = __toESM(require("node:os"), 1);
|
|
74974
75061
|
var import_node_path40 = __toESM(require("node:path"), 1);
|
|
74975
75062
|
var toml5 = __toESM(require_toml(), 1);
|
|
74976
75063
|
function resolveCodexHome3(options) {
|
|
74977
75064
|
if (options.codexHome) return options.codexHome;
|
|
74978
75065
|
if (options.homeDir) return import_node_path40.default.join(options.homeDir, ".codex");
|
|
74979
75066
|
if (process.env.CODEX_HOME) return process.env.CODEX_HOME;
|
|
74980
|
-
return import_node_path40.default.join(
|
|
75067
|
+
return import_node_path40.default.join(import_node_os20.default.homedir(), ".codex");
|
|
74981
75068
|
}
|
|
74982
75069
|
async function pathExists6(target) {
|
|
74983
75070
|
try {
|
|
@@ -75164,7 +75251,7 @@ Missing required flag(s): ${missing.join(
|
|
|
75164
75251
|
function augmentProcessPathWithCommonDirs() {
|
|
75165
75252
|
const isWin = process.platform === "win32";
|
|
75166
75253
|
if (isWin) return;
|
|
75167
|
-
const home = process.env.HOME || (0,
|
|
75254
|
+
const home = process.env.HOME || (0, import_node_os21.homedir)();
|
|
75168
75255
|
const candidates = [
|
|
75169
75256
|
import_node_path43.default.join(home, ".local", "bin"),
|
|
75170
75257
|
import_node_path43.default.join(home, ".cargo", "bin"),
|
|
@@ -75194,11 +75281,11 @@ function bootHookStatus() {
|
|
|
75194
75281
|
if (process.platform !== "darwin") return { status: "unknown" };
|
|
75195
75282
|
const uid = process.getuid?.();
|
|
75196
75283
|
if (uid === void 0 || uid === 0) return { status: "unknown" };
|
|
75197
|
-
const home = process.env.HOME ?? (0,
|
|
75284
|
+
const home = process.env.HOME ?? (0, import_node_os21.homedir)();
|
|
75198
75285
|
const agents = import_node_path43.default.join(home, "Library", "LaunchAgents");
|
|
75199
75286
|
const candidates = [
|
|
75200
75287
|
{ label: "com.mrrlin.director-bridge", plist: import_node_path43.default.join(agents, "com.mrrlin.director-bridge.plist") },
|
|
75201
|
-
{ label: "com.PM2", plist: import_node_path43.default.join(agents, `pm2.${(0,
|
|
75288
|
+
{ label: "com.PM2", plist: import_node_path43.default.join(agents, `pm2.${(0, import_node_os21.userInfo)().username}.plist`) }
|
|
75202
75289
|
];
|
|
75203
75290
|
for (const candidate of candidates) {
|
|
75204
75291
|
const printed = (0, import_node_child_process23.spawnSync)("launchctl", ["print", `gui/${uid}/${candidate.label}`], { encoding: "utf8" });
|
|
@@ -75480,7 +75567,7 @@ async function main() {
|
|
|
75480
75567
|
}
|
|
75481
75568
|
}
|
|
75482
75569
|
try {
|
|
75483
|
-
const codexHome = process.env.CODEX_HOME ?? import_node_path43.default.join(process.env.HOME ?? (0,
|
|
75570
|
+
const codexHome = process.env.CODEX_HOME ?? import_node_path43.default.join(process.env.HOME ?? (0, import_node_os21.homedir)(), ".codex");
|
|
75484
75571
|
(0, import_node_fs25.rmSync)(import_node_path43.default.join(codexHome, "prompts", "report-issue.md"), { force: true });
|
|
75485
75572
|
} catch {
|
|
75486
75573
|
}
|
|
@@ -75596,14 +75683,14 @@ async function main() {
|
|
|
75596
75683
|
purgeSecret: purge,
|
|
75597
75684
|
secretPath: agentCredentialPath(),
|
|
75598
75685
|
tokenPath: operatorTokenPath(),
|
|
75599
|
-
ecoPath: import_node_path43.default.join(process.env.HOME ?? (0,
|
|
75686
|
+
ecoPath: import_node_path43.default.join(process.env.HOME ?? (0, import_node_os21.homedir)(), ".mrrlin", "ecosystem.config.cjs"),
|
|
75600
75687
|
log: (m) => process.stderr.write(`[mrrlin-mcp uninstall-service] ${m}
|
|
75601
75688
|
`)
|
|
75602
75689
|
});
|
|
75603
75690
|
return;
|
|
75604
75691
|
}
|
|
75605
75692
|
case "uninstall": {
|
|
75606
|
-
const home = process.env.HOME ?? (0,
|
|
75693
|
+
const home = process.env.HOME ?? (0, import_node_os21.homedir)();
|
|
75607
75694
|
const log = (m) => process.stderr.write(`[mrrlin-mcp uninstall] ${m}
|
|
75608
75695
|
`);
|
|
75609
75696
|
uninstallService({
|