2026-05-19 14:03:13 +08:00
|
|
|
import type { PluginComponents } from "./plugin-components-loader"
|
|
|
|
|
import { setPluginHooksConfigs } from "../hooks/claude-code-hooks/config"
|
|
|
|
|
import { log } from "../shared"
|
|
|
|
|
|
|
|
|
|
export function applyHookConfig(params: {
|
|
|
|
|
pluginComponents: PluginComponents;
|
2026-05-20 22:30:25 +08:00
|
|
|
ctx: { directory: string };
|
2026-05-19 14:03:13 +08:00
|
|
|
}): void {
|
2026-05-20 22:30:25 +08:00
|
|
|
const { pluginComponents, ctx } = params
|
2026-05-19 14:03:13 +08:00
|
|
|
|
|
|
|
|
if (pluginComponents.hooksConfigs.length > 0) {
|
|
|
|
|
log("[hook-config-handler] Merging plugin hooks configs", {
|
|
|
|
|
count: pluginComponents.hooksConfigs.length,
|
|
|
|
|
plugins: pluginComponents.plugins.map(p => p.name),
|
|
|
|
|
})
|
|
|
|
|
}
|
2026-05-19 14:15:42 +08:00
|
|
|
|
2026-05-20 22:30:25 +08:00
|
|
|
setPluginHooksConfigs(ctx.directory, pluginComponents.hooksConfigs)
|
2026-05-19 14:03:13 +08:00
|
|
|
}
|