@railtownai/railtracks-visualizer 0.0.69 → 0.0.71

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/esm/index.js CHANGED
@@ -12919,7 +12919,7 @@ const createLucideIcon = (iconName, iconNode)=>{
12919
12919
  return Component;
12920
12920
  };
12921
12921
 
12922
- const __iconNode$A = [
12922
+ const __iconNode$D = [
12923
12923
  [
12924
12924
  "path",
12925
12925
  {
@@ -12935,9 +12935,9 @@ const __iconNode$A = [
12935
12935
  }
12936
12936
  ]
12937
12937
  ];
12938
- const ArrowLeft = createLucideIcon("arrow-left", __iconNode$A);
12938
+ const ArrowLeft = createLucideIcon("arrow-left", __iconNode$D);
12939
12939
 
12940
- const __iconNode$z = [
12940
+ const __iconNode$C = [
12941
12941
  [
12942
12942
  "path",
12943
12943
  {
@@ -12953,9 +12953,9 @@ const __iconNode$z = [
12953
12953
  }
12954
12954
  ]
12955
12955
  ];
12956
- const ArrowRight = createLucideIcon("arrow-right", __iconNode$z);
12956
+ const ArrowRight = createLucideIcon("arrow-right", __iconNode$C);
12957
12957
 
12958
- const __iconNode$y = [
12958
+ const __iconNode$B = [
12959
12959
  [
12960
12960
  "path",
12961
12961
  {
@@ -13003,9 +13003,9 @@ const __iconNode$y = [
13003
13003
  }
13004
13004
  ]
13005
13005
  ];
13006
- const Bot = createLucideIcon("bot", __iconNode$y);
13006
+ const Bot = createLucideIcon("bot", __iconNode$B);
13007
13007
 
13008
- const __iconNode$x = [
13008
+ const __iconNode$A = [
13009
13009
  [
13010
13010
  "path",
13011
13011
  {
@@ -13039,9 +13039,9 @@ const __iconNode$x = [
13039
13039
  }
13040
13040
  ]
13041
13041
  ];
13042
- const Calendar = createLucideIcon("calendar", __iconNode$x);
13042
+ const Calendar = createLucideIcon("calendar", __iconNode$A);
13043
13043
 
13044
- const __iconNode$w = [
13044
+ const __iconNode$z = [
13045
13045
  [
13046
13046
  "path",
13047
13047
  {
@@ -13098,9 +13098,9 @@ const __iconNode$w = [
13098
13098
  }
13099
13099
  ]
13100
13100
  ];
13101
- const ChartNetwork = createLucideIcon("chart-network", __iconNode$w);
13101
+ const ChartNetwork = createLucideIcon("chart-network", __iconNode$z);
13102
13102
 
13103
- const __iconNode$v = [
13103
+ const __iconNode$y = [
13104
13104
  [
13105
13105
  "path",
13106
13106
  {
@@ -13109,9 +13109,9 @@ const __iconNode$v = [
13109
13109
  }
13110
13110
  ]
13111
13111
  ];
13112
- const ChevronDown = createLucideIcon("chevron-down", __iconNode$v);
13112
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$y);
13113
13113
 
13114
- const __iconNode$u = [
13114
+ const __iconNode$x = [
13115
13115
  [
13116
13116
  "path",
13117
13117
  {
@@ -13120,9 +13120,9 @@ const __iconNode$u = [
13120
13120
  }
13121
13121
  ]
13122
13122
  ];
13123
- const ChevronRight = createLucideIcon("chevron-right", __iconNode$u);
13123
+ const ChevronRight = createLucideIcon("chevron-right", __iconNode$x);
13124
13124
 
13125
- const __iconNode$t = [
13125
+ const __iconNode$w = [
13126
13126
  [
13127
13127
  "path",
13128
13128
  {
@@ -13138,9 +13138,9 @@ const __iconNode$t = [
13138
13138
  }
13139
13139
  ]
13140
13140
  ];
13141
- const ChevronsDown = createLucideIcon("chevrons-down", __iconNode$t);
13141
+ const ChevronsDown = createLucideIcon("chevrons-down", __iconNode$w);
13142
13142
 
13143
- const __iconNode$s = [
13143
+ const __iconNode$v = [
13144
13144
  [
13145
13145
  "path",
13146
13146
  {
@@ -13156,9 +13156,9 @@ const __iconNode$s = [
13156
13156
  }
13157
13157
  ]
13158
13158
  ];
13159
- const ChevronsUp = createLucideIcon("chevrons-up", __iconNode$s);
13159
+ const ChevronsUp = createLucideIcon("chevrons-up", __iconNode$v);
13160
13160
 
13161
- const __iconNode$r = [
13161
+ const __iconNode$u = [
13162
13162
  [
13163
13163
  "circle",
13164
13164
  {
@@ -13189,9 +13189,9 @@ const __iconNode$r = [
13189
13189
  }
13190
13190
  ]
13191
13191
  ];
13192
- const CircleAlert = createLucideIcon("circle-alert", __iconNode$r);
13192
+ const CircleAlert = createLucideIcon("circle-alert", __iconNode$u);
13193
13193
 
13194
- const __iconNode$q = [
13194
+ const __iconNode$t = [
13195
13195
  [
13196
13196
  "path",
13197
13197
  {
@@ -13207,9 +13207,9 @@ const __iconNode$q = [
13207
13207
  }
13208
13208
  ]
13209
13209
  ];
13210
- const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$q);
13210
+ const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$t);
13211
13211
 
13212
- const __iconNode$p = [
13212
+ const __iconNode$s = [
13213
13213
  [
13214
13214
  "circle",
13215
13215
  {
@@ -13234,9 +13234,9 @@ const __iconNode$p = [
13234
13234
  }
13235
13235
  ]
13236
13236
  ];
13237
- const CircleDollarSign = createLucideIcon("circle-dollar-sign", __iconNode$p);
13237
+ const CircleDollarSign = createLucideIcon("circle-dollar-sign", __iconNode$s);
13238
13238
 
13239
- const __iconNode$o = [
13239
+ const __iconNode$r = [
13240
13240
  [
13241
13241
  "circle",
13242
13242
  {
@@ -13254,9 +13254,9 @@ const __iconNode$o = [
13254
13254
  }
13255
13255
  ]
13256
13256
  ];
13257
- const Clock = createLucideIcon("clock", __iconNode$o);
13257
+ const Clock = createLucideIcon("clock", __iconNode$r);
13258
13258
 
13259
- const __iconNode$n = [
13259
+ const __iconNode$q = [
13260
13260
  [
13261
13261
  "rect",
13262
13262
  {
@@ -13277,9 +13277,9 @@ const __iconNode$n = [
13277
13277
  }
13278
13278
  ]
13279
13279
  ];
13280
- const Copy = createLucideIcon("copy", __iconNode$n);
13280
+ const Copy = createLucideIcon("copy", __iconNode$q);
13281
13281
 
13282
- const __iconNode$m = [
13282
+ const __iconNode$p = [
13283
13283
  [
13284
13284
  "path",
13285
13285
  {
@@ -13387,9 +13387,9 @@ const __iconNode$m = [
13387
13387
  }
13388
13388
  ]
13389
13389
  ];
13390
- const Cpu = createLucideIcon("cpu", __iconNode$m);
13390
+ const Cpu = createLucideIcon("cpu", __iconNode$p);
13391
13391
 
13392
- const __iconNode$l = [
13392
+ const __iconNode$o = [
13393
13393
  [
13394
13394
  "line",
13395
13395
  {
@@ -13408,9 +13408,9 @@ const __iconNode$l = [
13408
13408
  }
13409
13409
  ]
13410
13410
  ];
13411
- const DollarSign = createLucideIcon("dollar-sign", __iconNode$l);
13411
+ const DollarSign = createLucideIcon("dollar-sign", __iconNode$o);
13412
13412
 
13413
- const __iconNode$k = [
13413
+ const __iconNode$n = [
13414
13414
  [
13415
13415
  "path",
13416
13416
  {
@@ -13440,9 +13440,9 @@ const __iconNode$k = [
13440
13440
  }
13441
13441
  ]
13442
13442
  ];
13443
- const FileInput = createLucideIcon("file-input", __iconNode$k);
13443
+ const FileInput = createLucideIcon("file-input", __iconNode$n);
13444
13444
 
13445
- const __iconNode$j = [
13445
+ const __iconNode$m = [
13446
13446
  [
13447
13447
  "path",
13448
13448
  {
@@ -13472,9 +13472,9 @@ const __iconNode$j = [
13472
13472
  }
13473
13473
  ]
13474
13474
  ];
13475
- const FileOutput = createLucideIcon("file-output", __iconNode$j);
13475
+ const FileOutput = createLucideIcon("file-output", __iconNode$m);
13476
13476
 
13477
- const __iconNode$i = [
13477
+ const __iconNode$l = [
13478
13478
  [
13479
13479
  "path",
13480
13480
  {
@@ -13532,9 +13532,27 @@ const __iconNode$i = [
13532
13532
  }
13533
13533
  ]
13534
13534
  ];
13535
- const FoldVertical = createLucideIcon("fold-vertical", __iconNode$i);
13535
+ const FoldVertical = createLucideIcon("fold-vertical", __iconNode$l);
13536
13536
 
13537
- const __iconNode$h = [
13537
+ const __iconNode$k = [
13538
+ [
13539
+ "path",
13540
+ {
13541
+ d: "m12 14 4-4",
13542
+ key: "9kzdfg"
13543
+ }
13544
+ ],
13545
+ [
13546
+ "path",
13547
+ {
13548
+ d: "M3.34 19a10 10 0 1 1 17.32 0",
13549
+ key: "19p75a"
13550
+ }
13551
+ ]
13552
+ ];
13553
+ const Gauge = createLucideIcon("gauge", __iconNode$k);
13554
+
13555
+ const __iconNode$j = [
13538
13556
  [
13539
13557
  "line",
13540
13558
  {
@@ -13576,9 +13594,9 @@ const __iconNode$h = [
13576
13594
  }
13577
13595
  ]
13578
13596
  ];
13579
- const Hash = createLucideIcon("hash", __iconNode$h);
13597
+ const Hash = createLucideIcon("hash", __iconNode$j);
13580
13598
 
13581
- const __iconNode$g = [
13599
+ const __iconNode$i = [
13582
13600
  [
13583
13601
  "circle",
13584
13602
  {
@@ -13603,9 +13621,9 @@ const __iconNode$g = [
13603
13621
  }
13604
13622
  ]
13605
13623
  ];
13606
- const Info = createLucideIcon("info", __iconNode$g);
13624
+ const Info = createLucideIcon("info", __iconNode$i);
13607
13625
 
13608
- const __iconNode$f = [
13626
+ const __iconNode$h = [
13609
13627
  [
13610
13628
  "path",
13611
13629
  {
@@ -13642,9 +13660,9 @@ const __iconNode$f = [
13642
13660
  }
13643
13661
  ]
13644
13662
  ];
13645
- const ListChecks = createLucideIcon("list-checks", __iconNode$f);
13663
+ const ListChecks = createLucideIcon("list-checks", __iconNode$h);
13646
13664
 
13647
- const __iconNode$e = [
13665
+ const __iconNode$g = [
13648
13666
  [
13649
13667
  "path",
13650
13668
  {
@@ -13674,9 +13692,9 @@ const __iconNode$e = [
13674
13692
  }
13675
13693
  ]
13676
13694
  ];
13677
- const MessageSquareText = createLucideIcon("message-square-text", __iconNode$e);
13695
+ const MessageSquareText = createLucideIcon("message-square-text", __iconNode$g);
13678
13696
 
13679
- const __iconNode$d = [
13697
+ const __iconNode$f = [
13680
13698
  [
13681
13699
  "path",
13682
13700
  {
@@ -13692,9 +13710,9 @@ const __iconNode$d = [
13692
13710
  }
13693
13711
  ]
13694
13712
  ];
13695
- const MessagesSquare = createLucideIcon("messages-square", __iconNode$d);
13713
+ const MessagesSquare = createLucideIcon("messages-square", __iconNode$f);
13696
13714
 
13697
- const __iconNode$c = [
13715
+ const __iconNode$e = [
13698
13716
  [
13699
13717
  "rect",
13700
13718
  {
@@ -13714,9 +13732,9 @@ const __iconNode$c = [
13714
13732
  }
13715
13733
  ]
13716
13734
  ];
13717
- const PanelLeft = createLucideIcon("panel-left", __iconNode$c);
13735
+ const PanelLeft = createLucideIcon("panel-left", __iconNode$e);
13718
13736
 
13719
- const __iconNode$b = [
13737
+ const __iconNode$d = [
13720
13738
  [
13721
13739
  "rect",
13722
13740
  {
@@ -13743,9 +13761,9 @@ const __iconNode$b = [
13743
13761
  }
13744
13762
  ]
13745
13763
  ];
13746
- const PanelRightOpen = createLucideIcon("panel-right-open", __iconNode$b);
13764
+ const PanelRightOpen = createLucideIcon("panel-right-open", __iconNode$d);
13747
13765
 
13748
- const __iconNode$a = [
13766
+ const __iconNode$c = [
13749
13767
  [
13750
13768
  "path",
13751
13769
  {
@@ -13775,9 +13793,9 @@ const __iconNode$a = [
13775
13793
  }
13776
13794
  ]
13777
13795
  ];
13778
- const RefreshCw = createLucideIcon("refresh-cw", __iconNode$a);
13796
+ const RefreshCw = createLucideIcon("refresh-cw", __iconNode$c);
13779
13797
 
13780
- const __iconNode$9 = [
13798
+ const __iconNode$b = [
13781
13799
  [
13782
13800
  "path",
13783
13801
  {
@@ -13814,9 +13832,9 @@ const __iconNode$9 = [
13814
13832
  }
13815
13833
  ]
13816
13834
  ];
13817
- const Scale = createLucideIcon("scale", __iconNode$9);
13835
+ const Scale = createLucideIcon("scale", __iconNode$b);
13818
13836
 
13819
- const __iconNode$8 = [
13837
+ const __iconNode$a = [
13820
13838
  [
13821
13839
  "path",
13822
13840
  {
@@ -13850,9 +13868,9 @@ const __iconNode$8 = [
13850
13868
  }
13851
13869
  ]
13852
13870
  ];
13853
- const Settings2 = createLucideIcon("settings-2", __iconNode$8);
13871
+ const Settings2 = createLucideIcon("settings-2", __iconNode$a);
13854
13872
 
13855
- const __iconNode$7 = [
13873
+ const __iconNode$9 = [
13856
13874
  [
13857
13875
  "path",
13858
13876
  {
@@ -13875,9 +13893,9 @@ const __iconNode$7 = [
13875
13893
  }
13876
13894
  ]
13877
13895
  ];
13878
- const Share = createLucideIcon("share", __iconNode$7);
13896
+ const Share = createLucideIcon("share", __iconNode$9);
13879
13897
 
13880
- const __iconNode$6 = [
13898
+ const __iconNode$8 = [
13881
13899
  [
13882
13900
  "path",
13883
13901
  {
@@ -13886,9 +13904,37 @@ const __iconNode$6 = [
13886
13904
  }
13887
13905
  ]
13888
13906
  ];
13889
- const Shield = createLucideIcon("shield", __iconNode$6);
13907
+ const Shield = createLucideIcon("shield", __iconNode$8);
13890
13908
 
13891
- const __iconNode$5 = [
13909
+ const __iconNode$7 = [
13910
+ [
13911
+ "path",
13912
+ {
13913
+ d: "M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",
13914
+ key: "16rjxf"
13915
+ }
13916
+ ],
13917
+ [
13918
+ "path",
13919
+ {
13920
+ d: "M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",
13921
+ key: "178nd4"
13922
+ }
13923
+ ],
13924
+ [
13925
+ "circle",
13926
+ {
13927
+ cx: "10.5",
13928
+ cy: "6.5",
13929
+ r: ".5",
13930
+ fill: "currentColor",
13931
+ key: "12ikhr"
13932
+ }
13933
+ ]
13934
+ ];
13935
+ const Tags = createLucideIcon("tags", __iconNode$7);
13936
+
13937
+ const __iconNode$6 = [
13892
13938
  [
13893
13939
  "circle",
13894
13940
  {
@@ -13917,9 +13963,9 @@ const __iconNode$5 = [
13917
13963
  }
13918
13964
  ]
13919
13965
  ];
13920
- const Target = createLucideIcon("target", __iconNode$5);
13966
+ const Target = createLucideIcon("target", __iconNode$6);
13921
13967
 
13922
- const __iconNode$4 = [
13968
+ const __iconNode$5 = [
13923
13969
  [
13924
13970
  "line",
13925
13971
  {
@@ -13950,7 +13996,32 @@ const __iconNode$4 = [
13950
13996
  }
13951
13997
  ]
13952
13998
  ];
13953
- const Timer = createLucideIcon("timer", __iconNode$4);
13999
+ const Timer = createLucideIcon("timer", __iconNode$5);
14000
+
14001
+ const __iconNode$4 = [
14002
+ [
14003
+ "path",
14004
+ {
14005
+ d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
14006
+ key: "wmoenq"
14007
+ }
14008
+ ],
14009
+ [
14010
+ "path",
14011
+ {
14012
+ d: "M12 9v4",
14013
+ key: "juzpu7"
14014
+ }
14015
+ ],
14016
+ [
14017
+ "path",
14018
+ {
14019
+ d: "M12 17h.01",
14020
+ key: "p32p05"
14021
+ }
14022
+ ]
14023
+ ];
14024
+ const TriangleAlert = createLucideIcon("triangle-alert", __iconNode$4);
13954
14025
 
13955
14026
  const __iconNode$3 = [
13956
14027
  [
@@ -47772,7 +47843,7 @@ const Paragraph = /*#__PURE__*/ React.forwardRef((props, ref)=>{
47772
47843
  }, children);
47773
47844
  });
47774
47845
 
47775
- const Text$2 = /*#__PURE__*/ React.forwardRef((props, ref)=>{
47846
+ const Text$3 = /*#__PURE__*/ React.forwardRef((props, ref)=>{
47776
47847
  const { ellipsis, children, ...restProps } = props;
47777
47848
  const mergedEllipsis = React.useMemo(()=>{
47778
47849
  if (ellipsis && typeof ellipsis === 'object') {
@@ -47819,7 +47890,7 @@ const Title$1 = /*#__PURE__*/ React.forwardRef((props, ref)=>{
47819
47890
  });
47820
47891
 
47821
47892
  const Typography = Typography$1;
47822
- Typography.Text = Text$2;
47893
+ Typography.Text = Text$3;
47823
47894
  Typography.Link = Link$1;
47824
47895
  Typography.Title = Title$1;
47825
47896
  Typography.Paragraph = Paragraph;
@@ -48140,6 +48211,130 @@ function valueToTreeNodes(value, path) {
48140
48211
  return valueToTreeNodes(data, "$root");
48141
48212
  }
48142
48213
 
48214
+ const { Text: Text$2 } = Typography;
48215
+ /**
48216
+ * Detect whether a tool/node output is an error envelope rather than a regular
48217
+ * return value. Failed nodes serialize as `{ type, message, traceback }`; a
48218
+ * traceback alone, or a `type` + `message` pair, is enough to treat it as an
48219
+ * error. Returns the parsed error (with only string fields kept) or null.
48220
+ */ function parseErrorOutput(output) {
48221
+ if (output === null || typeof output !== "object" || Array.isArray(output)) {
48222
+ return null;
48223
+ }
48224
+ const obj = output;
48225
+ const type = typeof obj.type === "string" ? obj.type : undefined;
48226
+ const message = typeof obj.message === "string" ? obj.message : undefined;
48227
+ const traceback = typeof obj.traceback === "string" ? obj.traceback : undefined;
48228
+ const looksLikeError = traceback !== undefined || type !== undefined && message !== undefined;
48229
+ return looksLikeError ? {
48230
+ type,
48231
+ message,
48232
+ traceback
48233
+ } : null;
48234
+ }
48235
+ /**
48236
+ * Renders a failed node/tool output distinctly from a regular returned object:
48237
+ * a destructive-tinted surface with the exception type, message, and a
48238
+ * collapsible traceback.
48239
+ */ const ErrorOutput = ({ error })=>{
48240
+ const { theme } = useTheme$1();
48241
+ const [showTraceback, setShowTraceback] = useState(false);
48242
+ const destructive = theme?.colors?.destructive ?? "hsl(0 84.2% 60.2%)";
48243
+ const foreground = theme?.colors?.foreground ?? "inherit";
48244
+ const mutedForeground = theme?.colors?.mutedForeground ?? "inherit";
48245
+ const radius = theme?.borderRadius?.md ?? "0.375rem";
48246
+ const xs = theme?.spacing?.xs ?? "0.25rem";
48247
+ const sm = theme?.spacing?.sm ?? "0.5rem";
48248
+ const md = theme?.spacing?.md ?? "1rem";
48249
+ const fontXs = theme?.fontSize?.xs ?? "0.75rem";
48250
+ const fontSm = theme?.fontSize?.sm ?? "0.875rem";
48251
+ const { type, message, traceback } = error;
48252
+ return /*#__PURE__*/ React__default.createElement("div", {
48253
+ "data-testid": "error-output",
48254
+ style: {
48255
+ border: `1px solid color-mix(in srgb, ${destructive} 45%, transparent)`,
48256
+ background: `color-mix(in srgb, ${destructive} 8%, transparent)`,
48257
+ borderRadius: radius,
48258
+ padding: md,
48259
+ display: "flex",
48260
+ flexDirection: "column",
48261
+ gap: sm
48262
+ }
48263
+ }, /*#__PURE__*/ React__default.createElement("div", {
48264
+ style: {
48265
+ display: "flex",
48266
+ alignItems: "center",
48267
+ gap: sm,
48268
+ flexWrap: "wrap"
48269
+ }
48270
+ }, /*#__PURE__*/ React__default.createElement(TriangleAlert, {
48271
+ size: 16,
48272
+ color: destructive,
48273
+ strokeWidth: 2,
48274
+ "aria-hidden": true
48275
+ }), /*#__PURE__*/ React__default.createElement(Tag, {
48276
+ color: "red",
48277
+ style: {
48278
+ margin: 0
48279
+ }
48280
+ }, type || "Error")), message && /*#__PURE__*/ React__default.createElement(Text$2, {
48281
+ strong: true,
48282
+ style: {
48283
+ color: foreground,
48284
+ fontSize: fontSm,
48285
+ wordBreak: "break-word"
48286
+ }
48287
+ }, message), traceback && /*#__PURE__*/ React__default.createElement("div", {
48288
+ style: {
48289
+ display: "flex",
48290
+ flexDirection: "column",
48291
+ gap: xs
48292
+ }
48293
+ }, /*#__PURE__*/ React__default.createElement("button", {
48294
+ type: "button",
48295
+ onClick: ()=>setShowTraceback((prev)=>!prev),
48296
+ "aria-expanded": showTraceback,
48297
+ style: {
48298
+ display: "inline-flex",
48299
+ alignItems: "center",
48300
+ gap: xs,
48301
+ alignSelf: "flex-start",
48302
+ padding: 0,
48303
+ border: "none",
48304
+ background: "transparent",
48305
+ cursor: "pointer",
48306
+ color: destructive,
48307
+ fontSize: fontXs,
48308
+ fontWeight: 500
48309
+ }
48310
+ }, showTraceback ? /*#__PURE__*/ React__default.createElement(ChevronDown, {
48311
+ size: 14,
48312
+ strokeWidth: 2,
48313
+ "aria-hidden": true
48314
+ }) : /*#__PURE__*/ React__default.createElement(ChevronRight, {
48315
+ size: 14,
48316
+ strokeWidth: 2,
48317
+ "aria-hidden": true
48318
+ }), showTraceback ? "Hide traceback" : "Show traceback"), showTraceback && /*#__PURE__*/ React__default.createElement("pre", {
48319
+ "data-testid": "error-output-traceback",
48320
+ style: {
48321
+ margin: 0,
48322
+ padding: sm,
48323
+ borderRadius: radius,
48324
+ background: `color-mix(in srgb, ${destructive} 6%, transparent)`,
48325
+ border: `1px solid color-mix(in srgb, ${destructive} 25%, transparent)`,
48326
+ color: mutedForeground,
48327
+ fontFamily: "monospace",
48328
+ fontSize: fontXs,
48329
+ lineHeight: 1.5,
48330
+ whiteSpace: "pre-wrap",
48331
+ wordBreak: "break-word",
48332
+ maxHeight: "300px",
48333
+ overflow: "auto"
48334
+ }
48335
+ }, traceback)));
48336
+ };
48337
+
48143
48338
  const { Text: Text$1 } = Typography;
48144
48339
  function themedCodeSurface(theme) {
48145
48340
  return {
@@ -48318,8 +48513,9 @@ const InputsOutputsCollapse = ({ inputs, output, toolOutput, modelProvider, mode
48318
48513
  const { theme } = useTheme$1();
48319
48514
  const hasInputs = hasInputsProp ?? inputs.length > 0;
48320
48515
  const hasOutputs = output !== null || toolOutput !== null;
48516
+ const errorOutput = parseErrorOutput(toolOutput);
48321
48517
  const outputsText = hasOutputs ? formatOutputAsText(output, toolOutput) : "";
48322
- const isToolOutputTabular = toolOutput !== null && toolOutput !== undefined && isTabularData(toolOutput);
48518
+ const isToolOutputTabular = !errorOutput && toolOutput !== null && toolOutput !== undefined && isTabularData(toolOutput);
48323
48519
  const toolInputText = getToolInputText(inputs);
48324
48520
  const inputsLabel = largeInputsTitle ? /*#__PURE__*/ React__default.createElement("div", {
48325
48521
  style: {
@@ -48404,13 +48600,26 @@ const InputsOutputsCollapse = ({ inputs, output, toolOutput, modelProvider, mode
48404
48600
  },
48405
48601
  {
48406
48602
  key: "outputs",
48407
- label: /*#__PURE__*/ React__default.createElement(Text$1, {
48603
+ label: /*#__PURE__*/ React__default.createElement("div", {
48604
+ style: {
48605
+ display: "flex",
48606
+ alignItems: "center",
48607
+ gap: theme.spacing.sm
48608
+ }
48609
+ }, /*#__PURE__*/ React__default.createElement(Text$1, {
48408
48610
  strong: true,
48409
48611
  style: {
48410
48612
  color: theme.colors.foreground
48411
48613
  }
48412
- }, "Outputs"),
48413
- children: hasOutputs ? isToolOutputTabular ? /*#__PURE__*/ React__default.createElement(JsonValueTree, {
48614
+ }, "Outputs"), errorOutput && /*#__PURE__*/ React__default.createElement(Tag, {
48615
+ color: "red",
48616
+ style: {
48617
+ margin: 0
48618
+ }
48619
+ }, "Failed")),
48620
+ children: hasOutputs ? errorOutput ? /*#__PURE__*/ React__default.createElement(ErrorOutput, {
48621
+ error: errorOutput
48622
+ }) : isToolOutputTabular ? /*#__PURE__*/ React__default.createElement(JsonValueTree, {
48414
48623
  data: toolOutput
48415
48624
  }) : /*#__PURE__*/ React__default.createElement("pre", {
48416
48625
  style: outputPreStyle
@@ -112605,7 +112814,32 @@ const GuardrailsPopover = ({ guardrails, title = "Guardrails", placement = "righ
112605
112814
  })));
112606
112815
  };
112607
112816
 
112608
- const getNodeLatency = (node)=>node.details?.internals?.latency?.total_time ?? 0;
112817
+ /** Collect start/end instants (unix seconds) for wall-clock span of a single node. */ const getNodeStampTimes = (node)=>{
112818
+ const start = node.stamp?.time;
112819
+ if (start == null) return [];
112820
+ const times = [
112821
+ start
112822
+ ];
112823
+ const latency = node.details?.internals?.latency?.total_time;
112824
+ if (latency != null && latency > 0) times.push(start + latency);
112825
+ return times;
112826
+ };
112827
+ const wallClockSpanSeconds = (times)=>{
112828
+ if (times.length === 0) return 0;
112829
+ const min = Math.min(...times);
112830
+ const max = Math.max(...times);
112831
+ return Math.max(0, max - min);
112832
+ };
112833
+ const collectSubtreeStampTimes = (nodeId, childrenMap, nodeMap)=>{
112834
+ const node = nodeMap.get(nodeId);
112835
+ if (!node) return [];
112836
+ const times = getNodeStampTimes(node);
112837
+ for (const childId of childrenMap.get(nodeId) ?? []){
112838
+ times.push(...collectSubtreeStampTimes(childId, childrenMap, nodeMap));
112839
+ }
112840
+ return times;
112841
+ };
112842
+ /** Wall-clock elapsed time across a node and all descendants (unix stamp times). */ const getSubtreeWallClockSeconds = (nodeId, childrenMap, nodeMap)=>wallClockSpanSeconds(collectSubtreeStampTimes(nodeId, childrenMap, nodeMap));
112609
112843
  const SessionTreeNodeTitle = ({ displayName, subtreeLatency, guardrails })=>{
112610
112844
  return /*#__PURE__*/ React__default.createElement("span", {
112611
112845
  style: {
@@ -112733,8 +112967,7 @@ const buildNodeTree = (run)=>{
112733
112967
  const nodeKey = `node::${run.run_id}::${node.identifier}`;
112734
112968
  const childIds = childrenMap.get(node.identifier) || [];
112735
112969
  const children = childIds.map((id)=>nodeMap.get(id)).filter((n)=>n != null).sort((a, b)=>(a.stamp?.step ?? 0) - (b.stamp?.step ?? 0)).map(buildTreeNode);
112736
- const childLatency = children.reduce((s, c)=>s + (c.subtreeLatency ?? 0), 0);
112737
- const subtreeLatency = getNodeLatency(node) + childLatency;
112970
+ const subtreeLatency = getSubtreeWallClockSeconds(node.identifier, childrenMap, nodeMap);
112738
112971
  const guardrails = node.details?.internals?.guard_details ?? [];
112739
112972
  const isTool = node.node_type === "Tool";
112740
112973
  const failed = isNodeFailureFromIncomingEdge(run, node.identifier);
@@ -113356,7 +113589,7 @@ const SessionDetails = ({ session, open, onClose, initialNodeId, initialRunId, l
113356
113589
 
113357
113590
  /**
113358
113591
  * DTOs for evaluation data from .railtracks/data/evaluations/*.json
113359
- */ /** Numeric metric definition (LLMMetric or ToolMetric) */ /** Type guard for LLM result */ function isLLMResult(item) {
113592
+ */ /** Numeric metric definition (LLMMetric, ToolMetric, or Numerical for custom evaluators) */ /** Type guard for LLM result */ function isLLMResult(item) {
113360
113593
  return item.type === "LLM";
113361
113594
  }
113362
113595
  /** Type guard for Tool result */ function isToolResult(item) {
@@ -113374,8 +113607,12 @@ const SessionDetails = ({ session, open, onClose, initialNodeId, initialRunId, l
113374
113607
  /** Type guard for CategoricalAggregate */ function isAggregateCategorical(item) {
113375
113608
  return item.type === "CategoricalAggregate";
113376
113609
  }
113377
- /** Type guard for aggregated stats (numeric - LLMInferenceAggregate or ToolAggregate) */ function isAggregatedStats(item) {
113378
- return item.type === "LLMInferenceAggregate" || item.type === "ToolAggregate";
113610
+ /** Type guard for NumericalAggregate (custom evaluator numeric aggregate) */ function isNumericalAggregate(item) {
113611
+ return item.type === "NumericalAggregate";
113612
+ }
113613
+ /** Type guard for aggregated stats (numeric - LLMInferenceAggregate, ToolAggregate, or NumericalAggregate) */ function isAggregatedStats(item) {
113614
+ const type = item.type;
113615
+ return type === "LLMInferenceAggregate" || type === "ToolAggregate" || type === "NumericalAggregate";
113379
113616
  }
113380
113617
 
113381
113618
  function isCategoricalMetric$1(def) {
@@ -113391,7 +113628,8 @@ function isCategoricalMetric$1(def) {
113391
113628
  const aggregateTypes = [
113392
113629
  "ToolAggregate",
113393
113630
  "LLMInferenceAggregate",
113394
- "CategoricalAggregate"
113631
+ "CategoricalAggregate",
113632
+ "NumericalAggregate"
113395
113633
  ];
113396
113634
  const aggregateItems = Object.values(nodes).filter((n)=>n?.type && aggregateTypes.includes(n.type));
113397
113635
  return [
@@ -117057,7 +117295,7 @@ function buildTreeFromProcessedData(latencyByTool, failureRateByTool, usageCount
117057
117295
 
117058
117296
  const JUDGE_RESULT_PREFIX = "JudgeResult/";
117059
117297
  const JUDGE_REASONING_PREFIX = "JudgeReasoning/";
117060
- /** Map agent node id -> session id from the agents array (new format only). */ function buildSessionByNodeId(agents) {
117298
+ /** Map agent node id -> session id from the agents array (new format only). */ function buildSessionByNodeId$1(agents) {
117061
117299
  const map = new Map();
117062
117300
  for (const agent of agents ?? []){
117063
117301
  for (const entry of agent.agent_node_ids ?? []){
@@ -117081,10 +117319,10 @@ const JUDGE_REASONING_PREFIX = "JudgeReasoning/";
117081
117319
  }
117082
117320
  return map;
117083
117321
  }
117084
- function metricNameOf(agg) {
117322
+ function metricNameOf$1(agg) {
117085
117323
  return agg.metric?.name ?? agg.name?.replace(/^Aggregate\//, "") ?? "Unknown";
117086
117324
  }
117087
- /** Collect the JudgeResult leaf nodes (label + node id) grouped by label. */ function groupNodesByLabel(agg, nodes, rawResults, metricName, sessionByNodeId, reasoningByKey) {
117325
+ /** Collect the leaf nodes (label + node id) grouped by label. */ function groupNodesByLabel(agg, nodes, rawResults, metricName, sessionByNodeId, reasoningByKey) {
117088
117326
  const byLabel = new Map();
117089
117327
  const seen = new Set();
117090
117328
  const push = (label, nodeId)=>{
@@ -117122,15 +117360,15 @@ function metricNameOf(agg) {
117122
117360
  }
117123
117361
  return byLabel;
117124
117362
  }
117125
- /** Build the Judge view model: one entry per categorical metric. */ function buildJudgeMetricsFromAggregate(input) {
117363
+ /** Build the categorical view model: one entry per categorical metric. */ function buildCategoricalMetricsFromAggregate(input) {
117126
117364
  const { roots, nodes, agents, rawResults = [] } = input;
117127
- const sessionByNodeId = buildSessionByNodeId(agents);
117365
+ const sessionByNodeId = buildSessionByNodeId$1(agents);
117128
117366
  const reasoningByKey = buildReasoningByKey(rawResults);
117129
117367
  // Prefer roots; fall back to scanning all nodes for categorical aggregates.
117130
117368
  const rootAggregates = roots.map((id)=>nodes[id]).filter((n)=>isAggregateCategorical(n));
117131
117369
  const aggregates = rootAggregates.length > 0 ? rootAggregates : Object.values(nodes).filter((n)=>isAggregateCategorical(n));
117132
117370
  return aggregates.map((agg, index)=>{
117133
- const metricName = metricNameOf(agg);
117371
+ const metricName = metricNameOf$1(agg);
117134
117372
  const counts = agg.counts ?? {};
117135
117373
  const categories = agg.categories ?? agg.metric?.categories ?? Object.keys(counts);
117136
117374
  const byLabel = groupNodesByLabel(agg, nodes, rawResults, metricName, sessionByNodeId, reasoningByKey);
@@ -117162,6 +117400,75 @@ function metricNameOf(agg) {
117162
117400
  });
117163
117401
  }
117164
117402
 
117403
+ /** Map agent node id -> session id from the agents array (new format only). */ function buildSessionByNodeId(agents) {
117404
+ const map = new Map();
117405
+ for (const agent of agents ?? []){
117406
+ for (const entry of agent.agent_node_ids ?? []){
117407
+ if (entry && typeof entry === "object" && "agent_node_id" in entry) {
117408
+ map.set(entry.agent_node_id, entry.session_id);
117409
+ }
117410
+ }
117411
+ }
117412
+ return map;
117413
+ }
117414
+ function metricNameOf(agg) {
117415
+ return agg.metric?.name ?? agg.name?.replace(/^Aggregate\//, "") ?? "Unknown";
117416
+ }
117417
+ /** Collect the per-run leaf values (value + node id) for a numerical aggregate. */ function collectNodes(agg, nodes, rawResults, metricName, sessionByNodeId) {
117418
+ const refs = [];
117419
+ const seen = new Set();
117420
+ const push = (nodeId, value)=>{
117421
+ if (!Number.isFinite(value) || seen.has(nodeId)) return;
117422
+ seen.add(nodeId);
117423
+ refs.push({
117424
+ nodeId,
117425
+ sessionId: sessionByNodeId.get(nodeId),
117426
+ value
117427
+ });
117428
+ };
117429
+ // Preferred: walk the aggregate's children leaf nodes.
117430
+ for (const childId of agg.children ?? []){
117431
+ const child = nodes[childId];
117432
+ if (child && isBaseResult(child)) {
117433
+ const nodeId = child.agent_data_id?.[0];
117434
+ if (nodeId) push(nodeId, Number(child.value));
117435
+ }
117436
+ }
117437
+ // Fallback: derive from raw Base results named after the metric when no children resolve.
117438
+ if (refs.length === 0) {
117439
+ for (const item of rawResults){
117440
+ if (isBaseResult(item) && item.result_name === metricName) {
117441
+ const nodeId = item.agent_data_id?.[0];
117442
+ if (nodeId) push(nodeId, Number(item.value));
117443
+ }
117444
+ }
117445
+ }
117446
+ return refs;
117447
+ }
117448
+ /** Build the custom (numerical) evaluator view model: one entry per numerical metric. */ function buildNumericalMetricsFromAggregate(input) {
117449
+ const { roots, nodes, agents, rawResults = [] } = input;
117450
+ const sessionByNodeId = buildSessionByNodeId(agents);
117451
+ // Prefer roots; fall back to scanning all nodes for numerical aggregates.
117452
+ const rootAggregates = roots.map((id)=>nodes[id]).filter((n)=>isNumericalAggregate(n));
117453
+ const aggregates = rootAggregates.length > 0 ? rootAggregates : Object.values(nodes).filter((n)=>isNumericalAggregate(n));
117454
+ return aggregates.map((agg, index)=>{
117455
+ const metricName = metricNameOf(agg);
117456
+ const nodeRefs = collectNodes(agg, nodes, rawResults, metricName, sessionByNodeId);
117457
+ return {
117458
+ key: agg.identifier ?? `${metricName}-${index}`,
117459
+ metricName,
117460
+ description: agg.metric?.description ?? undefined,
117461
+ mean: agg.mean,
117462
+ minimum: agg.minimum,
117463
+ maximum: agg.maximum,
117464
+ median: agg.median,
117465
+ std: agg.std,
117466
+ count: agg.values?.length ?? nodeRefs.length,
117467
+ nodes: nodeRefs
117468
+ };
117469
+ });
117470
+ }
117471
+
117165
117472
  const NodeActions = ({ sessionId, nodeId, onAgentNodeClick, onOpenVisualizer })=>{
117166
117473
  const { theme } = useTheme$1();
117167
117474
  const baseStyle = {
@@ -117223,7 +117530,7 @@ const NodeActions = ({ sessionId, nodeId, onAgentNodeClick, onOpenVisualizer })=
117223
117530
  }), "Visualizer")));
117224
117531
  };
117225
117532
 
117226
- const NodeRow = ({ node, metricName, onAgentNodeClick, onOpenVisualizer })=>{
117533
+ const NodeRow$1 = ({ node, metricName, onAgentNodeClick, onOpenVisualizer })=>{
117227
117534
  const { theme } = useTheme$1();
117228
117535
  const [showReasoning, setShowReasoning] = useState(false);
117229
117536
  return /*#__PURE__*/ React__default.createElement("div", {
@@ -117293,7 +117600,7 @@ const NodeRow = ({ node, metricName, onAgentNodeClick, onOpenVisualizer })=>{
117293
117600
  marginBottom: 6,
117294
117601
  color: theme.colors.mutedForeground
117295
117602
  }
117296
- }, "Judge reasoning · ", metricName), node.reasoning));
117603
+ }, "Reasoning · ", metricName), node.reasoning));
117297
117604
  };
117298
117605
  const LabelPanelHeader = ({ label })=>{
117299
117606
  const { theme } = useTheme$1();
@@ -117326,7 +117633,7 @@ const LabelPanelHeader = ({ label })=>{
117326
117633
  }
117327
117634
  }, label.count, " ", label.count === 1 ? "node" : "nodes"));
117328
117635
  };
117329
- const MetricCard = ({ metric, onAgentNodeClick, onOpenVisualizer })=>{
117636
+ const MetricCard$1 = ({ metric, icon: Icon, onAgentNodeClick, onOpenVisualizer })=>{
117330
117637
  const { theme } = useTheme$1();
117331
117638
  const items = metric.labels.map((label)=>({
117332
117639
  key: label.labelName,
@@ -117346,7 +117653,7 @@ const MetricCard = ({ metric, onAgentNodeClick, onOpenVisualizer })=>{
117346
117653
  flexDirection: "column",
117347
117654
  gap: 12
117348
117655
  }
117349
- }, label.nodes.map((node)=>/*#__PURE__*/ React__default.createElement(NodeRow, {
117656
+ }, label.nodes.map((node)=>/*#__PURE__*/ React__default.createElement(NodeRow$1, {
117350
117657
  key: node.nodeId,
117351
117658
  node: node,
117352
117659
  metricName: metric.metricName,
@@ -117374,7 +117681,7 @@ const MetricCard = ({ metric, onAgentNodeClick, onOpenVisualizer })=>{
117374
117681
  gap: 12,
117375
117682
  flexWrap: "wrap"
117376
117683
  }
117377
- }, /*#__PURE__*/ React__default.createElement(Scale, {
117684
+ }, /*#__PURE__*/ React__default.createElement(Icon, {
117378
117685
  size: 16,
117379
117686
  style: {
117380
117687
  color: theme.colors.primary,
@@ -117415,13 +117722,13 @@ const MetricCard = ({ metric, onAgentNodeClick, onOpenVisualizer })=>{
117415
117722
  marginLeft: "auto",
117416
117723
  flexShrink: 0
117417
117724
  }
117418
- }, /*#__PURE__*/ React__default.createElement(Meta, {
117725
+ }, /*#__PURE__*/ React__default.createElement(Meta$1, {
117419
117726
  label: "Most common",
117420
117727
  value: metric.mostCommon
117421
- }), /*#__PURE__*/ React__default.createElement(Meta, {
117728
+ }), /*#__PURE__*/ React__default.createElement(Meta$1, {
117422
117729
  label: "Least common",
117423
117730
  value: metric.leastCommon
117424
- }), /*#__PURE__*/ React__default.createElement(Meta, {
117731
+ }), /*#__PURE__*/ React__default.createElement(Meta$1, {
117425
117732
  label: "Evaluations",
117426
117733
  value: String(metric.total)
117427
117734
  }))), metric.description && /*#__PURE__*/ React__default.createElement("div", {
@@ -117438,6 +117745,76 @@ const MetricCard = ({ metric, onAgentNodeClick, onOpenVisualizer })=>{
117438
117745
  }
117439
117746
  }));
117440
117747
  };
117748
+ const Meta$1 = ({ label, value })=>{
117749
+ const { theme } = useTheme$1();
117750
+ return /*#__PURE__*/ React__default.createElement("span", {
117751
+ style: {
117752
+ display: "flex",
117753
+ flexDirection: "column",
117754
+ alignItems: "flex-end",
117755
+ gap: 1
117756
+ }
117757
+ }, /*#__PURE__*/ React__default.createElement("span", {
117758
+ style: {
117759
+ fontSize: 10,
117760
+ textTransform: "uppercase",
117761
+ letterSpacing: 0.4,
117762
+ color: theme.colors.mutedForeground
117763
+ }
117764
+ }, label), /*#__PURE__*/ React__default.createElement("span", {
117765
+ style: {
117766
+ fontSize: 13,
117767
+ fontWeight: 500
117768
+ }
117769
+ }, value ?? "—"));
117770
+ };
117771
+ const CategoricalAggregateView = ({ metrics, title = "Categorical Evaluator - Aggregate View", icon = Tags, emptyLabel = "No categorical metrics available", onAgentNodeClick, onOpenVisualizer })=>{
117772
+ const { theme } = useTheme$1();
117773
+ if (!metrics.length) {
117774
+ return /*#__PURE__*/ React__default.createElement("div", {
117775
+ style: {
117776
+ padding: 24,
117777
+ textAlign: "center",
117778
+ color: theme.colors.mutedForeground,
117779
+ fontSize: 14
117780
+ }
117781
+ }, emptyLabel);
117782
+ }
117783
+ return /*#__PURE__*/ React__default.createElement("div", {
117784
+ style: {
117785
+ width: "100%",
117786
+ minWidth: 0
117787
+ }
117788
+ }, /*#__PURE__*/ React__default.createElement("h3", {
117789
+ style: {
117790
+ margin: "0 0 16px",
117791
+ fontSize: 16,
117792
+ fontWeight: 600
117793
+ }
117794
+ }, title), /*#__PURE__*/ React__default.createElement("div", {
117795
+ style: {
117796
+ display: "flex",
117797
+ flexDirection: "column",
117798
+ gap: 12
117799
+ }
117800
+ }, metrics.map((metric)=>/*#__PURE__*/ React__default.createElement(MetricCard$1, {
117801
+ key: metric.key,
117802
+ metric: metric,
117803
+ icon: icon,
117804
+ onAgentNodeClick: onAgentNodeClick,
117805
+ onOpenVisualizer: onOpenVisualizer
117806
+ }))));
117807
+ };
117808
+
117809
+ /**
117810
+ * Format a numerical value for display. Custom metric names are arbitrary, so we
117811
+ * use a light heuristic: latency-like metrics render as durations, integers get
117812
+ * thousands separators, everything else gets two decimals.
117813
+ */ function formatStat(value, metricName) {
117814
+ if (value === undefined || !Number.isFinite(value)) return "—";
117815
+ if (/seconds$/i.test(metricName) || /latency/i.test(metricName)) return formatLatency(value);
117816
+ return Number.isInteger(value) ? formatNumberWithCommas(value) : value.toFixed(2);
117817
+ }
117441
117818
  const Meta = ({ label, value })=>{
117442
117819
  const { theme } = useTheme$1();
117443
117820
  return /*#__PURE__*/ React__default.createElement("span", {
@@ -117461,7 +117838,149 @@ const Meta = ({ label, value })=>{
117461
117838
  }
117462
117839
  }, value ?? "—"));
117463
117840
  };
117464
- const JudgeAggregateView = ({ metrics, onAgentNodeClick, onOpenVisualizer })=>{
117841
+ const NodeRow = ({ node, metricName, onAgentNodeClick, onOpenVisualizer })=>{
117842
+ const { theme } = useTheme$1();
117843
+ return /*#__PURE__*/ React__default.createElement("div", {
117844
+ style: {
117845
+ display: "flex",
117846
+ alignItems: "center",
117847
+ gap: 10,
117848
+ flexWrap: "wrap"
117849
+ }
117850
+ }, /*#__PURE__*/ React__default.createElement(Tag, {
117851
+ style: {
117852
+ margin: 0,
117853
+ fontFamily: "monospace",
117854
+ fontWeight: 600,
117855
+ background: theme.colors.tagLlminference?.bg ?? theme.colors.muted,
117856
+ color: theme.colors.tagLlminference?.color ?? theme.colors.foreground,
117857
+ border: `1px solid ${theme.colors.tagLlminference?.border ?? theme.colors.border}`
117858
+ }
117859
+ }, formatStat(node.value, metricName)), /*#__PURE__*/ React__default.createElement(Tag, {
117860
+ style: {
117861
+ margin: 0,
117862
+ display: "inline-flex",
117863
+ alignItems: "center",
117864
+ gap: 6,
117865
+ background: theme.colors.tagToolLevel2?.bg ?? theme.colors.primary,
117866
+ color: theme.colors.tagToolLevel2?.color ?? theme.colors.primaryForeground,
117867
+ border: "none"
117868
+ }
117869
+ }, /*#__PURE__*/ React__default.createElement(Bot, {
117870
+ size: 12,
117871
+ style: {
117872
+ flexShrink: 0
117873
+ }
117874
+ }), "Agent Node"), /*#__PURE__*/ React__default.createElement(NodeActions, {
117875
+ sessionId: node.sessionId,
117876
+ nodeId: node.nodeId,
117877
+ onAgentNodeClick: onAgentNodeClick,
117878
+ onOpenVisualizer: onOpenVisualizer
117879
+ }));
117880
+ };
117881
+ const MetricCard = ({ metric, onAgentNodeClick, onOpenVisualizer })=>{
117882
+ const { theme } = useTheme$1();
117883
+ const items = metric.nodes.length > 0 ? [
117884
+ {
117885
+ key: "per-run",
117886
+ label: /*#__PURE__*/ React__default.createElement("span", {
117887
+ style: {
117888
+ fontSize: 13,
117889
+ fontWeight: 600
117890
+ }
117891
+ }, "Per-run values", " ", /*#__PURE__*/ React__default.createElement("span", {
117892
+ style: {
117893
+ color: theme.colors.mutedForeground,
117894
+ fontWeight: 400
117895
+ }
117896
+ }, "(", metric.nodes.length, ")")),
117897
+ children: /*#__PURE__*/ React__default.createElement("div", {
117898
+ style: {
117899
+ display: "flex",
117900
+ flexDirection: "column",
117901
+ gap: 12
117902
+ }
117903
+ }, metric.nodes.map((node)=>/*#__PURE__*/ React__default.createElement(NodeRow, {
117904
+ key: node.nodeId,
117905
+ node: node,
117906
+ metricName: metric.metricName,
117907
+ onAgentNodeClick: onAgentNodeClick,
117908
+ onOpenVisualizer: onOpenVisualizer
117909
+ })))
117910
+ }
117911
+ ] : [];
117912
+ return /*#__PURE__*/ React__default.createElement("div", {
117913
+ style: {
117914
+ background: theme.colors.card,
117915
+ border: `1px solid ${theme.colors.border}`,
117916
+ borderRadius: 8,
117917
+ overflow: "hidden"
117918
+ }
117919
+ }, /*#__PURE__*/ React__default.createElement("div", {
117920
+ style: {
117921
+ padding: "14px 18px",
117922
+ borderBottom: metric.nodes.length > 0 ? `1px solid ${theme.colors.border}` : "none",
117923
+ background: theme.colors.secondary
117924
+ }
117925
+ }, /*#__PURE__*/ React__default.createElement("div", {
117926
+ style: {
117927
+ display: "flex",
117928
+ alignItems: "center",
117929
+ gap: 12,
117930
+ flexWrap: "wrap"
117931
+ }
117932
+ }, /*#__PURE__*/ React__default.createElement(Gauge, {
117933
+ size: 16,
117934
+ style: {
117935
+ color: theme.colors.primary,
117936
+ flexShrink: 0
117937
+ }
117938
+ }), /*#__PURE__*/ React__default.createElement("span", {
117939
+ style: {
117940
+ fontSize: 15,
117941
+ fontWeight: 600
117942
+ }
117943
+ }, metric.metricName), /*#__PURE__*/ React__default.createElement("div", {
117944
+ style: {
117945
+ display: "flex",
117946
+ gap: 20,
117947
+ marginLeft: "auto",
117948
+ flexShrink: 0,
117949
+ flexWrap: "wrap"
117950
+ }
117951
+ }, /*#__PURE__*/ React__default.createElement(Meta, {
117952
+ label: "Mean",
117953
+ value: formatStat(metric.mean, metric.metricName)
117954
+ }), /*#__PURE__*/ React__default.createElement(Meta, {
117955
+ label: "Min",
117956
+ value: formatStat(metric.minimum, metric.metricName)
117957
+ }), /*#__PURE__*/ React__default.createElement(Meta, {
117958
+ label: "Max",
117959
+ value: formatStat(metric.maximum, metric.metricName)
117960
+ }), /*#__PURE__*/ React__default.createElement(Meta, {
117961
+ label: "Median",
117962
+ value: formatStat(metric.median, metric.metricName)
117963
+ }), /*#__PURE__*/ React__default.createElement(Meta, {
117964
+ label: "Std",
117965
+ value: formatStat(metric.std, metric.metricName)
117966
+ }), /*#__PURE__*/ React__default.createElement(Meta, {
117967
+ label: "Runs",
117968
+ value: String(metric.count)
117969
+ }))), metric.description && /*#__PURE__*/ React__default.createElement("div", {
117970
+ style: {
117971
+ marginTop: 6,
117972
+ fontSize: 12,
117973
+ color: theme.colors.mutedForeground
117974
+ }
117975
+ }, metric.description)), metric.nodes.length > 0 && /*#__PURE__*/ React__default.createElement(Collapse$1, {
117976
+ items: items,
117977
+ bordered: false,
117978
+ style: {
117979
+ background: theme.colors.card
117980
+ }
117981
+ }));
117982
+ };
117983
+ const NumericalAggregateView = ({ metrics, onAgentNodeClick, onOpenVisualizer })=>{
117465
117984
  const { theme } = useTheme$1();
117466
117985
  if (!metrics.length) {
117467
117986
  return /*#__PURE__*/ React__default.createElement("div", {
@@ -117471,7 +117990,7 @@ const JudgeAggregateView = ({ metrics, onAgentNodeClick, onOpenVisualizer })=>{
117471
117990
  color: theme.colors.mutedForeground,
117472
117991
  fontSize: 14
117473
117992
  }
117474
- }, "No judge metrics available");
117993
+ }, "No numerical metrics available");
117475
117994
  }
117476
117995
  return /*#__PURE__*/ React__default.createElement("div", {
117477
117996
  style: {
@@ -117484,7 +118003,7 @@ const JudgeAggregateView = ({ metrics, onAgentNodeClick, onOpenVisualizer })=>{
117484
118003
  fontSize: 16,
117485
118004
  fontWeight: 600
117486
118005
  }
117487
- }, "Judge Evaluator - Aggregate View"), /*#__PURE__*/ React__default.createElement("div", {
118006
+ }, "Custom Evaluator - Aggregate View"), /*#__PURE__*/ React__default.createElement("div", {
117488
118007
  style: {
117489
118008
  display: "flex",
117490
118009
  flexDirection: "column",
@@ -117502,7 +118021,10 @@ function detectAggregateType(nodes) {
117502
118021
  const values = Object.values(nodes);
117503
118022
  if (values.some((n)=>n?.type === "ToolAggregate")) return "ToolUse";
117504
118023
  if (values.some((n)=>n?.type === "LLMInferenceAggregate")) return "LLMInference";
117505
- if (values.some((n)=>n?.type === "CategoricalAggregate")) return "Judge";
118024
+ // Categorical covers the built-in JudgeEvaluator and any custom evaluator with categorical metrics.
118025
+ if (values.some((n)=>n?.type === "CategoricalAggregate")) return "Categorical";
118026
+ // Custom numerical evaluators (anything that isn't ToolUse/LLMInference/categorical) emit NumericalAggregate.
118027
+ if (values.some((n)=>n?.type === "NumericalAggregate")) return "Numerical";
117506
118028
  return null;
117507
118029
  }
117508
118030
  function buildLLMInferenceFlatRows(nodes) {
@@ -117544,7 +118066,8 @@ function formatAggregateValue(value, metricName) {
117544
118066
  const DEFAULT_TITLES = {
117545
118067
  ToolUse: "Tool Use Evaluator - Aggregate View",
117546
118068
  LLMInference: "LLM Inference Evaluator - Aggregate View",
117547
- Judge: "Judge Evaluator - Aggregate View"
118069
+ Categorical: "Categorical Evaluator - Aggregate View",
118070
+ Numerical: "Custom Evaluator - Aggregate View"
117548
118071
  };
117549
118072
  const AggregateResultsTable = ({ rawResults = [], aggregateResults, agents, title, evaluatorName, onAgentNodeClick, onOpenVisualizer })=>{
117550
118073
  const { theme } = useTheme$1();
@@ -117586,10 +118109,23 @@ const AggregateResultsTable = ({ rawResults = [], aggregateResults, agents, titl
117586
118109
  llmExpandableKeys
117587
118110
  };
117588
118111
  }
117589
- if (type === "Judge") {
118112
+ if (type === "Categorical") {
117590
118113
  return {
117591
118114
  aggregateType: type,
117592
- dataSource: buildJudgeMetricsFromAggregate({
118115
+ dataSource: buildCategoricalMetricsFromAggregate({
118116
+ roots: aggregateResults.roots,
118117
+ nodes: aggregateResults.nodes,
118118
+ agents,
118119
+ rawResults
118120
+ }),
118121
+ llmIsTree: false,
118122
+ llmExpandableKeys: []
118123
+ };
118124
+ }
118125
+ if (type === "Numerical") {
118126
+ return {
118127
+ aggregateType: type,
118128
+ dataSource: buildNumericalMetricsFromAggregate({
117593
118129
  roots: aggregateResults.roots,
117594
118130
  nodes: aggregateResults.nodes,
117595
118131
  agents,
@@ -117915,8 +118451,21 @@ const AggregateResultsTable = ({ rawResults = [], aggregateResults, agents, titl
117915
118451
  }
117916
118452
  }));
117917
118453
  }
117918
- if (aggregateType === "Judge") {
117919
- return /*#__PURE__*/ React__default.createElement(JudgeAggregateView, {
118454
+ if (aggregateType === "Categorical") {
118455
+ // JudgeEvaluator keeps its branding; any other (custom) categorical evaluator
118456
+ // renders through the same view with neutral categorical branding.
118457
+ const isJudge = (evaluatorName ?? "").includes("Judge");
118458
+ return /*#__PURE__*/ React__default.createElement(CategoricalAggregateView, {
118459
+ metrics: dataSource,
118460
+ title: title ?? (isJudge ? "Judge Evaluator - Aggregate View" : "Custom Evaluator - Aggregate View"),
118461
+ icon: isJudge ? Scale : Tags,
118462
+ emptyLabel: isJudge ? "No judge metrics available" : "No categorical metrics available",
118463
+ onAgentNodeClick: onAgentNodeClick,
118464
+ onOpenVisualizer: onOpenVisualizer
118465
+ });
118466
+ }
118467
+ if (aggregateType === "Numerical") {
118468
+ return /*#__PURE__*/ React__default.createElement(NumericalAggregateView, {
117920
118469
  metrics: dataSource,
117921
118470
  onAgentNodeClick: onAgentNodeClick,
117922
118471
  onOpenVisualizer: onOpenVisualizer
@@ -118183,7 +118732,8 @@ function isCategoricalMetric(def) {
118183
118732
  const aggregateTypes = [
118184
118733
  "ToolAggregate",
118185
118734
  "LLMInferenceAggregate",
118186
- "CategoricalAggregate"
118735
+ "CategoricalAggregate",
118736
+ "NumericalAggregate"
118187
118737
  ];
118188
118738
  const aggregateItems = Object.values(nodes).filter((n)=>n?.type && aggregateTypes.includes(n.type));
118189
118739
  return [