claw-dashboard 1.9.0 → 2.0.0

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 (135) hide show
  1. package/.c8rc.json +38 -0
  2. package/.dockerignore +68 -0
  3. package/.github/dependabot.yml +45 -0
  4. package/.github/pull_request_template.md +39 -0
  5. package/.github/workflows/ci.yml +147 -0
  6. package/.github/workflows/release.yml +40 -0
  7. package/.github/workflows/security.yml +84 -0
  8. package/.husky/pre-commit +1 -0
  9. package/.planning/codebase/ARCHITECTURE.md +206 -0
  10. package/.planning/codebase/INTEGRATIONS.md +150 -0
  11. package/.planning/codebase/STACK.md +122 -0
  12. package/.planning/codebase/STRUCTURE.md +201 -0
  13. package/CHANGELOG.md +293 -0
  14. package/CONTRIBUTING.md +378 -0
  15. package/Dockerfile +54 -0
  16. package/FEATURES.md +195 -21
  17. package/README.md +83 -6
  18. package/TODO.md +28 -0
  19. package/build-cjs.js +127 -0
  20. package/cjs-shim.js +13 -0
  21. package/dist/clawdash +1729 -0
  22. package/dist/clawdash.meta.json +2236 -0
  23. package/dist/widgets.cjs +6511 -0
  24. package/docker-compose.yml +67 -0
  25. package/docs/API.md +1050 -0
  26. package/docs/PLUGINS.md +1504 -0
  27. package/esbuild.config.js +158 -0
  28. package/eslint.config.js +56 -0
  29. package/examples/plugins/README.md +122 -0
  30. package/examples/plugins/api-status/index.js +294 -0
  31. package/examples/plugins/api-status/plugin.json +19 -0
  32. package/examples/plugins/hello-world/index.js +104 -0
  33. package/examples/plugins/hello-world/plugin.json +15 -0
  34. package/examples/plugins/system-metrics-chart/index.js +339 -0
  35. package/examples/plugins/system-metrics-chart/plugin.json +18 -0
  36. package/examples/plugins/weather-widget/index.js +136 -0
  37. package/examples/plugins/weather-widget/plugin.json +19 -0
  38. package/index.cjs +23005 -0
  39. package/index.js +5236 -566
  40. package/jest.config.js +11 -0
  41. package/man/clawdash.1 +276 -0
  42. package/package.json +54 -5
  43. package/schemas/plugin-manifest.json +128 -0
  44. package/scripts/release.js +595 -0
  45. package/src/alerts.js +693 -0
  46. package/src/auto-save.js +584 -0
  47. package/src/cache.js +390 -0
  48. package/src/checksum.js +146 -0
  49. package/src/cli/args.js +110 -0
  50. package/src/cli/export-schedule.js +423 -0
  51. package/src/cli/export-snapshot.js +138 -0
  52. package/src/cli/help.js +69 -0
  53. package/src/cli/import-snapshot.js +230 -0
  54. package/src/cli/index.js +14 -0
  55. package/src/cli/list-templates.js +69 -0
  56. package/src/cli/validate-config.js +76 -0
  57. package/src/cli/validate-plugin.js +187 -0
  58. package/src/cli/version.js +15 -0
  59. package/src/config-validator.js +586 -0
  60. package/src/config-watcher.js +401 -0
  61. package/src/config.js +684 -0
  62. package/src/container-detector.js +499 -0
  63. package/src/database.js +734 -0
  64. package/src/differential-render.js +327 -0
  65. package/src/errors.js +169 -0
  66. package/src/export-scheduler.js +581 -0
  67. package/src/gateway-manager.js +685 -0
  68. package/src/hints.js +371 -0
  69. package/src/loading-states.js +509 -0
  70. package/src/logger.js +185 -0
  71. package/src/memory-pressure.js +467 -0
  72. package/src/performance-monitor.js +374 -0
  73. package/src/plugin-errors.js +586 -0
  74. package/src/plugin-manifest-validator.js +219 -0
  75. package/src/plugin-reload.js +481 -0
  76. package/src/plugin-scaffold.js +1941 -0
  77. package/src/plugin-validator.js +284 -0
  78. package/src/retry.js +218 -0
  79. package/src/security.js +860 -0
  80. package/src/snapshot.js +372 -0
  81. package/src/splash.js +115 -0
  82. package/src/theme-selector.js +411 -0
  83. package/src/themes.js +874 -0
  84. package/src/transitions.js +534 -0
  85. package/src/types.d.ts +174 -0
  86. package/src/validation.js +926 -0
  87. package/src/web-server.js +885 -0
  88. package/src/widgets/builtin-widgets.js +1057 -0
  89. package/src/widgets/config-processor.js +401 -0
  90. package/src/widgets/dependency-resolver.js +596 -0
  91. package/src/widgets/index.js +79 -0
  92. package/src/widgets/plugin-api.js +845 -0
  93. package/src/widgets/widget-error-boundary.js +773 -0
  94. package/src/widgets/widget-error-isolation.js +551 -0
  95. package/src/widgets/widget-loader.js +1437 -0
  96. package/src/workers/system-worker.js +130 -0
  97. package/src/workers/worker-pool.js +633 -0
  98. package/tests/alerts.test.js +437 -0
  99. package/tests/auto-save.test.js +529 -0
  100. package/tests/cache.test.js +317 -0
  101. package/tests/cli.test.js +351 -0
  102. package/tests/command-palette.test.js +320 -0
  103. package/tests/config-processor.test.js +452 -0
  104. package/tests/config-validator.test.js +710 -0
  105. package/tests/config-watcher.test.js +594 -0
  106. package/tests/config.test.js +755 -0
  107. package/tests/database.test.js +438 -0
  108. package/tests/errors.test.js +189 -0
  109. package/tests/example-plugins.test.js +624 -0
  110. package/tests/integration.test.js +1321 -0
  111. package/tests/loading-states.test.js +300 -0
  112. package/tests/manifest-validation-on-load.test.js +671 -0
  113. package/tests/performance-monitor.test.js +190 -0
  114. package/tests/plugin-api-rate-limit.test.js +302 -0
  115. package/tests/plugin-errors.test.js +311 -0
  116. package/tests/plugin-lifecycle-e2e.test.js +1036 -0
  117. package/tests/plugin-reload.test.js +764 -0
  118. package/tests/rate-limiter.test.js +539 -0
  119. package/tests/retry.test.js +308 -0
  120. package/tests/security.test.js +411 -0
  121. package/tests/settings-modal.test.js +226 -0
  122. package/tests/theme-selector.test.js +57 -0
  123. package/tests/utils.js +242 -0
  124. package/tests/utils.test.js +317 -0
  125. package/tests/validate-plugin-cli.test.js +359 -0
  126. package/tests/validation.test.js +837 -0
  127. package/tests/web-server.test.js +646 -0
  128. package/tests/widget-arrange-mode.test.js +183 -0
  129. package/tests/widget-config-hot-reload.test.js +465 -0
  130. package/tests/widget-dependency.test.js +591 -0
  131. package/tests/widget-error-boundary.test.js +749 -0
  132. package/tests/widget-error-isolation.test.js +469 -0
  133. package/tests/widget-integration.test.js +1147 -0
  134. package/tests/widget-refresh-intervals.test.js +284 -0
  135. package/tests/worker-pool.test.js +522 -0
package/FEATURES.md CHANGED
@@ -14,13 +14,53 @@
14
14
  - **Re-added by**: Cron job 2026-02-12 (mistake - should not have been re-added)
15
15
  - **Action**: NEVER implement this feature again
16
16
 
17
+ ### Disk Usage Sparkline
18
+ - **Date tried**: 2026-02-15
19
+ - **Status**: DECLINED
20
+ - **Description**: Added sparkline visualization to disk widget showing disk usage history over time
21
+ - **Reason declined**: Disk usage changes too slowly - sparkline provides no useful insight at 2s refresh intervals
22
+ - **User feedback**: "Disk usage changes slowly. Spark line kind of useless."
23
+ - **Version**: Not shipped
24
+
25
+ ### Load Average Display
26
+ - **Date tried**: 2026-02-15, 2026-02-18
27
+ - **Status**: REJECTED
28
+ - **Description**: Added 1/5/15 minute load average display to CPU widget detail line
29
+ - **Implementation**:
30
+ - Attempt 1 (2026-02-15): Added as new row in System widget (increased all widget heights)
31
+ - Attempt 2 (2026-02-18): Moved to CPU box detail line, replacing "X cores" text
32
+ - **Reason rejected**: Feature not needed
33
+ - **User feedback**: "It would be better added to the cpu box to replace the middle line instead of changing the row size" (2026-02-15), then ultimately rejected 2026-02-18
34
+ - **Version**: Not shipped
35
+
17
36
  ## Current Features (Retained)
