import { OutputMode } from "@outfitter/cli/types"; import { Result } from "@outfitter/contracts"; /** * Options for the check command. */ interface CheckOptions { /** Check a specific block only. */ readonly block?: string; /** Machine-oriented output for CI. */ readonly ci?: boolean; /** Working directory to check. */ readonly cwd: string; /** Only check manifest-tracked blocks; skip file-presence heuristic. */ readonly manifestOnly?: boolean; /** Output mode override. */ readonly outputMode?: OutputMode; /** Show diff information for drifted files. */ readonly verbose?: boolean; } /** * Information about a drifted file (included in verbose mode). */ interface DriftedFileInfo { /** File path relative to project root. */ readonly path: string; /** Reason for drift classification. */ readonly reason: "modified" | "missing"; } /** * Status of a single block after comparison. */ interface BlockCheckStatus { /** Current tooling version providing the registry. */ readonly currentToolingVersion?: string; /** Drifted file details (populated when verbose is true). */ readonly driftedFiles?: DriftedFileInfo[]; /** Tooling version the block was installed from. */ readonly installedFrom?: string; /** Block name. */ readonly name: string; /** Comparison result. */ readonly status: "current" | "drifted" | "missing"; } /** * Complete result of the check command. */ interface CheckResult { /** Per-block comparison results. */ readonly blocks: BlockCheckStatus[]; /** Number of blocks matching the registry. */ readonly currentCount: number; /** Number of blocks with local modifications. */ readonly driftedCount: number; /** Number of blocks with missing files. */ readonly missingCount: number; /** Number of blocks checked. */ readonly totalChecked: number; } /** * Error returned when the check command fails. */ declare class CheckError extends Error { readonly _tag: "CheckError"; constructor(message: string); } /** * Runs the check command programmatically. * * Reads the manifest (or falls back to file-presence heuristic) and * compares each installed block against the registry. * * @param options - Check command options * @returns Result with per-block comparison statuses * * @example * ```typescript * const result = await runCheck({ cwd: process.cwd() }); * if (result.isOk()) { * if (result.value.driftedCount > 0) { * console.log("Some blocks have drifted from the registry"); * } * } * ``` */ declare function runCheck(options: CheckOptions): Promise>; /** * Formats and outputs check results. */ declare function printCheckResults(result: CheckResult, options?: { mode?: OutputMode; verbose?: boolean; }): Promise; export { runCheck, printCheckResults, DriftedFileInfo, CheckResult, CheckOptions, CheckError, BlockCheckStatus };