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

Function formatKimiTimeRemaining

packages/arctic/src/provider/usage.ts:1477–1493  ·  view source on GitHub ↗
(resetsAt: number)

Source from the content-addressed store, hash-verified

1475 }
1476
1477 function formatKimiTimeRemaining(resetsAt: number): string {
1478 const now = Date.now()
1479 const resetTime = resetsAt * 1000
1480 const diff = resetTime - now
1481
1482 if (diff <= 0) return "resetting soon"
1483
1484 const totalMinutes = Math.floor(diff / 60000)
1485 const hours = Math.floor(totalMinutes / 60)
1486 const minutes = totalMinutes % 60
1487 const days = Math.floor(hours / 24)
1488 const hoursInDay = hours % 24
1489
1490 if (days > 0) return `${days}d ${hoursInDay}h left`
1491 if (hours > 0) return `${hours}h ${minutes}m left`
1492 return `${minutes}m left`
1493 }
1494
1495 async function ensureAntigravityAccessToken(auth: Extract<Auth.Info, { type: "oauth" }>, _providerID: string): Promise<string> {
1496 const needsRefresh = !auth.access || !auth.expires || auth.expires <= Date.now() + 5 * 60 * 1000

Callers 1

formatKimiLimitRowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected