import type { BrowserAction, BrowserActionBatch, BrowserActionReceipt, BrowserClipboard, BrowserDiagnosticBatch, BrowserDiagnosticsOptions, BrowserFrame, BrowserObservation, BrowserSession, BrowserTarget } from "@opengeni/sdk/interaction"; import { type EmbeddedBrowserInteractionClientOverride } from "../session-context.js"; /** Immutable input fence; queued actions never need the encoded screenshot. */ export type BrowserFrameInputFence = Pick; export type BrowserInputFailure = Pick & { state: Exclude; }; export type UseBrowserSessionOptions = EmbeddedBrowserInteractionClientOverride & { browserSessionId: string | null; enabled?: boolean | undefined; pollIntervalMs?: number | undefined; /** Keep session/tab inventory current without repeatedly fetching the full * accessibility tree while a live frame is available or the viewer is hidden. */ semanticObservationEnabled?: boolean | undefined; }; export type UseBrowserSessionResult = { session: BrowserSession | null; targets: BrowserTarget[]; selectedTarget: BrowserTarget | null; observation: BrowserObservation | null; loading: boolean; mutating: boolean; error: Error | null; inputFailure: BrowserInputFailure | null; refresh: () => Promise; observeForInput: () => Promise; actFromObservation: (action: BrowserAction, observation: BrowserObservation) => Promise; selectTarget: (targetId: string) => Promise; openTarget: (url?: string) => Promise; closeTarget: (targetId: string) => Promise; act: (action: BrowserAction | BrowserActionBatch, operationId?: string) => Promise; /** Dispatch input against the exact image a human saw. Stale images fail at * the controller fence instead of targeting a newer page. */ actFromFrame: (action: BrowserAction | BrowserActionBatch, frame: BrowserFrameInputFence, operationId?: string, observationMode?: "none" | "input") => Promise; readClipboard: () => Promise; diagnostics: (options?: BrowserDiagnosticsOptions) => Promise; }; /** Selected BrowserSession control state. All human actions use the same * generation-fenced controller operation stream as agent actions. */ export declare function useBrowserSession(options: UseBrowserSessionOptions): UseBrowserSessionResult;