feat: add session_start and session_end hook events - #50
Conversation
Fire session_start once after REPL boot and session_end on graceful quit so users can notify/log around a whole session lifecycle.
|
🤖 KlaatAI Review Bot (powered by Klaatu, advisory only — a maintainer makes the real call) Issue match Test coverage Correctness concerns
Verdict This is an automated review to help triage faster, not a gate. Nothing here blocks merging. |
|
session_start runs once when the app starts up Writing these tests now also gives us a safety net if we later change how quitting works — we'd know right away if session_end stopped firing. |
Extract createSessionLifecycle so we can assert session_start fires once at boot and session_end fires once across repeated quit triggers (/exit, Ctrl+D, Ctrl+C all call quit → end).
|
@Prateekgaur thanks — added tests covering exactly those cases:
Extracted a small |
Summary
session_start/session_endto the hooks lifecycle (closes Add session_start/session_end hook events #9).session_startfires once after boot (before the first prompt);session_endfires on graceful quit (/exit, Ctrl+D, Ctrl+C)./hookshelp and README document the new events.Test plan
bun run typecheckbun testbun run buildsession_start/session_endin.klaatai/hooks.json, start and quit the TUI, confirm both fire once