(content: Out, progressMessagesForMessage: ProgressMessage<PowerShellProgress>[], {
verbose,
theme: _theme,
tools: _tools,
style: _style
}: {
verbose: boolean;
theme: ThemeName;
tools: Tool[];
style?: 'condensed';
})
| 76 | </MessageResponse>; |
| 77 | } |
| 78 | export function renderToolResultMessage(content: Out, progressMessagesForMessage: ProgressMessage<PowerShellProgress>[], { |
| 79 | verbose, |
| 80 | theme: _theme, |
| 81 | tools: _tools, |
| 82 | style: _style |
| 83 | }: { |
| 84 | verbose: boolean; |
| 85 | theme: ThemeName; |
| 86 | tools: Tool[]; |
| 87 | style?: 'condensed'; |
| 88 | }): React.ReactNode { |
| 89 | const lastProgress = progressMessagesForMessage.at(-1); |
| 90 | const timeoutMs = lastProgress?.data?.timeoutMs; |
| 91 | const { |
| 92 | stdout, |
| 93 | stderr, |
| 94 | interrupted, |
| 95 | returnCodeInterpretation, |
| 96 | isImage, |
| 97 | backgroundTaskId |
| 98 | } = content; |
| 99 | if (isImage) { |
| 100 | return <MessageResponse height={1}> |
| 101 | <Text dimColor>[Image data detected and sent to Claude]</Text> |
| 102 | </MessageResponse>; |
| 103 | } |
| 104 | return <Box flexDirection="column"> |
| 105 | {stdout !== '' ? <OutputLine content={stdout} verbose={verbose} /> : null} |
| 106 | {stderr.trim() !== '' ? <OutputLine content={stderr} verbose={verbose} isError /> : null} |
| 107 | {stdout === '' && stderr.trim() === '' ? <MessageResponse height={1}> |
| 108 | <Text dimColor> |
| 109 | {backgroundTaskId ? <> |
| 110 | Running in the background{' '} |
| 111 | <KeyboardShortcutHint shortcut="↓" action="manage" parens /> |
| 112 | </> : interrupted ? 'Interrupted' : returnCodeInterpretation || '(No output)'} |
| 113 | </Text> |
| 114 | </MessageResponse> : null} |
| 115 | {timeoutMs ? <MessageResponse> |
| 116 | <ShellTimeDisplay timeoutMs={timeoutMs} /> |
| 117 | </MessageResponse> : null} |
| 118 | </Box>; |
| 119 | } |
| 120 | export function renderToolUseErrorMessage(result: ToolResultBlockParam['content'], { |
| 121 | verbose, |
| 122 | progressMessagesForMessage: _progressMessagesForMessage, |
nothing calls this directly
no outgoing calls
no test coverage detected