MCPcopy
hub / github.com/codeaashu/claude-code / executeConfigChangeHooks

Function executeConfigChangeHooks

src/utils/hooks.ts:4214–4239  ·  view source on GitHub ↗
(
  source: ConfigChangeSource,
  filePath?: string,
  timeoutMs: number = TOOL_HOOK_EXECUTION_TIMEOUT_MS,
)

Source from the content-addressed store, hash-verified

4212 * @param timeoutMs Optional timeout in milliseconds for hook execution
4213 */
4214export async function executeConfigChangeHooks(
4215 source: ConfigChangeSource,
4216 filePath?: string,
4217 timeoutMs: number = TOOL_HOOK_EXECUTION_TIMEOUT_MS,
4218): Promise<HookOutsideReplResult[]> {
4219 const hookInput: ConfigChangeHookInput = {
4220 ...createBaseHookInput(undefined),
4221 hook_event_name: 'ConfigChange',
4222 source,
4223 file_path: filePath,
4224 }
4225
4226 const results = await executeHooksOutsideREPL({
4227 hookInput,
4228 timeoutMs,
4229 matchQuery: source,
4230 })
4231
4232 // Policy settings are enterprise-managed — hooks fire for audit logging
4233 // but must never block policy changes from being applied
4234 if (source === 'policy_settings') {
4235 return results.map(r => ({ ...r, blocked: false }))
4236 }
4237
4238 return results
4239}
4240
4241async function executeEnvHooks(
4242 hookInput: HookInput,

Callers 3

handleChangeFunction · 0.85
handleDeleteFunction · 0.85
scheduleReloadFunction · 0.85

Calls 2

createBaseHookInputFunction · 0.85
executeHooksOutsideREPLFunction · 0.85

Tested by

no test coverage detected