@railtownai/railtracks-visualizer 0.0.70 → 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/cjs/index.js CHANGED
@@ -12939,7 +12939,7 @@ const createLucideIcon = (iconName, iconNode)=>{
12939
12939
  return Component;
12940
12940
  };
12941
12941
 
12942
- const __iconNode$C = [
12942
+ const __iconNode$D = [
12943
12943
  [
12944
12944
  "path",
12945
12945
  {
@@ -12955,9 +12955,9 @@ const __iconNode$C = [
12955
12955
  }
12956
12956
  ]
12957
12957
  ];
12958
- const ArrowLeft = createLucideIcon("arrow-left", __iconNode$C);
12958
+ const ArrowLeft = createLucideIcon("arrow-left", __iconNode$D);
12959
12959
 
12960
- const __iconNode$B = [
12960
+ const __iconNode$C = [
12961
12961
  [
12962
12962
  "path",
12963
12963
  {
@@ -12973,9 +12973,9 @@ const __iconNode$B = [
12973
12973
  }
12974
12974
  ]
12975
12975
  ];
12976
- const ArrowRight = createLucideIcon("arrow-right", __iconNode$B);
12976
+ const ArrowRight = createLucideIcon("arrow-right", __iconNode$C);
12977
12977
 
12978
- const __iconNode$A = [
12978
+ const __iconNode$B = [
12979
12979
  [
12980
12980
  "path",
12981
12981
  {
@@ -13023,9 +13023,9 @@ const __iconNode$A = [
13023
13023
  }
13024
13024
  ]
13025
13025
  ];
13026
- const Bot = createLucideIcon("bot", __iconNode$A);
13026
+ const Bot = createLucideIcon("bot", __iconNode$B);
13027
13027
 
13028
- const __iconNode$z = [
13028
+ const __iconNode$A = [
13029
13029
  [
13030
13030
  "path",
13031
13031
  {
@@ -13059,9 +13059,9 @@ const __iconNode$z = [
13059
13059
  }
13060
13060
  ]
13061
13061
  ];
13062
- const Calendar = createLucideIcon("calendar", __iconNode$z);
13062
+ const Calendar = createLucideIcon("calendar", __iconNode$A);
13063
13063
 
13064
- const __iconNode$y = [
13064
+ const __iconNode$z = [
13065
13065
  [
13066
13066
  "path",
13067
13067
  {
@@ -13118,9 +13118,9 @@ const __iconNode$y = [
13118
13118
  }
13119
13119
  ]
13120
13120
  ];
13121
- const ChartNetwork = createLucideIcon("chart-network", __iconNode$y);
13121
+ const ChartNetwork = createLucideIcon("chart-network", __iconNode$z);
13122
13122
 
13123
- const __iconNode$x = [
13123
+ const __iconNode$y = [
13124
13124
  [
13125
13125
  "path",
13126
13126
  {
@@ -13129,9 +13129,9 @@ const __iconNode$x = [
13129
13129
  }
13130
13130
  ]
13131
13131
  ];
13132
- const ChevronDown = createLucideIcon("chevron-down", __iconNode$x);
13132
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$y);
13133
13133
 
13134
- const __iconNode$w = [
13134
+ const __iconNode$x = [
13135
13135
  [
13136
13136
  "path",
13137
13137
  {
@@ -13140,9 +13140,9 @@ const __iconNode$w = [
13140
13140
  }
13141
13141
  ]
13142
13142
  ];
13143
- const ChevronRight = createLucideIcon("chevron-right", __iconNode$w);
13143
+ const ChevronRight = createLucideIcon("chevron-right", __iconNode$x);
13144
13144
 
13145
- const __iconNode$v = [
13145
+ const __iconNode$w = [
13146
13146
  [
13147
13147
  "path",
13148
13148
  {
@@ -13158,9 +13158,9 @@ const __iconNode$v = [
13158
13158
  }
13159
13159
  ]
13160
13160
  ];
13161
- const ChevronsDown = createLucideIcon("chevrons-down", __iconNode$v);
13161
+ const ChevronsDown = createLucideIcon("chevrons-down", __iconNode$w);
13162
13162
 
13163
- const __iconNode$u = [
13163
+ const __iconNode$v = [
13164
13164
  [
13165
13165
  "path",
13166
13166
  {
@@ -13176,9 +13176,9 @@ const __iconNode$u = [
13176
13176
  }
13177
13177
  ]
13178
13178
  ];
13179
- const ChevronsUp = createLucideIcon("chevrons-up", __iconNode$u);
13179
+ const ChevronsUp = createLucideIcon("chevrons-up", __iconNode$v);
13180
13180
 
13181
- const __iconNode$t = [
13181
+ const __iconNode$u = [
13182
13182
  [
13183
13183
  "circle",
13184
13184
  {
@@ -13209,9 +13209,9 @@ const __iconNode$t = [
13209
13209
  }
13210
13210
  ]
13211
13211
  ];
13212
- const CircleAlert = createLucideIcon("circle-alert", __iconNode$t);
13212
+ const CircleAlert = createLucideIcon("circle-alert", __iconNode$u);
13213
13213
 
13214
- const __iconNode$s = [
13214
+ const __iconNode$t = [
13215
13215
  [
13216
13216
  "path",
13217
13217
  {
@@ -13227,9 +13227,9 @@ const __iconNode$s = [
13227
13227
  }
13228
13228
  ]
13229
13229
  ];
13230
- const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$s);
13230
+ const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$t);
13231
13231
 
13232
- const __iconNode$r = [
13232
+ const __iconNode$s = [
13233
13233
  [
13234
13234
  "circle",
13235
13235
  {
@@ -13254,9 +13254,9 @@ const __iconNode$r = [
13254
13254
  }
13255
13255
  ]
13256
13256
  ];
13257
- const CircleDollarSign = createLucideIcon("circle-dollar-sign", __iconNode$r);
13257
+ const CircleDollarSign = createLucideIcon("circle-dollar-sign", __iconNode$s);
13258
13258
 
13259
- const __iconNode$q = [
13259
+ const __iconNode$r = [
13260
13260
  [
13261
13261
  "circle",
13262
13262
  {
@@ -13274,9 +13274,9 @@ const __iconNode$q = [
13274
13274
  }
13275
13275
  ]
13276
13276
  ];
13277
- const Clock = createLucideIcon("clock", __iconNode$q);
13277
+ const Clock = createLucideIcon("clock", __iconNode$r);
13278
13278
 
13279
- const __iconNode$p = [
13279
+ const __iconNode$q = [
13280
13280
  [
13281
13281
  "rect",
13282
13282
  {
@@ -13297,9 +13297,9 @@ const __iconNode$p = [
13297
13297
  }
13298
13298
  ]
13299
13299
  ];
13300
- const Copy = createLucideIcon("copy", __iconNode$p);
13300
+ const Copy = createLucideIcon("copy", __iconNode$q);
13301
13301
 
13302
- const __iconNode$o = [
13302
+ const __iconNode$p = [
13303
13303
  [
13304
13304
  "path",
13305
13305
  {
@@ -13407,9 +13407,9 @@ const __iconNode$o = [
13407
13407
  }
13408
13408
  ]
13409
13409
  ];
13410
- const Cpu = createLucideIcon("cpu", __iconNode$o);
13410
+ const Cpu = createLucideIcon("cpu", __iconNode$p);
13411
13411
 
13412
- const __iconNode$n = [
13412
+ const __iconNode$o = [
13413
13413
  [
13414
13414
  "line",
13415
13415
  {
@@ -13428,9 +13428,9 @@ const __iconNode$n = [
13428
13428
  }
13429
13429
  ]
13430
13430
  ];
13431
- const DollarSign = createLucideIcon("dollar-sign", __iconNode$n);
13431
+ const DollarSign = createLucideIcon("dollar-sign", __iconNode$o);
13432
13432
 
13433
- const __iconNode$m = [
13433
+ const __iconNode$n = [
13434
13434
  [
13435
13435
  "path",
13436
13436
  {
@@ -13460,9 +13460,9 @@ const __iconNode$m = [
13460
13460
  }
13461
13461
  ]
13462
13462
  ];
13463
- const FileInput = createLucideIcon("file-input", __iconNode$m);
13463
+ const FileInput = createLucideIcon("file-input", __iconNode$n);
13464
13464
 
13465
- const __iconNode$l = [
13465
+ const __iconNode$m = [
13466
13466
  [
13467
13467
  "path",
13468
13468
  {
@@ -13492,9 +13492,9 @@ const __iconNode$l = [
13492
13492
  }
13493
13493
  ]
13494
13494
  ];
13495
- const FileOutput = createLucideIcon("file-output", __iconNode$l);
13495
+ const FileOutput = createLucideIcon("file-output", __iconNode$m);
13496
13496
 
13497
- const __iconNode$k = [
13497
+ const __iconNode$l = [
13498
13498
  [
13499
13499
  "path",
13500
13500
  {
@@ -13552,9 +13552,9 @@ const __iconNode$k = [
13552
13552
  }
13553
13553
  ]
13554
13554
  ];
13555
- const FoldVertical = createLucideIcon("fold-vertical", __iconNode$k);
13555
+ const FoldVertical = createLucideIcon("fold-vertical", __iconNode$l);
13556
13556
 
13557
- const __iconNode$j = [
13557
+ const __iconNode$k = [
13558
13558
  [
13559
13559
  "path",
13560
13560
  {
@@ -13570,9 +13570,9 @@ const __iconNode$j = [
13570
13570
  }
13571
13571
  ]
13572
13572
  ];
13573
- const Gauge = createLucideIcon("gauge", __iconNode$j);
13573
+ const Gauge = createLucideIcon("gauge", __iconNode$k);
13574
13574
 
13575
- const __iconNode$i = [
13575
+ const __iconNode$j = [
13576
13576
  [
13577
13577
  "line",
13578
13578
  {
@@ -13614,9 +13614,9 @@ const __iconNode$i = [
13614
13614
  }
13615
13615
  ]
13616
13616
  ];
13617
- const Hash = createLucideIcon("hash", __iconNode$i);
13617
+ const Hash = createLucideIcon("hash", __iconNode$j);
13618
13618
 
13619
- const __iconNode$h = [
13619
+ const __iconNode$i = [
13620
13620
  [
13621
13621
  "circle",
13622
13622
  {
@@ -13641,9 +13641,9 @@ const __iconNode$h = [
13641
13641
  }
13642
13642
  ]
13643
13643
  ];
13644
- const Info = createLucideIcon("info", __iconNode$h);
13644
+ const Info = createLucideIcon("info", __iconNode$i);
13645
13645
 
13646
- const __iconNode$g = [
13646
+ const __iconNode$h = [
13647
13647
  [
13648
13648
  "path",
13649
13649
  {
@@ -13680,9 +13680,9 @@ const __iconNode$g = [
13680
13680
  }
13681
13681
  ]
13682
13682
  ];
13683
- const ListChecks = createLucideIcon("list-checks", __iconNode$g);
13683
+ const ListChecks = createLucideIcon("list-checks", __iconNode$h);
13684
13684
 
13685
- const __iconNode$f = [
13685
+ const __iconNode$g = [
13686
13686
  [
13687
13687
  "path",
13688
13688
  {
@@ -13712,9 +13712,9 @@ const __iconNode$f = [
13712
13712
  }
13713
13713
  ]
13714
13714
  ];
13715
- const MessageSquareText = createLucideIcon("message-square-text", __iconNode$f);
13715
+ const MessageSquareText = createLucideIcon("message-square-text", __iconNode$g);
13716
13716
 
13717
- const __iconNode$e = [
13717
+ const __iconNode$f = [
13718
13718
  [
13719
13719
  "path",
13720
13720
  {
@@ -13730,9 +13730,9 @@ const __iconNode$e = [
13730
13730
  }
13731
13731
  ]
13732
13732
  ];
13733
- const MessagesSquare = createLucideIcon("messages-square", __iconNode$e);
13733
+ const MessagesSquare = createLucideIcon("messages-square", __iconNode$f);
13734
13734
 
13735
- const __iconNode$d = [
13735
+ const __iconNode$e = [
13736
13736
  [
13737
13737
  "rect",
13738
13738
  {
@@ -13752,9 +13752,9 @@ const __iconNode$d = [
13752
13752
  }
13753
13753
  ]
13754
13754
  ];
13755
- const PanelLeft = createLucideIcon("panel-left", __iconNode$d);
13755
+ const PanelLeft = createLucideIcon("panel-left", __iconNode$e);
13756
13756
 
13757
- const __iconNode$c = [
13757
+ const __iconNode$d = [
13758
13758
  [
13759
13759
  "rect",
13760
13760
  {
@@ -13781,9 +13781,9 @@ const __iconNode$c = [
13781
13781
  }
13782
13782
  ]
13783
13783
  ];
13784
- const PanelRightOpen = createLucideIcon("panel-right-open", __iconNode$c);
13784
+ const PanelRightOpen = createLucideIcon("panel-right-open", __iconNode$d);
13785
13785
 
13786
- const __iconNode$b = [
13786
+ const __iconNode$c = [
13787
13787
  [
13788
13788
  "path",
13789
13789
  {
@@ -13813,9 +13813,9 @@ const __iconNode$b = [
13813
13813
  }
13814
13814
  ]
13815
13815
  ];
13816
- const RefreshCw = createLucideIcon("refresh-cw", __iconNode$b);
13816
+ const RefreshCw = createLucideIcon("refresh-cw", __iconNode$c);
13817
13817
 
13818
- const __iconNode$a = [
13818
+ const __iconNode$b = [
13819
13819
  [
13820
13820
  "path",
13821
13821
  {
@@ -13852,9 +13852,9 @@ const __iconNode$a = [
13852
13852
  }
13853
13853
  ]
13854
13854
  ];
13855
- const Scale = createLucideIcon("scale", __iconNode$a);
13855
+ const Scale = createLucideIcon("scale", __iconNode$b);
13856
13856
 
13857
- const __iconNode$9 = [
13857
+ const __iconNode$a = [
13858
13858
  [
13859
13859
  "path",
13860
13860
  {
@@ -13888,9 +13888,9 @@ const __iconNode$9 = [
13888
13888
  }
13889
13889
  ]
13890
13890
  ];
13891
- const Settings2 = createLucideIcon("settings-2", __iconNode$9);
13891
+ const Settings2 = createLucideIcon("settings-2", __iconNode$a);
13892
13892
 
13893
- const __iconNode$8 = [
13893
+ const __iconNode$9 = [
13894
13894
  [
13895
13895
  "path",
13896
13896
  {
@@ -13913,9 +13913,9 @@ const __iconNode$8 = [
13913
13913
  }
13914
13914
  ]
13915
13915
  ];
13916
- const Share = createLucideIcon("share", __iconNode$8);
13916
+ const Share = createLucideIcon("share", __iconNode$9);
13917
13917
 
13918
- const __iconNode$7 = [
13918
+ const __iconNode$8 = [
13919
13919
  [
13920
13920
  "path",
13921
13921
  {
@@ -13924,9 +13924,9 @@ const __iconNode$7 = [
13924
13924
  }
13925
13925
  ]
13926
13926
  ];
13927
- const Shield = createLucideIcon("shield", __iconNode$7);
13927
+ const Shield = createLucideIcon("shield", __iconNode$8);
13928
13928
 
13929
- const __iconNode$6 = [
13929
+ const __iconNode$7 = [
13930
13930
  [
13931
13931
  "path",
13932
13932
  {
@@ -13952,9 +13952,9 @@ const __iconNode$6 = [
13952
13952
  }
13953
13953
  ]
13954
13954
  ];
13955
- const Tags = createLucideIcon("tags", __iconNode$6);
13955
+ const Tags = createLucideIcon("tags", __iconNode$7);
13956
13956
 
13957
- const __iconNode$5 = [
13957
+ const __iconNode$6 = [
13958
13958
  [
13959
13959
  "circle",
13960
13960
  {
@@ -13983,9 +13983,9 @@ const __iconNode$5 = [
13983
13983
  }
13984
13984
  ]
13985
13985
  ];
13986
- const Target = createLucideIcon("target", __iconNode$5);
13986
+ const Target = createLucideIcon("target", __iconNode$6);
13987
13987
 
13988
- const __iconNode$4 = [
13988
+ const __iconNode$5 = [
13989
13989
  [
13990
13990
  "line",
13991
13991
  {
@@ -14016,7 +14016,32 @@ const __iconNode$4 = [
14016
14016
  }
14017
14017
  ]
14018
14018
  ];
14019
- const Timer = createLucideIcon("timer", __iconNode$4);
14019
+ const Timer = createLucideIcon("timer", __iconNode$5);
14020
+
14021
+ const __iconNode$4 = [
14022
+ [
14023
+ "path",
14024
+ {
14025
+ 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",
14026
+ key: "wmoenq"
14027
+ }
14028
+ ],
14029
+ [
14030
+ "path",
14031
+ {
14032
+ d: "M12 9v4",
14033
+ key: "juzpu7"
14034
+ }
14035
+ ],
14036
+ [
14037
+ "path",
14038
+ {
14039
+ d: "M12 17h.01",
14040
+ key: "p32p05"
14041
+ }
14042
+ ]
14043
+ ];
14044
+ const TriangleAlert = createLucideIcon("triangle-alert", __iconNode$4);
14020
14045
 
14021
14046
  const __iconNode$3 = [
14022
14047
  [
@@ -47838,7 +47863,7 @@ const Paragraph = /*#__PURE__*/ React__namespace.forwardRef((props, ref)=>{
47838
47863
  }, children);
47839
47864
  });
47840
47865
 
47841
- const Text$2 = /*#__PURE__*/ React__namespace.forwardRef((props, ref)=>{
47866
+ const Text$3 = /*#__PURE__*/ React__namespace.forwardRef((props, ref)=>{
47842
47867
  const { ellipsis, children, ...restProps } = props;
47843
47868
  const mergedEllipsis = React__namespace.useMemo(()=>{
47844
47869
  if (ellipsis && typeof ellipsis === 'object') {
@@ -47885,7 +47910,7 @@ const Title$1 = /*#__PURE__*/ React__namespace.forwardRef((props, ref)=>{
47885
47910
  });
47886
47911
 
47887
47912
  const Typography = Typography$1;
47888
- Typography.Text = Text$2;
47913
+ Typography.Text = Text$3;
47889
47914
  Typography.Link = Link$1;
47890
47915
  Typography.Title = Title$1;
47891
47916
  Typography.Paragraph = Paragraph;
@@ -48206,6 +48231,130 @@ function valueToTreeNodes(value, path) {
48206
48231
  return valueToTreeNodes(data, "$root");
48207
48232
  }
48208
48233
 
48234
+ const { Text: Text$2 } = Typography;
48235
+ /**
48236
+ * Detect whether a tool/node output is an error envelope rather than a regular
48237
+ * return value. Failed nodes serialize as `{ type, message, traceback }`; a
48238
+ * traceback alone, or a `type` + `message` pair, is enough to treat it as an
48239
+ * error. Returns the parsed error (with only string fields kept) or null.
48240
+ */ function parseErrorOutput(output) {
48241
+ if (output === null || typeof output !== "object" || Array.isArray(output)) {
48242
+ return null;
48243
+ }
48244
+ const obj = output;
48245
+ const type = typeof obj.type === "string" ? obj.type : undefined;
48246
+ const message = typeof obj.message === "string" ? obj.message : undefined;
48247
+ const traceback = typeof obj.traceback === "string" ? obj.traceback : undefined;
48248
+ const looksLikeError = traceback !== undefined || type !== undefined && message !== undefined;
48249
+ return looksLikeError ? {
48250
+ type,
48251
+ message,
48252
+ traceback
48253
+ } : null;
48254
+ }
48255
+ /**
48256
+ * Renders a failed node/tool output distinctly from a regular returned object:
48257
+ * a destructive-tinted surface with the exception type, message, and a
48258
+ * collapsible traceback.
48259
+ */ const ErrorOutput = ({ error })=>{
48260
+ const { theme } = useTheme$1();
48261
+ const [showTraceback, setShowTraceback] = React.useState(false);
48262
+ const destructive = theme?.colors?.destructive ?? "hsl(0 84.2% 60.2%)";
48263
+ const foreground = theme?.colors?.foreground ?? "inherit";
48264
+ const mutedForeground = theme?.colors?.mutedForeground ?? "inherit";
48265
+ const radius = theme?.borderRadius?.md ?? "0.375rem";
48266
+ const xs = theme?.spacing?.xs ?? "0.25rem";
48267
+ const sm = theme?.spacing?.sm ?? "0.5rem";
48268
+ const md = theme?.spacing?.md ?? "1rem";
48269
+ const fontXs = theme?.fontSize?.xs ?? "0.75rem";
48270
+ const fontSm = theme?.fontSize?.sm ?? "0.875rem";
48271
+ const { type, message, traceback } = error;
48272
+ return /*#__PURE__*/ React.createElement("div", {
48273
+ "data-testid": "error-output",
48274
+ style: {
48275
+ border: `1px solid color-mix(in srgb, ${destructive} 45%, transparent)`,
48276
+ background: `color-mix(in srgb, ${destructive} 8%, transparent)`,
48277
+ borderRadius: radius,
48278
+ padding: md,
48279
+ display: "flex",
48280
+ flexDirection: "column",
48281
+ gap: sm
48282
+ }
48283
+ }, /*#__PURE__*/ React.createElement("div", {
48284
+ style: {
48285
+ display: "flex",
48286
+ alignItems: "center",
48287
+ gap: sm,
48288
+ flexWrap: "wrap"
48289
+ }
48290
+ }, /*#__PURE__*/ React.createElement(TriangleAlert, {
48291
+ size: 16,
48292
+ color: destructive,
48293
+ strokeWidth: 2,
48294
+ "aria-hidden": true
48295
+ }), /*#__PURE__*/ React.createElement(Tag, {
48296
+ color: "red",
48297
+ style: {
48298
+ margin: 0
48299
+ }
48300
+ }, type || "Error")), message && /*#__PURE__*/ React.createElement(Text$2, {
48301
+ strong: true,
48302
+ style: {
48303
+ color: foreground,
48304
+ fontSize: fontSm,
48305
+ wordBreak: "break-word"
48306
+ }
48307
+ }, message), traceback && /*#__PURE__*/ React.createElement("div", {
48308
+ style: {
48309
+ display: "flex",
48310
+ flexDirection: "column",
48311
+ gap: xs
48312
+ }
48313
+ }, /*#__PURE__*/ React.createElement("button", {
48314
+ type: "button",
48315
+ onClick: ()=>setShowTraceback((prev)=>!prev),
48316
+ "aria-expanded": showTraceback,
48317
+ style: {
48318
+ display: "inline-flex",
48319
+ alignItems: "center",
48320
+ gap: xs,
48321
+ alignSelf: "flex-start",
48322
+ padding: 0,
48323
+ border: "none",
48324
+ background: "transparent",
48325
+ cursor: "pointer",
48326
+ color: destructive,
48327
+ fontSize: fontXs,
48328
+ fontWeight: 500
48329
+ }
48330
+ }, showTraceback ? /*#__PURE__*/ React.createElement(ChevronDown, {
48331
+ size: 14,
48332
+ strokeWidth: 2,
48333
+ "aria-hidden": true
48334
+ }) : /*#__PURE__*/ React.createElement(ChevronRight, {
48335
+ size: 14,
48336
+ strokeWidth: 2,
48337
+ "aria-hidden": true
48338
+ }), showTraceback ? "Hide traceback" : "Show traceback"), showTraceback && /*#__PURE__*/ React.createElement("pre", {
48339
+ "data-testid": "error-output-traceback",
48340
+ style: {
48341
+ margin: 0,
48342
+ padding: sm,
48343
+ borderRadius: radius,
48344
+ background: `color-mix(in srgb, ${destructive} 6%, transparent)`,
48345
+ border: `1px solid color-mix(in srgb, ${destructive} 25%, transparent)`,
48346
+ color: mutedForeground,
48347
+ fontFamily: "monospace",
48348
+ fontSize: fontXs,
48349
+ lineHeight: 1.5,
48350
+ whiteSpace: "pre-wrap",
48351
+ wordBreak: "break-word",
48352
+ maxHeight: "300px",
48353
+ overflow: "auto"
48354
+ }
48355
+ }, traceback)));
48356
+ };
48357
+
48209
48358
  const { Text: Text$1 } = Typography;
48210
48359
  function themedCodeSurface(theme) {
48211
48360
  return {
@@ -48384,8 +48533,9 @@ const InputsOutputsCollapse = ({ inputs, output, toolOutput, modelProvider, mode
48384
48533
  const { theme } = useTheme$1();
48385
48534
  const hasInputs = hasInputsProp ?? inputs.length > 0;
48386
48535
  const hasOutputs = output !== null || toolOutput !== null;
48536
+ const errorOutput = parseErrorOutput(toolOutput);
48387
48537
  const outputsText = hasOutputs ? formatOutputAsText(output, toolOutput) : "";
48388
- const isToolOutputTabular = toolOutput !== null && toolOutput !== undefined && isTabularData(toolOutput);
48538
+ const isToolOutputTabular = !errorOutput && toolOutput !== null && toolOutput !== undefined && isTabularData(toolOutput);
48389
48539
  const toolInputText = getToolInputText(inputs);
48390
48540
  const inputsLabel = largeInputsTitle ? /*#__PURE__*/ React.createElement("div", {
48391
48541
  style: {
@@ -48470,13 +48620,26 @@ const InputsOutputsCollapse = ({ inputs, output, toolOutput, modelProvider, mode
48470
48620
  },
48471
48621
  {
48472
48622
  key: "outputs",
48473
- label: /*#__PURE__*/ React.createElement(Text$1, {
48623
+ label: /*#__PURE__*/ React.createElement("div", {
48624
+ style: {
48625
+ display: "flex",
48626
+ alignItems: "center",
48627
+ gap: theme.spacing.sm
48628
+ }
48629
+ }, /*#__PURE__*/ React.createElement(Text$1, {
48474
48630
  strong: true,
48475
48631
  style: {
48476
48632
  color: theme.colors.foreground
48477
48633
  }
48478
- }, "Outputs"),
48479
- children: hasOutputs ? isToolOutputTabular ? /*#__PURE__*/ React.createElement(JsonValueTree, {
48634
+ }, "Outputs"), errorOutput && /*#__PURE__*/ React.createElement(Tag, {
48635
+ color: "red",
48636
+ style: {
48637
+ margin: 0
48638
+ }
48639
+ }, "Failed")),
48640
+ children: hasOutputs ? errorOutput ? /*#__PURE__*/ React.createElement(ErrorOutput, {
48641
+ error: errorOutput
48642
+ }) : isToolOutputTabular ? /*#__PURE__*/ React.createElement(JsonValueTree, {
48480
48643
  data: toolOutput
48481
48644
  }) : /*#__PURE__*/ React.createElement("pre", {
48482
48645
  style: outputPreStyle
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$C = [
12922
+ const __iconNode$D = [
12923
12923
  [
12924
12924
  "path",
12925
12925
  {
@@ -12935,9 +12935,9 @@ const __iconNode$C = [
12935
12935
  }
12936
12936
  ]
12937
12937
  ];
12938
- const ArrowLeft = createLucideIcon("arrow-left", __iconNode$C);
12938
+ const ArrowLeft = createLucideIcon("arrow-left", __iconNode$D);
12939
12939
 
12940
- const __iconNode$B = [
12940
+ const __iconNode$C = [
12941
12941
  [
12942
12942
  "path",
12943
12943
  {
@@ -12953,9 +12953,9 @@ const __iconNode$B = [
12953
12953
  }
12954
12954
  ]
12955
12955
  ];
12956
- const ArrowRight = createLucideIcon("arrow-right", __iconNode$B);
12956
+ const ArrowRight = createLucideIcon("arrow-right", __iconNode$C);
12957
12957
 
12958
- const __iconNode$A = [
12958
+ const __iconNode$B = [
12959
12959
  [
12960
12960
  "path",
12961
12961
  {
@@ -13003,9 +13003,9 @@ const __iconNode$A = [
13003
13003
  }
13004
13004
  ]
13005
13005
  ];
13006
- const Bot = createLucideIcon("bot", __iconNode$A);
13006
+ const Bot = createLucideIcon("bot", __iconNode$B);
13007
13007
 
13008
- const __iconNode$z = [
13008
+ const __iconNode$A = [
13009
13009
  [
13010
13010
  "path",
13011
13011
  {
@@ -13039,9 +13039,9 @@ const __iconNode$z = [
13039
13039
  }
13040
13040
  ]
13041
13041
  ];
13042
- const Calendar = createLucideIcon("calendar", __iconNode$z);
13042
+ const Calendar = createLucideIcon("calendar", __iconNode$A);
13043
13043
 
13044
- const __iconNode$y = [
13044
+ const __iconNode$z = [
13045
13045
  [
13046
13046
  "path",
13047
13047
  {
@@ -13098,9 +13098,9 @@ const __iconNode$y = [
13098
13098
  }
13099
13099
  ]
13100
13100
  ];
13101
- const ChartNetwork = createLucideIcon("chart-network", __iconNode$y);
13101
+ const ChartNetwork = createLucideIcon("chart-network", __iconNode$z);
13102
13102
 
13103
- const __iconNode$x = [
13103
+ const __iconNode$y = [
13104
13104
  [
13105
13105
  "path",
13106
13106
  {
@@ -13109,9 +13109,9 @@ const __iconNode$x = [
13109
13109
  }
13110
13110
  ]
13111
13111
  ];
13112
- const ChevronDown = createLucideIcon("chevron-down", __iconNode$x);
13112
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$y);
13113
13113
 
13114
- const __iconNode$w = [
13114
+ const __iconNode$x = [
13115
13115
  [
13116
13116
  "path",
13117
13117
  {
@@ -13120,9 +13120,9 @@ const __iconNode$w = [
13120
13120
  }
13121
13121
  ]
13122
13122
  ];
13123
- const ChevronRight = createLucideIcon("chevron-right", __iconNode$w);
13123
+ const ChevronRight = createLucideIcon("chevron-right", __iconNode$x);
13124
13124
 
13125
- const __iconNode$v = [
13125
+ const __iconNode$w = [
13126
13126
  [
13127
13127
  "path",
13128
13128
  {
@@ -13138,9 +13138,9 @@ const __iconNode$v = [
13138
13138
  }
13139
13139
  ]
13140
13140
  ];
13141
- const ChevronsDown = createLucideIcon("chevrons-down", __iconNode$v);
13141
+ const ChevronsDown = createLucideIcon("chevrons-down", __iconNode$w);
13142
13142
 
13143
- const __iconNode$u = [
13143
+ const __iconNode$v = [
13144
13144
  [
13145
13145
  "path",
13146
13146
  {
@@ -13156,9 +13156,9 @@ const __iconNode$u = [
13156
13156
  }
13157
13157
  ]
13158
13158
  ];
13159
- const ChevronsUp = createLucideIcon("chevrons-up", __iconNode$u);
13159
+ const ChevronsUp = createLucideIcon("chevrons-up", __iconNode$v);
13160
13160
 
13161
- const __iconNode$t = [
13161
+ const __iconNode$u = [
13162
13162
  [
13163
13163
  "circle",
13164
13164
  {
@@ -13189,9 +13189,9 @@ const __iconNode$t = [
13189
13189
  }
13190
13190
  ]
13191
13191
  ];
13192
- const CircleAlert = createLucideIcon("circle-alert", __iconNode$t);
13192
+ const CircleAlert = createLucideIcon("circle-alert", __iconNode$u);
13193
13193
 
13194
- const __iconNode$s = [
13194
+ const __iconNode$t = [
13195
13195
  [
13196
13196
  "path",
13197
13197
  {
@@ -13207,9 +13207,9 @@ const __iconNode$s = [
13207
13207
  }
13208
13208
  ]
13209
13209
  ];
13210
- const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$s);
13210
+ const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$t);
13211
13211
 
13212
- const __iconNode$r = [
13212
+ const __iconNode$s = [
13213
13213
  [
13214
13214
  "circle",
13215
13215
  {
@@ -13234,9 +13234,9 @@ const __iconNode$r = [
13234
13234
  }
13235
13235
  ]
13236
13236
  ];
13237
- const CircleDollarSign = createLucideIcon("circle-dollar-sign", __iconNode$r);
13237
+ const CircleDollarSign = createLucideIcon("circle-dollar-sign", __iconNode$s);
13238
13238
 
13239
- const __iconNode$q = [
13239
+ const __iconNode$r = [
13240
13240
  [
13241
13241
  "circle",
13242
13242
  {
@@ -13254,9 +13254,9 @@ const __iconNode$q = [
13254
13254
  }
13255
13255
  ]
13256
13256
  ];
13257
- const Clock = createLucideIcon("clock", __iconNode$q);
13257
+ const Clock = createLucideIcon("clock", __iconNode$r);
13258
13258
 
13259
- const __iconNode$p = [
13259
+ const __iconNode$q = [
13260
13260
  [
13261
13261
  "rect",
13262
13262
  {
@@ -13277,9 +13277,9 @@ const __iconNode$p = [
13277
13277
  }
13278
13278
  ]
13279
13279
  ];
13280
- const Copy = createLucideIcon("copy", __iconNode$p);
13280
+ const Copy = createLucideIcon("copy", __iconNode$q);
13281
13281
 
13282
- const __iconNode$o = [
13282
+ const __iconNode$p = [
13283
13283
  [
13284
13284
  "path",
13285
13285
  {
@@ -13387,9 +13387,9 @@ const __iconNode$o = [
13387
13387
  }
13388
13388
  ]
13389
13389
  ];
13390
- const Cpu = createLucideIcon("cpu", __iconNode$o);
13390
+ const Cpu = createLucideIcon("cpu", __iconNode$p);
13391
13391
 
13392
- const __iconNode$n = [
13392
+ const __iconNode$o = [
13393
13393
  [
13394
13394
  "line",
13395
13395
  {
@@ -13408,9 +13408,9 @@ const __iconNode$n = [
13408
13408
  }
13409
13409
  ]
13410
13410
  ];
13411
- const DollarSign = createLucideIcon("dollar-sign", __iconNode$n);
13411
+ const DollarSign = createLucideIcon("dollar-sign", __iconNode$o);
13412
13412
 
13413
- const __iconNode$m = [
13413
+ const __iconNode$n = [
13414
13414
  [
13415
13415
  "path",
13416
13416
  {
@@ -13440,9 +13440,9 @@ const __iconNode$m = [
13440
13440
  }
13441
13441
  ]
13442
13442
  ];
13443
- const FileInput = createLucideIcon("file-input", __iconNode$m);
13443
+ const FileInput = createLucideIcon("file-input", __iconNode$n);
13444
13444
 
13445
- const __iconNode$l = [
13445
+ const __iconNode$m = [
13446
13446
  [
13447
13447
  "path",
13448
13448
  {
@@ -13472,9 +13472,9 @@ const __iconNode$l = [
13472
13472
  }
13473
13473
  ]
13474
13474
  ];
13475
- const FileOutput = createLucideIcon("file-output", __iconNode$l);
13475
+ const FileOutput = createLucideIcon("file-output", __iconNode$m);
13476
13476
 
13477
- const __iconNode$k = [
13477
+ const __iconNode$l = [
13478
13478
  [
13479
13479
  "path",
13480
13480
  {
@@ -13532,9 +13532,9 @@ const __iconNode$k = [
13532
13532
  }
13533
13533
  ]
13534
13534
  ];
13535
- const FoldVertical = createLucideIcon("fold-vertical", __iconNode$k);
13535
+ const FoldVertical = createLucideIcon("fold-vertical", __iconNode$l);
13536
13536
 
13537
- const __iconNode$j = [
13537
+ const __iconNode$k = [
13538
13538
  [
13539
13539
  "path",
13540
13540
  {
@@ -13550,9 +13550,9 @@ const __iconNode$j = [
13550
13550
  }
13551
13551
  ]
13552
13552
  ];
13553
- const Gauge = createLucideIcon("gauge", __iconNode$j);
13553
+ const Gauge = createLucideIcon("gauge", __iconNode$k);
13554
13554
 
13555
- const __iconNode$i = [
13555
+ const __iconNode$j = [
13556
13556
  [
13557
13557
  "line",
13558
13558
  {
@@ -13594,9 +13594,9 @@ const __iconNode$i = [
13594
13594
  }
13595
13595
  ]
13596
13596
  ];
13597
- const Hash = createLucideIcon("hash", __iconNode$i);
13597
+ const Hash = createLucideIcon("hash", __iconNode$j);
13598
13598
 
13599
- const __iconNode$h = [
13599
+ const __iconNode$i = [
13600
13600
  [
13601
13601
  "circle",
13602
13602
  {
@@ -13621,9 +13621,9 @@ const __iconNode$h = [
13621
13621
  }
13622
13622
  ]
13623
13623
  ];
13624
- const Info = createLucideIcon("info", __iconNode$h);
13624
+ const Info = createLucideIcon("info", __iconNode$i);
13625
13625
 
13626
- const __iconNode$g = [
13626
+ const __iconNode$h = [
13627
13627
  [
13628
13628
  "path",
13629
13629
  {
@@ -13660,9 +13660,9 @@ const __iconNode$g = [
13660
13660
  }
13661
13661
  ]
13662
13662
  ];
13663
- const ListChecks = createLucideIcon("list-checks", __iconNode$g);
13663
+ const ListChecks = createLucideIcon("list-checks", __iconNode$h);
13664
13664
 
13665
- const __iconNode$f = [
13665
+ const __iconNode$g = [
13666
13666
  [
13667
13667
  "path",
13668
13668
  {
@@ -13692,9 +13692,9 @@ const __iconNode$f = [
13692
13692
  }
13693
13693
  ]
13694
13694
  ];
13695
- const MessageSquareText = createLucideIcon("message-square-text", __iconNode$f);
13695
+ const MessageSquareText = createLucideIcon("message-square-text", __iconNode$g);
13696
13696
 
13697
- const __iconNode$e = [
13697
+ const __iconNode$f = [
13698
13698
  [
13699
13699
  "path",
13700
13700
  {
@@ -13710,9 +13710,9 @@ const __iconNode$e = [
13710
13710
  }
13711
13711
  ]
13712
13712
  ];
13713
- const MessagesSquare = createLucideIcon("messages-square", __iconNode$e);
13713
+ const MessagesSquare = createLucideIcon("messages-square", __iconNode$f);
13714
13714
 
13715
- const __iconNode$d = [
13715
+ const __iconNode$e = [
13716
13716
  [
13717
13717
  "rect",
13718
13718
  {
@@ -13732,9 +13732,9 @@ const __iconNode$d = [
13732
13732
  }
13733
13733
  ]
13734
13734
  ];
13735
- const PanelLeft = createLucideIcon("panel-left", __iconNode$d);
13735
+ const PanelLeft = createLucideIcon("panel-left", __iconNode$e);
13736
13736
 
13737
- const __iconNode$c = [
13737
+ const __iconNode$d = [
13738
13738
  [
13739
13739
  "rect",
13740
13740
  {
@@ -13761,9 +13761,9 @@ const __iconNode$c = [
13761
13761
  }
13762
13762
  ]
13763
13763
  ];
13764
- const PanelRightOpen = createLucideIcon("panel-right-open", __iconNode$c);
13764
+ const PanelRightOpen = createLucideIcon("panel-right-open", __iconNode$d);
13765
13765
 
13766
- const __iconNode$b = [
13766
+ const __iconNode$c = [
13767
13767
  [
13768
13768
  "path",
13769
13769
  {
@@ -13793,9 +13793,9 @@ const __iconNode$b = [
13793
13793
  }
13794
13794
  ]
13795
13795
  ];
13796
- const RefreshCw = createLucideIcon("refresh-cw", __iconNode$b);
13796
+ const RefreshCw = createLucideIcon("refresh-cw", __iconNode$c);
13797
13797
 
13798
- const __iconNode$a = [
13798
+ const __iconNode$b = [
13799
13799
  [
13800
13800
  "path",
13801
13801
  {
@@ -13832,9 +13832,9 @@ const __iconNode$a = [
13832
13832
  }
13833
13833
  ]
13834
13834
  ];
13835
- const Scale = createLucideIcon("scale", __iconNode$a);
13835
+ const Scale = createLucideIcon("scale", __iconNode$b);
13836
13836
 
13837
- const __iconNode$9 = [
13837
+ const __iconNode$a = [
13838
13838
  [
13839
13839
  "path",
13840
13840
  {
@@ -13868,9 +13868,9 @@ const __iconNode$9 = [
13868
13868
  }
13869
13869
  ]
13870
13870
  ];
13871
- const Settings2 = createLucideIcon("settings-2", __iconNode$9);
13871
+ const Settings2 = createLucideIcon("settings-2", __iconNode$a);
13872
13872
 
13873
- const __iconNode$8 = [
13873
+ const __iconNode$9 = [
13874
13874
  [
13875
13875
  "path",
13876
13876
  {
@@ -13893,9 +13893,9 @@ const __iconNode$8 = [
13893
13893
  }
13894
13894
  ]
13895
13895
  ];
13896
- const Share = createLucideIcon("share", __iconNode$8);
13896
+ const Share = createLucideIcon("share", __iconNode$9);
13897
13897
 
13898
- const __iconNode$7 = [
13898
+ const __iconNode$8 = [
13899
13899
  [
13900
13900
  "path",
13901
13901
  {
@@ -13904,9 +13904,9 @@ const __iconNode$7 = [
13904
13904
  }
13905
13905
  ]
13906
13906
  ];
13907
- const Shield = createLucideIcon("shield", __iconNode$7);
13907
+ const Shield = createLucideIcon("shield", __iconNode$8);
13908
13908
 
13909
- const __iconNode$6 = [
13909
+ const __iconNode$7 = [
13910
13910
  [
13911
13911
  "path",
13912
13912
  {
@@ -13932,9 +13932,9 @@ const __iconNode$6 = [
13932
13932
  }
13933
13933
  ]
13934
13934
  ];
13935
- const Tags = createLucideIcon("tags", __iconNode$6);
13935
+ const Tags = createLucideIcon("tags", __iconNode$7);
13936
13936
 
13937
- const __iconNode$5 = [
13937
+ const __iconNode$6 = [
13938
13938
  [
13939
13939
  "circle",
13940
13940
  {
@@ -13963,9 +13963,9 @@ const __iconNode$5 = [
13963
13963
  }
13964
13964
  ]
13965
13965
  ];
13966
- const Target = createLucideIcon("target", __iconNode$5);
13966
+ const Target = createLucideIcon("target", __iconNode$6);
13967
13967
 
13968
- const __iconNode$4 = [
13968
+ const __iconNode$5 = [
13969
13969
  [
13970
13970
  "line",
13971
13971
  {
@@ -13996,7 +13996,32 @@ const __iconNode$4 = [
13996
13996
  }
13997
13997
  ]
13998
13998
  ];
13999
- 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);
14000
14025
 
14001
14026
  const __iconNode$3 = [
14002
14027
  [
@@ -47818,7 +47843,7 @@ const Paragraph = /*#__PURE__*/ React.forwardRef((props, ref)=>{
47818
47843
  }, children);
47819
47844
  });
47820
47845
 
47821
- const Text$2 = /*#__PURE__*/ React.forwardRef((props, ref)=>{
47846
+ const Text$3 = /*#__PURE__*/ React.forwardRef((props, ref)=>{
47822
47847
  const { ellipsis, children, ...restProps } = props;
47823
47848
  const mergedEllipsis = React.useMemo(()=>{
47824
47849
  if (ellipsis && typeof ellipsis === 'object') {
@@ -47865,7 +47890,7 @@ const Title$1 = /*#__PURE__*/ React.forwardRef((props, ref)=>{
47865
47890
  });
47866
47891
 
47867
47892
  const Typography = Typography$1;
47868
- Typography.Text = Text$2;
47893
+ Typography.Text = Text$3;
47869
47894
  Typography.Link = Link$1;
47870
47895
  Typography.Title = Title$1;
47871
47896
  Typography.Paragraph = Paragraph;
@@ -48186,6 +48211,130 @@ function valueToTreeNodes(value, path) {
48186
48211
  return valueToTreeNodes(data, "$root");
48187
48212
  }
48188
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
+
48189
48338
  const { Text: Text$1 } = Typography;
48190
48339
  function themedCodeSurface(theme) {
48191
48340
  return {
@@ -48364,8 +48513,9 @@ const InputsOutputsCollapse = ({ inputs, output, toolOutput, modelProvider, mode
48364
48513
  const { theme } = useTheme$1();
48365
48514
  const hasInputs = hasInputsProp ?? inputs.length > 0;
48366
48515
  const hasOutputs = output !== null || toolOutput !== null;
48516
+ const errorOutput = parseErrorOutput(toolOutput);
48367
48517
  const outputsText = hasOutputs ? formatOutputAsText(output, toolOutput) : "";
48368
- const isToolOutputTabular = toolOutput !== null && toolOutput !== undefined && isTabularData(toolOutput);
48518
+ const isToolOutputTabular = !errorOutput && toolOutput !== null && toolOutput !== undefined && isTabularData(toolOutput);
48369
48519
  const toolInputText = getToolInputText(inputs);
48370
48520
  const inputsLabel = largeInputsTitle ? /*#__PURE__*/ React__default.createElement("div", {
48371
48521
  style: {
@@ -48450,13 +48600,26 @@ const InputsOutputsCollapse = ({ inputs, output, toolOutput, modelProvider, mode
48450
48600
  },
48451
48601
  {
48452
48602
  key: "outputs",
48453
- 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, {
48454
48610
  strong: true,
48455
48611
  style: {
48456
48612
  color: theme.colors.foreground
48457
48613
  }
48458
- }, "Outputs"),
48459
- 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, {
48460
48623
  data: toolOutput
48461
48624
  }) : /*#__PURE__*/ React__default.createElement("pre", {
48462
48625
  style: outputPreStyle
@@ -0,0 +1,26 @@
1
+ import React from "react";
2
+ /** Error envelope produced by the Railtracks backend for a failed node/tool. */
3
+ export interface ToolErrorOutput {
4
+ /** Exception class name, e.g. "ValueError". */
5
+ type?: string;
6
+ /** Human-readable exception message. */
7
+ message?: string;
8
+ /** Full Python traceback string. */
9
+ traceback?: string;
10
+ }
11
+ /**
12
+ * Detect whether a tool/node output is an error envelope rather than a regular
13
+ * return value. Failed nodes serialize as `{ type, message, traceback }`; a
14
+ * traceback alone, or a `type` + `message` pair, is enough to treat it as an
15
+ * error. Returns the parsed error (with only string fields kept) or null.
16
+ */
17
+ export declare function parseErrorOutput(output: unknown): ToolErrorOutput | null;
18
+ export interface ErrorOutputProps {
19
+ error: ToolErrorOutput;
20
+ }
21
+ /**
22
+ * Renders a failed node/tool output distinctly from a regular returned object:
23
+ * a destructive-tinted surface with the exception type, message, and a
24
+ * collapsible traceback.
25
+ */
26
+ export declare const ErrorOutput: React.FC<ErrorOutputProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@railtownai/railtracks-visualizer",
3
- "version": "0.0.70",
3
+ "version": "0.0.71",
4
4
  "license": "MIT",
5
5
  "author": "Railtown AI",
6
6
  "description": "A visualizer for Railtracks agentic flows",