Skip to content
API reference

browser

Kind Export Description
class CloudBrowserUrlDenied The target URL failed policy before any provider call was made.
class CloudBrowserUpstreamError The configured provider answered with a failure or is unreachable.
class CloudBrowserTimeout A call did not complete within its deadline.
class CloudBrowserLeaseNotFound The named lease is not held by this (teamId, agentId, sessionId).
class CloudBrowserLeasePaused A member was asked to take over; the Agent cannot drive it until “Done”.
class CloudBrowserCapacityExceeded The Team has no more concurrent leases available right now.
class CloudBrowserCreditDenied The Team has no credit to start or continue a lease.
class CloudBrowserUnavailable No backend is configured (credentials absent, or the feature is paused).
type alias BrowserMeter One metered execution (a lease or a Quick Read), driven only by createBrowser. maxMs is the execution’s own ceiling: the hold covers it and settlement never exceeds it.
type alias BrowserEvent Code-only observations; never a URL, page text, token or provider body.
type alias BrowserHost The ONE host port for config, billing and provider egress.
type alias BrowserLimits @fungi.computer/oyster/browser: the one agent browser for the Hub and a standalone Oyster. A host builds the port from a provider (browserRunSessions or bindingSessions or onboxBrowserSessions on staging, plus Browser Run Quick Reads when it has them), its required metering owner and an event sink; createBrowser owns lease ownership, egress policy and billing order; browserCapabilitySource is the agent’s cloudBrowser tool. Raw CDP stays internal to this directory.
type alias BrowserMemberAction What a Team member may do to a lease an Agent handed off.
type alias Browser @fungi.computer/oyster/browser: the one agent browser for the Hub and a standalone Oyster. A host builds the port from a provider (browserRunSessions or bindingSessions or onboxBrowserSessions on staging, plus Browser Run Quick Reads when it has them), its required metering owner and an event sink; createBrowser owns lease ownership, egress policy and billing order; browserCapabilitySource is the agent’s cloudBrowser tool. Raw CDP stays internal to this directory.
type alias SaveBrowserFile The host’s door for screenshot/PDF bytes: a named path on a Computer the Agent is attached to. The model only ever receives the saved byte count.
type alias AgentBrowserDoor The agent-facing slice of Browser, possibly behind a host RPC hop.
type alias CdpSocket The minimal WebSocket surface this client drives (a fake in tests). A real WebSocket’s addEventListener structurally satisfies this: the listener accepts any platform Event and readCdpMessage parses a message’s data.
type alias HttpFetch The one fetch shape the module calls: global fetch or a binding’s.
type alias CloudBrowserFailure Every typed failure the browser module throws; nothing else escapes it.
type alias LeaseOwner The one place that binds a cloud-browser lease to the (teamId, agentId, sessionId) that opened it, enforces the per-Team concurrent cap, and times leases out. The provider (sessions.ts) only knows CDP connections; it has no idea which Team or Session owns one. This registry is in-process (one Hub instance): see the report for why a durable, cross-instance counter (the TeamDO-backed shape Computer admission uses) is the better home for this long-term.
type alias MarkdownInput Parsed markdown input.
type alias MarkdownResult Parsed markdown output.
type alias LinksResult Parsed links output.
type alias ScrapeInput Parsed scrape input.
type alias ScrapeResult Parsed scrape output.
type alias ExtractInput Parsed extract input.
type alias ExtractResult Parsed extract output.
type alias OpenResult Parsed open output.
type alias NavigateResult Parsed navigate output.
type alias SnapshotResult Parsed snapshot output.
type alias BinaryResult Raw bytes never cross the Mycelium boundary; only a byte count does.
type alias CloudBrowserOperation Every call the agent tool can make. markdown/links/scrape/extract are stateless Quick Reads (absent on a host without them); open..close share one driven session keyed by leaseId. “screenshot”/“pdf” return raw bytes here; capability-source.ts saves them through the host’s door and hands the model only a byte count.
type alias CloudBrowserAck Acknowledgement of one driven input step.
type alias CloudBrowserClosed Acknowledgement that a lease closed.
type alias CloudBrowserOperationResult What one CloudBrowserOperation returns, before the agent tool shapes it.
type alias BrowserRunQuickReadsConfig The Browser Run account and API token a host’s Quick Reads use.
type alias QuickRead A read’s result and the browser time the provider reports for it, if any.
type alias QuickReads The stateless half of the host port; only browserRunQuickReads builds one. The caller (browser.ts) owns the deadline through signal.
type alias BrowserSessions The provider half of the host port. Each step is separate so createBrowser owns a provider session id from the moment it exists, including when its CDP connect then fails.
type alias BrowserBinding A Workers BROWSER binding (Fetcher), reduced to the call this module makes.
type alias CdpConnect Opens the CDP WebSocket for one provider session URL.
constant CLOUD_BROWSER_DESCRIPTIONS The one source of truth for every cloudBrowser description: the module itself and each operation. cloud-browser-descriptions.test.ts imports this and asserts every entry stays under 1000 characters (the acceptance criterion in issues/retained-features-v1/02-*.md); the guard right below repeats that check at import time so a regression fails fast either way.
constant cloudBrowserBounds The module’s fixed output bounds (characters, links, selectors, bytes).
constant markdownInputSchema Input of markdown: a URL and a character bound.
constant markdownResultSchema Output of markdown: the page text, possibly truncated.
constant linksResultSchema Output of links: bare URL strings, bounded.
constant scrapeInputSchema Input of scrape: a URL and up to ten CSS selectors.
constant scrapeResultSchema Output of scrape: matched elements per selector, bounded.
constant extractInputSchema Input of extract: a URL and a prompt.
constant extractResultSchema Output of extract: JSON-safe structured data.
constant openResultSchema Output of open: the new lease and its first URL.
constant navigateResultSchema Output of navigate: the page’s location after load.
constant snapshotResultSchema Output of snapshot: a bounded accessibility-tree summary.
function createBrowser() @fungi.computer/oyster/browser: the one agent browser for the Hub and a standalone Oyster. A host builds the port from a provider (browserRunSessions or bindingSessions or onboxBrowserSessions on staging, plus Browser Run Quick Reads when it has them), its required metering owner and an event sink; createBrowser owns lease ownership, egress policy and billing order; browserCapabilitySource is the agent’s cloudBrowser tool. Raw CDP stays internal to this directory.
function browserCapabilitySource() Compose the cloudBrowser source for one Session, on either host. browser is the module’s lease door (in-process, or the Hub’s egress RPC); saveFile is the host’s Computer bytes writer and requestHandoff its “needs you” card. A host without one passes null and the matching operations are not offered. A lease needs a Session identity, so a session-free host (e.g. the MCP execute path) gets no module at all.
function browserRunQuickReads() Browser Run’s REST Quick Actions as a host’s QuickReads.
function browserRunSessions() Cloudflare Browser Run over REST with an account token (Hub, any celld host).
function bindingSessions() A standalone Oyster’s own Workers BROWSER binding.
function onboxBrowserSessions() Staging uses Chromium’s native CDP browser contexts; no session store.

