/**
 * Orchestrator Restart Service
 *
 * Automatically restarts the orchestrator when it becomes unresponsive
 * (child process dies inside the PTY shell). Enforces a cooldown window
 * to prevent restart loops.
 *
 * @module orchestrator-restart.service
 */
import type { AgentRegistrationService } from '../agent/agent-registration.service.js';
import type { ISessionBackend } from '../session/session-backend.interface.js';
/**
 * Restart statistics for monitoring
 */
export interface RestartStats {
    /** Total number of restarts since service creation */
    totalRestarts: number;
    /** Restarts within the current cooldown window */
    restartsInWindow: number;
    /** Whether a restart is currently in progress */
    isRestarting: boolean;
    /** Timestamp of the last successful restart */
    lastRestartAt: string | null;
    /** Whether further restarts are allowed under cooldown */
    restartAllowed: boolean;
}
/**
 * OrchestratorRestartService manages automatic restart of the orchestrator
 * when the child process (Claude Code) dies inside the PTY shell.
 *
 * Features:
 * - Kills the old PTY session before creating a new one
 * - Initializes memory and starts chat monitoring
 * - Notifies via Slack (if configured)
 * - Broadcasts WebSocket event for UI updates
 * - Enforces max 3 restarts per hour cooldown
 *
 * @example
 * ```typescript
 * const service = OrchestratorRestartService.getInstance();
 * service.setDependencies(agentRegistrationService, sessionBackend, io);
 * await service.attemptRestart();
 * ```
 */
export declare class OrchestratorRestartService {
    private static instance;
    private logger;
    /** Timestamps of recent restarts for cooldown tracking */
    private restartTimestamps;
    /** Total restart count since service creation */
    private totalRestarts;
    /** Flag to prevent concurrent restart attempts */
    private isRestarting;
    /** External dependencies (injected via setDependencies) */
    private agentRegistrationService;
    private sessionBackend;
    private socketIO;
    private constructor();
    /**
     * Get the singleton instance.
     *
     * @returns The OrchestratorRestartService instance
     */
    static getInstance(): OrchestratorRestartService;
    /**
     * Reset the singleton instance (for testing).
     */
    static resetInstance(): void;
    /**
     * Inject external dependencies.
     *
     * @param agentRegistrationService - Service for creating agent sessions
     * @param sessionBackend - Session backend for killing old sessions
     * @param socketIO - Socket.IO server for broadcasting events
     */
    setDependencies(agentRegistrationService: AgentRegistrationService, sessionBackend: ISessionBackend, socketIO?: {
        emit: (event: string, data: unknown) => void;
    }): void;
    /**
     * Check if a restart is currently allowed under the cooldown window.
     *
     * @returns true if restart is allowed
     */
    isRestartAllowed(): boolean;
    /**
     * Attempt to restart the orchestrator.
     *
     * This method:
     * 1. Checks cooldown limits
     * 2. Kills the old PTY session
     * 3. Creates a new agent session
     * 4. Initializes memory
     * 5. Starts chat monitoring
     * 6. Notifies Slack (if configured)
     * 7. Broadcasts WebSocket event
     *
     * @returns true if restart succeeded, false otherwise
     */
    attemptRestart(): Promise<boolean>;
    /**
     * Resolve orchestrator runtime type from persisted orchestrator status.
     * Falls back to Claude Code if status is unavailable/invalid.
     */
    private resolveOrchestratorRuntimeType;
    /**
     * Get current restart statistics.
     *
     * @returns Restart statistics object
     */
    getRestartStats(): RestartStats;
    /**
     * Send a Slack notification about the orchestrator restart.
     * Best-effort: silently ignores failures (Slack may not be configured).
     */
    private notifySlack;
}
//# sourceMappingURL=orchestrator-restart.service.d.ts.map