@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
|
@@ -1,25 +1,9 @@
|
|
|
1
1
|
import { type WindowsChromeRunOptions } from "../windows/index.js";
|
|
2
|
-
import type { ChromeMcpConfig, PluginContext,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/** Swap the live resolved settings source (installSection hook). */
|
|
8
|
-
setSource(next: () => SettingsResolved): void;
|
|
9
|
-
/** Route one settings commit: relaunch on flag or executable drift, and run
|
|
10
|
-
* one executable refresh on the search trigger. */
|
|
11
|
-
onSettingsChange(): void;
|
|
12
|
-
/** Run one executable refresh (probe the candidates, merge what is found
|
|
13
|
-
* into the saved rows, seed a never-configured host). Runs are serialized so
|
|
14
|
-
* rapid actions never interleave. */
|
|
15
|
-
run(): Promise<unknown>;
|
|
16
|
-
/** Run the Windows Chrome path once (locate, prereq, port, launch, connect)
|
|
17
|
-
* on the same one-run-at-a-time chain the button drives through, and answer
|
|
18
|
-
* with what the run stated. This is the MCP-tool surface of the button: the
|
|
19
|
-
* trigger is the call itself — nothing is persisted, so a booting host never
|
|
20
|
-
* launches a browser on its own. Resolves after the run settles. */
|
|
21
|
-
prelaunchWindowsChrome(): Promise<string>;
|
|
22
|
-
}
|
|
2
|
+
import type { ChromeMcpConfig, PluginContext, WindowsChromeRun } from "../types/index.js";
|
|
3
|
+
import type { Controller } from "./state.js";
|
|
4
|
+
/** Public alias: the controller object the form, commands and kinds work
|
|
5
|
+
* through is the internal `Controller` type itself. */
|
|
6
|
+
export type ChromeMcpController = Controller;
|
|
23
7
|
/**
|
|
24
8
|
* Optional overrides for tests and diagnostics: the Windows Chrome run is the
|
|
25
9
|
* only half that reaches outside the process (it opens TCP sockets and spawns
|
|
@@ -28,13 +12,24 @@ export interface ChromeMcpController {
|
|
|
28
12
|
*/
|
|
29
13
|
export type ChromeMcpControllerDeps = {
|
|
30
14
|
runWindowsChrome?: (options: WindowsChromeRunOptions) => Promise<WindowsChromeRun>;
|
|
15
|
+
/** The Windows-side executables this host carries, in preference order. The
|
|
16
|
+
* machine half of the candidate fold — the real one locates through the
|
|
17
|
+
* interop mount; a test supplies the answer list it wants folded. */
|
|
18
|
+
windowsExecutables?: () => string[];
|
|
19
|
+
/** The platform the WSL probe reads; defaults to `process.platform`. A test
|
|
20
|
+
* that simulates a WSL host through its launch environment states `linux`
|
|
21
|
+
* here too — the environment alone never makes a Windows host WSL. */
|
|
22
|
+
platform?: NodeJS.Platform;
|
|
31
23
|
};
|
|
32
24
|
/**
|
|
33
|
-
* Build the live state for one
|
|
25
|
+
* Build the live state for one row page. The controller is also the public
|
|
26
|
+
* surface (`ChromeMcpController` — the same object the form, the commands and
|
|
27
|
+
* the kinds work through); what each method does lives in the sibling modules.
|
|
34
28
|
* @param ctx - plugin context.
|
|
35
|
-
* @param config - validated
|
|
29
|
+
* @param config - the validated config `apply` received: every `.volatile()`
|
|
30
|
+
* field a reference rather than a value (read them through `readConfigField`).
|
|
36
31
|
* @param deps - optional host overrides (tests replace the Windows run;
|
|
37
32
|
* everything else resolves from this process).
|
|
38
33
|
*/
|
|
39
|
-
export declare function createChromeMcpController(ctx: PluginContext, config: ChromeMcpConfig, deps?: ChromeMcpControllerDeps):
|
|
34
|
+
export declare function createChromeMcpController(ctx: PluginContext, config: ChromeMcpConfig, deps?: ChromeMcpControllerDeps): Controller;
|
|
40
35
|
//# sourceMappingURL=controller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../src/host/controller/controller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../src/host/controller/controller.ts"],"names":[],"mappings":"AAmCA,OAAO,EAAyD,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAY1H,OAAO,KAAK,EACR,eAAe,EAEf,aAAa,EACb,gBAAgB,EACnB,MAAM,mBAAmB,CAAC;AAU3B,OAAO,KAAK,EAAE,UAAU,EAAmB,MAAM,YAAY,CAAC;AAE9D;uDACuD;AACvD,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,MAAM,uBAAuB,GAAG;IAClC,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,uBAAuB,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACnF;;yEAEqE;IACrE,kBAAkB,CAAC,EAAE,MAAM,MAAM,EAAE,CAAC;IACpC;;0EAEsE;IACtE,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC;CAC9B,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,aAAa,EAAE,MAAM,EAAE,eAAe,EAAE,IAAI,GAAE,uBAA4B,GAAG,UAAU,CAgMrI"}
|
|
@@ -1,122 +1,137 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Host half — live state: `createChromeMcpController`.
|
|
3
3
|
*
|
|
4
|
-
* One controller per apply(): the
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* controller methods, never the other way
|
|
4
|
+
* One controller per apply(): the live mirror the Host publishes, the serialized
|
|
5
|
+
* executable runs, the Windows run half, and the capture paths — tool-call
|
|
6
|
+
* results reaching the live mirror. Every live answer is written into
|
|
7
|
+
* `state.live` and published through the volatile references (see ./publish.ts);
|
|
8
|
+
* form commits route in through the controller methods, never the other way
|
|
9
|
+
* round.
|
|
9
10
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* seeds a never-configured host exactly once. A fixed path that later breaks
|
|
16
|
-
* stays fixed and reads broken instead of being re-resolved.
|
|
11
|
+
* Since the component model, the controller starts nothing: every live bridge is
|
|
12
|
+
* a connection of the manager's, answered through ./kind.ts. What this half owns
|
|
13
|
+
* is the machine — the executable catalog and its runs, the Windows run, the
|
|
14
|
+
* layers, and the mirror — plus the seam the manager reads it through (the
|
|
15
|
+
* connection service sits on `state.connections`, installed by ../manager.ts).
|
|
17
16
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
17
|
+
* The executable state keeps the rule that there is no auto mode: the saved
|
|
18
|
+
* **rows** (`{ id: path, name: label }`) are what every picker lists, the
|
|
19
|
+
* *selection* is what the default answers run with, and a run refreshes both —
|
|
20
|
+
* it probes every candidate the rows and the row config carry, merges what it
|
|
21
|
+
* finds into the rows (names kept), and seeds a never-configured host exactly
|
|
22
|
+
* once. A fixed path that later breaks stays fixed and reads broken instead of
|
|
23
|
+
* being re-resolved.
|
|
24
|
+
*
|
|
25
|
+
* This file is only the assembly: it resolves the config-derived pieces, seeds
|
|
26
|
+
* the live mirror, and wires the public methods to the behavior modules that sit
|
|
27
|
+
* alongside it (see ./index.ts for the layout). Everything that actually *does*
|
|
28
|
+
* something lives there, not here.
|
|
22
29
|
*/
|
|
23
|
-
import
|
|
30
|
+
import { existsSync } from "node:fs";
|
|
24
31
|
import { launchEnvironmentOf } from "@deepseek-ai/dsh-launch-environment";
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import { extractExecutablePathFlag, flagsSkipCheck, stripExecutablePathFlags } from "../flags.js";
|
|
32
|
+
import { FLAGS_ENV_VAR, WSL_WINDOWS_LAUNCH_ERROR } from "../constants.js";
|
|
33
|
+
import { flagsSkipCheck } from "../flags.js";
|
|
28
34
|
import { isWindowsExecutablePath, isWindowsSubsystemForLinux } from "../platform.js";
|
|
29
|
-
import { runWindowsChromeConnect } from "../windows/index.js";
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import { noteSelection
|
|
35
|
-
import {
|
|
35
|
+
import { findWindowsChromeExecutables, runWindowsChromeConnect } from "../windows/index.js";
|
|
36
|
+
import { createLiveMirror, readConfigForm, readConfigLayers, readDefaultExtraFlags, readWslExtraFlags, resolveEnvFlags, resolveLaunchFlags, resolveSelection, resolveStderrModeFromLayers } from "../values.js";
|
|
37
|
+
import { registerToolCapture } from "./captures.js";
|
|
38
|
+
import { noteRunning as mirrorRunning } from "./connections.js";
|
|
39
|
+
import { onFormCommit } from "./commits.js";
|
|
40
|
+
import { noteSelection } from "./notes.js";
|
|
41
|
+
import { dismissMigration, } from "./persist.js";
|
|
42
|
+
import { cancelDiscoveryRetry, prelaunchWindowsChrome, queue, selectChromePath } from "./runs.js";
|
|
43
|
+
import { prelaunchWindowsForConnection } from "./windows-run.js";
|
|
36
44
|
/**
|
|
37
|
-
* Build the live state for one
|
|
45
|
+
* Build the live state for one row page. The controller is also the public
|
|
46
|
+
* surface (`ChromeMcpController` — the same object the form, the commands and
|
|
47
|
+
* the kinds work through); what each method does lives in the sibling modules.
|
|
38
48
|
* @param ctx - plugin context.
|
|
39
|
-
* @param config - validated
|
|
49
|
+
* @param config - the validated config `apply` received: every `.volatile()`
|
|
50
|
+
* field a reference rather than a value (read them through `readConfigField`).
|
|
40
51
|
* @param deps - optional host overrides (tests replace the Windows run;
|
|
41
52
|
* everything else resolves from this process).
|
|
42
53
|
*/
|
|
43
54
|
export function createChromeMcpController(ctx, config, deps = {}) {
|
|
44
|
-
// The Windows run half — injectable for
|
|
45
|
-
//
|
|
55
|
+
// The Windows run half — injectable for tests, default is the real one (TCP
|
|
56
|
+
// samples + the interop launch).
|
|
46
57
|
const windowsChrome = typeof deps.runWindowsChrome === "function" ? deps.runWindowsChrome : runWindowsChromeConnect;
|
|
47
58
|
const launchEnvironment = launchEnvironmentOf(ctx);
|
|
48
|
-
const
|
|
59
|
+
const launchFlags = launchEnvironment.get(FLAGS_ENV_VAR)?.value;
|
|
49
60
|
// Where the plugin runs: a WSL host plus a Windows executable is a selection
|
|
50
|
-
// the bridge can never launch (its debug pipes do not cross the interop
|
|
61
|
+
// the local bridge can never launch (its debug pipes do not cross the interop
|
|
51
62
|
// boundary, and its debugging port stays on the Windows loopback). The launch
|
|
52
63
|
// environment is authoritative inside a host, so the answer is deterministic;
|
|
53
64
|
// a bare call falls back to the interop marker.
|
|
54
|
-
const wslHost = isWindowsSubsystemForLinux({ env: (name) => launchEnvironment.get(name)?.value });
|
|
65
|
+
const wslHost = isWindowsSubsystemForLinux({ platform: deps.platform, env: (name) => launchEnvironment.get(name)?.value });
|
|
66
|
+
// The Linux half of the host: the executable candidate list models the
|
|
67
|
+
// stable-channel installs a Linux host carries, so this is what keys the
|
|
68
|
+
// executable-missing answer's advice (see runs.ts). WSL is the case with the
|
|
69
|
+
// Windows-side alternative next to it.
|
|
70
|
+
const linuxHost = process.platform === "linux";
|
|
55
71
|
// A path this host must never exec. There is only one: a Windows
|
|
56
72
|
// `chrome.exe` selected on a WSL host. Its `--version` probe answers (so the
|
|
57
73
|
// selection looks healthy) but answering attaches to the Windows browser
|
|
58
74
|
// session, and that **starts a browser instance** no tool call could drive —
|
|
59
|
-
// see WSL_WINDOWS_LAUNCH_ERROR. The
|
|
75
|
+
// see WSL_WINDOWS_LAUNCH_ERROR. The runs keep such an entry visible carrying
|
|
60
76
|
// this reason; the probe answers nothing instead of paying for it.
|
|
61
77
|
const blockedForPlatform = (candidate) => wslHost && isWindowsExecutablePath(candidate) ? WSL_WINDOWS_LAUNCH_ERROR : "";
|
|
62
|
-
//
|
|
63
|
-
//
|
|
64
|
-
//
|
|
65
|
-
//
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
78
|
+
// The Windows-side executables this host carries, located through the interop
|
|
79
|
+
// mount. An executable run folds them into its candidate list so the picker
|
|
80
|
+
// can name the Windows browser the **Prelaunch Windows Chrome** run drives
|
|
81
|
+
// instead of hiding it. Being offered only, they are never spawned (see
|
|
82
|
+
// `blockedForPlatform`): an entry answers a note, never a version, and never
|
|
83
|
+
// seeds. Locating them is the machine half of the fold, injected the same way
|
|
84
|
+
// the run's own `exists` half is — a host off WSL answers nothing, and a
|
|
85
|
+
// machine that carries none of them answers nothing either.
|
|
86
|
+
const windowsExecutables = typeof deps.windowsExecutables === "function"
|
|
87
|
+
? deps.windowsExecutables
|
|
88
|
+
: () => (wslHost ? findWindowsChromeExecutables(existsSync) : []);
|
|
89
|
+
// The configuration form's layers as they answer right now. The references
|
|
90
|
+
// resolve the user layer over the row config, so every answer here is the
|
|
91
|
+
// effective one; the two layers the "did the user say this, or is it the row
|
|
92
|
+
// config" distinction reads only answer once the form attaches, and the first
|
|
93
|
+
// commit read settles it.
|
|
94
|
+
const layers = readConfigLayers(config);
|
|
95
|
+
// Default launch flags (highest first): the user layer,
|
|
96
|
+
// `DSH_CHROME_MCP_FLAGS`, the row config, the schema default. What a
|
|
97
|
+
// connection with no own answer is resolved with starts on them.
|
|
98
|
+
const initialFlags = resolveLaunchFlags(layers, launchFlags);
|
|
99
|
+
if (typeof launchFlags === "string" && launchFlags.trim() !== "" && resolveEnvFlags([], launchFlags).length === 0) {
|
|
100
|
+
ctx.logger.warn(`dsh-chrome-mcp(${config.serverName}): ignoring ${FLAGS_ENV_VAR} — invalid flags list; using the resolved configuration`);
|
|
74
101
|
}
|
|
75
|
-
// The
|
|
76
|
-
//
|
|
77
|
-
//
|
|
78
|
-
//
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
//
|
|
88
|
-
//
|
|
89
|
-
|
|
90
|
-
//
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
executables: [],
|
|
101
|
-
chromeCustomPaths: [],
|
|
102
|
-
stderrMode: "",
|
|
103
|
-
lastError: "",
|
|
104
|
-
chromeMissing: false,
|
|
105
|
-
executableDiscoveryRevision: 0,
|
|
106
|
-
chromeVersion: "",
|
|
107
|
-
executableStatus: [],
|
|
108
|
-
effectiveChromePath: runningChromePath,
|
|
109
|
-
effectiveSource: runningChromeSource,
|
|
110
|
-
wslWindowsExecutable: wslHost && isWindowsExecutablePath(runningChromePath),
|
|
111
|
-
rowStderr: config.bridgeStderr === "console" ? "console" : "log",
|
|
112
|
-
defaultExtraFlags: [...DEFAULT_EXTRA_FLAGS],
|
|
113
|
-
wslExtraFlags: [...WSL_EXTRA_FLAGS],
|
|
114
|
-
windowsChromeStatus: { state: wslHost ? "off" : "not-applicable", port: 0, error: "" },
|
|
115
|
-
carriesConnectionMode: flagsSkipCheck(initialFlags)
|
|
116
|
-
};
|
|
102
|
+
// The initial selection: what the user layer says, else what the row config
|
|
103
|
+
// says (a legacy row-level `--executablePath` folded in — the picker owns that
|
|
104
|
+
// flag, so it becomes the row-config source of the selection and never reaches
|
|
105
|
+
// argv as a second source of truth), else nothing. Nothing here consults
|
|
106
|
+
// discovery: the first run does, and only seeds when both layers are silent.
|
|
107
|
+
const selection = resolveSelection(layers);
|
|
108
|
+
const runningChromePath = selection.path;
|
|
109
|
+
const runningChromeSource = selection.source;
|
|
110
|
+
// The effective console-output mode: what the user layer's toggle says, then
|
|
111
|
+
// what the row config carries, then the row's `bridgeStderr`. Every spawn
|
|
112
|
+
// wrapper reads it.
|
|
113
|
+
const runningStderrMode = resolveStderrModeFromLayers(layers, config.bridgeStderr);
|
|
114
|
+
// The mirror's opening answers: what the default answers would run with, not
|
|
115
|
+
// what a host with no answers would serve. `windowsChromeStatus` in particular
|
|
116
|
+
// reads off this host from the start — the Windows path simply does not exist
|
|
117
|
+
// off WSL.
|
|
118
|
+
const live = createLiveMirror();
|
|
119
|
+
live.effectiveChromePath = runningChromePath;
|
|
120
|
+
live.effectiveSource = runningChromeSource;
|
|
121
|
+
live.stderrEffective = runningStderrMode;
|
|
122
|
+
live.wslWindowsExecutable = wslHost && runningChromePath !== "" && isWindowsExecutablePath(runningChromePath);
|
|
123
|
+
live.carriesConnectionMode = flagsSkipCheck(initialFlags);
|
|
124
|
+
live.windowsChromeStatus = { state: wslHost ? "off" : "not-applicable", port: 0, error: "" };
|
|
125
|
+
live.defaultExtraFlags = readDefaultExtraFlags();
|
|
126
|
+
live.wslExtraFlags = readWslExtraFlags();
|
|
117
127
|
const state = {
|
|
118
|
-
|
|
119
|
-
|
|
128
|
+
live,
|
|
129
|
+
form: void 0,
|
|
130
|
+
// The live layers read: the references answer what runs now, and once the
|
|
131
|
+
// form is described the two layers answer the distinction with it. This is
|
|
132
|
+
// read live on every commit — cordis starts the `settings` injection
|
|
133
|
+
// callback after `apply` returns, so nothing may be captured here.
|
|
134
|
+
source: () => readConfigLayers(config, state.form?.settings ? readConfigForm(state.form.settings, state.form.entryId) : void 0),
|
|
120
135
|
runningFlags: initialFlags,
|
|
121
136
|
runningStderrMode,
|
|
122
137
|
runningChromePath,
|
|
@@ -128,40 +143,92 @@ export function createChromeMcpController(ctx, config, deps = {}) {
|
|
|
128
143
|
seededPath: "",
|
|
129
144
|
seenUserSelection: false,
|
|
130
145
|
runs: Promise.resolve(),
|
|
146
|
+
retryTimer: void 0,
|
|
147
|
+
retriesPending: 0,
|
|
148
|
+
disposed: false,
|
|
131
149
|
wslNoticeShown: false,
|
|
132
150
|
profileLinkKeptShown: false,
|
|
133
|
-
legacyPathsMerged: false
|
|
151
|
+
legacyPathsMerged: false,
|
|
152
|
+
legacyPinAnnounced: false,
|
|
153
|
+
mirror: void 0,
|
|
154
|
+
kindsNotifyQueued: false,
|
|
155
|
+
// The manager seam opens empty: `attachToManager` fills it in once the
|
|
156
|
+
// service answers. A component without the manager answers its own page
|
|
157
|
+
// and starts nothing — exactly as a row with no connections should.
|
|
158
|
+
connections: void 0,
|
|
159
|
+
notifyKindsChanged: () => void 0
|
|
134
160
|
};
|
|
135
161
|
const controller = {
|
|
136
162
|
ctx,
|
|
137
163
|
config,
|
|
138
164
|
wslHost,
|
|
165
|
+
linuxHost,
|
|
139
166
|
blockedForPlatform,
|
|
140
|
-
|
|
141
|
-
rowFlags,
|
|
167
|
+
launchFlags,
|
|
142
168
|
windowsChrome,
|
|
143
|
-
|
|
144
|
-
state
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
169
|
+
windowsExecutables,
|
|
170
|
+
state,
|
|
171
|
+
attachForm(form) {
|
|
172
|
+
state.form = form;
|
|
173
|
+
const nowDescribed = form.settings !== void 0;
|
|
174
|
+
// The first attach is the mount's commit read: no nonce has been
|
|
175
|
+
// observed yet, so its nonce diff fires the registration run. The step
|
|
176
|
+
// where the row starts being *described* is routed too, for the one
|
|
177
|
+
// thing the references cannot answer: which layer a value came from.
|
|
178
|
+
// Until it answers there, the launch environment sits above whatever
|
|
179
|
+
// the references carry, so a saved UI edit has to be re-read against
|
|
180
|
+
// the user layer the moment that layer exists.
|
|
181
|
+
const first = !routed;
|
|
182
|
+
const layersArrived = nowDescribed && !described;
|
|
183
|
+
routed = true;
|
|
184
|
+
described = nowDescribed;
|
|
185
|
+
if (!first && !layersArrived)
|
|
186
|
+
return;
|
|
187
|
+
onFormCommit(controller);
|
|
161
188
|
},
|
|
162
|
-
|
|
189
|
+
detachForm() {
|
|
190
|
+
// Only the described row's layers go away: the references keep
|
|
191
|
+
// answering, so nothing else has to be undone.
|
|
192
|
+
state.form = void 0;
|
|
193
|
+
routed = false;
|
|
194
|
+
described = false;
|
|
195
|
+
},
|
|
196
|
+
onFormCommit: () => onFormCommit(controller),
|
|
197
|
+
run: () => queue(controller, "probe"),
|
|
198
|
+
source: () => state.source(),
|
|
199
|
+
// The live mirror, by reference: controller modules write its fields in
|
|
200
|
+
// place, publish reads them off `state.live`, and every other surface
|
|
201
|
+
// (the commands) reads the very same answers out of it.
|
|
202
|
+
get live() {
|
|
203
|
+
return state.live;
|
|
204
|
+
},
|
|
205
|
+
selectChromePath: (path) => selectChromePath(controller, path),
|
|
163
206
|
prelaunchWindowsChrome: () => prelaunchWindowsChrome(controller),
|
|
164
|
-
|
|
207
|
+
noteRunning(entry, answers) {
|
|
208
|
+
mirrorRunning(controller, entry.id, answers);
|
|
209
|
+
},
|
|
210
|
+
prelaunchForConnection: () => prelaunchWindowsForConnection(controller),
|
|
211
|
+
dismissMigration: () => dismissMigration(controller),
|
|
212
|
+
dispose: () => {
|
|
213
|
+
// Every late answer stands down: the run chain drains on its own (the
|
|
214
|
+
// chain is per-instance, no shared resource left behind), and the one
|
|
215
|
+
// timer this instance owns is cancelled.
|
|
216
|
+
state.disposed = true;
|
|
217
|
+
cancelDiscoveryRetry(controller);
|
|
218
|
+
}
|
|
165
219
|
};
|
|
220
|
+
// Form routing arrives in two steps — the entry id as soon as this fiber knows
|
|
221
|
+
// its own entry, then the described row once the settings service resolves —
|
|
222
|
+
// and the layers read live off it either way (the two flags above are what
|
|
223
|
+
// mark the difference between "never described" and "described before").
|
|
224
|
+
let routed = false;
|
|
225
|
+
let described = false;
|
|
226
|
+
// Tool-level status: browser-level failures are returned to the calling agent
|
|
227
|
+
// and never reach a line of their own.
|
|
228
|
+
registerToolCapture(controller);
|
|
229
|
+
// Seed the mirror before the first snapshot lands (a card that reads before
|
|
230
|
+
// anything ran still gets the real opening answers, never defaults).
|
|
231
|
+
noteSelection(controller);
|
|
232
|
+
return controller;
|
|
166
233
|
}
|
|
167
234
|
//# sourceMappingURL=controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controller.js","sourceRoot":"","sources":["../../../src/host/controller/controller.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"controller.js","sourceRoot":"","sources":["../../../src/host/controller/controller.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE1E,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,uB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O,EAAE,GAAG,EAAE;YACV,sEAAsE;YACtE,sEAAsE;YACtE,yCAAyC;YACzC,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;YACtB,oBAAoB,CAAC,UAAU,CAAC,CAAC;QACrC,CAAC;KACJ,CAAC;IAEF,+EAA+E;IAC/E,6EAA6E;IAC7E,2EAA2E;IAC3E,yEAAyE;IACzE,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,IAAI,SAAS,GAAG,KAAK,CAAC;IAEtB,8EAA8E;IAC9E,uCAAuC;IACvC,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAEhC,4EAA4E;IAC5E,qEAAqE;IACrE,aAAa,CAAC,UAAU,CAAC,CAAC;IAE1B,OAAO,UAAU,CAAC;AACtB,CAAC"}
|
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Host half — the controller's live state + behavior.
|
|
3
3
|
*
|
|
4
|
-
* One controller per apply(): the
|
|
5
|
-
*
|
|
6
|
-
* `createChromeMcpController`
|
|
7
|
-
* concern modules:
|
|
4
|
+
* One controller per apply(): the live mirror the Host publishes, the serialized
|
|
5
|
+
* executable runs, the Windows run half, and the tool-call capture path. The
|
|
6
|
+
* public surface is `createChromeMcpController` (the controller object itself);
|
|
7
|
+
* everything behind it is split into concern modules:
|
|
8
8
|
*
|
|
9
|
-
* ./controller.ts the assembly: resolve config,
|
|
10
|
-
* the
|
|
9
|
+
* ./controller.ts the assembly: resolve config, seed the live mirror, wire
|
|
10
|
+
* the public methods
|
|
11
11
|
* ./state.ts the live state + context every helper shares (internal)
|
|
12
|
-
* ./notes.ts
|
|
13
|
-
* ./
|
|
12
|
+
* ./notes.ts live-mirror announcements (selection, stderr)
|
|
13
|
+
* ./connections.ts the manager seam: what answers reach the live state, and
|
|
14
|
+
* how a default answer change reaches live connections
|
|
14
15
|
* ./runs.ts the executable run + serialization + the Windows trigger
|
|
15
16
|
* ./windows-run.ts the one **Prelaunch Windows Chrome** run
|
|
16
|
-
* ./persist.ts
|
|
17
|
-
* ./captures.ts
|
|
18
|
-
* ./commits.ts
|
|
17
|
+
* ./persist.ts the form writes a run makes (seed, rows, dismissal)
|
|
18
|
+
* ./captures.ts tool-call-result capture
|
|
19
|
+
* ./commits.ts configuration-form commit routing (`onFormCommit`)
|
|
19
20
|
*
|
|
20
|
-
* The
|
|
21
|
-
* `state.source()` at commit time, never capture
|
|
22
|
-
*
|
|
21
|
+
* The two rules that must survive the split: read the layers through
|
|
22
|
+
* `state.source()` at commit time, never capture them, and route every live answer
|
|
23
|
+
* out through `publishLive` (./publish.ts) — configuration-form commits route in,
|
|
24
|
+
* never out, and the live mirror is never written by a commit path.
|
|
23
25
|
*/
|
|
24
26
|
export { createChromeMcpController } from "./controller.js";
|
|
25
27
|
export type { ChromeMcpController, ChromeMcpControllerDeps } from "./controller.js";
|
|
28
|
+
export type { Controller, ControllerState } from "./state.js";
|
|
29
|
+
export type { RunningAnswers } from "./connections.js";
|
|
26
30
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/host/controller/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/host/controller/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,YAAY,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AACpF,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC9D,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Host half — the controller's live state + behavior.
|
|
3
3
|
*
|
|
4
|
-
* One controller per apply(): the
|
|
5
|
-
*
|
|
6
|
-
* `createChromeMcpController`
|
|
7
|
-
* concern modules:
|
|
4
|
+
* One controller per apply(): the live mirror the Host publishes, the serialized
|
|
5
|
+
* executable runs, the Windows run half, and the tool-call capture path. The
|
|
6
|
+
* public surface is `createChromeMcpController` (the controller object itself);
|
|
7
|
+
* everything behind it is split into concern modules:
|
|
8
8
|
*
|
|
9
|
-
* ./controller.ts the assembly: resolve config,
|
|
10
|
-
* the
|
|
9
|
+
* ./controller.ts the assembly: resolve config, seed the live mirror, wire
|
|
10
|
+
* the public methods
|
|
11
11
|
* ./state.ts the live state + context every helper shares (internal)
|
|
12
|
-
* ./notes.ts
|
|
13
|
-
* ./
|
|
12
|
+
* ./notes.ts live-mirror announcements (selection, stderr)
|
|
13
|
+
* ./connections.ts the manager seam: what answers reach the live state, and
|
|
14
|
+
* how a default answer change reaches live connections
|
|
14
15
|
* ./runs.ts the executable run + serialization + the Windows trigger
|
|
15
16
|
* ./windows-run.ts the one **Prelaunch Windows Chrome** run
|
|
16
|
-
* ./persist.ts
|
|
17
|
-
* ./captures.ts
|
|
18
|
-
* ./commits.ts
|
|
17
|
+
* ./persist.ts the form writes a run makes (seed, rows, dismissal)
|
|
18
|
+
* ./captures.ts tool-call-result capture
|
|
19
|
+
* ./commits.ts configuration-form commit routing (`onFormCommit`)
|
|
19
20
|
*
|
|
20
|
-
* The
|
|
21
|
-
* `state.source()` at commit time, never capture
|
|
22
|
-
*
|
|
21
|
+
* The two rules that must survive the split: read the layers through
|
|
22
|
+
* `state.source()` at commit time, never capture them, and route every live answer
|
|
23
|
+
* out through `publishLive` (./publish.ts) — configuration-form commits route in,
|
|
24
|
+
* never out, and the live mirror is never written by a commit path.
|
|
23
25
|
*/
|
|
24
26
|
export { createChromeMcpController } from "./controller.js";
|
|
25
27
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/host/controller/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/host/controller/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Controller —
|
|
2
|
+
* Controller — live-mirror announcements.
|
|
3
3
|
*
|
|
4
|
-
* The two
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* The two answers the card can only learn from here: the resolved selection
|
|
5
|
+
* (with the WSL + Windows-executable state, keyed on the *selection*, not a
|
|
6
|
+
* probe), and where the bridge console output goes. Both land in the live mirror
|
|
7
|
+
* and reach the card through one volatile commit (see ./publish.ts).
|
|
7
8
|
*/
|
|
8
9
|
import type { BridgeStderrNotice } from "../types/index.js";
|
|
9
10
|
import type { Controller } from "./state.js";
|
|
10
11
|
/**
|
|
11
|
-
* Publish the resolved selection into the
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* Publish the resolved selection into the mirror — with the one state the card
|
|
13
|
+
* can only learn from here, and with the static notice that goes with it. The
|
|
14
|
+
* Windows-executable state is keyed on the *selection*, not on any probe: a
|
|
14
15
|
* Windows binary answers `--version` just fine across the interop boundary, so a
|
|
15
16
|
* healthy-looking pill is exactly what a broken Windows selection looks like
|
|
16
17
|
* until the first tool call fails.
|
|
@@ -19,8 +20,7 @@ export declare function noteSelection(controller: Controller): void;
|
|
|
19
20
|
/**
|
|
20
21
|
* Announce where the bridge's console output goes — one line per change of
|
|
21
22
|
* state, keyed on what actually happened, so neither the "log" capture nor
|
|
22
|
-
* a switch to console echo is silent.
|
|
23
|
-
* warns with the reason so the fallback is not mysterious.
|
|
23
|
+
* a switch to console echo is silent.
|
|
24
24
|
*/
|
|
25
25
|
export declare function noteStderr(controller: Controller, built: BridgeStderrNotice): void;
|
|
26
26
|
//# sourceMappingURL=notes.d.ts.map
|