UNPKG

jpglens

Version:

🔍 Universal AI-Powered UI Testing - See your interfaces through the lens of intelligence

138 lines 3.54 kB
/** * 🔍 jpglens - AI Analyzer Core * Universal AI-Powered UI Testing * * @author Taha Bahrami (Kaito) * @license MIT */ import { AnalysisContext, AnalysisResult, ScreenshotData, JPGLensConfig, ReportConfig } from './types.js'; /** * Core AI analysis engine for jpglens * Orchestrates AI providers and manages analysis workflow */ export declare class AIAnalyzer { private config; private providers; private primaryProvider; private fallbackProvider?; private reportGenerator; private apiHandler; constructor(config: JPGLensConfig); /** * Initialize available AI providers */ private initializeProviders; /** * Get provider by name */ private getProvider; /** * Extract provider name from model string (e.g., "openai/gpt-4" -> "openai") */ private extractProviderFromModel; /** * Main analysis method - the heart of jpglens */ analyze(screenshot: ScreenshotData, context: AnalysisContext): Promise<AnalysisResult>; /** * Analyze multiple screenshots in parallel (for journey analysis) */ analyzeMultiple(screenshots: ScreenshotData[], contexts: AnalysisContext[]): Promise<AnalysisResult[]>; /** * Generate appropriate prompt based on context */ private generatePrompt; /** * Validate analysis inputs */ private validateInputs; /** * Enhance AI result with additional processing */ private enhanceResult; /** * Parse AI response and structure it properly */ private parseAIResponse; /** * Parse raw text response from AI */ private parseTextResponse; /** * Extract issues from text by section */ private extractIssues; /** * Extract list items from a section */ private extractListItems; /** * Categorize issue by content */ private categorizeIssue; /** * Extract issue title from description */ private extractIssueTitle; /** * Assess impact based on issue content and severity */ private assessImpact; /** * Extract fix suggestion from issue text */ private extractFix; /** * Extract recommendations from text */ private extractRecommendations; /** * Categorize recommendation by type */ private categorizeRecommendation; /** * Extract implementation details */ private extractImplementation; /** * Assess recommendation impact */ private assessRecommendationImpact; /** * Assess recommendation effort */ private assessRecommendationEffort; /** * Extract specific score from text */ private extractSpecificScore; /** * Validate analysis result */ private validateResult; /** * Create error result for failed analyses */ private createErrorResult; /** * Configure reporting system */ configureReporting(config: Partial<ReportConfig>): void; /** * Get current reporting configuration */ getReportingConfig(): ReportConfig; /** * Add custom report template */ addReportTemplate(name: string, template: any): void; /** * Get API compatibility information */ getAPICompatibilityInfo(): any; /** * Manually generate report for existing result */ generateReport(result: AnalysisResult, config?: Partial<ReportConfig>): Promise<string>; } //# sourceMappingURL=ai-analyzer.d.ts.map