Feat: Show Gemini Usage in usage dropdown and mobile sidebar

This commit is contained in:
eclipxe
2026-01-25 09:44:03 -08:00
committed by gsxdsm
parent 7765a12868
commit 7d5bc722fa
17 changed files with 1374 additions and 61 deletions

View File

@@ -1,6 +1,11 @@
// Type definitions for Electron IPC API
import type { SessionListItem, Message } from '@/types/electron';
import type { ClaudeUsageResponse, CodexUsageResponse, ZaiUsageResponse } from '@/store/app-store';
import type {
ClaudeUsageResponse,
CodexUsageResponse,
ZaiUsageResponse,
GeminiUsageResponse,
} from '@/store/app-store';
import type {
IssueValidationVerdict,
IssueValidationConfidence,
@@ -874,6 +879,9 @@ export interface ElectronAPI {
error?: string;
}>;
};
gemini?: {
getUsage: () => Promise<GeminiUsageResponse>;
};
settings?: {
getStatus: () => Promise<{
success: boolean;
@@ -1418,6 +1426,20 @@ const _getMockElectronAPI = (): ElectronAPI => {
};
},
},
// Mock Gemini API
gemini: {
getUsage: async () => {
console.log('[Mock] Getting Gemini usage');
return {
authenticated: true,
authMethod: 'cli_login',
usedPercent: 0,
remainingPercent: 100,
lastUpdated: new Date().toISOString(),
};
},
},
};
};