hermes-agent/gateway
teknium1 b52b37ae64 feat: add /insights command with usage analytics and cost estimation
Inspired by Claude Code's /insights, adapted for Hermes Agent's multi-platform
architecture. Analyzes session history from state.db to produce comprehensive
usage insights.

Features:
- Overview stats: sessions, messages, tokens, estimated cost, active time
- Model breakdown: per-model sessions, tokens, and cost estimation
- Platform breakdown: CLI vs Telegram vs Discord etc. (unique to Hermes)
- Tool usage ranking: most-used tools with percentages
- Activity patterns: day-of-week chart, peak hours, streaks
- Notable sessions: longest, most messages, most tokens, most tool calls
- Cost estimation: real pricing data for 25+ models (OpenAI, Anthropic,
  DeepSeek, Google, Meta) with fuzzy model name matching
- Configurable time window: --days flag (default 30)
- Source filtering: --source flag to filter by platform

Three entry points:
- /insights slash command in CLI (supports --days and --source flags)
- /insights slash command in gateway (compact markdown format)
- hermes insights CLI subcommand (standalone)

Includes 56 tests covering pricing helpers, format helpers, empty DB,
populated DB with multi-platform data, filtering, formatting, and edge cases.
2026-03-06 14:04:59 -08:00
..
platforms Merge PR #433: fix(whatsapp): replace Linux-only fuser with cross-platform port cleanup 2026-03-06 04:52:25 -08:00
__init__.py Enhance CLI with multi-platform messaging integration and configuration management 2026-02-02 19:01:51 -08:00
channel_directory.py feat: implement channel directory and message mirroring for cross-platform communication 2026-02-22 20:44:15 -08:00
config.py feat: add Home Assistant integration (REST tools + WebSocket gateway) 2026-02-28 13:32:48 +03:00
delivery.py Hermes Agent UX Improvements 2026-02-22 02:16:11 -08:00
hooks.py Add messaging platform enhancements: STT, stickers, Discord UX, Slack, pairing, hooks 2026-02-15 21:38:59 -08:00
mirror.py feat: implement channel directory and message mirroring for cross-platform communication 2026-02-22 20:44:15 -08:00
pairing.py Add messaging platform enhancements: STT, stickers, Discord UX, Slack, pairing, hooks 2026-02-15 21:38:59 -08:00
run.py feat: add /insights command with usage analytics and cost estimation 2026-03-06 14:04:59 -08:00
session.py refactor: add exception handling and docstring to has_any_sessions 2026-03-04 05:38:54 -08:00
status.py fix: prevent duplicate gateway instances from running simultaneously 2026-03-05 20:35:33 -08:00
sticker_cache.py Add messaging platform enhancements: STT, stickers, Discord UX, Slack, pairing, hooks 2026-02-15 21:38:59 -08:00