mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-14 20:17:03 +00:00
feat(cliproxy): add backend selection for CLIProxyAPI vs CLIProxyAPIPlus
Add cliproxy.backend config field to choose between CLIProxyAPI (original) and CLIProxyAPIPlus backends. Includes CLI --backend flag, Dashboard toggle, and provider validation to block Kiro/ghcp on original backend.
This commit is contained in:
1 parent
ca86772208
commit
8ade4a6b26
12 files changed
+601
-71
No files matched your search
@@ -19,7 +19,9 @@ import {
|
||||
clearPinnedVersion,
|
||||
isVersionPinned,
|
||||
} from '../binary-manager';
|
||||
import { CLIPROXY_FALLBACK_VERSION } from '../platform-detector';
|
||||
import { BACKEND_CONFIG, DEFAULT_BACKEND } from '../platform-detector';
|
||||
import { CLIProxyBackend } from '../types';
|
||||
import { loadOrCreateUnifiedConfig } from '../../config/unified-config-loader';
|
||||
|
||||
/** Binary status result */
|
||||
export interface BinaryStatusResult {
|
||||
@@ -28,6 +30,7 @@ export interface BinaryStatusResult {
|
||||
pinnedVersion: string | null;
|
||||
binaryPath: string;
|
||||
fallbackVersion: string;
|
||||
backend: CLIProxyBackend;
|
||||
}
|
||||
|
||||
/** Install result */
|
||||
@@ -48,15 +51,19 @@ export interface LatestVersionResult {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current binary status
|
||||
* Get current binary status for a specific backend
|
||||
*/
|
||||
export function getBinaryStatus(): BinaryStatusResult {
|
||||
export function getBinaryStatus(backend?: CLIProxyBackend): BinaryStatusResult {
|
||||
const effectiveBackend =
|
||||
backend ?? loadOrCreateUnifiedConfig().cliproxy?.backend ?? DEFAULT_BACKEND;
|
||||
const backendConfig = BACKEND_CONFIG[effectiveBackend];
|
||||
return {
|
||||
installed: isCLIProxyInstalled(),
|
||||
currentVersion: getInstalledCliproxyVersion(),
|
||||
pinnedVersion: getPinnedVersion(),
|
||||
binaryPath: getCLIProxyPath(),
|
||||
fallbackVersion: CLIPROXY_FALLBACK_VERSION,
|
||||
fallbackVersion: backendConfig.fallbackVersion,
|
||||
backend: effectiveBackend,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user