* Format a human-readable file size.
(bytes?: number)
| 120 | * Format a human-readable file size. |
| 121 | */ |
| 122 | function formatSize(bytes?: number): string { |
| 123 | if (bytes === undefined || bytes === null) return ""; |
| 124 | if (bytes < 1024) return `${bytes}B`; |
| 125 | if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)}KB`; |
| 126 | return `${(bytes / (1024 * 1024)).toFixed(1)}MB`; |
| 127 | } |
| 128 | |
| 129 | /** |
| 130 | * Format non-image attachments as a text block to inject into the agent prompt. |
no outgoing calls
no test coverage detected