@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.
Files changed (172) hide show
  1. package/README.md +44 -39
  2. package/lib/client.js +2186 -614
  3. package/lib/client.js.map +4 -4
  4. package/lib/host/apply.d.ts +38 -1
  5. package/lib/host/apply.d.ts.map +1 -1
  6. package/lib/host/apply.js +43 -17
  7. package/lib/host/apply.js.map +1 -1
  8. package/lib/host/bridge.d.ts +28 -19
  9. package/lib/host/bridge.d.ts.map +1 -1
  10. package/lib/host/bridge.js +71 -79
  11. package/lib/host/bridge.js.map +1 -1
  12. package/lib/host/catalog.d.ts +2 -2
  13. package/lib/host/catalog.js +2 -2
  14. package/lib/host/commands/chrome-path.d.ts +4 -0
  15. package/lib/host/commands/chrome-path.d.ts.map +1 -0
  16. package/lib/host/commands/chrome-path.js +65 -0
  17. package/lib/host/commands/chrome-path.js.map +1 -0
  18. package/lib/host/commands/chrome-refresh.d.ts +17 -0
  19. package/lib/host/commands/chrome-refresh.d.ts.map +1 -0
  20. package/lib/host/commands/chrome-refresh.js +37 -0
  21. package/lib/host/commands/chrome-refresh.js.map +1 -0
  22. package/lib/host/commands/index.d.ts +26 -0
  23. package/lib/host/commands/index.d.ts.map +1 -0
  24. package/lib/host/commands/index.js +41 -0
  25. package/lib/host/commands/index.js.map +1 -0
  26. package/lib/host/constants.d.ts +107 -30
  27. package/lib/host/constants.d.ts.map +1 -1
  28. package/lib/host/constants.js +107 -30
  29. package/lib/host/constants.js.map +1 -1
  30. package/lib/host/controller/_trace.d.ts +3 -0
  31. package/lib/host/controller/_trace.d.ts.map +1 -0
  32. package/lib/host/controller/_trace.js +14 -0
  33. package/lib/host/controller/_trace.js.map +1 -0
  34. package/lib/host/controller/bridge-run.d.ts +4 -2
  35. package/lib/host/controller/bridge-run.d.ts.map +1 -1
  36. package/lib/host/controller/bridge-run.js +24 -8
  37. package/lib/host/controller/bridge-run.js.map +1 -1
  38. package/lib/host/controller/captures.d.ts +9 -16
  39. package/lib/host/controller/captures.d.ts.map +1 -1
  40. package/lib/host/controller/captures.js +73 -48
  41. package/lib/host/controller/captures.js.map +1 -1
  42. package/lib/host/controller/commits.d.ts +2 -2
  43. package/lib/host/controller/commits.d.ts.map +1 -1
  44. package/lib/host/controller/commits.js +97 -41
  45. package/lib/host/controller/commits.js.map +1 -1
  46. package/lib/host/controller/connections.d.ts +38 -0
  47. package/lib/host/controller/connections.d.ts.map +1 -0
  48. package/lib/host/controller/connections.js +71 -0
  49. package/lib/host/controller/connections.js.map +1 -0
  50. package/lib/host/controller/controller.d.ts +19 -24
  51. package/lib/host/controller/controller.d.ts.map +1 -1
  52. package/lib/host/controller/controller.js +181 -114
  53. package/lib/host/controller/controller.js.map +1 -1
  54. package/lib/host/controller/index.d.ts +18 -14
  55. package/lib/host/controller/index.d.ts.map +1 -1
  56. package/lib/host/controller/index.js +16 -14
  57. package/lib/host/controller/index.js.map +1 -1
  58. package/lib/host/controller/notes.d.ts +9 -9
  59. package/lib/host/controller/notes.d.ts.map +1 -1
  60. package/lib/host/controller/notes.js +16 -21
  61. package/lib/host/controller/notes.js.map +1 -1
  62. package/lib/host/controller/persist.d.ts +10 -3
  63. package/lib/host/controller/persist.d.ts.map +1 -1
  64. package/lib/host/controller/persist.js +89 -42
  65. package/lib/host/controller/persist.js.map +1 -1
  66. package/lib/host/controller/publish.d.ts +4 -0
  67. package/lib/host/controller/publish.d.ts.map +1 -0
  68. package/lib/host/controller/publish.js +56 -0
  69. package/lib/host/controller/publish.js.map +1 -0
  70. package/lib/host/controller/runs.d.ts +34 -10
  71. package/lib/host/controller/runs.d.ts.map +1 -1
  72. package/lib/host/controller/runs.js +241 -58
  73. package/lib/host/controller/runs.js.map +1 -1
  74. package/lib/host/controller/state.d.ts +122 -20
  75. package/lib/host/controller/state.d.ts.map +1 -1
  76. package/lib/host/controller/windows-run.d.ts +10 -2
  77. package/lib/host/controller/windows-run.d.ts.map +1 -1
  78. package/lib/host/controller/windows-run.js +66 -35
  79. package/lib/host/controller/windows-run.js.map +1 -1
  80. package/lib/host/discovery/candidates.d.ts +23 -13
  81. package/lib/host/discovery/candidates.d.ts.map +1 -1
  82. package/lib/host/discovery/candidates.js +20 -8
  83. package/lib/host/discovery/candidates.js.map +1 -1
  84. package/lib/host/discovery/index.d.ts +1 -0
  85. package/lib/host/discovery/index.d.ts.map +1 -1
  86. package/lib/host/discovery/index.js +1 -0
  87. package/lib/host/discovery/index.js.map +1 -1
  88. package/lib/host/discovery/probe.d.ts +16 -5
  89. package/lib/host/discovery/probe.d.ts.map +1 -1
  90. package/lib/host/discovery/probe.js +68 -10
  91. package/lib/host/discovery/probe.js.map +1 -1
  92. package/lib/host/discovery/scan.d.ts +14 -9
  93. package/lib/host/discovery/scan.d.ts.map +1 -1
  94. package/lib/host/discovery/scan.js +56 -30
  95. package/lib/host/discovery/scan.js.map +1 -1
  96. package/lib/host/flags.d.ts +28 -5
  97. package/lib/host/flags.d.ts.map +1 -1
  98. package/lib/host/flags.js +75 -7
  99. package/lib/host/flags.js.map +1 -1
  100. package/lib/host/kind.d.ts +45 -0
  101. package/lib/host/kind.d.ts.map +1 -0
  102. package/lib/host/kind.js +251 -0
  103. package/lib/host/kind.js.map +1 -0
  104. package/lib/host/manager.d.ts +21 -0
  105. package/lib/host/manager.d.ts.map +1 -0
  106. package/lib/host/manager.js +113 -0
  107. package/lib/host/manager.js.map +1 -0
  108. package/lib/host/migration.d.ts +26 -0
  109. package/lib/host/migration.d.ts.map +1 -0
  110. package/lib/host/migration.js +127 -0
  111. package/lib/host/migration.js.map +1 -0
  112. package/lib/host/plugin-meta.d.ts +12 -3
  113. package/lib/host/plugin-meta.d.ts.map +1 -1
  114. package/lib/host/plugin-meta.js +13 -4
  115. package/lib/host/plugin-meta.js.map +1 -1
  116. package/lib/host/schema.d.ts +301 -247
  117. package/lib/host/schema.d.ts.map +1 -1
  118. package/lib/host/schema.js +145 -120
  119. package/lib/host/schema.js.map +1 -1
  120. package/lib/host/settings.d.ts +22 -3
  121. package/lib/host/settings.d.ts.map +1 -1
  122. package/lib/host/settings.js +81 -60
  123. package/lib/host/settings.js.map +1 -1
  124. package/lib/host/status.d.ts +7 -10
  125. package/lib/host/status.d.ts.map +1 -1
  126. package/lib/host/status.js +8 -23
  127. package/lib/host/status.js.map +1 -1
  128. package/lib/host/tool.d.ts +13 -7
  129. package/lib/host/tool.d.ts.map +1 -1
  130. package/lib/host/tool.js +4 -3
  131. package/lib/host/tool.js.map +1 -1
  132. package/lib/host/types/config.d.ts +66 -12
  133. package/lib/host/types/config.d.ts.map +1 -1
  134. package/lib/host/types/executable.d.ts +8 -3
  135. package/lib/host/types/executable.d.ts.map +1 -1
  136. package/lib/host/types/index.d.ts +5 -4
  137. package/lib/host/types/index.d.ts.map +1 -1
  138. package/lib/host/types/services.d.ts +26 -0
  139. package/lib/host/types/services.d.ts.map +1 -0
  140. package/lib/host/types/services.js +9 -0
  141. package/lib/host/types/services.js.map +1 -0
  142. package/lib/host/types/settings.d.ts +118 -65
  143. package/lib/host/types/settings.d.ts.map +1 -1
  144. package/lib/host/types/stderr.d.ts +3 -5
  145. package/lib/host/types/stderr.d.ts.map +1 -1
  146. package/lib/host/values.d.ts +152 -37
  147. package/lib/host/values.d.ts.map +1 -1
  148. package/lib/host/values.js +304 -112
  149. package/lib/host/values.js.map +1 -1
  150. package/lib/host/windows/connect-flags.d.ts +19 -8
  151. package/lib/host/windows/connect-flags.d.ts.map +1 -1
  152. package/lib/host/windows/connect-flags.js +50 -20
  153. package/lib/host/windows/connect-flags.js.map +1 -1
  154. package/lib/host/windows/index.d.ts +1 -1
  155. package/lib/host/windows/index.d.ts.map +1 -1
  156. package/lib/host/windows/index.js +1 -1
  157. package/lib/host/windows/index.js.map +1 -1
  158. package/lib/host/windows/paths.d.ts +27 -6
  159. package/lib/host/windows/paths.d.ts.map +1 -1
  160. package/lib/host/windows/paths.js +40 -13
  161. package/lib/host/windows/paths.js.map +1 -1
  162. package/lib/host/windows/run.d.ts.map +1 -1
  163. package/lib/host/windows/run.js +3 -2
  164. package/lib/host/windows/run.js.map +1 -1
  165. package/lib/index.d.ts +72 -56
  166. package/lib/index.d.ts.map +1 -1
  167. package/lib/index.js +74 -55
  168. package/lib/index.js.map +1 -1
  169. package/locale/en.json +6 -0
  170. package/locale/zh.json +6 -0
  171. package/package.json +35 -14
  172. package/cordis.patch.yml +0 -5
