down to duplicates
This commit is contained in:
parent
03e7d5d1e9
commit
edbf7d0b00
5 changed files with 29 additions and 10 deletions
|
|
@ -230,6 +230,7 @@ export default async function doLoadConfig(
|
|||
newConfig,
|
||||
controlPlaneProxyInfo,
|
||||
);
|
||||
debugger;
|
||||
|
||||
return { config: newConfig, errors, configLoadInterrupted: false };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -142,6 +142,7 @@ function testLLM(
|
|||
type: "function",
|
||||
wouldLikeTo: "Say hello",
|
||||
readonly: true,
|
||||
group: "Hello",
|
||||
},
|
||||
],
|
||||
toolChoice: {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ function ToolDropdownItem(props: ToolDropdownItemProps) {
|
|||
|
||||
return (
|
||||
<div
|
||||
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"
|
||||
className="text-vsc-foreground flex cursor-pointer items-center justify-between gap-2 py-1 text-left text-xs brightness-75 hover:brightness-125"
|
||||
onClick={(e) => {
|
||||
dispatch(toggleToolSetting(props.tool.function.name));
|
||||
e.stopPropagation();
|
||||
|
|
@ -69,7 +69,7 @@ function ToolDropdownItem(props: ToolDropdownItemProps) {
|
|||
className="h-4 w-4"
|
||||
/>
|
||||
)}
|
||||
{props.tool.displayTitle}{" "}
|
||||
{props.tool.function.name}{" "}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex cursor-pointer gap-2">
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { Tool } from "core";
|
||||
import { useMemo } from "react";
|
||||
import { useAppSelector } from "../../../redux/hooks";
|
||||
import InfoHover from "../../InfoHover";
|
||||
|
|
@ -6,6 +7,17 @@ import ToolDropdownItem from "./ToolDropdownItem";
|
|||
const ToolPermissionsDialog = () => {
|
||||
const availableTools = useAppSelector((state) => state.config.config.tools);
|
||||
|
||||
const toolsByGroup = useMemo(() => {
|
||||
const byGroup: Record<string, Tool[]> = {};
|
||||
for (const tool of availableTools) {
|
||||
if (!byGroup[tool.group]) {
|
||||
byGroup[tool.group] = [];
|
||||
}
|
||||
byGroup[tool.group].push(tool);
|
||||
}
|
||||
return Object.entries(byGroup);
|
||||
}, [availableTools]);
|
||||
|
||||
// Detect duplicate tool names
|
||||
const duplicateDetection = useMemo(() => {
|
||||
const counts: Record<string, number> = {};
|
||||
|
|
@ -48,13 +60,18 @@ const ToolPermissionsDialog = () => {
|
|||
}
|
||||
/>
|
||||
</div>
|
||||
<div className="max-h-72 overflow-y-auto pr-2">
|
||||
{availableTools.map((tool) => (
|
||||
<ToolDropdownItem
|
||||
key={tool.uri + tool.function.name}
|
||||
tool={tool}
|
||||
duplicatesDetected={duplicateDetection[tool.function.name]}
|
||||
/>
|
||||
<div className="flex max-h-72 flex-col gap-2 divide-y divide-zinc-700 overflow-y-auto px-2">
|
||||
{toolsByGroup.map(([groupName, tools]) => (
|
||||
<div key={groupName} className="flex flex-col gap-1">
|
||||
<h3 className="m-0 p-0 text-sm">{groupName}</h3>
|
||||
{tools.map((tool) => (
|
||||
<ToolDropdownItem
|
||||
key={tool.uri + tool.function.name}
|
||||
tool={tool}
|
||||
duplicatesDetected={duplicateDetection[tool.function.name]}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ function MCPServerPreview({ server }: MCPServerStatusProps) {
|
|||
|
||||
return (
|
||||
<div className="flex flex-col gap-1.5 pb-4">
|
||||
<h3 className="m-0 mb-1 text-base">{server.name}</h3>
|
||||
<h3 className="m-0 mb-1 text-xs sm:text-sm">{server.name}</h3>
|
||||
<div className="flex flex-row items-center justify-between gap-3">
|
||||
<div className="flex flex-row items-center gap-2">
|
||||
{server.status === "not-connected" ? (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue