hermesd 2026.4.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. hermesd-2026.4.9/.gitignore +37 -0
  2. hermesd-2026.4.9/CHANGELOG.md +31 -0
  3. hermesd-2026.4.9/LICENSE +21 -0
  4. hermesd-2026.4.9/PKG-INFO +348 -0
  5. hermesd-2026.4.9/README.md +315 -0
  6. hermesd-2026.4.9/hermesd/__init__.py +1 -0
  7. hermesd-2026.4.9/hermesd/__main__.py +66 -0
  8. hermesd-2026.4.9/hermesd/app.py +331 -0
  9. hermesd-2026.4.9/hermesd/collector.py +477 -0
  10. hermesd-2026.4.9/hermesd/db.py +134 -0
  11. hermesd-2026.4.9/hermesd/models.py +132 -0
  12. hermesd-2026.4.9/hermesd/panels/__init__.py +56 -0
  13. hermesd-2026.4.9/hermesd/panels/config_panel.py +62 -0
  14. hermesd-2026.4.9/hermesd/panels/cron.py +99 -0
  15. hermesd-2026.4.9/hermesd/panels/formatting.py +9 -0
  16. hermesd-2026.4.9/hermesd/panels/gateway.py +94 -0
  17. hermesd-2026.4.9/hermesd/panels/logs.py +78 -0
  18. hermesd-2026.4.9/hermesd/panels/overview.py +123 -0
  19. hermesd-2026.4.9/hermesd/panels/sessions.py +78 -0
  20. hermesd-2026.4.9/hermesd/panels/tokens.py +67 -0
  21. hermesd-2026.4.9/hermesd/panels/tools.py +83 -0
  22. hermesd-2026.4.9/hermesd/theme.py +134 -0
  23. hermesd-2026.4.9/pyproject.toml +55 -0
  24. hermesd-2026.4.9/tests/__init__.py +0 -0
  25. hermesd-2026.4.9/tests/conftest.py +212 -0
  26. hermesd-2026.4.9/tests/test_app.py +90 -0
  27. hermesd-2026.4.9/tests/test_app_extended.py +154 -0
  28. hermesd-2026.4.9/tests/test_collector.py +124 -0
  29. hermesd-2026.4.9/tests/test_collector_extended.py +293 -0
  30. hermesd-2026.4.9/tests/test_cost_estimation.py +97 -0
  31. hermesd-2026.4.9/tests/test_cron_panel.py +115 -0
  32. hermesd-2026.4.9/tests/test_db.py +59 -0
  33. hermesd-2026.4.9/tests/test_db_extended.py +96 -0
  34. hermesd-2026.4.9/tests/test_db_resilience.py +165 -0
  35. hermesd-2026.4.9/tests/test_formatting.py +22 -0
  36. hermesd-2026.4.9/tests/test_gateway_resilience.py +134 -0
  37. hermesd-2026.4.9/tests/test_main.py +59 -0
  38. hermesd-2026.4.9/tests/test_models.py +117 -0
  39. hermesd-2026.4.9/tests/test_panels.py +143 -0
  40. hermesd-2026.4.9/tests/test_panels_extended.py +210 -0
  41. hermesd-2026.4.9/tests/test_session_active.py +124 -0
  42. hermesd-2026.4.9/tests/test_skills_panel.py +138 -0
  43. hermesd-2026.4.9/tests/test_theme.py +51 -0
  44. hermesd-2026.4.9/tests/test_tools_panel.py +71 -0
@@ -0,0 +1,37 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.egg-info/
6
+ *.egg
7
+ dist/
8
+ build/
9
+ *.whl
10
+
11
+ # Virtual environments
12
+ .venv/
13
+ venv/
14
+ env/
15
+
16
+ # Testing
17
+ .pytest_cache/
18
+ .coverage
19
+ htmlcov/
20
+ .mypy_cache/
21
+
22
+ # IDE
23
+ .vscode/
24
+ .idea/
25
+ *.swp
26
+ *.swo
27
+ *~
28
+
29
+ # OS
30
+ .DS_Store
31
+ Thumbs.db
32
+
33
+ # Claude Code / Superpowers (development artifacts)
34
+ .claude/
35
+ .remember/
36
+ .superpowers/
37
+ docs/superpowers/
@@ -0,0 +1,31 @@
1
+ # Changelog
2
+
3
+ All notable changes to hermesd will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [2026.4.9] - 2026-04-09
9
+
10
+ ### Added
11
+
12
+ - Initial release of hermesd TUI monitoring dashboard
13
+ - 8-panel overview with compact and detail views:
14
+ - [1] Gateway & Platforms — PID, version, update status, platform connection state
15
+ - [2] Sessions — active/total count, messages, tool calls, per-session detail table
16
+ - [3] Tokens / Cost — today and total token usage, estimated cost from token counts
17
+ - [4] Tools — available tools grid, per-session call stats
18
+ - [5] Config — model, provider, personality, compression, security
19
+ - [6] Cron — scheduler tick, job list with schedule/state/next-run
20
+ - [7] Skills / Providers — provider auth status, skills by category with descriptions, j/k scrolling
21
+ - [8] Logs — tailed agent/gateway/error logs with Tab switching
22
+ - Adaptive layout: single-column at 80x24 (SSH/tmux), full grid at 100+ columns
23
+ - Read-only SQLite access with `PRAGMA data_version` caching
24
+ - Cache preservation on transient errors (never blanks out on write contention)
25
+ - Auto-reconnect after 3 consecutive DB errors
26
+ - Gateway PID detection with `gateway.pid` fallback for launchd restarts
27
+ - Cost estimation from token counts when provider doesn't report costs
28
+ - Skin/theme system inheriting from Hermes Agent config
29
+ - Keyboard navigation: 1-8 expand, Esc back, j/k scroll, Tab cycle logs, r refresh, q quit
30
+ - Escape sequence handling for Ghostty/SSH/tmux environments
31
+ - 164 tests covering all panels, data collection, resilience, and edge cases
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nous Research
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,348 @@
1
+ Metadata-Version: 2.4
2
+ Name: hermesd
3
+ Version: 2026.4.9
4
+ Summary: TUI monitoring dashboard for Hermes AI agent
5
+ Project-URL: Homepage, https://github.com/mudrii/hermesd
6
+ Project-URL: Repository, https://github.com/mudrii/hermesd
7
+ Project-URL: Issues, https://github.com/mudrii/hermesd/issues
8
+ Project-URL: Changelog, https://github.com/mudrii/hermesd/blob/main/CHANGELOG.md
9
+ Author: Nous Research
10
+ Author-email: Ion Mudreac <mudreac@gmail.com>
11
+ License: MIT
12
+ License-File: LICENSE
13
+ Keywords: agent,dashboard,hermes,monitoring,terminal,tui
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Operating System :: MacOS
19
+ Classifier: Operating System :: POSIX :: Linux
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Topic :: System :: Monitoring
24
+ Classifier: Topic :: Utilities
25
+ Classifier: Typing :: Typed
26
+ Requires-Python: >=3.11
27
+ Requires-Dist: pydantic>=2.0.0
28
+ Requires-Dist: pyyaml>=6.0
29
+ Requires-Dist: rich>=14.0.0
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest>=9.0.0; extra == 'dev'
32
+ Description-Content-Type: text/markdown
33
+
34
+ # hermesd
35
+
36
+ A real-time TUI monitoring dashboard for [Hermes Agent](https://github.com/NousResearch/hermes-agent).
37
+
38
+ ![hermesd overview](images/SCR-20260409-pzqv.png)
39
+
40
+ ## Why This Exists
41
+
42
+ When you run Hermes Agent seriously — gateway handling Telegram, Discord, Slack, and WhatsApp simultaneously, cron jobs firing reminders, multiple CLI sessions with sub-agents spawning sub-agents, dozens of skills loaded, 7+ LLM providers configured — the information gets scattered fast.
43
+
44
+ **The problem:** there was no single place to answer the obvious questions:
45
+ - Is my gateway actually running? Which platforms are connected?
46
+ - How many tokens have I burned today and what's the estimated cost?
47
+ - Which sessions are active and how much context are they consuming?
48
+ - What cron jobs are scheduled, and did the last one succeed or fail?
49
+ - Which skills are installed and what do they do?
50
+ - What's in my error log right now?
51
+
52
+ The only way to answer these was running `hermes status`, `hermes sessions list`, `hermes cron list`, tailing log files, and mentally stitching together a picture from 5+ different sources. That friction adds up.
53
+
54
+ **The solution:** `hermesd` — a single terminal command that reads `~/.hermes/` and presents everything in one live-updating dashboard. Gateway health, sessions, tokens, costs, tools, cron, skills, logs — all refreshed automatically, no API keys, no network access, zero writes to your agent state.
55
+
56
+ It's not trying to replace the Hermes CLI or your Telegram interface. It's the at-a-glance overview layer that tells you whether everything is healthy and where your tokens are going — so you can make decisions without hunting for data.
57
+
58
+ ## Features
59
+
60
+ ### 8 Dashboard Panels
61
+
62
+ | # | Panel | What It Shows |
63
+ |---|-------|---------------|
64
+ | 1 | **Gateway & Platforms** | Live gateway PID, Hermes version, update status, per-platform connection dots |
65
+ | 2 | **Sessions** | Active/total count, message and tool call totals, recent session list |
66
+ | 3 | **Tokens / Cost** | Today's and all-time token usage, estimated cost (~USD) from token counts |
67
+ | 4 | **Tools** | Available tools count, per-session call stats, full tool name grid |
68
+ | 5 | **Config** | Model, provider, personality, max turns, reasoning, compression, security |
69
+ | 6 | **Cron** | Scheduler tick, job table with schedule, state, next run, error count |
70
+ | 7 | **Skills / Providers** | Provider auth status, skills grouped by category with descriptions, j/k scrolling |
71
+ | 8 | **Logs** | Tailed agent, gateway, and error logs with level coloring and Tab switching |
72
+
73
+ ### Key Features
74
+
75
+ - **Read-only** — hermesd never writes to `~/.hermes/` or modifies Hermes Agent state
76
+ - **Live-updating** — polls every 5 seconds (configurable with `--refresh-rate`)
77
+ - **Adaptive layout** — full 8-panel grid on wide terminals, compact single-column on 80x24 (SSH/tmux)
78
+ - **Detail views** — press `1`-`8` to expand any panel to full-screen
79
+ - **Scrollable lists** — `j`/`k` to scroll through skills and logs in detail mode
80
+ - **Resilient** — keeps showing last known good data on transient SQLite lock contention
81
+ - **Theme-aware** — inherits your Hermes Agent skin (default, ares, mono, slate, poseidon, sisyphus, charizard)
82
+ - **SSH/tmux compatible** — `tty.setcbreak` mode, escape sequence handling for remote terminals
83
+ - **Cost estimation** — computes ~USD from token counts when the provider doesn't report costs
84
+ - **Zero config** — no config file, no API keys, just `hermesd` and go
85
+
86
+ ## Screenshots
87
+
88
+ ### Overview — The Full Picture
89
+
90
+ The main dashboard shows all 8 panels at a glance. Gateway status with PID and version at the top, sessions and token costs side by side, tools and config, cron and skills, logs at the bottom. The footer shows keyboard shortcuts and a polling indicator.
91
+
92
+ ![Overview](images/SCR-20260409-pzqv.png)
93
+
94
+ ### [1] Gateway & Platforms — Is Everything Connected?
95
+
96
+ Press `1` to expand. Shows whether the gateway process is alive (with correct PID even after launchd restarts), Hermes version with update status, and a per-platform table with connection state and last-seen timestamps. Catches the "gateway says running but the PID is dead" case.
97
+
98
+ ![Gateway Detail](images/SCR-20260409-pzxz.png)
99
+
100
+ ### [3] Tokens / Cost — Where Are My Tokens Going?
101
+
102
+ Press `3` for the full per-session token breakdown. Shows input, output, cache-read, cache-write, and reasoning tokens for every session, plus estimated cost. The compact view shows today's totals with `~$` prefix indicating estimated costs when the provider (e.g., OpenAI Codex) doesn't report them.
103
+
104
+ ![Tokens Detail](images/SCR-20260409-qaah.png)
105
+
106
+ ### [4] Tools — What's Available and What's Being Used?
107
+
108
+ Press `4` for two tables: **Tool Calls** showing per-session call counts (which sessions are using the most tools), and **Available Tools** listing all 29 registered tools in a 3-column grid. The compact view shows the top callers.
109
+
110
+ ![Tools Detail](images/SCR-20260409-qacn.png)
111
+
112
+ ### [5] Config — Current Agent Configuration
113
+
114
+ Press `5` for the full config key-value table: model, provider, personality, max turns, reasoning effort, compression threshold, secret redaction, and approval mode. All read from `~/.hermes/config.yaml`.
115
+
116
+ ![Config Detail](images/SCR-20260409-qael.png)
117
+
118
+ ### [6] Cron — Scheduled Jobs
119
+
120
+ Press `6` to see all cron jobs with their schedule, current state, next run time, and last execution status. The compact view shows tick recency, job count, and error count. Reads from `~/.hermes/cron/jobs.json`.
121
+
122
+ ![Cron Detail](images/SCR-20260409-qbwi.png)
123
+
124
+ ### [7] Skills & Providers — What's Installed?
125
+
126
+ Press `7` for two sections: **Providers** showing auth status for each configured LLM provider (active marked with `●`), and **Skills** grouped by category with descriptions loaded from each skill's `SKILL.md` frontmatter. Use `j`/`k` to scroll through the full skill list. The scroll position indicator shows `[11-69/69]`.
127
+
128
+ ![Skills Detail](images/SCR-20260409-qbym.png)
129
+
130
+ ### [8] Logs — What Just Happened?
131
+
132
+ Press `8` for the full log viewer with three tabs: **agent**, **gateway**, and **errors**. Press `Tab` to switch between them. Log lines are color-coded by level (INFO green, WARNING orange, ERROR red). The compact view shows the last 5 agent log lines.
133
+
134
+ ![Logs Detail](images/SCR-20260409-qcgt.png)
135
+
136
+ ## Installation
137
+
138
+ Requires Python 3.11+ and a working [Hermes Agent](https://github.com/NousResearch/hermes-agent) installation (`~/.hermes/` must exist).
139
+
140
+ ### From Source (recommended)
141
+
142
+ ```bash
143
+ git clone https://github.com/mudrii/hermesd.git
144
+ cd hermesd
145
+ uv venv .venv --python 3.11
146
+ source .venv/bin/activate
147
+ uv pip install -e .
148
+ hermesd
149
+ ```
150
+
151
+ ### Via pip (from source)
152
+
153
+ ```bash
154
+ pip install git+https://github.com/mudrii/hermesd.git
155
+ hermesd
156
+ ```
157
+
158
+ ### Via uv (from source)
159
+
160
+ ```bash
161
+ uv tool install git+https://github.com/mudrii/hermesd.git
162
+ hermesd
163
+ ```
164
+
165
+ ### Docker
166
+
167
+ ```bash
168
+ docker build -t hermesd .
169
+ docker run -it -v ~/.hermes:/home/hermesd/.hermes:ro hermesd
170
+ ```
171
+
172
+ ### Nix Flake
173
+
174
+ ```bash
175
+ # Run directly
176
+ nix run github:mudrii/hermesd
177
+
178
+ # Dev shell
179
+ nix develop github:mudrii/hermesd
180
+ ```
181
+
182
+ > **Note:** PyPI publication is planned. Once published, `pip install hermesd` and `uv tool install hermesd` will work without the `git+` prefix.
183
+
184
+ ## Usage
185
+
186
+ ```bash
187
+ # Launch the dashboard (reads ~/.hermes by default)
188
+ hermesd
189
+
190
+ # Custom hermes home directory (for profiles)
191
+ hermesd --hermes-home ~/.hermes-work
192
+
193
+ # Faster polling (every 2 seconds)
194
+ hermesd --refresh-rate 2
195
+
196
+ # Disable colors
197
+ hermesd --no-color
198
+
199
+ # Show version
200
+ hermesd --version
201
+ ```
202
+
203
+ ### Environment Variables
204
+
205
+ | Variable | Default | Description |
206
+ |----------|---------|-------------|
207
+ | `HERMES_HOME` | `~/.hermes` | Override the Hermes home directory |
208
+
209
+ ## Keyboard Shortcuts
210
+
211
+ | Key | Action |
212
+ |-----|--------|
213
+ | `1`-`8` | Expand panel to full-screen detail view |
214
+ | `Esc` | Return to overview |
215
+ | `j` / `k` | Scroll down/up in detail mode |
216
+ | `Tab` | Cycle log sub-view: agent / gateway / errors (panel 8) |
217
+ | `r` | Force immediate refresh |
218
+ | `q` | Quit |
219
+ | `?` | Toggle help overlay |
220
+
221
+ ## Architecture
222
+
223
+ hermesd is a **read-only companion** — it reads files from `~/.hermes/` and never writes anything.
224
+
225
+ ```
226
+ ~/.hermes/ hermesd
227
+ state.db (SQLite WAL) ───────> db.py Read-only (mode=ro), data_version cache
228
+ gateway_state.json ──────────> collector.py JSON/YAML mtime-cached readers
229
+ gateway.pid ─────────────────>
230
+ config.yaml ─────────────────>
231
+ cron/jobs.json ──────────────>
232
+ auth.json ───────────────────>
233
+ skills/*/SKILL.md ───────────>
234
+ sessions/*.json ─────────────>
235
+ logs/*.log ──────────────────>
236
+ |
237
+ v
238
+ models.py Pydantic DashboardState
239
+ |
240
+ v
241
+ app.py Rich TUI (Live + Layout + threads)
242
+ |
243
+ v
244
+ panels/*.py 8 panel renderers (compact + detail)
245
+ ```
246
+
247
+ ### Design Decisions
248
+
249
+ | Decision | Why |
250
+ |----------|-----|
251
+ | SQLite `mode=ro` + `check_same_thread=False` | Guarantees no writes; safe for cross-thread polling/render |
252
+ | `PRAGMA data_version` caching | Skips re-reads when agent hasn't written, minimizing I/O |
253
+ | Cache preservation on error | Transient SQLite lock contention keeps last good data visible |
254
+ | Auto-reconnect after 3 errors | Recovers from WAL checkpoint invalidation |
255
+ | `gateway.pid` fallback | Detects correct PID after launchd/systemd restarts |
256
+ | `tty.setcbreak` (not `setraw`) | Preserves signal handling over SSH/tmux |
257
+ | `os.read(fd, 64)` bulk read | Captures escape sequences as single chunks |
258
+ | Cost estimation from tokens | Shows ~USD when provider doesn't report costs |
259
+ | Adaptive layout threshold | 80x24 gets compact single-column; 100+ gets full grid |
260
+
261
+ ## Themes
262
+
263
+ hermesd inherits the active skin from Hermes Agent's `config.yaml`:
264
+
265
+ | Skin | Style |
266
+ |------|-------|
267
+ | `default` | Gold/bronze on dark — the classic Hermes look |
268
+ | `ares` | Deep red with gold accents |
269
+ | `mono` | Grayscale minimalist |
270
+ | `slate` | Cool blue tones |
271
+ | `poseidon` | Ocean blue |
272
+ | `sisyphus` | Silver/stone gray |
273
+ | `charizard` | Warm orange/amber |
274
+
275
+ ## Development
276
+
277
+ ```bash
278
+ git clone https://github.com/mudrii/hermesd.git
279
+ cd hermesd
280
+ uv venv .venv --python 3.11
281
+ source .venv/bin/activate
282
+ uv pip install -e ".[dev]"
283
+
284
+ # Run tests (164 tests, <0.5s)
285
+ python -m pytest tests/ -v
286
+
287
+ # Run the dashboard
288
+ hermesd
289
+ ```
290
+
291
+ ### Project Structure
292
+
293
+ ```
294
+ hermesd/
295
+ __init__.py Version string
296
+ __main__.py CLI entry point (argparse)
297
+ app.py Rich TUI: Live context, input thread, adaptive layout
298
+ collector.py Reads all ~/.hermes data sources
299
+ db.py Read-only SQLite with data_version caching
300
+ models.py Pydantic models for dashboard state
301
+ theme.py Skin/color system matching Hermes Agent
302
+ panels/
303
+ __init__.py Panel dispatch and registry
304
+ gateway.py [1] Gateway & Platforms
305
+ sessions.py [2] Sessions
306
+ tokens.py [3] Tokens / Cost
307
+ tools.py [4] Tools
308
+ config_panel.py [5] Config
309
+ cron.py [6] Cron
310
+ overview.py [7] Skills / Providers
311
+ logs.py [8] Logs
312
+ tests/ 164 tests: panels, data, resilience, edge cases
313
+ ```
314
+
315
+ ### Adding a Panel
316
+
317
+ 1. Create `hermesd/panels/your_panel.py` with `render_*(state, theme, detail)` function
318
+ 2. Add data model to `hermesd/models.py`
319
+ 3. Collect data in `hermesd/collector.py`
320
+ 4. Register in `hermesd/panels/__init__.py`
321
+ 5. Add to layout in `hermesd/app.py`
322
+ 6. Write tests in `tests/test_your_panel.py`
323
+
324
+ ## Requirements
325
+
326
+ - **Python** >= 3.11
327
+ - **Hermes Agent** installed with `~/.hermes/` directory present
328
+ - **Terminal** with 256-color or truecolor support
329
+
330
+ ### Dependencies
331
+
332
+ Only 3 runtime dependencies — all of which are already installed as part of Hermes Agent, so hermesd adds **zero new packages** to your system:
333
+
334
+ | Package | Version | Purpose | In hermes-agent? |
335
+ |---------|---------|---------|------------------|
336
+ | `rich` | >= 14.0 | TUI rendering (Live, Layout, Panel, Table, Text) | Yes (`rich>=14.3.3`) |
337
+ | `pyyaml` | >= 6.0 | Reading config.yaml | Yes (`pyyaml>=6.0.2`) |
338
+ | `pydantic` | >= 2.0 | Data models and validation | Yes (`pydantic>=2.12.5`) |
339
+
340
+ If you install hermesd into the same environment as Hermes Agent, no additional downloads are needed.
341
+
342
+ ## License
343
+
344
+ [MIT License](LICENSE)
345
+
346
+ ## Credits
347
+
348
+ Built for [Hermes Agent](https://github.com/NousResearch/hermes-agent) by [Nous Research](https://nousresearch.com).