Used by /hooks slash command to enumerate registered hooks.
()
| 102 | |
| 103 | /** Used by /hooks slash command to enumerate registered hooks. */ |
| 104 | list(): Array<{ event: HookEvent; index: number; config: HookConfig }> { |
| 105 | const events: HookEvent[] = ['PreToolUse', 'PostToolUse', 'SessionStart', 'SessionEnd', 'PreCompact']; |
| 106 | const out: Array<{ event: HookEvent; index: number; config: HookConfig }> = []; |
| 107 | for (const ev of events) { |
| 108 | const hooks = this.cfg[ev] ?? []; |
| 109 | hooks.forEach((h, i) => out.push({ event: ev, index: i, config: h })); |
| 110 | } |
| 111 | return out; |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | // Singleton wiring — bootstrap creates it; loop & slash commands read it via getter. |
no test coverage detected