Incorporate MCP changes (#93)

Co-authored-by: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com>
This commit is contained in:
Matt Rubens
2024-12-12 23:16:39 -05:00
committed by GitHub
parent f08c3c7736
commit be3d8a6166
30 changed files with 3878 additions and 3037 deletions

View File

@@ -0,0 +1,59 @@
import { McpResource, McpResourceTemplate } from "../../../../src/shared/mcp"
type McpResourceRowProps = {
item: McpResource | McpResourceTemplate
}
const McpResourceRow = ({ item }: McpResourceRowProps) => {
const hasUri = "uri" in item
const uri = hasUri ? item.uri : item.uriTemplate
return (
<div
key={uri}
style={{
padding: "3px 0",
}}>
<div
style={{
display: "flex",
alignItems: "center",
marginBottom: "4px",
}}>
<span className={`codicon codicon-symbol-file`} style={{ marginRight: "6px" }} />
<span style={{ fontWeight: 500, wordBreak: "break-all" }}>{uri}</span>
</div>
<div
style={{
fontSize: "12px",
opacity: 0.8,
margin: "4px 0",
}}>
{item.name && item.description
? `${item.name}: ${item.description}`
: !item.name && item.description
? item.description
: !item.description && item.name
? item.name
: "No description"}
</div>
<div
style={{
fontSize: "12px",
}}>
<span style={{ opacity: 0.8 }}>Returns </span>
<code
style={{
color: "var(--vscode-textPreformat-foreground)",
background: "var(--vscode-textPreformat-background)",
padding: "1px 4px",
borderRadius: "3px",
}}>
{item.mimeType || "Unknown"}
</code>
</div>
</div>
)
}
export default McpResourceRow