turno-browser 0.2.0 → 0.4.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 (121) hide show
  1. package/CHANGELOG.md +228 -0
  2. package/README.md +205 -16
  3. package/dist/act-model.d.ts +85 -0
  4. package/dist/act-model.js +116 -0
  5. package/dist/act.d.ts +37 -0
  6. package/dist/act.js +599 -0
  7. package/dist/api.d.ts +96 -0
  8. package/dist/api.js +88 -0
  9. package/dist/argv.d.ts +55 -3
  10. package/dist/argv.js +190 -10
  11. package/dist/batch.d.ts +19 -0
  12. package/dist/batch.js +148 -0
  13. package/dist/bench.d.ts +1 -1
  14. package/dist/bench.js +21 -5
  15. package/dist/bin/mcp.js +108 -12
  16. package/dist/captcha.d.ts +77 -0
  17. package/dist/captcha.js +333 -0
  18. package/dist/cdp-relay.d.ts +20 -0
  19. package/dist/cdp-relay.js +101 -0
  20. package/dist/chrome-features.d.ts +23 -0
  21. package/dist/chrome-features.js +44 -0
  22. package/dist/detectors.d.ts +11 -0
  23. package/dist/detectors.js +46 -4
  24. package/dist/diagnose.d.ts +45 -0
  25. package/dist/diagnose.js +326 -0
  26. package/dist/doctor.d.ts +85 -0
  27. package/dist/doctor.js +556 -0
  28. package/dist/engine-attach.d.ts +27 -0
  29. package/dist/engine-attach.js +165 -0
  30. package/dist/engine-camoufox.d.ts +32 -0
  31. package/dist/engine-camoufox.js +270 -0
  32. package/dist/engine-lightpanda.d.ts +72 -0
  33. package/dist/engine-lightpanda.js +292 -0
  34. package/dist/engine.d.ts +119 -0
  35. package/dist/engine.js +355 -0
  36. package/dist/flows.d.ts +127 -0
  37. package/dist/flows.js +294 -0
  38. package/dist/governor.d.ts +119 -0
  39. package/dist/governor.js +325 -0
  40. package/dist/health.d.ts +60 -0
  41. package/dist/health.js +86 -0
  42. package/dist/host.d.ts +95 -0
  43. package/dist/host.js +1181 -0
  44. package/dist/human-input.d.ts +84 -0
  45. package/dist/human-input.js +443 -0
  46. package/dist/humanize.d.ts +123 -0
  47. package/dist/humanize.js +241 -0
  48. package/dist/identities.d.ts +23 -10
  49. package/dist/identities.js +45 -37
  50. package/dist/idle-timer.d.ts +12 -0
  51. package/dist/idle-timer.js +25 -0
  52. package/dist/ids.d.ts +9 -0
  53. package/dist/ids.js +34 -0
  54. package/dist/index.d.ts +21 -6
  55. package/dist/index.js +19 -18
  56. package/dist/lifecycle.d.ts +99 -0
  57. package/dist/lifecycle.js +172 -0
  58. package/dist/live-client.d.ts +22 -0
  59. package/dist/live-client.js +93 -0
  60. package/dist/live-page.d.ts +11 -0
  61. package/dist/live-page.js +143 -0
  62. package/dist/live-server.d.ts +173 -0
  63. package/dist/live-server.js +640 -0
  64. package/dist/live.d.ts +120 -0
  65. package/dist/live.js +203 -0
  66. package/dist/login-tool.d.ts +45 -0
  67. package/dist/login-tool.js +233 -0
  68. package/dist/login.d.ts +8 -3
  69. package/dist/login.js +65 -26
  70. package/dist/network-chrome.d.ts +74 -0
  71. package/dist/network-chrome.js +178 -0
  72. package/dist/network.d.ts +125 -0
  73. package/dist/network.js +263 -0
  74. package/dist/opt-in-settings.d.ts +69 -0
  75. package/dist/opt-in-settings.js +151 -0
  76. package/dist/patchright.d.ts +4 -2
  77. package/dist/patchright.js +4 -2
  78. package/dist/recorder.d.ts +88 -0
  79. package/dist/recorder.js +538 -0
  80. package/dist/recordings.d.ts +116 -0
  81. package/dist/recordings.js +474 -0
  82. package/dist/redact.d.ts +34 -0
  83. package/dist/redact.js +135 -0
  84. package/dist/replay.d.ts +20 -0
  85. package/dist/replay.js +382 -0
  86. package/dist/reputation.d.ts +89 -0
  87. package/dist/reputation.js +203 -0
  88. package/dist/resources.d.ts +76 -0
  89. package/dist/resources.js +341 -0
  90. package/dist/runtime-lock.d.ts +59 -0
  91. package/dist/runtime-lock.js +131 -0
  92. package/dist/sealed.d.ts +8 -0
  93. package/dist/sealed.js +96 -0
  94. package/dist/session-export.d.ts +67 -0
  95. package/dist/session-export.js +194 -0
  96. package/dist/session.d.ts +20 -0
  97. package/dist/session.js +30 -0
  98. package/dist/settings.d.ts +246 -0
  99. package/dist/settings.js +530 -0
  100. package/dist/sharing.d.ts +96 -0
  101. package/dist/sharing.js +269 -0
  102. package/dist/snippet.d.ts +8 -0
  103. package/dist/snippet.js +22 -0
  104. package/dist/tab-locks.d.ts +63 -0
  105. package/dist/tab-locks.js +179 -0
  106. package/dist/tools.d.ts +111 -0
  107. package/dist/tools.js +59 -0
  108. package/dist/totp.d.ts +32 -0
  109. package/dist/totp.js +82 -0
  110. package/dist/tuning.d.ts +76 -0
  111. package/dist/tuning.js +69 -0
  112. package/dist/units.d.ts +8 -0
  113. package/dist/units.js +20 -0
  114. package/dist/upstream.d.ts +243 -0
  115. package/dist/upstream.js +46 -0
  116. package/dist/vault.d.ts +91 -0
  117. package/dist/vault.js +273 -0
  118. package/npm-shrinkwrap.json +1074 -3
  119. package/package.json +5 -4
  120. package/dist/paths.d.ts +0 -17
  121. package/dist/paths.js +0 -17
