(data: any, label?: string)
| 658 | } |
| 659 | |
| 660 | function resolveAnthropicLimit(data: any, label?: string): RateLimitWindowSummary | undefined { |
| 661 | if (!data || typeof data !== "object") return undefined |
| 662 | const utilization = typeof data.utilization === "number" ? data.utilization : undefined |
| 663 | const resetsAt = resolveAnthropicReset(data.resets_at) |
| 664 | if (utilization === undefined && resetsAt === undefined) return undefined |
| 665 | return { |
| 666 | usedPercent: utilization ?? null, |
| 667 | resetsAt, |
| 668 | label, |
| 669 | } |
| 670 | } |
| 671 | |
| 672 | function resolveAnthropicReset(value: any): number | undefined { |
| 673 | if (!value || typeof value !== "string") return undefined |
no test coverage detected