infrastructure

package
v0.181.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: Apache-2.0 Imports: 23 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 ExtensionBridge

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

ExtensionBridge hosts the localhost WebSocket endpoint the opentask browser extension dials into. It implements browserdomain.BrowserDriver by forwarding the browser-use verbs to the connected extension, and it mirrors the chat conversation to the extension (AG-UI event stream out, user messages in).

ponytail: one connection, one implied tab - multi-tab / multi-CLI routing when someone actually needs it.

func NewExtensionBridge

func NewExtensionBridge(cfg *config.BrowserUseConfig, notifier agentdomain.UINotifier, repo convdomain.ConversationRepository, events agentdomain.EventBridge, skills agentdomain.SkillsService, sessionID, artifactsDir string) *ExtensionBridge

NewExtensionBridge builds the bridge. notifier, repo, events, and skills may be nil (the matching feature is then skipped); cfg must not be nil. 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) SetToolExecution added in v0.181.0

func (b *ExtensionBridge) SetToolExecution(toolSvc agentdomain.ToolService, approval agentdomain.ApprovalPolicy, models convdomain.ModelService, defaultModel string)

SetToolExecution wires the deps answering tool_request and list_models frames - after construction, because the container builds the bridge before the tool and model services exist. Any argument may be nil/empty.

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