import Anthropic from '@anthropic-ai/sdk'; import type { UiSpec } from '@manehorizons/cadence-types'; import { type SpawnFn } from './host-cli-client.js'; /** * rec-20260711-004 — ui-spec-review verifier. Reviews the parsed UI-SPEC * (per-component detail/Layout & Tokens/Precedent References plus * whole-slice Responsive & Interaction) at `cadence spec approve`, only when * a UI-SPEC is present, run through the same Phase 35.1 convergence loop as * spec-review. Structural sibling of `spec-review.ts` — same shape, UI-SPEC * schema and prompt instead of SPEC's. */ export type UiSpecReviewSeverity = 'high' | 'medium' | 'low'; export interface UiSpecReviewFinding { severity: UiSpecReviewSeverity; message: string; suggestedEdit?: string; } export interface UiSpecReviewInput { uiSpec: UiSpec; } export interface UiSpecReviewResult { pass: boolean; findings: UiSpecReviewFinding[]; provider: string; model?: string; } export interface UiSpecReviewVerifier { readonly name: string; verify(input: UiSpecReviewInput): Promise; } /** * Deterministic mock — passes iff every component has non-empty * `layoutTokens` AND whole-slice `responsiveInteraction` is non-empty. * Intentionally flags a component whose only detail is a Precedent * Reference: an empty `layoutTokens` array trips regardless of `precedent` * being populated. Each defect is one HIGH finding. */ export declare class MockUiSpecReviewVerifier implements UiSpecReviewVerifier { readonly name = "mock"; verify(input: UiSpecReviewInput): Promise; } export interface AnthropicUiSpecReviewVerifierOptions { apiKey?: string; model?: string; maxTokens?: number; client?: Anthropic; } export declare class AnthropicUiSpecReviewVerifier implements UiSpecReviewVerifier { readonly name = "anthropic"; private readonly client; private readonly model; private readonly maxTokens; constructor(opts?: AnthropicUiSpecReviewVerifierOptions); verify(input: UiSpecReviewInput): Promise; } export interface LocalUiSpecReviewVerifierOptions { baseURL: string; model: string; transport?: typeof fetch; } export declare class LocalUiSpecReviewVerifier implements UiSpecReviewVerifier { private readonly o; readonly name = "local"; constructor(o: LocalUiSpecReviewVerifierOptions); verify(input: UiSpecReviewInput): Promise; } export interface HostCliUiSpecReviewVerifierOptions { /** Host CLI binary name or path, e.g. `"claude"` or `"codex"`. */ bin: string; model?: string; /** Inject a spawn implementation for tests; production callers should omit this. */ spawnImpl?: SpawnFn; } /** * Phase 191 — spawns the user's already-installed, already-authenticated * host CLI (`claude`/`codex`) in headless mode via `hostCliJSON` instead of * calling an HTTP endpoint. Structurally mirrors `LocalUiSpecReviewVerifier` — * same `SYSTEM_PROMPT`/`formatUserMessage`/`UiSpecReviewResponseSchema`, only * the transport differs. */ export declare class HostCliUiSpecReviewVerifier implements UiSpecReviewVerifier { private readonly o; readonly name = "host-cli"; constructor(o: HostCliUiSpecReviewVerifierOptions); verify(input: UiSpecReviewInput): Promise; } //# sourceMappingURL=ui-spec-review.d.ts.map