agentflow-dashboard 0.3.1 → 0.4.1

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/README.md CHANGED
@@ -1,32 +1,39 @@
1
- # AgentFlow Dashboard v0.3.0
1
+ # AgentFlow Dashboard v0.4.0
2
2
 
3
- Real-time monitoring dashboard for AgentFlow - Visualize agent execution graphs and performance metrics with comprehensive agent infrastructure monitoring.
3
+ Real-time monitoring dashboard for AI agent systems. Visualize execution graphs, session transcripts, and performance metrics from any agent framework.
4
4
 
5
5
  ## Features
6
6
 
7
- ### **🎯 Universal Agent Monitoring**
8
- - **Alfred Integration** - Full Alfred worker and conversation monitoring
9
- - **OpenClaw Support** - OpenClaw gateway and agent trace ingestion
10
- - **Multi-Framework** - Supports LangChain, CrewAI, AutoGen, Mastra, and more
11
- - **Real-time Updates** - Live WebSocket connections with instant trace updates
12
-
13
- ### **🛠️ Enhanced Process Health**
14
- - **Process Tagging** - Smart categorization (`main`, `agents`, `browser`, `context`, `exec`, `read`, `tool`, `think`, `user`, `write`)
15
- - **Tree View Structure** - Hierarchical process relationships with parent-child visualization
16
- - **Infrastructure Detection** - Automatic detection of Milvus, Redis, PostgreSQL, and vector databases
17
- - **Resource Monitoring** - CPU, memory, and uptime tracking for all processes
18
-
19
- ### **💬 LLM Conversation Tracking**
20
- - **Session Parsing** - Full Alfred and OpenClaw conversation logs
21
- - **Token Usage** - OpenRouter, Claude, and other provider usage statistics
22
- - **Model Interactions** - Complete LLM request/response chains with metadata
23
- - **Activity Filtering** - Filter traces by agent activity type and behavior
24
-
25
- ### **📊 Performance & Visualization**
26
- - **Interactive Graphs** - Cytoscape.js execution flow visualization
27
- - **Timeline View** - Waterfall execution timeline with duration metrics
28
- - **Success Metrics** - Agent performance, failure rates, and health monitoring
29
- - **Responsive Design** - Works on desktop and mobile devices
7
+ ### Universal Agent Monitoring
8
+ - **Multi-Format Ingestion** - AgentFlow JSON traces, JSONL session logs (Claude Code compatible), structured log files, cron run logs
9
+ - **Auto-Discovery** - Recursively scans directories for trace files, watches for new files in real-time
10
+ - **Framework Agnostic** - Works with any agent system that produces JSON traces or JSONL session logs
11
+
12
+ ### 7 Interactive Tabs
13
+ - **Timeline** - Waterfall execution timeline with duration bars and status icons
14
+ - **Transcript** - Full conversation view: user messages, assistant responses, thinking blocks, tool calls
15
+ - **Graph** - Interactive Cytoscape.js execution flow visualization
16
+ - **Metrics** - Success rates, token usage, duration stats, node breakdown
17
+ - **Heatmap** - Error distribution across recent traces
18
+ - **State Machine** - Execution state flow diagram with node counts
19
+ - **Summary** - Auto-generated text summary with recommendations
20
+
21
+ ### Session Transcripts
22
+ - Chat-bubble UI for JSONL sessions
23
+ - User/assistant messages, tool calls with args and results
24
+ - Collapsible thinking blocks
25
+ - Token usage and cost per message
26
+ - Subagent spawn tracking
27
+
28
+ ### Process Health
29
+ - Live process detection and categorization
30
+ - PID file and systemd unit monitoring
31
+ - Orphan process detection
32
+ - CPU/memory resource tracking
33
+
34
+ ### Real-Time Updates
35
+ - WebSocket live trace broadcasting with auto-reconnect
36
+ - File watcher triggers instant sidebar updates on new/changed files
30
37
 
31
38
  ## Quick Start
32
39
 
@@ -34,350 +41,145 @@ Real-time monitoring dashboard for AgentFlow - Visualize agent execution graphs
34
41
  # Install globally
35
42
  npm install -g agentflow-dashboard
36
43
 
37
- # Start monitoring your traces
44
+ # Monitor a traces directory
38
45
  agentflow-dashboard --traces ./traces --port 3000
39
46
 
47
+ # Watch multiple directories
48
+ agentflow-dashboard \
49
+ --traces ./traces \
50
+ --data-dir ./sessions \
51
+ --data-dir ./cron-runs \
52
+ --host 0.0.0.0
53
+
40
54
  # Or run with npx
41
55
  npx agentflow-dashboard --traces ./my-agent-traces
