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
52 lines • 1.8 kB
JavaScript
import { AIProcessor } from '../../ai/AIProcessor.js';
import { WBSTemplate } from './WBSTemplate.js';
/**
* Work Breakdown Structure (WBS) Document Processor
* Uses AIProcessor to synthesize WBS content from template and context.
*/
export class WBSProcessor {
aiProcessor;
constructor() {
this.aiProcessor = AIProcessor.getInstance();
}
async process(context) {
try {
const aiMessages = this.buildAIMessages(context);
const content = await this.aiProcessor.makeAICall(aiMessages)
.then(res => typeof res === 'string' ? res : res.content);
return {
title: 'Work Breakdown Structure (WBS)',
content
};
}
catch (error) {
console.error('Error generating Work Breakdown Structure (WBS):', error);
return {
title: 'Work Breakdown Structure (WBS)',
content: this.getErrorMessage()
};
}
}
/**
* Constructs the AI prompt messages for WBS synthesis.
*/
buildAIMessages(context) {
return [
{
role: 'system',
content: 'You are a senior project manager. Synthesize a hierarchical Work Breakdown Structure (WBS) for the project based on the template and context.'
},
{
role: 'user',
content: WBSTemplate.buildPrompt(context)
}
];
}
/**
* Returns a user-friendly error message for WBS generation failures.
*/
getErrorMessage() {
return 'An error occurred while generating the Work Breakdown Structure (WBS). Please try again or check the logs for details.';
}
}
//# sourceMappingURL=WBSProcessor.js.map