From 38f98951d09cc4d3c936b6b8c037ba5ef12c6e63 Mon Sep 17 00:00:00 2001 From: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com> Date: Fri, 16 Aug 2024 23:36:39 -0400 Subject: [PATCH] Minor UI changes; update copy --- README.md | 6 ++-- package.json | 4 +-- src/ClaudeDev.ts | 5 +-- src/api/anthropic.ts | 2 +- src/api/openrouter.ts | 1 + webview-ui/src/components/ChatView.tsx | 8 +++-- webview-ui/src/components/SettingsView.tsx | 41 +++++++++++----------- webview-ui/src/components/TaskHeader.tsx | 4 +-- 8 files changed, 38 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 772f3a8415..b103c9ad6a 100644 --- a/README.md +++ b/README.md @@ -12,17 +12,17 @@ Thanks to [Claude 3.5 Sonnet's agentic coding capabilities](https://www-cdn.anth - Paste images in chat to use Claude's vision capabilities and turn mockups into fully functional applications or fix bugs with screenshots - Inspect diffs of every change Claude makes right in the editor, and provide feedback until you're satisfied with the result -- Runs terminal commands directly in chat, so you never have to open a terminal yourself (+ respond to interactive commands by sending a message) +- Runs CLI commands directly in chat, so you never have to open a terminal yourself (+ respond to interactive commands by sending a message) - Presents permission buttons (i.e. 'Approve terminal command') before tool use or sending information to the API - Keep track of total tokens and API usage cost for the entire task loop and individual requests - Set a maximum # of API requests allowed for a task before being prompted for permission to proceed - When a task is completed, Claude determines if he can present the result to you with a terminal command like `open -a "Google Chrome" index.html`, which you run with a click of a button -_**Pro tip**: Use the `Cmd + Shift + P` shortcut to open the command palette and type `Claude Dev: Open In New Tab` to start a new task right in your editor._ +_**Pro tip**: Use the `Cmd + Shift + P` shortcut to open the command palette and type `Claude Dev: Open In New Tab` to start a new task right in the editor._ ## How it works -Claude Dev uses an autonomous task execution loop with chain-of-thought prompting and access to powerful tools that give him the ability to accomplish nearly any task. Start by providing a task and the loop fires off, where it might use certain tools (with your permission) to accomplish each step in its thought process. +Claude Dev uses an autonomous task execution loop with chain-of-thought prompting and access to powerful tools that give him the ability to accomplish nearly any task. Start by providing a task and the loop fires off, where Claude might use certain tools (with your permission) to accomplish each step in his thought process. ### Tools diff --git a/package.json b/package.json index f6428f36f3..7caf3cd9c3 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "claude-dev", "displayName": "Claude Dev", - "description": "Autonomous software engineer right in your IDE, capable of creating/editing files, executing commands, and more with your permission every step of the way.", - "version": "1.2.1", + "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.2.2", "icon": "icon.png", "engines": { "vscode": "^1.84.0" diff --git a/src/ClaudeDev.ts b/src/ClaudeDev.ts index dbcee1971b..db737ca313 100644 --- a/src/ClaudeDev.ts +++ b/src/ClaudeDev.ts @@ -162,7 +162,7 @@ const tools: Tool[] = [ { name: "write_to_file", description: - "Write content to a file at the specified path. If the file exists, only the necessary changes will be applied. If the file doesn't exist, it will be created. Always provide the full intended content of the file, without any truncation. This tool will automatically create any directories needed to write the file.", + "Write content to a file at the specified path. If the file exists, it will be completely overwritten with the provided content (so do NOT omit unmodified sections). If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file.", input_schema: { type: "object", properties: { @@ -172,7 +172,8 @@ const tools: Tool[] = [ }, content: { type: "string", - description: "The full content to write to the file", + description: + "The full content to write to the file. Must be the full intended content of the file, without any omission or truncation.", }, }, required: ["path", "content"], diff --git a/src/api/anthropic.ts b/src/api/anthropic.ts index cc0b8602d9..e24fb76f7b 100644 --- a/src/api/anthropic.ts +++ b/src/api/anthropic.ts @@ -33,7 +33,7 @@ export class AnthropicHandler implements ApiHandler { { model: modelId, max_tokens: this.getModel().info.maxTokens, - system: [{ text: systemPrompt, type: "text", cache_control: { type: "ephemeral" } }], + system: [{ text: systemPrompt, type: "text", cache_control: { type: "ephemeral" } }], // setting cache breakpoint for system prompt so new tasks can reuse it messages: messages.map((message, index) => { if (index === lastUserMsgIndex || index === secondLastMsgUserIndex) { return { diff --git a/src/api/openrouter.ts b/src/api/openrouter.ts index bb354e4341..b7940fa165 100644 --- a/src/api/openrouter.ts +++ b/src/api/openrouter.ts @@ -379,6 +379,7 @@ export class OpenRouterHandler implements ApiHandler { return { model: this.getModel().id, max_tokens: this.getModel().info.maxTokens, + system: "(see SYSTEM_PROMPT in src/ClaudeDev.ts)", messages: [{ conversation_history: "..." }, { role: "user", content: withoutImageData(userContent) }], tools: "(see tools in src/ClaudeDev.ts)", tool_choice: "auto", diff --git a/webview-ui/src/components/ChatView.tsx b/webview-ui/src/components/ChatView.tsx index f275dca8ea..31a228fe4b 100644 --- a/webview-ui/src/components/ChatView.tsx +++ b/webview-ui/src/components/ChatView.tsx @@ -618,15 +618,17 @@ const ChatView = ({ appearance="icon" aria-label="Attach Images" onClick={selectImages} - style={{ marginRight: "4px" }}> - + style={{ marginRight: "2px" }}> + - + diff --git a/webview-ui/src/components/SettingsView.tsx b/webview-ui/src/components/SettingsView.tsx index ffc4fdb218..b420c51753 100644 --- a/webview-ui/src/components/SettingsView.tsx +++ b/webview-ui/src/components/SettingsView.tsx @@ -72,7 +72,7 @@ const SettingsView = ({ left: 0, right: 0, bottom: 0, - padding: "10px 0px 15px 20px", + padding: "10px 0px 0px 20px", display: "flex", flexDirection: "column", overflow: "hidden", @@ -88,7 +88,8 @@ const SettingsView = ({

Settings

Done -
+
-
+
)}
-
-
-

- If you have any questions or feedback, feel free to open an issue at{" "} - - https://github.com/saoudrizwan/claude-dev - -

-

v{version}

+
+

+ If you have any questions or feedback, feel free to open an issue at{" "} + + https://github.com/saoudrizwan/claude-dev + +

+

v{version}

+
) diff --git a/webview-ui/src/components/TaskHeader.tsx b/webview-ui/src/components/TaskHeader.tsx index e876d9eba5..bfb356a2db 100644 --- a/webview-ui/src/components/TaskHeader.tsx +++ b/webview-ui/src/components/TaskHeader.tsx @@ -195,7 +195,7 @@ const TaskHeader: React.FC = ({ {tokensIn.toLocaleString()} @@ -209,7 +209,7 @@ const TaskHeader: React.FC = ({
{(doesModelSupportPromptCache || cacheReads !== undefined || cacheWrites !== undefined) && (
- Prompt Cache: + Cache: