* Build a dedup key for a matched hook, namespaced by source context. * * Settings-file hooks (no pluginRoot/skillRoot) share the '' prefix so the * same command defined in user/project/local still collapses to one — the * original intent of the dedup. Plugin/skill hooks get their root as the *
(m: MatchedHook, payload: string)
| 1451 | * template don't collapse: after expansion they point to different files. |
| 1452 | */ |
| 1453 | function hookDedupKey(m: MatchedHook, payload: string): string { |
| 1454 | return `${m.pluginRoot ?? m.skillRoot ?? ''}\0${payload}` |
| 1455 | } |
| 1456 | |
| 1457 | /** |
| 1458 | * Build a map of {sanitizedPluginName: hookCount} from matched hooks. |