82
return result;
83
}
85
>
const hooksObj = hooks as Record<string, unknown>;
86
>
87
>
for (const originalId of Object.keys(hooksObj)) {
88
>
const hookType = resolveCopilotCliHookType(originalId) ?? toHookType(originalId);
89
>
if (!hookType) {
90
continue;
91
}
93
>
const hookArray = hooksObj[originalId];
94
>
if (!Array.isArray(hookArray)) {
95
continue;
96
}
98
>
const commands: IHookCommand[] = [];
99
>
100
>
for (const item of hookArray) {
101
>
// Use helper that handles both direct commands and Claude-style nested matcher structures
102
>
const extracted = extractHookCommandsFromItem(item, workspaceRootUri, userHome);
103
>
commands.push(...extracted);
104
>
}
105
>
106
>
if (commands.length > 0) {
107
>
result.set(hookType, { hooks: commands, originalId });
108
>
}
109
>
}
110
>
111
>
return result;
112
>
}
113
114
/**