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

Function formatBashOutput

src/utils/promptShellExecution.ts:164–184  ·  view source on GitHub ↗
(
  stdout: string,
  stderr: string,
  inline = false,
)

Source from the content-addressed store, hash-verified

162}
163
164function formatBashOutput(
165 stdout: string,
166 stderr: string,
167 inline = false,
168): string {
169 const parts: string[] = []
170
171 if (stdout.trim()) {
172 parts.push(stdout.trim())
173 }
174
175 if (stderr.trim()) {
176 if (inline) {
177 parts.push(`[stderr: ${stderr.trim()}]`)
178 } else {
179 parts.push(`[stderr]\n${stderr.trim()}`)
180 }
181 }
182
183 return parts.join(inline ? ' ' : '\n')
184}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected