MCPcopy Create free account
hub / github.com/apache/maka / formatShellOutput

Function formatShellOutput

packages/cli/src/pi-transcript-format.ts:122–133  ·  view source on GitHub ↗
(output: ShellOutput)

Source from the content-addressed store, hash-verified

120}
121
122function formatShellOutput(output: ShellOutput): string {
123 if (output.mode === 'pty') {
124 const terminal = ptyHumanTerminalText(output);
125 return terminal ? `terminal:\n${terminal}` : '';
126 }
127 return [
128 output.stdout ? `stdout:\n${output.stdout}` : '',
129 output.stderr ? `stderr:\n${output.stderr}` : '',
130 ]
131 .filter(Boolean)
132 .join('\n\n');
133}
134
135export function formatUnknown(value: unknown): string {
136 if (typeof value === 'string') return value;

Callers 1

formatToolResultContentFunction · 0.85

Calls 2

ptyHumanTerminalTextFunction · 0.90
joinMethod · 0.80

Tested by

no test coverage detected