/**
 * Improvement Startup Service
 *
 * Handles self-improvement continuation after process restart.
 * This is the critical hook that makes self-improvement work
 * with hot-reload / nodemon.
 *
 * @module services/orchestrator/improvement-startup
 */
import { ImprovementPhase } from './improvement-marker.service.js';
/**
 * Startup result indicating what action was taken
 */
export interface StartupResult {
    hadPendingImprovement: boolean;
    improvementId?: string;
    phase?: ImprovementPhase;
    action?: 'validated' | 'rolled_back' | 'cleaned_up' | 'none';
    validationPassed?: boolean;
    error?: string;
}
/**
 * ImprovementStartupService class
 *
 * Runs at application startup to check for and handle pending
 * self-improvements that were interrupted by hot-reload.
 */
export declare class ImprovementStartupService {
    private projectRoot;
    private logger;
    /**
     * Creates an instance of ImprovementStartupService.
     *
     * @param projectRoot - Project root directory
     */
    constructor(projectRoot?: string);
    /**
     * Run the startup check.
     *
     * This should be called early in application startup,
     * before normal operations begin.
     *
     * @returns Result of the startup check
     */
    runStartupCheck(): Promise<StartupResult>;
    /**
     * Handle interrupted planning phase.
     *
     * @param marker - The improvement marker
     * @returns Startup result
     */
    private handleInterruptedPlanning;
    /**
     * Handle changes_applied phase - run validation.
     *
     * @param marker - The improvement marker
     * @returns Startup result
     */
    private handleChangesApplied;
    /**
     * Handle validating phase - continue validation.
     *
     * @param marker - The improvement marker
     * @returns Startup result
     */
    private handleValidating;
    /**
     * Run validation checks.
     *
     * @param marker - The improvement marker
     * @param skipChecks - Checks to skip (already passed)
     * @returns True if all required validations passed
     */
    private runValidation;
    /**
     * Handle validation success.
     *
     * @param marker - The improvement marker
     * @returns Startup result
     */
    private handleValidationSuccess;
    /**
     * Handle validation failure - trigger rollback.
     *
     * @param marker - The improvement marker
     * @returns Startup result
     */
    private handleValidationFailure;
    /**
     * Handle rolling_back phase - continue rollback.
     *
     * @param marker - The improvement marker
     * @returns Startup result
     */
    private handleRollingBack;
    /**
     * Handle rolled_back phase - just clean up.
     *
     * @param marker - The improvement marker
     * @returns Startup result
     */
    private handleRolledBack;
    /**
     * Force a rollback of the current improvement.
     * Used for manual rollback requests via the API.
     *
     * @param reason - Reason for the rollback
     * @returns Rollback result with success status and files restored count
     */
    forceRollback(reason: string): Promise<{
        success: boolean;
        filesRestored: number;
        message: string;
    }>;
    /**
     * Handle too many restarts.
     *
     * @param marker - The improvement marker
     * @returns Startup result
     */
    private handleTooManyRestarts;
    /**
     * Perform rollback of file changes.
     *
     * @param marker - The improvement marker with backup info
     * @returns Rollback result
     */
    private performRollback;
    /**
     * Run a shell command.
     *
     * @param cmd - Command to run
     * @param args - Command arguments
     * @param timeoutMs - Timeout in milliseconds
     * @returns Command output
     */
    private runCommand;
    /**
     * Send Slack notification.
     *
     * @param marker - The improvement marker
     * @param message - Message to send
     * @param urgency - Message urgency level
     */
    private notifySlack;
}
/**
 * Get singleton instance of ImprovementStartupService.
 *
 * @returns The singleton ImprovementStartupService instance
 */
export declare function getImprovementStartupService(): ImprovementStartupService;
/**
 * Reset singleton instance (for testing).
 */
export declare function resetImprovementStartupService(): void;
//# sourceMappingURL=improvement-startup.service.d.ts.map