@agent-inspect/mcp-server 6.7.3 → 6.7.5

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
@@ -1646,6 +1646,12 @@ async function searchTraces(metas, options) {
1646
1646
  ...sessionLabel ? { sessionId: sessionLabel } : {}
1647
1647
  });
1648
1648
  }
1649
+ results.sort((a, b) => {
1650
+ const ta = a.timestamp ?? 0;
1651
+ const tb = b.timestamp ?? 0;
1652
+ if (ta !== tb) return tb - ta;
1653
+ return a.runId.localeCompare(b.runId);
1654
+ });
1649
1655
  return results.slice(0, limit);
1650
1656
  }
1651
1657
  for (const m of filtered) {
@@ -1693,7 +1699,7 @@ async function searchTraces(metas, options) {
1693
1699
  results.sort((a, b) => {
1694
1700
  const ta = a.timestamp ?? 0;
1695
1701
  const tb = b.timestamp ?? 0;
1696
- if (ta !== tb) return ta - tb;
1702
+ if (ta !== tb) return tb - ta;
1697
1703
  const runCmp = a.runId.localeCompare(b.runId);
1698
1704
  if (runCmp !== 0) return runCmp;
1699
1705
  return (a.stepName ?? "").localeCompare(b.stepName ?? "");
@@ -2682,13 +2688,24 @@ function inc(map, key) {
2682
2688
  map[key] = (map[key] ?? 0) + 1;
2683
2689
  }
2684
2690
  function computeRunStatus(events) {
2691
+ let runTerminal;
2692
+ let sawRunEvent = false;
2693
+ for (const e of events) {
2694
+ if (e.kind !== "RUN") continue;
2695
+ sawRunEvent = true;
2696
+ if (e.status === "ok" || e.status === "error") {
2697
+ runTerminal = e.status;
2698
+ }
2699
+ }
2700
+ if (sawRunEvent) {
2701
+ return runTerminal ?? "running";
2702
+ }
2685
2703
  let hasRunning = false;
2686
2704
  for (const e of events) {
2687
2705
  if (e.status === "error") return "error";
2688
2706
  if (e.status === "running") hasRunning = true;
2689
2707
  }
2690
- if (hasRunning) return "running";
2691
- return "ok";
2708
+ return hasRunning ? "running" : "ok";
2692
2709
  }
2693
2710
  var TreeBuilder = class {
2694
2711
  constructor(options) {