MCPcopy Create free account
hub / github.com/arctic-cli/interface / formatAnthropicUsageRow

Function formatAnthropicUsageRow

packages/arctic/src/provider/usage.ts:679–686  ·  view source on GitHub ↗
(label: string, data: any)

Source from the content-addressed store, hash-verified

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()

Callers 1

fetchAnthropicUsageFunction · 0.85

Calls 2

resolveAnthropicResetFunction · 0.85

Tested by

no test coverage detected