Add support for GitHub Copilot quota provider (#271)

* feat(quota): add github-copilot to QuotaProviderId type

* feat(quota): add GitHub Copilot provider metadata

* feat(quota): add premium_interactions window label mapping

* feat(quota): implement GitHub Copilot quota provider for web

* feat(quota): implement GitHub Copilot quota provider for VS Code

* feat(quota): implement GitHub Copilot quota provider for desktop
This commit is contained in:
Nelson Pires
2026-02-03 13:03:27 +02:00
committed by GitHub
parent 388911b253
commit 392cd888a8
6 changed files with 380 additions and 2 deletions
+2 -1
View File
@@ -8,7 +8,8 @@ export interface QuotaProviderMeta {
export const QUOTA_PROVIDERS: QuotaProviderMeta[] = [
{ id: 'openai', name: 'OpenAI' },
{ id: 'google', name: 'Google' },
{ id: 'zai-coding-plan', name: 'z.ai' }
{ id: 'zai-coding-plan', name: 'z.ai' },
{ id: 'github-copilot', name: 'GitHub Copilot' }
];
export const QUOTA_PROVIDER_MAP = QUOTA_PROVIDERS.reduce<Record<string, QuotaProviderMeta>>(
+1
View File
@@ -29,5 +29,6 @@ export const resolveUsageTone = (percent: number | null): 'safe' | 'warn' | 'cri
export const formatWindowLabel = (label: string): string => {
if (label === '5h') return '5-Hour Limit';
if (label === 'weekly') return 'Weekly Limit';
if (label === 'premium_interactions') return 'Premium interactions';
return label;
};
+1 -1
View File
@@ -1,4 +1,4 @@
export type QuotaProviderId = 'openai' | 'google' | 'zai-coding-plan';
export type QuotaProviderId = 'openai' | 'google' | 'zai-coding-plan' | 'github-copilot';
export interface UsageWindow {
usedPercent: number | null;