| 73 | } |
| 74 | |
| 75 | export function formatAgentResult(params: { |
| 76 | agentId: string |
| 77 | commit: EvalCommitV2 |
| 78 | judging: JudgingResult |
| 79 | cost: number |
| 80 | durationMs: number |
| 81 | error?: string |
| 82 | traceFilePath?: string |
| 83 | agentNumber: number |
| 84 | totalAgents: number |
| 85 | }): string { |
| 86 | const { |
| 87 | agentId, |
| 88 | commit, |
| 89 | judging, |
| 90 | cost, |
| 91 | durationMs, |
| 92 | error, |
| 93 | traceFilePath, |
| 94 | agentNumber, |
| 95 | totalAgents, |
| 96 | } = params |
| 97 | |
| 98 | const lines: string[] = [] |
| 99 | const minorSeparator = '-'.repeat(80) |
| 100 | |
| 101 | lines.push('') |
| 102 | lines.push(minorSeparator) |
| 103 | lines.push(`AGENT ${agentNumber}/${totalAgents}: [${agentId}]`) |
| 104 | lines.push(minorSeparator) |
| 105 | lines.push('') |
| 106 | |
| 107 | if (error) { |
| 108 | lines.push('❌ ERROR:') |
| 109 | lines.push(minorSeparator) |
| 110 | lines.push(error) |
| 111 | lines.push('') |
| 112 | } |
| 113 | |
| 114 | lines.push('JUDGING RESULTS:') |
| 115 | lines.push(minorSeparator) |
| 116 | lines.push('') |
| 117 | lines.push('Scores:') |
| 118 | lines.push(` Overall Score: ${judging.overallScore.toFixed(1)}/10`) |
| 119 | lines.push(` Completion Score: ${judging.completionScore.toFixed(1)}/10`) |
| 120 | lines.push(` Code Quality Score: ${judging.codeQualityScore.toFixed(1)}/10`) |
| 121 | lines.push('') |
| 122 | |
| 123 | lines.push('Analysis:') |
| 124 | lines.push(judging.analysis) |
| 125 | lines.push('') |
| 126 | |
| 127 | if (judging.strengths.length > 0) { |
| 128 | lines.push('Strengths:') |
| 129 | judging.strengths.forEach((s, i) => { |
| 130 | lines.push(` ${i + 1}. ${s}`) |
| 131 | }) |
| 132 | lines.push('') |