diff --git a/src/cliproxy/binary-manager.ts b/src/cliproxy/binary-manager.ts index 70adfec1..8e83f2a7 100644 --- a/src/cliproxy/binary-manager.ts +++ b/src/cliproxy/binary-manager.ts @@ -25,10 +25,10 @@ import { ensureBinary, } from './binary'; -/** Default configuration */ +/** Default configuration (uses CLIProxyAPIPlus fork with Kiro + Copilot support) */ const DEFAULT_CONFIG: BinaryManagerConfig = { 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(), maxRetries: 3, verbose: false, diff --git a/src/cliproxy/binary/types.ts b/src/cliproxy/binary/types.ts index 461100f0..133faaf4 100644 --- a/src/cliproxy/binary/types.ts +++ b/src/cliproxy/binary/types.ts @@ -24,6 +24,6 @@ export const VERSION_CACHE_DURATION_MS = 60 * 60 * 1000; /** Version pin file name - stores user's explicit version choice */ 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 = - 'https://api.github.com/repos/router-for-me/CLIProxyAPI/releases/latest'; + 'https://api.github.com/repos/router-for-me/CLIProxyAPIPlus/releases/latest'; diff --git a/src/cliproxy/binary/version-checker.ts b/src/cliproxy/binary/version-checker.ts index c21398e7..6108bd82 100644 --- a/src/cliproxy/binary/version-checker.ts +++ b/src/cliproxy/binary/version-checker.ts @@ -9,10 +9,15 @@ import { UpdateCheckResult, GITHUB_API_LATEST_RELEASE } from './types'; /** * Compare semver versions (true if latest > current) + * Handles CLIProxyAPIPlus versioning: strips -0 suffix before comparison */ export function isNewerVersion(latest: string, current: string): boolean { - const latestParts = latest.split('.').map((p) => parseInt(p, 10) || 0); - const currentParts = current.split('.').map((p) => parseInt(p, 10) || 0); + // Strip -0 suffix from CLIProxyAPIPlus versions (e.g., "6.6.40-0" -> "6.6.40") + 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 while (latestParts.length < 3) latestParts.push(0);