diff --git a/.gitignore b/.gitignore index f9ef5f78..2c3156b9 100644 --- a/.gitignore +++ b/.gitignore @@ -57,5 +57,3 @@ gha-creds-*.json # Log files patch_output.log - -.claude/ diff --git a/eslint.config.js b/eslint.config.js index f1a58044..5e5e1b85 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -120,7 +120,7 @@ export default tseslint.config( '**/generated/**', './styles/tailwind.css', './styles/App.css', - './styles/ClaudeCodeStyles.css' + './styles/style.css' ], }, ], diff --git a/packages/vscode-ide-companion/package.json b/packages/vscode-ide-companion/package.json index 1fcf35b3..11aa3975 100644 --- a/packages/vscode-ide-companion/package.json +++ b/packages/vscode-ide-companion/package.json @@ -57,7 +57,7 @@ }, { "command": "qwen-code.openChat", - "title": "Qwen Code: Open Chat", + "title": "Qwen Code: Open", "icon": "./assets/icon.png" }, { @@ -107,11 +107,6 @@ "command": "qwen.diff.accept", "key": "cmd+s", "when": "qwen.diff.isVisible" - }, - { - "command": "qwen-code.openChat", - "key": "ctrl+shift+a", - "mac": "cmd+shift+a" } ] }, diff --git a/packages/vscode-ide-companion/src/constants/auth.ts b/packages/vscode-ide-companion/src/constants/auth.ts deleted file mode 100644 index 076e94cb..00000000 --- a/packages/vscode-ide-companion/src/constants/auth.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * @license - * Copyright 2025 Qwen Team - * SPDX-License-Identifier: Apache-2.0 - */ - -export const authMethod = 'qwen-oauth'; diff --git a/packages/vscode-ide-companion/src/services/acpConnection.ts b/packages/vscode-ide-companion/src/services/acpConnection.ts index 29b68837..71bd025c 100644 --- a/packages/vscode-ide-companion/src/services/acpConnection.ts +++ b/packages/vscode-ide-companion/src/services/acpConnection.ts @@ -6,7 +6,6 @@ import { JSONRPC_VERSION } from '../types/acpTypes.js'; import type { - AcpBackend, AcpMessage, AcpPermissionRequest, AcpResponse, @@ -31,7 +30,6 @@ export class AcpConnection { private child: ChildProcess | null = null; private pendingRequests = new Map>(); private nextRequestId = { value: 0 }; - private backend: AcpBackend | null = null; // Remember the working dir provided at connect() so later ACP calls // that require cwd (e.g. session/list) can include it. private workingDir: string = process.cwd(); @@ -53,15 +51,13 @@ export class AcpConnection { } /** - * Connect to ACP backend + * Connect to Qwen ACP * - * @param backend - Backend type * @param cliPath - CLI path * @param workingDir - Working directory * @param extraArgs - Extra command line arguments */ async connect( - backend: AcpBackend, cliPath: string, workingDir: string = process.cwd(), extraArgs: string[] = [], @@ -70,7 +66,6 @@ export class AcpConnection { this.disconnect(); } - this.backend = backend; this.workingDir = workingDir; const isWindows = process.platform === 'win32'; @@ -136,15 +131,13 @@ export class AcpConnection { }; this.child = spawn(spawnCommand, spawnArgs, options); - await this.setupChildProcessHandlers(backend); + await this.setupChildProcessHandlers(); } /** * Set up child process handlers - * - * @param backend - Backend name */ - private async setupChildProcessHandlers(backend: string): Promise { + private async setupChildProcessHandlers(): Promise { let spawnError: Error | null = null; this.child!.stderr?.on('data', (data) => { @@ -153,9 +146,9 @@ export class AcpConnection { message.toLowerCase().includes('error') && !message.includes('Loaded cached') ) { - console.error(`[ACP ${backend}]:`, message); + console.error(`[ACP qwen]:`, message); } else { - console.log(`[ACP ${backend}]:`, message); + console.log(`[ACP qwen]:`, message); } }); @@ -165,7 +158,7 @@ export class AcpConnection { this.child!.on('exit', (code, signal) => { console.error( - `[ACP ${backend}] Process exited with code: ${code}, signal: ${signal}`, + `[ACP qwen] Process exited with code: ${code}, signal: ${signal}`, ); }); @@ -177,7 +170,7 @@ export class AcpConnection { } if (!this.child || this.child.killed) { - throw new Error(`${backend} ACP process failed to start`); + throw new Error(`Qwen ACP process failed to start`); } // Handle messages from ACP server @@ -409,7 +402,6 @@ export class AcpConnection { this.pendingRequests.clear(); this.sessionManager.reset(); - this.backend = null; } /** diff --git a/packages/vscode-ide-companion/src/services/qwenAgentManager.ts b/packages/vscode-ide-companion/src/services/qwenAgentManager.ts index 271416db..0bd5a4d9 100644 --- a/packages/vscode-ide-companion/src/services/qwenAgentManager.ts +++ b/packages/vscode-ide-companion/src/services/qwenAgentManager.ts @@ -20,7 +20,7 @@ import type { import { QwenConnectionHandler } from '../services/qwenConnectionHandler.js'; import { QwenSessionUpdateHandler } from './qwenSessionUpdateHandler.js'; import { CliContextManager } from '../cli/cliContextManager.js'; -import { authMethod } from '../constants/auth.js'; +import { authMethod } from '../types/acpTypes.js'; export type { ChatMessage, PlanEntry, ToolCallUpdateData }; @@ -1220,7 +1220,7 @@ export class QwenAgentManager { ); } - // Try to create a new ACP session. If the backend asks for auth despite our + // Try to create a new ACP session. If Qwen asks for auth despite our // cached flag (e.g. fresh process or expired tokens), re-authenticate and retry. try { await this.connection.newSession(workingDir); diff --git a/packages/vscode-ide-companion/src/services/qwenConnectionHandler.ts b/packages/vscode-ide-companion/src/services/qwenConnectionHandler.ts index 9bceb60c..fd5350ca 100644 --- a/packages/vscode-ide-companion/src/services/qwenConnectionHandler.ts +++ b/packages/vscode-ide-companion/src/services/qwenConnectionHandler.ts @@ -16,7 +16,7 @@ import type { QwenSessionReader } from '../services/qwenSessionReader.js'; import type { AuthStateManager } from '../services/authStateManager.js'; import { CliVersionManager } from '../cli/cliVersionManager.js'; import { CliContextManager } from '../cli/cliContextManager.js'; -import { authMethod } from '../constants/auth.js'; +import { authMethod } from '../types/acpTypes.js'; /** * Qwen Connection Handler class @@ -71,7 +71,7 @@ export class QwenConnectionHandler { // Build extra CLI arguments (only essential parameters) const extraArgs: string[] = []; - await connection.connect('qwen', effectiveCliPath, workingDir, extraArgs); + await connection.connect(effectiveCliPath, workingDir, extraArgs); // Check if we have valid cached authentication if (authStateManager) { @@ -214,14 +214,14 @@ export class QwenConnectionHandler { errorMessage, ); - // If the backend reports that authentication is required, try to + // If Qwen reports that authentication is required, try to // authenticate on-the-fly once and retry without waiting. const requiresAuth = errorMessage.includes('Authentication required') || errorMessage.includes('(code: -32000)'); if (requiresAuth) { console.log( - '[QwenAgentManager] Backend requires authentication. Authenticating and retrying session/new...', + '[QwenAgentManager] Qwen requires authentication. Authenticating and retrying session/new...', ); try { await connection.authenticate(authMethod); diff --git a/packages/vscode-ide-companion/src/types/acpTypes.ts b/packages/vscode-ide-companion/src/types/acpTypes.ts index 128b6426..d4557826 100644 --- a/packages/vscode-ide-companion/src/types/acpTypes.ts +++ b/packages/vscode-ide-companion/src/types/acpTypes.ts @@ -5,8 +5,9 @@ */ export const JSONRPC_VERSION = '2.0' as const; +export const authMethod = 'qwen-oauth'; -export type AcpBackend = 'qwen' | 'claude' | 'gemini' | 'codex'; +export type AcpBackend = 'qwen'; export interface AcpRequest { jsonrpc: typeof JSONRPC_VERSION; diff --git a/packages/vscode-ide-companion/src/types/connectionTypes.ts b/packages/vscode-ide-companion/src/types/connectionTypes.ts index 20af647a..b49bd027 100644 --- a/packages/vscode-ide-companion/src/types/connectionTypes.ts +++ b/packages/vscode-ide-companion/src/types/connectionTypes.ts @@ -28,5 +28,4 @@ export interface AcpConnectionState { nextRequestId: number; sessionId: string | null; isInitialized: boolean; - backend: string | null; } diff --git a/packages/vscode-ide-companion/src/webview/WebViewProvider.ts b/packages/vscode-ide-companion/src/webview/WebViewProvider.ts index 9e0568e2..64a317fd 100644 --- a/packages/vscode-ide-companion/src/webview/WebViewProvider.ts +++ b/packages/vscode-ide-companion/src/webview/WebViewProvider.ts @@ -15,7 +15,7 @@ import { MessageHandler } from '../webview/MessageHandler.js'; import { WebViewContent } from '../webview/WebViewContent.js'; import { CliInstaller } from '../cli/cliInstaller.js'; import { getFileName } from './utils/webviewUtils.js'; -import { authMethod } from '../constants/auth.js'; +import { authMethod } from '../types/acpTypes.js'; export class WebViewProvider { private panelManager: PanelManager; diff --git a/packages/vscode-ide-companion/src/webview/index.tsx b/packages/vscode-ide-companion/src/webview/index.tsx index b2a526fa..547dc3fc 100644 --- a/packages/vscode-ide-companion/src/webview/index.tsx +++ b/packages/vscode-ide-companion/src/webview/index.tsx @@ -6,6 +6,7 @@ import ReactDOM from 'react-dom/client'; import { App } from './App.js'; + // eslint-disable-next-line import/no-internal-modules import './styles/tailwind.css'; // eslint-disable-next-line import/no-internal-modules