mirror of https://github.com/kortix-ai/suna.git
Merge pull request #265 from assert6/patch-1
Fixed: A require() style import is forbidden. @typescript-eslint/no-require-imports
This commit is contained in:
commit
aaadab5140
|
@ -9,6 +9,11 @@ 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(
|
|||
</div>
|
||||
);
|
||||
} 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<ThreadContentProps> = ({
|
|||
{streamingToolCall && !detectedTag && (
|
||||
<div className="mt-2 mb-1">
|
||||
{(() => {
|
||||
// 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<ThreadContentProps> = ({
|
|||
);
|
||||
};
|
||||
|
||||
export default ThreadContent;
|
||||
export default ThreadContent;
|
||||
|
|
Loading…
Reference in New Issue