codecrucible-synth
Version:
Production-Ready AI Development Platform with Multi-Voice Synthesis, Smithery MCP Integration, Enterprise Security, and Zero-Timeout Reliability
149 lines • 4.33 kB
TypeScript
/**
* Context-Aware CLI Integration - Enhanced CLI with Project Intelligence
* Iteration 3: Add enhanced context awareness and project intelligence
*/
import { EventEmitter } from 'events';
import { ProjectIntelligence } from './project-intelligence-system.js';
export interface ContextAwareOptions {
enableIntelligence?: boolean;
maxContextFiles?: number;
contextDepth?: number;
intelligentSuggestions?: boolean;
projectAnalysis?: boolean;
smartNavigation?: boolean;
contextualRecommendations?: boolean;
}
export interface ContextualPromptEnhancement {
originalPrompt: string;
enhancedPrompt: string;
contextAdded: ContextInformation;
confidence: number;
suggestions: string[];
}
export interface ContextInformation {
projectType: string;
primaryLanguage: string;
frameworks: string[];
architecture: string;
relevantFiles: string[];
codePatterns: string[];
dependencies: string[];
recommendations: string[];
}
export interface SmartSuggestion {
type: 'command' | 'file' | 'pattern' | 'improvement';
title: string;
description: string;
action?: string;
confidence: number;
rationale: string;
}
export interface NavigationContext {
currentPath: string;
relatedFiles: string[];
suggestedFiles: string[];
keyDirectories: string[];
navigationHistory: string[];
}
export interface IntelligentCommand {
command: string;
description: string;
examples: string[];
contextRelevance: number;
suggestedArgs: string[];
}
export declare class ContextAwareCLIIntegration extends EventEmitter {
private logger;
private intelligenceSystem;
private projectCache;
private contextHistory;
private navigationHistory;
private currentWorkingDir;
constructor();
/**
* Initialize context-aware CLI with project intelligence
*/
initialize(workingDir?: string, options?: ContextAwareOptions): Promise<void>;
/**
* Load or update project intelligence
*/
loadProjectIntelligence(projectPath: string, options?: ContextAwareOptions): Promise<ProjectIntelligence>;
/**
* Enhance user prompts with project context
*/
enhancePromptWithContext(prompt: string, options?: ContextAwareOptions): Promise<ContextualPromptEnhancement>;
/**
* Build contextual information for a given prompt
*/
private buildContextInformation;
/**
* Find files relevant to the user's prompt
*/
private findRelevantFiles;
/**
* Identify code patterns relevant to the prompt
*/
private identifyRelevantPatterns;
/**
* Generate contextual recommendations
*/
private generateContextualRecommendations;
/**
* Construct enhanced prompt with context
*/
private constructEnhancedPrompt;
/**
* Generate smart suggestions based on prompt and project context
*/
generateSmartSuggestions(prompt: string, intelligence: ProjectIntelligence): Promise<SmartSuggestion[]>;
/**
* Display project overview
*/
private displayProjectOverview;
/**
* Get navigation context for current directory
*/
getNavigationContext(): Promise<NavigationContext>;
/**
* Get intelligent command suggestions
*/
getIntelligentCommands(context?: string): Promise<IntelligentCommand[]>;
/**
* Calculate context confidence score
*/
private calculateContextConfidence;
/**
* Get basic commands when no project intelligence available
*/
private getBasicCommands;
/**
* Get framework-specific commands
*/
private getFrameworkCommands;
/**
* Get language-specific commands
*/
private getLanguageCommands;
/**
* Get empty context for fallback
*/
private getEmptyContext;
/**
* Update navigation history
*/
updateNavigationHistory(path: string): void;
/**
* Get cached project intelligence
*/
getProjectIntelligence(path?: string): ProjectIntelligence | null;
/**
* Clear project cache
*/
clearProjectCache(path?: string): void;
/**
* Get system metrics
*/
getMetrics(): any;
}
export default ContextAwareCLIIntegration;
//# sourceMappingURL=context-aware-cli-integration.d.ts.map