@axiom-lattice/react-sdk 2.1.4 → 2.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -319,11 +319,14 @@ function useChat(threadId, options = {}) {
319
319
  pollInterval: options.resumeStreamPollInterval || 100
320
320
  },
321
321
  handleStreamEvent,
322
- () => {
322
+ async () => {
323
323
  setState((prev) => ({
324
324
  ...prev,
325
325
  isLoading: false
326
326
  }));
327
+ if (options.enableReturnStateWhenStreamCompleted) {
328
+ await fetchAndUpdateAgentState(threadId);
329
+ }
327
330
  stopStreamingRef.current = null;
328
331
  },
329
332
  (error) => {
@@ -635,25 +638,14 @@ var import_react_syntax_highlighter = require("react-syntax-highlighter");
635
638
  var import_prism = require("react-syntax-highlighter/dist/cjs/styles/prism");
636
639
  var import_remark_gfm = __toESM(require("remark-gfm"));
637
640
  var import_react13 = require("react");
638
- var import_antd_style6 = require("antd-style");
641
+ var import_antd_style5 = require("antd-style");
639
642
  var import_rehype_raw = __toESM(require("rehype-raw"));
640
643
 
641
644
  // src/components/GenUI/elements/confirm_feedback.tsx
642
645
  var import_antd = require("antd");
643
646
  var import_react6 = require("react");
644
- var import_antd_style = require("antd-style");
645
647
  var import_jsx_runtime2 = require("react/jsx-runtime");
646
648
  var { Text } = import_antd.Typography;
647
- var useStyle = (0, import_antd_style.createStyles)(({ token, css }) => ({
648
- card: css`
649
- max-width: 1200px;
650
- background: linear-gradient(
651
- 919deg,
652
- rgb(232 67 157 / 8%),
653
- rgb(250 235 206 / 28%) 43%
654
- );
655
- `
656
- }));
657
649
  var ConfirmFeedback = ({
658
650
  data,
659
651
  eventHandler,
@@ -661,23 +653,7 @@ var ConfirmFeedback = ({
661
653
  }) => {
662
654
  const { message: message3, type, config, feedback, options } = data ?? {};
663
655
  const [clicked, setClicked] = (0, import_react6.useState)(false);
664
- const { styles } = useStyle();
665
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_antd.Card, { size: "small", className: `shadow-sm ${styles.card}`, bordered: false, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_antd.Space, { direction: "vertical", style: { width: "100%" }, children: [
666
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
667
- import_antd.Tag,
668
- {
669
- bordered: false,
670
- color: "orange",
671
- style: {
672
- fontSize: 14,
673
- fontWeight: "bold",
674
- background: "#ffffff8f",
675
- padding: 4,
676
- borderRadius: 8
677
- },
678
- children: "\u8BF7\u6C42\u786E\u8BA4"
679
- }
680
- ),
656
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_antd.Space, { direction: "vertical", style: { width: "100%" }, children: [
681
657
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(MDResponse, { content: message3 }),
682
658
  options ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_antd.Space, { style: { justifyContent: "flex-end", width: "100%" }, children: options?.map((option) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
683
659
  import_antd.Button,
@@ -744,7 +720,7 @@ var ConfirmFeedback = ({
744
720
  }
745
721
  )
746
722
  ] })
747
- ] }) });
723
+ ] });
748
724
  };
749
725
 
750
726
  // src/components/GenUI/elements/generic_data_table.tsx
@@ -913,11 +889,11 @@ var import_icons3 = require("@ant-design/icons");
913
889
 
914
890
  // src/components/GenUI/elements/ToolCard.tsx
915
891
  var import_antd3 = require("antd");
916
- var import_antd_style2 = require("antd-style");
892
+ var import_antd_style = require("antd-style");
917
893
  var import_icons2 = require("@ant-design/icons");
918
894
  var import_jsx_runtime5 = require("react/jsx-runtime");
919
895
  var { Text: Text3, Title } = import_antd3.Typography;
