MCPcopy Create free account
hub / github.com/ephraimduncan/opencode-cursor / handleInteractionUpdate

Function handleInteractionUpdate

src/proxy.ts:872–891  ·  view source on GitHub ↗
(
  update: any,
  state: StreamState,
  onText: (text: string, isThinking?: boolean) => void,
)

Source from the content-addressed store, hash-verified

870}
871
872function 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. */
894function sendKvResponse(

Callers 1

processServerMessageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected