Compare commits
1 Commits
main
...
ashwin/res
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8cd1dc7dd4 |
@@ -7,6 +7,7 @@ import {
|
|||||||
ReadResourceResultSchema,
|
ReadResourceResultSchema,
|
||||||
CallToolResultSchema,
|
CallToolResultSchema,
|
||||||
ListPromptsResultSchema,
|
ListPromptsResultSchema,
|
||||||
|
Resource,
|
||||||
Tool,
|
Tool,
|
||||||
ClientRequest,
|
ClientRequest,
|
||||||
} from "mcp-typescript/types.js";
|
} from "mcp-typescript/types.js";
|
||||||
@@ -34,7 +35,7 @@ import {
|
|||||||
import ConsoleTab from "./components/ConsoleTab";
|
import ConsoleTab from "./components/ConsoleTab";
|
||||||
import Sidebar from "./components/Sidebar";
|
import Sidebar from "./components/Sidebar";
|
||||||
import RequestsTab from "./components/RequestsTabs";
|
import RequestsTab from "./components/RequestsTabs";
|
||||||
import ResourcesTab, { Resource } from "./components/ResourcesTab";
|
import ResourcesTab from "./components/ResourcesTab";
|
||||||
import NotificationsTab from "./components/NotificationsTab";
|
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";
|
||||||
@@ -108,7 +109,7 @@ const App = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const readResource = async (uri: string) => {
|
const readResource = async (uri: URL) => {
|
||||||
const response = await makeRequest(
|
const response = await makeRequest(
|
||||||
{
|
{
|
||||||
method: "resources/read" as const,
|
method: "resources/read" as const,
|
||||||
|
|||||||
@@ -2,13 +2,9 @@ import { FileText, ChevronRight, AlertCircle, RefreshCw } from "lucide-react";
|
|||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
||||||
import { TabsContent } from "@/components/ui/tabs";
|
import { TabsContent } from "@/components/ui/tabs";
|
||||||
|
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,
|
||||||
@@ -20,7 +16,7 @@ const ResourcesTab = ({
|
|||||||
}: {
|
}: {
|
||||||
resources: Resource[];
|
resources: Resource[];
|
||||||
listResources: () => void;
|
listResources: () => void;
|
||||||
readResource: (uri: string) => void;
|
readResource: (uri: URL) => void;
|
||||||
selectedResource: Resource | null;
|
selectedResource: Resource | null;
|
||||||
setSelectedResource: (resource: Resource) => void;
|
setSelectedResource: (resource: Resource) => void;
|
||||||
resourceContent: string;
|
resourceContent: string;
|
||||||
@@ -37,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" />
|
||||||
|
|||||||
Reference in New Issue
Block a user