MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / createEventHandler

Function createEventHandler

cli/src/utils/sdk-event-handlers.ts:528–536  ·  view source on GitHub ↗
(state: EventHandlerState)

Source from the content-addressed store, hash-verified

526
527export const createEventHandler =
528 (state: EventHandlerState) => (event: SDKEvent) => {
529 return match(event)
530 .with({ type: 'subagent_start' }, (e) => handleSubagentStart(state, e))
531 .with({ type: 'subagent_finish' }, (e) => handleSubagentFinish(state, e))
532 .with({ type: 'tool_call' }, (e) => handleToolCall(state, e))
533 .with({ type: 'tool_result' }, (e) => handleToolResult(state, e))
534 .with({ type: 'finish' }, (e) => handleFinish(state, e))
535 .otherwise(() => undefined)
536 }

Callers 2

createRunConfigFunction · 0.90

Calls 5

handleSubagentStartFunction · 0.85
handleSubagentFinishFunction · 0.85
handleToolResultFunction · 0.85
handleFinishFunction · 0.85
handleToolCallFunction · 0.70

Tested by

no test coverage detected