The target URL failed policy before any provider call was made.

  • YieldableError<this> & object & Readonly<{ reason: | "invalid_url" | "unsupported_scheme" | "credentials_in_url" | "not_public" | "dns_unavailable"; message: string; }>
Signature
new CloudBrowserUrlDenied(args): CloudBrowserUrlDenied;
Parameter Type
args { reason: | "invalid_url" | "unsupported_scheme" | "credentials_in_url" | "not_public" | "dns_unavailable"; message: string; }
args.reason | "invalid_url" | "unsupported_scheme" | "credentials_in_url" | "not_public" | "dns_unavailable"
args.message string

CloudBrowserUrlDenied

Signature
Data.TaggedError(
"CloudBrowserUrlDenied",
)<{
readonly reason:
| "invalid_url"
| "unsupported_scheme"
| "credentials_in_url"
| "not_public"
| "dns_unavailable";
readonly message: string;
}>.constructor
Signature
readonly reason:
| "invalid_url"
| "unsupported_scheme"
| "credentials_in_url"
| "not_public"
| "dns_unavailable";
Signature
Data.TaggedError("CloudBrowserUrlDenied").reason;
Signature
message: string;
Signature
Data.TaggedError("CloudBrowserUrlDenied").message;

CloudBrowserUpstreamErrorclass

