Documentation
¶
Index ¶
- func NewSession(cfg *config.BrowserUseConfig) *browserSession
- type ExtensionBridge
- func (b *ExtensionBridge) Addr() string
- func (b *ExtensionBridge) Click(ctx context.Context, selector string) (browserdomain.BrowserToolResult, error)
- func (b *ExtensionBridge) ClickAt(_ context.Context, _, _ float64) (browserdomain.BrowserToolResult, error)
- func (b *ExtensionBridge) Close()
- func (b *ExtensionBridge) Navigate(ctx context.Context, url string) (browserdomain.BrowserToolResult, error)
- func (b *ExtensionBridge) Read(ctx context.Context, selector string) (browserdomain.BrowserToolResult, error)
- func (b *ExtensionBridge) Screenshot(ctx context.Context) (browserdomain.BrowserScreenshotResult, error)
- func (b *ExtensionBridge) Start() error
- func (b *ExtensionBridge) Tabs(ctx context.Context) ([]browserdomain.BrowserTab, error)
- func (b *ExtensionBridge) Type(ctx context.Context, selector, text string, pressEnter bool) (browserdomain.BrowserToolResult, error)
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 ¶
func (b *ExtensionBridge) Click(ctx context.Context, selector string) (browserdomain.BrowserToolResult, error)
Click implements browserdomain.BrowserDriver.
func (*ExtensionBridge) ClickAt ¶
func (b *ExtensionBridge) ClickAt(_ context.Context, _, _ float64) (browserdomain.BrowserToolResult, error)
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 ¶
func (b *ExtensionBridge) Navigate(ctx context.Context, url string) (browserdomain.BrowserToolResult, error)
Navigate implements browserdomain.BrowserDriver.
func (*ExtensionBridge) Read ¶
func (b *ExtensionBridge) Read(ctx context.Context, selector string) (browserdomain.BrowserToolResult, error)
Read implements browserdomain.BrowserDriver.
func (*ExtensionBridge) Screenshot ¶
func (b *ExtensionBridge) Screenshot(ctx context.Context) (browserdomain.BrowserScreenshotResult, error)
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 ¶
func (b *ExtensionBridge) Tabs(ctx context.Context) ([]browserdomain.BrowserTab, error)
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.