MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / queueCommandOutputMessage

Function queueCommandOutputMessage

src/core/tools/ExecuteCommandTool.ts:294–311  ·  view source on GitHub ↗
(text: string, partial: boolean, force = false)

Source from the content-addressed store, hash-verified

292 let commandOutputSayChain: Promise<void> = Promise.resolve()
293
294 const queueCommandOutputMessage = (text: string, partial: boolean, force = false): Promise<void> => {
295 if (!force && text === lastQueuedCommandOutput) {
296 return commandOutputSayChain
297 }
298
299 lastQueuedCommandOutput = text
300 commandOutputSayChain = commandOutputSayChain
301 .then(async () => {
302 await task.say("command_output", text, undefined, partial, undefined, undefined, {
303 isNonInteractive: true,
304 })
305 })
306 .catch((error) => {
307 console.error("[ExecuteCommandTool] Failed to publish command output:", error)
308 })
309
310 return commandOutputSayChain
311 }
312
313 const schedulePartialCommandOutputUpdate = () => {
314 if (!latestCompressedOutput || completed) {

Callers 2

emitUpdateFunction · 0.85
executeCommandInTerminalFunction · 0.85

Calls 2

sayMethod · 0.80
errorMethod · 0.65

Tested by

no test coverage detected