/** * element-info.ts — Extracts Playwright-friendly element information from the page. * * Used by BrowserSession to enrich action logs with CSS selectors, element types, * and text content so that chat AI can reproduce user interactions via Playwright. */ import type { Page } from 'playwright'; /** Structured information about a DOM element */ export interface ElementInfo { /** Best CSS selector for Playwright (e.g., '#submit-btn', 'button:has-text("Login")') */ selector: string; /** Tag name (e.g., 'button', 'input', 'a') */ tagName: string; /** Element type attribute for input/button (e.g., 'text', 'submit', 'checkbox') */ type?: string; /** Visible text content (truncated) */ text?: string; /** Role attribute or implicit ARIA role */ role?: string; /** name, placeholder, aria-label, or title attribute */ label?: string; /** href for links */ href?: string; } /** * Get element info at the given coordinates via page.evaluate(). * Returns null if no element found or on error. */ export declare function getElementAtPoint(page: Page, x: number, y: number): Promise; /** * Get info about the currently focused element. * Returns null if no element is focused or on error. */ export declare function getFocusedElementInfo(page: Page): Promise; /** * Get the CSS `cursor` value of the element at the given coordinates. * * Returns 'default' when no element is at the point or the computed cursor is * empty/non-string. Unlike getElementAtPoint, this does NOT swallow evaluate * errors: it re-throws so the caller (mouse-move handler) can skip sending a * cursor update for that frame instead of reporting a misleading 'default'. */ export declare function getCursorAt(page: Page, x: number, y: number): Promise; /** * Format ElementInfo into a human-readable, Playwright-actionable string. */ export declare function formatElementInfo(info: ElementInfo): string; //# sourceMappingURL=element-info.d.ts.map