MCPcopy
hub / github.com/steipete/oracle / flushRemainder

Function flushRemainder

src/cli/sessionDisplay.ts:214–233  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

212 };
213
214 const flushRemainder = (): void => {
215 if (!liveRenderState || liveRenderState.fallback) {
216 return;
217 }
218 if (liveRenderState.pending.length === 0) {
219 return;
220 }
221 const text = liveRenderState.pending;
222 liveRenderState.pending = '';
223 const projected = liveRenderState.renderedBytes + Buffer.byteLength(text, 'utf8');
224 if (projected > MAX_RENDER_BYTES) {
225 if (!liveRenderState.noticedFallback) {
226 console.log(dim(`Render skipped (log too large: > ${MAX_RENDER_BYTES} bytes). Showing raw text.`));
227 }
228 process.stdout.write(text);
229 liveRenderState.fallback = true;
230 return;
231 }
232 process.stdout.write(renderMarkdownAnsi(text));
233 };
234
235 const printNew = async () => {
236 const text = await readSessionLog(sessionId);

Callers 1

attachSessionFunction · 0.85

Calls 2

renderMarkdownAnsiFunction · 0.85
dimFunction · 0.70

Tested by

no test coverage detected