mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-24 03:54:43 -07:00
Disallow redundant typecasts. (#15030)
This commit is contained in:
committed by
GitHub
parent
fcc3b2b5ec
commit
942bcfc61e
@@ -10,11 +10,7 @@ import type {
|
||||
CommandContext,
|
||||
} from './types.js';
|
||||
import { CommandKind } from './types.js';
|
||||
import type {
|
||||
DiscoveredMCPPrompt,
|
||||
DiscoveredMCPResource,
|
||||
MessageActionReturn,
|
||||
} from '@google/gemini-cli-core';
|
||||
import type { MessageActionReturn } from '@google/gemini-cli-core';
|
||||
import {
|
||||
DiscoveredMCPTool,
|
||||
getMCPDiscoveryState,
|
||||
@@ -218,25 +214,20 @@ const listAction = async (
|
||||
connectingServers.length > 0;
|
||||
|
||||
const allTools = toolRegistry.getAllTools();
|
||||
const mcpTools = allTools.filter(
|
||||
(tool) => tool instanceof DiscoveredMCPTool,
|
||||
) as DiscoveredMCPTool[];
|
||||
const mcpTools = allTools.filter((tool) => tool instanceof DiscoveredMCPTool);
|
||||
|
||||
const promptRegistry = await config.getPromptRegistry();
|
||||
const mcpPrompts = promptRegistry
|
||||
.getAllPrompts()
|
||||
.filter(
|
||||
(prompt) =>
|
||||
'serverName' in prompt &&
|
||||
serverNames.includes(prompt.serverName as string),
|
||||
) as DiscoveredMCPPrompt[];
|
||||
'serverName' in prompt && serverNames.includes(prompt.serverName),
|
||||
);
|
||||
|
||||
const resourceRegistry = config.getResourceRegistry();
|
||||
const mcpResources = resourceRegistry
|
||||
.getAllResources()
|
||||
.filter((entry) =>
|
||||
serverNames.includes(entry.serverName),
|
||||
) as DiscoveredMCPResource[];
|
||||
.filter((entry) => serverNames.includes(entry.serverName));
|
||||
|
||||
const authStatus: HistoryItemMcpStatus['authStatus'] = {};
|
||||
const tokenStorage = new MCPOAuthTokenStorage();
|
||||
@@ -269,7 +260,7 @@ const listAction = async (
|
||||
schema: tool.schema,
|
||||
})),
|
||||
prompts: mcpPrompts.map((prompt) => ({
|
||||
serverName: prompt.serverName as string,
|
||||
serverName: prompt.serverName,
|
||||
name: prompt.name,
|
||||
description: prompt.description,
|
||||
})),
|
||||
|
||||
Reference in New Issue
Block a user