/** * Shared audit pipeline — extracted so both the CLI and the fix orchestrator * can run a full audit without going through the CLI entry point. * * Returns AuditResult plus auxiliary data (tokens, config) needed by the fix * orchestrator to build a ClassifyContext. */ import type { DesignSystemGraph } from "../graph/types.js"; import type { Resolver } from "../graph/resolve/types.js"; import type { AuditResult, LyseConfig, TokenMap, ComponentInventoryEntry } from "../types.js"; import { RefuseToRunError, ScopeError, type AuditFlags } from "./audit-flags.js"; export { RefuseToRunError, ScopeError, type AuditFlags }; export interface AuditPipelineResult { /** Full AuditResult as produced by the audit subcommand. */ result: AuditResult; /** Loaded token map (null when no token source was found). */ tokens: TokenMap | null; /** Parsed .lyse.yaml config. */ config: LyseConfig; /** Component inventory for the configured DS module. */ componentInventory: ComponentInventoryEntry[]; /** Number of source files scanned. */ fileCount: number; /** The reified Design System Graph (P1). */ graph: DesignSystemGraph; /** * The four-class value resolver the rules ran against, built once per audit. * Exposed so `buildClassifyContext` can hand the SAME instance to the * confidence hooks — rebuilding one there would both duplicate work and risk * the hooks disagreeing with the verdicts the rules already emitted. */ resolver: Resolver; } /** * Run a full audit on a repository root. * This is the same pipeline as the `lyse audit` CLI command, extracted for * programmatic use by the fix orchestrator and future commands. * * @param repoRoot - Absolute path to the repository root. * @param flags - Optional CLI-level overrides (e.g. --static-only). */ export declare function auditDirectory(repoRoot: string, flags?: AuditFlags): Promise;