Section titled “CloudBrowserUpstreamError”

The configured provider answered with a failure or is unreachable.

  • YieldableError<this> & object & Readonly<{ op: string; status: number | null; message: string; }>
Signature
new CloudBrowserUpstreamError(args): CloudBrowserUpstreamError;
Parameter Type
args { op: string; status: number | null; message: string; }
args.op string
args.status number | null
args.message string

CloudBrowserUpstreamError

Signature
Data.TaggedError(
"CloudBrowserUpstreamError",
)<{
readonly op: string;
readonly status: number | null;
readonly message: string;
}>.constructor
Signature
readonly op: string;
Signature
Data.TaggedError("CloudBrowserUpstreamError").op;
Signature
readonly status: number | null;
Signature
Data.TaggedError("CloudBrowserUpstreamError").status;
Signature
message: string;
Signature
Data.TaggedError("CloudBrowserUpstreamError").message;

A call did not complete within its deadline.

  • YieldableError<this> & object & Readonly<{ op: string; timeoutMs: number; }>
Signature
new CloudBrowserTimeout(args): CloudBrowserTimeout;
Parameter Type
args { op: string; timeoutMs: number; }
args.op string
args.timeoutMs number

CloudBrowserTimeout

Signature
Data.TaggedError(
"CloudBrowserTimeout",
)<{
readonly op: string;
readonly timeoutMs: number;
}>.constructor
Signature
readonly op: string;
Signature
Data.TaggedError("CloudBrowserTimeout").op;
Signature
readonly timeoutMs: number;
Signature
Data.TaggedError("CloudBrowserTimeout").timeoutMs;

CloudBrowserLeaseNotFoundclass

Section titled “CloudBrowserLeaseNotFound”

The named lease is not held by this (teamId, agentId, sessionId).

  • YieldableError<this> & object & Readonly<{ leaseId: string; }>
Signature
new CloudBrowserLeaseNotFound(args): CloudBrowserLeaseNotFound;
Parameter Type
args { leaseId: string; }
args.leaseId string

CloudBrowserLeaseNotFound

Signature
Data.TaggedError(
"CloudBrowserLeaseNotFound",
)<{
readonly leaseId: string;
}>.constructor
Signature
readonly leaseId: string;
Signature
Data.TaggedError("CloudBrowserLeaseNotFound").leaseId;

A member was asked to take over; the Agent cannot drive it until “Done”.

  • YieldableError<this> & object & Readonly<{ leaseId: string; }>
Signature
new CloudBrowserLeasePaused(args): CloudBrowserLeasePaused;
Parameter Type
args { leaseId: string; }
args.leaseId string

CloudBrowserLeasePaused

Signature
Data.TaggedError(
"CloudBrowserLeasePaused",
)<{
readonly leaseId: string;
}>.constructor
Signature
readonly leaseId: string;
Signature
Data.TaggedError("CloudBrowserLeasePaused").leaseId;

CloudBrowserCapacityExceededclass

Section titled “CloudBrowserCapacityExceeded”

The Team has no more concurrent leases available right now.

  • YieldableError<this> & object & Readonly<{ teamId: string; limit: number; }>
Signature
new CloudBrowserCapacityExceeded(args): CloudBrowserCapacityExceeded;
Parameter Type
args { teamId: string; limit: number; }
args.teamId string
args.limit number

CloudBrowserCapacityExceeded

Signature
Data.TaggedError(
"CloudBrowserCapacityExceeded",
)<{
readonly teamId: string;
readonly limit: number;
}>.constructor
Signature
readonly teamId: string;
Signature
Data.TaggedError("CloudBrowserCapacityExceeded").teamId;
Signature
readonly limit: number;
Signature
Data.TaggedError("CloudBrowserCapacityExceeded").limit;

CloudBrowserCreditDeniedclass

Section titled “CloudBrowserCreditDenied”

