import { type Finding, type Project } from "@uxloom/journeygraph"; import type { CriticOptions } from "@uxloom/critics"; export interface ReviewerComment { id: string; screen: string; state: string; x: number; y: number; text: string; resolved: boolean; createdAt: string; /** Lifecycle status (RFC 0006). Absent on legacy comments — use commentStatus. */ status?: "open" | "assigned" | "resolved"; assignedAt?: string; /** Layout block the pin landed on, when the screen had an explicit layout. */ block?: { index: number; type: string; label?: string; }; resolvedAt?: string; resolvedBy?: "agent" | "reviewer"; /** What was changed and why — shown to the reviewer. */ resolution?: string; } /** * Effective status (RFC 0006): the legacy `resolved` boolean wins, then an * explicit `status: "assigned"`, else open. Legacy comments without a * `status` field are open. */ export declare function commentStatus(c: ReviewerComment): "open" | "assigned" | "resolved"; export interface UxloomConfig { thresholds?: CriticOptions; /** "required" forces rationale enforcement before any rationale exists. */ rationale?: "required"; } /** Critic options derived from config (rationale mode folded in). */ export declare function criticOptionsFor(config: UxloomConfig): CriticOptions; export interface ReviewRound { round: number; at: string; errors: number; warnings: number; rationale: { documented: number; total: number; }; notes?: string; } export declare function reviewsPathFor(projectPath: string): string; export declare function loadReviews(path: string): ReviewRound[]; export declare function saveReviews(path: string, rounds: ReviewRound[]): void; export interface Baseline { check: string[]; audit: string[]; } export interface Workspace { projectPath: string; dir: string; project: Project; /** Findings produced by loading itself (duplicate ids across fragments). */ loadFindings: Finding[]; config: UxloomConfig; baseline: Baseline; baselinePath: string; comments: ReviewerComment[]; commentsPath: string; /** Fragment files that contributed to the merge (for reporting). */ fragments: string[]; } export declare function commentsPathFor(projectPath: string): string; export declare function loadWorkspace(projectPathArg: string): Workspace; /** Stable fingerprint of a finding for baselining. */ export declare function fingerprint(f: { code?: string; critic?: string; journey?: string; screen?: string; state?: string; component?: string; }): string; /** Split findings into fresh vs baselined. */ export declare function applyBaseline[0]>(findings: T[], baselined: string[]): { fresh: T[]; suppressed: number; }; export declare function saveBaseline(path: string, baseline: Baseline): void; /** Persist the comments sidecar (RFC 0006 contract shape). */ export declare function saveComments(commentsPath: string, comments: ReviewerComment[]): void; /** * Open reviewer comments become findings in the same loop agents iterate on. * Assigned comments (the reviewer clicked "→ agent" in the preview) carry a * distinct message and fix, so an agent that only runs validation still * discovers its work queue. */ export declare function commentFindings(comments: ReviewerComment[]): Finding[];