From 29032d2c6a8956de2f2dc4643120ded15b2f131d Mon Sep 17 00:00:00 2001 From: yiliang114 <1204183885@qq.com> Date: Tue, 9 Dec 2025 21:48:40 +0800 Subject: [PATCH] chore(vscode-ide-companion): bump version to 0.4.1 --- packages/vscode-ide-companion/package.json | 2 +- .../src/cli/cliContextManager.ts | 63 ------------------- .../src/cli/cliVersionManager.ts | 19 +----- .../src/services/acpSessionManager.ts | 1 - .../src/services/authStateManager.ts | 2 +- .../src/services/qwenAgentManager.ts | 3 +- .../src/services/qwenConnectionHandler.ts | 15 +++-- .../toolcalls/shared/LayoutComponents.css | 2 - 8 files changed, 14 insertions(+), 93 deletions(-) diff --git a/packages/vscode-ide-companion/package.json b/packages/vscode-ide-companion/package.json index 11aa3975..0b52f41c 100644 --- a/packages/vscode-ide-companion/package.json +++ b/packages/vscode-ide-companion/package.json @@ -2,7 +2,7 @@ "name": "qwen-code-vscode-ide-companion", "displayName": "Qwen Code Companion", "description": "Enable Qwen Code with direct access to your VS Code workspace.", - "version": "0.4.0", + "version": "0.4.1", "publisher": "qwenlm", "icon": "assets/icon.png", "repository": { diff --git a/packages/vscode-ide-companion/src/cli/cliContextManager.ts b/packages/vscode-ide-companion/src/cli/cliContextManager.ts index 6e7171d8..c812a08e 100644 --- a/packages/vscode-ide-companion/src/cli/cliContextManager.ts +++ b/packages/vscode-ide-companion/src/cli/cliContextManager.ts @@ -31,15 +31,6 @@ export class CliContextManager { this.currentVersionInfo = versionInfo; } - /** - * Get current CLI version information - * - * @returns Current CLI version information or null if not set - */ - getCurrentVersionInfo(): CliVersionInfo | null { - return this.currentVersionInfo; - } - /** * Get current CLI feature flags * @@ -54,68 +45,14 @@ export class CliContextManager { return { supportsSessionList: false, supportsSessionLoad: false, - supportsSessionSave: false, }; } - /** - * Check if current CLI supports session/list method - * - * @returns Whether session/list is supported - */ supportsSessionList(): boolean { return this.getCurrentFeatures().supportsSessionList; } - /** - * Check if current CLI supports session/load method - * - * @returns Whether session/load is supported - */ supportsSessionLoad(): boolean { return this.getCurrentFeatures().supportsSessionLoad; } - - /** - * Check if current CLI supports session/save method - * - * @returns Whether session/save is supported - */ - supportsSessionSave(): boolean { - return this.getCurrentFeatures().supportsSessionSave; - } - - /** - * Check if CLI is installed and detected - * - * @returns Whether CLI is installed - */ - isCliInstalled(): boolean { - return this.currentVersionInfo?.detectionResult.isInstalled ?? false; - } - - /** - * Get CLI version string - * - * @returns CLI version string or undefined if not detected - */ - getCliVersion(): string | undefined { - return this.currentVersionInfo?.version; - } - - /** - * Check if CLI version is supported - * - * @returns Whether CLI version is supported - */ - isCliVersionSupported(): boolean { - return this.currentVersionInfo?.isSupported ?? false; - } - - /** - * Clear current CLI context - */ - clearContext(): void { - this.currentVersionInfo = null; - } } diff --git a/packages/vscode-ide-companion/src/cli/cliVersionManager.ts b/packages/vscode-ide-companion/src/cli/cliVersionManager.ts index 383ae638..3e0d241e 100644 --- a/packages/vscode-ide-companion/src/cli/cliVersionManager.ts +++ b/packages/vscode-ide-companion/src/cli/cliVersionManager.ts @@ -21,11 +21,6 @@ export interface CliFeatureFlags { * Whether the CLI supports session/load ACP method */ supportsSessionLoad: boolean; - - /** - * Whether the CLI supports session/save ACP method - */ - supportsSessionSave: boolean; } /** @@ -91,6 +86,7 @@ export class CliVersionManager { return false; } + // TODO: // Simple version comparison (assuming semantic versioning) try { const versionParts = version.split('.').map(Number); @@ -131,7 +127,6 @@ export class CliVersionManager { return { supportsSessionList: isSupportedVersion, supportsSessionLoad: isSupportedVersion, - supportsSessionSave: false, // Not yet supported in any version }; } @@ -190,7 +185,6 @@ export class CliVersionManager { features: { supportsSessionList: false, supportsSessionLoad: false, - supportsSessionSave: false, }, detectionResult: { isInstalled: false, @@ -232,15 +226,4 @@ export class CliVersionManager { const versionInfo = await this.detectCliVersion(forceRefresh); return versionInfo.features.supportsSessionLoad; } - - /** - * Check if CLI supports session/save method - * - * @param forceRefresh - Force a new check, ignoring cache - * @returns Whether session/save is supported - */ - async supportsSessionSave(forceRefresh = false): Promise { - const versionInfo = await this.detectCliVersion(forceRefresh); - return versionInfo.features.supportsSessionSave; - } } diff --git a/packages/vscode-ide-companion/src/services/acpSessionManager.ts b/packages/vscode-ide-companion/src/services/acpSessionManager.ts index 78429aa3..8812282a 100644 --- a/packages/vscode-ide-companion/src/services/acpSessionManager.ts +++ b/packages/vscode-ide-companion/src/services/acpSessionManager.ts @@ -9,7 +9,6 @@ * * Responsible for managing ACP protocol session operations, including initialization, authentication, session creation, and switching */ - import { JSONRPC_VERSION } from '../types/acpTypes.js'; import type { AcpRequest, diff --git a/packages/vscode-ide-companion/src/services/authStateManager.ts b/packages/vscode-ide-companion/src/services/authStateManager.ts index 2bd52440..9614cae6 100644 --- a/packages/vscode-ide-companion/src/services/authStateManager.ts +++ b/packages/vscode-ide-companion/src/services/authStateManager.ts @@ -21,7 +21,7 @@ export class AuthStateManager { private static context: vscode.ExtensionContext | null = null; private static readonly AUTH_STATE_KEY = 'qwen.authState'; private static readonly AUTH_CACHE_DURATION = 24 * 60 * 60 * 1000; // 24 hours - + //TODO: private constructor() {} /** diff --git a/packages/vscode-ide-companion/src/services/qwenAgentManager.ts b/packages/vscode-ide-companion/src/services/qwenAgentManager.ts index b4816d7f..e48492e1 100644 --- a/packages/vscode-ide-companion/src/services/qwenAgentManager.ts +++ b/packages/vscode-ide-companion/src/services/qwenAgentManager.ts @@ -22,6 +22,7 @@ import { QwenConnectionHandler } from '../services/qwenConnectionHandler.js'; import { QwenSessionUpdateHandler } from './qwenSessionUpdateHandler.js'; import { CliContextManager } from '../cli/cliContextManager.js'; import { authMethod } from '../types/acpTypes.js'; +import { MIN_CLI_VERSION_FOR_SESSION_METHODS } from '../cli/cliVersionManager.js'; export type { ChatMessage, PlanEntry, ToolCallUpdateData }; @@ -1034,7 +1035,7 @@ export class QwenAgentManager { if (!supportsSessionLoad) { throw new Error( - `CLI version does not support session/load method. Please upgrade to version 0.4.0 or later.`, + `CLI version does not support session/load method. Please upgrade to version ${MIN_CLI_VERSION_FOR_SESSION_METHODS} or later.`, ); } diff --git a/packages/vscode-ide-companion/src/services/qwenConnectionHandler.ts b/packages/vscode-ide-companion/src/services/qwenConnectionHandler.ts index fd5350ca..9fd9f7cf 100644 --- a/packages/vscode-ide-companion/src/services/qwenConnectionHandler.ts +++ b/packages/vscode-ide-companion/src/services/qwenConnectionHandler.ts @@ -14,7 +14,10 @@ import * as vscode from 'vscode'; import type { AcpConnection } from './acpConnection.js'; import type { QwenSessionReader } from '../services/qwenSessionReader.js'; import type { AuthStateManager } from '../services/authStateManager.js'; -import { CliVersionManager } from '../cli/cliVersionManager.js'; +import { + CliVersionManager, + MIN_CLI_VERSION_FOR_SESSION_METHODS, +} from '../cli/cliVersionManager.js'; import { CliContextManager } from '../cli/cliContextManager.js'; import { authMethod } from '../types/acpTypes.js'; @@ -54,13 +57,13 @@ export class QwenConnectionHandler { // Show warning if CLI version is below minimum requirement if (!versionInfo.isSupported) { console.warn( - `[QwenAgentManager] CLI version ${versionInfo.version} is below minimum required version ${'0.4.0'}`, + `[QwenAgentManager] CLI version ${versionInfo.version} is below minimum required version ${MIN_CLI_VERSION_FOR_SESSION_METHODS}`, ); - // TODO: Wait to determine release version number - // vscode.window.showWarningMessage( - // `Qwen Code CLI version ${versionInfo.version} is below the minimum required version. Some features may not work properly. Please upgrade to version 0.4.0 or later.`, - // ); + // Wait to determine release version number + vscode.window.showWarningMessage( + `Qwen Code CLI version ${versionInfo.version} is below the minimum required version. Some features may not work properly. Please upgrade to version ${MIN_CLI_VERSION_FOR_SESSION_METHODS} or later.`, + ); } const config = vscode.workspace.getConfiguration('qwenCode'); diff --git a/packages/vscode-ide-companion/src/webview/components/messages/toolcalls/shared/LayoutComponents.css b/packages/vscode-ide-companion/src/webview/components/messages/toolcalls/shared/LayoutComponents.css index 5a055684..39846d77 100644 --- a/packages/vscode-ide-companion/src/webview/components/messages/toolcalls/shared/LayoutComponents.css +++ b/packages/vscode-ide-companion/src/webview/components/messages/toolcalls/shared/LayoutComponents.css @@ -63,8 +63,6 @@ content: '\25cf'; position: absolute; left: 8px; - /* TODO: */ - /* padding-top: 2px; */ font-size: 10px; color: #c74e39; z-index: 1;