+ {item.artifacts.slice(0, 3).map((artifact: any, artifactIndex: number) => {
+ const kind = String(artifact?.kind || '').trim().toLowerCase();
+ const mime = String(artifact?.mime_type || '').trim().toLowerCase();
+ const isImage = kind === 'image' || mime.startsWith('image/');
+ const isVideo = kind === 'video' || mime.startsWith('video/');
+ const dataUrl = dataUrlForArtifact(artifact);
+ return (
+
+
{String(artifact?.name || artifact?.source_path || `artifact-${artifactIndex + 1}`)}
+
+ {[artifact?.kind, artifact?.mime_type, formatBytes(artifact?.size_bytes)].filter(Boolean).join(' · ')}
+
+
+ {isImage && dataUrl &&

}
+ {isVideo && dataUrl &&
}
+ {!isImage && !isVideo && String(artifact?.content_text || '').trim() !== '' && (
+
{String(artifact?.content_text || '')}
+ )}
+
+