/** * @license * Copyright 2025 Qwen * SPDX-License-Identifier: Apache-2.0 */ import { Box, Text, useInput } from 'ink'; import { ManagementStepProps } from './types.js'; import { theme } from '../../semantic-colors.js'; import { shouldShowColor, getColorForDisplay } from './utils.js'; export const AgentViewerStep = ({ state, onPrevious }: ManagementStepProps) => { // Handle keyboard input useInput((input, key) => { if (key.escape || input === 'b') { onPrevious(); } }); if (!state.selectedAgent) { return ( No agent selected ); } const agent = state.selectedAgent; const toolsDisplay = agent.tools ? agent.tools.join(', ') : '*'; return ( Location: {agent.level === 'project' ? 'Project Level (.qwen/agents/)' : 'User Level (~/.qwen/agents/)'} File Path: {agent.filePath} Tools: {toolsDisplay} {shouldShowColor(agent.backgroundColor) && ( Color: {` ${agent.name} `} )} Description: {agent.description} System Prompt: {agent.systemPrompt} ); };