UNPKG

@gui-agent/operator-browser

Version:
68 lines 2.56 kB
import { Page } from '@agent-infra/browser'; import { Logger } from '@agent-infra/logger'; import { BaseAction } from '@gui-agent/shared/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); showWaterFlow(): Promise<void>; private showWaterFlowInner; hideWaterFlow(): Promise<void>; private hideWaterFlowInner; /** * 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>; private highlightClickableElementsInner; /** * Removes highlighting from clickable elements */ removeClickableHighlights(): Promise<void>; private removeClickableHighlightsInner; /** * Displays information about the current action being performed * @param prediction The parsed prediction containing action details */ showActionInfo(action: BaseAction, thought: string): Promise<void>; showActionInfoInternal(action_type: string, action_inputs: Record<string, unknown>, thought: string): 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>; private showClickIndicatorInner; /** * 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>; private showDragIndicatorInner; cleanupTemporaryVisuals(): Promise<void>; /** * Removes all UI helper elements from the page */ cleanup(): Promise<void>; /** * Injects required CSS styles into the page * Creates styling for action indicators and information panels */ private injectStyles; } //# sourceMappingURL=ui-helper.d.ts.map