Captures a one-off screenshot of the current viewport.
The screenshot image, Base64-encoded.
Closes the session and releases the backend browser/container. Idempotent — safe to call once teardown has already begun.
A promise that resolves once the session is fully torn down.
Executes a single agent RemoteBrowserAction over CDP.
The action to perform; narrow on action.Kind.
The action result.
Returns the Chrome DevTools Protocol endpoint for this session — the one primitive every backend exposes and the engine's computer-use loop connects to.
The CDP websocket/connect endpoint URL.
Returns the browser's current URL synchronously (last known to the session).
The current page URL.
Returns an embeddable live-view URL so humans can watch the browser without MJ encoding frames.
Capability-gated by LiveView. Backends without it reject with import('./capability-errors').RemoteBrowserCapabilityNotSupportedError.
The live-view URL.
Reads the remote page's CURRENT text selection — the copy-out half of human clipboard support. The
viewer captures a local copy / Cmd+C, calls this to read what the human has selected on the remote
page, and writes the returned text to the LOCAL clipboard (again sidestepping the isolated remote
clipboard, the mirror of the RemoteBrowserTextInput paste path).
Capability-gated by HumanTakeover (copy-out belongs to the human-control path). Degrades
gracefully: backends that cannot read the selection — or a page with nothing selected — resolve to
'' rather than throwing, so a best-effort copy never breaks the live view.
The selected text, or '' when nothing is selected / the selection can't be read.
Delegates a high-level natural-language intent to the backend's own AI-control harness (e.g. Browserbase Stagehand) instead of MJ's computer-use loop.
Capability-gated by NativeAIControl. Backends without it reject.
The natural-language intent (e.g. 'log in with the test account').
The action result.
Navigates the browser to a URL. Convenience over IRemoteBrowserSession.ExecuteAction
with a navigate action.
The absolute URL to load.
The action result (success + resulting URL).
Routes a human takeover input (pointer move/click, key, scroll) into the backend browser.
Capability-gated by HumanTakeover — only valid in Collaborative (and pointer-only
observation in ViewOnly). Backends without it throw.
The human input event; narrow on input.Kind.
Runs an autonomous, goal-driven browser loop (MJ's computer-use) against THIS session's live
browser — the agent sets a high-level goal ("log in and download the latest invoice") and the
computer-use vision/action model plans + executes it, instead of the caller issuing granular
actions. The CDP layer hands its own (already-attached) PlaywrightBrowserAdapter to the engine,
so the loop drives the very page the human is watching (no second browser/CDP attach).
This is the default 'ComputerUse' control strategy; the 'NativeAI' strategy uses
IRemoteBrowserSession.InvokeNativeAIControl instead. resolveControlStrategy picks.
The natural-language goal.
Optionaloptions: RunComputerUseGoalOptionsOptional start URL, step cap, model overrides, and model-blind context.
The goal outcome (success, status, step count, final URL).
Begins streaming the remote browser's tab audio to onChunk (the source for the channel's
client-side audio player) — so a co-agent demoing a video/audio site is HEARD, not just seen.
Capability-gated by BACKEND IMPLEMENTATION (v1): a backend without an audio-capture mechanism
rejects with import('./capability-errors').RemoteBrowserCapabilityNotSupportedError, exactly
like a non-streaming backend rejects IRemoteBrowserSession.StartScreencast. (A future
metadata AudioStreaming feature flag is a documented fast-follow; v1 gates by whether the backend
provides capture.)
Invoked with each encoded RemoteBrowserAudioChunk.
A promise that resolves once the audio stream has started.
Begins streaming encoded viewport frames to onFrame (the source for the channel's ScreenOut
track).
Capability-gated by ScreenStreaming. Backends without it reject.
Invoked with each encoded RemoteBrowserScreencastFrame.
A promise that resolves once the screencast has started.
Stops an audio stream previously started with IRemoteBrowserSession.StartAudioStream.
Capability-gated by BACKEND IMPLEMENTATION (v1). Backends without audio capture reject.
A promise that resolves once streaming has stopped.
Stops a screencast previously started with IRemoteBrowserSession.StartScreencast.
Capability-gated by ScreenStreaming. Backends without it reject.
A promise that resolves once streaming has stopped.
A live handle to a single remote-browser session, returned by import('./base-remote-browser-provider').BaseRemoteBrowserProvider.Connect.
The core methods (
GetCdpEndpoint,Navigate,ExecuteAction,CaptureScreenshot,GetCurrentUrl,Close) rest on the universal CDP substrate every backend provides and are always available. The remaining methods are capability-gated (feature-gated, documented per-method): the engine checks the provider'sSupportedFeaturesflag before calling them, and a backend that cannot satisfy a feature should reject/throw import('./capability-errors').RemoteBrowserCapabilityNotSupportedError.This is a pure interface — the concrete implementation lives in the server package / drivers (which own the Playwright + CDP machinery).