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:
@@ -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>>(
|
||||
|
||||
@@ -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,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;
|
||||
|
||||
Reference in New Issue
Block a user