agentflow-dashboard 0.6.0 → 0.7.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/dist/server.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DashboardServer
3
- } from "./chunk-N6IN5SHX.js";
3
+ } from "./chunk-GA2Y6E62.js";
4
4
  export {
5
5
  DashboardServer
6
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentflow-dashboard",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Real-time monitoring dashboard for AgentFlow - Visualize agent execution graphs and performance",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -21,9 +21,11 @@
21
21
  "public"
22
22
  ],
23
23
  "scripts": {
24
- "build": "tsup src/index.ts src/cli.ts src/server.ts --format esm,cjs --clean && npm run build:public",
24
+ "build": "tsup src/index.ts src/cli.ts src/server.ts --format esm,cjs --clean && npm run build:public && npm run build:client",
25
25
  "build:public": "cp -r public dist/",
26
+ "build:client": "vite build",
26
27
  "dev": "tsx src/server.ts",
28
+ "dev:client": "vite",
27
29
  "start": "node dist/server.js",
28
30
  "test": "vitest run",
29
31
  "test:watch": "vitest",
@@ -40,17 +42,23 @@
40
42
  "agentflow-core": "^0.8.0",
41
43
  "chokidar": "^3.5.3",
42
44
  "express": "^4.18.2",
45
+ "react": "^19.1.0",
46
+ "react-dom": "^19.1.0",
43
47
  "ws": "^8.16.0"
44
48
  },
45
49
  "devDependencies": {
46
50
  "@playwright/test": "^1.41.0",
47
51
  "@types/express": "^4.17.21",
52
+ "@types/react": "^19.1.0",
53
+ "@types/react-dom": "^19.1.0",
48
54
  "@types/ws": "^8.5.10",
55
+ "@vitejs/plugin-react": "^4.4.1",
49
56
  "@vitest/coverage-v8": "^3.0.0",
50
57
  "get-port": "^7.0.0",
51
58
  "supertest": "^7.0.0",
52
59
  "tsup": "^8.4.0",
53
60
  "tsx": "^4.19.0",
61
+ "vite": "^6.3.5",
54
62
  "vitest": "^3.0.0",
55
63
  "ws": "^8.16.0"
56
64
  },
@@ -380,51 +380,83 @@ class AgentFlowDashboard {
380
380
  section.style.display = '';
381
381
  var html = '<h4>Process Health</h4>';
382
382
 
383
- // PID File section
384
- if (r.pidFile) {
385
- var pf = r.pidFile;
386
- var cls = pf.alive && pf.matchesProcess ? 'ok' : pf.stale ? 'bad' : 'warn';
387
- html += '<div class="ph-row">';
388
- html += '<span class="ph-label">PID File</span>';
389
- html += `<span class="ph-value ${cls}">`;
390
- html += pf.pid ? `PID ${pf.pid}${pf.alive ? ' (alive)' : ' (dead)'}` : 'No PID';
391
- html += '</span></div>';
392
- }
383
+ // Render all discovered services (new multi-service format)
384
+ var services = r.services || [];
385
+ if (services.length > 0) {
386
+ for (var si = 0; si < services.length; si++) {
387
+ var svc = services[si];
388
+ html += '<div class="ph-service">';
389
+ html += `<div class="ph-service-name">${escapeHtml(svc.name)}</div>`;
390
+
391
+ // PID File for this service
392
+ if (svc.pidFile) {
393
+ var pf = svc.pidFile;
394
+ var cls = pf.alive && pf.matchesProcess ? 'ok' : pf.stale ? 'bad' : 'warn';
395
+ html += '<div class="ph-row">';
396
+ html += '<span class="ph-label">PID File</span>';
397
+ html += `<span class="ph-value ${cls}">`;
398
+ html += pf.pid ? `PID ${pf.pid}${pf.alive ? ' (alive)' : ' (dead)'}` : 'No PID';
399
+ html += '</span></div>';
400
+ }
393
401
 
394
- // Systemd section
395
- if (r.systemd) {
396
- var sd = r.systemd;
397
- var sdCls = sd.activeState === 'active' ? 'ok' : sd.failed ? 'bad' : 'warn';
398
- html += '<div class="ph-row">';
399
- html += '<span class="ph-label">Systemd</span>';
400
- html += `<span class="ph-value ${sdCls}">`;
401
- html +=
402
- escapeHtml(sd.unit) +
403
- ' \u2014 ' +
404
- escapeHtml(sd.activeState) +
405
- ' (' +
406
- escapeHtml(sd.subState) +
407
- ')';
408
- if (sd.restarts > 0) html += ` [${sd.restarts} restarts]`;
409
- html += '</span></div>';
410
- }
402
+ // Systemd for this service
403
+ if (svc.systemd) {
404
+ var sd = svc.systemd;
405
+ var sdCls = sd.activeState === 'active' ? 'ok' : sd.failed ? 'bad' : 'warn';
406
+ html += '<div class="ph-row">';
407
+ html += '<span class="ph-label">Systemd</span>';
408
+ html += `<span class="ph-value ${sdCls}">`;
409
+ html +=
410
+ escapeHtml(sd.unit) +
411
+ ' \u2014 ' +
412
+ escapeHtml(sd.activeState) +
413
+ ' (' +
414
+ escapeHtml(sd.subState) +
415
+ ')';
416
+ if (sd.restarts > 0) html += ` [${sd.restarts} restarts]`;
417
+ html += '</span></div>';
418
+ }
411
419
 
412
- // Workers detailed view
413
- if (r.workers?.workers) {
414
- html += '<div class="ph-section">';
415
- html += '<span class="ph-label">Workers</span>';
416
- html += '<div class="process-grid">';
417
- for (var i = 0; i < r.workers.workers.length; i++) {
418
- var worker = r.workers.workers[i];
419
- var statusCls = worker.alive ? 'ok' : worker.stale ? 'bad' : 'warn';
420
- html += `<div class="worker-card ${statusCls}">`;
421
- html += `<div class="worker-name">${escapeHtml(worker.name)}</div>`;
422
- html += '<div class="worker-details">';
423
- html += `<span>PID: ${worker.pid || '-'}</span>`;
424
- html += `<span>${escapeHtml(worker.declaredStatus)}</span>`;
425
- html += '</div></div>';
420
+ // Workers for this service
421
+ if (svc.workers?.workers) {
422
+ html += '<div class="ph-section">';
423
+ html += '<span class="ph-label">Workers</span>';
424
+ html += '<div class="process-grid">';
425
+ for (var i = 0; i < svc.workers.workers.length; i++) {
426
+ var worker = svc.workers.workers[i];
427
+ var statusCls = worker.alive ? 'ok' : worker.stale ? 'bad' : 'warn';
428
+ html += `<div class="worker-card ${statusCls}">`;
429
+ html += `<div class="worker-name">${escapeHtml(worker.name)}</div>`;
430
+ html += '<div class="worker-details">';
431
+ html += `<span>PID: ${worker.pid || '-'}</span>`;
432
+ html += `<span>${escapeHtml(worker.declaredStatus)}</span>`;
433
+ html += '</div></div>';
434
+ }
435
+ html += '</div></div>';
436
+ }
437
+
438
+ html += '</div>'; // .ph-service
439
+ }
440
+ } else {
441
+ // Fallback: legacy single-service format
442
+ if (r.pidFile) {
443
+ var pf2 = r.pidFile;
444
+ var cls2 = pf2.alive && pf2.matchesProcess ? 'ok' : pf2.stale ? 'bad' : 'warn';
445
+ html += '<div class="ph-row">';
446
+ html += '<span class="ph-label">PID File</span>';
447
+ html += `<span class="ph-value ${cls2}">`;
448
+ html += pf2.pid ? `PID ${pf2.pid}${pf2.alive ? ' (alive)' : ' (dead)'}` : 'No PID';
449
+ html += '</span></div>';
450
+ }
451
+ if (r.systemd) {
452
+ var sd2 = r.systemd;
453
+ var sdCls2 = sd2.activeState === 'active' ? 'ok' : sd2.failed ? 'bad' : 'warn';
454
+ html += '<div class="ph-row">';
455
+ html += '<span class="ph-label">Systemd</span>';
456
+ html += `<span class="ph-value ${sdCls2}">`;
457
+ html += escapeHtml(sd2.unit) + ' \u2014 ' + escapeHtml(sd2.activeState) + ' (' + escapeHtml(sd2.subState) + ')';
458
+ html += '</span></div>';
426
459
  }
427
- html += '</div></div>';
428
460
  }
429
461
 
430
462
  // Agent Services - categorize processes and build tree
package/public/index.html CHANGED
@@ -711,6 +711,19 @@
711
711
  }
712
712
 
713
713
  /* Enhanced Process Health */
714
+ .ph-service {
715
+ margin-bottom: 1rem;
716
+ padding: 0.6rem 0.8rem;
717
+ border: 1px solid var(--border-color, #30363d);
718
+ border-radius: 6px;
719
+ }
720
+ .ph-service-name {
721
+ font-weight: 600;
722
+ font-size: 0.95rem;
723
+ margin-bottom: 0.4rem;
724
+ color: var(--fg-primary, #e6edf3);
725
+ text-transform: capitalize;
726
+ }
714
727
  .ph-section {
715
728
  margin-bottom: 1rem;
716
729
  }
@@ -1,43 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head><title>Test Dashboard API</title></head>
4
- <body>
5
- <script>
6
- fetch('/api/process-health')
7
- .then(r => r.json())
8
- .then(data => {
9
- console.log('Process Health Data:', data);
10
-
11
- // Test categorization
12
- const processes = data.osProcesses || [];
13
- const agents = [];
14
- const infrastructure = [];
15
-
16
- processes.forEach(proc => {
17
- const cmd = proc.command.toLowerCase();
18
- const cmdline = (proc.cmdline || '').toLowerCase();
19
-
20
- // Test infrastructure detection
21
- if (cmd.includes('milvus') || cmdline.includes('milvus')) {
22
- infrastructure.push({component: 'Milvus Vector DB', ...proc});
23
- } else if (cmdline.includes('agentflow-dashboard')) {
24
- agents.push({service: 'AgentFlow Dashboard', ...proc});
25
- }
26
- });
27
-
28
- console.log('Detected Infrastructure:', infrastructure);
29
- console.log('Detected Agents:', agents);
30
-
31
- document.body.innerHTML = `
32
- <h2>Process Health Debug</h2>
33
- <h3>Infrastructure (${infrastructure.length}):</h3>
34
- <ul>${infrastructure.map(i => `<li>PID ${i.pid}: ${i.component} (CPU: ${i.cpu}%)</li>`).join('')}</ul>
35
- <h3>Agents (${agents.length}):</h3>
36
- <ul>${agents.map(a => `<li>PID ${a.pid}: ${a.service} (CPU: ${a.cpu}%)</li>`).join('')}</ul>
37
- <h3>Total OS Processes: ${processes.length}</h3>
38
- `;
39
- })
40
- .catch(console.error);
41
- </script>
42
- </body>
43
- </html>
package/public/debug.html DELETED
@@ -1,43 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head><title>Test Dashboard API</title></head>
4
- <body>
5
- <script>
6
- fetch('/api/process-health')
7
- .then(r => r.json())
8
- .then(data => {
9
- console.log('Process Health Data:', data);
10
-
11
- // Test categorization
12
- const processes = data.osProcesses || [];
13
- const agents = [];
14
- const infrastructure = [];
15
-
16
- processes.forEach(proc => {
17
- const cmd = proc.command.toLowerCase();
18
- const cmdline = (proc.cmdline || '').toLowerCase();
19
-
20
- // Test infrastructure detection
21
- if (cmd.includes('milvus') || cmdline.includes('milvus')) {
22
- infrastructure.push({component: 'Milvus Vector DB', ...proc});
23
- } else if (cmdline.includes('agentflow-dashboard')) {
24
- agents.push({service: 'AgentFlow Dashboard', ...proc});
25
- }
26
- });
27
-
28
- console.log('Detected Infrastructure:', infrastructure);
29
- console.log('Detected Agents:', agents);
30
-
31
- document.body.innerHTML = `
32
- <h2>Process Health Debug</h2>
33
- <h3>Infrastructure (${infrastructure.length}):</h3>
34
- <ul>${infrastructure.map(i => `<li>PID ${i.pid}: ${i.component} (CPU: ${i.cpu}%)</li>`).join('')}</ul>
35
- <h3>Agents (${agents.length}):</h3>
36
- <ul>${agents.map(a => `<li>PID ${a.pid}: ${a.service} (CPU: ${a.cpu}%)</li>`).join('')}</ul>
37
- <h3>Total OS Processes: ${processes.length}</h3>
38
- `;
39
- })
40
- .catch(console.error);
41
- </script>
42
- </body>
43
- </html>