@agent-inspect/viewer 6.7.3 → 6.7.4

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.mjs CHANGED
@@ -2609,13 +2609,24 @@ function inc(map, key) {
2609
2609
  map[key] = (map[key] ?? 0) + 1;
2610
2610
  }
2611
2611
  function computeRunStatus(events) {
2612
+ let runTerminal;
2613
+ let sawRunEvent = false;
2614
+ for (const e of events) {
2615
+ if (e.kind !== "RUN") continue;
2616
+ sawRunEvent = true;
2617
+ if (e.status === "ok" || e.status === "error") {
2618
+ runTerminal = e.status;
2619
+ }
2620
+ }
2621
+ if (sawRunEvent) {
2622
+ return runTerminal ?? "running";
2623
+ }
2612
2624
  let hasRunning = false;
2613
2625
  for (const e of events) {
2614
2626
  if (e.status === "error") return "error";
2615
2627
  if (e.status === "running") hasRunning = true;
2616
2628
  }
2617
- if (hasRunning) return "running";
2618
- return "ok";
2629
+ return hasRunning ? "running" : "ok";
2619
2630
  }
2620
2631
  var TreeBuilder = class {
2621
2632
  constructor(options) {