MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / mergeClaudeCodePluginHooks

Function mergeClaudeCodePluginHooks

src/integrations/claude-plugins.ts:325–338  ·  view source on GitHub ↗
(config: QodexConfig, cwd: string)

Source from the content-addressed store, hash-verified

323
324/** Merge plugin hooks into config.hooks (mutates, appends). Returns count added. */
325export async function mergeClaudeCodePluginHooks(config: QodexConfig, cwd: string): Promise<number> {
326 if (disabled()) return 0;
327 const hooks = await loadClaudeCodePluginHooks(cwd).catch(() => ({} as HooksConfig));
328 const cfgHooks = ((config as any).hooks ??= {});
329 let added = 0;
330 for (const event of SUPPORTED_HOOK_EVENTS) {
331 const incoming = hooks[event];
332 if (!incoming?.length) continue;
333 (cfgHooks[event] ??= []).push(...incoming);
334 added += incoming.length;
335 }
336 if (added) logger.info('Imported Claude Code plugin hooks', { added });
337 return added;
338}
339
340/** One-shot: import agents + MCP servers + hooks from Claude Code into config (mutates). */
341export async function applyClaudeCodeIntegration(

Callers 2

Calls 4

disabledFunction · 0.85
infoMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected