Skip to content

Commit 6efea7b

Browse files
committed
update typecheck display
1 parent 75f31d8 commit 6efea7b

File tree

1 file changed

+17
-1
lines changed
  • apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/message-content

1 file changed

+17
-1
lines changed

apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/message-content/tool-call-display.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import {
66
SEARCH_REPLACE_MULTI_EDIT_FILE_TOOL_NAME,
77
type SEARCH_REPLACE_MULTI_EDIT_FILE_TOOL_PARAMETERS,
88
TERMINAL_COMMAND_TOOL_NAME, TODO_WRITE_TOOL_NAME,
9-
type TODO_WRITE_TOOL_PARAMETERS, WEB_SEARCH_TOOL_NAME,
9+
type TODO_WRITE_TOOL_PARAMETERS, TYPECHECK_TOOL_NAME,
10+
WEB_SEARCH_TOOL_NAME,
1011
type WEB_SEARCH_TOOL_PARAMETERS,
1112
WRITE_FILE_TOOL_NAME,
1213
type WRITE_FILE_TOOL_PARAMETERS
@@ -15,6 +16,7 @@ import type { WebSearchResult } from '@onlook/models';
1516
import { Icons } from '@onlook/ui/icons/index';
1617
import { cn } from '@onlook/ui/utils';
1718
import type { ToolUIPart } from 'ai';
19+
import stripAnsi from 'strip-ansi';
1820
import { type z } from 'zod';
1921
import { BashCodeDisplay } from '../../code-display/bash-code-display';
2022
import { CollapsibleCodeBlock } from '../../code-display/collapsible-code-block';
@@ -212,6 +214,20 @@ export const ToolCallDisplay = ({
212214
);
213215
}
214216

217+
if (toolName === TYPECHECK_TOOL_NAME) {
218+
const result = toolInvocation.output as { success: boolean; error?: string } | null;
219+
const error = stripAnsi(result?.error || '');
220+
return (
221+
<BashCodeDisplay
222+
key={toolInvocation.toolCallId}
223+
content={'bunx tsc --noEmit'}
224+
isStream={isStream}
225+
defaultStdOut={error ? null : '✅ Typecheck passed!'}
226+
defaultStdErr={error ? error : null}
227+
/>
228+
);
229+
}
230+
215231
return (
216232
<ToolCallSimple
217233
toolInvocation={toolInvocation}

0 commit comments

Comments
 (0)