@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
@@ -0,0 +1,251 @@
1
+ /**
2
+ * The two connection kinds this component registers with the manager — the live
3
+ * half, seen from this component.
4
+ *
5
+ * The manager's pool starts, switches and stops the connections; what this
6
+ * module answers is what the pool needs: what each `select` offers (the saved
7
+ * rows plus whatever discovery reported plus what a live connection runs with),
8
+ * how one entry turns into the fixed `<node> <pinned chrome-devtools-mcp cli> …`
9
+ * stdio, and — for the Windows kind — the whole prelaunch run.
10
+ *
11
+ * What the kinds decide about the card:
12
+ *
13
+ * - `transport: "none"` — each kind owns everything through its `fields`, so the
14
+ * core's stdio/http fields stay hidden and what the entry's editor shows is
15
+ * exactly what `resolve` reads back.
16
+ * - No `maxEntries`, no composer pill (unlike docker): any number of connections
17
+ * of either kind may stand, and none of them claims the conversation input.
18
+ * - `resolve()` of the Windows kind is **async**: preparing it IS the prelaunch
19
+ * (locate → free port → interop launch → wait for the bind). The pool caches
20
+ * the preparation per entry, so a browser is never launched twice for one
21
+ * state.
22
+ *
23
+ * The choices a `select` offers are **Host-served**: read off the live state when
24
+ * the manager asks for them. `notifyKindsChanged` (installed by ./manager.ts) is
25
+ * what says "what they would answer moved" — that is how a discovery run shows
26
+ * up in a picker.
27
+ */
28
+ import { KIND_FIELDS, KIND_ID_CHROME, KIND_CHROME_LABEL, KIND_CHROME_SUMMARY, KIND_ID_WINDOWS, KIND_WINDOWS_LABEL, KIND_WINDOWS_SUMMARY, FLAG_LINE_SEPARATOR, NOT_WSL_ERROR } from "./constants.js";
29
+ import { buildBridgeSpawn, buildServerArgs, serverCommand } from "./bridge.js";
30
+ import { flagsSkipCheck } from "./flags.js";
31
+ import { firstLine } from "./status.js";
32
+ import { resolveLaunchFlags, resolveSelection, resolveStderrModeFromLayers, readSavedExecutables } from "./values.js";
33
+ import { windowsChromeUrl, withBrowserUrlFlag } from "./windows/index.js";
34
+ /** Split one `lines` field's value into its flags. Missing/blank answers nothing
35
+ * — the entry carries no own answer, so the caller falls through to the row. */
36
+ export function parseFlagLines(value) {
37
+ if (typeof value !== "string")
38
+ return void 0;
39
+ const flags = value.split(/\r?\n/u).map((flag) => flag.trim()).filter((flag) => flag !== "");
40
+ return flags.length === 0 ? void 0 : flags;
41
+ }
42
+ /** Join one flags list back into a `lines` field value (round-trips with
43
+ * {@link parseFlagLines}). */
44
+ export function joinFlagLines(flags) {
45
+ return flags.join(FLAG_LINE_SEPARATOR);
46
+ }
47
+ /**
48
+ * What the executable field offers: the saved rows first, then every path the
49
+ * last scan reported, then the Windows-side executables a WSL host carries, then
50
+ * the path a live connection actually launches with — the running path is the
51
+ * answer the Host knows best, and it may not be a saved row yet. A stored pick
52
+ * the choices stop carrying stays offered by the card itself, so it never
53
+ * silently becomes another one.
54
+ */
55
+ export function executableChoices(controller) {
56
+ const { state } = controller;
57
+ const seen = new Map();
58
+ for (const row of readSavedExecutables(state.source())) {
59
+ if (row.id === "")
60
+ continue;
61
+ seen.set(row.id, { value: row.id, label: row.name === "" ? row.id : row.name });
62
+ }
63
+ for (const status of state.live.executableStatus) {
64
+ if (!seen.has(status.path))
65
+ seen.set(status.path, { value: status.path, label: status.path });
66
+ }
67
+ for (const path of controller.windowsExecutables()) {
68
+ if (!seen.has(path))
69
+ seen.set(path, { value: path, label: path });
70
+ }
71
+ if (state.runningChromePath !== "" && !seen.has(state.runningChromePath))
72
+ seen.set(state.runningChromePath, { value: state.runningChromePath, label: state.runningChromePath });
73
+ return [...seen.values()];
74
+ }
75
+ /** The executable one entry launches with: its own pick, else what the row's
76
+ * layers resolve (the user layer, then the row config with a legacy
77
+ * `--executablePath` folded in) — never a scan answer and never a re-resolve. */
78
+ export function entryExecutable(entry, controller) {
79
+ const picked = typeof entry.extra[KIND_FIELDS.executable] === "string" ? String(entry.extra[KIND_FIELDS.executable]).trim() : "";
80
+ if (picked !== "")
81
+ return picked;
82
+ return resolveSelection(controller.state.source()).path;
83
+ }
84
+ /** The flags one entry launches with: its own `lines` field, else the row's
85
+ * resolved precedence (user layer > `DSH_CHROME_MCP_FLAGS` > row config > the
86
+ * schema default). */
87
+ export function entryExtraFlags(entry, controller) {
88
+ const own = parseFlagLines(entry.extra[KIND_FIELDS.extraFlags]);
89
+ if (own !== void 0)
90
+ return own;
91
+ return resolveLaunchFlags(controller.state.source(), controller.launchFlags);
92
+ }
93
+ /** The console-output mode one entry runs with: its own pick, else the row's
94
+ * answer. Never a third state. The field is a toggle (`"true"` = reduce = log
95
+ * file); the `log`/`console` it stored while it was a choice still read. */
96
+ export function entryStderrMode(entry, controller) {
97
+ const picked = entry.extra[KIND_FIELDS.stderrMode];
98
+ if (picked === "true")
99
+ return "log";
100
+ if (picked === "false")
101
+ return "console";
102
+ if (picked === "console" || picked === "log")
103
+ return picked;
104
+ return resolveStderrModeFromLayers(controller.state.source(), controller.config.bridgeStderr);
105
+ }
106
+ /** One reason an entry cannot run: a Windows binary under WSL can be *found* but
107
+ * never *driven* from a launch — the debug pipes do not cross the interop
108
+ * boundary. */
109
+ const WINDOWS_EXECUTABLE_UNDER_WSL = "launching Windows Chrome from WSL is not supported — use the Windows Chrome (WSL debug port) kind to drive the Windows-side browser";
110
+ /** One entry's local stdio config: the fixed pinned-server argv through the
111
+ * stderr wrapper, `serverName` is the entry's id (the tool namespace rides
112
+ * `entry.id` now, not the row's old `serverName`). */
113
+ function localConfig(entry, controller, flags, executable, stderrMode) {
114
+ const composed = { ...controller.config, extraFlags: [...flags], chromePath: executable, serverName: entry.id };
115
+ const spawned = buildBridgeSpawn({
116
+ command: serverCommand(controller.config),
117
+ args: buildServerArgs(composed, [...flags]),
118
+ stderr: stderrMode,
119
+ logPath: controller.config.bridgeStderrLog,
120
+ serverName: entry.id
121
+ }, {});
122
+ return {
123
+ config: {
124
+ serverName: entry.id,
125
+ transport: "stdio",
126
+ command: spawned.command,
127
+ args: spawned.args,
128
+ env: controller.config.env,
129
+ cwd: controller.config.cwd,
130
+ toolCallTimeoutMs: controller.config.toolCallTimeoutMs,
131
+ maxInstructionBytes: controller.config.maxInstructionBytes,
132
+ failOnStartupError: controller.config.failOnStartupError,
133
+ reconnect: controller.config.reconnect
134
+ },
135
+ redirect: spawned.redirect
136
+ };
137
+ }
138
+ /** The `chrome` kind: the local `chrome-devtools-mcp` bridge — what the row used
139
+ * to start for itself, now as one of the manager's connections. */
140
+ export function createChromeKind(controller) {
141
+ const { state } = controller;
142
+ return {
143
+ id: KIND_ID_CHROME,
144
+ label: KIND_CHROME_LABEL,
145
+ summary: KIND_CHROME_SUMMARY,
146
+ builtIn: false,
147
+ transport: "none",
148
+ fields: [
149
+ {
150
+ key: KIND_FIELDS.executable,
151
+ label: "Chrome executable",
152
+ type: "select",
153
+ placeholder: "row default",
154
+ help: "Which Chrome this connection launches. Choices come from the saved executables, the last scan, and what a live connection runs with; leave it empty to follow this row's default.",
155
+ options: () => executableChoices(controller)
156
+ },
157
+ {
158
+ key: KIND_FIELDS.extraFlags,
159
+ label: "Extra flags",
160
+ type: "lines",
161
+ placeholder: "--no-usage-statistics",
162
+ help: "One flag per line, passed to chrome-devtools-mcp. Empty leaves every connection to the row's resolved flags."
163
+ },
164
+ {
165
+ key: KIND_FIELDS.stderrMode,
166
+ label: "Reduce bridge log output",
167
+ type: "boolean",
168
+ // What an entry that never set it shows: the schema's `log`.
169
+ placeholder: "true",
170
+ help: "On keeps the bridge's progress lines off the console in a log file; off prints them."
171
+ }
172
+ ],
173
+ async resolve(entry) {
174
+ const flags = entryExtraFlags(entry, controller);
175
+ const stderrMode = entryStderrMode(entry, controller);
176
+ const executable = flagsSkipCheck(flags) ? "" : entryExecutable(entry, controller);
177
+ const blocked = controller.blockedForPlatform(executable);
178
+ if (blocked !== "")
179
+ return { error: `${executable} cannot be driven from this host — ${blocked}` };
180
+ const built = localConfig(entry, controller, flags, executable, stderrMode);
181
+ const note = built.redirect === "" ? "" : `bridge stderr → ${built.redirect}`;
182
+ controller.noteRunning(entry, { executable, source: entry.extra[KIND_FIELDS.executable] !== undefined ? "selected" : resolveSelection(state.source()).source, flags, stderrMode, redirect: built.redirect, note });
183
+ return {
184
+ config: built.config,
185
+ note
186
+ };
187
+ }
188
+ };
189
+ }
190
+ /** The `chrome-windows` kind: the Windows browser driven through the WSL interop
191
+ * mount. `resolve` runs the prelaunch itself — locate, prereq, free port,
192
+ * launch, wait for the bind — and answers the local `chrome-devtools-mcp` in
193
+ * connect mode against that port. The port speaks no MCP; the MCP stays the
194
+ * local process. Off WSL the entry is refused, with the answer the card shows. */
195
+ export function createChromeWindowsKind(controller) {
196
+ return {
197
+ id: KIND_ID_WINDOWS,
198
+ label: KIND_WINDOWS_LABEL,
199
+ summary: KIND_WINDOWS_SUMMARY,
200
+ builtIn: false,
201
+ transport: "none",
202
+ fields: [
203
+ {
204
+ key: KIND_FIELDS.extraFlags,
205
+ label: "Extra flags",
206
+ type: "lines",
207
+ placeholder: "--no-usage-statistics",
208
+ help: "One flag per line on the local chrome-devtools-mcp that connects to the Windows browser. The debug URL is added by the run."
209
+ },
210
+ {
211
+ key: KIND_FIELDS.stderrMode,
212
+ label: "Reduce bridge log output",
213
+ type: "boolean",
214
+ // What an entry that never set it shows: the schema's `log`.
215
+ placeholder: "true",
216
+ help: "On keeps the local bridge's progress lines off the console in a log file; off prints them."
217
+ }
218
+ ],
219
+ async resolve(entry) {
220
+ if (!controller.wslHost)
221
+ return { error: NOT_WSL_ERROR };
222
+ const run = await controller.prelaunchForConnection();
223
+ if (run.state !== "connected" || run.port <= 0) {
224
+ return { error: `Windows Chrome did not connect (${run.state}): ${firstLine(run.error)}` };
225
+ }
226
+ const url = run.url !== "" ? run.url : windowsChromeUrl(run.port);
227
+ const flags = entryExtraFlags(entry, controller);
228
+ const stderrMode = entryStderrMode(entry, controller);
229
+ // The run's own port is the answer: a connect flag the row or the
230
+ // entry still carries (an older run's port) is **replaced**, never kept
231
+ // next to it, and a local `--user-data-dir` goes — upstream refuses it
232
+ // beside `--browserUrl`.
233
+ const withUrl = withBrowserUrlFlag(flags, url);
234
+ const built = localConfig(entry, controller, withUrl, "", stderrMode);
235
+ controller.noteRunning(entry, { executable: "", source: "selected", flags: withUrl, stderrMode, redirect: built.redirect, note: `Windows Chrome connected at ${url}` });
236
+ return {
237
+ config: built.config,
238
+ note: `Windows Chrome connected at ${url}${built.redirect === "" ? "" : `; bridge stderr → ${built.redirect}`}`
239
+ };
240
+ }
241
+ };
242
+ }
243
+ /** The kinds this host can answer, in registration order — `chrome` first,
244
+ * because it is the answer a standalone config translates into by default
245
+ * (./migration.ts). `chrome-windows` is offered on WSL only: anywhere else its
246
+ * `resolve` could only refuse, so the picker never lists it there (a native
247
+ * Windows host drives its own Chrome through `chrome`). */
248
+ export function createChromeKinds(controller) {
249
+ return controller.wslHost ? [createChromeKind(controller), createChromeWindowsKind(controller)] : [createChromeKind(controller)];
250
+ }
251
+ //# sourceMappingURL=kind.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kind.js","sourceRoot":"","sources":["../../src/host/kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,eAAe,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpM,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAA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AAC,UAAU,CAAC,CAAC,CAAC;AACrI,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { McpConnectionsService } from "@comecaramelos/dsh-mcp-manager/api";
2
+ import type { Controller } from "./controller/index.js";
3
+ import type { PluginContext } from "./types/index.js";
4
+ /** Whether one entry is owned by a kind this component registered. */
5
+ export declare function isOwnedKind(kind: unknown): boolean;
6
+ /**
7
+ * Attach one live component to the manager's `mcpConnections` service: register
8
+ * the kinds this host answers, keep their fields' choices fresh, and offer what
9
+ * a standalone config means now.
10
+ *
11
+ * @param ctx - plugin context (the injection is this component's own effect).
12
+ * @param controller - the live state every answer is read from.
13
+ */
14
+ export declare function attachToManager(ctx: PluginContext, controller: Controller): void;
15
+ /** Every live entry of our own kinds, whatever its line currently says. */
16
+ export declare function ownedEntries(service: McpConnectionsService): import("@comecaramelos/dsh-mcp-manager/api").ServerEntry[];
17
+ /** The entry's own answer for one kind field, or "" when it stated none. */
18
+ export declare function entryField(entry: {
19
+ extra: Record<string, string>;
20
+ }, key: string): string;
21
+ //# sourceMappingURL=manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/host/manager.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,qBAAqB,EAAe,MAAM,oCAAoC,CAAC;AAC7F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,sEAAsE;AACtE,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAElD;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,CAqDhF;AAED,2EAA2E;AAC3E,wBAAgB,YAAY,CAAC,OAAO,EAAE,qBAAqB,8DAE1D;AAED,4EAA4E;AAC5E,wBAAgB,UAAU,CAAC,KAAK,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAGxF"}
@@ -0,0 +1,113 @@
1
+ /**
2
+ * The manager seam — what this component says to `mcpConnections`, and when.
3
+ *
4
+ * The component is a *companion* of the manager bundle: it injects the
5
+ * `mcpConnections` service the manager provides, so this module only runs while
6
+ * the manager runs, and whatever it registers is withdrawn when the injector's
7
+ * effect does (no global state, nothing left behind when the component is off).
8
+ *
9
+ * Three things happen here, in the only order that works:
10
+ *
11
+ * 1. **The kinds come first.** A `chrome` or `chrome-windows` entry cannot be
12
+ * saved, nor `resolve`d, until a kind answers for it — so the kinds register
13
+ * before anything may be proposed, and their fields are what the entry editor
14
+ * renders.
15
+ * 2. **Every publish re-notifies.** The `select` choices are read off this
16
+ * component's live state (the executable catalog, the scan answers, what a
17
+ * live connection runs with), so what a picker shows is only as fresh as the
18
+ * last `notifyKindsChanged`.
19
+ * 3. **The translation is offered last, never earlier.** A standalone row config
20
+ * is proposed only once the kinds exist, because a proposal names a kind and
21
+ * the row is useless without it; a dismissal then remembers itself in this
22
+ * row's config (./migration.ts).
23
+ */
24
+ import { KIND_ID_CHROME, KIND_ID_WINDOWS } from "./constants.js";
25
+ import { createChromeKinds } from "./kind.js";
26
+ import { migrationDismissed, standaloneProposal } from "./migration.js";
27
+ /** Whether one entry is owned by a kind this component registered. */
28
+ export function isOwnedKind(kind) {
29
+ return kind === KIND_ID_CHROME || kind === KIND_ID_WINDOWS;
30
+ }
31
+ /**
32
+ * Attach one live component to the manager's `mcpConnections` service: register
33
+ * the kinds this host answers, keep their fields' choices fresh, and offer what
34
+ * a standalone config means now.
35
+ *
36
+ * @param ctx - plugin context (the injection is this component's own effect).
37
+ * @param controller - the live state every answer is read from.
38
+ */
39
+ export function attachToManager(ctx, controller) {
40
+ ctx.inject(["mcpConnections"], (inner) => {
41
+ const service = inner.mcpConnections;
42
+ if (service === void 0)
43
+ return;
44
+ const state = controller.state;
45
+ state.connections = service;
46
+ // What a picker would answer just moved — every live publish says so.
47
+ state.notifyKindsChanged = () => {
48
+ try {
49
+ service.notifyKindsChanged();
50
+ }
51
+ catch {
52
+ // A manager that has already gone away answers nothing; the next
53
+ // publish says it again.
54
+ }
55
+ };
56
+ for (const kind of createChromeKinds(controller)) {
57
+ ctx.effect(() => {
58
+ const unregister = service.registerKind(kind);
59
+ return () => {
60
+ unregister();
61
+ };
62
+ }, `dsh-chrome-mcp(${controller.config.serverName}): manager kind ${kind.id}`);
63
+ }
64
+ ctx.effect(() => () => {
65
+ state.connections = void 0;
66
+ state.notifyKindsChanged = () => void 0;
67
+ }, "dsh-chrome-mcp(${controller.config.serverName}): manager state");
68
+ // Entries already standing under these kinds were answered "kind nobody
69
+ // registered" by the manager's first reconcile; registering is enough —
70
+ // the manager reconciles again when a kind arrives (or leaves), and that
71
+ // answer was never kept.
72
+ // The standalone translation, offered once per apply: what it offers is
73
+ // fixed by the row config, which does not change underneath. A dismissal
74
+ // withdraws it (the manager drops a dismissed proposal itself); the
75
+ // reason it is not offered again is the row's own `migrationDismissed`.
76
+ ctx.effect(() => {
77
+ const proposal = standingProposal(controller);
78
+ if (proposal === void 0)
79
+ return () => void 0;
80
+ let withdraw;
81
+ try {
82
+ withdraw = service.propose(proposal);
83
+ }
84
+ catch (error) {
85
+ controller.ctx.logger.warn(`dsh-chrome-mcp(${controller.config.serverName}): the standalone configuration could not be offered: ${String(error)}`);
86
+ return () => void 0;
87
+ }
88
+ return () => {
89
+ withdraw?.();
90
+ };
91
+ }, "dsh-chrome-mcp(${controller.config.serverName}): standalone translation");
92
+ });
93
+ }
94
+ /** Every live entry of our own kinds, whatever its line currently says. */
95
+ export function ownedEntries(service) {
96
+ return service.entries().filter((entry) => isOwnedKind(entry.kind));
97
+ }
98
+ /** The entry's own answer for one kind field, or "" when it stated none. */
99
+ export function entryField(entry, key) {
100
+ const value = entry.extra[key];
101
+ return typeof value === "string" ? value : "";
102
+ }
103
+ /** The translation currently worth offering, or `undefined` — when it has been
104
+ * turned down, or when there is nothing to say. The manager filters standing
105
+ * proposals by the kind they would create anyway (an accepted offer disappears
106
+ * without this module noticing), so what is left here to decide is dismissal
107
+ * alone. */
108
+ function standingProposal(controller) {
109
+ if (migrationDismissed(controller))
110
+ return void 0;
111
+ return standaloneProposal(controller);
112
+ }
113
+ //# sourceMappingURL=manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manager.js","sourceRoot":"","sources":["../../src/host/manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAe,cAAc,EAAE,eAAe,EAA6B,MAAM,gBAAgB,CAAC;AACzG,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAKxE,sEAAsE;AACtE,MAAM,UAAU,WAAW,CAAC,IAAa;IACrC,OAAO,IAAI,KAAK,cAAc,IAAI,IAAI,KAAK,eAAe,CAAC;AAC/D,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,GAAkB,EAAE,UAAsB;IACtE,GAAG,CAAC,MAAM,CAAC,CAAC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE;QACrC,MAAM,OAAO,GAAI,KAA+D,CAAC,cAAc,CAAC;QAChG,IAAI,OAAO,KAAK,KAAK,CAAC;YAAE,OAAO;QAC/B,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;QAC/B,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;QAC5B,sEAAsE;QACtE,KAAK,CAAC,kBAAkB,GAAG,GAAG,EAAE;YAC5B,IAAI,CAAC;gBACD,OAAO,CAAC,kBAAkB,EAAE,CAAC;YACjC,CAAC;YAAC,MAAM,CAAC;gBACL,iEAAiE;gBACjE,yBAAyB;YAC7B,CAAC;QACL,CAAC,CAAC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CAAC;YACD,OAAO,GAAG,EAAE;gBACR,QAAQ,EAAE,EAAE,CAAC;YACjB,CAAC,CAAC;QACN,CAAC,EAAE,yEAAyE,CAAC,CAAC;IAClF,CAAC,CAAC,CAAC;AACP,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,YAAY,CAAC,OAA8B;IACvD,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AACxE,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,UAAU,CAAC,KAAwC,EAAE,GAAW;IAC5E,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC/B,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AAClD,CAAC;AAED;;;;YAIY;AACZ,SAAS,gBAAgB,CAAC,UAAsB;IAC5C,IAAI,kBAAkB,CAAC,UAAU,CAAC;QAAE,OAAO,KAAK,CAAC,CAAC;IAClD,OAAO,kBAAkB,CAAC,UAAU,CAAC,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,26 @@
1
+ import type { McpProposal } from "@comecaramelos/dsh-mcp-manager/api";
2
+ import type { Controller } from "./controller/index.js";
3
+ import type { ChromeMcpConfig } from "./types/index.js";
4
+ /** Whether one row config still says what a standalone install steered a bridge
5
+ * with — anything that differs from the shipped defaults. A row that stands
6
+ * entirely on the defaults says nothing to translate: its connection answer is
7
+ * exactly the defaults' answer, and offering it would be noise. */
8
+ export declare function carriesStandaloneConfig(config: ChromeMcpConfig): boolean;
9
+ /** Whether this row has already been offered a translation and turned it down. */
10
+ export declare function migrationDismissed(controller: Controller): boolean;
11
+ /**
12
+ * The connection one standalone row config translates into — or `undefined`,
13
+ * when there is nothing to translate or it has already been refused.
14
+ *
15
+ * The identity carries the namespace across: `id` is what every tool is named
16
+ * under, so reusing the old `serverName` (default `"chrome"`) keeps the tool
17
+ * names exactly what they were. The flags decide the kind: a `--browserUrl`
18
+ * riding the saved flags is the residue of a **Prelaunch Windows Chrome** run —
19
+ * translated to `chrome-windows`, which drives that browser through its port.
20
+ * The machine half (the executable catalog) is deliberately *not* translated:
21
+ * it stays in this row and feeds the pickers.
22
+ *
23
+ * @param controller - the live state the row config is read through.
24
+ */
25
+ export declare function standaloneProposal(controller: Controller): McpProposal | undefined;
26
+ //# sourceMappingURL=migration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../src/host/migration.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD;;;mEAGmE;AACnE,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAexE;AAED,kFAAkF;AAClF,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAElE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,WAAW,GAAG,SAAS,CA8BlF"}
@@ -0,0 +1,127 @@
1
+ /**
2
+ * Migration — translating a **standalone** row config into a connection (D4).
3
+ *
4
+ * Before this component existed, the row *was* the connection: the row config
5
+ * steered a bridge this plugin started itself — the flags it launched with, the
6
+ * executable it picked, where its console output went, and every passthrough
7
+ * that reached the client. That bridge is gone, so an installed row would
8
+ * quietly stop running anything unless it is said what its configuration means
9
+ * now — exactly one `chrome` connection, or one `chrome-windows` connection for
10
+ * what the Prelaunch run already left running.
11
+ *
12
+ * Two rules keep the step honest:
13
+ *
14
+ * - **Nothing lands in `servers` without a click.** The proposal is the offer;
15
+ * writing is the person's. Detection only *proposes*, and the row's config is
16
+ * read, never rewritten.
17
+ * - **A dismissal is this row's own state.** `migrationDismissed` is a field of
18
+ * the row's `Config`, not a hidden marker and not something the connection
19
+ * carries — because what was turned down is *this row's* configuration, and
20
+ * another component's entry has no business remembering it.
21
+ *
22
+ * A row that already carries a `chrome`/`chrome-windows` connection is not
23
+ * offered anything: the manager filters standing proposals by the kind they
24
+ * would create anyway, so an accepted offer disappears without this module
25
+ * noticing.
26
+ */
27
+ import { BROWSER_URL_FLAG_PREFIX, DEFAULT_EXTRA_FLAGS, ENTRY_ID, KIND_FIELDS, KIND_ID_CHROME, KIND_ID_WINDOWS, MIGRATION_DISMISSED_FIELD } from "./constants.js";
28
+ import { joinFlagLines } from "./kind.js";
29
+ import { carriesConnectionMode, sameFlags } from "./flags.js";
30
+ import { readConfigField } from "./values.js";
31
+ /** Whether one row config still says what a standalone install steered a bridge
32
+ * with — anything that differs from the shipped defaults. A row that stands
33
+ * entirely on the defaults says nothing to translate: its connection answer is
34
+ * exactly the defaults' answer, and offering it would be noise. */
35
+ export function carriesStandaloneConfig(config) {
36
+ if (!sameFlags(readConfigField(config.extraFlags, [...DEFAULT_EXTRA_FLAGS]), [...DEFAULT_EXTRA_FLAGS]))
37
+ return true;
38
+ if (readConfigField(config.chromePath, "").trim() !== "")
39
+ return true;
40
+ const stderrMode = readConfigField(config.stderrMode, "");
41
+ if (stderrMode === "log" || stderrMode === "console")
42
+ return true;
43
+ if (config.serverName !== "" && config.serverName !== "chrome")
44
+ return true;
45
+ if (config.command.trim() !== "" && config.command.trim() !== "npx")
46
+ return true;
47
+ if (config.package.trim() !== "" && config.package.trim() !== "chrome-devtools-mcp@latest")
48
+ return true;
49
+ if (Object.keys(config.env).length > 0)
50
+ return true;
51
+ if (config.cwd.trim() !== "")
52
+ return true;
53
+ if (config.toolCallTimeoutMs !== 60000 || config.maxInstructionBytes !== 32768 || config.failOnStartupError)
54
+ return true;
55
+ if (config.bridgeStderr === "console" || config.bridgeStderrLog.trim() !== "")
56
+ return true;
57
+ const reconnect = config.reconnect;
58
+ if (!reconnect.enabled || reconnect.initialDelayMs !== 500 || reconnect.maxDelayMs !== 30000 || reconnect.maxAttempts !== 10)
59
+ return true;
60
+ return false;
61
+ }
62
+ /** Whether this row has already been offered a translation and turned it down. */
63
+ export function migrationDismissed(controller) {
64
+ return readConfigField(controller.config[MIGRATION_DISMISSED_FIELD], false) === true;
65
+ }
66
+ /**
67
+ * The connection one standalone row config translates into — or `undefined`,
68
+ * when there is nothing to translate or it has already been refused.
69
+ *
70
+ * The identity carries the namespace across: `id` is what every tool is named
71
+ * under, so reusing the old `serverName` (default `"chrome"`) keeps the tool
72
+ * names exactly what they were. The flags decide the kind: a `--browserUrl`
73
+ * riding the saved flags is the residue of a **Prelaunch Windows Chrome** run —
74
+ * translated to `chrome-windows`, which drives that browser through its port.
75
+ * The machine half (the executable catalog) is deliberately *not* translated:
76
+ * it stays in this row and feeds the pickers.
77
+ *
78
+ * @param controller - the live state the row config is read through.
79
+ */
80
+ export function standaloneProposal(controller) {
81
+ const config = controller.config;
82
+ if (migrationDismissed(controller))
83
+ return void 0;
84
+ if (!carriesStandaloneConfig(config))
85
+ return void 0;
86
+ const flags = readConfigField(config.extraFlags, [...DEFAULT_EXTRA_FLAGS]);
87
+ const carriesUrl = flags.some((flag) => typeof flag === "string" && carriesConnectionMode(flag) && flag.startsWith(BROWSER_URL_FLAG_PREFIX));
88
+ const kind = carriesUrl && controller.wslHost ? KIND_ID_WINDOWS : KIND_ID_CHROME;
89
+ const id = config.serverName.trim() === "" ? "chrome" : config.serverName.trim();
90
+ const extra = {};
91
+ const executable = readConfigField(config.chromePath, "").trim();
92
+ if (executable !== "" && kind === KIND_ID_CHROME)
93
+ extra[KIND_FIELDS.executable] = executable;
94
+ if (!sameFlags(flags, [...DEFAULT_EXTRA_FLAGS]))
95
+ extra[KIND_FIELDS.extraFlags] = joinFlagLines(flags);
96
+ const stderrMode = readConfigField(config.stderrMode, "");
97
+ if (stderrMode === "log" || stderrMode === "console")
98
+ extra[KIND_FIELDS.stderrMode] = stderrMode;
99
+ const why = describeStandalone(config, kind === KIND_ID_WINDOWS);
100
+ return {
101
+ id: `${ENTRY_ID}-standalone`,
102
+ title: `Turn this row's configuration into a ${kind === KIND_ID_WINDOWS ? "Windows Chrome" : "Chrome MCP"} connection (${why})`,
103
+ entry: {
104
+ id,
105
+ kind,
106
+ enabled: true,
107
+ label: kind === KIND_ID_WINDOWS ? "Windows Chrome" : "Chrome",
108
+ extra
109
+ },
110
+ /** The person said no: remembered here, in this row, and nowhere else.
111
+ * Nothing is removed from the config, because the config is what the row
112
+ * still says. */
113
+ onDismiss: () => controller.dismissMigration()
114
+ };
115
+ }
116
+ /** One line naming what the translation runs against — for the title. */
117
+ function describeStandalone(config, windows) {
118
+ const executable = readConfigField(config.chromePath, "").trim();
119
+ if (windows)
120
+ return "connect mode through the Windows-side browser";
121
+ if (executable !== "")
122
+ return `"${executable}"`;
123
+ if (config.command.trim() !== "" && config.command.trim() !== "npx")
124
+ return config.command.trim();
125
+ return "local Chrome";
126
+ }
127
+ //# sourceMappingURL=migration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration.js","sourceRoot":"","sources":["../../src/host/migration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AACjK,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAK9C;;;mEAGmE;AACnE,MAAM,UAAU,uBAAuB,CAAC,MAAuB;IAC3D,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,MAAM,CAAC,U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,EAAE,CAAC;IACjE,IAAI,OAAO;QAAE,OAAO,+CAA+C,CAAC;IACpE,IAAI,UAAU,KAAK,EAAE;QAAE,OAAO,IAAI,UAAU,GAAG,CAAC;IAChD,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,KAAK;QAAE,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IAClG,OAAO,cAAc,CAAC;AAC1B,CAAC"}
@@ -2,11 +2,20 @@
2
2
  * Host-half plugin identity.
