humanbehavior-js
Version:
SDK for HumanBehavior session and event recording
145 lines • 4.29 kB
TypeScript
/**
* AI-Enhanced HumanBehavior SDK Auto-Installation Wizard
*
* This wizard uses AI to intelligently detect frameworks, analyze code patterns,
* and generate optimal integration code that's both future-proof and backward-compatible.
*
* 🚀 KEY FEATURES:
* - AI-powered framework detection beyond package.json
* - Intelligent code pattern analysis
* - Future-proof integration strategies
* - Backward compatibility with legacy frameworks
* - Adaptive code generation for new frameworks
* - Smart conflict resolution
* - Learning from user feedback
* - Centralized AI service (no user API keys required)
*/
import { AutoInstallationWizard, FrameworkInfo, InstallationResult } from '../core/install-wizard';
export interface AICodeAnalysis {
framework: FrameworkInfo;
confidence: number;
patterns: string[];
conflicts: string[];
recommendations: string[];
integrationStrategy: 'provider' | 'plugin' | 'module' | 'script' | 'standalone';
compatibilityMode: 'modern' | 'legacy' | 'hybrid';
}
export interface AIInstallationResult extends InstallationResult {
aiAnalysis: AICodeAnalysis;
learningData: {
patterns: string[];
framework: string;
success: boolean;
userFeedback?: string;
};
}
/**
* Centralized AI Service Interface
* This runs on your backend infrastructure, not in the user's environment
*/
interface CentralizedAIService {
analyzeCodePatterns(codeSamples: string[]): Promise<AICodeAnalysis>;
resolveConflicts(conflicts: string[], framework: FrameworkInfo): Promise<string[]>;
generateOptimizations(framework: FrameworkInfo, patterns: string[]): Promise<string[]>;
}
export declare class AIEnhancedInstallationWizard extends AutoInstallationWizard {
private aiService;
private learningCache;
private patternDatabase;
constructor(apiKey: string, projectRoot?: string, aiService?: CentralizedAIService);
/**
* AI-enhanced installation with intelligent analysis
*/
install(): Promise<AIInstallationResult>;
/**
* AI-powered code analysis using centralized service
*/
performAICodeAnalysis(): Promise<AICodeAnalysis>;
/**
* Scan project files for analysis
*/
private scanProjectFiles;
/**
* Check if file is relevant for analysis
*/
private isRelevantFile;
/**
* Extract code samples for AI analysis
*/
private extractCodeSamples;
/**
* Extract relevant code patterns
*/
private extractCodePatterns;
/**
* AI-enhanced framework detection
*/
private detectFrameworkWithAI;
/**
* Generate AI-optimized modifications
*/
private generateAIOptimizedModifications;
/**
* Enhance modification with AI insights
*/
private enhanceModificationWithAI;
/**
* Generate AI-specific optimizations
*/
private generateAIOptimizations;
/**
* Apply modifications with AI conflict resolution
*/
private applyModificationsWithAI;
/**
* Detect potential conflicts
*/
private detectConflicts;
/**
* Resolve conflicts with AI
*/
private resolveConflicts;
/**
* Apply single modification
*/
private applyModification;
/**
* Generate AI-enhanced next steps
*/
private generateAINextSteps;
/**
* Learn from installation for future improvements
*/
private learnFromInstallation;
/**
* Load learning data from disk
*/
private loadLearningData;
/**
* Save learning data to disk
*/
private saveLearningData;
/**
* Get AI insights for a specific framework
*/
getAIInsights(frameworkName: string): any[];
/**
* Get learning statistics
*/
getLearningStats(): any;
}
/**
* Browser-based AI installation wizard
*/
export declare class AIBrowserInstallationWizard {
private apiKey;
private aiService;
constructor(apiKey: string, aiService?: CentralizedAIService);
install(): Promise<AIInstallationResult>;
private performBrowserAIAnalysis;
private detectBrowserFramework;
private analyzeBrowserPatterns;
private generateAIBrowserModifications;
}
export {};
//# sourceMappingURL=ai-install-wizard.d.ts.map