/** * Auto-Continue v7.0 - Session Monitor Module * * Handles: * 1. Orphan parent detection - when subagent finishes but parent stays busy * 2. Session discovery - periodic polling to find missed sessions * 3. Idle session cleanup - prevent memory leaks */ import { type SessionState } from "./session-state.js"; import type { PluginConfig } from "./config.js"; import type { TypedPluginInput } from "./types.js"; import type { StopConditionResult } from "./stop-conditions.js"; export interface SessionMonitorDeps { config: PluginConfig; sessions: Map; log: (...args: unknown[]) => void; input: TypedPluginInput; isDisposed: () => boolean; recover: (sessionId: string) => void; checkStopConditions?: (sessionId: string) => StopConditionResult; } export interface SessionMonitor { start(): void; stop(): void; touchSession(sessionId: string): void; trackParentChild(parentId: string, childId: string): void; getStats(): SessionMonitorStats; } export interface SessionMonitorStats { totalSessions: number; busySessions: number; idleSessions: number; orphanRecoveries: number; discoveredSessions: number; cleanedUpSessions: number; } /** * Create the session monitor module. */ export declare function createSessionMonitor(deps: SessionMonitorDeps): SessionMonitor; //# sourceMappingURL=session-monitor.d.ts.map