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

73 lines • 4.05 kB
import { BaseToolHandler } from './base-handler.js'; import { AITestCoreGeneration } from '../modules/ai-test-core-generation.js'; import { AITestAnalysisIntelligence } from '../modules/ai-test-analysis-intelligence.js'; import { AITestRecordingGeneration } from '../modules/ai-test-recording-generation.js'; import { AITestVisualEnhancement } from '../modules/ai-test-visual-enhancement.js'; /** * AI Test Enhancement Handler (Issue #22) - CRITICAL MISSING COMPONENT * * Addresses user feedback "QA tool needs a lot of work" by providing intelligent automation layer * that makes QA Gates truly powerful. This handler was referenced throughout documentation but * completely missing from codebase. * * Features: * - Intelligent test generation from debugging sessions * - Visual-first testing with screenshot-based validation * - Requirements-driven automation (GitHub/Jira/Linear integration) * - AI-enhanced test maintenance and optimization * - Coverage gap analysis with machine learning * - Integration with existing QA Gates and Visual Regression infrastructure */ export class AITestEnhancementHandler extends BaseToolHandler { auditEngine; localEngine; coreGeneration; analysisIntelligence; recordingGeneration; visualEnhancement; tools = []; constructor(auditEngine, localEngine) { super(); this.auditEngine = auditEngine; this.localEngine = localEngine; this.coreGeneration = new AITestCoreGeneration(auditEngine, localEngine); this.analysisIntelligence = new AITestAnalysisIntelligence(auditEngine, localEngine); this.recordingGeneration = new AITestRecordingGeneration(auditEngine, localEngine); this.visualEnhancement = new AITestVisualEnhancement(auditEngine, localEngine); // Merge tools from all modules this.tools = [ ...this.coreGeneration.getTools(), ...this.analysisIntelligence.getTools(), ...this.recordingGeneration.getTools(), ...this.visualEnhancement.getTools() ]; } async handle(toolName, args, sessions) { const sessionId = args.sessionId; if (!sessionId || !sessions.has(sessionId)) { throw new Error(`Invalid session ID: ${sessionId}`); } // Delegate core test generation tools to modular component const coreGenerationTools = ['generate_intelligent_tests', 'generate_visual_first_tests', 'requirements_to_tests', 'auto_maintain_tests', 'optimize_test_suite']; if (coreGenerationTools.includes(toolName)) { return this.coreGeneration.handleTool(toolName, args, sessions); } // Delegate analysis and intelligence tools to modular component const analysisIntelligenceTools = ['recommend_test_evolution', 'analyze_coverage_gaps', 'detect_missing_scenarios', 'analyze_production_patterns', 'implement_continuous_learning', 'enable_predictive_analysis']; if (analysisIntelligenceTools.includes(toolName)) { return this.analysisIntelligence.handleTool(toolName, args, sessions); } // Delegate recording and generation tools to modular component const recordingGenerationTools = ['enable_autonomous_bug_discovery', 'integrate_github_issues', 'prepare_jira_integration', 'support_linear_integration', 'generate_executive_analytics', 'create_unified_reporting']; if (recordingGenerationTools.includes(toolName)) { return this.recordingGeneration.handleTool(toolName, args, sessions); } // Delegate visual enhancement tools to modular component const visualEnhancementTools = ['implement_visual_element_detection', 'implement_self_healing_tests', 'integrate_with_qa_gates', 'enhance_visual_regression']; if (visualEnhancementTools.includes(toolName)) { return this.visualEnhancement.handleTool(toolName, args, sessions); } throw new Error(`Unknown tool: ${toolName}`); } } //# sourceMappingURL=ai-test-enhancement-handler.js.map