@@ -6,21 +6,23 @@ import type { AuthFile, FileQuota, ProviderSection } from '@/types';
66import type { ProviderFilterItem } from '@/features/quota/components/ProviderFilter' ;
77import { resolveCodexChatgptAccountId , resolveCodexPlanType , resolveGeminiCliProjectId } from '@/shared/utils/quota.helpers' ;
88
9- function getProviderType ( file : AuthFile ) : 'antigravity' | 'codex' | 'gemini-cli' | 'kiro' | 'copilot' | 'unknown' {
9+ function getProviderType ( file : AuthFile ) : 'antigravity' | 'codex' | 'gemini-cli' | 'kiro' | 'copilot' | 'anthropic' | ' unknown' {
1010 const filename = ( file ?. filename || file ?. id || '' ) . toLowerCase ( ) ;
1111
1212 if ( filename . startsWith ( 'antigravity-' ) || filename . includes ( 'antigravity' ) ) return 'antigravity' ;
1313 if ( filename . startsWith ( 'codex-' ) || filename . includes ( 'codex' ) ) return 'codex' ;
1414 if ( filename . startsWith ( 'gemini-cli-' ) || filename . includes ( 'gemini' ) ) return 'gemini-cli' ;
1515 if ( filename . startsWith ( 'kiro-' ) || filename . includes ( 'kiro' ) ) return 'kiro' ;
1616 if ( filename . startsWith ( 'github-copilot-' ) || filename . includes ( 'copilot' ) ) return 'copilot' ;
17+ if ( filename . startsWith ( 'claude-' ) || filename . includes ( 'claude' ) || filename . includes ( 'anthropic' ) ) return 'anthropic' ;
1718
1819 const provider = ( file ?. provider || '' ) . toLowerCase ( ) ;
1920 if ( provider . includes ( 'antigravity' ) ) return 'antigravity' ;
2021 if ( provider . includes ( 'codex' ) ) return 'codex' ;
2122 if ( provider . includes ( 'gemini' ) ) return 'gemini-cli' ;
2223 if ( provider . includes ( 'kiro' ) ) return 'kiro' ;
2324 if ( provider . includes ( 'copilot' ) || provider . includes ( 'github' ) ) return 'copilot' ;
25+ if ( provider . includes ( 'claude' ) || provider . includes ( 'anthropic' ) ) return 'anthropic' ;
2426
2527 return 'unknown' ;
2628}
@@ -35,6 +37,7 @@ const ICON_MAP: Record<string, { path?: string; needsInvert: boolean }> = {
3537 'gemini-cli' : { path : '/gemini/gemini.png' , needsInvert : false } ,
3638 kiro : { path : '/kiro/kiro.png' , needsInvert : false } ,
3739 copilot : { path : '/copilot/copilot.png' , needsInvert : true } ,
40+ anthropic : { path : '/claude/claude.png' , needsInvert : false } ,
3841} ;
3942
4043const PROVIDER_DISPLAY : { key : string ; name : string } [ ] = [
@@ -43,6 +46,8 @@ const PROVIDER_DISPLAY: { key: string; name: string }[] = [
4346 { key : 'gemini-cli' , name : 'Gemini CLI' } ,
4447 { key : 'kiro' , name : 'Kiro (CodeWhisperer)' } ,
4548 { key : 'copilot' , name : 'GitHub Copilot' } ,
49+ { key : 'anthropic' , name : 'Claude (Anthropic)' } ,
50+ { key : 'unknown' , name : 'Other' } ,
4651] ;
4752
4853export function useQuotaPresenter ( ) {
@@ -149,6 +154,14 @@ export function useQuotaPresenter() {
149154 ...f , loading : false , plan : result . plan , models : result . models , error : result . error
150155 } : f )
151156 } : s ) ) ;
157+ } else if ( targetProvider === 'anthropic' ) {
158+ const result = await quotaApi . fetchClaude ( authIndex ) ;
159+ setSections ( ( prev ) => prev . map ( s => s . provider === 'anthropic' ? {
160+ ...s ,
161+ files : s . files . map ( f => f . fileId === fileId ? {
162+ ...f , loading : false , email : result . email , models : result . models , error : result . error
163+ } : f )
164+ } : s ) ) ;
152165 }
153166 } catch ( err ) {
154167 const msg = ( err as Error ) . message ;
@@ -170,7 +183,7 @@ export function useQuotaPresenter() {
170183 const files : AuthFile [ ] = Array . isArray ( resp ) ? resp : ( resp as any ) . items || ( resp as any ) . files || [ ] ;
171184
172185 const grouped : Record < string , FileQuota [ ] > = {
173- antigravity : [ ] , codex : [ ] , 'gemini-cli' : [ ] , kiro : [ ] , copilot : [ ] ,
186+ antigravity : [ ] , codex : [ ] , 'gemini-cli' : [ ] , kiro : [ ] , copilot : [ ] , anthropic : [ ] , unknown : [ ]
174187 } ;
175188
176189 files . forEach ( ( file ) => {
0 commit comments