@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
package/lib/host/status.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/host/status.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/host/status.ts"],"names":[],"mappings":"AAUA,oDAAoD;AACpD,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,GAAE,MAAkB,GAAG,MAAM,CAKxE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAQtD;AAED;;;;;;;GAOG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC"}
|
package/lib/host/status.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Error classification and status notes — the human-readable half.
|
|
3
3
|
*
|
|
4
4
|
* Every capture path (check failure, bridge log line, tool-call result) ends
|
|
5
|
-
* in one capped line written to the
|
|
5
|
+
* in one capped line written to the live mirror's `lastError`; `isChromeMissing`
|
|
6
6
|
* decides whether that line is the known, developer-actionable "no Chrome
|
|
7
7
|
* executable detected" state (`chromeMissing`) or a generic failure.
|
|
8
8
|
*/
|
|
@@ -34,27 +34,12 @@ export function isChromeMissing(text) {
|
|
|
34
34
|
/failed to launch the browser process/iu.test(message));
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
|
-
* Summarize one chrome-tool call result for the card's status line
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* @param result - settled tools-service execution result.
|
|
44
|
-
* @returns the note, or null when the call did not fail.
|
|
37
|
+
* Summarize one chrome-tool call result for the card's status line — the rule
|
|
38
|
+
* is ancestros' (`host/status.toolResultNote`): failed calls answer
|
|
39
|
+
* "<tool> failed: <first text line>", successes `null` (the caller clears the
|
|
40
|
+
* stored error). Tool-level errors (browser unreachable, "Target closed", …)
|
|
41
|
+
* are returned to the calling agent and never reach a bridge line, so the
|
|
42
|
+
* tool-call capture is the only place they surface.
|
|
45
43
|
*/
|
|
46
|
-
export
|
|
47
|
-
if (!result || result.isError !== true)
|
|
48
|
-
return null;
|
|
49
|
-
const blocks = Array.isArray(result.content) ? result.content : [];
|
|
50
|
-
let text = blocks
|
|
51
|
-
.filter((block) => block && block.type === "text" && typeof block.text === "string")
|
|
52
|
-
.map((block) => block.text)
|
|
53
|
-
.join(" ");
|
|
54
|
-
if (text === "" && result.error && typeof result.error.message === "string")
|
|
55
|
-
text = result.error.message;
|
|
56
|
-
if (text === "")
|
|
57
|
-
text = result.error === void 0 ? "unknown error" : String(result.error);
|
|
58
|
-
return firstLine(`${toolName.split("__").pop()} failed: ${text}`);
|
|
59
|
-
}
|
|
44
|
+
export { toolResultNote } from "@comecaramelos/dsh-ancesters/host";
|
|
60
45
|
//# sourceMappingURL=status.js.map
|
package/lib/host/status.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/host/status.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/host/status.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,oDAAoD;AACpD,MAAM,UAAU,SAAS,CAAC,IAAa,EAAE,MAAc,SAAS;IAC5D,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;SAC1B,KAAK,CAAC,QAAQ,CAAC;SACf,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC;IACxD,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACrC,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,eAAe,CAAC,IAAa;IACzC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;IACnC,OAAO,CACH,+BAA+B,CAAC,IAAI,CAAC,OAAO,CAAC;QAC7C,qDAAqD,CAAC,IAAI,CAAC,OAAO,CAAC;QACnE,0DAA0D,CAAC,IAAI,CAAC,OAAO,CAAC;QACxE,wCAAwC,CAAC,IAAI,CAAC,OAAO,CAAC,CACzD,CAAC;AACN,CAAC;AAED;;;;;;;GAOG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC"}
|
package/lib/host/tool.d.ts
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Host half — the **prelaunch_windows_chrome** tool.
|
|
3
3
|
*
|
|
4
|
-
* The second trigger of the same Windows Chrome run the card button drives:
|
|
5
|
-
*
|
|
4
|
+
* The second trigger of the same Windows Chrome run the card button drives: the
|
|
5
|
+
* run itself lives in ./windows/, the queueing + state mirror in the
|
|
6
6
|
* controller, and registering the tool is plain wiring — the definition adds
|
|
7
7
|
* no logic of its own, it just hands the model the button's action (the run
|
|
8
8
|
* answers through `windowsChromeStatus`, exactly like a click does).
|
|
9
9
|
*
|
|
10
|
+
* With the component model the run feeds connections, not a bridge this row
|
|
11
|
+
* owns: live `chrome-windows` connections are refreshed against the run
|
|
12
|
+
* (idempotent — the live URL rides into the run's `currentFlags`), and a run
|
|
13
|
+
* that connected without one says what would drive it.
|
|
14
|
+
*
|
|
10
15
|
* The two registration rules this module keeps:
|
|
11
16
|
*
|
|
12
|
-
* - The tools service is injected **at mount time**, not statically:
|
|
13
|
-
* nested mcp-client
|
|
14
|
-
* `inject: ["tools"]` on this plugin would risk the same
|
|
15
|
-
* the tool-result listener bullet warns about. `ctx.inject`
|
|
16
|
-
* service lazily, which is what the listener idiom already
|
|
17
|
+
* - The tools service is injected **at mount time**, not statically: the
|
|
18
|
+
* connections' nested mcp-client fibers are what publish the bridge's tools,
|
|
19
|
+
* so a static `inject: ["tools"]` on this plugin would risk the same
|
|
20
|
+
* load-order cycle the tool-result listener bullet warns about. `ctx.inject`
|
|
21
|
+
* resolves the service lazily, which is what the listener idiom already
|
|
22
|
+
* relies on.
|
|
17
23
|
* - The registration lives on one fiber effect. An HMR reload disposes the
|
|
18
24
|
* old instance's effect first, so the tool re-registers cleanly instead of
|
|
19
25
|
* colliding with a still-held global registration; the effect body guards
|
package/lib/host/tool.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/host/tool.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/host/tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,gEAAgE;AAChE,eAAO,MAAM,6BAA6B,6BAA6B,CAAC;AAExE,8EAA8E;AAC9E,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAElD;;;;GAIG;AACH,UAAU,kBAAkB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,MAAM,EAAE;QACJ,MAAM,EAAE,OAAO,CAAC;QAChB,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,WAAW,EAAE,CAAC;KACxD,CAAC;IACF,OAAO,IAAI,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACxC;AAKD,sEAAsE;AACtE,wBAAgB,gCAAgC,CAAC,UAAU,EAAE,mBAAmB,GAAG,kBAAkB,CAqBpG;AAED;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAAC,GAAG,EAAE,aAAa,EAAE,UAAU,EAAE,mBAAmB,GAAG,IAAI,CAgB3G"}
|
package/lib/host/tool.js
CHANGED
|
@@ -4,11 +4,12 @@ export const PRELAUNCH_WINDOWS_CHROME_NAME = "prelaunch_windows_chrome";
|
|
|
4
4
|
export function prelaunchWindowsChromeDefinition(controller) {
|
|
5
5
|
return {
|
|
6
6
|
name: PRELAUNCH_WINDOWS_CHROME_NAME,
|
|
7
|
-
description: "Open the Windows-side Chrome on WSL
|
|
8
|
-
"Takes no arguments: the host
|
|
7
|
+
description: "Open the Windows-side Chrome on WSL — the same run the card's Prelaunch Windows Chrome button drives. " +
|
|
8
|
+
"Takes no arguments: the host launches the Windows executable the picker selected when that selection is a Windows one (otherwise it locates one), " +
|
|
9
|
+
"checks that the Windows loopback is reachable from this WSL host " +
|
|
9
10
|
"(networkingMode=mirrored is a manual Windows-side setting it only reads), picks the first free debugging port, launches with a " +
|
|
10
11
|
"Windows-side profile under LOCALAPPDATA linked into the workspace as .chrome, opens a packaged page in that window explaining " +
|
|
11
|
-
"that it was opened by the plugin so the agent can drive it from WSL, and
|
|
12
|
+
"that it was opened by the plugin so the agent can drive it from WSL, and reports the debugging URL. Live Windows Chrome connections, if any stand, refresh against the run instead of launching a second browser. On a non-WSL host it answers \"not applicable\". " +
|
|
12
13
|
"The browser it started is never closed by the plugin.",
|
|
13
14
|
parameters: { type: "object", properties: {}, additionalProperties: false },
|
|
14
15
|
output: {
|
package/lib/host/tool.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../../src/host/tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../../src/host/tool.ts"],"names":[],"mappings":"AA8BA,gEAAgE;AAChE,MAAM,CAAC,MAAM,6BAA6B,GAAG,0BAA0B,CAAC;AAwBxE,sEAAsE;AACtE,MAAM,UAAU,gCAAgC,CAAC,UAA+B;IAC5E,OAAO;QACH,IAAI,EAAE,6BAA6B;QACnC,WAAW,EACP,wGAAwG;YACxG,oJAAoJ;YACpJ,mEAAmE;YACnE,iIAAiI;YACjI,gIAAgI;YAChI,qQAAqQ;YACrQ,uDAAuD;QAC3D,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE,oBAAoB,EAAE,KAAK,EAAE;QAC3E,MAAM,EAAE;YACJ,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,oBAAoB,EAAE,KAAK,EAAE;YACrH,MAAM,CAAC,KAAc,EAAE,KAAc;gBACjC,MAAM,IAAI,GAAG,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAE,KAA4B,CAAC,IAAI,CAAC;gBACnG,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC1E,CAAC;SACJ;QACD,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC,sBAAsB,EAAE,EAAE,CAAC;KAC7E,CAAC;AACN,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iCAAiC,CAAC,GAAkB,EAAE,UAA+B;IACjG,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE;QACZ,IAAI,UAAU,GAAG,KAAK,CAAC;QACvB,IAAI,UAAoC,CAAC;QACzC,GAAG,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,KAAoB,EAAE,EAAE;YAC3C,IAAI,UAAU;gBAAE,OAAO;YACvB,MAAM,KAAK,GAAI,KAAsC,CAAC,KAAK,CAAC;YAC5D,IAAI,CAAC,KAAK;gBAAE,OAAO;YACnB,UAAU,GAAG,IAAI,CAAC;YAClB,UAAU,GAAG,KAAK,CAAC,QAAQ,CAAC,gCAAgC,CAAC,UAAU,CAAC,CAAC,CAAC;QAC9E,CAAC,CAAC,CAAC;QACH,OAAO,GAAG,EAAE;YACR,IAAI,UAAU;gBAAE,UAAU,EAAE,CAAC;YAC7B,UAAU,GAAG,KAAK,CAAC;QACvB,CAAC,CAAC;IACN,CAAC,EAAE,2CAA2C,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -1,36 +1,90 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Types — the
|
|
2
|
+
* Types — the config `apply` receives, and the plugin context.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* One `Config` (./../schema.ts) carries everything: the ordinary row-config
|
|
5
|
+
* fields the card only reads, the user-authored fields the card edits, and the
|
|
6
|
+
* live answers the Host publishes. What matters to every consumer here is the
|
|
7
|
+
* *shape at runtime*: dsh 0.2.0 hands `apply` a reference for every
|
|
8
|
+
* `.volatile()` field and a plain value for every ordinary one, so reading a
|
|
9
|
+
* volatile field's type is not reading what it holds (see ./values.ts
|
|
10
|
+
* `readConfigField`). The two halves are typed apart for exactly that reason.
|
|
8
11
|
*/
|
|
9
12
|
import type { Context } from "@deepseek-ai/cordis";
|
|
10
13
|
import type { BridgeStderrMode } from "./stderr.js";
|
|
14
|
+
import type { ChromeExecutableEntry, ChromeExecutableStatus, EffectiveChromeSource } from "./executable.js";
|
|
15
|
+
import type { WindowsChromeStatus } from "./windows.js";
|
|
16
|
+
/** A `.volatile()` field as `apply` hands it: a stable reference the fiber
|
|
17
|
+
* resolves live, or — the shape a hand-built config (or a test) hands — the plain
|
|
18
|
+
* value itself. Read it through `readConfigField` (./values.ts). */
|
|
19
|
+
export type ConfigField<T> = T | {
|
|
20
|
+
get(): T;
|
|
21
|
+
};
|
|
11
22
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
23
|
+
* The validated row config as `apply` sees it: every ordinary field resolved to
|
|
24
|
+
* its final shape (the card reads them, it never edits them), every `.volatile()`
|
|
25
|
+
* field as a reference. This is the one config type the host half passes around —
|
|
26
|
+
* `buildServerArgs`, `checkChrome` and the bridge config all read ordinary
|
|
27
|
+
* fields directly and take the volatile ones through `readConfigField` or an
|
|
28
|
+
* explicit argument.
|
|
14
29
|
*/
|
|
15
30
|
export type ChromeMcpConfig = {
|
|
16
31
|
serverName: string;
|
|
17
32
|
command: string;
|
|
18
33
|
package: string;
|
|
19
|
-
extraFlags: string[];
|
|
20
|
-
chromePath: string;
|
|
21
34
|
chromePaths: string[];
|
|
22
35
|
env: Record<string, string>;
|
|
23
36
|
cwd: string;
|
|
24
37
|
toolCallTimeoutMs: number;
|
|
38
|
+
/** Ceiling for the bridge's server instructions, in UTF-8 bytes (attribution
|
|
39
|
+
* included). A verbatim passthrough to the nested `dsh-mcp-client` row; a
|
|
40
|
+
* server whose instructions exceed it never connects. */
|
|
41
|
+
maxInstructionBytes: number;
|
|
25
42
|
failOnStartupError: boolean;
|
|
26
43
|
reconnect: ReconnectConfig;
|
|
27
44
|
/** Bridge console-output routing: "log" (default) redirects the child's
|
|
28
45
|
* stderr into a log file; "console" echoes it. The card's "Reduce log
|
|
29
|
-
* output" toggle (
|
|
46
|
+
* output" toggle (`stderrMode`) overrides this. */
|
|
30
47
|
bridgeStderr: BridgeStderrMode;
|
|
31
|
-
/** Optional absolute path for the stderr log ("" → the per-
|
|
32
|
-
* `<
|
|
48
|
+
/** Optional absolute path for the stderr log ("" → the private per-process
|
|
49
|
+
* directory created by `mkdtemp`, holding `<serverName>-bridge.log`). */
|
|
33
50
|
bridgeStderrLog: string;
|
|
51
|
+
extraFlags: ConfigField<string[]>;
|
|
52
|
+
/** The executable the bridge launches with: a saved row's path the picker
|
|
53
|
+
* wrote, or one the Host seeded once. "" = nothing resolved yet. */
|
|
54
|
+
chromePath: ConfigField<string>;
|
|
55
|
+
/** The picker's saved rows, `{ id: path, name: label }`. */
|
|
56
|
+
executables: ConfigField<ChromeExecutableEntry[]>;
|
|
57
|
+
/** The ids of saved rows the user dropped — Host-authored, consulted by
|
|
58
|
+
* every merge step so a deleted row never comes back. */
|
|
59
|
+
droppedExecutables: ConfigField<string[]>;
|
|
60
|
+
/** **Legacy** MRU of hand-typed executables — read once, never written. */
|
|
61
|
+
chromeCustomPaths: ConfigField<string[]>;
|
|
62
|
+
/** The card's stderr toggle: "log"/"console"/"" (follow `bridgeStderr`). */
|
|
63
|
+
stderrMode: ConfigField<"" | BridgeStderrMode>;
|
|
64
|
+
/** The card's **Fetch executables** trigger. */
|
|
65
|
+
refreshExecutablesNonce: ConfigField<number>;
|
|
66
|
+
/** The card's **Prelaunch Windows Chrome** trigger. */
|
|
67
|
+
openWindowsChromeNonce: ConfigField<number>;
|
|
68
|
+
lastError: ConfigField<string>;
|
|
69
|
+
chromeMissing: ConfigField<boolean>;
|
|
70
|
+
executableDiscoveryRevision: ConfigField<number>;
|
|
71
|
+
chromeVersion: ConfigField<string>;
|
|
72
|
+
executableStatus: ConfigField<ChromeExecutableStatus[]>;
|
|
73
|
+
effectiveChromePath: ConfigField<string>;
|
|
74
|
+
effectiveSource: ConfigField<EffectiveChromeSource>;
|
|
75
|
+
stderrEffective: ConfigField<BridgeStderrMode>;
|
|
76
|
+
defaultExtraFlags: ConfigField<string[]>;
|
|
77
|
+
wslExtraFlags: ConfigField<string[]>;
|
|
78
|
+
wslWindowsExecutable: ConfigField<boolean>;
|
|
79
|
+
windowsChromeStatus: ConfigField<WindowsChromeStatus>;
|
|
80
|
+
carriesConnectionMode: ConfigField<boolean>;
|
|
81
|
+
/** The flags the live connection actually launches with (mirrored from the
|
|
82
|
+
* last resolve). */
|
|
83
|
+
runningFlags: ConfigField<string[]>;
|
|
84
|
+
/** The note the live connection answered with. */
|
|
85
|
+
runningNote: ConfigField<string>;
|
|
86
|
+
/** Whether the standalone-config translation was turned down (D4). */
|
|
87
|
+
migrationDismissed: ConfigField<boolean>;
|
|
34
88
|
};
|
|
35
89
|
/** Reconnect policy, mirroring the `dsh-mcp-client` bridge config. */
|
|
36
90
|
export type ReconnectConfig = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/host/types/config.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/host/types/config.ts"],"names":[],"mappings":"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"}
|
|
@@ -16,14 +16,19 @@ export type ChromeExecutableEntry = {
|
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
18
18
|
* What one saved row answered with, keyed by its id: the `--version` line
|
|
19
|
-
* (`""` when the probe answered nothing)
|
|
20
|
-
* runnable (`""` when it runs)
|
|
21
|
-
*
|
|
19
|
+
* (`""` when the probe answered nothing), the failure that makes the row not
|
|
20
|
+
* runnable (`""` when it runs), and the **note** that explains an executable
|
|
21
|
+
* this host offers without probing it. A note is not a failure: the path is
|
|
22
|
+
* there and usable, only not launchable *as a local executable* from here — the
|
|
23
|
+
* one case is a Windows `chrome.exe` on a WSL host, which the **Prelaunch
|
|
24
|
+
* Windows Chrome** run drives in connect mode. Base-layer status, never
|
|
25
|
+
* persisted — the rows themselves live in the user layer.
|
|
22
26
|
*/
|
|
23
27
|
export type ChromeExecutableStatus = {
|
|
24
28
|
path: string;
|
|
25
29
|
version: string;
|
|
26
30
|
error: string;
|
|
31
|
+
note: string;
|
|
27
32
|
};
|
|
28
33
|
/** Where the effective executable came from (`effectiveSource`). */
|
|
29
34
|
export type EffectiveChromeSource = "selected" | "row-config" | "";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executable.d.ts","sourceRoot":"","sources":["../../../src/host/types/executable.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjE
|
|
1
|
+
{"version":3,"file":"executable.d.ts","sourceRoot":"","sources":["../../../src/host/types/executable.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjE;;;;;;;;;GASG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,oEAAoE;AACpE,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG,YAAY,GAAG,EAAE,CAAC"}
|
|
@@ -6,18 +6,19 @@
|
|
|
6
6
|
* names all of it:
|
|
7
7
|
*
|
|
8
8
|
* ./stderr.ts where the bridge console goes + the stderr-wrapper shapes
|
|
9
|
-
* ./config.ts the
|
|
9
|
+
* ./config.ts the config `apply` receives + reconnect + PluginContext
|
|
10
10
|
* ./executable.ts the saved-executable rows + source tag
|
|
11
11
|
* ./windows.ts the Prelaunch Windows Chrome run's states + outcome
|
|
12
|
-
* ./settings.ts the
|
|
12
|
+
* ./settings.ts the configuration form's layers, the live mirror, the service
|
|
13
13
|
* ./plugin.ts the bridge fiber + the tool-call captures
|
|
14
14
|
*
|
|
15
15
|
* Structural views stay narrow: only what the host half actually calls.
|
|
16
16
|
*/
|
|
17
17
|
export type { BridgeStderrMode, BridgeStderrNotice, BridgeSpawnTarget, BridgeSpawnOptions, BridgeSpawnResult, BridgeStderrLogPathOptions } from "./stderr.js";
|
|
18
|
-
export type { ChromeMcpConfig, ReconnectConfig, PluginContext } from "./config.js";
|
|
18
|
+
export type { ChromeMcpConfig, ConfigField, ReconnectConfig, PluginContext } from "./config.js";
|
|
19
19
|
export type { ChromeExecutableEntry, ChromeExecutableStatus, EffectiveChromeSource } from "./executable.js";
|
|
20
20
|
export type { WindowsChromeState, WindowsChromeStatus, WindowsChromeLinkAnswer, WindowsChromeRun } from "./windows.js";
|
|
21
|
-
export type {
|
|
21
|
+
export type { ConfigUserFields, ConfigLiveFields, ConfigLayerFields, ConfigLayers, SettingsForms, SettingsFormRow, SettingsPathOp, ChromeMcpForm } from "./settings.js";
|
|
22
22
|
export type { McpBridge, ToolCallExecution, ToolCallResult } from "./plugin.js";
|
|
23
|
+
export type { CommandDefinition, CommandInvocation, CommandResult } from "./services.js";
|
|
23
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/host/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAC9J,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/host/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAC9J,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAChG,YAAY,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC5G,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACvH,YAAY,EACR,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,eAAe,EACf,cAAc,EACd,aAAa,EAChB,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAChF,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural views of the host services this half registers onto but does not
|
|
3
|
+
* own. The slash-command shapes come from the `commands` service — the headless
|
|
4
|
+
* mirror surface the card's two executable actions get; the service may be
|
|
5
|
+
* mounted after `apply` returns (hence the lazy injection) and may not be
|
|
6
|
+
* mounted at all on a host with no commands plane.
|
|
7
|
+
*/
|
|
8
|
+
/** One slash-command invocation: the raw text after the command name. */
|
|
9
|
+
export type CommandInvocation = {
|
|
10
|
+
rawInput: string;
|
|
11
|
+
};
|
|
12
|
+
/** What a slash-command handler answers with — never thrown, always shown. */
|
|
13
|
+
export type CommandResult = {
|
|
14
|
+
kind: "success" | "error";
|
|
15
|
+
text: string;
|
|
16
|
+
};
|
|
17
|
+
/** The `commands` service definition shape, registered by name. */
|
|
18
|
+
export type CommandDefinition = {
|
|
19
|
+
name: string;
|
|
20
|
+
description: string;
|
|
21
|
+
input?: {
|
|
22
|
+
hint?: string;
|
|
23
|
+
};
|
|
24
|
+
handler: (invocation: CommandInvocation) => CommandResult | Promise<CommandResult>;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=services.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../src/host/types/services.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,yEAAyE;AACzE,MAAM,MAAM,iBAAiB,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAErD,8EAA8E;AAC9E,MAAM,MAAM,aAAa,GAAG;IAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAExE,mEAAmE;AACnE,MAAM,MAAM,iBAAiB,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1B,OAAO,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CACtF,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural views of the host services this half registers onto but does not
|
|
3
|
+
* own. The slash-command shapes come from the `commands` service — the headless
|
|
4
|
+
* mirror surface the card's two executable actions get; the service may be
|
|
5
|
+
* mounted after `apply` returns (hence the lazy injection) and may not be
|
|
6
|
+
* mounted at all on a host with no commands plane.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=services.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"services.js","sourceRoot":"","sources":["../../../src/host/types/services.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -1,39 +1,48 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Types — the
|
|
2
|
+
* Types — the configuration form's layers, the live mirror, and the settings
|
|
3
|
+
* service surface the Host reads and writes through.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* Since dsh 0.2.0 there is one `Config` (./../schema.ts) and one form per profile
|
|
6
|
+
* row: the card edits the row's volatile fields, and every live answer the Host
|
|
7
|
+
* has to serve rides the very same references. So there is no separate persisted
|
|
8
|
+
* section and no base layer to publish over — what the Host reads for the fields
|
|
9
|
+
* it edits is one read of the row's two layers, and what it serves is one
|
|
10
|
+
* volatile commit of the mirror.
|
|
8
11
|
*/
|
|
9
12
|
import type { BridgeStderrMode } from "./stderr.js";
|
|
10
13
|
import type { ChromeExecutableEntry, ChromeExecutableStatus, EffectiveChromeSource } from "./executable.js";
|
|
11
14
|
import type { WindowsChromeStatus } from "./windows.js";
|
|
12
15
|
/**
|
|
13
|
-
*
|
|
16
|
+
* The fields the card edits — the fields the Host persists, and the only ones
|
|
17
|
+
* whose commits the Host routes (a commit touching nothing here changes nothing
|
|
18
|
+
* the bridge runs with).
|
|
14
19
|
*/
|
|
15
|
-
export type
|
|
20
|
+
export type ConfigUserFields = {
|
|
16
21
|
extraFlags: string[];
|
|
17
|
-
/** Written by the card's **
|
|
22
|
+
/** Written by the card's **Fetch executables** action: one host run that
|
|
18
23
|
* re-probes the saved rows and folds what it finds back into them. */
|
|
19
24
|
refreshExecutablesNonce: number;
|
|
20
25
|
/** Written by the card's **Prelaunch Windows Chrome** button: one host run that
|
|
21
26
|
* locates the Windows Chrome, proves the mirrored-loopback prereq, launches
|
|
22
27
|
* it with a debugging port and leaves the bridge in connect mode. Same
|
|
23
|
-
* trigger idiom as `refreshExecutablesNonce` —
|
|
24
|
-
*
|
|
28
|
+
* trigger idiom as `refreshExecutablesNonce` — an action travels as one write
|
|
29
|
+
* the Host reacts to, never a push channel. */
|
|
25
30
|
openWindowsChromeNonce: number;
|
|
26
31
|
/** The executable the bridge launches with: picked in the picker (a saved
|
|
27
32
|
* row's path), or seeded once by the host; "" = nothing resolved yet. There
|
|
28
33
|
* is no "auto" state to fall back to. */
|
|
29
34
|
chromePath: string;
|
|
30
35
|
/** The saved-executables rows: `{ id: path, name: label }`, the dropdown's
|
|
31
|
-
* catalog (see ./catalog.ts).
|
|
32
|
-
*
|
|
36
|
+
* catalog (see ./catalog.ts). User-authored; a scan merges what it finds
|
|
37
|
+
* into them without dropping a name the user chose. */
|
|
33
38
|
executables: ChromeExecutableEntry[];
|
|
39
|
+
/** The ids of saved rows the user dropped — Host-authored, never edited by
|
|
40
|
+
* the card, and read by every merge step so a deleted row is never folded
|
|
41
|
+
* back in (see ../controller/runs.ts). */
|
|
42
|
+
droppedExecutables: string[];
|
|
34
43
|
/** **Legacy** MRU of hand-typed executables (oldest drops off past
|
|
35
44
|
* `CUSTOM_PATHS_CAP`). Nothing writes it any more: the saved rows replace it,
|
|
36
|
-
* and a host whose
|
|
45
|
+
* and a host whose profile still carries it folds its paths into the rows on
|
|
37
46
|
* the first run (see ./catalog.ts). */
|
|
38
47
|
chromeCustomPaths: string[];
|
|
39
48
|
/** The card's "Reduce log output" toggle: "log" captures the bridge's
|
|
@@ -42,86 +51,130 @@ export type SettingsUserFields = {
|
|
|
42
51
|
stderrMode: "" | BridgeStderrMode;
|
|
43
52
|
};
|
|
44
53
|
/**
|
|
45
|
-
*
|
|
54
|
+
* The live mirror: what the Host answers through the same volatile references
|
|
55
|
+
* the card edits, and never persists. Every field here is a volatile field of the
|
|
56
|
+
* single `Config`, published by one commit per change batch.
|
|
46
57
|
*/
|
|
47
|
-
export type
|
|
58
|
+
export type ConfigLiveFields = {
|
|
59
|
+
/** Last check/connection failure, human-readable; "" when healthy. */
|
|
48
60
|
lastError: string;
|
|
61
|
+
/** The last failure was "no Chrome executable detected". */
|
|
49
62
|
chromeMissing: boolean;
|
|
50
63
|
/** Completion signal of one executable run (a merged scan, and the probe of
|
|
51
64
|
* what is selected that follows it). The one counter every executable action
|
|
52
|
-
* waits on
|
|
53
|
-
* `executableDiscoveryRevision` for the same job. */
|
|
65
|
+
* waits on. */
|
|
54
66
|
executableDiscoveryRevision: number;
|
|
55
67
|
/** The `--version` line the selected executable answered with; "" when
|
|
56
68
|
* nothing answered (nothing selected, a connect mode, a blocked path). */
|
|
57
69
|
chromeVersion: string;
|
|
58
|
-
/** Per-row probe status, keyed by path
|
|
59
|
-
*
|
|
60
|
-
* layer, never persisted — the *rows* themselves are user-authored and live
|
|
61
|
-
* in the persisted layer. */
|
|
70
|
+
/** Per-row probe status, keyed by path. Never persisted — the *rows*
|
|
71
|
+
* themselves are user-authored. */
|
|
62
72
|
executableStatus: ChromeExecutableStatus[];
|
|
63
73
|
/** Executable the bridge actually launches with; "" when nothing is fixed. */
|
|
64
74
|
effectiveChromePath: string;
|
|
65
75
|
/** Where `effectiveChromePath` came from. */
|
|
66
76
|
effectiveSource: EffectiveChromeSource;
|
|
67
|
-
/**
|
|
68
|
-
*
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
/** Row-config `bridgeStderr` in effect (static base-layer mirror; never
|
|
73
|
-
* persisted) — the fallback when the user `stderrMode` is "". */
|
|
74
|
-
rowStderr: BridgeStderrMode;
|
|
75
|
-
/** The canonical default extra-flags list (static base-layer mirror of
|
|
76
|
-
* `DEFAULT_EXTRA_FLAGS`; never persisted) — what the card's Restore
|
|
77
|
-
* defaults action appends, keeping whatever the user already has. */
|
|
77
|
+
/** The mode the bridge actually routes console output through — what the
|
|
78
|
+
* card's toggle is checked against, so it never reads a phantom state. */
|
|
79
|
+
stderrEffective: BridgeStderrMode;
|
|
80
|
+
/** The canonical default extra-flags list — what the card's Restore defaults
|
|
81
|
+
* action appends, keeping whatever the rows already carry. */
|
|
78
82
|
defaultExtraFlags: string[];
|
|
79
|
-
/** The recommended WSL ↔ Windows extra-flags list
|
|
80
|
-
*
|
|
81
|
-
* WSL** action appends, missing entries only, keeping everything the rows
|
|
82
|
-
* already carry. */
|
|
83
|
+
/** The recommended WSL ↔ Windows extra-flags list — what the card's **Flags
|
|
84
|
+
* WSL** action appends, missing entries only. */
|
|
83
85
|
wslExtraFlags: string[];
|
|
84
|
-
/**
|
|
85
|
-
*
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
/** True while this Host runs under WSL **and** the effective executable is a
|
|
87
|
+
* Windows binary (see ./platform.ts) — the state the card's notice explains. */
|
|
88
|
+
wslWindowsExecutable: boolean;
|
|
89
|
+
/** What the **Prelaunch Windows Chrome** run is doing right now. The whole
|
|
90
|
+
* Windows path lives host-side, so the card renders this one field and
|
|
91
|
+
* carries no list of Windows paths or reachability rules. */
|
|
88
92
|
windowsChromeStatus: WindowsChromeStatus;
|
|
89
93
|
/** True while the bridge launches with a connect-mode flag
|
|
90
94
|
* (`--browserUrl` / `--wsEndpoint`): there is then no local executable to
|
|
91
|
-
* launch or probe, so the card mutes the picker instead of claiming a
|
|
92
|
-
*
|
|
95
|
+
* launch or probe, so the card mutes the picker instead of claiming a local
|
|
96
|
+
* selection the bridge is not running. */
|
|
93
97
|
carriesConnectionMode: boolean;
|
|
98
|
+
/** The flags the live connection actually launches with (mirrored from the
|
|
99
|
+
* last resolve) — what the machine page states as running, not what the
|
|
100
|
+
* layers were last configured with. Empty while nothing resolves. */
|
|
101
|
+
runningFlags: string[];
|
|
102
|
+
/** The note the live connection answered with — where its console output
|
|
103
|
+
* goes, or the debugging URL the Windows run connected to. */
|
|
104
|
+
runningNote: string;
|
|
105
|
+
};
|
|
106
|
+
/** One layer's answers: a field is absent when that layer said nothing. */
|
|
107
|
+
export type ConfigLayerFields = {
|
|
108
|
+
[K in keyof ConfigUserFields]?: ConfigUserFields[K];
|
|
94
109
|
};
|
|
95
110
|
/**
|
|
96
|
-
*
|
|
111
|
+
* One read of the form: what runs now (the references resolve the user layer over
|
|
112
|
+
* the row config, which is exactly what the bridge launches with) plus the two
|
|
113
|
+
* layers the distinction "did the user edit this, or does the row config say it"
|
|
114
|
+
* reads. Before the form is attached the references answer for both layers, so
|
|
115
|
+
* the first commit settles the distinction.
|
|
97
116
|
*/
|
|
98
|
-
export type
|
|
117
|
+
export type ConfigLayers = {
|
|
118
|
+
value: ConfigUserFields;
|
|
119
|
+
user: ConfigLayerFields;
|
|
120
|
+
base: ConfigLayerFields;
|
|
121
|
+
};
|
|
99
122
|
/**
|
|
100
|
-
*
|
|
123
|
+
* Surface of the `settings` service (`SettingsForms`) as consumed here. Typed
|
|
124
|
+
* structurally the way `tool.ts` types the tools service: the service lives in
|
|
125
|
+
* the loader's module table, and the Host only reads a described row, writes a
|
|
126
|
+
* patch and turns the generated page off. The patch row is keyed by the
|
|
127
|
+
* **profile entry id**, never by a namespace of the Host's own.
|
|
101
128
|
*/
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
export type
|
|
129
|
+
/**
|
|
130
|
+
* One ordered edit a write carries through `mutate`: a `set` names a field with
|
|
131
|
+
* a value; an `unset` returns the field to whatever the row config answers (an
|
|
132
|
+
* unset of a path no layer answers drops out of the stored row entirely — this
|
|
133
|
+
* is exactly how the Host clears its live-only fields back to their row-config
|
|
134
|
+
* answers; see ./values.ts `liveMirrorKeys`).
|
|
135
|
+
*/
|
|
136
|
+
export type SettingsPathOp = {
|
|
110
137
|
op: "set";
|
|
111
|
-
path: string[];
|
|
112
|
-
value
|
|
138
|
+
path: readonly string[];
|
|
139
|
+
value: unknown;
|
|
113
140
|
} | {
|
|
114
141
|
op: "unset";
|
|
115
|
-
path: string[];
|
|
142
|
+
path: readonly string[];
|
|
116
143
|
};
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
144
|
+
export interface SettingsForms {
|
|
145
|
+
describe(options?: unknown): SettingsFormRow[];
|
|
146
|
+
/** Write one user-authored field into the row's own patch layer (the store
|
|
147
|
+
* dsh 0.2.0 uses instead of `settings.yaml`). Never called with a live field. */
|
|
148
|
+
update(entryId: string, patch: Record<string, unknown>, expectedRevision?: number): Promise<unknown> | unknown;
|
|
149
|
+
/** One ordered field edit; every edit addresses a volatile field, and an
|
|
150
|
+
* `unset` falls back to the row-config answer. The Host's write-backs go
|
|
151
|
+
* through this channel, carrying the live-only fields' clear alongside the
|
|
152
|
+
* one user field they write, so a live answer can never ride a write back
|
|
153
|
+
* into the stored layer (see ./values.ts). */
|
|
154
|
+
mutate(entryId: string, ops: readonly SettingsPathOp[], expectedRevision?: number): Promise<unknown> | unknown;
|
|
155
|
+
/** `auto: false` keeps the generated page off while the card owns the row's
|
|
156
|
+
* page. Disposable, and calling it twice for one fiber throws. */
|
|
157
|
+
configure(presentation: {
|
|
158
|
+
auto?: boolean;
|
|
159
|
+
}, owner?: unknown): () => void;
|
|
160
|
+
}
|
|
161
|
+
/** One described settings row (dsh-ancesters `readFormRow`), narrowed to what the Host consults. */
|
|
162
|
+
export interface SettingsFormRow {
|
|
163
|
+
/** The profile entry id this row is keyed by. */
|
|
164
|
+
ns: string;
|
|
165
|
+
/** Live effective value, Host live commits included. */
|
|
166
|
+
value?: unknown;
|
|
167
|
+
/** Composition base — what the row config carries under the user layer. */
|
|
168
|
+
base?: unknown;
|
|
169
|
+
/** What the profile patch carries (`{}` when it carries nothing). */
|
|
170
|
+
user?: unknown;
|
|
171
|
+
}
|
|
172
|
+
/** Everything the Host keeps about the form once it attaches. */
|
|
173
|
+
export interface ChromeMcpForm {
|
|
174
|
+
/** The row's profile entry id — the key every read and write goes through. */
|
|
175
|
+
entryId: string;
|
|
176
|
+
/** The form service itself (undefined on the cold path, where only the
|
|
177
|
+
* references answer). */
|
|
178
|
+
settings?: SettingsForms;
|
|
126
179
|
}
|
|
127
180
|
//# sourceMappingURL=settings.d.ts.map
|