claw-dashboard 2.1.0 → 2.2.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.
- package/CHANGELOG.md +29 -1
- package/docs/API.md +1 -2
- package/index.js +32 -42
- package/package.json +23 -12
- package/src/auto-save.js +11 -5
- package/src/cli/export-snapshot.js +3 -1
- package/src/cli/import-snapshot.js +3 -1
- package/src/config.js +9 -15
- package/src/errors.js +0 -9
- package/src/security.js +6 -2
- package/src/snapshot.js +73 -26
- package/src/web-server.js +7 -10
- package/src/widgets/builtin-widgets.js +0 -94
- package/src/widgets/index.js +0 -1
- package/.c8rc.json +0 -38
- package/.dockerignore +0 -68
- package/.github/dependabot.yml +0 -45
- package/.github/pull_request_template.md +0 -39
- package/.github/workflows/ci.yml +0 -147
- package/.github/workflows/release.yml +0 -40
- package/.github/workflows/security.yml +0 -84
- package/.husky/pre-commit +0 -1
- package/.planning/codebase/ARCHITECTURE.md +0 -206
- package/.planning/codebase/INTEGRATIONS.md +0 -150
- package/.planning/codebase/STACK.md +0 -122
- package/.planning/codebase/STRUCTURE.md +0 -201
- package/CONTRIBUTING.md +0 -378
- package/Dockerfile +0 -54
- package/FEATURES.md +0 -307
- package/TODO.md +0 -28
- package/ai.openclaw.dashboard.plist +0 -35
- package/build-cjs.js +0 -127
- package/cjs-shim.js +0 -13
- package/dist/clawdash +0 -1729
- package/dist/clawdash.meta.json +0 -2236
- package/dist/widgets.cjs +0 -6511
- package/docker-compose.yml +0 -67
- package/esbuild.config.js +0 -158
- package/eslint.config.js +0 -56
- package/examples/plugins/README.md +0 -122
- package/examples/plugins/api-status/index.js +0 -294
- package/examples/plugins/api-status/plugin.json +0 -19
- package/examples/plugins/hello-world/index.js +0 -104
- package/examples/plugins/hello-world/plugin.json +0 -15
- package/examples/plugins/system-metrics-chart/index.js +0 -339
- package/examples/plugins/system-metrics-chart/plugin.json +0 -18
- package/examples/plugins/weather-widget/index.js +0 -136
- package/examples/plugins/weather-widget/plugin.json +0 -19
- package/index.cjs +0 -23005
- package/jest.config.js +0 -11
- package/scripts/release.js +0 -595
- package/src/database.js +0 -734
- package/tests/alerts.test.js +0 -437
- package/tests/auto-save.test.js +0 -529
- package/tests/cache.test.js +0 -317
- package/tests/cli.test.js +0 -351
- package/tests/command-palette.test.js +0 -320
- package/tests/config-processor.test.js +0 -452
- package/tests/config-validator.test.js +0 -710
- package/tests/config-watcher.test.js +0 -594
- package/tests/config.test.js +0 -755
- package/tests/database.test.js +0 -438
- package/tests/errors.test.js +0 -189
- package/tests/example-plugins.test.js +0 -624
- package/tests/integration.test.js +0 -1321
- package/tests/loading-states.test.js +0 -300
- package/tests/manifest-validation-on-load.test.js +0 -671
- package/tests/performance-monitor.test.js +0 -190
- package/tests/plugin-api-rate-limit.test.js +0 -302
- package/tests/plugin-errors.test.js +0 -311
- package/tests/plugin-lifecycle-e2e.test.js +0 -1036
- package/tests/plugin-reload.test.js +0 -764
- package/tests/rate-limiter.test.js +0 -539
- package/tests/retry.test.js +0 -308
- package/tests/security.test.js +0 -411
- package/tests/settings-modal.test.js +0 -226
- package/tests/theme-selector.test.js +0 -57
- package/tests/utils.js +0 -242
- package/tests/utils.test.js +0 -317
- package/tests/validate-plugin-cli.test.js +0 -359
- package/tests/validation.test.js +0 -837
- package/tests/web-server.test.js +0 -646
- package/tests/widget-arrange-mode.test.js +0 -183
- package/tests/widget-config-hot-reload.test.js +0 -465
- package/tests/widget-dependency.test.js +0 -591
- package/tests/widget-error-boundary.test.js +0 -749
- package/tests/widget-error-isolation.test.js +0 -469
- package/tests/widget-integration.test.js +0 -1147
- package/tests/widget-refresh-intervals.test.js +0 -284
- package/tests/worker-pool.test.js +0 -522
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
name: Security Audit
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [main, dev]
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: [main]
|
|
8
|
-
schedule:
|
|
9
|
-
# Run daily at 2:00 AM UTC
|
|
10
|
-
- cron: '0 2 * * *'
|
|
11
|
-
workflow_dispatch:
|
|
12
|
-
|
|
13
|
-
jobs:
|
|
14
|
-
npm-audit:
|
|
15
|
-
name: NPM Audit
|
|
16
|
-
runs-on: ubuntu-latest
|
|
17
|
-
|
|
18
|
-
steps:
|
|
19
|
-
- name: Checkout code
|
|
20
|
-
uses: actions/checkout@v6
|
|
21
|
-
|
|
22
|
-
- name: Setup Node.js
|
|
23
|
-
uses: actions/setup-node@v6
|
|
24
|
-
with:
|
|
25
|
-
node-version: 20
|
|
26
|
-
cache: 'npm'
|
|
27
|
-
|
|
28
|
-
- name: Install dependencies
|
|
29
|
-
run: npm ci
|
|
30
|
-
|
|
31
|
-
- name: Run npm audit
|
|
32
|
-
run: |
|
|
33
|
-
npm audit --audit-level=moderate || exit_code=$?
|
|
34
|
-
if [ "${exit_code:-0}" -eq 0 ]; then
|
|
35
|
-
echo "No vulnerabilities found"
|
|
36
|
-
elif [ "${exit_code:-0}" -eq 1 ]; then
|
|
37
|
-
echo "Vulnerabilities found! See above for details."
|
|
38
|
-
exit 1
|
|
39
|
-
fi
|
|
40
|
-
|
|
41
|
-
dependency-review:
|
|
42
|
-
name: Dependency Review
|
|
43
|
-
runs-on: ubuntu-latest
|
|
44
|
-
if: github.event_name == 'pull_request'
|
|
45
|
-
|
|
46
|
-
steps:
|
|
47
|
-
- name: Checkout code
|
|
48
|
-
uses: actions/checkout@v6
|
|
49
|
-
|
|
50
|
-
- name: Dependency Review
|
|
51
|
-
uses: actions/dependency-review-action@v4
|
|
52
|
-
with:
|
|
53
|
-
fail-on-severity: moderate
|
|
54
|
-
comment-summary-in-pr: true
|
|
55
|
-
|
|
56
|
-
codeql-analysis:
|
|
57
|
-
name: CodeQL Analysis
|
|
58
|
-
runs-on: ubuntu-latest
|
|
59
|
-
permissions:
|
|
60
|
-
actions: read
|
|
61
|
-
contents: read
|
|
62
|
-
security-events: write
|
|
63
|
-
|
|
64
|
-
strategy:
|
|
65
|
-
fail-fast: false
|
|
66
|
-
matrix:
|
|
67
|
-
language: ['javascript']
|
|
68
|
-
|
|
69
|
-
steps:
|
|
70
|
-
- name: Checkout code
|
|
71
|
-
uses: actions/checkout@v6
|
|
72
|
-
|
|
73
|
-
- name: Initialize CodeQL
|
|
74
|
-
uses: github/codeql-action/init@v4
|
|
75
|
-
with:
|
|
76
|
-
languages: ${{ matrix.language }}
|
|
77
|
-
|
|
78
|
-
- name: Autobuild
|
|
79
|
-
uses: github/codeql-action/autobuild@v4
|
|
80
|
-
|
|
81
|
-
- name: Perform CodeQL Analysis
|
|
82
|
-
uses: github/codeql-action/analyze@v4
|
|
83
|
-
with:
|
|
84
|
-
category: "/language:${{matrix.language}}"
|
package/.husky/pre-commit
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
npx lint-staged
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
# Architecture
|
|
2
|
-
|
|
3
|
-
**Analysis Date:** 2026-02-28
|
|
4
|
-
|
|
5
|
-
## Pattern Overview
|
|
6
|
-
|
|
7
|
-
**Overall:** Modular widget-based terminal dashboard with plugin architecture
|
|
8
|
-
|
|
9
|
-
**Key Characteristics:**
|
|
10
|
-
- Widget-based UI components using blessed framework
|
|
11
|
-
- Plugin system with lazy loading and hot-reload
|
|
12
|
-
- Event-driven architecture (EventEmitter pattern)
|
|
13
|
-
- Worker thread pool for heavy system operations
|
|
14
|
-
- Rate limiting throughout API access
|
|
15
|
-
- Comprehensive error boundaries
|
|
16
|
-
|
|
17
|
-
## Layers
|
|
18
|
-
|
|
19
|
-
**Application Layer:**
|
|
20
|
-
- Purpose: Entry point, CLI parsing, main dashboard orchestration
|
|
21
|
-
- Location: `index.js`
|
|
22
|
-
- Contains: Main screen setup, keyboard handlers, initialization sequence
|
|
23
|
-
- Depends on: All other layers
|
|
24
|
-
- Used by: CLI binary
|
|
25
|
-
|
|
26
|
-
**Widget Layer:**
|
|
27
|
-
- Purpose: UI components and plugin system
|
|
28
|
-
- Location: `src/widgets/`
|
|
29
|
-
- Contains: BaseWidget class, PluginAPI, WidgetLoader, built-in widgets
|
|
30
|
-
- Depends on: blessed, blessed-contrib
|
|
31
|
-
- Used by: Application layer
|
|
32
|
-
|
|
33
|
-
**Service Layer:**
|
|
34
|
-
- Purpose: Business logic, data fetching, caching
|
|
35
|
-
- Location: `src/*.js` (non-widget files)
|
|
36
|
-
- Contains: gateway-manager, database, cache, themes, alerts, validation
|
|
37
|
-
- Depends on: systeminformation, sql.js
|
|
38
|
-
- Used by: Widgets and Application
|
|
39
|
-
|
|
40
|
-
**Worker Layer:**
|
|
41
|
-
- Purpose: Offload heavy system calls to threads
|
|
42
|
-
- Location: `src/workers/`
|
|
43
|
-
- Contains: WorkerPool, system-worker
|
|
44
|
-
- Depends on: Node.js worker_threads
|
|
45
|
-
- Used by: Application layer for system metrics
|
|
46
|
-
|
|
47
|
-
**Data Layer:**
|
|
48
|
-
- Purpose: Persistence and caching
|
|
49
|
-
- Location: `src/database.js`, `src/cache.js`
|
|
50
|
-
- Contains: SQLite persistence, in-memory caching
|
|
51
|
-
- Depends on: sql.js, fs
|
|
52
|
-
- Used by: Service layer
|
|
53
|
-
|
|
54
|
-
## Data Flow
|
|
55
|
-
|
|
56
|
-
**System Metrics Flow:**
|
|
57
|
-
|
|
58
|
-
1. Widget requests data via PluginAPI
|
|
59
|
-
2. PluginAPI checks rate limiter
|
|
60
|
-
3. Widget calls getData() which may use:
|
|
61
|
-
- Worker pool for systeminformation calls
|
|
62
|
-
- Cache for recent data
|
|
63
|
-
- Direct fetch for real-time data
|
|
64
|
-
4. Data returns to widget
|
|
65
|
-
5. Widget renders to blessed elements
|
|
66
|
-
|
|
67
|
-
**Gateway Data Flow:**
|
|
68
|
-
|
|
69
|
-
1. GatewayManager initialized with endpoints
|
|
70
|
-
2. Periodic fetch from `/api/sessions`, `/api/agents`
|
|
71
|
-
3. Checksum verification (optional)
|
|
72
|
-
4. Data aggregated from multiple endpoints
|
|
73
|
-
5. Stored in SQLite database
|
|
74
|
-
6. Widgets query database for display
|
|
75
|
-
|
|
76
|
-
**Widget Plugin Flow:**
|
|
77
|
-
|
|
78
|
-
1. WidgetLoader discovers plugins from `~/.openclaw/plugins/`
|
|
79
|
-
2. Manifest validated (`src/plugin-manifest-validator.js`)
|
|
80
|
-
3. Dependencies resolved (`src/widgets/dependency-resolver.js`)
|
|
81
|
-
4. Widget class loaded dynamically
|
|
82
|
-
5. BaseWidget lifecycle: init -> create -> getData -> render -> destroy
|
|
83
|
-
6. Config watcher enables hot-reload
|
|
84
|
-
|
|
85
|
-
## Key Abstractions
|
|
86
|
-
|
|
87
|
-
**BaseWidget:**
|
|
88
|
-
- Purpose: Base class for all widgets
|
|
89
|
-
- Location: `src/widgets/plugin-api.js` (class BaseWidget)
|
|
90
|
-
- Pattern: Template method pattern with lifecycle hooks
|
|
91
|
-
- Methods: init(), create(screen, theme), getData(), render(data), destroy()
|
|
92
|
-
|
|
93
|
-
**PluginAPI:**
|
|
94
|
-
- Purpose: Stable API for widget development
|
|
95
|
-
- Location: `src/widgets/plugin-api.js`
|
|
96
|
-
- Pattern: Facade pattern with rate limiting
|
|
97
|
-
- Extension points: registerExtensionPoint(), extend(), registerProvider()
|
|
98
|
-
|
|
99
|
-
**WidgetLoader:**
|
|
100
|
-
- Purpose: Lazy loading and plugin management
|
|
101
|
-
- Location: `src/widgets/widget-loader.js`
|
|
102
|
-
- Pattern: Registry + Factory pattern
|
|
103
|
-
- Features: Priority-based loading, dependency resolution, hot-reload
|
|
104
|
-
|
|
105
|
-
**GatewayManager:**
|
|
106
|
-
- Purpose: Multi-endpoint gateway aggregation
|
|
107
|
-
- Location: `src/gateway-manager.js`
|
|
108
|
-
- Pattern: Manager pattern with aggregation
|
|
109
|
-
- Features: Checksum verification, retry logic, endpoint health tracking
|
|
110
|
-
|
|
111
|
-
**Error Boundaries:**
|
|
112
|
-
- Purpose: Isolate widget failures
|
|
113
|
-
- Location: `src/widgets/widget-error-boundary.js`
|
|
114
|
-
- Pattern: Decorator pattern
|
|
115
|
-
- Features: Per-widget error isolation, automatic retry
|
|
116
|
-
|
|
117
|
-
## Entry Points
|
|
118
|
-
|
|
119
|
-
**Main Entry:**
|
|
120
|
-
- Location: `index.js`
|
|
121
|
-
- Triggers: CLI execution (`clawdash` or `node index.js`)
|
|
122
|
-
- Responsibilities:
|
|
123
|
-
- Parse CLI args (`src/cli/index.js`)
|
|
124
|
-
- Initialize database
|
|
125
|
-
- Setup blessed screen
|
|
126
|
-
- Load widgets via WidgetLoader
|
|
127
|
-
- Setup keyboard handlers
|
|
128
|
-
- Start refresh loop
|
|
129
|
-
|
|
130
|
-
**CLI Commands:**
|
|
131
|
-
- Location: `src/cli/`
|
|
132
|
-
- Files: args.js, help.js, version.js, validate-plugin.js, validate-config.js
|
|
133
|
-
- Exports centralized in: `src/cli/index.js`
|
|
134
|
-
|
|
135
|
-
**Worker Entry:**
|
|
136
|
-
- Location: `src/workers/system-worker.js`
|
|
137
|
-
- Triggers: WorkerPool initialization
|
|
138
|
-
- Responsibilities: Execute systeminformation calls in separate threads
|
|
139
|
-
|
|
140
|
-
## State Management
|
|
141
|
-
|
|
142
|
-
**Theme State:**
|
|
143
|
-
- File: `src/themes.js`
|
|
144
|
-
- Pattern: Singleton with observer pattern
|
|
145
|
-
- Detection: Auto-detects system dark/light mode
|
|
146
|
-
- Persistence: Settings file
|
|
147
|
-
|
|
148
|
-
**Settings State:**
|
|
149
|
-
- File: `src/config.js` (constants), `src/validation.js` (validation)
|
|
150
|
-
- Pattern: Immutable constants with validation
|
|
151
|
-
- Storage: JSON file at `~/.openclaw/dashboard-settings.json`
|
|
152
|
-
|
|
153
|
-
**Widget State:**
|
|
154
|
-
- File: `src/widgets/widget-loader.js`
|
|
155
|
-
- Pattern: Registry with metadata
|
|
156
|
-
- Storage: In-memory Map instances
|
|
157
|
-
|
|
158
|
-
**Performance State:**
|
|
159
|
-
- File: `src/performance-monitor.js`
|
|
160
|
-
- Pattern: Observer with periodic sampling
|
|
161
|
-
- Metrics: Memory usage, worker pool stats
|
|
162
|
-
|
|
163
|
-
## Error Handling
|
|
164
|
-
|
|
165
|
-
**Strategy:** Hierarchical error classes with boundary isolation
|
|
166
|
-
|
|
167
|
-
**Patterns:**
|
|
168
|
-
- Custom error hierarchy: `DashboardError` -> specific errors
|
|
169
|
-
- Widget error boundaries isolate failures
|
|
170
|
-
- Plugin error analyzer for debugging
|
|
171
|
-
- Rate-limited error reporting
|
|
172
|
-
|
|
173
|
-
**Error Classes:**
|
|
174
|
-
- `src/errors.js`: DashboardError, ConfigError, SettingsError, GatewayError, etc.
|
|
175
|
-
- `src/plugin-errors.js`: PluginError, PluginErrorAnalyzer
|
|
176
|
-
|
|
177
|
-
## Cross-Cutting Concerns
|
|
178
|
-
|
|
179
|
-
**Logging:**
|
|
180
|
-
- Location: `src/logger.js`
|
|
181
|
-
- Pattern: Centralized with level filtering
|
|
182
|
-
- Output: Console + file (`~/.openclaw/claw-dashboard.log`)
|
|
183
|
-
|
|
184
|
-
**Validation:**
|
|
185
|
-
- Location: `src/validation.js`
|
|
186
|
-
- Pattern: Schema-based with detailed error messages
|
|
187
|
-
- Scope: Settings, file paths, refresh intervals
|
|
188
|
-
|
|
189
|
-
**Security:**
|
|
190
|
-
- Location: `src/security.js`
|
|
191
|
-
- Pattern: Input sanitization + path validation
|
|
192
|
-
- Features: Path traversal prevention, file permission management
|
|
193
|
-
|
|
194
|
-
**Rate Limiting:**
|
|
195
|
-
- Location: `src/alerts.js` (RateLimiter class)
|
|
196
|
-
- Pattern: Token bucket per category
|
|
197
|
-
- Integration: PluginAPI uses for API calls
|
|
198
|
-
|
|
199
|
-
**Caching:**
|
|
200
|
-
- Location: `src/cache.js`
|
|
201
|
-
- Pattern: TTL-based with category-specific timeouts
|
|
202
|
-
- Features: Debounce, throttle, memoization
|
|
203
|
-
|
|
204
|
-
---
|
|
205
|
-
|
|
206
|
-
*Architecture analysis: 2026-02-28*
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
# External Integrations
|
|
2
|
-
|
|
3
|
-
**Analysis Date:** 2026-02-28
|
|
4
|
-
|
|
5
|
-
## APIs & External Services
|
|
6
|
-
|
|
7
|
-
**OpenClaw Gateway (Primary Integration):**
|
|
8
|
-
- Default endpoint: localhost:18789
|
|
9
|
-
- Protocol: HTTPS with optional token authentication
|
|
10
|
-
- Endpoints queried:
|
|
11
|
-
- `/api/sessions` - Active session list
|
|
12
|
-
- `/api/agents` - Available agents
|
|
13
|
-
- `/api/logs` - Log entries
|
|
14
|
-
- File: `src/gateway-manager.js`
|
|
15
|
-
|
|
16
|
-
**System Information (systeminformation library):**
|
|
17
|
-
- CPU: load, usage, temperature
|
|
18
|
-
- Memory: total, used, free, swap
|
|
19
|
-
- GPU: NVIDIA (nvidia-smi), AMD (radeontop), Intel, WSL
|
|
20
|
-
- Network: interfaces, speed, stats
|
|
21
|
-
- Disk: filesystems, IO, usage
|
|
22
|
-
- OS: uptime, hostname, platform
|
|
23
|
-
- File: Uses `systeminformation` npm package
|
|
24
|
-
|
|
25
|
-
**No External Cloud Services:**
|
|
26
|
-
- No telemetry or analytics services
|
|
27
|
-
- No external logging services
|
|
28
|
-
- No cloud-based configuration
|
|
29
|
-
|
|
30
|
-
## Data Storage
|
|
31
|
-
|
|
32
|
-
**Local SQLite Database:**
|
|
33
|
-
- Library: sql.js (WebAssembly SQLite)
|
|
34
|
-
- Path: `~/.openclaw/dashboard-history.db`
|
|
35
|
-
- Tables: session_snapshots, cpu_metrics, memory_metrics, network_metrics
|
|
36
|
-
- File: `src/database.js`
|
|
37
|
-
|
|
38
|
-
**JSON Configuration:**
|
|
39
|
-
- Settings: `~/.openclaw/dashboard-settings.json`
|
|
40
|
-
- Persistent state across restarts
|
|
41
|
-
- File: `src/config.js`, `src/validation.js`
|
|
42
|
-
|
|
43
|
-
**File Storage:**
|
|
44
|
-
- Local filesystem only
|
|
45
|
-
- Export directory: `~/.openclaw/exports/`
|
|
46
|
-
- Plugin directory: `~/.openclaw/plugins/`
|
|
47
|
-
|
|
48
|
-
**Caching:**
|
|
49
|
-
- In-memory cache with TTL
|
|
50
|
-
- Categories: cpu, memory, gpu, network, disk, system, container
|
|
51
|
-
- File: `src/cache.js`
|
|
52
|
-
|
|
53
|
-
## Authentication & Identity
|
|
54
|
-
|
|
55
|
-
**Gateway Authentication:**
|
|
56
|
-
- Token-based (optional per endpoint)
|
|
57
|
-
- Header: Authorization Bearer token
|
|
58
|
-
- File: `src/gateway-manager.js`
|
|
59
|
-
|
|
60
|
-
**Web Interface Auth (Optional):**
|
|
61
|
-
- API key authentication (disabled by default)
|
|
62
|
-
- Key format: `cd_[a-zA-Z0-9]{32}`
|
|
63
|
-
- Max 10 keys, hashed in storage
|
|
64
|
-
- File: `src/web-server.js`
|
|
65
|
-
|
|
66
|
-
**File Permissions:**
|
|
67
|
-
- Settings/database: 0600 (owner read/write only)
|
|
68
|
-
- File: `src/security.js`
|
|
69
|
-
|
|
70
|
-
## Monitoring & Observability
|
|
71
|
-
|
|
72
|
-
**Error Tracking:**
|
|
73
|
-
- Custom error classes (DashboardError hierarchy)
|
|
74
|
-
- Centralized error handling in widgets
|
|
75
|
-
- Plugin error boundary with isolation
|
|
76
|
-
- File: `src/errors.js`, `src/plugin-errors.js`, `src/widgets/widget-error-boundary.js`
|
|
77
|
-
|
|
78
|
-
**Logging:**
|
|
79
|
-
- Local log file: `~/.openclaw/claw-dashboard.log`
|
|
80
|
-
- Logger: `src/logger.js`
|
|
81
|
-
- Levels: error, warn, info, debug
|
|
82
|
-
- Console output during development
|
|
83
|
-
|
|
84
|
-
**Performance Monitoring:**
|
|
85
|
-
- Worker pool metrics
|
|
86
|
-
- Memory pressure detection
|
|
87
|
-
- Widget render timing
|
|
88
|
-
- File: `src/performance-monitor.js`, `src/memory-pressure.js`
|
|
89
|
-
|
|
90
|
-
## Web Interface
|
|
91
|
-
|
|
92
|
-
**Embedded Web Server:**
|
|
93
|
-
- Disabled by default
|
|
94
|
-
- Port: 18790 (configurable)
|
|
95
|
-
- Rate limiting: 100 requests/minute per IP
|
|
96
|
-
- CORS: configurable (wildcard in development)
|
|
97
|
-
- Endpoints:
|
|
98
|
-
- GET /health
|
|
99
|
-
- GET /metrics
|
|
100
|
-
- GET /sessions
|
|
101
|
-
- GET /agents
|
|
102
|
-
- GET /logs
|
|
103
|
-
- GET /status
|
|
104
|
-
- File: `src/web-server.js`
|
|
105
|
-
|
|
106
|
-
## CI/CD & Deployment
|
|
107
|
-
|
|
108
|
-
**CI Pipeline:**
|
|
109
|
-
- GitHub Actions configured (`.github/workflows/`)
|
|
110
|
-
- Jest tests with coverage
|
|
111
|
-
- Docker support (Dockerfile, docker-compose.yml)
|
|
112
|
-
|
|
113
|
-
**Installation:**
|
|
114
|
-
- npm global install: `npm install -g claw-dashboard`
|
|
115
|
-
- Binary: `clawdash`
|
|
116
|
-
- Manual install script: `install.sh`
|
|
117
|
-
|
|
118
|
-
## Environment Configuration
|
|
119
|
-
|
|
120
|
-
**Required env vars:**
|
|
121
|
-
- None (all have defaults)
|
|
122
|
-
|
|
123
|
-
**Optional env vars:**
|
|
124
|
-
- `HOME` - Used for path expansion
|
|
125
|
-
- `DARK_MODE` - Theme override
|
|
126
|
-
- `THEME` - Theme override
|
|
127
|
-
- `COLORFGBG` - Terminal background detection
|
|
128
|
-
|
|
129
|
-
**Secrets location:**
|
|
130
|
-
- Settings file (~/.openclaw/dashboard-settings.json)
|
|
131
|
-
- Database file (~/.openclaw/dashboard-history.db)
|
|
132
|
-
- API keys hashed before storage
|
|
133
|
-
|
|
134
|
-
## Webhooks & Callbacks
|
|
135
|
-
|
|
136
|
-
**Incoming:**
|
|
137
|
-
- None
|
|
138
|
-
|
|
139
|
-
**Outgoing:**
|
|
140
|
-
- None
|
|
141
|
-
|
|
142
|
-
**Plugin System:**
|
|
143
|
-
- Plugins loaded from filesystem
|
|
144
|
-
- Hot-reload support via file watcher
|
|
145
|
-
- Extension points for custom functionality
|
|
146
|
-
- File: `src/widgets/widget-loader.js`, `src/widgets/plugin-api.js`
|
|
147
|
-
|
|
148
|
-
---
|
|
149
|
-
|
|
150
|
-
*Integration audit: 2026-02-28*
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
# Technology Stack
|
|
2
|
-
|
|
3
|
-
**Analysis Date:** 2026-02-28
|
|
4
|
-
|
|
5
|
-
## Languages
|
|
6
|
-
|
|
7
|
-
**Primary:**
|
|
8
|
-
- JavaScript (ES2022) - All source code
|
|
9
|
-
- TypeScript definitions (types.d.ts) - Type definitions for IDE support
|
|
10
|
-
|
|
11
|
-
## Runtime
|
|
12
|
-
|
|
13
|
-
**Environment:**
|
|
14
|
-
- Node.js >= 18 (required)
|
|
15
|
-
- ES Modules (`"type": "module"` in package.json)
|
|
16
|
-
|
|
17
|
-
**Package Manager:**
|
|
18
|
-
- npm (lockfile present: package-lock.json)
|
|
19
|
-
|
|
20
|
-
## Frameworks & Libraries
|
|
21
|
-
|
|
22
|
-
**Core Runtime:**
|
|
23
|
-
- `blessed` ^0.1.81 - Terminal UI framework (blessed curses-like library)
|
|
24
|
-
- `blessed-contrib` ^4.11.0 - Charts and widgets for blessed
|
|
25
|
-
- `chalk` ^5.3.0 - Terminal string styling
|
|
26
|
-
- `systeminformation` ^5.21.22 - System information gathering (CPU, memory, network, disk, GPU)
|
|
27
|
-
- `sql.js` ^1.14.0 - SQLite compiled to WebAssembly for in-process database
|
|
28
|
-
- `timeout-cli` ^0.3.2 - Command timeout utilities
|
|
29
|
-
|
|
30
|
-
**Build System:**
|
|
31
|
-
- `esbuild` ^0.25.12 - Fast bundler for CJS builds
|
|
32
|
-
- Dual-package: ESM (primary) + CJS (built via build-cjs.js)
|
|
33
|
-
|
|
34
|
-
**Testing:**
|
|
35
|
-
- `jest` ^30.2.0 - Test framework (run with --experimental-vm-modules)
|
|
36
|
-
- No additional assertion library (uses Jest built-in)
|
|
37
|
-
|
|
38
|
-
**Linting:**
|
|
39
|
-
- `eslint` ^10.0.2 - Linting with @eslint/js recommended config
|
|
40
|
-
- Uses flat config (eslint.config.js)
|
|
41
|
-
|
|
42
|
-
## Key Dependencies
|
|
43
|
-
|
|
44
|
-
**Critical:**
|
|
45
|
-
- `blessed` + `blessed-contrib` - Terminal UI framework (core dependency)
|
|
46
|
-
- `systeminformation` - All system metrics (CPU, memory, GPU, network, disk)
|
|
47
|
-
- `sql.js` - SQLite WASM for historical data persistence
|
|
48
|
-
|
|
49
|
-
**Infrastructure:**
|
|
50
|
-
- `chalk` - Terminal styling
|
|
51
|
-
- `worker_threads` (Node.js built-in) - Worker pool for heavy operations
|
|
52
|
-
- `https`/`http` (Node.js built-in) - Gateway API communication
|
|
53
|
-
|
|
54
|
-
## Configuration
|
|
55
|
-
|
|
56
|
-
**Environment:**
|
|
57
|
-
- Settings stored in: `~/.openclaw/dashboard-settings.json`
|
|
58
|
-
- Database stored in: `~/.openclaw/dashboard-history.db`
|
|
59
|
-
- Plugins loaded from: `~/.openclaw/plugins/`
|
|
60
|
-
- Log file: `~/.openclaw/claw-dashboard.log`
|
|
61
|
-
|
|
62
|
-
**Build:**
|
|
63
|
-
- esbuild.config.js - ESM build configuration
|
|
64
|
-
- build-cjs.js - CJS bundle generation (creates index.cjs, dist/widgets.cjs)
|
|
65
|
-
- cjs-shim.js - Provides import.meta.url polyfill for CJS
|
|
66
|
-
|
|
67
|
-
**Package Exports:**
|
|
68
|
-
```json
|
|
69
|
-
{
|
|
70
|
-
".": {
|
|
71
|
-
"import": "./index.js",
|
|
72
|
-
"require": "./index.cjs"
|
|
73
|
-
},
|
|
74
|
-
"./widgets": {
|
|
75
|
-
"import": "./src/widgets/index.js",
|
|
76
|
-
"require": "./dist/widgets.cjs"
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
## Platform Requirements
|
|
82
|
-
|
|
83
|
-
**Development:**
|
|
84
|
-
- Node.js >= 18
|
|
85
|
-
- npm for dependency management
|
|
86
|
-
- macOS/Linux/Windows (some system features macOS-specific)
|
|
87
|
-
|
|
88
|
-
**Production:**
|
|
89
|
-
- Node.js runtime
|
|
90
|
-
- No external services required (self-contained)
|
|
91
|
-
- Optional: OpenClaw gateway endpoint on localhost:18789
|
|
92
|
-
|
|
93
|
-
## Module System
|
|
94
|
-
|
|
95
|
-
**Primary:** ES Modules (ESM) with `.js` extension
|
|
96
|
-
**Dual Package:** CJS builds for compatibility
|
|
97
|
-
**Worker Threads:** Separate worker files in `src/workers/`
|
|
98
|
-
|
|
99
|
-
**Import Patterns:**
|
|
100
|
-
```javascript
|
|
101
|
-
// ESM imports throughout
|
|
102
|
-
import blessed from 'blessed';
|
|
103
|
-
import { BaseWidget } from './plugin-api.js';
|
|
104
|
-
import config, { DEFAULT_SETTINGS } from './config.js';
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
## Database
|
|
108
|
-
|
|
109
|
-
**Type:** SQLite via sql.js (WebAssembly)
|
|
110
|
-
**Location:** `~/.openclaw/dashboard-history.db`
|
|
111
|
-
**Tables:**
|
|
112
|
-
- `session_snapshots` - Agent session data
|
|
113
|
-
- `cpu_metrics` - CPU usage history
|
|
114
|
-
- `memory_metrics` - Memory usage history
|
|
115
|
-
- `network_metrics` - Network usage history
|
|
116
|
-
|
|
117
|
-
**Save Interval:** 30 seconds
|
|
118
|
-
**Cleanup Interval:** 1 hour (with retention policy)
|
|
119
|
-
|
|
120
|
-
---
|
|
121
|
-
|
|
122
|
-
*Stack analysis: 2026-02-28*
|