/** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { Box, Text } from 'ink'; import { type AgentDefinition } from '@google/gemini-cli-core'; import { theme } from '../semantic-colors.js'; import { RadioButtonSelect, type RadioSelectItem, } from './shared/RadioButtonSelect.js'; export enum NewAgentsChoice { ACKNOWLEDGE = 'acknowledge', IGNORE = 'ignore', } interface NewAgentsNotificationProps { agents: AgentDefinition[]; onSelect: (choice: NewAgentsChoice) => void; } export const NewAgentsNotification = ({ agents, onSelect, }: NewAgentsNotificationProps) => { const options: Array> = [ { label: 'Acknowledge and Enable', value: NewAgentsChoice.ACKNOWLEDGE, key: 'acknowledge', }, { label: 'Do not enable (Ask again next time)', value: NewAgentsChoice.IGNORE, key: 'ignore', }, ]; // Limit display to 5 agents to avoid overflow, show count for rest const MAX_DISPLAYED_AGENTS = 5; const displayAgents = agents.slice(0, MAX_DISPLAYED_AGENTS); const remaining = agents.length - MAX_DISPLAYED_AGENTS; return ( New Agents Discovered The following agents were found in this project. Please review them: {displayAgents.map((agent) => ( - {agent.name}:{' '} {agent.description} ))} {remaining > 0 && ( ... and {remaining} more. )} ); };