/** * Session Recording * * Records browser sessions as WebM video via Playwright's Chromium screencast, * with synchronized action timeline and bounding box capture for overlays. * * Architecture: * - On `startRecording()`, a NEW BrowserContext is created with `recordVideo` * - The recording page navigates to the same URL as the daemon's main page * - Actions (click, fill) are executed on the RECORDING page (not the main page) * - On `stopRecording()`, the recording page/context are closed, which finalizes the video * - The video file path is available via `page.video().path()` after close */ import type { SessionManifest } from './session.js'; type Browser = import('playwright').Browser; type Page = import('playwright').Page; export interface RecordingEventCursors { consoleStartCursor: number; networkStartCursor: number; } export declare function getRecordingEventCursors(): RecordingEventCursors | null; /** * Start recording a session with real video capture. * Creates a new BrowserContext with recordVideo enabled. */ export declare function startRecording(browser: Browser, url: string, outputDir: string, options?: { viewport?: { width: number; height: number; }; label?: string; /** Path to a Playwright storageState JSON (cookies + localStorage) — for testing logged-in flows. */ storageState?: string; /** Enable Playwright trace recording (writes trace.zip on stop). */ trace?: boolean; }): Promise<{ sessionId: string; }>; /** * Get the recording page for executing actions. * Actions during recording should use THIS page, not the main daemon page. */ export declare function getRecordingPage(): Page | null; /** * Log an action during recording. * Captures a screenshot at the moment of the action for the viewer thumbnail. */ export declare function logAction(action: import('./session.js').RecordedAction, args: string[], page: Page, boundingBox?: { x: number; y: number; width: number; height: number; }, durationMs?: number): Promise; /** * Stop recording and generate session manifest. * Closes the recording context which finalizes the video file. */ export declare function stopRecording(): Promise; /** Check if recording is in progress (returns true even when paused). */ export declare function isRecording(): boolean; /** Check if recording is paused. */ export declare function isRecordingPaused(): boolean; /** * Pause the active recording. Subsequent action logs are skipped, and the * paused window is subtracted from the manifest duration. The video * stream from Playwright keeps recording (Playwright's video API has no * pause primitive), but the action timeline is gapped honestly. */ export declare function pauseRecording(): { pausedAt: number; } | null; /** Resume a paused recording. */ export declare function resumeRecording(): { pausedDurationMs: number; } | null; /** Get recording status info. */ export declare function getRecordingStatus(): { recording: boolean; sessionId: string | null; duration: number | null; actionCount: number; }; export {}; //# sourceMappingURL=recording.d.ts.map