(input: Partial<BashToolInput>, {
verbose,
theme: _theme
}: {
verbose: boolean;
theme: ThemeName;
})
| 83 | return t4; |
| 84 | } |
| 85 | export function renderToolUseMessage(input: Partial<BashToolInput>, { |
| 86 | verbose, |
| 87 | theme: _theme |
| 88 | }: { |
| 89 | verbose: boolean; |
| 90 | theme: ThemeName; |
| 91 | }): React.ReactNode { |
| 92 | const { |
| 93 | command |
| 94 | } = input; |
| 95 | if (!command) { |
| 96 | return null; |
| 97 | } |
| 98 | |
| 99 | // Render sed in-place edits like file edits (show file path only) |
| 100 | const sedInfo = parseSedEditCommand(command); |
| 101 | if (sedInfo) { |
| 102 | return verbose ? sedInfo.filePath : getDisplayPath(sedInfo.filePath); |
| 103 | } |
| 104 | if (!verbose) { |
| 105 | const lines = command.split('\n'); |
| 106 | if (isFullscreenEnvEnabled()) { |
| 107 | const label = extractBashCommentLabel(command); |
| 108 | if (label) { |
| 109 | return label.length > MAX_COMMAND_DISPLAY_CHARS ? label.slice(0, MAX_COMMAND_DISPLAY_CHARS) + '…' : label; |
| 110 | } |
| 111 | } |
| 112 | const needsLineTruncation = lines.length > MAX_COMMAND_DISPLAY_LINES; |
| 113 | const needsCharTruncation = command.length > MAX_COMMAND_DISPLAY_CHARS; |
| 114 | if (needsLineTruncation || needsCharTruncation) { |
| 115 | let truncated = command; |
| 116 | |
| 117 | // First truncate by lines if needed |
| 118 | if (needsLineTruncation) { |
| 119 | truncated = lines.slice(0, MAX_COMMAND_DISPLAY_LINES).join('\n'); |
| 120 | } |
| 121 | |
| 122 | // Then truncate by chars if still too long |
| 123 | if (truncated.length > MAX_COMMAND_DISPLAY_CHARS) { |
| 124 | truncated = truncated.slice(0, MAX_COMMAND_DISPLAY_CHARS); |
| 125 | } |
| 126 | return <Text>{truncated.trim()}…</Text>; |
| 127 | } |
| 128 | } |
| 129 | return command; |
| 130 | } |
| 131 | export function renderToolUseProgressMessage(progressMessagesForMessage: ProgressMessage<BashProgress>[], { |
| 132 | verbose, |
| 133 | tools: _tools, |
nothing calls this directly
no test coverage detected