From 3330b2c6712429b72914d6d8ac65887cdfeaaeec Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Wed, 2 Jul 2025 11:07:12 +0530 Subject: [PATCH 01/36] feat: prefix folder path for colocated rules --- .../src/markdown/markdownToRule.test.ts | 78 +++++++++++++++++-- .../src/markdown/markdownToRule.ts | 27 ++++++- 2 files changed, 97 insertions(+), 8 deletions(-) diff --git a/packages/config-yaml/src/markdown/markdownToRule.test.ts b/packages/config-yaml/src/markdown/markdownToRule.test.ts index 1b930220a..3f9cfc396 100644 --- a/packages/config-yaml/src/markdown/markdownToRule.test.ts +++ b/packages/config-yaml/src/markdown/markdownToRule.test.ts @@ -20,7 +20,7 @@ This is a test rule.`; const result = markdownToRule(content, mockId); expect(result.rule).toBe("# Test Rule\n\nThis is a test rule."); - expect(result.globs).toBe("**/test/**/*.kt"); + expect(result.globs).toBe("/path/to/**/test/**/*.kt"); expect(result.name).toBe("Custom Name"); }); @@ -34,7 +34,7 @@ globs: "**/test/**/*.kt" This is a test rule.`; const result = markdownToRule(content, mockId); - expect(result.globs).toBe("**/test/**/*.kt"); + expect(result.globs).toBe("/path/to/**/test/**/*.kt"); expect(result.rule).toBe("# Test Rule\n\nThis is a test rule."); expect(result.name).toBe("to/file"); // Should use last two path segments }); @@ -45,7 +45,7 @@ This is a test rule.`; This is a test rule without frontmatter.`; const result = markdownToRule(content, mockId); - expect(result.globs).toBeUndefined(); + expect(result.globs).toBe("/path/to/**/*"); expect(result.rule).toBe(content); expect(result.name).toBe("to/file"); // Should use last two path segments }); @@ -59,13 +59,77 @@ This is a test rule without frontmatter.`; This is a test rule with empty frontmatter.`; const result = markdownToRule(content, mockId); - expect(result.globs).toBeUndefined(); + expect(result.globs).toBe("/path/to/**/*"); expect(result.rule).toBe( "# Test Rule\n\nThis is a test rule with empty frontmatter.", ); expect(result.name).toBe("to/file"); // Should use last two path segments }); + describe("glob patterns", () => { + it("should match glob pattern for file extensions", () => { + const content = `--- +globs: "*.ts" +name: glob pattern testing +--- + + # Test Rule + + This is a test rule.`; + + const result = markdownToRule(content, mockId); + expect(result.globs).toBe("/path/to/**/*.ts"); + }); + + it("should match glob pattern for dotfiles", () => { + const content = `--- +globs: ".gitignore" +name: glob pattern testing +--- + + # Test Rule + + This is a test rule.`; + + const result = markdownToRule(content, mockId); + expect(result.globs).toBe("/path/to/**/.gitignore"); + }); + + it("should also work in root as base directory", () => { + const content = `--- +globs: "src/**/Dockerfile" +name: glob pattern testing +--- + + # Test Rule + + This is a test rule.`; + + const result = markdownToRule(content, { + uriType: "file", + filePath: "/", + }); + expect(result.globs).toBe("/src/**/Dockerfile"); + }); + + it("should match have nested folder for multiple globs", () => { + const content = `--- +globs: ["**/nested/**/deeper/**/*.rs", ".zshrc"] +name: glob pattern testing +--- + +# Test Rule + +This is a test rule.`; + + const result = markdownToRule(content, mockId); + expect(result.globs).toEqual([ + "/path/to/**/nested/**/deeper/**/*.rs", + "/path/to/**/.zshrc", + ]); + }); + }); + it("should handle frontmatter with whitespace", () => { const content = `--- globs: "**/test/**/*.kt" @@ -76,7 +140,7 @@ globs: "**/test/**/*.kt" This is a test rule.`; const result = markdownToRule(content, mockId); - expect(result.globs).toBe("**/test/**/*.kt"); + expect(result.globs).toBe("/path/to/**/test/**/*.kt"); expect(result.rule).toBe("# Test Rule\n\nThis is a test rule."); expect(result.name).toBe("to/file"); // Should use last two path segments }); @@ -92,7 +156,7 @@ globs: "**/test/**/*.kt"\r This is a test rule.`; const result = markdownToRule(content, mockId); - expect(result.globs).toBe("**/test/**/*.kt"); + expect(result.globs).toBe("/path/to/**/test/**/*.kt"); // The result should be normalized to \n expect(result.rule).toBe("# Test Rule\n\nThis is a test rule."); expect(result.name).toBe("to/file"); // Should use last two path segments @@ -110,7 +174,7 @@ This is a test rule.`; // Should treat as only markdown when frontmatter is malformed const result = markdownToRule(content, mockId); - expect(result.globs).toBeUndefined(); + expect(result.globs).toBe("/path/to/**/*"); expect(result.rule).toBe(content); expect(result.name).toBe("to/file"); // Should use last two path segments }); diff --git a/packages/config-yaml/src/markdown/markdownToRule.ts b/packages/config-yaml/src/markdown/markdownToRule.ts index 3add16b6c..bc88e1018 100644 --- a/packages/config-yaml/src/markdown/markdownToRule.ts +++ b/packages/config-yaml/src/markdown/markdownToRule.ts @@ -1,3 +1,4 @@ +import path from "path"; import * as YAML from "yaml"; import { PackageIdentifier, @@ -69,6 +70,30 @@ export function getRuleName( return displayName; } +function getGlobPattern( + globs: RuleFrontmatter["globs"], + id: PackageIdentifier, +) { + if (id.uriType !== "file") { + return globs; + } + const dir = path.dirname(id.filePath); + const prependDirAndApplyGlobstar = (glob: string) => { + // skip if glob is a directory + if (glob.includes("/")) { + return path.join(dir, glob); + } + return path.join(dir, `**/${glob}`); + }; + if (!globs) { + return prependDirAndApplyGlobstar("**/*"); + } + if (Array.isArray(globs)) { + return globs.map(prependDirAndApplyGlobstar); + } + return prependDirAndApplyGlobstar(globs); +} + export function markdownToRule( rule: string, id: PackageIdentifier, @@ -78,7 +103,7 @@ export function markdownToRule( return { name: getRuleName(frontmatter, id), rule: markdown, - globs: frontmatter.globs, + globs: getGlobPattern(frontmatter.globs, id), regex: frontmatter.regex, description: frontmatter.description, alwaysApply: frontmatter.alwaysApply, From 581ff1af9a347e2ae6a087c27087aa16a91e5dc9 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Thu, 3 Jul 2025 13:02:38 +0530 Subject: [PATCH 02/36] fix dir prepend and .continue append --- .../src/markdown/markdownToRule.test.ts | 35 ++++++++++++++++--- .../src/markdown/markdownToRule.ts | 8 +++-- 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/packages/config-yaml/src/markdown/markdownToRule.test.ts b/packages/config-yaml/src/markdown/markdownToRule.test.ts index 3f9cfc396..0d96ab19e 100644 --- a/packages/config-yaml/src/markdown/markdownToRule.test.ts +++ b/packages/config-yaml/src/markdown/markdownToRule.test.ts @@ -67,6 +67,14 @@ This is a test rule with empty frontmatter.`; }); describe("glob patterns", () => { + // we want to ensure the following glob changes happen + // *.ts -> path/to/**/*.ts + // **/subdir/** -> path/to/**/**/subdir/** OR path/to/**/subdir/** + // myfile -> path/to/**/myfile (any depth including 0) + // mydir/ -> path/to/**/mydir/** + // **abc** -> path/to/**abc** + // *xyz* -> path/to/**/*xyz* + it("should match glob pattern for file extensions", () => { const content = `--- globs: "*.ts" @@ -109,12 +117,12 @@ name: glob pattern testing uriType: "file", filePath: "/", }); - expect(result.globs).toBe("/src/**/Dockerfile"); + expect(result.globs).toBe("/**/src/**/Dockerfile"); }); - it("should match have nested folder for multiple globs", () => { + it("should match for multiple globs", () => { const content = `--- -globs: ["**/nested/**/deeper/**/*.rs", ".zshrc"] +globs: ["**/nested/**/deeper/**/*.rs", ".zshrc1", "**abc**", "*xyz*"] name: glob pattern testing --- @@ -125,9 +133,28 @@ This is a test rule.`; const result = markdownToRule(content, mockId); expect(result.globs).toEqual([ "/path/to/**/nested/**/deeper/**/*.rs", - "/path/to/**/.zshrc", + "/path/to/**/.zshrc1", + "/path/to/**abc**", + "/path/to/**/*xyz*", ]); }); + + it("should not prepend when inside .continue", () => { + const content = `--- +globs: ".git" +name: glob pattern testing +--- + + # Test Rule + + This is a test rule.`; + + const result = markdownToRule(content, { + uriType: "file", + filePath: "/Documents/myproject/.continue/rules/rule1.md", + }); + expect(result.globs).toBe(".git"); + }); }); it("should handle frontmatter with whitespace", () => { diff --git a/packages/config-yaml/src/markdown/markdownToRule.ts b/packages/config-yaml/src/markdown/markdownToRule.ts index bc88e1018..41306fe3d 100644 --- a/packages/config-yaml/src/markdown/markdownToRule.ts +++ b/packages/config-yaml/src/markdown/markdownToRule.ts @@ -78,15 +78,17 @@ function getGlobPattern( return globs; } const dir = path.dirname(id.filePath); + if (dir.includes(".continue")) { + return globs; + } const prependDirAndApplyGlobstar = (glob: string) => { - // skip if glob is a directory - if (glob.includes("/")) { + if (glob.startsWith("**")) { return path.join(dir, glob); } return path.join(dir, `**/${glob}`); }; if (!globs) { - return prependDirAndApplyGlobstar("**/*"); + return path.join(dir, "**/*"); } if (Array.isArray(globs)) { return globs.map(prependDirAndApplyGlobstar); From d30483f96710b707492bbfbd5eafffe07e3d1940 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Thu, 3 Jul 2025 13:11:03 +0530 Subject: [PATCH 03/36] fix tests --- .../src/markdown/createMarkdownRule.test.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/config-yaml/src/markdown/createMarkdownRule.test.ts b/packages/config-yaml/src/markdown/createMarkdownRule.test.ts index 52fb9db33..982e823bf 100644 --- a/packages/config-yaml/src/markdown/createMarkdownRule.test.ts +++ b/packages/config-yaml/src/markdown/createMarkdownRule.test.ts @@ -9,7 +9,7 @@ import { markdownToRule } from "./markdownToRule.js"; // Mock package identifier for testing const mockPackageId: PackageIdentifier = { uriType: "file", - filePath: "/path/to/file", + filePath: "/path/to/folder", }; describe("sanitizeRuleName", () => { @@ -85,7 +85,9 @@ Just markdown content.`; expect(parsed.name).toBe(originalFrontmatter.name); expect(parsed.description).toBe(originalFrontmatter.description); - expect(parsed.globs).toEqual(originalFrontmatter.globs); + expect(parsed.globs).toEqual( + originalFrontmatter.globs.map((glob) => `/path/to/**/${glob}`), + ); expect(parsed.alwaysApply).toBe(originalFrontmatter.alwaysApply); expect(parsed.rule).toBe(originalMarkdown); }); @@ -102,7 +104,7 @@ describe("createRuleMarkdown", () => { const parsed = markdownToRule(result, mockPackageId); expect(parsed.description).toBe("Test description"); - expect(parsed.globs).toEqual(["*.ts", "*.js"]); + expect(parsed.globs).toEqual(["/path/to/**/*.ts", "/path/to/**/*.js"]); expect(parsed.alwaysApply).toBe(true); expect(parsed.rule).toBe("This is the rule content"); }); @@ -113,7 +115,7 @@ describe("createRuleMarkdown", () => { const parsed = markdownToRule(result, mockPackageId); expect(parsed.description).toBeUndefined(); - expect(parsed.globs).toBeUndefined(); + expect(parsed.globs).toBe("/path/to/**/*"); expect(parsed.alwaysApply).toBeUndefined(); expect(parsed.rule).toBe("Simple content"); }); @@ -124,7 +126,7 @@ describe("createRuleMarkdown", () => { }); const parsed = markdownToRule(result, mockPackageId); - expect(parsed.globs).toBe("*.py"); + expect(parsed.globs).toBe("/path/to/**/*.py"); }); it("should trim description and globs", () => { @@ -135,7 +137,7 @@ describe("createRuleMarkdown", () => { const parsed = markdownToRule(result, mockPackageId); expect(parsed.description).toBe("spaced description"); - expect(parsed.globs).toBe("*.ts"); + expect(parsed.globs).toBe("/path/to/**/*.ts"); }); it("should handle alwaysApply false explicitly", () => { From e3c9e489e347b81e6f50663336677edf0738b079 Mon Sep 17 00:00:00 2001 From: chezsmithy Date: Fri, 4 Jul 2025 22:59:02 -0700 Subject: [PATCH 04/36] feat: :sparkles: Enhance searching for context providers --- gui/src/context/SubmenuContextProviders.tsx | 244 +++++++++++++++++++- 1 file changed, 241 insertions(+), 3 deletions(-) diff --git a/gui/src/context/SubmenuContextProviders.tsx b/gui/src/context/SubmenuContextProviders.tsx index cf3939c48..b3d8ca21f 100644 --- a/gui/src/context/SubmenuContextProviders.tsx +++ b/gui/src/context/SubmenuContextProviders.tsx @@ -29,6 +29,14 @@ const MINISEARCH_OPTIONS = { const MAX_LENGTH = 70; +// Enhanced search result interface for intelligent sorting +interface EnhancedSearchResult + extends SearchResult, + ContextSubmenuItemWithProvider { + sortPriority: number; + matchQuality: number; +} + interface SubtextContextProvidersContextType { getSubmenuContextItems: ( providerTitle: string | undefined, @@ -43,6 +51,91 @@ const initialContextProviders: SubtextContextProvidersContextType = { const SubmenuContextProvidersContext = createContext(initialContextProviders); +// Helper functions for intelligent file sorting +function hasExactWordMatch(text: string, query: string): boolean { + const words = text.split(/[^a-zA-Z0-9]+/); + return words.some((word) => word === query); +} + +function isCommonDevFile(fileName: string): boolean { + const commonExtensions = [ + ".ts", + ".tsx", + ".js", + ".jsx", + ".py", + ".java", + ".cpp", + ".c", + ".h", + ".vue", + ".svelte", + ]; + const commonNames = [ + "index", + "main", + "app", + "component", + "service", + "util", + "helper", + "config", + "types", + ]; + + const extension = fileName.substring(fileName.lastIndexOf(".")); + const baseName = fileName + .substring(0, fileName.lastIndexOf(".")) + .toLowerCase(); + + return commonExtensions.includes(extension) || commonNames.includes(baseName); +} + +function isInCommonDirectory(filePath: string): boolean { + const commonDirs = [ + "src/", + "lib/", + "components/", + "utils/", + "helpers/", + "services/", + "pages/", + "views/", + "hooks/", + "store/", + "types/", + "interfaces/", + "models/", + "api/", + ]; + return commonDirs.some((dir) => filePath.includes(dir)); +} + +function matchesCamelCaseOrAbbreviation( + fileName: string, + query: string, +): boolean { + // Extract capital letters for camel case matching + const capitals = fileName.match(/[A-Z]/g)?.join("").toLowerCase() || ""; + + // Check if query matches the capital letters pattern + if (capitals.length > 0 && capitals.includes(query)) { + return true; + } + + // Check for abbreviation matches (first letters of words) + const words = fileName.split(/[^a-zA-Z0-9]+/).filter((w) => w.length > 0); + if (words.length > 1) { + const abbreviation = words + .map((word) => word[0]) + .join("") + .toLowerCase(); + return abbreviation.includes(query); + } + + return false; +} + export const SubmenuContextProvidersProvider = ({ children, }: { @@ -128,6 +221,98 @@ export const SubmenuContextProvidersProvider = ({ new Map(), ).current; + const calculateFileSortPriority = useCallback( + ( + result: SearchResult & ContextSubmenuItemWithProvider, + query: string, + openFiles: ContextSubmenuItemWithProvider[], + ): number => { + const fileName = result.title.toLowerCase(); + const filePath = result.description.toLowerCase(); + const queryLower = query.toLowerCase(); + + // Priority 1: Exact filename match + if (fileName === queryLower) { + return 1; + } + + // Priority 2: Recently opened files + if (openFiles.some((f) => f.id === result.id)) { + return 2; + } + + // Priority 3: Filename starts with query + if (fileName.startsWith(queryLower)) { + return 3; + } + + // Priority 4: Exact word match in filename + if (hasExactWordMatch(fileName, queryLower)) { + return 4; + } + + // Priority 5: Common development files + if (isCommonDevFile(fileName)) { + return 5; + } + + // Priority 6: Files in common directories + if (isInCommonDirectory(filePath)) { + return 6; + } + + // Priority 7: CamelCase/abbreviation matches + if (matchesCamelCaseOrAbbreviation(fileName, queryLower)) { + return 7; + } + + // Priority 8: Path starts with query + if (filePath.startsWith(queryLower)) { + return 8; + } + + // Priority 9: Default + return 9; + }, + [], + ); + + const calculateMatchQuality = useCallback( + ( + result: SearchResult & ContextSubmenuItemWithProvider, + query: string, + ): number => { + const fileName = result.title.toLowerCase(); + const queryLower = query.toLowerCase(); + let quality = 0; + + // Exact match bonus + if (fileName === queryLower) quality += 100; + + // Prefix match bonus + if (fileName.startsWith(queryLower)) quality += 50; + + // Contains match bonus + if (fileName.includes(queryLower)) quality += 25; + + // Shorter filename bonus (prefer concise names) + quality += Math.max(0, 50 - fileName.length); + + // Extension preference (common dev files) + if ( + fileName.endsWith(".ts") || + fileName.endsWith(".tsx") || + fileName.endsWith(".js") || + fileName.endsWith(".jsx") + ) { + quality += 10; + } + + return quality; + }, + [], + ); + const getSubmenuContextItems = useCallback( ( providerTitle: string | undefined, @@ -168,9 +353,57 @@ export const SubmenuContextProvidersProvider = ({ }); } } - searchResults.sort((a, b) => b.score - a.score); - // 2. Add fallback results if no search results + // 2. Enhanced sorting for file provider + if ( + providerTitle === "file" || + (!providerTitle && + searchResults.some((r) => r.providerTitle === "file")) + ) { + const enhancedResults: EnhancedSearchResult[] = searchResults.map( + (result): EnhancedSearchResult => ({ + ...result, + id: result.id, + title: result.title, + description: result.description, + providerTitle: result.providerTitle, + sortPriority: calculateFileSortPriority( + result, + query, + lastOpenFilesRef.current, + ), + matchQuality: calculateMatchQuality(result, query), + }), + ); + + // Sort by multiple criteria + enhancedResults.sort((a, b) => { + // Primary: Sort priority (lower = better) + if (a.sortPriority !== b.sortPriority) { + return a.sortPriority - b.sortPriority; + } + + // Secondary: Match quality (higher = better) + if (a.matchQuality !== b.matchQuality) { + return b.matchQuality - a.matchQuality; + } + + // Tertiary: MiniSearch relevance score (higher = better) + if (a.score !== b.score) { + return b.score - a.score; + } + + // Quaternary: Path length (shorter = better) + return a.description.length - b.description.length; + }); + + searchResults = enhancedResults; + } else { + // Default sorting for non-file providers + searchResults.sort((a, b) => b.score - a.score); + } + + // 3. Add fallback results if no search results if (searchResults.length === 0) { const fallbackItems = ( providerTitle ? (fallbackResults[providerTitle] ?? []) : [] @@ -223,7 +456,12 @@ export const SubmenuContextProvidersProvider = ({ return []; } }, - [fallbackResults, minisearches], + [ + fallbackResults, + minisearches, + calculateFileSortPriority, + calculateMatchQuality, + ], ); const loadSubmenuItems = useCallback( From 687e56d8dcaee6b9b810e0baa55e169e564024f2 Mon Sep 17 00:00:00 2001 From: chezsmithy Date: Sat, 5 Jul 2025 00:04:16 -0700 Subject: [PATCH 05/36] fixes --- gui/src/context/SubmenuContextProviders.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/src/context/SubmenuContextProviders.tsx b/gui/src/context/SubmenuContextProviders.tsx index b3d8ca21f..b82c36b6c 100644 --- a/gui/src/context/SubmenuContextProviders.tsx +++ b/gui/src/context/SubmenuContextProviders.tsx @@ -32,7 +32,7 @@ const MAX_LENGTH = 70; // Enhanced search result interface for intelligent sorting interface EnhancedSearchResult extends SearchResult, - ContextSubmenuItemWithProvider { + Omit { sortPriority: number; matchQuality: number; } From 8d68230035211402cb108b0856c53ff17d0d41c8 Mon Sep 17 00:00:00 2001 From: adarshramiyer Date: Mon, 7 Jul 2025 14:43:56 -0700 Subject: [PATCH 06/36] made edit logging directories user-configurable --- binary/package-lock.json | 2 + core/nextEdit/context/processNextEditData.ts | 34 +++++----- extensions/vscode/package-lock.json | 6 +- .../vscode/src/util/editLoggingUtils.ts | 64 ++++++++++++++----- gui/package-lock.json | 2 + 5 files changed, 74 insertions(+), 34 deletions(-) diff --git a/binary/package-lock.json b/binary/package-lock.json index 51e6f5cf9..11dd6505b 100644 --- a/binary/package-lock.json +++ b/binary/package-lock.json @@ -121,6 +121,8 @@ "@babel/preset-env": "^7.24.7", "@biomejs/biome": "1.6.4", "@google/generative-ai": "^0.11.4", + "@shikijs/colorized-brackets": "^3.7.0", + "@shikijs/transformers": "^3.7.0", "@types/diff": "^7.0.1", "@types/follow-redirects": "^1.14.4", "@types/jest": "^29.5.12", diff --git a/core/nextEdit/context/processNextEditData.ts b/core/nextEdit/context/processNextEditData.ts index cb514f1e6..206b17b80 100644 --- a/core/nextEdit/context/processNextEditData.ts +++ b/core/nextEdit/context/processNextEditData.ts @@ -2,7 +2,7 @@ import { IDE, Position } from "../.."; import { AutocompleteCodeSnippet } from "../../autocomplete/snippets/types"; import { GetLspDefinitionsFunction } from "../../autocomplete/types"; import { ConfigHandler } from "../../config/ConfigHandler"; -// import { DataLogger } from "../../data/log"; +import { DataLogger } from "../../data/log"; import { RecentlyEditedRange } from "../types"; import { getAutocompleteContext } from "./autocompleteContextFetching"; import { createDiff, DiffFormatType } from "./diffFormatting"; @@ -108,22 +108,22 @@ export const processNextEditData = async ({ ); } - // if (filenamesAndDiffs.length > 0) { - // // if there are previous edits, log - // void DataLogger.getInstance().logDevData({ - // name: "nextEditWithHistory", - // data: { - // previousEdits: filenamesAndDiffs, - // fileURI: filePath, - // workspaceDirURI: workspaceDir, - // beforeContent, - // afterContent, - // beforeCursorPos: cursorPosBeforeEdit, - // afterCursorPos: cursorPosAfterPrevEdit, - // context: autocompleteContext, - // }, - // }); - // } + if (filenamesAndDiffs.length > 0) { + // if there are previous edits, log + void DataLogger.getInstance().logDevData({ + name: "nextEditWithHistory", + data: { + previousEdits: filenamesAndDiffs, + fileURI: filePath, + workspaceDirURI: workspaceDir, + beforeContent, + afterContent, + beforeCursorPos: cursorPosBeforeEdit, + afterCursorPos: cursorPosAfterPrevEdit, + context: autocompleteContext, + }, + }); + } // add current edit to history const thisEdit: prevEdit = { diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index 0f87e013c..b1f582aac 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "1.1.55", + "version": "1.1.57", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "1.1.55", + "version": "1.1.57", "license": "Apache-2.0", "dependencies": { "@continuedev/config-types": "^1.0.14", @@ -173,6 +173,8 @@ "@babel/preset-env": "^7.24.7", "@biomejs/biome": "1.6.4", "@google/generative-ai": "^0.11.4", + "@shikijs/colorized-brackets": "^3.7.0", + "@shikijs/transformers": "^3.7.0", "@types/diff": "^7.0.1", "@types/follow-redirects": "^1.14.4", "@types/jest": "^29.5.12", diff --git a/extensions/vscode/src/util/editLoggingUtils.ts b/extensions/vscode/src/util/editLoggingUtils.ts index 90992db2e..1c6bd3dfb 100644 --- a/extensions/vscode/src/util/editLoggingUtils.ts +++ b/extensions/vscode/src/util/editLoggingUtils.ts @@ -3,6 +3,10 @@ import { AutocompleteCodeSnippet } from "core/autocomplete/snippets/types"; import { GetLspDefinitionsFunction } from "core/autocomplete/types"; import { ConfigHandler } from "core/config/ConfigHandler"; import { RecentlyEditedRange } from "core/nextEdit/types"; +import { getContinueGlobalPath } from "core/util/paths"; +import { findUriInDirs } from "core/util/uri"; +import fs from "fs"; +import { resolve } from "path"; import * as vscode from "vscode"; import { ContinueCompletionProvider } from "../autocomplete/completionProvider"; @@ -18,23 +22,53 @@ export const getBeforeCursorPos = (range: Range, activePos: Position) => { } }; -const getWorkspaceDirInfo = async ( - event: vscode.TextDocumentChangeEvent, - ide: IDE, -) => { - // gets the workspace dir uri and checks if it's the open-source continue repo +const isFileWithinFolder = (fileUri: string, folderPath: string): boolean => { + try { + const uriMatch = fileUri.match(/^([a-zA-Z]+:\/\/)/); + const scheme = uriMatch ? uriMatch[1] : "file://"; + + const folderUri = folderPath.match(/^[a-zA-Z]+:\/\//) + ? folderPath + : `${scheme}${folderPath}`; + + const normalizedFolderUri = folderUri.endsWith("/") + ? folderUri + : `${folderUri}/`; + + const { foundInDir } = findUriInDirs(fileUri, [normalizedFolderUri]); + return foundInDir !== null; + } catch (error) { + return false; + } +}; + +const isEditLoggingAllowed = async (editedFileURI: string) => { + const globalContinuePath = getContinueGlobalPath(); + const editLogDirsPath = resolve(globalContinuePath, ".editlogdirs"); + + try { + const fileContent = await fs.promises.readFile(editLogDirsPath, "utf-8"); + const stringItems = fileContent + .split("\n") + .map((line) => line.trim()) + .filter((line) => line.length > 0); + + return stringItems.some((dir) => isFileWithinFolder(editedFileURI, dir)); + } catch (error) { + return false; + } +}; + +const getWorkspaceDirUri = async (event: vscode.TextDocumentChangeEvent) => { const workspaceFolder = vscode.workspace.getWorkspaceFolder( event.document.uri, ); if (!workspaceFolder) { return false; } + const workspaceDirUri = workspaceFolder.uri.toString(); - const repoName = await ide.getRepoName(workspaceDirUri); - return { - workspaceDirUri: workspaceDirUri, - isContinueRepo: repoName === "continuedev/continue", - }; + return workspaceDirUri; }; export const handleTextDocumentChange = async ( @@ -52,10 +86,10 @@ export const handleTextDocumentChange = async ( if (!editor) return; if (event.contentChanges.length === 0) return; - // Ensure that loggin will only happen in the open-source continue repo - const workspaceDirInfo = await getWorkspaceDirInfo(event, ide); - if (!workspaceDirInfo) return; - // if (!workspaceDirInfo.isContinueRepo) return; + // Ensure that logging will only happen in the open-source continue repo + const workspaceDirUri = await getWorkspaceDirUri(event); + if (!workspaceDirUri) return; + if (!(await isEditLoggingAllowed(event.document.uri.toString()))) return; const activeCursorPos = editor.selection.active; const editActions: RangeInFileWithNextEditInfo[] = changes.map((change) => ({ @@ -68,7 +102,7 @@ export const handleTextDocumentChange = async ( editText: change.text, beforeCursorPos: getBeforeCursorPos(change.range, activeCursorPos), afterCursorPos: activeCursorPos as Position, - workspaceDir: workspaceDirInfo.workspaceDirUri, + workspaceDir: workspaceDirUri, })); let recentlyEditedRanges: RecentlyEditedRange[] = []; diff --git a/gui/package-lock.json b/gui/package-lock.json index 8c53ca7ce..eb948d185 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -182,6 +182,8 @@ "@babel/preset-env": "^7.24.7", "@biomejs/biome": "1.6.4", "@google/generative-ai": "^0.11.4", + "@shikijs/colorized-brackets": "^3.7.0", + "@shikijs/transformers": "^3.7.0", "@types/diff": "^7.0.1", "@types/follow-redirects": "^1.14.4", "@types/jest": "^29.5.12", From 318910df162917d5d19ac0abe5e1ca5ca2d9c497 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Mon, 7 Jul 2025 15:13:38 -0700 Subject: [PATCH 07/36] chore: build all packages in install scripts --- binary/package-lock.json | 2 ++ extensions/vscode/package-lock.json | 6 ++++-- gui/package-lock.json | 2 ++ packages/hub/package-lock.json | 4 ++-- scripts/install-dependencies.ps1 | 30 ++++++++++++++++++++++++++--- scripts/install-dependencies.sh | 30 ++++++++++++++++++++++++++--- scripts/uninstall.js | 15 +++++++++++++++ 7 files changed, 79 insertions(+), 10 deletions(-) diff --git a/binary/package-lock.json b/binary/package-lock.json index 51e6f5cf9..11dd6505b 100644 --- a/binary/package-lock.json +++ b/binary/package-lock.json @@ -121,6 +121,8 @@ "@babel/preset-env": "^7.24.7", "@biomejs/biome": "1.6.4", "@google/generative-ai": "^0.11.4", + "@shikijs/colorized-brackets": "^3.7.0", + "@shikijs/transformers": "^3.7.0", "@types/diff": "^7.0.1", "@types/follow-redirects": "^1.14.4", "@types/jest": "^29.5.12", diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index 0f87e013c..b1f582aac 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "1.1.55", + "version": "1.1.57", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "1.1.55", + "version": "1.1.57", "license": "Apache-2.0", "dependencies": { "@continuedev/config-types": "^1.0.14", @@ -173,6 +173,8 @@ "@babel/preset-env": "^7.24.7", "@biomejs/biome": "1.6.4", "@google/generative-ai": "^0.11.4", + "@shikijs/colorized-brackets": "^3.7.0", + "@shikijs/transformers": "^3.7.0", "@types/diff": "^7.0.1", "@types/follow-redirects": "^1.14.4", "@types/jest": "^29.5.12", diff --git a/gui/package-lock.json b/gui/package-lock.json index 8c53ca7ce..eb948d185 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -182,6 +182,8 @@ "@babel/preset-env": "^7.24.7", "@biomejs/biome": "1.6.4", "@google/generative-ai": "^0.11.4", + "@shikijs/colorized-brackets": "^3.7.0", + "@shikijs/transformers": "^3.7.0", "@types/diff": "^7.0.1", "@types/follow-redirects": "^1.14.4", "@types/jest": "^29.5.12", diff --git a/packages/hub/package-lock.json b/packages/hub/package-lock.json index bfc2041d5..ec4bd43df 100644 --- a/packages/hub/package-lock.json +++ b/packages/hub/package-lock.json @@ -1,12 +1,12 @@ { "name": "@continuedev/hub", - "version": "0.0.1", + "version": "0.0.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@continuedev/hub", - "version": "0.0.1", + "version": "0.0.4", "license": "Apache-2.0", "dependencies": { "@continuedev/config-yaml": "^1.0.70" diff --git a/scripts/install-dependencies.ps1 b/scripts/install-dependencies.ps1 index e783f94b4..1e258f9fd 100644 --- a/scripts/install-dependencies.ps1 +++ b/scripts/install-dependencies.ps1 @@ -76,8 +76,20 @@ if (($null -eq $node)) { Write-Host "`nInstalling root-level dependencies..." -ForegroundColor White npm install -Write-Host "`nBuilding openai-adapters..." -ForegroundColor White -Push-Location packages/openai-adapters +Write-Host "`nBuilding config-types..." -ForegroundColor White +Push-Location packages/config-types +npm install +npm run build +Pop-Location + +Write-Host "`nBuilding fetch..." -ForegroundColor White +Push-Location packages/fetch +npm install +npm run build +Pop-Location + +Write-Host "`nBuilding llm-info..." -ForegroundColor White +Push-Location packages/llm-info npm install npm run build Pop-Location @@ -88,6 +100,18 @@ npm install npm run build Pop-Location +Write-Host "`nBuilding openai-adapters..." -ForegroundColor White +Push-Location packages/openai-adapters +npm install +npm run build +Pop-Location + +Write-Host "`nBuilding hub..." -ForegroundColor White +Push-Location packages/hub +npm install +npm run build +Pop-Location + Write-Host "`nInstalling Core extension dependencies..." -ForegroundColor White Push-Location core npm install @@ -127,4 +151,4 @@ Push-Location docs npm install -Pop-Location +Pop-Location \ No newline at end of file diff --git a/scripts/install-dependencies.sh b/scripts/install-dependencies.sh index 503aabbcd..3f3e54f7b 100755 --- a/scripts/install-dependencies.sh +++ b/scripts/install-dependencies.sh @@ -30,8 +30,20 @@ fi echo "Installing root-level dependencies..." npm install -echo "Building openai-adapters..." -pushd packages/openai-adapters +echo "Building config-types..." +pushd packages/config-types +npm install +npm run build +popd + +echo "Building fetch..." +pushd packages/fetch +npm install +npm run build +popd + +echo "Building llm-info..." +pushd packages/llm-info npm install npm run build popd @@ -42,6 +54,18 @@ npm install npm run build popd +echo "Building openai-adapters..." +pushd packages/openai-adapters +npm install +npm run build +popd + +echo "Building hub..." +pushd packages/hub +npm install +npm run build +popd + echo "Installing Core extension dependencies..." pushd core ## This flag is set because we pull down Chromium at runtime @@ -76,4 +100,4 @@ popd echo "Installing docs dependencies..." pushd docs npm install -popd +popd \ No newline at end of file diff --git a/scripts/uninstall.js b/scripts/uninstall.js index 8754e5188..15c1edf73 100644 --- a/scripts/uninstall.js +++ b/scripts/uninstall.js @@ -18,6 +18,21 @@ const directories = [ "./binary/bin", "./binary/dist", "./binary/out", + // packages + "./packages/config-types/node_modules", + "./packages/config-types/dist", + "./packages/fetch/node_modules", + "./packages/fetch/dist", + "./packages/llm-info/node_modules", + "./packages/llm-info/dist", + "./packages/config-yaml/node_modules", + "./packages/config-yaml/dist", + "./packages/openai-adapters/node_modules", + "./packages/openai-adapters/dist", + "./packages/hub/node_modules", + "./packages/hub/dist", + // docs + "./docs/node_modules", // root "./node_modules", ]; From 330fa09aab864cb7aadf9e7045156c78f13b7641 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Tue, 8 Jul 2025 21:57:28 +0530 Subject: [PATCH 08/36] fix: autocomplete dev data timestamp as iso string --- core/autocomplete/CompletionProvider.ts | 2 +- core/autocomplete/util/types.ts | 2 +- packages/config-yaml/src/schemas/data/autocomplete/index.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/autocomplete/CompletionProvider.ts b/core/autocomplete/CompletionProvider.ts index 749b44e25..e6111a508 100644 --- a/core/autocomplete/CompletionProvider.ts +++ b/core/autocomplete/CompletionProvider.ts @@ -254,7 +254,7 @@ export class CompletionProvider { completionId: helper.input.completionId, gitRepo: await this.ide.getRepoName(helper.filepath), uniqueId: await this.ide.getUniqueId(), - timestamp: Date.now(), + timestamp: new Date().toISOString(), ...helper.options, }; diff --git a/core/autocomplete/util/types.ts b/core/autocomplete/util/types.ts index 3959bff9c..bd385fb47 100644 --- a/core/autocomplete/util/types.ts +++ b/core/autocomplete/util/types.ts @@ -41,5 +41,5 @@ export interface AutocompleteOutcome extends TabAutocompleteOptions { gitRepo?: string; completionId: string; uniqueId: string; - timestamp: number; + timestamp: string; } diff --git a/packages/config-yaml/src/schemas/data/autocomplete/index.ts b/packages/config-yaml/src/schemas/data/autocomplete/index.ts index 8ae073e2e..458473c3b 100644 --- a/packages/config-yaml/src/schemas/data/autocomplete/index.ts +++ b/packages/config-yaml/src/schemas/data/autocomplete/index.ts @@ -34,7 +34,7 @@ export const autocompleteEventAllSchema = baseDevDataAllSchema.extend({ gitRepo: z.string().optional(), completionId: z.string(), uniqueId: z.string(), - timestamp: z.number(), + timestamp: z.string(), // DEPRECATED - no more nested objects after v0.1.0, all flat values completionOptions: completionOptionsSchema.optional(), From f4ce2011fcbca9e12e38c3cade8224f283a80c6c Mon Sep 17 00:00:00 2001 From: Arkadii Yakovets Date: Tue, 8 Jul 2025 11:07:11 -0700 Subject: [PATCH 09/36] fix: typo in core/llm/defaultSystemMessages.ts --- core/llm/defaultSystemMessages.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/llm/defaultSystemMessages.ts b/core/llm/defaultSystemMessages.ts index a6b3afc6c..b4ecf8e91 100644 --- a/core/llm/defaultSystemMessages.ts +++ b/core/llm/defaultSystemMessages.ts @@ -51,7 +51,7 @@ export const DEFAULT_CHAT_SYSTEM_MESSAGE = `\ You are in chat mode. If the user asks to make changes to files offer that they can use the Apply Button on the code block, or switch to Agent Mode to make the suggested updates automatically. - If needed consisely explain to the user they can switch to agent mode using the Mode Selector dropdown and provide no other details. + If needed concisely explain to the user they can switch to agent mode using the Mode Selector dropdown and provide no other details. ${CODEBLOCK_FORMATTING_INSTRUCTIONS} ${EDIT_CODE_INSTRUCTIONS} From 94cd063fbf05facf5c4b6637896edbbd97bb7816 Mon Sep 17 00:00:00 2001 From: jhpiedrahitao Date: Tue, 8 Jul 2025 13:25:17 -0500 Subject: [PATCH 10/36] update sambanova logo --- gui/public/logos/sambanova.png | Bin 10780 -> 12593 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/gui/public/logos/sambanova.png b/gui/public/logos/sambanova.png index 6f95c6a5859e839fd1f3b07ec0613dee73e39ac0..a3016db0b64966c1bd872c4599416e52fcb5f855 100644 GIT binary patch literal 12593 zcmV-1G0x73P)PyA07*naRCr$PoeOjv*LmN+1weuT36LN}O9TmuluSjIQoB(UiIi-aw4B7Toup1& z*FI_NNKI>}agSrQX=^t%MJ0~g)6{lOWIKLD@+0y?mMYnnZCRoO&=Q{#DN-cCHvtkL z_yF;K>@Ie(+w;G>-}3IootZncvoGMzIXJtRxpQacyZ1N$@B8kZ*$COiTEJSMU<*VF zuEADdE#P5+dvAH<78H4*>;A5}YAg%VTy5DBUe~5yeRLBJSCgVm=}6@5xkIN(toK|Z z)EP;qx1-#PUH3icS-t`bSdc2PQ7ZYA7@9~rvPGPyDJ(uNDnjY4)drOX$wvdv*P?*O z4><97f6i3#_<2XO)z`10`ua9kvjVDWP$>)2e5J$Xy5G2L!=}}%KS}}~7sX*<#>QR| zwYfp#WoCxT39d>9%7Wz8!t-c*PI(;Q0XSaJG%i{#EY{GF`D|RYDrdol>^9Y;(O92Y zH5JRKS2Ws3bqiOL4ysB8%7QeHK+#>Q8$7b&=+uUxX>GYP1CIk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cG>fT$2!=%-B&m-4ab6<|t4v0XyC#ZARU{OB`yr$2yErJ0 fod--3J-P+IKv1Z*DZfCqdjeDyH5D4 Date: Tue, 8 Jul 2025 13:38:04 -0700 Subject: [PATCH 11/36] Add dev data guide and expand editOutcome schema with code fields --- .continue/rules/dev-data-guide.md | 200 ++++++++++++++++++ .../src/schemas/data/editOutcome/v0.2.0.ts | 7 + 2 files changed, 207 insertions(+) create mode 100644 .continue/rules/dev-data-guide.md diff --git a/.continue/rules/dev-data-guide.md b/.continue/rules/dev-data-guide.md new file mode 100644 index 000000000..641ec040d --- /dev/null +++ b/.continue/rules/dev-data-guide.md @@ -0,0 +1,200 @@ +--- +alwaysApply: false +--- + +# Continue Development Data (Dev Data) Guide + +## Overview + +Development data (dev data) captures detailed information about how developers interact with LLM-aided development tools. Unlike basic telemetry, dev data includes lots of details into the complete software development workflow, including code context, user interactions, and development patterns. + +## Core Architecture + +### Primary Implementation Files + +- **`/core/data/log.ts`**: Main `DataLogger` class - singleton for event logging and remote transmission +- **`/packages/config-yaml/src/schemas/data/`**: Schema definitions for all event types + +### Storage Locations + +- **Default storage**: `~/.continue/dev_data/` +- **Event files**: `~/.continue/dev_data/{version}/{eventName}.jsonl` + +## Event Types and Schemas + +### Core Event Types + +1. **`tokensGenerated`**: LLM token usage tracking +2. **`autocomplete`**: Code completion interactions +3. **`chatInteraction`**: Chat-based development assistance +4. **`editInteraction`**: Code editing sessions +5. **`editOutcome`**: Results of edit operations +6. **`nextEditOutcome`**: Next Edit feature outcomes +7. **`chatFeedback`**: User feedback on AI responses +8. **`toolUsage`**: Tool interaction statistics +9. **`quickEdit`**: Quick edit functionality usage + +### Schema Versioning + +- **Version 0.1.0**: Initial schema implementation +- **Version 0.2.0**: Current schema with expanded fields and metadata +- **Schema files**: Located in `/packages/config-yaml/src/schemas/data/` + +### Base Schema Structure + +All events inherit from a base schema (`/packages/config-yaml/src/schemas/data/base.ts`): + +```typescript +{ + eventName: string, + schema: string, + timestamp: string, + userId: string, + userAgent: string, + selectedProfileId: string +} +``` + +## Key Integration Points + +### Autocomplete System + +- **File**: `/core/autocomplete/util/AutocompleteLoggingService.ts` +- **Purpose**: Tracks code completion acceptance/rejection, timing, and cache hits +- **Integration**: Called from autocomplete engine when completions are shown/accepted + +### Chat Interface + +- **Integration**: Chat interactions logged through `DataLogger.logDevData()` +- **Data**: Includes prompts, responses, context, and user feedback +- **Privacy**: Can be configured to exclude code content + +### Edit Features + +- **Files**: `/extensions/vscode/src/extension/EditOutcomeTracker.ts`, `/core/nextEdit/NextEditLoggingService.ts` +- **Purpose**: Track edit suggestions, acceptance rates, and outcomes +- **Integration**: Embedded in edit workflow to capture user decisions + +### LLM Token Tracking + +- **File**: `/core/llm/index.ts` +- **Purpose**: Track token usage across all LLM providers +- **Storage**: SQLite database for efficient querying and reporting + +## Configuration and Customization + +### Configuration Structure + +Dev data is configured through `data` blocks in your Continue config: + +```yaml +data: + - name: "Local Development Data" + destination: "file:///Users/developer/.continue/dev_data" + schema: "0.2.0" + level: "all" + events: ["autocomplete", "chatInteraction", "editOutcome"] + + - name: "Team Analytics" + destination: "https://analytics.yourcompany.com/api/events" + schema: "0.2.0" + level: "noCode" + apiKey: "your-api-key-here" + events: ["tokensGenerated", "toolUsage"] +``` + +### Configuration Options + +- **`destination`**: Where to send data (`file://` for local, `http://`/`https://` for remote) +- **`schema`**: Schema version to use (`"0.1.0"` or `"0.2.0"`) +- **`level`**: Data detail level (`"all"` includes code, `"noCode"` excludes code content) +- **`events`**: Array of event types to collect +- **`apiKey`**: Authentication for remote endpoints + +### Privacy Controls + +- **`"all"` level**: Includes code content (prefixes, suffixes, completions) +- **`"noCode"` level**: Excludes code content, only metadata and metrics +- **Local-first**: Data is always stored locally, remote transmission is optional + +## Making Changes to Dev Data + +### Adding New Event Types + +1. **Create schema**: Add new event schema in `/packages/config-yaml/src/schemas/data/` +2. **Update index**: Add to schema aggregator in `/packages/config-yaml/src/schemas/data/index.ts` +3. **Implement logging**: Add logging calls in relevant service files +4. **Update version**: Consider schema version bump if breaking changes + +### Modifying Existing Events + +1. **Schema changes**: Update schema files in `/packages/config-yaml/src/schemas/data/` +2. **Backward compatibility**: Ensure changes don't break existing data consumers +3. **Version management**: Increment schema version for breaking changes +4. **Test thoroughly**: Validate schema changes with existing data + +### Adding New Logging Points + +1. **Import DataLogger**: `import { DataLogger } from "core/data/log"` +2. **Log events**: Call `DataLogger.getInstance().logDevData(eventName, data)` +3. **Follow patterns**: Use existing logging services as examples +4. **Validate data**: Ensure logged data matches schema requirements + +### Debugging Dev Data Issues + +1. **Check local storage**: Verify files are being created in `~/.continue/dev_data/` +2. **Validate schemas**: Ensure event data matches expected schema format +3. **Review configuration**: Check `data` blocks in Continue config +4. **Test endpoints**: Verify remote endpoints are reachable and accepting data + +## Best Practices + +### When Adding New Events + +- Follow existing naming conventions for event types +- Include sufficient context for analysis without oversharing sensitive data +- Consider privacy implications and respect user configuration levels +- Add appropriate error handling and logging + +### When Modifying Schemas + +- Maintain backward compatibility when possible +- Document schema changes thoroughly +- Consider impact on existing data consumers +- Test with real development data + +### When Integrating Logging + +- Use the singleton pattern: `DataLogger.getInstance()` +- Log events at appropriate points in user workflow +- Respect user privacy settings and configuration +- Handle errors gracefully without disrupting user experience + +## Common Patterns + +### Service-Based Logging + +Most dev data logging follows a service pattern: + +```typescript +export class FeatureLoggingService { + private dataLogger = DataLogger.getInstance(); + + logFeatureUsage(data: FeatureUsageData) { + this.dataLogger.logDevData("featureUsage", data); + } +} +``` + +### Event-Driven Logging + +Events are typically logged at key interaction points: + +```typescript +// When user accepts autocomplete +onAutocompleteAccepted(completion: CompletionData) { + AutocompleteLoggingService.getInstance().logAutocompleteAccepted(completion); +} +``` + +This guide provides the foundation for understanding and working with Continue's dev data system. Always prioritize user privacy and follow established patterns when making changes. \ No newline at end of file diff --git a/packages/config-yaml/src/schemas/data/editOutcome/v0.2.0.ts b/packages/config-yaml/src/schemas/data/editOutcome/v0.2.0.ts index 88d867fbd..1fdbfb967 100644 --- a/packages/config-yaml/src/schemas/data/editOutcome/v0.2.0.ts +++ b/packages/config-yaml/src/schemas/data/editOutcome/v0.2.0.ts @@ -15,10 +15,17 @@ export const editOutcomeEventSchema_0_2_0 = editOutcomeEventAllSchema.pick({ modelTitle: true, modelProvider: true, accepted: true, + previousCode: true, + newCode: true, + previousCodeLines: true, + newCodeLines: true, + lineChange: true, }); export const editOutcomeEventSchema_0_2_0_noCode = editOutcomeEventSchema_0_2_0.omit({ prompt: true, completion: true, + previousCode: true, + newCode: true, }); From 1d06c3b75699d65e842bc7335d13ed41c3562619 Mon Sep 17 00:00:00 2001 From: Jazzcort Date: Tue, 8 Jul 2025 16:10:40 -0400 Subject: [PATCH 12/36] Fix: improved Documentation Indexing and Submenu Updates This patch significantly enhances how Continue responds to changes in the documentation configuration, providing a more consistent and user-friendly experience. Previously, Continue's handling of documentation configuration changes could lead to inconsistencies, requiring users to relaunch the application to see updates. This PR addresses these issues by improving the caching, indexing, and display of the documentation. Key Improvements: 1. Submenu items for the documentation now refresh automatically after retrieving the cache from S3. Before this fix, it won't show up in the submenu until we relaunch Continue. 2. The titles and favicons for cached documentation now correctly reflect the values defined in the docs configuration, rather than defaulting to the URL. 3. Deleting or commenting out a documentation entry in the configuration file will now automatically remove it from the submenu, ensuring consistency between the configuration and the displayed options. 4. If only the title or favicon of a document changes, Continue now efficiently updates the metadata in the SQLite database instead of performing a full reindexing. 5. Continue can now catch and apply changes to documentation titles and favicons even when the application is not actively running. Future Considerations: 1. The doc schema in the config-yaml should be updated to include maxDepth and useLocalCrawling parameters if we're planing to keep these parameters. Their values are always undefined now no matter what users set in config file. 2. If we do keep maxDepth and useLocalCrawling, we should consider adding maxDepth and useLocalCrawling to the SQLite metadata. This would allow the SQLite database to serve as a persistent store for each document's parameters, preventing edge cases where changes to the documentation configuration are missed when Continue is inactive. --- core/context/providers/DocsContextProvider.ts | 19 ++-- core/indexing/docs/DocsService.ts | 98 ++++++++++++++++--- 2 files changed, 100 insertions(+), 17 deletions(-) diff --git a/core/context/providers/DocsContextProvider.ts b/core/context/providers/DocsContextProvider.ts index 360e68670..0f87a3f61 100644 --- a/core/context/providers/DocsContextProvider.ts +++ b/core/context/providers/DocsContextProvider.ts @@ -145,6 +145,11 @@ class DocsContextProvider extends BaseContextProvider { async loadSubmenuItems( args: LoadSubmenuItemsArgs, ): Promise { + const { config } = args; + // This set is used to filter out the docs that is not in docs config but exist in sqlite metadata + const configDocsSet = new Set( + config.docs?.map((doc) => doc.startUrl) || [], + ); // Get docs service const docsService = DocsService.getSingleton(); if (!docsService) { @@ -159,12 +164,14 @@ class DocsContextProvider extends BaseContextProvider { // Get all indexed docs from the database const docs = (await docsService.listMetadata()) ?? []; for (const { startUrl, title, favicon } of docs) { - submenuItems.push({ - title, - id: startUrl, - description: new URL(startUrl).hostname, - icon: favicon, - }); + if (configDocsSet.has(startUrl)) { + submenuItems.push({ + title, + id: startUrl, + description: new URL(startUrl).hostname, + icon: favicon, + }); + } } // Sort alphabetically diff --git a/core/indexing/docs/DocsService.ts b/core/indexing/docs/DocsService.ts index 7ea3d444e..0ccb4804e 100644 --- a/core/indexing/docs/DocsService.ts +++ b/core/indexing/docs/DocsService.ts @@ -107,6 +107,17 @@ const siteIndexingConfigsAreEqual = ( ); }; +const siteIndexingConfigsAreEqualExceptTitleAndFavicon = ( + config1: SiteIndexingConfig, + config2: SiteIndexingConfig, +) => { + return ( + config1.startUrl === config2.startUrl && + config1.maxDepth === config2.maxDepth && + config1.useLocalCrawling === config2.useLocalCrawling + ); +}; + /* General process: - On config update: @@ -395,6 +406,21 @@ export default class DocsService { siteIndexingConfig: SiteIndexingConfig, ): Promise { try { + // Set a initial status when retrieving cache + this.handleStatusUpdate({ + type: "docs", + id: startUrl, + embeddingsProviderId: embeddingId, + isReindexing: false, + title: siteIndexingConfig.title, + debugInfo: "Loaded from cache", + icon: siteIndexingConfig.faviconUrl, + url: startUrl, + progress: 0, + description: "Try to retrieve cache", + status: "indexing", + }); + const cacheHit = await this.tryFetchFromCache(startUrl, embeddingId); if (cacheHit) { @@ -429,7 +455,8 @@ export default class DocsService { siteIndexingConfig: SiteIndexingConfig, forceReindex: boolean = false, ): Promise { - const { startUrl, useLocalCrawling, maxDepth } = siteIndexingConfig; + const { startUrl, useLocalCrawling, maxDepth, faviconUrl } = + siteIndexingConfig; // First, if indexing is already in process, don't attempt // This queue is necessary because indexAndAdd is invoked circularly by config edits @@ -685,7 +712,9 @@ export default class DocsService { await this.deleteIndexes(startUrl); } - const favicon = await fetchFavicon(new URL(siteIndexingConfig.startUrl)); + const favicon = + faviconUrl || + (await fetchFavicon(new URL(siteIndexingConfig.startUrl))); if (this.shouldCancel(startUrl, startedWithEmbedder)) { return; @@ -718,10 +747,6 @@ export default class DocsService { void this.ide.showToast("info", `Successfully indexed ${startUrl}`); } - this.messenger?.send("refreshSubmenuItems", { - providers: ["docs"], - }); - removeFromFailedGlobalContext(siteIndexingConfig); } catch (e) { console.error( @@ -766,14 +791,22 @@ export default class DocsService { const siteEmbeddings = JSON.parse(data) as SiteIndexingResults; // Try to get a favicon for the site - const favicon = await fetchFavicon(new URL(startUrl)); + const favicon = + this.statuses.get(startUrl)?.icon || + (await fetchFavicon(new URL(startUrl))); + + // Always try to make the title match what users set in the config + const title = + this.statuses.get(startUrl)?.title || + siteEmbeddings.title || + new URL(startUrl).hostname; // Add the cached embeddings to our database await this.add({ favicon, siteIndexingConfig: { startUrl, - title: siteEmbeddings.title || new URL(startUrl).hostname, + title, }, chunks: siteEmbeddings.chunks, embeddings: siteEmbeddings.chunks.map((c) => c.embedding), @@ -910,6 +943,10 @@ export default class DocsService { ); if (cacheHit) { + // If cache hit, refresh the submenu items for docs + this.messenger?.send("refreshSubmenuItems", { + providers: ["docs"], + }); // If cache hit, retry the search once return await this.retrieveChunks(startUrl, vector, nRetrieve, true); } @@ -987,8 +1024,7 @@ export default class DocsService { const currentStartUrls = currentlyIndexedDocs.map((doc) => doc.startUrl); // Anything found in old config, new config, AND sqlite that doesn't match should be reindexed - // TODO if only favicon and title change, only update, don't embed - // Otherwise anything found in new config that isn't in sqlite should be added/indexed + // Anything found in new config that isn't in sqlite should be added/indexed const addedDocs: SiteIndexingConfig[] = []; const changedDocs: SiteIndexingConfig[] = []; for (const doc of newConfigDocs) { @@ -999,12 +1035,26 @@ export default class DocsService { (d) => d.startUrl === doc.startUrl, ); + // TODO: Changes to the docs config made while Continue isn't running won't be caught if (oldConfigDoc && !siteIndexingConfigsAreEqual(oldConfigDoc, doc)) { - changedDocs.push(doc); + // When only the title or faviconUrl changed, Update the sqlite metadate instead of reindexing + if ( + siteIndexingConfigsAreEqualExceptTitleAndFavicon( + oldConfigDoc, + doc, + ) + ) { + await this.updateMetadataInSqlite(doc); + } else { + changedDocs.push(doc); + } } else { if (forceReindex) { changedDocs.push(doc); } else { + // This is a temperary fix to catch the changes to the docs config that were made when Continue isn't running + // We only update title and faviconUrl here + await this.updateMetadataInSqlite(doc); // if get's here, not changed, no update needed, mark as complete this.handleStatusUpdate({ type: "docs", @@ -1036,6 +1086,10 @@ export default class DocsService { console.error("Error syncing docs index on config update", e); } finally { this.isSyncing = false; + // Refresh the submenu items for docs + this.messenger?.send("refreshSubmenuItems", { + providers: ["docs"], + }); } } @@ -1182,6 +1236,27 @@ export default class DocsService { ); } + private async updateMetadataInSqlite(siteIndexingConfig: SiteIndexingConfig) { + const { startUrl, title, faviconUrl } = siteIndexingConfig; + const favicon = faviconUrl || (await fetchFavicon(new URL(startUrl))); + if (!this.config.selectedModelByRole.embed) { + console.warn( + `Attempting to add metadata for ${startUrl} without embeddings provider specified`, + ); + return; + } + + const db = await this.getOrCreateSqliteDb(); + + await db.run( + `UPDATE ${DocsService.sqlitebTableName} SET title = ?, favicon = ? WHERE startUrl = ? AND embeddingsProviderId = ?`, + title, + favicon, + startUrl, + this.config.selectedModelByRole.embed.embeddingId, + ); + } + private addToConfig(siteIndexingConfig: SiteIndexingConfig) { // Handles the case where a user has manually added the doc to config.json // so it already exists in the file @@ -1286,5 +1361,6 @@ export default class DocsService { this.messenger?.send("refreshSubmenuItems", { providers: ["docs"], }); + this.statuses.delete(startUrl); } } From 2352fb0bffe4b6915229d1d332356d6281fbc482 Mon Sep 17 00:00:00 2001 From: adarshramiyer Date: Tue, 8 Jul 2025 14:48:24 -0700 Subject: [PATCH 13/36] chore: :bug: put more context lines in history diffs --- core/nextEdit/context/diffFormatting.ts | 11 +++++++++-- core/nextEdit/context/processNextEditData.ts | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/core/nextEdit/context/diffFormatting.ts b/core/nextEdit/context/diffFormatting.ts index 6d892dee7..3c7deb933 100644 --- a/core/nextEdit/context/diffFormatting.ts +++ b/core/nextEdit/context/diffFormatting.ts @@ -17,10 +17,16 @@ export const createDiff = ( afterContent: string, filePath: string, diffType: DiffFormatType, + contextLines: number = 3, ) => { switch (diffType) { case DiffFormatType.Unified: - return createUnifiedDiff(beforeContent, afterContent, filePath); + return createUnifiedDiff( + beforeContent, + afterContent, + filePath, + contextLines, + ); case DiffFormatType.TokenLineDiff: return createTokenLineDiff(beforeContent, afterContent, filePath); } @@ -31,6 +37,7 @@ const createUnifiedDiff = ( beforeContent: string, afterContent: string, filePath: string, + contextLines: number, ) => { const normalizedBefore = beforeContent.endsWith("\n") ? beforeContent @@ -45,7 +52,7 @@ const createUnifiedDiff = ( normalizedAfter, "before", "after", - { context: 3 }, + { context: contextLines }, ); return patch; diff --git a/core/nextEdit/context/processNextEditData.ts b/core/nextEdit/context/processNextEditData.ts index 206b17b80..45c9e231b 100644 --- a/core/nextEdit/context/processNextEditData.ts +++ b/core/nextEdit/context/processNextEditData.ts @@ -132,6 +132,7 @@ export const processNextEditData = async ({ afterContent, filePath, DiffFormatType.Unified, + 25, // 25 context lines; store a large number for trimming later on ), fileUri: filePath, workspaceUri: workspaceDir, From 094d548954a9b58d067c57d5d585498330ed7e71 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 8 Jul 2025 17:22:18 -0700 Subject: [PATCH 14/36] add apiKey/express mode support for vertex AI --- core/llm/llms/VertexAI.ts | 77 ++++++++++++++++++++++++++++++++------- 1 file changed, 64 insertions(+), 13 deletions(-) diff --git a/core/llm/llms/VertexAI.ts b/core/llm/llms/VertexAI.ts index 1a956cf76..b7a5e7ecf 100644 --- a/core/llm/llms/VertexAI.ts +++ b/core/llm/llms/VertexAI.ts @@ -28,11 +28,49 @@ class VertexAI extends BaseLLM { console.warn(`Failed to load credentials for Vertex AI: ${e.message}`); }); - private static getDefaultApiBaseFrom(options: LLMOptions) { - const { region, projectId } = options; + /* + Vertex Supports 3 different URL formats + 1. Express mode: e.g. https://aiplatform.googleapis.com/v1/publishers/google/models/{model}:streamGenerateContent?key={API_KEY} // see https://cloud.google.com/vertex-ai/generative-ai/docs/start/express-mode/overview + 2. Standard VertexAI: e.g. https://{location}-aiplatform.googleapis.com/v1/projects/{project}/locations/{location}/publishers/google/models/{model}:streamGenerateContent + 3. Tuned model: e.g. https://{location}-aiplatform.googleapis.com/v1/projects/{project}/locations/{location}/endpoints/{endpoint}:streamGenerateContent + + Authentication can be done using the following + 1. API Key (express mode), region and projectId will be ignored + 2. project id and region with Google Auth client + + In all cases we have defined apiBase to be up to everything including the location. + Express api base: https://aiplatform.googleapis.com/v1/ + Standard api base: https://{location}-aiplatform.googleapis.com/v1/projects/{project}/locations/{location}/ + TODO endpoints is not currently supported (api base is same as standard but we don't have a way to add endpoint name yet + + Note that VertexAI uses the term "service endpoint" and "model", like: + {service-endpoint}/v1/{model}:streamGenerateContent + So "model" includes the project, location, publisher, etc + + Express mode has limited support + https://cloud.google.com/vertex-ai/generative-ai/docs/start/express-mode/overview#models + supported methods: countTokens, generateContent, and streamGenerateContent + supported models: gemini for now (updating quickly) + + */ + private getDefaultApiBaseFrom(options: LLMOptions) { + const { region, projectId, apiKey } = options; + if (apiKey) { + if (this.vertexProvider !== "gemini") { + throw new Error( + "VertexAI: only gemini models are supported in express (apiKey) mode. See https://cloud.google.com/vertex-ai/generative-ai/docs/start/express-mode/overview#models", + ); + } + if (region || projectId) { + console.warn( + "Region and projectId are ignored when using apiKey. See VertexAI Express Mode docs https://cloud.google.com/vertex-ai/generative-ai/docs/start/express-mode/overview", + ); + } + return `https://aiplatform.googleapis.com/v1/`; + } if (!region || !projectId) { throw new Error( - "region and projectId must be defined if apiBase is not provided", + "To authenticate VertexAI, either add your region and projectId, which will Google Cloud credientials, or add an apiKey (express mode)", ); } return `https://${region}-aiplatform.googleapis.com/v1/projects/${projectId}/locations/${region}/`; @@ -47,7 +85,7 @@ class VertexAI extends BaseLLM { ); } super(_options); - this.apiBase ??= VertexAI.getDefaultApiBaseFrom(_options); + this.apiBase ??= this.getDefaultApiBaseFrom(_options); this.vertexProvider = _options.model.includes("mistral") || _options.model.includes("codestral") || @@ -62,20 +100,27 @@ class VertexAI extends BaseLLM { this.geminiInstance = new Gemini(_options); } - async fetch(url: RequestInfo | URL, init?: RequestInit) { - const client = await this.clientPromise; - const result = await client?.getAccessToken(); - if (!result?.token) { - throw new Error( - "Could not get an access token. Set up your Google Application Default Credentials.", - ); + async fetch(url: URL, init?: RequestInit) { + const headers: Record = { + "Content-Type": "application/json", + }; + if (this.apiKey) { + url.searchParams.set("key", this.apiKey); + } else { + const client = await this.clientPromise; + const result = await client?.getAccessToken(); + if (!result?.token) { + throw new Error( + "Could not get an access token. Set up your Google Application Default Credentials.", + ); + } + headers.Authorization = `Bearer ${result.token}`; } return await super.fetch(url, { ...init, headers: { - "Content-Type": "application/json", - Authorization: `Bearer ${result.token}`, ...init?.headers, + ...headers, }, }); } @@ -85,6 +130,10 @@ class VertexAI extends BaseLLM { const convertedArgs = this.anthropicInstance.convertArgs(options); // Remove the `model` property and add `anthropic_version` + // For claude 4 models + // anthropic_version is a required parameter and must be set to "vertex-2024-10-22". + + // const const { model, ...finalOptions } = convertedArgs; return { ...finalOptions, @@ -104,6 +153,8 @@ class VertexAI extends BaseLLM { this.cacheBehavior?.cacheSystemMessage && systemMessage ); + // /v1/publishers/anthropic/models/claude-3-5-sonnet-20240620:streamRawPredict + const apiURL = new URL( `publishers/anthropic/models/${options.model}:streamRawPredict`, this.apiBase, From 16755afc426c83cca57a210ede3df8aa0bf33c73 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 8 Jul 2025 17:27:04 -0700 Subject: [PATCH 15/36] docs: vertex express mode docs --- core/llm/llms/VertexAI.ts | 2 +- .../model-providers/top-level/vertexai.mdx | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/core/llm/llms/VertexAI.ts b/core/llm/llms/VertexAI.ts index b7a5e7ecf..27351cf25 100644 --- a/core/llm/llms/VertexAI.ts +++ b/core/llm/llms/VertexAI.ts @@ -58,7 +58,7 @@ class VertexAI extends BaseLLM { if (apiKey) { if (this.vertexProvider !== "gemini") { throw new Error( - "VertexAI: only gemini models are supported in express (apiKey) mode. See https://cloud.google.com/vertex-ai/generative-ai/docs/start/express-mode/overview#models", + "VertexAI: only gemini models are supported in express (apiKey) mode. See https://cloud.google.com/vertex-ai/generative-ai/docs/start/express-mode/overview#models", ); } if (region || projectId) { diff --git a/docs/docs/customize/model-providers/top-level/vertexai.mdx b/docs/docs/customize/model-providers/top-level/vertexai.mdx index 2863acc31..383e404f1 100644 --- a/docs/docs/customize/model-providers/top-level/vertexai.mdx +++ b/docs/docs/customize/model-providers/top-level/vertexai.mdx @@ -114,3 +114,33 @@ We recommend configuring **text-embedding-004** as your embeddings model. Vertex AI currently does not offer any reranking models. [Click here](../../model-roles/reranking.mdx) to see a list of reranking model providers. + +## Express mode + +You can use VertexAI in [express mode](https://cloud.google.com/vertex-ai/generative-ai/docs/start/express-mode/overview) by only providing an API Key. Only some Gemini models are supported in express mode for now. + + + + ```yaml title="config.yaml" + models: + - name: Gemini 2.5 Flash - VertexAI + provider: vertexai + model: gemini-2.5-flash + apiKey: ${{ secrets.GOOGLE_CLOUD_API_KEY }} + ``` + + + ```json title="config.json" + { + "models": [ + { + "title": "Gemini 2.5 Flash - VertexAI", + "provider": "vertexai", + "model": "gemini-2.5-flash", + "apiKey": "[YOUR_GOOGLE_CLOUD_API_KEY]", + } + ] + } + ``` + + From 7c39878ed8f0d7f9c60ad41ac62b765c74d1d17c Mon Sep 17 00:00:00 2001 From: Nate Date: Tue, 8 Jul 2025 21:37:15 -0700 Subject: [PATCH 16/36] add applied rules to dev data --- core/llm/rules/getSystemMessageWithRules.ts | 4 ++++ gui/src/redux/thunks/streamNormalInput.ts | 5 +++++ .../config-yaml/src/schemas/data/chatInteraction/index.ts | 8 ++++++++ .../src/schemas/data/chatInteraction/v0.2.0.ts | 1 + 4 files changed, 18 insertions(+) diff --git a/core/llm/rules/getSystemMessageWithRules.ts b/core/llm/rules/getSystemMessageWithRules.ts index f017f24fd..39a30e34d 100644 --- a/core/llm/rules/getSystemMessageWithRules.ts +++ b/core/llm/rules/getSystemMessageWithRules.ts @@ -324,6 +324,10 @@ export const getApplicableRules = ( return applicableRules; }; +export function getRuleId(rule: RuleWithSource): string { + return rule.slug ?? rule.ruleFile ?? rule.name ?? rule.source; +} + export const getSystemMessageWithRules = ({ baseSystemMessage, userMessage, diff --git a/gui/src/redux/thunks/streamNormalInput.ts b/gui/src/redux/thunks/streamNormalInput.ts index 37910c105..211f211c8 100644 --- a/gui/src/redux/thunks/streamNormalInput.ts +++ b/gui/src/redux/thunks/streamNormalInput.ts @@ -1,6 +1,7 @@ import { createAsyncThunk, unwrapResult } from "@reduxjs/toolkit"; import { LLMFullCompletionOptions, ModelDescription, Tool } from "core"; import { modelSupportsTools } from "core/llm/autodetect"; +import { getRuleId } from "core/llm/rules/getSystemMessageWithRules"; import { ToCoreProtocol } from "core/protocol"; import { BuiltInToolNames } from "core/tools/builtIn"; import { selectActiveTools } from "../selectors/selectActiveTools"; @@ -171,6 +172,10 @@ export const streamNormalInput = createAsyncThunk< ...(!!activeTools.length && { tools: activeTools.map((tool) => tool.function.name), }), + rules: appliedRules.map((rule) => ({ + id: getRuleId(rule), + rule: rule.rule, + })), }, }); // else if (state.session.mode === "edit") { diff --git a/packages/config-yaml/src/schemas/data/chatInteraction/index.ts b/packages/config-yaml/src/schemas/data/chatInteraction/index.ts index 91cbbb1e7..f13b630af 100644 --- a/packages/config-yaml/src/schemas/data/chatInteraction/index.ts +++ b/packages/config-yaml/src/schemas/data/chatInteraction/index.ts @@ -8,4 +8,12 @@ export const chatInteractionEventAllSchema = baseDevDataAllSchema.extend({ completion: z.string(), sessionId: z.string(), tools: z.array(z.string()).optional(), + rules: z + .array( + z.object({ + id: z.string(), + rule: z.string(), + }), + ) + .optional(), }); diff --git a/packages/config-yaml/src/schemas/data/chatInteraction/v0.2.0.ts b/packages/config-yaml/src/schemas/data/chatInteraction/v0.2.0.ts index aec50a223..ce0983a75 100644 --- a/packages/config-yaml/src/schemas/data/chatInteraction/v0.2.0.ts +++ b/packages/config-yaml/src/schemas/data/chatInteraction/v0.2.0.ts @@ -17,6 +17,7 @@ export const chatInteractionEventSchema_0_2_0 = modelProvider: true, sessionId: true, tools: true, + rules: true, }); export const chatInteractionEventSchema_0_2_0_noCode = From 5b17cb5d088641bf94301ee658ab8ec3dead9075 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 8 Jul 2025 23:06:41 -0700 Subject: [PATCH 17/36] vertexai json and keyFile support --- core/llm/llms/VertexAI.ts | 143 +++++++++++++++++++++++++++----------- 1 file changed, 101 insertions(+), 42 deletions(-) diff --git a/core/llm/llms/VertexAI.ts b/core/llm/llms/VertexAI.ts index 27351cf25..c428b9aa6 100644 --- a/core/llm/llms/VertexAI.ts +++ b/core/llm/llms/VertexAI.ts @@ -1,4 +1,4 @@ -import { GoogleAuth } from "google-auth-library"; +import { AuthClient, GoogleAuth, auth } from "google-auth-library"; import { streamResponse, streamSse } from "@continuedev/fetch"; import { ChatMessage, CompletionOptions, LLMOptions } from "../../index.js"; @@ -20,62 +20,33 @@ class VertexAI extends BaseLLM { region: "us-central1", }; - private clientPromise = new GoogleAuth({ - scopes: "https://www.googleapis.com/auth/cloud-platform", - }) - .getClient() - .catch((e) => { - console.warn(`Failed to load credentials for Vertex AI: ${e.message}`); - }); + private clientPromise: Promise; /* Vertex Supports 3 different URL formats - 1. Express mode: e.g. https://aiplatform.googleapis.com/v1/publishers/google/models/{model}:streamGenerateContent?key={API_KEY} // see https://cloud.google.com/vertex-ai/generative-ai/docs/start/express-mode/overview - 2. Standard VertexAI: e.g. https://{location}-aiplatform.googleapis.com/v1/projects/{project}/locations/{location}/publishers/google/models/{model}:streamGenerateContent - 3. Tuned model: e.g. https://{location}-aiplatform.googleapis.com/v1/projects/{project}/locations/{location}/endpoints/{endpoint}:streamGenerateContent + 1. Standard VertexAI: e.g. https://{location}-aiplatform.googleapis.com/v1/projects/{project}/locations/{location}/publishers/google/models/{model}:streamGenerateContent + 2. Tuned model: e.g. https://{location}-aiplatform.googleapis.com/v1/projects/{project}/locations/{location}/endpoints/{endpoint}:streamGenerateContent + 3. Express mode: e.g. https://aiplatform.googleapis.com/v1/publishers/google/models/{model}:streamGenerateContent?key={API_KEY} // see https://cloud.google.com/vertex-ai/generative-ai/docs/start/express-mode/overview Authentication can be done using the following + 2. Access token obtained using Google Auth client, passed to endpoint that includes full model path with project id and region 1. API Key (express mode), region and projectId will be ignored - 2. project id and region with Google Auth client In all cases we have defined apiBase to be up to everything including the location. - Express api base: https://aiplatform.googleapis.com/v1/ Standard api base: https://{location}-aiplatform.googleapis.com/v1/projects/{project}/locations/{location}/ + Express api base: https://aiplatform.googleapis.com/v1/ TODO endpoints is not currently supported (api base is same as standard but we don't have a way to add endpoint name yet Note that VertexAI uses the term "service endpoint" and "model", like: {service-endpoint}/v1/{model}:streamGenerateContent So "model" includes the project, location, publisher, etc - Express mode has limited support + Express mode has limited support + and CRITICALLY is only available to NEW users who had NOT used cloud services before. + However it is pretty common as gemini becomes more popular. + Only Gemini models are supported for now https://cloud.google.com/vertex-ai/generative-ai/docs/start/express-mode/overview#models - supported methods: countTokens, generateContent, and streamGenerateContent - supported models: gemini for now (updating quickly) - - */ - private getDefaultApiBaseFrom(options: LLMOptions) { - const { region, projectId, apiKey } = options; - if (apiKey) { - if (this.vertexProvider !== "gemini") { - throw new Error( - "VertexAI: only gemini models are supported in express (apiKey) mode. See https://cloud.google.com/vertex-ai/generative-ai/docs/start/express-mode/overview#models", - ); - } - if (region || projectId) { - console.warn( - "Region and projectId are ignored when using apiKey. See VertexAI Express Mode docs https://cloud.google.com/vertex-ai/generative-ai/docs/start/express-mode/overview", - ); - } - return `https://aiplatform.googleapis.com/v1/`; - } - if (!region || !projectId) { - throw new Error( - "To authenticate VertexAI, either add your region and projectId, which will Google Cloud credientials, or add an apiKey (express mode)", - ); - } - return `https://${region}-aiplatform.googleapis.com/v1/projects/${projectId}/locations/${region}/`; - } - + */ constructor(_options: LLMOptions) { if (_options.region !== "us-central1") { // Any region outside of us-central1 has a max batch size of 5. @@ -85,7 +56,7 @@ class VertexAI extends BaseLLM { ); } super(_options); - this.apiBase ??= this.getDefaultApiBaseFrom(_options); + this.vertexProvider = _options.model.includes("mistral") || _options.model.includes("codestral") || @@ -96,6 +67,93 @@ class VertexAI extends BaseLLM { : _options.model.includes("gemini") ? "gemini" : "unknown"; + + // Validate inputs + const { apiKey, region, projectId, env } = _options; + const keyFile = env?.keyFile; + const keyJson = env?.keyJson; + + // Acceptable setup: + // apiKey only + // region and projectId AND (keyFile OR keyJson OR nothing) + + if (apiKey) { + // Consider warning here instead of throwing error + if (region || projectId || keyFile || keyJson) { + throw new Error( + "Vertex in express mode (api key only) cannot be configured with region, projectId, keyFile, or keyJson", + ); + // console.warn( + // "Region, projectId, and key path/file are ignored when apiKey is set. See VertexAI Express Mode docs https://cloud.google.com/vertex-ai/generative-ai/docs/start/express-mode/overview", + // ); + } + if (this.vertexProvider !== "gemini") { + throw new Error( + "VertexAI: only gemini models are supported in express (apiKey) mode. See https://cloud.google.com/vertex-ai/generative-ai/docs/start/express-mode/overview#models", + ); + } + } else { + if (region && projectId) { + throw new Error( + "region and projectId are required for VertexAI (when not using express/apiKey mode)", + ); + } + if (keyFile && keyJson) { + throw new Error( + "VertexAI credentials can be configured with either keyFile or keyJson but not both", + ); + } + } + + if (!this.apiBase) { + if (apiKey) { + this.apiBase = `https://aiplatform.googleapis.com/v1/`; + } else { + this.apiBase = `https://${region}-aiplatform.googleapis.com/v1/projects/${projectId}/locations/${region}/`; + } + } + + const scopes = "https://www.googleapis.com/auth/cloud-platform"; + if (keyJson) { + // Loading keys from manually set JSON + if (typeof keyJson !== "string") { + throw new Error("VertexAI: keyJson must be a JSON string"); + } + try { + const parsed = JSON.parse(keyJson); + this.clientPromise = Promise.resolve(auth.fromJSON(parsed)); + } catch (e) { + throw new Error("VertexAI: Failed to parse keyJson"); + } + } else if (keyFile) { + // Loading keys from manually set file path + if (typeof keyFile !== "string") { + throw new Error("VertexAI: keyFile must be a string"); + } + this.clientPromise = new GoogleAuth({ + scopes, + keyFile, + }) + .getClient() + .catch((e) => { + console.warn( + `Failed to load credentials for Vertex AI: ${e.message}`, + ); + }); + } else { + // Loading keys from local credentials or environment variable + this.clientPromise = new GoogleAuth({ + scopes, + }) + .getClient() + .catch((e) => { + console.warn( + `Failed to load credentials for Vertex AI: ${e.message}`, + ); + }); + } + + // Uses instances of other LLMs since underlying functionality is the same this.anthropicInstance = new Anthropic(_options); this.geminiInstance = new Gemini(_options); } @@ -116,6 +174,7 @@ class VertexAI extends BaseLLM { } headers.Authorization = `Bearer ${result.token}`; } + return await super.fetch(url, { ...init, headers: { From 02678858ea90d839801f3f9c0906bf5400df7553 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Wed, 9 Jul 2025 00:48:39 -0700 Subject: [PATCH 18/36] feat: add keyFile and keyJson auth methods for vertexAI --- core/llm/llms/VertexAI.ts | 44 +++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/core/llm/llms/VertexAI.ts b/core/llm/llms/VertexAI.ts index c428b9aa6..c3c2c9bf4 100644 --- a/core/llm/llms/VertexAI.ts +++ b/core/llm/llms/VertexAI.ts @@ -1,4 +1,4 @@ -import { AuthClient, GoogleAuth, auth } from "google-auth-library"; +import { AuthClient, GoogleAuth, JWT, auth } from "google-auth-library"; import { streamResponse, streamSse } from "@continuedev/fetch"; import { ChatMessage, CompletionOptions, LLMOptions } from "../../index.js"; @@ -14,6 +14,7 @@ class VertexAI extends BaseLLM { declare vertexProvider: "mistral" | "anthropic" | "gemini" | "unknown"; declare anthropicInstance: Anthropic; declare geminiInstance: Gemini; + static AUTH_SCOPES = "https://www.googleapis.com/auth/cloud-platform"; static defaultOptions: Partial | undefined = { maxEmbeddingBatchSize: 250, @@ -68,12 +69,12 @@ class VertexAI extends BaseLLM { ? "gemini" : "unknown"; - // Validate inputs + // Set client authentication promise const { apiKey, region, projectId, env } = _options; const keyFile = env?.keyFile; const keyJson = env?.keyJson; - // Acceptable setup: + // Acceptable authentication methods: // apiKey only // region and projectId AND (keyFile OR keyJson OR nothing) @@ -93,7 +94,7 @@ class VertexAI extends BaseLLM { ); } } else { - if (region && projectId) { + if (!region && !projectId) { throw new Error( "region and projectId are required for VertexAI (when not using express/apiKey mode)", ); @@ -105,15 +106,6 @@ class VertexAI extends BaseLLM { } } - if (!this.apiBase) { - if (apiKey) { - this.apiBase = `https://aiplatform.googleapis.com/v1/`; - } else { - this.apiBase = `https://${region}-aiplatform.googleapis.com/v1/projects/${projectId}/locations/${region}/`; - } - } - - const scopes = "https://www.googleapis.com/auth/cloud-platform"; if (keyJson) { // Loading keys from manually set JSON if (typeof keyJson !== "string") { @@ -121,7 +113,17 @@ class VertexAI extends BaseLLM { } try { const parsed = JSON.parse(keyJson); - this.clientPromise = Promise.resolve(auth.fromJSON(parsed)); + if (!parsed?.private_key) { + throw new Error("VertexAI: keyJson must contain a valid private key"); + } + parsed.private_key = parsed.private_key.replace(/\\n/g, "\n"); + const jsonClient = auth.fromJSON(parsed); + if (jsonClient instanceof JWT) { + jsonClient.scopes = [VertexAI.AUTH_SCOPES]; + } else { + throw new Error("VertexAI: keyJson must be a valid JWT"); + } + this.clientPromise = Promise.resolve(jsonClient); } catch (e) { throw new Error("VertexAI: Failed to parse keyJson"); } @@ -131,7 +133,7 @@ class VertexAI extends BaseLLM { throw new Error("VertexAI: keyFile must be a string"); } this.clientPromise = new GoogleAuth({ - scopes, + scopes: VertexAI.AUTH_SCOPES, keyFile, }) .getClient() @@ -143,7 +145,7 @@ class VertexAI extends BaseLLM { } else { // Loading keys from local credentials or environment variable this.clientPromise = new GoogleAuth({ - scopes, + scopes: VertexAI.AUTH_SCOPES, }) .getClient() .catch((e) => { @@ -153,6 +155,16 @@ class VertexAI extends BaseLLM { }); } + // Set api base + if (!this.apiBase) { + if (apiKey) { + // Express mode + this.apiBase = `https://aiplatform.googleapis.com/v1/`; + } else { + this.apiBase = `https://${region}-aiplatform.googleapis.com/v1/projects/${projectId}/locations/${region}/`; + } + } + // Uses instances of other LLMs since underlying functionality is the same this.anthropicInstance = new Anthropic(_options); this.geminiInstance = new Gemini(_options); From dc1adabee4092716232796f26646ab3e3b3f0aaf Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Wed, 9 Jul 2025 11:04:57 -0700 Subject: [PATCH 19/36] chore: remove feedback dialog --- gui/src/components/dialogs/FeedbackDialog.tsx | 64 ------------------- gui/src/pages/gui/Chat.tsx | 20 ------ 2 files changed, 84 deletions(-) delete mode 100644 gui/src/components/dialogs/FeedbackDialog.tsx diff --git a/gui/src/components/dialogs/FeedbackDialog.tsx b/gui/src/components/dialogs/FeedbackDialog.tsx deleted file mode 100644 index d8da4e93b..000000000 --- a/gui/src/components/dialogs/FeedbackDialog.tsx +++ /dev/null @@ -1,64 +0,0 @@ -import { usePostHog } from "posthog-js/react"; -import { setDialogMessage } from "../../redux/slices/uiSlice"; -import { useAppDispatch } from "../../redux/hooks"; - -export default function FeedbackDialog() { - const posthog = usePostHog(); - const dispatch = useAppDispatch(); - - return ( -
- 👋 Thanks for using Continue. We are always trying to improve and love - hearing from users. If you're interested in speaking, enter your name and - email. We won't use this information for anything other than reaching out. -
-
-
{ - e.preventDefault(); - posthog?.capture("user_interest_form", { - name: e.target.elements[0].value, - email: e.target.elements[1].value, - }); - dispatch( - setDialogMessage( -
- Thanks! We'll be in touch soon. -
, - ), - ); - }} - style={{ - display: "flex", - flexDirection: "column", - gap: "10px", - }} - > - - - -
-
- ); -} diff --git a/gui/src/pages/gui/Chat.tsx b/gui/src/pages/gui/Chat.tsx index 09a3884b7..cab6b3adc 100644 --- a/gui/src/pages/gui/Chat.tsx +++ b/gui/src/pages/gui/Chat.tsx @@ -16,7 +16,6 @@ import { import { ErrorBoundary } from "react-error-boundary"; import styled from "styled-components"; import { Button, lightGray, vscBackground } from "../../components"; -import FeedbackDialog from "../../components/dialogs/FeedbackDialog"; import { useFindWidget } from "../../components/find/FindWidget"; import TimelineItem from "../../components/gui/TimelineItem"; import { NewSessionButton } from "../../components/mainInput/belowMainInput/NewSessionButton"; @@ -37,18 +36,12 @@ import { newSession, updateToolCallOutput, } from "../../redux/slices/sessionSlice"; -import { - setDialogEntryOn, - setDialogMessage, - setShowDialog, -} from "../../redux/slices/uiSlice"; import { streamEditThunk } from "../../redux/thunks/edit"; import { loadLastSession } from "../../redux/thunks/session"; import { streamResponseThunk } from "../../redux/thunks/streamResponse"; import { isJetBrains, isMetaEquivalentKeyPressed } from "../../util"; import { cancelStream } from "../../redux/thunks/cancelStream"; -import { getLocalStorage, setLocalStorage } from "../../util/localStorage"; import { EmptyChatBody } from "./EmptyChatBody"; import { ExploreDialogWatcher } from "./ExploreDialogWatcher"; import { ToolCallDiv } from "./ToolCallDiv"; @@ -221,19 +214,6 @@ export function Chat() { editorToClearOnSend.commands.clearContent(); } } - - // Increment localstorage counter for popup - const currentCount = getLocalStorage("mainTextEntryCounter"); - if (currentCount) { - setLocalStorage("mainTextEntryCounter", currentCount + 1); - if (currentCount === 300) { - dispatch(setDialogMessage()); - dispatch(setDialogEntryOn(false)); - dispatch(setShowDialog(true)); - } - } else { - setLocalStorage("mainTextEntryCounter", 1); - } }, [ history, From 277053db1ce02b7d4ba807f93b3468e8a90689f1 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Wed, 9 Jul 2025 11:08:59 -0700 Subject: [PATCH 20/36] remove more stale code --- gui/src/redux/slices/uiSlice.ts | 11 ----------- gui/src/util/localStorage.ts | 1 - 2 files changed, 12 deletions(-) diff --git a/gui/src/redux/slices/uiSlice.ts b/gui/src/redux/slices/uiSlice.ts index 65350d7c8..f261ff892 100644 --- a/gui/src/redux/slices/uiSlice.ts +++ b/gui/src/redux/slices/uiSlice.ts @@ -83,12 +83,6 @@ export const uiSlice = createSlice({ ) => { state.dialogMessage = action.payload; }, - setDialogEntryOn: ( - state, - action: PayloadAction, - ) => { - state.dialogEntryOn = action.payload; - }, setShowDialog: (state, action: PayloadAction) => { state.showDialog = action.payload; }, @@ -98,9 +92,6 @@ export const uiSlice = createSlice({ ) => { state.isExploreDialogOpen = action.payload; }, - setHasDismissedExploreDialog: (state, action: PayloadAction) => { - state.hasDismissedExploreDialog = action.payload; - }, // Tools addTool: (state, action: PayloadAction) => { state.toolSettings[action.payload.function.name] = @@ -173,10 +164,8 @@ export const uiSlice = createSlice({ export const { setOnboardingCard, setDialogMessage, - setDialogEntryOn, setShowDialog, setIsExploreDialogOpen, - setHasDismissedExploreDialog, toggleToolSetting, setToolPolicy, clearToolPolicy, diff --git a/gui/src/util/localStorage.ts b/gui/src/util/localStorage.ts index 244b51fc6..a6d630e0a 100644 --- a/gui/src/util/localStorage.ts +++ b/gui/src/util/localStorage.ts @@ -6,7 +6,6 @@ type LocalStorageTypes = { hasDismissedExploreDialog: boolean; onboardingStatus?: OnboardingStatus; hasDismissedOnboardingCard: boolean; - mainTextEntryCounter: number; ide: "vscode" | "jetbrains"; vsCodeUriScheme: string; ftc: number; From d0b8eee0ab8cce5fdeded0cbb43a809101bdd675 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Wed, 9 Jul 2025 12:16:12 -0700 Subject: [PATCH 21/36] Update mcp-tools.mdx (#6491) * Update mcp-tools.mdx * Update mcp-tools.mdx --- docs/docs/customization/mcp-tools.mdx | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/docs/docs/customization/mcp-tools.mdx b/docs/docs/customization/mcp-tools.mdx index 098835c59..9b4d35519 100644 --- a/docs/docs/customization/mcp-tools.mdx +++ b/docs/docs/customization/mcp-tools.mdx @@ -19,22 +19,3 @@ Model Context Protocol servers provide specialized functionality: ## Learn More Learn more in the [MCP deep dive](../customize/deep-dives/mcp.mdx), and view [`mcpServers`](/reference#mcpservers) in the YAML Reference for more details. -description: Model Context Protocol servers provide specialized functionality -keywords: [mcp, blocks, model context protocol, integrations, tools] -sidebar_position: 4 - ---- - -Model Context Protocol servers provide specialized functionality: - -- Enable integration with external tools and systems -- Create extensible interfaces for custom capabilities -- Support more complex interactions with your development environment -- Allow partners to contribute specialized functionality -- Database Connectors: Understand schema and data models during development - -![MCP Blocks Overview](/img/mcp-blocks-overview.png) - -## Learn More - -Learn more in the [MCP deep dive](../customize/deep-dives/mcp.mdx), and view [`mcpServers`](/reference#mcpservers) in the YAML Reference for more details. From c7cea2ebc81a36c459b9e295afd7aa109fc49ac6 Mon Sep 17 00:00:00 2001 From: Nate Date: Wed, 9 Jul 2025 14:13:56 -0700 Subject: [PATCH 22/36] prettier format --- .continue/rules/dev-data-guide.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.continue/rules/dev-data-guide.md b/.continue/rules/dev-data-guide.md index 641ec040d..7321b93c0 100644 --- a/.continue/rules/dev-data-guide.md +++ b/.continue/rules/dev-data-guide.md @@ -94,7 +94,7 @@ data: schema: "0.2.0" level: "all" events: ["autocomplete", "chatInteraction", "editOutcome"] - + - name: "Team Analytics" destination: "https://analytics.yourcompany.com/api/events" schema: "0.2.0" @@ -179,7 +179,7 @@ Most dev data logging follows a service pattern: ```typescript export class FeatureLoggingService { private dataLogger = DataLogger.getInstance(); - + logFeatureUsage(data: FeatureUsageData) { this.dataLogger.logDevData("featureUsage", data); } @@ -197,4 +197,4 @@ onAutocompleteAccepted(completion: CompletionData) { } ``` -This guide provides the foundation for understanding and working with Continue's dev data system. Always prioritize user privacy and follow established patterns when making changes. \ No newline at end of file +This guide provides the foundation for understanding and working with Continue's dev data system. Always prioritize user privacy and follow established patterns when making changes. From 92d1df24427889ac7dc8d7d055652c526542e2d2 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Wed, 9 Jul 2025 14:58:15 -0700 Subject: [PATCH 23/36] Revert "chore: terminate all tasks after debug" --- .vscode/launch.json | 1 - .vscode/tasks.json | 13 ------------- 2 files changed, 14 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 346714e94..53632f8d2 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -19,7 +19,6 @@ "pauseForSourceMap": false, "outFiles": ["${workspaceFolder}/extensions/vscode/out/extension.js"], "preLaunchTask": "vscode-extension:build", - "postDebugTask": "Terminate All Tasks", "env": { // "CONTROL_PLANE_ENV": "local", "CONTINUE_GLOBAL_DIR": "${workspaceFolder}/extensions/.continue-debug" diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 0ea873978..5b0636368 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -223,19 +223,6 @@ ], "type": "shell", "problemMatcher": [] - }, - { - "label": "Terminate All Tasks", - "command": "${input:terminate}", - "type": "shell" - } - ], - "inputs": [ - { - "id": "terminate", - "type": "command", - "command": "workbench.action.tasks.terminate", - "args": "terminateAll" } ] } From 1527345c712c5e3939eecd9da7a0cf37dc041857 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Wed, 9 Jul 2025 15:38:33 -0700 Subject: [PATCH 24/36] handle different arg streaming styles --- core/llm/autodetect.ts | 3 +- gui/src/util/toolCallState.test.ts | 100 +++++++++++++++++++++++++++++ gui/src/util/toolCallState.ts | 21 ++++-- 3 files changed, 117 insertions(+), 7 deletions(-) diff --git a/core/llm/autodetect.ts b/core/llm/autodetect.ts index 9a3d37af9..91d14bfdc 100644 --- a/core/llm/autodetect.ts +++ b/core/llm/autodetect.ts @@ -46,7 +46,8 @@ import { PROVIDER_TOOL_SUPPORT } from "./toolSupport.js"; const PROVIDER_HANDLES_TEMPLATING: string[] = [ "lmstudio", "openai", - "ollama", + "nvidia", + "ollama", "together", "novita", "msty", diff --git a/gui/src/util/toolCallState.test.ts b/gui/src/util/toolCallState.test.ts index 3207b606a..486f26c66 100644 --- a/gui/src/util/toolCallState.test.ts +++ b/gui/src/util/toolCallState.test.ts @@ -479,4 +479,104 @@ describe("addToolCallDeltaToState", () => { ); expect(currentState.parsedArgs).toEqual({ location: "Paris, France" }); }); + + it("should handle arguments streamed in full progressive chunks", () => { + // Test case where model streams args progressively but includes full prefix each time + // e.g. '{"query":"te' -> '{"query":"tes' -> '{"query":"test"}' + const currentState: ToolCallState = { + status: "generating", + toolCall: { + id: "call123", + type: "function", + function: { + name: "searchFiles", + arguments: '{"query":"te', + }, + }, + toolCallId: "call123", + parsedArgs: { query: "te" }, + }; + + const delta: ToolCallDelta = { + function: { + arguments: '{"query":"tes', + }, + }; + + const result = addToolCallDeltaToState(delta, currentState); + expect(result.toolCall.function.arguments).toBe('{"query":"tes'); + expect(result.parsedArgs).toEqual({ query: "tes" }); + + // Continue the streaming + const nextDelta: ToolCallDelta = { + function: { + arguments: '{"query":"test"}', + }, + }; + + const finalResult = addToolCallDeltaToState(nextDelta, result); + expect(finalResult.toolCall.function.arguments).toBe('{"query":"test"}'); + expect(finalResult.parsedArgs).toEqual({ query: "test" }); + }); + + it("should handle when args delta is a superset of current args", () => { + // Test case where model sends a subset of the current arguments + // This can happen in certain LLM implementations + const currentState: ToolCallState = { + status: "generating", + toolCall: { + id: "call123", + type: "function", + function: { + name: "searchFiles", + arguments: '{"query":"test"', + }, + }, + toolCallId: "call123", + parsedArgs: { query: "test" }, + }; + + const delta: ToolCallDelta = { + function: { + arguments: '{"query":"test","limit":10}', + }, + }; + + // The subset should be ignored, keeping the current state + const result = addToolCallDeltaToState(delta, currentState); + expect(result.toolCall.function.arguments).toBe( + '{"query":"test","limit":10}', + ); + expect(result.parsedArgs).toEqual({ query: "test", limit: 10 }); + }); + + it("should handle when args are complete JSON and new deltas arrive", () => { + // When args are already a valid JSON object, new deltas should not modify it + const currentState: ToolCallState = { + status: "generating", + toolCall: { + id: "call123", + type: "function", + function: { + name: "searchFiles", + arguments: '{"query":"test","limit":10}', + }, + }, + toolCallId: "call123", + parsedArgs: { query: "test", limit: 10 }, + }; + + const delta: ToolCallDelta = { + function: { + arguments: ',"sort":"asc"}', + }, + }; + + // The complete JSON should not be modified + const result = addToolCallDeltaToState(delta, currentState); + expect(result.toolCall.function.arguments).toBe( + '{"query":"test","limit":10}', + ); + expect(result.parsedArgs).toEqual({ query: "test", limit: 10 }); + }); }); diff --git a/gui/src/util/toolCallState.ts b/gui/src/util/toolCallState.ts index e42ac6430..dab9b87b4 100644 --- a/gui/src/util/toolCallState.ts +++ b/gui/src/util/toolCallState.ts @@ -34,15 +34,24 @@ export function addToolCallDeltaToState( if (nameDelta.startsWith(currentName)) { // Case where model progresssively streams name but full name each time e.g. "readFi" -> "readFil" -> "readFile" mergedName = nameDelta; - } else if (currentName.startsWith(nameDelta)) { - // Case where model streams in full name each time e.g. readFile -> readFile -> readFile - // do nothing - } else { - // Case where model streams in name in parts e.g. "read" -> "File" + } else if (!currentName.startsWith(nameDelta)) { mergedName = currentName + nameDelta; } - const mergedArgs = currentArgs + argsDelta; + // Similar logic for args, with an extra JSON check + let mergedArgs = currentArgs; + try { + // If args is JSON parseable, it is complete, don't add to it + JSON.parse(currentArgs); + } catch (e) { + if (argsDelta.startsWith(currentArgs)) { + // Case where model progresssively streams args but full args each time e.g. "{"file": "file1"}" -> "{"file": "file1", "line": 1}" + mergedArgs = argsDelta; + } else if (!currentArgs.startsWith(argsDelta)) { + // Case where model streams in args in parts e.g. "{"file": "file1"" -> ", "line": 1}" + mergedArgs = currentArgs + argsDelta; + } + } const [_, parsedArgs] = incrementalParseJson(mergedArgs || "{}"); From eea1b13e403835030067c7ed25abe8f73ba3c26f Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Wed, 9 Jul 2025 15:45:54 -0700 Subject: [PATCH 25/36] fix autodetect prettier --- core/llm/autodetect.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/llm/autodetect.ts b/core/llm/autodetect.ts index 91d14bfdc..a220b5dbd 100644 --- a/core/llm/autodetect.ts +++ b/core/llm/autodetect.ts @@ -47,7 +47,7 @@ const PROVIDER_HANDLES_TEMPLATING: string[] = [ "lmstudio", "openai", "nvidia", - "ollama", + "ollama", "together", "novita", "msty", From 4d5423294aa6aa888d70ef3f94a8bd6aa76bd111 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Thu, 10 Jul 2025 08:49:32 +0530 Subject: [PATCH 26/36] use string concat instead of path.join --- packages/config-yaml/src/markdown/markdownToRule.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/config-yaml/src/markdown/markdownToRule.ts b/packages/config-yaml/src/markdown/markdownToRule.ts index 41306fe3d..231b2ab4a 100644 --- a/packages/config-yaml/src/markdown/markdownToRule.ts +++ b/packages/config-yaml/src/markdown/markdownToRule.ts @@ -77,18 +77,21 @@ function getGlobPattern( if (id.uriType !== "file") { return globs; } - const dir = path.dirname(id.filePath); + let dir = path.dirname(id.filePath); if (dir.includes(".continue")) { return globs; } + if (!dir.endsWith("/")) { + dir = dir.concat("/"); + } const prependDirAndApplyGlobstar = (glob: string) => { if (glob.startsWith("**")) { - return path.join(dir, glob); + return dir.concat(glob); } - return path.join(dir, `**/${glob}`); + return dir.concat("**/", glob); }; if (!globs) { - return path.join(dir, "**/*"); + return dir.concat("**/*"); } if (Array.isArray(globs)) { return globs.map(prependDirAndApplyGlobstar); From b11e831a20638f7065e3ee47e8e954436d4e5a82 Mon Sep 17 00:00:00 2001 From: adarshramiyer Date: Wed, 9 Jul 2025 20:20:58 -0700 Subject: [PATCH 27/36] changes to address patrick's comments --- core/nextEdit/context/diffFormatting.ts | 22 ++++++++---- core/nextEdit/context/processNextEditData.ts | 14 ++++---- core/util/paths.ts | 34 +++++++++++++++++++ extensions/vscode/package-lock.json | 4 +-- .../vscode/src/util/editLoggingUtils.ts | 23 +------------ 5 files changed, 59 insertions(+), 38 deletions(-) diff --git a/core/nextEdit/context/diffFormatting.ts b/core/nextEdit/context/diffFormatting.ts index 3c7deb933..e373c56bc 100644 --- a/core/nextEdit/context/diffFormatting.ts +++ b/core/nextEdit/context/diffFormatting.ts @@ -12,13 +12,21 @@ export type BeforeAfterDiff = { afterContent: string; }; -export const createDiff = ( - beforeContent: string, - afterContent: string, - filePath: string, - diffType: DiffFormatType, - contextLines: number = 3, -) => { +export interface createDiffArgs { + beforeContent: string; + afterContent: string; + filePath: string; + diffType: DiffFormatType; + contextLines: number; +} + +export const createDiff = ({ + beforeContent, + afterContent, + filePath, + diffType, + contextLines, +}: createDiffArgs) => { switch (diffType) { case DiffFormatType.Unified: return createUnifiedDiff( diff --git a/core/nextEdit/context/processNextEditData.ts b/core/nextEdit/context/processNextEditData.ts index 45c9e231b..aaa89d33a 100644 --- a/core/nextEdit/context/processNextEditData.ts +++ b/core/nextEdit/context/processNextEditData.ts @@ -127,13 +127,13 @@ export const processNextEditData = async ({ // add current edit to history const thisEdit: prevEdit = { - unidiff: createDiff( - beforeContent, - afterContent, - filePath, - DiffFormatType.Unified, - 25, // 25 context lines; store a large number for trimming later on - ), + unidiff: createDiff({ + beforeContent: beforeContent, + afterContent: afterContent, + filePath: filePath, + diffType: DiffFormatType.Unified, + contextLines: 25, // storing many context lines for downstream trimming + }), fileUri: filePath, workspaceUri: workspaceDir, timestamp: timestamp, diff --git a/core/util/paths.ts b/core/util/paths.ts index 1123b7eda..92ea5be94 100644 --- a/core/util/paths.ts +++ b/core/util/paths.ts @@ -1,6 +1,7 @@ import * as fs from "fs"; import * as os from "os"; import * as path from "path"; +import * as URI from "uri-js"; import * as YAML from "yaml"; import { ConfigYaml, DevEventName } from "@continuedev/config-yaml"; @@ -466,3 +467,36 @@ export function getDiffsDirectoryPath(): string { } return diffsPath; } + +export const isFileWithinFolder = ( + fileUri: string, + folderPath: string, +): boolean => { + try { + if (!fileUri || !folderPath) { + return false; + } + + const fileUriParsed = URI.parse(fileUri); + const fileScheme = fileUriParsed.scheme || "file"; + let filePath = fileUriParsed.path || ""; + filePath = decodeURIComponent(filePath); + + let folderWithScheme = folderPath; + if (!folderPath.includes("://")) { + folderWithScheme = `${fileScheme}://${folderPath.startsWith("/") ? "" : "/"}${folderPath}`; + } + const folderUriParsed = URI.parse(folderWithScheme); + + let folderPathClean = folderUriParsed.path || ""; + folderPathClean = decodeURIComponent(folderPathClean); + + filePath = filePath.replace(/\/$/, ""); + folderPathClean = folderPathClean.replace(/\/$/, ""); + + return filePath === folderPath || filePath.startsWith(`${folderPath}/`); + } catch (error) { + console.error("Error in isFileWithinFolder:", error); + return false; + } +}; diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index f58d4cba8..6936cc88b 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "1.1.58", + "version": "1.1.59", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "1.1.58", + "version": "1.1.59", "license": "Apache-2.0", "dependencies": { "@continuedev/config-types": "^1.0.14", diff --git a/extensions/vscode/src/util/editLoggingUtils.ts b/extensions/vscode/src/util/editLoggingUtils.ts index 1c6bd3dfb..4ef1fabc6 100644 --- a/extensions/vscode/src/util/editLoggingUtils.ts +++ b/extensions/vscode/src/util/editLoggingUtils.ts @@ -3,8 +3,7 @@ import { AutocompleteCodeSnippet } from "core/autocomplete/snippets/types"; import { GetLspDefinitionsFunction } from "core/autocomplete/types"; import { ConfigHandler } from "core/config/ConfigHandler"; import { RecentlyEditedRange } from "core/nextEdit/types"; -import { getContinueGlobalPath } from "core/util/paths"; -import { findUriInDirs } from "core/util/uri"; +import { getContinueGlobalPath, isFileWithinFolder } from "core/util/paths"; import fs from "fs"; import { resolve } from "path"; import * as vscode from "vscode"; @@ -22,26 +21,6 @@ export const getBeforeCursorPos = (range: Range, activePos: Position) => { } }; -const isFileWithinFolder = (fileUri: string, folderPath: string): boolean => { - try { - const uriMatch = fileUri.match(/^([a-zA-Z]+:\/\/)/); - const scheme = uriMatch ? uriMatch[1] : "file://"; - - const folderUri = folderPath.match(/^[a-zA-Z]+:\/\//) - ? folderPath - : `${scheme}${folderPath}`; - - const normalizedFolderUri = folderUri.endsWith("/") - ? folderUri - : `${folderUri}/`; - - const { foundInDir } = findUriInDirs(fileUri, [normalizedFolderUri]); - return foundInDir !== null; - } catch (error) { - return false; - } -}; - const isEditLoggingAllowed = async (editedFileURI: string) => { const globalContinuePath = getContinueGlobalPath(); const editLogDirsPath = resolve(globalContinuePath, ".editlogdirs"); From 522d62ff112a2625353825ebee0a1a89bda4272c Mon Sep 17 00:00:00 2001 From: adarshramiyer Date: Wed, 9 Jul 2025 20:44:08 -0700 Subject: [PATCH 28/36] corrected to checking against clean paths --- core/util/paths.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/util/paths.ts b/core/util/paths.ts index 92ea5be94..315053413 100644 --- a/core/util/paths.ts +++ b/core/util/paths.ts @@ -494,7 +494,9 @@ export const isFileWithinFolder = ( filePath = filePath.replace(/\/$/, ""); folderPathClean = folderPathClean.replace(/\/$/, ""); - return filePath === folderPath || filePath.startsWith(`${folderPath}/`); + return ( + filePath === folderPathClean || filePath.startsWith(`${folderPathClean}/`) + ); } catch (error) { console.error("Error in isFileWithinFolder:", error); return false; From dfdaa71032dca1c29c911d68cf2ae0651d98300d Mon Sep 17 00:00:00 2001 From: adarshramiyer Date: Wed, 9 Jul 2025 20:47:40 -0700 Subject: [PATCH 29/36] adopting new createDiff signature across repo --- core/nextEdit/context/aggregateEdits.ts | 13 +++++++------ core/nextEdit/context/processSmallEdit.ts | 13 +++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/core/nextEdit/context/aggregateEdits.ts b/core/nextEdit/context/aggregateEdits.ts index 4443b1d9e..b4a9bbd9e 100644 --- a/core/nextEdit/context/aggregateEdits.ts +++ b/core/nextEdit/context/aggregateEdits.ts @@ -482,12 +482,13 @@ export class EditAggregator { return; } - const diff = createDiff( - beforeContent, - afterContent, - filePath, - DiffFormatType.Unified, - ); // Used for checks, not for final output + const diff = createDiff({ + beforeContent: beforeContent, + afterContent: afterContent, + filePath: filePath, + diffType: DiffFormatType.Unified, + contextLines: 3, + }); // Used for checks, not for final output // Skip diffs with too many changed lines const changedLineCount = this.countChangedLines(diff); diff --git a/core/nextEdit/context/processSmallEdit.ts b/core/nextEdit/context/processSmallEdit.ts index 18ed9d544..5824191b3 100644 --- a/core/nextEdit/context/processSmallEdit.ts +++ b/core/nextEdit/context/processSmallEdit.ts @@ -15,12 +15,13 @@ export const processSmallEdit = async ( ide: IDE, ) => { NextEditProvider.getInstance().addDiffToContext( - createDiff( - beforeAfterdiff.beforeContent, - beforeAfterdiff.afterContent, - beforeAfterdiff.filePath, - DiffFormatType.Unified, - ), + createDiff({ + beforeContent: beforeAfterdiff.beforeContent, + afterContent: beforeAfterdiff.afterContent, + filePath: beforeAfterdiff.filePath, + diffType: DiffFormatType.Unified, + contextLines: 3, // NOTE: This can change depending on experiments! + }), ); // Get the current context data from the most recent message From 8d71186214fcb4c15b996796c90b6b1035aae21e Mon Sep 17 00:00:00 2001 From: Brian Douglas Date: Wed, 9 Jul 2025 21:37:17 -0700 Subject: [PATCH 30/36] docs: return autocomplete setup (#6536) * docs: return autocomplete setup * fix broken links * adds redirects * adds missing files and redirect * fix build --- docs/docs/customize/deep-dives/mcp.mdx | 2 +- .../docs/features/agent/context-selection.mdx | 3 ++ docs/docs/features/agent/how-to-customize.mdx | 27 ++++++++++ docs/docs/features/agent/model-setup.mdx | 14 ++++++ .../autocomplete/context-selection.mdx | 19 +++++++ .../autocomplete/how-to-customize.mdx | 5 ++ .../features/autocomplete/model-setup.mdx | 29 +++++++++++ docs/docs/features/chat/context-selection.mdx | 39 +++++++++++++++ docs/docs/features/chat/how-to-customize.mdx | 7 +++ docs/docs/features/chat/model-setup.mdx | 19 +++++++ docs/docs/features/edit/context-selection.mdx | 11 +++++ docs/docs/features/edit/how-to-customize.mdx | 9 ++++ docs/docs/features/edit/model-setup.mdx | 14 ++++++ docs/docusaurus.config.js | 49 +++++++++++++++++++ 14 files changed, 246 insertions(+), 1 deletion(-) create mode 100644 docs/docs/features/agent/context-selection.mdx create mode 100644 docs/docs/features/agent/how-to-customize.mdx create mode 100644 docs/docs/features/agent/model-setup.mdx create mode 100644 docs/docs/features/autocomplete/context-selection.mdx create mode 100644 docs/docs/features/autocomplete/how-to-customize.mdx create mode 100644 docs/docs/features/autocomplete/model-setup.mdx create mode 100644 docs/docs/features/chat/context-selection.mdx create mode 100644 docs/docs/features/chat/how-to-customize.mdx create mode 100644 docs/docs/features/chat/model-setup.mdx create mode 100644 docs/docs/features/edit/context-selection.mdx create mode 100644 docs/docs/features/edit/how-to-customize.mdx create mode 100644 docs/docs/features/edit/model-setup.mdx diff --git a/docs/docs/customize/deep-dives/mcp.mdx b/docs/docs/customize/deep-dives/mcp.mdx index 589b04798..eb95d66f5 100644 --- a/docs/docs/customize/deep-dives/mcp.mdx +++ b/docs/docs/customize/deep-dives/mcp.mdx @@ -140,7 +140,7 @@ mcpServers: - "@modelcontextprotocol/server-sqlite" - "./database.db" cwd: "/path/to/project" - + - name: Local Project Server command: npm args: diff --git a/docs/docs/features/agent/context-selection.mdx b/docs/docs/features/agent/context-selection.mdx new file mode 100644 index 000000000..57efd4711 --- /dev/null +++ b/docs/docs/features/agent/context-selection.mdx @@ -0,0 +1,3 @@ +You can use the same methods to manually add context as [Chat](/features/chat/context-selection). + +Tool call responses are automatically included as context items. This enables Agent mode to see the result of the previous action and decide what to do next. diff --git a/docs/docs/features/agent/how-to-customize.mdx b/docs/docs/features/agent/how-to-customize.mdx new file mode 100644 index 000000000..a912292d2 --- /dev/null +++ b/docs/docs/features/agent/how-to-customize.mdx @@ -0,0 +1,27 @@ +## Add Rules Blocks + +Adding Rules can be done in your assistant locally or in the Hub. You can explore Rules on the Continue Hub and refer to the [Rules deep dive](/customize/deep-dives/rules) for more details. + +## Add MCP Tools + +You can add MCP servers to your assistant to give Agent access to more tools. Explore [MCP Servers on the Hub](https://hub.continue.dev) and consult the [MCP guide](/customize/deep-dives/mcp) for more details. + +## Tool Policies + +You can adjust the Agent's tool usage behavior to three options: + +- **Ask First (default)**: Request user permission with "Cancel" and "Continue" buttons +- **Automatic**: Automatically call the tool without requesting permission +- **Excluded**: Do not send the tool to the model + +:::warning +Be careful setting tools to "automatic" if their behavior is not read-only. +::: + +To manage tool policies: + +1. Click the tools icon in the input toolbar +2. View and change policies by clicking on the policy text +3. You can also toggle groups of tools on/off + +Tool policies are stored locally per user. diff --git a/docs/docs/features/agent/model-setup.mdx b/docs/docs/features/agent/model-setup.mdx new file mode 100644 index 000000000..c4a30c526 --- /dev/null +++ b/docs/docs/features/agent/model-setup.mdx @@ -0,0 +1,14 @@ +We recommend **Claude 3.5 Sonnet** from Anthropic for the best Agent experience. + +- [Add Claude 3.5 Sonnet to your assistant from the hub](https://hub.continue.dev/anthropic/claude-3-5-sonnet-20241022) +- Get your API key from the [Anthropic console](https://console.anthropic.com/) + +## Other recommended models + +- [Claude Sonnet 4 from Anthropic](https://hub.continue.dev/anthropic) +- [GPT-4o from OpenAI](https://hub.continue.dev/openai/gpt-4o) +- [Gemini 2.0 Pro from Google](https://hub.continue.dev/google/gemini-2.0-pro) + +Agent can be used with models that support tool use through Continue. The best chat models generally support tool use. + +For more information on models, check out [our recommended chat models](/features/chat/model-setup). diff --git a/docs/docs/features/autocomplete/context-selection.mdx b/docs/docs/features/autocomplete/context-selection.mdx new file mode 100644 index 000000000..66cd4694e --- /dev/null +++ b/docs/docs/features/autocomplete/context-selection.mdx @@ -0,0 +1,19 @@ +# Context Selection + +Autocomplete will automatically determine context based on the current cursor position. We use the following techniques to determine what to include in the prompt: + +## File prefix/suffix + +We will always include the code from your file prior to and after the cursor position. + +## Definitions from the Language Server Protocol + +Similar to how you can use cmd/ctrl + click in your editor, we use the same tool (the LSP) to power "go to definition". For example, if you are typing out a function call, we will include the function definition. Or, if you are writing code inside of a method, we will include the type definitions for any parameters or the return type. + +## Imported files + +Because there are often many imports, we can't include all of them. Instead, we look for symbols around your cursor that have matching imports and use that as context. + +## Recent files + +We automatically consider recently opened or edited files and include snippets that are relevant to the current completion. diff --git a/docs/docs/features/autocomplete/how-to-customize.mdx b/docs/docs/features/autocomplete/how-to-customize.mdx new file mode 100644 index 000000000..ddd028933 --- /dev/null +++ b/docs/docs/features/autocomplete/how-to-customize.mdx @@ -0,0 +1,5 @@ +# How to Customize Autocomplete + +Continue offers a handful of settings to customize autocomplete behavior. Visit the [User Settings Page](/customize/settings) to manage these settings. + +For a comprehensive guide on all configuration options and their impacts, see the [Autocomplete deep dive](/customize/deep-dives/autocomplete). diff --git a/docs/docs/features/autocomplete/model-setup.mdx b/docs/docs/features/autocomplete/model-setup.mdx new file mode 100644 index 000000000..9acece878 --- /dev/null +++ b/docs/docs/features/autocomplete/model-setup.mdx @@ -0,0 +1,29 @@ +# Autocomplete Model Setup + +Setting up the right model for autocomplete is crucial for a smooth coding experience. Here are our top recommendations: + +## Recommended Models + +### Hosted-Based (Best Performance) + +For the highest quality autocomplete suggestions, we recommend **[Codestral](https://hub.continue.dev/mistral/codestral)** from Mistral. This model is specifically designed for code completion and offers excellent performance across multiple programming languages. + +**Quick Setup:** + +1. [Add Codestral from the hub](https://hub.continue.dev/mistral/codestral) +2. Get your API key from the [Mistral Platform](https://console.mistral.ai/codestral) +3. Configure it in your Continue settings + +### Local/Offline (Privacy First) + +For a fully local autocomplete experience that doesn't send your code to external servers, we recommend **[Qwen 2.5 Coder 1.5B](https://hub.continue.dev/ollama/qwen2.5-coder-1.5b)** running on Ollama. This model provides good suggestions while keeping your code completely private. + +**Quick Setup:** + +1. Install [Ollama](https://ollama.ai/) +2. [Add Qwen 2.5 Coder from the hub](https://hub.continue.dev/ollama/qwen2.5-coder-1.5b) +3. Configure it in your Continue settings + +## Need Help? + +If you're not seeing any completions or need more detailed configuration options, check out our comprehensive [autocomplete deep dive guide](/customize/deep-dives/autocomplete). diff --git a/docs/docs/features/chat/context-selection.mdx b/docs/docs/features/chat/context-selection.mdx new file mode 100644 index 000000000..04041b689 --- /dev/null +++ b/docs/docs/features/chat/context-selection.mdx @@ -0,0 +1,39 @@ +## Input + +Typing a question or instructions into the input box is the only required context. + +## Highlighted Code + +The highlighted code you've selected by pressing cmd/ctrl + L (VS Code) or cmd/ctrl + J (JetBrains) will be included in your prompt. + +## Active File + +You can include the currently open file as context by pressing opt/alt + enter when you send your request. + +## Specific File + +You can include a specific file in your current workspace by typing '@Files' and selecting the file. + +## Specific Folder + +You can include a folder in your current workspace by typing '@Folder' and selecting the directory. + +## Codebase Search + +You can automatically include relevant files from your codebase by typing '@Codebase'. + +## Documentation Site + +You can include a documentation site as context by typing '@Docs' and selecting the site. + +## Terminal Contents + +You can include the contents of the terminal in your IDE by typing '@Terminal'. + +## Git Diff + +You can include all of the changes you've made to your current branch by typing '@Git Diff'. + +## Other Context + +You can see a full list of built-in context providers [here](/customize/custom-providers) and learn about how to create your own context provider [here](/guides/build-your-own-context-provider). diff --git a/docs/docs/features/chat/how-to-customize.mdx b/docs/docs/features/chat/how-to-customize.mdx new file mode 100644 index 000000000..2692f7837 --- /dev/null +++ b/docs/docs/features/chat/how-to-customize.mdx @@ -0,0 +1,7 @@ +There are a number of different ways to customize Chat: + +- Add a `rules` block to give the model persistent instructions through the system prompt +- Configure `@Codebase` +- Configure `@Docs` +- [Build your own context provider](/guides/build-your-own-context-provider) +- [Create a custom code RAG](/guides/custom-code-rag) diff --git a/docs/docs/features/chat/model-setup.mdx b/docs/docs/features/chat/model-setup.mdx new file mode 100644 index 000000000..2b762ec64 --- /dev/null +++ b/docs/docs/features/chat/model-setup.mdx @@ -0,0 +1,19 @@ +We recommend setting up a model for the best experience. + +## Recommended Models + +Here's our primary model recommendation: + +**Claude 3.5 Sonnet** from Anthropic + +- [Add Claude 3.5 Sonnet to your assistant from the hub](https://hub.continue.dev/anthropic/claude-3-5-sonnet-20241022) +- Get your API key from the [Anthropic console](https://console.anthropic.com/) + +Other top models to consider: + +- [GPT-4o from OpenAI](https://hub.continue.dev/openai/gpt-4o) +- [Grok-2 from xAI](https://hub.continue.dev/xai/grok-2) +- [Gemini 2.0 Flash from Google](https://hub.continue.dev/google/gemini-2.0-flash) +- [Llama 3.1 8b from Meta (local)](https://hub.continue.dev/ollama/llama3.1) + +For more detailed setup instructions, see [here](/getting-started/install#setup-your-first-model). diff --git a/docs/docs/features/edit/context-selection.mdx b/docs/docs/features/edit/context-selection.mdx new file mode 100644 index 000000000..a7c3459c9 --- /dev/null +++ b/docs/docs/features/edit/context-selection.mdx @@ -0,0 +1,11 @@ +## Input + +The input you provide is included in the prompt. + +## Code to Edit + +The **entire contents** of each file (the current file for Jetbrains inline Edit, the `Code to Edit` item for VS Code Edit mode) are included in the prompt for context. The model will only attempt to edit the highlighted/specified ranges. + +## Context Providers + +In VS Code Edit mode, you can use `@` to add context using [Context Providers](/customize/custom-providers), similar to [Chat](/features/chat/context-selection). Some context providers may be disabled in Edit mode. diff --git a/docs/docs/features/edit/how-to-customize.mdx b/docs/docs/features/edit/how-to-customize.mdx new file mode 100644 index 000000000..1375d7b9d --- /dev/null +++ b/docs/docs/features/edit/how-to-customize.mdx @@ -0,0 +1,9 @@ +## Setting active Edit/Apply model + +You can configure particular models from your Assistant to be used for Edit and Apply requests. + +1. Click the 3 dots above the main input +2. Click the cube icon to expand the "Models" section +3. Use the dropdowns to select models for Edit and Apply + +Learn more about the [Edit role](/customize/model-roles/edit) and [Apply role](/customize/model-roles/apply). diff --git a/docs/docs/features/edit/model-setup.mdx b/docs/docs/features/edit/model-setup.mdx new file mode 100644 index 000000000..05160853b --- /dev/null +++ b/docs/docs/features/edit/model-setup.mdx @@ -0,0 +1,14 @@ +By default, Edit uses the same model as Chat. We recommend **Claude 3.5 Sonnet** from Anthropic. + +[Explore other Edit models on the Continue Hub →](https://hub.continue.dev) + +## Apply Model + +We also recommend setting up an Apply model for the best Edit experience. + +**Recommended Apply models:** + +- [Morph v0 Fast Apply](https://hub.continue.dev) +- [Relace Instant Apply](https://hub.continue.dev) + +[Explore other Apply models on the Continue Hub →](https://hub.continue.dev) diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index a48bd4707..3e146343d 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -636,6 +636,18 @@ const config = { to: "/features/autocomplete/how-it-works", from: "/autocomplete/how-it-works", }, + { + to: "/features/autocomplete/model-setup", + from: "/autocomplete/model-setup", + }, + { + to: "/features/autocomplete/how-to-customize", + from: "/autocomplete/how-to-customize", + }, + { + to: "/features/autocomplete/context-selection", + from: "/autocomplete/context-selection", + }, { to: "/features/edit/how-it-works", from: "/edit/how-it-works", @@ -656,6 +668,43 @@ const config = { to: "/customize/json-reference", from: ["/json-reference", "/advanced/json-reference"], }, + // New feature page redirects + { + to: "/features/chat/model-setup", + from: "/chat/model-setup", + }, + { + to: "/features/chat/how-to-customize", + from: "/chat/how-to-customize", + }, + { + to: "/features/chat/context-selection", + from: "/chat/context-selection", + }, + { + to: "/features/edit/model-setup", + from: "/edit/model-setup", + }, + { + to: "/features/edit/how-to-customize", + from: "/edit/how-to-customize", + }, + { + to: "/features/edit/context-selection", + from: "/edit/context-selection", + }, + { + to: "/features/agent/model-setup", + from: "/agent/model-setup", + }, + { + to: "/features/agent/how-to-customize", + from: "/agent/how-to-customize", + }, + { + to: "/features/agent/context-selection", + from: "/agent/context-selection", + }, ], }, ], From 7293b977bf7a357377c1785aeab53b682ca38697 Mon Sep 17 00:00:00 2001 From: adarshramiyer Date: Wed, 9 Jul 2025 23:06:19 -0700 Subject: [PATCH 31/36] pascal case interface --- core/nextEdit/context/diffFormatting.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/nextEdit/context/diffFormatting.ts b/core/nextEdit/context/diffFormatting.ts index e373c56bc..465a7106f 100644 --- a/core/nextEdit/context/diffFormatting.ts +++ b/core/nextEdit/context/diffFormatting.ts @@ -12,7 +12,7 @@ export type BeforeAfterDiff = { afterContent: string; }; -export interface createDiffArgs { +export interface CreateDiffArgs { beforeContent: string; afterContent: string; filePath: string; @@ -26,7 +26,7 @@ export const createDiff = ({ filePath, diffType, contextLines, -}: createDiffArgs) => { +}: CreateDiffArgs) => { switch (diffType) { case DiffFormatType.Unified: return createUnifiedDiff( From d6ef98e761e6e7968a216c537e384a477017c398 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Wed, 9 Jul 2025 23:24:14 -0700 Subject: [PATCH 32/36] chore: vs code 1.1.60 --- extensions/vscode/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index cb33e7a31..f7c6b6ea5 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -2,7 +2,7 @@ "name": "continue", "icon": "media/icon.png", "author": "Continue Dev, Inc", - "version": "1.1.59", + "version": "1.1.60", "repository": { "type": "git", "url": "https://github.com/continuedev/continue" From 12e35a1bd0790be08242503ef70272ea10911c2e Mon Sep 17 00:00:00 2001 From: zimu Date: Thu, 10 Jul 2025 20:00:34 +0800 Subject: [PATCH 33/36] fix: parameter order misplace (directory <-> artifactId) in IntelliJIde.kt --- .../continueintellijextension/continue/IntelliJIde.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IntelliJIde.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IntelliJIde.kt index 2dfc3e3e1..e1b6624d1 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IntelliJIde.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IntelliJIde.kt @@ -495,7 +495,7 @@ class IntelliJIDE( // Create the list of IndexTag objects return workspaceDirs.mapIndexed { index, directory -> - IndexTag(directory, branches[index], artifactId) + IndexTag(artifactId, branches[index], directory) } } @@ -622,4 +622,5 @@ class IntelliJIDE( return listOfNotNull(project.guessProjectDir()?.toUriOrNull()).toTypedArray() } -} \ No newline at end of file +} + From 3d4d777b07875418cc7efff2e21de27960af395a Mon Sep 17 00:00:00 2001 From: zimu Date: Thu, 10 Jul 2025 19:30:42 +0800 Subject: [PATCH 34/36] fix: adjust binary/build.js. copy vscode/tree-sitter folder to binary/ and pack into binary file --- binary/.gitignore | 1 + binary/build.js | 20 ++++++++++++++++++++ binary/pkgJson/darwin-arm64/package.json | 1 + binary/pkgJson/darwin-x64/package.json | 1 + binary/pkgJson/linux-arm64/package.json | 1 + binary/pkgJson/linux-x64/package.json | 1 + binary/pkgJson/win32-arm64/package.json | 1 + binary/pkgJson/win32-x64/package.json | 1 + 8 files changed, 27 insertions(+) diff --git a/binary/.gitignore b/binary/.gitignore index 3b0c8035f..356b68c71 100644 --- a/binary/.gitignore +++ b/binary/.gitignore @@ -3,3 +3,4 @@ bin data out tmp +tree-sitter diff --git a/binary/build.js b/binary/build.js index c2431333c..839bbb281 100644 --- a/binary/build.js +++ b/binary/build.js @@ -21,6 +21,7 @@ function cleanSlate() { rimrafSync(out); rimrafSync(build); rimrafSync(path.join(__dirname, "tmp")); + rimrafSync(path.join(__dirname, "tree-sitter")); fs.mkdirSync(bin); fs.mkdirSync(out); fs.mkdirSync(build); @@ -142,6 +143,25 @@ async function buildWithEsbuild() { ); }); + // copy tree-sitter colder to binary folder to make it available when running in intellij debug mode + const treeSitterDir = path.join(__dirname, "tree-sitter"); + fs.mkdirSync(treeSitterDir); + await new Promise((resolve, reject) => { + ncp( + path.join(__dirname, "..", "extensions", "vscode", "tree-sitter"), + treeSitterDir, + { dereference: true }, + (error) => { + if (error) { + console.warn("[error] Error copying tree-sitter files", error); + reject(error); + } else { + resolve(); + } + }, + ); + }); + const filesToCopy = [ "../core/vendor/tree-sitter.wasm", "../core/llm/llamaTokenizerWorkerPool.mjs", diff --git a/binary/pkgJson/darwin-arm64/package.json b/binary/pkgJson/darwin-arm64/package.json index afc840e85..885f2f215 100644 --- a/binary/pkgJson/darwin-arm64/package.json +++ b/binary/pkgJson/darwin-arm64/package.json @@ -11,6 +11,7 @@ "../../../core/node_modules/sqlite3/**/*", "../../out/tree-sitter.wasm", "../../out/tree-sitter-wasms/*", + "../../tree-sitter/**/*", "../../out/llamaTokenizer.mjs", "../../out/llamaTokenizerWorkerPool.mjs", "../../out/tiktokenWorkerPool.mjs", diff --git a/binary/pkgJson/darwin-x64/package.json b/binary/pkgJson/darwin-x64/package.json index 4ba10b526..eba774c71 100644 --- a/binary/pkgJson/darwin-x64/package.json +++ b/binary/pkgJson/darwin-x64/package.json @@ -11,6 +11,7 @@ "../../../core/node_modules/sqlite3/**/*", "../../out/tree-sitter.wasm", "../../out/tree-sitter-wasms/*", + "../../tree-sitter/**/*", "../../out/llamaTokenizer.mjs", "../../out/llamaTokenizerWorkerPool.mjs", "../../out/tiktokenWorkerPool.mjs", diff --git a/binary/pkgJson/linux-arm64/package.json b/binary/pkgJson/linux-arm64/package.json index efa9b2ad1..a3db51040 100644 --- a/binary/pkgJson/linux-arm64/package.json +++ b/binary/pkgJson/linux-arm64/package.json @@ -11,6 +11,7 @@ "../../../core/node_modules/sqlite3/**/*", "../../out/tree-sitter.wasm", "../../out/tree-sitter-wasms/*", + "../../tree-sitter/**/*", "../../out/llamaTokenizer.mjs", "../../out/llamaTokenizerWorkerPool.mjs", "../../out/tiktokenWorkerPool.mjs", diff --git a/binary/pkgJson/linux-x64/package.json b/binary/pkgJson/linux-x64/package.json index c80a0af36..f23f4ce49 100644 --- a/binary/pkgJson/linux-x64/package.json +++ b/binary/pkgJson/linux-x64/package.json @@ -11,6 +11,7 @@ "../../../core/node_modules/sqlite3/**/*", "../../out/tree-sitter.wasm", "../../out/tree-sitter-wasms/*", + "../../tree-sitter/**/*", "../../out/llamaTokenizer.mjs", "../../out/llamaTokenizerWorkerPool.mjs", "../../out/tiktokenWorkerPool.mjs", diff --git a/binary/pkgJson/win32-arm64/package.json b/binary/pkgJson/win32-arm64/package.json index 0aceefbe2..6134fb8fe 100644 --- a/binary/pkgJson/win32-arm64/package.json +++ b/binary/pkgJson/win32-arm64/package.json @@ -11,6 +11,7 @@ "../../../core/node_modules/sqlite3/**/*", "../../out/tree-sitter.wasm", "../../out/tree-sitter-wasms/*", + "../../tree-sitter/**/*", "../../node_modules/win-ca/lib/crypt32-ia32.node", "../../node_modules/win-ca/lib/crypt32-x64.node", "../../node_modules/win-ca/lib/roots.exe", diff --git a/binary/pkgJson/win32-x64/package.json b/binary/pkgJson/win32-x64/package.json index 71de49f1c..be714529a 100644 --- a/binary/pkgJson/win32-x64/package.json +++ b/binary/pkgJson/win32-x64/package.json @@ -11,6 +11,7 @@ "../../../core/node_modules/sqlite3/**/*", "../../out/tree-sitter.wasm", "../../out/tree-sitter-wasms/*", + "../../tree-sitter/**/*", "../../node_modules/win-ca/lib/crypt32-ia32.node", "../../node_modules/win-ca/lib/crypt32-x64.node", "../../node_modules/win-ca/lib/roots.exe", From a780297819cf7d02d4e11c5a4c9b7aaf857200fd Mon Sep 17 00:00:00 2001 From: Jakub Blach Date: Thu, 10 Jul 2025 18:18:58 +0200 Subject: [PATCH 35/36] fix: Don't mark autocompletion inlay rendering as write operation We only have rendering here. Actual write happens in `accept`. --- .../autocomplete/AutocompleteService.kt | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteService.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteService.kt index f4c3fd67f..4a84a202b 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteService.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteService.kt @@ -185,18 +185,17 @@ class AutocompleteService(private val project: Project) { return } - ApplicationManager.getApplication().invokeLater { - WriteAction.run { - // Clear existing completions - hideCompletions(editor) + invokeLater { + // Clear existing completions + hideCompletions(editor) - val properties = InlayProperties() - properties.relatesToPrecedingText(true) - properties.disableSoftWrapping(true) + val properties = InlayProperties() + properties.relatesToPrecedingText(true) + properties.disableSoftWrapping(true) - val lines = completion.lines() - pendingCompletion = pendingCompletion?.copy(text = lines.joinToString("\n")) - editor.addInlayElement(lines, offset, properties) + val lines = completion.lines() + pendingCompletion = pendingCompletion?.copy(text = lines.joinToString("\n")) + editor.addInlayElement(lines, offset, properties) // val attributes = TextAttributes().apply { // backgroundColor = JBColor.GREEN @@ -204,7 +203,6 @@ class AutocompleteService(private val project: Project) { // val key = TextAttributesKey.createTextAttributesKey("CONTINUE_AUTOCOMPLETE") // key.let { editor.colorsScheme.setAttributes(it, attributes) } // editor.markupModel.addLineHighlighter(key, editor.caretModel.logicalPosition.line, HighlighterLayer.LAST) - } } } From 9fe950ad279adf6d40a7f9c332b1dcbf6c6a6d33 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Thu, 10 Jul 2025 11:01:03 -0700 Subject: [PATCH 36/36] tool delta streaming for bedrock openai --- packages/openai-adapters/src/apis/Bedrock.ts | 65 +++++++++----------- 1 file changed, 28 insertions(+), 37 deletions(-) diff --git a/packages/openai-adapters/src/apis/Bedrock.ts b/packages/openai-adapters/src/apis/Bedrock.ts index 2a580456a..ce9fcb933 100644 --- a/packages/openai-adapters/src/apis/Bedrock.ts +++ b/packages/openai-adapters/src/apis/Bedrock.ts @@ -1,6 +1,7 @@ import { BedrockRuntimeClient, ContentBlock, + ContentBlockStart, ConversationRole, ConverseStreamCommand, ConverseStreamCommandInput, @@ -57,8 +58,6 @@ interface ToolUseState { } export class BedrockApi implements BaseLlmApi { - private _currentToolResponse: Partial | null = null; - constructor(protected config: BedrockConfig) { if (config.env?.accessKeyId || config?.env?.secretAccessKey) { if (!config.env?.accessKeyId) { @@ -455,8 +454,6 @@ export class BedrockApi implements BaseLlmApi { throw new Error("No stream received from Bedrock API"); } - this._currentToolResponse = null; - for await (const chunk of response.stream) { if (chunk.contentBlockDelta?.delta) { const delta: any = chunk.contentBlockDelta.delta; @@ -479,56 +476,50 @@ export class BedrockApi implements BaseLlmApi { } // Handle tool use - if (delta.toolUse?.input && this._currentToolResponse) { - if (this._currentToolResponse.input === undefined) { - this._currentToolResponse.input = ""; - } - this._currentToolResponse.input += delta.toolUse.input; - continue; - } - } - - if (chunk.contentBlockStart?.start) { - const start: any = chunk.contentBlockStart.start; - - // Handle tool start - const toolUse = start.toolUse; - if (toolUse?.toolUseId && toolUse?.name) { - this._currentToolResponse = { - toolUseId: toolUse.toolUseId, - name: toolUse.name, - input: "", - }; - } - continue; - } - - if (chunk.contentBlockStop) { - // End of a content block - if (this._currentToolResponse) { + if (delta.toolUse) { yield chatChunkFromDelta({ model: body.model, delta: { tool_calls: [ { index: 0, - id: this._currentToolResponse.toolUseId, + id: delta.toolUse.toolUseId, type: "function", function: { - name: this._currentToolResponse.name, - arguments: this._currentToolResponse.input, + name: delta.toolUse.name, + arguments: delta.toolUse.input, + }, + }, + ], + }, + }); + } + } + + if (chunk.contentBlockStart?.start) { + const start: ContentBlockStart = chunk.contentBlockStart.start; + + if (start.toolUse) { + yield chatChunkFromDelta({ + model: body.model, + delta: { + tool_calls: [ + { + index: 0, + id: start.toolUse.toolUseId, + type: "function", + function: { + name: start.toolUse.name, + arguments: undefined, }, }, ], }, }); - this._currentToolResponse = null; } - continue; } } } catch (error) { - this._currentToolResponse = null; if (error instanceof Error) { if ("code" in error) { throw new Error(