import type { Page, BrowserContext } from 'playwright-core'; import type { Settings } from '../config/types.js'; import type { PageInfo, CreatePageResult, SessionInfo } from './types.js'; /** * BrowserManager handles browser lifecycle, session management, and page management. * Provides a clean interface for MCP tools to interact with Camoufox. */ export declare class BrowserManager { private state; private settings; /** * Initialize the browser manager with settings. * This will auto-download Camoufox if not installed. */ initialize(settings: Settings): Promise; /** * Check if the browser is initialized. */ isInitialized(): boolean; /** * Get the list of registered context file paths from settings. */ getRegisteredContextPaths(): string[]; /** * Create a new isolated session (BrowserContext). * Optionally inject cookies/localStorage from a context file. */ createSession(options?: { name?: string; contextPath?: string; }): Promise; /** * Get a session's BrowserContext by ID. */ getSession(sessionId: string): BrowserContext | undefined; /** * List all sessions with their info. */ listSessions(): SessionInfo[]; /** * Close a session and all its pages. */ closeSession(sessionId: string): Promise; /** * Get the session ID for a given page. */ getSessionForPage(pageId: string): string | undefined; /** * Get the active session ID. */ getActiveSessionId(): string | null; /** * Set the active session. */ setActiveSession(sessionId: string): void; /** * Ensure a default session exists, creating one if needed. */ private ensureDefaultSession; /** * Create a new page/tab within a session. */ createPage(url?: string, sessionId?: string): Promise; /** * Get a page by ID. */ getPage(pageId: string): Page | undefined; /** * Get the active page. */ getActivePage(): Page | undefined; /** * Get the active page ID. */ getActivePageId(): string | null; /** * Set the active page. */ setActivePage(pageId: string): void; /** * Close a page by ID. */ closePage(pageId: string): Promise; /** * List all pages. */ listPages(): Promise; /** * Get page count. */ getPageCount(): number; /** * Shutdown the browser manager. */ shutdown(): Promise; /** * Ensure browser is initialized, throw if not. */ private ensureInitialized; } export declare const browserManager: BrowserManager; //# sourceMappingURL=manager.d.ts.map