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
35 lines • 1.5 kB
JavaScript
import { getAIProcessor } from '../../ai/AIProcessor.js';
import { UnderlyingCompetenciesTemplate } from './UnderlyingCompetenciesTemplate.js';
/**
* Processor for the BABOK Underlying Competencies document.
* Uses AIProcessor for enhanced content, with fallback to the template.
*/
export class UnderlyingCompetenciesProcessor {
async process(context) {
return this.generate(context);
}
async generate(context) {
const template = new UnderlyingCompetenciesTemplate();
const aiProcessor = getAIProcessor();
let content;
try {
// Use the template to generate a user prompt for the AI
const userPrompt = template.generateContent(context);
const systemPrompt = 'You are an expert business analyst. Generate a standards-compliant BABOK Underlying Competencies document in markdown.';
const messages = aiProcessor.createMessages(systemPrompt, userPrompt);
const response = await aiProcessor.makeAICall(messages);
content = aiProcessor.extractContent(response);
}
catch (err) {
content = template.generateContent(context);
}
if (!content || typeof content !== 'string' || content.length < 100) {
content = template.generateContent(context);
}
return {
title: 'Underlying Competencies (BABOK v3)',
content
};
}
}
//# sourceMappingURL=UnderlyingCompetenciesProcessor.js.map