/**
 * Session Health Monitor
 *
 * Periodically checks session health and detects stale sessions.
 * Early detection of infinite loading states improves system stability.
 */
import type { PluginInput } from "@opencode-ai/plugin";
type OpencodeClient = PluginInput["client"];
interface SessionHealthState {
    sessionID: string;
    lastActiveTime: number;
    lastResponseTime: number;
    isStale: boolean;
    activityCount: number;
}
/**
 * Record session activity
 *
 * Call this when an activity occurs in the session.
 * (e.g., sending prompt, tool execution)
 *
 * @param sessionID - Session ID
 */
export declare function recordSessionActivity(sessionID: string): void;
/**
 * Record session response receipt
 *
 * Call this when a response is received from the session.
 * (e.g., assistant message received)
 *
 * @param sessionID - Session ID
 */
export declare function recordSessionResponse(sessionID: string): void;
/**
 * Check if session is stale
 *
 * @param sessionID - Session ID
 * @returns true if stale
 */
export declare function isSessionStale(sessionID: string): boolean;
/**
 * Get session response age
 *
 * @param sessionID - Session ID
 * @returns Time elapsed since last response (ms), or -1 if session not found
 */
export declare function getSessionResponseAge(sessionID: string): number;
/**
 * Get all stale session IDs
 *
 * @returns Array of stale session IDs
 */
export declare function getStaleSessions(): string[];
/**
 * Start health check monitor
 *
 * @param opencodeClient - OpenCode Client
 */
export declare function startHealthCheck(opencodeClient: OpencodeClient): void;
/**
 * Stop health check monitor
 */
export declare function stopHealthCheck(): void;
/**
 * Perform actual health check (Exported for testing)
 */
export declare function performHealthCheck(): void;
/**
 * Cleanup session health state
 *
 * @param sessionID - Session ID
 */
export declare function cleanupSessionHealth(sessionID: string): void;
/**
 * Clear all session health info (for testing)
 */
export declare function clearAllSessionHealth(): void;
/**
 * Get session health info (for debugging)
 *
 * @param sessionID - Session ID
 */
export declare function getSessionHealth(sessionID: string): SessionHealthState | undefined;
/**
 * Get overall health stats (for debugging)
 */
export declare function getHealthStats(): {
    total: number;
    stale: number;
    healthy: number;
    avgResponseAge: number;
};
export {};
