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

94 lines • 3.42 kB
export class FlutterPerformanceModule { page; performanceMetrics = { fps: 0, frameTime: 0, jank: { total: 0, severe: 0 }, memory: { heap: 0, rss: 0, external: 0 }, shaderCompilation: { compiledShaders: 0, compilationTime: 0 }, widgetRebuildCount: 0, renderTime: 0 }; async attachToPage(page) { this.page = page; await this.setupPerformanceTracking(); } async getPerformanceMetrics() { if (!this.page) return this.performanceMetrics; return await this.page.evaluate(() => { const perf = window.__flutterDebugPerf__ || {}; return { fps: perf.fps || 60, frameTime: perf.frameTime || 16.67, jank: perf.jank || { total: 0, severe: 0 }, memory: perf.memory || { heap: 0, rss: 0, external: 0 }, shaderCompilation: perf.shaderCompilation || { compiledShaders: 0, compilationTime: 0 }, widgetRebuildCount: perf.widgetRebuildCount || 0, renderTime: perf.renderTime || 0 }; }); } async detectMemoryLeaks() { if (!this.page) { return { suspectedLeaks: [], totalSuspectedLeaks: 0, memoryPressure: 'low', recommendations: [] }; } return await this.page.evaluate(() => { const memAnalysis = window.__flutterMemoryAnalysis__ || {}; return { suspectedLeaks: memAnalysis.suspectedLeaks || [], totalSuspectedLeaks: memAnalysis.totalSuspectedLeaks || 0, memoryPressure: memAnalysis.memoryPressure || 'low', recommendations: memAnalysis.recommendations || [] }; }); } async getPerformanceBaseline() { if (!this.page) { return { metric: 'fps', current: 0, baseline: 60, status: 'critical', recommendations: [] }; } return await this.page.evaluate(() => { const baseline = window.__flutterBaseline__ || {}; return { metric: baseline.metric || 'fps', current: baseline.current || 0, baseline: baseline.baseline || 60, status: baseline.status || 'critical', recommendations: baseline.recommendations || [] }; }); } async setupPerformanceTracking() { if (!this.page) return; await this.page.evaluate(() => { if (!window.__flutterDebugPerf__) { window.__flutterDebugPerf__ = { fps: 60, frameTime: 16.67, jank: { total: 0, severe: 0 }, memory: { heap: 0, rss: 0, external: 0 }, shaderCompilation: { compiledShaders: 0, compilationTime: 0 }, widgetRebuildCount: 0, renderTime: 0 }; // Set up performance monitoring if (window.performance && window.performance.mark) { window.performance.mark('flutter-perf-start'); } } }); } } //# sourceMappingURL=flutter-performance.js.map