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

1,277 lines • 81.1 kB
/** * Interactive CLI Menu System * * Provides a Yeoman-style interactive CLI interface for the ADPA system. * This is the main entry point for the interactive menu functionality. * * @version 1.0.0 * @author ADPA Team */ import * as readline from 'readline'; import { EventEmitter } from 'events'; import { CommandIntegrationService } from './CommandIntegration.js'; import { InteractiveErrorHandler } from './InteractiveErrorHandler.js'; import { EnhancedPromptService } from './EnhancedPromptService.js'; /** * Main Interactive Menu System Class */ export class InteractiveMenuSystem extends EventEmitter { rl; navigationStack = []; currentMenu; menus = new Map(); systemStatus; commandIntegration; promptService; constructor() { super(); this.rl = readline.createInterface({ input: process.stdin, output: process.stdout }); this.systemStatus = { aiProviderConfigured: false, projectInitialized: false, integrationsConfigured: false, documentsGenerated: 0 }; this.commandIntegration = new CommandIntegrationService(); this.promptService = new EnhancedPromptService(this.rl); this.initializeMenus(); } /** * Start the interactive menu system */ async start() { console.log('šŸš€ Starting ADPA Interactive CLI...\n'); // Load system status await this.loadSystemStatus(); // Navigate to main menu await this.navigateTo('main-menu'); } /** * Stop the interactive menu system */ async stop() { this.promptService.close(); this.rl.close(); console.log('\nšŸ‘‹ Thank you for using ADPA Interactive CLI!'); } /** * Navigate to a specific menu */ async navigateTo(menuId, params) { const menu = this.menus.get(menuId); if (!menu) { console.error(`āŒ Menu not found: ${menuId}`); return; } this.navigationStack.push(menuId); this.currentMenu = menuId; await this.renderMenu(menu); await this.handleMenuInput(menu); } /** * Go back to previous menu */ async goBack() { if (this.navigationStack.length > 1) { this.navigationStack.pop(); // Remove current const previous = this.navigationStack.pop(); // Get previous if (previous) { await this.navigateTo(previous); } } else { console.log('šŸ“ Already at the top level menu'); await this.navigateTo('main-menu'); } } /** * Go to main menu */ async goHome() { this.navigationStack = []; await this.navigateTo('main-menu'); } /** * Render a menu to the console */ async renderMenu(menu) { this.clearScreen(); // Show breadcrumb if enabled if (menu.showBreadcrumb && this.navigationStack.length > 1) { this.renderBreadcrumb(); } // Render menu header this.renderMenuHeader(menu.title); // Render menu items for (const item of menu.items) { this.renderMenuItem(item); } // Render menu footer this.renderMenuFooter(); // Show status bar if enabled if (menu.showStatusBar) { this.renderStatusBar(); } } /** * Handle user input for a menu */ async handleMenuInput(menu) { while (true) { try { // Use enhanced prompt service for menu choice const validChoices = menu.items.map(item => item.key); const result = await this.promptService.promptMenuChoice('Select an option (or type "back", "home", "help", "exit"): ', validChoices); if (!result.success) { if (result.cancelled) { console.log('🚫 Operation cancelled by user.'); await this.goBack(); return; } console.log(`āŒ ${result.error}`); console.log('šŸ’” Please try again or type "help" for assistance.'); continue; } const sanitizedChoice = result.value; // Handle special navigation commands switch (sanitizedChoice) { case 'back': case 'b': await this.goBack(); return; case 'home': case 'h': await this.goHome(); return; case 'help': case '?': await this.showNavigationHelp(); continue; case 'exit': case 'quit': case 'q': await this.stop(); process.exit(0); return; case 'status': case 's': await this.showSystemStatus(); continue; case 'refresh': case 'r': await this.loadSystemStatus(); await this.renderMenu(menu); continue; } // Handle numeric menu selections const selectedItem = menu.items.find(item => item.key === sanitizedChoice); if (!selectedItem) { // This shouldn't happen due to validation, but handle it gracefully console.log('āŒ Invalid choice. Please try again.'); continue; } if (!selectedItem.enabled) { console.log('āš ļø This option is currently disabled.'); console.log('šŸ’” Check system status or configuration to enable this option.'); await this.pause(); continue; } // Execute the menu action with error handling const success = await this.executeMenuActionWithErrorHandling(selectedItem.action, menu.id); if (success) { return; // Action completed successfully } // If action failed, continue the menu loop } catch (error) { const context = { operation: 'menu input handling', menuId: menu.id, timestamp: new Date() }; const interactiveError = InteractiveErrorHandler.handleUnknownError(error, context); await InteractiveErrorHandler.displayError(interactiveError); const action = await InteractiveErrorHandler.getRecoveryAction(interactiveError, this.promptForChoice.bind(this)); switch (action) { case 'retry': continue; case 'back': await this.goBack(); return; case 'exit': await this.stop(); process.exit(0); return; case 'help': await this.showNavigationHelp(); continue; } } } } /** * Execute a menu action with enhanced error handling */ async executeMenuActionWithErrorHandling(action, menuId) { const context = { operation: `execute ${action.type} action`, menuId, timestamp: new Date() }; try { switch (action.type) { case 'navigate': if (action.target) { await this.navigateTo(action.target); return true; } break; case 'function': if (action.handler) { await this.executeFunctionWithErrorHandling(action.handler, context); return true; } break; case 'command': if (action.command) { await this.executeCommandWithErrorHandling(action.command, action.args || [], context); return true; } break; default: console.log('āŒ Unknown action type'); return false; } } catch (error) { const interactiveError = InteractiveErrorHandler.handleUnknownError(error, context); await InteractiveErrorHandler.displayError(interactiveError); const recoveryAction = await InteractiveErrorHandler.getRecoveryAction(interactiveError, this.promptForChoice.bind(this)); switch (recoveryAction) { case 'retry': return await this.executeMenuActionWithErrorHandling(action, menuId); case 'back': await this.goBack(); return true; case 'exit': await this.stop(); process.exit(0); return true; case 'help': await this.showNavigationHelp(); return false; default: return false; } } return false; } /** * Execute a menu action (legacy method for backward compatibility) */ async executeMenuAction(action) { await this.executeMenuActionWithErrorHandling(action, this.currentMenu || 'unknown'); } /** * Execute a function handler with error handling */ async executeFunctionWithErrorHandling(handlerName, context) { await InteractiveErrorHandler.withErrorHandling(() => this.executeFunction(handlerName), { ...context, operation: `execute function ${handlerName}` }, this.promptForChoice.bind(this)); } /** * Execute a function handler */ async executeFunction(handlerName) { switch (handlerName) { case 'searchTemplates': await this.searchTemplates(); break; case 'showSystemStatus': await this.showSystemStatus(); break; case 'setupEnvironment': await this.setupEnvironment(); break; case 'showRecentDocuments': await this.showRecentDocuments(); break; case 'showProviderStatus': await this.showProviderStatus(); break; case 'showIntegrationStatus': await this.showIntegrationStatus(); break; case 'showPerformanceInsights': await this.showPerformanceInsights(); break; case 'manageTemplates': await this.manageTemplates(); break; case 'configureOutput': await this.configureOutput(); break; case 'runDiagnostics': await this.runDiagnostics(); break; case 'showGettingStarted': await this.showGettingStarted(); break; case 'showCommandReference': await this.showCommandReference(); break; case 'showTemplateGuide': await this.showTemplateGuide(); break; case 'showTroubleshooting': await this.showTroubleshooting(); break; case 'showAbout': await this.showAbout(); break; case 'interactiveTemplateSelection': await this.interactiveTemplateSelection(); break; case 'batchGeneration': await this.batchGeneration(); break; case 'customContextGeneration': await this.customContextGeneration(); break; case 'configureAdobe': await this.configureAdobe(); break; case 'customRiskAssessment': await this.customRiskAssessment(); break; case 'exit': await this.stop(); process.exit(0); break; default: console.log(`āš ļø Function not implemented: ${handlerName}`); console.log('šŸ’” This feature is planned for a future release.'); await this.pause(); if (this.currentMenu) { await this.navigateTo(this.currentMenu); } } } /** * Execute a CLI command with error handling */ async executeCommandWithErrorHandling(command, args, context) { await InteractiveErrorHandler.withErrorHandling(() => this.executeCommand(command, args), { ...context, operation: `execute command ${command}` }, this.promptForChoice.bind(this)); } /** * Execute a CLI command using the integrated command service */ async executeCommand(command, args) { try { // Use the integrated command service directly - no child process spawning needed const result = await this.commandIntegration.executeCommand(command, args); if (result.success) { console.log('āœ… Command executed successfully'); if (result.message) { console.log(`šŸ’” ${result.message}`); } } else { console.error('āŒ Command execution failed'); if (result.message) { console.error(`šŸ’” ${result.message}`); } if (result.error) { console.error(`šŸ” Error details: ${result.error.message}`); } } } catch (error) { if (error instanceof Error) { console.error('āŒ Error executing command:', error.message); } else { console.error('āŒ Error executing command:', error); } console.log('šŸ’” Make sure the CLI is properly configured.'); } await this.pause(); // Return to current menu after command execution if (this.currentMenu) { await this.navigateTo(this.currentMenu); } } /** * Initialize all menu configurations */ initializeMenus() { // Main Menu this.menus.set('main-menu', { id: 'main-menu', title: 'ADPA Interactive CLI - Main Menu', showBreadcrumb: false, showStatusBar: true, items: [ { key: '1', label: 'Quick Start', icon: 'šŸš€', description: 'Get started quickly with common workflows', enabled: true, action: { type: 'navigate', target: 'quick-start' } }, { key: '2', label: 'Document Generation', icon: 'šŸ“', description: 'Generate project documents', enabled: true, badge: '120+ templates', action: { type: 'navigate', target: 'document-generation' } }, { key: '3', label: 'AI Configuration', icon: 'šŸ¤–', description: 'Configure AI providers', enabled: true, badge: this.getProviderStatusBadge(), action: { type: 'navigate', target: 'ai-configuration' } }, { key: '4', label: 'Project Management', icon: 'šŸ“Š', description: 'Project analysis and management tools', enabled: true, action: { type: 'navigate', target: 'project-management' } }, { key: '5', label: 'Integrations', icon: 'šŸ”—', description: 'External system integrations', enabled: true, action: { type: 'navigate', target: 'integrations' } }, { key: '6', label: 'Analytics & Feedback', icon: 'šŸ“ˆ', description: 'Document analytics and feedback', enabled: true, action: { type: 'navigate', target: 'analytics' } }, { key: '7', label: 'System Configuration', icon: 'āš™ļø', description: 'System settings and configuration', enabled: true, action: { type: 'navigate', target: 'system-config' } }, { key: '8', label: 'Workspace Analysis', icon: 'šŸ”', description: 'Analyze current workspace', enabled: true, action: { type: 'function', handler: 'showSystemStatus' } }, { key: '9', label: 'Help & Documentation', icon: 'ā“', description: 'User assistance and documentation', enabled: true, action: { type: 'navigate', target: 'help' } }, { key: '0', label: 'Exit', icon: '🚪', description: 'Exit the application', enabled: true, action: { type: 'function', handler: 'exit' } } ] }); // Quick Start Menu this.menus.set('quick-start', { id: 'quick-start', title: 'Quick Start', showBreadcrumb: true, showStatusBar: true, parent: 'main-menu', items: [ { key: '1', label: 'New Project Setup', icon: 'šŸŽÆ', description: 'Initialize a new project', enabled: true, action: { type: 'function', handler: 'setupEnvironment' } }, { key: '2', label: 'Generate Core Documents', icon: 'šŸ“‹', description: 'Generate essential project documents', enabled: this.systemStatus.projectInitialized, action: { type: 'command', command: 'generate', args: ['core-analysis'] } }, { key: '3', label: 'Project Charter Wizard', icon: 'šŸ—ļø', description: 'Step-by-step charter creation', enabled: true, action: { type: 'command', command: 'generate', args: ['project-charter'] } }, { key: '4', label: 'Stakeholder Analysis', icon: 'šŸ‘„', description: 'Analyze project stakeholders', enabled: true, action: { type: 'command', command: 'stakeholder', args: ['analysis'] } }, { key: '5', label: 'Risk Assessment', icon: 'šŸ“Š', description: 'Perform risk analysis', enabled: true, action: { type: 'command', command: 'risk-compliance', args: ['--type', 'SOFTWARE_DEVELOPMENT'] } }, { key: '6', label: 'Environment Setup', icon: 'šŸ”§', description: 'Configure development environment', enabled: true, action: { type: 'function', handler: 'setupEnvironment' } }, { key: '7', label: 'View Templates', icon: 'šŸ“š', description: 'Browse available templates', enabled: true, action: { type: 'function', handler: 'searchTemplates' } }, { key: '8', label: 'Back to Main Menu', icon: 'ā¬…ļø', description: 'Return to main menu', enabled: true, action: { type: 'navigate', target: 'main-menu' } } ] }); // Document Generation Menu this.menus.set('document-generation', { id: 'document-generation', title: 'Document Generation', showBreadcrumb: true, showStatusBar: true, parent: 'main-menu', items: [ { key: '1', label: 'Browse by Category', icon: 'šŸ“š', description: 'Browse templates by category', enabled: true, action: { type: 'navigate', target: 'browse-categories' } }, { key: '2', label: 'Search Templates', icon: 'šŸ”', description: 'Search for specific templates', enabled: true, action: { type: 'function', handler: 'searchTemplates' } }, { key: '3', label: 'Generate Single Document', icon: '⚔', description: 'Generate a single document', enabled: true, action: { type: 'command', command: 'generate' } }, { key: '4', label: 'Generate Category', icon: 'šŸ“¦', description: 'Generate all documents in a category', enabled: true, action: { type: 'command', command: 'generate-category' } }, { key: '5', label: 'Generate All Documents', icon: '🌟', description: 'Generate all available documents', enabled: true, action: { type: 'command', command: 'generate-all' } }, { key: '6', label: 'Custom Generation', icon: 'šŸŽÆ', description: 'Custom document generation options', enabled: true, action: { type: 'navigate', target: 'custom-generation' } }, { key: '7', label: 'Recent Documents', icon: 'šŸ“‹', description: 'View recently generated documents', enabled: true, action: { type: 'function', handler: 'showRecentDocuments' } }, { key: '8', label: 'Back to Main Menu', icon: 'ā¬…ļø', description: 'Return to main menu', enabled: true, action: { type: 'navigate', target: 'main-menu' } } ] }); // AI Configuration Menu this.menus.set('ai-configuration', { id: 'ai-configuration', title: 'AI Configuration', showBreadcrumb: true, showStatusBar: true, parent: 'main-menu', items: [ { key: '1', label: 'Configure Google AI', icon: 'šŸ¤–', description: 'Set up Google AI (Gemini) provider', enabled: true, action: { type: 'command', command: 'setup', args: ['--provider', 'google-ai'] } }, { key: '2', label: 'Configure OpenAI', icon: '🧠', description: 'Set up OpenAI provider', enabled: true, action: { type: 'command', command: 'setup', args: ['--provider', 'openai'] } }, { key: '3', label: 'Configure Azure OpenAI', icon: 'ā˜ļø', description: 'Set up Azure OpenAI provider', enabled: true, action: { type: 'command', command: 'setup', args: ['--provider', 'azure-openai'] } }, { key: '4', label: 'Test AI Connection', icon: 'šŸ”', description: 'Test current AI provider connection', enabled: this.systemStatus.aiProviderConfigured, action: { type: 'command', command: 'validate', args: ['--ai-connection'] } }, { key: '5', label: 'Provider Status', icon: 'šŸ“Š', description: 'View AI provider status and metrics', enabled: true, action: { type: 'function', handler: 'showProviderStatus' } }, { key: '6', label: 'Back to Main Menu', icon: 'ā¬…ļø', description: 'Return to main menu', enabled: true, action: { type: 'navigate', target: 'main-menu' } } ] }); // Project Management Menu this.menus.set('project-management', { id: 'project-management', title: 'Project Management', showBreadcrumb: true, showStatusBar: true, parent: 'main-menu', items: [ { key: '1', label: 'Project Analysis', icon: 'šŸ”', description: 'Analyze current project structure', enabled: true, action: { type: 'command', command: 'analyze', args: ['workspace'] } }, { key: '2', label: 'Stakeholder Management', icon: 'šŸ‘„', description: 'Stakeholder analysis and management', enabled: true, action: { type: 'navigate', target: 'stakeholder-management' } }, { key: '3', label: 'Risk & Compliance', icon: 'āš ļø', description: 'Risk assessment and compliance checking', enabled: true, action: { type: 'navigate', target: 'risk-compliance' } }, { key: '4', label: 'Business Analysis', icon: 'šŸ“Š', description: 'Business analysis tools and workflows', enabled: true, action: { type: 'command', command: 'business-analysis', args: ['--interactive'] } }, { key: '5', label: 'Project Status', icon: 'šŸ“ˆ', description: 'View project status and metrics', enabled: true, action: { type: 'command', command: 'status', args: ['--detailed'] } }, { key: '6', label: 'Back to Main Menu', icon: 'ā¬…ļø', description: 'Return to main menu', enabled: true, action: { type: 'navigate', target: 'main-menu' } } ] }); // Integrations Menu this.menus.set('integrations', { id: 'integrations', title: 'External Integrations', showBreadcrumb: true, showStatusBar: true, parent: 'main-menu', items: [ { key: '1', label: 'Confluence Integration', icon: 'šŸ“š', description: 'Configure and manage Confluence publishing', enabled: true, action: { type: 'navigate', target: 'confluence-integration' } }, { key: '2', label: 'SharePoint Integration', icon: 'šŸ“', description: 'Configure and manage SharePoint publishing', enabled: true, action: { type: 'navigate', target: 'sharepoint-integration' } }, { key: '3', label: 'Version Control', icon: 'šŸ”„', description: 'Git and version control integration', enabled: true, action: { type: 'navigate', target: 'vcs-integration' } }, { key: '4', label: 'Adobe Creative Suite', icon: 'šŸŽØ', description: 'Adobe Creative Suite integration', enabled: true, action: { type: 'function', handler: 'configureAdobe' } }, { key: '5', label: 'Integration Status', icon: 'šŸ“Š', description: 'View all integration statuses', enabled: true, action: { type: 'function', handler: 'showIntegrationStatus' } }, { key: '6', label: 'Back to Main Menu', icon: 'ā¬…ļø', description: 'Return to main menu', enabled: true, action: { type: 'navigate', target: 'main-menu' } } ] }); // Analytics & Feedback Menu this.menus.set('analytics', { id: 'analytics', title: 'Analytics & Feedback', showBreadcrumb: true, showStatusBar: true, parent: 'main-menu', items: [ { key: '1', label: 'Document Analytics', icon: 'šŸ“Š', description: 'View document generation analytics', enabled: true, action: { type: 'command', command: 'feedback', args: ['analytics'] } }, { key: '2', label: 'Feedback Reports', icon: 'šŸ“', description: 'View and analyze feedback reports', enabled: true, action: { type: 'command', command: 'feedback', args: ['reports'] } }, { key: '3', label: 'Quality Metrics', icon: '⭐', description: 'Document quality metrics and trends', enabled: true, action: { type: 'command', command: 'feedback', args: ['metrics'] } }, { key: '4', label: 'Performance Insights', icon: 'šŸš€', description: 'System performance insights', enabled: true, action: { type: 'function', handler: 'showPerformanceInsights' } }, { key: '5', label: 'Export Reports', icon: 'šŸ“¤', description: 'Export analytics and reports', enabled: true, action: { type: 'command', command: 'feedback', args: ['export'] } }, { key: '6', label: 'Back to Main Menu', icon: 'ā¬…ļø', description: 'Return to main menu', enabled: true, action: { type: 'navigate', target: 'main-menu' } } ] }); // System Configuration Menu this.menus.set('system-config', { id: 'system-config', title: 'System Configuration', showBreadcrumb: true, showStatusBar: true, parent: 'main-menu', items: [ { key: '1', label: 'Environment Setup', icon: 'šŸ”§', description: 'Configure development environment', enabled: true, action: { type: 'function', handler: 'setupEnvironment' } }, { key: '2', label: 'Template Management', icon: 'šŸ“‹', description: 'Manage document templates', enabled: true, action: { type: 'function', handler: 'manageTemplates' } }, { key: '3', label: 'Output Configuration', icon: 'šŸ“', description: 'Configure output directories and formats', enabled: true, action: { type: 'function', handler: 'configureOutput' } }, { key: '4', label: 'Validation Settings', icon: 'āœ…', description: 'Configure validation rules and settings', enabled: true, action: { type: 'command', command: 'validate', args: ['--configure'] } }, { key: '5', label: 'System Diagnostics', icon: 'šŸ”', description: 'Run system diagnostics', enabled: true, action: { type: 'function', handler: 'runDiagnostics' } }, { key: '6', label: 'Back to Main Menu', icon: 'ā¬…ļø', description: 'Return to main menu', enabled: true, action: { type: 'navigate', target: 'main-menu' } } ] }); // Help & Documentation Menu this.menus.set('help', { id: 'help', title: 'Help & Documentation', showBreadcrumb: true, showStatusBar: true, parent: 'main-menu', items: [ { key: '1', label: 'Getting Started Guide', icon: 'šŸš€', description: 'Step-by-step getting started guide', enabled: true, action: { type: 'function', handler: 'showGettingStarted' } }, { key: '2', label: 'Command Reference', icon: 'šŸ“–', description: 'Complete CLI command reference', enabled: true, action: { type: 'function', handler: 'showCommandReference' } }, { key: '3', label: 'Template Guide', icon: 'šŸ“', description: 'Guide to available templates', enabled: true, action: { type: 'function', handler: 'showTemplateGuide' } }, { key: '4', label: 'Troubleshooting', icon: 'šŸ”§', description: 'Common issues and solutions', enabled: true, action: { type: 'function', handler: 'showTroubleshooting' } }, { key: '5', label: 'About ADPA', icon: 'ā„¹ļø', description: 'About ADPA and version information', enabled: true, action: { type: 'function', handler: 'showAbout' } }, { key: '6', label: 'Back to Main Menu', icon: 'ā¬…ļø', description: 'Return to main menu', enabled: true, action: { type: 'navigate', target: 'main-menu' } } ] }); // Browse Categories Menu this.menus.set('browse-categories', { id: 'browse-categories', title: 'Browse Template Categories', showBreadcrumb: true, showStatusBar: true, parent: 'document-generation', items: [ { key: '1', label: 'PMBOK Templates', icon: 'šŸ“Š', description: 'Project Management Body of Knowledge templates', enabled: true, action: { type: 'command', command: 'generate-category', args: ['pmbok'] } }, { key: '2', label: 'BABOK Templates', icon: 'šŸ“‹', description: 'Business Analysis Body of Knowledge templates', enabled: true, action: { type: 'command', command: 'generate-category', args: ['babok'] } }, { key: '3', label: 'DMBOK Templates', icon: 'šŸ—„ļø', description: 'Data Management Body of Knowledge templates', enabled: true, action: { type: 'command', command: 'generate-category', args: ['dmbok'] } }, { key: '4', label: 'Strategic Planning', icon: 'šŸŽÆ', description: 'Strategic planning and business case templates', enabled: true, action: { type: 'command', command: 'generate-category', args: ['strategic-statements'] } }, { key: '5', label: 'Technical Design', icon: 'āš™ļø', description: 'Technical design and architecture templates', enabled: true, action: { type: 'command', command: 'generate-category', args: ['technical-design'] } }, { key: '6', label: 'Quality Assurance', icon: 'āœ…', description: 'QA and testing templates', enabled: true, action: { type: 'command', command: 'generate-category', args: ['quality-assurance'] } }, { key: '7', label: 'Back to Document Generation', icon: 'ā¬…ļø', description: 'Return to document generation menu', enabled: true, action: { type: 'navigate', target: 'document-generation' } } ] }); // Custom Generation Menu this.menus.set('custom-generation', { id: 'custom-generation', title: 'Custom Document Generation', showBreadcrumb: true, showStatusBar: true, parent: 'document-generation', items: [ { key: '1', label: 'Interactive Template Selection', icon: 'šŸŽÆ', description: 'Select templates interactively', enabled: true, action: { type: 'function', handler: 'interactiveTemplateSelection' } }, { key: '2', label: 'Batch Generation', icon: 'šŸ“¦', description: 'Generate multiple documents at once', enabled: true, action: { type: 'function', handler: 'batchGeneration' } }, { key: '3', label: 'Custom Context', icon: 'šŸ“', description: 'Generate with custom context input', enabled: true, action: { type: 'function', handler: 'customContextGeneration' } }, { key: '4', label: 'Template Validation', icon: 'āœ…', description: 'Validate templates before generation', enabled: true, action: { type: 'command', command: 'validate', args: ['--templates'] } }, { key: '5', label: 'Back to Document Generation', icon: 'ā¬…ļø', description: 'Return to document generation menu', enabled: true, action: { type: 'navigate', target: 'document-generation' } } ] }); // Stakeholder Management Menu this.menus.set('stakeholder-management', { id: 'stakeholder-management', title: 'Stakeholder Management', showBreadcrumb: true, showStatusBar: true, parent: 'project-management', items: [ { key: '1', label: 'Stakeholder Analysis', icon: 'šŸ”', description: 'Generate comprehensive stakeholder analysis', enabled: true, action: { type: 'command', command: 'stakeholder', args: ['analysis'] } }, { key: '2', label: 'Stakeholder Register', icon: 'šŸ“‹', description: 'Generate stakeholder register only', enabled: true, action: { type: 'command', command: 'stakeholder', args: ['register'] } }, { key: '3', label: 'Engagement Plan', icon: 'šŸ¤', description: 'Generate stakeholder engagement plan', enabled: true, action: { type: 'command', command: 'stakeholder', args: ['engagement-plan'] } }, { key: '4', label: 'Complete Automation', icon: 'šŸš€', description: 'Generate all stakeholder documents', enabled: true, action: { type: 'command', command: 'stakeholder', args: ['automate'] } }, { key: '5', label: 'Back to Project Management', icon: 'ā¬…ļø', description: 'Return to project management menu', enabled: true, action: { type: 'navigate', target: 'project-management' } } ] }); // Risk & Compliance Menu this.menus.set('risk-compliance', { id: 'risk-compliance', title: 'Risk & Compliance Assessment', showBreadcrumb: true, showStatusBar: true, parent: 'project-management', items: [ { key: '1', label: 'Software Development Risk Assessment', icon: 'šŸ’»', description: 'Risk assessment for software projects', enabled: true, action: { type: 'command', command: 'risk-compliance', args: ['--project', 'current-project', '--type', 'SOFTWARE_DEVELOPMENT'] } }, { key: '2', label: 'Infrastructure Risk Assessment', icon: 'šŸ—ļø', description: 'Risk assessment for infrastructure projects', enabled: true, action: { type: 'command', command: 'risk-compliance', args: ['--project', 'current-project', '--type', 'INFRASTRUCTURE'] } }, { key: '3', label: 'Custom Risk Assessment', icon: 'šŸŽÆ', description: 'Custom risk assessment with interactive setup', enabled: true, action: { type: 'function', handler: 'customRiskAssessment' } }, { key: '4', label: 'PMBOK-Only Assessment', icon: 'šŸ“Š', description: 'PMBOK-focused risk assessment', enabled: true, action: { type: 'command', command: 'risk-compliance', args: ['--project', 'current-project', '--pmbok-only'] } }, { key: '5', label: 'Back to Project Management', icon: 'ā¬…ļø', description: 'Return to project management menu', enabled: true, action: { type: 'navigate', target: 'project-management' } } ] }); // Confluence Integration Menu this.menus.set('confluence-integration', { id: 'confluence-integration', title: 'Confluence Integration', showBreadcrumb: true, showStatusBar: true, parent: 'integrations', items: [ { key: '1', label: 'Initialize Configuration', icon: 'šŸ”§', description: 'Set up Confluence integration', enabled: true, action: { type: 'command', command: 'confluence', args: ['init'] } }, { key: '2', label: 'Test Connection', icon: 'šŸ”', description: 'Test Confluence connection', enabled: true, action: { type: 'command', command: 'confluence', args: ['test'] } }, { key: '3', label: 'Publish Documents', icon: 'šŸ“¤', description: 'Publish documents to Confluence', enabled: true, action: { type: 'command', command: 'confluence', args: ['publish'] } }, { key: '4', label: 'Integration Status', icon: 'šŸ“Š', description: 'View Confluence integration status', enabled: true, action: { type: 'command', command: 'confluence', args: ['status'] } }, { key: '5', label: 'Back to Integrations', icon: 'ā¬…ļø', description: 'Return to integrations menu', enabled: true, action: { type: 'navigate', target: 'integrations' } } ] }); // SharePoint Integration Menu this.menus.set('sharepoint-integration', { id: 'sharepoint-integration', title: 'SharePoint Integration', showBreadcrumb: true, showStatusBar: true, parent: 'integrations', items: [ { key: '1', label: 'Initialize Configuration', icon: 'šŸ”§', description: 'Set up SharePoint integration', enabled: true, action: { type: 'command', command: '