MCPcopy
hub / github.com/codeaashu/claude-code / renderToolResultMessage

Function renderToolResultMessage

src/tools/FileReadTool/UI.tsx:77–143  ·  view source on GitHub ↗
(output: Output)

Source from the content-addressed store, hash-verified

75 return <Text dimColor> {agentTaskId}</Text>;
76}
77export function renderToolResultMessage(output: Output): React.ReactNode {
78 // TODO: Render recursively
79 switch (output.type) {
80 case 'image':
81 {
82 const {
83 originalSize
84 } = output.file;
85 const formattedSize = formatFileSize(originalSize);
86 return <MessageResponse height={1}>
87 <Text>Read image ({formattedSize})</Text>
88 </MessageResponse>;
89 }
90 case 'notebook':
91 {
92 const {
93 cells
94 } = output.file;
95 if (!cells || cells.length < 1) {
96 return <Text color="error">No cells found in notebook</Text>;
97 }
98 return <MessageResponse height={1}>
99 <Text>
100 Read <Text bold>{cells.length}</Text> cells
101 </Text>
102 </MessageResponse>;
103 }
104 case 'pdf':
105 {
106 const {
107 originalSize
108 } = output.file;
109 const formattedSize = formatFileSize(originalSize);
110 return <MessageResponse height={1}>
111 <Text>Read PDF ({formattedSize})</Text>
112 </MessageResponse>;
113 }
114 case 'parts':
115 {
116 return <MessageResponse height={1}>
117 <Text>
118 Read <Text bold>{output.file.count}</Text>{' '}
119 {output.file.count === 1 ? 'page' : 'pages'} (
120 {formatFileSize(output.file.originalSize)})
121 </Text>
122 </MessageResponse>;
123 }
124 case 'text':
125 {
126 const {
127 numLines
128 } = output.file;
129 return <MessageResponse height={1}>
130 <Text>
131 Read <Text bold>{numLines}</Text>{' '}
132 {numLines === 1 ? 'line' : 'lines'}
133 </Text>
134 </MessageResponse>;

Callers

nothing calls this directly

Calls 1

formatFileSizeFunction · 0.85

Tested by

no test coverage detected