(bytes)
| 100 | } |
| 101 | |
| 102 | function formatFileSize(bytes) { |
| 103 | if (bytes === 0) return '0 B'; |
| 104 | const k = 1024; |
| 105 | const sizes = ['B', 'KB', 'MB', 'GB']; |
| 106 | const i = Math.floor(Math.log(bytes) / Math.log(k)); |
| 107 | return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i]; |
| 108 | } |
| 109 | |
| 110 | // Handle MCP tool call display |
| 111 | function formatMcpToolCallWithPlaceholders(text, placeholders) { |