mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-15 04:20:57 -07:00
chore(deps): pin dependencies and enforce 14-day update cooldown (#27948)
This commit is contained in:
@@ -35,16 +35,16 @@ describe('McpClientManager', () => {
|
||||
let toolRegistry: ToolRegistry;
|
||||
|
||||
beforeEach(() => {
|
||||
mockedMcpClient = vi.mockObject({
|
||||
mockedMcpClient = {
|
||||
connect: vi.fn(),
|
||||
discoverInto: vi.fn(),
|
||||
disconnect: vi.fn(),
|
||||
getStatus: vi.fn().mockReturnValue(MCPServerStatus.DISCONNECTED),
|
||||
getServerConfig: vi.fn(),
|
||||
getServerName: vi.fn().mockReturnValue('test-server'),
|
||||
} as unknown as McpClient);
|
||||
} as unknown as MockedObject<McpClient>;
|
||||
vi.mocked(McpClient).mockReturnValue(mockedMcpClient);
|
||||
mockConfig = vi.mockObject({
|
||||
mockConfig = {
|
||||
isTrustedFolder: vi.fn().mockReturnValue(true),
|
||||
getMcpServers: vi.fn().mockReturnValue({}),
|
||||
getPromptRegistry: vi.fn().mockReturnValue({ registerPrompt: vi.fn() }),
|
||||
@@ -62,15 +62,15 @@ describe('McpClientManager', () => {
|
||||
isInitialized: vi.fn(),
|
||||
}),
|
||||
refreshMcpContext: vi.fn(),
|
||||
} as unknown as Config);
|
||||
toolRegistry = vi.mockObject({
|
||||
} as unknown as MockedObject<Config>;
|
||||
toolRegistry = {
|
||||
registerTool: vi.fn(),
|
||||
unregisterTool: vi.fn(),
|
||||
sortTools: vi.fn(),
|
||||
getMessageBus: vi.fn().mockReturnValue({}),
|
||||
removeMcpToolsByServer: vi.fn(),
|
||||
getToolsByServer: vi.fn().mockReturnValue([]),
|
||||
} as unknown as ToolRegistry);
|
||||
} as unknown as ToolRegistry;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
||||
@@ -1148,10 +1148,12 @@ class LenientJsonSchemaValidator implements jsonSchemaValidator {
|
||||
try {
|
||||
return this.ajvValidator.getValidator<T>(schema);
|
||||
} catch (error) {
|
||||
let id = '<no $id>';
|
||||
if (schema && typeof schema === 'object' && '$id' in schema) {
|
||||
id = String(schema.$id);
|
||||
}
|
||||
debugLogger.warn(
|
||||
`Failed to compile MCP tool output schema (${
|
||||
(schema as Record<string, unknown>)?.['$id'] ?? '<no $id>'
|
||||
}): ${error instanceof Error ? error.message : String(error)}. ` +
|
||||
`Failed to compile MCP tool output schema (${id}): ${error instanceof Error ? error.message : String(error)}. ` +
|
||||
'Skipping output validation for this tool.',
|
||||
);
|
||||
return (input: unknown) => ({
|
||||
|
||||
@@ -634,7 +634,7 @@ export class ToolRegistry {
|
||||
possibleNames.push(`${tool.getFullyQualifiedPrefix()}${tool.name}`);
|
||||
}
|
||||
}
|
||||
return !possibleNames.some((name) => excludeTools.has(name));
|
||||
return !possibleNames.some((name) => excludeTools?.has(name));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user