/** * Leaper Agent – Browser Supervisor * Browser lifecycle management, multi-tab, screenshot queue, resource cleanup. */ import type { ToolDefinition } from './registry.js'; export type DialogType = 'alert' | 'confirm' | 'prompt' | 'beforeunload'; export type DialogPolicy = 'accept' | 'dismiss' | 'ignore'; export type FrameType = 'mainFrame' | 'subFrame' | 'worker' | 'oopif'; export interface PendingDialog { type: DialogType; message: string; frame_id: string; timestamp: string; } export interface DialogRecord extends PendingDialog { response: string | null; dismissed: boolean; resolved_at: string; } export interface FrameInfo { frame_id: string; parent_id?: string; url: string; type: FrameType; session_id?: string; title?: string; } export interface SupervisorSnapshot { task_id: string; frames: FrameInfo[]; pending_dialogs: PendingDialog[]; dialog_history: DialogRecord[]; console_events: Array<{ level: string; text: string; timestamp: string; }>; } export interface SupervisorOptions { task_id: string; cdp_url?: string; dialog_policy?: DialogPolicy; max_frames?: number; max_console_events?: number; } export declare class CDPSupervisor { readonly taskId: string; private cdpUrl; private dialogPolicy; private maxFrames; private maxConsoleEvents; private frames; private pendingDialogs; private dialogHistory; private consoleEvents; private running; constructor(opts: SupervisorOptions); isRunning(): boolean; start(): void; stop(): void; addFrame(frame: FrameInfo): void; removeFrame(frameId: string): void; addConsoleEvent(level: string, text: string): void; addPendingDialog(dialog: PendingDialog): void; resolveDialog(frameId: string, response?: string | null): DialogRecord | null; snapshot(): SupervisorSnapshot; } declare class SupervisorRegistry { private supervisors; get(taskId: string): CDPSupervisor | undefined; start(opts: SupervisorOptions): CDPSupervisor; stop(taskId: string): boolean; stopAll(): void; list(): string[]; } export declare const supervisorRegistry: SupervisorRegistry; export declare const browserSupervisorTool: ToolDefinition; export {}; //# sourceMappingURL=browser-supervisor.d.ts.map