UNPKG

pm-orchestrator-enhancement

Version:

PM Orchestrator Enhancement - Multi-agent parallel execution system

80 lines 2.99 kB
"use strict"; /** * PM Orchestrator Enhancement - Terminal UI * * ターミナルUIを表示します */ Object.defineProperty(exports, "__esModule", { value: true }); exports.TerminalUI = void 0; class TerminalUI { /** * 進捗を表示します */ displayProgress(progress) { this.currentTaskId = progress.taskId; console.log('\n' + '='.repeat(60)); console.log(`Task: ${progress.taskName}`); console.log(`Status: ${this.formatStatus(progress.status)}`); console.log(`Progress: ${this.formatProgressBar(progress.progress)}`); if (progress.currentSubagent) { console.log(`Current: ${progress.currentSubagent}`); } if (progress.startTime) { console.log(`Started: ${new Date(progress.startTime).toLocaleString()}`); } if (progress.endTime) { const duration = this.calculateDuration(progress.startTime, progress.endTime); console.log(`Completed: ${new Date(progress.endTime).toLocaleString()}`); console.log(`Duration: ${duration}ms`); } console.log('='.repeat(60)); } /** * サマリーを表示します */ displaySummary(allProgress) { console.log('\n' + '='.repeat(60)); console.log('Task Execution Summary'); console.log('='.repeat(60)); const completed = allProgress.filter(p => p.status === 'completed').length; const failed = allProgress.filter(p => p.status === 'failed').length; const inProgress = allProgress.filter(p => p.status === 'in_progress').length; const pending = allProgress.filter(p => p.status === 'pending').length; console.log(`Completed: ${completed}`); console.log(`Failed: ${failed}`); console.log(`In Progress: ${inProgress}`); console.log(`Pending: ${pending}`); console.log('='.repeat(60)); } /** * ステータスをフォーマット(プライベート) */ formatStatus(status) { const statusMap = { pending: '⏳ Pending', in_progress: '🔄 In Progress', completed: '✅ Completed', failed: '❌ Failed' }; return statusMap[status] || status; } /** * プログレスバーをフォーマット(プライベート) */ formatProgressBar(progress) { const barLength = 40; const filledLength = Math.round((progress / 100) * barLength); const emptyLength = barLength - filledLength; const filled = '█'.repeat(filledLength); const empty = '░'.repeat(emptyLength); return `[${filled}${empty}] ${progress.toFixed(1)}%`; } /** * 期間を計算(プライベート) */ calculateDuration(startTime, endTime) { return new Date(endTime).getTime() - new Date(startTime).getTime(); } } exports.TerminalUI = TerminalUI; //# sourceMappingURL=terminal-ui.js.map