()
| 114 | } |
| 115 | |
| 116 | async function main() { |
| 117 | const input = readHookInput(); |
| 118 | const eventName = process.argv[2] ?? input.hook_event_name ?? ""; |
| 119 | |
| 120 | if (eventName === "SessionStart") { |
| 121 | handleSessionStart(input); |
| 122 | return; |
| 123 | } |
| 124 | |
| 125 | if (eventName === "SessionEnd") { |
| 126 | await handleSessionEnd(input); |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | main().catch((error) => { |
| 131 | process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`); |
no test coverage detected