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

216 lines • 6.84 kB
/** * FlutterAnalysisCoordinator - Coordinates all Flutter-related analysis engines * * This coordinator consolidates Flutter debugging capabilities including basic engine * operations, enhanced debugging features, and state capture into a unified interface, * reducing complexity in LocalDebugEngine. */ export class FlutterAnalysisCoordinator { flutterEngine; flutterEnhancedEngine; stateCapture; constructor(flutterEngine, flutterEnhancedEngine, stateCapture) { this.flutterEngine = flutterEngine; this.flutterEnhancedEngine = flutterEnhancedEngine; this.stateCapture = stateCapture; } /** * Detect if the current page is a Flutter Web application */ async detectFlutterWeb(page) { if (!this.flutterEngine) { return false; } return await this.flutterEngine.detectFlutterWeb(page); } /** * Attach enhanced Flutter engine to the page */ async attachEnhancedEngineToPage(page) { if (this.flutterEnhancedEngine) { await this.flutterEnhancedEngine.attachToPage(page); } } /** * Find the Flutter DevTools debug port */ async findDebugPort(page) { if (!this.flutterEngine) { return null; } return await this.flutterEngine.findDebugPort(page); } /** * Connect to Flutter DevTools at the specified port */ async connectToDevTools(port) { if (this.flutterEngine) { await this.flutterEngine.connect(port); } } // Basic Flutter Engine Methods /** * Get the Flutter widget tree */ async getFlutterWidgetTree() { if (!this.flutterEngine) { throw new Error('Flutter engine not initialized'); } return await this.flutterEngine.getWidgetTree(); } /** * Get Flutter performance information */ async getFlutterPerformance() { if (!this.flutterEngine) { throw new Error('Flutter engine not initialized'); } return await this.flutterEngine.getPerformanceInfo(); } /** * Inspect a specific Flutter widget by ID */ async inspectFlutterWidget(widgetId) { if (!this.flutterEngine) { throw new Error('Flutter engine not initialized'); } return await this.flutterEngine.inspectWidget(widgetId); } /** * Highlight a specific Flutter widget by ID */ async highlightFlutterWidget(widgetId) { if (!this.flutterEngine) { throw new Error('Flutter engine not initialized'); } await this.flutterEngine.highlightWidget(widgetId); } /** * Get Flutter memory usage information */ async getFlutterMemoryUsage() { if (!this.flutterEngine) { throw new Error('Flutter engine not initialized'); } return await this.flutterEngine.getMemoryUsage(); } // Enhanced Flutter Engine Methods /** * Get Flutter configuration */ async getFlutterConfig() { if (!this.flutterEnhancedEngine) { throw new Error('Enhanced Flutter engine not initialized'); } return await this.flutterEnhancedEngine.getFlutterConfig(); } /** * Get Flutter diagnostics */ async getFlutterDiagnostics() { if (!this.flutterEnhancedEngine) { throw new Error('Enhanced Flutter engine not initialized'); } return await this.flutterEnhancedEngine.getFlutterDiagnostics(); } /** * Get Flutter performance metrics */ async getFlutterPerformanceMetrics() { if (!this.flutterEnhancedEngine) { throw new Error('Enhanced Flutter engine not initialized'); } return await this.flutterEnhancedEngine.getPerformanceMetrics(); } /** * Detect Flutter Web specific issues */ async detectFlutterWebIssues() { if (!this.flutterEnhancedEngine) { throw new Error('Enhanced Flutter engine not initialized'); } return await this.flutterEnhancedEngine.detectFlutterWebIssues(); } /** * Analyze the Flutter widget tree */ async analyzeFlutterWidgetTree() { if (!this.flutterEnhancedEngine) { throw new Error('Enhanced Flutter engine not initialized'); } return await this.flutterEnhancedEngine.analyzeWidgetTree(); } /** * Detect Flutter memory leaks */ async detectFlutterMemoryLeaks() { if (!this.flutterEnhancedEngine) { throw new Error('Enhanced Flutter engine not initialized'); } return await this.flutterEnhancedEngine.detectMemoryLeaks(); } /** * Analyze Flutter asset loading */ async analyzeFlutterAssetLoading() { if (!this.flutterEnhancedEngine) { throw new Error('Enhanced Flutter engine not initialized'); } return await this.flutterEnhancedEngine.analyzeAssetLoading(); } /** * Get Flutter browser compatibility information */ async getFlutterBrowserCompatibility() { if (!this.flutterEnhancedEngine) { throw new Error('Enhanced Flutter engine not initialized'); } return await this.flutterEnhancedEngine.getBrowserCompatibility(); } /** * Get Flutter health check information */ async getFlutterHealthCheck() { if (!this.flutterEnhancedEngine) { throw new Error('Enhanced Flutter engine not initialized'); } return await this.flutterEnhancedEngine.getFlutterHealthCheck(); } /** * Get Flutter performance baseline */ async getFlutterPerformanceBaseline() { if (!this.flutterEnhancedEngine) { throw new Error('Enhanced Flutter engine not initialized'); } return await this.flutterEnhancedEngine.getPerformanceBaseline(); } // State Capture Integration /** * Capture Flutter state snapshot */ async captureFlutterStateSnapshot() { return await this.stateCapture.captureFlutterStateSnapshot(); } // Connection Status Methods /** * Check if Flutter DevTools is connected */ isFlutterConnected() { return this.flutterEngine !== null && this.flutterEngine.isConnected === true; } /** * Check if Flutter framework is detected */ isFlutterDetected() { return this.flutterEngine !== null; } /** * Set the Flutter engines (used during framework detection) */ setEngines(flutterEngine, flutterEnhancedEngine) { this.flutterEngine = flutterEngine; this.flutterEnhancedEngine = flutterEnhancedEngine; } } //# sourceMappingURL=flutter-analysis-coordinator.js.map