MCPcopy Index your code
hub / github.com/7836246/cursor2api / writeAnthropicTextDelta

Function writeAnthropicTextDelta

src/handler.ts:849–870  ·  view source on GitHub ↗
(
    res: Response,
    state: { blockIndex: number; textBlockStarted: boolean },
    text: string,
)

Source from the content-addressed store, hash-verified

847}
848
849function writeAnthropicTextDelta(
850 res: Response,
851 state: { blockIndex: number; textBlockStarted: boolean },
852 text: string,
853): void {
854 if (!text) return;
855
856 if (!state.textBlockStarted) {
857 writeSSE(res, 'content_block_start', {
858 type: 'content_block_start',
859 index: state.blockIndex,
860 content_block: { type: 'text', text: '' },
861 });
862 state.textBlockStarted = true;
863 }
864
865 writeSSE(res, 'content_block_delta', {
866 type: 'content_block_delta',
867 index: state.blockIndex,
868 delta: { type: 'text_delta', text },
869 });
870}
871
872function emitAnthropicThinkingBlock(
873 res: Response,

Callers 4

flushVisibleFunction · 0.85
handleDirectTextStreamFunction · 0.85
pushToStreamerFunction · 0.85
handleStreamFunction · 0.85

Calls 1

writeSSEFunction · 0.85

Tested by

no test coverage detected