42
56
  ```
43
57
 
44
58
  Open http://localhost:3000 to view the dashboard.
45
59
 
46
- ## Installation
60
+ ## CLI Options
47
61
 
48
- ```bash
49
- npm install agentflow-dashboard
50
62
  ```
51
-
52
- **Requirements:**
53
- - Node.js 18+
54
- - AgentFlow traces directory
55
-
56
- ## Usage
57
-
58
- ### Command Line Interface
59
-
60
- ```bash
61
63
  agentflow-dashboard [options]
62
- ```
63
-
64
- **Options:**
65
- - `-p, --port <number>` - Server port (default: 3000)
66
- - `-t, --traces <path>` - Traces directory (default: ./traces)
67
- - `-h, --host <address>` - Host address (default: localhost)
68
- - `--cors` - Enable CORS headers
69
- - `--help` - Show help message
70
-
71
- ### Examples
72
-
73
- ```bash
74
- # Basic usage
75
- agentflow-dashboard
76
64
 
77
- # Custom port and traces directory
78
- agentflow-dashboard --port 8080 --traces /var/log/agentflow
79
-
80
- # Enable external access with CORS
81
- agentflow-dashboard --host 0.0.0.0 --cors --port 3000
82
-
83
- # Monitor specific agent traces
84
- agentflow-dashboard --traces ./my-ai-agent/traces
85
- ```
86
-
87
- ### Programmatic Usage
88
-
89
- ```typescript
90
- import { DashboardServer } from 'agentflow-dashboard';
91
-
92
- const dashboard = new DashboardServer({
93
- port: 3000,
94
- tracesDir: './traces',
95
- host: 'localhost',
96
- enableCors: false
97
- });
98
-
99
- await dashboard.start();
100
- console.log('Dashboard started!');
65
+ Options:
66
+ -p, --port <number> Server port (default: 3000)
67
+ -t, --traces <path> Primary traces directory (default: ./traces)
68
+ -h, --host <address> Host address (default: localhost)
69
+ --data-dir <path> Extra data directory (repeatable)
70
+ --cors Enable CORS headers
71
+ --help Show help message
101
72
  ```
102
73
 
103
- ## Dashboard Interface
104
-
105
- ### Overview Page
106
-
107
- The main dashboard shows:
74
+ ## Supported File Formats
108
75
 
109
- - **Global Statistics** - Total agents, executions, success rate, active agents
110
- - **Agent List** - All agents with execution counts and success rates
111
- - **Recent Activity** - Latest agent executions with status indicators
112
- - **Performance Trends** - Success/failure patterns over time
76
+ | Format | Extension | Description |
77
+ |--------|-----------|-------------|
78
+ | AgentFlow JSON | `.json` | Execution graph traces with nodes, edges, timing |
79
+ | JSONL Sessions | `.jsonl` | Claude Code / OpenClaw session transcripts |
80
+ | Cron Run Logs | `.jsonl` | Job execution logs (`ts`, `jobId`, `action`, `status`) |
81
+ | Structured Logs | `.log` | Python structlog, JSON logs, key=value logs |
82
+ | Session Index | `sessions.json` | Agent session metadata (auto-discovered) |
113
83
 
114
- ### Agent Details
84
+ ### JSONL Session Format
115
85
 
116
- Click any agent to view:
86
+ Compatible with Claude Code session format:
117
87
 
118
- - **Execution History** - All recent executions for that agent
119
- - **Performance Metrics** - Success rate, average execution time
120
- - **Trigger Analysis** - How the agent is being invoked
121
- - **Error Patterns** - Common failure modes and debugging info
122
-
123
- ### Real-Time Updates
124
-
125
- The dashboard automatically updates when:
126
-
127
- - New trace files are created
128
- - Existing traces are updated
129
- - Agent performance changes
130
- - System status changes
131
-
132
- ## Configuration
133
-
134
- ### Directory Structure
135
-
136
- The dashboard expects this structure:
137
-
138
- ```
139
- traces/
140
- ├── agent1-2024-01-15T10-30-00.json
141
- ├── agent1-2024-01-15T10-35-00.json
142
- ├── agent2-2024-01-15T10-32-00.json
143
- └── ...
88
+ ```jsonl
89
+ {"type":"session","id":"abc123","timestamp":"2026-03-19T10:00:00Z"}
90
+ {"type":"model_change","modelId":"claude-sonnet-4-20250514","provider":"anthropic"}
91
+ {"type":"message","message":{"role":"user","content":[{"type":"text","text":"Hello"}]}}
92
+ {"type":"message","message":{"role":"assistant","content":[{"type":"text","text":"Hi!"}],"usage":{"input":100,"output":50}}}
144
93
  ```
145
94
 
146
- ### Trace File Format
147
-
148
- Compatible with standard AgentFlow trace format:
95
+ ### AgentFlow Trace Format
149
96
 