920
- var useStyle2 = (0, import_antd_style2.createStyles)(({ token, css }) => ({
896
+ var useStyle = (0, import_antd_style.createStyles)(({ token, css }) => ({
921
897
  card: css`
922
898
  max-width: 500px;
923
899
  background: linear-gradient(
@@ -984,7 +960,7 @@ var ToolCard = ({
984
960
  eventHandler,
985
961
  interactive = true
986
962
  }) => {
987
- const { styles } = useStyle2();
963
+ const { styles } = useStyle();
988
964
  if (!data || !data.name) {
989
965
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_antd3.Card, { size: "small", className: styles.card, bordered: false, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text3, { type: "secondary", children: "Invalid tool data" }) });
990
966
  }
@@ -1188,11 +1164,11 @@ var ToolCall = ({ data, eventHandler }) => {
1188
1164
 
1189
1165
  // src/components/GenUI/elements/Todo.tsx
1190
1166
  var import_antd5 = require("antd");
1191
- var import_antd_style3 = require("antd-style");
1167
+ var import_antd_style2 = require("antd-style");
1192
1168
  var import_icons4 = require("@ant-design/icons");
1193
1169
  var import_jsx_runtime7 = require("react/jsx-runtime");
1194
1170
  var { Text: Text4 } = import_antd5.Typography;
1195
- var useStyle3 = (0, import_antd_style3.createStyles)(({ token, css }) => ({
1171
+ var useStyle2 = (0, import_antd_style2.createStyles)(({ token, css }) => ({
1196
1172
  card: css`
1197
1173
  max-width: 1200px;
1198
1174
  background: linear-gradient(
@@ -1224,7 +1200,7 @@ var Todo = ({
1224
1200
  eventHandler,
1225
1201
  interactive = true
1226
1202
  }) => {
1227
- const { styles } = useStyle3();
1203
+ const { styles } = useStyle2();
1228
1204
  const getStatusIcon3 = (status) => {
1229
1205
  switch (status) {
1230
1206
  case "completed":
@@ -1382,7 +1358,7 @@ var WriteTodos = ({
1382
1358
  var import_react8 = require("react");
1383
1359
  var import_antd7 = require("antd");
1384
1360
  var import_icons7 = require("@ant-design/icons");
1385
- var import_antd_style4 = require("antd-style");
1361
+ var import_antd_style3 = require("antd-style");
1386
1362
 
1387
1363
  // src/components/GenUI/elements/getFileIcon.tsx
1388
1364
  var import_icons6 = require("@ant-design/icons");
@@ -1420,7 +1396,7 @@ var getFileIcon = (filename) => {
1420
1396
 
1421
1397
  // src/components/GenUI/FileExplorer.tsx
1422
1398
  var import_jsx_runtime10 = require("react/jsx-runtime");
1423
- var useStyles = (0, import_antd_style4.createStyles)(({ token, css }) => ({
1399
+ var useStyles = (0, import_antd_style3.createStyles)(({ token, css }) => ({
1424
1400
  container: css`
1425
1401
  height: 100%;
1426
1402
  background: ${token.colorBgContainer};
@@ -1782,7 +1758,7 @@ var AttachmentsCard = ({
1782
1758
  columns = 1,
1783
1759
  showDownloadButton = false
1784
1760
  }) => {
1785
- const { Text: Text8 } = import_antd8.Typography;
1761
+ const { Text: Text9 } = import_antd8.Typography;
1786
1762
  const [showAll, setShowAll] = (0, import_react9.useState)(false);
1787
1763
  const getStyles = () => {
1788
1764
  switch (size) {
@@ -1859,7 +1835,7 @@ var AttachmentsCard = ({
1859
1835
  );
1860
1836
  };
1861
1837
  const renderFileDescription = (item) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_antd8.Space, { direction: "vertical", size: size === "small" ? 2 : 4, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_antd8.Space, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1862
- Text8,
1838
+ Text9,
1863
1839
  {
1864
1840
  type: "secondary",
1865
1841
  style: {
@@ -1938,7 +1914,7 @@ var AttachmentsCard = ({
1938
1914
  }
1939
1915
  ),
1940
1916
  item.files && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { paddingLeft: "12px" }, children: [
1941
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text8, { type: "secondary", style: { fontSize: "12px" }, children: [
1917
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text9, { type: "secondary", style: { fontSize: "12px" }, children: [
1942
1918
  "\u5305\u542B\u6587\u4EF6(",
1943
1919
  item.files.length,
1944
1920
  ")"
@@ -2047,13 +2023,13 @@ var import_antd11 = require("antd");
2047
2023
  // src/components/GenUI/elements/ContentPreviewCollapse.tsx
2048
2024
  var import_react11 = require("react");
2049
2025
  var import_antd10 = require("antd");
2050
- var import_antd_style5 = require("antd-style");
2026
+ var import_antd_style4 = require("antd-style");
2051
2027
  var import_icons8 = require("@ant-design/icons");
2052
2028
  var import_CollapsePanel3 = __toESM(require("antd/es/collapse/CollapsePanel"));
2053
2029
  var import_jsx_runtime13 = require("react/jsx-runtime");
2054
2030
  var DEFAULT_COLLAPSED_MAX_HEIGHT = 180;
2055
2031
  var DEFAULT_EXPANDED_MAX_HEIGHT = 500;
2056
- var useStyle4 = (0, import_antd_style5.createStyles)(
2032
+ var useStyle3 = (0, import_antd_style4.createStyles)(
2057
2033
  ({ css }, { showShadow }) => ({
2058
2034
  collapse: css`
2059
2035
  .ant-collapse-header {
@@ -2119,7 +2095,7 @@ var ContentPreviewCollapse = ({
2119
2095
  const [isOverflowing, setIsOverflowing] = (0, import_react11.useState)(false);
2120
2096
  const contentRef = (0, import_react11.useRef)(null);
2121
2097
  const showShadow = isOverflowing && !showFullContent;
2122
- const { styles, cx } = useStyle4({ showShadow });
2098
+ const { styles, cx } = useStyle3({ showShadow });
2123
2099
  const checkOverflow = (0, import_react11.useCallback)(() => {
2124
2100
  if (contentRef.current) {
2125
2101
  const scrollHeight = contentRef.current.scrollHeight;
@@ -2454,7 +2430,7 @@ var MDMermaid = ({ children = [] }) => {
2454
2430
  // src/components/GenUI/MDResponse.tsx
2455
2431
  var import_jsx_runtime18 = require("react/jsx-runtime");
2456
2432
  var SyntaxHighlighter = import_react_syntax_highlighter.Prism;
2457
- var useStyles2 = (0, import_antd_style6.createStyles)(({ token, css }) => ({
2433
+ var useStyles2 = (0, import_antd_style5.createStyles)(({ token, css }) => ({
2458
2434
  markdownTableContainer: css`
2459
2435
  overflow-x: auto;
2460
2436
  width: 100%;
@@ -2646,11 +2622,61 @@ var IFrameCard = ({ src }) => {
2646
2622
  // src/components/Chat/Chating.tsx
2647
2623
  var import_icons9 = require("@ant-design/icons");
2648
2624
  var import_x2 = require("@ant-design/x");
2649
- var import_antd13 = require("antd");
2625
+ var import_antd14 = require("antd");
2650
2626
  var import_ErrorBoundary = __toESM(require("antd/es/alert/ErrorBoundary"));
2651
2627
  var import_react14 = __toESM(require("react"));
2652
2628
  var import_react_i18next = require("react-i18next");
2629
+
2630
+ // src/components/GenUI/HITLContainer.tsx
2631
+ var import_antd13 = require("antd");
2632
+ var import_antd_style6 = require("antd-style");
2653
2633
  var import_jsx_runtime19 = require("react/jsx-runtime");
2634
+ var { Text: Text8 } = import_antd13.Typography;
2635
+ var useStyle4 = (0, import_antd_style6.createStyles)(({ token, css }) => ({
2636
+ card: css`
2637
+ max-width: 1200px;
2638
+ margin: 8px 20px;
2639
+ background: linear-gradient(
2640
+ 919deg,
2641
+ rgb(232 67 157 / 8%),
2642
+ rgb(250 235 206 / 28%) 43%
2643
+ );
2644
+ `
2645
+ }));
2646
+ var HITLContainer = ({
2647
+ interrupts,
2648
+ eventHandler
2649
+ }) => {
2650
+ const { styles } = useStyle4();
2651
+ return interrupts && interrupts.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_antd13.Card, { size: "small", className: `shadow-sm ${styles.card}`, bordered: false, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_antd13.Space, { direction: "vertical", style: { width: "100%" }, children: [
2652
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2653
+ import_antd13.Tag,
2654
+ {
2655
+ bordered: false,
2656
+ color: "orange",
2657
+ style: {
2658
+ fontSize: 14,
2659
+ fontWeight: "bold",
2660
+ background: "#ffffff8f",
2661
+ padding: 4,
2662
+ borderRadius: 8
2663
+ },
2664
+ children: "\u7B49\u5F85\u53CD\u9988"
2665
+ }
2666
+ ),
2667
+ interrupts.map((interrupt) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2668
+ MDResponse,
2669
+ {
2670
+ content: interrupt.value,
2671
+ eventHandler
2672
+ },
2673
+ interrupt.id
2674
+ ))
2675
+ ] }) }) : null;
2676
+ };
2677
+
2678
+ // src/components/Chat/Chating.tsx
2679
+ var import_jsx_runtime20 = require("react/jsx-runtime");
2654
2680
  var LazyBubble = ({
2655
2681
  message: message3,
2656
2682
  renderContent,
@@ -2684,16 +2710,16 @@ var LazyBubble = ({
2684
2710
  }, []);
2685
2711
  const getPlaceholder = () => {
2686
2712
  const estimatedHeight = message3.content ? Math.min(100, message3.content.length / 5) : 100;
2687
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { style: { height: `${estimatedHeight}px`, minHeight: "50px" } });
2713
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { height: `${estimatedHeight}px`, minHeight: "50px" } });
2688
2714
  };
2689
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_ErrorBoundary.default, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { ref, style: { width: "100%" }, children: isVisible || wasEverVisible ? renderContent(message3) : getPlaceholder() }) });
2715
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_ErrorBoundary.default, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { ref, style: { width: "100%" }, children: isVisible || wasEverVisible ? renderContent(message3) : getPlaceholder() }) });
2690
2716
  };
2691
2717
  var MemoizedBubbleList = (0, import_react14.memo)(
2692
2718
  ({
2693
2719
  items,
2694
2720
  roles,
2695
2721
  className
2696
- }) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2722
+ }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2697
2723
  import_x2.Bubble.List,
2698
2724
  {
2699
2725
  autoScroll: true,
@@ -2758,7 +2784,7 @@ var Chating = ({
2758
2784
  try {
2759
2785
  const json = JSON.parse(content2);
2760
2786
  if (json.action && json.message) {
2761
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2787
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2762
2788
  MDResponse,
2763
2789
  {
2764
2790
  content: json.message,
@@ -2774,7 +2800,7 @@ ${JSON.stringify(tool_call)}
2774
2800
  \`\`\``;
2775
2801
  }) || [];
2776
2802
  const content_md = [content2, ...tool_calls_md].join("\n");
2777
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_antd13.Space, { direction: "vertical", style: { width: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2803
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_antd14.Space, { direction: "vertical", style: { width: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2778
2804
  MDResponse,
2779
2805
  {
2780
2806
  content: content_md,
@@ -2789,7 +2815,7 @@ ${JSON.stringify(tool_call)}
2789
2815
  key: message3.id,
2790
2816
  role: message3.role,
2791
2817
  typing: false,
2792
- content: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2818
+ content: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2793
2819
  LazyBubble,
2794
2820
  {
2795
2821
  message: message3,
@@ -2839,7 +2865,7 @@ ${JSON.stringify(tool_call)}
2839
2865
  const onSubmit = (nextContent) => {
2840
2866
  if (!nextContent && attachedFiles.length === 0) return;
2841
2867
  if (attachedFiles.filter((f) => f.status !== "done").length > 0) {
2842
- import_antd13.message.warning("\u6587\u4EF6\u8FD8\u5728\u4E0A\u4F20\u4E2D...");
2868
+ import_antd14.message.warning("\u6587\u4EF6\u8FD8\u5728\u4E0A\u4F20\u4E2D...");
2843
2869
  return;
2844
2870
  }
2845
2871
  if (!nextContent && attachedFiles.length > 0) {
@@ -2883,7 +2909,7 @@ ${JSON.stringify(tool_call)}
2883
2909
  setHeaderOpen(true);
2884
2910
  }
2885
2911
  if (info.file?.response?.error || info.file.status === "error") {
2886
- import_antd13.message.error(
2912
+ import_antd14.message.error(
2887
2913
  `${info.file.name} file upload failed.${info.file?.response?.message}`
2888
2914
  );
2889
2915
  }
@@ -2895,22 +2921,22 @@ ${JSON.stringify(tool_call)}
2895
2921
  const beforeUpload = (file) => {
2896
2922
  const isLessThan20MB = file.size / 1024 / 1024 < 20;
2897
2923
  if (!isLessThan20MB) {
2898
- import_antd13.message.error(
2924
+ import_antd14.message.error(
2899
2925
  `File must be smaller than 20MB! ${file.name} is too large.`
2900
2926
  );
2901
2927
  return false;
2902
2928
  }
2903
2929
  return true;
2904
2930
  };
2905
- const attachmentsNode = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_antd13.Badge, { dot: attachedFiles.length > 0 && !headerOpen, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2906
- import_antd13.Button,
2931
+ const attachmentsNode = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_antd14.Badge, { dot: attachedFiles.length > 0 && !headerOpen, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2932
+ import_antd14.Button,
2907
2933
  {
2908
2934
  type: "text",
2909
- icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_icons9.PaperClipOutlined, {}),
2935
+ icon: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_icons9.PaperClipOutlined, {}),
2910
2936
  onClick: () => setHeaderOpen(!headerOpen)
2911
2937
  }
2912
2938
  ) });
2913
- const senderHeader = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2939
+ const senderHeader = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2914
2940
  import_x2.Sender.Header,
2915
2941
  {
2916
2942
  title: "Attachments",
@@ -2922,7 +2948,7 @@ ${JSON.stringify(tool_call)}
2922
2948
  }
2923
2949
  },
2924
2950
  forceRender: true,
2925
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2951
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2926
2952
  import_x2.Attachments,
2927
2953
  {
2928
2954
  ref: attachmentsRef,
@@ -2944,7 +2970,7 @@ ${JSON.stringify(tool_call)}
2944
2970
  multiple: true,
2945
2971
  maxCount: 10,
2946
2972
  placeholder: (type) => ({
2947
- icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_icons9.CloudUploadOutlined, {}),
2973
+ icon: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_icons9.CloudUploadOutlined, {}),
2948
2974
  title: "\u4E0A\u4F20\u6587\u4EF6",
2949
2975
  description: attachment_placeholder
2950
2976
  })
@@ -2985,7 +3011,7 @@ ${JSON.stringify(tool_call)}
2985
3011
  try {
2986
3012
  } catch (error2) {
2987
3013
  }
2988
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3014
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2989
3015
  Element,
2990
3016
  {
2991
3017
  component_key: meta.id,
@@ -3001,22 +3027,22 @@ ${JSON.stringify(tool_call)}
3001
3027
  }
3002
3028
  return void 0;
3003
3029
  }, [extraMeta]);
3004
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
3005
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
3006
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3030
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
3031
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { children: [
3032
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3007
3033
  import_x2.Welcome,
3008
3034
  {
3009
3035
  style: { padding: 8 },
3010
3036
  variant: "borderless",
3011
3037
  description,
3012
- icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_antd13.Avatar, { src: avatar || "/images/avatar.jpeg", size: 48 }),
3038
+ icon: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_antd14.Avatar, { src: avatar || "/images/avatar.jpeg", size: 48 }),
3013
3039
  title: name || "Fina",
3014
- extra: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_antd13.Space, { children: [
3040
+ extra: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_antd14.Space, { children: [
3015
3041
  extra,
3016
- todos && todos.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3017
- import_antd13.Popover,
3042
+ todos && todos.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3043
+ import_antd14.Popover,
3018
3044
  {
3019
- content: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { style: { width: 400 }, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3045
+ content: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { width: 400 }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3020
3046
  Todo,
3021
3047
  {
3022
3048
  data: todos,
@@ -3027,12 +3053,12 @@ ${JSON.stringify(tool_call)}
3027
3053
  title: "Todos",
3028
3054
  trigger: "click",
3029
3055
  placement: "bottomRight",
3030
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3031
- import_antd13.Tooltip,
3056
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3057
+ import_antd14.Tooltip,
3032
3058
  {
3033
3059
  title: `${todos.filter((item) => item.status === "completed").length} / ${todos.length} tasks completed`,
3034
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { style: { cursor: "pointer", display: "inline-flex" }, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3035
- import_antd13.Progress,
3060
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { cursor: "pointer", display: "inline-flex" }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3061
+ import_antd14.Progress,
3036
3062
  {
3037
3063
  type: "circle",
3038
3064
  strokeColor: {
@@ -3044,7 +3070,7 @@ ${JSON.stringify(tool_call)}
3044
3070
  ),
3045
3071
  status: todos.some((item) => item.status === "in_progress") ? "active" : "normal",
3046
3072
  width: 30,
3047
- format: () => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3073
+ format: () => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3048
3074
  "div",
3049
3075
  {
3050
3076
  style: {
@@ -3053,7 +3079,7 @@ ${JSON.stringify(tool_call)}
3053
3079
  alignItems: "center",
3054
3080
  lineHeight: 1
3055
3081
  },
3056
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { style: { fontSize: 8 }, children: [
3082
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { style: { fontSize: 8 }, children: [
3057
3083
  todos.filter(
3058
3084
  (item) => item.status === "completed"
3059
3085
  ).length,
@@ -3068,17 +3094,17 @@ ${JSON.stringify(tool_call)}
3068
3094
  )
3069
3095
  }
3070
3096
  ),
3071
- files && Object.keys(files).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_antd13.Tooltip, { title: "File Explorer", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3072
- import_antd13.Badge,
3097
+ files && Object.keys(files).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_antd14.Tooltip, { title: "File Explorer", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3098
+ import_antd14.Badge,
3073
3099
  {
3074
3100
  count: Object.keys(files).length,
3075
3101
  size: "small",
3076
3102
  color: "blue",
3077
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3078
- import_antd13.Button,
3103
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3104
+ import_antd14.Button,
3079
3105
  {
3080
3106
  type: "text",
3081
- icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_icons9.FileTextOutlined, {}),
3107
+ icon: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_icons9.FileTextOutlined, {}),
3082
3108
  onClick: () => onOpenSidePanel({
3083
3109
  component_key: "file_explorer",
3084
3110
  message: "File Explorer",
@@ -3088,11 +3114,11 @@ ${JSON.stringify(tool_call)}
3088
3114
  )
3089
3115
  }
3090
3116
  ) }),
3091
- extraMetaComponents && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_antd13.Space, { align: "center", style: { marginRight: 16 }, children: extraMetaComponents })
3117
+ extraMetaComponents && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_antd14.Space, { align: "center", style: { marginRight: 16 }, children: extraMetaComponents })
3092
3118
  ] })
3093
3119
  }
3094
3120
  ),
3095
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3121
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3096
3122
  "div",
3097
3123
  {
3098
3124
  style: {
@@ -3101,17 +3127,17 @@ ${JSON.stringify(tool_call)}
3101
3127
  }
3102
3128
  )
3103
3129
  ] }),
3104
- items.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3130
+ items.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3105
3131
  MemoizedBubbleList,
3106
3132
  {
3107
3133
  items,
3108
3134
  roles,
3109
3135
  className: styles.messages
3110
3136
  }
3111
- ) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { style: { flex: 1 } }),
3112
- isLoading ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_x2.Bubble, { loading: isLoading, variant: "borderless" }) }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_x2.Prompts, { items: senderPromptsItems, onItemClick: onPromptsItemClick }),
3113
- error && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { style: { padding: "0 16px 8px" }, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3114
- import_antd13.Alert,
3137
+ ) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { flex: 1 } }),
3138
+ isLoading ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_x2.Bubble, { loading: isLoading, variant: "borderless" }) }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_x2.Prompts, { items: senderPromptsItems, onItemClick: onPromptsItemClick }),
3139
+ error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { padding: "0 16px 8px" }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3140
+ import_antd14.Alert,
3115
3141
  {
3116
3142
  type: "error",
3117
3143
  banner: true,
@@ -3120,15 +3146,14 @@ ${JSON.stringify(tool_call)}
3120
3146
  message: `${error.message}`
3121
3147
  }
3122
3148
  ) }),
3123
- interrupts && interrupts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_antd13.Space, { direction: "vertical", style: { width: "100%" }, children: interrupts.map((interrupt) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3124
- MDResponse,
3149
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3150
+ HITLContainer,
3125
3151
  {
3126
- content: interrupt.value,
3152
+ interrupts,
3127
3153
  eventHandler: handleMDResponseEvent
3128
- },
3129
- interrupt.id
3130
- )) }),
3131
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3154
+ }
3155
+ ),
3156
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3132
3157
  import_x2.Sender,
3133
3158
  {
3134
3159
  disabled: interrupts && interrupts.length > 0,
@@ -3144,7 +3169,7 @@ ${JSON.stringify(tool_call)}
3144
3169
  className: styles.sender,
3145
3170
  actions: (ori, { components }) => {
3146
3171
  const { SendButton, LoadingButton } = components;
3147
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_antd13.Flex, { justify: "space-between", align: "center", children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(LoadingButton, { type: "default" }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3172
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_antd14.Flex, { justify: "space-between", align: "center", children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(LoadingButton, { type: "default" }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3148
3173
  SendButton,
3149
3174
  {
3150
3175
  type: "primary",
@@ -3167,17 +3192,17 @@ ${JSON.stringify(tool_call)}
3167
3192
  // src/components/Chat/ThinkingChain.tsx
3168
3193
  var import_icons10 = require("@ant-design/icons");
3169
3194
  var import_x3 = require("@ant-design/x");
3170
- var import_jsx_runtime20 = require("react/jsx-runtime");
3195
+ var import_jsx_runtime21 = require("react/jsx-runtime");
3171
3196
  function getStatusIcon2(status) {
3172
3197
  switch (status) {
3173
3198
  case "success":
3174
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_icons10.CheckCircleOutlined, {});
3199
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_icons10.CheckCircleOutlined, {});
3175
3200
  case "error":
3176
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_icons10.InfoCircleOutlined, {});
3201
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_icons10.InfoCircleOutlined, {});
3177
3202
  case "pending":
3178
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_icons10.LoadingOutlined, {});
3203
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_icons10.LoadingOutlined, {});
3179
3204
  default:
3180
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_icons10.CheckCircleOutlined, {});
3205
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_icons10.CheckCircleOutlined, {});
3181
3206
  }
3182
3207
  }
3183
3208
  var ThinkingChain = ({ message: message3 }) => {
@@ -3186,12 +3211,12 @@ var ThinkingChain = ({ message: message3 }) => {
3186
3211
  {
3187
3212
  key: message3.id,
3188
3213
  title,
3189
- content: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MDResponse, { content: message3.content }),
3214
+ content: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(MDResponse, { content: message3.content }),
3190
3215
  status: message3.status,
3191
3216
  icon: getStatusIcon2(message3.status)
3192
3217
  }
3193
3218
  ];
3194
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3219
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
3195
3220
  import_x3.ThoughtChain,
3196
3221
  {
3197
3222
  items,
@@ -3205,19 +3230,19 @@ var ThinkingChainGroup = ({ message: message3 }) => {
3205
3230
  const children = message3.items?.map((item) => ({
3206
3231
  key: item.id,
3207
3232
  title: item.name || item.content.split("\n")[0],
3208
- content: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MDResponse, { content: item.content }),
3233
+ content: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(MDResponse, { content: item.content }),
3209
3234
  status: item.status,
3210
3235
  icon: getStatusIcon2(item.status)
3211
3236
  }));
3212
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_x3.ThoughtChain, { items: children, collapsible: true, size: "small" });
3237
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_x3.ThoughtChain, { items: children, collapsible: true, size: "small" });
3213
3238
  };
3214
3239
 
3215
3240
  // src/components/Chat/SideAppViewBrowser.tsx
3216
3241
  var import_icons11 = require("@ant-design/icons");
3217
- var import_antd14 = require("antd");
3242
+ var import_antd15 = require("antd");
3218
3243
  var import_antd_style7 = require("antd-style");
3219
3244
  var import_react15 = require("react");
3220
- var import_jsx_runtime21 = require("react/jsx-runtime");
3245
+ var import_jsx_runtime22 = require("react/jsx-runtime");
3221
3246
  var useStyle5 = (0, import_antd_style7.createStyles)(({ token, css }) => {
3222
3247
  return {
3223
3248
  tabContainer: css`
@@ -3237,9 +3262,9 @@ var useStyle5 = (0, import_antd_style7.createStyles)(({ token, css }) => {
3237
3262
  };
3238
3263
  });
3239
3264
  var EmptySideAppView = ({ component_key, data }) => {
3240
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
3241
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { children: "\u672A\u627E\u5230\u5BF9\u5E94\u7684\u7EC4\u4EF6\u89C6\u56FE" }),
3242
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("pre", { children: JSON.stringify({ component_key, data }, null, 2) })
3265
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { children: [
3266
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { children: "\u672A\u627E\u5230\u5BF9\u5E94\u7684\u7EC4\u4EF6\u89C6\u56FE" }),
3267
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("pre", { children: JSON.stringify({ component_key, data }, null, 2) })
3243
3268
  ] });
3244
3269
  };
3245
3270
  var SideAppViewBrowser = ({
@@ -3297,7 +3322,7 @@ var SideAppViewBrowser = ({
3297
3322
  add(
3298
3323
  key,
3299
3324
  open_uri.message || open_uri.data.message || "\u672A\u547D\u540D",
3300
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
3325
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3301
3326
  SideAppView,
3302
3327
  {
3303
3328
  component_key: open_uri.component_key,
@@ -3345,26 +3370,26 @@ var SideAppViewBrowser = ({
3345
3370
  const getSizeIcon = (size) => {
3346
3371
  switch (size) {
3347
3372
  case "middle":
3348
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_icons11.CompressOutlined, {});
3373
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons11.CompressOutlined, {});
3349
3374
  case "large":
3350
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_icons11.ExpandOutlined, {});
3375
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons11.ExpandOutlined, {});
3351
3376
  case "full":
3352
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_icons11.FullscreenOutlined, {});
3377
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons11.FullscreenOutlined, {});
3353
3378
  default:
3354
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_icons11.ExpandOutlined, {});
3379
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons11.ExpandOutlined, {});
3355
3380
  }
3356
3381
  };
3357
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
3358
- import_antd14.Tabs,
3382
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3383
+ import_antd15.Tabs,
3359
3384
  {
3360
3385
  className: styles.tabContainer,
3361
3386
  type: "editable-card",
3362
3387
  style: { height: "100%" },
3363
3388
  hideAdd: true,
3364
3389
  tabBarExtraContent: {
3365
- right: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { display: "flex", gap: "4px" }, children: [
3366
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
3367
- import_antd14.Button,
3390
+ right: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", gap: "4px" }, children: [
3391
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3392
+ import_antd15.Button,
3368
3393
  {
3369
3394
  style: { margin: "8px 0" },
3370
3395
  size: "large",
@@ -3374,13 +3399,13 @@ var SideAppViewBrowser = ({
3374
3399
  title: `\u5F53\u524D\u5C3A\u5BF8: ${getSizeLabel(currentSize)}, \u70B9\u51FB\u5207\u6362`
3375
3400
  }
3376
3401
  ),
3377
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
3378
- import_antd14.Button,
3402
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3403
+ import_antd15.Button,
3379
3404
  {
3380
3405
  style: { margin: "8px 0" },
3381
3406
  size: "large",
3382
3407
  type: "text",
3383
- icon: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_icons11.CloseOutlined, {}),
3408
+ icon: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons11.CloseOutlined, {}),
3384
3409
  onClick: () => {
3385
3410
  onClose();
3386
3411
  }