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:
Marko Kraemer 2025-05-12 23:17:07 +02:00 committed by GitHub
commit aaadab5140
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 5 deletions

View File

@ -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;