37
+
38
+ ### Core Features
18
39
  - System stats (CPU, memory, GPU, disk, network)
19
40
  - OpenClaw sessions list
20
41
  - OpenClaw agents list
21
42
  - Uptime tracking
22
43
  - OpenClaw logs
23
44
  - Settings panel
45
+ - Web interface / Remote access (HTTP API)
46
+
47
+ ### v2.0.0 Features
48
+ - **Command Palette** (`Ctrl+K`) - Quick access to all commands
49
+ - **Widget Arrangement Mode** (`w`) - Drag-and-drop widget reordering
50
+ - **Widget Pinning** (`Alt+1-9`) - Pin favorites to top row
51
+ - **Widget Size Presets** - Small/medium/large/wide per widget
52
+ - **Dashboard Snapshots** (`Ctrl+S`/`Ctrl+O`) - Export/import state
53
+ - **Auto-save** - State persistence with backup rotation
54
+ - **Export Scheduling** - Automated cron-like metric exports
55
+ - **Plugin System** - Scaffolding CLI, hot-reload, config UI
56
+ - **Theme Selector** (`T`) - Interactive theme picker
57
+ - **Performance Metrics Overlay** (`p`) - Memory, CPU, refresh stats
58
+ - **Worker Thread Pool** - Background system info gathering
59
+ - **Memory Pressure Detection** - Long-running session health
60
+ - **Multi-gateway Support** - Multiple OpenClaw endpoints
61
+ - **Gateway Auto-retry** - Exponential backoff for reconnections
62
+ - **Widget Error Boundaries** - Isolate failures, retry UI (`X`)
63
+ - **Auto Theme Detection** - Sync with system theme
24
64
 
25
65
  ## User Preferences
26
66
  - Prefer clean, uncluttered layout
@@ -45,6 +85,8 @@ When colors show as literal text like `{green-fg}text{/green-fg}` instead of ren
45
85
  - Logs need full width to be useful
46
86
  - Avoid squeezing content into narrow columns
47
87
 
88
+ ## Feature History
89
+
48
90
  ### Network Traffic Sparkline
49
91
  - **Date tried**: 2026-02-13
50
92
  - **Status**: SHIPPED
@@ -69,7 +111,6 @@ When colors show as literal text like `{green-fg}text{/green-fg}` instead of ren
69
111
  - When paused: clock shows [PAUSED] in yellow, footer shows "▶ running"
70
112
  - When running: footer shows "p pause"
71
113
  - Help panel updated with new key binding
72
- - **User feedback**: (to be filled in)
73
114
  - **Version**: v1.7.2
74
115
 
75
116
  ### Network Traffic Sparkline Visualization
@@ -81,28 +122,8 @@ When colors show as literal text like `{green-fg}text{/green-fg}` instead of ren
81
122
  - Added combined network activity sparkline (RX + TX data) displayed below interface name
82
123
  - Uses existing network history data (30 data points, ~60 seconds of history)
83
124
  - Adjusted log box position to prevent overlap (top: 23, height: 100%-24)
84
- - **User feedback**: (to be filled in)
85
125
  - **Version**: v1.7.3
86
126
 
87
- ### Disk Usage Sparkline
88
- - **Date tried**: 2026-02-15
89
- - **Status**: DECLINED
90
- - **Description**: Added sparkline visualization to disk widget showing disk usage history over time
91
- - **Reason declined**: Disk usage changes too slowly - sparkline provides no useful insight at 2s refresh intervals
92
- - **User feedback**: "Disk usage changes slowly. Spark line kind of useless."
93
- - **Version**: Not shipped
94
-
95
- ### Load Average Display
96
- - **Date tried**: 2026-02-15, 2026-02-18
97
- - **Status**: REJECTED
98
- - **Description**: Added 1/5/15 minute load average display to CPU widget detail line
99
- - **Implementation**:
100
- - Attempt 1 (2026-02-15): Added as new row in System widget (increased all widget heights)
101
- - Attempt 2 (2026-02-18): Moved to CPU box detail line, replacing "X cores" text
102
- - **Reason rejected**: Feature not needed
103
- - **User feedback**: "It would be better added to the cpu box to replace the middle line instead of changing the row size" (2026-02-15), then ultimately rejected 2026-02-18
104
- - **Version**: Not shipped
105
-
106
127
  ### Session Sorting Feature
107
128
  - **Date tried**: 2026-02-19
108
129
  - **Status**: SHIPPED
@@ -119,6 +140,156 @@ When colors show as literal text like `{green-fg}text{/green-fg}` instead of ren
119
140
  - Updated help panel with new key binding
120
141
  - **Version**: v1.8.3
121
142
 
143
+ ### Performance Monitoring Feature
144
+ - **Date tried**: 2026-02-27
145
+ - **Status**: SHIPPED
146
+ - **Description**: Added performance metrics tracking and display for dashboard monitoring
147
+ - **Metrics tracked**:
148
+ - Memory usage (heap used/total, percentage)
149
+ - CPU usage (process-specific)
150
+ - Refresh rate
151
+ - Event loop lag
152
+ - Process uptime
153
+ - **Implementation**:
154
+ - Toggle via Settings panel ("Perf Metrics")
155
+ - When enabled, shows live metrics in footer: MEM, CPU, refresh rate
156
+ - Color-coded indicators (green/yellow/red) for memory and CPU levels
157
+ - History tracking for sparkline visualization
158
+ - **Version**: v1.9.0
159
+
160
+ ### Web Interface / Remote Access Feature
161
+ - **Date tried**: 2026-02-27
162
+ - **Status**: SHIPPED
163
+ - **Description**: Added web server mode for remote dashboard access via HTTP API
164
+ - **Implementation**:
165
+ - New `--web` CLI flag to run in web server mode (no TUI)
166
+ - New `--web-port` flag to configure the port (default: 18790)
167
+ - New `--web-host` flag to configure the bind host (default: 0.0.0.0)
168
+ - REST API endpoints: `/health`, `/metrics`, `/sessions`, `/agents`, `/logs`, `/status`
169
+ - CORS-enabled for cross-origin requests
170
+ - JSON responses for all endpoints
171
+ - Graceful shutdown handling
172
+ - **Endpoints**:
173
+ - `GET /health` - Health check with version and uptime
174
+ - `GET /metrics` - System metrics (CPU, memory, GPU, disk, network)
175
+ - `GET /sessions` - Active OpenClaw sessions
176
+ - `GET /agents` - Available OpenClaw agents
177
+ - `GET /logs` - Recent OpenClaw logs
178
+ - `GET /status` - Full dashboard status (all data combined)
179
+ - **Security**: API key authentication and rate limiting added in v2.0.0
180
+ - **Version**: v1.10.0
181
+
182
+ ### Command Palette Feature
183
+ - **Date tried**: 2026-02-28
184
+ - **Status**: SHIPPED (v2.0.0)
185
+ - **Description**: Quick access to all dashboard commands via fuzzy search overlay
186
+ - **Implementation**:
187
+ - Press `Ctrl+K` to open command palette
188
+ - Type to filter commands by name or description
189
+ - Navigate with arrow keys, select with Enter
190
+ - Categories: Navigation, Display, System, Widgets
191
+ - Shows keyboard shortcuts for each command
192
+ - **Version**: v2.0.0
193
+
194
+ ### Widget Arrangement Mode
195
+ - **Date tried**: 2026-02-28
196
+ - **Status**: SHIPPED (v2.0.0)
197
+ - **Description**: Drag-and-drop style widget reordering
198
+ - **Implementation**:
199
+ - Press `w` to enter arrangement mode
200
+ - Use arrow keys to move focused widget
201
+ - Press Escape or `w` again to exit
202
+ - Layout persists across restarts
203
+ - **Version**: v2.0.0
204
+
205
+ ### Widget Pinning Feature
206
+ - **Date tried**: 2026-02-28
207
+ - **Status**: SHIPPED (v2.0.0)
208
+ - **Description**: Pin up to 4 favorite widgets to a dedicated top row
209
+ - **Implementation**:
210
+ - Press `Alt+1` through `Alt+9` to pin/unpin widgets
211
+ - Pinned widgets appear in a fixed top row
212
+ - Independent from visibility toggles
213
+ - Useful for keeping important widgets always visible
214
+ - **Version**: v2.0.0
215
+
216
+ ### Dashboard Snapshots
217
+ - **Date tried**: 2026-02-28
218
+ - **Status**: SHIPPED (v2.0.0)
219
+ - **Description**: Export and import dashboard state as shareable JSON files
220
+ - **Implementation**:
221
+ - Press `Ctrl+S` to export current state (settings, widget visibility, sizes, positions)
222
+ - Press `Ctrl+O` to import a previously saved snapshot
223
+ - Useful for sharing configurations across machines or backing up preferences
224
+ - **Version**: v2.0.0
225
+
226
+ ### Auto-save System
227
+ - **Date tried**: 2026-02-28
228
+ - **Status**: SHIPPED (v2.0.0)
229
+ - **Description**: Automatic state persistence with crash recovery
230
+ - **Implementation**:
231
+ - Saves state every 30 seconds (configurable)
232
+ - Maintains last 5 backups with rotation
233
+ - Restores on startup: session selection, search query, favorites filter, widget focus
234
+ - Configurable via settings (interval, saveOnExit)
235
+ - **Version**: v2.0.0
236
+
237
+ ### Plugin System
238
+ - **Date tried**: 2026-02-28
239
+ - **Status**: SHIPPED (v2.0.0)
240
+ - **Description**: Extensible widget plugin architecture with scaffolding
241
+ - **Implementation**:
242
+ - Interactive scaffolding CLI: `clawdash plugin:create`
243
+ - Plugin hot-reload with `--watch` flag for development
244
+ - Plugin configuration UI in settings panel
245
+ - Manifest validation on load
246
+ - Pre-commit hooks with lint-staged
247
+ - **Version**: v2.0.0
248
+
249
+ ### Theme Selector UI
250
+ - **Date tried**: 2026-02-28
251
+ - **Status**: SHIPPED (v2.0.0)
252
+ - **Description**: Interactive theme picker with live preview
253
+ - **Implementation**:
254
+ - Press `T` to open theme selector
255
+ - Navigate with arrow keys, preview live
256
+ - Themes: default, dark, high-contrast, ocean, auto (system sync)
257
+ - Auto theme detection syncs with system theme changes
258
+ - **Version**: v2.0.0
259
+
260
+ ### Worker Thread Pool
261
+ - **Date tried**: 2026-02-28
262
+ - **Status**: SHIPPED (v2.0.0)
263
+ - **Description**: Offload heavy system info gathering to background threads
264
+ - **Implementation**:
265
+ - Configurable worker pool for systeminformation calls
266
+ - Graceful degradation when workers unavailable
267
+ - Prevents UI blocking during expensive operations
268
+ - Status shown in performance overlay
269
+ - **Version**: v2.0.0
270
+
271
+ ### Multi-gateway Support
272
+ - **Date tried**: 2026-02-28
273
+ - **Status**: SHIPPED (v2.0.0)
274
+ - **Description**: Connect to multiple OpenClaw endpoints
275
+ - **Implementation**:
276
+ - Configure multiple gateways in settings
277
+ - Visual indicator in footer shows gateway status
278
+ - Per-gateway health monitoring
279
+ - Auto-retry with exponential backoff for failed connections
280
+ - **Version**: v2.0.0
281
+
282
+ ### Widget Error Boundaries
283
+ - **Date tried**: 2026-02-28
284
+ - **Status**: SHIPPED (v2.0.0)
285
+ - **Description**: Isolate widget failures from crashing entire dashboard
286
+ - **Implementation**:
287
+ - Failed widgets show error state with retry button
288
+ - Press `X` to retry all failed widgets
289
+ - Other widgets continue operating normally
290
+ - Error details logged for debugging
291
+ - **Version**: v2.0.0
292
+
122
293
  ## Version History
