import { type Browser, type Page } from 'playwright';
import type { PlaywrightHandle } from './types';
export declare const pages: Map<string, Page>;
/** Allocate a unique page ID (shared across both playwright servers). */
export declare function allocatePageId(): string;
export declare function ensureBrowser(): Promise<Browser>;
/**
 * Resolve a page from either a local `page_id`, a `_handle`, or "most recent".
 * Handles cross-container reconnection via CDP when needed.
 */
export declare function resolvePage(args: {
    page_id?: string;
    _handle?: PlaywrightHandle;
}): Promise<{
    page: Page;
    pageId: string;
}>;
/**
 * Build a _handle for a page. Includes CDP endpoint when available
 * (for cross-container access in distributed deployments).
 */
export declare function buildHandle(pageId: string): PlaywrightHandle;
/**
 * Shut down the shared browser and release all pages.
 */
export declare function stopPlaywrightServer(): Promise<void>;
