diff --git a/core/config/profile/doLoadConfig.ts b/core/config/profile/doLoadConfig.ts index 8065718d9..33bdf9b6c 100644 --- a/core/config/profile/doLoadConfig.ts +++ b/core/config/profile/doLoadConfig.ts @@ -134,6 +134,7 @@ export default async function doLoadConfig( type: "function" as const, wouldLikeTo: "", uri: encodeMCPToolUri(server.id, tool.name), + group: server.name, })); newConfig.tools.push(...serverTools); diff --git a/core/index.d.ts b/core/index.d.ts index 6a6614b61..f73fec9ce 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -912,6 +912,7 @@ export interface Tool { readonly: boolean; uri?: string; faviconUrl?: string; + group: string; } interface ToolChoice { diff --git a/core/tools/builtIn.ts b/core/tools/builtIn.ts index d15db456c..268cbb9a8 100644 --- a/core/tools/builtIn.ts +++ b/core/tools/builtIn.ts @@ -8,4 +8,5 @@ export enum BuiltInToolNames { ExactSearch = "builtin_exact_search", SearchWeb = "builtin_search_web", ViewDiff = "builtin_view_diff", -} \ No newline at end of file +} +export const BUILT_IN_GROUP_NAME = "Built-In"; diff --git a/core/tools/definitions/createNewFile.ts b/core/tools/definitions/createNewFile.ts index 7af42d6a8..f932ae87b 100644 --- a/core/tools/definitions/createNewFile.ts +++ b/core/tools/definitions/createNewFile.ts @@ -1,10 +1,11 @@ import { Tool } from "../.."; -import { BuiltInToolNames } from "../builtIn"; +import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn"; export const createNewFileTool: Tool = { type: "function", displayTitle: "Create New File", wouldLikeTo: "create a new file", + group: BUILT_IN_GROUP_NAME, readonly: false, function: { name: BuiltInToolNames.CreateNewFile, diff --git a/core/tools/definitions/exactSearch.ts b/core/tools/definitions/exactSearch.ts index 8358b55da..400adbd9e 100644 --- a/core/tools/definitions/exactSearch.ts +++ b/core/tools/definitions/exactSearch.ts @@ -1,11 +1,12 @@ import { Tool } from "../.."; -import { BuiltInToolNames } from "../builtIn"; +import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn"; export const exactSearchTool: Tool = { type: "function", displayTitle: "Exact Search", wouldLikeTo: 'search for "{{{ query }}}" in the repository', readonly: true, + group: BUILT_IN_GROUP_NAME, function: { name: BuiltInToolNames.ExactSearch, description: "Perform an exact search over the repository using ripgrep.", diff --git a/core/tools/definitions/readCurrentlyOpenFile.ts b/core/tools/definitions/readCurrentlyOpenFile.ts index 5abc2edb1..75a0e8169 100644 --- a/core/tools/definitions/readCurrentlyOpenFile.ts +++ b/core/tools/definitions/readCurrentlyOpenFile.ts @@ -1,11 +1,12 @@ import { Tool } from "../.."; -import { BuiltInToolNames } from "../builtIn"; +import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn"; export const readCurrentlyOpenFileTool: Tool = { type: "function", displayTitle: "Read Currently Open File", wouldLikeTo: "read the current file", readonly: true, + group: BUILT_IN_GROUP_NAME, function: { name: BuiltInToolNames.ReadCurrentlyOpenFile, description: diff --git a/core/tools/definitions/readFile.ts b/core/tools/definitions/readFile.ts index 4f5366e23..53d381e62 100644 --- a/core/tools/definitions/readFile.ts +++ b/core/tools/definitions/readFile.ts @@ -1,11 +1,12 @@ import { Tool } from "../.."; -import { BuiltInToolNames } from "../builtIn"; +import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn"; export const readFileTool: Tool = { type: "function", displayTitle: "Read File", wouldLikeTo: "read {{{ filepath }}}", readonly: true, + group: BUILT_IN_GROUP_NAME, function: { name: BuiltInToolNames.ReadFile, description: diff --git a/core/tools/definitions/runTerminalCommand.ts b/core/tools/definitions/runTerminalCommand.ts index 1b526009a..2b7882167 100644 --- a/core/tools/definitions/runTerminalCommand.ts +++ b/core/tools/definitions/runTerminalCommand.ts @@ -1,11 +1,12 @@ import { Tool } from "../.."; -import { BuiltInToolNames } from "../builtIn"; +import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn"; export const runTerminalCommandTool: Tool = { type: "function", displayTitle: "Run Terminal Command", wouldLikeTo: "run a terminal command", readonly: false, + group: BUILT_IN_GROUP_NAME, function: { name: BuiltInToolNames.RunTerminalCommand, description: diff --git a/core/tools/definitions/searchWeb.ts b/core/tools/definitions/searchWeb.ts index dfbcb04f7..7e2724a7c 100644 --- a/core/tools/definitions/searchWeb.ts +++ b/core/tools/definitions/searchWeb.ts @@ -1,12 +1,13 @@ import { Tool } from "../.."; -import { BuiltInToolNames } from "../builtIn"; +import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn"; export const searchWebTool: Tool = { type: "function", displayTitle: "Search Web", wouldLikeTo: 'search the web for "{{{ query }}}"', readonly: true, + group: BUILT_IN_GROUP_NAME, function: { name: BuiltInToolNames.SearchWeb, description: diff --git a/core/tools/definitions/viewDiff.ts b/core/tools/definitions/viewDiff.ts index e54086d05..3da0c71a9 100644 --- a/core/tools/definitions/viewDiff.ts +++ b/core/tools/definitions/viewDiff.ts @@ -1,12 +1,13 @@ import { Tool } from "../.."; -import { BuiltInToolNames } from "../builtIn"; +import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn"; export const viewDiffTool: Tool = { type: "function", displayTitle: "View Diff", wouldLikeTo: "view a diff", readonly: true, + group: BUILT_IN_GROUP_NAME, function: { name: BuiltInToolNames.ViewDiff, description: "View the current diff of working changes", diff --git a/core/tools/definitions/viewRepoMap.ts b/core/tools/definitions/viewRepoMap.ts index 9cf3d319d..60d671177 100644 --- a/core/tools/definitions/viewRepoMap.ts +++ b/core/tools/definitions/viewRepoMap.ts @@ -1,12 +1,13 @@ import { Tool } from "../.."; -import { BuiltInToolNames } from "../builtIn"; +import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn"; export const viewRepoMapTool: Tool = { type: "function", displayTitle: "View Repo Map", wouldLikeTo: "view the repository map", readonly: true, + group: BUILT_IN_GROUP_NAME, function: { name: BuiltInToolNames.ViewRepoMap, description: "View the repository map", diff --git a/core/tools/definitions/viewSubdirectory.ts b/core/tools/definitions/viewSubdirectory.ts index 70b7524bd..b78daba76 100644 --- a/core/tools/definitions/viewSubdirectory.ts +++ b/core/tools/definitions/viewSubdirectory.ts @@ -1,11 +1,12 @@ import { Tool } from "../.."; -import { BuiltInToolNames } from "../builtIn"; +import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn"; export const viewSubdirectoryTool: Tool = { type: "function", displayTitle: "View Subdirectory", wouldLikeTo: 'view the contents of "{{{ directory_path }}}"', readonly: true, + group: BUILT_IN_GROUP_NAME, function: { name: BuiltInToolNames.ViewSubdirectory, description: "View the contents of a subdirectory", diff --git a/gui/src/components/mainInput/InputToolbar/ToolDropdownItem.tsx b/gui/src/components/mainInput/InputToolbar/ToolDropdownItem.tsx index 64a36c959..c75ea5847 100644 --- a/gui/src/components/mainInput/InputToolbar/ToolDropdownItem.tsx +++ b/gui/src/components/mainInput/InputToolbar/ToolDropdownItem.tsx @@ -29,21 +29,22 @@ function ToolDropdownItem(props: ToolDropdownItemProps) { return (