UNPKG

adpa-enterprise-framework-automation

Version:

Modular, standards-compliant Node.js/TypeScript automation framework for enterprise requirements, project, and data management. Provides CLI and API for BABOK v3, PMBOK 7th Edition, and DMBOK 2.0 (in progress). Production-ready Express.js API with TypeSpe

61 lines (58 loc) 2.12 kB
import { AIProcessor } from '../../ai/AIProcessor.js'; export class TroubleshootingProcessor { aiProcessor; constructor() { this.aiProcessor = AIProcessor.getInstance(); } async process(context) { try { const prompt = this.createPrompt(context); const content = await this.aiProcessor.makeAICall([ { role: 'system', content: 'You are a senior developer with expertise in debugging and troubleshooting complex systems.' }, { role: 'user', content: prompt } ]).then(res => typeof res === 'string' ? res : res.content); await this.validateOutput(content); return { title: 'Troubleshooting Guide', content }; } catch (error) { console.error('Error processing Troubleshooting Guide:', error); throw new Error(`Failed to generate Troubleshooting Guide: ${error instanceof Error ? error.message : String(error)}`); } } createPrompt(context) { return `Based on the following project context, generate a comprehensive Troubleshooting Guide. Project Context: - Name: ${context.projectName} - Type: ${context.projectType} - Description: ${context.description} The document should include: 1. Common Issues and Solutions 2. Debugging Methodologies 3. Logging and Monitoring 4. Error Analysis Techniques 5. Performance Troubleshooting 6. Environment-Specific Issues 7. Tool Recommendations 8. Escalation Procedures 9. Knowledge Base Maintenance 10. Prevention Strategies Requirements: 1. Systematic approach 2. Clear problem categories 3. Step-by-step solutions 4. Tool usage examples 5. When to escalate`; } async validateOutput(content) { if (!content || content.trim().length === 0) { throw new Error('Generated content is empty'); } if (content.length < 500) { console.warn('Generated content seems unusually short for troubleshooting guide'); } } } //# sourceMappingURL=TroubleshootingProcessor.js.map