fix type errors
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,3 +3,4 @@ node_modules
|
|||||||
server/build
|
server/build
|
||||||
client/dist
|
client/dist
|
||||||
client/tsconfig.app.tsbuildinfo
|
client/tsconfig.app.tsbuildinfo
|
||||||
|
client/tsconfig.node.tsbuildinfo
|
||||||
|
|||||||
@@ -22,7 +22,8 @@
|
|||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-dom": "^18.3.1",
|
"react-dom": "^18.3.1",
|
||||||
"tailwind-merge": "^2.5.3",
|
"tailwind-merge": "^2.5.3",
|
||||||
"tailwindcss-animate": "^1.0.7"
|
"tailwindcss-animate": "^1.0.7",
|
||||||
|
"zod": "^3.23.8"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "^9.11.1",
|
"@eslint/js": "^9.11.1",
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ import NotificationsTab from "./components/NotificationsTab";
|
|||||||
import PromptsTab, { Prompt } from "./components/PromptsTab";
|
import PromptsTab, { Prompt } from "./components/PromptsTab";
|
||||||
import ToolsTab from "./components/ToolsTab";
|
import ToolsTab from "./components/ToolsTab";
|
||||||
import History from "./components/History";
|
import History from "./components/History";
|
||||||
import { AnyZodObject } from "node_modules/zod/lib";
|
import { AnyZodObject } from "zod";
|
||||||
|
|
||||||
const App = () => {
|
const App = () => {
|
||||||
const [connectionStatus, setConnectionStatus] = useState<
|
const [connectionStatus, setConnectionStatus] = useState<
|
||||||
|
|||||||
@@ -5,11 +5,6 @@ import { TabsContent } from "@/components/ui/tabs";
|
|||||||
import { Resource } from "mcp-typescript/types.js";
|
import { Resource } from "mcp-typescript/types.js";
|
||||||
import ListPane from "./ListPane";
|
import ListPane from "./ListPane";
|
||||||
|
|
||||||
export type Resource = {
|
|
||||||
uri: string;
|
|
||||||
name: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
const ResourcesTab = ({
|
const ResourcesTab = ({
|
||||||
resources,
|
resources,
|
||||||
listResources,
|
listResources,
|
||||||
@@ -38,7 +33,7 @@ const ResourcesTab = ({
|
|||||||
renderItem={(resource) => (
|
renderItem={(resource) => (
|
||||||
<div className="flex items-center w-full">
|
<div className="flex items-center w-full">
|
||||||
<FileText className="w-4 h-4 mr-2 flex-shrink-0 text-gray-500" />
|
<FileText className="w-4 h-4 mr-2 flex-shrink-0 text-gray-500" />
|
||||||
<span className="flex-1 truncate" title={resource.uri}>
|
<span className="flex-1 truncate" title={resource.uri.toString()}>
|
||||||
{resource.name}
|
{resource.name}
|
||||||
</span>
|
</span>
|
||||||
<ChevronRight className="w-4 h-4 flex-shrink-0 text-gray-400" />
|
<ChevronRight className="w-4 h-4 flex-shrink-0 text-gray-400" />
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ const ToolsTab = ({
|
|||||||
<p className="text-sm text-gray-600">
|
<p className="text-sm text-gray-600">
|
||||||
{selectedTool.description}
|
{selectedTool.description}
|
||||||
</p>
|
</p>
|
||||||
{Object.entries(selectedTool.inputSchema.properties).map(
|
{Object.entries(selectedTool.inputSchema.properties ?? []).map(
|
||||||
([key, value]) => (
|
([key, value]) => (
|
||||||
<div key={key}>
|
<div key={key}>
|
||||||
<Label
|
<Label
|
||||||
@@ -71,14 +71,17 @@ const ToolsTab = ({
|
|||||||
{key}
|
{key}
|
||||||
</Label>
|
</Label>
|
||||||
<Input
|
<Input
|
||||||
|
// @ts-expect-error value type is currently unknown
|
||||||
type={value.type === "number" ? "number" : "text"}
|
type={value.type === "number" ? "number" : "text"}
|
||||||
id={key}
|
id={key}
|
||||||
name={key}
|
name={key}
|
||||||
|
// @ts-expect-error value type is currently unknown
|
||||||
placeholder={value.description}
|
placeholder={value.description}
|
||||||
onChange={(e) =>
|
onChange={(e) =>
|
||||||
setParams({
|
setParams({
|
||||||
...params,
|
...params,
|
||||||
[key]:
|
[key]:
|
||||||
|
// @ts-expect-error value type is currently unknown
|
||||||
value.type === "number"
|
value.type === "number"
|
||||||
? Number(e.target.value)
|
? Number(e.target.value)
|
||||||
: e.target.value,
|
: e.target.value,
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"root":["./vite.config.ts"],"version":"5.6.2"}
|
{"root":["./vite.config.ts"],"version":"5.6.3"}
|
||||||
Reference in New Issue
Block a user