refactor(vscode-ide-companion/cli): consolidate CLI detection and version management

- Replace separate CliDetector, CliVersionChecker, and CliVersionManager classes with unified CliManager
- Remove redundant code and simplify CLI detection logic
- Maintain all existing functionality while improving code organization
- Update imports in dependent files to use CliManager

This change reduces complexity by consolidating CLI-related functionality into a single manager class.
This commit is contained in:
yiliang114
2025-12-13 20:42:59 +08:00
parent 90fc4c33f0
commit 61ce586117
13 changed files with 527 additions and 721 deletions

View File

@@ -12,7 +12,7 @@
import type { AcpConnection } from './acpConnection.js';
import type { QwenSessionReader } from '../services/qwenSessionReader.js';
import { CliDetector } from '../cli/cliDetector.js';
import { CliManager } from '../cli/cliManager.js';
import { authMethod } from '../types/acpTypes.js';
import { isAuthenticationRequiredError } from '../utils/authErrors.js';
@@ -50,7 +50,7 @@ export class QwenConnectionHandler {
let requiresAuth = false;
// Check if CLI exists using standard detection (with cached results for better performance)
const detectionResult = await CliDetector.detectQwenCli(
const detectionResult = await CliManager.detectQwenCli(
/* forceRefresh */ false, // Use cached results when available for better performance
);
if (!detectionResult.isInstalled) {