The Team has no credit to start or continue a lease.

  • YieldableError<this> & object & Readonly<{ teamId: string; }>
Signature
new CloudBrowserCreditDenied(args): CloudBrowserCreditDenied;
Parameter Type
args { teamId: string; }
args.teamId string

CloudBrowserCreditDenied

Signature
Data.TaggedError(
"CloudBrowserCreditDenied",
)<{
readonly teamId: string;
}>.constructor
Signature
readonly teamId: string;
Signature
Data.TaggedError("CloudBrowserCreditDenied").teamId;

No backend is configured (credentials absent, or the feature is paused).

  • YieldableError<this> & object & Readonly<{ reason: "paused" | "unconfigured"; }>
Signature
new CloudBrowserUnavailable(args): CloudBrowserUnavailable;
Parameter Type
args { reason: "paused" | "unconfigured"; }
args.reason "paused" | "unconfigured"

CloudBrowserUnavailable

Signature
Data.TaggedError(
"CloudBrowserUnavailable",
)<{
readonly reason: "unconfigured" | "paused";
}>.constructor
Signature
readonly reason: "paused" | "unconfigured";
Signature
Data.TaggedError("CloudBrowserUnavailable").reason;

BrowserMetertype alias

Section titled “BrowserMeter”
Signature
type BrowserMeter = Readonly<{
hold: (input) => Promise<void>;
start: (input) => Promise<void>;
settle: (input) => Promise<void>;
release: (input) => Promise<void>;
}>;

One metered execution (a lease or a Quick Read), driven only by createBrowser. maxMs is the execution’s own ceiling: the hold covers it and settlement never exceeds it.


BrowserEventtype alias

Section titled “BrowserEvent”
Signature
type BrowserEvent = Readonly<{
kind:
| "reap_close_failed"
| "reap_settle_failed"
| "settle_failed"
| "open_cleanup_failed"
| "read_release_failed"
| "teardown_failed"
| "teardown_abandoned";
teamId: string;
executionId: string;
cause: unknown;
}>;

Code-only observations; never a URL, page text, token or provider body.


BrowserHosttype alias

Section titled “BrowserHost”
Signature
type BrowserHost = Readonly<{
sessions: BrowserSessions;
quickReads: QuickReads | null;
meter: (owner) => BrowserMeter;
report: (event) => void;
}>;

The ONE host port for config, billing and provider egress.


BrowserLimitstype alias

Section titled “BrowserLimits”
Signature
type BrowserLimits = Readonly<{
maxConcurrentPerTeam: number;
maxLifetimeMs: number;
idleTimeoutMs: number;
navigationTimeoutMs?: number;
closeConfirmMs?: number;
quickReadTimeoutMs?: number;
now?: () => number;
}>;

@fungi.computer/oyster/browser: the one agent browser for the Hub and a standalone Oyster. A host builds the port from a provider (browserRunSessions or bindingSessions or onboxBrowserSessions on staging, plus Browser Run Quick Reads when it has them), its required metering owner and an event sink; createBrowser owns lease ownership, egress policy and billing order; browserCapabilitySource is the agent’s cloudBrowser tool. Raw CDP stays internal to this directory.


BrowserMemberActiontype alias

Section titled “BrowserMemberAction”
Signature
type BrowserMemberAction =
| Readonly<{
kind: "screenshot";
}>
| Readonly<{
kind: "click";
x: number;
y: number;
}>
| Readonly<{
kind: "type";
text: string;
}>
| Readonly<{
kind: "scroll";
deltaX: number;
deltaY: number;
}>
| Readonly<{
kind: "resume";
}>;

What a Team member may do to a lease an Agent handed off.


Signature
type Browser = Readonly<{
quickReads: boolean;
call: (owner, op, signal) => Promise<CloudBrowserOperationResult>;
handoff: (owner, leaseId) => void;
member: (teamId, leaseId, action, signal) => Promise<BinaryResult | null>;
}>;

@fungi.computer/oyster/browser: the one agent browser for the Hub and a standalone Oyster. A host builds the port from a provider (browserRunSessions or bindingSessions or onboxBrowserSessions on staging, plus Browser Run Quick Reads when it has them), its required metering owner and an event sink; createBrowser owns lease ownership, egress policy and billing order; browserCapabilitySource is the agent’s cloudBrowser tool. Raw CDP stays internal to this directory.


