Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.4.1",
"@radix-ui/react-checkbox": "^1.1.4",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-select": "^2.1.2",
Expand Down
25 changes: 24 additions & 1 deletion client/src/components/ToolsTab.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import { Button } from "@/components/ui/button";
import { Checkbox } from "@/components/ui/checkbox";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { TabsContent } from "@/components/ui/tabs";
Expand Down Expand Up @@ -169,6 +170,28 @@ const ToolsTab = ({
</Label>
{
/* @ts-expect-error value type is currently unknown */
value.type === "boolean" ? (
<div className="flex items-center space-x-2 mt-2">
<Checkbox
id={key}
name={key}
checked={!!params[key]}
onCheckedChange={(checked: boolean) =>
setParams({
...params,
[key]: checked,
})
}
/>
<label
htmlFor={key}
className="text-sm font-medium text-gray-700 dark:text-gray-300"
>
{/* @ts-expect-error value type is currently unknown */}
{value.description || "Toggle this option"}
</label>
</div>
) : /* @ts-expect-error value type is currently unknown */
value.type === "string" ? (
<Textarea
id={key}
Expand Down Expand Up @@ -197,7 +220,7 @@ const ToolsTab = ({
...params,
[key]: parsed,
});
} catch (err) {
} catch {
// If invalid JSON, store as string - will be validated on submit
setParams({
...params,
Expand Down
30 changes: 30 additions & 0 deletions client/src/components/ui/checkbox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"use client";

import * as React from "react";
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
import { Check } from "lucide-react";

import { cn } from "@/lib/utils";

const Checkbox = React.forwardRef<
React.ElementRef<typeof CheckboxPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
>(({ className, ...props }, ref) => (
<CheckboxPrimitive.Root
ref={ref}
className={cn(
"peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
className,
)}
{...props}
>
<CheckboxPrimitive.Indicator
className={cn("flex items-center justify-center text-current")}
>
<Check className="h-4 w-4" />
</CheckboxPrimitive.Indicator>
</CheckboxPrimitive.Root>
));
Checkbox.displayName = CheckboxPrimitive.Root.displayName;

export { Checkbox };
4 changes: 4 additions & 0 deletions client/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}

button[role="checkbox"] {
padding: 0;
}

@media (prefers-color-scheme: light) {
:root {
color: #213547;
Expand Down
129 changes: 123 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"scripts": {
"build": "tsc",
"start": "node build/index.js",
"dev": "node --import tsx --watch --watch-preserve-output src/index.ts"
"dev": "tsx watch --clear-screen=false src/index.ts"
},
"devDependencies": {
"@types/cors": "^2.8.17",
Expand Down
Loading