import type { LocalWebSocketConstructor } from "./types.js"; import type { SessionInfo } from "./workflow-types.js"; export interface ReadonlyLiveViewAccess { url: string; expiresAt?: string; } export interface ReadonlyLiveViewPoint { 0: number; 1: number; } export interface ReadonlyLiveViewBounds { x: number; y: number; width: number; height: number; } export interface ReadonlyLiveViewTarget { documentGeneration?: string; id: string; bounds: ReadonlyLiveViewBounds; label: string; interaction: string; enabled: boolean; readonly: boolean; options?: string[]; placeholder?: string; inputType?: string; credentialKind?: string; checked?: boolean | null; choiceStatus?: "known" | "unavailable" | "none"; choiceOwnerId?: string; optionChoices?: Array<{ value: string; label: string; disabled: boolean; selected?: boolean; }>; } export interface ReadonlyLiveViewSurface { documentGeneration?: string; recognitionKey?: string; revision: number; capturedAtMs?: number; viewport: { width: number; height: number; }; contentBounds: ReadonlyLiveViewBounds; url?: string; targets: ReadonlyLiveViewTarget[]; } export interface ReadonlyLiveFrameMetadata { type?: "frame"; kind?: "interactive_surface"; capabilities?: { pointer: false; keyboard: false; }; backend?: string; seq?: number; viewport?: { width?: number; height?: number; }; frame?: { width?: number; height?: number; }; cursor?: [number, number]; surfaceRevision?: number; surfaceCapturedAtMs?: number; surface?: ReadonlyLiveViewSurface; } export interface ReadonlyLiveStatusFact { label: string; value: string; } export interface ReadonlyLiveStatusMember { id: string; generation: number; state: string; activity: string; health: string; updatedAtMs?: number; facts: ReadonlyLiveStatusFact[]; } export interface ReadonlyLiveStatusSnapshot { revision: number; capturedAtMs?: number; title: string; members: ReadonlyLiveStatusMember[]; metrics: ReadonlyLiveStatusFact[]; } export interface ReadonlyLiveViewFrame { data: unknown; mimeType: "image/jpeg"; metadata: ReadonlyLiveFrameMetadata; } export type ReadonlyLiveViewConnectionState = "connecting" | "open" | "reconnecting" | "disconnected" | "closed"; export interface ReadonlyLiveViewHandlers { onFrame(frame: ReadonlyLiveViewFrame): void; onStatus?(snapshot: ReadonlyLiveStatusSnapshot): void; onConnectionState?(state: ReadonlyLiveViewConnectionState): void; onDisconnect?(error?: Error): void; } export interface ReadonlyLiveViewConnectOptions { reconnect?: boolean; reconnectDelayMs?: number; } export interface ReadonlyLiveViewConnection { readonly access: ReadonlyLiveViewAccess; close(): void; } type ResolveSession = () => Promise; /** A frame-only view of an existing browser session. It cannot send browser input. */ export declare class ReadonlySessionLiveView { private readonly resolveSession; private readonly webSocket?; constructor(resolveSession: ResolveSession, webSocket?: LocalWebSocketConstructor | undefined); connect(handlers: ReadonlyLiveViewHandlers, options?: ReadonlyLiveViewConnectOptions): Promise; } export {};