/** * Session state management for TestDriver MCP Server * Tracks sandbox sessions for MCP server */ export interface SessionState { sessionId: string; sandboxId: string | null; status: "initializing" | "active" | "expired" | "error"; os: "linux" | "windows"; resolution: string; createdAt: number; expiresAt: number; keepAlive: number; testFile: string | null; lastScreenshot: string | null; errorMessage?: string; } /** * Session Manager - handles session state for MCP server */ export declare class SessionManager { private sessions; private currentSessionId; /** * Create a new session */ createSession(options: { sandboxId?: string; os?: "linux" | "windows"; resolution?: string; keepAlive?: number; testFile?: string; }): SessionState; /** * Get the current active session */ getCurrentSession(): SessionState | null; /** * Get a session by ID */ getSession(sessionId: string): SessionState | null; /** * Update session state */ updateSession(sessionId: string, updates: Partial): SessionState | null; /** * Mark session as active with sandbox ID */ activateSession(sessionId: string, sandboxId: string): SessionState | null; /** * Extend session expiry time by adding additional milliseconds */ extendSession(sessionId: string, additionalMs: number): SessionState | null; /** * Refresh session expiry to reset the keepAlive timer from now * Called on each command to keep session alive during active use */ refreshSession(sessionId: string): SessionState | null; /** * Check if session is still valid */ isSessionValid(sessionId: string): boolean; /** * Get time remaining until session expires */ getTimeRemaining(sessionId: string): number; /** * Mark session as expired/ended */ endSession(sessionId: string): void; /** * Delete a session */ deleteSession(sessionId: string): boolean; /** * Get session summary for status reporting */ getSessionSummary(sessionId: string): { sessionId: string; status: string; sandboxId: string | null; timeRemaining: number; } | null; } export declare const sessionManager: SessionManager;