SaveBrowserFiletype alias

Section titled “SaveBrowserFile”
Signature
type SaveBrowserFile = (input) => Promise<
Readonly<{
computerId: string;
path: string;
bytes: number;
}>
>;

The host’s door for screenshot/PDF bytes: a named path on a Computer the Agent is attached to. The model only ever receives the saved byte count.

Parameter Type
input Readonly<{ computerId: string; path: string; bytes: Uint8Array; contentType: string; }>

Promise<Readonly<{ computerId: string; path: string; bytes: number; }>>


AgentBrowserDoortype alias

Section titled “AgentBrowserDoor”
Signature
type AgentBrowserDoor = Readonly<{
call: (owner, op, signal) => Promise<CloudBrowserOperationResult>;
handoff: (owner, leaseId) => Promise<void>;
}>;

The agent-facing slice of Browser, possibly behind a host RPC hop.


CdpSockettype alias

Section titled “CdpSocket”
Signature
type CdpSocket = Readonly<{
send: (data) => void;
close: (code?, reason?) => void;
addEventListener: (type, listener) => void;
}>;

The minimal WebSocket surface this client drives (a fake in tests). A real WebSocket’s addEventListener structurally satisfies this: the listener accepts any platform Event and readCdpMessage parses a message’s data.


HttpFetchtype alias

Section titled “HttpFetch”
Signature
type HttpFetch = (url, init?) => Promise<Response>;

The one fetch shape the module calls: global fetch or a binding’s.

Parameter Type
url string
init? RequestInit

Promise<Response>


CloudBrowserFailuretype alias

Section titled “CloudBrowserFailure”
Signature
type CloudBrowserFailure =
| CloudBrowserUrlDenied
| CloudBrowserUpstreamError
| CloudBrowserTimeout
| CloudBrowserLeaseNotFound
| CloudBrowserLeasePaused
| CloudBrowserCapacityExceeded
| CloudBrowserCreditDenied
| CloudBrowserUnavailable;

Every typed failure the browser module throws; nothing else escapes it.


LeaseOwnertype alias

Section titled “LeaseOwner”
Signature
type LeaseOwner = Readonly<{
teamId: string;
agentId: string;
sessionId: string;
}>;

The one place that binds a cloud-browser lease to the (teamId, agentId, sessionId) that opened it, enforces the per-Team concurrent cap, and times leases out. The provider (sessions.ts) only knows CDP connections; it has no idea which Team or Session owns one. This registry is in-process (one Hub instance): see the report for why a durable, cross-instance counter (the TeamDO-backed shape Computer admission uses) is the better home for this long-term.


MarkdownInputtype alias

Section titled “MarkdownInput”
Signature
type MarkdownInput = z.output<typeof markdownInputSchema>;

Parsed markdown input.


MarkdownResulttype alias

Section titled “MarkdownResult”
Signature
type MarkdownResult = z.output<typeof markdownResultSchema>;

Parsed markdown output.


LinksResulttype alias

Section titled “LinksResult”
Signature
type LinksResult = z.output<typeof linksResultSchema>;

Parsed links output.


ScrapeInputtype alias

Section titled “ScrapeInput”
Signature
type ScrapeInput = z.output<typeof scrapeInputSchema>;

Parsed scrape input.


ScrapeResulttype alias

Section titled “ScrapeResult”
Signature
type ScrapeResult = z.output<typeof scrapeResultSchema>;

Parsed scrape output.


ExtractInputtype alias

Section titled “ExtractInput”
Signature
type ExtractInput = z.output<typeof extractInputSchema>;

Parsed extract input.


ExtractResulttype alias

Section titled “ExtractResult”
Signature
type ExtractResult = z.output<typeof extractResultSchema>;

Parsed extract output.


OpenResulttype alias

Section titled “OpenResult”
Signature
type OpenResult = z.output<typeof openResultSchema>;

Parsed open output.


Section titled “NavigateResult”
Signature
type NavigateResult = z.output<typeof navigateResultSchema>;

