@jackwener/browsermcp 0.0.34-embedded.1 → 0.0.34
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 -12
- package/README.md +1 -93
- package/dist/docs/api-reference.md +15 -6
- package/dist/docs/errors.md +24 -0
- package/dist/docs/js-tool.md +12 -2
- package/dist/docs/tab-lifecycle.md +3 -3
- package/dist/src/api/api.js +2 -1
- package/dist/src/api/api.js.map +1 -1
- package/dist/src/api/browser.js +23 -4
- package/dist/src/api/browser.js.map +1 -1
- package/dist/src/api/tab.js +23 -7
- package/dist/src/api/tab.js.map +1 -1
- package/dist/src/backends/extension-page.js +8 -1
- 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/mcp/js-session.js +29 -18
- package/dist/src/mcp/js-session.js.map +1 -1
- package/dist/src/mcp/js-worker.mjs +51 -15
- package/dist/src/mcp/server.js +2 -2
- package/dist/src/mcp/server.js.map +1 -1
- package/dist/src/protocol.js +1 -1
- package/dist/src/protocol.js.map +1 -1
- package/dist/src/runtime/runtime.js +2 -2
- package/dist/src/runtime/runtime.js.map +1 -1
- package/dist/src/shared/api-contract.js +117 -0
- package/dist/src/shared/api-contract.js.map +1 -0
- package/docs/api-reference.md +15 -6
- package/docs/errors.md +24 -0
- package/docs/js-tool.md +12 -2
- package/docs/releasing.md +14 -3
- package/docs/tab-lifecycle.md +3 -3
- package/extension/dist/background.js +20046 -278
- package/package.json +4 -13
- package/dist/src/api/action-input.d.ts +0 -47
- package/dist/src/api/agent.d.ts +0 -10
- package/dist/src/api/api.d.ts +0 -50
- package/dist/src/api/browser.d.ts +0 -89
- 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 -12
- 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 -308
- 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 -57
- 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 -35
- 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 -48
- package/dist/src/electron/backend.js +0 -360
- 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 -42
- package/dist/src/electron/driver.js +0 -238
- 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 -93
- package/dist/src/electron/registry.js +0 -259
- 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 -41
- package/dist/src/embedded/index.js +0 -69
- 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 -63
- package/dist/src/mcp/server.d.ts +0 -15
- package/dist/src/protocol.d.ts +0 -318
- 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/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 -84
- package/dist/src/sites/schema.d.ts +0 -11
- package/dist/src/version.d.ts +0 -2
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wrap JS code for CDP Runtime.evaluate:
|
|
3
|
-
* - Already an IIFE `(...)()` → send as-is
|
|
4
|
-
* - Arrow/function literal → wrap as IIFE `(code)()`
|
|
5
|
-
* - `new Promise(...)` or raw expression → send as-is (expression)
|
|
6
|
-
*/
|
|
7
|
-
export declare function wrapForEval(js: string): string;
|
|
8
|
-
/** Generate JS to read performance resource entries as network requests */
|
|
9
|
-
export declare function networkRequestsJs(includeStatic: boolean): string;
|
|
10
|
-
/**
|
|
11
|
-
* Generate JS to wait until the DOM stabilizes (no mutations for `quietMs`),
|
|
12
|
-
* with a hard cap at `maxMs`. Uses MutationObserver in the browser.
|
|
13
|
-
*
|
|
14
|
-
* Returns as soon as the page stops changing, avoiding unnecessary fixed waits.
|
|
15
|
-
* If document.body is not available, falls back to a fixed sleep of maxMs.
|
|
16
|
-
*/
|
|
17
|
-
export declare function waitForDomStableJs(maxMs: number, quietMs: number): string;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/** The page transport over the extension bridge; interactions use the shared act engine. */
|
|
2
|
-
import type { PageTransport } from './page-transport.js';
|
|
3
|
-
import type { PageOptions as ExtensionPageOptions, ManagedRuntimePage as ExtensionRuntimePage } from './managed-page.js';
|
|
4
|
-
export type { PageOptions as ExtensionPageOptions, ManagedRuntimePage as ExtensionRuntimePage, UserTabInfo } from './managed-page.js';
|
|
5
|
-
export declare function createExtensionPage(bridge: PageTransport, opts: ExtensionPageOptions): Promise<ExtensionRuntimePage>;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import type { RuntimePage } from './page-types.js';
|
|
2
|
-
import type { CloseUserTabsResult } from '../protocol.js';
|
|
3
|
-
export interface PageOptions {
|
|
4
|
-
session: string;
|
|
5
|
-
surface: 'browser' | 'adapter';
|
|
6
|
-
/** bind this page object to one tab identity for its whole life (per-Tab pages); omitted = session-scope page with no tab */
|
|
7
|
-
page?: string;
|
|
8
|
-
}
|
|
9
|
-
export interface UserTabInfo {
|
|
10
|
-
tabId: number;
|
|
11
|
-
title?: string;
|
|
12
|
-
url?: string;
|
|
13
|
-
windowId: number;
|
|
14
|
-
active: boolean;
|
|
15
|
-
groupId?: number;
|
|
16
|
-
lastAccessed?: number;
|
|
17
|
-
}
|
|
18
|
-
/** Page ownership and lifecycle operations shared by browser backends. */
|
|
19
|
-
export interface ManagedPageExtras {
|
|
20
|
-
nameSession(name: string): Promise<void>;
|
|
21
|
-
userTabs(options?: {
|
|
22
|
-
query?: string;
|
|
23
|
-
limit?: number;
|
|
24
|
-
}): Promise<UserTabInfo[]>;
|
|
25
|
-
claim(tab: {
|
|
26
|
-
tabId?: number;
|
|
27
|
-
active?: boolean;
|
|
28
|
-
title?: string;
|
|
29
|
-
url?: string;
|
|
30
|
-
expectedUrl?: string;
|
|
31
|
-
expectedTitle?: string;
|
|
32
|
-
}): Promise<{
|
|
33
|
-
page: string;
|
|
34
|
-
tabId: number;
|
|
35
|
-
url?: string;
|
|
36
|
-
title?: string;
|
|
37
|
-
}>;
|
|
38
|
-
closeUserTabs(tabIds: number[]): Promise<CloseUserTabsResult>;
|
|
39
|
-
mark(page: string, mark: 'deliverable' | 'handoff' | null): Promise<void>;
|
|
40
|
-
finalize(keep: Array<{
|
|
41
|
-
page: string;
|
|
42
|
-
status: 'deliverable' | 'handoff';
|
|
43
|
-
}>): Promise<{
|
|
44
|
-
closed: string[];
|
|
45
|
-
kept: string[];
|
|
46
|
-
failed: Array<{
|
|
47
|
-
page: string;
|
|
48
|
-
reason: string;
|
|
49
|
-
}>;
|
|
50
|
-
}>;
|
|
51
|
-
cursor(x: number, y: number, opts?: {
|
|
52
|
-
waitForArrival?: boolean;
|
|
53
|
-
}): Promise<void>;
|
|
54
|
-
setVisibility(visible: boolean): Promise<void>;
|
|
55
|
-
getVisibility(): Promise<boolean>;
|
|
56
|
-
}
|
|
57
|
-
export type ManagedRuntimePage = RuntimePage & ManagedPageExtras;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Command, BrowserFeature } from '../protocol.js';
|
|
2
|
-
export interface PageTransport {
|
|
3
|
-
readonly extensionFeatures: BrowserFeature[];
|
|
4
|
-
send(action: Command['action'], params?: Omit<Command, 'id' | 'action'>, opts?: {
|
|
5
|
-
timeoutMs?: number;
|
|
6
|
-
}): Promise<{
|
|
7
|
-
data: unknown;
|
|
8
|
-
page?: string;
|
|
9
|
-
}>;
|
|
10
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/** The transport surface used by the browser object API. */
|
|
2
|
-
import type { ActSpec, ActResult, DialogInfo, StreamReadOptions, StreamBatch, DownloadWaitResult, FrameStep } from '../protocol.js';
|
|
3
|
-
import type { Expectation, CheckResult } from '../shared/page-contract.js';
|
|
4
|
-
export interface ScreenshotOptions {
|
|
5
|
-
format?: 'png' | 'jpeg';
|
|
6
|
-
quality?: number;
|
|
7
|
-
fullPage?: boolean;
|
|
8
|
-
width?: number;
|
|
9
|
-
height?: number;
|
|
10
|
-
}
|
|
11
|
-
export interface RuntimePage {
|
|
12
|
-
goto(url: string, options?: {
|
|
13
|
-
waitUntil?: 'load' | 'none';
|
|
14
|
-
settleMs?: number;
|
|
15
|
-
}): Promise<void>;
|
|
16
|
-
evaluate<T = unknown>(js: string, opts?: {
|
|
17
|
-
timeoutMs?: number;
|
|
18
|
-
}): Promise<T>;
|
|
19
|
-
fetchJson(url: string, opts?: {
|
|
20
|
-
method?: string;
|
|
21
|
-
headers?: Record<string, string>;
|
|
22
|
-
body?: unknown;
|
|
23
|
-
timeoutMs?: number;
|
|
24
|
-
}): Promise<unknown>;
|
|
25
|
-
getCookies(opts?: {
|
|
26
|
-
domain?: string;
|
|
27
|
-
url?: string;
|
|
28
|
-
}): Promise<unknown[]>;
|
|
29
|
-
tabs(): Promise<unknown[]>;
|
|
30
|
-
networkRequests(includeStatic?: boolean): Promise<unknown[]>;
|
|
31
|
-
getActivePage(): string | undefined;
|
|
32
|
-
cdp(method: string, params?: Record<string, unknown>, target?: {
|
|
33
|
-
frameId: string;
|
|
34
|
-
}): Promise<unknown>;
|
|
35
|
-
newTab(url?: string): Promise<string | undefined>;
|
|
36
|
-
closeTab(target?: string): Promise<void>;
|
|
37
|
-
releaseTab(target?: string): Promise<void>;
|
|
38
|
-
closeWindow(): Promise<void>;
|
|
39
|
-
screenshot(options?: ScreenshotOptions): Promise<string>;
|
|
40
|
-
startNetworkCapture(pattern?: string): Promise<boolean>;
|
|
41
|
-
readNetworkCapture(): Promise<unknown[]>;
|
|
42
|
-
waitForDownload(afterSequence: number, timeoutMs?: number): Promise<DownloadWaitResult>;
|
|
43
|
-
/** Child frames in document order; crossOrigin marks frames whose origin differs from the top document (data:/sandboxed count as cross-origin). */
|
|
44
|
-
frames(): Promise<Array<{
|
|
45
|
-
index: number;
|
|
46
|
-
frameId: string;
|
|
47
|
-
url: string;
|
|
48
|
-
name: string;
|
|
49
|
-
crossOrigin?: boolean;
|
|
50
|
-
oopif?: boolean;
|
|
51
|
-
}>>;
|
|
52
|
-
evaluateInFrame(js: string, frame: import('../protocol.js').FrameStep | import('../protocol.js').FrameStep[], timeoutMs?: number): Promise<unknown>;
|
|
53
|
-
getCurrentUrl(): Promise<string | null>;
|
|
54
|
-
evaluateWithArgs(js: string, args: Record<string, unknown>): Promise<unknown>;
|
|
55
|
-
/** browsermcp extras */
|
|
56
|
-
readonly session: string;
|
|
57
|
-
readonly surface: 'browser' | 'adapter';
|
|
58
|
-
/** The interaction engine at this backend's edge (locate → wait → hit-test → real input → settle). */
|
|
59
|
-
act(spec: ActSpec): Promise<ActResult>;
|
|
60
|
-
/** Console messages and uncaught exceptions captured while attached (cursor-paged). */
|
|
61
|
-
consoleLogs(opts?: StreamReadOptions): Promise<StreamBatch>;
|
|
62
|
-
/** Browser-driven reload / back / forward with a bounded load wait. */
|
|
63
|
-
history(op: 'reload' | 'back' | 'forward'): Promise<{
|
|
64
|
-
url?: string;
|
|
65
|
-
title?: string;
|
|
66
|
-
timedOut?: boolean;
|
|
67
|
-
}>;
|
|
68
|
-
dialog(op: 'get' | 'accept' | 'dismiss', text?: string): Promise<{
|
|
69
|
-
dialog: DialogInfo | null;
|
|
70
|
-
handled?: string;
|
|
71
|
-
}>;
|
|
72
|
-
/** Wait until an expectation about the page holds (text/url/title/selector/ref); throws expectation_failed with the failed checks and the page state. */
|
|
73
|
-
expect(what: Expectation, opts?: {
|
|
74
|
-
timeoutMs?: number;
|
|
75
|
-
}): Promise<CheckResult>;
|
|
76
|
-
/** Accessibility snapshot text for browser sessions and adapters. */
|
|
77
|
-
aria(opts?: {
|
|
78
|
-
viewport?: boolean;
|
|
79
|
-
}): Promise<string>;
|
|
80
|
-
/** Call one function of the page-side module (extension/src/page) in the main frame or a frame path, without scrolling. */
|
|
81
|
-
pageCall(fn: string, args?: unknown, timeoutMs?: number, frame?: FrameStep | FrameStep[]): Promise<unknown>;
|
|
82
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/** Backend-specific instructions: never send an embedded client through Chrome setup. */
|
|
2
|
-
export const EMBEDDED_DOCS = {
|
|
3
|
-
instructions: `# Embedded BrowserMCP
|
|
4
|
-
Use js as a persistent workspace. Pre-bound: browser, sites, tools, recon, agent, session, nodeRepl.
|
|
5
|
-
The host application owns pages, workspace/profile selection, login sessions, and storage. No setup or extension installation is needed.
|
|
6
|
-
Registered tabs can be dormant; listing them does not load them. claimTab loads a dormant tab before returning. active reflects the host-selected tab, not keyboard focus.
|
|
7
|
-
Open or claim a registered tab, observe, act, and verify the actual result. Await API calls. Copy refs from current observations.
|
|
8
|
-
Use browser.chrome.describe(method) before a Chrome API call: this backend implements a subset with explicit Electron semantics.
|
|
9
|
-
Use tab.cdp.send for page-scoped Chromium protocol operations. Browser-wide Target/Browser commands are not available.
|
|
10
|
-
Create and update adapters with tools.define, tools.try and tools.activate. A draft is inactive until verified and activated. Existing adapter code remains shared; execution follows the calling session's profile.
|
|
11
|
-
Finish with session_finalize. Borrowed user tabs stay open. Keep deliverables explicitly; handoff pages stay owned until the session closes.
|
|
12
|
-
js_reset stops the REPL but already dispatched operations can still finish. Inspect doctor and the page before retrying a mutation.
|
|
13
|
-
The host opted into trusted Node execution: REPL and adapter code are not a security sandbox.
|
|
14
|
-
Read docs_get for API signatures and recovery guidance.`,
|
|
15
|
-
'capabilities/chrome': `# Chrome API compatibility in Electron
|
|
16
|
-
browser.chrome.call(method, argsArray), describe(member), and watch(event, options) are available.
|
|
17
|
-
Supported calls: tabs.query/get/create/update/remove/reload; cookies.getAll/get/set/remove.
|
|
18
|
-
Supported events: tabs.onCreated/onUpdated/onRemoved/onActivated. Events cover this session's registered pages; activation requires a host callback.
|
|
19
|
-
Use describe for positional argument names, semantics and availability. Unimplemented methods/options fail with capability_unavailable.
|
|
20
|
-
Only registered tabs in the authorized workspace/profile are visible; another session's owned pages are excluded. Tab ids are stable BrowserMCP logical identities, not Electron webContents ids. windowId is -1 because application tab/window layout is host-owned.
|
|
21
|
-
Cookies use the authorized Electron Session. Unsupported Chrome fields such as storeId and partitionKey are rejected.
|
|
22
|
-
Use browser.tabs.new and browser.user.claimTab when you need a Tab handle. A raw Chrome call returns a Chrome-shaped value, not a Tab.
|
|
23
|
-
A watch handle supports read({cursor,limit}) and close(). Reads report dropped/reset information. js_reset and session finalization release subscriptions.
|
|
24
|
-
Extension installation, Native Messaging, Chrome profiles, tabGroups and extension service workers are not involved.`,
|
|
25
|
-
troubleshooting: `# Embedded recovery
|
|
26
|
-
Run doctor for runtime and JavaScript state. The host application supplies the backend; do not run CLI setup or install an extension.
|
|
27
|
-
tab_not_found: no registered tab matches. List browser.user.openTabs and use a reported tabId; active selection must be supplied by the host.
|
|
28
|
-
page_unavailable/stale_page: the page closed or access was released. List or claim an authorized page and recreate the handle.
|
|
29
|
-
debugger_in_use: another debugger owns the target. Ask the host to release it; do not steal its attachment.
|
|
30
|
-
profile_mismatch: the host supplied a webContents from the wrong Electron Session. This requires a host integration fix.
|
|
31
|
-
capability_unavailable: inspect browser.chrome.describe or browser.capabilities.list; do not assume every Chrome API is implemented.
|
|
32
|
-
command_outcome_unknown: inspect current page/site state before repeating a write.
|
|
33
|
-
cleanup_failed: the host could not close an owned page. Retry service cleanup after correcting the host callback.`,
|
|
34
|
-
};
|
|
35
|
-
//# sourceMappingURL=embedded.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"embedded.js","sourceRoot":"","sources":["../../../src/docs/embedded.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,YAAY,EAAE;;;;;;;;;;;wDAWwC;IACtD,qBAAqB,EAAE;;;;;;;;;qHAS4F;IACnH,eAAe,EAAE;;;;;;;;kHAQ+F;CACjH,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export type DocMode = 'included' | 'model' | 'lookup';
|
|
2
|
-
export interface DocEntry {
|
|
3
|
-
name: string;
|
|
4
|
-
mode: DocMode;
|
|
5
|
-
description?: string;
|
|
6
|
-
when?: {
|
|
7
|
-
backends?: Array<'extension' | 'electron' | 'none'>;
|
|
8
|
-
capabilities?: string[];
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
export interface DocContext {
|
|
12
|
-
backend: 'extension' | 'electron' | 'none';
|
|
13
|
-
capabilities: string[];
|
|
14
|
-
}
|
|
15
|
-
export declare const DOCS_MANIFEST: DocEntry[];
|
|
16
|
-
export declare function readDoc(name: string): string | null;
|
|
17
|
-
export declare function readDocForContext(name: string, ctx: DocContext, member?: string): string | null;
|
|
18
|
-
export declare function listDocs(ctx: DocContext): Array<DocEntry & {
|
|
19
|
-
available: boolean;
|
|
20
|
-
}>;
|
|
21
|
-
export declare function applies(d: DocEntry, ctx: DocContext): boolean;
|
|
22
|
-
/** Concatenate all `included` docs that apply → MCP server instructions (memoized per context). */
|
|
23
|
-
export declare function buildInstructions(ctx: DocContext): string;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** Runtime capability catalog shared by browser discovery and model-facing API projection. */
|
|
2
|
-
import type { BrowserFeature } from '../protocol.js';
|
|
3
|
-
export declare const BROWSER_CAPABILITIES: Array<{
|
|
4
|
-
id: BrowserFeature;
|
|
5
|
-
description: string;
|
|
6
|
-
doc?: string;
|
|
7
|
-
}>;
|
|
8
|
-
export declare const TAB_FEATURES: Record<string, BrowserFeature>;
|
|
9
|
-
/** Keep generated source documentation complete on disk; project only available members for an MCP client. */
|
|
10
|
-
export declare function projectApiReference(source: string, features: readonly BrowserFeature[]): string;
|
|
11
|
-
/** Slice the generated reference and include the value types needed by that member. */
|
|
12
|
-
export declare function selectApiReference(source: string, member: string): string | null;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { Session, WebContents } from 'electron';
|
|
2
|
-
import type { BrowserBackend } from '../backends/backend.js';
|
|
3
|
-
import type { PageOptions } from '../backends/managed-page.js';
|
|
4
|
-
import type { BrowserEvent, BrowserFeature, Command } from '../protocol.js';
|
|
5
|
-
import { ElectronStreams } from './streams.js';
|
|
6
|
-
import { PageRegistry, type PageScope, type PageRegistration } from './registry.js';
|
|
7
|
-
export interface ElectronBackendOptions {
|
|
8
|
-
createPage(scope: PageScope): Promise<WebContents>;
|
|
9
|
-
closePage(contents: WebContents): Promise<void>;
|
|
10
|
-
profile(scope: PageScope): Session;
|
|
11
|
-
activatePage?(contents: WebContents): Promise<void>;
|
|
12
|
-
pageModuleSource?: string;
|
|
13
|
-
}
|
|
14
|
-
/** Lives in Electron main; the host supplies registered pages and MCP transports. */
|
|
15
|
-
export declare class ElectronBackend implements BrowserBackend {
|
|
16
|
-
private readonly options;
|
|
17
|
-
readonly kind: "electron";
|
|
18
|
-
available: boolean;
|
|
19
|
-
readonly registry: PageRegistry;
|
|
20
|
-
readonly streams: ElectronStreams;
|
|
21
|
-
private readonly chrome;
|
|
22
|
-
private readonly listeners;
|
|
23
|
-
private readonly drivers;
|
|
24
|
-
private readonly closingPages;
|
|
25
|
-
private readonly selected;
|
|
26
|
-
private readonly scopes;
|
|
27
|
-
constructor(options: ElectronBackendOptions);
|
|
28
|
-
bindSession(session: string, scope: PageScope): void;
|
|
29
|
-
closeSession(session: string): Promise<void>;
|
|
30
|
-
register(contents: WebContents, scope: PageScope): string;
|
|
31
|
-
register(registration: PageRegistration): string;
|
|
32
|
-
unregister(page: string): void;
|
|
33
|
-
features(): BrowserFeature[];
|
|
34
|
-
subscribe(listener: (event: BrowserEvent) => void): () => void;
|
|
35
|
-
createPage(options: PageOptions): Promise<import("../backends/managed-page.js").ManagedRuntimePage>;
|
|
36
|
-
command(action: Command['action'], params: Partial<Command>): Promise<{
|
|
37
|
-
data: unknown;
|
|
38
|
-
page?: string;
|
|
39
|
-
}>;
|
|
40
|
-
private newPage;
|
|
41
|
-
private closeAccessiblePage;
|
|
42
|
-
private closePage;
|
|
43
|
-
private finalize;
|
|
44
|
-
private target;
|
|
45
|
-
private driver;
|
|
46
|
-
private dispatch;
|
|
47
|
-
dispose(): Promise<void>;
|
|
48
|
-
}
|