feat(kilo): report quota from the Kilo Pass state endpoint - #195
feat(kilo): report quota from the Kilo Pass state endpoint#195wagner-sousa wants to merge 7 commits into
Conversation
Report credit-remaining percentage, USD balance, and usage from the Kilo user account endpoint alone, replacing the separate balance API call. Include the Credits label in single-window rendering, keep the grouped toast time column off when no reset time exists, and drop the stale kilo-gateway runtime alias. Fix a clock-sensitive Antigravity test fixture and ignore stray worktrees.
Switch from the undocumented user API to the tRPC kiloPass.getState endpoint, which exposes period base credits, usage, and bonus. Derive the percent bar from base + bonus credits and split the value row into left (U:) and right (B: + bonus) columns. Also let grouped formatters render label-less value entries full-width.
|
@wagner-sousa Thanks for adding better Kilo Pass support. Quick question ( The total quota remaining would still include any bonus credits Kilo provides, so users would see the correct percentage and remaining balance without needing a separate bonus label. My preference is to keep the bonus in the calculation, diagnostics, and exports, but simplify the everyday UI to something like:
|
Hi, I don't consider the bonus a standard quota, it's temporary and variable. That is why I have separated it. |
Summary
Report Kilo Pass quota from the authenticated subscription-state endpoint (
GET https://app.kilo.ai/api/trpc/kiloPass.getState) alone. Derives credit-remaining percentage (base + bonus period credits), USD balance, and usage in a single request, replacing the previous balance-only API call.Changes
/api/profile/balancecall;queryKiloPassStatenow readscurrentPeriodBaseCreditsUsd,currentPeriodUsageUsd, andcurrentPeriodBonusCreditsUsdfrom the tRPCkiloPass.getStatepayload, derivingbalanceUsd(rounded) andbonusUsd.Credits:percent entry (percentage computed over base + bonus) plus a value row split into left (U: $usage) and right (B: $balance+$bonuswhen present) columns; surfacesbalance_usdin status details.kilo-gatewayruntime alias (single provider only).[Kilo Gateway] Credits) in single-window rendering without duplicating window labels.