MCPcopy Create free account
hub / github.com/Noumena-Network/code / truncateCommand

Function truncateCommand

src/tools/TaskStopTool/UI.tsx:13–23  ·  view source on GitHub ↗
(command: string)

Source from the content-addressed store, hash-verified

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

Callers 1

renderToolResultMessageFunction · 0.85

Calls 1

Tested by

no test coverage detected