diff --git a/package-lock.json b/package-lock.json index f0d36579d68..8579831a58f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,6 +31,7 @@ "diff-match-patch": "^1.0.5", "fast-deep-equal": "^3.1.3", "fastest-levenshtein": "^1.0.16", + "fzf": "^0.5.2", "get-folder-size": "^5.0.0", "globby": "^14.0.2", "isbinaryfile": "^5.0.2", @@ -51,6 +52,7 @@ "tmp": "^0.2.3", "tree-sitter-wasms": "^0.1.11", "turndown": "^7.2.0", + "vscrui": "^0.2.1", "web-tree-sitter": "^0.22.6", "zod": "^3.23.8" }, @@ -6025,6 +6027,16 @@ "resolved": "https://registry.npmjs.org/@types/pdf-parse/-/pdf-parse-1.1.4.tgz", "integrity": "sha512-+gbBHbNCVGGYw1S9lAIIvrHW47UYOhMIFUsJcMkMrzy1Jf0vulBN3XQIjPgnoOXveMuHnF3b57fXROnY/Or7eg==" }, + "node_modules/@types/react": { + "version": "19.0.10", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.0.10.tgz", + "integrity": "sha512-JuRQ9KXLEjaUNjTWpzuR231Z2WpIwczOkBEIvbHNCzQefFIT0L8IqE6NV6ULLyC1SI/i234JnDoMkfg+RjQj2g==", + "license": "MIT", + "peer": true, + "dependencies": { + "csstype": "^3.0.2" + } + }, "node_modules/@types/stack-utils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", @@ -7830,6 +7842,13 @@ "url": "https://github.com/sponsors/fb55" } }, + "node_modules/csstype": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", + "license": "MIT", + "peer": true + }, "node_modules/data-uri-to-buffer": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz", @@ -9319,6 +9338,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/fzf": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fzf/-/fzf-0.5.2.tgz", + "integrity": "sha512-Tt4kuxLXFKHy8KT40zwsUPUkg1CrsgY25FxA2U/j/0WgEDCk3ddc/zLTCCcbSHX9FcKtLuVaDGtGE/STWC+j3Q==", + "license": "BSD-3-Clause" + }, "node_modules/gauge": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/gauge/-/gauge-5.0.2.tgz", @@ -13646,6 +13671,16 @@ "node": ">= 0.8" } }, + "node_modules/react": { + "version": "19.0.0", + "resolved": "https://registry.npmjs.org/react/-/react-19.0.0.tgz", + "integrity": "sha512-V8AVnmPIICiWpGfm6GLzCR/W5FXLchHop40W4nXBmdlEceh16rCN8O8LNWm5bh5XUX91fh7KpA+W0TgMKmgTpQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/react-is": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", @@ -15327,6 +15362,20 @@ "spdx-expression-parse": "^3.0.0" } }, + "node_modules/vscrui": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/vscrui/-/vscrui-0.2.1.tgz", + "integrity": "sha512-PiPCYoiiw2Z8ZmMwCIqjHWszaUruyTa345yh6mIOixQH9DLfeYUK040huAlwVL+yZ32xb8tB6zHcL6PUGdiXyQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/estruyf" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^17 || ^18 || ^19" + } + }, "node_modules/walker": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", diff --git a/package.json b/package.json index c43cf05b11e..4cf8265fdb2 100644 --- a/package.json +++ b/package.json @@ -326,6 +326,7 @@ "diff-match-patch": "^1.0.5", "fast-deep-equal": "^3.1.3", "fastest-levenshtein": "^1.0.16", + "fzf": "^0.5.2", "get-folder-size": "^5.0.0", "globby": "^14.0.2", "isbinaryfile": "^5.0.2", @@ -346,6 +347,7 @@ "tmp": "^0.2.3", "tree-sitter-wasms": "^0.1.11", "turndown": "^7.2.0", + "vscrui": "^0.2.1", "web-tree-sitter": "^0.22.6", "zod": "^3.23.8" }, diff --git a/src/core/Cline.ts b/src/core/Cline.ts index 9c2977a2669..93553479e19 100644 --- a/src/core/Cline.ts +++ b/src/core/Cline.ts @@ -64,6 +64,7 @@ import { McpHub } from "../services/mcp/McpHub" import crypto from "crypto" import { insertGroups } from "./diff/insert-groups" import { EXPERIMENT_IDS, experiments as Experiments } from "../shared/experiments" +import { logger } from "../utils/logging" const cwd = vscode.workspace.workspaceFolders?.map((folder) => folder.uri.fsPath).at(0) ?? path.join(os.homedir(), "Desktop") // may or may not exist but fs checking existence would immediately ask for permission which would be bad UX, need to come up with a better solution @@ -597,6 +598,8 @@ export class Cline { let modifiedOldUserContent: UserContent // either the last message if its user message, or the user message before the last (assistant) message let modifiedApiConversationHistory: Anthropic.Messages.MessageParam[] // need to remove the last user message to replace with new modified user message + modifiedOldUserContent = [] + modifiedApiConversationHistory = [] if (existingApiConversationHistory.length > 0) { const lastMessage = existingApiConversationHistory[existingApiConversationHistory.length - 1] @@ -666,7 +669,7 @@ export class Cline { throw new Error("Unexpected: Last message is not a user or assistant message") } } else { - throw new Error("Unexpected: No existing API conversation history") + logger.debug("Unexpected: No existing API conversation history") } let newUserContent: UserContent = [...modifiedOldUserContent] @@ -2836,7 +2839,7 @@ export class Cline { } const abortStream = async (cancelReason: ClineApiReqCancelReason, streamingFailedMessage?: string) => { - console.log(`[Cline#abortStream] cancelReason = ${cancelReason}`) + logger.debug(`[Cline#abortStream] cancelReason = ${cancelReason}`) if (this.diffViewProvider.isEditing) { await this.diffViewProvider.revertChanges() // closes diff view