MCPcopy
hub / github.com/7836246/cursor2api / flushVisible

Function flushVisible

src/openai-handler.ts:643–654  ·  view source on GitHub ↗
(chunk: string)

Source from the content-addressed store, hash-verified

641 });
642
643 const flushVisible = (chunk: string): void => {
644 if (!chunk) return;
645 visibleText += chunk;
646 const delta = attemptStreamer.push(chunk);
647 if (!delta) return;
648
649 if (thinkingEnabled && reasoningContent && !reasoningSent) {
650 writeOpenAIReasoningDelta(res, streamMeta.id, streamMeta.created, streamMeta.model, reasoningContent);
651 reasoningSent = true;
652 }
653 writeOpenAITextDelta(res, streamMeta.id, streamMeta.created, streamMeta.model, delta);
654 };
655
656 await sendCursorRequest(activeCursorReq, (event: CursorSSEEvent) => {
657 if (event.type !== 'text-delta' || !event.delta) return;

Callers 1

executeAttemptFunction · 0.70

Calls 3

writeOpenAITextDeltaFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected