import type { VisualQaAssert, VisualQaVerdictItem } from '../../visualQa/types'; import { type HostRendition } from './host'; import { type MotionRead, type RawPose } from './session'; import { AVATAR_CHECK_SCHEMA, type MotionId } from './types'; export declare const CHECK_REVISION = "avatar-check/1"; export interface CheckOptions { glb: string; out: string; apiBase: string; webBase: string; chrome?: string; /** Item whose Marketplace page hosts the candidate (default: the smallest published avatar rendition that fits). */ hostItem?: string; /** Item drawn beside the candidate as the control (default Base Female). */ controlItem?: string; /** Re-render the control instead of using the cache. */ noControlCache?: boolean; /** Skip the inspection set (numbers only). A run without it is not an inspection. */ noInspection?: boolean; /** Write what the page read (rest + poses of each motion) here, for calibration. */ dumpDir?: string; log?: (line: string) => void; } export interface CheckResult { schema: typeof AVATAR_CHECK_SCHEMA; revision: string; /** * `pass` every blocking assert passed · `warn` nothing blocks but generator-limit defects were measured (exit 0, see * `warnings`) · `fail` a blocking assert failed · `error` could not measure. Same words as the hosted gate's verdict. */ verdict: 'pass' | 'warn' | 'fail' | 'error'; exitCode: 0 | 1 | 2; avatar: { file: string; bytes: number; sha256: string; }; out: string; host: { name: string; itemId: string; rendition: string; bytes: number; } | null; control: { name: string; itemId: string; } | null; asserts: VisualQaAssert[]; failing: Array<{ id: string; measured: string; detail: string; next: string; }>; unmeasured: Array<{ id: string; detail: string; }>; /** Generator-limit defects that do not stop the avatar (empty on pass/fail/error unless the run also measured some). Same shape as the server's. */ warnings: VisualQaVerdictItem[]; /** What stops the avatar, machine-readable: every failing or unmeasured blocking assert and every harness error. */ blockers: VisualQaVerdictItem[]; errors: string[]; inspection: { dir: string; sheets: number; holes: string[]; } | null; timingsMs: Record; note: string; } /** The first `measured` value of an assert, as one short string for the failure line. */ export declare function measuredSummary(a: VisualQaAssert): string; /** A failing assert that is a generator limit, not a defect that stops the avatar: warn-severity, or in the mirrored `AVATAR_WARN_ASSERTS` table. */ export declare const isWarnFailure: (a: VisualQaAssert) => boolean; /** * Classify the asserts: a failing block assert = exit 1 (`fail`); a block assert that could not be measured (and no other * failure) = exit 2 (`error`); otherwise a failing warn-class assert (see `isWarnFailure`) = `warn`, which STAYS exit 0 so * every script and MCP that treats a nonzero exit as a stop keeps working; the warnings are in the JSON and the text. */ export declare function exitFor(asserts: VisualQaAssert[], errors: string[], holes: string[]): { exitCode: 0 | 1 | 2; verdict: CheckResult['verdict']; failing: VisualQaAssert[]; unmeasured: VisualQaAssert[]; warned: VisualQaAssert[]; }; /** The machine-readable verdict lines (the server's `VisualQaVerdictItem`): warnings from `warned`, blockers from the failing/unmeasured asserts and harness errors. */ export declare function verdictItems(ex: Pick, 'failing' | 'unmeasured' | 'warned'>, errors: string[], holes: string[]): { warnings: VisualQaVerdictItem[]; blockers: VisualQaVerdictItem[]; }; interface CachedRead { duration: number; clip: string | null; dynamicsChains: number | null; raw: { rest: unknown; poses: RawPose[]; }; } declare function decodeRead(motion: MotionId, c: CachedRead): Pick; export declare class ControlCache { readonly key: string; readonly enabled: boolean; readonly dir: string; constructor(root: string, key: string, enabled: boolean); static keyFor(control: HostRendition, clips: Record): string; private readFile; loadRead(m: MotionId): ReturnType | null; saveRead(m: MotionId, r: Pick): void; tileFile(id: string, phaseIdx: number): string; } export declare function runAvatarCheck(opts: CheckOptions): Promise; /** The text a human or agent reads: every failing assert with its measured value and next step, then what a pass means. */ export declare function renderReport(r: CheckResult): string; export {};