// Shared recipe validation and project summaries for the CLI and MCP. Ordinary validation renders // the recipe and reports its animations without starting any source compiler or preset measurement. import { renderProject } from './core.js'; import { describeAnimations } from './export.js'; import { frameGrid } from './frame-rate.js'; // Shared project summary fields returned by validate, inspect, compile and render. export const projectSummary = (project, recipe) => ({ name: project.name, width: project.width, height: project.height, frames: project.frames.length, ...describeAnimations(project, recipe), warnings: project.warnings, ...(project.clipping && { clipping: project.clipping }), ...(project.clippingOmitted && { clippingOmitted: project.clippingOmitted }) }); // Validates and renders a recipe, optionally checking frame durations against a video frame rate. export function validateAction(recipe, { fps } = {}) { const project = renderProject(recipe); return { project, summary: projectSummary(project, recipe), ...(fps !== undefined && { frameGrid: frameGrid(project, fps) }) }; }