Changesets · Branches · Tags · Compare
| Changeset | 6d82571f343fd116549140e5b66af7f58af6f1cee98893075dac09e5bd033ccc |
|---|---|
| Author | Dallin Romney <dallinromney@gmail.com> · 2025-07-02 11:29 -07:00 |
| Committer | GitHub <noreply@github.com> · 2025-07-02 11:29 -07:00 |
| Parents | 579e987b4d40, 85def0438284 |
10 files changed
modified core/tools/builtIn.ts +17 −17
| @@ -1,23 +1,23 @@ | ||
| 1 | 1 | export enum BuiltInToolNames { |
| 2 | - ReadFile = "builtin_read_file", | |
| 3 | - EditExistingFile = "builtin_edit_existing_file", | |
| 4 | - SearchAndReplaceInFile = "builtin_search_and_replace_in_file", | |
| 5 | - ReadCurrentlyOpenFile = "builtin_read_currently_open_file", | |
| 6 | - CreateNewFile = "builtin_create_new_file", | |
| 7 | - RunTerminalCommand = "builtin_run_terminal_command", | |
| 8 | - GrepSearch = "builtin_grep_search", | |
| 9 | - FileGlobSearch = "builtin_file_glob_search", | |
| 10 | - SearchWeb = "builtin_search_web", | |
| 11 | - ViewDiff = "builtin_view_diff", | |
| 12 | - LSTool = "builtin_ls", | |
| 13 | - CreateRuleBlock = "builtin_create_rule_block", | |
| 14 | - RequestRule = "builtin_request_rule", | |
| 15 | - FetchUrlContent = "builtin_fetch_url_content", | |
| 16 | - CodebaseTool = "builtin_codebase", | |
| 2 | + ReadFile = "read_file", | |
| 3 | + EditExistingFile = "edit_existing_file", | |
| 4 | + SearchAndReplaceInFile = "search_and_replace_in_file", | |
| 5 | + ReadCurrentlyOpenFile = "read_currently_open_file", | |
| 6 | + CreateNewFile = "create_new_file", | |
| 7 | + RunTerminalCommand = "run_terminal_command", | |
| 8 | + GrepSearch = "grep_search", | |
| 9 | + FileGlobSearch = "file_glob_search", | |
| 10 | + SearchWeb = "search_web", | |
| 11 | + ViewDiff = "view_diff", | |
| 12 | + LSTool = "ls", | |
| 13 | + CreateRuleBlock = "create_rule_block", | |
| 14 | + RequestRule = "request_rule", | |
| 15 | + FetchUrlContent = "fetch_url_content", | |
| 16 | + CodebaseTool = "codebase", | |
| 17 | 17 | |
| 18 | 18 | // excluded from allTools for now |
| 19 | - ViewRepoMap = "builtin_view_repo_map", | |
| 20 | - ViewSubdirectory = "builtin_view_subdirectory", | |
| 19 | + ViewRepoMap = "view_repo_map", | |
| 20 | + ViewSubdirectory = "view_subdirectory", | |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | export const BUILT_IN_GROUP_NAME = "Built-In"; |
modified docs/docs/agent/how-it-works.md +9 −11
| @@ -28,14 +28,12 @@ | ||
| 28 | 28 | |
| 29 | 29 | Continue includes several built-in tools which provide the model access to IDE functionality: |
| 30 | 30 | |
| 31 | -- **Read file** (`builtin_read_file`): read the contents of a file within the project | |
| 32 | -- **Read currently open file** (`builtin_read_currently_open_file`): read the contents of the currently open file | |
| 33 | -- **Create new file** (`builtin_create_new_file`): Create a new file within the project, with path and contents specified by the model | |
| 34 | -- **Exact search** (`builtin_exact_search`): perform a `ripgrep` search within the project | |
| 35 | -- **Glob search** (`builtin_file_glob_search`): perform a glob search on files in the project. Currently limits to 100 output and warns the Agent if limit reached. | |
| 36 | -- **Run terminal command** (`builtin_run_terminal_command`): run a terminal command from the workspace root | |
| 37 | -- **Search web** (`builtin_search_web`): Perform a web search to get top results | |
| 38 | -- **View diff** (`builtin_view_diff`): View the current working git diff | |
| 39 | -- **View repo map** (`builtin_view_repo_map`): request a copy of the repository map—same as the [Repo Map Context Provider](../customize/context-providers.mdx#repository-map) | |
| 40 | -- **View subdirectory** (`builtin_view_subdirectory`): request a copy of a repo map for a specific directory within the project | |
| 41 | -- **Create Rule Block** (`builtin_create_rule_block`): creates a new rule block in `.continue/rules` based on the contents of the conversation | |
| 31 | +- **Read file** (`read_file`): read the contents of a file within the project | |
| 32 | +- **Read currently open file** (`read_currently_open_file`): read the contents of the currently open file | |
| 33 | +- **Create new file** (`create_new_file`): Create a new file within the project, with path and contents specified by the model | |
| 34 | +- **Exact search** (`exact_search`): perform a `ripgrep` search within the project | |
| 35 | +- **Glob search** (`file_glob_search`): perform a glob search on files in the project. Currently limits to 100 output and warns the Agent if limit reached. | |
| 36 | +- **Run terminal command** (`run_terminal_command`): run a terminal command from the workspace root | |
| 37 | +- **Search web** (`search_web`): Perform a web search to get top results | |
| 38 | +- **View diff** (`view_diff`): View the current working git diff | |
| 39 | +- **Create Rule Block** (`create_rule_block`): creates a new rule block in `.continue/rules` based on the contents of the conversation |
modified docs/docs/customize/deep-dives/rules.mdx +1 −1
| @@ -48,7 +48,7 @@ | ||
| 48 | 48 |  |
| 49 | 49 | |
| 50 | 50 | :::info Automatically create local rule blocks |
| 51 | -When in Agent mode, you can prompt the agent to create a rule for you using the `builtin_create_rule_block` tool if enabled. | |
| 51 | +When in Agent mode, you can prompt the agent to create a rule for you using the `create_rule_block` tool if enabled. | |
| 52 | 52 | |
| 53 | 53 | For example, you can say "Create a rule for this", and a rule will be created for you in `.continue/rules` based on your conversation. |
| 54 | 54 | ::: |
modified extensions/vscode/e2e/test-continue-yaml/config.yaml +1 −1
| @@ -37,7 +37,7 @@ | ||
| 37 | 37 | - id: test_id |
| 38 | 38 | type: function |
| 39 | 39 | function: |
| 40 | - name: builtin_view_diff | |
| 40 | + name: view_diff | |
| 41 | 41 | - REPEAT_LAST_MSG |
| 42 | 42 | roles: |
| 43 | 43 | - chat |
modified extensions/vscode/e2e/test-continue/config.json +1 −1
| @@ -36,7 +36,7 @@ | ||
| 36 | 36 | "id": "test_id", |
| 37 | 37 | "type": "function", |
| 38 | 38 | "function": { |
| 39 | - "name": "builtin_view_diff" | |
| 39 | + "name": "view_diff" | |
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | ] |
modified extensions/vscode/e2e/tests/GUI.test.ts +2 −2
| @@ -304,7 +304,7 @@ | ||
| 304 | 304 | }).timeout(DEFAULT_TIMEOUT.MD * 100); |
| 305 | 305 | |
| 306 | 306 | it("should call tool after approval", async () => { |
| 307 | - await GUIActions.toggleToolPolicy(view, "builtin_view_diff", 2); | |
| 307 | + await GUIActions.toggleToolPolicy(view, "view_diff", 2); | |
| 308 | 308 | |
| 309 | 309 | const [messageInput] = await GUISelectors.getMessageInputFields(view); |
| 310 | 310 | await messageInput.sendKeys("Hello"); |
| @@ -325,7 +325,7 @@ | ||
| 325 | 325 | }).timeout(DEFAULT_TIMEOUT.XL); |
| 326 | 326 | |
| 327 | 327 | it("should cancel tool", async () => { |
| 328 | - await GUIActions.toggleToolPolicy(view, "builtin_view_diff", 2); | |
| 328 | + await GUIActions.toggleToolPolicy(view, "view_diff", 2); | |
| 329 | 329 | |
| 330 | 330 | const [messageInput] = await GUISelectors.getMessageInputFields(view); |
| 331 | 331 | await messageInput.sendKeys("Hello"); |
modified gui/src/hooks/ParallelListeners.tsx +5 −0
| @@ -38,6 +38,7 @@ | ||
| 38 | 38 | } from "../styles/theme"; |
| 39 | 39 | import { isJetBrains } from "../util"; |
| 40 | 40 | import { setLocalStorage } from "../util/localStorage"; |
| 41 | +import { migrateLocalStorage } from "../util/migrateLocalStorage"; | |
| 41 | 42 | import { useWebviewListener } from "./useWebviewListener"; |
| 42 | 43 | |
| 43 | 44 | function ParallelListeners() { |
| @@ -310,6 +311,10 @@ | ||
| 310 | 311 | } |
| 311 | 312 | }, [isInEdit, history]); |
| 312 | 313 | |
| 314 | + useEffect(() => { | |
| 315 | + migrateLocalStorage(dispatch); | |
| 316 | + }, []); | |
| 317 | + | |
| 313 | 318 | return <></>; |
| 314 | 319 | } |
| 315 | 320 |
modified gui/src/pages/gui/ToolCallDiv/index.tsx +3 −3
| @@ -46,9 +46,9 @@ | ||
| 46 | 46 | [BuiltInToolNames.ViewRepoMap]: MapIcon, |
| 47 | 47 | [BuiltInToolNames.ViewSubdirectory]: FolderOpenIcon, |
| 48 | 48 | [BuiltInToolNames.CreateRuleBlock]: PencilIcon, |
| 49 | - // EditExistingFile = "builtin_edit_existing_file", | |
| 50 | - // CreateNewFile = "builtin_create_new_file", | |
| 51 | - // RunTerminalCommand = "builtin_run_terminal_command", | |
| 49 | + // EditExistingFile | |
| 50 | + // CreateNewFile | |
| 51 | + // RunTerminalCommand | |
| 52 | 52 | }; |
| 53 | 53 | |
| 54 | 54 | function getStatusIcon(state: ToolStatus) { |
modified gui/src/redux/slices/uiSlice.ts +14 −0
| @@ -106,6 +106,18 @@ | ||
| 106 | 106 | state.toolSettings[action.payload.function.name] = |
| 107 | 107 | "allowedWithPermission"; |
| 108 | 108 | }, |
| 109 | + setToolPolicy: ( | |
| 110 | + state, | |
| 111 | + action: PayloadAction<{ | |
| 112 | + toolName: string; | |
| 113 | + policy: ToolPolicy; | |
| 114 | + }>, | |
| 115 | + ) => { | |
| 116 | + state.toolSettings[action.payload.toolName] = action.payload.policy; | |
| 117 | + }, | |
| 118 | + clearToolPolicy: (state, action: PayloadAction<string>) => { | |
| 119 | + delete state.toolSettings[action.payload]; | |
| 120 | + }, | |
| 109 | 121 | toggleToolSetting: (state, action: PayloadAction<string>) => { |
| 110 | 122 | const setting = state.toolSettings[action.payload]; |
| 111 | 123 | |
| @@ -166,6 +178,8 @@ | ||
| 166 | 178 | setIsExploreDialogOpen, |
| 167 | 179 | setHasDismissedExploreDialog, |
| 168 | 180 | toggleToolSetting, |
| 181 | + setToolPolicy, | |
| 182 | + clearToolPolicy, | |
| 169 | 183 | toggleToolGroupSetting, |
| 170 | 184 | addTool, |
| 171 | 185 | addRule, |
added gui/src/util/migrateLocalStorage.ts +74 −0
| @@ -0,0 +1,74 @@ | ||
| 1 | +import { BuiltInToolNames } from "core/tools/builtIn"; | |
| 2 | +import { | |
| 3 | + clearToolPolicy, | |
| 4 | + setToolPolicy, | |
| 5 | + ToolPolicy, | |
| 6 | +} from "../redux/slices/uiSlice"; | |
| 7 | +import { AppDispatch } from "../redux/store"; | |
| 8 | + | |
| 9 | +const validPolicyValues: ToolPolicy[] = [ | |
| 10 | + "allowedWithPermission", | |
| 11 | + "allowedWithoutPermission", | |
| 12 | + "disabled", | |
| 13 | +]; | |
| 14 | +function migrateToolPolicies(dispatch: AppDispatch) { | |
| 15 | + const toFromMap: Record<string, string[]> = { | |
| 16 | + [BuiltInToolNames.ReadFile]: ["builtin_read_file"], | |
| 17 | + [BuiltInToolNames.EditExistingFile]: ["builtin_edit_existing_file"], | |
| 18 | + [BuiltInToolNames.SearchAndReplaceInFile]: [ | |
| 19 | + "builtin_search_and_replace_in_file", | |
| 20 | + ], | |
| 21 | + [BuiltInToolNames.ReadCurrentlyOpenFile]: [ | |
| 22 | + "builtin_read_currently_open_file", | |
| 23 | + ], | |
| 24 | + [BuiltInToolNames.CreateNewFile]: ["builtin_create_new_file"], | |
| 25 | + [BuiltInToolNames.RunTerminalCommand]: ["builtin_run_terminal_command"], | |
| 26 | + [BuiltInToolNames.GrepSearch]: ["builtin_grep_search"], | |
| 27 | + [BuiltInToolNames.FileGlobSearch]: ["builtin_file_glob_search"], | |
| 28 | + [BuiltInToolNames.SearchWeb]: ["builtin_search_web"], | |
| 29 | + [BuiltInToolNames.ViewDiff]: ["builtin_view_diff"], | |
| 30 | + [BuiltInToolNames.LSTool]: ["builtin_ls"], | |
| 31 | + [BuiltInToolNames.CreateRuleBlock]: ["builtin_create_rule_block"], | |
| 32 | + [BuiltInToolNames.RequestRule]: ["builtin_request_rule"], | |
| 33 | + [BuiltInToolNames.FetchUrlContent]: ["builtin_fetch_url_content"], | |
| 34 | + [BuiltInToolNames.CodebaseTool]: ["builtin_codebase"], | |
| 35 | + [BuiltInToolNames.ViewRepoMap]: ["builtin_view_repo_map"], | |
| 36 | + [BuiltInToolNames.ViewSubdirectory]: ["builtin_view_subdirectory"], | |
| 37 | + }; | |
| 38 | + const persistedRedux = localStorage.getItem("persist:root"); | |
| 39 | + if (persistedRedux) { | |
| 40 | + const uiState = JSON.parse(persistedRedux)?.ui; | |
| 41 | + if (uiState) { | |
| 42 | + const parsedSettings = JSON.parse(uiState)?.toolSettings; | |
| 43 | + if (parsedSettings) { | |
| 44 | + let migratedToolSettings = 0; | |
| 45 | + Object.entries(toFromMap).forEach(([newToolName, oldToolNames]) => { | |
| 46 | + for (const tool of oldToolNames) { | |
| 47 | + if ( | |
| 48 | + tool in parsedSettings && | |
| 49 | + validPolicyValues.includes(parsedSettings[tool]) | |
| 50 | + ) { | |
| 51 | + dispatch( | |
| 52 | + setToolPolicy({ | |
| 53 | + toolName: newToolName, | |
| 54 | + policy: parsedSettings[tool], | |
| 55 | + }), | |
| 56 | + ); | |
| 57 | + dispatch(clearToolPolicy(tool)); | |
| 58 | + migratedToolSettings++; | |
| 59 | + } | |
| 60 | + } | |
| 61 | + }); | |
| 62 | + if (migratedToolSettings > 0) { | |
| 63 | + console.log( | |
| 64 | + `Migrated ${migratedToolSettings} tool policies successfully.`, | |
| 65 | + ); | |
| 66 | + } | |
| 67 | + } | |
| 68 | + } | |
| 69 | + } | |
| 70 | +} | |
| 71 | + | |
| 72 | +export function migrateLocalStorage(dispatch: AppDispatch) { | |
| 73 | + migrateToolPolicies(dispatch); | |
| 74 | +} |