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

Function formatRemaining

packages/arctic/src/session/usage-format.ts:143–149  ·  view source on GitHub ↗
(window: RateLimitWindowSummary)

Source from the content-addressed store, hash-verified

141}
142
143function formatRemaining(window: RateLimitWindowSummary): string {
144 if (typeof window.usedPercent !== "number") {
145 return "usage unknown"
146 }
147 const percentRemaining = Math.max(0, 100 - window.usedPercent)
148 return `${formatPercent(percentRemaining)} ${renderProgressBar(percentRemaining)}`
149}
150
151function renderProgressBar(percentRemaining: number): string {
152 const ratio = Math.max(0, Math.min(100, percentRemaining)) / 100

Callers 1

limitLineFunction · 0.85

Calls 2

formatPercentFunction · 0.85
renderProgressBarFunction · 0.85

Tested by

no test coverage detected