@@ -0,0 +1,326 @@
1
+ /**
2
+ * Click and type errors that say what is in the way. When an action on an element
3
+ * fails because the element cannot take it, Playwright retries until the action timeout and
4
+ * then reports "Timeout 5000ms exceeded" with a call log, which leaves the agent guessing. The
5
+ * host looks at the target once, after the failure, and replaces the error with one that names
6
+ * the element in the way, or the state of the target, and the next step.
7
+ *
8
+ * One case is checked before the call too (`coveredBeforeCall`): a target in view that another
9
+ * element covers, such as a cookie banner over the page. When the same element still covers it
10
+ * a moment later, the call does not run and the agent hears which element is in the way at
11
+ * once, instead of after the 5 second action timeout. That check costs one look at the target
12
+ * per call and never scrolls the page.
13
+ */
14
+ /** The stock tools whose failures are diagnosed, with the verb for the message. */
15
+ const DIAGNOSED_TOOLS = Object.freeze({
16
+ browser_click: "click",
17
+ browser_hover: "hover over",
18
+ browser_type: "type into",
19
+ browser_select_option: "select an option in",
20
+ browser_drag: "drag",
21
+ });
22
+ /** True for the failures a look at the element can explain: actionability timeouts. */
23
+ export function isActionabilityFailure(text) {
24
+ if (/Ref \S+ not found in the current page snapshot/.test(text))
25
+ return false;
26
+ return /Timeout \d+ms exceeded|intercepts pointer events|element is not (visible|enabled|editable|stable)|outside of the viewport/.test(text);
27
+ }
28
+ /**
29
+ * Runs in the page, on the target element: what keeps an action from it. Self-contained, as
30
+ * Playwright serializes it.
31
+ */
32
+ function inspect(el, scroll = true) {
33
+ const clean = (s, max = 60) => {
34
+ const t = (s ?? "").replace(/\s+/g, " ").trim();
35
+ return t.length > max ? `${t.slice(0, max - 3)}...` : t;
36
+ };
37
+ const roleOf = (e) => {
38
+ const explicit = e.getAttribute("role");
39
+ if (explicit)
40
+ return explicit.split(" ")[0];
41
+ const tag = e.tagName.toLowerCase();
42
+ if (tag === "a")
43
+ return e.hasAttribute("href") ? "link" : "generic";
44
+ if (tag === "button" || tag === "summary")
45
+ return "button";
46
+ if (tag === "select")
47
+ return "combobox";
48
+ if (tag === "textarea")
49
+ return "textbox";
50
+ if (tag === "img")
51
+ return "img";
52
+ if (tag === "dialog")
53
+ return "dialog";
54
+ if (/^h[1-6]$/.test(tag))
55
+ return "heading";
56
+ if (tag === "input") {
57
+ const type = (e.getAttribute("type") ?? "text").toLowerCase();
58
+ if (["button", "submit", "reset", "image"].includes(type))
59
+ return "button";
60
+ if (type === "checkbox" || type === "radio")
61
+ return type;
62
+ return "textbox";
63
+ }
64
+ const landmarks = {
65
+ nav: "navigation",
66
+ header: "banner",
67
+ footer: "contentinfo",
68
+ main: "main",
69
+ aside: "complementary",
70
+ form: "form",
71
+ };
72
+ return landmarks[tag] ?? "generic";
73
+ };
74
+ const nameOf = (e) => {
75
+ const label = e.getAttribute("aria-label");
76
+ if (label)
77
+ return clean(label);
78
+ const by = e.getAttribute("aria-labelledby");
79
+ if (by) {
80
+ const text = by
81
+ .split(/\s+/)
82
+ .map((id) => document.getElementById(id)?.textContent ?? "")
83
+ .join(" ");
84
+ if (clean(text))
85
+ return clean(text);
86
+ }
87
+ if (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement) {
88
+ const labelText = e.labels?.[0]?.textContent;
89
+ if (clean(labelText))
90
+ return clean(labelText);
91
+ if (e instanceof HTMLInputElement && ["button", "submit", "reset"].includes(e.type) && e.value)
92
+ return clean(e.value);
93
+ const placeholder = e.getAttribute("placeholder");
94
+ if (placeholder)
95
+ return clean(placeholder);
96
+ }
97
+ const alt = e.getAttribute("alt") ?? e.getAttribute("title");
98
+ if (alt)
99
+ return clean(alt);
100
+ return clean(e.textContent);
101
+ };
102
+ const selectorOf = (e) => {
103
+ const tag = e.tagName.toLowerCase();
104
+ if (e.id && /^[A-Za-z][\w-]*$/.test(e.id) && document.querySelectorAll(`#${e.id}`).length === 1)
105
+ return `${tag}#${e.id}`;
106
+ for (const attr of ["data-testid", "data-test", "data-qa", "name"]) {
107
+ const v = e.getAttribute(attr);
108
+ if (v && v.length <= 40 && !/["\\\]]/.test(v))
109
+ return `${tag}[${attr}="${v}"]`;
110
+ }
111
+ const classes = [...e.classList].filter((c) => /^[A-Za-z_-][\w-]*$/.test(c) && c.length <= 30).slice(0, 2);
112
+ return classes.length ? `${tag}.${classes.join(".")}` : tag;
113
+ };
114
+ const describe = (e) => ({ role: roleOf(e), name: nameOf(e), selector: selectorOf(e) });
115
+ const target = describe(el);
116
+ const disabled = el.disabled === true ||
117
+ el.getAttribute("aria-disabled") === "true" ||
118
+ !!el.closest("fieldset[disabled]");
119
+ if (disabled)
120
+ return { state: "disabled", target };
121
+ const box = el.getBoundingClientRect();
122
+ const style = getComputedStyle(el);
123
+ const visible = box.width > 0 &&
124
+ box.height > 0 &&
125
+ style.visibility !== "hidden" &&
126
+ (el.checkVisibility ? el.checkVisibility({ opacityProperty: false }) : true);
127
+ if (!visible) {
128
+ // The ancestor that hides it, when it is not the element itself.
129
+ for (let a = el.parentElement; a && a !== document.body; a = a.parentElement) {
130
+ const s = getComputedStyle(a);
131
+ if (s.display === "none" || s.visibility === "hidden" || s.contentVisibility === "hidden")
132
+ return { state: "hidden", target, because: describe(a) };
133
+ }
134
+ return { state: "hidden", target };
135
+ }
136
+ if ((el instanceof HTMLInputElement || el instanceof HTMLTextAreaElement) && el.readOnly)
137
+ return { state: "readonly", target };
138
+ if (scroll)
139
+ el.scrollIntoView({ block: "center", inline: "center", behavior: "instant" });
140
+ const r = el.getBoundingClientRect();
141
+ const x = r.left + r.width / 2;
142
+ const y = r.top + r.height / 2;
143
+ // Without scrolling, a center outside the viewport cannot be hit-tested: nothing to say yet.
144
+ if (!scroll && (x < 0 || y < 0 || x >= window.innerWidth || y >= window.innerHeight))
145
+ return { state: "ok", target };
146
+ let hit = document.elementFromPoint(x, y);
147
+ while (hit?.shadowRoot) {
148
+ const inner = hit.shadowRoot.elementFromPoint(x, y);
149
+ if (!inner || inner === hit)
150
+ break;
151
+ hit = inner;
152
+ }
153
+ const inside = (e) => {
154
+ for (let n = e; n; n = n instanceof ShadowRoot ? n.host : n.parentNode)
155
+ if (n === el)
156
+ return true;
157
+ return false;
158
+ };
159
+ if (!hit || inside(hit))
160
+ return { state: "ok", target };
161
+ // The covering element: the outermost ancestor of what was hit that does not hold the target
162
+ // (the cookie banner, not the paragraph inside it).
163
+ let cover = hit;
164
+ while (cover.parentElement &&
165
+ cover.parentElement !== document.body &&
166
+ cover.parentElement !== document.documentElement &&
167
+ !cover.parentElement.contains(el)) {
168
+ cover = cover.parentElement;
169
+ }
170
+ const buttons = [
171
+ ...cover.querySelectorAll('button, [role="button"], a[href], input[type="button"], input[type="submit"]'),
172
+ ]
173
+ .filter((b) => b.offsetParent !== null || getComputedStyle(b).position === "fixed")
174
+ .map(nameOf)
175
+ .filter((n) => n)
176
+ .slice(0, 3);
177
+ return { state: "covered", target, cover: describe(cover), buttons };
178
+ }
179
+ /** The target of a stock call as a locator: a snapshot ref (`e5`, `f1e5`) or a selector. */
180
+ function locatorOf(page, target) {
181
+ return /^(f\d+)?e\d+$/.test(target) ? page.getByRef(target) : page.locator(target);
182
+ }
183
+ /** Looks at the target of a failed call. Undefined when it cannot be found (it is gone). */
184
+ async function diagnoseTarget(page, target) {
185
+ try {
186
+ return await locatorOf(page, target).first().evaluate(inspect, undefined, { timeout: 1_000 });
187
+ }
188
+ catch {
189
+ return undefined;
190
+ }
191
+ }
192
+ function named(e) {
193
+ return `${e.role}${e.name ? ` "${e.name}"` : ""} (${e.selector})`;
194
+ }
195
+ /** The agent-facing message for a diagnosed failure. */
196
+ export function failureMessage(tool, target, d, original) {
197
+ const verb = DIAGNOSED_TOOLS[tool] ?? "act on";
198
+ const first = original.split("\n").find((l) => l.trim()) ?? original;
199
+ const detail = original.startsWith("the call did not run") ? `turno: ${first.trim()}` : `Playwright: ${first.trim()}`;
200
+ if (!d) {
201
+ return [
202
+ `Could not ${verb} ${target}: the element is no longer on the page.`,
203
+ `Next: take a new snapshot (browser_snapshot) and use the ref it shows now.`,
204
+ detail,
205
+ ].join("\n");
206
+ }
207
+ const what = `${named(d.target)}, ${target}`;
208
+ switch (d.state) {
209
+ case "covered":
210
+ return [
211
+ `Could not ${verb} ${what}: ${named(d.cover)} covers it and would get the click instead.`,
212
+ d.buttons.length
213
+ ? `Next: close or answer that element first (it has ${d.buttons.map((b) => `"${b}"`).join(", ")}), then try again; take a new snapshot if the page changed.`
214
+ : "Next: close or scroll past that element first, then try again; take a new snapshot if the page changed.",
215
+ detail,
216
+ ].join("\n");
217
+ case "hidden":
218
+ return [
219
+ `Could not ${verb} ${what}: it is not visible${d.because ? ` (${named(d.because)} hides it)` : ""}.`,
220
+ "Next: open the menu, tab or section that holds it (or wait for it with browser_wait_for), then take a new snapshot and try again.",
221
+ detail,
222
+ ].join("\n");
223
+ case "disabled":
224
+ return [
225
+ `Could not ${verb} ${what}: it is disabled.`,
226
+ "Next: do what enables it first (fill in the required fields, accept the terms), or wait for it with browser_wait_for, then try again.",
227
+ detail,
228
+ ].join("\n");
229
+ case "readonly":
230
+ return [
231
+ `Could not ${verb} ${what}: it is read-only.`,
232
+ "Next: look for the control that sets this value (a picker, a select, an edit button).",
233
+ detail,
234
+ ].join("\n");
235
+ case "ok":
236
+ return [
237
+ `Could not ${verb} ${what} in time, although it is visible, enabled and not covered now: it was probably moving or covered for a moment.`,
238
+ "Next: try again once; if it fails again, take a new snapshot.",
239
+ detail,
240
+ ].join("\n");
241
+ }
242
+ }
243
+ /** How long a cover must stay before the call is refused: an overlay fading out is let through. */
244
+ const COVER_STABLE_MS = 300;
245
+ /** The error result of a stock call, in the shape the call asked for. */
246
+ function errorOf(message, json) {
247
+ return {
248
+ isError: true,
249
+ content: [
250
+ {
251
+ type: "text",
252
+ text: json ? JSON.stringify({ isError: true, error: message }, null, 2) : `### Error\n${message}`,
253
+ },
254
+ ],
255
+ };
256
+ }
257
+ /**
258
+ * Before a diagnosed call: when its target is in view and another element covers it, now and
259
+ * `COVER_STABLE_MS` later, the error that names that element; undefined (run the call) otherwise.
260
+ * Anything this check cannot tell (a target not found yet, out of view, in a frame) is left to
261
+ * Playwright and the diagnosis after it.
262
+ */
263
+ export async function coveredBeforeCall(page, tool, args, json, wait = (ms) => new Promise((r) => setTimeout(r, ms))) {
264
+ if (!page || !(tool in DIAGNOSED_TOOLS))
265
+ return undefined;
266
+ const target = String(args.target ?? args.startTarget ?? "");
267
+ if (!target)
268
+ return undefined;
269
+ const look = async () => {
270
+ try {
271
+ const locator = locatorOf(page, target);
272
+ if ((await locator.count()) !== 1)
273
+ return undefined;
274
+ return await locator.evaluate(inspect, false, { timeout: 500 });
275
+ }
276
+ catch {
277
+ return undefined;
278
+ }
279
+ };
280
+ const first = await look();
281
+ if (first?.state !== "covered")
282
+ return undefined;
283
+ await wait(COVER_STABLE_MS);
284
+ const again = await look();
285
+ if (again?.state !== "covered" || again.cover.selector !== first.cover.selector)
286
+ return undefined;
287
+ return errorOf(failureMessage(tool, target, again, "the call did not run: the target is covered"), json);
288
+ }
289
+ /**
290
+ * Rewrites the error of a failed stock call when it is an actionability failure of a diagnosed
291
+ * tool; returns the result as it was otherwise.
292
+ */
293
+ export async function explainFailure(page, tool, args, result, json) {
294
+ if (!result.isError || !page || !(tool in DIAGNOSED_TOOLS))
295
+ return result;
296
+ const first = result.content[0];
297
+ if (!first || first.type !== "text")
298
+ return result;
299
+ const text = first.text;
300
+ let original = text.replace(/^### Error\n/, "");
301
+ if (json) {
302
+ try {
303
+ original = String(JSON.parse(text).error ?? text);
304
+ }
305
+ catch {
306
+ /* keep the raw text */
307
+ }
308
+ }
309
+ if (!isActionabilityFailure(original))
310
+ return result;
311
+ const target = String(args.target ?? args.startTarget ?? "");
312
+ if (!target)
313
+ return result;
314
+ const message = failureMessage(tool, target, await diagnoseTarget(page, target), original);
315
+ return {
316
+ ...result,
317
+ content: [
318
+ {
319
+ type: "text",
320
+ text: json ? JSON.stringify({ isError: true, error: message }, null, 2) : `### Error\n${message}`,
321
+ },
322
+ ...result.content.slice(1),
323
+ ],
324
+ };
325
+ }
326
+ //# sourceMappingURL=diagnose.js.map
@@ -0,0 +1,85 @@
1
+ import { type ProcTable } from "turno-core/process";
2
+ import { type SecretStore } from "turno-core/secrets";
3
+ import { type LightpandaInfo } from "./engine-lightpanda.js";
4
+ import { type CamoufoxInfo, type PlaywrightCoreInfo } from "./engine-camoufox.js";
5
+ /**
6
+ * `turno browser doctor`: what a browser identity needs to work, one check per row,
7
+ * each problem with the command that fixes it, like `turno doctor`.
8
+ *
9
+ * - Chrome: found, its version, and a smoke launch on a throwaway profile (headless).
10
+ * - System: a headed Chrome needs the desktop session (macOS) or a display (Linux).
11
+ * - Engines: Lightpanda for read mode and Camoufox with the stock Playwright it runs on (both
12
+ * optional; a failure only when an identity uses them), and a Lightpanda an earlier server
13
+ * left running.
14
+ * - Per identity: identity.json, who holds it (runtime lock and Chrome's profile lock), session
15
+ * health, challenges in the last 7 days, and the opt-in network settings (`proxy`: whether
16
+ * the secret store has its credentials, never their value; `userAgent`).
17
+ *
18
+ * `--fix` removes runtime locks whose process is gone and stops a Chrome an earlier run left
19
+ * behind on an identity's profile (the same sweep a server start does), and stops a Lightpanda
20
+ * an earlier server left running.
21
+ */
22
+ export interface DoctorCheck {
23
+ /** "chrome", "system", "engines", "identities" or "identity <id>". */
24
+ area: string;
25
+ level: "ok" | "warn" | "fail" | "info";
26
+ text: string;
27
+ /** The command that fixes it, which a person runs (or `--fix` runs, with `auto`). */
28
+ fix?: string;
29
+ /** True when `turno browser doctor --fix` runs `fix`. */
30
+ auto?: boolean;
31
+ /** The manual step, when no single command fixes it. */
32
+ manual?: string;
33
+ }
34
+ export interface ChromeInfo {
35
+ path: string;
36
+ version?: string;
37
+ }
38
+ export interface DoctorOptions {
39
+ env?: NodeJS.ProcessEnv;
40
+ platform?: NodeJS.Platform;
41
+ /** Run the smoke launch (default true). */
42
+ launch?: boolean;
43
+ /** Repair what is safe to repair, then check again. */
44
+ fix?: boolean;
45
+ /** Finds Chrome (tests inject one). */
46
+ chrome?: (env: NodeJS.ProcessEnv, platform: NodeJS.Platform) => ChromeInfo | undefined;
47
+ /** Starts and closes Chrome on a temporary profile; resolves with the milliseconds it took. */
48
+ smoke?: (env: NodeJS.ProcessEnv) => Promise<number>;
49
+ /** Finds Lightpanda (tests inject one). */
50
+ lightpanda?: (env: NodeJS.ProcessEnv) => LightpandaInfo | undefined;
51
+ /** Finds Camoufox and the stock Playwright it runs on (tests inject them). */
52
+ camoufox?: (env: NodeJS.ProcessEnv) => CamoufoxInfo | undefined;
53
+ playwrightCore?: (env: NodeJS.ProcessEnv) => (PlaywrightCoreInfo & {
54
+ ok: boolean;
55
+ }) | undefined;
56
+ /** The secret store proxy credentials come from (tests inject a fake); default: this machine's. */
57
+ secrets?: SecretStore;
58
+ /** The process table, for a Lightpanda left running (tests inject one). */
59
+ procTable?: () => ProcTable | undefined;
60
+ /** The mcp.toml servers that run turno-browser-mcp for an identity (turno-cli reads mcp.toml). */
61
+ servers?: readonly ServedIdentity[];
62
+ now?: Date;
63
+ }
64
+ /** One mcp.toml server of an identity, as mcpd runs it. */
65
+ export interface ServedIdentity {
66
+ /** The server's name in mcp.toml (`browser-work`). */
67
+ name: string;
68
+ identity: string;
69
+ /** mcp.toml `exclusive`: one client session at a time. */
70
+ exclusive: boolean;
71
+ /** mcp.toml `scope`: with "session" every client session gets its own server. */
72
+ scope: string;
73
+ /** A `--sharing` flag in the server's args, which wins over identity.json. */
74
+ sharing?: string;
75
+ }
76
+ export interface DoctorReport {
77
+ checks: DoctorCheck[];
78
+ /** What `--fix` did. */
79
+ fixed: string[];
80
+ }
81
+ /** CFBundleShortVersionString of a macOS Info.plist (XML). */
82
+ export declare function chromeVersionFromPlist(xml: string): string | undefined;
83
+ /** The installed Google Chrome (the `chrome` channel Playwright launches) and its version. */
84
+ export declare function findChrome(env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform): ChromeInfo | undefined;
85
+ export declare function runDoctor(opts?: DoctorOptions): Promise<DoctorReport>;