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

127 lines • 3.98 kB
/** * JavaScriptAnalysisCoordinator - Coordinates all JavaScript-related analysis engines * * This coordinator consolidates JavaScript execution tracking, async operation monitoring, * and error detection into a unified interface, reducing complexity in LocalDebugEngine. */ export class JavaScriptAnalysisCoordinator { jsExecutionEngine; asyncTrackingEngine; jsErrorDetectionEngine; constructor(jsExecutionEngine, asyncTrackingEngine, jsErrorDetectionEngine) { this.jsExecutionEngine = jsExecutionEngine; this.asyncTrackingEngine = asyncTrackingEngine; this.jsErrorDetectionEngine = jsErrorDetectionEngine; } /** * Attach all JavaScript analysis engines to the page and browser context */ async attachToPage(page, context) { this.jsExecutionEngine.attach(page, context); this.asyncTrackingEngine.attach(page); this.jsErrorDetectionEngine.attach(page); } /** * Start monitoring for JavaScript errors */ async startMonitoring() { await this.jsErrorDetectionEngine.startMonitoring(); } /** * Stop monitoring for JavaScript errors */ async stopMonitoring() { await this.jsErrorDetectionEngine.stopMonitoring(); } // JavaScript Execution Tracking Methods /** * Enable JavaScript execution tracing */ async enableJavaScriptTracing() { await this.jsExecutionEngine.enableTracing(); } /** * Disable JavaScript execution tracing */ async disableJavaScriptTracing() { await this.jsExecutionEngine.disableTracing(); } /** * Instrument a specific function for detailed tracking */ async instrumentFunction(functionPath, functionName) { await this.jsExecutionEngine.instrumentFunction(functionPath, functionName); } /** * Get the JavaScript execution trace */ async getJavaScriptExecutionTrace() { return await this.jsExecutionEngine.getExecutionTrace(); } /** * Get the JavaScript call graph */ async getJavaScriptCallGraph() { return await this.jsExecutionEngine.getCallGraph(); } /** * Get the JavaScript performance profile */ async getJavaScriptPerformanceProfile() { return await this.jsExecutionEngine.getPerformanceProfile(); } // Async Operation Tracking Methods /** * Enable async operation tracking */ async enableAsyncTracking() { await this.asyncTrackingEngine.enableTracking(); } /** * Disable async operation tracking */ async disableAsyncTracking() { await this.asyncTrackingEngine.disableTracking(); } /** * Get the async operation trace */ async getAsyncOperationTrace() { return await this.asyncTrackingEngine.getAsyncTrace(); } /** * Get a specific promise chain */ async getPromiseChain(promiseId) { return await this.asyncTrackingEngine.getPromiseChain(promiseId); } /** * Get async stack trace for a specific operation */ async getAsyncStackTrace(operationId) { return await this.asyncTrackingEngine.getAsyncStackTrace(operationId); } /** * Detect async memory leaks */ async detectAsyncLeaks() { return await this.asyncTrackingEngine.detectAsyncLeaks(); } // Error Detection Methods /** * Detect JavaScript errors and get comprehensive report */ async detectJavaScriptErrors() { // Run common issue detection await this.jsErrorDetectionEngine.detectCommonIssues(); // Get the full error report return await this.jsErrorDetectionEngine.getErrorReport(); } /** * Validate script tags on the page */ async validateScriptTags() { return await this.jsErrorDetectionEngine.validateScriptTags(); } } //# sourceMappingURL=javascript-analysis-coordinator.js.map