123
294
  - v1.5.1: Baseline
124
295
  - v1.6.0: Session list improvements, memory calculation fix
@@ -131,3 +302,6 @@ When colors show as literal text like `{green-fg}text{/green-fg}` instead of ren
131
302
  - v1.7.5: Load average display (REJECTED)
132
303
  - v1.8.1: Session list improvements
133
304
  - v1.8.2: Session sorting feature
305
+ - v1.8.3: Session sorting enhancements
306
+ - v1.9.0: Performance monitoring, web interface
307
+ - v2.0.0: **MAJOR** - Command palette, widget system overhaul, snapshots, auto-save, plugin system, theme selector, multi-gateway, worker threads, error boundaries
package/README.md CHANGED
@@ -4,6 +4,8 @@ A beautiful, real-time terminal dashboard for monitoring OpenClaw instances —
4
4
 
5
5
  ![Dashboard Preview](https://img.shields.io/badge/OpenClaw-Dashboard-00d4aa?style=for-the-badge)
6
6
 
7
+ > **Coverage Report**: Run `npm run test:coverage` to generate detailed coverage reports in `coverage/`.
8
+
7
9
  ## ✨ Features
8
10
 
9
11
  - **🎨 Stunning Visuals**: ASCII art logo, gradient colors, donut charts, and progress bars
@@ -14,6 +16,13 @@ A beautiful, real-time terminal dashboard for monitoring OpenClaw instances —
14
16
  - **🤖 OpenClaw Integration**: Live session tracking, agent status, security audit
15
17
  - **📱 Session Management**: View all active sessions with token usage
16
18
  - **⚡ Lightweight**: Built with Node.js and blessed for minimal resource usage
19
+ - **🔄 Auto-save**: Dashboard state persists across restarts
20
+ - **📤 Export Scheduling**: Automated metric exports with cron-like scheduling
21
+ - **🎛️ Widget Arrangement**: Drag-and-drop widget reordering with `w` key
22
+ - **📌 Widget Pinning**: Pin favorite widgets to top row with `Alt+1-9`
23
+ - **📸 Snapshots**: Export/import dashboard configurations
24
+ - **🎨 Theme Selector**: Interactive theme picker with auto-detection
25
+ - **🖱️ Command Palette**: Quick access to all commands with `Ctrl+K`
17
26
 
18
27
  ## 🚀 Quick Start
19
28
 
@@ -41,20 +50,79 @@ clawdash
41
50
 
42
51
  # Or with npm start (if installed locally)
43
52
  npm start
53
+
54
+ # Run with plugin hot-reload (development)
55
+ clawdash --watch
44
56
  ```
45
57
 
46
58
  ## 🎮 Controls
47
59
 
60
+ ### Basic Controls
61
+
48
62
  | Key | Action |
49
63
  |-----|--------|
50
64
  | `q` or `Q` | Quit the dashboard |
51
65
  | `r` or `R` | Force refresh data |
52
- | `p` or `Space` | Pause/resume auto-refresh |
66
+ | `p` | Toggle performance metrics overlay |
67
+ | `P` or `Space` | Pause/resume auto-refresh |
53
68
  | `o` | Cycle session sort (time/tokens/idle/name) |
54
69
  | `?` or `h` | Toggle help panel |
55
70
  | `s` or `S` | Open/close settings panel |
56
- | `Esc` | Close settings panel (when open) |
71
+ | `Esc` | Close current modal |
57
72
  | `Ctrl+C` | Quit gracefully |
73
+ | `Ctrl+K` | Open command palette |
74
+ | `v` | Show version info |
75
+
76
+ ### Widget Controls
77
+
78
+ | Key | Action |
79
+ |-----|--------|
80
+ | `1-9` | Toggle widgets (1:CPU, 2:MEM, 3:GPU, 4:NET, 5:DISK, 6:SYS, 7:UP, 8:HLTH, 9:GATEWAY) |
81
+ | `Alt+1-9` | Pin/unpin widget to favorites row (max 4) |
82
+ | `w` | Enter widget arrangement mode (drag-and-drop) |
83
+ | `Tab` | Focus next widget |
84
+ | `Shift+Tab` | Focus previous widget |
85
+ | `Enter` | Show widget details (when widget focused) |
86
+
87
+ ### Session Controls
88
+
89
+ | Key | Action |
90
+ |-----|--------|
91
+ | `f` | Toggle favorite on current session |
92
+ | `F` | Show favorites only (filter) |
93
+ | `g` | Go to first page |
94
+ | `G` | Retry gateway connection |
95
+ | `/` | Search/filter sessions |
96
+ | `Return` | Show session detail |
97
+
98
+ ### Data & Export
99
+
100
+ | Key | Action |
101
+ |-----|--------|
102
+ | `e` | Export dashboard data (JSON/CSV) |
103
+ | `E` | Cycle export format |
104
+ | `Ctrl+S` | Export snapshot (shareable config) |
105
+ | `Ctrl+O` | Import snapshot |
106
+ | `X` | Retry failed widgets (error recovery) |
107
+
108
+ ### Navigation
109
+
110
+ | Key | Action |
111
+ |-----|--------|
112
+ | `↑`/`k` | Previous session |
113
+ | `↓`/`j` | Next session |
114
+ | `←`/`h` | Previous page |
115
+ | `→`/`l` | Next page |
116
+ | `[`/`]` | Previous/next page |
117
+ | `Ctrl+B` | Page up |
118
+ | `Ctrl+F` | Page down |
119
+
120
+ ### Theme & Display
121
+
122
+ | Key | Action |
123
+ |-----|--------|
124
+ | `t` | Cycle theme (default/dark/high-contrast/ocean) |
125
+ | `T` | Open theme selector |
58
126
 
59
127
  ### Session Sorting
60
128
 
@@ -69,10 +137,12 @@ Press `o` to cycle through different ways to sort the sessions list:
69
137
  Press `s` to open the settings panel where you can customize:
70
138
 
71
139
  - **Refresh Interval**: Toggle between 1s, 2s, 5s, or 10s
72
- - **Show Network**: Enable/disable network monitoring widget
73
- - **Show GPU**: Enable/disable GPU monitoring widget
74
- - **Show Disk**: Enable/disable disk usage widget
75
- - **Show Processes**: Enable/disable top processes widget
140
+ - **Widget Visibility**: Toggle individual widgets (1-9 keys)
141
+ - **Widget Sizes**: Choose small/medium/large/wide for each widget
142
+ - **Export Schedule**: Configure automated metric exports
143
+ - **Version Check**: Set interval for update checking (1h/6h/12h/24h/off)
144
+ - **Plugin Config**: Configure installed plugins
145
+ - **Performance Metrics**: Show/hide performance overlay in footer
76
146
 
77
147
  Settings are automatically saved to `~/.openclaw/dashboard-settings.json` and persist across sessions.
78
148
 
@@ -181,6 +251,13 @@ Recommended: **iTerm2**, **Kitty**, **Alacritty**
181
251
  - `systeminformation` - System stats
182
252
  - `chalk` - Terminal colors
183
253
 
254
+ ## 📚 Documentation
255
+
256
+ - **[CHANGELOG.md](CHANGELOG.md)** - Version history and release notes
257
+ - **[docs/API.md](docs/API.md)** - Internal API documentation for modules
258
+ - **[TODO.md](TODO.md)** - Planned features and development roadmap
259
+ - **[FEATURES.md](FEATURES.md)** - Detailed feature documentation
260
+
184
261
  ## 🤝 Contributing
185
262
 
186
263
  Issues and PRs welcome at [github.com/openclaw/claw-dashboard](https://github.com/openclaw/claw-dashboard)
package/TODO.md ADDED
@@ -0,0 +1,28 @@
1
+ ## TODO
2
+
3
+ ## Backlog
4
+
5
+ - Document command palette feature in README.md
6
+ - Integration test for command palette execution flow
7
+ - E2E test for Ctrl+K keybinding
8
+ - Plugin marketplace/discovery - Community registry index
9
+ - Session quick-switcher - Ctrl+K fuzzy finder for profiles
10
+ - WebSocket support - Push-based real-time updates
11
+ - Multiple dashboard profiles - Tabbed navigation
12
+ - Widget grouping/collapsing - Organize dense dashboards
13
+ - Conditional widget visibility - Show/hide based on data thresholds
14
+ - Dashboard layout templates - Preset layouts for different roles
15
+ - Historical data persistence - SQLite/LevelDB backend
16
+ - Trend indicators - Compare vs historical averages
17
+ - Anomaly detection alerts - Automatic spike detection
18
+ - Webhook notifications - Threshold breach alerts (Slack/Discord)
19
+ - OpenClaw event stream - Consume events from gateway
20
+ - Plugin sandbox - Node.js VM isolation
21
+ - Widget playground - Live preview during development
22
+ - Plugin publishing CLI - npm-style workflow
23
+
24
+ ## Technical Debt
25
+
26
+ - Test coverage - Improve from ~43% to 70%+
27
+ - TypeScript migration - Start with validation.js/security.js
28
+ - JSDoc completion - Complete PluginAPI public methods
package/build-cjs.js ADDED
@@ -0,0 +1,127 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Build CJS wrappers for dual-package exports
5
+ * Creates CJS versions of ESM modules for backward compatibility
6
+ */
7
+
8
+ import * as esbuild from 'esbuild';
9
+ import { writeFileSync, mkdirSync, existsSync, readFileSync } from 'fs';
10
+ import { dirname, join } from 'path';
11
+ import { fileURLToPath } from 'url';
12
+
13
+ const __filename = fileURLToPath(import.meta.url);
14
+ const __dirname = dirname(__filename);
15
+
16
+ // Custom plugin to replace import.meta.url with a CJS-compatible version
17
+ const cjsImportMetaPlugin = {
18
+ name: 'cjs-import-meta',
19
+ setup(build) {
20
+ // Filter only JS files
21
+ const filter = /\.js$/;
22
+
23
+ build.onLoad({ filter }, async (args) => {
24
+ const contents = await readFileSync(args.path, 'utf8');
25
+
26
+ // Replace import.meta.url with a CJS-compatible expression
27
+ // We use process.cwd() as fallback since we can't know the actual file location
28
+ const newContents = contents.replace(
29
+ /import\.meta\.url/g,
30
+ "'file://' + (typeof __dirname !== 'undefined' ? require('path').join(__dirname, 'index.js').replace(/\\\\/g, '/') : process.cwd() + '/index.js')"
31
+ );
32
+
33
+ return { contents: newContents, loader: 'js' };
34
+ });
35
+ },
36
+ };
37
+
38
+ // Build config for widgets CJS bundle
39
+ const widgetsCjsConfig = {
40
+ entryPoints: ['src/widgets/index.js'],
41
+ bundle: true,
42
+ platform: 'node',
43
+ target: 'node18',
44
+ outfile: 'dist/widgets.cjs',
45
+ format: 'cjs',
46
+ external: ['blessed', 'blessed-contrib', 'systeminformation'],
47
+ minify: false,
48
+ sourcemap: false,
49
+ plugins: [cjsImportMetaPlugin],
50
+ };
51
+
52
+ // Build config for main CJS bundle
53
+ const mainCjsConfig = {
54
+ entryPoints: ['index.js'],
55
+ bundle: true,
56
+ platform: 'node',
57
+ target: 'node18',
58
+ outfile: 'index.cjs',
59
+ format: 'cjs',
60
+ external: ['blessed', 'blessed-contrib', 'systeminformation'],
61
+ minify: false,
62
+ sourcemap: false,
63
+ plugins: [cjsImportMetaPlugin],
64
+ };
65
+
66
+ async function buildCjs(config, name) {
67
+ console.log(`Building CJS ${name}...`);
68
+ try {
69
+ const result = await esbuild.build({
70
+ ...config,
71
+ write: false,
72
+ });
73
+
74
+ let output = result.outputFiles[0].text;
75
+
76
+ // Extract shebang if present (must be at the very start)
77
+ let shebang = '';
78
+ const shebangMatch = output.match(/^#![^\n]*\n/);
79
+ if (shebangMatch) {
80
+ shebang = shebangMatch[0];
81
+ output = output.slice(shebang.length);
82
+ }
83
+
84
+ // Also remove any shebang that might appear later in the file
85
+ output = output.replace(/#![^\n]*\n/g, '');
86
+
87
+ // Post-process: add __dirname polyfill at the start of the bundle
88
+ const polyfill = `// Polyfill for __dirname in CJS bundle
89
+ var path = require('path');
90
+ var __filename = process.argv[1] || process.cwd() + '/index.js';
91
+ var __dirname = path.dirname(__filename);
92
+ `;
93
+
94
+ // Add shebang first, then polyfill after 'use strict' if present
95
+ if (output.startsWith('"use strict";')) {
96
+ output = shebang + '"use strict";\n' + polyfill + output.slice('"use strict";'.length);
97
+ } else {
98
+ output = shebang + polyfill + output;
99
+ }
100
+
101
+ writeFileSync(config.outfile, output, { mode: 0o755 });
102
+ console.log(`✓ CJS ${name} built: ${config.outfile}`);
103
+ return true;
104
+ } catch (error) {
105
+ console.error(`✗ CJS ${name} build failed:`, error.message);
106
+ return false;
107
+ }
108
+ }
109
+
110
+ async function main() {
111
+ // Ensure dist directory exists
112
+ if (!existsSync('dist')) {
113
+ mkdirSync('dist', { recursive: true });
114
+ }
115
+
116
+ const widgetsResult = await buildCjs(widgetsCjsConfig, 'widgets');
117
+ const mainResult = await buildCjs(mainCjsConfig, 'main');
118
+
119
+ if (widgetsResult && mainResult) {
120
+ console.log('✓ All CJS builds completed');
121
+ process.exit(0);
122
+ } else {
123
+ process.exit(1);
124
+ }
125
+ }
126
+
127
+ main();
package/cjs-shim.js ADDED
@@ -0,0 +1,13 @@
1
+ // CJS shim for import.meta.url polyfill
2
+ // This file is injected into CJS builds to provide __dirname
3
+
4
+ const path = require('path');
5
+ const { fileURLToPath } = require('url');
6
+
7
+ // Check if we're in a bundled environment or regular CJS
8
+ if (typeof __filename === 'undefined') {
9
+ // In bundled CJS, process.cwd() is used
10
+ global.__dirname = path.dirname(process.execPath);
11
+ } else {
12
+ global.__dirname = path.dirname(__filename);
13
+ }