150
97
  ```json
151
98
  {
99
+ "id": "node_001",
100
+ "rootNodeId": "node_001",
152
101
  "agentId": "my-agent",
153
- "trigger": "cron_job",
154
- "name": "my-agent data_processing execution",
155
- "timestamp": 1642234200000,
156
- "nodes": [...],
157
- "rootId": "node_1",
158
- "metadata": {...}
102
+ "trigger": "cron",
103
+ "startTime": 1710800000000,
104
+ "endTime": 1710800060000,
105
+ "status": "completed",
106
+ "nodes": {
107
+ "node_001": { "id": "node_001", "type": "agent", "name": "my-agent", "children": ["node_002"] },
108
+ "node_002": { "id": "node_002", "type": "tool", "name": "search", "children": [] }
109
+ }
159
110
  }
160
111
  ```
161
112
 
162
- ### Environment Variables
163
-
164
- - `AGENTFLOW_DASHBOARD_PORT` - Default port
165
- - `AGENTFLOW_DASHBOARD_HOST` - Default host
166
- - `AGENTFLOW_TRACES_DIR` - Default traces directory
167
-
168
- ## API Endpoints
169
-
170
- The dashboard exposes REST endpoints for integration:
171
-
172
- ### GET /api/traces
173
- Get all trace files with metadata.
174
-
175
- ```bash
176
- curl http://localhost:3000/api/traces
177
- ```
178
-
179
- ### GET /api/traces/:filename
180
- Get specific trace file content.
181
-
182
- ```bash
183
- curl http://localhost:3000/api/traces/agent1-2024-01-15T10-30-00.json
184
- ```
185
-
186
- ### GET /api/stats
187
- Get global performance statistics.
188
-
189
- ```bash
190
- curl http://localhost:3000/api/stats
191
- ```
192
-
193
- ### GET /api/stats/:agentId
194
- Get statistics for specific agent.
113
+ ## Programmatic Usage
195
114
 
196
- ```bash
197
- curl http://localhost:3000/api/stats/my-agent
198
- ```
115
+ ```typescript
116
+ import { DashboardServer } from 'agentflow-dashboard';
199
117
 
200
- ### GET /api/agents
201
- Get list of all known agents.
118
+ const dashboard = new DashboardServer({
119
+ port: 3000,
120
+ tracesDir: './traces',
121
+ dataDirs: ['./sessions', './cron-runs'],
122
+ host: 'localhost',
123
+ enableCors: false,
124
+ });
202
125
 
203
- ```bash
204
- curl http://localhost:3000/api/agents
126
+ await dashboard.start();
205
127
  ```
206
128
 
207
- ## Integration Examples
208
-
209
- ### Docker Deployment
210
-
211
- ```dockerfile
212
- FROM node:18-alpine
213
-
214
- RUN npm install -g agentflow-dashboard
129
+ ## API Endpoints
215
130
 
216
- EXPOSE 3000
131
+ | Method | Endpoint | Description |
132
+ |--------|----------|-------------|
133
+ | GET | `/api/traces` | List all traces with metadata |
134
+ | GET | `/api/traces/:filename` | Full trace detail (nodes, events, token usage) |
135
+ | GET | `/api/traces/:filename/events` | Session events and token usage |
136
+ | GET | `/api/agents` | All discovered agents with metrics |
137
+ | GET | `/api/stats` | Global performance statistics |
138
+ | GET | `/api/stats/:agentId` | Per-agent statistics |
139
+ | GET | `/api/process-health` | Running process audit |
140
+ | WS | `/` | Real-time trace updates |
217
141
 
