@comecaramelos/dsh-chrome-mcp 1.0.0 → 2.0.0
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/README.md +44 -39
- package/lib/client.js +2186 -614
- package/lib/client.js.map +4 -4
- package/lib/host/apply.d.ts +38 -1
- package/lib/host/apply.d.ts.map +1 -1
- package/lib/host/apply.js +43 -17
- package/lib/host/apply.js.map +1 -1
- package/lib/host/bridge.d.ts +28 -19
- package/lib/host/bridge.d.ts.map +1 -1
- package/lib/host/bridge.js +71 -79
- package/lib/host/bridge.js.map +1 -1
- package/lib/host/catalog.d.ts +2 -2
- package/lib/host/catalog.js +2 -2
- package/lib/host/commands/chrome-path.d.ts +4 -0
- package/lib/host/commands/chrome-path.d.ts.map +1 -0
- package/lib/host/commands/chrome-path.js +65 -0
- package/lib/host/commands/chrome-path.js.map +1 -0
- package/lib/host/commands/chrome-refresh.d.ts +17 -0
- package/lib/host/commands/chrome-refresh.d.ts.map +1 -0
- package/lib/host/commands/chrome-refresh.js +37 -0
- package/lib/host/commands/chrome-refresh.js.map +1 -0
- package/lib/host/commands/index.d.ts +26 -0
- package/lib/host/commands/index.d.ts.map +1 -0
- package/lib/host/commands/index.js +41 -0
- package/lib/host/commands/index.js.map +1 -0
- package/lib/host/constants.d.ts +107 -30
- package/lib/host/constants.d.ts.map +1 -1
- package/lib/host/constants.js +107 -30
- package/lib/host/constants.js.map +1 -1
- package/lib/host/controller/_trace.d.ts +3 -0
- package/lib/host/controller/_trace.d.ts.map +1 -0
- package/lib/host/controller/_trace.js +14 -0
- package/lib/host/controller/_trace.js.map +1 -0
- package/lib/host/controller/bridge-run.d.ts +4 -2
- package/lib/host/controller/bridge-run.d.ts.map +1 -1
- package/lib/host/controller/bridge-run.js +24 -8
- package/lib/host/controller/bridge-run.js.map +1 -1
- package/lib/host/controller/captures.d.ts +9 -16
- package/lib/host/controller/captures.d.ts.map +1 -1
- package/lib/host/controller/captures.js +73 -48
- package/lib/host/controller/captures.js.map +1 -1
- package/lib/host/controller/commits.d.ts +2 -2
- package/lib/host/controller/commits.d.ts.map +1 -1
- package/lib/host/controller/commits.js +97 -41
- package/lib/host/controller/commits.js.map +1 -1
- package/lib/host/controller/connections.d.ts +38 -0
- package/lib/host/controller/connections.d.ts.map +1 -0
- package/lib/host/controller/connections.js +71 -0
- package/lib/host/controller/connections.js.map +1 -0
- package/lib/host/controller/controller.d.ts +19 -24
- package/lib/host/controller/controller.d.ts.map +1 -1
- package/lib/host/controller/controller.js +181 -114
- package/lib/host/controller/controller.js.map +1 -1
- package/lib/host/controller/index.d.ts +18 -14
- package/lib/host/controller/index.d.ts.map +1 -1
- package/lib/host/controller/index.js +16 -14
- package/lib/host/controller/index.js.map +1 -1
- package/lib/host/controller/notes.d.ts +9 -9
- package/lib/host/controller/notes.d.ts.map +1 -1
- package/lib/host/controller/notes.js +16 -21
- package/lib/host/controller/notes.js.map +1 -1
- package/lib/host/controller/persist.d.ts +10 -3
- package/lib/host/controller/persist.d.ts.map +1 -1
- package/lib/host/controller/persist.js +89 -42
- package/lib/host/controller/persist.js.map +1 -1
- package/lib/host/controller/publish.d.ts +4 -0
- package/lib/host/controller/publish.d.ts.map +1 -0
- package/lib/host/controller/publish.js +56 -0
- package/lib/host/controller/publish.js.map +1 -0
- package/lib/host/controller/runs.d.ts +34 -10
- package/lib/host/controller/runs.d.ts.map +1 -1
- package/lib/host/controller/runs.js +241 -58
- package/lib/host/controller/runs.js.map +1 -1
- package/lib/host/controller/state.d.ts +122 -20
- package/lib/host/controller/state.d.ts.map +1 -1
- package/lib/host/controller/windows-run.d.ts +10 -2
- package/lib/host/controller/windows-run.d.ts.map +1 -1
- package/lib/host/controller/windows-run.js +66 -35
- package/lib/host/controller/windows-run.js.map +1 -1
- package/lib/host/discovery/candidates.d.ts +23 -13
- package/lib/host/discovery/candidates.d.ts.map +1 -1
- package/lib/host/discovery/candidates.js +20 -8
- package/lib/host/discovery/candidates.js.map +1 -1
- package/lib/host/discovery/index.d.ts +1 -0
- package/lib/host/discovery/index.d.ts.map +1 -1
- package/lib/host/discovery/index.js +1 -0
- package/lib/host/discovery/index.js.map +1 -1
- package/lib/host/discovery/probe.d.ts +16 -5
- package/lib/host/discovery/probe.d.ts.map +1 -1
- package/lib/host/discovery/probe.js +68 -10
- package/lib/host/discovery/probe.js.map +1 -1
- package/lib/host/discovery/scan.d.ts +14 -9
- package/lib/host/discovery/scan.d.ts.map +1 -1
- package/lib/host/discovery/scan.js +56 -30
- package/lib/host/discovery/scan.js.map +1 -1
- package/lib/host/flags.d.ts +28 -5
- package/lib/host/flags.d.ts.map +1 -1
- package/lib/host/flags.js +75 -7
- package/lib/host/flags.js.map +1 -1
- package/lib/host/kind.d.ts +45 -0
- package/lib/host/kind.d.ts.map +1 -0
- package/lib/host/kind.js +251 -0
- package/lib/host/kind.js.map +1 -0
- package/lib/host/manager.d.ts +21 -0
- package/lib/host/manager.d.ts.map +1 -0
- package/lib/host/manager.js +113 -0
- package/lib/host/manager.js.map +1 -0
- package/lib/host/migration.d.ts +26 -0
- package/lib/host/migration.d.ts.map +1 -0
- package/lib/host/migration.js +127 -0
- package/lib/host/migration.js.map +1 -0
- package/lib/host/plugin-meta.d.ts +12 -3
- package/lib/host/plugin-meta.d.ts.map +1 -1
- package/lib/host/plugin-meta.js +13 -4
- package/lib/host/plugin-meta.js.map +1 -1
- package/lib/host/schema.d.ts +301 -247
- package/lib/host/schema.d.ts.map +1 -1
- package/lib/host/schema.js +145 -120
- package/lib/host/schema.js.map +1 -1
- package/lib/host/settings.d.ts +22 -3
- package/lib/host/settings.d.ts.map +1 -1
- package/lib/host/settings.js +81 -60
- package/lib/host/settings.js.map +1 -1
- package/lib/host/status.d.ts +7 -10
- package/lib/host/status.d.ts.map +1 -1
- package/lib/host/status.js +8 -23
- package/lib/host/status.js.map +1 -1
- package/lib/host/tool.d.ts +13 -7
- package/lib/host/tool.d.ts.map +1 -1
- package/lib/host/tool.js +4 -3
- package/lib/host/tool.js.map +1 -1
- package/lib/host/types/config.d.ts +66 -12
- package/lib/host/types/config.d.ts.map +1 -1
- package/lib/host/types/executable.d.ts +8 -3
- package/lib/host/types/executable.d.ts.map +1 -1
- package/lib/host/types/index.d.ts +5 -4
- package/lib/host/types/index.d.ts.map +1 -1
- package/lib/host/types/services.d.ts +26 -0
- package/lib/host/types/services.d.ts.map +1 -0
- package/lib/host/types/services.js +9 -0
- package/lib/host/types/services.js.map +1 -0
- package/lib/host/types/settings.d.ts +118 -65
- package/lib/host/types/settings.d.ts.map +1 -1
- package/lib/host/types/stderr.d.ts +3 -5
- package/lib/host/types/stderr.d.ts.map +1 -1
- package/lib/host/values.d.ts +152 -37
- package/lib/host/values.d.ts.map +1 -1
- package/lib/host/values.js +304 -112
- package/lib/host/values.js.map +1 -1
- package/lib/host/windows/connect-flags.d.ts +19 -8
- package/lib/host/windows/connect-flags.d.ts.map +1 -1
- package/lib/host/windows/connect-flags.js +50 -20
- package/lib/host/windows/connect-flags.js.map +1 -1
- package/lib/host/windows/index.d.ts +1 -1
- package/lib/host/windows/index.d.ts.map +1 -1
- package/lib/host/windows/index.js +1 -1
- package/lib/host/windows/index.js.map +1 -1
- package/lib/host/windows/paths.d.ts +27 -6
- package/lib/host/windows/paths.d.ts.map +1 -1
- package/lib/host/windows/paths.js +40 -13
- package/lib/host/windows/paths.js.map +1 -1
- package/lib/host/windows/run.d.ts.map +1 -1
- package/lib/host/windows/run.js +3 -2
- package/lib/host/windows/run.js.map +1 -1
- package/lib/index.d.ts +72 -56
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +74 -55
- package/lib/index.js.map +1 -1
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +35 -14
- package/cordis.patch.yml +0 -5
|
@@ -10,17 +10,77 @@
|
|
|
10
10
|
* answer. The scan that drives them lives in ./scan.ts.
|
|
11
11
|
*/
|
|
12
12
|
import { spawn } from "node:child_process";
|
|
13
|
-
import { accessSync, constants, realpathSync, statSync } from "node:fs";
|
|
13
|
+
import { accessSync, constants, readdirSync, realpathSync, statSync } from "node:fs";
|
|
14
|
+
import * as path from "node:path";
|
|
14
15
|
import { scrubbedParentEnv } from "@deepseek-ai/dsh-subprocess";
|
|
15
|
-
import { CHECK_TIMEOUT_MS } from "../constants.js";
|
|
16
|
+
import { CHECK_TIMEOUT_MS, WINDOWS_VERSION_UNKNOWN } from "../constants.js";
|
|
16
17
|
import { firstLine } from "../status.js";
|
|
18
|
+
/** A Chromium install's version folder name: `155.0.8059.85`. */
|
|
19
|
+
const VERSION_FOLDER = /^\d+\.\d+\.\d+\.\d+$/u;
|
|
20
|
+
/** The "not found" rejection, carrying code "ENOENT" for the scan to drop. */
|
|
21
|
+
function missingExecutable(target) {
|
|
22
|
+
const missing = new Error(`Chrome executable not found: ${target}`);
|
|
23
|
+
Object.defineProperty(missing, "code", { value: "ENOENT", writable: true, enumerable: false, configurable: true });
|
|
24
|
+
return missing;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The version a Windows install states without being run: the highest
|
|
28
|
+
* `<major>.<minor>.<build>.<patch>` folder beside the executable (the layout
|
|
29
|
+
* Chrome, Edge, Brave and Chromium all install with), or
|
|
30
|
+
* {@link WINDOWS_VERSION_UNKNOWN} when none is there. A missing file rejects
|
|
31
|
+
* like the spawn would; a bare name (no folder to look in) answers unknown.
|
|
32
|
+
*/
|
|
33
|
+
export function readWindowsInstallVersion(target) {
|
|
34
|
+
const win = path.win32;
|
|
35
|
+
if (!target.includes("/") && !target.includes("\\"))
|
|
36
|
+
return WINDOWS_VERSION_UNKNOWN;
|
|
37
|
+
let isFile = false;
|
|
38
|
+
try {
|
|
39
|
+
isFile = statSync(target).isFile();
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
// Absent — answered below like a spawn's ENOENT.
|
|
43
|
+
}
|
|
44
|
+
if (!isFile)
|
|
45
|
+
throw missingExecutable(target);
|
|
46
|
+
let names;
|
|
47
|
+
try {
|
|
48
|
+
names = readdirSync(win.dirname(target));
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
return WINDOWS_VERSION_UNKNOWN;
|
|
52
|
+
}
|
|
53
|
+
const versions = names.filter((name) => VERSION_FOLDER.test(name));
|
|
54
|
+
if (versions.length === 0)
|
|
55
|
+
return WINDOWS_VERSION_UNKNOWN;
|
|
56
|
+
const parts = (name) => name.split(".").map(Number);
|
|
57
|
+
versions.sort((a, b) => {
|
|
58
|
+
const [pa, pb] = [parts(a), parts(b)];
|
|
59
|
+
for (let i = 0; i < 4; i++)
|
|
60
|
+
if (pa[i] !== pb[i])
|
|
61
|
+
return pa[i] - pb[i];
|
|
62
|
+
return 0;
|
|
63
|
+
});
|
|
64
|
+
return versions[versions.length - 1];
|
|
65
|
+
}
|
|
17
66
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
67
|
+
* Answer one executable's version. On Windows nothing is spawned — a Chromium
|
|
68
|
+
* browser asked `--version` there opens a window instead of answering — and
|
|
69
|
+
* the version is read off the install ({@link readWindowsInstallVersion}).
|
|
70
|
+
* Everywhere else: one `chromePath --version` probe (scrubbed parent env,
|
|
71
|
+
* bounded timeout). Resolves the first stdout line (the version); ENOENT
|
|
72
|
+
* rejects with "Chrome executable not found: <path>" carrying code "ENOENT"; a
|
|
73
|
+
* non-zero exit rejects with the first non-empty stderr/stdout line.
|
|
22
74
|
*/
|
|
23
|
-
export function probeExecutable(target) {
|
|
75
|
+
export function probeExecutable(target, platform = process.platform) {
|
|
76
|
+
if (platform === "win32") {
|
|
77
|
+
try {
|
|
78
|
+
return Promise.resolve(readWindowsInstallVersion(target));
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
return Promise.reject(error);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
24
84
|
return new Promise((resolve, reject) => {
|
|
25
85
|
let child;
|
|
26
86
|
try {
|
|
@@ -42,9 +102,7 @@ export function probeExecutable(target) {
|
|
|
42
102
|
child.on("error", (error) => {
|
|
43
103
|
const code = error && typeof error.code === "string" ? error.code : "";
|
|
44
104
|
if (code === "ENOENT") {
|
|
45
|
-
|
|
46
|
-
Object.defineProperty(missing, "code", { value: "ENOENT", writable: true, enumerable: false, configurable: true });
|
|
47
|
-
reject(missing);
|
|
105
|
+
reject(missingExecutable(target));
|
|
48
106
|
return;
|
|
49
107
|
}
|
|
50
108
|
reject(new Error(`could not run "${target} --version": ${String(error)}`));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"probe.js","sourceRoot":"","sources":["../../../src/host/discovery/probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"probe.js","sourceRoot":"","sources":["../../../src/host/discovery/probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACrF,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,iEAAiE;AACjE,MAAM,cAAc,GAAG,uBAAuB,CAAC;AAE/C,8EAA8E;AAC9E,SAAS,iBAAiB,CAAC,MAAc;IACrC,MAAM,OAAO,GAAG,IAAI,KAAK,CAAC,gCAAgC,MAAM,EAAE,CAAC,CAAC;IACpE,MAAM,CAAC,cAAc,CAAC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AAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,aAAa,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC9H,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,MAAM,uBAAuB,MAAM,EAAE,CAAC,CAAC,CAAC;gBAC7D,OAAO;YACX,CAAC;YACD,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC;AAED;;;;qBAIqB;AACrB,MAAM,UAAU,aAAa,CAAC,SAAiB;IAC3C,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACvE,IAAI,CAAC;QACD,iEAAiE;QACjE,4DAA4D;QAC5D,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE;YAAE,OAAO,KAAK,CAAC;QAChD,UAAU,CAAC,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC;IAChB,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,KAAK,CAAC;IACjB,CAAC;AACL,CAAC;AAED;;oDAEoD;AACpD,MAAM,UAAU,QAAQ,CAAC,SAAiB;IACtC,IAAI,CAAC;QACD,OAAO,YAAY,CAAC,SAAS,CAAC,CAAC;IACnC,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,SAAS,CAAC;IACrB,CAAC;AACL,CAAC"}
|
|
@@ -11,9 +11,9 @@ import type { ChromeExecutableStatus, ChromeMcpConfig } from "../types/index.js"
|
|
|
11
11
|
*
|
|
12
12
|
* - absent / not executable → dropped without a spawn,
|
|
13
13
|
* - `blockedForPlatform` answers non-empty → **no spawn**: the candidate keeps
|
|
14
|
-
* its place carrying that reason
|
|
15
|
-
* WSL host, whose probe would start a browser
|
|
16
|
-
* see {@link WSL_WINDOWS_LAUNCH_ERROR}),
|
|
14
|
+
* its place carrying that reason as a `note`, never as a failure (the one case
|
|
15
|
+
* is a Windows `chrome.exe` on a WSL host, whose probe would start a browser
|
|
16
|
+
* instance it can never drive — see {@link WSL_WINDOWS_LAUNCH_ERROR}),
|
|
17
17
|
* - two spellings of the same binary collapse into the first one seen.
|
|
18
18
|
*
|
|
19
19
|
* An empty candidate list resolves `[]` (nothing probed: unknown platform, or a
|
|
@@ -44,8 +44,12 @@ export declare function discoverChrome(candidatePaths: string[], blockedForPlatf
|
|
|
44
44
|
* `chromePaths`, default {@link defaultChromePaths}) and report the first
|
|
45
45
|
* runnable entry. Nothing usable → the known executable-missing error;
|
|
46
46
|
* only-present-but-broken entries → that entry's failure.
|
|
47
|
-
*
|
|
48
|
-
*
|
|
47
|
+
* - the extra flags leave the check mute: they declare a connect mode
|
|
48
|
+
* (`--browserUrl` / `--browser-url` / `-u`, `--wsEndpoint` /
|
|
49
|
+
* `--ws-endpoint` / `-w`, `--autoConnect` / `--auto-connect`), name a
|
|
50
|
+
* config file (`--config`), or fix another `--channel` than the `stable`
|
|
51
|
+
* the candidate list models → resolve "": there is no local executable
|
|
52
|
+
* this check could honestly answer for.
|
|
49
53
|
* - `blockedForPlatform` answers non-empty for what is selected → resolve "" with
|
|
50
54
|
* **no spawn**. A Windows `chrome.exe` on a WSL host is the case: its
|
|
51
55
|
* `--version` probe answers (which is why the selection looks healthy) but
|
|
@@ -53,12 +57,13 @@ export declare function discoverChrome(candidatePaths: string[], blockedForPlatf
|
|
|
53
57
|
* a browser instance no tool call could drive
|
|
54
58
|
* ({@link WSL_WINDOWS_LAUNCH_ERROR}).
|
|
55
59
|
*
|
|
56
|
-
* A run that probes **nothing** (no candidates, a connect mode,
|
|
57
|
-
*
|
|
60
|
+
* A run that probes **nothing** (no candidates, a connect mode, a config file
|
|
61
|
+
* or another channel standing in for the local executable, or a blocked path)
|
|
62
|
+
* resolves "" — callers must treat that as "no evidence", never as health.
|
|
58
63
|
*
|
|
59
64
|
* @param entry - validated {@link ChromeMcpConfig}.
|
|
60
|
-
* @param extraFlags - the flags list the bridge currently launches with;
|
|
61
|
-
* inspected for
|
|
65
|
+
* @param extraFlags - the flags list the bridge currently launches with;
|
|
66
|
+
* inspected for the entries that leave the check mute.
|
|
62
67
|
* @param blockedForPlatform - answers a reason for a path this host must never
|
|
63
68
|
* exec, `""` for one it may probe.
|
|
64
69
|
* @returns the executable version line, or "" when nothing is probed.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../../../src/host/discovery/scan.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../../../src/host/discovery/scan.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAKjF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,qBAAqB,CACvC,UAAU,EAAE,MAAM,EAAE,EACpB,kBAAkB,GAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAiB,GAC7D,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAmDnC;AAED;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAChC,cAAc,EAAE,MAAM,EAAE,EACxB,kBAAkB,GAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAiB,GAC7D,OAAO,CAAC,MAAM,CAAC,CAoBjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,WAAW,CACvB,KAAK,EAAE,eAAe,EACtB,UAAU,CAAC,EAAE,MAAM,EAAE,EACrB,kBAAkB,GAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAiB,GAC7D,OAAO,CAAC,MAAM,CAAC,CAUjB"}
|
|
@@ -13,16 +13,21 @@
|
|
|
13
13
|
* therefore probes eagerly: there is no "auto" mode, the scan lists what exists,
|
|
14
14
|
* the card picks one of them, and what is picked stays picked.
|
|
15
15
|
*
|
|
16
|
-
* WSL NOTE: the executable
|
|
17
|
-
* chrome.exe through the WSL interop layer fails:
|
|
18
|
-
* with `pipe: true` (inherited fd 3/4), and
|
|
19
|
-
* receive those pipes from WSL; the WebSocket
|
|
20
|
-
* the DevToolsActivePort file, unreachable
|
|
21
|
-
* empirically 2025-09-19 (.probe/)
|
|
22
|
-
*
|
|
16
|
+
* WSL NOTE: the executable the bridge *launches* has to be a Linux binary.
|
|
17
|
+
* Launching the Windows chrome.exe through the WSL interop layer fails:
|
|
18
|
+
* chrome-devtools-mcp connects with `pipe: true` (inherited fd 3/4), and
|
|
19
|
+
* Windows-side processes cannot receive those pipes from WSL; the WebSocket
|
|
20
|
+
* fallback hard-codes 127.0.0.1 in the DevToolsActivePort file, unreachable
|
|
21
|
+
* across the WSL2 NAT bridge. Verified empirically 2025-09-19 (.probe/). What
|
|
22
|
+
* the Windows side *is* good for is connect mode, so on a WSL host the Windows
|
|
23
|
+
* executables join the candidate list as `blockedForPlatform` answers it —
|
|
24
|
+
* visible, selectable, never spawned — and the run that drives them is the
|
|
25
|
+
* **Prelaunch Windows Chrome** one. Never spawn a blocked candidate.
|
|
23
26
|
*/
|
|
24
|
-
import {
|
|
27
|
+
import { flagsSkipProbe } from "../flags.js";
|
|
25
28
|
import { firstLine } from "../status.js";
|
|
29
|
+
import { readConfigField } from "../values.js";
|
|
30
|
+
import { windowsPathToMount } from "../windows/paths.js";
|
|
26
31
|
import { defaultChromePaths } from "./candidates.js";
|
|
27
32
|
import { identity, presentOnDisk, probeExecutable } from "./probe.js";
|
|
28
33
|
/**
|
|
@@ -37,9 +42,9 @@ import { identity, presentOnDisk, probeExecutable } from "./probe.js";
|
|
|
37
42
|
*
|
|
38
43
|
* - absent / not executable → dropped without a spawn,
|
|
39
44
|
* - `blockedForPlatform` answers non-empty → **no spawn**: the candidate keeps
|
|
40
|
-
* its place carrying that reason
|
|
41
|
-
* WSL host, whose probe would start a browser
|
|
42
|
-
* see {@link WSL_WINDOWS_LAUNCH_ERROR}),
|
|
45
|
+
* its place carrying that reason as a `note`, never as a failure (the one case
|
|
46
|
+
* is a Windows `chrome.exe` on a WSL host, whose probe would start a browser
|
|
47
|
+
* instance it can never drive — see {@link WSL_WINDOWS_LAUNCH_ERROR}),
|
|
43
48
|
* - two spellings of the same binary collapse into the first one seen.
|
|
44
49
|
*
|
|
45
50
|
* An empty candidate list resolves `[]` (nothing probed: unknown platform, or a
|
|
@@ -60,13 +65,22 @@ export async function scanChromeExecutables(candidates, blockedForPlatform = ()
|
|
|
60
65
|
const blocked = blockedForPlatform(path);
|
|
61
66
|
if (blocked !== "") {
|
|
62
67
|
// Never spawned: what a blocked candidate would do is start a
|
|
63
|
-
// browser this host could not drive. It
|
|
64
|
-
//
|
|
65
|
-
|
|
68
|
+
// browser this host could not drive. It keeps its place on the list
|
|
69
|
+
// carrying that reason as a **note** — what gets reported is what
|
|
70
|
+
// this host could not do with the path, not whether it is there, and
|
|
71
|
+
// reporting it as a failure would read as a broken executable.
|
|
72
|
+
//
|
|
73
|
+
// The seen key folds through the interop mount, because the same
|
|
74
|
+
// executable reaches this list in either spelling: the Windows one
|
|
75
|
+
// the locate answers, and the mount one a saved row or the row config
|
|
76
|
+
// can carry (the only spelling the WSL side can stat). One executable
|
|
77
|
+
// answers once, under the first spelling seen.
|
|
78
|
+
const mounted = windowsPathToMount(path);
|
|
79
|
+
const key = `blocked\u0000${identity(mounted !== "" ? mounted : path)}`;
|
|
66
80
|
if (seen.has(key))
|
|
67
81
|
continue;
|
|
68
82
|
seen.add(key);
|
|
69
|
-
statuses.push({ path, version: "", error: blocked });
|
|
83
|
+
statuses.push({ path, version: "", error: "", note: blocked });
|
|
70
84
|
continue;
|
|
71
85
|
}
|
|
72
86
|
if (!presentOnDisk(path))
|
|
@@ -77,7 +91,7 @@ export async function scanChromeExecutables(candidates, blockedForPlatform = ()
|
|
|
77
91
|
if (seen.has(key))
|
|
78
92
|
continue;
|
|
79
93
|
seen.add(key);
|
|
80
|
-
statuses.push({ path, version, error: "" });
|
|
94
|
+
statuses.push({ path, version, error: "", note: "" });
|
|
81
95
|
}
|
|
82
96
|
catch (error) {
|
|
83
97
|
const code = (error instanceof Error && typeof error.code === "string")
|
|
@@ -92,7 +106,8 @@ export async function scanChromeExecutables(candidates, blockedForPlatform = ()
|
|
|
92
106
|
statuses.push({
|
|
93
107
|
path,
|
|
94
108
|
version: "",
|
|
95
|
-
error: firstLine(error instanceof Error ? error.message : String(error))
|
|
109
|
+
error: firstLine(error instanceof Error ? error.message : String(error)),
|
|
110
|
+
note: ""
|
|
96
111
|
});
|
|
97
112
|
}
|
|
98
113
|
}
|
|
@@ -121,6 +136,14 @@ export async function discoverChrome(candidatePaths, blockedForPlatform = () =>
|
|
|
121
136
|
const broken = found.find((status) => status.error !== "");
|
|
122
137
|
if (broken !== void 0)
|
|
123
138
|
throw new Error(broken.error);
|
|
139
|
+
// A note is the other half of "nothing answered": the candidate is there, it
|
|
140
|
+
// is simply not launchable as a local executable from this host (the one
|
|
141
|
+
// case is a Windows executable under WSL), and the note names the run that
|
|
142
|
+
// drives it.
|
|
143
|
+
const noted = found.find((status) => status.note !== "");
|
|
144
|
+
if (noted !== void 0) {
|
|
145
|
+
throw new Error(`Chrome executable not found: no executable detected for this host (checked: ${candidates.join(", ")}); ${noted.note}`);
|
|
146
|
+
}
|
|
124
147
|
throw new Error(`Chrome executable not found: no executable detected (checked: ${candidates.join(", ")})`);
|
|
125
148
|
}
|
|
126
149
|
/**
|
|
@@ -133,8 +156,12 @@ export async function discoverChrome(candidatePaths, blockedForPlatform = () =>
|
|
|
133
156
|
* `chromePaths`, default {@link defaultChromePaths}) and report the first
|
|
134
157
|
* runnable entry. Nothing usable → the known executable-missing error;
|
|
135
158
|
* only-present-but-broken entries → that entry's failure.
|
|
136
|
-
*
|
|
137
|
-
*
|
|
159
|
+
* - the extra flags leave the check mute: they declare a connect mode
|
|
160
|
+
* (`--browserUrl` / `--browser-url` / `-u`, `--wsEndpoint` /
|
|
161
|
+
* `--ws-endpoint` / `-w`, `--autoConnect` / `--auto-connect`), name a
|
|
162
|
+
* config file (`--config`), or fix another `--channel` than the `stable`
|
|
163
|
+
* the candidate list models → resolve "": there is no local executable
|
|
164
|
+
* this check could honestly answer for.
|
|
138
165
|
* - `blockedForPlatform` answers non-empty for what is selected → resolve "" with
|
|
139
166
|
* **no spawn**. A Windows `chrome.exe` on a WSL host is the case: its
|
|
140
167
|
* `--version` probe answers (which is why the selection looks healthy) but
|
|
@@ -142,26 +169,25 @@ export async function discoverChrome(candidatePaths, blockedForPlatform = () =>
|
|
|
142
169
|
* a browser instance no tool call could drive
|
|
143
170
|
* ({@link WSL_WINDOWS_LAUNCH_ERROR}).
|
|
144
171
|
*
|
|
145
|
-
* A run that probes **nothing** (no candidates, a connect mode,
|
|
146
|
-
*
|
|
172
|
+
* A run that probes **nothing** (no candidates, a connect mode, a config file
|
|
173
|
+
* or another channel standing in for the local executable, or a blocked path)
|
|
174
|
+
* resolves "" — callers must treat that as "no evidence", never as health.
|
|
147
175
|
*
|
|
148
176
|
* @param entry - validated {@link ChromeMcpConfig}.
|
|
149
|
-
* @param extraFlags - the flags list the bridge currently launches with;
|
|
150
|
-
* inspected for
|
|
177
|
+
* @param extraFlags - the flags list the bridge currently launches with;
|
|
178
|
+
* inspected for the entries that leave the check mute.
|
|
151
179
|
* @param blockedForPlatform - answers a reason for a path this host must never
|
|
152
180
|
* exec, `""` for one it may probe.
|
|
153
181
|
* @returns the executable version line, or "" when nothing is probed.
|
|
154
182
|
*/
|
|
155
183
|
export function checkChrome(entry, extraFlags, blockedForPlatform = () => "") {
|
|
156
|
-
|
|
184
|
+
// The two config fields read here are volatile, so what they carry is either a
|
|
185
|
+
// reference or the value a caller handed in explicitly.
|
|
186
|
+
const target = readConfigField(entry.chromePath, "").trim();
|
|
157
187
|
if (target !== "")
|
|
158
188
|
return blockedForPlatform(target) !== "" ? Promise.resolve("") : probeExecutable(target);
|
|
159
|
-
const flags =
|
|
160
|
-
|
|
161
|
-
: Array.isArray(entry.extraFlags)
|
|
162
|
-
? entry.extraFlags
|
|
163
|
-
: [];
|
|
164
|
-
if (flags.some((flag) => typeof flag === "string" && carriesConnectionMode(flag))) {
|
|
189
|
+
const flags = extraFlags === void 0 ? readConfigField(entry.extraFlags, []) : extraFlags;
|
|
190
|
+
if (flagsSkipProbe(flags)) {
|
|
165
191
|
return Promise.resolve("");
|
|
166
192
|
}
|
|
167
193
|
return discoverChrome(entry.chromePaths, blockedForPlatform);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scan.js","sourceRoot":"","sources":["../../../src/host/discovery/scan.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"scan.js","sourceRoot":"","sources":["../../../src/host/discovery/scan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAGzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACvC,UAAoB,EACpB,qBAAoD,GAAG,EAAE,CAAC,EAAE;IAE5D,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAA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,EAAE,CAAC,EAAE;IAE5D,+EAA+E;IAC/E,wDAAwD;IACxD,MAAM,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC5D,IAAI,MAAM,KAAK,EAAE;QAAE,OAAO,kBAAkB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAC5G,MAAM,KAAK,GAAG,UAAU,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;IACzF,IAAI,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,cAAc,CAAC,KAAK,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;AACjE,CAAC"}
|
package/lib/host/flags.d.ts
CHANGED
|
@@ -30,12 +30,35 @@ export declare function extractExecutablePathFlag(flags: unknown): string;
|
|
|
30
30
|
* A `--flag <path>` spelling consumes the following entry; a flag-looking next
|
|
31
31
|
* entry keeps it (nothing was meant as the value). */
|
|
32
32
|
export declare function stripExecutablePathFlags(flags: unknown): string[];
|
|
33
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* True when one extraFlag declares a connect mode (the bridge will not launch a
|
|
35
|
+
* local executable). Upstream spellings (docs/configuration.md): the two URL
|
|
36
|
+
* options — `--browserUrl`/`--browser-url`/`-u` and
|
|
37
|
+
* `--wsEndpoint`/`--ws-endpoint`/`-w` — plus `--autoConnect`/`--auto-connect`,
|
|
38
|
+
* which attaches to an already-running Chrome (Chrome 144+) instead of starting
|
|
39
|
+
* one. Each form counts with its value inline (`=`), carried as the following
|
|
40
|
+
* entry (the whitespace-split env source's spelling), or bare.
|
|
41
|
+
*/
|
|
34
42
|
export declare function carriesConnectionMode(flag: string): boolean;
|
|
35
|
-
/** True when
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
*
|
|
43
|
+
/** True when one extraFlag names a config file. */
|
|
44
|
+
export declare function carriesConfigFile(flag: unknown): boolean;
|
|
45
|
+
/** True when one extraFlag fixes the update channel to something other than
|
|
46
|
+
* `stable` (the default the candidate list models). `next` is the entry that
|
|
47
|
+
* follows a bare `--channel`; a value equal to the default is not a skip. */
|
|
48
|
+
export declare function carriesOtherChannel(flag: unknown, next?: unknown): boolean;
|
|
49
|
+
/** True when an executable probe could not answer here, whatever the host
|
|
50
|
+
* carries: the bridge connects instead of launching (connect mode), the
|
|
51
|
+
* executable it runs came from a config file, or the channel it looks in is
|
|
52
|
+
* not the `stable` one the candidate list models. A check that ran **no**
|
|
53
|
+
* probe answers `""` — *no evidence*, never health: it must not clear
|
|
54
|
+
* `lastError` nor the known `chromeMissing` state. */
|
|
55
|
+
export declare function flagsSkipProbe(flags: unknown): boolean;
|
|
56
|
+
/** True when any entry of a flags list declares connect mode — the connect
|
|
57
|
+
* half that answers the live `carriesConnectionMode` mirror, keys the pill
|
|
58
|
+
* relabel on, and drops `--executablePath` from the argv. For what spares the
|
|
59
|
+
* *executable check* there is the wider {@link flagsSkipProbe}: a config file
|
|
60
|
+
* and a non-`stable` channel also leave the probe mute, while the bridge still
|
|
61
|
+
* launches a local executable. */
|
|
39
62
|
export declare function flagsSkipCheck(flags: unknown): boolean;
|
|
40
63
|
/** True when two flags lists are element-wise equal (flags are arrays). */
|
|
41
64
|
export declare function sameFlags(a: unknown, b: unknown): boolean;
|
package/lib/host/flags.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flags.d.ts","sourceRoot":"","sources":["../../src/host/flags.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flags.d.ts","sourceRoot":"","sources":["../../src/host/flags.ts"],"names":[],"mappings":"AAsBA;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAkBvD;AAED;;;;iBAIiB;AACjB,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE3D;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAWhE;AAED;;;;sDAIsD;AACtD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAejE;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE3D;AAQD,mDAAmD;AACnD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAExD;AAQD;;6EAE6E;AAC7E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAa1E;AAED;;;;;sDAKsD;AACtD,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAStD;AAED;;;;;kCAKkC;AAClC,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEtD;AAED,2EAA2E;AAC3E,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CAGzD"}
|
package/lib/host/flags.js
CHANGED
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
* Flags are execve'd as argv entries — never through a shell — so validation
|
|
6
6
|
* rejects control characters only, and the executable pin / connect-mode
|
|
7
7
|
* options are matched against their upstream spellings (`--executablePath`,
|
|
8
|
-
* `--executable-path`, `-e
|
|
8
|
+
* `--executable-path`, `-e`; the connect group `--browserUrl`/`--browser-url`/
|
|
9
|
+
* `-u`, `--wsEndpoint`/`--ws-endpoint`/`-w`, `--autoConnect`/`--auto-connect`;
|
|
10
|
+
* plus the probe-skipping `--config` and `--channel`).
|
|
9
11
|
*
|
|
10
12
|
* One rule has since hardened: pinning the executable by flag is a second
|
|
11
13
|
* source of truth for the same lever the executable picker owns, so a
|
|
@@ -98,14 +100,80 @@ export function stripExecutablePathFlags(flags) {
|
|
|
98
100
|
}
|
|
99
101
|
return stripped;
|
|
100
102
|
}
|
|
101
|
-
/**
|
|
103
|
+
/**
|
|
104
|
+
* True when one extraFlag declares a connect mode (the bridge will not launch a
|
|
105
|
+
* local executable). Upstream spellings (docs/configuration.md): the two URL
|
|
106
|
+
* options — `--browserUrl`/`--browser-url`/`-u` and
|
|
107
|
+
* `--wsEndpoint`/`--ws-endpoint`/`-w` — plus `--autoConnect`/`--auto-connect`,
|
|
108
|
+
* which attaches to an already-running Chrome (Chrome 144+) instead of starting
|
|
109
|
+
* one. Each form counts with its value inline (`=`), carried as the following
|
|
110
|
+
* entry (the whitespace-split env source's spelling), or bare.
|
|
111
|
+
*/
|
|
102
112
|
export function carriesConnectionMode(flag) {
|
|
103
|
-
return
|
|
113
|
+
return /^(?:--(?:auto[-]?connect|browser[-]?url|ws[-]?endpoint)(?:=|(?=\s)|$)|-[uw]\b)/iu.test(flag);
|
|
114
|
+
}
|
|
115
|
+
/** One config-file flag, `--config <file>` (also matched for the
|
|
116
|
+
* `--config-path` spelling). A JSON config can fix the executable and the
|
|
117
|
+
* connect mode itself, so the bridge argv no longer states locally what will
|
|
118
|
+
* run — the check would only guess. */
|
|
119
|
+
const CONFIG_FILE_FLAG = /^--config(?:-path)?(?:=|(?=\s)|$)/iu;
|
|
120
|
+
/** True when one extraFlag names a config file. */
|
|
121
|
+
export function carriesConfigFile(flag) {
|
|
122
|
+
return typeof flag === "string" && CONFIG_FILE_FLAG.test(flag);
|
|
123
|
+
}
|
|
124
|
+
/** One `--channel` flag. Its value picks where upstream looks for a browser
|
|
125
|
+
* (`canary`/`dev`/`beta`/`stable`); the check's own candidate list models only
|
|
126
|
+
* `stable`, so any other value makes it answer "not found" about a browser
|
|
127
|
+
* living in another channel. */
|
|
128
|
+
const CHANNEL_FLAG = /^--channel(?:=|(?=\s)|$)/iu;
|
|
129
|
+
/** True when one extraFlag fixes the update channel to something other than
|
|
130
|
+
* `stable` (the default the candidate list models). `next` is the entry that
|
|
131
|
+
* follows a bare `--channel`; a value equal to the default is not a skip. */
|
|
132
|
+
export function carriesOtherChannel(flag, next) {
|
|
133
|
+
if (typeof flag !== "string" || !CHANNEL_FLAG.test(flag))
|
|
134
|
+
return false;
|
|
135
|
+
const eq = flag.indexOf("=");
|
|
136
|
+
let value;
|
|
137
|
+
if (eq !== -1) {
|
|
138
|
+
value = flag.slice(eq + 1).trim();
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
const whitespace = /\s/u.exec(flag);
|
|
142
|
+
if (whitespace !== null)
|
|
143
|
+
value = flag.slice(whitespace.index + 1).trim();
|
|
144
|
+
else if (typeof next === "string" && !next.startsWith("-"))
|
|
145
|
+
value = next.trim();
|
|
146
|
+
else
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
return value !== "" && value.toLowerCase() !== "stable";
|
|
150
|
+
}
|
|
151
|
+
/** True when an executable probe could not answer here, whatever the host
|
|
152
|
+
* carries: the bridge connects instead of launching (connect mode), the
|
|
153
|
+
* executable it runs came from a config file, or the channel it looks in is
|
|
154
|
+
* not the `stable` one the candidate list models. A check that ran **no**
|
|
155
|
+
* probe answers `""` — *no evidence*, never health: it must not clear
|
|
156
|
+
* `lastError` nor the known `chromeMissing` state. */
|
|
157
|
+
export function flagsSkipProbe(flags) {
|
|
158
|
+
if (!Array.isArray(flags))
|
|
159
|
+
return false;
|
|
160
|
+
for (let index = 0; index < flags.length; index += 1) {
|
|
161
|
+
const flag = flags[index];
|
|
162
|
+
if (typeof flag !== "string")
|
|
163
|
+
continue;
|
|
164
|
+
if (carriesConnectionMode(flag) || carriesConfigFile(flag))
|
|
165
|
+
return true;
|
|
166
|
+
if (CHANNEL_FLAG.test(flag) && carriesOtherChannel(flag, flags[index + 1]))
|
|
167
|
+
return true;
|
|
168
|
+
}
|
|
169
|
+
return false;
|
|
104
170
|
}
|
|
105
|
-
/** True when any entry of a flags list declares connect mode — the
|
|
106
|
-
* that
|
|
107
|
-
*
|
|
108
|
-
* {@link
|
|
171
|
+
/** True when any entry of a flags list declares connect mode — the connect
|
|
172
|
+
* half that answers the live `carriesConnectionMode` mirror, keys the pill
|
|
173
|
+
* relabel on, and drops `--executablePath` from the argv. For what spares the
|
|
174
|
+
* *executable check* there is the wider {@link flagsSkipProbe}: a config file
|
|
175
|
+
* and a non-`stable` channel also leave the probe mute, while the bridge still
|
|
176
|
+
* launches a local executable. */
|
|
109
177
|
export function flagsSkipCheck(flags) {
|
|
110
178
|
return Array.isArray(flags) && flags.some((flag) => typeof flag === "string" && carriesConnectionMode(flag));
|
|
111
179
|
}
|
package/lib/host/flags.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../../src/host/flags.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../../src/host/flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,yEAAyE;AACzE,MAAM,oBAAoB,GAAG,4DAA4D,CAAC;AAE1F;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAc;IAC7C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC9D,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;YAC1C,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;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E,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,mBAAmB,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YAAE,OAAO,IAAI,CAAC;IAC5F,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC;AAED;;;;;kCAKkC;AAClC,MAAM,UAAU,cAAc,CAAC,KAAc;IACzC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC;AACjH,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,SAAS,CAAC,CAAU,EAAE,CAAU;IAC5C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAClF,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,KAAM,CAAc,CAAC,KAAK,CAAC,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { KindOption, McpKind, ServerEntry } from "@comecaramelos/dsh-mcp-manager/api";
|
|
2
|
+
import type { Controller } from "./controller/index.js";
|
|
3
|
+
/** Split one `lines` field's value into its flags. Missing/blank answers nothing
|
|
4
|
+
* — the entry carries no own answer, so the caller falls through to the row. */
|
|
5
|
+
export declare function parseFlagLines(value: unknown): string[] | undefined;
|
|
6
|
+
/** Join one flags list back into a `lines` field value (round-trips with
|
|
7
|
+
* {@link parseFlagLines}). */
|
|
8
|
+
export declare function joinFlagLines(flags: readonly string[]): string;
|
|
9
|
+
/**
|
|
10
|
+
* What the executable field offers: the saved rows first, then every path the
|
|
11
|
+
* last scan reported, then the Windows-side executables a WSL host carries, then
|
|
12
|
+
* the path a live connection actually launches with — the running path is the
|
|
13
|
+
* answer the Host knows best, and it may not be a saved row yet. A stored pick
|
|
14
|
+
* the choices stop carrying stays offered by the card itself, so it never
|
|
15
|
+
* silently becomes another one.
|
|
16
|
+
*/
|
|
17
|
+
export declare function executableChoices(controller: Controller): readonly KindOption[];
|
|
18
|
+
/** The executable one entry launches with: its own pick, else what the row's
|
|
19
|
+
* layers resolve (the user layer, then the row config with a legacy
|
|
20
|
+
* `--executablePath` folded in) — never a scan answer and never a re-resolve. */
|
|
21
|
+
export declare function entryExecutable(entry: ServerEntry, controller: Controller): string;
|
|
22
|
+
/** The flags one entry launches with: its own `lines` field, else the row's
|
|
23
|
+
* resolved precedence (user layer > `DSH_CHROME_MCP_FLAGS` > row config > the
|
|
24
|
+
* schema default). */
|
|
25
|
+
export declare function entryExtraFlags(entry: ServerEntry, controller: Controller): string[];
|
|
26
|
+
/** The console-output mode one entry runs with: its own pick, else the row's
|
|
27
|
+
* answer. Never a third state. The field is a toggle (`"true"` = reduce = log
|
|
28
|
+
* file); the `log`/`console` it stored while it was a choice still read. */
|
|
29
|
+
export declare function entryStderrMode(entry: ServerEntry, controller: Controller): "log" | "console";
|
|
30
|
+
/** The `chrome` kind: the local `chrome-devtools-mcp` bridge — what the row used
|
|
31
|
+
* to start for itself, now as one of the manager's connections. */
|
|
32
|
+
export declare function createChromeKind(controller: Controller): McpKind;
|
|
33
|
+
/** The `chrome-windows` kind: the Windows browser driven through the WSL interop
|
|
34
|
+
* mount. `resolve` runs the prelaunch itself — locate, prereq, free port,
|
|
35
|
+
* launch, wait for the bind — and answers the local `chrome-devtools-mcp` in
|
|
36
|
+
* connect mode against that port. The port speaks no MCP; the MCP stays the
|
|
37
|
+
* local process. Off WSL the entry is refused, with the answer the card shows. */
|
|
38
|
+
export declare function createChromeWindowsKind(controller: Controller): McpKind;
|
|
39
|
+
/** The kinds this host can answer, in registration order — `chrome` first,
|
|
40
|
+
* because it is the answer a standalone config translates into by default
|
|
41
|
+
* (./migration.ts). `chrome-windows` is offered on WSL only: anywhere else its
|
|
42
|
+
* `resolve` could only refuse, so the picker never lists it there (a native
|
|
43
|
+
* Windows host drives its own Chrome through `chrome`). */
|
|
44
|
+
export declare function createChromeKinds(controller: Controller): McpKind[];
|
|
45
|
+
//# sourceMappingURL=kind.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kind.d.ts","sourceRoot":"","sources":["../../src/host/kind.ts"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAsB,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAC/G,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD;gFACgF;AAChF,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,SAAS,CAInE;AAED;8BAC8B;AAC9B,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAE9D;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS,UAAU,EAAE,CAe/E;AAED;;iFAEiF;AACjF,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,GAAG,MAAM,CAIlF;AAED;;sBAEsB;AACtB,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,GAAG,MAAM,EAAE,CAIpF;AAED;;4EAE4E;AAC5E,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,GAAG,KAAK,GAAG,SAAS,CAM7F;AAwCD;mEACmE;AACnE,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAgDhE;AAED;;;;kFAIkF;AAClF,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CA8CvE;AAED;;;;2DAI2D;AAC3D,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,EAAE,CAEnE"}
|