export interface BrowserObservation { observationId: string; url: string; title: string; textSummary: string; interactive: InteractiveElement[]; status: BrowserPageStatus; warnings: string[]; screenshotPath: string | null; capturedAt: string; } export interface BrowserPageStatus { httpStatus: number | null; loadingState: 'idle' | 'loading' | 'navigating'; hasDialog: boolean; consoleErrors: number; } export interface InteractiveElement { id: string; role: string; label: string; kind: string | null; value: string | null; state: InteractiveElementState; bbox: BoundingBox; selector?: string; } export interface InteractiveElementState { disabled: boolean; checked?: boolean; selected?: boolean; expanded?: boolean; } export interface BoundingBox { x: number; y: number; w: number; h: number; } export type Target = { kind: 'semantic'; text: string; role?: string; } | { kind: 'element_id'; elementId: string; } | { kind: 'selector'; selector: string; }; export type WaitForOption = 'load' | 'domcontentloaded' | 'networkidle'; export type ActAction = 'click' | 'fill' | 'press' | 'select' | 'hover' | 'scroll_to' | 'wait_for'; export interface OpenInput { sessionId: string; url: string; waitFor?: WaitForOption; screenshot?: boolean; timeoutMs?: number; } export interface ObserveInput { sessionId: string; screenshot?: boolean; includeHidden?: boolean; maxElements?: number; } export interface ActInput { sessionId: string; action: ActAction; target: Target; value?: string; timeoutMs?: number; screenshot?: boolean; } export interface ScreenshotInput { sessionId: string; target?: Target; fullPage?: boolean; } export interface ExtractInput { sessionId: string; schema: Record; instruction?: string; scopeSelector?: string; } export interface CloseInput { sessionId: string; } export interface RenderInput { url: string; timeoutMs?: number; waitFor?: WaitForOption; signal?: AbortSignal; requestGuard?: (url: string) => Promise; } export interface RenderResult { html: string; finalUrl: string; httpStatus: number | null; } export interface ScreenshotResult { path: string; bytes: number; width: number; height: number; dataBase64: string; mediaType: 'image/png'; } export interface ExtractResult { data: unknown; warnings?: string[]; } export interface AmbiguousTarget { outcome: 'ambiguous_target'; query: { text: string; role?: string; }; candidates: InteractiveElement[]; } export interface BlockedByPolicy { outcome: 'blocked_by_policy'; url: string; reason: string; } export interface BrowserProviderState { active: boolean; url: string | null; title: string | null; lastAction: string | null; lastActionAt: string | null; openTabs: number; } export interface BrowserConfig { headless: boolean; allowedDomains: readonly string[]; blockedDomains: readonly string[]; domSnapshots: boolean; backend: 'playwright' | 'agent-browser' | 'auto'; configPath: string | null; defaultProfile: string; }