218
- CMD ["agentflow-dashboard", "--host", "0.0.0.0", "--traces", "/traces"]
219
- ```
142
+ ## Architecture
220
143
 
221
- ```yaml
222
- # docker-compose.yml
223
- version: '3.8'
224
- services:
225
- agentflow-dashboard:
226
- image: node:18-alpine
227
- ports:
228
- - "3000:3000"
229
- volumes:
230
- - ./traces:/traces
231
- command: >
232
- sh -c "npm install -g agentflow-dashboard &&
233
- agentflow-dashboard --host 0.0.0.0 --traces /traces"
234
144
  ```
235
-
236
- ### Kubernetes Deployment
237
-
238
- ```yaml
239
- apiVersion: apps/v1
240
- kind: Deployment
241
- metadata:
242
- name: agentflow-dashboard
243
- spec:
244
- replicas: 1
245
- selector:
246
- matchLabels:
247
- app: agentflow-dashboard
248
- template:
249
- metadata:
250
- labels:
251
- app: agentflow-dashboard
252
- spec:
253
- containers:
254
- - name: dashboard
255
- image: node:18-alpine
256
- ports:
257
- - containerPort: 3000
258
- command:
259
- - sh
260
- - -c
261
- - "npm install -g agentflow-dashboard && agentflow-dashboard --host 0.0.0.0"
262
- volumeMounts:
263
- - name: traces
264
- mountPath: /traces
265
- volumes:
266
- - name: traces
267
- persistentVolumeClaim:
268
- claimName: agentflow-traces
145
+ Trace files (.json, .jsonl, .log)
146
+
147
+
148
+ TraceWatcher ──▶ AgentStats ──▶ Express + WebSocket
149
+ (file watcher) (metrics) (REST API + live updates)
150
+
151
+
152
+ Browser SPA
153
+ (dashboard.js)
269
154
  ```
270
155
 
271
- ### Nginx Reverse Proxy
272
-
273
- ```nginx
274
- server {
275
- listen 80;
276
- server_name dashboard.example.com;
277
-
278
- location / {
279
- proxy_pass http://localhost:3000;
280
- proxy_http_version 1.1;
281
- proxy_set_header Upgrade $http_upgrade;
282
- proxy_set_header Connection 'upgrade';
283
- proxy_set_header Host $host;
284
- proxy_set_header X-Real-IP $remote_addr;
285
- proxy_cache_bypass $http_upgrade;
286
- }
287
- }
288
- ```
156
+ ## Deployment
289
157
 
290
- ### Systemd Service
158
+ ### Systemd
291
159
 
292
160
  ```ini
293
- # /etc/systemd/system/agentflow-dashboard.service
294
161
  [Unit]
295
162
  Description=AgentFlow Dashboard
296
163
  After=network.target
297
164
 
298
165
  [Service]
299
166
  Type=simple
300
- User=agentflow
301
- WorkingDirectory=/opt/agentflow
302
- ExecStart=/usr/local/bin/agentflow-dashboard --traces /var/log/agentflow
167
+ ExecStart=/usr/local/bin/agentflow-dashboard --host 0.0.0.0 --traces /var/log/agentflow
303
168
  Restart=always
304
- Environment=NODE_ENV=production
305
169
 
306
170
  [Install]
307
171
  WantedBy=multi-user.target
308
172
  ```
309
173
 
310
- ## Performance Tuning
311
-
312
- ### Large Trace Volumes
313
-
314
- For high-volume agent systems:
315
-
316
- ```bash
317
- # Increase Node.js memory limit
318
- NODE_OPTIONS="--max-old-space-size=4096" agentflow-dashboard
319
-
320
- # Use dedicated traces directory with log rotation
321
- agentflow-dashboard --traces /var/log/agentflow/current
322
- ```
323
-
324
- ### Network Optimization
174
+ ### Docker
325
175
 
326
- ```typescript
327
- // Disable real-time updates for low-bandwidth connections
328
- const dashboard = new DashboardServer({
329
- port: 3000,
330
- tracesDir: './traces',
331
- enableCors: true,
332
- // Custom update intervals can be configured
333
- });
334
- ```
335
-
336
- ## Troubleshooting
337
-
338
- ### Common Issues
339
-
340
- **Dashboard not loading traces:**
341
- ```bash
342
- # Check traces directory permissions
343
- ls -la ./traces
344
-
345
- # Check trace file format
346
- cat traces/agent-*.json | head -20
347
- ```
348
-
349
- **WebSocket connection failures:**
350
- ```bash
351
- # Check firewall settings
352
- sudo ufw status
353
-
354
- # Test WebSocket connectivity
355
- curl -i -N -H "Connection: Upgrade" -H "Upgrade: websocket" http://localhost:3000
356
- ```
357
-
358
- **High memory usage:**
359
- ```bash
360
- # Monitor dashboard process
361
- top -p $(pgrep -f agentflow-dashboard)
362
-
363
- # Clean old trace files
364
- find ./traces -name "*.json" -mtime +7 -delete
365
- ```
366
-
367
- ### Debug Mode
368
-
369
- ```bash
370
- # Enable debug logging
371
- DEBUG=agentflow:* agentflow-dashboard --traces ./traces
372
-
373
- # Check dashboard health
374
- curl http://localhost:3000/api/stats
176
+ ```dockerfile
177
+ FROM node:20-alpine
178
+ RUN npm install -g agentflow-dashboard
179
+ EXPOSE 3000
180
+ CMD ["agentflow-dashboard", "--host", "0.0.0.0", "--traces", "/traces"]
375
181
  ```
376
182
 
377
- ## Contributing
378
-
379
- See [CONTRIBUTING.md](../../CONTRIBUTING.md) for development guidelines.
380
-
381
183
  ## License
382
184
 
383
- MIT - See [LICENSE](../../LICENSE) for details.
185
+ MIT