feat(cliproxy): migrate from CLIProxyAPI to CLIProxyAPIPlus

- Update GitHub repo URL to router-for-me/CLIProxyAPIPlus
- Handle new release naming pattern (v6.6.X-0 suffix)
- Add version comparison support for Plus releases
This commit is contained in:
kaitranntt
2025-12-21 22:25:48 -05:00
parent ec7781bbc8
commit 6f8587db68
3 changed files with 11 additions and 6 deletions
+2 -2
View File
@@ -25,10 +25,10 @@ import {
ensureBinary, ensureBinary,
} from './binary'; } from './binary';
/** Default configuration */ /** Default configuration (uses CLIProxyAPIPlus fork with Kiro + Copilot support) */
const DEFAULT_CONFIG: BinaryManagerConfig = { const DEFAULT_CONFIG: BinaryManagerConfig = {
version: CLIPROXY_FALLBACK_VERSION, version: CLIPROXY_FALLBACK_VERSION,
releaseUrl: 'https://github.com/router-for-me/CLIProxyAPI/releases/download', releaseUrl: 'https://github.com/router-for-me/CLIProxyAPIPlus/releases/download',
binPath: getBinDir(), binPath: getBinDir(),
maxRetries: 3, maxRetries: 3,
verbose: false, verbose: false,
+2 -2
View File
@@ -24,6 +24,6 @@ export const VERSION_CACHE_DURATION_MS = 60 * 60 * 1000;
/** Version pin file name - stores user's explicit version choice */ /** Version pin file name - stores user's explicit version choice */
export const VERSION_PIN_FILE = '.version-pin'; export const VERSION_PIN_FILE = '.version-pin';
/** GitHub API URL for latest release */ /** GitHub API URL for latest release (CLIProxyAPIPlus fork with Kiro + Copilot support) */
export const GITHUB_API_LATEST_RELEASE = export const GITHUB_API_LATEST_RELEASE =
'https://api.github.com/repos/router-for-me/CLIProxyAPI/releases/latest'; 'https://api.github.com/repos/router-for-me/CLIProxyAPIPlus/releases/latest';
+7 -2
View File
@@ -9,10 +9,15 @@ import { UpdateCheckResult, GITHUB_API_LATEST_RELEASE } from './types';
/** /**
* Compare semver versions (true if latest > current) * Compare semver versions (true if latest > current)
* Handles CLIProxyAPIPlus versioning: strips -0 suffix before comparison
*/ */
export function isNewerVersion(latest: string, current: string): boolean { export function isNewerVersion(latest: string, current: string): boolean {
const latestParts = latest.split('.').map((p) => parseInt(p, 10) || 0); // Strip -0 suffix from CLIProxyAPIPlus versions (e.g., "6.6.40-0" -> "6.6.40")
const currentParts = current.split('.').map((p) => parseInt(p, 10) || 0); const cleanLatest = latest.replace(/-\d+$/, '');
const cleanCurrent = current.replace(/-\d+$/, '');
const latestParts = cleanLatest.split('.').map((p) => parseInt(p, 10) || 0);
const currentParts = cleanCurrent.split('.').map((p) => parseInt(p, 10) || 0);
// Pad arrays to same length // Pad arrays to same length
while (latestParts.length < 3) latestParts.push(0); while (latestParts.length < 3) latestParts.push(0);