feat(03-01): HookEvent struct, processHookEvent mapping, UpdateFromHook, WaitType

- HookEvent struct parses Claude Code hook JSON payload
- processHookEvent maps Notification/Stop/PostToolUse/PreToolUse to State+WaitType
- UpdateFromHook creates new entries and manages WaitingSince transitions
- SessionInfo.WaitType serialized in JSON with omitempty
- 12 tests cover all event mappings, edge cases, and JSON serialization

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Pierre Martin
2026-03-23 19:40:02 +01:00
parent 10a9d95116
commit e1b176cf55
4 changed files with 357 additions and 0 deletions

View File

@@ -28,6 +28,7 @@ type SessionInfo struct {
Preview string `json:"preview"`
Workspace string `json:"workspace"`
Label string `json:"label,omitempty"`
WaitType string `json:"wait_type,omitempty"`
WaitingSince *time.Time `json:"waiting_since,omitempty"`
}