MCPcopy
hub / github.com/coder/mux / buildOutput

Function buildOutput

src/node/services/devToolsMiddleware.ts:485–504  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

483 let streamError: string | null = null;
484
485 const buildOutput = (): DevToolsStepOutput => {
486 // Streams can end abruptly (abort/cancel/error) before receiving `*-end`
487 // chunks, so flush in-progress deltas to preserve partial debug output.
488 for (const [id, text] of currentText) {
489 textParts.push({ id, text });
490 }
491 currentText.clear();
492
493 for (const [id, text] of currentReasoning) {
494 reasoningParts.push({ id, text });
495 }
496 currentReasoning.clear();
497
498 return {
499 textParts,
500 reasoningParts,
501 toolCalls,
502 finishReason,
503 };
504 };
505
506 const finalizeStep = async (
507 update: Pick<

Callers 3

abortHandlerFunction · 0.70
pullFunction · 0.70
cancelFunction · 0.70

Calls 2

pushMethod · 0.65
clearMethod · 0.45

Tested by

no test coverage detected