/** * Interactive Viewer Generator * * Generates a self-contained HTML file with: * - WebM video playback with play/pause/seek * - Scrub bar with action markers positioned by timestamp * - Canvas overlay for click ripple + action toast at bounding box coordinates * - Dual-pane layout (video + timeline/logs) * - Auto-step-through mode that pauses at each action * - Console/network log tabs with error highlighting * * Security: All user-generated content is escaped before insertion. * No external dependencies — works offline. */ import type { ConsoleEntry, NetworkEntry } from './listeners.js'; import type { SessionManifest } from './session.js'; export interface ViewerOptions { sessionDir: string; outputPath?: string; consoleEntries?: ConsoleEntry[]; networkEntries?: NetworkEntry[]; /** * If true, embed the video as a base64 data URL — produces a single * portable HTML file (good for emailing/sharing). Defaults to false: * the viewer references `session.webm` in the same directory, which * keeps the HTML ~280× smaller for typical session lengths. */ inlineVideo?: boolean; } /** * Upper bound on a video we're willing to base64-inline into the HTML. * Inlining bloats by ~33% and the whole string is built in memory, so a long * recording can produce an un-openable (or OOM) file. Past this size we fall * back to referencing the WebM by relative path even when inlineVideo is set. */ export declare const MAX_INLINE_VIDEO_BYTES: number; export declare function generateViewer(manifest: SessionManifest, options: ViewerOptions): Promise; /** Default manifest filename written into a session directory. */ export declare const SESSION_MANIFEST_FILENAME = "sweetlink-session.json"; export interface BuildViewerFromDirOptions { /** Manifest path; defaults to `/sweetlink-session.json`. */ manifestPath?: string; /** Output path; defaults to `/viewer.html`. */ outputPath?: string; consoleEntries?: ConsoleEntry[]; networkEntries?: NetworkEntry[]; inlineVideo?: boolean; } /** * Daemon-free entry point: build a `viewer.html` from a session directory on * disk that already contains a manifest (`sweetlink-session.json`), the WebM it * references, and any per-action screenshots. * * This is the standalone core of the daemon's `generate-viewer` action — it * needs no live BrowserContext, daemon, or Playwright. External tools (e.g. * el-visual-evidence, which records its own Playwright session) can assemble a * manifest + WebM into a directory and call this directly to reuse sweetlink's * viewer rather than reimplementing it. */ export declare function buildViewerFromDir(sessionDir: string, options?: BuildViewerFromDirOptions): Promise; //# sourceMappingURL=viewer.d.ts.map