/** * Session Manager * * Manages multiple parallel browser sessions for NotebookLM API * * Features: * - Session lifecycle management * - Auto-cleanup of inactive sessions * - Resource limits (max concurrent sessions) * - Shared PERSISTENT browser fingerprint (ONE context for all sessions) * * Based on the Python implementation from session_manager.py */ import type { AuthManager } from "../auth/auth-manager.js"; import { BrowserSession } from "./browser-session.js"; import type { SessionInfo } from "../types.js"; export declare class SessionManager { private authManager; private sharedContextManager; private sessions; private maxSessions; private sessionTimeout; private cleanupInterval?; constructor(authManager: AuthManager); /** * Generate a unique session ID */ private generateSessionId; /** * Get existing session or create a new one * * @param sessionId Optional session ID to reuse existing session * @param notebookUrl Notebook URL for the session * @param overrideHeadless Optional override for headless mode (true = show browser) */ getOrCreateSession(sessionId?: string, notebookUrl?: string, overrideHeadless?: boolean): Promise; /** * Get an existing session by ID */ getSession(sessionId: string): BrowserSession | null; /** * Close and remove a specific session */ closeSession(sessionId: string): Promise; /** * Close all sessions that are using the provided notebook URL */ closeSessionsForNotebook(url: string): Promise; /** * Clean up all inactive sessions */ cleanupInactiveSessions(): Promise; /** * Clean up the oldest session to make space */ private cleanupOldestSession; /** * Close all sessions (used during shutdown) */ closeAllSessions(): Promise; /** * Get all sessions info */ getAllSessionsInfo(): SessionInfo[]; /** * Get aggregate stats */ getStats(): { active_sessions: number; max_sessions: number; session_timeout: number; oldest_session_seconds: number; total_messages: number; }; } //# sourceMappingURL=session-manager.d.ts.map