/** * Weavetab — tools/dialog.ts * Auto-handles JavaScript alert/confirm/prompt dialogs via CDP Page API. * Weavetab by fy2ne */ import CDP from "chrome-remote-interface"; export interface DialogResult { success: true; dialog_type: string; message: string; accepted: boolean; } export declare function hasOpenDialog(session: CDP.Client): boolean; /** Register the auto-dismiss handler for the given CDP session. */ export declare function initDialogHandler(session: CDP.Client): void; /** * Manually trigger dialog handling — call this if the agent suspects * a dialog is pending that blocked previous tool calls. */ export interface DialogOptions { action: "accept" | "dismiss"; promptText?: string; } export declare function browserDialog(session: CDP.Client, options: DialogOptions): Promise;