import { LocalBrowser, RemoteBrowser } from '@agent-infra/browser'; import { ConsoleLogger } from '@tarko/mcp-agent'; /** * FIXME: remove `lastLaunchOptions` * * BrowserManager - Singleton manager for Local Browser instance * * This class implements the Singleton pattern to ensure only one browser instance * exists across the application. It provides: * * 1. Lazy initialization - browser only launches when first needed * 2. Lifecycle management - handling browser creation, verification and cleanup * 3. Global access - consistent access point to shared browser instance */ export declare class BrowserManager { private static instance; private browser; private isLaunched; private logger; lastLaunchOptions: { headless?: boolean; cdpEndpoint?: string; }; private isRecoveryInProgress; private constructor(); /** * Get the singleton instance of BrowserManager */ static getInstance(logger: ConsoleLogger): BrowserManager; /** * Get the browser instance, creating it if it doesn't exist */ getBrowser(): LocalBrowser | RemoteBrowser; /** * Launch the browser with specified options */ launchBrowser(options?: { headless?: boolean; cdpEndpoint?: string; }): Promise; /** * Check if the browser is launched */ isLaunchingComplete(): boolean; /** * Check if the browser is alive and recover it if needed * @param autoRecover Whether to automatically recover the browser if it's not alive * @returns True if the browser is alive or successfully recovered, false otherwise */ isBrowserAlive(autoRecover?: boolean): Promise; /** * Recover browser after it was killed or crashed * @returns True if recovery was successful, false otherwise */ recoverBrowser(): Promise; /** * Close all browser pages but keep the browser instance alive * This is useful for cleaning up between tasks without needing to relaunch the browser */ closeAllPages(): Promise; /** * Close the browser instance */ closeBrowser(): Promise; /** * Reset the browser manager state (for testing purposes) */ static resetInstance(): void; } //# sourceMappingURL=browser-manager.d.ts.map