import type { Browser, Page } from "puppeteer-core"; import type { ZodTypeAny } from "zod"; export interface McpResult { content: Array<{ type: "text"; text: string; } | { type: "image"; data: string; mimeType: string; }>; isError?: boolean; } export interface Tool { description: string; inputSchema: Record; handler: (args: Record) => Promise; } export interface BrowserConfig { apiKey: string; baseUrl: string; defaultProfileId?: string; defaultProfileOrigin?: "env" | "header" | "query"; } export interface BrowserEntry { sessionId: string; browser: Browser; page: Page; expiresAt: string; recording: boolean; cdpEndpoint: string; } export interface BrowserRegistry { sessions: Map; } export declare const text: (o: unknown) => McpResult; export declare const MAX_PAGE_TEXT = 30000; export declare const MAX_LINKS = 200; export declare const CDP_DIAL_ATTEMPTS = 3; export declare const HANDOFF_POLL_MS = 2000; export declare const redact: (s: string) => string; export declare function api(cfg: BrowserConfig, method: string, path: string, body?: unknown): Promise; export declare function apiError(res: Response, what: string): Promise; export declare function resolveProfileRef(cfg: BrowserConfig, apiFn: typeof api, raw: string): Promise; export declare function releaseBrowserSession(cfg: BrowserConfig, id: string, fetchApi?: typeof api): Promise; export declare function reconcileBrowserReg(cfg: BrowserConfig, reg: BrowserRegistry, fetchApi?: typeof api): Promise; export interface BrowserDeps { connect: (cdpEndpoint: string) => Promise; fetchApi: typeof api; } export interface BrowserToolCtx { cfg: BrowserConfig; reg: BrowserRegistry; deps: BrowserDeps; api: typeof api; need: (id: string) => Promise; activePage: (e: BrowserEntry) => Promise; capText: (s: string, what: string) => string; }