(report)
| 178 | } |
| 179 | |
| 180 | function formatCompressionReport(report) { |
| 181 | if (report.totalEntries === 0) return 'No compression stats recorded yet.\n'; |
| 182 | |
| 183 | const lines = [ |
| 184 | '', |
| 185 | '=== Discovery Compression Stats ===', |
| 186 | '', |
| 187 | ` Compressions: ${report.totalEntries}`, |
| 188 | ` Total input: ${report.totalInput} chars`, |
| 189 | ` Total output: ${report.totalOutput} chars`, |
| 190 | ` Average ratio: ${(report.averageRatio * 100).toFixed(1)}%`, |
| 191 | '', |
| 192 | '--- Recent ---', |
| 193 | '', |
| 194 | ]; |
| 195 | |
| 196 | for (const entry of report.recent) { |
| 197 | lines.push(` ${entry.agent}: ${entry.inputChars} → ${entry.outputChars} chars (${(entry.ratio * 100).toFixed(1)}%)`); |
| 198 | } |
| 199 | |
| 200 | if (report.invalidSummary) { |
| 201 | lines.push('', `Invalid lines: ${report.invalidSummary}`); |
| 202 | } |
| 203 | |
| 204 | return lines.join('\n') + '\n'; |
| 205 | } |
| 206 | |
| 207 | module.exports = { |
| 208 | buildAgentReport, |
no outgoing calls
no test coverage detected