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