@comecaramelos/dsh-chrome-mcp 0.0.1 → 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.
Files changed (214) hide show
  1. package/README.md +44 -95
  2. package/assets/dsh-chrome-mcp-social.png +0 -0
  3. package/assets/icon.svg +71 -0
  4. package/assets/prelaunch-windows-chrome.html +277 -0
  5. package/lib/client.js +3005 -568
  6. package/lib/client.js.map +7 -0
  7. package/lib/host/apply.d.ts +40 -0
  8. package/lib/host/apply.d.ts.map +1 -0
  9. package/lib/host/apply.js +57 -0
  10. package/lib/host/apply.js.map +1 -0
  11. package/lib/host/bridge.d.ts +74 -0
  12. package/lib/host/bridge.d.ts.map +1 -0
  13. package/lib/host/bridge.js +168 -0
  14. package/lib/host/bridge.js.map +1 -0
  15. package/lib/host/catalog.d.ts +31 -0
  16. package/lib/host/catalog.d.ts.map +1 -0
  17. package/lib/host/catalog.js +92 -0
  18. package/lib/host/catalog.js.map +1 -0
  19. package/lib/host/commands/chrome-path.d.ts +4 -0
  20. package/lib/host/commands/chrome-path.d.ts.map +1 -0
  21. package/lib/host/commands/chrome-path.js +65 -0
  22. package/lib/host/commands/chrome-path.js.map +1 -0
  23. package/lib/host/commands/chrome-refresh.d.ts +17 -0
  24. package/lib/host/commands/chrome-refresh.d.ts.map +1 -0
  25. package/lib/host/commands/chrome-refresh.js +37 -0
  26. package/lib/host/commands/chrome-refresh.js.map +1 -0
  27. package/lib/host/commands/index.d.ts +26 -0
  28. package/lib/host/commands/index.d.ts.map +1 -0
  29. package/lib/host/commands/index.js +41 -0
  30. package/lib/host/commands/index.js.map +1 -0
  31. package/lib/host/constants.d.ts +306 -0
  32. package/lib/host/constants.d.ts.map +1 -0
  33. package/lib/host/constants.js +319 -0
  34. package/lib/host/constants.js.map +1 -0
  35. package/lib/host/controller/_trace.d.ts +3 -0
  36. package/lib/host/controller/_trace.d.ts.map +1 -0
  37. package/lib/host/controller/_trace.js +14 -0
  38. package/lib/host/controller/_trace.js.map +1 -0
  39. package/lib/host/controller/bridge-run.d.ts +40 -0
  40. package/lib/host/controller/bridge-run.d.ts.map +1 -0
  41. package/lib/host/controller/bridge-run.js +85 -0
  42. package/lib/host/controller/bridge-run.js.map +1 -0
  43. package/lib/host/controller/captures.d.ts +15 -0
  44. package/lib/host/controller/captures.d.ts.map +1 -0
  45. package/lib/host/controller/captures.js +85 -0
  46. package/lib/host/controller/captures.js.map +1 -0
  47. package/lib/host/controller/commits.d.ts +4 -0
  48. package/lib/host/controller/commits.d.ts.map +1 -0
  49. package/lib/host/controller/commits.js +131 -0
  50. package/lib/host/controller/commits.js.map +1 -0
  51. package/lib/host/controller/connections.d.ts +38 -0
  52. package/lib/host/controller/connections.d.ts.map +1 -0
  53. package/lib/host/controller/connections.js +71 -0
  54. package/lib/host/controller/connections.js.map +1 -0
  55. package/lib/host/controller/controller.d.ts +35 -0
  56. package/lib/host/controller/controller.d.ts.map +1 -0
  57. package/lib/host/controller/controller.js +234 -0
  58. package/lib/host/controller/controller.js.map +1 -0
  59. package/lib/host/controller/index.d.ts +30 -0
  60. package/lib/host/controller/index.d.ts.map +1 -0
  61. package/lib/host/controller/index.js +27 -0
  62. package/lib/host/controller/index.js.map +1 -0
  63. package/lib/host/controller/notes.d.ts +26 -0
  64. package/lib/host/controller/notes.d.ts.map +1 -0
  65. package/lib/host/controller/notes.js +44 -0
  66. package/lib/host/controller/notes.js.map +1 -0
  67. package/lib/host/controller/persist.d.ts +16 -0
  68. package/lib/host/controller/persist.d.ts.map +1 -0
  69. package/lib/host/controller/persist.js +98 -0
  70. package/lib/host/controller/persist.js.map +1 -0
  71. package/lib/host/controller/publish.d.ts +4 -0
  72. package/lib/host/controller/publish.d.ts.map +1 -0
  73. package/lib/host/controller/publish.js +56 -0
  74. package/lib/host/controller/publish.js.map +1 -0
  75. package/lib/host/controller/runs.d.ts +80 -0
  76. package/lib/host/controller/runs.d.ts.map +1 -0
  77. package/lib/host/controller/runs.js +394 -0
  78. package/lib/host/controller/runs.js.map +1 -0
  79. package/lib/host/controller/state.d.ts +172 -0
  80. package/lib/host/controller/state.d.ts.map +1 -0
  81. package/lib/host/controller/state.js +2 -0
  82. package/lib/host/controller/state.js.map +1 -0
  83. package/lib/host/controller/windows-run.d.ts +17 -0
  84. package/lib/host/controller/windows-run.d.ts.map +1 -0
  85. package/lib/host/controller/windows-run.js +109 -0
  86. package/lib/host/controller/windows-run.js.map +1 -0
  87. package/lib/host/discovery/candidates.d.ts +47 -0
  88. package/lib/host/discovery/candidates.d.ts.map +1 -0
  89. package/lib/host/discovery/candidates.js +68 -0
  90. package/lib/host/discovery/candidates.js.map +1 -0
  91. package/lib/host/discovery/index.d.ts +19 -0
  92. package/lib/host/discovery/index.d.ts.map +1 -0
  93. package/lib/host/discovery/index.js +19 -0
  94. package/lib/host/discovery/index.js.map +1 -0
  95. package/lib/host/discovery/probe.d.ts +29 -0
  96. package/lib/host/discovery/probe.d.ts.map +1 -0
  97. package/lib/host/discovery/probe.js +155 -0
  98. package/lib/host/discovery/probe.js.map +1 -0
  99. package/lib/host/discovery/scan.d.ts +72 -0
  100. package/lib/host/discovery/scan.d.ts.map +1 -0
  101. package/lib/host/discovery/scan.js +195 -0
  102. package/lib/host/discovery/scan.js.map +1 -0
  103. package/lib/host/flags.d.ts +65 -0
  104. package/lib/host/flags.d.ts.map +1 -0
  105. package/lib/host/flags.js +186 -0
  106. package/lib/host/flags.js.map +1 -0
  107. package/lib/host/kind.d.ts +45 -0
  108. package/lib/host/kind.d.ts.map +1 -0
  109. package/lib/host/kind.js +251 -0
  110. package/lib/host/kind.js.map +1 -0
  111. package/lib/host/manager.d.ts +21 -0
  112. package/lib/host/manager.d.ts.map +1 -0
  113. package/lib/host/manager.js +113 -0
  114. package/lib/host/manager.js.map +1 -0
  115. package/lib/host/migration.d.ts +26 -0
  116. package/lib/host/migration.d.ts.map +1 -0
  117. package/lib/host/migration.js +127 -0
  118. package/lib/host/migration.js.map +1 -0
  119. package/lib/host/platform.d.ts +38 -0
  120. package/lib/host/platform.d.ts.map +1 -0
  121. package/lib/host/platform.js +64 -0
  122. package/lib/host/platform.js.map +1 -0
  123. package/lib/host/plugin-meta.d.ts +21 -0
  124. package/lib/host/plugin-meta.d.ts.map +1 -0
  125. package/lib/host/plugin-meta.js +21 -0
  126. package/lib/host/plugin-meta.js.map +1 -0
  127. package/lib/host/schema.d.ts +361 -0
  128. package/lib/host/schema.d.ts.map +1 -0
  129. package/lib/host/schema.js +196 -0
  130. package/lib/host/schema.js.map +1 -0
  131. package/lib/host/settings.d.ts +28 -0
  132. package/lib/host/settings.d.ts.map +1 -0
  133. package/lib/host/settings.js +91 -0
  134. package/lib/host/settings.js.map +1 -0
  135. package/lib/host/status.d.ts +25 -0
  136. package/lib/host/status.d.ts.map +1 -0
  137. package/lib/host/status.js +45 -0
  138. package/lib/host/status.js.map +1 -0
  139. package/lib/host/tool.d.ts +65 -0
  140. package/lib/host/tool.d.ts.map +1 -0
  141. package/lib/host/tool.js +52 -0
  142. package/lib/host/tool.js.map +1 -0
  143. package/lib/host/types/config.d.ts +101 -0
  144. package/lib/host/types/config.d.ts.map +1 -0
  145. package/lib/host/types/config.js +2 -0
  146. package/lib/host/types/config.js.map +1 -0
  147. package/lib/host/types/executable.d.ts +35 -0
  148. package/lib/host/types/executable.d.ts.map +1 -0
  149. package/lib/host/types/executable.js +9 -0
  150. package/lib/host/types/executable.js.map +1 -0
  151. package/lib/host/types/index.d.ts +24 -0
  152. package/lib/host/types/index.d.ts.map +1 -0
  153. package/lib/host/types/index.js +2 -0
  154. package/lib/host/types/index.js.map +1 -0
  155. package/lib/host/types/plugin.d.ts +38 -0
  156. package/lib/host/types/plugin.d.ts.map +1 -0
  157. package/lib/host/types/plugin.js +10 -0
  158. package/lib/host/types/plugin.js.map +1 -0
  159. package/lib/host/types/services.d.ts +26 -0
  160. package/lib/host/types/services.d.ts.map +1 -0
  161. package/lib/host/types/services.js +9 -0
  162. package/lib/host/types/services.js.map +1 -0
  163. package/lib/host/types/settings.d.ts +180 -0
  164. package/lib/host/types/settings.d.ts.map +1 -0
  165. package/lib/host/types/settings.js +2 -0
  166. package/lib/host/types/settings.js.map +1 -0
  167. package/lib/host/types/stderr.d.ts +51 -0
  168. package/lib/host/types/stderr.d.ts.map +1 -0
  169. package/lib/host/types/stderr.js +9 -0
  170. package/lib/host/types/stderr.js.map +1 -0
  171. package/lib/host/types/windows.d.ts +39 -0
  172. package/lib/host/types/windows.d.ts.map +1 -0
  173. package/lib/host/types/windows.js +9 -0
  174. package/lib/host/types/windows.js.map +1 -0
  175. package/lib/host/values.d.ts +204 -0
  176. package/lib/host/values.d.ts.map +1 -0
  177. package/lib/host/values.js +404 -0
  178. package/lib/host/values.js.map +1 -0
  179. package/lib/host/windows/connect-flags.d.ts +27 -0
  180. package/lib/host/windows/connect-flags.d.ts.map +1 -0
  181. package/lib/host/windows/connect-flags.js +97 -0
  182. package/lib/host/windows/connect-flags.js.map +1 -0
  183. package/lib/host/windows/index.d.ts +31 -0
  184. package/lib/host/windows/index.d.ts.map +1 -0
  185. package/lib/host/windows/index.js +30 -0
  186. package/lib/host/windows/index.js.map +1 -0
  187. package/lib/host/windows/landing.d.ts +47 -0
  188. package/lib/host/windows/landing.d.ts.map +1 -0
  189. package/lib/host/windows/landing.js +174 -0
  190. package/lib/host/windows/landing.js.map +1 -0
  191. package/lib/host/windows/link.d.ts +11 -0
  192. package/lib/host/windows/link.d.ts.map +1 -0
  193. package/lib/host/windows/link.js +52 -0
  194. package/lib/host/windows/link.js.map +1 -0
  195. package/lib/host/windows/paths.d.ts +64 -0
  196. package/lib/host/windows/paths.d.ts.map +1 -0
  197. package/lib/host/windows/paths.js +148 -0
  198. package/lib/host/windows/paths.js.map +1 -0
  199. package/lib/host/windows/run.d.ts +74 -0
  200. package/lib/host/windows/run.d.ts.map +1 -0
  201. package/lib/host/windows/run.js +211 -0
  202. package/lib/host/windows/run.js.map +1 -0
  203. package/lib/host/windows/spawn.d.ts +22 -0
  204. package/lib/host/windows/spawn.d.ts.map +1 -0
  205. package/lib/host/windows/spawn.js +73 -0
  206. package/lib/host/windows/spawn.js.map +1 -0
  207. package/lib/index.d.ts +102 -0
  208. package/lib/index.d.ts.map +1 -0
  209. package/lib/index.js +102 -636
  210. package/lib/index.js.map +1 -0
  211. package/locale/en.json +6 -0
  212. package/locale/zh.json +6 -0
  213. package/package.json +57 -14
  214. package/cordis.patch.yml +0 -5
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Host half — where the plugin is running: is this Linux host a Windows
3
+ * Subsystem for Linux instance, and does one executable path name a Windows
4
+ * binary rather than a Linux one.
5
+ *
6
+ * The two answers only ever combine into one warning. Launching a Windows
7
+ * `chrome.exe` from WSL cannot work (`.probe/`, AGENTS.md): the debug pipes
8
+ * `chrome-devtools-mcp` opens do not survive the interop boundary, and the
9
+ * debugging port it reads from `DevToolsActivePort` stays bound to the Windows
10
+ * loopback, unreachable across the WSL2 NAT bridge. It even *seems* to work: the
11
+ * `--version` probe answers successfully, so a broken selection hides behind a
12
+ * healthy pill until the first tool call. That is why the pair is surfaced on
13
+ * the card as its own notice rather than through the error dot: nothing is
14
+ * failing yet, the required configuration is simply different.
15
+ *
16
+ * Both probes stay pure and injectable (`platform`, `env`, `exists`) so the
17
+ * tests never depend on the machine they run on.
18
+ */
19
+ import { existsSync } from "node:fs";
20
+ import { WINDOWS_EXE_PATTERN, WINDOWS_PATH_PATTERN, WSL_ENV_VARS, WSL_INTEROP_MARKER } from "./constants.js";
21
+ /**
22
+ * True when `path` names a Windows binary — one that lives on the interop mount
23
+ * (`/mnt/<drive>/…`), in a Windows spelling (`\\host\…`, `C:\…`), or simply
24
+ * carries the PE suffix. A Linux path is never Windows-side, and a candidate
25
+ * list built from {@link DEFAULT_CHROME_PATHS} never matches.
26
+ * @param path - one executable path as selected.
27
+ */
28
+ export function isWindowsExecutablePath(path) {
29
+ if (typeof path !== "string")
30
+ return false;
31
+ const candidate = path.trim();
32
+ if (candidate === "")
33
+ return false;
34
+ return WINDOWS_PATH_PATTERN.test(candidate) || WINDOWS_EXE_PATTERN.test(candidate);
35
+ }
36
+ /**
37
+ * True when the current process runs inside Windows Subsystem for Linux: a
38
+ * Linux kernel plus the WSL markers. A non-Linux platform (a plain Windows
39
+ * host) is never "under WSL", whatever its environment says.
40
+ * @param probe - what to consult (defaults to this process).
41
+ */
42
+ export function isWindowsSubsystemForLinux(probe = {}) {
43
+ const platform = probe.platform ?? process.platform;
44
+ if (platform !== "linux")
45
+ return false;
46
+ if (probe.env !== void 0) {
47
+ return WSL_ENV_VARS.some((name) => {
48
+ const value = probe.env(name);
49
+ return typeof value === "string" && value.trim() !== "";
50
+ });
51
+ }
52
+ return (probe.exists ?? ((candidate) => existsSync(candidate)))(WSL_INTEROP_MARKER);
53
+ }
54
+ /**
55
+ * The interop trap the card warns about: we are under WSL **and** what is
56
+ * selected is a Windows executable. Both halves are required — a Linux binary
57
+ * selected on a Windows host is simply nothing to say.
58
+ * @param path - the effective executable path.
59
+ * @param probe - what to consult for the environment (defaults to this process).
60
+ */
61
+ export function isWindowsExecutableUnderWsl(path, probe = {}) {
62
+ return isWindowsSubsystemForLinux(probe) && isWindowsExecutablePath(path);
63
+ }
64
+ //# sourceMappingURL=platform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.js","sourceRoot":"","sources":["../../src/host/platform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAiB7G;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAAa;IACjD,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC3C,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC9B,IAAI,SAAS,KAAK,EAAE;QAAE,OAAO,KAAK,CAAC;IACnC,OAAO,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,mBAAmB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACvF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CAAC,QAAuB,EAAE;IAChE,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC;IACpD,IAAI,QAAQ,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC;IACvC,IAAI,KAAK,CAAC,GAAG,KAAK,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;YAC9B,MAAM,KAAK,GAAG,KAAK,CAAC,GAAI,CAAC,IAAI,CAAC,CAAC;YAC/B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;QAC5D,CAAC,CAAC,CAAC;IACP,CAAC;IACD,OAAO,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC,SAAiB,EAAE,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC;AAChG,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,2BAA2B,CAAC,IAAa,EAAE,QAAuB,EAAE;IAChF,OAAO,0BAA0B,CAAC,KAAK,CAAC,IAAI,uBAAuB,CAAC,IAAI,CAAC,CAAC;AAC9E,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Host-half plugin identity.
3
+ *
4
+ * `name` is what the cordis loader reports for diagnostics and `inject` is the
5
+ * list of host services this half needs of its own; the connection fibers
6
+ * declare the tools, so the only service this row itself asks for is the
7
+ * manager's.
8
+ */
9
+ /** Cordis plugin name used by loader diagnostics. */
10
+ export declare const name = "chrome-devtools-mcp";
11
+ /**
12
+ * The host services this component needs of its own.
13
+ *
14
+ * `mcpConnections` is what the MCP manager *provides*: it is how this component
15
+ * says "there are two kinds of connection here — `chrome` and `chrome-windows`
16
+ * — and here is what one runs with". Declaring it is what the component being a
17
+ * component means — without the manager the injection never answers, so the row
18
+ * describes itself, answers its pickers, and starts nothing.
19
+ */
20
+ export declare const inject: string[];
21
+ //# sourceMappingURL=plugin-meta.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-meta.d.ts","sourceRoot":"","sources":["../../src/host/plugin-meta.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,qDAAqD;AACrD,eAAO,MAAM,IAAI,wBAAwB,CAAC;AAE1C;;;;;;;;GAQG;AACH,eAAO,MAAM,MAAM,EAAE,MAAM,EAAuB,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Host-half plugin identity.
3
+ *
4
+ * `name` is what the cordis loader reports for diagnostics and `inject` is the
5
+ * list of host services this half needs of its own; the connection fibers
6
+ * declare the tools, so the only service this row itself asks for is the
7
+ * manager's.
8
+ */
9
+ /** Cordis plugin name used by loader diagnostics. */
10
+ export const name = "chrome-devtools-mcp";
11
+ /**
12
+ * The host services this component needs of its own.
13
+ *
14
+ * `mcpConnections` is what the MCP manager *provides*: it is how this component
15
+ * says "there are two kinds of connection here — `chrome` and `chrome-windows`
16
+ * — and here is what one runs with". Declaring it is what the component being a
17
+ * component means — without the manager the injection never answers, so the row
18
+ * describes itself, answers its pickers, and starts nothing.
19
+ */
20
+ export const inject = ["mcpConnections"];
21
+ //# sourceMappingURL=plugin-meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-meta.js","sourceRoot":"","sources":["../../src/host/plugin-meta.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,qDAAqD;AACrD,MAAM,CAAC,MAAM,IAAI,GAAG,qBAAqB,CAAC;AAE1C;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,MAAM,GAAa,CAAC,gBAAgB,CAAC,CAAC"}
@@ -0,0 +1,361 @@
1
+ /**
2
+ * The single zod `Config` of the plugin row.
3
+ *
4
+ * Since dsh 0.2.0 the Web GUI card edits the **row configuration** through the
5
+ * profile's configuration form — there is no separate `settings.yaml` namespace
6
+ * and no base layer to publish state over. So one schema carries everything the
7
+ * card reads and writes, and every field the card touches is declared
8
+ * `.volatile()`: a volatile field is editable through the form without
9
+ * remounting the plugin, its user layer rides the profile patch instead of
10
+ * `settings.yaml`, and a live value the Host commits never reaches the patch
11
+ * (the form write strips the volatile fields out of the stored layer before
12
+ * merging).
13
+ *
14
+ * Ordinary fields (`serverName`, `command`, `package`, `chromePaths`, `env`,
15
+ * `cwd`, `toolCallTimeoutMs`, `maxInstructionBytes`, `failOnStartupError`,
16
+ * `reconnect`, `bridgeStderrLog`) are composition-only: the card reads them, it
17
+ * never edits them, and a form write naming one of them is refused by
18
+ * dsh-settings.
19
+ *
20
+ * Host-resolved fields carry the live value in the reference, so the Host
21
+ * publishes them through the live mirror (dsh-ancesters `createLiveMirror`) — never with the form.
22
+ */
23
+ import z from "@deepseek-ai/schemastery";
24
+ /**
25
+ * The plugin row's configuration, and the configuration form the Web GUI card
26
+ * edits. Every `.volatile()` field below is live: a user edit lands in the
27
+ * profile patch and commits without a remount, and the Host's own live answers
28
+ * ride the same references without ever being persisted.
29
+ */
30
+ export declare const Config: z<Schemastery.ObjectS<NoInfer<{
31
+ serverName: z<string, string, "defined">;
32
+ command: z<string, string, "defined">;
33
+ package: z<string, string, "defined">;
34
+ /** Flags appended after `npx -y <package>`; the card's last UI edit. The
35
+ * field's own pattern is what refuses them (an entry that carries a control
36
+ * character never resolves, so a write is refused Host-side rather than
37
+ * landing in argv); an executable-pinning flag is rejected by the Host fold
38
+ * because the executable is picked below. */
39
+ extraFlags: z<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
40
+ chromePaths: z<string[], string[], "defined">;
41
+ env: z<import("@deepseek-ai/cosmokit").Dict<string, string>, import("@deepseek-ai/cosmokit").Dict<string, string>, "defined">;
42
+ cwd: z<string, string, "defined">;
43
+ toolCallTimeoutMs: z<number, number, "defined">;
44
+ /** Ceiling for the bridge's server instructions (UTF-8 bytes, attribution
45
+ * included); an oversized description rejects the connection. Mirrors
46
+ * `dsh-mcp-client`'s own field and default (32768) — a passthrough for a
47
+ * server whose instructions run longer than the cap. */
48
+ maxInstructionBytes: z<number, number, "defined">;
49
+ failOnStartupError: z<boolean, boolean, "defined">;
50
+ reconnect: z<Schemastery.ObjectS<NoInfer<{
51
+ enabled: z<boolean, boolean, "defined">;
52
+ initialDelayMs: z<number, number, "defined">;
53
+ maxDelayMs: z<number, number, "defined">;
54
+ maxAttempts: z<number, number, "defined">;
55
+ }>>, Schemastery.ObjectT<NoInfer<{
56
+ enabled: z<boolean, boolean, "defined">;
57
+ initialDelayMs: z<number, number, "defined">;
58
+ maxDelayMs: z<number, number, "defined">;
59
+ maxAttempts: z<number, number, "defined">;
60
+ }>>, "plain">;
61
+ /** Bridge console-output routing: "log" (default) redirects the spawned
62
+ * npx child's inherited stderr into a per-spawn log file so its progress
63
+ * / startup lines stay out of the dsh console; "console" inherits it
64
+ * (debug). The card's "Reduce log output" toggle (`stderrMode`) overrides
65
+ * this. See {@link buildBridgeSpawn}. */
66
+ bridgeStderr: z<"log" | "console", "log" | "console", "defined">;
67
+ /** Log path override for "log" mode; "" = auto (see
68
+ * {@link bridgeStderrLogPath}). Absolute paths only. */
69
+ bridgeStderrLog: z<string, string, "defined">;
70
+ /**
71
+ * The executable the bridge launches with: picked in the picker (a saved
72
+ * row's `id`) or seeded once by the Host's first scan. "" = nothing
73
+ * resolved yet — there is no auto state to fall back to.
74
+ */
75
+ chromePath: z<string, string, "volatile-defined">;
76
+ /** The picker's saved rows — `{ id: path, name: label }`, user-authored. The
77
+ * Host re-normalizes (trim, dedupe, caps) on every read, and a scan merges
78
+ * what it discovers into them without dropping a name the user chose. */
79
+ executables: z<NoInfer<({
80
+ id?: string | null | undefined;
81
+ name?: string | null | undefined;
82
+ } & import("@deepseek-ai/cosmokit").Dict)[]>, NoInfer<Schemastery.ObjectT<NoInfer<{
83
+ id: z<string, string, "defined">;
84
+ name: z<string, string, "defined">;
85
+ }>>[]>, "volatile-defined">;
86
+ /** The ids of saved rows the user dropped. Every run folds what it found
87
+ * back into the rows, and the found list keeps answering a path the user
88
+ * just deleted, so without this record a dropped row stood back up on the
89
+ * very run the deletion queued (measured live 2026-10-12: the (x86)
90
+ * Windows-executable row read as a delete that never landed). Merge steps
91
+ * skip every id standing here; a list write carrying the id again clears
92
+ * it. Host-authored: the card never edits this field. */
93
+ droppedExecutables: z<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
94
+ /**
95
+ * **Legacy** MRU of hand-typed executables, newest first. The saved rows
96
+ * replace it: a Host whose profile still carries it folds its paths into
97
+ * the rows during the first scan (see ./catalog.ts `mergeEntries`), so the
98
+ * field is read once and never written again.
99
+ */
100
+ chromeCustomPaths: z<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
101
+ /**
102
+ * The card's "Reduce log output" toggle: "log" captures the bridge's
103
+ * stderr into the log file, "console" echoes it (debug). "" follows the
104
+ * row-config `bridgeStderr`.
105
+ */
106
+ stderrMode: z<string, string, "volatile-defined">;
107
+ /** The mode the bridge actually routes console output through — the UI
108
+ * toggle when it states one, else the row config. Mirrored live so the
109
+ * toggle never reads a phantom state (see `resolveStderrMode`). */
110
+ stderrEffective: z<"log" | "console", "log" | "console", "volatile-defined">;
111
+ /** Written by the card's **Fetch executables** button; the Host reacts by
112
+ * re-probing the saved rows and merging what it finds back into them. */
113
+ refreshExecutablesNonce: z<number, number, "volatile-defined">;
114
+ /** Written by the card's **Prelaunch Windows Chrome** button; the Host
115
+ * reacts by running the Windows launch: locate the Windows Chrome, prove
116
+ * the mirrored-loopback prereq, launch it with a debugging port, and write
117
+ * the `--browserUrl` connect entry that leaves the bridge in connect mode. */
118
+ openWindowsChromeNonce: z<number, number, "volatile-defined">;
119
+ /**
120
+ * Whether the translation of this row's **standalone** configuration was
121
+ * offered and turned down. Host-authored:
122
+ * the card never edits it — only the proposal's dismiss action does.
123
+ */
124
+ migrationDismissed: z<boolean, boolean, "volatile-defined">;
125
+ /** Last check/connection failure, human-readable; empty when healthy. */
126
+ lastError: z<string, string, "volatile-defined">;
127
+ /** Known error: the last failure was "no Chrome executable detected". */
128
+ chromeMissing: z<boolean, boolean, "volatile-defined">;
129
+ /** Executable-run counter (success or failure); completion signal for every
130
+ * executable action the card can take. */
131
+ executableDiscoveryRevision: z<number, number, "volatile-defined">;
132
+ /** The version the **selected** executable answered with; "" when nothing
133
+ * answered — nothing picked, a connect mode, or a blocked path. */
134
+ chromeVersion: z<string, string, "volatile-defined">;
135
+ /** Per-row probe status keyed by path: the version the row answered with,
136
+ * and the failure for a row that is present but not runnable (or blocked). */
137
+ executableStatus: z<NoInfer<({
138
+ path?: string | null | undefined;
139
+ version?: string | null | undefined;
140
+ error?: string | null | undefined;
141
+ note?: string | null | undefined;
142
+ } & import("@deepseek-ai/cosmokit").Dict)[]>, NoInfer<Schemastery.ObjectT<NoInfer<{
143
+ path: z<string, string, "defined">;
144
+ version: z<string, string, "defined">;
145
+ error: z<string, string, "defined">;
146
+ note: z<string, string, "defined">;
147
+ }>>[]>, "volatile-defined">;
148
+ /** The path the bridge actually launches with ("" when nothing is fixed). */
149
+ effectiveChromePath: z<string, string, "volatile-defined">;
150
+ /** Where `effectiveChromePath` came from — picked (`"selected"`), row config
151
+ * (`"row-config"`) or nothing yet (""). */
152
+ effectiveSource: z<string, string, "volatile-defined">;
153
+ /** The canonical default extra-flags list — the list the card's **Restore
154
+ * defaults** control appends to what the editor holds. Mirror of
155
+ * `DEFAULT_EXTRA_FLAGS`, served so the card carries no copy of it. */
156
+ defaultExtraFlags: z<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
157
+ /** The recommended WSL ↔ Windows extra-flags list — the list the card's
158
+ * **Flags WSL** control appends, missing entries only. Mirror of
159
+ * `WSL_EXTRA_FLAGS`, served so the card carries no copy of it. */
160
+ wslExtraFlags: z<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
161
+ /** True while this Host runs under WSL and the selected executable is a
162
+ * Windows binary — the state the card's notice explains (see ./platform.ts). */
163
+ wslWindowsExecutable: z<boolean, boolean, "volatile-defined">;
164
+ /** What the **Prelaunch Windows Chrome** run is doing — the single field
165
+ * the card derives the button's state, its disabled reason and the pill's
166
+ * connect-mode muting from. Every half (locate, prereq, launch, port) lives
167
+ * Host-side (./windows/), so the card carries no list of Windows paths or
168
+ * reachability rules. */
169
+ windowsChromeStatus: z<NoInfer<Schemastery.ObjectS<NoInfer<{
170
+ state: z<string, string, "defined">;
171
+ port: z<number, number, "defined">;
172
+ error: z<string, string, "defined">;
173
+ }>>>, NoInfer<Schemastery.ObjectT<NoInfer<{
174
+ state: z<string, string, "defined">;
175
+ port: z<number, number, "defined">;
176
+ error: z<string, string, "defined">;
177
+ }>>>, "volatile-defined">;
178
+ /** True while the bridge launches with a connect-mode flag (`--browserUrl`
179
+ * / `--wsEndpoint`): no local executable is then launched or probed, so the
180
+ * card mutes the picker. */
181
+ carriesConnectionMode: z<boolean, boolean, "volatile-defined">;
182
+ /** The flags a live connection of this component's own kinds actually
183
+ * launches with — mirrored from the last `resolve`, not from any layer, so
184
+ * the machine page states what is running rather than what was last
185
+ * configured. Empty while nothing resolves. */
186
+ runningFlags: z<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
187
+ /** The note the last live connection answered with — where its console
188
+ * output goes, or the Windows URL it connected to. "" when the answer was
189
+ * silent. */
190
+ runningNote: z<string, string, "volatile-defined">;
191
+ }>>, Schemastery.ObjectT<NoInfer<{
192
+ serverName: z<string, string, "defined">;
193
+ command: z<string, string, "defined">;
194
+ package: z<string, string, "defined">;
195
+ /** Flags appended after `npx -y <package>`; the card's last UI edit. The
196
+ * field's own pattern is what refuses them (an entry that carries a control
197
+ * character never resolves, so a write is refused Host-side rather than
198
+ * landing in argv); an executable-pinning flag is rejected by the Host fold
199
+ * because the executable is picked below. */
200
+ extraFlags: z<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
201
+ chromePaths: z<string[], string[], "defined">;
202
+ env: z<import("@deepseek-ai/cosmokit").Dict<string, string>, import("@deepseek-ai/cosmokit").Dict<string, string>, "defined">;
203
+ cwd: z<string, string, "defined">;
204
+ toolCallTimeoutMs: z<number, number, "defined">;
205
+ /** Ceiling for the bridge's server instructions (UTF-8 bytes, attribution
206
+ * included); an oversized description rejects the connection. Mirrors
207
+ * `dsh-mcp-client`'s own field and default (32768) — a passthrough for a
208
+ * server whose instructions run longer than the cap. */
209
+ maxInstructionBytes: z<number, number, "defined">;
210
+ failOnStartupError: z<boolean, boolean, "defined">;
211
+ reconnect: z<Schemastery.ObjectS<NoInfer<{
212
+ enabled: z<boolean, boolean, "defined">;
213
+ initialDelayMs: z<number, number, "defined">;
214
+ maxDelayMs: z<number, number, "defined">;
215
+ maxAttempts: z<number, number, "defined">;
216
+ }>>, Schemastery.ObjectT<NoInfer<{
217
+ enabled: z<boolean, boolean, "defined">;
218
+ initialDelayMs: z<number, number, "defined">;
219
+ maxDelayMs: z<number, number, "defined">;
220
+ maxAttempts: z<number, number, "defined">;
221
+ }>>, "plain">;
222
+ /** Bridge console-output routing: "log" (default) redirects the spawned
223
+ * npx child's inherited stderr into a per-spawn log file so its progress
224
+ * / startup lines stay out of the dsh console; "console" inherits it
225
+ * (debug). The card's "Reduce log output" toggle (`stderrMode`) overrides
226
+ * this. See {@link buildBridgeSpawn}. */
227
+ bridgeStderr: z<"log" | "console", "log" | "console", "defined">;
228
+ /** Log path override for "log" mode; "" = auto (see
229
+ * {@link bridgeStderrLogPath}). Absolute paths only. */
230
+ bridgeStderrLog: z<string, string, "defined">;
231
+ /**
232
+ * The executable the bridge launches with: picked in the picker (a saved
233
+ * row's `id`) or seeded once by the Host's first scan. "" = nothing
234
+ * resolved yet — there is no auto state to fall back to.
235
+ */
236
+ chromePath: z<string, string, "volatile-defined">;
237
+ /** The picker's saved rows — `{ id: path, name: label }`, user-authored. The
238
+ * Host re-normalizes (trim, dedupe, caps) on every read, and a scan merges
239
+ * what it discovers into them without dropping a name the user chose. */
240
+ executables: z<NoInfer<({
241
+ id?: string | null | undefined;
242
+ name?: string | null | undefined;
243
+ } & import("@deepseek-ai/cosmokit").Dict)[]>, NoInfer<Schemastery.ObjectT<NoInfer<{
244
+ id: z<string, string, "defined">;
245
+ name: z<string, string, "defined">;
246
+ }>>[]>, "volatile-defined">;
247
+ /** The ids of saved rows the user dropped. Every run folds what it found
248
+ * back into the rows, and the found list keeps answering a path the user
249
+ * just deleted, so without this record a dropped row stood back up on the
250
+ * very run the deletion queued (measured live 2026-10-12: the (x86)
251
+ * Windows-executable row read as a delete that never landed). Merge steps
252
+ * skip every id standing here; a list write carrying the id again clears
253
+ * it. Host-authored: the card never edits this field. */
254
+ droppedExecutables: z<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
255
+ /**
256
+ * **Legacy** MRU of hand-typed executables, newest first. The saved rows
257
+ * replace it: a Host whose profile still carries it folds its paths into
258
+ * the rows during the first scan (see ./catalog.ts `mergeEntries`), so the
259
+ * field is read once and never written again.
260
+ */
261
+ chromeCustomPaths: z<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
262
+ /**
263
+ * The card's "Reduce log output" toggle: "log" captures the bridge's
264
+ * stderr into the log file, "console" echoes it (debug). "" follows the
265
+ * row-config `bridgeStderr`.
266
+ */
267
+ stderrMode: z<string, string, "volatile-defined">;
268
+ /** The mode the bridge actually routes console output through — the UI
269
+ * toggle when it states one, else the row config. Mirrored live so the
270
+ * toggle never reads a phantom state (see `resolveStderrMode`). */
271
+ stderrEffective: z<"log" | "console", "log" | "console", "volatile-defined">;
272
+ /** Written by the card's **Fetch executables** button; the Host reacts by
273
+ * re-probing the saved rows and merging what it finds back into them. */
274
+ refreshExecutablesNonce: z<number, number, "volatile-defined">;
275
+ /** Written by the card's **Prelaunch Windows Chrome** button; the Host
276
+ * reacts by running the Windows launch: locate the Windows Chrome, prove
277
+ * the mirrored-loopback prereq, launch it with a debugging port, and write
278
+ * the `--browserUrl` connect entry that leaves the bridge in connect mode. */
279
+ openWindowsChromeNonce: z<number, number, "volatile-defined">;
280
+ /**
281
+ * Whether the translation of this row's **standalone** configuration was
282
+ * offered and turned down. Host-authored:
283
+ * the card never edits it — only the proposal's dismiss action does.
284
+ */
285
+ migrationDismissed: z<boolean, boolean, "volatile-defined">;
286
+ /** Last check/connection failure, human-readable; empty when healthy. */
287
+ lastError: z<string, string, "volatile-defined">;
288
+ /** Known error: the last failure was "no Chrome executable detected". */
289
+ chromeMissing: z<boolean, boolean, "volatile-defined">;
290
+ /** Executable-run counter (success or failure); completion signal for every
291
+ * executable action the card can take. */
292
+ executableDiscoveryRevision: z<number, number, "volatile-defined">;
293
+ /** The version the **selected** executable answered with; "" when nothing
294
+ * answered — nothing picked, a connect mode, or a blocked path. */
295
+ chromeVersion: z<string, string, "volatile-defined">;
296
+ /** Per-row probe status keyed by path: the version the row answered with,
297
+ * and the failure for a row that is present but not runnable (or blocked). */
298
+ executableStatus: z<NoInfer<({
299
+ path?: string | null | undefined;
300
+ version?: string | null | undefined;
301
+ error?: string | null | undefined;
302
+ note?: string | null | undefined;
303
+ } & import("@deepseek-ai/cosmokit").Dict)[]>, NoInfer<Schemastery.ObjectT<NoInfer<{
304
+ path: z<string, string, "defined">;
305
+ version: z<string, string, "defined">;
306
+ error: z<string, string, "defined">;
307
+ note: z<string, string, "defined">;
308
+ }>>[]>, "volatile-defined">;
309
+ /** The path the bridge actually launches with ("" when nothing is fixed). */
310
+ effectiveChromePath: z<string, string, "volatile-defined">;
311
+ /** Where `effectiveChromePath` came from — picked (`"selected"`), row config
312
+ * (`"row-config"`) or nothing yet (""). */
313
+ effectiveSource: z<string, string, "volatile-defined">;
314
+ /** The canonical default extra-flags list — the list the card's **Restore
315
+ * defaults** control appends to what the editor holds. Mirror of
316
+ * `DEFAULT_EXTRA_FLAGS`, served so the card carries no copy of it. */
317
+ defaultExtraFlags: z<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
318
+ /** The recommended WSL ↔ Windows extra-flags list — the list the card's
319
+ * **Flags WSL** control appends, missing entries only. Mirror of
320
+ * `WSL_EXTRA_FLAGS`, served so the card carries no copy of it. */
321
+ wslExtraFlags: z<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
322
+ /** True while this Host runs under WSL and the selected executable is a
323
+ * Windows binary — the state the card's notice explains (see ./platform.ts). */
324
+ wslWindowsExecutable: z<boolean, boolean, "volatile-defined">;
325
+ /** What the **Prelaunch Windows Chrome** run is doing — the single field
326
+ * the card derives the button's state, its disabled reason and the pill's
327
+ * connect-mode muting from. Every half (locate, prereq, launch, port) lives
328
+ * Host-side (./windows/), so the card carries no list of Windows paths or
329
+ * reachability rules. */
330
+ windowsChromeStatus: z<NoInfer<Schemastery.ObjectS<NoInfer<{
331
+ state: z<string, string, "defined">;
332
+ port: z<number, number, "defined">;
333
+ error: z<string, string, "defined">;
334
+ }>>>, NoInfer<Schemastery.ObjectT<NoInfer<{
335
+ state: z<string, string, "defined">;
336
+ port: z<number, number, "defined">;
337
+ error: z<string, string, "defined">;
338
+ }>>>, "volatile-defined">;
339
+ /** True while the bridge launches with a connect-mode flag (`--browserUrl`
340
+ * / `--wsEndpoint`): no local executable is then launched or probed, so the
341
+ * card mutes the picker. */
342
+ carriesConnectionMode: z<boolean, boolean, "volatile-defined">;
343
+ /** The flags a live connection of this component's own kinds actually
344
+ * launches with — mirrored from the last `resolve`, not from any layer, so
345
+ * the machine page states what is running rather than what was last
346
+ * configured. Empty while nothing resolves. */
347
+ runningFlags: z<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
348
+ /** The note the last live connection answered with — where its console
349
+ * output goes, or the Windows URL it connected to. "" when the answer was
350
+ * silent. */
351
+ runningNote: z<string, string, "volatile-defined">;
352
+ }>>, "plain">;
353
+ /** What one row's configuration **form** answers with — every field resolved to a
354
+ * plain, nullable value (`TypeS`, not `TypeT`: the volatile fields stay plain here,
355
+ * they are not wrapped references). This is the stored/described shape: what a
356
+ * described settings row carries, and what the card reads out of its snapshot.
357
+ * What `apply` receives is **not** this shape — every `.volatile()` field of it
358
+ * arrives as a reference instead, which is why the host half carries its own
359
+ * runtime view in ./types/config.ts (`ChromeMcpConfig`). */
360
+ export type ConfigFormValues = Schemastery.TypeS<typeof Config>;
361
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/host/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,CAAC,MAAM,0BAA0B,CAAC;AAoDzC;;;;;GAKG;AACH,eAAO,MAAM,MAAM;;;;IAIf;;;;iDAI6C;;;;;;IAM7C;;;4DAGwD;;;;;;;;;;;;;;IAIxD;;;;6CAIyC;;IAEzC;4DACwD;;IAKxD;;;;OAIG;;IAEH;;6EAEyE;;;;;;;;IAEzE;;;;;;6DAMyD;;IAEzD;;;;;OAKG;;IAEH;;;;OAIG;;IAEH;;uEAEmE;;IAEnE;6EACyE;;IAEzE;;;kFAG8E;;IAE9E;;;;OAIG;;IAKH,yEAAyE;;IAEzE,yEAAyE;;IAEzE;8CAC0C;;IAE1C;uEACmE;;IAEnE;kFAC8E;;;;;;;;;;;;IAE9E,6EAA6E;;IAE7E;+CAC2C;;IAE3C;;0EAEsE;;IAEtE;;sEAEkE;;IAElE;oFACgF;;IAEhF;;;;6BAIyB;;;;;;;;;;IAEzB;;gCAE4B;;IAE5B;;;mDAG+C;;IAE/C;;iBAEa;;;;;;IA/Hb;;;;iDAI6C;;;;;;IAM7C;;;4DAGwD;;;;;;;;;;;;;;IAIxD;;;;6CAIyC;;IAEzC;4DACwD;;IAKxD;;;;OAIG;;IAEH;;6EAEyE;;;;;;;;IAEzE;;;;;;6DAMyD;;IAEzD;;;;;OAKG;;IAEH;;;;OAIG;;IAEH;;uEAEmE;;IAEnE;6EACyE;;IAEzE;;;kFAG8E;;IAE9E;;;;OAIG;;IAKH,yEAAyE;;IAEzE,yEAAyE;;IAEzE;8CAC0C;;IAE1C;uEACmE;;IAEnE;kFAC8E;;;;;;;;;;;;IAE9E,6EAA6E;;IAE7E;+CAC2C;;IAE3C;;0EAEsE;;IAEtE;;sEAEkE;;IAElE;oFACgF;;IAEhF;;;;6BAIyB;;;;;;;;;;IAEzB;;gCAE4B;;IAE5B;;;mDAG+C;;IAE/C;;iBAEa;;aAEf,CAAC;AAEH;;;;;;4DAM4D;AAC5D,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC"}