/** * browser-manager.ts * * Manages the lifecycle of a single Chromium browser instance used by the * Playwright Pilot AI MCP server for live-browser analysis and test execution. * * The server keeps one BrowserManager instance alive for the duration of its * process. Tools like pwpilot_launch_browser, pwpilot_analyze_page, * and pwpilot_heal_test all share this single browser instance through * the MCP server's shared state. * * The browser always launches in headed mode (visible window) so users can * observe the automation while it runs. * * Role in the overall flow: * MCP server (shared state) → BrowserManager → DOMAnalyzer / PageObserver / HealingEngine */ import { Page } from 'playwright'; /** * Wraps a single Playwright Chromium browser, context, and page so that * every MCP tool shares the same session without needing to relaunch. */ export declare class BrowserManager { private browser; private context; private page; /** * Launch a new Chromium browser and open a blank page. * If a browser is already open, this replaces the existing session. * * @param headless - When true, runs without a visible window. * Defaults to false (headed) so users can watch the browser. * @returns The newly created Playwright Page. */ launch(headless?: boolean): Promise; /** * Navigate the current page to a URL and wait for the DOM to load. * * @param url - The full URL to navigate to. * @throws Error if the browser has not been launched yet. */ navigate(url: string): Promise; /** * Return the currently active Playwright Page. * * @returns The active Page. * @throws Error if the browser has not been launched yet. */ getPage(): Page; /** * Save a full-page PNG screenshot to the specified file path. * * @param filePath - Absolute path where the PNG file should be written. * @throws Error if the browser has not been launched yet. */ screenshot(filePath: string): Promise; /** * Close the browser and release all resources. * After this call, isOpen() returns false and getPage() will throw until * launch() is called again. */ close(): Promise; /** * Check whether the browser is currently open and a page is available. * * @returns True if a page is available, false otherwise. */ isOpen(): boolean; } //# sourceMappingURL=browser-manager.d.ts.map