MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / appendTextBlock

Function appendTextBlock

apps/cli/src/ai/chat-command.ts:168–176  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

166 // 中文注释:CLI 历史回放依赖 contentBlocks 的时序;只要出现计划/思考块,
167 // 就同步保留后续正文 text block,避免 UI 使用 blocks 渲染时丢失最终回答。
168 const appendTextBlock = (text: string) => {
169 if (!text) return
170 const lastBlock = contentBlocks[contentBlocks.length - 1]
171 if (lastBlock?.type === 'text') {
172 lastBlock.text += text
173 } else {
174 contentBlocks.push({ type: 'text', text })
175 }
176 }
177
178 const appendThinkBlock = (text: string, tag = 'thinking', durationMs?: number) => {
179 if (!text && durationMs === undefined) return

Callers 1

runChatTurnFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected