import { type ScanResult } from '../lib/pr-status.js';
export interface ScanOpts {
    tidy?: boolean;
    force?: boolean;
    staleAfter?: string;
    json?: boolean;
}
interface LoadScanOptions {
    force?: boolean;
    staleAfterMs: number;
}
export declare function loadScanResult(options: LoadScanOptions): Promise<ScanResult>;
export declare function runScan(opts?: ScanOpts): Promise<void>;
export declare function printScanResult(result: ScanResult, tidy: boolean): void;
export declare function handleScanError(command: string, err: unknown): never;
type ReviewState = 'PR' | 'APPROVE' | 'NEEDS_WORK' | 'BLOCK';
type StepType = 'review' | 'fix' | 'recheck';
export interface ScanTokens {
    review: number;
    fix: number;
    recheck: number;
    total: number;
}
export interface ScanAnnotationMetadata {
    commentId: number;
    commentCreatedAt: string;
    raw: string;
    origin?: string;
    reviewer?: string;
    verdict?: ReviewState;
    type?: string;
    isRecheck?: boolean;
}
export interface ScanRow {
    repo: string;
    pr: number;
    title: string;
    author: string;
    branch: string;
    headSha: string;
    headShaShort: string;
    url: string;
    createdAt: string;
    lastActiveAt: string;
    isStale: boolean;
    reviewState: ReviewState;
    latestVerdict: ReviewState | null;
    progressSummary: string;
    tokens: ScanTokens;
    latestAnnotation: ScanAnnotationMetadata | null;
    nextAction: string | null;
}
export interface LogEntry {
    ts: string;
    event: string;
    repo?: string;
    pr?: number;
    step_type?: string;
    verdict?: string | null;
    tokens_used?: number;
    applied_count?: number;
    conflicts_resolved?: number;
    reason?: string;
}
export interface PRLogSummary {
    reviewVerdict: ReviewState | null;
    recheckVerdict: ReviewState | null;
    latestVerdict: ReviewState | null;
    latestVerdictAt: string | null;
    latestStep: StepType | null;
    latestLogAt: string | null;
    fixAppliedCount: number | null;
    fixCompletedAt: string | null;
    tokens: ScanTokens;
}
export declare function filterScanRowsForOutput(rows: ScanRow[], tidy: boolean): ScanRow[];
export declare function chooseLatestVerdict(annotationVerdict: ReviewState, annotationAt: string, logSummary: PRLogSummary): ReviewState | null;
export declare function selectNextAction(latestVerdict: ReviewState | null, logSummary: PRLogSummary): string | null;
export declare function buildProgressSummary(annotation: ScanAnnotationMetadata | null, logSummary: PRLogSummary): string;
interface ScanAnnotations {
    latestAnnotation: ScanAnnotationMetadata | null;
    latestVerdictAnnotation: ScanAnnotationMetadata | null;
}
export declare function findLatestAnnotation(comments: Array<{
    id: number;
    body: string;
    createdAt: string;
    author?: string;
    updatedAt?: string;
}>): ScanAnnotations;
export declare function applyLogEntry(summary: PRLogSummary, entry: LogEntry): void;
export declare function emptyLogSummary(): PRLogSummary;
export {};
//# sourceMappingURL=scan.d.ts.map