UNPKG

blowback-context

Version:

MCP server that integrates with FE development server for Cursor

67 lines (66 loc) 1.87 kB
import { ContextInstance, ContextCreateOptions, ContextOperationResult, ContextListOptions, ContextStats, SharedBrowserInstance } from '../types/browser.js'; /** * Context manager for handling multiple browser contexts with shared browser instance */ export declare class ContextManager { private contexts; private sharedBrowser; private readonly MAX_CONTEXTS; constructor(); /** * Initialize context manager and restore persisted contexts */ initialize(): Promise<void>; /** * Find an available port for CDP debugging */ private findAvailablePort; /** * Ensure shared browser instance exists */ private ensureSharedBrowser; /** * Create a new context instance */ createContext(options: ContextCreateOptions): Promise<ContextOperationResult>; /** * Get context instance by ID */ getContext(contextId: string): ContextInstance | null; /** * Get all contexts matching filter options */ listContexts(options?: ContextListOptions): ContextInstance[]; /** * Close and remove context instance */ closeContext(contextId: string): Promise<ContextOperationResult>; /** * Check if context exists and is active */ hasContext(contextId: string): boolean; /** * Get most recently used context */ getMostRecentContext(): ContextInstance | null; /** * Get context statistics */ getContextStats(contextId?: string): ContextStats[]; /** * Clean up all contexts and shared browser */ private cleanup; /** * Get total context count */ getContextCount(): number; /** * Get maximum context limit */ getMaxContexts(): number; /** * Get shared browser information */ getSharedBrowserInfo(): SharedBrowserInstance | null; }