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