import React from 'react' import type { Attachment, ImageAttachment, McpContent, PlanConfig, TaskTodoConfig, Operation, BaseEvent, HandleImageAttachmentClick, } from '../../types' import { AttachmentItem } from './AttachmentItem' import { ImageAttachmentItem } from './ImageAttachmentItem' import { TodoList } from './TodoList' export interface SystemMessageProps { attachment?: Attachment[] imageAttachment?: ImageAttachment[] operation?: Operation mcpContent?: McpContent planConfig?: PlanConfig taskTodoConfig?: TaskTodoConfig base?: BaseEvent showSystemAttachments: boolean showOperation: boolean showMcpContent: boolean showPlanConfig: boolean showTaskTodoList: boolean onAttachmentClick?: (attachment: Attachment) => void onImageAttachmentClick?: HandleImageAttachmentClick } /** * 系统消息组件 - 渲染系统附件、待办列表、MCP内容、计划配置、操作信息 * 对应 next-agent SystemMessage */ function InnerSystemMessage({ attachment, imageAttachment, operation, mcpContent, planConfig, taskTodoConfig, showSystemAttachments, showOperation, showMcpContent, showPlanConfig, showTaskTodoList, onAttachmentClick, onImageAttachmentClick, }: SystemMessageProps) { const hasContent = showTaskTodoList || (imageAttachment?.length ?? 0) > 0 || (showSystemAttachments && (attachment?.length ?? 0) > 0) || (showMcpContent && !!mcpContent) || (showOperation && !!operation) || (showPlanConfig && !!planConfig) if (!hasContent) return null return (
{JSON.stringify(mcpContent, null, 2)}
{JSON.stringify(operation, null, 2)}