/** * Playwright command implementations — used when Chrome extension CDP is available. * Falls back to injected client RPC commands when extension is not connected. * * Each function maps an MCP tool command to the equivalent Playwright API call. * Based on @xmorse/playwright-core with getExistingCDPSession pattern from Playwriter. */ import type { Page } from '@xmorse/playwright-core'; import type { CDPRelay } from './cdp-relay.js'; /** * Try to execute a browser command via Playwright. * Returns the result if CDP is available, or null to signal fallback to RPC. * * @param serverPort - dev server port to match against page URLs for multi-tab targeting */ export declare function tryPlaywrightCommand(relay: CDPRelay | undefined, method: string, params?: any, serverPort?: number): Promise; /** Cached ref entry for resolving ref-based actions */ export interface RefEntry { role: string; name: string; backendDOMNodeId?: number; } /** * Take an a11y snapshot with ref IDs for interactive elements. * Caches refs on the relay for subsequent ref-based actions. */ export declare function pwA11ySnapshot(relay: CDPRelay, page: Page, params?: any): Promise; /** * Resolve a ref (e.g. "e3") to a Playwright locator action. * Uses cached refs from the last a11y_snapshot call. */ export declare function resolveRef(relay: CDPRelay, page: Page, ref: string): Promise; //# sourceMappingURL=playwright-commands.d.ts.map