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/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  AgentStats,
4
4
  DashboardServer,
5
5
  TraceWatcher
6
- } from "./chunk-N6IN5SHX.js";
6
+ } from "./chunk-GA2Y6E62.js";
7
7
  export {
8
8
  AgentStats,
9
9
  DashboardServer,
@@ -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
@@ -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
  }