/** * Weavetab — tools/recording.ts * browser_recording: Session recording (screencast) for compliance review. * Uses CDP Page.startScreencast at 2-5 FPS and compiles frames into video (.webp, .gif, .webm, .mp4). * Weavetab by fy2ne */ import CDP from "chrome-remote-interface"; import type { Config } from "../config/loader.js"; export interface RecordingOptions { action: "start" | "stop" | "list"; sessionId?: string; fps?: number; maxFrames?: number; /** Output video/animation format when stopping recording. * Options: 'webp' (default pure Node animation), 'gif', 'webm', 'mp4', or 'frames' (raw images). */ format?: "webp" | "gif" | "webm" | "mp4" | "frames"; /** If false (default), cleans up raw JPEG image frames after video compilation. */ keepFrames?: boolean; /** If false, keeps the WeaveTab UI overlay visible in the recording. * Default: true — overlay is hidden from screencasts so agent never records itself. */ hideOverlay?: boolean; } interface RecordingState { sessionId: string; targetId: string; startedAt: string; fps: number; maxFrames: number; frameCount: number; dir: string; active: boolean; } export declare function browserRecording(session: CDP.Client, options: RecordingOptions, config: Config): Promise<{ success: boolean; recordings?: RecordingState[]; error?: string; dir?: string; frameCount?: number; videoPath?: string; videoFormat?: string; durationSeconds?: number; fileSizeBytes?: number; compilerUsed?: string; }>; export {};