/** * audit-url.ts — Layer 0 render-and-capture transport. * * Renders a live URL at each viewport×theme, scroll-settles, fires interactions, * captures real pixels + DOM, then runs the EXISTING checks (audit_page rule * engine, contrast, responsive-visibility, video-blank, screenshot diff) plus * pixel checks (image edge symmetry) over the captured output. Every finding is * tagged confirmed | likely-artifact | inconclusive with its evidence, and * ranked by severity. * * This tool does NOT reimplement the checks — it reuses: * · runPageChecks (the audit_page rule engine, shared verbatim) * · verifyFindings (the adversarial confirmed/likely-artifact tagger) * · captureResponsiveVisibility (desktop-visible / mobile-hidden divergence) * · auditContrastUrl (per-element WCAG AA/AAA) * · capturePage video-blank detection * · auditImageEdges (sliced/cropped image edge symmetry) * · diffScreenshots (baseline vs post-interaction state diff) */ import type { Interaction, Theme } from "./capture.js"; export type ViewportSpec = { w: number; h: number; label?: string; }; export type Verdict = "confirmed" | "likely-artifact" | "inconclusive"; export type FindingSource = "page" | "contrast" | "responsive-visibility" | "video" | "asset-integrity" | "hover-state"; export type AuditUrlFinding = { source: FindingSource; rule: string; severity: "error" | "warning" | "info"; message: string; fix: string; selector?: string; viewport: string; theme: Theme; verdict: Verdict; evidence: string; }; export type AuditUrlCapture = { viewport: string; theme: Theme; mobile_emulation?: boolean; scrolledToBottom: boolean; animationsSettled: boolean; capture_warnings: string[]; screenshot_bytes: number; screenshot?: string; }; export type AuditUrlResult = { tool: "audit_url"; url: string; viewports: ViewportSpec[]; themes: Theme[]; findings: AuditUrlFinding[]; counts: { total: number; confirmed: number; likely_artifact: number; inconclusive: number; errors: number; warnings: number; }; summary: string; coverage: { requested: number; succeeded: number; complete: boolean; }; captures: AuditUrlCapture[]; capture_warnings: string[]; warnings: string[]; }; export type AuditUrlOptions = { viewports?: ViewportSpec[]; themes?: Theme[]; scroll_settle?: boolean; interactions?: Interaction[]; containerMaxWidth?: number; timeoutMs?: number; includeScreenshots?: boolean; }; export declare function auditUrl(url: string, opts?: AuditUrlOptions): Promise;