@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.mjs CHANGED
@@ -266,11 +266,14 @@ function useChat(threadId, options = {}) {
266
266
  pollInterval: options.resumeStreamPollInterval || 100
267
267
  },
268
268
  handleStreamEvent,
269
- () => {
269
+ async () => {
270
270
  setState((prev) => ({
271
271
  ...prev,
272
272
  isLoading: false
273
273
  }));
274
+ if (options.enableReturnStateWhenStreamCompleted) {
275
+ await fetchAndUpdateAgentState(threadId);
276
+ }
274
277
  stopStreamingRef.current = null;
275
278
  },
276
279
  (error) => {
@@ -582,25 +585,14 @@ import { Prism } from "react-syntax-highlighter";
582
585
  import { dark } from "react-syntax-highlighter/dist/cjs/styles/prism";
583
586
  import remarkGfm from "remark-gfm";
584
587
  import { useMemo as useMemo3, useRef as useRef5, useState as useState11 } from "react";
585
- import { createStyles as createStyles6 } from "antd-style";
588
+ import { createStyles as createStyles5 } from "antd-style";
586
589
  import rehypeRaw from "rehype-raw";
587
590
 
588
591
  // src/components/GenUI/elements/confirm_feedback.tsx
589
- import { Button, Card, Space, Tag, Typography } from "antd";
592
+ import { Button, Space, Typography } from "antd";
590
593
  import { useState as useState5 } from "react";
591
- import { createStyles } from "antd-style";
592
594
  import { jsx as jsx2, jsxs } from "react/jsx-runtime";
593
595
  var { Text } = Typography;
594
- var useStyle = createStyles(({ token, css }) => ({
595
- card: css`
596
- max-width: 1200px;
597
- background: linear-gradient(
598
- 919deg,
599
- rgb(232 67 157 / 8%),
600
- rgb(250 235 206 / 28%) 43%
601
- );
602
- `
603
- }));
604
596
  var ConfirmFeedback = ({
605
597
  data,
606
598
  eventHandler,
@@ -608,23 +600,7 @@ var ConfirmFeedback = ({
608
600
  }) => {
609
601
  const { message: message3, type, config, feedback, options } = data ?? {};
610
602
  const [clicked, setClicked] = useState5(false);
611
- const { styles } = useStyle();
612
- return /* @__PURE__ */ jsx2(Card, { size: "small", className: `shadow-sm ${styles.card}`, bordered: false, children: /* @__PURE__ */ jsxs(Space, { direction: "vertical", style: { width: "100%" }, children: [
613
- /* @__PURE__ */ jsx2(
614
- Tag,
615
- {
616
- bordered: false,
617
- color: "orange",
618
- style: {
619
- fontSize: 14,
620
- fontWeight: "bold",
621
- background: "#ffffff8f",
622
- padding: 4,
623
- borderRadius: 8
624
- },
625
- children: "\u8BF7\u6C42\u786E\u8BA4"
626
- }
627
- ),
603
+ return /* @__PURE__ */ jsxs(Space, { direction: "vertical", style: { width: "100%" }, children: [
628
604
  /* @__PURE__ */ jsx2(MDResponse, { content: message3 }),
629
605
  options ? /* @__PURE__ */ jsx2(Space, { style: { justifyContent: "flex-end", width: "100%" }, children: options?.map((option) => /* @__PURE__ */ jsx2(
630
606
  Button,
@@ -691,11 +667,11 @@ var ConfirmFeedback = ({
691
667
  }
692
668
  )
693
669
  ] })
694
- ] }) });
670
+ ] });
695
671
  };
696
672
 
697
673
  // src/components/GenUI/elements/generic_data_table.tsx
698
- import { Table as Table2, Typography as Typography2, Button as Button2, Flex, Space as Space2 } from "antd";
674
+ import { Table, Typography as Typography2, Button as Button2, Flex, Space as Space2 } from "antd";
699
675
  import { useState as useState6 } from "react";
700
676
  import { DownloadOutlined, ExpandAltOutlined } from "@ant-design/icons";
701
677
  import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
@@ -784,7 +760,7 @@ var GenericDataTable = ({
784
760
  };
785
761
  const hasExpandableRows = processedData.some((item) => item.expandItem);
786
762
  return /* @__PURE__ */ jsx3(
787
- Table2,
763
+ Table,
788
764
  {
789
765
  size: "small",
790
766
  title: () => /* @__PURE__ */ jsxs2(Flex, { justify: "space-between", align: "center", children: [
@@ -863,12 +839,12 @@ import {
863
839
  } from "@ant-design/icons";
864
840
 
865
841
  // src/components/GenUI/elements/ToolCard.tsx
866
- import { Card as Card3, Typography as Typography3, Space as Space3, Tag as Tag2 } from "antd";
867
- import { createStyles as createStyles2 } from "antd-style";
842
+ import { Card as Card2, Typography as Typography3, Space as Space3, Tag } from "antd";
843
+ import { createStyles } from "antd-style";
868
844
  import { ToolOutlined, CodeOutlined } from "@ant-design/icons";
869
845
  import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
870
846
  var { Text: Text3, Title } = Typography3;
871
- var useStyle2 = createStyles2(({ token, css }) => ({
847
+ var useStyle = createStyles(({ token, css }) => ({
872
848
  card: css`
873
849
  max-width: 500px;
874
850
  background: linear-gradient(
@@ -935,9 +911,9 @@ var ToolCard = ({
935
911
  eventHandler,
936
912
  interactive = true
937
913
  }) => {
938
- const { styles } = useStyle2();
914
+ const { styles } = useStyle();
939
915
  if (!data || !data.name) {
940
- return /* @__PURE__ */ jsx5(Card3, { size: "small", className: styles.card, bordered: false, children: /* @__PURE__ */ jsx5(Text3, { type: "secondary", children: "Invalid tool data" }) });
916
+ return /* @__PURE__ */ jsx5(Card2, { size: "small", className: styles.card, bordered: false, children: /* @__PURE__ */ jsx5(Text3, { type: "secondary", children: "Invalid tool data" }) });
941
917
  }
942
918
  const formatToolName = (name) => {
943
919
  return name.replace(/([a-z])([A-Z])/g, "$1 $2").split(/[_-]/).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
@@ -981,7 +957,7 @@ var ToolCard = ({
981
957
  };
982
958
  const hasParameters = data.parameters && Object.keys(data.parameters).length > 0;
983
959
  return /* @__PURE__ */ jsxs3(
984
- Card3,
960
+ Card2,
985
961
  {
986
962
  size: "small",
987
963
  className: styles.card,
@@ -992,7 +968,7 @@ var ToolCard = ({
992
968
  /* @__PURE__ */ jsxs3(Space3, { align: "center", children: [
993
969
  /* @__PURE__ */ jsx5(ToolOutlined, { style: { color: "#1890ff", fontSize: "18px" } }),
994
970
  /* @__PURE__ */ jsx5(Title, { level: 5, className: styles.toolName, style: { margin: 0 }, children: formatToolName(data.name) }),
995
- data.type && /* @__PURE__ */ jsx5(Tag2, { color: "blue", className: styles.typeTag, children: data.type })
971
+ data.type && /* @__PURE__ */ jsx5(Tag, { color: "blue", className: styles.typeTag, children: data.type })
996
972
  ] }),
997
973
  data.description && /* @__PURE__ */ jsx5(
998
974
  Text3,
@@ -1016,7 +992,7 @@ var ToolCard = ({
1016
992
  /* @__PURE__ */ jsx5("div", { className: styles.parameterName, children: /* @__PURE__ */ jsxs3(Space3, { align: "center", children: [
1017
993
  /* @__PURE__ */ jsx5("span", { children: key }),
1018
994
  /* @__PURE__ */ jsx5(
1019
- Tag2,
995
+ Tag,
1020
996
  {
1021
997
  color: getTypeColor(value),
1022
998
  style: { fontSize: "10px", marginLeft: "auto" },
@@ -1138,8 +1114,8 @@ var ToolCall = ({ data, eventHandler }) => {
1138
1114
  };
1139
1115
 
1140
1116
  // src/components/GenUI/elements/Todo.tsx
1141
- import { Card as Card4, List, Typography as Typography5, Space as Space5 } from "antd";
1142
- import { createStyles as createStyles3 } from "antd-style";
1117
+ import { Card as Card3, List, Typography as Typography5, Space as Space5 } from "antd";
1118
+ import { createStyles as createStyles2 } from "antd-style";
1143
1119
  import {
1144
1120
  ArrowRightOutlined,
1145
1121
  CheckCircleOutlined as CheckCircleOutlined2,
@@ -1147,7 +1123,7 @@ import {
1147
1123
  } from "@ant-design/icons";
1148
1124
  import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
1149
1125
  var { Text: Text4 } = Typography5;
1150
- var useStyle3 = createStyles3(({ token, css }) => ({
1126
+ var useStyle2 = createStyles2(({ token, css }) => ({
1151
1127
  card: css`
1152
1128
  max-width: 1200px;
1153
1129
  background: linear-gradient(
@@ -1179,7 +1155,7 @@ var Todo = ({
1179
1155
  eventHandler,
1180
1156
  interactive = true
1181
1157
  }) => {
1182
- const { styles } = useStyle3();
1158
+ const { styles } = useStyle2();
1183
1159
  const getStatusIcon3 = (status) => {
1184
1160
  switch (status) {
1185
1161
  case "completed":
@@ -1230,7 +1206,7 @@ var Todo = ({
1230
1206
  };
1231
1207
  if (!data || !Array.isArray(data)) {
1232
1208
  return /* @__PURE__ */ jsx7(
1233
- Card4,
1209
+ Card3,
1234
1210
  {
1235
1211
  size: "small",
1236
1212
  className: `shadow-sm ${styles.card}`,
@@ -1239,7 +1215,7 @@ var Todo = ({
1239
1215
  }
1240
1216
  );
1241
1217
  }
1242
- return /* @__PURE__ */ jsx7(Card4, { size: "small", className: `shadow-sm ${styles.card}`, bordered: false, children: /* @__PURE__ */ jsxs5(Space5, { direction: "vertical", style: { width: "100%" }, children: [
1218
+ return /* @__PURE__ */ jsx7(Card3, { size: "small", className: `shadow-sm ${styles.card}`, bordered: false, children: /* @__PURE__ */ jsxs5(Space5, { direction: "vertical", style: { width: "100%" }, children: [
1243
1219
  /* @__PURE__ */ jsx7(
1244
1220
  List,
1245
1221
  {
@@ -1343,7 +1319,7 @@ import {
1343
1319
  DownloadOutlined as DownloadOutlined2,
1344
1320
  CheckOutlined
1345
1321
  } from "@ant-design/icons";
1346
- import { createStyles as createStyles4 } from "antd-style";
1322
+ import { createStyles as createStyles3 } from "antd-style";
1347
1323
 
1348
1324
  // src/components/GenUI/elements/getFileIcon.tsx
1349
1325
  import {
@@ -1389,7 +1365,7 @@ var getFileIcon = (filename) => {
1389
1365
 
1390
1366
  // src/components/GenUI/FileExplorer.tsx
1391
1367
  import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
1392
- var useStyles = createStyles4(({ token, css }) => ({
1368
+ var useStyles = createStyles3(({ token, css }) => ({
1393
1369
  container: css`
1394
1370
  height: 100%;
1395
1371
  background: ${token.colorBgContainer};
@@ -1740,7 +1716,7 @@ var FileExplorer = ({
1740
1716
  // src/components/GenUI/elements/attachments_card.tsx
1741
1717
  import { Attachments } from "@ant-design/x";
1742
1718
  import {
1743
- Card as Card5,
1719
+ Card as Card4,
1744
1720
  Flex as Flex3,
1745
1721
  Space as Space7,
1746
1722
  Typography as Typography7,
@@ -1759,7 +1735,7 @@ var AttachmentsCard = ({
1759
1735
  columns = 1,
1760
1736
  showDownloadButton = false
1761
1737
  }) => {
1762
- const { Text: Text8 } = Typography7;
1738
+ const { Text: Text9 } = Typography7;
1763
1739
  const [showAll, setShowAll] = useState8(false);
1764
1740
  const getStyles = () => {
1765
1741
  switch (size) {
@@ -1836,7 +1812,7 @@ var AttachmentsCard = ({
1836
1812
  );
1837
1813
  };
1838
1814
  const renderFileDescription = (item) => /* @__PURE__ */ jsx11(Space7, { direction: "vertical", size: size === "small" ? 2 : 4, children: /* @__PURE__ */ jsx11(Space7, { children: /* @__PURE__ */ jsx11(
1839
- Text8,
1815
+ Text9,
1840
1816
  {
1841
1817
  type: "secondary",
1842
1818
  style: {
@@ -1857,7 +1833,7 @@ var AttachmentsCard = ({
1857
1833
  evt.stopPropagation();
1858
1834
  handleItemClick(item);
1859
1835
  },
1860
- children: /* @__PURE__ */ jsxs8(Card5, { size: styles.cardSize, style: getCardStyle(item), children: [
1836
+ children: /* @__PURE__ */ jsxs8(Card4, { size: styles.cardSize, style: getCardStyle(item), children: [
1861
1837
  /* @__PURE__ */ jsx11(DownloadButton, { item }),
1862
1838
  /* @__PURE__ */ jsx11(
1863
1839
  Attachments.FileCard,
@@ -1900,7 +1876,7 @@ var AttachmentsCard = ({
1900
1876
  const shouldShowViewMore = displayData.length > 4;
1901
1877
  const visibleData = showAll ? displayData : displayData.slice(0, 4);
1902
1878
  return /* @__PURE__ */ jsxs8(Flex3, { vertical: true, gap: size === "small" ? "small" : "middle", children: [
1903
- visibleData.map((item) => /* @__PURE__ */ jsx11("div", { onClick: () => handleItemClick(item), children: /* @__PURE__ */ jsxs8(Card5, { size: styles.cardSize, style: getCardStyle(item), children: [
1879
+ visibleData.map((item) => /* @__PURE__ */ jsx11("div", { onClick: () => handleItemClick(item), children: /* @__PURE__ */ jsxs8(Card4, { size: styles.cardSize, style: getCardStyle(item), children: [
1904
1880
  /* @__PURE__ */ jsx11(DownloadButton, { item }),
1905
1881
  /* @__PURE__ */ jsx11(
1906
1882
  Attachments.FileCard,
@@ -1915,7 +1891,7 @@ var AttachmentsCard = ({
1915
1891
  }
1916
1892
  ),
1917
1893
  item.files && /* @__PURE__ */ jsxs8("div", { style: { paddingLeft: "12px" }, children: [
1918
- /* @__PURE__ */ jsxs8(Text8, { type: "secondary", style: { fontSize: "12px" }, children: [
1894
+ /* @__PURE__ */ jsxs8(Text9, { type: "secondary", style: { fontSize: "12px" }, children: [
1919
1895
  "\u5305\u542B\u6587\u4EF6(",
1920
1896
  item.files.length,
1921
1897
  ")"
@@ -2024,13 +2000,13 @@ import { Button as Button6, Space as Space8, Typography as Typography8 } from "a
2024
2000
  // src/components/GenUI/elements/ContentPreviewCollapse.tsx
2025
2001
  import { useRef as useRef3, useState as useState10, useEffect as useEffect6, useCallback as useCallback5 } from "react";
2026
2002
  import { Collapse as Collapse4 } from "antd";
2027
- import { createStyles as createStyles5 } from "antd-style";
2003
+ import { createStyles as createStyles4 } from "antd-style";
2028
2004
  import { DownOutlined as DownOutlined2, UpOutlined } from "@ant-design/icons";
2029
2005
  import CollapsePanel3 from "antd/es/collapse/CollapsePanel";
2030
2006
  import { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
2031
2007
  var DEFAULT_COLLAPSED_MAX_HEIGHT = 180;
2032
2008
  var DEFAULT_EXPANDED_MAX_HEIGHT = 500;
2033
- var useStyle4 = createStyles5(
2009
+ var useStyle3 = createStyles4(
2034
2010
  ({ css }, { showShadow }) => ({
2035
2011
  collapse: css`
2036
2012
  .ant-collapse-header {
@@ -2096,7 +2072,7 @@ var ContentPreviewCollapse = ({
2096
2072
  const [isOverflowing, setIsOverflowing] = useState10(false);
2097
2073
  const contentRef = useRef3(null);
2098
2074
  const showShadow = isOverflowing && !showFullContent;
2099
- const { styles, cx } = useStyle4({ showShadow });
2075
+ const { styles, cx } = useStyle3({ showShadow });
2100
2076
  const checkOverflow = useCallback5(() => {
2101
2077
  if (contentRef.current) {
2102
2078
  const scrollHeight = contentRef.current.scrollHeight;
@@ -2431,7 +2407,7 @@ var MDMermaid = ({ children = [] }) => {
2431
2407
  // src/components/GenUI/MDResponse.tsx
2432
2408
  import { jsx as jsx18 } from "react/jsx-runtime";
2433
2409
  var SyntaxHighlighter = Prism;
2434
- var useStyles2 = createStyles6(({ token, css }) => ({
2410
+ var useStyles2 = createStyles5(({ token, css }) => ({
2435
2411
  markdownTableContainer: css`
2436
2412
  overflow-x: auto;
2437
2413
  width: 100%;
@@ -2637,9 +2613,9 @@ import {
2637
2613
  Alert as Alert2,
2638
2614
  Avatar,
2639
2615
  Badge,
2640
- Button as Button8,
2616
+ Button as Button9,
2641
2617
  Flex as Flex5,
2642
- Space as Space10,
2618
+ Space as Space11,
2643
2619
  message as message2,
2644
2620
  Tooltip as Tooltip2,
2645
2621
  Popover,
@@ -2655,7 +2631,57 @@ import React4, {
2655
2631
  useState as useState12
2656
2632
  } from "react";
2657
2633
  import { useTranslation } from "react-i18next";
2658
- import { Fragment as Fragment3, jsx as jsx19, jsxs as jsxs13 } from "react/jsx-runtime";
2634
+
2635
+ // src/components/GenUI/HITLContainer.tsx
2636
+ import { Card as Card5, Space as Space10, Tag as Tag3, Typography as Typography10 } from "antd";
2637
+ import { createStyles as createStyles6 } from "antd-style";
2638
+ import { jsx as jsx19, jsxs as jsxs13 } from "react/jsx-runtime";
2639
+ var { Text: Text8 } = Typography10;
2640
+ var useStyle4 = createStyles6(({ token, css }) => ({
2641
+ card: css`
2642
+ max-width: 1200px;
2643
+ margin: 8px 20px;
2644
+ background: linear-gradient(
2645
+ 919deg,
2646
+ rgb(232 67 157 / 8%),
2647
+ rgb(250 235 206 / 28%) 43%
2648
+ );
2649
+ `
2650
+ }));
2651
+ var HITLContainer = ({
2652
+ interrupts,
2653
+ eventHandler
2654
+ }) => {
2655
+ const { styles } = useStyle4();
2656
+ return interrupts && interrupts.length > 0 ? /* @__PURE__ */ jsx19(Card5, { size: "small", className: `shadow-sm ${styles.card}`, bordered: false, children: /* @__PURE__ */ jsxs13(Space10, { direction: "vertical", style: { width: "100%" }, children: [
2657
+ /* @__PURE__ */ jsx19(
2658
+ Tag3,
2659
+ {
2660
+ bordered: false,
2661
+ color: "orange",
2662
+ style: {
2663
+ fontSize: 14,
2664
+ fontWeight: "bold",
2665
+ background: "#ffffff8f",
2666
+ padding: 4,
2667
+ borderRadius: 8
2668
+ },
2669
+ children: "\u7B49\u5F85\u53CD\u9988"
2670
+ }
2671
+ ),
2672
+ interrupts.map((interrupt) => /* @__PURE__ */ jsx19(
2673
+ MDResponse,
2674
+ {
2675
+ content: interrupt.value,
2676
+ eventHandler
2677
+ },
2678
+ interrupt.id
2679
+ ))
2680
+ ] }) }) : null;
2681
+ };
2682
+
2683
+ // src/components/Chat/Chating.tsx
2684
+ import { Fragment as Fragment3, jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
2659
2685
  var LazyBubble = ({
2660
2686
  message: message3,
2661
2687
  renderContent,
@@ -2689,16 +2715,16 @@ var LazyBubble = ({
2689
2715
  }, []);
2690
2716
  const getPlaceholder = () => {
2691
2717
  const estimatedHeight = message3.content ? Math.min(100, message3.content.length / 5) : 100;
2692
- return /* @__PURE__ */ jsx19("div", { style: { height: `${estimatedHeight}px`, minHeight: "50px" } });
2718
+ return /* @__PURE__ */ jsx20("div", { style: { height: `${estimatedHeight}px`, minHeight: "50px" } });
2693
2719
  };
2694
- return /* @__PURE__ */ jsx19(ErrorBoundary, { children: /* @__PURE__ */ jsx19("div", { ref, style: { width: "100%" }, children: isVisible || wasEverVisible ? renderContent(message3) : getPlaceholder() }) });
2720
+ return /* @__PURE__ */ jsx20(ErrorBoundary, { children: /* @__PURE__ */ jsx20("div", { ref, style: { width: "100%" }, children: isVisible || wasEverVisible ? renderContent(message3) : getPlaceholder() }) });
2695
2721
  };
2696
2722
  var MemoizedBubbleList = memo(
2697
2723
  ({
2698
2724
  items,
2699
2725
  roles,
2700
2726
  className
2701
- }) => /* @__PURE__ */ jsx19(
2727
+ }) => /* @__PURE__ */ jsx20(
2702
2728
  Bubble.List,
2703
2729
  {
2704
2730
  autoScroll: true,
@@ -2763,7 +2789,7 @@ var Chating = ({
2763
2789
  try {
2764
2790
  const json = JSON.parse(content2);
2765
2791
  if (json.action && json.message) {
2766
- return /* @__PURE__ */ jsx19(
2792
+ return /* @__PURE__ */ jsx20(
2767
2793
  MDResponse,
2768
2794
  {
2769
2795
  content: json.message,
@@ -2779,7 +2805,7 @@ ${JSON.stringify(tool_call)}
2779
2805
  \`\`\``;
2780
2806
  }) || [];
2781
2807
  const content_md = [content2, ...tool_calls_md].join("\n");
2782
- return /* @__PURE__ */ jsx19(Space10, { direction: "vertical", style: { width: "100%" }, children: /* @__PURE__ */ jsx19(
2808
+ return /* @__PURE__ */ jsx20(Space11, { direction: "vertical", style: { width: "100%" }, children: /* @__PURE__ */ jsx20(
2783
2809
  MDResponse,
2784
2810
  {
2785
2811
  content: content_md,
@@ -2794,7 +2820,7 @@ ${JSON.stringify(tool_call)}
2794
2820
  key: message3.id,
2795
2821
  role: message3.role,
2796
2822
  typing: false,
2797
- content: /* @__PURE__ */ jsx19(
2823
+ content: /* @__PURE__ */ jsx20(
2798
2824
  LazyBubble,
2799
2825
  {
2800
2826
  message: message3,
@@ -2907,15 +2933,15 @@ ${JSON.stringify(tool_call)}
2907
2933
  }
2908
2934
  return true;
2909
2935
  };
2910
- const attachmentsNode = /* @__PURE__ */ jsx19(Badge, { dot: attachedFiles.length > 0 && !headerOpen, children: /* @__PURE__ */ jsx19(
2911
- Button8,
2936
+ const attachmentsNode = /* @__PURE__ */ jsx20(Badge, { dot: attachedFiles.length > 0 && !headerOpen, children: /* @__PURE__ */ jsx20(
2937
+ Button9,
2912
2938
  {
2913
2939
  type: "text",
2914
- icon: /* @__PURE__ */ jsx19(PaperClipOutlined, {}),
2940
+ icon: /* @__PURE__ */ jsx20(PaperClipOutlined, {}),
2915
2941
  onClick: () => setHeaderOpen(!headerOpen)
2916
2942
  }
2917
2943
  ) });
2918
- const senderHeader = /* @__PURE__ */ jsx19(
2944
+ const senderHeader = /* @__PURE__ */ jsx20(
2919
2945
  Sender.Header,
2920
2946
  {
2921
2947
  title: "Attachments",
@@ -2927,7 +2953,7 @@ ${JSON.stringify(tool_call)}
2927
2953
  }
2928
2954
  },
2929
2955
  forceRender: true,
2930
- children: /* @__PURE__ */ jsx19(
2956
+ children: /* @__PURE__ */ jsx20(
2931
2957
  Attachments2,
2932
2958
  {
2933
2959
  ref: attachmentsRef,
@@ -2949,7 +2975,7 @@ ${JSON.stringify(tool_call)}
2949
2975
  multiple: true,
2950
2976
  maxCount: 10,
2951
2977
  placeholder: (type) => ({
2952
- icon: /* @__PURE__ */ jsx19(CloudUploadOutlined, {}),
2978
+ icon: /* @__PURE__ */ jsx20(CloudUploadOutlined, {}),
2953
2979
  title: "\u4E0A\u4F20\u6587\u4EF6",
2954
2980
  description: attachment_placeholder
2955
2981
  })
@@ -2990,7 +3016,7 @@ ${JSON.stringify(tool_call)}
2990
3016
  try {
2991
3017
  } catch (error2) {
2992
3018
  }
2993
- return /* @__PURE__ */ jsx19(
3019
+ return /* @__PURE__ */ jsx20(
2994
3020
  Element,
2995
3021
  {
2996
3022
  component_key: meta.id,
@@ -3006,22 +3032,22 @@ ${JSON.stringify(tool_call)}
3006
3032
  }
3007
3033
  return void 0;
3008
3034
  }, [extraMeta]);
3009
- return /* @__PURE__ */ jsxs13(Fragment3, { children: [
3010
- /* @__PURE__ */ jsxs13("div", { children: [
3011
- /* @__PURE__ */ jsx19(
3035
+ return /* @__PURE__ */ jsxs14(Fragment3, { children: [
3036
+ /* @__PURE__ */ jsxs14("div", { children: [
3037
+ /* @__PURE__ */ jsx20(
3012
3038
  Welcome,
3013
3039
  {
3014
3040
  style: { padding: 8 },
3015
3041
  variant: "borderless",
3016
3042
  description,
3017
- icon: /* @__PURE__ */ jsx19(Avatar, { src: avatar || "/images/avatar.jpeg", size: 48 }),
3043
+ icon: /* @__PURE__ */ jsx20(Avatar, { src: avatar || "/images/avatar.jpeg", size: 48 }),
3018
3044
  title: name || "Fina",
3019
- extra: /* @__PURE__ */ jsxs13(Space10, { children: [
3045
+ extra: /* @__PURE__ */ jsxs14(Space11, { children: [
3020
3046
  extra,
3021
- todos && todos.length > 0 && /* @__PURE__ */ jsx19(
3047
+ todos && todos.length > 0 && /* @__PURE__ */ jsx20(
3022
3048
  Popover,
3023
3049
  {
3024
- content: /* @__PURE__ */ jsx19("div", { style: { width: 400 }, children: /* @__PURE__ */ jsx19(
3050
+ content: /* @__PURE__ */ jsx20("div", { style: { width: 400 }, children: /* @__PURE__ */ jsx20(
3025
3051
  Todo,
3026
3052
  {
3027
3053
  data: todos,
@@ -3032,11 +3058,11 @@ ${JSON.stringify(tool_call)}
3032
3058
  title: "Todos",
3033
3059
  trigger: "click",
3034
3060
  placement: "bottomRight",
3035
- children: /* @__PURE__ */ jsx19(
3061
+ children: /* @__PURE__ */ jsx20(
3036
3062
  Tooltip2,
3037
3063
  {
3038
3064
  title: `${todos.filter((item) => item.status === "completed").length} / ${todos.length} tasks completed`,
3039
- children: /* @__PURE__ */ jsx19("div", { style: { cursor: "pointer", display: "inline-flex" }, children: /* @__PURE__ */ jsx19(
3065
+ children: /* @__PURE__ */ jsx20("div", { style: { cursor: "pointer", display: "inline-flex" }, children: /* @__PURE__ */ jsx20(
3040
3066
  Progress,
3041
3067
  {
3042
3068
  type: "circle",
@@ -3049,7 +3075,7 @@ ${JSON.stringify(tool_call)}
3049
3075
  ),
3050
3076
  status: todos.some((item) => item.status === "in_progress") ? "active" : "normal",
3051
3077
  width: 30,
3052
- format: () => /* @__PURE__ */ jsx19(
3078
+ format: () => /* @__PURE__ */ jsx20(
3053
3079
  "div",
3054
3080
  {
3055
3081
  style: {
@@ -3058,7 +3084,7 @@ ${JSON.stringify(tool_call)}
3058
3084
  alignItems: "center",
3059
3085
  lineHeight: 1
3060
3086
  },
3061
- children: /* @__PURE__ */ jsxs13("span", { style: { fontSize: 8 }, children: [
3087
+ children: /* @__PURE__ */ jsxs14("span", { style: { fontSize: 8 }, children: [
3062
3088
  todos.filter(
3063
3089
  (item) => item.status === "completed"
3064
3090
  ).length,
@@ -3073,17 +3099,17 @@ ${JSON.stringify(tool_call)}
3073
3099
  )
3074
3100
  }
3075
3101
  ),
3076
- files && Object.keys(files).length > 0 && /* @__PURE__ */ jsx19(Tooltip2, { title: "File Explorer", children: /* @__PURE__ */ jsx19(
3102
+ files && Object.keys(files).length > 0 && /* @__PURE__ */ jsx20(Tooltip2, { title: "File Explorer", children: /* @__PURE__ */ jsx20(
3077
3103
  Badge,
3078
3104
  {
3079
3105
  count: Object.keys(files).length,
3080
3106
  size: "small",
3081
3107
  color: "blue",
3082
- children: /* @__PURE__ */ jsx19(
3083
- Button8,
3108
+ children: /* @__PURE__ */ jsx20(
3109
+ Button9,
3084
3110
  {
3085
3111
  type: "text",
3086
- icon: /* @__PURE__ */ jsx19(FileTextOutlined3, {}),
3112
+ icon: /* @__PURE__ */ jsx20(FileTextOutlined3, {}),
3087
3113
  onClick: () => onOpenSidePanel({
3088
3114
  component_key: "file_explorer",
3089
3115
  message: "File Explorer",
@@ -3093,11 +3119,11 @@ ${JSON.stringify(tool_call)}
3093
3119
  )
3094
3120
  }
3095
3121
  ) }),
3096
- extraMetaComponents && /* @__PURE__ */ jsx19(Space10, { align: "center", style: { marginRight: 16 }, children: extraMetaComponents })
3122
+ extraMetaComponents && /* @__PURE__ */ jsx20(Space11, { align: "center", style: { marginRight: 16 }, children: extraMetaComponents })
3097
3123
  ] })
3098
3124
  }
3099
3125
  ),
3100
- /* @__PURE__ */ jsx19(
3126
+ /* @__PURE__ */ jsx20(
3101
3127
  "div",
3102
3128
  {
3103
3129
  style: {
@@ -3106,16 +3132,16 @@ ${JSON.stringify(tool_call)}
3106
3132
  }
3107
3133
  )
3108
3134
  ] }),
3109
- items.length > 0 ? /* @__PURE__ */ jsx19(
3135
+ items.length > 0 ? /* @__PURE__ */ jsx20(
3110
3136
  MemoizedBubbleList,
3111
3137
  {
3112
3138
  items,
3113
3139
  roles,
3114
3140
  className: styles.messages
3115
3141
  }
3116
- ) : /* @__PURE__ */ jsx19("div", { style: { flex: 1 } }),
3117
- isLoading ? /* @__PURE__ */ jsx19("div", { children: /* @__PURE__ */ jsx19(Bubble, { loading: isLoading, variant: "borderless" }) }) : /* @__PURE__ */ jsx19(Prompts, { items: senderPromptsItems, onItemClick: onPromptsItemClick }),
3118
- error && /* @__PURE__ */ jsx19("div", { style: { padding: "0 16px 8px" }, children: /* @__PURE__ */ jsx19(
3142
+ ) : /* @__PURE__ */ jsx20("div", { style: { flex: 1 } }),
3143
+ isLoading ? /* @__PURE__ */ jsx20("div", { children: /* @__PURE__ */ jsx20(Bubble, { loading: isLoading, variant: "borderless" }) }) : /* @__PURE__ */ jsx20(Prompts, { items: senderPromptsItems, onItemClick: onPromptsItemClick }),
3144
+ error && /* @__PURE__ */ jsx20("div", { style: { padding: "0 16px 8px" }, children: /* @__PURE__ */ jsx20(
3119
3145
  Alert2,
3120
3146
  {
3121
3147
  type: "error",
@@ -3125,15 +3151,14 @@ ${JSON.stringify(tool_call)}
3125
3151
  message: `${error.message}`
3126
3152
  }
3127
3153
  ) }),
3128
- interrupts && interrupts.length > 0 && /* @__PURE__ */ jsx19(Space10, { direction: "vertical", style: { width: "100%" }, children: interrupts.map((interrupt) => /* @__PURE__ */ jsx19(
3129
- MDResponse,
3154
+ /* @__PURE__ */ jsx20(
3155
+ HITLContainer,
3130
3156
  {
3131
- content: interrupt.value,
3157
+ interrupts,
3132
3158
  eventHandler: handleMDResponseEvent
3133
- },
3134
- interrupt.id
3135
- )) }),
3136
- /* @__PURE__ */ jsx19(
3159
+ }
3160
+ ),
3161
+ /* @__PURE__ */ jsx20(
3137
3162
  Sender,
3138
3163
  {
3139
3164
  disabled: interrupts && interrupts.length > 0,
@@ -3149,7 +3174,7 @@ ${JSON.stringify(tool_call)}
3149
3174
  className: styles.sender,
3150
3175
  actions: (ori, { components }) => {
3151
3176
  const { SendButton, LoadingButton } = components;
3152
- return /* @__PURE__ */ jsx19(Flex5, { justify: "space-between", align: "center", children: isLoading ? /* @__PURE__ */ jsx19(LoadingButton, { type: "default" }) : /* @__PURE__ */ jsx19(
3177
+ return /* @__PURE__ */ jsx20(Flex5, { justify: "space-between", align: "center", children: isLoading ? /* @__PURE__ */ jsx20(LoadingButton, { type: "default" }) : /* @__PURE__ */ jsx20(
3153
3178
  SendButton,
3154
3179
  {
3155
3180
  type: "primary",
@@ -3178,17 +3203,17 @@ import {
3178
3203
  import {
3179
3204
  ThoughtChain
3180
3205
  } from "@ant-design/x";
3181
- import { jsx as jsx20 } from "react/jsx-runtime";
3206
+ import { jsx as jsx21 } from "react/jsx-runtime";
3182
3207
  function getStatusIcon2(status) {
3183
3208
  switch (status) {
3184
3209
  case "success":
3185
- return /* @__PURE__ */ jsx20(CheckCircleOutlined3, {});
3210
+ return /* @__PURE__ */ jsx21(CheckCircleOutlined3, {});
3186
3211
  case "error":
3187
- return /* @__PURE__ */ jsx20(InfoCircleOutlined2, {});
3212
+ return /* @__PURE__ */ jsx21(InfoCircleOutlined2, {});
3188
3213
  case "pending":
3189
- return /* @__PURE__ */ jsx20(LoadingOutlined3, {});
3214
+ return /* @__PURE__ */ jsx21(LoadingOutlined3, {});
3190
3215
  default:
3191
- return /* @__PURE__ */ jsx20(CheckCircleOutlined3, {});
3216
+ return /* @__PURE__ */ jsx21(CheckCircleOutlined3, {});
3192
3217
  }
3193
3218
  }
3194
3219
  var ThinkingChain = ({ message: message3 }) => {
@@ -3197,12 +3222,12 @@ var ThinkingChain = ({ message: message3 }) => {
3197
3222
  {
3198
3223
  key: message3.id,
3199
3224
  title,
3200
- content: /* @__PURE__ */ jsx20(MDResponse, { content: message3.content }),
3225
+ content: /* @__PURE__ */ jsx21(MDResponse, { content: message3.content }),
3201
3226
  status: message3.status,
3202
3227
  icon: getStatusIcon2(message3.status)
3203
3228
  }
3204
3229
  ];
3205
- return /* @__PURE__ */ jsx20(
3230
+ return /* @__PURE__ */ jsx21(
3206
3231
  ThoughtChain,
3207
3232
  {
3208
3233
  items,
@@ -3216,11 +3241,11 @@ var ThinkingChainGroup = ({ message: message3 }) => {
3216
3241
  const children = message3.items?.map((item) => ({
3217
3242
  key: item.id,
3218
3243
  title: item.name || item.content.split("\n")[0],
3219
- content: /* @__PURE__ */ jsx20(MDResponse, { content: item.content }),
3244
+ content: /* @__PURE__ */ jsx21(MDResponse, { content: item.content }),
3220
3245
  status: item.status,
3221
3246
  icon: getStatusIcon2(item.status)
3222
3247
  }));
3223
- return /* @__PURE__ */ jsx20(ThoughtChain, { items: children, collapsible: true, size: "small" });
3248
+ return /* @__PURE__ */ jsx21(ThoughtChain, { items: children, collapsible: true, size: "small" });
3224
3249
  };
3225
3250
 
3226
3251
  // src/components/Chat/SideAppViewBrowser.tsx
@@ -3230,10 +3255,10 @@ import {
3230
3255
  ExpandOutlined,
3231
3256
  FullscreenOutlined
3232
3257
  } from "@ant-design/icons";
3233
- import { Button as Button9, Tabs } from "antd";
3258
+ import { Button as Button10, Tabs } from "antd";
3234
3259
  import { createStyles as createStyles7 } from "antd-style";
3235
3260
  import { useEffect as useEffect9, useState as useState13 } from "react";
3236
- import { jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
3261
+ import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
3237
3262
  var useStyle5 = createStyles7(({ token, css }) => {
3238
3263
  return {
3239
3264
  tabContainer: css`
@@ -3253,9 +3278,9 @@ var useStyle5 = createStyles7(({ token, css }) => {
3253
3278
  };
3254
3279
  });
3255
3280
  var EmptySideAppView = ({ component_key, data }) => {
3256
- return /* @__PURE__ */ jsxs14("div", { children: [
3257
- /* @__PURE__ */ jsx21("p", { children: "\u672A\u627E\u5230\u5BF9\u5E94\u7684\u7EC4\u4EF6\u89C6\u56FE" }),
3258
- /* @__PURE__ */ jsx21("pre", { children: JSON.stringify({ component_key, data }, null, 2) })
3281
+ return /* @__PURE__ */ jsxs15("div", { children: [
3282
+ /* @__PURE__ */ jsx22("p", { children: "\u672A\u627E\u5230\u5BF9\u5E94\u7684\u7EC4\u4EF6\u89C6\u56FE" }),
3283
+ /* @__PURE__ */ jsx22("pre", { children: JSON.stringify({ component_key, data }, null, 2) })
3259
3284
  ] });
3260
3285
  };
3261
3286
  var SideAppViewBrowser = ({
@@ -3313,7 +3338,7 @@ var SideAppViewBrowser = ({
3313
3338
  add(
3314
3339
  key,
3315
3340
  open_uri.message || open_uri.data.message || "\u672A\u547D\u540D",
3316
- /* @__PURE__ */ jsx21(
3341
+ /* @__PURE__ */ jsx22(
3317
3342
  SideAppView,
3318
3343
  {
3319
3344
  component_key: open_uri.component_key,
@@ -3361,16 +3386,16 @@ var SideAppViewBrowser = ({
3361
3386
  const getSizeIcon = (size) => {
3362
3387
  switch (size) {
3363
3388
  case "middle":
3364
- return /* @__PURE__ */ jsx21(CompressOutlined, {});
3389
+ return /* @__PURE__ */ jsx22(CompressOutlined, {});
3365
3390
  case "large":
3366
- return /* @__PURE__ */ jsx21(ExpandOutlined, {});
3391
+ return /* @__PURE__ */ jsx22(ExpandOutlined, {});
3367
3392
  case "full":
3368
- return /* @__PURE__ */ jsx21(FullscreenOutlined, {});
3393
+ return /* @__PURE__ */ jsx22(FullscreenOutlined, {});
3369
3394
  default:
3370
- return /* @__PURE__ */ jsx21(ExpandOutlined, {});
3395
+ return /* @__PURE__ */ jsx22(ExpandOutlined, {});
3371
3396
  }
3372
3397
  };
3373
- return /* @__PURE__ */ jsx21(
3398
+ return /* @__PURE__ */ jsx22(
3374
3399
  Tabs,
3375
3400
  {
3376
3401
  className: styles.tabContainer,
@@ -3378,9 +3403,9 @@ var SideAppViewBrowser = ({
3378
3403
  style: { height: "100%" },
3379
3404
  hideAdd: true,
3380
3405
  tabBarExtraContent: {
3381
- right: /* @__PURE__ */ jsxs14("div", { style: { display: "flex", gap: "4px" }, children: [
3382
- /* @__PURE__ */ jsx21(
3383
- Button9,
3406
+ right: /* @__PURE__ */ jsxs15("div", { style: { display: "flex", gap: "4px" }, children: [
3407
+ /* @__PURE__ */ jsx22(
3408
+ Button10,
3384
3409
  {
3385
3410
  style: { margin: "8px 0" },
3386
3411
  size: "large",
@@ -3390,13 +3415,13 @@ var SideAppViewBrowser = ({
3390
3415
  title: `\u5F53\u524D\u5C3A\u5BF8: ${getSizeLabel(currentSize)}, \u70B9\u51FB\u5207\u6362`
3391
3416
  }
3392
3417
  ),
3393
- /* @__PURE__ */ jsx21(
3394
- Button9,
3418
+ /* @__PURE__ */ jsx22(
3419
+ Button10,
3395
3420
  {
3396
3421
  style: { margin: "8px 0" },
3397
3422
  size: "large",
3398
3423
  type: "text",
3399
- icon: /* @__PURE__ */ jsx21(CloseOutlined, {}),
3424
+ icon: /* @__PURE__ */ jsx22(CloseOutlined, {}),
3400
3425
  onClick: () => {
3401
3426
  onClose();
3402
3427
  }