tool groupe name

This commit is contained in:
Dallin Romney 2025-03-21 11:35:38 -07:00
parent c4ab5a2f22
commit 03e7d5d1e9
13 changed files with 32 additions and 19 deletions

View file

@ -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);

1
core/index.d.ts vendored
View file

@ -912,6 +912,7 @@ export interface Tool {
readonly: boolean;
uri?: string;
faviconUrl?: string;
group: string;
}
interface ToolChoice {

View file

@ -8,4 +8,5 @@ export enum BuiltInToolNames {
ExactSearch = "builtin_exact_search",
SearchWeb = "builtin_search_web",
ViewDiff = "builtin_view_diff",
}
}
export const BUILT_IN_GROUP_NAME = "Built-In";

View file

@ -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,

View file

@ -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.",

View file

@ -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:

View file

@ -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:

View file

@ -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:

View file

@ -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:

View file

@ -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",

View file

@ -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",

View file

@ -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",

View file

@ -29,21 +29,22 @@ function ToolDropdownItem(props: ToolDropdownItemProps) {
return (
<div
className="text-vsc-foreground flex w-full cursor-pointer items-center justify-between gap-2 px-2 py-1 text-left text-xs brightness-75 hover:brightness-125"
className="text-vsc-foreground flex cursor-pointer items-center justify-between gap-2 py-1 pl-2 pr-1 text-left text-xs brightness-75 hover:brightness-125"
onClick={(e) => {
dispatch(toggleToolSetting(props.tool.function.name));
e.stopPropagation();
e.preventDefault();
}}
>
<div className="flex flex-row items-center gap-2">
<div className="flex flex-1 flex-row items-center gap-1">
{props.duplicatesDetected ? (
<>
<InformationCircleIcon
data-tooltip-id={props.tool.displayTitle + "-duplicate-warning"}
className="h-4 w-4 cursor-help text-yellow-500"
/>
<div>
<InformationCircleIcon
data-tooltip-id={props.tool.displayTitle + "-duplicate-warning"}
className="h-3 w-3 cursor-help text-yellow-500"
/>
</div>
<ToolTip
id={props.tool.displayTitle + "-duplicate-warning"}
place="bottom"
@ -60,7 +61,7 @@ function ToolDropdownItem(props: ToolDropdownItemProps) {
</ToolTip>
</>
) : null}
<span className="flex items-center gap-1">
<span className="lines lines-1 flex items-center gap-1">
{props.tool.faviconUrl && (
<img
src={props.tool.faviconUrl}
@ -71,7 +72,7 @@ function ToolDropdownItem(props: ToolDropdownItemProps) {
{props.tool.displayTitle}{" "}
</span>
</div>
<div className="flex cursor-pointer gap-2 pr-4">
<div className="flex cursor-pointer gap-2">
{(settings === "allowedWithPermission" || settings === undefined) && (
<span className="text-yellow-500">Allowed</span>
)}