@@ -1 +1 @@
1
- {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/host/status.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,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;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAUzG"}
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"}
@@ -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 base layer's `lastError`; `isChromeMissing`
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. Failed
38
- * calls return "<tool> failed: <first text line>" — tool-level errors
39
- * (browser unreachable, "Target closed", …) are returned to the calling
40
- * agent and never route through the bridge logger, so this is the only
41
- * capture point. Successes return null: the caller clears the stored error.
42
- * @param toolName - fully qualified registered name (`mcp__<server>__<tool>`).
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 function toolResultNote(toolName, result) {
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
@@ -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;AAG3C,oDAAoD;AACpD,MAAM,UAAU,SAAS,CAAC,IAAa,EAAE,M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C,IAAI,CAAC,OAAO,CAAC,CACzD,CAAC;AACN,CAAC;AAED;;;;;;;GAOG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC"}
@@ -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
- * the run itself lives in ./windows/, the queueing + state mirror in the
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: our own
13
- * nested mcp-client row is what publishes the bridge's tools, so a static
14
- * `inject: ["tools"]` on this plugin would risk the same load-order cycle
15
- * the tool-result listener bullet warns about. `ctx.inject` resolves the
16
- * service lazily, which is what the listener idiom already relies on.
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
@@ -1 +1 @@
1
- {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/host/tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBA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,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 and switch the Chrome bridge to connect mode — the same run the card's Prelaunch Windows Chrome button drives. " +
8
- "Takes no arguments: the host locates the Windows browser, checks that the Windows loopback is reachable from this WSL 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 connects on the port's address. On a non-WSL host it answers \"not applicable\". " +
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: {
@@ -1 +1 @@
1
- {"version":3,"file":"tool.js","sourceRoot":"","sources":["../../src/host/tool.ts"],"names":[],"mappings":"AAwBA,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,qJAAqJ;YACrJ,6HAA6H;YAC7H,iIAAiI;YACjI,gIAAgI;YAChI,4JAA4J;YAC5J,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,IA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;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 validated row config and the plugin context.
2
+ * Types — the config `apply` receives, and the plugin context.
3
3
  *
4
- * The config a cordis plugin row carries (every field defaulting through the
5
- * zod schema in ./schema.ts) and the narrow service/fiber views this host half
6
- * actually calls. Split out of the single `types.ts`. Structural views stay
7
- * narrow: only what the host half calls, widened no further than that.
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
- * A validated row config (every field carries a schema default).
13
- * Mirrors the zod schema shape for typed access in apply().
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 (the persisted `stderrMode`) overrides this. */
46
+ * output" toggle (`stderrMode`) overrides this. */
30
47
  bridgeStderr: BridgeStderrMode;
31
- /** Optional absolute path for the stderr log ("" → the per-spawn
32
- * `<tmpdir>/dsh-chrome-mcp-<serverName>-bridge-<pid>.log` default). */
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;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,iBAAiB,EAAE,MAAM,CAAC;IAC1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W,CAAC,OAAO,CAAC,CAAC;IAC3C,mBAAmB,EAAE,WAAW,CAAC,mBAAmB,CAAC,CAAC;IACtD,qBAAqB,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5C;wBACoB;IACpB,YAAY,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;IACpC,kDAAkD;IAClD,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACjC,sEAAsE;IACtE,kBAAkB,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CAC5C,CAAC;AAEF,sEAAsE;AACtE,MAAM,MAAM,eAAe,GAAG;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC"}
@@ -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) and the failure that makes the row not
20
- * runnable (`""` when it runs). Base-layer status, never persisted — the row
21
- * itself lives in the user layer.
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;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,oEAAoE;AACpE,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG,YAAY,GAAG,EAAE,CAAC"}
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 validated row config + reconnect + PluginContext
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 persisted section, base layer, resolved value, service
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 { SettingsUserFields, SettingsBaseLayer, SettingsResolved, ValidatedSettings, SettingsOp, SettingsService } from "./settings.js";
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;AACnF,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,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC7I,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,cAAc,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 persisted settings section and its composition layers.
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
- * What the user edits (and only that persists), the in-memory base layer served
5
- * alongside it, the resolved value the client card reads, and the `settings`
6
- * service surface this host half installs the section into. Split out of the
7
- * single `types.ts`.
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
- * User-authored settings fields — the only keys that persist.
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 SettingsUserFields = {
20
+ export type ConfigUserFields = {
16
21
  extraFlags: string[];
17
- /** Written by the card's **Search executables** action: one host run that
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` — there is no push channel, so
24
- * an action travels as one write that the host reacts to. */
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). Persisted, user-authored; a scan merges what it
32
- * finds into them without dropping a name the user chose. */
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 settings still carry it folds its paths into the rows on
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
- * In-memory composition base layer served alongside the user layer.
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 SettingsBaseLayer = {
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 — the reference plugin names it
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: the version a row answered with, and
59
- * the failure for a row that is present but not runnable (or blocked). Base
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
- /** True while the running host is WSL **and** the effective executable is a
68
- * Windows binary: it cannot be launched across the interop boundary, so the
69
- * card shows the static notice that spells out the configuration a Windows
70
- * browser does need. Base layer, never persisted. */
71
- wslWindowsExecutable: boolean;
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 (static base-layer
80
- * mirror of `WSL_EXTRA_FLAGS`; never persisted) — what the card's **Flags
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
- /** What the **Prelaunch Windows Chrome** run is doing right now (base layer;
85
- * never persisted). The whole Windows path lives host-side — locate,
86
- * prereq, launch, port — so the card renders this one field and carries
87
- * no list of Windows paths or of reachability rules. */
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
- * local selection the bridge is not running. */
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
- * Resolved value served to the client card.
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 SettingsResolved = SettingsUserFields & SettingsBaseLayer;
117
+ export type ConfigLayers = {
118
+ value: ConfigUserFields;
119
+ user: ConfigLayerFields;
120
+ base: ConfigLayerFields;
121
+ };
99
122
  /**
100
- * Validated settings section as consumed by the validate hook.
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
- export type ValidatedSettings = {
103
- extraFlags: string[];
104
- stderrMode: "" | BridgeStderrMode;
105
- chromePath: string;
106
- executables: ChromeExecutableEntry[];
107
- };
108
- /** One `settings.mutate` operation: `set` a path, or `unset` it. */
109
- export type SettingsOp = {
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?: unknown;
138
+ path: readonly string[];
139
+ value: unknown;
113
140
  } | {
114
141
  op: "unset";
115
- path: string[];
142
+ path: readonly string[];
116
143
  };
117
- /** Surface of the `settings` service as consumed here. */
118
- export interface SettingsService {
119
- document?: Record<string, Record<string, any> | undefined> | undefined;
120
- mutate(ns: string, ops: SettingsOp[]): Promise<unknown> | unknown;
121
- installSection(ctx: unknown, ns: string, schema: unknown, base: Partial<SettingsResolved>, hooks: {
122
- setSource?: (source: () => SettingsResolved) => void;
123
- validate?: (value: SettingsResolved) => void;
124
- onChange?: () => void;
125
- }): void;
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