/** * design #8 — `slowcook eye` planning (pure). Expands the CLI flags + the * spec's declared fidelity modes into the (viewport × scheme) capture matrix + * gate thresholds the runner executes. Kept pure + unit-tested; the Playwright * execution + spec IO live in ./index.ts (matrix source) and ./spec-modes.ts. * * Which modes are in fidelity scope is a CONTRACT declared by refine in the * spec (`fidelity.modes`), not chosen by brew. The eye reads + enforces it; * brew is measured against it. CLI flags can only NARROW (never widen). */ import type { FidelityGateOptions } from "@slowcook-ai/gates"; /** A capture context plus the pixel viewport to emulate. */ export interface EyeContext { viewport: string; scheme: "light" | "dark"; width: number; height: number; /** * design §6 — locale/direction axis. When set, the runner drives the * consumer's language by appending `?lang=` to BOTH the reference * and the candidate URL (RTL/LTR layouts drift independently). Absent on * the default matrix → unchanged viewport×scheme behaviour. */ locale?: string; } export interface EyeOptions { referenceUrl: string; candidateUrl: string; outDir: string; matrix: EyeContext[]; gate: FidelityGateOptions; /** When set, the runner derives the matrix from this story's `fidelity.modes`. */ story?: string; /** Repo root for spec lookup (default "."). */ cwd: string; /** Raw narrowing flags, re-applied after a spec-derived matrix is built. */ viewport?: string; scheme?: string; /** * design §6 — locale codes from `--locale fa,en`. Applied as a third matrix * axis (driven via `?lang=` on both sides). When the spec/CLI declares none, * the matrix has no locale dimension and behaviour is unchanged. */ locales?: string[]; /** * design §4 — shared-fixture scenario from `--scenario `. Appended as * `?scenario=` to BOTH sides so the mock's mock-data layer and the * candidate's dev-only data adaptor render the SAME fixture → 1-1 diff. */ scenario?: string; /** design #8 / sc#189 — warm-browser HMR re-eye loop. */ watch: boolean; /** Poll interval between watch passes (ms). Default 2000. */ intervalMs: number; /** In watch mode, exit 0 as soon as the gate passes. */ untilConverged: boolean; /** Safety cap on watch passes. Default 60. */ maxPasses: number; } export declare const VIEWPORTS: Record; /** Full default matrix: {mobile,desktop} × {light,dark}. */ export declare const DEFAULT_MATRIX: EyeContext[]; /** * design §6 — extract locale codes from `fidelity.modes`. Locales are namespaced * tokens (`locale:fa`, `locale:en`) so they never collide with viewport/scheme * values and a typo stays ignored (fail-open). Returns [] when none declared. */ export declare function localesFromModes(modes: string[]): string[]; /** * Add (or filter) the locale axis on a matrix (pure). If the matrix already * carries a locale dimension, narrow it to `locales`; otherwise multiply each * cell by the locales (CLI/spec opting the axis in). No-op when `locales` empty. */ export declare function applyLocaleAxis(matrix: EyeContext[], locales: string[] | undefined): EyeContext[]; /** * Build the capture matrix from a spec's declared `fidelity.modes` (pure). * Tokens are dimension VALUES (`light`/`dark`/`mobile`/`desktop`, plus * `locale:` for the §6 locale axis), expanded to the product: a dimension * with no declared value defaults to its full set (so `[dark]` → dark × * {mobile,desktop}; `[mobile]` → {light,dark} × mobile). Locale is OPTIONAL — no * `locale:` token means no locale dimension. Unrecognised tokens are ignored; if * NONE are recognised, the full default matrix is returned (fail-open — a typo * never silently checks nothing). */ export declare function matrixFromModes(modes: string[]): EyeContext[]; /** Narrow a matrix by explicit --viewport / --scheme / --locale flags (pure). Validates. */ export declare function narrowMatrix(base: EyeContext[], opts: { viewport?: string; scheme?: string; locales?: string[]; }): EyeContext[]; /** * Parse `slowcook eye` flags. Required: --reference , --candidate . * Optional: --story (derive the matrix from the spec's fidelity.modes), * --cwd , --out , --viewport + --scheme (narrow), * --locale (§6 locale axis), --scenario (§4 shared fixture), * --max-violations , --fail-on . The returned `matrix` is the flag-only * default; when `story` is set the runner rebuilds it from the spec. */ export declare function parseEyeArgs(args: string[]): EyeOptions; //# sourceMappingURL=plan.d.ts.map