(command: string)
| 10 | const MAX_COMMAND_DISPLAY_LINES = 2; |
| 11 | const MAX_COMMAND_DISPLAY_CHARS = 160; |
| 12 | function truncateCommand(command: string): string { |
| 13 | const lines = command.split('\n'); |
| 14 | let truncated = command; |
| 15 | if (lines.length > MAX_COMMAND_DISPLAY_LINES) { |
| 16 | truncated = lines.slice(0, MAX_COMMAND_DISPLAY_LINES).join('\n'); |
| 17 | } |
| 18 | if (stringWidth(truncated) > MAX_COMMAND_DISPLAY_CHARS) { |
| 19 | truncated = truncateToWidthNoEllipsis(truncated, MAX_COMMAND_DISPLAY_CHARS); |
| 20 | } |
| 21 | return truncated.trim(); |
| 22 | } |
| 23 | export function renderToolResultMessage(output: Output, _progressMessagesForMessage: unknown[], { |
| 24 | verbose |
| 25 | }: { |
no test coverage detected