fix: add claude provider to statsProviderMap, UI types, and provider arrays

Fixes remaining edge cases from #382:
- Add anthropic/claude mapping to statsProviderMap in cliproxy-auth-routes
- Add 'claude' case to provider-refreshers switch statement
- Add 'claude' to 4 UI type definitions in api-client.ts
- Add 'claude' to cliproxy-dialog providers array and options
- Add 'claude' to use-cliproxy-auth-flow VALID_PROVIDERS
- Fix wizard index.tsx type cast to include all 8 providers
This commit is contained in:
kaitranntt
2026-01-27 21:02:34 -05:00
parent 9cd9c423e9
commit 4a2abc74ca
6 changed files with 19 additions and 7 deletions
@@ -35,6 +35,7 @@ export async function refreshToken(
case 'iflow': case 'iflow':
case 'kiro': case 'kiro':
case 'ghcp': case 'ghcp':
case 'claude':
return { return {
success: false, success: false,
error: `Token refresh not yet implemented for ${provider}`, error: `Token refresh not yet implemented for ${provider}`,
@@ -71,6 +71,8 @@ router.get('/', async (_req: Request, res: Response): Promise<void> => {
iflow: 'iflow', iflow: 'iflow',
kiro: 'kiro', kiro: 'kiro',
copilot: 'ghcp', // CLIProxyAPI returns 'copilot', we map to 'ghcp' copilot: 'ghcp', // CLIProxyAPI returns 'copilot', we map to 'ghcp'
anthropic: 'claude', // CLIProxyAPI returns 'anthropic', we map to 'claude'
claude: 'claude',
}; };
// Update lastUsedAt for providers with recent activity // Update lastUsedAt for providers with recent activity
@@ -14,7 +14,7 @@ import { Label } from '@/components/ui/label';
import { useCreateVariant, useCliproxyAuth } from '@/hooks/use-cliproxy'; import { useCreateVariant, useCliproxyAuth } from '@/hooks/use-cliproxy';
import { usePrivacy } from '@/contexts/privacy-context'; import { usePrivacy } from '@/contexts/privacy-context';
const providers = ['gemini', 'codex', 'agy', 'qwen', 'iflow', 'kiro', 'ghcp'] as const; const providers = ['gemini', 'codex', 'agy', 'qwen', 'iflow', 'kiro', 'ghcp', 'claude'] as const;
const schema = z.object({ const schema = z.object({
name: z name: z
@@ -41,6 +41,7 @@ const providerOptions = [
{ value: 'iflow', label: 'iFlow' }, { value: 'iflow', label: 'iFlow' },
{ value: 'kiro', label: 'Kiro (AWS)' }, { value: 'kiro', label: 'Kiro (AWS)' },
{ value: 'ghcp', label: 'GitHub Copilot (OAuth)' }, { value: 'ghcp', label: 'GitHub Copilot (OAuth)' },
{ value: 'claude', label: 'Claude (Anthropic)' },
]; ];
export function CliproxyDialog({ open, onClose }: CliproxyDialogProps) { export function CliproxyDialog({ open, onClose }: CliproxyDialogProps) {
+9 -1
View File
@@ -136,7 +136,15 @@ export function QuickSetupWizard({ open, onClose }: QuickSetupWizardProps) {
try { try {
await createMutation.mutateAsync({ await createMutation.mutateAsync({
name: variantName, name: variantName,
provider: selectedProvider as 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow', provider: selectedProvider as
| 'gemini'
| 'codex'
| 'agy'
| 'qwen'
| 'iflow'
| 'kiro'
| 'ghcp'
| 'claude',
model: modelName || undefined, model: modelName || undefined,
account: selectedAccount?.id, account: selectedAccount?.id,
}); });
+1 -1
View File
@@ -14,7 +14,7 @@ interface AuthFlowState {
error: string | null; error: string | null;
} }
const VALID_PROVIDERS = ['gemini', 'codex', 'agy', 'qwen', 'iflow', 'kiro', 'ghcp']; const VALID_PROVIDERS = ['gemini', 'codex', 'agy', 'qwen', 'iflow', 'kiro', 'ghcp', 'claude'];
export function useCliproxyAuthFlow() { export function useCliproxyAuthFlow() {
const [state, setState] = useState<AuthFlowState>({ const [state, setState] = useState<AuthFlowState>({
+4 -4
View File
@@ -47,7 +47,7 @@ export interface UpdateProfile {
export interface Variant { export interface Variant {
name: string; name: string;
provider: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow' | 'kiro' | 'ghcp'; provider: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow' | 'kiro' | 'ghcp' | 'claude';
settings: string; settings: string;
account?: string; account?: string;
port?: number; port?: number;
@@ -56,13 +56,13 @@ export interface Variant {
export interface CreateVariant { export interface CreateVariant {
name: string; name: string;
provider: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow' | 'kiro' | 'ghcp'; provider: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow' | 'kiro' | 'ghcp' | 'claude';
model?: string; model?: string;
account?: string; account?: string;
} }
export interface UpdateVariant { export interface UpdateVariant {
provider?: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow' | 'kiro' | 'ghcp'; provider?: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow' | 'kiro' | 'ghcp' | 'claude';
model?: string; model?: string;
account?: string; account?: string;
} }
@@ -72,7 +72,7 @@ export interface OAuthAccount {
id: string; id: string;
email?: string; email?: string;
nickname?: string; nickname?: string;
provider: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow' | 'kiro' | 'ghcp'; provider: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow' | 'kiro' | 'ghcp' | 'claude';
isDefault: boolean; isDefault: boolean;
tokenFile: string; tokenFile: string;
createdAt: string; createdAt: string;