Open Agent Loops
API Reference

BrowserSession

@open-agent-loops/core


Defined in: tools/builtin/builtin.types.ts:521

The browser capability seam — implement this against a real browser.

Remarks

Unlike every other seam here, this is stateful: it drives one persistent page (cookies, history, scroll position) across calls, so each method mutates a live session rather than answering an isolated request. Wire it to e.g. Playwright / Puppeteer driving Chromium, or a hosted browser (Browserbase, computer-use).

SECURITY: navigate dereferences a model-supplied URL with the same SSRF / exfiltration surface as WebBackend.fetch, and a live session carries cookies and credentials from prior steps. Route the resulting tools through the permission gate (../../permissions) before granting them to a model you do not fully trust.

See

Methods

click()

click(ref, ctx): Promise<BrowserSnapshot>;

Defined in: tools/builtin/builtin.types.ts:537

Click the element identified by ref and return the resulting page.

Parameters

ParameterTypeDescription
refstringA ref from the current snapshot's elements.
ctxToolContextPer-call context; ctx.signal may be used to abort the click.

Returns

Promise<BrowserSnapshot>

A snapshot of the page after the click.


navigate(url, ctx): Promise<BrowserSnapshot>;

Defined in: tools/builtin/builtin.types.ts:529

Navigate to a URL and return the resulting page.

Parameters

ParameterTypeDescription
urlstringAbsolute URL to load.
ctxToolContextPer-call context; ctx.signal may be used to abort the navigation.

Returns

Promise<BrowserSnapshot>

A snapshot of the loaded page.


type()

type(
   ref, 
   text, 
ctx): Promise<BrowserSnapshot>;

Defined in: tools/builtin/builtin.types.ts:546

Type text into the element identified by ref and return the resulting page.

Parameters

ParameterTypeDescription
refstringA ref from the current snapshot's elements (a text field).
textstringThe text to type into it.
ctxToolContextPer-call context; ctx.signal may be used to abort the input.

Returns

Promise<BrowserSnapshot>

A snapshot of the page after typing.

On this page