(input: Partial<PowerShellToolInput>, {
verbose,
theme: _theme
}: {
verbose: boolean;
theme: ThemeName;
})
| 19 | const MAX_COMMAND_DISPLAY_LINES = 2; |
| 20 | const MAX_COMMAND_DISPLAY_CHARS = 160; |
| 21 | export function renderToolUseMessage(input: Partial<PowerShellToolInput>, { |
| 22 | verbose, |
| 23 | theme: _theme |
| 24 | }: { |
| 25 | verbose: boolean; |
| 26 | theme: ThemeName; |
| 27 | }): React.ReactNode { |
| 28 | const { |
| 29 | command |
| 30 | } = input; |
| 31 | if (!command) { |
| 32 | return null; |
| 33 | } |
| 34 | const displayCommand = command; |
| 35 | if (!verbose) { |
| 36 | const lines = displayCommand.split('\n'); |
| 37 | const needsLineTruncation = lines.length > MAX_COMMAND_DISPLAY_LINES; |
| 38 | const needsCharTruncation = displayCommand.length > MAX_COMMAND_DISPLAY_CHARS; |
| 39 | if (needsLineTruncation || needsCharTruncation) { |
| 40 | let truncated = displayCommand; |
| 41 | if (needsLineTruncation) { |
| 42 | truncated = lines.slice(0, MAX_COMMAND_DISPLAY_LINES).join('\n'); |
| 43 | } |
| 44 | if (truncated.length > MAX_COMMAND_DISPLAY_CHARS) { |
| 45 | truncated = truncated.slice(0, MAX_COMMAND_DISPLAY_CHARS); |
| 46 | } |
| 47 | return <Text>{truncated.trim()}…</Text>; |
| 48 | } |
| 49 | } |
| 50 | return displayCommand; |
| 51 | } |
| 52 | export function renderToolUseProgressMessage(progressMessagesForMessage: ProgressMessage<PowerShellProgress>[], { |
| 53 | verbose, |
| 54 | tools: _tools, |
nothing calls this directly
no outgoing calls
no test coverage detected