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

141 lines • 4.07 kB
/** * Intelligent Agent Router * * Enhanced routing algorithms that learn from delegation patterns and optimize * agent selection through machine learning techniques, context analysis, and * adaptive decision making. */ export interface RoutingContext { taskType: string; userIntent: string; projectContext?: { framework: string; language: string; complexity: 'simple' | 'moderate' | 'complex'; }; sessionHistory: string[]; performanceConstraints: { maxTimeMs: number; tokenBudget: number; qualityThreshold: number; }; } export interface AgentCapabilityProfile { agentType: string; expertiseDomains: string[]; averageSuccessRate: number; averageExecutionTime: number; contextSpecializations: Map<string, number>; learningMetrics: { improvementRate: number; adaptabilityScore: number; consistencyScore: number; }; } export interface RoutingDecision { selectedAgent: string; confidence: number; reasoning: string[]; alternativeAgents: Array<{ agent: string; score: number; reason: string; }>; expectedPerformance: { successProbability: number; estimatedTimeMs: number; qualityScore: number; }; } export interface LearningPattern { contextSignature: string; successfulAgents: Map<string, number>; failurePatterns: string[]; adaptiveWeights: Map<string, number>; confidenceHistory: number[]; } export declare class IntelligentAgentRouter { private agentProfiles; private learningPatterns; private contextAnalyzer; private adaptiveWeights; private routingHistory; private performanceTracker; constructor(); /** * Initialize agent capability profiles with baseline data */ private initializeAgentProfiles; /** * Initialize adaptive weights for different routing factors */ private initializeAdaptiveWeights; /** * Intelligent agent selection with machine learning-based optimization */ selectOptimalAgent(context: RoutingContext): Promise<RoutingDecision>; /** * Score agents based on multiple factors and context analysis */ private scoreAgentsForContext; /** * Calculate comprehensive score for an agent given the context */ private calculateAgentScore; /** * Apply machine learning enhancements based on historical patterns */ private applyMachineLearningEnhancements; /** * Make final routing decision with confidence and alternatives */ private makeRoutingDecision; /** * Calculate context match score for agent specialization */ private calculateContextMatchScore; /** * Calculate domain expertise match score */ private calculateDomainExpertiseScore; /** * Calculate confidence based on historical data and current context */ private calculateConfidence; /** * Record routing decision for learning */ private recordRoutingDecision; /** * Update learning patterns based on routing decisions */ private updateLearningPattern; /** * Update adaptive weights based on decision outcomes */ private updateAdaptiveWeights; /** * Normalize adaptive weights to ensure they sum to 1 */ private normalizeAdaptiveWeights; /** * Get current performance metrics and learning status */ getIntelligenceMetrics(): { totalDecisions: number; averageConfidence: number; learningPatterns: number; adaptiveWeights: Map<string, number>; agentPerformance: Map<string, { successRate: number; avgTime: number; }>; }; private hasFailurePattern; private getAdaptiveBoost; private calculateSelectionConfidence; private generateReasoningExplanation; private generateAlternativeReason; private estimatePerformance; } //# sourceMappingURL=intelligent-agent-router.d.ts.map