Parsed navigate output.


SnapshotResulttype alias

Section titled “SnapshotResult”
Signature
type SnapshotResult = z.output<typeof snapshotResultSchema>;

Parsed snapshot output.


BinaryResulttype alias

Section titled “BinaryResult”
Signature
type BinaryResult = Readonly<{
leaseId: string;
bytes: Uint8Array;
contentType: string;
}>;

Raw bytes never cross the Mycelium boundary; only a byte count does.


CloudBrowserOperationtype alias

Section titled “CloudBrowserOperation”
Signature
type CloudBrowserOperation =
| Readonly<{
kind: "markdown";
input: MarkdownInput;
}>
| Readonly<{
kind: "links";
url: string;
}>
| Readonly<{
kind: "scrape";
input: ScrapeInput;
}>
| Readonly<{
kind: "extract";
input: ExtractInput;
}>
| Readonly<{
kind: "open";
url: string | null;
}>
| Readonly<{
kind: "navigate";
leaseId: string;
url: string;
}>
| Readonly<{
kind: "snapshot";
leaseId: string;
}>
| Readonly<{
kind: "click";
leaseId: string;
x: number;
y: number;
}>
| Readonly<{
kind: "type";
leaseId: string;
text: string;
}>
| Readonly<{
kind: "press";
leaseId: string;
key: string;
}>
| Readonly<{
kind: "scroll";
leaseId: string;
deltaX: number;
deltaY: number;
}>
| Readonly<{
kind: "screenshot";
leaseId: string;
}>
| Readonly<{
kind: "pdf";
leaseId: string;
}>
| Readonly<{
kind: "close";
leaseId: string;
}>;

Every call the agent tool can make. markdown/links/scrape/extract are stateless Quick Reads (absent on a host without them); open..close share one driven session keyed by leaseId. “screenshot”/“pdf” return raw bytes here; capability-source.ts saves them through the host’s door and hands the model only a byte count.


CloudBrowserAcktype alias

Section titled “CloudBrowserAck”
Signature
type CloudBrowserAck = Readonly<{
leaseId: string;
}>;

Acknowledgement of one driven input step.


CloudBrowserClosedtype alias

Section titled “CloudBrowserClosed”
Signature
type CloudBrowserClosed = Readonly<{
leaseId: string;
closed: true;
provider: "closed" | "closing";
}>;

Acknowledgement that a lease closed.


CloudBrowserOperationResulttype alias

Section titled “CloudBrowserOperationResult”
Signature
type CloudBrowserOperationResult =
| MarkdownResult
| LinksResult
| ScrapeResult
| ExtractResult
| OpenResult
| NavigateResult
| SnapshotResult
| CloudBrowserAck
| BinaryResult
| CloudBrowserClosed;

What one CloudBrowserOperation returns, before the agent tool shapes it.


BrowserRunQuickReadsConfigtype alias

Section titled “BrowserRunQuickReadsConfig”
Signature
type BrowserRunQuickReadsConfig = Readonly<{
accountId: string;
apiToken: string;
fetch?: HttpFetch;
}>;

The Browser Run account and API token a host’s Quick Reads use.


QuickReadtype alias

Section titled “QuickRead”
Signature
type QuickRead<Result> = Readonly<{
result: Result;
browserMs: number | null;
}>;

A read’s result and the browser time the provider reports for it, if any.

Type Parameter
Result

QuickReadstype alias

Section titled “QuickReads”
Signature
type QuickReads = Readonly<{
markdown: (url, maxChars, signal) => Promise<QuickRead<MarkdownResult>>;
links: (url, signal) => Promise<QuickRead<LinksResult>>;
scrape: (url, selectors, signal) => Promise<QuickRead<ScrapeResult>>;
extract: (url, prompt, signal) => Promise<QuickRead<ExtractResult>>;
}>;

The stateless half of the host port; only browserRunQuickReads builds one. The caller (browser.ts) owns the deadline through signal.


BrowserSessionstype alias

Section titled “BrowserSessions”
Signature
type BrowserSessions = Readonly<{}>;

The provider half of the host port. Each step is separate so createBrowser owns a provider session id from the moment it exists, including when its CDP connect then fails.


BrowserBindingtype alias

Section titled “BrowserBinding”
Signature
type BrowserBinding = Readonly<{
fetch: HttpFetch;
}>;

A Workers BROWSER binding (Fetcher), reduced to the call this module makes.


CdpConnecttype alias

Section titled “CdpConnect”
Signature
type CdpConnect = (url, headers, signal) => Promise<CdpSocket>;

Opens the CDP WebSocket for one provider session URL.

Parameter Type
url string
headers Readonly<Record<string, string>>
signal AbortSignal

Promise<CdpSocket>

CLOUD_BROWSER_DESCRIPTIONSconstant

Section titled “CLOUD_BROWSER_DESCRIPTIONS”
Signature
const CLOUD_BROWSER_DESCRIPTIONS: Readonly<{
module: string;
markdown: "Render a JavaScript page and return it as markdown, truncated to maxChars (default 20000).";
links: "Render a page and return up to 500 links found on it.";
scrape: "Render a page and return matched elements for up to 10 CSS selectors, bounded to 64 KiB.";
extract: "Render a page and extract structured data matching a prompt.";
open: "Open a driven browser session, optionally navigating to a URL, and return its leaseId.";
navigate: "Navigate an open session's page to a URL.";
snapshot: "Read an open session's page as a bounded accessibility-tree text summary.";
click: "Click at a viewport pixel coordinate in an open session.";
type: "Insert text at the current focus in an open session.";
press: 'Press one key (e.g. "Enter", "Tab") in an open session.';
scroll: "Scroll an open session's page by a pixel delta.";
screenshot: "Capture a PNG screenshot of an open session's page and save it to a Computer path; returns the saved byte count, never the bytes.";
pdf: "Render an open session's page to PDF and save it to a Computer path; returns the saved byte count, never the bytes.";
handoff: "Ask a Team member to take over an open session for a login or captcha; a card appears in the conversation and the run continues once they finish.";
close: "End a driven session and release its lease.";
}>;

The one source of truth for every cloudBrowser description: the module itself and each operation. cloud-browser-descriptions.test.ts imports this and asserts every entry stays under 1000 characters (the acceptance criterion in issues/retained-features-v1/02-*.md); the guard right below repeats that check at import time so a regression fails fast either way.


cloudBrowserBoundsconstant

Section titled “cloudBrowserBounds”
Signature
const cloudBrowserBounds: Readonly<{
maxChars: 50000;
defaultMarkdownChars: 20000;
maxLinks: 500;
maxSelectors: 10;
maxScrapeBytes: number;
maxSnapshotBytes: number;
maxScreenshotBytes: number;
maxPdfBytes: number;
}>;

The module’s fixed output bounds (characters, links, selectors, bytes).


markdownInputSchemaconstant

Section titled “markdownInputSchema”
Signature
const markdownInputSchema: ZodObject<
{
url: ZodURL;
maxChars: ZodDefault<ZodNumber>;
},
$strict
>;

Input of markdown: a URL and a character bound.


markdownResultSchemaconstant

Section titled “markdownResultSchema”
Signature
const markdownResultSchema: ZodObject<
{
url: ZodString;
text: ZodString;
truncated: ZodBoolean;
},
$strict
>;

Output of markdown: the page text, possibly truncated.


linksResultSchemaconstant

Section titled “linksResultSchema”
Signature
const linksResultSchema: ZodObject<
{
url: ZodString;
links: ZodArray<ZodString>;
truncated: ZodBoolean;
},
$strict
>;

Output of links: bare URL strings, bounded.


scrapeInputSchemaconstant

Section titled “scrapeInputSchema”
Signature
const scrapeInputSchema: ZodObject<
{
url: ZodURL;
selectors: ZodArray<ZodString>;
},
$strict
>;

Input of scrape: a URL and up to ten CSS selectors.


scrapeResultSchemaconstant

Section titled “scrapeResultSchema”
Signature
const scrapeResultSchema: ZodObject<
{
url: ZodString;
result: ZodArray<
ZodObject<
{
selector: ZodString;
elements: ZodArray<
ZodObject<
{
text: ZodString;
html: ZodString;
},
$strict
>
>;
},
$strict
>
>;
truncated: ZodBoolean;
},
$strict
>;

Output of scrape: matched elements per selector, bounded.


extractInputSchemaconstant

Section titled “extractInputSchema”
Signature
const extractInputSchema: ZodObject<
{
url: ZodURL;
prompt: ZodString;
},
$strict
>;

Input of extract: a URL and a prompt.


extractResultSchemaconstant

Section titled “extractResultSchema”
Signature
const extractResultSchema: ZodObject<
{
url: ZodString;
result: ZodJSONSchema;
},
$strict
>;

Output of extract: JSON-safe structured data.


openResultSchemaconstant

Section titled “openResultSchema”
Signature
const openResultSchema: ZodObject<
{
leaseId: ZodString;
url: ZodNullable<ZodString>;
},
$strict
>;

Output of open: the new lease and its first URL.


Section titled “navigateResultSchema”
Signature
const navigateResultSchema: ZodObject<
{
leaseId: ZodString;
url: ZodString;
status: ZodNullable<ZodNumber>;
title: ZodNullable<ZodString>;
},
$strict
>;

Output of navigate: the page’s location after load.


snapshotResultSchemaconstant

Section titled “snapshotResultSchema”
Signature
const snapshotResultSchema: ZodObject<
{
leaseId: ZodString;
tree: ZodString;
truncated: ZodBoolean;
},
$strict
>;

Output of snapshot: a bounded accessibility-tree summary.

createBrowser()function

Section titled “createBrowser()”
Signature
function createBrowser(host, limits): Browser;

@fungi.computer/oyster/browser: the one agent browser for the Hub and a standalone Oyster. A host builds the port from a provider (browserRunSessions or bindingSessions or onboxBrowserSessions on staging, plus Browser Run Quick Reads when it has them), its required metering owner and an event sink; createBrowser owns lease ownership, egress policy and billing order; browserCapabilitySource is the agent’s cloudBrowser tool. Raw CDP stays internal to this directory.

Parameter Type
host BrowserHost
limits BrowserLimits

Browser


browserCapabilitySource()function

Section titled “browserCapabilitySource()”
Signature
function browserCapabilitySource(deps): CapabilitySource;

Compose the cloudBrowser source for one Session, on either host. browser is the module’s lease door (in-process, or the Hub’s egress RPC); saveFile is the host’s Computer bytes writer and requestHandoff its “needs you” card. A host without one passes null and the matching operations are not offered. A lease needs a Session identity, so a session-free host (e.g. the MCP execute path) gets no module at all.

Parameter Type
deps Readonly<{ identity: () => | Readonly<{ teamId: string; agentId: string; }> | null; browser: AgentBrowserDoor; quickReads: boolean; saveFile: SaveBrowserFile | null; requestHandoff: ((sessionId, reason) => void) | null; }>

CapabilitySource


browserRunQuickReads()function

Section titled “browserRunQuickReads()”
Signature
function browserRunQuickReads(config): QuickReads;

Browser Run’s REST Quick Actions as a host’s QuickReads.

Parameter Type
config BrowserRunQuickReadsConfig

QuickReads


browserRunSessions()function

Section titled “browserRunSessions()”
Signature
function browserRunSessions(config): BrowserSessions;

Cloudflare Browser Run over REST with an account token (Hub, any celld host).

Parameter Type
config Readonly<{ accountId: string; apiToken: string; fetch?: HttpFetch; connect?: CdpConnect; }>

BrowserSessions


bindingSessions()function

Section titled “bindingSessions()”
Signature
function bindingSessions(binding): BrowserSessions;

A standalone Oyster’s own Workers BROWSER binding.

Parameter Type
binding BrowserBinding

BrowserSessions


onboxBrowserSessions()function

Section titled “onboxBrowserSessions()”
Signature
function onboxBrowserSessions(origin, fetcher?): BrowserSessions;

Staging uses Chromium’s native CDP browser contexts; no session store.

Parameter Type
origin string
fetcher HttpFetch

BrowserSessions