/** * Session caching for Scrapeless Browser Skills * Reduces API calls by caching active session information */ import type { SessionInfo } from './api-client.js'; export interface CachedSession { sessionId: string; createdAt: Date; status: string; name?: string; metadata?: Record; lastUsed: Date; cdpUrl?: string; } export declare class SessionCache { private static instance; private cache; private maxAge; private maxSize; private constructor(); static getInstance(): SessionCache; /** * Set cache configuration */ configure(options: { maxAge?: number; maxSize?: number; }): void; /** * Add or update a session in the cache */ set(sessionInfo: SessionInfo, cdpUrl?: string): void; /** * Get a session from the cache */ get(sessionId: string): CachedSession | null; /** * Get all cached sessions */ getAll(): CachedSession[]; /** * Get all running sessions from cache */ getRunning(): CachedSession[]; /** * Get the latest running session from cache */ getLatestRunning(): CachedSession | null; /** * Remove a session from the cache */ remove(sessionId: string): void; /** * Update session status */ updateStatus(sessionId: string, status: string): void; /** * Clear all cached sessions */ clear(): void; /** * Get cache statistics */ getStats(): { total: number; running: number; expired: number; oldestEntry: Date | null; newestEntry: Date | null; }; /** * Check if a cached session is expired */ private isExpired; /** * Clean up expired sessions and enforce size limit */ private cleanup; } export declare const sessionCache: SessionCache; /** * Configure the global session cache */ export declare function configureSessionCache(options: { maxAge?: number; maxSize?: number; }): void; //# sourceMappingURL=session-cache.d.ts.map