/**
 * Checkpoint Manager - Pause/Resume support for Living Docs Builder
 *
 * Enables long-running living docs jobs to:
 * 1. Save progress at key points (after each phase/module)
 * 2. Resume from last checkpoint on restart
 * 3. Track phase and module completion
 */
import type { LivingDocsPhase } from '../background/types.js';
import type { DiscoveryResult } from './discovery.js';
import type { WorkItemMatchResult } from './workitem-matcher.js';
/**
 * Simplified checkpoint for internal use
 * (Not extending LivingDocsCheckpoint to avoid complex phaseProgress structure)
 */
export interface FullCheckpoint {
    /** Current phase */
    phase: LivingDocsPhase;
    /** Simple progress percentage (0-100) */
    progressPercent: number;
    /** Discovery results (saved after discovery phase) */
    discovery?: DiscoveryResult;
    /** Foundation docs paths (saved after foundation phase) */
    foundationPaths?: string[];
    /** Work item matching stats (saved after integration phase) */
    matchingStats?: {
        totalWorkItems: number;
        matchedWorkItems: number;
        modulesWithWorkItems: number;
    };
    /** Module analysis progress */
    moduleAnalysis?: {
        completed: string[];
        current?: string;
        remaining: string[];
    };
    /** Error log */
    errors: Array<{
        phase: LivingDocsPhase;
        message: string;
        timestamp: string;
    }>;
    /** Last updated timestamp */
    lastUpdated?: string;
}
/**
 * Checkpoint file paths
 */
export interface CheckpointPaths {
    /** Main checkpoint file */
    checkpoint: string;
    /** Phase-specific checkpoint directory */
    phasesDir: string;
    /** Discovery results */
    discovery: string;
    /** Foundation docs record */
    foundation: string;
    /** Matching results */
    matching: string;
}
/**
 * Get checkpoint file paths for a job
 */
export declare function getCheckpointPaths(projectPath: string, jobId: string): CheckpointPaths;
/**
 * Initialize checkpoint for a new job
 */
export declare function initializeCheckpoint(projectPath: string, jobId: string): FullCheckpoint;
/**
 * Save checkpoint to disk
 */
export declare function saveCheckpoint(projectPath: string, jobId: string, checkpoint: FullCheckpoint): void;
/**
 * Load checkpoint from disk
 */
export declare function loadCheckpoint(projectPath: string, jobId: string): FullCheckpoint | null;
/**
 * Save discovery results to checkpoint
 */
export declare function saveDiscoveryCheckpoint(projectPath: string, jobId: string, discovery: DiscoveryResult): void;
/**
 * Load discovery results from checkpoint
 */
export declare function loadDiscoveryCheckpoint(projectPath: string, jobId: string): DiscoveryResult | null;
/**
 * Save foundation phase completion
 */
export declare function saveFoundationCheckpoint(projectPath: string, jobId: string, foundationPaths: string[]): void;
/**
 * Save matching phase completion
 */
export declare function saveMatchingCheckpoint(projectPath: string, jobId: string, result: WorkItemMatchResult): void;
/**
 * Update module analysis progress
 */
export declare function updateModuleProgress(projectPath: string, jobId: string, completedModule: string, remainingModules: string[]): void;
/**
 * Start module analysis phase
 */
export declare function startModuleAnalysis(projectPath: string, jobId: string, modules: string[]): void;
/**
 * Record an error in the checkpoint
 */
export declare function recordError(projectPath: string, jobId: string, phase: LivingDocsPhase, message: string): void;
/**
 * Complete job with final phase
 */
export declare function completeJob(projectPath: string, jobId: string): void;
/**
 * Check if a phase is already completed
 */
export declare function isPhaseCompleted(checkpoint: FullCheckpoint | null, phase: LivingDocsPhase): boolean;
/**
 * Get resume point for a job
 */
export declare function getResumePoint(projectPath: string, jobId: string): {
    phase: LivingDocsPhase;
    module?: string;
} | null;
//# sourceMappingURL=checkpoint-manager.d.ts.map