mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-15 23:31:29 +00:00
fix(ui): accept MCPInfo in mcp_info custom-field helpers to fix build type error
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
30f2eb307a
commit
1908eda531
2 changed files with 3 additions and 3 deletions
|
|
@ -72,7 +72,7 @@ export const MCPServerView: React.FC<MCPServerViewProps> = ({
|
|||
const urlValue = mcpServer.url ?? "";
|
||||
const { maskedUrl, hasToken } = urlValue ? getMaskedAndFullUrl(urlValue) : { maskedUrl: "—", hasToken: false };
|
||||
|
||||
const customMcpInfo = extractCustomMcpInfo(mcpServer.mcp_info as Record<string, unknown> | null | undefined);
|
||||
const customMcpInfo = extractCustomMcpInfo(mcpServer.mcp_info);
|
||||
const hasCustomMcpInfo = Object.keys(customMcpInfo).length > 0;
|
||||
|
||||
const renderUrlWithToggle = (url: string | null | undefined, showFull: boolean) => {
|
||||
|
|
|
|||
|
|
@ -94,13 +94,13 @@ export const MCP_INFO_RESERVED_KEYS = [
|
|||
"tool_allowlist_enforced",
|
||||
] as const;
|
||||
|
||||
export const extractCustomMcpInfo = (info: Record<string, unknown> | null | undefined): Record<string, unknown> => {
|
||||
export const extractCustomMcpInfo = (info: unknown): Record<string, unknown> => {
|
||||
if (!info || typeof info !== "object") return {};
|
||||
const reserved = new Set<string>(MCP_INFO_RESERVED_KEYS);
|
||||
return Object.fromEntries(Object.entries(info).filter(([key]) => !reserved.has(key)));
|
||||
};
|
||||
|
||||
export const serializeCustomMcpInfo = (info: Record<string, unknown> | null | undefined): string => {
|
||||
export const serializeCustomMcpInfo = (info: unknown): string => {
|
||||
const custom = extractCustomMcpInfo(info);
|
||||
if (Object.keys(custom).length === 0) return "";
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue