INNER CODE UNIT · TypeScript
executeEventHooks
superagent-ai/grok-cli · src/hooks/index.ts:45
export async function executeEventHooks(
input: HookInput,
cwd: string,
signal?: AbortSignal,
): Promise<AggregatedHookResult> {
try {
const config = loadHooksConfig();
const matchValue = getMatchQuery(input);
const hooks = getMatchingHooks(config, input.hook_event_name, matchValue);
if (hooks.length === 0) return emptyResult();
return await executeHooks(hooks, input, cwd, signal);
} catch {
return emptyResult();
}
}
/**
* Fire PreToolUse hooks. Returns the aggregated result which may block execution.