/**
 * OpenCode process supervisor.
 *
 * Monitors the OpenCode child process for unexpected exits and
 * auto-restarts with exponential backoff. Integrates with proxy
 * and SSE modules to update auth and reconnect after restart.
 */
import { type OpenCodeAuth, type OpenCodeProcess } from "./spawn.js";
export interface SupervisorOptions {
    /** Port for the OpenCode server. */
    port?: number;
    /** Called after a successful restart with the new auth info. */
    onRestarted?: (auth: OpenCodeAuth) => void;
}
/**
 * Start supervising an already-spawned OpenCode process.
 *
 * Attaches an exit listener that triggers auto-restart with
 * exponential backoff on unexpected exits.
 */
export declare function supervise(proc: OpenCodeProcess, options?: SupervisorOptions): void;
/**
 * Stop the supervisor and the managed OpenCode process.
 * Prevents any further restart attempts.
 */
export declare function stopSupervisor(): Promise<void>;
/**
 * Get the current supervised OpenCode process, if any.
 */
export declare function getSupervisedProcess(): OpenCodeProcess | null;
/**
 * Check whether the supervisor is in shutdown mode.
 */
export declare function isShuttingDown(): boolean;
/**
 * Get the current restart attempt count (for testing/monitoring).
 */
export declare function getRestartAttempts(): number;
/**
 * Reset supervisor state (for testing).
 */
export declare function resetSupervisor(): void;
//# sourceMappingURL=supervisor.d.ts.map