Add `hermes sessions browse` — a curses-based interactive session picker with live type-to-search filtering, arrow key navigation, and seamless session resume via Enter. Features: - Arrow keys to navigate, Enter to select and resume, Esc/q to quit - Type characters to live-filter sessions by title, preview, source, or ID - Backspace to edit filter, first Esc clears filter, second Esc exits - Adaptive column layout (title/preview, last active, source, ID) - Scrolling support for long session lists - --source flag to filter by platform (cli, telegram, discord, etc.) - --limit flag to control how many sessions to load (default: 50) - Windows fallback: numbered list with input prompt - After selection, seamlessly execs into `hermes --resume <id>` Design decisions: - Separate subcommand (not a flag on -c) — preserves `hermes -c` as-is for instant most-recent-session resume - Uses curses (not simple_term_menu) per Known Pitfalls to avoid the arrow-key ghost-duplication rendering bug in tmux/iTerm - Follows existing curses pattern from hermes_cli/tools_config.py Also fixes: removed redundant `import os` inside cmd_sessions stats block that shadowed the module-level import (would cause UnboundLocalError if browse action was taken in the same function). Tests: 33 new tests covering curses picker, fallback mode, filtering, navigation, edge cases, and argument parser registration.
21 KiB
21 KiB