From 520ef5281e64327804073a0983383d22799cec0c Mon Sep 17 00:00:00 2001 From: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com> Date: Mon, 2 Sep 2024 01:15:22 -0400 Subject: [PATCH] Add announcement --- CHANGELOG.md | 4 ++++ package.json | 2 +- src/ClaudeDev.ts | 4 +--- src/providers/ClaudeDevProvider.ts | 20 ++++---------------- src/utils/get-python-env.ts | 4 ---- webview-ui/src/components/Announcement.tsx | 8 ++++---- 6 files changed, 14 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a8147c..33c6cc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to the "claude-dev" extension will be documented in this fil +## [1.5.13] + +- New terminal emulator! When Claude runs commands, you can now type directly in the terminal (+ support for Python environments) + ## [1.5.6] - You can now edit Claude's changes before accepting! When he edits or creates a file, you can modify his changes directly in the right side of the diff view (+ hover over the 'Revert Block' arrow button in the center to undo `// rest of code here` shenanigans) diff --git a/package.json b/package.json index 34b4305..4639edc 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "claude-dev", "displayName": "Claude Dev", "description": "Autonomous coding agent right in your IDE, capable of creating/editing files, executing commands, and more with your permission every step of the way.", - "version": "1.5.12", + "version": "1.5.13", "icon": "icon.png", "engines": { "vscode": "^1.84.0" diff --git a/src/ClaudeDev.ts b/src/ClaudeDev.ts index b31831f..7f3f9f8 100644 --- a/src/ClaudeDev.ts +++ b/src/ClaudeDev.ts @@ -91,9 +91,7 @@ Default Shell: ${defaultShell}${await (async () => { if (pythonEnvPath) { return `\nPython Environment: ${pythonEnvPath}` } - } catch (error) { - console.log("Failed to get python env path", error) - } + } catch {} return "" })()} Home Directory: ${os.homedir()} diff --git a/src/providers/ClaudeDevProvider.ts b/src/providers/ClaudeDevProvider.ts index f16b6a1..ca2c275 100644 --- a/src/providers/ClaudeDevProvider.ts +++ b/src/providers/ClaudeDevProvider.ts @@ -33,7 +33,7 @@ export class ClaudeDevProvider implements vscode.WebviewViewProvider { private disposables: vscode.Disposable[] = [] private view?: vscode.WebviewView | vscode.WebviewPanel private claudeDev?: ClaudeDev - private latestAnnouncementId = "aug-31-2024-1" // update to some unique identifier when we add a new announcement + private latestAnnouncementId = "sep-2-2024" // update to some unique identifier when we add a new announcement constructor(readonly context: vscode.ExtensionContext, private readonly outputChannel: vscode.OutputChannel) { this.outputChannel.appendLine("ClaudeDevProvider instantiated") @@ -166,14 +166,7 @@ export class ClaudeDevProvider implements vscode.WebviewViewProvider { async initClaudeDevWithTask(task?: string, images?: string[]) { await this.clearTask() // ensures that an exising task doesn't exist before starting a new one, although this shouldn't be possible since user must clear task before starting a new one const { apiConfiguration, customInstructions, alwaysAllowReadOnly } = await this.getState() - this.claudeDev = new ClaudeDev( - this, - apiConfiguration, - customInstructions, - alwaysAllowReadOnly, - task, - images - ) + this.claudeDev = new ClaudeDev(this, apiConfiguration, customInstructions, alwaysAllowReadOnly, task, images) } async initClaudeDevWithHistoryItem(historyItem: HistoryItem) { @@ -472,13 +465,8 @@ export class ClaudeDevProvider implements vscode.WebviewViewProvider { } async getStateToPostToWebview() { - const { - apiConfiguration, - lastShownAnnouncementId, - customInstructions, - alwaysAllowReadOnly, - taskHistory, - } = await this.getState() + const { apiConfiguration, lastShownAnnouncementId, customInstructions, alwaysAllowReadOnly, taskHistory } = + await this.getState() return { version: this.context.extension?.packageJSON?.version ?? "", apiConfiguration, diff --git a/src/utils/get-python-env.ts b/src/utils/get-python-env.ts index 9a6a6cd..61e0ff9 100644 --- a/src/utils/get-python-env.ts +++ b/src/utils/get-python-env.ts @@ -4,14 +4,12 @@ export async function getPythonEnvPath(): Promise { const pythonExtension = vscode.extensions.getExtension("ms-python.python") if (!pythonExtension) { - console.log("Python extension is not installed.") return undefined } // Ensure the Python extension is activated if (!pythonExtension.isActive) { // if the python extension is not active, we can assume the project is not a python project - console.log("Python extension is not active.") return undefined } @@ -20,12 +18,10 @@ export async function getPythonEnvPath(): Promise { // Get the active environment path for the current workspace const workspaceFolder = vscode.workspace.workspaceFolders?.[0] if (!workspaceFolder) { - console.log("No workspace folder is open.") return undefined } // Get the active python environment path for the current workspace const pythonEnv = await pythonApi?.environments?.getActiveEnvironmentPath(workspaceFolder.uri) - console.log("Python environment path:", pythonEnv) if (pythonEnv && pythonEnv.path) { return pythonEnv.path } else { diff --git a/webview-ui/src/components/Announcement.tsx b/webview-ui/src/components/Announcement.tsx index 1554029..3f5b6cc 100644 --- a/webview-ui/src/components/Announcement.tsx +++ b/webview-ui/src/components/Announcement.tsx @@ -30,6 +30,10 @@ const Announcement = ({ version, hideAnnouncement, apiConfiguration, vscodeUriSc 🎉{" "}New in v{version}

Follow me for more updates!{" "}