(label: string, data: any)
| 677 | } |
| 678 | |
| 679 | function formatAnthropicUsageRow(label: string, data: any): string | undefined { |
| 680 | if (!data || typeof data !== "object") return undefined |
| 681 | const utilization = typeof data.utilization === "number" ? data.utilization : undefined |
| 682 | if (utilization === undefined) return undefined |
| 683 | const resetsAt = resolveAnthropicReset(data.resets_at) |
| 684 | const resetLabel = resetsAt ? formatAnthropicTimeRemaining(resetsAt) : undefined |
| 685 | return `${label}: ${utilization.toFixed(0)}% used${resetLabel ? ` (${resetLabel})` : ""}` |
| 686 | } |
| 687 | |
| 688 | function formatAnthropicTimeRemaining(resetsAt: number): string { |
| 689 | const now = Date.now() |
no test coverage detected