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
65 lines • 3.07 kB
JavaScript
import { BaseToolHandler } from './base-handler.js';
import { FlutterCoreInfoHandler } from './flutter/flutter-core-info-handler.js';
import { FlutterWidgetTreeHandler } from './flutter/flutter-widget-tree-handler.js';
import { FlutterPerformanceHandler } from './flutter/flutter-performance-handler.js';
import { FlutterMemoryStateHandler } from './flutter/flutter-memory-state-handler.js';
import { FlutterQuantumHandler } from './flutter/flutter-quantum-handler.js';
/**
* Handler for all Flutter-related debugging tools
* Delegates all operations to specialized sub-handlers
*/
export class FlutterHandler extends BaseToolHandler {
localEngine;
quantumDebugger;
coreInfoHandler;
widgetTreeHandler;
performanceHandler;
memoryStateHandler;
quantumHandler;
constructor(localEngine, quantumDebugger) {
super();
this.localEngine = localEngine;
this.quantumDebugger = quantumDebugger;
this.coreInfoHandler = new FlutterCoreInfoHandler(localEngine, quantumDebugger);
this.widgetTreeHandler = new FlutterWidgetTreeHandler(localEngine, quantumDebugger);
this.performanceHandler = new FlutterPerformanceHandler(localEngine, quantumDebugger);
this.memoryStateHandler = new FlutterMemoryStateHandler(localEngine, quantumDebugger);
this.quantumHandler = new FlutterQuantumHandler(localEngine, quantumDebugger);
}
get tools() {
// Combine tools from all sub-handlers
return [
...this.coreInfoHandler.tools,
...this.widgetTreeHandler.tools,
...this.performanceHandler.tools,
...this.memoryStateHandler.tools,
...this.quantumHandler.tools
];
}
async handle(toolName, args, sessions) {
// Check if tool is handled by sub-handlers
const coreInfoTools = this.coreInfoHandler.tools.map(t => t.name);
const widgetTreeTools = this.widgetTreeHandler.tools.map(t => t.name);
const performanceTools = this.performanceHandler.tools.map(t => t.name);
const memoryStateTools = this.memoryStateHandler.tools.map(t => t.name);
const quantumTools = this.quantumHandler.tools.map(t => t.name);
if (coreInfoTools.includes(toolName)) {
return this.coreInfoHandler.handle(toolName, args, sessions);
}
if (widgetTreeTools.includes(toolName)) {
return this.widgetTreeHandler.handle(toolName, args, sessions);
}
if (performanceTools.includes(toolName)) {
return this.performanceHandler.handle(toolName, args, sessions);
}
if (memoryStateTools.includes(toolName)) {
return this.memoryStateHandler.handle(toolName, args, sessions);
}
if (quantumTools.includes(toolName)) {
return this.quantumHandler.handle(toolName, args, sessions);
}
// No more tools in main handler - all delegated to sub-handlers
throw new Error(`Unknown Flutter tool: ${toolName}`);
}
}
//# sourceMappingURL=flutter-handler.js.map