()
| 227 | } |
| 228 | |
| 229 | export function formatTotalCost(): string { |
| 230 | const costDisplay = |
| 231 | formatCost(getTotalCostUSD()) + |
| 232 | (hasUnknownModelCost() |
| 233 | ? ' (costs may be inaccurate due to usage of unknown models)' |
| 234 | : '') |
| 235 | |
| 236 | const modelUsageDisplay = formatModelUsage() |
| 237 | |
| 238 | return chalk.dim( |
| 239 | `Total cost: ${costDisplay}\n` + |
| 240 | `Total duration (API): ${formatDuration(getTotalAPIDuration())} |
| 241 | Total duration (wall): ${formatDuration(getTotalDuration())} |
| 242 | Total code changes: ${getTotalLinesAdded()} ${getTotalLinesAdded() === 1 ? 'line' : 'lines'} added, ${getTotalLinesRemoved()} ${getTotalLinesRemoved() === 1 ? 'line' : 'lines'} removed |
| 243 | ${modelUsageDisplay}`, |
| 244 | ) |
| 245 | } |
| 246 | |
| 247 | function round(number: number, precision: number): number { |
| 248 | return Math.round(number * precision) / precision |
no test coverage detected