MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / processTextChunk

Function processTextChunk

cli/src/utils/stream-chunk-processor.ts:40–57  ·  view source on GitHub ↗
(
  blocks: ContentBlock[],
  destination: ChunkDestination,
  text: string,
)

Source from the content-addressed store, hash-verified

38}
39
40export const processTextChunk = (
41 blocks: ContentBlock[],
42 destination: ChunkDestination,
43 text: string,
44): ContentBlock[] => {
45 if (!text) {
46 return blocks
47 }
48
49 if (destination.type === 'agent') {
50 return appendTextToAgentBlock(blocks, destination.agentId, text, destination.textType)
51 }
52
53 return appendTextToRootStream(blocks, {
54 type: destination.textType,
55 text,
56 })
57}

Callers 1

createStreamChunkHandlerFunction · 0.90

Calls 2

appendTextToAgentBlockFunction · 0.90
appendTextToRootStreamFunction · 0.90

Tested by

no test coverage detected