@jackwener/browsermcp 0.0.39-embedded.0 → 0.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -48
- package/README.md +6 -93
- package/dist/docs/api-reference.md +10 -3
- package/dist/docs/api-use.md +15 -3
- package/dist/docs/instructions.md +1 -1
- package/dist/src/api/browser.js +2 -0
- package/dist/src/api/browser.js.map +1 -1
- package/dist/src/api/content-wait.js +48 -0
- package/dist/src/api/content-wait.js.map +1 -0
- package/dist/src/api/tab.js +14 -2
- package/dist/src/api/tab.js.map +1 -1
- package/dist/src/backends/extension-page.js +2 -2
- package/dist/src/backends/extension-page.js.map +1 -1
- package/dist/src/docs/manifest.js +3 -6
- package/dist/src/docs/manifest.js.map +1 -1
- package/dist/src/protocol.js.map +1 -1
- package/dist/src/shared/aria-tree.js +7 -1
- package/dist/src/shared/aria-tree.js.map +1 -1
- package/dist/src/shared/closed-shadow.js +50 -0
- package/dist/src/shared/closed-shadow.js.map +1 -0
- package/dist/src/shared/engine.js +97 -30
- package/dist/src/shared/engine.js.map +1 -1
- package/dist/src/shared/inflight.js +50 -0
- package/dist/src/shared/inflight.js.map +1 -0
- package/dist/src/shared/injected-source.js +2 -2
- package/dist/src/shared/injected-source.js.map +1 -1
- package/docs/api-reference.md +10 -3
- package/docs/api-use.md +15 -3
- package/docs/instructions.md +1 -1
- package/extension/dist/background.js +195 -47
- package/extension/dist/manifest.json +1 -1
- package/extension/dist/page.js +231 -35
- package/package.json +3 -12
- package/dist/src/api/action-input.d.ts +0 -87
- package/dist/src/api/agent.d.ts +0 -10
- package/dist/src/api/api.d.ts +0 -54
- package/dist/src/api/browser.d.ts +0 -93
- package/dist/src/api/commands.d.ts +0 -506
- package/dist/src/api/context.d.ts +0 -7
- package/dist/src/api/diff.d.ts +0 -8
- package/dist/src/api/errors.d.ts +0 -14
- package/dist/src/api/network.d.ts +0 -10
- package/dist/src/api/observation.d.ts +0 -4
- package/dist/src/api/streams.d.ts +0 -13
- package/dist/src/api/tab.d.ts +0 -319
- package/dist/src/api/webmcp.d.ts +0 -19
- package/dist/src/backends/backend.d.ts +0 -14
- package/dist/src/backends/browser-helpers.d.ts +0 -17
- package/dist/src/backends/extension-page.d.ts +0 -5
- package/dist/src/backends/managed-page.d.ts +0 -50
- package/dist/src/backends/page-transport.d.ts +0 -10
- package/dist/src/backends/page-types.d.ts +0 -82
- package/dist/src/docs/embedded.d.ts +0 -2
- package/dist/src/docs/embedded.js +0 -40
- package/dist/src/docs/embedded.js.map +0 -1
- package/dist/src/docs/manifest.d.ts +0 -23
- package/dist/src/docs/surface.d.ts +0 -12
- package/dist/src/electron/backend.d.ts +0 -50
- package/dist/src/electron/backend.js +0 -375
- package/dist/src/electron/backend.js.map +0 -1
- package/dist/src/electron/chrome.d.ts +0 -24
- package/dist/src/electron/chrome.js +0 -133
- package/dist/src/electron/chrome.js.map +0 -1
- package/dist/src/electron/driver.d.ts +0 -66
- package/dist/src/electron/driver.js +0 -294
- package/dist/src/electron/driver.js.map +0 -1
- package/dist/src/electron/event-buffer.d.ts +0 -16
- package/dist/src/electron/event-buffer.js +0 -59
- package/dist/src/electron/event-buffer.js.map +0 -1
- package/dist/src/electron/page.js +0 -834
- package/dist/src/electron/registry.d.ts +0 -104
- package/dist/src/electron/registry.js +0 -316
- package/dist/src/electron/registry.js.map +0 -1
- package/dist/src/electron/streams.d.ts +0 -16
- package/dist/src/electron/streams.js +0 -48
- package/dist/src/electron/streams.js.map +0 -1
- package/dist/src/embedded/index.d.ts +0 -39
- package/dist/src/embedded/index.js +0 -72
- package/dist/src/embedded/index.js.map +0 -1
- package/dist/src/host/bridge.d.ts +0 -50
- package/dist/src/host/doctor.d.ts +0 -34
- package/dist/src/host/extension.d.ts +0 -3
- package/dist/src/host/host.d.ts +0 -3
- package/dist/src/host/ipc.d.ts +0 -14
- package/dist/src/host/jsonc-config.d.ts +0 -1
- package/dist/src/host/launch.d.ts +0 -11
- package/dist/src/host/native-messaging.d.ts +0 -28
- package/dist/src/host/opencode.d.ts +0 -6
- package/dist/src/host/pi.d.ts +0 -6
- package/dist/src/host/registration.d.ts +0 -24
- package/dist/src/host/setup.d.ts +0 -7
- package/dist/src/host/socket.d.ts +0 -25
- package/dist/src/host/state.d.ts +0 -39
- package/dist/src/launcher/stdio.d.ts +0 -3
- package/dist/src/lib/paths.d.ts +0 -1
- package/dist/src/lib/sources.d.ts +0 -5
- package/dist/src/main.d.ts +0 -2
- package/dist/src/mcp/catalog.d.ts +0 -202
- package/dist/src/mcp/js-session.d.ts +0 -64
- package/dist/src/mcp/server.d.ts +0 -15
- package/dist/src/protocol.d.ts +0 -320
- package/dist/src/recon/analyzer.d.ts +0 -43
- package/dist/src/recon/discover.d.ts +0 -48
- package/dist/src/runtime/runtime.d.ts +0 -148
- package/dist/src/shared/api-contract.d.ts +0 -86
- package/dist/src/shared/aria-tree.d.ts +0 -2
- package/dist/src/shared/element-ref.d.ts +0 -4
- package/dist/src/shared/engine.d.ts +0 -50
- package/dist/src/shared/injected-source.d.ts +0 -2
- package/dist/src/shared/page-contract.d.ts +0 -256
- package/dist/src/sites/define.d.ts +0 -28
- package/dist/src/sites/drafts.d.ts +0 -39
- package/dist/src/sites/executor.d.ts +0 -34
- package/dist/src/sites/loader.d.ts +0 -101
- package/dist/src/sites/manifest.d.ts +0 -5
- package/dist/src/sites/schema.d.ts +0 -11
- package/dist/src/version.d.ts +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest_version": 3,
|
|
3
3
|
"name": "BrowserMCP Connector",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.28",
|
|
5
5
|
"description": "Connect your logged-in Chrome to BrowserMCP agents through a local native host.",
|
|
6
6
|
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1DKzfAqudbl9AylDyPDJtv4/Uf0DsfYtNmkB42Drff0IJVZ0pRGznikRyz3gNpSSairFyg50pWtuh0EKM/QsU1VrTlHycY529ho8+xMLFO64w3OolId18F73YQ4wRFEo3ESTYLLKVPRrK23dewElkVqtl0u3a63tm6YFkxUxzlS3l6xLMFoSId135BNdVLqHUZe9s/SGE0nD44sDMoNmkJk3qw+oUg65LH+69uc80PtSsXz9uiU6Ma77t2UG42Szvm5HfEDlWfX0NMM042emU8gZ3Id77DKe4195LZs/uEolqwyL12WsUkXcXyhCF7iQ09H/Ye8I6D6SqiEklX1S8QIDAQAB",
|
|
7
7
|
"permissions": [
|
package/extension/dist/page.js
CHANGED
|
@@ -94,8 +94,8 @@
|
|
|
94
94
|
const el = refToEl.get(ref)?.deref();
|
|
95
95
|
return el?.isConnected && el.ownerDocument === document ? el : void 0;
|
|
96
96
|
}
|
|
97
|
-
function pageError(code, message, hint) {
|
|
98
|
-
return Object.assign(new Error(message), { code, hint });
|
|
97
|
+
function pageError(code, message, hint, data) {
|
|
98
|
+
return Object.assign(new Error(message), { code, hint, ...data && { data } });
|
|
99
99
|
}
|
|
100
100
|
function requireRef(ref) {
|
|
101
101
|
const el = liveElement(ref);
|
|
@@ -121,7 +121,29 @@
|
|
|
121
121
|
function ariaRefOf(el) {
|
|
122
122
|
return stableRefOf(el);
|
|
123
123
|
}
|
|
124
|
-
var
|
|
124
|
+
var REGION_ROLES = /* @__PURE__ */ new Set(["form", "dialog", "alertdialog", "region", "navigation", "main", "complementary", "banner", "contentinfo", "search", "group", "listitem", "row", "article", "tabpanel", "menu", "list", "table"]);
|
|
125
|
+
function regionOf(el) {
|
|
126
|
+
for (let n = el; ; ) {
|
|
127
|
+
const parent = n.parentElement;
|
|
128
|
+
if (!parent) {
|
|
129
|
+
const root = n.getRootNode();
|
|
130
|
+
if (!(root instanceof ShadowRoot)) return "page";
|
|
131
|
+
const host = root.host;
|
|
132
|
+
const label = host.getAttribute("aria-label");
|
|
133
|
+
return `shadow root of <${host.localName}${host.id ? `#${host.id}` : ""}>${label ? ` "${label.slice(0, 60)}"` : ""}`;
|
|
134
|
+
}
|
|
135
|
+
n = parent;
|
|
136
|
+
const role = roleOf(n);
|
|
137
|
+
const name = REGION_ROLES.has(role) ? nameOf(n).replace(/\s+/g, " ").trim().slice(0, 60) : "";
|
|
138
|
+
if (name || ["form", "dialog", "alertdialog", "navigation", "main", "search"].includes(role)) return `${role}${name ? ` "${name}"` : ""}`;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
var candidate = (el) => ({ ref: ariaRefOf(el), role: roleOf(el), name: nameOf(el).replace(/\s+/g, " ").trim().slice(0, 80), within: regionOf(el), tag: el.tagName.toLowerCase(), text: text(el).slice(0, 80), visible: is(el, "visible"), box: box(el) });
|
|
142
|
+
function ambiguity(n, selector, visibleN, matches) {
|
|
143
|
+
const candidates = matches.slice(0, 8).map(candidate);
|
|
144
|
+
const list = candidates.map((c) => `[ref=${c.ref}] ${c.role || c.tag}${c.name ? ` "${c.name}"` : ""} in ${c.within}${c.visible ? "" : " (hidden)"}`).join("; ");
|
|
145
|
+
return { code: "selector_ambiguous", message: `${n} elements match ${selector}${visibleN ? ` (${visibleN} visible)` : ""}: ${list}${n > 8 ? `; \u2026${n - 8} more` : ""}`, hint: "Act on one of these refs, or scope the locator with within (a container ref or selector).", candidates };
|
|
146
|
+
}
|
|
125
147
|
var actionElement = null;
|
|
126
148
|
function actionTarget() {
|
|
127
149
|
const el = actionElement;
|
|
@@ -148,7 +170,7 @@
|
|
|
148
170
|
if (matches.length > 1 && strict) {
|
|
149
171
|
const visible = matches.filter((m) => is(m, "visible"));
|
|
150
172
|
if (visible.length === 1) el = visible[0];
|
|
151
|
-
else return { error:
|
|
173
|
+
else return { error: ambiguity(matches.length, selector, visible.length, visible.length > 1 ? visible : matches), retry: false };
|
|
152
174
|
}
|
|
153
175
|
for (const st of states) {
|
|
154
176
|
const r = stateOf(el, st);
|
|
@@ -306,27 +328,118 @@
|
|
|
306
328
|
const el = actEl();
|
|
307
329
|
return el instanceof HTMLInputElement ? el.files?.length ?? 0 : 0;
|
|
308
330
|
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
const
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
331
|
+
var nativeShadowRoot = Object.getOwnPropertyDescriptor(Element.prototype, "shadowRoot").get;
|
|
332
|
+
var adoptedRoots = /* @__PURE__ */ new WeakMap();
|
|
333
|
+
Object.defineProperty(Element.prototype, "shadowRoot", {
|
|
334
|
+
configurable: true,
|
|
335
|
+
enumerable: true,
|
|
336
|
+
get() {
|
|
337
|
+
return nativeShadowRoot.call(this) ?? adoptedRoots.get(this) ?? null;
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
var SHADOW_HOST_TAGS = /* @__PURE__ */ new Set(["ARTICLE", "ASIDE", "BLOCKQUOTE", "BODY", "DIV", "FOOTER", "H1", "H2", "H3", "H4", "H5", "H6", "HEADER", "MAIN", "NAV", "P", "SECTION", "SPAN"]);
|
|
341
|
+
var shadowChecked = /* @__PURE__ */ new WeakSet();
|
|
342
|
+
var MAX_SHADOW_CANDIDATES = 40;
|
|
343
|
+
function closedShadowCandidates() {
|
|
344
|
+
const out = [];
|
|
345
|
+
const visit = (root) => {
|
|
346
|
+
const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT);
|
|
347
|
+
for (let n = walker.nextNode(); n && out.length < MAX_SHADOW_CANDIDATES; n = walker.nextNode()) {
|
|
348
|
+
const shadow = n.shadowRoot;
|
|
349
|
+
if (shadow) {
|
|
350
|
+
visit(shadow);
|
|
351
|
+
continue;
|
|
352
|
+
}
|
|
353
|
+
if (shadowChecked.has(n)) continue;
|
|
354
|
+
const custom = n.localName.includes("-");
|
|
355
|
+
if (custom) {
|
|
356
|
+
if (!n.matches(":defined")) continue;
|
|
357
|
+
} else if (!SHADOW_HOST_TAGS.has(n.tagName) || n.childElementCount || (n.textContent ?? "").trim()) continue;
|
|
358
|
+
else {
|
|
359
|
+
const r = n.getBoundingClientRect();
|
|
360
|
+
if (!r.width || !r.height) continue;
|
|
361
|
+
}
|
|
362
|
+
shadowChecked.add(n);
|
|
363
|
+
out.push(n);
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
visit(document);
|
|
367
|
+
return out;
|
|
368
|
+
}
|
|
369
|
+
function adoptShadowRoot(root) {
|
|
370
|
+
if (!(root instanceof ShadowRoot) || !root.host || nativeShadowRoot.call(root.host)) return false;
|
|
371
|
+
adoptedRoots.set(root.host, root);
|
|
372
|
+
watchDocument(root, true);
|
|
373
|
+
return true;
|
|
374
|
+
}
|
|
375
|
+
var OWN_LAYERS = /* @__PURE__ */ new Set(["browsermcp-overlay-root", "browsermcp-annotate"]);
|
|
376
|
+
var STYLE_REPEAT_MS = 200;
|
|
377
|
+
var activityState = { n: 0, last: performance.now(), installed: performance.now() };
|
|
378
|
+
var watchedDocuments = /* @__PURE__ */ new WeakSet();
|
|
379
|
+
var styledAt = /* @__PURE__ */ new WeakMap();
|
|
380
|
+
var ownLayer = (node) => node instanceof Element && OWN_LAYERS.has(node.id);
|
|
381
|
+
function bump(at) {
|
|
382
|
+
activityState.n++;
|
|
383
|
+
activityState.last = at;
|
|
384
|
+
}
|
|
385
|
+
function watchDocument(doc, counted) {
|
|
386
|
+
if (watchedDocuments.has(doc)) return;
|
|
387
|
+
watchedDocuments.add(doc);
|
|
388
|
+
if (counted) bump(performance.now());
|
|
389
|
+
new MutationObserver((records) => {
|
|
390
|
+
const now = performance.now();
|
|
391
|
+
let real = false;
|
|
392
|
+
for (const r of records) {
|
|
393
|
+
if (ownLayer(r.target) || [...r.addedNodes, ...r.removedNodes].some(ownLayer)) continue;
|
|
394
|
+
if (r.type === "attributes") {
|
|
395
|
+
const target2 = r.target;
|
|
396
|
+
if (r.oldValue === target2.getAttributeNS(r.attributeNamespace, r.attributeName)) continue;
|
|
397
|
+
if (r.attributeName === "style") {
|
|
398
|
+
const previous = styledAt.get(target2);
|
|
399
|
+
styledAt.set(target2, now);
|
|
400
|
+
if (previous === void 0 ? now - activityState.installed < STYLE_REPEAT_MS : now - previous <= STYLE_REPEAT_MS) continue;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
real = true;
|
|
404
|
+
}
|
|
405
|
+
if (real) bump(now);
|
|
406
|
+
}).observe(doc, { subtree: true, childList: true, attributes: true, attributeOldValue: true, characterData: true });
|
|
407
|
+
for (const type of doc instanceof Document ? ["input", "change", "scroll"] : ["scroll"]) doc.addEventListener(type, () => bump(performance.now()), true);
|
|
408
|
+
}
|
|
409
|
+
function watchShadowRoots(root, counted) {
|
|
410
|
+
const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT);
|
|
411
|
+
for (let n = walker.nextNode(); n; n = walker.nextNode()) {
|
|
412
|
+
const shadow = n.shadowRoot;
|
|
413
|
+
if (!shadow) continue;
|
|
414
|
+
watchDocument(shadow, counted);
|
|
415
|
+
watchShadowRoots(shadow, counted);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
function watchFrames(doc, counted) {
|
|
419
|
+
for (const frame of doc.querySelectorAll("iframe,frame")) {
|
|
420
|
+
let child = null;
|
|
421
|
+
try {
|
|
422
|
+
child = frame.contentDocument;
|
|
423
|
+
} catch {
|
|
424
|
+
child = null;
|
|
425
|
+
}
|
|
426
|
+
if (!child) continue;
|
|
427
|
+
watchDocument(child, counted);
|
|
428
|
+
watchFrames(child, counted);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
watchDocument(document, false);
|
|
432
|
+
watchFrames(document, false);
|
|
433
|
+
function contentProbe() {
|
|
434
|
+
const text2 = (document.body?.innerText ?? "").replace(/\s+/g, " ").trim();
|
|
435
|
+
return { href: location.href, ready: document.readyState, chars: text2.length, head: text2.slice(0, 200) };
|
|
436
|
+
}
|
|
437
|
+
var documentId = () => String(performance.timeOrigin);
|
|
438
|
+
function activity(args = {}) {
|
|
439
|
+
watchFrames(document, true);
|
|
440
|
+
if (args.scan) watchShadowRoots(document, false);
|
|
441
|
+
const now = performance.now();
|
|
442
|
+
return { n: activityState.n, idleMs: Math.round(now - activityState.last), ready: document.readyState, url: location.href, doc: documentId() };
|
|
330
443
|
}
|
|
331
444
|
var probedFrame = null;
|
|
332
445
|
function frameElement() {
|
|
@@ -384,7 +497,7 @@
|
|
|
384
497
|
if (matches.length > 1) {
|
|
385
498
|
const visible = matches.filter((m) => is(m, "visible"));
|
|
386
499
|
if (visible.length === 1) el = visible[0];
|
|
387
|
-
else return { error:
|
|
500
|
+
else return { error: ambiguity(matches.length, args.selector, visible.length, visible.length > 1 ? visible : matches), retry: false };
|
|
388
501
|
}
|
|
389
502
|
const enabled = stateOf(el, "enabled");
|
|
390
503
|
if (!enabled.matches) return { error: { code: "not_enabled", message: `element is not enabled${enabled.received.startsWith("error:") ? ` (${enabled.received.slice(6)})` : ""}`, candidates: [candidate(el)] }, retry: true };
|
|
@@ -441,7 +554,15 @@
|
|
|
441
554
|
}
|
|
442
555
|
return best;
|
|
443
556
|
}
|
|
557
|
+
function inClosedDetails(node) {
|
|
558
|
+
let child = node;
|
|
559
|
+
for (let parent = node.parentNode; parent; child = parent, parent = parent.parentNode ?? parent.host ?? null) {
|
|
560
|
+
if (parent instanceof HTMLDetailsElement && !parent.open && child.nodeName !== "SUMMARY") return true;
|
|
561
|
+
}
|
|
562
|
+
return false;
|
|
563
|
+
}
|
|
444
564
|
function skipRead(el, visible) {
|
|
565
|
+
if (el && inClosedDetails(el)) return true;
|
|
445
566
|
while (el) {
|
|
446
567
|
const tag = el.tagName;
|
|
447
568
|
if (tag === "SCRIPT" || tag === "STYLE" || tag === "NOSCRIPT") return true;
|
|
@@ -451,7 +572,7 @@
|
|
|
451
572
|
if (cached === false) return true;
|
|
452
573
|
if (cached === void 0) {
|
|
453
574
|
const style = getComputedStyle(el);
|
|
454
|
-
const shown = style.display !== "none" && style.visibility !== "hidden" && style.visibility !== "collapse";
|
|
575
|
+
const shown = style.display !== "none" && style.visibility !== "hidden" && style.visibility !== "collapse" && style.opacity !== "0";
|
|
455
576
|
visible.set(el, shown);
|
|
456
577
|
if (!shown) return true;
|
|
457
578
|
}
|
|
@@ -459,12 +580,41 @@
|
|
|
459
580
|
}
|
|
460
581
|
return false;
|
|
461
582
|
}
|
|
583
|
+
function shownText(root) {
|
|
584
|
+
if (skipRead(root, /* @__PURE__ */ new WeakMap())) return "";
|
|
585
|
+
const parts = [];
|
|
586
|
+
const visit = (node, textShown) => {
|
|
587
|
+
for (const n of node.childNodes) {
|
|
588
|
+
if (node instanceof HTMLDetailsElement && !node.open && n.nodeName !== "SUMMARY") continue;
|
|
589
|
+
if (n.nodeType === Node.TEXT_NODE) {
|
|
590
|
+
if (textShown) parts.push(n.textContent ?? "");
|
|
591
|
+
continue;
|
|
592
|
+
}
|
|
593
|
+
if (!(n instanceof Element) || /^(SCRIPT|STYLE|NOSCRIPT|TEMPLATE)$/.test(n.tagName) || n.id === "browsermcp-annotate" || n.hasAttribute("hidden")) continue;
|
|
594
|
+
const style = getComputedStyle(n);
|
|
595
|
+
if (style.display === "none" || style.opacity === "0") continue;
|
|
596
|
+
const shown = style.visibility !== "hidden" && style.visibility !== "collapse";
|
|
597
|
+
const block = n.tagName === "BR" || style.display !== "inline" && style.display !== "contents";
|
|
598
|
+
if (block) parts.push(" ");
|
|
599
|
+
visit(n, shown);
|
|
600
|
+
if (n.shadowRoot) visit(n.shadowRoot, shown);
|
|
601
|
+
if (block) parts.push(" ");
|
|
602
|
+
}
|
|
603
|
+
};
|
|
604
|
+
visit(root, true);
|
|
605
|
+
if (root.shadowRoot) visit(root.shadowRoot, true);
|
|
606
|
+
return parts.join("").replace(/\s+/g, " ").trim();
|
|
607
|
+
}
|
|
608
|
+
function shownElement(el) {
|
|
609
|
+
return is(el, "visible") && !skipRead(el, /* @__PURE__ */ new WeakMap());
|
|
610
|
+
}
|
|
462
611
|
function pageLines() {
|
|
463
612
|
const out = [];
|
|
464
613
|
if (!document.body) return out;
|
|
465
614
|
const visible = /* @__PURE__ */ new WeakMap();
|
|
466
615
|
const visit = (root) => {
|
|
467
616
|
for (const n of root.childNodes) {
|
|
617
|
+
if (root instanceof HTMLDetailsElement && !root.open && n.nodeName !== "SUMMARY") continue;
|
|
468
618
|
if (n.nodeType === Node.TEXT_NODE) {
|
|
469
619
|
const parent = n.parentElement ?? n.getRootNode().host;
|
|
470
620
|
if (!skipRead(parent, visible)) {
|
|
@@ -575,11 +725,50 @@
|
|
|
575
725
|
if (!matches.length) throw pageError("not_found", `No element matches ${args.selector}`, "Observe the page or find the container again.");
|
|
576
726
|
if (matches.length > 1) {
|
|
577
727
|
const visible = matches.filter((el) => is(el, "visible"));
|
|
578
|
-
if (visible.length !== 1)
|
|
728
|
+
if (visible.length !== 1) {
|
|
729
|
+
const a = ambiguity(matches.length, args.selector, visible.length, visible.length > 1 ? visible : matches);
|
|
730
|
+
throw pageError(a.code, a.message, a.hint, { candidates: a.candidates });
|
|
731
|
+
}
|
|
579
732
|
matches = visible;
|
|
580
733
|
}
|
|
581
734
|
return matches[0];
|
|
582
735
|
}
|
|
736
|
+
var SLOT_TAGS = /* @__PURE__ */ new Set(["P", "SPAN", "DIV", "DD", "TD", "EM", "STRONG", "B", "SMALL", "LABEL", "TIME", "DATA", "OUTPUT"]);
|
|
737
|
+
function isEmptySlot(el) {
|
|
738
|
+
if (!SLOT_TAGS.has(el.tagName) || el.children.length || (el.textContent ?? "").trim()) return false;
|
|
739
|
+
const box2 = el.getBoundingClientRect();
|
|
740
|
+
return !(box2.width > 0 && box2.height > 0);
|
|
741
|
+
}
|
|
742
|
+
function namingTokens(el) {
|
|
743
|
+
const tokens = [...el.classList].filter((t) => t.length <= 32 && /^[a-z][a-z0-9]*(?:[-_]{1,2}[a-z0-9]+)*$/i.test(t) && !/\d{3}|^(?:css|sc|jsx|svelte|emotion)-/i.test(t));
|
|
744
|
+
return el.id && !/\d{3}/.test(el.id) ? [`#${el.id}`, ...tokens] : tokens;
|
|
745
|
+
}
|
|
746
|
+
var SELECTED_TOKEN = /^(?:.*[-_])?(?:cur|current|active|actived|selected|checked|on)$/i;
|
|
747
|
+
function stateHints(el, empty) {
|
|
748
|
+
let out = "";
|
|
749
|
+
if (empty) {
|
|
750
|
+
const names = namingTokens(el);
|
|
751
|
+
out += names.length ? ` [empty ${names[0].startsWith("#") ? `id="${names[0].slice(1)}"` : `class="${names.slice(0, 2).join(" ")}"`}]` : " [empty]";
|
|
752
|
+
}
|
|
753
|
+
const details = el.tagName === "SUMMARY" && el.parentElement instanceof HTMLDetailsElement ? el.parentElement : null;
|
|
754
|
+
if (details && !el.hasAttribute("aria-expanded")) out += details.open ? " [expanded]" : " [collapsed]";
|
|
755
|
+
const current = el.getAttribute("aria-current");
|
|
756
|
+
if (current && current !== "false") out += current === "true" ? " [current]" : ` [current=${current}]`;
|
|
757
|
+
else if (!["aria-selected", "aria-pressed", "aria-checked"].some((a) => el.hasAttribute(a)) && !(el instanceof HTMLInputElement)) {
|
|
758
|
+
const token = selectionToken(el);
|
|
759
|
+
if (token) out += ` [selected? class="${token}"]`;
|
|
760
|
+
}
|
|
761
|
+
return out;
|
|
762
|
+
}
|
|
763
|
+
function selectionToken(el) {
|
|
764
|
+
const parent = el.parentElement;
|
|
765
|
+
if (!parent) return null;
|
|
766
|
+
const siblings = [...parent.children].filter((s) => s.tagName === el.tagName);
|
|
767
|
+
if (siblings.length < 2 || siblings.length > 50) return null;
|
|
768
|
+
const marked = siblings.filter((s) => [...s.classList].some((t) => SELECTED_TOKEN.test(t)));
|
|
769
|
+
if (marked.length !== 1 || marked[0] !== el) return null;
|
|
770
|
+
return [...el.classList].find((t) => SELECTED_TOKEN.test(t));
|
|
771
|
+
}
|
|
583
772
|
function aria(args = {}) {
|
|
584
773
|
const root = observationRoot(args);
|
|
585
774
|
const i = injected();
|
|
@@ -616,8 +805,11 @@
|
|
|
616
805
|
continue;
|
|
617
806
|
}
|
|
618
807
|
const el = elements.get(m[2]);
|
|
619
|
-
|
|
620
|
-
|
|
808
|
+
const empty = !m[4] && !m[1].includes(' "') && isEmptySlot(el);
|
|
809
|
+
const hints = stateHints(el, empty);
|
|
810
|
+
const closing = hints && m[3].endsWith("'") ? m[3].slice(0, -1) + hints + "'" : m[3] + hints;
|
|
811
|
+
let rline = m[1] + stableRefOf(el) + closing + (m[4] ?? "");
|
|
812
|
+
if (args.viewport && !args.ref && !intersectsViewport(empty && el.parentElement ? el.parentElement : el)) {
|
|
621
813
|
dropBelow = indent;
|
|
622
814
|
continue;
|
|
623
815
|
}
|
|
@@ -698,7 +890,7 @@ Focused: [ref=${focusRef}]` : "");
|
|
|
698
890
|
if (!matches.length) return { error: { code: "not_found", message: `no element matches ${args.selector}`, hint: "Observe or find the target again." } };
|
|
699
891
|
if (matches.length > 1) {
|
|
700
892
|
const visible = matches.filter((el2) => is(el2, "visible"));
|
|
701
|
-
if (visible.length !== 1) return { error:
|
|
893
|
+
if (visible.length !== 1) return { error: ambiguity(matches.length, args.selector, visible.length, visible.length > 1 ? visible : matches) };
|
|
702
894
|
matches = visible;
|
|
703
895
|
}
|
|
704
896
|
const el = matches[0];
|
|
@@ -778,6 +970,7 @@ Focused: [ref=${focusRef}]` : "");
|
|
|
778
970
|
function unannotate() {
|
|
779
971
|
document.getElementById(ANNOTATE_ID)?.remove();
|
|
780
972
|
}
|
|
973
|
+
var fold = (value) => value.replace(/\s+/g, " ").trim().toLowerCase();
|
|
781
974
|
function check(args) {
|
|
782
975
|
const failed = [];
|
|
783
976
|
const actual = {};
|
|
@@ -787,11 +980,14 @@ Focused: [ref=${focusRef}]` : "");
|
|
|
787
980
|
if (!matches.length && args.fallback) matches = query(args.fallback);
|
|
788
981
|
if (matches.length > 1) {
|
|
789
982
|
const visible = matches.filter((el) => is(el, "visible"));
|
|
790
|
-
if (visible.length !== 1)
|
|
983
|
+
if (visible.length !== 1) {
|
|
984
|
+
const a = ambiguity(matches.length, args.selector, visible.length, visible.length > 1 ? visible : matches);
|
|
985
|
+
throw Object.assign(new Error(a.message), { code: a.code, hint: a.hint, data: { candidates: a.candidates } });
|
|
986
|
+
}
|
|
791
987
|
matches = visible;
|
|
792
988
|
}
|
|
793
989
|
element = matches[0];
|
|
794
|
-
actual.visible = !!element &&
|
|
990
|
+
actual.visible = !!element && shownElement(element) && (args.targetText === void 0 || fold(shownText(element)).includes(fold(args.targetText)));
|
|
795
991
|
const visibilityOnly = ["text", "notText", "value", "checked", "selected", "enabled"].every((key) => args[key] === void 0);
|
|
796
992
|
if (args.visible !== void 0 || visibilityOnly) {
|
|
797
993
|
if (actual.visible !== (args.visible ?? true)) failed.push(`visible is ${actual.visible}, expected ${args.visible ?? true}`);
|
|
@@ -800,7 +996,7 @@ Focused: [ref=${focusRef}]` : "");
|
|
|
800
996
|
}
|
|
801
997
|
if (args.selector === void 0 || element) {
|
|
802
998
|
const root = element ?? document.body;
|
|
803
|
-
const content = element && isCredentialField(element) ? "<redacted>" :
|
|
999
|
+
const content = element && isCredentialField(element) ? "<redacted>" : root ? shownText(root) : "";
|
|
804
1000
|
if (args.text !== void 0 || args.notText !== void 0) {
|
|
805
1001
|
actual.text = content.slice(0, 1e3);
|
|
806
1002
|
if (args.text !== void 0 && !content.includes(args.text)) failed.push(`text does not include "${args.text}"`);
|
|
@@ -829,6 +1025,6 @@ Focused: [ref=${focusRef}]` : "");
|
|
|
829
1025
|
if (args.title !== void 0 && !document.title.includes(args.title)) failed.push(`title "${document.title}" does not include "${args.title}"`);
|
|
830
1026
|
return { ok: failed.length === 0, failed, url: location.href, title: document.title, actual };
|
|
831
1027
|
}
|
|
832
|
-
var api = { check, resolve, resolveUpload, fileSelectionCount, pointInfo, focus, readValue, fill, isChecked, select, caretToEnd, actionTarget, clearActionTarget,
|
|
1028
|
+
var api = { check, resolve, resolveUpload, fileSelectionCount, pointInfo, focus, readValue, fill, isChecked, select, caretToEnd, actionTarget, clearActionTarget, activity, contentProbe, closedShadowCandidates, adoptShadowRoot, frameProbe, frameElement, clearFrameProbe, aria, observeFrame, visibleDom, readElement, find, findByQuery, elementAt, annotate, unannotate, armClickProbe, readClickProbe, domClick, readText };
|
|
833
1029
|
globalThis[PAGE_GLOBAL] = api;
|
|
834
1030
|
})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jackwener/browsermcp",
|
|
3
|
-
"version": "0.0.39
|
|
3
|
+
"version": "0.0.39",
|
|
4
4
|
"description": "Chrome-backed MCP browser service with optional site adapters.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,23 +19,20 @@
|
|
|
19
19
|
"browsermcp": "dist/src/main.js"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
|
-
"build": "node scripts/clean.mjs && node scripts/extract-playwright-injected.mjs && tsc -p tsconfig.json && node scripts/gen-adapter-manifest.mjs && node scripts/gen-api-reference.mjs && node scripts/render-icons.mjs && node scripts/build-extension.mjs && node scripts/copy-assets.mjs
|
|
22
|
+
"build": "node scripts/clean.mjs && node scripts/extract-playwright-injected.mjs && tsc -p tsconfig.json && node scripts/gen-adapter-manifest.mjs && node scripts/gen-api-reference.mjs && node scripts/render-icons.mjs && node scripts/build-extension.mjs && node scripts/copy-assets.mjs",
|
|
23
23
|
"build:ext": "node scripts/render-icons.mjs && node scripts/build-extension.mjs",
|
|
24
24
|
"dev": "tsx src/main.ts",
|
|
25
25
|
"test": "vitest run",
|
|
26
26
|
"typecheck": "tsc -p tsconfig.tests.json && tsc -p extension/tsconfig.json",
|
|
27
27
|
"smoke:setup": "node scripts/smoke-setup.mjs",
|
|
28
|
-
"smoke:browser": "node scripts/smoke-browser.mjs",
|
|
29
28
|
"smoke:observation": "node scripts/smoke-observation.mjs",
|
|
29
|
+
"smoke:feedback": "node scripts/smoke-agent-feedback.mjs",
|
|
30
30
|
"prepare": "npm run build",
|
|
31
31
|
"check": "npm run typecheck && npm run build && npm test",
|
|
32
32
|
"pack:store": "npm run build && node scripts/pack-extension.mjs store",
|
|
33
33
|
"pack:manual": "npm run build && node scripts/pack-extension.mjs manual",
|
|
34
34
|
"smoke:native": "node scripts/smoke-native-capabilities.mjs",
|
|
35
35
|
"generate:chrome": "node scripts/gen-chrome-reference.mjs",
|
|
36
|
-
"build:embedded": "tsc -p tsconfig.json && node scripts/gen-adapter-manifest.mjs && node scripts/build-embedded.mjs && node scripts/copy-assets.mjs",
|
|
37
|
-
"smoke:embedded": "npm run build:embedded && node scripts/run-embedded-smoke.mjs",
|
|
38
|
-
"smoke:embedded:package": "npm run build:embedded && node scripts/smoke-embedded-package.mjs",
|
|
39
36
|
"gen:adapters": "tsc -p tsconfig.json && node scripts/gen-adapter-manifest.mjs"
|
|
40
37
|
},
|
|
41
38
|
"files": [
|
|
@@ -64,11 +61,9 @@
|
|
|
64
61
|
"zod": "^4.6.5"
|
|
65
62
|
},
|
|
66
63
|
"devDependencies": {
|
|
67
|
-
"@electron/asar": "^4.3.1",
|
|
68
64
|
"@resvg/resvg-js": "^2.6.2",
|
|
69
65
|
"@types/chrome": "^0.3.0",
|
|
70
66
|
"@types/node": "^22.20.3",
|
|
71
|
-
"electron": "^44.9.0",
|
|
72
67
|
"esbuild": "^0.28.2",
|
|
73
68
|
"playwright-core": "^1.63.0",
|
|
74
69
|
"tsx": "^4.23.13",
|
|
@@ -79,10 +74,6 @@
|
|
|
79
74
|
"./adapter-sdk": {
|
|
80
75
|
"types": "./adapter-sdk/index.d.ts",
|
|
81
76
|
"default": "./adapter-sdk/index.js"
|
|
82
|
-
},
|
|
83
|
-
"./embedded": {
|
|
84
|
-
"types": "./dist/src/embedded/index.d.ts",
|
|
85
|
-
"default": "./dist/src/embedded/index.js"
|
|
86
77
|
}
|
|
87
78
|
}
|
|
88
79
|
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import type { Expectation } from '../shared/page-contract.js';
|
|
3
|
-
import type { ActAction, Target } from './tab.js';
|
|
4
|
-
export interface RawTarget {
|
|
5
|
-
ref?: string | number;
|
|
6
|
-
selector?: string;
|
|
7
|
-
within?: string;
|
|
8
|
-
nth?: number;
|
|
9
|
-
role?: string;
|
|
10
|
-
name?: string;
|
|
11
|
-
label?: string;
|
|
12
|
-
text?: string;
|
|
13
|
-
testid?: string;
|
|
14
|
-
x?: number;
|
|
15
|
-
y?: number;
|
|
16
|
-
frame?: Target['frame'];
|
|
17
|
-
}
|
|
18
|
-
export interface ActToolInput {
|
|
19
|
-
action: ActAction;
|
|
20
|
-
target?: RawTarget;
|
|
21
|
-
to?: RawTarget;
|
|
22
|
-
value?: string;
|
|
23
|
-
files?: string[];
|
|
24
|
-
direction?: 'up' | 'down' | 'left' | 'right';
|
|
25
|
-
amount?: number;
|
|
26
|
-
method?: 'cdp' | 'dom';
|
|
27
|
-
timeoutMs?: number;
|
|
28
|
-
settleMs?: number;
|
|
29
|
-
}
|
|
30
|
-
export declare const targetShape: z.ZodObject<{
|
|
31
|
-
ref: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
32
|
-
selector: z.ZodOptional<z.ZodString>;
|
|
33
|
-
within: z.ZodOptional<z.ZodString>;
|
|
34
|
-
nth: z.ZodOptional<z.ZodNumber>;
|
|
35
|
-
role: z.ZodOptional<z.ZodString>;
|
|
36
|
-
name: z.ZodOptional<z.ZodString>;
|
|
37
|
-
label: z.ZodOptional<z.ZodString>;
|
|
38
|
-
text: z.ZodOptional<z.ZodString>;
|
|
39
|
-
testid: z.ZodOptional<z.ZodString>;
|
|
40
|
-
x: z.ZodOptional<z.ZodNumber>;
|
|
41
|
-
y: z.ZodOptional<z.ZodNumber>;
|
|
42
|
-
frame: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>>;
|
|
43
|
-
}, z.core.$strict>;
|
|
44
|
-
export declare const expectationShape: z.ZodObject<{
|
|
45
|
-
target: z.ZodOptional<z.ZodObject<{
|
|
46
|
-
ref: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
47
|
-
selector: z.ZodOptional<z.ZodString>;
|
|
48
|
-
within: z.ZodOptional<z.ZodString>;
|
|
49
|
-
nth: z.ZodOptional<z.ZodNumber>;
|
|
50
|
-
role: z.ZodOptional<z.ZodString>;
|
|
51
|
-
name: z.ZodOptional<z.ZodString>;
|
|
52
|
-
label: z.ZodOptional<z.ZodString>;
|
|
53
|
-
text: z.ZodOptional<z.ZodString>;
|
|
54
|
-
testid: z.ZodOptional<z.ZodString>;
|
|
55
|
-
x: z.ZodOptional<z.ZodNumber>;
|
|
56
|
-
y: z.ZodOptional<z.ZodNumber>;
|
|
57
|
-
frame: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>>;
|
|
58
|
-
}, z.core.$strict>>;
|
|
59
|
-
text: z.ZodOptional<z.ZodString>;
|
|
60
|
-
notText: z.ZodOptional<z.ZodString>;
|
|
61
|
-
url: z.ZodOptional<z.ZodString>;
|
|
62
|
-
title: z.ZodOptional<z.ZodString>;
|
|
63
|
-
visible: z.ZodOptional<z.ZodBoolean>;
|
|
64
|
-
value: z.ZodOptional<z.ZodString>;
|
|
65
|
-
checked: z.ZodOptional<z.ZodBoolean>;
|
|
66
|
-
selected: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
67
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
68
|
-
}, z.core.$strict>;
|
|
69
|
-
type Need = 'required' | 'nonempty' | 'present' | 'optional' | 'forbidden';
|
|
70
|
-
export declare const ACTION_RULES: Record<ActAction, {
|
|
71
|
-
target: Need;
|
|
72
|
-
value: Need;
|
|
73
|
-
files: Need;
|
|
74
|
-
to: Need;
|
|
75
|
-
scroll: boolean;
|
|
76
|
-
}>;
|
|
77
|
-
/** What the model can copy into the next call. Wire shape is error.details.expected. */
|
|
78
|
-
export declare function expectedAct(action: ActAction): Record<string, string>;
|
|
79
|
-
export declare function pickTarget(t: RawTarget | undefined, action: ActAction, slot: 'target' | 'to'): Target | undefined;
|
|
80
|
-
export declare function checkActInput(input: ActToolInput): {
|
|
81
|
-
target?: Target;
|
|
82
|
-
to?: Target;
|
|
83
|
-
method?: 'cdp' | 'dom';
|
|
84
|
-
};
|
|
85
|
-
/** Validate the public contract before sending a compiled expectation to the page. */
|
|
86
|
-
export declare function checkExpect(what: Expectation): void;
|
|
87
|
-
export {};
|
package/dist/src/api/agent.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The object model — the single surface behind both the typed MCP tools and the `js` session.
|
|
3
|
-
* agent.browsers → browser.tabs / browser.user / browser.capabilities → tab.observe / tab.act / …
|
|
4
|
-
* sites.<site>.<command>(args) · recon.discover(tab) · tools.define · browser.nameSession / browser.tabs.finalize
|
|
5
|
-
* Split by object: tab.ts, browser.ts, api.ts (context.ts carries what they share). This file re-exports them.
|
|
6
|
-
*/
|
|
7
|
-
export * from './tab.js';
|
|
8
|
-
export * from './browser.js';
|
|
9
|
-
export * from './api.js';
|
|
10
|
-
export * from './context.js';
|
package/dist/src/api/api.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { type BrowserHelper, type BrowserCommands } from './commands.js';
|
|
2
|
-
/**
|
|
3
|
-
* The object model's entry: agent.browsers · sites.<site>.<command>() · recon.discover(tab) · tools.define.
|
|
4
|
-
* One surface behind both the typed entry tools and the `js` session.
|
|
5
|
-
*/
|
|
6
|
-
import type { Runtime } from '../runtime/runtime.js';
|
|
7
|
-
import { discoverEndpoints, type DiscoverResult } from '../recon/discover.js';
|
|
8
|
-
import { listDefinedTools, type ToolDefinition } from '../sites/define.js';
|
|
9
|
-
import type { DraftExpectation } from '../sites/drafts.js';
|
|
10
|
-
import { Tab } from './tab.js';
|
|
11
|
-
import { Browser } from './browser.js';
|
|
12
|
-
export interface AgentApi {
|
|
13
|
-
helper: BrowserHelper;
|
|
14
|
-
agent: {
|
|
15
|
-
browsers: {
|
|
16
|
-
getDefault(): Promise<Browser>;
|
|
17
|
-
};
|
|
18
|
-
browser: Browser;
|
|
19
|
-
documentation: {
|
|
20
|
-
get(name: string): Promise<string | null>;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
sites: Record<string, unknown> & {
|
|
24
|
-
search(q: string, limit?: number): Promise<unknown>;
|
|
25
|
-
list(): Promise<unknown>;
|
|
26
|
-
enable(site: string, opts?: {
|
|
27
|
-
write?: boolean;
|
|
28
|
-
}): Promise<{
|
|
29
|
-
site: string;
|
|
30
|
-
tools: string[];
|
|
31
|
-
}>;
|
|
32
|
-
disable(site: string): Promise<boolean>;
|
|
33
|
-
run(site: string, name: string, args?: Record<string, unknown>): Promise<unknown>;
|
|
34
|
-
};
|
|
35
|
-
recon: {
|
|
36
|
-
discover(tab: Tab, opts?: Parameters<typeof discoverEndpoints>[1]): Promise<DiscoverResult>;
|
|
37
|
-
};
|
|
38
|
-
tools: {
|
|
39
|
-
define(def: ToolDefinition | (Omit<ToolDefinition, 'func'> & {
|
|
40
|
-
func?: string | ((ctx: Record<string, unknown>) => unknown);
|
|
41
|
-
})): ReturnType<Runtime['defineTool']>;
|
|
42
|
-
try(draftId: string, args: Record<string, unknown>, expect: DraftExpectation): ReturnType<Runtime['tryToolDraft']>;
|
|
43
|
-
activate(draftId: string): ReturnType<Runtime['activateToolDraft']>;
|
|
44
|
-
discard(draftId: string): Promise<ReturnType<Runtime['discardToolDraft']>>;
|
|
45
|
-
list(): Promise<ReturnType<typeof listDefinedTools>>;
|
|
46
|
-
remove(site: string, name: string): ReturnType<Runtime['removeTool']>;
|
|
47
|
-
};
|
|
48
|
-
session: {
|
|
49
|
-
id: string;
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
export declare function createAgentApi(rt: Runtime, sessionId: string): AgentApi & {
|
|
53
|
-
commands: BrowserCommands;
|
|
54
|
-
};
|