import * as z from "zod"; export declare const DEFAULT_ACTION_TIMEOUT_MS = 30000; export declare const BrowserTransportPreferenceSchema: z.ZodEnum<{ auto: "auto"; playwright: "playwright"; relay: "relay"; }>; declare const BrowserVideoSizeSchema: z.ZodObject<{ width: z.ZodNumber; height: z.ZodNumber; }, z.core.$strip>; export declare const BrowserSessionVideoRecordingSchema: z.ZodUnion; size: z.ZodOptional>; }, z.core.$strip>]>; export declare const BrowserActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"navigate">; url: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"url">; url: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"open">; url: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"goto">; url: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"click">; selector: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"type">; selector: z.ZodString; text: z.ZodString; submit: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"press">; key: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"wait">; ms: z.ZodOptional; selector: z.ZodOptional; url: z.ZodOptional; load: z.ZodOptional>; fn: z.ZodOptional; timeoutMs: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"ms">; ms: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"sleep">; ms: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"pause">; ms: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ selector: z.ZodOptional; url: z.ZodOptional; load: z.ZodOptional>; fn: z.ZodOptional; timeoutMs: z.ZodOptional; type: z.ZodLiteral<"wait_for">; }, z.core.$strip>, z.ZodObject<{ selector: z.ZodOptional; url: z.ZodOptional; load: z.ZodOptional>; fn: z.ZodOptional; timeoutMs: z.ZodOptional; type: z.ZodLiteral<"wait_until">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"extract_text">; selector: z.ZodOptional; maxChars: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"selector">; selector: z.ZodString; maxChars: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"extract">; selector: z.ZodOptional; maxChars: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"getContent">; selector: z.ZodOptional; maxChars: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"get_content">; selector: z.ZodOptional; maxChars: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"querySelector">; selector: z.ZodOptional; maxChars: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"query_selector">; selector: z.ZodOptional; maxChars: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"screenshot">; path: z.ZodOptional; fullPage: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"path">; path: z.ZodString; fullPage: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"snapshot">; path: z.ZodString; fullPage: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"capture">; path: z.ZodString; fullPage: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"evaluate">; expression: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"expression">; expression: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"js">; expression: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"script">; expression: z.ZodString; }, z.core.$strip>], "type">; export declare const BrowserControlInputSchema: z.ZodObject<{ url: z.ZodOptional; actions: z.ZodDefault; url: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"url">; url: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"open">; url: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"goto">; url: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"click">; selector: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"type">; selector: z.ZodString; text: z.ZodString; submit: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"press">; key: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"wait">; ms: z.ZodOptional; selector: z.ZodOptional; url: z.ZodOptional; load: z.ZodOptional>; fn: z.ZodOptional; timeoutMs: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"ms">; ms: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"sleep">; ms: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"pause">; ms: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ selector: z.ZodOptional; url: z.ZodOptional; load: z.ZodOptional>; fn: z.ZodOptional; timeoutMs: z.ZodOptional; type: z.ZodLiteral<"wait_for">; }, z.core.$strip>, z.ZodObject<{ selector: z.ZodOptional; url: z.ZodOptional; load: z.ZodOptional>; fn: z.ZodOptional; timeoutMs: z.ZodOptional; type: z.ZodLiteral<"wait_until">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"extract_text">; selector: z.ZodOptional; maxChars: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"selector">; selector: z.ZodString; maxChars: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"extract">; selector: z.ZodOptional; maxChars: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"getContent">; selector: z.ZodOptional; maxChars: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"get_content">; selector: z.ZodOptional; maxChars: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"querySelector">; selector: z.ZodOptional; maxChars: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"query_selector">; selector: z.ZodOptional; maxChars: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"screenshot">; path: z.ZodOptional; fullPage: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"path">; path: z.ZodString; fullPage: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"snapshot">; path: z.ZodString; fullPage: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"capture">; path: z.ZodString; fullPage: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"evaluate">; expression: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"expression">; expression: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"js">; expression: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"script">; expression: z.ZodString; }, z.core.$strip>], "type">>>>; headless: z.ZodOptional; timeoutMs: z.ZodDefault>; executablePath: z.ZodOptional; transport: z.ZodOptional>; }, z.core.$strip>; export declare const BrowserSessionActionInputSchema: z.ZodObject<{ session_id: z.ZodString; url: z.ZodOptional; actions: z.ZodDefault; url: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"url">; url: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"open">; url: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"goto">; url: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"click">; selector: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"type">; selector: z.ZodString; text: z.ZodString; submit: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"press">; key: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"wait">; ms: z.ZodOptional; selector: z.ZodOptional; url: z.ZodOptional; load: z.ZodOptional>; fn: z.ZodOptional; timeoutMs: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"ms">; ms: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"sleep">; ms: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"pause">; ms: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ selector: z.ZodOptional; url: z.ZodOptional; load: z.ZodOptional>; fn: z.ZodOptional; timeoutMs: z.ZodOptional; type: z.ZodLiteral<"wait_for">; }, z.core.$strip>, z.ZodObject<{ selector: z.ZodOptional; url: z.ZodOptional; load: z.ZodOptional>; fn: z.ZodOptional; timeoutMs: z.ZodOptional; type: z.ZodLiteral<"wait_until">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"extract_text">; selector: z.ZodOptional; maxChars: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"selector">; selector: z.ZodString; maxChars: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"extract">; selector: z.ZodOptional; maxChars: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"getContent">; selector: z.ZodOptional; maxChars: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"get_content">; selector: z.ZodOptional; maxChars: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"querySelector">; selector: z.ZodOptional; maxChars: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"query_selector">; selector: z.ZodOptional; maxChars: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"screenshot">; path: z.ZodOptional; fullPage: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"path">; path: z.ZodString; fullPage: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"snapshot">; path: z.ZodString; fullPage: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"capture">; path: z.ZodString; fullPage: z.ZodDefault>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"evaluate">; expression: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"expression">; expression: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"js">; expression: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"script">; expression: z.ZodString; }, z.core.$strip>], "type">>>>; timeoutMs: z.ZodDefault>; }, z.core.$strip>; export type BrowserControlInput = z.infer; export type BrowserSessionVideoRecordingInput = z.infer; export type BrowserSessionActionInput = z.infer; export type BrowserAction = z.infer; export type BrowserTransportPreference = z.infer; export type BrowserVideoSize = z.infer; type BrowserVideoLike = { path: () => Promise; }; export type BrowserPageLike = { goto: (url: string, options?: { waitUntil?: "domcontentloaded"; timeout?: number; }) => Promise; bringToFront?: () => Promise; click: (selector: string, options?: { timeout?: number; }) => Promise; fill: (selector: string, text: string, options?: { timeout?: number; }) => Promise; keyboard: { press: (key: string) => Promise; }; waitForTimeout: (ms: number) => Promise; waitForSelector?: (selector: string, options?: { state?: "attached" | "detached" | "visible" | "hidden"; timeout?: number; }) => Promise; waitForURL?: (url: string | RegExp, options?: { timeout?: number; waitUntil?: "load" | "domcontentloaded" | "networkidle"; }) => Promise; waitForLoadState?: (state?: "load" | "domcontentloaded" | "networkidle", options?: { timeout?: number; }) => Promise; waitForFunction?: (expression: string, arg?: unknown, options?: { timeout?: number; }) => Promise; textContent: (selector: string, options?: { timeout?: number; }) => Promise; evaluate: (expression: string) => Promise; screenshot: (options: { path: string; fullPage?: boolean; }) => Promise; video?: () => BrowserVideoLike | null; title: () => Promise; url: () => string; }; export type BrowserContextLike = { pages: () => BrowserPageLike[]; newPage: () => Promise; close?: () => Promise; }; type BrowserLike = { contexts: () => BrowserContextLike[]; close: () => Promise; }; type LaunchPersistentContextOptions = { executablePath?: string; headless?: boolean; timeout?: number; args?: string[]; ignoreDefaultArgs?: string[]; recordVideo?: { dir: string; size?: BrowserVideoSize; }; }; type PlaywrightLike = { chromium: { connectOverCDP: (wsEndpoint: string, options?: { timeout?: number; }) => Promise; launchPersistentContext?: (userDataDir: string, options?: LaunchPersistentContextOptions) => Promise; }; }; interface StartChromeInput { executablePath?: string; headless: boolean; launchTimeoutMs: number; userDataDir: string; chromeArgs?: string[]; } interface StartedChromeSession { wsEndpoint: string; close: () => Promise; } export type BrowserRuntimeTransport = "cdp" | "persistent-context" | "relay-cdp"; type BrowserRelayRuntimeConfig = { enabled?: boolean; host?: string; port?: number; requireAuth?: boolean; authToken?: string; }; type ResolvedBrowserRelayConfig = { host: string; port: number; requireAuth: boolean; authToken?: string; }; export interface BrowserControlDependencies { importPlaywright: () => Promise; startChrome: (input: StartChromeInput) => Promise; resolveRelayWsEndpoint: (config: ResolvedBrowserRelayConfig, timeoutMs: number) => Promise; mkTempDir: () => string; removeDir: (target: string) => void; now: () => number; } export interface BrowserControlToolOptions { workspace?: string; configWorkspace?: string; launchTimeoutMs?: number; defaultExecutablePath?: string; browserProfile?: string; browserTransport?: BrowserTransportPreference; relayConfig?: BrowserRelayRuntimeConfig; profilesRootDir?: string; profilePaths?: Record; browserExtensions?: string[]; extensionsRootDir?: string; extensionPaths?: Record; defaultExtensions?: string[]; preferPersistentLaunch?: boolean; } export type BrowserUserDataDirSelection = { userDataDir: string; persistentProfile: boolean; profileId?: string; releaseLock?: () => void; }; type BrowserVideoRecordingSelection = { dirAbsolute: string; dirRelative: string; size?: BrowserVideoSize; }; type BrowserVideoRecordingRuntime = BrowserVideoRecordingSelection & { handles: Set; }; export interface BrowserGeneratedMedia { kind: "image" | "video"; source: "screenshot" | "video-recording"; path: string; relativePath: string; uri: string; url: string; mimeType: string; name: string; fullPage?: boolean; actionIndex?: number | null; } export interface BrowserVideoRecordingSummary { enabled: boolean; state: "inactive" | "recording" | "saved"; dir: string | null; size: BrowserVideoSize | null; videoCount: number; } export interface BrowserSessionRuntime { workspace: string; configWorkspace: string; now: () => number; headless: boolean; context: BrowserContextLike; activePage: BrowserPageLike | null; userDataDirSelection: BrowserUserDataDirSelection; browserTransport: BrowserRuntimeTransport; transportRequested: BrowserTransportPreference; transportFallbackReason: string | null; reusedExistingCdpSession: boolean; extensionIds: string[]; launchedContext: BrowserContextLike | null; browser: BrowserLike | null; chromeSession: StartedChromeSession | null; videoRecording: BrowserVideoRecordingRuntime | null; closed: boolean; } export interface BrowserExecutionSummary { browser: "chrome-cdp" | "chrome-playwright" | "chrome-relay"; transport: BrowserRuntimeTransport; transportRequested: BrowserTransportPreference; transportUsed: BrowserRuntimeTransport; fallbackReason: string | null; mode: "headless" | "headed"; persistentProfile: boolean; profileId: string | null; profilePath: string | null; reusedExistingSession: boolean; executionWorkspace: string; configWorkspace: string; extensions: string[]; finalUrl: string; title: string; actionResults: Record[]; media: BrowserGeneratedMedia[]; videoRecording: BrowserVideoRecordingSummary | null; } type BrowserSessionOpenInput = Partial> & { recordVideo?: BrowserSessionVideoRecordingInput; }; type BrowserSessionExecutionInput = Partial>; export declare const createBrowserDependencies: (dependencies?: Partial) => BrowserControlDependencies; export declare function clearStaleDevtoolsArtifacts(userDataDir: string): void; export declare function runBrowserAction(page: BrowserPageLike, action: BrowserAction, timeoutMs: number, workspace: string, now: () => number, actionIndex: number): Promise>; export declare function openBrowserSessionRuntime(options?: BrowserControlToolOptions, dependencies?: Partial, input?: BrowserSessionOpenInput): Promise; export declare function executeBrowserSessionRuntime(runtime: BrowserSessionRuntime, input?: BrowserSessionExecutionInput): Promise; export declare function closeBrowserSessionRuntime(runtime: BrowserSessionRuntime, dependencies?: Partial): Promise<{ media: BrowserGeneratedMedia[]; videoRecording: BrowserVideoRecordingSummary | null; }>; export {};