(text: string, partial: boolean, force = false)
| 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) { |
no test coverage detected