Refactor: Migrate CLI appEvents to Core coreEvents (#15737)

This commit is contained in:
Adib234
2026-01-23 11:45:46 -05:00
committed by GitHub
parent 0b7d26c9e3
commit 488d5fc439
13 changed files with 90 additions and 93 deletions

View File

@@ -5,9 +5,13 @@
*/
import { useEffect, useState } from 'react';
import { AppEvent, appEvents } from './../../utils/events.js';
import { Box, Text } from 'ink';
import { type McpClient, MCPServerStatus } from '@google/gemini-cli-core';
import {
CoreEvent,
coreEvents,
type McpClient,
MCPServerStatus,
} from '@google/gemini-cli-core';
import { GeminiSpinner } from './GeminiRespondingSpinner.js';
import { theme } from '../semantic-colors.js';
@@ -45,9 +49,9 @@ export const ConfigInitDisplay = () => {
}
};
appEvents.on(AppEvent.McpClientUpdate, onChange);
coreEvents.on(CoreEvent.McpClientUpdate, onChange);
return () => {
appEvents.off(AppEvent.McpClientUpdate, onChange);
coreEvents.off(CoreEvent.McpClientUpdate, onChange);
};
}, []);