UNPKG

@re-shell/cli

Version:

Full-stack development platform uniting microservices and microfrontends. Build complete applications with .NET (ASP.NET Core Web API, Minimal API), Java (Spring Boot, Quarkus, Micronaut, Vert.x), Rust (Actix-Web, Warp, Rocket, Axum), Python (FastAPI, Dja

212 lines (211 loc) 5.81 kB
import { EventEmitter } from 'events'; export interface TroubleshootingConfig { outputPath?: string; includeAutoDiagnostics?: boolean; includeSystemInfo?: boolean; includeNetworkTests?: boolean; includeFileSystemChecks?: boolean; includeEnvironmentChecks?: boolean; includeDependencyAnalysis?: boolean; includePerformanceTests?: boolean; includeSecurityChecks?: boolean; customChecks?: CustomCheck[]; generateInteractiveGuide?: boolean; exportFormats?: ExportFormat[]; } export interface CustomCheck { id: string; name: string; description: string; category: CheckCategory; command?: string; script?: string; validator?: (result: any) => CheckResult; autoFix?: AutoFixConfig; } export interface AutoFixConfig { command?: string; script?: string; requiresConfirmation?: boolean; description: string; riskLevel: 'low' | 'medium' | 'high'; } export type CheckCategory = 'system' | 'network' | 'filesystem' | 'environment' | 'dependencies' | 'performance' | 'security' | 'configuration' | 'integration'; export type ExportFormat = 'html' | 'pdf' | 'markdown' | 'json' | 'interactive'; export interface CheckResult { status: 'pass' | 'warning' | 'fail' | 'info'; message: string; details?: any; suggestion?: string; autoFixAvailable?: boolean; documentation?: string; } export interface DiagnosticCheck { id: string; name: string; category: CheckCategory; description: string; run: () => Promise<CheckResult>; autoFix?: () => Promise<boolean>; } export interface TroubleshootingGuide { id: string; title: string; description: string; symptoms: string[]; causes: TroubleCause[]; solutions: TroubleSolution[]; diagnostics: DiagnosticCheck[]; relatedGuides?: string[]; tags: string[]; difficulty: 'beginner' | 'intermediate' | 'advanced'; } export interface TroubleCause { id: string; description: string; probability: 'low' | 'medium' | 'high'; checkCommand?: string; diagnosticId?: string; } export interface TroubleSolution { id: string; description: string; steps: SolutionStep[]; effectiveness: 'low' | 'medium' | 'high'; riskLevel: 'low' | 'medium' | 'high'; timeEstimate: string; prerequisites?: string[]; } export interface SolutionStep { order: number; description: string; command?: string; code?: string; verification?: string; screenshot?: string; video?: string; } export interface DiagnosticReport { timestamp: Date; systemInfo: SystemInfo; diagnosticResults: DiagnosticResult[]; recommendations: Recommendation[]; autoFixesAvailable: AutoFix[]; exportPath?: string; } export interface SystemInfo { platform: string; arch: string; nodeVersion: string; npmVersion: string; cliVersion: string; memory: MemoryInfo; cpu: CPUInfo; network: NetworkInfo; disk: DiskInfo; } export interface MemoryInfo { total: number; free: number; used: number; percentage: number; } export interface CPUInfo { model: string; cores: number; speed: number; loadAverage: number[]; } export interface NetworkInfo { interfaces: NetworkInterface[]; connectivity: boolean; latency?: number; dns: string[]; } export interface NetworkInterface { name: string; address: string; netmask: string; family: string; internal: boolean; } export interface DiskInfo { total: number; free: number; used: number; percentage: number; path: string; } export interface DiagnosticResult { checkId: string; checkName: string; category: CheckCategory; result: CheckResult; duration: number; timestamp: Date; } export interface Recommendation { id: string; priority: 'low' | 'medium' | 'high' | 'critical'; title: string; description: string; actions: string[]; impact: string; effort: 'low' | 'medium' | 'high'; } export interface AutoFix { diagnosticId: string; title: string; description: string; command: string; riskLevel: 'low' | 'medium' | 'high'; requiresConfirmation: boolean; } export interface TroubleshootingGenerationResult { guidesGenerated: number; diagnosticsCreated: number; autoFixesConfigured: number; outputPath: string; formats: string[]; report?: DiagnosticReport; } export declare class TroubleshootingGuideGenerator extends EventEmitter { private config; private diagnostics; private guides; private customChecks; constructor(config?: TroubleshootingConfig); generateTroubleshootingGuides(): Promise<TroubleshootingGenerationResult>; private initializeBuiltInDiagnostics; private initializeBuiltInGuides; private addDiagnostic; private addGuide; private runDiagnostics; private collectSystemInfo; private getNpmVersion; private getCliVersion; private getDiskInfo; private getNetworkInterfaces; private checkConnectivity; private getDnsServers; private runCustomCheck; private getUniqueCategories; private generateCategoryGuides; private generateGuideFile; private generateCategoryIndex; private generateIndex; private generateNavigation; private exportGuides; private exportToHtml; private generateDiagnosticsHtml; private generateGuidesHtml; private exportToPdf; private exportToJson; private generateInteractiveGuide; private generateSymptomsList; private saveReport; private countAutoFixes; runDiagnostic(diagnosticId: string): Promise<CheckResult>; runAutoFix(diagnosticId: string): Promise<boolean>; searchGuides(query: string): Promise<TroubleshootingGuide[]>; }