610
*/
611
export function parseSubagentHooksFromYaml(
613
>
workspaceRootUri: URI | undefined,
614
>
userHome: string,
615
>
target: Target = Target.Undefined,
616
>
): ChatRequestHooks {
617
>
const result: Record<string, IHookCommand[]> = {};
618
>
const targetHookMap = HOOKS_BY_TARGET[target] ?? HOOKS_BY_TARGET[Target.Undefined];
619
>
620
>
for (const prop of hooksMap.properties) {
621
>
const hookTypeName = prop.key.value;
622
>
623
>
// Resolve hook type name using the target's own map first, then fall back to canonical names
624
>
const hookType = targetHookMap[hookTypeName] ?? toHookType(hookTypeName);
625
>
if (!hookType) {
626
continue;
627
}