/** * Claude Intent Analyzer Service * Single Responsibility: Use Claude Code CLI to analyze user queries and detect intent * * This service replaces all hardcoded keyword-based intent detection with actual * Claude AI analysis, providing accurate and context-aware query understanding. */ export interface IntentAnalysis { intent: 'create' | 'modify' | 'fix' | 'delete' | 'understand' | 'analyze' | 'search' | 'general'; confidence: number; reasoning: string; requiresModifications: boolean; assumptions: string[]; ambiguities: string[]; suggestedClarifications: string[]; targetEntities: string[]; actionVerbs: string[]; } export interface TaskDecomposition { isComplex: boolean; reasoning: string; subTasks: DecomposedTask[]; } export interface DecomposedTask { id: number; type: 'analyze' | 'create' | 'modify' | 'refactor' | 'test' | 'fix' | 'document' | 'configure' | 'general'; description: string; searchTerms: string[]; priority: number; dependencies: number[]; complexity: 'low' | 'medium' | 'high'; } export interface DecompositionResult { success: boolean; decomposition?: TaskDecomposition; error?: string; fallbackUsed?: boolean; } export interface QueryAnalysisResult { success: boolean; analysis?: IntentAnalysis; error?: string; fallbackUsed?: boolean; } export declare class ClaudeIntentAnalyzer { private logger; private static instance; /** * Get singleton instance */ static getInstance(): ClaudeIntentAnalyzer; /** * Analyze a user query using Claude Code CLI * This is the main method that replaces all hardcoded intent detection */ analyzeQuery(query: string, projectContext?: string): Promise; /** * Build the prompt for Claude to analyze the query */ private buildAnalysisPrompt; /** * Parse Claude's JSON response */ private parseClaudeResponse; /** * Normalize intent string to valid enum value */ private normalizeIntent; /** * Fallback analysis when Claude is unavailable * This is minimal and should rarely be used */ private fallbackAnalysis; /** * Quick check if query is a natural language request (vs a command) * This is a simple heuristic check, not AI-based */ isNaturalLanguageQuery(input: string): boolean; /** * Decompose a complex query into sub-tasks using Claude * This replaces all hardcoded keyword matching for task decomposition */ decomposeQuery(query: string, intentAnalysis: IntentAnalysis): Promise; /** * Build the prompt for Claude to decompose the query into sub-tasks */ private buildDecompositionPrompt; /** * Parse Claude's decomposition response */ private parseDecompositionResponse; /** * Normalize task type to valid enum value */ private normalizeTaskType; /** * Normalize complexity level */ private normalizeComplexity; /** * Create a single task from the original query */ private createSingleTask; /** * Fallback decomposition when Claude is unavailable */ private fallbackDecomposition; } //# sourceMappingURL=claude-intent-analyzer.d.ts.map