* Format byte size as human-readable string (KB or MB). * Uses decimal (SI) units (1000-based) — intentionally different from the shared * binary-unit formatBytes in @/common/utils/formatBytes which uses 1024-based thresholds.
(bytes: number)
| 50 | * binary-unit formatBytes in @/common/utils/formatBytes which uses 1024-based thresholds. |
| 51 | */ |
| 52 | function formatBytesSI(bytes: number): string { |
| 53 | if (bytes >= 1_000_000) { |
| 54 | return `${(bytes / 1_000_000).toFixed(1)} MB`; |
| 55 | } |
| 56 | return `${Math.round(bytes / 1000)} KB`; |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * Transform MCP tool result to AI SDK format. |
no outgoing calls
no test coverage detected