( update: any, state: StreamState, onText: (text: string, isThinking?: boolean) => void, )
| 870 | } |
| 871 | |
| 872 | function handleInteractionUpdate( |
| 873 | update: any, |
| 874 | state: StreamState, |
| 875 | onText: (text: string, isThinking?: boolean) => void, |
| 876 | ): void { |
| 877 | const updateCase = update.message?.case; |
| 878 | |
| 879 | if (updateCase === "textDelta") { |
| 880 | const delta = update.message.value.text || ""; |
| 881 | if (delta) onText(delta, false); |
| 882 | } else if (updateCase === "thinkingDelta") { |
| 883 | const delta = update.message.value.text || ""; |
| 884 | if (delta) onText(delta, true); |
| 885 | } else if (updateCase === "tokenDelta") { |
| 886 | state.outputTokens += update.message.value.tokens ?? 0; |
| 887 | } |
| 888 | // toolCallStarted, partialToolCall, toolCallDelta, toolCallCompleted |
| 889 | // are intentionally ignored. MCP tool calls flow through the exec |
| 890 | // message path (mcpArgs → mcpResult), not interaction updates. |
| 891 | } |
| 892 | |
| 893 | /** Send a KV client response back to Cursor. */ |
| 894 | function sendKvResponse( |
no outgoing calls
no test coverage detected