import { VoiceCommand, CommandDefinition, CommandComplexity, BusinessContext, EntityType } from '../../types/src/types'; export interface CommandClassification { complexity: CommandComplexity; canHandle: boolean; shouldFallback: boolean; fallbackReason?: string; confidence: number; businessRelevance: number; requiredEntities: EntityType[]; detectedKeywords: string[]; } export interface ClassificationConfig { confidenceThreshold: number; businessRelevanceThreshold: number; enableSmartFallback: boolean; strictMode: boolean; } /** * Intelligent command classifier that determines what voice package can handle * vs what needs business API integration */ export declare class CommandClassifier { private businessContext; private config; private businessKeywords; private simpleKeywords; private fallbackPhrases; constructor(businessContext: BusinessContext, config?: ClassificationConfig); /** * Classify a command to determine handling capability */ classifyCommand(command: VoiceCommand, commandDefinition?: CommandDefinition): CommandClassification; /** * Classify a command with known definition */ private classifyDefinedCommand; /** * Classify an unknown command */ private classifyUnknownCommand; /** * Apply smart fallback logic based on confidence and context */ private applySmartFallback; /** * Calculate business relevance score (0-1) */ private calculateBusinessRelevance; /** * Detect keywords in text */ private detectKeywords; /** * Check if command is simple and can be handled by voice package */ private isSimpleCommand; /** * Detect what entities are likely required for this command */ private detectRequiredEntities; /** * Determine specific fallback reason based on analysis */ private determineFallbackReason; /** * Update business keywords based on business context */ updateBusinessContext(context: BusinessContext): void; /** * Add domain-specific keywords */ private addDomainKeywords; /** * Add capability-specific keywords */ private addCapabilityKeywords; /** * Get classification statistics for debugging */ getClassificationStats(commands: VoiceCommand[]): { totalCommands: number; canHandle: number; shouldFallback: number; avgConfidence: number; avgBusinessRelevance: number; complexityBreakdown: Record; topFallbackReasons: Array<{ reason: string; count: number; }>; }; /** * Update configuration */ updateConfig(newConfig: Partial): void; /** * Add custom business keywords */ addCustomKeywords(keywords: Record): void; /** * Get current business keywords */ getBusinessKeywords(): Record; }