3
3
  *
4
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 nested mcp-client row
6
- * declares the tools, so nothing is injected here.
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.
7
8
  */
8
9
  /** Cordis plugin name used by loader diagnostics. */
9
10
  export declare const name = "chrome-devtools-mcp";
10
- /** No host services of our own: the nested bridge declares `tools`. */
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
+ */
11
20
  export declare const inject: string[];
12
21
  //# sourceMappingURL=plugin-meta.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-meta.d.ts","sourceRoot":"","sources":["../../src/host/plugin-meta.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,qDAAqD;AACrD,eAAO,MAAM,IAAI,wBAAwB,CAAC;AAE1C,uEAAuE;AACvE,eAAO,MAAM,MAAM,EAAE,MAAM,EAAO,CAAC"}
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"}
@@ -2,11 +2,20 @@
2
2
  * Host-half plugin identity.
3
3
  *
4
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 nested mcp-client row
6
- * declares the tools, so nothing is injected here.
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.
7
8
  */
8
9
  /** Cordis plugin name used by loader diagnostics. */
9
10
  export const name = "chrome-devtools-mcp";
10
- /** No host services of our own: the nested bridge declares `tools`. */
11
- export const inject = [];
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"];
12
21
  //# sourceMappingURL=plugin-meta.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-meta.js","sourceRoot":"","sources":["../../src/host/plugin-meta.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,qDAAqD;AACrD,MAAM,CAAC,MAAM,IAAI,GAAG,qBAAqB,CAAC;AAE1C,uEAAuE;AACvE,MAAM,CAAC,MAAM,MAAM,GAAa,EAAE,CAAC"}
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"}