diff --git a/frontend/src/components/thread/content/ThreadContent.tsx b/frontend/src/components/thread/content/ThreadContent.tsx index 6e28aab0..8572fddf 100644 --- a/frontend/src/components/thread/content/ThreadContent.tsx +++ b/frontend/src/components/thread/content/ThreadContent.tsx @@ -4,11 +4,16 @@ import { ArrowDown, CircleDashed } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Markdown } from '@/components/ui/markdown'; import { UnifiedMessage, ParsedContent, ParsedMetadata } from '@/components/thread/types'; -import { safeJsonParse } from '@/components/thread/utils'; +import { safeJsonParse } from '@/components/thread/utils'; import { FileAttachmentGrid } from '@/components/thread/file-attachment'; import { FileCache } from '@/hooks/use-cached-file'; import { useAuth } from '@/components/AuthProvider'; import { Project } from '@/lib/api'; +import { + extractPrimaryParam, + getToolIcon, + safeJsonParse, +} from '@/components/thread/utils'; // Define the set of tags whose raw XML should be hidden during streaming const HIDE_STREAMING_XML_TAGS = new Set([ @@ -138,8 +143,6 @@ export function renderMarkdownContent( ); } else { - // Import dynamically to avoid circular dependencies - const { getToolIcon, extractPrimaryParam } = require('@/components/thread/utils'); const IconComponent = getToolIcon(toolName); const paramDisplay = extractPrimaryParam(toolName, rawXml); @@ -504,8 +507,6 @@ export const ThreadContent: React.FC = ({ {streamingToolCall && !detectedTag && (
{(() => { - // Import dynamically to avoid circular dependencies - const { getToolIcon, extractPrimaryParam } = require('@/components/thread/utils'); const toolName = streamingToolCall.name || streamingToolCall.xml_tag_name || 'Tool'; const IconComponent = getToolIcon(toolName); const paramDisplay = extractPrimaryParam(toolName, streamingToolCall.arguments || ''); @@ -672,4 +673,4 @@ export const ThreadContent: React.FC = ({ ); }; -export default ThreadContent; \ No newline at end of file +export default ThreadContent;