File size: 1,108 Bytes
52efc7b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | /**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type React from 'react';
import { Box, Text } from 'ink';
import type { HistoryItemSubagent } from '../../types.js';
interface SubagentHistoryMessageProps {
item: HistoryItemSubagent;
terminalWidth: number;
}
export const SubagentHistoryMessage: React.FC<SubagentHistoryMessageProps> = ({
item,
terminalWidth,
}) => (
<Box flexDirection="column" width={terminalWidth} marginBottom={1}>
<Box marginBottom={1}>
<Text bold color="cyan">
🤖 {item.agentName} Trace ({item.history.length} items)
</Text>
</Box>
{item.history.map((activity) => (
<Box key={activity.id} marginLeft={2} marginBottom={0}>
<Text color={activity.type === 'thought' ? 'gray' : 'white'}>
{activity.type === 'thought' ? '🧠' : '🛠️'} {activity.content}
{activity.status === 'running' && ' (Running...)'}
{activity.status === 'completed' && ' ✅'}
{activity.status === 'error' && ' ❌'}
</Text>
</Box>
))}
</Box>
);
|