feat(core,cli): add Anthropic provider, normalize auth/env config, and centralize logging

This commit is contained in:
tanzhenxin 2025-12-24 19:00:56 +08:00
parent 9f65bd3b39
commit b931d28f35
35 changed files with 1592 additions and 2034 deletions

View file

@ -26,6 +26,20 @@ export function validateAuthMethod(authMethod: string): string | null {
return null;
}
if (authMethod === AuthType.USE_ANTHROPIC) {
const hasApiKey = process.env['ANTHROPIC_API_KEY'];
if (!hasApiKey) {
return 'ANTHROPIC_API_KEY environment variable not found.';
}
const hasBaseUrl = process.env['ANTHROPIC_BASE_URL'];
if (!hasBaseUrl) {
return 'ANTHROPIC_BASE_URL environment variable not found.';
}
return null;
}
if (authMethod === AuthType.USE_GEMINI) {
const hasApiKey = process.env['GEMINI_API_KEY'];
if (!hasApiKey) {