feat: restore Kimi usage dashboard (api.kimi.com/coding/v1/usages)

Recovered kimi-usage.ts from bot session logs — original was deleted
during March 27 fallback cleanup. Shows 5h/7d usage bars in dashboard
alongside Claude and Codex, using sk-kimi-* coding plan API key.
This commit is contained in:
Eyejoker
2026-03-31 01:46:19 +09:00
parent 68901e5da9
commit a89ab757b6
3 changed files with 233 additions and 10 deletions

View File

@@ -187,10 +187,7 @@ let globalFailoverActive = false;
let globalFailoverReason: string | null = null;
let globalFailoverActivatedAt: string | null = null;
export function activateCodexFailover(
_chatJid: string,
reason: string,
): void {
export function activateCodexFailover(_chatJid: string, reason: string): void {
globalFailoverActive = true;
globalFailoverReason = reason;
globalFailoverActivatedAt = new Date().toISOString();
@@ -238,9 +235,7 @@ export interface ActiveFailoverLease {
export function getActiveCodexFailoverLeases(): ActiveFailoverLease[] {
// Global failover: report as a single pseudo-lease
if (globalFailoverActive) {
return [
{ chatJid: '*', activatedAt: globalFailoverActivatedAt },
];
return [{ chatJid: '*', activatedAt: globalFailoverActivatedAt }];
}
return [];
}