infrastructure

package
v0.218.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSession

func NewSession(cfg *config.BrowserUseConfig) *browserSession

Types

type Deps added in v0.218.0

Deps are the collaborators the bridge and its panel units use. The container builds every one of them before the bridge, so nothing is wired late and no capability is optional.

type ExtensionBridge

type ExtensionBridge struct {
	// contains filtered or unexported fields
}

ExtensionBridge hosts the localhost WebSocket endpoint the opentask browser extension dials into. It owns the connection, implements browserdomain.BrowserDriver by forwarding the browser-use verbs to the extension, and routes every other frame to the panel unit that owns it.

func NewExtensionBridge

func NewExtensionBridge(deps Deps) *ExtensionBridge

NewExtensionBridge builds the bridge and its panel units, one unit per frame family, so each unit holds only the dependencies it uses. artifactsDir, when non-empty, is served read-only at /artifacts/ so the panel can display generated images the agent saved locally.

func (*ExtensionBridge) Addr

func (b *ExtensionBridge) Addr() string

Addr returns the actual listen address (useful with port 0 in tests).

func (*ExtensionBridge) Click

Click implements browserdomain.BrowserDriver.

func (*ExtensionBridge) ClickAt

ClickAt implements browserdomain.BrowserDriver. The extension bridge drives clicks through chrome.scripting (untrusted synthetic events), which have no reliable viewport-coordinate form - that needs chrome.debugger/CDP. Fail clearly.

func (*ExtensionBridge) Close

func (b *ExtensionBridge) Close()

Close implements browserdomain.BrowserDriver: shuts the server and any connection.

func (*ExtensionBridge) Navigate

Navigate implements browserdomain.BrowserDriver.

func (*ExtensionBridge) Read

Read implements browserdomain.BrowserDriver.

func (*ExtensionBridge) Screenshot

Screenshot implements browserdomain.BrowserDriver via the extension's captureVisibleTab.

func (*ExtensionBridge) Start

func (b *ExtensionBridge) Start() error

Start listens on 127.0.0.1:<port> and serves the /ws endpoint. Errors are also stored so later tool calls surface them instead of a silent no-op.

func (*ExtensionBridge) Tabs

Tabs implements browserdomain.BrowserDriver via the extension's chrome.tabs query.

func (*ExtensionBridge) Type

func (b *ExtensionBridge) Type(ctx context.Context, selector, text string, pressEnter bool) (browserdomain.BrowserToolResult, error)

Type implements browserdomain.BrowserDriver.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL