browser
Exports
Section titled “Exports”| 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. |
CloudBrowserUrlDeniedclass
Section titled “CloudBrowserUrlDenied”The target URL failed policy before any provider call was made.
Extends
Section titled “Extends”YieldableError<this> &object&Readonly<{reason: |"invalid_url"|"unsupported_scheme"|"credentials_in_url"|"not_public"|"dns_unavailable";message:string; }>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CloudBrowserUrlDenied(args): CloudBrowserUrlDenied;Parameters
Section titled “Parameters”| 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 |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Data.TaggedError( "CloudBrowserUrlDenied",)<{ readonly reason: | "invalid_url" | "unsupported_scheme" | "credentials_in_url" | "not_public" | "dns_unavailable"; readonly message: string;}>.constructorProperties
Section titled “Properties”reason
Section titled “reason”readonly reason: | "invalid_url" | "unsupported_scheme" | "credentials_in_url" | "not_public" | "dns_unavailable";Inherited from
Section titled “Inherited from”Data.TaggedError("CloudBrowserUrlDenied").reason;message
Section titled “message”message: string;Inherited from
Section titled “Inherited from”Data.TaggedError("CloudBrowserUrlDenied").message;CloudBrowserUpstreamErrorclass
Section titled “CloudBrowserUpstreamError”The configured provider answered with a failure or is unreachable.
Extends
Section titled “Extends”YieldableError<this> &object&Readonly<{op:string;status:number|null;message:string; }>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CloudBrowserUpstreamError(args): CloudBrowserUpstreamError;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
args |
{ op: string; status: number | null; message: string; } |
args.op |
string |
args.status |
number | null |
args.message |
string |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Data.TaggedError( "CloudBrowserUpstreamError",)<{ readonly op: string; readonly status: number | null; readonly message: string;}>.constructorProperties
Section titled “Properties”readonly op: string;Inherited from
Section titled “Inherited from”Data.TaggedError("CloudBrowserUpstreamError").op;status
Section titled “status”readonly status: number | null;Inherited from
Section titled “Inherited from”Data.TaggedError("CloudBrowserUpstreamError").status;message
Section titled “message”message: string;Inherited from
Section titled “Inherited from”Data.TaggedError("CloudBrowserUpstreamError").message;CloudBrowserTimeoutclass
Section titled “CloudBrowserTimeout”A call did not complete within its deadline.
Extends
Section titled “Extends”YieldableError<this> &object&Readonly<{op:string;timeoutMs:number; }>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CloudBrowserTimeout(args): CloudBrowserTimeout;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
args |
{ op: string; timeoutMs: number; } |
args.op |
string |
args.timeoutMs |
number |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Data.TaggedError( "CloudBrowserTimeout",)<{ readonly op: string; readonly timeoutMs: number;}>.constructorProperties
Section titled “Properties”readonly op: string;Inherited from
Section titled “Inherited from”Data.TaggedError("CloudBrowserTimeout").op;timeoutMs
Section titled “timeoutMs”readonly timeoutMs: number;Inherited from
Section titled “Inherited from”Data.TaggedError("CloudBrowserTimeout").timeoutMs;CloudBrowserLeaseNotFoundclass
Section titled “CloudBrowserLeaseNotFound”The named lease is not held by this (teamId, agentId, sessionId).
Extends
Section titled “Extends”YieldableError<this> &object&Readonly<{leaseId:string; }>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CloudBrowserLeaseNotFound(args): CloudBrowserLeaseNotFound;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
args |
{ leaseId: string; } |
args.leaseId |
string |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Data.TaggedError( "CloudBrowserLeaseNotFound",)<{ readonly leaseId: string;}>.constructorProperties
Section titled “Properties”leaseId
Section titled “leaseId”readonly leaseId: string;Inherited from
Section titled “Inherited from”Data.TaggedError("CloudBrowserLeaseNotFound").leaseId;CloudBrowserLeasePausedclass
Section titled “CloudBrowserLeasePaused”A member was asked to take over; the Agent cannot drive it until “Done”.
Extends
Section titled “Extends”YieldableError<this> &object&Readonly<{leaseId:string; }>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CloudBrowserLeasePaused(args): CloudBrowserLeasePaused;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
args |
{ leaseId: string; } |
args.leaseId |
string |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Data.TaggedError( "CloudBrowserLeasePaused",)<{ readonly leaseId: string;}>.constructorProperties
Section titled “Properties”leaseId
Section titled “leaseId”readonly leaseId: string;Inherited from
Section titled “Inherited from”Data.TaggedError("CloudBrowserLeasePaused").leaseId;CloudBrowserCapacityExceededclass
Section titled “CloudBrowserCapacityExceeded”The Team has no more concurrent leases available right now.
Extends
Section titled “Extends”YieldableError<this> &object&Readonly<{teamId:string;limit:number; }>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CloudBrowserCapacityExceeded(args): CloudBrowserCapacityExceeded;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
args |
{ teamId: string; limit: number; } |
args.teamId |
string |
args.limit |
number |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Data.TaggedError( "CloudBrowserCapacityExceeded",)<{ readonly teamId: string; readonly limit: number;}>.constructorProperties
Section titled “Properties”teamId
Section titled “teamId”readonly teamId: string;Inherited from
Section titled “Inherited from”Data.TaggedError("CloudBrowserCapacityExceeded").teamId;readonly limit: number;Inherited from
Section titled “Inherited from”Data.TaggedError("CloudBrowserCapacityExceeded").limit;CloudBrowserCreditDeniedclass
Section titled “CloudBrowserCreditDenied”The Team has no credit to start or continue a lease.
Extends
Section titled “Extends”YieldableError<this> &object&Readonly<{teamId:string; }>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CloudBrowserCreditDenied(args): CloudBrowserCreditDenied;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
args |
{ teamId: string; } |
args.teamId |
string |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Data.TaggedError( "CloudBrowserCreditDenied",)<{ readonly teamId: string;}>.constructorProperties
Section titled “Properties”teamId
Section titled “teamId”readonly teamId: string;Inherited from
Section titled “Inherited from”Data.TaggedError("CloudBrowserCreditDenied").teamId;CloudBrowserUnavailableclass
Section titled “CloudBrowserUnavailable”No backend is configured (credentials absent, or the feature is paused).
Extends
Section titled “Extends”YieldableError<this> &object&Readonly<{reason:"paused"|"unconfigured"; }>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CloudBrowserUnavailable(args): CloudBrowserUnavailable;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
args |
{ reason: "paused" | "unconfigured"; } |
args.reason |
"paused" | "unconfigured" |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Data.TaggedError( "CloudBrowserUnavailable",)<{ readonly reason: "unconfigured" | "paused";}>.constructorProperties
Section titled “Properties”reason
Section titled “reason”readonly reason: "paused" | "unconfigured";Inherited from
Section titled “Inherited from”Data.TaggedError("CloudBrowserUnavailable").reason;BrowserMetertype alias
Section titled “BrowserMeter”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”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”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”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”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.
Browsertype alias
Section titled “Browser”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”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
Readonly<{ computerId: string; path: string; bytes: Uint8Array; contentType: string; }> |
Returns
Section titled “Returns”Promise<Readonly<{ computerId: string; path: string; bytes:
number; }>>
AgentBrowserDoortype alias
Section titled “AgentBrowserDoor”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”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”type HttpFetch = (url, init?) => Promise<Response>;The one fetch shape the module calls: global fetch or a binding’s.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
url |
string |
init? |
RequestInit |
Returns
Section titled “Returns”Promise<Response>
CloudBrowserFailuretype alias
Section titled “CloudBrowserFailure”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”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”type MarkdownInput = z.output<typeof markdownInputSchema>;Parsed markdown input.
MarkdownResulttype alias
Section titled “MarkdownResult”type MarkdownResult = z.output<typeof markdownResultSchema>;Parsed markdown output.
LinksResulttype alias
Section titled “LinksResult”type LinksResult = z.output<typeof linksResultSchema>;Parsed links output.
ScrapeInputtype alias
Section titled “ScrapeInput”type ScrapeInput = z.output<typeof scrapeInputSchema>;Parsed scrape input.
ScrapeResulttype alias
Section titled “ScrapeResult”type ScrapeResult = z.output<typeof scrapeResultSchema>;Parsed scrape output.
ExtractInputtype alias
Section titled “ExtractInput”type ExtractInput = z.output<typeof extractInputSchema>;Parsed extract input.
ExtractResulttype alias
Section titled “ExtractResult”type ExtractResult = z.output<typeof extractResultSchema>;Parsed extract output.
OpenResulttype alias
Section titled “OpenResult”type OpenResult = z.output<typeof openResultSchema>;Parsed open output.
NavigateResulttype alias
Section titled “NavigateResult”type NavigateResult = z.output<typeof navigateResultSchema>;Parsed navigate output.
SnapshotResulttype alias
Section titled “SnapshotResult”type SnapshotResult = z.output<typeof snapshotResultSchema>;Parsed snapshot output.
BinaryResulttype alias
Section titled “BinaryResult”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”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”type CloudBrowserAck = Readonly<{ leaseId: string;}>;Acknowledgement of one driven input step.
CloudBrowserClosedtype alias
Section titled “CloudBrowserClosed”type CloudBrowserClosed = Readonly<{ leaseId: string; closed: true; provider: "closed" | "closing";}>;Acknowledgement that a lease closed.
CloudBrowserOperationResulttype alias
Section titled “CloudBrowserOperationResult”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”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”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 Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
Result |
QuickReadstype alias
Section titled “QuickReads”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”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”type BrowserBinding = Readonly<{ fetch: HttpFetch;}>;A Workers BROWSER binding (Fetcher), reduced to the call this module makes.
CdpConnecttype alias
Section titled “CdpConnect”type CdpConnect = (url, headers, signal) => Promise<CdpSocket>;Opens the CDP WebSocket for one provider session URL.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
url |
string |
headers |
Readonly<Record<string, string>> |
signal |
AbortSignal |
Returns
Section titled “Returns”Promise<CdpSocket>
CLOUD_BROWSER_DESCRIPTIONSconstant
Section titled “CLOUD_BROWSER_DESCRIPTIONS”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”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”const markdownInputSchema: ZodObject< { url: ZodURL; maxChars: ZodDefault<ZodNumber>; }, $strict>;Input of markdown: a URL and a character bound.
markdownResultSchemaconstant
Section titled “markdownResultSchema”const markdownResultSchema: ZodObject< { url: ZodString; text: ZodString; truncated: ZodBoolean; }, $strict>;Output of markdown: the page text, possibly truncated.
linksResultSchemaconstant
Section titled “linksResultSchema”const linksResultSchema: ZodObject< { url: ZodString; links: ZodArray<ZodString>; truncated: ZodBoolean; }, $strict>;Output of links: bare URL strings, bounded.
scrapeInputSchemaconstant
Section titled “scrapeInputSchema”const scrapeInputSchema: ZodObject< { url: ZodURL; selectors: ZodArray<ZodString>; }, $strict>;Input of scrape: a URL and up to ten CSS selectors.
scrapeResultSchemaconstant
Section titled “scrapeResultSchema”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”const extractInputSchema: ZodObject< { url: ZodURL; prompt: ZodString; }, $strict>;Input of extract: a URL and a prompt.
extractResultSchemaconstant
Section titled “extractResultSchema”const extractResultSchema: ZodObject< { url: ZodString; result: ZodJSONSchema; }, $strict>;Output of extract: JSON-safe structured data.
openResultSchemaconstant
Section titled “openResultSchema”const openResultSchema: ZodObject< { leaseId: ZodString; url: ZodNullable<ZodString>; }, $strict>;Output of open: the new lease and its first URL.
navigateResultSchemaconstant
Section titled “navigateResultSchema”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”const snapshotResultSchema: ZodObject< { leaseId: ZodString; tree: ZodString; truncated: ZodBoolean; }, $strict>;Output of snapshot: a bounded accessibility-tree summary.
createBrowser()function
Section titled “createBrowser()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
host |
BrowserHost |
limits |
BrowserLimits |
Returns
Section titled “Returns”browserCapabilitySource()function
Section titled “browserCapabilitySource()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
deps |
Readonly<{ identity: () => | Readonly<{ teamId: string; agentId: string; }> | null; browser: AgentBrowserDoor; quickReads: boolean; saveFile: SaveBrowserFile | null; requestHandoff: ((sessionId, reason) => void) | null; }> |
Returns
Section titled “Returns”CapabilitySource
browserRunQuickReads()function
Section titled “browserRunQuickReads()”function browserRunQuickReads(config): QuickReads;Browser Run’s REST Quick Actions as a host’s QuickReads.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
config |
BrowserRunQuickReadsConfig |
Returns
Section titled “Returns”browserRunSessions()function
Section titled “browserRunSessions()”function browserRunSessions(config): BrowserSessions;Cloudflare Browser Run over REST with an account token (Hub, any celld host).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
config |
Readonly<{ accountId: string; apiToken: string; fetch?: HttpFetch; connect?: CdpConnect; }> |
Returns
Section titled “Returns”bindingSessions()function
Section titled “bindingSessions()”function bindingSessions(binding): BrowserSessions;A standalone Oyster’s own Workers BROWSER binding.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
binding |
BrowserBinding |
Returns
Section titled “Returns”onboxBrowserSessions()function
Section titled “onboxBrowserSessions()”function onboxBrowserSessions(origin, fetcher?): BrowserSessions;Staging uses Chromium’s native CDP browser contexts; no session store.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
origin |
string |
fetcher |
HttpFetch |