UNPKG

@ui-tars/operator-browser

Version:
61 lines 2.19 kB
import { Page } from '@agent-infra/browser'; import { Logger } from '@agent-infra/logger'; import { ParsedPrediction } from './types'; /** * Helper class for UI interactions in the browser * Provides visual feedback for actions and information display */ export declare class UIHelper { private getCurrentPage; private logger; private styleId; private containerId; private highlightClass; private waterFlowId; /** * Creates a new UIHelper instance * @param getCurrentPage Function that returns the current active page */ constructor(getCurrentPage: () => Promise<Page>, logger: Logger); /** * Injects required CSS styles into the page * Creates styling for action indicators and information panels */ private injectStyles; /** * Displays information about the current action being performed * @param prediction The parsed prediction containing action details */ showActionInfo(prediction: ParsedPrediction): Promise<void>; /** * Shows a visual click indicator at the specified coordinates * @param x X coordinate for the click * @param y Y coordinate for the click */ showClickIndicator(x: number, y: number): Promise<void>; showWaterFlow(): Promise<void>; hideWaterFlow(): Promise<void>; /** * Highlights all clickable elements on the page using SoM-inspired approach * Should be called before taking a screenshot to show interactive elements */ highlightClickableElements(): Promise<void>; /** * Removes highlighting from clickable elements */ removeClickableHighlights(): Promise<void>; cleanupTemporaryVisuals(): Promise<void>; /** * Removes all UI helper elements from the page */ cleanup(): Promise<void>; /** * Shows a visual drag indicator from start to end coordinates * @param startX Starting X coordinate * @param startY Starting Y coordinate * @param endX Ending X coordinate * @param endY Ending Y coordinate */ showDragIndicator(startX: number, startY: number, endX: number, endY: number): Promise<void>; } //# sourceMappingURL=ui-helper.d.ts.map