/** * video-to-test.ts * * Implements the pwpilot_video_to_test MCP tool. * * Converts a screen recording or a list of natural-language steps into a * structured prompt for Claude to write a Playwright Page Object Model and * test spec. This tool handles the "video" and "steps-only" generation flows. * * When a video is provided, the tool: * 1. Detects the target project's codebase style. * 2. Uses VideoAnalyzer to extract frames via ffmpeg, runs OCR, detects * motion, and identifies likely web actions (navigate, click, fill, etc.). * 3. Combines video steps with any user-supplied steps (if both are given). * 4. Builds a compact, token-optimized code-generation prompt for Claude. * * When only user steps are provided (no video), the tool skips video analysis * and builds the prompt directly from the step list. * * Role in the overall flow: * pwpilot_preview_generation → user confirms → * pwpilot_video_to_test → Claude writes POM + spec → pwpilot_save_test */ import { z } from 'zod'; /** * Zod schema for validating the input to video_to_test. */ export declare const VideoToTestSchema: z.ZodObject<{ videoPath: z.ZodOptional; userSteps: z.ZodOptional>; url: z.ZodString; prompt: z.ZodString; cwd: z.ZodOptional; artifactsDir: z.ZodOptional; fps: z.ZodOptional; }, "strip", z.ZodTypeAny, { url: string; prompt: string; cwd?: string | undefined; videoPath?: string | undefined; userSteps?: string[] | undefined; artifactsDir?: string | undefined; fps?: number | undefined; }, { url: string; prompt: string; cwd?: string | undefined; videoPath?: string | undefined; userSteps?: string[] | undefined; artifactsDir?: string | undefined; fps?: number | undefined; }>; /** Input type inferred from VideoToTestSchema. */ export type VideoToTestInput = z.infer; /** * Output returned to the MCP server after video analysis and prompt construction. */ export interface VideoToTestOutput { /** Where the test content came from. */ source: 'video' | 'steps' | 'combined'; /** Number of steps extracted (from video or user input). */ stepCount: number; /** The compact prompt Claude should use to write the POM and spec. */ codeGenerationPrompt: string; /** Any non-fatal warnings from video analysis (e.g. ffmpeg unavailable). */ analysisWarnings: string[]; /** Detected or inferred codebase profile. */ codebaseProfile: { isNewCodebase: boolean; testStyle: string; testDirectory: string; pomDirectory: string; }; } /** * Analyze a video or user-supplied steps and produce a code-generation prompt * for Claude to write a Playwright POM and spec. * * @param input - Validated input: optional video path, user steps, URL, and prompt. * @param artifactsBaseDir - Root directory where frame extraction output is written. * @returns A VideoToTestOutput with the prompt and metadata for the MCP server to return. */ export declare function videoToTest(input: VideoToTestInput, artifactsBaseDir: string): Promise; //# sourceMappingURL=video-to-test.d.ts.map