MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / renderToolUseMessage

Function renderToolUseMessage

source code/tools/PowerShellTool/UI.tsx:21–51  ·  view source on GitHub ↗
(input: Partial<PowerShellToolInput>, {
  verbose,
  theme: _theme
}: {
  verbose: boolean;
  theme: ThemeName;
})

Source from the content-addressed store, hash-verified

19const MAX_COMMAND_DISPLAY_LINES = 2;
20const MAX_COMMAND_DISPLAY_CHARS = 160;
21export 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}
52export function renderToolUseProgressMessage(progressMessagesForMessage: ProgressMessage<PowerShellProgress>[], {
53 verbose,
54 tools: _tools,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected