MCPcopy Index your code
hub / github.com/codeaashu/claude-code / emitHookResponse

Function emitHookResponse

src/utils/hooks/hookEvents.ts:153–177  ·  view source on GitHub ↗
(data: {
  hookId: string
  hookName: string
  hookEvent: string
  output: string
  stdout: string
  stderr: string
  exitCode?: number
  outcome: 'success' | 'error' | 'cancelled'
})

Source from the content-addressed store, hash-verified

151}
152
153export function emitHookResponse(data: {
154 hookId: string
155 hookName: string
156 hookEvent: string
157 output: string
158 stdout: string
159 stderr: string
160 exitCode?: number
161 outcome: 'success' | 'error' | 'cancelled'
162}): void {
163 // Always log full hook output to debug log for verbose mode debugging
164 const outputToLog = data.stdout || data.stderr || data.output
165 if (outputToLog) {
166 logForDebugging(
167 `Hook ${data.hookName} (${data.hookEvent}) ${data.outcome}:\n${outputToLog}`,
168 )
169 }
170
171 if (!shouldEmit(data.hookEvent)) return
172
173 emit({
174 type: 'response',
175 ...data,
176 })
177}
178
179/**
180 * Enable emission of all hook event types (beyond SessionStart and Setup).

Callers 3

executeInBackgroundFunction · 0.85
executeHooksFunction · 0.85
finalizeHookFunction · 0.85

Calls 3

logForDebuggingFunction · 0.85
shouldEmitFunction · 0.85
emitFunction · 0.70

Tested by

no test coverage detected