import type { SessionDownloadListing } from "./download-store.ts"; import type { SessionInfo } from "./session.ts"; export type FinalizationStageOutcome = "ok" | "error" | "timeout"; export interface SessionFinalizationReport { context: FinalizationStageOutcome; browser: FinalizationStageOutcome; completed: boolean; } /** * The minimal surface act() dispatch needs from a live page — deliberately * not the full Playwright Page type. One SessionPage per session, created * lazily and reused across every act() call (tmux-session semantics: a * persistent page, not a fresh one per action). */ export interface SessionPage { goto(url: string, opts?: { timeoutMs?: number }): Promise; click(selector: string, opts?: { timeoutMs?: number }): Promise; hover(selector: string, opts?: { timeoutMs?: number }): Promise; /** Presses a keyboard key. Scoped to selector when given (focuses it first); otherwise a global keyboard press, for keys like Escape with no natural target element. */ pressKey(key: string, opts?: { selector?: string; timeoutMs?: number }): Promise; /** * Real per-character keyboard input (Playwright's pressSequentially, not * a synthetic DOM event) — the primitive a caller needs for pages with * their own JS keyboard/input handling (framework-bound form fields that * don't react to a directly-set .value). Clears existing content first * unless opts.clear is explicitly false. */ type(selector: string, text: string, opts?: { timeoutMs?: number; clear?: boolean }): Promise; /** Selects a