/** * Browser Tool — Chrome DevTools Protocol (CDP) integration. * * This provides browser automation capabilities: * - Page navigation * - Element interaction (click, type, select) * - JavaScript execution * - Screenshot capture * - PDF generation * - Network interception * - Cookie management * - Local storage access * - Dialog handling * - Multi-tab support * - Headless mode * - Proxy support * - User agent rotation * * Better than Hermes: * - Full CDP protocol support * - Built-in rate limiting * - Automatic retry on failures * - Detailed error reporting * - Integration with skill system */ export interface BrowserConfig { /** Browser executable path */ executablePath?: string; /** Headless mode (default: true) */ headless?: boolean; /** Window size */ viewport?: { width: number; height: number; }; /** Proxy configuration */ proxy?: { server: string; username?: string; password?: string; }; /** User agent */ userAgent?: string; /** Slow motion delay (ms) */ slowMo?: number; /** Default timeout (ms) */ timeout?: number; /** Chrome arguments */ args?: string[]; } export interface NavigateOptions { /** URL to navigate to */ url: string; /** Wait until event (load, domcontentloaded, networkidle) */ waitUntil?: 'load' | 'domcontentloaded' | 'networkidle'; /** Timeout (ms) */ timeout?: number; } export interface ClickOptions { /** Selector or element description */ selector: string; /** Click type (left, right, middle) */ button?: 'left' | 'right' | 'middle'; /** Number of clicks */ clickCount?: number; /** Delay between clicks (ms) */ delay?: number; } export interface TypeOptions { /** Selector or element description */ selector: string; /** Text to type */ text: string; /** Delay between keystrokes (ms) */ delay?: number; } export interface ScreenshotOptions { /** Output file path */ path?: string; /** Full page screenshot */ fullPage?: boolean; /** Clip region */ clip?: { x: number; y: number; width: number; height: number; }; /** Image quality (1-100) */ quality?: number; } export interface BrowserResult { success: boolean; data?: any; error?: string; durationMs: number; } export declare class BrowserTool { private process; private config; private cdpPort; private sessionId; constructor(config?: BrowserConfig); /** * Launch browser instance. */ launch(): Promise; /** * Navigate to a URL. */ navigate(options: NavigateOptions): Promise; /** * Click an element. */ click(options: ClickOptions): Promise; /** * Type text into an element. */ type(options: TypeOptions): Promise; /** * Execute JavaScript in the page. */ evaluate(expression: string): Promise; /** * Take a screenshot. */ screenshot(options?: ScreenshotOptions): Promise; /** * Get page content. */ getContent(): Promise; /** * Get page title. */ getTitle(): Promise; /** * Get current URL. */ getUrl(): Promise; /** * Set cookie. */ setCookie(cookie: { name: string; value: string; domain?: string; path?: string; expires?: number; httpOnly?: boolean; secure?: boolean; sameSite?: 'Strict' | 'Lax' | 'None'; }): Promise; /** * Get cookies. */ getCookies(): Promise; /** * Delete cookie. */ deleteCookie(name: string, domain?: string, path?: string): Promise; /** * Get local storage. */ getLocalStorage(): Promise; /** * Set local storage item. */ setLocalStorage(key: string, value: string): Promise; /** * Wait for element to appear. */ waitForSelector(selector: string, timeout?: number): Promise; /** * Close browser. */ close(): Promise; private findChrome; private buildArgs; private waitForCdp; private cdpCommand; private querySelector; private getBoundingBox; private focus; private waitForLoad; private waitForNetworkIdle; private sleep; } /** * Get or create browser instance. */ export declare function getBrowser(config?: BrowserConfig): Promise; /** * Close browser instance. */ export declare function closeBrowser(): Promise; /** * Execute a browser-based skill. */ export declare function executeBrowserSkill(skillContent: string, options?: { url?: string; actions?: Array<{ type: string; params: any; }>; }): Promise; //# sourceMappingURL=browser-tool.d.ts.map