(
content: Extract<ToolResultContent, { kind: 'terminal' }>,
)
| 302 | } |
| 303 | |
| 304 | function compactTerminalSummary( |
| 305 | content: Extract<ToolResultContent, { kind: 'terminal' }>, |
| 306 | ): CompactToolSummary { |
| 307 | if (content.status !== 'completed') { |
| 308 | // The exit code is the whole signal on a failed row; the error text lives |
| 309 | // in the expanded card. |
| 310 | return { |
| 311 | text: ansi.red(content.exitCode === undefined ? content.status : `exit ${content.exitCode}`), |
| 312 | protect: true, |
| 313 | }; |
| 314 | } |
| 315 | if (content.output.mode === 'pty') { |
| 316 | const rows = ptyTuiTerminalRows(content.output).length; |
| 317 | return rows > 0 ? { text: linesText(rows), protect: true } : noOutput(); |
| 318 | } |
| 319 | const lines = pipeOutputLineCount(content.output); |
| 320 | return lines > 0 ? { text: linesText(lines), protect: true } : noOutput(); |
| 321 | } |
| 322 | |
| 323 | function compactDiffSummary( |
| 324 | content: Extract<ToolResultContent, { kind: 'file_diff' }>, |
no test coverage detected