/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import React from 'react'; import { Box } from 'ink'; import { IndividualToolCallDisplay, ToolCallStatus } from '../../types.js'; import { ToolMessage } from './ToolMessage.js'; import { PartListUnion } from '@google/genai'; import { ToolConfirmationMessage } from './ToolConfirmationMessage.js'; import { Colors } from '../../colors.js'; interface ToolGroupMessageProps { groupId: number; toolCalls: IndividualToolCallDisplay[]; onSubmit: (value: PartListUnion) => void; } // Main component renders the border and maps the tools using ToolMessage export const ToolGroupMessage: React.FC = ({ groupId, toolCalls, onSubmit, }) => { const hasPending = !toolCalls.every( (t) => t.status === ToolCallStatus.Success, ); const borderColor = hasPending ? Colors.AccentYellow : Colors.AccentCyan; return ( {toolCalls.map((tool) => ( {tool.status === ToolCallStatus.Confirming && tool.confirmationDetails && ( )} ))} {/* Optional: Add padding below the last item if needed, though ToolMessage already has some vertical space implicitly */} {/* {tools.length > 0 && } */} ); };