feat(cliproxy): add CLIProxyAPI integration for OAuth profiles

Complete integration of CLIProxyAPI for zero-config OAuth profiles.

New profiles:
- ccs gemini: Gemini via OAuth
- ccs chatgpt: ChatGPT via OAuth
- ccs qwen: Qwen via OAuth

Implementation:
- Phase 1: Binary infrastructure (download-on-demand)
- Phase 2: Proxy executor (spawn/kill pattern)
- Phase 3: OAuth integration (browser-based auth)
- Phase 4: Profile registration (routing + help text)
- Phase 5: Diagnostics (doctor command + errors)

Files added:
- src/cliproxy/*.ts (binary-manager, platform-detector, executor, auth-handler, config-generator, types, index)

Files modified:
- src/ccs.ts (CLIProxy routing)
- src/auth/profile-detector.ts (cliproxy profile type)
- src/commands/help-command.ts (new profiles in help)
- src/management/doctor.ts (CLIProxy health checks)
- src/utils/error-manager.ts (OAuth/port/download errors)
- CHANGELOG.md (v5.0.0 release notes)

Tests: 42/42 passed
This commit is contained in:
kaitranntt committed 2025-11-28 16:28:15 -05:00
1 parent 296d5661d0
commit 5f71eba6f6
17 files changed
+2182 -19

No files matched your search

+73
View File
@@ -0,0 +1,73 @@
/**
* CLIProxy Module Exports
* Central export point for CLIProxyAPI binary management and execution
*/
// Types
export type {
PlatformInfo,
SupportedOS,
SupportedArch,
ArchiveExtension,
BinaryManagerConfig,
BinaryInfo,
DownloadProgress,
ProgressCallback,
ChecksumResult,
DownloadResult,
CLIProxyProvider,
CLIProxyConfig,
ExecutorConfig,
ProviderConfig,
ProviderModelMapping,
} from './types';
// Platform detection
export {
detectPlatform,
getDownloadUrl,
getChecksumsUrl,
getExecutableName,
isPlatformSupported,
getPlatformDescription,
CLIPROXY_VERSION,
} from './platform-detector';
// Binary management
export {
BinaryManager,
ensureCLIProxyBinary,
isCLIProxyInstalled,
getCLIProxyPath,
} from './binary-manager';
// Config generation
export {
generateConfig,
getClaudeEnvVars,
getProviderConfig,
getModelMapping,
getAuthDir,
getConfigPath,
configExists,
deleteConfig,
PROVIDER_CONFIGS,
CLIPROXY_DEFAULT_PORT,
} from './config-generator';
// Executor
export { execClaudeWithCLIProxy, isPortAvailable, findAvailablePort } from './cliproxy-executor';
// Authentication
export type { AuthStatus } from './auth-handler';
export {
isAuthenticated,
getAuthStatus,
getAllAuthStatus,
clearAuth,
triggerOAuth,
ensureAuth,
getOAuthConfig,
getProviderTokenDir,
displayAuthStatus,
} from './auth-handler';