Compare commits

...

1 Commits

Author SHA1 Message Date
Ashwin Bhat
8cd1dc7dd4 fix resource reading type error 2024-10-15 14:58:48 -07:00
2 changed files with 6 additions and 9 deletions

View File

@@ -7,6 +7,7 @@ import {
ReadResourceResultSchema,
CallToolResultSchema,
ListPromptsResultSchema,
Resource,
Tool,
ClientRequest,
} from "mcp-typescript/types.js";
@@ -34,7 +35,7 @@ import {
import ConsoleTab from "./components/ConsoleTab";
import Sidebar from "./components/Sidebar";
import RequestsTab from "./components/RequestsTabs";
import ResourcesTab, { Resource } from "./components/ResourcesTab";
import ResourcesTab from "./components/ResourcesTab";
import NotificationsTab from "./components/NotificationsTab";
import PromptsTab, { Prompt } from "./components/PromptsTab";
import ToolsTab from "./components/ToolsTab";
@@ -108,7 +109,7 @@ const App = () => {
}
};
const readResource = async (uri: string) => {
const readResource = async (uri: URL) => {
const response = await makeRequest(
{
method: "resources/read" as const,

View File

@@ -2,13 +2,9 @@ import { FileText, ChevronRight, AlertCircle, RefreshCw } from "lucide-react";
import { Button } from "@/components/ui/button";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import { TabsContent } from "@/components/ui/tabs";
import { Resource } from "mcp-typescript/types.js";
import ListPane from "./ListPane";
export type Resource = {
uri: string;
name: string;
};
const ResourcesTab = ({
resources,
listResources,
@@ -20,7 +16,7 @@ const ResourcesTab = ({
}: {
resources: Resource[];
listResources: () => void;
readResource: (uri: string) => void;
readResource: (uri: URL) => void;
selectedResource: Resource | null;
setSelectedResource: (resource: Resource) => void;
resourceContent: string;
@@ -37,7 +33,7 @@ const ResourcesTab = ({
renderItem={(resource) => (
<div className="flex items-center w-full">
<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}
</span>
<ChevronRight className="w-4 h-4 flex-shrink-0 text-gray-400" />