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 { FileCache } from '@/hooks/use-cached-file';
|
||||||
import { useAuth } from '@/components/AuthProvider';
|
import { useAuth } from '@/components/AuthProvider';
|
||||||
import { Project } from '@/lib/api';
|
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
|
// Define the set of tags whose raw XML should be hidden during streaming
|
||||||
const HIDE_STREAMING_XML_TAGS = new Set([
|
const HIDE_STREAMING_XML_TAGS = new Set([
|
||||||
|
@ -138,8 +143,6 @@ export function renderMarkdownContent(
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// Import dynamically to avoid circular dependencies
|
|
||||||
const { getToolIcon, extractPrimaryParam } = require('@/components/thread/utils');
|
|
||||||
const IconComponent = getToolIcon(toolName);
|
const IconComponent = getToolIcon(toolName);
|
||||||
const paramDisplay = extractPrimaryParam(toolName, rawXml);
|
const paramDisplay = extractPrimaryParam(toolName, rawXml);
|
||||||
|
|
||||||
|
@ -504,8 +507,6 @@ export const ThreadContent: React.FC<ThreadContentProps> = ({
|
||||||
{streamingToolCall && !detectedTag && (
|
{streamingToolCall && !detectedTag && (
|
||||||
<div className="mt-2 mb-1">
|
<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 toolName = streamingToolCall.name || streamingToolCall.xml_tag_name || 'Tool';
|
||||||
const IconComponent = getToolIcon(toolName);
|
const IconComponent = getToolIcon(toolName);
|
||||||
const paramDisplay = extractPrimaryParam(toolName, streamingToolCall.arguments || '');
|
const paramDisplay = extractPrimaryParam(toolName, streamingToolCall.arguments || '');
|
||||||
|
|
Loading…
Reference in New Issue