| 243 | } |
| 244 | |
| 245 | function getHandlerDedupeKey(handler: HookHandler): string { |
| 246 | switch (handler.type) { |
| 247 | case "command": |
| 248 | return `command:${handler.command}`; |
| 249 | case "http": |
| 250 | return `http:${handler.url}`; |
| 251 | case "prompt": |
| 252 | return `prompt:${handler.prompt}`; |
| 253 | case "agent": |
| 254 | return `agent:${handler.prompt}`; |
| 255 | default: |
| 256 | return `unknown:${JSON.stringify(handler)}`; |
| 257 | } |
| 258 | } |
| 259 | |
| 260 | function getMatcherValue(input: HookInput): string | undefined { |
| 261 | const eventName = input.hook_event_name as HookEventName; |