import type { ReclaimClient } from '@reclaimprotocol/client/api'; import { type CdpHandles, connectCdp, connectCdpUrl } from '../../../cdp/client.ts'; import { dockerAvailable, startContainer } from '../../../cdp/container.ts'; import type { ConfigStore } from '../../../config/store.ts'; import { type RegisteredTool } from '../../server.ts'; export type BrowserMode = 'dedicated' | 'attach' | 'builder' | 'custom' | 'container'; /** * Modes with a live view that `share_browser_view` can put behind a public URL. * * Only `container`: it runs the Reclaim browser runtime, whose viewer already * serves on loopback, so sharing is a tunnel in front of it. `builder` gives a * hosted `liveViewUrl` instead, and a plain local browser has nothing to * show — one on this machine is watched by looking at it. */ export declare const SHAREABLE_MODES: Set; export interface AttachState { handles: CdpHandles; mode: BrowserMode; port?: number; liveViewUrl?: string; browserSessionId?: string; orgId?: string; /** The hosted Builder browser's TEE API base — lets * `run_proof_via_pod` prove through the SAME enclave that holds the * browser's TLS session (and its country-routed egress), instead of the * local in-process attestor SDK. */ apiUrl?: string; /** The exit country this remote browser was allocated with, if any. */ countryCode?: string; /** Docker's name for a `container`-mode browser, for diagnostics. */ containerName?: string; /** Loopback port the container's own live viewer serves on, which is what * `share_browser_view` tunnels. Never the CDP port. */ viewerPort?: number; /** Whether the runtime image had to be downloaded on this attach. */ imagePulled?: boolean; disposeRemote?: () => Promise; } export interface AttachRef { current?: AttachState; config: ConfigStore; } interface AttachDependencies { connectLocal: typeof connectCdp; connectRemote: typeof connectCdpUrl; /** Injected so container mode is testable without Docker installed. */ dockerAvailable: typeof dockerAvailable; startContainer: typeof startContainer; } export declare function attachTool(state: AttachRef, builderClient?: ReclaimClient, beforeReplace?: () => Promise, dependencies?: Partial): RegisteredTool; export declare function disposeAttached(state: AttachRef): Promise; export {};