type SessionIntegrityIssueCode = "transcript_malformed_line" | "transcript_invalid_entry" | "transcript_duplicate_turn_id" | "transcript_broken_chain" | "transcript_incomplete_turn" | "checkpoint_missing" | "checkpoint_invalid_json" | "checkpoint_invalid_metadata" | "checkpoint_expired";
interface SessionIntegrityIssue {
    code: SessionIntegrityIssueCode;
    severity: "info" | "warn" | "error";
    message: string;
    filePath?: string;
    line?: number;
    sessionKey?: string;
}
interface SessionTranscriptStats {
    sessionKey: string;
    entries: number;
    malformedLines: number;
    invalidEntries: number;
    duplicateTurnIds: number;
    brokenChains: number;
    incompleteTurns: number;
}
interface SessionIntegrityReport {
    generatedAt: string;
    memoryDir: string;
    healthy: boolean;
    sessions: SessionTranscriptStats[];
    checkpoint: {
        present: boolean;
        healthy: boolean;
        path: string;
        sessionKey?: string;
        expiresAt?: string;
    };
    issues: SessionIntegrityIssue[];
}
interface SessionRepairAction {
    kind: "rewrite_transcript" | "remove_checkpoint" | "repair_session_files";
    description: string;
    targetPath: string;
    details?: string;
}
interface SessionRepairPlan {
    generatedAt: string;
    dryRun: boolean;
    allowSessionFileRepair: boolean;
    actions: SessionRepairAction[];
}
interface SessionRepairApplyResult {
    applied: boolean;
    actionsAttempted: number;
    actionsApplied: number;
    errors: string[];
}
interface AnalyzeSessionIntegrityOptions {
    memoryDir: string;
}
interface PlanSessionRepairOptions {
    report: SessionIntegrityReport;
    dryRun: boolean;
    allowSessionFileRepair?: boolean;
    sessionFilesDir?: string;
}
interface ApplySessionRepairOptions {
    plan: SessionRepairPlan;
}
declare function analyzeSessionIntegrity(options: AnalyzeSessionIntegrityOptions): Promise<SessionIntegrityReport>;
declare function planSessionRepair(options: PlanSessionRepairOptions): SessionRepairPlan;
declare function applySessionRepair(options: ApplySessionRepairOptions): Promise<SessionRepairApplyResult>;

export { type AnalyzeSessionIntegrityOptions, type ApplySessionRepairOptions, type PlanSessionRepairOptions, type SessionIntegrityIssue, type SessionIntegrityIssueCode, type SessionIntegrityReport, type SessionRepairAction, type SessionRepairApplyResult, type SessionRepairPlan, type SessionTranscriptStats, analyzeSessionIntegrity, applySessionRepair, planSessionRepair };
