UNPKG

ai-debug-local-mcp

Version:

🎯 ENHANCED AI GUIDANCE v4.1.2: Dramatically improved tool descriptions help AI users choose the right tools instead of 'close enough' options. Ultra-fast keyboard automation (10x speed), universal recording, multi-ecosystem debugging support, and compreh

89 lines • 2.54 kB
import { ResourceManager, TrackedResource } from './resource-manager.js'; export interface SessionState { sessionId: string; createdAt: Date; lastUsed: Date; resources: TrackedResource[]; status: 'active' | 'cleaning' | 'closed'; } export interface SessionResourceStats { totalSessions: number; activeSessions: number; totalResources: number; resourcesByType: Record<string, number>; averageResourcesPerSession: number; sessionAges: number[]; } /** * SessionResourceManager - Manages resources at the session level * * Provides a higher-level interface for resource management that * coordinates with the global ResourceManager */ export declare class SessionResourceManager { private sessions; private resourceManager; private cleanupCallbacks; constructor(resourceManager?: ResourceManager); /** * Create a new session */ createSession(sessionId: string): Promise<SessionState>; /** * Get session by ID */ getSession(sessionId: string): SessionState | undefined; /** * Attach resource to session */ attachResource(sessionId: string, resourceType: 'page' | 'browser' | 'context', resource: any): Promise<void>; /** * Get all resources for a session */ getSessionResources(sessionId: string): TrackedResource[]; /** * Update session last used time */ touchSession(sessionId: string): void; /** * Cleanup session and all its resources */ cleanupSession(sessionId: string): Promise<void>; /** * Cleanup all sessions */ cleanupAll(): Promise<void>; /** * Find and cleanup stale sessions */ cleanupStaleSessions(maxAgeMinutes?: number): Promise<number>; /** * Get session statistics */ getSessionStats(): SessionResourceStats; /** * Check if session exists and is active */ isSessionActive(sessionId: string): boolean; /** * Get all active session IDs */ getActiveSessionIds(): string[]; /** * Register cleanup callback */ registerCleanupCallback(callback: (sessionId: string) => Promise<void>): void; /** * Get the underlying ResourceManager */ getResourceManager(): ResourceManager; /** * Clear all sessions (for testing) */ clear(): void; } /** * Global session resource manager instance */ export declare const globalSessionResourceManager: SessionResourceManager; //# sourceMappingURL=session-resource-manager.d.ts.map