feat: display detailed session stats on exit with resume command

When quitting the CLI, users now see a comprehensive session summary:
- Total API time spent and session duration
- Total code changes (+additions/-deletions)
- Per-model token usage breakdown (input/output/cached)
- Resume command with session ID

Implementation details:
- Extended SessionStats type with apiTimeSpent, apiCallStartTime, and modelUsage
- Added startApiCall(), stopApiCall(), and addTokensWithModel() tracking functions
- Created session-stats.ts utility with formatters and generateSessionSummary()
- Updated TUI exit handler to display formatted stats
- Added mouse tracking disable to drainStdin() for cleaner exit
- Added modifiedFiles to getState() for exit summary access
This commit is contained in:
2026-02-15 12:32:36 -05:00
parent b51e3d49a6
commit 18a5eca3ae
8 changed files with 244 additions and 15 deletions

View File

@@ -465,6 +465,9 @@ bun run lint
## Recent Changes (v0.4.2)
- **Session Stats on Exit**: Displays detailed session summary when quitting:
- Total API time spent, session duration, code changes (+/-)
- Per-model token usage breakdown with resume command
- **Pink Purple Theme**: New built-in color theme
- **Activity Panel Toggle**: `Ctrl+O` to show/hide the activity panel
- **Image Paste Fix**: Fixed race condition where pasted images were silently dropped