@axiom-lattice/react-sdk 2.1.16 → 2.1.18
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.d.mts +2 -9
- package/dist/index.d.ts +2 -9
- package/dist/index.js +1041 -916
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +920 -790
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -8
package/dist/index.mjs
CHANGED
|
@@ -585,7 +585,7 @@ function AgentThreadProvider({
|
|
|
585
585
|
}
|
|
586
586
|
}, []);
|
|
587
587
|
const resumeStream = useCallback2(
|
|
588
|
-
(messageId) => {
|
|
588
|
+
(messageId, onMessageChunk) => {
|
|
589
589
|
if (!threadId) {
|
|
590
590
|
throw new Error("Thread ID is required to resume stream");
|
|
591
591
|
}
|
|
@@ -619,7 +619,10 @@ function AgentThreadProvider({
|
|
|
619
619
|
};
|
|
620
620
|
const stopResumeStream = client.resumeStream(
|
|
621
621
|
resumeStreamOptions,
|
|
622
|
-
|
|
622
|
+
(chunk) => {
|
|
623
|
+
onMessageChunk?.(chunk);
|
|
624
|
+
handleStreamEvent(chunk);
|
|
625
|
+
},
|
|
623
626
|
async () => {
|
|
624
627
|
setState((prev) => ({
|
|
625
628
|
...prev,
|
|
@@ -669,7 +672,6 @@ function AgentThreadProvider({
|
|
|
669
672
|
lastAgentStateCreatedAtRef.current = currentCreatedAt;
|
|
670
673
|
}
|
|
671
674
|
let needUpdateFields = {};
|
|
672
|
-
let fetchedMessages = [];
|
|
673
675
|
needUpdateFields.agentState = agentState;
|
|
674
676
|
needUpdateFields.todos = agentState?.values?.todos;
|
|
675
677
|
const interrupts = agentState?.tasks?.flatMap(
|
|
@@ -685,19 +687,24 @@ function AgentThreadProvider({
|
|
|
685
687
|
}
|
|
686
688
|
);
|
|
687
689
|
needUpdateFields.interrupts = interrupts;
|
|
688
|
-
fetchedMessages = await client.getMessages({ threadId });
|
|
689
|
-
needUpdateFields.messages = fetchedMessages;
|
|
690
|
+
const fetchedMessages = await client.getMessages({ threadId });
|
|
690
691
|
chunkMessageMerger.current.reset();
|
|
691
692
|
chunkMessageMerger.current.initialMessages(fetchedMessages);
|
|
693
|
+
needUpdateFields.messages = chunkMessageMerger.current.getMessages();
|
|
692
694
|
setState((prev) => ({
|
|
693
695
|
...prev,
|
|
694
696
|
...needUpdateFields,
|
|
695
697
|
isLoading: false
|
|
696
698
|
}));
|
|
697
|
-
if (options.enableResumeStream &&
|
|
698
|
-
const lastMessage =
|
|
699
|
-
|
|
700
|
-
resumeStream(lastMessage.id)
|
|
699
|
+
if (options.enableResumeStream && needUpdateFields.messages.length > 0) {
|
|
700
|
+
const lastMessage = needUpdateFields.messages[needUpdateFields.messages.length - 1];
|
|
701
|
+
let lastMessageIsRemoved = false;
|
|
702
|
+
resumeStream(lastMessage.id, (chunk) => {
|
|
703
|
+
if (!lastMessageIsRemoved) {
|
|
704
|
+
chunkMessageMerger.current.removeMessageById(lastMessage.id);
|
|
705
|
+
lastMessageIsRemoved = true;
|
|
706
|
+
}
|
|
707
|
+
});
|
|
701
708
|
}
|
|
702
709
|
} catch (error) {
|
|
703
710
|
setState((prev) => ({
|
|
@@ -1279,96 +1286,241 @@ import {
|
|
|
1279
1286
|
} from "@ant-design/icons";
|
|
1280
1287
|
|
|
1281
1288
|
// src/components/GenUI/elements/confirm_feedback.tsx
|
|
1282
|
-
import { Button, Space, Typography } from "antd";
|
|
1283
|
-
import { useState as
|
|
1289
|
+
import { Button as Button2, Space as Space2, Typography as Typography2 } from "antd";
|
|
1290
|
+
import { useState as useState9 } from "react";
|
|
1284
1291
|
|
|
1285
1292
|
// src/components/GenUI/MDResponse.tsx
|
|
1286
|
-
import
|
|
1287
|
-
import {
|
|
1288
|
-
import { dark } from "react-syntax-highlighter/dist/cjs/styles/prism";
|
|
1289
|
-
import remarkGfm from "remark-gfm";
|
|
1290
|
-
import { useMemo as useMemo2, useRef as useRef5, useState as useState7 } from "react";
|
|
1293
|
+
import XMarkdown from "@ant-design/x-markdown";
|
|
1294
|
+
import { useRef as useRef5, useState as useState8 } from "react";
|
|
1291
1295
|
import { createStyles as createStyles2 } from "antd-style";
|
|
1292
|
-
import rehypeRaw from "rehype-raw";
|
|
1293
1296
|
|
|
1294
|
-
// src/components/GenUI/
|
|
1295
|
-
import
|
|
1296
|
-
|
|
1297
|
-
|
|
1297
|
+
// src/components/GenUI/Code.tsx
|
|
1298
|
+
import { CodeHighlighter, Mermaid } from "@ant-design/x";
|
|
1299
|
+
|
|
1300
|
+
// src/components/GenUI/ReactInfographic.tsx
|
|
1301
|
+
import { Infographic } from "@antv/infographic";
|
|
1302
|
+
import { useRef as useRef4, useEffect as useEffect5 } from "react";
|
|
1298
1303
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
1299
|
-
var
|
|
1300
|
-
const
|
|
1301
|
-
const
|
|
1302
|
-
|
|
1303
|
-
const targetInternal = useRef4(null);
|
|
1304
|
+
var ReactInfographic = (props) => {
|
|
1305
|
+
const { children } = props;
|
|
1306
|
+
const $container = useRef4(null);
|
|
1307
|
+
let infographicInstance = useRef4(null);
|
|
1304
1308
|
useEffect5(() => {
|
|
1305
|
-
if (
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
theme: "default",
|
|
1309
|
-
securityLevel: "loose",
|
|
1310
|
-
themeCSS: `
|
|
1311
|
-
g.classGroup rect {
|
|
1312
|
-
fill: #282a36;
|
|
1313
|
-
stroke: #6272a4;
|
|
1314
|
-
}
|
|
1315
|
-
g.classGroup text {
|
|
1316
|
-
fill: #f8f8f2;
|
|
1317
|
-
}
|
|
1318
|
-
g.classGroup line {
|
|
1319
|
-
stroke: #f8f8f2;
|
|
1320
|
-
stroke-width: 0.5;
|
|
1321
|
-
}
|
|
1322
|
-
.classLabel .box {
|
|
1323
|
-
stroke: #21222c;
|
|
1324
|
-
stroke-width: 3;
|
|
1325
|
-
fill: #21222c;
|
|
1326
|
-
opacity: 1;
|
|
1327
|
-
}
|
|
1328
|
-
.classLabel .label {
|
|
1329
|
-
fill: #f1fa8c;
|
|
1330
|
-
}
|
|
1331
|
-
.relation {
|
|
1332
|
-
stroke: #ff79c6;
|
|
1333
|
-
stroke-width: 1;
|
|
1334
|
-
}
|
|
1335
|
-
#compositionStart, #compositionEnd {
|
|
1336
|
-
fill: #bd93f9;
|
|
1337
|
-
stroke: #bd93f9;
|
|
1338
|
-
stroke-width: 1;
|
|
1339
|
-
}
|
|
1340
|
-
#aggregationEnd, #aggregationStart {
|
|
1341
|
-
fill: #21222c;
|
|
1342
|
-
stroke: #50fa7b;
|
|
1343
|
-
stroke-width: 1;
|
|
1344
|
-
}
|
|
1345
|
-
#dependencyStart, #dependencyEnd {
|
|
1346
|
-
fill: #00bcd4;
|
|
1347
|
-
stroke: #00bcd4;
|
|
1348
|
-
stroke-width: 1;
|
|
1349
|
-
}
|
|
1350
|
-
#extensionStart, #extensionEnd {
|
|
1351
|
-
fill: #f8f8f2;
|
|
1352
|
-
stroke: #f8f8f2;
|
|
1353
|
-
stroke-width: 1;
|
|
1354
|
-
}
|
|
1355
|
-
`,
|
|
1356
|
-
fontFamily: "Fira Code",
|
|
1357
|
-
sequence: { showSequenceNumbers: true }
|
|
1358
|
-
});
|
|
1359
|
-
mermaid.render(domId.current, code, target.current).then((result) => {
|
|
1360
|
-
target.current.innerHTML = result.svg;
|
|
1361
|
-
}).catch((error) => {
|
|
1362
|
-
console.log(error);
|
|
1309
|
+
if ($container.current) {
|
|
1310
|
+
infographicInstance.current = new Infographic({
|
|
1311
|
+
container: $container.current
|
|
1363
1312
|
});
|
|
1364
1313
|
}
|
|
1365
|
-
|
|
1366
|
-
|
|
1314
|
+
return () => {
|
|
1315
|
+
infographicInstance.current?.destroy();
|
|
1316
|
+
};
|
|
1317
|
+
}, []);
|
|
1318
|
+
useEffect5(() => {
|
|
1319
|
+
infographicInstance.current?.render(children);
|
|
1320
|
+
}, [children]);
|
|
1321
|
+
return /* @__PURE__ */ jsx5("div", { ref: $container });
|
|
1367
1322
|
};
|
|
1368
1323
|
|
|
1369
|
-
// src/components/GenUI/
|
|
1324
|
+
// src/components/GenUI/Code.tsx
|
|
1370
1325
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
1371
|
-
var
|
|
1326
|
+
var Code = (props) => {
|
|
1327
|
+
const { className, children } = props;
|
|
1328
|
+
const language = className?.match(/language-(\w+)/)?.[1] || "";
|
|
1329
|
+
let childrenStr;
|
|
1330
|
+
if (typeof children === "string") {
|
|
1331
|
+
childrenStr = children;
|
|
1332
|
+
}
|
|
1333
|
+
if (Array.isArray(children)) {
|
|
1334
|
+
childrenStr = children.join("");
|
|
1335
|
+
}
|
|
1336
|
+
if (language) {
|
|
1337
|
+
const Element = getElement(language)?.card_view;
|
|
1338
|
+
if (Element) {
|
|
1339
|
+
let childrenData;
|
|
1340
|
+
try {
|
|
1341
|
+
childrenData = JSON.parse(childrenStr);
|
|
1342
|
+
} catch (error) {
|
|
1343
|
+
}
|
|
1344
|
+
return /* @__PURE__ */ jsx6(Element, { component_key: language, data: childrenData });
|
|
1345
|
+
}
|
|
1346
|
+
switch (language) {
|
|
1347
|
+
case "infographic":
|
|
1348
|
+
return /* @__PURE__ */ jsx6(ReactInfographic, { children });
|
|
1349
|
+
case "mermaid":
|
|
1350
|
+
return /* @__PURE__ */ jsx6(Mermaid, { children });
|
|
1351
|
+
default:
|
|
1352
|
+
return /* @__PURE__ */ jsx6(CodeHighlighter, { lang: language, children });
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
return /* @__PURE__ */ jsx6(CodeHighlighter, { lang: language, children });
|
|
1356
|
+
};
|
|
1357
|
+
|
|
1358
|
+
// src/components/GenUI/MDComponentWrap.tsx
|
|
1359
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
1360
|
+
var MDComponentWrap = (Element) => {
|
|
1361
|
+
return (props) => {
|
|
1362
|
+
return /* @__PURE__ */ jsx7(Element, { ...props });
|
|
1363
|
+
};
|
|
1364
|
+
};
|
|
1365
|
+
|
|
1366
|
+
// src/components/GenUI/elements/generic_data_table.tsx
|
|
1367
|
+
import { Table, Typography, Button, Flex, Space } from "antd";
|
|
1368
|
+
import { useState as useState7 } from "react";
|
|
1369
|
+
import { DownloadOutlined, ExpandAltOutlined } from "@ant-design/icons";
|
|
1370
|
+
import { jsx as jsx8, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1371
|
+
var { Text } = Typography;
|
|
1372
|
+
var GenericDataTable = ({ data, interactive = true, default_open_in_side_app = true }) => {
|
|
1373
|
+
const { dataSource, message: message5 } = data ?? {};
|
|
1374
|
+
const [expandedRowKeys, setExpandedRowKeys] = useState7([]);
|
|
1375
|
+
const { openSideApp } = useChatUIContext();
|
|
1376
|
+
const processedData = dataSource?.map((item, index) => ({
|
|
1377
|
+
...item,
|
|
1378
|
+
key: `${index}_${JSON.stringify(item).slice(0, 20)}`
|
|
1379
|
+
})) || [];
|
|
1380
|
+
const generateColumns = (dataItem) => {
|
|
1381
|
+
if (!dataItem || typeof dataItem !== "object") {
|
|
1382
|
+
return [];
|
|
1383
|
+
}
|
|
1384
|
+
return Object.keys(dataItem).filter((key) => key !== "key" && key !== "expandItem").map((key) => ({
|
|
1385
|
+
title: formatColumnTitle(key),
|
|
1386
|
+
dataIndex: key,
|
|
1387
|
+
key,
|
|
1388
|
+
width: 150,
|
|
1389
|
+
sorter: (a, b) => {
|
|
1390
|
+
const aVal = a[key];
|
|
1391
|
+
const bVal = b[key];
|
|
1392
|
+
if (aVal === null || aVal === void 0) return 1;
|
|
1393
|
+
if (bVal === null || bVal === void 0) return -1;
|
|
1394
|
+
if (typeof aVal === "number" && typeof bVal === "number") {
|
|
1395
|
+
return aVal - bVal;
|
|
1396
|
+
}
|
|
1397
|
+
const aDate = new Date(aVal);
|
|
1398
|
+
const bDate = new Date(bVal);
|
|
1399
|
+
if (!isNaN(aDate.getTime()) && !isNaN(bDate.getTime())) {
|
|
1400
|
+
return aDate.getTime() - bDate.getTime();
|
|
1401
|
+
}
|
|
1402
|
+
return String(aVal).localeCompare(String(bVal), "zh-CN");
|
|
1403
|
+
},
|
|
1404
|
+
render: (value) => {
|
|
1405
|
+
if (value === null || value === void 0) {
|
|
1406
|
+
return "-";
|
|
1407
|
+
}
|
|
1408
|
+
if (typeof value === "object") {
|
|
1409
|
+
return JSON.stringify(value);
|
|
1410
|
+
}
|
|
1411
|
+
return String(value);
|
|
1412
|
+
}
|
|
1413
|
+
}));
|
|
1414
|
+
};
|
|
1415
|
+
const formatColumnTitle = (key) => {
|
|
1416
|
+
return key.replace(/([A-Z])/g, " $1").replace(/_/g, " ").replace(/^./, (str) => str.toUpperCase()).trim();
|
|
1417
|
+
};
|
|
1418
|
+
const columns = processedData.length > 0 ? generateColumns(processedData[0]) : [];
|
|
1419
|
+
const expandedRowRender = (record) => {
|
|
1420
|
+
const expandItem = record.expandItem;
|
|
1421
|
+
if (!expandItem) {
|
|
1422
|
+
return null;
|
|
1423
|
+
}
|
|
1424
|
+
return /* @__PURE__ */ jsxs2("div", { style: { padding: "16px" }, children: [
|
|
1425
|
+
expandItem.content && /* @__PURE__ */ jsxs2("div", { style: { marginBottom: "16px" }, children: [
|
|
1426
|
+
/* @__PURE__ */ jsx8(Text, { strong: true, style: { display: "block", marginBottom: "8px" }, children: "\u8BE6\u7EC6\u4FE1\u606F:" }),
|
|
1427
|
+
/* @__PURE__ */ jsx8(MDResponse, { content: expandItem.content })
|
|
1428
|
+
] }),
|
|
1429
|
+
expandItem.dataSource && expandItem.dataSource.length > 0 && /* @__PURE__ */ jsxs2("div", { children: [
|
|
1430
|
+
/* @__PURE__ */ jsx8(Text, { strong: true, style: { display: "block", marginBottom: "8px" }, children: "\u5B50\u8868\u6570\u636E:" }),
|
|
1431
|
+
/* @__PURE__ */ jsx8(
|
|
1432
|
+
GenericDataTable,
|
|
1433
|
+
{
|
|
1434
|
+
component_key: `nested_${record.key}`,
|
|
1435
|
+
data: {
|
|
1436
|
+
dataSource: expandItem.dataSource,
|
|
1437
|
+
message: void 0
|
|
1438
|
+
},
|
|
1439
|
+
interactive
|
|
1440
|
+
}
|
|
1441
|
+
)
|
|
1442
|
+
] })
|
|
1443
|
+
] });
|
|
1444
|
+
};
|
|
1445
|
+
const exportToExcel = () => {
|
|
1446
|
+
if (!processedData || processedData.length === 0) return;
|
|
1447
|
+
console.warn(
|
|
1448
|
+
"Export to Excel not implemented in SDK yet (requires xlsx dependency)"
|
|
1449
|
+
);
|
|
1450
|
+
};
|
|
1451
|
+
const hasExpandableRows = processedData.some((item) => item.expandItem);
|
|
1452
|
+
return /* @__PURE__ */ jsx8(
|
|
1453
|
+
Table,
|
|
1454
|
+
{
|
|
1455
|
+
size: "small",
|
|
1456
|
+
title: () => /* @__PURE__ */ jsxs2(Flex, { justify: "space-between", align: "center", children: [
|
|
1457
|
+
/* @__PURE__ */ jsx8(Space, { children: /* @__PURE__ */ jsx8(Text, { strong: true, style: { fontSize: 16 }, children: message5 || "" }) }),
|
|
1458
|
+
/* @__PURE__ */ jsxs2(Space, { children: [
|
|
1459
|
+
/* @__PURE__ */ jsx8(
|
|
1460
|
+
Button,
|
|
1461
|
+
{
|
|
1462
|
+
type: "text",
|
|
1463
|
+
size: "small",
|
|
1464
|
+
icon: /* @__PURE__ */ jsx8(DownloadOutlined, {}),
|
|
1465
|
+
onClick: exportToExcel,
|
|
1466
|
+
disabled: !processedData || processedData.length === 0,
|
|
1467
|
+
children: "\u5BFC\u51FAExcel"
|
|
1468
|
+
}
|
|
1469
|
+
),
|
|
1470
|
+
default_open_in_side_app && /* @__PURE__ */ jsxs2(
|
|
1471
|
+
Button,
|
|
1472
|
+
{
|
|
1473
|
+
type: "link",
|
|
1474
|
+
size: "small",
|
|
1475
|
+
onClick: () => {
|
|
1476
|
+
openSideApp({
|
|
1477
|
+
component_key: "generic_data_table",
|
|
1478
|
+
message: message5 || "",
|
|
1479
|
+
data: { dataSource, message: message5 }
|
|
1480
|
+
});
|
|
1481
|
+
},
|
|
1482
|
+
children: [
|
|
1483
|
+
/* @__PURE__ */ jsx8(ExpandAltOutlined, {}),
|
|
1484
|
+
"\u5C55\u5F00"
|
|
1485
|
+
]
|
|
1486
|
+
}
|
|
1487
|
+
)
|
|
1488
|
+
] })
|
|
1489
|
+
] }),
|
|
1490
|
+
dataSource: processedData,
|
|
1491
|
+
columns,
|
|
1492
|
+
pagination: {
|
|
1493
|
+
pageSize: 10,
|
|
1494
|
+
showSizeChanger: true,
|
|
1495
|
+
showQuickJumper: true,
|
|
1496
|
+
showTotal: (total, range) => `\u7B2C ${range[0]}-${range[1]} \u6761/\u5171 ${total} \u6761`
|
|
1497
|
+
},
|
|
1498
|
+
scroll: { x: "max-content" },
|
|
1499
|
+
expandable: hasExpandableRows ? {
|
|
1500
|
+
expandedRowRender,
|
|
1501
|
+
expandedRowKeys,
|
|
1502
|
+
onExpandedRowsChange: (keys) => setExpandedRowKeys(keys),
|
|
1503
|
+
rowExpandable: (record) => !!record.expandItem
|
|
1504
|
+
} : void 0,
|
|
1505
|
+
rowKey: "key",
|
|
1506
|
+
bordered: true
|
|
1507
|
+
}
|
|
1508
|
+
);
|
|
1509
|
+
};
|
|
1510
|
+
|
|
1511
|
+
// src/components/GenUI/mdComponents.tsx
|
|
1512
|
+
var genericdatatable = MDComponentWrap(GenericDataTable);
|
|
1513
|
+
var mdComponents = {
|
|
1514
|
+
code: Code,
|
|
1515
|
+
genericdatatable
|
|
1516
|
+
// row: Row,
|
|
1517
|
+
// col: Col,
|
|
1518
|
+
// input: Input,
|
|
1519
|
+
// button: Button,
|
|
1520
|
+
};
|
|
1521
|
+
|
|
1522
|
+
// src/components/GenUI/MDResponse.tsx
|
|
1523
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
1372
1524
|
var useStyles = createStyles2(({ token, css }) => ({
|
|
1373
1525
|
markdownTableContainer: css`
|
|
1374
1526
|
overflow-x: auto;
|
|
@@ -1458,117 +1610,33 @@ var MDResponse = ({
|
|
|
1458
1610
|
noGenUI
|
|
1459
1611
|
}) => {
|
|
1460
1612
|
const { styles } = useStyles();
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
table({ node, ...props }) {
|
|
1470
|
-
return /* @__PURE__ */ jsx6("div", { className: styles.markdownTableContainer, children: /* @__PURE__ */ jsx6("table", { className: styles.markdownTable, ...props }) });
|
|
1471
|
-
},
|
|
1472
|
-
th({ node, ...props }) {
|
|
1473
|
-
return /* @__PURE__ */ jsx6("th", { className: styles.markdownTh, ...props });
|
|
1474
|
-
},
|
|
1475
|
-
td({ node, ...props }) {
|
|
1476
|
-
return /* @__PURE__ */ jsx6("td", { className: styles.markdownTd, ...props });
|
|
1477
|
-
},
|
|
1478
|
-
tr({ node, ...props }) {
|
|
1479
|
-
return /* @__PURE__ */ jsx6("tr", { className: styles.markdownTr, ...props });
|
|
1480
|
-
},
|
|
1481
|
-
code({ children, className, node, ...rest }) {
|
|
1482
|
-
const match = /language-(\w+)/.exec(className || "");
|
|
1483
|
-
const language = match?.[1];
|
|
1484
|
-
if (language) {
|
|
1485
|
-
const Element = getElement(language)?.card_view;
|
|
1486
|
-
if (Element) {
|
|
1487
|
-
let childrenData;
|
|
1488
|
-
try {
|
|
1489
|
-
childrenData = JSON.parse(children);
|
|
1490
|
-
} catch (error) {
|
|
1491
|
-
}
|
|
1492
|
-
return /* @__PURE__ */ jsx6(
|
|
1493
|
-
Element,
|
|
1494
|
-
{
|
|
1495
|
-
context,
|
|
1496
|
-
interactive,
|
|
1497
|
-
component_key: language,
|
|
1498
|
-
data: childrenData
|
|
1499
|
-
}
|
|
1500
|
-
);
|
|
1501
|
-
}
|
|
1502
|
-
switch (language) {
|
|
1503
|
-
case "mermaid":
|
|
1504
|
-
return /* @__PURE__ */ jsx6(MDMermaid, { children });
|
|
1505
|
-
default:
|
|
1506
|
-
return /* @__PURE__ */ jsx6(
|
|
1507
|
-
SyntaxHighlighter,
|
|
1508
|
-
{
|
|
1509
|
-
...rest,
|
|
1510
|
-
PreTag: "div",
|
|
1511
|
-
language,
|
|
1512
|
-
style: dark,
|
|
1513
|
-
children: String(children).replace(/\n$/, "")
|
|
1514
|
-
}
|
|
1515
|
-
);
|
|
1516
|
-
}
|
|
1517
|
-
} else {
|
|
1518
|
-
return /* @__PURE__ */ jsx6("code", { ...rest, className, children });
|
|
1519
|
-
}
|
|
1520
|
-
}
|
|
1521
|
-
},
|
|
1522
|
-
remarkPlugins: [remarkGfm],
|
|
1523
|
-
rehypePlugins: [rehypeRaw]
|
|
1524
|
-
}),
|
|
1525
|
-
[userData, interactive, embeddedLink, styles]
|
|
1526
|
-
);
|
|
1527
|
-
return /* @__PURE__ */ jsx6("div", { className: styles.markdownContainer, children: /* @__PURE__ */ jsx6(ReactMarkdown, { ...config, children: content }) });
|
|
1613
|
+
return /* @__PURE__ */ jsx9("div", { className: styles.markdownContainer, children: /* @__PURE__ */ jsx9(
|
|
1614
|
+
XMarkdown,
|
|
1615
|
+
{
|
|
1616
|
+
components: mdComponents,
|
|
1617
|
+
content,
|
|
1618
|
+
paragraphTag: "div"
|
|
1619
|
+
}
|
|
1620
|
+
) });
|
|
1528
1621
|
};
|
|
1529
1622
|
var MDViewFormItem = ({ value }) => {
|
|
1530
|
-
return /* @__PURE__ */
|
|
1531
|
-
};
|
|
1532
|
-
var IFrameCard = ({ src }) => {
|
|
1533
|
-
const containerRef = useRef5(null);
|
|
1534
|
-
const [width, setWidth] = useState7("640px");
|
|
1535
|
-
const [height, setHeight] = useState7("320px");
|
|
1536
|
-
const valid_images = [
|
|
1537
|
-
"jpg",
|
|
1538
|
-
"jpeg",
|
|
1539
|
-
"png",
|
|
1540
|
-
"gif",
|
|
1541
|
-
"bmp",
|
|
1542
|
-
"svg",
|
|
1543
|
-
"tif",
|
|
1544
|
-
"tiff",
|
|
1545
|
-
"webp"
|
|
1546
|
-
];
|
|
1547
|
-
if (!src) {
|
|
1548
|
-
return null;
|
|
1549
|
-
}
|
|
1550
|
-
const spitedSrc = src.split(".");
|
|
1551
|
-
if (valid_images.includes(spitedSrc[spitedSrc.length - 1].toLowerCase())) {
|
|
1552
|
-
return /* @__PURE__ */ jsx6("div", { children: /* @__PURE__ */ jsx6("img", { src, style: { width: "100%" } }) });
|
|
1553
|
-
} else {
|
|
1554
|
-
return /* @__PURE__ */ jsx6("div", { children: /* @__PURE__ */ jsx6("a", { href: src, target: "_black", children: src }) });
|
|
1555
|
-
}
|
|
1623
|
+
return /* @__PURE__ */ jsx9(MDResponse, { content: value || "" });
|
|
1556
1624
|
};
|
|
1557
1625
|
|
|
1558
1626
|
// src/components/GenUI/elements/confirm_feedback.tsx
|
|
1559
|
-
import { jsx as
|
|
1560
|
-
var { Text } =
|
|
1627
|
+
import { jsx as jsx10, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1628
|
+
var { Text: Text2 } = Typography2;
|
|
1561
1629
|
var ConfirmFeedback = ({
|
|
1562
1630
|
data,
|
|
1563
1631
|
interactive = true
|
|
1564
1632
|
}) => {
|
|
1565
1633
|
const { message: message5, type, config, feedback, options } = data ?? {};
|
|
1566
1634
|
const { sendMessage } = useAgentChat();
|
|
1567
|
-
const [clicked, setClicked] =
|
|
1568
|
-
return /* @__PURE__ */
|
|
1569
|
-
/* @__PURE__ */
|
|
1570
|
-
options ? /* @__PURE__ */
|
|
1571
|
-
|
|
1635
|
+
const [clicked, setClicked] = useState9(false);
|
|
1636
|
+
return /* @__PURE__ */ jsxs3(Space2, { direction: "vertical", style: { width: "100%" }, children: [
|
|
1637
|
+
/* @__PURE__ */ jsx10(MDResponse, { content: message5 }),
|
|
1638
|
+
options ? /* @__PURE__ */ jsx10(Space2, { style: { justifyContent: "flex-end", width: "100%" }, children: options?.map((option) => /* @__PURE__ */ jsx10(
|
|
1639
|
+
Button2,
|
|
1572
1640
|
{
|
|
1573
1641
|
title: option.description,
|
|
1574
1642
|
disabled: !interactive || clicked || feedback,
|
|
@@ -1590,9 +1658,9 @@ var ConfirmFeedback = ({
|
|
|
1590
1658
|
children: option.label
|
|
1591
1659
|
},
|
|
1592
1660
|
option.value
|
|
1593
|
-
)) }) : /* @__PURE__ */
|
|
1594
|
-
/* @__PURE__ */
|
|
1595
|
-
|
|
1661
|
+
)) }) : /* @__PURE__ */ jsxs3(Space2, { style: { justifyContent: "flex-end", width: "100%" }, children: [
|
|
1662
|
+
/* @__PURE__ */ jsx10(
|
|
1663
|
+
Button2,
|
|
1596
1664
|
{
|
|
1597
1665
|
disabled: !interactive || clicked || feedback,
|
|
1598
1666
|
style: {
|
|
@@ -1614,8 +1682,8 @@ var ConfirmFeedback = ({
|
|
|
1614
1682
|
children: "\u786E\u8BA4"
|
|
1615
1683
|
}
|
|
1616
1684
|
),
|
|
1617
|
-
/* @__PURE__ */
|
|
1618
|
-
|
|
1685
|
+
/* @__PURE__ */ jsx10(
|
|
1686
|
+
Button2,
|
|
1619
1687
|
{
|
|
1620
1688
|
disabled: !interactive || clicked || feedback,
|
|
1621
1689
|
type: "default",
|
|
@@ -1641,155 +1709,10 @@ var ConfirmFeedback = ({
|
|
|
1641
1709
|
] });
|
|
1642
1710
|
};
|
|
1643
1711
|
|
|
1644
|
-
// src/components/GenUI/elements/generic_data_table.tsx
|
|
1645
|
-
import { Table, Typography as Typography2, Button as Button2, Flex, Space as Space2 } from "antd";
|
|
1646
|
-
import { useState as useState9 } from "react";
|
|
1647
|
-
import { DownloadOutlined, ExpandAltOutlined } from "@ant-design/icons";
|
|
1648
|
-
import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1649
|
-
var { Text: Text2 } = Typography2;
|
|
1650
|
-
var GenericDataTable = ({ data, interactive = true, default_open_in_side_app = true }) => {
|
|
1651
|
-
const { dataSource, message: message5 } = data ?? {};
|
|
1652
|
-
const [expandedRowKeys, setExpandedRowKeys] = useState9([]);
|
|
1653
|
-
const { openSideApp } = useChatUIContext();
|
|
1654
|
-
const processedData = dataSource?.map((item, index) => ({
|
|
1655
|
-
...item,
|
|
1656
|
-
key: `${index}_${JSON.stringify(item).slice(0, 20)}`
|
|
1657
|
-
})) || [];
|
|
1658
|
-
const generateColumns = (dataItem) => {
|
|
1659
|
-
if (!dataItem || typeof dataItem !== "object") {
|
|
1660
|
-
return [];
|
|
1661
|
-
}
|
|
1662
|
-
return Object.keys(dataItem).filter((key) => key !== "key" && key !== "expandItem").map((key) => ({
|
|
1663
|
-
title: formatColumnTitle(key),
|
|
1664
|
-
dataIndex: key,
|
|
1665
|
-
key,
|
|
1666
|
-
width: 150,
|
|
1667
|
-
sorter: (a, b) => {
|
|
1668
|
-
const aVal = a[key];
|
|
1669
|
-
const bVal = b[key];
|
|
1670
|
-
if (aVal === null || aVal === void 0) return 1;
|
|
1671
|
-
if (bVal === null || bVal === void 0) return -1;
|
|
1672
|
-
if (typeof aVal === "number" && typeof bVal === "number") {
|
|
1673
|
-
return aVal - bVal;
|
|
1674
|
-
}
|
|
1675
|
-
const aDate = new Date(aVal);
|
|
1676
|
-
const bDate = new Date(bVal);
|
|
1677
|
-
if (!isNaN(aDate.getTime()) && !isNaN(bDate.getTime())) {
|
|
1678
|
-
return aDate.getTime() - bDate.getTime();
|
|
1679
|
-
}
|
|
1680
|
-
return String(aVal).localeCompare(String(bVal), "zh-CN");
|
|
1681
|
-
},
|
|
1682
|
-
render: (value) => {
|
|
1683
|
-
if (value === null || value === void 0) {
|
|
1684
|
-
return "-";
|
|
1685
|
-
}
|
|
1686
|
-
if (typeof value === "object") {
|
|
1687
|
-
return JSON.stringify(value);
|
|
1688
|
-
}
|
|
1689
|
-
return String(value);
|
|
1690
|
-
}
|
|
1691
|
-
}));
|
|
1692
|
-
};
|
|
1693
|
-
const formatColumnTitle = (key) => {
|
|
1694
|
-
return key.replace(/([A-Z])/g, " $1").replace(/_/g, " ").replace(/^./, (str) => str.toUpperCase()).trim();
|
|
1695
|
-
};
|
|
1696
|
-
const columns = processedData.length > 0 ? generateColumns(processedData[0]) : [];
|
|
1697
|
-
const expandedRowRender = (record) => {
|
|
1698
|
-
const expandItem = record.expandItem;
|
|
1699
|
-
if (!expandItem) {
|
|
1700
|
-
return null;
|
|
1701
|
-
}
|
|
1702
|
-
return /* @__PURE__ */ jsxs3("div", { style: { padding: "16px" }, children: [
|
|
1703
|
-
expandItem.content && /* @__PURE__ */ jsxs3("div", { style: { marginBottom: "16px" }, children: [
|
|
1704
|
-
/* @__PURE__ */ jsx8(Text2, { strong: true, style: { display: "block", marginBottom: "8px" }, children: "\u8BE6\u7EC6\u4FE1\u606F:" }),
|
|
1705
|
-
/* @__PURE__ */ jsx8(MDResponse, { content: expandItem.content })
|
|
1706
|
-
] }),
|
|
1707
|
-
expandItem.dataSource && expandItem.dataSource.length > 0 && /* @__PURE__ */ jsxs3("div", { children: [
|
|
1708
|
-
/* @__PURE__ */ jsx8(Text2, { strong: true, style: { display: "block", marginBottom: "8px" }, children: "\u5B50\u8868\u6570\u636E:" }),
|
|
1709
|
-
/* @__PURE__ */ jsx8(
|
|
1710
|
-
GenericDataTable,
|
|
1711
|
-
{
|
|
1712
|
-
component_key: `nested_${record.key}`,
|
|
1713
|
-
data: {
|
|
1714
|
-
dataSource: expandItem.dataSource,
|
|
1715
|
-
message: void 0
|
|
1716
|
-
},
|
|
1717
|
-
interactive
|
|
1718
|
-
}
|
|
1719
|
-
)
|
|
1720
|
-
] })
|
|
1721
|
-
] });
|
|
1722
|
-
};
|
|
1723
|
-
const exportToExcel = () => {
|
|
1724
|
-
if (!processedData || processedData.length === 0) return;
|
|
1725
|
-
console.warn(
|
|
1726
|
-
"Export to Excel not implemented in SDK yet (requires xlsx dependency)"
|
|
1727
|
-
);
|
|
1728
|
-
};
|
|
1729
|
-
const hasExpandableRows = processedData.some((item) => item.expandItem);
|
|
1730
|
-
return /* @__PURE__ */ jsx8(
|
|
1731
|
-
Table,
|
|
1732
|
-
{
|
|
1733
|
-
size: "small",
|
|
1734
|
-
title: () => /* @__PURE__ */ jsxs3(Flex, { justify: "space-between", align: "center", children: [
|
|
1735
|
-
/* @__PURE__ */ jsx8(Space2, { children: /* @__PURE__ */ jsx8(Text2, { strong: true, style: { fontSize: 16 }, children: message5 || "" }) }),
|
|
1736
|
-
/* @__PURE__ */ jsxs3(Space2, { children: [
|
|
1737
|
-
/* @__PURE__ */ jsx8(
|
|
1738
|
-
Button2,
|
|
1739
|
-
{
|
|
1740
|
-
type: "text",
|
|
1741
|
-
size: "small",
|
|
1742
|
-
icon: /* @__PURE__ */ jsx8(DownloadOutlined, {}),
|
|
1743
|
-
onClick: exportToExcel,
|
|
1744
|
-
disabled: !processedData || processedData.length === 0,
|
|
1745
|
-
children: "\u5BFC\u51FAExcel"
|
|
1746
|
-
}
|
|
1747
|
-
),
|
|
1748
|
-
default_open_in_side_app && /* @__PURE__ */ jsxs3(
|
|
1749
|
-
Button2,
|
|
1750
|
-
{
|
|
1751
|
-
type: "link",
|
|
1752
|
-
size: "small",
|
|
1753
|
-
onClick: () => {
|
|
1754
|
-
openSideApp({
|
|
1755
|
-
component_key: "generic_data_table",
|
|
1756
|
-
message: message5 || "",
|
|
1757
|
-
data: { dataSource, message: message5 }
|
|
1758
|
-
});
|
|
1759
|
-
},
|
|
1760
|
-
children: [
|
|
1761
|
-
/* @__PURE__ */ jsx8(ExpandAltOutlined, {}),
|
|
1762
|
-
"\u5C55\u5F00"
|
|
1763
|
-
]
|
|
1764
|
-
}
|
|
1765
|
-
)
|
|
1766
|
-
] })
|
|
1767
|
-
] }),
|
|
1768
|
-
dataSource: processedData,
|
|
1769
|
-
columns,
|
|
1770
|
-
pagination: {
|
|
1771
|
-
pageSize: 10,
|
|
1772
|
-
showSizeChanger: true,
|
|
1773
|
-
showQuickJumper: true,
|
|
1774
|
-
showTotal: (total, range) => `\u7B2C ${range[0]}-${range[1]} \u6761/\u5171 ${total} \u6761`
|
|
1775
|
-
},
|
|
1776
|
-
scroll: { x: "max-content" },
|
|
1777
|
-
expandable: hasExpandableRows ? {
|
|
1778
|
-
expandedRowRender,
|
|
1779
|
-
expandedRowKeys,
|
|
1780
|
-
onExpandedRowsChange: (keys) => setExpandedRowKeys(keys),
|
|
1781
|
-
rowExpandable: (record) => !!record.expandItem
|
|
1782
|
-
} : void 0,
|
|
1783
|
-
rowKey: "key",
|
|
1784
|
-
bordered: true
|
|
1785
|
-
}
|
|
1786
|
-
);
|
|
1787
|
-
};
|
|
1788
|
-
|
|
1789
1712
|
// src/components/GenUI/elements/generic_data_table_side_app.tsx
|
|
1790
|
-
import { jsx as
|
|
1713
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1791
1714
|
var GenericDataTableSideApp = (props) => {
|
|
1792
|
-
return /* @__PURE__ */
|
|
1715
|
+
return /* @__PURE__ */ jsx11(GenericDataTable, { ...props, default_open_in_side_app: false });
|
|
1793
1716
|
};
|
|
1794
1717
|
|
|
1795
1718
|
// src/components/GenUI/elements/ToolCall.tsx
|
|
@@ -1805,7 +1728,7 @@ import {
|
|
|
1805
1728
|
import { Card as Card2, Typography as Typography3, Space as Space3, Tag } from "antd";
|
|
1806
1729
|
import { createStyles as createStyles3 } from "antd-style";
|
|
1807
1730
|
import { ToolOutlined, CodeOutlined } from "@ant-design/icons";
|
|
1808
|
-
import { jsx as
|
|
1731
|
+
import { jsx as jsx12, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1809
1732
|
var { Text: Text3, Title } = Typography3;
|
|
1810
1733
|
var useStyle2 = createStyles3(({ token, css }) => ({
|
|
1811
1734
|
card: css`
|
|
@@ -1875,7 +1798,7 @@ var ToolCard = ({
|
|
|
1875
1798
|
}) => {
|
|
1876
1799
|
const { styles } = useStyle2();
|
|
1877
1800
|
if (!data || !data.name) {
|
|
1878
|
-
return /* @__PURE__ */
|
|
1801
|
+
return /* @__PURE__ */ jsx12(Card2, { size: "small", className: styles.card, bordered: false, children: /* @__PURE__ */ jsx12(Text3, { type: "secondary", children: "Invalid tool data" }) });
|
|
1879
1802
|
}
|
|
1880
1803
|
const formatToolName = (name) => {
|
|
1881
1804
|
return name.replace(/([a-z])([A-Z])/g, "$1 $2").split(/[_-]/).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
@@ -1928,11 +1851,11 @@ var ToolCard = ({
|
|
|
1928
1851
|
children: [
|
|
1929
1852
|
/* @__PURE__ */ jsxs4("div", { className: styles.header, children: [
|
|
1930
1853
|
/* @__PURE__ */ jsxs4(Space3, { align: "center", children: [
|
|
1931
|
-
/* @__PURE__ */
|
|
1932
|
-
/* @__PURE__ */
|
|
1933
|
-
data.type && /* @__PURE__ */
|
|
1854
|
+
/* @__PURE__ */ jsx12(ToolOutlined, { style: { color: "#1890ff", fontSize: "18px" } }),
|
|
1855
|
+
/* @__PURE__ */ jsx12(Title, { level: 5, className: styles.toolName, style: { margin: 0 }, children: formatToolName(data.name) }),
|
|
1856
|
+
data.type && /* @__PURE__ */ jsx12(Tag, { color: "blue", className: styles.typeTag, children: data.type })
|
|
1934
1857
|
] }),
|
|
1935
|
-
data.description && /* @__PURE__ */
|
|
1858
|
+
data.description && /* @__PURE__ */ jsx12(
|
|
1936
1859
|
Text3,
|
|
1937
1860
|
{
|
|
1938
1861
|
type: "secondary",
|
|
@@ -1943,17 +1866,17 @@ var ToolCard = ({
|
|
|
1943
1866
|
] }),
|
|
1944
1867
|
hasParameters ? /* @__PURE__ */ jsxs4("div", { children: [
|
|
1945
1868
|
/* @__PURE__ */ jsxs4(Space3, { align: "center", style: { marginBottom: "12px" }, children: [
|
|
1946
|
-
/* @__PURE__ */
|
|
1869
|
+
/* @__PURE__ */ jsx12(CodeOutlined, { style: { color: "#52c41a", fontSize: "14px" } }),
|
|
1947
1870
|
/* @__PURE__ */ jsxs4(Text3, { strong: true, style: { fontSize: "14px" }, children: [
|
|
1948
1871
|
"Parameters (",
|
|
1949
1872
|
Object.keys(data.parameters).length,
|
|
1950
1873
|
")"
|
|
1951
1874
|
] })
|
|
1952
1875
|
] }),
|
|
1953
|
-
/* @__PURE__ */
|
|
1954
|
-
/* @__PURE__ */
|
|
1955
|
-
/* @__PURE__ */
|
|
1956
|
-
/* @__PURE__ */
|
|
1876
|
+
/* @__PURE__ */ jsx12("div", { className: styles.parameterGrid, children: Object.entries(data.parameters).map(([key, value], index) => /* @__PURE__ */ jsxs4("div", { className: styles.parameterItem, children: [
|
|
1877
|
+
/* @__PURE__ */ jsx12("div", { className: styles.parameterName, children: /* @__PURE__ */ jsxs4(Space3, { align: "center", children: [
|
|
1878
|
+
/* @__PURE__ */ jsx12("span", { children: key }),
|
|
1879
|
+
/* @__PURE__ */ jsx12(
|
|
1957
1880
|
Tag,
|
|
1958
1881
|
{
|
|
1959
1882
|
color: getTypeColor(value),
|
|
@@ -1962,11 +1885,11 @@ var ToolCard = ({
|
|
|
1962
1885
|
}
|
|
1963
1886
|
)
|
|
1964
1887
|
] }) }),
|
|
1965
|
-
/* @__PURE__ */
|
|
1888
|
+
/* @__PURE__ */ jsx12("div", { className: styles.parameterValue, children: formatParameterValue(value) })
|
|
1966
1889
|
] }, index)) })
|
|
1967
1890
|
] }) : /* @__PURE__ */ jsxs4(Space3, { align: "center", children: [
|
|
1968
|
-
/* @__PURE__ */
|
|
1969
|
-
/* @__PURE__ */
|
|
1891
|
+
/* @__PURE__ */ jsx12(CodeOutlined, { style: { color: "#d9d9d9", fontSize: "14px" } }),
|
|
1892
|
+
/* @__PURE__ */ jsx12(Text3, { type: "secondary", style: { fontSize: "13px" }, children: "No parameters" })
|
|
1970
1893
|
] })
|
|
1971
1894
|
]
|
|
1972
1895
|
}
|
|
@@ -1974,15 +1897,15 @@ var ToolCard = ({
|
|
|
1974
1897
|
};
|
|
1975
1898
|
|
|
1976
1899
|
// src/components/GenUI/elements/ToolCall.tsx
|
|
1977
|
-
import { jsx as
|
|
1900
|
+
import { jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1978
1901
|
function getStatusIcon(status) {
|
|
1979
1902
|
switch (status) {
|
|
1980
1903
|
case "success":
|
|
1981
|
-
return /* @__PURE__ */
|
|
1904
|
+
return /* @__PURE__ */ jsx13(CheckCircleOutlined, { style: { color: "#52c41a" } });
|
|
1982
1905
|
case "error":
|
|
1983
|
-
return /* @__PURE__ */
|
|
1906
|
+
return /* @__PURE__ */ jsx13(InfoCircleOutlined, { style: { color: "#ff4d4f" } });
|
|
1984
1907
|
default:
|
|
1985
|
-
return /* @__PURE__ */
|
|
1908
|
+
return /* @__PURE__ */ jsx13(LoadingOutlined, { style: { color: "#1890ff" } });
|
|
1986
1909
|
}
|
|
1987
1910
|
}
|
|
1988
1911
|
var ToolCall = ({ data }) => {
|
|
@@ -2006,8 +1929,8 @@ var ToolCall = ({ data }) => {
|
|
|
2006
1929
|
}
|
|
2007
1930
|
};
|
|
2008
1931
|
const header = /* @__PURE__ */ jsxs5(Flex2, { align: "center", wrap: "wrap", children: [
|
|
2009
|
-
/* @__PURE__ */
|
|
2010
|
-
/* @__PURE__ */
|
|
1932
|
+
/* @__PURE__ */ jsx13(Typography4.Text, { strong: true, children: formatToolName(toolCallData.name) }),
|
|
1933
|
+
/* @__PURE__ */ jsx13(
|
|
2011
1934
|
Typography4.Text,
|
|
2012
1935
|
{
|
|
2013
1936
|
type: "secondary",
|
|
@@ -2022,7 +1945,7 @@ var ToolCall = ({ data }) => {
|
|
|
2022
1945
|
type: "tool_call"
|
|
2023
1946
|
};
|
|
2024
1947
|
const content = /* @__PURE__ */ jsxs5("div", { style: { marginTop: "8px" }, children: [
|
|
2025
|
-
/* @__PURE__ */
|
|
1948
|
+
/* @__PURE__ */ jsx13(
|
|
2026
1949
|
ToolCard,
|
|
2027
1950
|
{
|
|
2028
1951
|
data: toolCardData,
|
|
@@ -2031,7 +1954,7 @@ var ToolCall = ({ data }) => {
|
|
|
2031
1954
|
}
|
|
2032
1955
|
),
|
|
2033
1956
|
toolCallData.response && /* @__PURE__ */ jsxs5("div", { style: { marginTop: "12px" }, children: [
|
|
2034
|
-
/* @__PURE__ */
|
|
1957
|
+
/* @__PURE__ */ jsx13(
|
|
2035
1958
|
Typography4.Text,
|
|
2036
1959
|
{
|
|
2037
1960
|
strong: true,
|
|
@@ -2039,7 +1962,7 @@ var ToolCall = ({ data }) => {
|
|
|
2039
1962
|
children: "Response:"
|
|
2040
1963
|
}
|
|
2041
1964
|
),
|
|
2042
|
-
/* @__PURE__ */
|
|
1965
|
+
/* @__PURE__ */ jsx13(MDResponse, { content: toolCallData.response })
|
|
2043
1966
|
] })
|
|
2044
1967
|
] });
|
|
2045
1968
|
const expandIcon = ({ isActive }) => {
|
|
@@ -2052,14 +1975,14 @@ var ToolCall = ({ data }) => {
|
|
|
2052
1975
|
component_key: toolCallData.id
|
|
2053
1976
|
});
|
|
2054
1977
|
}
|
|
2055
|
-
return /* @__PURE__ */
|
|
1978
|
+
return /* @__PURE__ */ jsx13(
|
|
2056
1979
|
Collapse,
|
|
2057
1980
|
{
|
|
2058
1981
|
size: "small",
|
|
2059
1982
|
bordered: false,
|
|
2060
1983
|
defaultActiveKey: [],
|
|
2061
1984
|
expandIcon,
|
|
2062
|
-
children: /* @__PURE__ */
|
|
1985
|
+
children: /* @__PURE__ */ jsx13(
|
|
2063
1986
|
CollapsePanel,
|
|
2064
1987
|
{
|
|
2065
1988
|
header,
|
|
@@ -2073,14 +1996,17 @@ var ToolCall = ({ data }) => {
|
|
|
2073
1996
|
};
|
|
2074
1997
|
|
|
2075
1998
|
// src/components/GenUI/elements/Todo.tsx
|
|
2076
|
-
import { Card as Card3, List, Typography as Typography5, Space as Space5 } from "antd";
|
|
1999
|
+
import { Card as Card3, List, Typography as Typography5, Space as Space5, Button as Button3 } from "antd";
|
|
2077
2000
|
import { createStyles as createStyles4 } from "antd-style";
|
|
2078
2001
|
import {
|
|
2079
2002
|
ArrowRightOutlined,
|
|
2080
2003
|
CheckCircleOutlined as CheckCircleOutlined2,
|
|
2081
|
-
ClockCircleOutlined
|
|
2004
|
+
ClockCircleOutlined,
|
|
2005
|
+
DownOutlined,
|
|
2006
|
+
UpOutlined
|
|
2082
2007
|
} from "@ant-design/icons";
|
|
2083
|
-
import {
|
|
2008
|
+
import { useState as useState10 } from "react";
|
|
2009
|
+
import { jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2084
2010
|
var { Text: Text4 } = Typography5;
|
|
2085
2011
|
var useStyle3 = createStyles4(({ token, css }) => ({
|
|
2086
2012
|
card: css`
|
|
@@ -2111,17 +2037,19 @@ var useStyle3 = createStyles4(({ token, css }) => ({
|
|
|
2111
2037
|
var Todo = ({
|
|
2112
2038
|
data,
|
|
2113
2039
|
component_key,
|
|
2114
|
-
interactive = true
|
|
2040
|
+
interactive = true,
|
|
2041
|
+
focusMode = false
|
|
2115
2042
|
}) => {
|
|
2116
2043
|
const { styles } = useStyle3();
|
|
2044
|
+
const [isExpanded, setIsExpanded] = useState10(false);
|
|
2117
2045
|
const getStatusIcon2 = (status) => {
|
|
2118
2046
|
switch (status) {
|
|
2119
2047
|
case "completed":
|
|
2120
|
-
return /* @__PURE__ */
|
|
2048
|
+
return /* @__PURE__ */ jsx14(CheckCircleOutlined2, { style: { color: "#52c41a" } });
|
|
2121
2049
|
case "in_progress":
|
|
2122
|
-
return /* @__PURE__ */
|
|
2050
|
+
return /* @__PURE__ */ jsx14(ArrowRightOutlined, { style: { fontWeight: "500" } });
|
|
2123
2051
|
case "pending":
|
|
2124
|
-
return /* @__PURE__ */
|
|
2052
|
+
return /* @__PURE__ */ jsx14(ClockCircleOutlined, { style: { color: "gray" } });
|
|
2125
2053
|
default:
|
|
2126
2054
|
return null;
|
|
2127
2055
|
}
|
|
@@ -2162,35 +2090,68 @@ var Todo = ({
|
|
|
2162
2090
|
return "";
|
|
2163
2091
|
}
|
|
2164
2092
|
};
|
|
2093
|
+
const getFilteredData = () => {
|
|
2094
|
+
if (!data || !Array.isArray(data)) {
|
|
2095
|
+
return [];
|
|
2096
|
+
}
|
|
2097
|
+
if (!focusMode || data.length <= 3) {
|
|
2098
|
+
return data;
|
|
2099
|
+
}
|
|
2100
|
+
const firstInProgressIndex = data.findIndex(
|
|
2101
|
+
(item) => item.status === "in_progress"
|
|
2102
|
+
);
|
|
2103
|
+
if (firstInProgressIndex !== -1) {
|
|
2104
|
+
return data.slice(firstInProgressIndex, firstInProgressIndex + 3);
|
|
2105
|
+
}
|
|
2106
|
+
const allCompleted = data.every((item) => item.status === "completed");
|
|
2107
|
+
if (allCompleted) {
|
|
2108
|
+
return data.slice(-3);
|
|
2109
|
+
}
|
|
2110
|
+
return data.slice(0, 3);
|
|
2111
|
+
};
|
|
2165
2112
|
if (!data || !Array.isArray(data)) {
|
|
2166
|
-
return /* @__PURE__ */
|
|
2113
|
+
return /* @__PURE__ */ jsx14(
|
|
2167
2114
|
Card3,
|
|
2168
2115
|
{
|
|
2169
2116
|
size: "small",
|
|
2170
2117
|
className: `shadow-sm ${styles.card}`,
|
|
2171
2118
|
bordered: false,
|
|
2172
|
-
children: /* @__PURE__ */
|
|
2119
|
+
children: /* @__PURE__ */ jsx14(Text4, { type: "secondary", children: "No todo items available" })
|
|
2173
2120
|
}
|
|
2174
2121
|
);
|
|
2175
2122
|
}
|
|
2176
|
-
|
|
2177
|
-
|
|
2123
|
+
const filteredData = getFilteredData();
|
|
2124
|
+
const hasMoreItems = filteredData.length < data.length;
|
|
2125
|
+
const displayData = isExpanded ? data : filteredData;
|
|
2126
|
+
return /* @__PURE__ */ jsx14(Card3, { size: "small", className: `shadow-sm ${styles.card}`, bordered: false, children: /* @__PURE__ */ jsxs6(Space5, { direction: "vertical", style: { width: "100%" }, children: [
|
|
2127
|
+
/* @__PURE__ */ jsx14(
|
|
2178
2128
|
List,
|
|
2179
2129
|
{
|
|
2180
2130
|
size: "small",
|
|
2181
|
-
dataSource:
|
|
2182
|
-
renderItem: (item, index) => /* @__PURE__ */
|
|
2131
|
+
dataSource: displayData,
|
|
2132
|
+
renderItem: (item, index) => /* @__PURE__ */ jsx14(
|
|
2183
2133
|
List.Item,
|
|
2184
2134
|
{
|
|
2185
2135
|
className: `${styles.todoItem} ${getItemClassName(item.status)}`,
|
|
2186
2136
|
children: /* @__PURE__ */ jsxs6(Space5, { align: "center", style: { width: "100%" }, children: [
|
|
2187
2137
|
getStatusIcon2(item.status),
|
|
2188
|
-
/* @__PURE__ */
|
|
2138
|
+
/* @__PURE__ */ jsx14(Text4, { style: { flex: 1 }, children: item.content })
|
|
2189
2139
|
] })
|
|
2190
2140
|
}
|
|
2191
2141
|
)
|
|
2192
2142
|
}
|
|
2193
2143
|
),
|
|
2144
|
+
hasMoreItems && /* @__PURE__ */ jsx14(
|
|
2145
|
+
Button3,
|
|
2146
|
+
{
|
|
2147
|
+
type: "link",
|
|
2148
|
+
size: "small",
|
|
2149
|
+
icon: isExpanded ? /* @__PURE__ */ jsx14(UpOutlined, {}) : /* @__PURE__ */ jsx14(DownOutlined, {}),
|
|
2150
|
+
onClick: () => setIsExpanded(!isExpanded),
|
|
2151
|
+
style: { padding: 0, height: "auto" },
|
|
2152
|
+
children: isExpanded ? "Collapse" : `Show all ${data.length} items (${data.length - filteredData.length} hidden)`
|
|
2153
|
+
}
|
|
2154
|
+
),
|
|
2194
2155
|
/* @__PURE__ */ jsxs6(Text4, { type: "secondary", style: { fontSize: 12 }, children: [
|
|
2195
2156
|
"Total items: ",
|
|
2196
2157
|
data.length,
|
|
@@ -2210,7 +2171,7 @@ var Todo = ({
|
|
|
2210
2171
|
import { Space as Space6, Collapse as Collapse2, Typography as Typography6 } from "antd";
|
|
2211
2172
|
import { UnorderedListOutlined } from "@ant-design/icons";
|
|
2212
2173
|
import CollapsePanel2 from "antd/es/collapse/CollapsePanel";
|
|
2213
|
-
import { jsx as
|
|
2174
|
+
import { jsx as jsx15, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2214
2175
|
var { Text: Text5 } = Typography6;
|
|
2215
2176
|
var WriteTodos = ({
|
|
2216
2177
|
data,
|
|
@@ -2224,10 +2185,10 @@ var WriteTodos = ({
|
|
|
2224
2185
|
(item) => item.status === "completed"
|
|
2225
2186
|
).length;
|
|
2226
2187
|
const expandIcon = () => {
|
|
2227
|
-
return /* @__PURE__ */
|
|
2188
|
+
return /* @__PURE__ */ jsx15(UnorderedListOutlined, {});
|
|
2228
2189
|
};
|
|
2229
2190
|
const header = /* @__PURE__ */ jsxs7(Space6, { children: [
|
|
2230
|
-
/* @__PURE__ */
|
|
2191
|
+
/* @__PURE__ */ jsx15(Text5, { strong: true, children: "TODOs" }),
|
|
2231
2192
|
/* @__PURE__ */ jsxs7(Text5, { style: { fontSize: 12 }, type: "secondary", children: [
|
|
2232
2193
|
completedCount,
|
|
2233
2194
|
"/",
|
|
@@ -2238,24 +2199,25 @@ var WriteTodos = ({
|
|
|
2238
2199
|
if (!toolCallData) {
|
|
2239
2200
|
return null;
|
|
2240
2201
|
}
|
|
2241
|
-
return /* @__PURE__ */
|
|
2202
|
+
return /* @__PURE__ */ jsx15(
|
|
2242
2203
|
Collapse2,
|
|
2243
2204
|
{
|
|
2244
2205
|
size: "small",
|
|
2245
2206
|
bordered: false,
|
|
2246
2207
|
defaultActiveKey: [toolCallData.id],
|
|
2247
2208
|
expandIcon,
|
|
2248
|
-
children: /* @__PURE__ */
|
|
2209
|
+
children: /* @__PURE__ */ jsx15(
|
|
2249
2210
|
CollapsePanel2,
|
|
2250
2211
|
{
|
|
2251
2212
|
header,
|
|
2252
2213
|
style: { minWidth: 400 },
|
|
2253
|
-
children: /* @__PURE__ */
|
|
2214
|
+
children: /* @__PURE__ */ jsx15(
|
|
2254
2215
|
Todo,
|
|
2255
2216
|
{
|
|
2256
2217
|
data: data.args.todos,
|
|
2257
2218
|
component_key,
|
|
2258
|
-
interactive
|
|
2219
|
+
interactive,
|
|
2220
|
+
focusMode: true
|
|
2259
2221
|
}
|
|
2260
2222
|
)
|
|
2261
2223
|
},
|
|
@@ -2266,8 +2228,8 @@ var WriteTodos = ({
|
|
|
2266
2228
|
};
|
|
2267
2229
|
|
|
2268
2230
|
// src/components/GenUI/FileExplorer.tsx
|
|
2269
|
-
import { useState as
|
|
2270
|
-
import { Splitter, Tree, Empty, Button as
|
|
2231
|
+
import { useState as useState11, useEffect as useEffect6, useMemo as useMemo2 } from "react";
|
|
2232
|
+
import { Splitter, Tree, Empty, Button as Button4, Tooltip, message } from "antd";
|
|
2271
2233
|
import {
|
|
2272
2234
|
FolderOutlined,
|
|
2273
2235
|
FolderOpenOutlined,
|
|
@@ -2287,40 +2249,40 @@ import {
|
|
|
2287
2249
|
FileUnknownOutlined,
|
|
2288
2250
|
Html5Outlined
|
|
2289
2251
|
} from "@ant-design/icons";
|
|
2290
|
-
import { jsx as
|
|
2252
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
2291
2253
|
var getFileIcon = (filename) => {
|
|
2292
2254
|
const ext = filename?.split(".")?.pop()?.toLowerCase();
|
|
2293
2255
|
const iconStyle = { fontSize: 14, marginRight: 4, verticalAlign: "middle" };
|
|
2294
2256
|
switch (ext) {
|
|
2295
2257
|
case "ts":
|
|
2296
2258
|
case "tsx":
|
|
2297
|
-
return /* @__PURE__ */
|
|
2259
|
+
return /* @__PURE__ */ jsx16(CodeOutlined2, { style: { ...iconStyle, color: "#3178c6" } });
|
|
2298
2260
|
case "js":
|
|
2299
2261
|
case "jsx":
|
|
2300
|
-
return /* @__PURE__ */
|
|
2262
|
+
return /* @__PURE__ */ jsx16(CodeOutlined2, { style: { ...iconStyle, color: "#f7df1e" } });
|
|
2301
2263
|
case "html":
|
|
2302
|
-
return /* @__PURE__ */
|
|
2264
|
+
return /* @__PURE__ */ jsx16(Html5Outlined, { style: { ...iconStyle, color: "#e34c26" } });
|
|
2303
2265
|
case "css":
|
|
2304
2266
|
case "less":
|
|
2305
2267
|
case "scss":
|
|
2306
|
-
return /* @__PURE__ */
|
|
2268
|
+
return /* @__PURE__ */ jsx16(FileUnknownOutlined, { style: { ...iconStyle, color: "#563d7c" } });
|
|
2307
2269
|
case "md":
|
|
2308
|
-
return /* @__PURE__ */
|
|
2270
|
+
return /* @__PURE__ */ jsx16(FileMarkdownOutlined, { style: { ...iconStyle, color: "#083fa1" } });
|
|
2309
2271
|
case "json":
|
|
2310
|
-
return /* @__PURE__ */
|
|
2272
|
+
return /* @__PURE__ */ jsx16(FileTextOutlined, { style: { ...iconStyle, color: "#fbc02d" } });
|
|
2311
2273
|
case "png":
|
|
2312
2274
|
case "jpg":
|
|
2313
2275
|
case "jpeg":
|
|
2314
2276
|
case "gif":
|
|
2315
2277
|
case "svg":
|
|
2316
|
-
return /* @__PURE__ */
|
|
2278
|
+
return /* @__PURE__ */ jsx16(FileImageOutlined, { style: { ...iconStyle, color: "#4caf50" } });
|
|
2317
2279
|
default:
|
|
2318
|
-
return /* @__PURE__ */
|
|
2280
|
+
return /* @__PURE__ */ jsx16(FileOutlined, { style: { ...iconStyle, color: "#9e9e9e" } });
|
|
2319
2281
|
}
|
|
2320
2282
|
};
|
|
2321
2283
|
|
|
2322
2284
|
// src/components/GenUI/FileExplorer.tsx
|
|
2323
|
-
import { jsx as
|
|
2285
|
+
import { jsx as jsx17, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2324
2286
|
var useStyles2 = createStyles5(({ token, css }) => ({
|
|
2325
2287
|
container: css`
|
|
2326
2288
|
height: 100%;
|
|
@@ -2452,7 +2414,7 @@ var getFolderIcon = (expanded) => {
|
|
|
2452
2414
|
color: "#dcb67a",
|
|
2453
2415
|
verticalAlign: "middle"
|
|
2454
2416
|
};
|
|
2455
|
-
return expanded ? /* @__PURE__ */
|
|
2417
|
+
return expanded ? /* @__PURE__ */ jsx17(FolderOpenOutlined, { style: iconStyle }) : /* @__PURE__ */ jsx17(FolderOutlined, { style: iconStyle });
|
|
2456
2418
|
};
|
|
2457
2419
|
var sortTreeNodes = (nodes) => {
|
|
2458
2420
|
return nodes.sort((a, b) => {
|
|
@@ -2477,7 +2439,7 @@ var buildTreeData = (files, expandedKeys) => {
|
|
|
2477
2439
|
const key = parts.slice(0, index + 1).join("/");
|
|
2478
2440
|
let existingNode = currentLevel.find((node) => node.key === key);
|
|
2479
2441
|
if (!existingNode) {
|
|
2480
|
-
const title = part === "" && index === 0 ? /* @__PURE__ */
|
|
2442
|
+
const title = part === "" && index === 0 ? /* @__PURE__ */ jsx17(
|
|
2481
2443
|
"span",
|
|
2482
2444
|
{
|
|
2483
2445
|
style: {
|
|
@@ -2512,10 +2474,10 @@ var FileExplorer = ({
|
|
|
2512
2474
|
}) => {
|
|
2513
2475
|
const { files } = data ?? {};
|
|
2514
2476
|
const { styles, cx } = useStyles2();
|
|
2515
|
-
const [fileList, setFileList] =
|
|
2516
|
-
const [selectedKey, setSelectedKey] =
|
|
2517
|
-
const [expandedKeys, setExpandedKeys] =
|
|
2518
|
-
const [copied, setCopied] =
|
|
2477
|
+
const [fileList, setFileList] = useState11([]);
|
|
2478
|
+
const [selectedKey, setSelectedKey] = useState11("");
|
|
2479
|
+
const [expandedKeys, setExpandedKeys] = useState11([]);
|
|
2480
|
+
const [copied, setCopied] = useState11(false);
|
|
2519
2481
|
useEffect6(() => {
|
|
2520
2482
|
if (copied) {
|
|
2521
2483
|
const timer = setTimeout(() => setCopied(false), 2e3);
|
|
@@ -2538,7 +2500,7 @@ var FileExplorer = ({
|
|
|
2538
2500
|
setSelectedKey(list[0].name);
|
|
2539
2501
|
}
|
|
2540
2502
|
}, [files]);
|
|
2541
|
-
const treeData =
|
|
2503
|
+
const treeData = useMemo2(
|
|
2542
2504
|
() => buildTreeData(fileList, expandedKeys),
|
|
2543
2505
|
[fileList, expandedKeys]
|
|
2544
2506
|
);
|
|
@@ -2559,7 +2521,7 @@ var FileExplorer = ({
|
|
|
2559
2521
|
setExpandedKeys(getAllKeys(treeData));
|
|
2560
2522
|
}
|
|
2561
2523
|
}, [treeData.length]);
|
|
2562
|
-
const selectedFile =
|
|
2524
|
+
const selectedFile = useMemo2(() => {
|
|
2563
2525
|
return fileList.find((f) => f.name === selectedKey);
|
|
2564
2526
|
}, [fileList, selectedKey]);
|
|
2565
2527
|
const handleCopy = () => {
|
|
@@ -2586,7 +2548,7 @@ var FileExplorer = ({
|
|
|
2586
2548
|
};
|
|
2587
2549
|
const renderContent = () => {
|
|
2588
2550
|
if (!selectedFile) {
|
|
2589
|
-
return /* @__PURE__ */
|
|
2551
|
+
return /* @__PURE__ */ jsx17("div", { className: styles.emptyState, children: /* @__PURE__ */ jsx17(
|
|
2590
2552
|
Empty,
|
|
2591
2553
|
{
|
|
2592
2554
|
description: "Select a file to preview",
|
|
@@ -2601,32 +2563,32 @@ var FileExplorer = ({
|
|
|
2601
2563
|
style: { minHeight: "100%", display: "flex", flexDirection: "column" },
|
|
2602
2564
|
children: [
|
|
2603
2565
|
/* @__PURE__ */ jsxs8("div", { className: styles.header, children: [
|
|
2604
|
-
/* @__PURE__ */
|
|
2605
|
-
|
|
2566
|
+
/* @__PURE__ */ jsx17(Tooltip, { title: "Copy Content", children: /* @__PURE__ */ jsx17(
|
|
2567
|
+
Button4,
|
|
2606
2568
|
{
|
|
2607
2569
|
type: "text",
|
|
2608
|
-
icon: copied ? /* @__PURE__ */
|
|
2570
|
+
icon: copied ? /* @__PURE__ */ jsx17(CheckOutlined, {}) : /* @__PURE__ */ jsx17(CopyOutlined, {}),
|
|
2609
2571
|
onClick: handleCopy,
|
|
2610
2572
|
size: "small"
|
|
2611
2573
|
}
|
|
2612
2574
|
) }),
|
|
2613
|
-
/* @__PURE__ */
|
|
2614
|
-
|
|
2575
|
+
/* @__PURE__ */ jsx17(Tooltip, { title: "Download File", children: /* @__PURE__ */ jsx17(
|
|
2576
|
+
Button4,
|
|
2615
2577
|
{
|
|
2616
2578
|
type: "text",
|
|
2617
|
-
icon: /* @__PURE__ */
|
|
2579
|
+
icon: /* @__PURE__ */ jsx17(DownloadOutlined2, {}),
|
|
2618
2580
|
onClick: handleDownload,
|
|
2619
2581
|
size: "small"
|
|
2620
2582
|
}
|
|
2621
2583
|
) })
|
|
2622
2584
|
] }),
|
|
2623
|
-
/* @__PURE__ */
|
|
2585
|
+
/* @__PURE__ */ jsx17("div", { className: styles.contentBody, children: /* @__PURE__ */ jsx17(MDResponse, { content }) })
|
|
2624
2586
|
]
|
|
2625
2587
|
}
|
|
2626
2588
|
);
|
|
2627
2589
|
};
|
|
2628
|
-
return /* @__PURE__ */
|
|
2629
|
-
/* @__PURE__ */
|
|
2590
|
+
return /* @__PURE__ */ jsx17("div", { className: styles.container, children: /* @__PURE__ */ jsxs8(Splitter, { className: styles.splitter, children: [
|
|
2591
|
+
/* @__PURE__ */ jsx17(Splitter.Panel, { defaultSize: "25%", min: "15%", max: "40%", children: /* @__PURE__ */ jsx17("div", { className: styles.leftPanel, children: /* @__PURE__ */ jsx17(
|
|
2630
2592
|
Tree,
|
|
2631
2593
|
{
|
|
2632
2594
|
showIcon: true,
|
|
@@ -2664,7 +2626,7 @@ var FileExplorer = ({
|
|
|
2664
2626
|
}
|
|
2665
2627
|
}
|
|
2666
2628
|
) }) }),
|
|
2667
|
-
/* @__PURE__ */
|
|
2629
|
+
/* @__PURE__ */ jsx17(Splitter.Panel, { children: /* @__PURE__ */ jsx17("div", { className: styles.rightPanel, children: renderContent() }) })
|
|
2668
2630
|
] }) });
|
|
2669
2631
|
};
|
|
2670
2632
|
|
|
@@ -2677,11 +2639,11 @@ import {
|
|
|
2677
2639
|
Typography as Typography7,
|
|
2678
2640
|
Row,
|
|
2679
2641
|
Col,
|
|
2680
|
-
Button as
|
|
2642
|
+
Button as Button5
|
|
2681
2643
|
} from "antd";
|
|
2682
2644
|
import dayjs from "dayjs";
|
|
2683
|
-
import { useState as
|
|
2684
|
-
import { jsx as
|
|
2645
|
+
import { useState as useState12 } from "react";
|
|
2646
|
+
import { jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2685
2647
|
var AttachmentsCard = ({
|
|
2686
2648
|
data,
|
|
2687
2649
|
component_key,
|
|
@@ -2689,8 +2651,8 @@ var AttachmentsCard = ({
|
|
|
2689
2651
|
columns = 1,
|
|
2690
2652
|
showDownloadButton = false
|
|
2691
2653
|
}) => {
|
|
2692
|
-
const { Text:
|
|
2693
|
-
const [showAll, setShowAll] =
|
|
2654
|
+
const { Text: Text14 } = Typography7;
|
|
2655
|
+
const [showAll, setShowAll] = useState12(false);
|
|
2694
2656
|
const { openSideApp } = useChatUIContext();
|
|
2695
2657
|
const getStyles = () => {
|
|
2696
2658
|
switch (size) {
|
|
@@ -2749,7 +2711,7 @@ var AttachmentsCard = ({
|
|
|
2749
2711
|
};
|
|
2750
2712
|
const DownloadButton = ({ item }) => {
|
|
2751
2713
|
if (!showDownloadButton) return null;
|
|
2752
|
-
return /* @__PURE__ */
|
|
2714
|
+
return /* @__PURE__ */ jsx18(
|
|
2753
2715
|
"div",
|
|
2754
2716
|
{
|
|
2755
2717
|
style: {
|
|
@@ -2763,8 +2725,8 @@ var AttachmentsCard = ({
|
|
|
2763
2725
|
}
|
|
2764
2726
|
);
|
|
2765
2727
|
};
|
|
2766
|
-
const renderFileDescription = (item) => /* @__PURE__ */
|
|
2767
|
-
|
|
2728
|
+
const renderFileDescription = (item) => /* @__PURE__ */ jsx18(Space7, { direction: "vertical", size: size === "small" ? 2 : 4, children: /* @__PURE__ */ jsx18(Space7, { children: /* @__PURE__ */ jsx18(
|
|
2729
|
+
Text14,
|
|
2768
2730
|
{
|
|
2769
2731
|
type: "secondary",
|
|
2770
2732
|
style: {
|
|
@@ -2778,7 +2740,7 @@ var AttachmentsCard = ({
|
|
|
2778
2740
|
const shouldShowViewMore2 = displayData2.length > 4;
|
|
2779
2741
|
const visibleData2 = showAll ? displayData2 : displayData2.slice(0, 4);
|
|
2780
2742
|
return /* @__PURE__ */ jsxs9(Flex3, { vertical: true, gap: "small", children: [
|
|
2781
|
-
/* @__PURE__ */
|
|
2743
|
+
/* @__PURE__ */ jsx18(Row, { gutter: [8, 8], children: visibleData2.map((item) => /* @__PURE__ */ jsx18(Col, { span: 24 / columns, children: /* @__PURE__ */ jsx18(
|
|
2782
2744
|
"div",
|
|
2783
2745
|
{
|
|
2784
2746
|
onClick: (evt) => {
|
|
@@ -2786,8 +2748,8 @@ var AttachmentsCard = ({
|
|
|
2786
2748
|
handleItemClick(item);
|
|
2787
2749
|
},
|
|
2788
2750
|
children: /* @__PURE__ */ jsxs9(Card4, { size: styles.cardSize, style: getCardStyle(item), children: [
|
|
2789
|
-
/* @__PURE__ */
|
|
2790
|
-
/* @__PURE__ */
|
|
2751
|
+
/* @__PURE__ */ jsx18(DownloadButton, { item }),
|
|
2752
|
+
/* @__PURE__ */ jsx18(
|
|
2791
2753
|
FileCard,
|
|
2792
2754
|
{
|
|
2793
2755
|
style: getFileCardStyle(item),
|
|
@@ -2796,7 +2758,7 @@ var AttachmentsCard = ({
|
|
|
2796
2758
|
description: renderFileDescription(item)
|
|
2797
2759
|
}
|
|
2798
2760
|
),
|
|
2799
|
-
item.files && /* @__PURE__ */
|
|
2761
|
+
item.files && /* @__PURE__ */ jsx18(
|
|
2800
2762
|
AttachmentsCard,
|
|
2801
2763
|
{
|
|
2802
2764
|
data: item.files,
|
|
@@ -2809,8 +2771,8 @@ var AttachmentsCard = ({
|
|
|
2809
2771
|
] })
|
|
2810
2772
|
}
|
|
2811
2773
|
) }, item.id)) }),
|
|
2812
|
-
shouldShowViewMore2 && /* @__PURE__ */
|
|
2813
|
-
|
|
2774
|
+
shouldShowViewMore2 && /* @__PURE__ */ jsx18(
|
|
2775
|
+
Button5,
|
|
2814
2776
|
{
|
|
2815
2777
|
type: "link",
|
|
2816
2778
|
onClick: () => setShowAll(!showAll),
|
|
@@ -2824,9 +2786,9 @@ var AttachmentsCard = ({
|
|
|
2824
2786
|
const shouldShowViewMore = displayData.length > 4;
|
|
2825
2787
|
const visibleData = showAll ? displayData : displayData.slice(0, 4);
|
|
2826
2788
|
return /* @__PURE__ */ jsxs9(Flex3, { vertical: true, gap: size === "small" ? "small" : "middle", children: [
|
|
2827
|
-
visibleData.map((item) => /* @__PURE__ */
|
|
2828
|
-
/* @__PURE__ */
|
|
2829
|
-
/* @__PURE__ */
|
|
2789
|
+
visibleData.map((item) => /* @__PURE__ */ jsx18("div", { onClick: () => handleItemClick(item), children: /* @__PURE__ */ jsxs9(Card4, { size: styles.cardSize, style: getCardStyle(item), children: [
|
|
2790
|
+
/* @__PURE__ */ jsx18(DownloadButton, { item }),
|
|
2791
|
+
/* @__PURE__ */ jsx18(
|
|
2830
2792
|
FileCard,
|
|
2831
2793
|
{
|
|
2832
2794
|
style: getFileCardStyle(item),
|
|
@@ -2836,12 +2798,12 @@ var AttachmentsCard = ({
|
|
|
2836
2798
|
}
|
|
2837
2799
|
),
|
|
2838
2800
|
item.files && /* @__PURE__ */ jsxs9("div", { style: { paddingLeft: "12px" }, children: [
|
|
2839
|
-
/* @__PURE__ */ jsxs9(
|
|
2801
|
+
/* @__PURE__ */ jsxs9(Text14, { type: "secondary", style: { fontSize: "12px" }, children: [
|
|
2840
2802
|
"\u5305\u542B\u6587\u4EF6(",
|
|
2841
2803
|
item.files.length,
|
|
2842
2804
|
")"
|
|
2843
2805
|
] }),
|
|
2844
|
-
/* @__PURE__ */
|
|
2806
|
+
/* @__PURE__ */ jsx18(
|
|
2845
2807
|
AttachmentsCard,
|
|
2846
2808
|
{
|
|
2847
2809
|
data: item.files,
|
|
@@ -2853,8 +2815,8 @@ var AttachmentsCard = ({
|
|
|
2853
2815
|
)
|
|
2854
2816
|
] })
|
|
2855
2817
|
] }) }, item.id)),
|
|
2856
|
-
shouldShowViewMore && /* @__PURE__ */
|
|
2857
|
-
|
|
2818
|
+
shouldShowViewMore && /* @__PURE__ */ jsx18(
|
|
2819
|
+
Button5,
|
|
2858
2820
|
{
|
|
2859
2821
|
type: "link",
|
|
2860
2822
|
size: "small",
|
|
@@ -2870,18 +2832,18 @@ var AttachmentsCard = ({
|
|
|
2870
2832
|
};
|
|
2871
2833
|
|
|
2872
2834
|
// src/components/GenUI/elements/attachments_viewer_side_app.tsx
|
|
2873
|
-
import { Button as
|
|
2874
|
-
import { useState as
|
|
2875
|
-
import { Fragment as Fragment2, jsx as
|
|
2835
|
+
import { Button as Button6, Empty as Empty2, Skeleton } from "antd";
|
|
2836
|
+
import { useState as useState13 } from "react";
|
|
2837
|
+
import { Fragment as Fragment2, jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2876
2838
|
function AttachmentsViewerSideApp({
|
|
2877
2839
|
data,
|
|
2878
2840
|
component_key
|
|
2879
2841
|
}) {
|
|
2880
|
-
const [fileUri, setFileUri] =
|
|
2881
|
-
const [loading, setLoading] =
|
|
2882
|
-
const { file_id } = data ?? {};
|
|
2842
|
+
const [fileUri, setFileUri] = useState13();
|
|
2843
|
+
const [loading, setLoading] = useState13(false);
|
|
2844
|
+
const { file_id, url } = data ?? {};
|
|
2883
2845
|
if (loading) {
|
|
2884
|
-
return /* @__PURE__ */
|
|
2846
|
+
return /* @__PURE__ */ jsx19(Skeleton, { active: true });
|
|
2885
2847
|
}
|
|
2886
2848
|
const canPreviewInIframe = (fileName) => {
|
|
2887
2849
|
if (!fileName) return false;
|
|
@@ -2916,18 +2878,18 @@ function AttachmentsViewerSideApp({
|
|
|
2916
2878
|
return previewableExtensions.includes(extension);
|
|
2917
2879
|
};
|
|
2918
2880
|
const isPreviewable = fileUri?.fileName ? canPreviewInIframe(fileUri.fileName) : false;
|
|
2919
|
-
return isPreviewable ? /* @__PURE__ */
|
|
2881
|
+
return isPreviewable || url ? /* @__PURE__ */ jsx19(
|
|
2920
2882
|
"iframe",
|
|
2921
2883
|
{
|
|
2922
2884
|
style: { width: "100%", height: "100%", border: 0 },
|
|
2923
|
-
src: fileUri?.url
|
|
2885
|
+
src: fileUri?.url || url
|
|
2924
2886
|
}
|
|
2925
|
-
) : /* @__PURE__ */
|
|
2887
|
+
) : /* @__PURE__ */ jsx19(
|
|
2926
2888
|
Empty2,
|
|
2927
2889
|
{
|
|
2928
2890
|
description: /* @__PURE__ */ jsxs10(Fragment2, { children: [
|
|
2929
|
-
/* @__PURE__ */
|
|
2930
|
-
/* @__PURE__ */ jsxs10(
|
|
2891
|
+
/* @__PURE__ */ jsx19("div", { children: "\u6682\u65F6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u8BF7\u4E0B\u8F7D\u540E\u67E5\u770B\u3002" }),
|
|
2892
|
+
/* @__PURE__ */ jsxs10(Button6, { type: "link", href: fileUri?.url, download: fileUri?.fileName, children: [
|
|
2931
2893
|
"\u4E0B\u8F7D",
|
|
2932
2894
|
fileUri?.fileName
|
|
2933
2895
|
] })
|
|
@@ -2938,15 +2900,15 @@ function AttachmentsViewerSideApp({
|
|
|
2938
2900
|
}
|
|
2939
2901
|
|
|
2940
2902
|
// src/components/GenUI/elements/WriteFile.tsx
|
|
2941
|
-
import { Button as
|
|
2903
|
+
import { Button as Button7, Space as Space8, Typography as Typography8 } from "antd";
|
|
2942
2904
|
|
|
2943
2905
|
// src/components/GenUI/elements/ContentPreviewCollapse.tsx
|
|
2944
|
-
import { useRef as useRef6, useState as
|
|
2906
|
+
import { useRef as useRef6, useState as useState14, useEffect as useEffect8, useCallback as useCallback6 } from "react";
|
|
2945
2907
|
import { Collapse as Collapse4 } from "antd";
|
|
2946
2908
|
import { createStyles as createStyles6 } from "antd-style";
|
|
2947
|
-
import { DownOutlined as
|
|
2909
|
+
import { DownOutlined as DownOutlined3, UpOutlined as UpOutlined2 } from "@ant-design/icons";
|
|
2948
2910
|
import CollapsePanel3 from "antd/es/collapse/CollapsePanel";
|
|
2949
|
-
import { Fragment as Fragment3, jsx as
|
|
2911
|
+
import { Fragment as Fragment3, jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2950
2912
|
var DEFAULT_COLLAPSED_MAX_HEIGHT = 180;
|
|
2951
2913
|
var DEFAULT_EXPANDED_MAX_HEIGHT = 500;
|
|
2952
2914
|
var useStyle4 = createStyles6(
|
|
@@ -3011,8 +2973,8 @@ var ContentPreviewCollapse = ({
|
|
|
3011
2973
|
showAllText = "Show all content",
|
|
3012
2974
|
showLessText = "Show less"
|
|
3013
2975
|
}) => {
|
|
3014
|
-
const [showFullContent, setShowFullContent] =
|
|
3015
|
-
const [isOverflowing, setIsOverflowing] =
|
|
2976
|
+
const [showFullContent, setShowFullContent] = useState14(false);
|
|
2977
|
+
const [isOverflowing, setIsOverflowing] = useState14(false);
|
|
3016
2978
|
const contentRef = useRef6(null);
|
|
3017
2979
|
const showShadow = isOverflowing && !showFullContent;
|
|
3018
2980
|
const { styles, cx } = useStyle4({ showShadow });
|
|
@@ -3038,7 +3000,7 @@ var ContentPreviewCollapse = ({
|
|
|
3038
3000
|
e.stopPropagation();
|
|
3039
3001
|
setShowFullContent(!showFullContent);
|
|
3040
3002
|
};
|
|
3041
|
-
return /* @__PURE__ */
|
|
3003
|
+
return /* @__PURE__ */ jsx20(
|
|
3042
3004
|
Collapse4,
|
|
3043
3005
|
{
|
|
3044
3006
|
className: styles.collapse,
|
|
@@ -3053,22 +3015,22 @@ var ContentPreviewCollapse = ({
|
|
|
3053
3015
|
extra,
|
|
3054
3016
|
style: { minWidth },
|
|
3055
3017
|
children: [
|
|
3056
|
-
/* @__PURE__ */
|
|
3018
|
+
/* @__PURE__ */ jsx20(
|
|
3057
3019
|
"div",
|
|
3058
3020
|
{
|
|
3059
3021
|
className: cx(styles.contentContainer, showFullContent && "expanded"),
|
|
3060
3022
|
style: {
|
|
3061
3023
|
maxHeight: showFullContent ? expandedMaxHeight : collapsedMaxHeight
|
|
3062
3024
|
},
|
|
3063
|
-
children: /* @__PURE__ */
|
|
3025
|
+
children: /* @__PURE__ */ jsx20("div", { ref: contentRef, className: styles.content, children })
|
|
3064
3026
|
}
|
|
3065
3027
|
),
|
|
3066
|
-
isOverflowing && /* @__PURE__ */
|
|
3067
|
-
/* @__PURE__ */
|
|
3068
|
-
/* @__PURE__ */
|
|
3028
|
+
isOverflowing && /* @__PURE__ */ jsx20("div", { className: styles.toggleButton, onClick: handleToggleContent, children: showFullContent ? /* @__PURE__ */ jsxs11(Fragment3, { children: [
|
|
3029
|
+
/* @__PURE__ */ jsx20(UpOutlined2, { style: { fontSize: 10 } }),
|
|
3030
|
+
/* @__PURE__ */ jsx20("span", { children: showLessText })
|
|
3069
3031
|
] }) : /* @__PURE__ */ jsxs11(Fragment3, { children: [
|
|
3070
|
-
/* @__PURE__ */
|
|
3071
|
-
/* @__PURE__ */
|
|
3032
|
+
/* @__PURE__ */ jsx20(DownOutlined3, { style: { fontSize: 10 } }),
|
|
3033
|
+
/* @__PURE__ */ jsx20("span", { children: showAllText })
|
|
3072
3034
|
] }) })
|
|
3073
3035
|
]
|
|
3074
3036
|
},
|
|
@@ -3079,7 +3041,7 @@ var ContentPreviewCollapse = ({
|
|
|
3079
3041
|
};
|
|
3080
3042
|
|
|
3081
3043
|
// src/components/GenUI/elements/WriteFile.tsx
|
|
3082
|
-
import { jsx as
|
|
3044
|
+
import { jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3083
3045
|
var { Text: Text6 } = Typography8;
|
|
3084
3046
|
var WriteFile = ({
|
|
3085
3047
|
data,
|
|
@@ -3094,8 +3056,8 @@ var WriteFile = ({
|
|
|
3094
3056
|
}
|
|
3095
3057
|
const expandIcon = () => getFileIcon(file_path);
|
|
3096
3058
|
const header = /* @__PURE__ */ jsxs12(Space8, { children: [
|
|
3097
|
-
/* @__PURE__ */
|
|
3098
|
-
/* @__PURE__ */
|
|
3059
|
+
/* @__PURE__ */ jsx21(Text6, { strong: true, children: "New" }),
|
|
3060
|
+
/* @__PURE__ */ jsx21(Text6, { title: file_path, children: file_path?.split("/")?.pop() || "" })
|
|
3099
3061
|
] });
|
|
3100
3062
|
const handleItemClick = (toolCallData2) => {
|
|
3101
3063
|
openSideApp({
|
|
@@ -3107,14 +3069,14 @@ var WriteFile = ({
|
|
|
3107
3069
|
}
|
|
3108
3070
|
});
|
|
3109
3071
|
};
|
|
3110
|
-
return /* @__PURE__ */
|
|
3072
|
+
return /* @__PURE__ */ jsx21(
|
|
3111
3073
|
ContentPreviewCollapse,
|
|
3112
3074
|
{
|
|
3113
3075
|
panelKey: toolCallData.id,
|
|
3114
3076
|
header,
|
|
3115
3077
|
expandIcon,
|
|
3116
|
-
extra: /* @__PURE__ */
|
|
3117
|
-
|
|
3078
|
+
extra: /* @__PURE__ */ jsx21(
|
|
3079
|
+
Button7,
|
|
3118
3080
|
{
|
|
3119
3081
|
type: "link",
|
|
3120
3082
|
size: "small",
|
|
@@ -3125,7 +3087,7 @@ var WriteFile = ({
|
|
|
3125
3087
|
children: "Diff View"
|
|
3126
3088
|
}
|
|
3127
3089
|
),
|
|
3128
|
-
children: /* @__PURE__ */
|
|
3090
|
+
children: /* @__PURE__ */ jsx21(MDResponse, { content })
|
|
3129
3091
|
}
|
|
3130
3092
|
);
|
|
3131
3093
|
};
|
|
@@ -3133,10 +3095,10 @@ var WriteFile = ({
|
|
|
3133
3095
|
// src/components/GenUI/elements/file_content_diff_view.tsx
|
|
3134
3096
|
import ReactDiffViewer from "@alexbruf/react-diff-viewer";
|
|
3135
3097
|
import "@alexbruf/react-diff-viewer/index.css";
|
|
3136
|
-
import { jsx as
|
|
3098
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
3137
3099
|
var FileContentDiffView = ({ data, interactive = true, default_open_in_side_app = true }) => {
|
|
3138
3100
|
const { old_code, new_code } = data;
|
|
3139
|
-
return /* @__PURE__ */
|
|
3101
|
+
return /* @__PURE__ */ jsx22(
|
|
3140
3102
|
ReactDiffViewer,
|
|
3141
3103
|
{
|
|
3142
3104
|
oldValue: old_code,
|
|
@@ -3147,8 +3109,8 @@ var FileContentDiffView = ({ data, interactive = true, default_open_in_side_app
|
|
|
3147
3109
|
};
|
|
3148
3110
|
|
|
3149
3111
|
// src/components/GenUI/elements/EditFile.tsx
|
|
3150
|
-
import { Button as
|
|
3151
|
-
import { jsx as
|
|
3112
|
+
import { Button as Button8, Space as Space9, Typography as Typography9 } from "antd";
|
|
3113
|
+
import { jsx as jsx23, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3152
3114
|
var { Text: Text7 } = Typography9;
|
|
3153
3115
|
var EditFile = ({
|
|
3154
3116
|
data,
|
|
@@ -3163,8 +3125,8 @@ var EditFile = ({
|
|
|
3163
3125
|
}
|
|
3164
3126
|
const expandIcon = () => getFileIcon(file_path);
|
|
3165
3127
|
const header = /* @__PURE__ */ jsxs13(Space9, { children: [
|
|
3166
|
-
/* @__PURE__ */
|
|
3167
|
-
/* @__PURE__ */
|
|
3128
|
+
/* @__PURE__ */ jsx23(Text7, { strong: true, children: "Edit" }),
|
|
3129
|
+
/* @__PURE__ */ jsx23(Text7, { title: file_path, children: file_path?.split("/")?.pop() || "" })
|
|
3168
3130
|
] });
|
|
3169
3131
|
const handleItemClick = (toolCallData2) => {
|
|
3170
3132
|
openSideApp({
|
|
@@ -3176,14 +3138,14 @@ var EditFile = ({
|
|
|
3176
3138
|
}
|
|
3177
3139
|
});
|
|
3178
3140
|
};
|
|
3179
|
-
return /* @__PURE__ */
|
|
3141
|
+
return /* @__PURE__ */ jsx23(
|
|
3180
3142
|
ContentPreviewCollapse,
|
|
3181
3143
|
{
|
|
3182
3144
|
panelKey: toolCallData.id,
|
|
3183
3145
|
header,
|
|
3184
3146
|
expandIcon,
|
|
3185
|
-
extra: /* @__PURE__ */
|
|
3186
|
-
|
|
3147
|
+
extra: /* @__PURE__ */ jsx23(
|
|
3148
|
+
Button8,
|
|
3187
3149
|
{
|
|
3188
3150
|
type: "link",
|
|
3189
3151
|
size: "small",
|
|
@@ -3194,7 +3156,7 @@ var EditFile = ({
|
|
|
3194
3156
|
children: "Diff View"
|
|
3195
3157
|
}
|
|
3196
3158
|
),
|
|
3197
|
-
children: /* @__PURE__ */
|
|
3159
|
+
children: /* @__PURE__ */ jsx23(MDResponse, { content: new_string })
|
|
3198
3160
|
}
|
|
3199
3161
|
);
|
|
3200
3162
|
};
|
|
@@ -3210,7 +3172,7 @@ import {
|
|
|
3210
3172
|
RightOutlined as RightOutlined2,
|
|
3211
3173
|
CarryOutOutlined
|
|
3212
3174
|
} from "@ant-design/icons";
|
|
3213
|
-
import { jsx as
|
|
3175
|
+
import { jsx as jsx24, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3214
3176
|
var { Text: Text8 } = Typography10;
|
|
3215
3177
|
var useStyle5 = createStyles7(({ token, css }) => ({
|
|
3216
3178
|
card: css`
|
|
@@ -3378,14 +3340,14 @@ var TaskCard = ({
|
|
|
3378
3340
|
switch (status2) {
|
|
3379
3341
|
case "success":
|
|
3380
3342
|
return {
|
|
3381
|
-
icon: /* @__PURE__ */
|
|
3343
|
+
icon: /* @__PURE__ */ jsx24(CheckCircleOutlined3, { style: { fontSize: 16 } }),
|
|
3382
3344
|
color: "success",
|
|
3383
3345
|
text: "Completed",
|
|
3384
3346
|
bgColor: "rgba(82, 196, 26, 0.1)"
|
|
3385
3347
|
};
|
|
3386
3348
|
case "error":
|
|
3387
3349
|
return {
|
|
3388
|
-
icon: /* @__PURE__ */
|
|
3350
|
+
icon: /* @__PURE__ */ jsx24(CloseCircleOutlined, { style: { fontSize: 16 } }),
|
|
3389
3351
|
color: "error",
|
|
3390
3352
|
text: "Failed",
|
|
3391
3353
|
bgColor: "rgba(255, 77, 79, 0.1)"
|
|
@@ -3393,7 +3355,7 @@ var TaskCard = ({
|
|
|
3393
3355
|
case "pending":
|
|
3394
3356
|
default:
|
|
3395
3357
|
return {
|
|
3396
|
-
icon: /* @__PURE__ */
|
|
3358
|
+
icon: /* @__PURE__ */ jsx24(LoadingOutlined2, { style: { fontSize: 16 } }),
|
|
3397
3359
|
color: "processing",
|
|
3398
3360
|
text: "In Progress",
|
|
3399
3361
|
bgColor: "rgba(24, 144, 255, 0.1)"
|
|
@@ -3413,7 +3375,7 @@ var TaskCard = ({
|
|
|
3413
3375
|
}
|
|
3414
3376
|
});
|
|
3415
3377
|
};
|
|
3416
|
-
return /* @__PURE__ */
|
|
3378
|
+
return /* @__PURE__ */ jsx24(
|
|
3417
3379
|
Card5,
|
|
3418
3380
|
{
|
|
3419
3381
|
size: "small",
|
|
@@ -3423,27 +3385,27 @@ var TaskCard = ({
|
|
|
3423
3385
|
hoverable: interactive,
|
|
3424
3386
|
bodyStyle: { padding: 0 },
|
|
3425
3387
|
children: /* @__PURE__ */ jsxs14("div", { className: styles.cardBody, children: [
|
|
3426
|
-
/* @__PURE__ */
|
|
3427
|
-
/* @__PURE__ */
|
|
3388
|
+
/* @__PURE__ */ jsx24("div", { className: styles.header, children: /* @__PURE__ */ jsxs14("div", { className: styles.titleSection, children: [
|
|
3389
|
+
/* @__PURE__ */ jsx24("div", { className: styles.iconWrapper, children: /* @__PURE__ */ jsx24(CarryOutOutlined, { style: { fontSize: 20, color: "#1890ff" } }) }),
|
|
3428
3390
|
/* @__PURE__ */ jsxs14("div", { className: styles.titleContent, children: [
|
|
3429
|
-
subagent_type && /* @__PURE__ */
|
|
3430
|
-
description && /* @__PURE__ */
|
|
3391
|
+
subagent_type && /* @__PURE__ */ jsx24("div", { className: styles.taskType, children: subagent_type }),
|
|
3392
|
+
description && /* @__PURE__ */ jsx24(Text8, { className: styles.description, children: description })
|
|
3431
3393
|
] })
|
|
3432
3394
|
] }) }),
|
|
3433
3395
|
/* @__PURE__ */ jsxs14("div", { className: styles.footer, children: [
|
|
3434
3396
|
/* @__PURE__ */ jsxs14("div", { className: styles.footerLeft, children: [
|
|
3435
3397
|
assignee && /* @__PURE__ */ jsxs14("div", { className: styles.assigneeContainer, children: [
|
|
3436
|
-
/* @__PURE__ */
|
|
3398
|
+
/* @__PURE__ */ jsx24(
|
|
3437
3399
|
Avatar,
|
|
3438
3400
|
{
|
|
3439
3401
|
size: 24,
|
|
3440
|
-
icon: /* @__PURE__ */
|
|
3402
|
+
icon: /* @__PURE__ */ jsx24(UserOutlined, {}),
|
|
3441
3403
|
className: styles.assigneeAvatar
|
|
3442
3404
|
}
|
|
3443
3405
|
),
|
|
3444
|
-
/* @__PURE__ */
|
|
3406
|
+
/* @__PURE__ */ jsx24(Text8, { className: styles.assigneeName, children: assignee })
|
|
3445
3407
|
] }),
|
|
3446
|
-
/* @__PURE__ */
|
|
3408
|
+
/* @__PURE__ */ jsx24(
|
|
3447
3409
|
Tag3,
|
|
3448
3410
|
{
|
|
3449
3411
|
icon: statusConfig.icon,
|
|
@@ -3461,7 +3423,7 @@ var TaskCard = ({
|
|
|
3461
3423
|
}
|
|
3462
3424
|
)
|
|
3463
3425
|
] }),
|
|
3464
|
-
interactive && /* @__PURE__ */
|
|
3426
|
+
interactive && /* @__PURE__ */ jsx24(RightOutlined2, { className: styles.actionIcon })
|
|
3465
3427
|
] }),
|
|
3466
3428
|
showResponse && /* @__PURE__ */ jsxs14(
|
|
3467
3429
|
"div",
|
|
@@ -3469,8 +3431,8 @@ var TaskCard = ({
|
|
|
3469
3431
|
className: styles.responseSection,
|
|
3470
3432
|
onClick: (e) => e.stopPropagation(),
|
|
3471
3433
|
children: [
|
|
3472
|
-
/* @__PURE__ */
|
|
3473
|
-
/* @__PURE__ */
|
|
3434
|
+
/* @__PURE__ */ jsx24(Text8, { className: styles.responseHeader, children: "Response" }),
|
|
3435
|
+
/* @__PURE__ */ jsx24("div", { className: styles.responseContent, children: /* @__PURE__ */ jsx24(MDResponse, { content: response }) })
|
|
3474
3436
|
]
|
|
3475
3437
|
}
|
|
3476
3438
|
)
|
|
@@ -3502,19 +3464,19 @@ import {
|
|
|
3502
3464
|
memo,
|
|
3503
3465
|
useCallback as useCallback7,
|
|
3504
3466
|
useEffect as useEffect9,
|
|
3505
|
-
useMemo as
|
|
3467
|
+
useMemo as useMemo3,
|
|
3506
3468
|
useRef as useRef7,
|
|
3507
|
-
useState as
|
|
3469
|
+
useState as useState15
|
|
3508
3470
|
} from "react";
|
|
3509
|
-
import { jsx as
|
|
3471
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
3510
3472
|
var LazyBubble = ({
|
|
3511
3473
|
message: message5,
|
|
3512
3474
|
renderContent,
|
|
3513
3475
|
autoLoadRightPanel
|
|
3514
3476
|
}) => {
|
|
3515
3477
|
const ref = useRef7(null);
|
|
3516
|
-
const [isVisible, setIsVisible] =
|
|
3517
|
-
const [wasEverVisible, setWasEverVisible] =
|
|
3478
|
+
const [isVisible, setIsVisible] = useState15(false);
|
|
3479
|
+
const [wasEverVisible, setWasEverVisible] = useState15(false);
|
|
3518
3480
|
useEffect9(() => {
|
|
3519
3481
|
const observer = new IntersectionObserver(
|
|
3520
3482
|
([entry]) => {
|
|
@@ -3540,16 +3502,16 @@ var LazyBubble = ({
|
|
|
3540
3502
|
}, []);
|
|
3541
3503
|
const getPlaceholder = () => {
|
|
3542
3504
|
const estimatedHeight = message5.content ? Math.min(100, message5.content.length / 5) : 100;
|
|
3543
|
-
return /* @__PURE__ */
|
|
3505
|
+
return /* @__PURE__ */ jsx25("div", { style: { height: `${estimatedHeight}px`, minHeight: "50px" } });
|
|
3544
3506
|
};
|
|
3545
|
-
return /* @__PURE__ */
|
|
3507
|
+
return /* @__PURE__ */ jsx25(ErrorBoundary, { children: /* @__PURE__ */ jsx25("div", { ref, style: { width: "100%" }, children: isVisible || wasEverVisible ? renderContent(message5) : getPlaceholder() }) });
|
|
3546
3508
|
};
|
|
3547
3509
|
var MemoizedBubbleList = memo(
|
|
3548
3510
|
({
|
|
3549
3511
|
items,
|
|
3550
3512
|
role,
|
|
3551
3513
|
className
|
|
3552
|
-
}) => /* @__PURE__ */
|
|
3514
|
+
}) => /* @__PURE__ */ jsx25(
|
|
3553
3515
|
Bubble.List,
|
|
3554
3516
|
{
|
|
3555
3517
|
autoScroll: true,
|
|
@@ -3578,7 +3540,7 @@ var MessageList = ({
|
|
|
3578
3540
|
try {
|
|
3579
3541
|
const json = JSON.parse(content);
|
|
3580
3542
|
if (json.action && json.message) {
|
|
3581
|
-
return /* @__PURE__ */
|
|
3543
|
+
return /* @__PURE__ */ jsx25(MDResponse, { content: json.message });
|
|
3582
3544
|
}
|
|
3583
3545
|
} catch (error) {
|
|
3584
3546
|
}
|
|
@@ -3588,14 +3550,14 @@ ${JSON.stringify(tool_call)}
|
|
|
3588
3550
|
\`\`\``;
|
|
3589
3551
|
}) || [];
|
|
3590
3552
|
const content_md = [content, ...tool_calls_md].join("\n");
|
|
3591
|
-
return /* @__PURE__ */
|
|
3553
|
+
return /* @__PURE__ */ jsx25(Space10, { direction: "vertical", style: { width: "100%" }, children: /* @__PURE__ */ jsx25(MDResponse, { content: content_md }) });
|
|
3592
3554
|
}, []);
|
|
3593
|
-
const items =
|
|
3555
|
+
const items = useMemo3(
|
|
3594
3556
|
() => messages.map((message5, index) => ({
|
|
3595
3557
|
key: message5.id,
|
|
3596
3558
|
role: message5.role,
|
|
3597
3559
|
typing: false,
|
|
3598
|
-
content: /* @__PURE__ */
|
|
3560
|
+
content: /* @__PURE__ */ jsx25(
|
|
3599
3561
|
LazyBubble,
|
|
3600
3562
|
{
|
|
3601
3563
|
message: message5,
|
|
@@ -3655,9 +3617,9 @@ ${JSON.stringify(tool_call)}
|
|
|
3655
3617
|
}
|
|
3656
3618
|
};
|
|
3657
3619
|
if (items.length === 0) {
|
|
3658
|
-
return /* @__PURE__ */
|
|
3620
|
+
return /* @__PURE__ */ jsx25("div", { style: { flex: 1 } });
|
|
3659
3621
|
}
|
|
3660
|
-
return /* @__PURE__ */
|
|
3622
|
+
return /* @__PURE__ */ jsx25(
|
|
3661
3623
|
MemoizedBubbleList,
|
|
3662
3624
|
{
|
|
3663
3625
|
items,
|
|
@@ -3671,10 +3633,10 @@ ${JSON.stringify(tool_call)}
|
|
|
3671
3633
|
import {
|
|
3672
3634
|
Alert as Alert2,
|
|
3673
3635
|
Badge as Badge2,
|
|
3674
|
-
Button as
|
|
3636
|
+
Button as Button11,
|
|
3675
3637
|
message as message3
|
|
3676
3638
|
} from "antd";
|
|
3677
|
-
import React6, { useEffect as useEffect10, useRef as useRef8, useState as
|
|
3639
|
+
import React6, { useEffect as useEffect10, useRef as useRef8, useState as useState16 } from "react";
|
|
3678
3640
|
|
|
3679
3641
|
// src/components/GenUI/HITLContainer.tsx
|
|
3680
3642
|
import {
|
|
@@ -3685,7 +3647,7 @@ import {
|
|
|
3685
3647
|
} from "antd";
|
|
3686
3648
|
import { createStyles as createStyles8 } from "antd-style";
|
|
3687
3649
|
import CollapsePanel4 from "antd/es/collapse/CollapsePanel";
|
|
3688
|
-
import { jsx as
|
|
3650
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
3689
3651
|
var { Text: Text9 } = Typography11;
|
|
3690
3652
|
var useStyle6 = createStyles8(({ token, css }) => ({
|
|
3691
3653
|
card: css`
|
|
@@ -3701,18 +3663,18 @@ var useStyle6 = createStyles8(({ token, css }) => ({
|
|
|
3701
3663
|
var HITLContainer = () => {
|
|
3702
3664
|
const { styles } = useStyle6();
|
|
3703
3665
|
const { interrupts } = useAgentChat();
|
|
3704
|
-
return interrupts && interrupts.length > 0 ? /* @__PURE__ */
|
|
3666
|
+
return interrupts && interrupts.length > 0 ? /* @__PURE__ */ jsx26(
|
|
3705
3667
|
Collapse5,
|
|
3706
3668
|
{
|
|
3707
3669
|
className: styles.card,
|
|
3708
3670
|
size: "small",
|
|
3709
3671
|
bordered: false,
|
|
3710
3672
|
defaultActiveKey: ["hitl"],
|
|
3711
|
-
children: /* @__PURE__ */
|
|
3673
|
+
children: /* @__PURE__ */ jsx26(
|
|
3712
3674
|
CollapsePanel4,
|
|
3713
3675
|
{
|
|
3714
3676
|
showArrow: false,
|
|
3715
|
-
header: /* @__PURE__ */
|
|
3677
|
+
header: /* @__PURE__ */ jsx26(
|
|
3716
3678
|
Tag4,
|
|
3717
3679
|
{
|
|
3718
3680
|
bordered: false,
|
|
@@ -3727,7 +3689,7 @@ var HITLContainer = () => {
|
|
|
3727
3689
|
children: "\u7B49\u5F85\u53CD\u9988"
|
|
3728
3690
|
}
|
|
3729
3691
|
),
|
|
3730
|
-
children: /* @__PURE__ */
|
|
3692
|
+
children: /* @__PURE__ */ jsx26(Space11, { direction: "vertical", style: { width: "100%" }, children: interrupts.map((interrupt) => /* @__PURE__ */ jsx26(MDResponse, { content: interrupt.value }, interrupt.id)) })
|
|
3731
3693
|
},
|
|
3732
3694
|
"hitl"
|
|
3733
3695
|
)
|
|
@@ -3740,7 +3702,7 @@ import { Avatar as Avatar2, Space as Space12, Typography as Typography12 } from
|
|
|
3740
3702
|
|
|
3741
3703
|
// src/components/Chat/TodoProgress.tsx
|
|
3742
3704
|
import { Popover, Tooltip as Tooltip2, Progress } from "antd";
|
|
3743
|
-
import { jsx as
|
|
3705
|
+
import { jsx as jsx27, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3744
3706
|
var TodoProgress = ({}) => {
|
|
3745
3707
|
const { openSideApp } = useChatUIContext();
|
|
3746
3708
|
const { todos } = useAgentChat();
|
|
@@ -3753,14 +3715,14 @@ var TodoProgress = ({}) => {
|
|
|
3753
3715
|
const totalCount = todos.length;
|
|
3754
3716
|
const hasInProgress = todos.some((item) => item.status === "in_progress");
|
|
3755
3717
|
const percent = Math.round(completedCount / totalCount * 100);
|
|
3756
|
-
return /* @__PURE__ */
|
|
3718
|
+
return /* @__PURE__ */ jsx27(
|
|
3757
3719
|
Popover,
|
|
3758
3720
|
{
|
|
3759
|
-
content: /* @__PURE__ */
|
|
3721
|
+
content: /* @__PURE__ */ jsx27("div", { style: { width: 400 }, children: /* @__PURE__ */ jsx27(Todo, { data: todos, component_key: "header_todos" }) }),
|
|
3760
3722
|
title: "Todos",
|
|
3761
3723
|
trigger: "click",
|
|
3762
3724
|
placement: "bottomRight",
|
|
3763
|
-
children: /* @__PURE__ */
|
|
3725
|
+
children: /* @__PURE__ */ jsx27(Tooltip2, { title: `${completedCount} / ${totalCount} tasks completed`, children: /* @__PURE__ */ jsx27("div", { style: { cursor: "pointer", display: "inline-flex" }, children: /* @__PURE__ */ jsx27(
|
|
3764
3726
|
Progress,
|
|
3765
3727
|
{
|
|
3766
3728
|
type: "circle",
|
|
@@ -3771,7 +3733,7 @@ var TodoProgress = ({}) => {
|
|
|
3771
3733
|
percent,
|
|
3772
3734
|
status: hasInProgress ? "active" : "normal",
|
|
3773
3735
|
width: 30,
|
|
3774
|
-
format: () => /* @__PURE__ */
|
|
3736
|
+
format: () => /* @__PURE__ */ jsx27(
|
|
3775
3737
|
"div",
|
|
3776
3738
|
{
|
|
3777
3739
|
style: {
|
|
@@ -3794,9 +3756,9 @@ var TodoProgress = ({}) => {
|
|
|
3794
3756
|
};
|
|
3795
3757
|
|
|
3796
3758
|
// src/components/Chat/FileExplorerButton.tsx
|
|
3797
|
-
import { Tooltip as Tooltip3, Badge, Button as
|
|
3759
|
+
import { Tooltip as Tooltip3, Badge, Button as Button10 } from "antd";
|
|
3798
3760
|
import { FileTextOutlined as FileTextOutlined4 } from "@ant-design/icons";
|
|
3799
|
-
import { jsx as
|
|
3761
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
3800
3762
|
var FileExplorerButton = ({}) => {
|
|
3801
3763
|
const { agentState } = useAgentChat();
|
|
3802
3764
|
const { openSideApp } = useChatUIContext();
|
|
@@ -3805,11 +3767,11 @@ var FileExplorerButton = ({}) => {
|
|
|
3805
3767
|
return null;
|
|
3806
3768
|
}
|
|
3807
3769
|
const fileCount = Object.keys(files).length;
|
|
3808
|
-
return /* @__PURE__ */
|
|
3809
|
-
|
|
3770
|
+
return /* @__PURE__ */ jsx28(Tooltip3, { title: "File Explorer", children: /* @__PURE__ */ jsx28(Badge, { count: fileCount, size: "small", color: "blue", children: /* @__PURE__ */ jsx28(
|
|
3771
|
+
Button10,
|
|
3810
3772
|
{
|
|
3811
3773
|
type: "text",
|
|
3812
|
-
icon: /* @__PURE__ */
|
|
3774
|
+
icon: /* @__PURE__ */ jsx28(FileTextOutlined4, {}),
|
|
3813
3775
|
onClick: () => openSideApp({
|
|
3814
3776
|
component_key: "file_explorer",
|
|
3815
3777
|
message: "File Explorer",
|
|
@@ -3821,12 +3783,12 @@ var FileExplorerButton = ({}) => {
|
|
|
3821
3783
|
|
|
3822
3784
|
// src/components/Chat/AgentHeader.tsx
|
|
3823
3785
|
import { Welcome } from "@ant-design/x";
|
|
3824
|
-
import { useMemo as
|
|
3825
|
-
import { jsx as
|
|
3786
|
+
import { useMemo as useMemo4 } from "react";
|
|
3787
|
+
import { jsx as jsx29, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3826
3788
|
var { Text: Text10 } = Typography12;
|
|
3827
3789
|
var AgentHeader = (props) => {
|
|
3828
3790
|
const { description, avatar, name, extra, extraMeta } = props;
|
|
3829
|
-
const extraMetaComponents =
|
|
3791
|
+
const extraMetaComponents = useMemo4(() => {
|
|
3830
3792
|
if (extraMeta && extraMeta.length > 0) {
|
|
3831
3793
|
return extraMeta.map((meta) => {
|
|
3832
3794
|
const Element = getElement(meta.id)?.card_view;
|
|
@@ -3835,7 +3797,7 @@ var AgentHeader = (props) => {
|
|
|
3835
3797
|
try {
|
|
3836
3798
|
} catch (error) {
|
|
3837
3799
|
}
|
|
3838
|
-
return /* @__PURE__ */
|
|
3800
|
+
return /* @__PURE__ */ jsx29(
|
|
3839
3801
|
Element,
|
|
3840
3802
|
{
|
|
3841
3803
|
component_key: meta.id,
|
|
@@ -3849,23 +3811,23 @@ var AgentHeader = (props) => {
|
|
|
3849
3811
|
return void 0;
|
|
3850
3812
|
}, [extraMeta]);
|
|
3851
3813
|
return /* @__PURE__ */ jsxs16("div", { children: [
|
|
3852
|
-
/* @__PURE__ */
|
|
3814
|
+
/* @__PURE__ */ jsx29(
|
|
3853
3815
|
Welcome,
|
|
3854
3816
|
{
|
|
3855
3817
|
style: { padding: 8 },
|
|
3856
3818
|
variant: "borderless",
|
|
3857
|
-
description: description ? /* @__PURE__ */
|
|
3858
|
-
icon: avatar ? /* @__PURE__ */
|
|
3819
|
+
description: description ? /* @__PURE__ */ jsx29(Text10, { ellipsis: { tooltip: description }, children: description }) : void 0,
|
|
3820
|
+
icon: avatar ? /* @__PURE__ */ jsx29(Avatar2, { src: avatar, size: 48 }) : /* @__PURE__ */ jsx29(Avatar2, { size: 48, children: name?.charAt(0).toUpperCase() }),
|
|
3859
3821
|
title: name ? name : void 0,
|
|
3860
3822
|
extra: /* @__PURE__ */ jsxs16(Space12, { children: [
|
|
3861
3823
|
extra,
|
|
3862
|
-
/* @__PURE__ */
|
|
3863
|
-
/* @__PURE__ */
|
|
3864
|
-
extraMetaComponents && /* @__PURE__ */
|
|
3824
|
+
/* @__PURE__ */ jsx29(TodoProgress, {}),
|
|
3825
|
+
/* @__PURE__ */ jsx29(FileExplorerButton, {}),
|
|
3826
|
+
extraMetaComponents && /* @__PURE__ */ jsx29(Space12, { align: "center", style: { marginRight: 16 }, children: extraMetaComponents })
|
|
3865
3827
|
] })
|
|
3866
3828
|
}
|
|
3867
3829
|
),
|
|
3868
|
-
/* @__PURE__ */
|
|
3830
|
+
/* @__PURE__ */ jsx29(
|
|
3869
3831
|
"div",
|
|
3870
3832
|
{
|
|
3871
3833
|
style: {
|
|
@@ -3877,7 +3839,7 @@ var AgentHeader = (props) => {
|
|
|
3877
3839
|
};
|
|
3878
3840
|
|
|
3879
3841
|
// src/components/Chat/Chating.tsx
|
|
3880
|
-
import { Fragment as Fragment4, jsx as
|
|
3842
|
+
import { Fragment as Fragment4, jsx as jsx30, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3881
3843
|
var Chating = ({
|
|
3882
3844
|
avatar,
|
|
3883
3845
|
name,
|
|
@@ -3893,10 +3855,10 @@ var Chating = ({
|
|
|
3893
3855
|
showHITL = true,
|
|
3894
3856
|
showRefreshButton = false
|
|
3895
3857
|
}) => {
|
|
3896
|
-
const [content, setContent] =
|
|
3897
|
-
const [attachedFiles, setAttachedFiles] =
|
|
3858
|
+
const [content, setContent] = useState16("");
|
|
3859
|
+
const [attachedFiles, setAttachedFiles] = useState16([]);
|
|
3898
3860
|
const { styles } = useStyle();
|
|
3899
|
-
const [headerOpen, setHeaderOpen] =
|
|
3861
|
+
const [headerOpen, setHeaderOpen] = useState16(false);
|
|
3900
3862
|
const attachmentsRef = useRef8(null);
|
|
3901
3863
|
const senderRef = React6.useRef(null);
|
|
3902
3864
|
const {
|
|
@@ -3995,15 +3957,15 @@ var Chating = ({
|
|
|
3995
3957
|
}
|
|
3996
3958
|
return true;
|
|
3997
3959
|
};
|
|
3998
|
-
const attachmentsNode = /* @__PURE__ */
|
|
3999
|
-
|
|
3960
|
+
const attachmentsNode = /* @__PURE__ */ jsx30(Badge2, { dot: attachedFiles.length > 0 && !headerOpen, children: /* @__PURE__ */ jsx30(
|
|
3961
|
+
Button11,
|
|
4000
3962
|
{
|
|
4001
3963
|
type: "text",
|
|
4002
|
-
icon: /* @__PURE__ */
|
|
3964
|
+
icon: /* @__PURE__ */ jsx30(PaperClipOutlined, {}),
|
|
4003
3965
|
onClick: () => setHeaderOpen(!headerOpen)
|
|
4004
3966
|
}
|
|
4005
3967
|
) });
|
|
4006
|
-
const senderHeader = /* @__PURE__ */
|
|
3968
|
+
const senderHeader = /* @__PURE__ */ jsx30(
|
|
4007
3969
|
Sender.Header,
|
|
4008
3970
|
{
|
|
4009
3971
|
title: "Attachments",
|
|
@@ -4015,7 +3977,7 @@ var Chating = ({
|
|
|
4015
3977
|
}
|
|
4016
3978
|
},
|
|
4017
3979
|
forceRender: true,
|
|
4018
|
-
children: /* @__PURE__ */
|
|
3980
|
+
children: /* @__PURE__ */ jsx30(
|
|
4019
3981
|
Attachments,
|
|
4020
3982
|
{
|
|
4021
3983
|
ref: attachmentsRef,
|
|
@@ -4037,7 +3999,7 @@ var Chating = ({
|
|
|
4037
3999
|
multiple: true,
|
|
4038
4000
|
maxCount: 10,
|
|
4039
4001
|
placeholder: (type) => ({
|
|
4040
|
-
icon: /* @__PURE__ */
|
|
4002
|
+
icon: /* @__PURE__ */ jsx30(CloudUploadOutlined, {}),
|
|
4041
4003
|
title: "\u4E0A\u4F20\u6587\u4EF6",
|
|
4042
4004
|
description: attachment_placeholder
|
|
4043
4005
|
})
|
|
@@ -4045,11 +4007,11 @@ var Chating = ({
|
|
|
4045
4007
|
)
|
|
4046
4008
|
}
|
|
4047
4009
|
);
|
|
4048
|
-
const refreshButton = /* @__PURE__ */
|
|
4049
|
-
|
|
4010
|
+
const refreshButton = /* @__PURE__ */ jsx30(
|
|
4011
|
+
Button11,
|
|
4050
4012
|
{
|
|
4051
4013
|
type: "text",
|
|
4052
|
-
icon: /* @__PURE__ */
|
|
4014
|
+
icon: /* @__PURE__ */ jsx30(ReloadOutlined, {}),
|
|
4053
4015
|
onClick: () => {
|
|
4054
4016
|
loadMessages();
|
|
4055
4017
|
}
|
|
@@ -4057,7 +4019,7 @@ var Chating = ({
|
|
|
4057
4019
|
);
|
|
4058
4020
|
const headerExtra = showRefreshButton ? [refreshButton] : [];
|
|
4059
4021
|
return /* @__PURE__ */ jsxs17(Fragment4, { children: [
|
|
4060
|
-
/* @__PURE__ */
|
|
4022
|
+
/* @__PURE__ */ jsx30("div", { children: showHeader && /* @__PURE__ */ jsx30(
|
|
4061
4023
|
AgentHeader,
|
|
4062
4024
|
{
|
|
4063
4025
|
description,
|
|
@@ -4067,9 +4029,9 @@ var Chating = ({
|
|
|
4067
4029
|
extraMeta
|
|
4068
4030
|
}
|
|
4069
4031
|
) }),
|
|
4070
|
-
/* @__PURE__ */
|
|
4071
|
-
isLoading ? /* @__PURE__ */
|
|
4072
|
-
error && /* @__PURE__ */
|
|
4032
|
+
/* @__PURE__ */ jsx30(MessageList, { messages, className: styles.messages }),
|
|
4033
|
+
isLoading ? /* @__PURE__ */ jsx30("div", {}) : /* @__PURE__ */ jsx30(Prompts, { items: senderPromptsItems, onItemClick: onPromptsItemClick }),
|
|
4034
|
+
error && /* @__PURE__ */ jsx30("div", { style: { padding: "0 16px 8px" }, children: /* @__PURE__ */ jsx30(
|
|
4073
4035
|
Alert2,
|
|
4074
4036
|
{
|
|
4075
4037
|
type: "error",
|
|
@@ -4079,8 +4041,8 @@ var Chating = ({
|
|
|
4079
4041
|
message: `${error.message}`
|
|
4080
4042
|
}
|
|
4081
4043
|
) }),
|
|
4082
|
-
showHITL && /* @__PURE__ */
|
|
4083
|
-
showSender && /* @__PURE__ */
|
|
4044
|
+
showHITL && /* @__PURE__ */ jsx30(HITLContainer, {}),
|
|
4045
|
+
showSender && /* @__PURE__ */ jsx30(
|
|
4084
4046
|
Sender,
|
|
4085
4047
|
{
|
|
4086
4048
|
disabled: interrupts && interrupts.length > 0,
|
|
@@ -4106,11 +4068,11 @@ var Chating = ({
|
|
|
4106
4068
|
};
|
|
4107
4069
|
|
|
4108
4070
|
// src/components/GenUI/elements/task_detail.tsx
|
|
4109
|
-
import { jsx as
|
|
4071
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
4110
4072
|
var { Text: Text11 } = Typography13;
|
|
4111
4073
|
var TaskDetail = ({ data, component_key, interactive = true }) => {
|
|
4112
4074
|
const { description, subagent_type, thread_id } = data || {};
|
|
4113
|
-
return /* @__PURE__ */
|
|
4075
|
+
return /* @__PURE__ */ jsx31(
|
|
4114
4076
|
AgentThreadProvider,
|
|
4115
4077
|
{
|
|
4116
4078
|
threadId: thread_id,
|
|
@@ -4120,7 +4082,7 @@ var TaskDetail = ({ data, component_key, interactive = true }) => {
|
|
|
4120
4082
|
enableReturnStateWhenStreamCompleted: true,
|
|
4121
4083
|
enableResumeStream: true
|
|
4122
4084
|
},
|
|
4123
|
-
children: /* @__PURE__ */
|
|
4085
|
+
children: /* @__PURE__ */ jsx31("div", { style: { overflow: "hidden" }, children: /* @__PURE__ */ jsx31(
|
|
4124
4086
|
Chating,
|
|
4125
4087
|
{
|
|
4126
4088
|
showRefreshButton: true,
|
|
@@ -4134,6 +4096,172 @@ var TaskDetail = ({ data, component_key, interactive = true }) => {
|
|
|
4134
4096
|
);
|
|
4135
4097
|
};
|
|
4136
4098
|
|
|
4099
|
+
// src/components/GenUI/elements/internet_search_card.tsx
|
|
4100
|
+
import { Avatar as Avatar3, Button as Button12, List as List2, Space as Space13, Typography as Typography14 } from "antd";
|
|
4101
|
+
import {
|
|
4102
|
+
SearchOutlined
|
|
4103
|
+
} from "@ant-design/icons";
|
|
4104
|
+
import { createStyles as createStyles9 } from "antd-style";
|
|
4105
|
+
import { jsx as jsx32, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4106
|
+
var { Text: Text12 } = Typography14;
|
|
4107
|
+
var useStyle7 = createStyles9(({ token, css }) => ({
|
|
4108
|
+
listContainer: css`
|
|
4109
|
+
background: ${token.colorBgContainer};
|
|
4110
|
+
border-radius: ${token.borderRadius}px;
|
|
4111
|
+
padding: 8px 0;
|
|
4112
|
+
`,
|
|
4113
|
+
listItem: css`
|
|
4114
|
+
padding: 12px 16px;
|
|
4115
|
+
border-bottom: 1px solid ${token.colorBorderSecondary};
|
|
4116
|
+
transition: background-color 0.2s ease;
|
|
4117
|
+
cursor: pointer;
|
|
4118
|
+
|
|
4119
|
+
&:hover {
|
|
4120
|
+
background: ${token.colorFillTertiary};
|
|
4121
|
+
}
|
|
4122
|
+
|
|
4123
|
+
&:last-child {
|
|
4124
|
+
border-bottom: none;
|
|
4125
|
+
}
|
|
4126
|
+
`,
|
|
4127
|
+
itemContent: css`
|
|
4128
|
+
display: flex;
|
|
4129
|
+
align-items: center;
|
|
4130
|
+
gap: 12px;
|
|
4131
|
+
width: 100%;
|
|
4132
|
+
`,
|
|
4133
|
+
iconWrapper: css`
|
|
4134
|
+
width: 32px;
|
|
4135
|
+
height: 32px;
|
|
4136
|
+
border-radius: 50%;
|
|
4137
|
+
display: flex;
|
|
4138
|
+
align-items: center;
|
|
4139
|
+
justify-content: center;
|
|
4140
|
+
flex-shrink: 0;
|
|
4141
|
+
background: ${token.colorPrimary};
|
|
4142
|
+
color: white;
|
|
4143
|
+
font-size: 14px;
|
|
4144
|
+
font-weight: 600;
|
|
4145
|
+
`,
|
|
4146
|
+
titleWrapper: css`
|
|
4147
|
+
flex: 1;
|
|
4148
|
+
min-width: 0;
|
|
4149
|
+
`,
|
|
4150
|
+
title: css`
|
|
4151
|
+
color: ${token.colorText};
|
|
4152
|
+
font-size: ${token.fontSize}px;
|
|
4153
|
+
line-height: 1.5;
|
|
4154
|
+
margin: 0;
|
|
4155
|
+
overflow: hidden;
|
|
4156
|
+
text-overflow: ellipsis;
|
|
4157
|
+
white-space: nowrap;
|
|
4158
|
+
`,
|
|
4159
|
+
source: css`
|
|
4160
|
+
color: ${token.colorTextSecondary};
|
|
4161
|
+
font-size: ${token.fontSizeSM}px;
|
|
4162
|
+
margin: 0;
|
|
4163
|
+
flex-shrink: 0;
|
|
4164
|
+
margin-left: 16px;
|
|
4165
|
+
`
|
|
4166
|
+
}));
|
|
4167
|
+
var getDomainFromUrl = (url) => {
|
|
4168
|
+
try {
|
|
4169
|
+
const urlObj = new URL(url);
|
|
4170
|
+
return urlObj.hostname.replace(/^www\./, "");
|
|
4171
|
+
} catch {
|
|
4172
|
+
return url;
|
|
4173
|
+
}
|
|
4174
|
+
};
|
|
4175
|
+
var getIconText = (domain) => {
|
|
4176
|
+
if (!domain) return "?";
|
|
4177
|
+
const parts = domain.split(".");
|
|
4178
|
+
if (parts.length >= 2) {
|
|
4179
|
+
const mainPart = parts[parts.length - 2];
|
|
4180
|
+
return mainPart.substring(0, 2).toUpperCase();
|
|
4181
|
+
}
|
|
4182
|
+
return domain.substring(0, 2).toUpperCase();
|
|
4183
|
+
};
|
|
4184
|
+
var getIconColor = (domain) => {
|
|
4185
|
+
const colors = [
|
|
4186
|
+
"#1890ff",
|
|
4187
|
+
// blue
|
|
4188
|
+
"#52c41a",
|
|
4189
|
+
// green
|
|
4190
|
+
"#fa8c16",
|
|
4191
|
+
// orange
|
|
4192
|
+
"#eb2f96",
|
|
4193
|
+
// pink
|
|
4194
|
+
"#722ed1",
|
|
4195
|
+
// purple
|
|
4196
|
+
"#13c2c2",
|
|
4197
|
+
// cyan
|
|
4198
|
+
"#f5222d"
|
|
4199
|
+
// red
|
|
4200
|
+
];
|
|
4201
|
+
let hash = 0;
|
|
4202
|
+
for (let i = 0; i < domain.length; i++) {
|
|
4203
|
+
hash = domain.charCodeAt(i) + ((hash << 5) - hash);
|
|
4204
|
+
}
|
|
4205
|
+
return colors[Math.abs(hash) % colors.length];
|
|
4206
|
+
};
|
|
4207
|
+
var InternetSearchCard = ({
|
|
4208
|
+
data,
|
|
4209
|
+
component_key,
|
|
4210
|
+
interactive = true
|
|
4211
|
+
}) => {
|
|
4212
|
+
const { styles } = useStyle7();
|
|
4213
|
+
const toolCallData = data;
|
|
4214
|
+
const { query } = toolCallData?.args || {};
|
|
4215
|
+
const dataSource = JSON.parse(toolCallData.response || "[]");
|
|
4216
|
+
const { openSideApp } = useChatUIContext();
|
|
4217
|
+
if (!toolCallData) {
|
|
4218
|
+
return null;
|
|
4219
|
+
}
|
|
4220
|
+
const header = /* @__PURE__ */ jsxs18(Space13, { children: [
|
|
4221
|
+
/* @__PURE__ */ jsx32(Text12, { strong: true, children: "Internet Search" }),
|
|
4222
|
+
/* @__PURE__ */ jsx32(Text12, { title: query, children: query })
|
|
4223
|
+
] });
|
|
4224
|
+
return /* @__PURE__ */ jsx32(
|
|
4225
|
+
ContentPreviewCollapse,
|
|
4226
|
+
{
|
|
4227
|
+
panelKey: toolCallData.id,
|
|
4228
|
+
header,
|
|
4229
|
+
expandIcon: () => /* @__PURE__ */ jsx32(SearchOutlined, {}),
|
|
4230
|
+
children: /* @__PURE__ */ jsx32(
|
|
4231
|
+
List2,
|
|
4232
|
+
{
|
|
4233
|
+
size: "small",
|
|
4234
|
+
dataSource,
|
|
4235
|
+
renderItem: (item) => {
|
|
4236
|
+
const url = item.url || "";
|
|
4237
|
+
const domain = getDomainFromUrl(url);
|
|
4238
|
+
const iconText = getIconText(domain);
|
|
4239
|
+
const iconColor = getIconColor(domain);
|
|
4240
|
+
return /* @__PURE__ */ jsx32(List2.Item, { extra: /* @__PURE__ */ jsx32(Text12, { className: styles.source, children: domain }), children: /* @__PURE__ */ jsxs18(Space13, { style: { width: "100%" }, children: [
|
|
4241
|
+
/* @__PURE__ */ jsx32(Avatar3, { style: { background: iconColor }, children: iconText }),
|
|
4242
|
+
" ",
|
|
4243
|
+
/* @__PURE__ */ jsx32(
|
|
4244
|
+
Button12,
|
|
4245
|
+
{
|
|
4246
|
+
type: "text",
|
|
4247
|
+
onClick: () => {
|
|
4248
|
+
openSideApp({
|
|
4249
|
+
component_key: "attachments",
|
|
4250
|
+
data: { url, message: item.title },
|
|
4251
|
+
message: item.title
|
|
4252
|
+
});
|
|
4253
|
+
},
|
|
4254
|
+
children: item.title
|
|
4255
|
+
}
|
|
4256
|
+
)
|
|
4257
|
+
] }) });
|
|
4258
|
+
}
|
|
4259
|
+
}
|
|
4260
|
+
)
|
|
4261
|
+
}
|
|
4262
|
+
);
|
|
4263
|
+
};
|
|
4264
|
+
|
|
4137
4265
|
// src/components/GenUI/elements/builtIns.tsx
|
|
4138
4266
|
var elements = {
|
|
4139
4267
|
action_show_attachments_uploader: {
|
|
@@ -4161,6 +4289,9 @@ var elements = {
|
|
|
4161
4289
|
write_todos: {
|
|
4162
4290
|
card_view: WriteTodos
|
|
4163
4291
|
},
|
|
4292
|
+
internet_search: {
|
|
4293
|
+
card_view: InternetSearchCard
|
|
4294
|
+
},
|
|
4164
4295
|
write_file: {
|
|
4165
4296
|
card_view: WriteFile
|
|
4166
4297
|
},
|
|
@@ -4199,11 +4330,11 @@ var regsiterElement = (language, ElementMeta) => {
|
|
|
4199
4330
|
};
|
|
4200
4331
|
|
|
4201
4332
|
// src/components/Chat/SideAppViewBrowser.tsx
|
|
4202
|
-
import { Button as
|
|
4203
|
-
import { createStyles as
|
|
4204
|
-
import { useEffect as useEffect11, useState as
|
|
4205
|
-
import { jsx as
|
|
4206
|
-
var
|
|
4333
|
+
import { Button as Button13, Tabs } from "antd";
|
|
4334
|
+
import { createStyles as createStyles10 } from "antd-style";
|
|
4335
|
+
import { useEffect as useEffect11, useState as useState17 } from "react";
|
|
4336
|
+
import { jsx as jsx33, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4337
|
+
var useStyle8 = createStyles10(({ token, css }) => {
|
|
4207
4338
|
return {
|
|
4208
4339
|
tabContainer: css`
|
|
4209
4340
|
.ant-tabs-content-holder {
|
|
@@ -4222,13 +4353,13 @@ var useStyle7 = createStyles9(({ token, css }) => {
|
|
|
4222
4353
|
};
|
|
4223
4354
|
});
|
|
4224
4355
|
var EmptySideAppView = ({ component_key, data }) => {
|
|
4225
|
-
return /* @__PURE__ */
|
|
4226
|
-
/* @__PURE__ */
|
|
4227
|
-
/* @__PURE__ */
|
|
4356
|
+
return /* @__PURE__ */ jsxs19("div", { children: [
|
|
4357
|
+
/* @__PURE__ */ jsx33("p", { children: "\u672A\u627E\u5230\u5BF9\u5E94\u7684\u7EC4\u4EF6\u89C6\u56FE" }),
|
|
4358
|
+
/* @__PURE__ */ jsx33("pre", { children: JSON.stringify({ component_key, data }, null, 2) })
|
|
4228
4359
|
] });
|
|
4229
4360
|
};
|
|
4230
4361
|
var SideAppViewBrowser = () => {
|
|
4231
|
-
const { styles } =
|
|
4362
|
+
const { styles } = useStyle8();
|
|
4232
4363
|
const {
|
|
4233
4364
|
sideAppSize,
|
|
4234
4365
|
sideAppSelectedCard,
|
|
@@ -4236,10 +4367,10 @@ var SideAppViewBrowser = () => {
|
|
|
4236
4367
|
openSideApp,
|
|
4237
4368
|
closeSideApp
|
|
4238
4369
|
} = useChatUIContext();
|
|
4239
|
-
const [activeKey, setActiveKey] =
|
|
4370
|
+
const [activeKey, setActiveKey] = useState17(
|
|
4240
4371
|
JSON.stringify(sideAppSelectedCard)
|
|
4241
4372
|
);
|
|
4242
|
-
const [items, setItems] =
|
|
4373
|
+
const [items, setItems] = useState17([]);
|
|
4243
4374
|
const add = (key, label, children) => {
|
|
4244
4375
|
const newActiveKey = key;
|
|
4245
4376
|
const newPanes = [...items];
|
|
@@ -4285,7 +4416,7 @@ var SideAppViewBrowser = () => {
|
|
|
4285
4416
|
add(
|
|
4286
4417
|
key,
|
|
4287
4418
|
sideAppSelectedCard?.message || sideAppSelectedCard?.data.message || "\u672A\u547D\u540D",
|
|
4288
|
-
/* @__PURE__ */
|
|
4419
|
+
/* @__PURE__ */ jsx33(
|
|
4289
4420
|
SideAppView,
|
|
4290
4421
|
{
|
|
4291
4422
|
component_key: sideAppSelectedCard?.component_key || "",
|
|
@@ -4326,16 +4457,16 @@ var SideAppViewBrowser = () => {
|
|
|
4326
4457
|
const getSizeIcon = (size) => {
|
|
4327
4458
|
switch (size) {
|
|
4328
4459
|
case "middle":
|
|
4329
|
-
return /* @__PURE__ */
|
|
4460
|
+
return /* @__PURE__ */ jsx33(CompressOutlined, {});
|
|
4330
4461
|
case "large":
|
|
4331
|
-
return /* @__PURE__ */
|
|
4462
|
+
return /* @__PURE__ */ jsx33(ExpandOutlined, {});
|
|
4332
4463
|
case "full":
|
|
4333
|
-
return /* @__PURE__ */
|
|
4464
|
+
return /* @__PURE__ */ jsx33(FullscreenOutlined, {});
|
|
4334
4465
|
default:
|
|
4335
|
-
return /* @__PURE__ */
|
|
4466
|
+
return /* @__PURE__ */ jsx33(ExpandOutlined, {});
|
|
4336
4467
|
}
|
|
4337
4468
|
};
|
|
4338
|
-
return /* @__PURE__ */
|
|
4469
|
+
return /* @__PURE__ */ jsx33(
|
|
4339
4470
|
Tabs,
|
|
4340
4471
|
{
|
|
4341
4472
|
className: styles.tabContainer,
|
|
@@ -4343,9 +4474,9 @@ var SideAppViewBrowser = () => {
|
|
|
4343
4474
|
style: { height: "100%" },
|
|
4344
4475
|
hideAdd: true,
|
|
4345
4476
|
tabBarExtraContent: {
|
|
4346
|
-
right: /* @__PURE__ */
|
|
4347
|
-
/* @__PURE__ */
|
|
4348
|
-
|
|
4477
|
+
right: /* @__PURE__ */ jsxs19("div", { style: { display: "flex", gap: "4px" }, children: [
|
|
4478
|
+
/* @__PURE__ */ jsx33(
|
|
4479
|
+
Button13,
|
|
4349
4480
|
{
|
|
4350
4481
|
style: { margin: "8px 0" },
|
|
4351
4482
|
size: "large",
|
|
@@ -4355,13 +4486,13 @@ var SideAppViewBrowser = () => {
|
|
|
4355
4486
|
title: `\u5F53\u524D\u5C3A\u5BF8: ${getSizeLabel(sideAppSize)}, \u70B9\u51FB\u5207\u6362`
|
|
4356
4487
|
}
|
|
4357
4488
|
),
|
|
4358
|
-
/* @__PURE__ */
|
|
4359
|
-
|
|
4489
|
+
/* @__PURE__ */ jsx33(
|
|
4490
|
+
Button13,
|
|
4360
4491
|
{
|
|
4361
4492
|
style: { margin: "8px 0" },
|
|
4362
4493
|
size: "large",
|
|
4363
4494
|
type: "text",
|
|
4364
|
-
icon: /* @__PURE__ */
|
|
4495
|
+
icon: /* @__PURE__ */ jsx33(CloseOutlined, {}),
|
|
4365
4496
|
onClick: () => {
|
|
4366
4497
|
closeSideApp();
|
|
4367
4498
|
}
|
|
@@ -4378,10 +4509,10 @@ var SideAppViewBrowser = () => {
|
|
|
4378
4509
|
};
|
|
4379
4510
|
|
|
4380
4511
|
// src/components/Chat/LatticeChat.tsx
|
|
4381
|
-
import { jsx as
|
|
4512
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
4382
4513
|
var LatticeChat = (props) => {
|
|
4383
4514
|
const { assistant_id, thread_id = "", menu, ...chatingProps } = props;
|
|
4384
|
-
return /* @__PURE__ */
|
|
4515
|
+
return /* @__PURE__ */ jsx34(
|
|
4385
4516
|
AgentThreadProvider,
|
|
4386
4517
|
{
|
|
4387
4518
|
assistantId: assistant_id,
|
|
@@ -4391,12 +4522,12 @@ var LatticeChat = (props) => {
|
|
|
4391
4522
|
enableReturnStateWhenStreamCompleted: true,
|
|
4392
4523
|
enableResumeStream: true
|
|
4393
4524
|
},
|
|
4394
|
-
children: /* @__PURE__ */
|
|
4525
|
+
children: /* @__PURE__ */ jsx34(ChatUIContextProvider, { children: /* @__PURE__ */ jsx34(
|
|
4395
4526
|
ColumnLayout,
|
|
4396
4527
|
{
|
|
4397
4528
|
menu,
|
|
4398
|
-
left: thread_id ? /* @__PURE__ */
|
|
4399
|
-
right: /* @__PURE__ */
|
|
4529
|
+
left: thread_id ? /* @__PURE__ */ jsx34(Chating, { ...chatingProps }) : /* @__PURE__ */ jsx34("div", { children: "\u9700\u8981\u5148\u521B\u5EFA\u4F1A\u8BDD" }),
|
|
4530
|
+
right: /* @__PURE__ */ jsx34(SideAppViewBrowser, {})
|
|
4400
4531
|
}
|
|
4401
4532
|
) })
|
|
4402
4533
|
}
|
|
@@ -4409,9 +4540,9 @@ import {
|
|
|
4409
4540
|
useCallback as useCallback10,
|
|
4410
4541
|
useContext as useContext6,
|
|
4411
4542
|
useEffect as useEffect13,
|
|
4412
|
-
useMemo as
|
|
4543
|
+
useMemo as useMemo6,
|
|
4413
4544
|
useRef as useRef10,
|
|
4414
|
-
useState as
|
|
4545
|
+
useState as useState20
|
|
4415
4546
|
} from "react";
|
|
4416
4547
|
|
|
4417
4548
|
// src/components/Chat/AssistantContext.tsx
|
|
@@ -4420,9 +4551,9 @@ import {
|
|
|
4420
4551
|
useCallback as useCallback9,
|
|
4421
4552
|
useContext as useContext5,
|
|
4422
4553
|
useEffect as useEffect12,
|
|
4423
|
-
useMemo as
|
|
4554
|
+
useMemo as useMemo5,
|
|
4424
4555
|
useRef as useRef9,
|
|
4425
|
-
useState as
|
|
4556
|
+
useState as useState19
|
|
4426
4557
|
} from "react";
|
|
4427
4558
|
import {
|
|
4428
4559
|
Client as Client2
|
|
@@ -4433,9 +4564,9 @@ import {
|
|
|
4433
4564
|
createContext as createContext4,
|
|
4434
4565
|
useCallback as useCallback8,
|
|
4435
4566
|
useContext as useContext4,
|
|
4436
|
-
useState as
|
|
4567
|
+
useState as useState18
|
|
4437
4568
|
} from "react";
|
|
4438
|
-
import { jsx as
|
|
4569
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
4439
4570
|
var DEFAULT_CONFIG = {
|
|
4440
4571
|
baseURL: "http://localhost:4001",
|
|
4441
4572
|
apiKey: "",
|
|
@@ -4475,8 +4606,8 @@ var LatticeChatShellContextProvider = ({
|
|
|
4475
4606
|
}
|
|
4476
4607
|
return { ...DEFAULT_CONFIG, ...initialConfig };
|
|
4477
4608
|
}, [persistToLocalStorage, localStorageKey, initialConfig]);
|
|
4478
|
-
const [config, setConfig] =
|
|
4479
|
-
const [settingsModalOpen, setSettingsModalOpen] =
|
|
4609
|
+
const [config, setConfig] = useState18(loadInitialConfig);
|
|
4610
|
+
const [settingsModalOpen, setSettingsModalOpen] = useState18(false);
|
|
4480
4611
|
const saveToLocalStorage = useCallback8(
|
|
4481
4612
|
(newConfig) => {
|
|
4482
4613
|
if (persistToLocalStorage && typeof window !== "undefined") {
|
|
@@ -4514,7 +4645,7 @@ var LatticeChatShellContextProvider = ({
|
|
|
4514
4645
|
setConfig(defaultConfig);
|
|
4515
4646
|
saveToLocalStorage(defaultConfig);
|
|
4516
4647
|
}, [initialConfig, saveToLocalStorage]);
|
|
4517
|
-
return /* @__PURE__ */
|
|
4648
|
+
return /* @__PURE__ */ jsx35(
|
|
4518
4649
|
LatticeChatShellContext.Provider,
|
|
4519
4650
|
{
|
|
4520
4651
|
value: {
|
|
@@ -4540,7 +4671,7 @@ var useLatticeChatShellContext = () => {
|
|
|
4540
4671
|
};
|
|
4541
4672
|
|
|
4542
4673
|
// src/components/Chat/AssistantContext.tsx
|
|
4543
|
-
import { jsx as
|
|
4674
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
4544
4675
|
var AssistantContext = createContext5({
|
|
4545
4676
|
assistants: [],
|
|
4546
4677
|
currentAssistant: null,
|
|
@@ -4574,7 +4705,7 @@ var AssistantContextProvider = ({
|
|
|
4574
4705
|
const {
|
|
4575
4706
|
config: { baseURL, apiKey = "", transport = "sse" }
|
|
4576
4707
|
} = useLatticeChatShellContext();
|
|
4577
|
-
const client =
|
|
4708
|
+
const client = useMemo5(
|
|
4578
4709
|
() => new Client2({
|
|
4579
4710
|
baseURL,
|
|
4580
4711
|
apiKey,
|
|
@@ -4583,7 +4714,7 @@ var AssistantContextProvider = ({
|
|
|
4583
4714
|
}),
|
|
4584
4715
|
[baseURL, apiKey, transport]
|
|
4585
4716
|
);
|
|
4586
|
-
const [state, setState] =
|
|
4717
|
+
const [state, setState] = useState19({
|
|
4587
4718
|
assistants: [],
|
|
4588
4719
|
currentAssistant: null,
|
|
4589
4720
|
isLoading: false,
|
|
@@ -4775,7 +4906,7 @@ var AssistantContextProvider = ({
|
|
|
4775
4906
|
}
|
|
4776
4907
|
}
|
|
4777
4908
|
}, [initialAssistantId, state.assistants, state.currentAssistant]);
|
|
4778
|
-
return /* @__PURE__ */
|
|
4909
|
+
return /* @__PURE__ */ jsx36(
|
|
4779
4910
|
AssistantContext.Provider,
|
|
4780
4911
|
{
|
|
4781
4912
|
value: {
|
|
@@ -4805,7 +4936,7 @@ var useAssistantContext = () => {
|
|
|
4805
4936
|
|
|
4806
4937
|
// src/components/Chat/ConversationContext.tsx
|
|
4807
4938
|
import { Client as Client3 } from "@axiom-lattice/client-sdk";
|
|
4808
|
-
import { jsx as
|
|
4939
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
4809
4940
|
var ConversationContext = createContext6({
|
|
4810
4941
|
assistantId: null,
|
|
4811
4942
|
thread: null,
|
|
@@ -4848,7 +4979,7 @@ var ConversationContextProvider = ({
|
|
|
4848
4979
|
const {
|
|
4849
4980
|
config: { baseURL, apiKey = "", transport = "sse" }
|
|
4850
4981
|
} = useLatticeChatShellContext();
|
|
4851
|
-
const client =
|
|
4982
|
+
const client = useMemo6(
|
|
4852
4983
|
() => new Client3({
|
|
4853
4984
|
baseURL,
|
|
4854
4985
|
apiKey,
|
|
@@ -4857,10 +4988,10 @@ var ConversationContextProvider = ({
|
|
|
4857
4988
|
}),
|
|
4858
4989
|
[baseURL, apiKey, assistantId, transport]
|
|
4859
4990
|
);
|
|
4860
|
-
const [threads, setThreads] =
|
|
4861
|
-
const [threadId, setThreadId] =
|
|
4862
|
-
const [isLoading, setIsLoading] =
|
|
4863
|
-
const [error, setError] =
|
|
4991
|
+
const [threads, setThreads] = useState20([]);
|
|
4992
|
+
const [threadId, setThreadId] = useState20(null);
|
|
4993
|
+
const [isLoading, setIsLoading] = useState20(false);
|
|
4994
|
+
const [error, setError] = useState20(null);
|
|
4864
4995
|
const loadedAssistantIdRef = useRef10(null);
|
|
4865
4996
|
const prevAssistantIdRef = useRef10(null);
|
|
4866
4997
|
const isLoadingRef = useRef10(false);
|
|
@@ -4946,7 +5077,7 @@ var ConversationContextProvider = ({
|
|
|
4946
5077
|
prevAssistantIdRef.current = null;
|
|
4947
5078
|
}
|
|
4948
5079
|
}, [assistantId, loadThreads]);
|
|
4949
|
-
const thread =
|
|
5080
|
+
const thread = useMemo6(() => {
|
|
4950
5081
|
if (!assistantId || !threadId) {
|
|
4951
5082
|
return null;
|
|
4952
5083
|
}
|
|
@@ -5068,7 +5199,7 @@ var ConversationContextProvider = ({
|
|
|
5068
5199
|
const clearThread = useCallback10(() => {
|
|
5069
5200
|
setThreadId(null);
|
|
5070
5201
|
}, []);
|
|
5071
|
-
return /* @__PURE__ */
|
|
5202
|
+
return /* @__PURE__ */ jsx37(
|
|
5072
5203
|
ConversationContext.Provider,
|
|
5073
5204
|
{
|
|
5074
5205
|
value: {
|
|
@@ -5105,8 +5236,8 @@ var useConversationContext = () => {
|
|
|
5105
5236
|
// src/components/Chat/AgentConversations.tsx
|
|
5106
5237
|
import { Conversations } from "@ant-design/x";
|
|
5107
5238
|
import { theme } from "antd";
|
|
5108
|
-
import { useMemo as
|
|
5109
|
-
import { jsx as
|
|
5239
|
+
import { useMemo as useMemo7 } from "react";
|
|
5240
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
5110
5241
|
var AgentConversations = () => {
|
|
5111
5242
|
const { token } = theme.useToken();
|
|
5112
5243
|
const { currentAssistant } = useAssistantContext();
|
|
@@ -5123,7 +5254,7 @@ var AgentConversations = () => {
|
|
|
5123
5254
|
background: "transparent",
|
|
5124
5255
|
borderRadius: token.borderRadius
|
|
5125
5256
|
};
|
|
5126
|
-
const threadItems =
|
|
5257
|
+
const threadItems = useMemo7(() => {
|
|
5127
5258
|
return threads || [];
|
|
5128
5259
|
}, [threads]);
|
|
5129
5260
|
const items = threadItems.map((thread2) => ({
|
|
@@ -5136,7 +5267,7 @@ var AgentConversations = () => {
|
|
|
5136
5267
|
}
|
|
5137
5268
|
await createThread();
|
|
5138
5269
|
};
|
|
5139
|
-
return /* @__PURE__ */
|
|
5270
|
+
return /* @__PURE__ */ jsx38(
|
|
5140
5271
|
Conversations,
|
|
5141
5272
|
{
|
|
5142
5273
|
creation: {
|
|
@@ -5154,7 +5285,7 @@ var AgentConversations = () => {
|
|
|
5154
5285
|
};
|
|
5155
5286
|
|
|
5156
5287
|
// src/components/Chat/ChatSidebar.tsx
|
|
5157
|
-
import { useState as
|
|
5288
|
+
import { useState as useState21 } from "react";
|
|
5158
5289
|
import { Divider as Divider2 } from "antd";
|
|
5159
5290
|
import {
|
|
5160
5291
|
MenuFoldOutlined,
|
|
@@ -5164,8 +5295,8 @@ import {
|
|
|
5164
5295
|
|
|
5165
5296
|
// src/components/Chat/AssistantList.tsx
|
|
5166
5297
|
import { Conversations as Conversations2 } from "@ant-design/x";
|
|
5167
|
-
import { Avatar as
|
|
5168
|
-
import { jsx as
|
|
5298
|
+
import { Avatar as Avatar4, theme as theme2 } from "antd";
|
|
5299
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
5169
5300
|
var AssistantList = () => {
|
|
5170
5301
|
const { token } = theme2.useToken();
|
|
5171
5302
|
const { assistants, selectAssistant, currentAssistant } = useAssistantContext();
|
|
@@ -5177,8 +5308,8 @@ var AssistantList = () => {
|
|
|
5177
5308
|
const items = assistants.map((assistant) => ({
|
|
5178
5309
|
key: assistant.id,
|
|
5179
5310
|
label: assistant.name,
|
|
5180
|
-
icon: /* @__PURE__ */
|
|
5181
|
-
|
|
5311
|
+
icon: /* @__PURE__ */ jsx39(
|
|
5312
|
+
Avatar4,
|
|
5182
5313
|
{
|
|
5183
5314
|
size: "small",
|
|
5184
5315
|
style: {
|
|
@@ -5189,7 +5320,7 @@ var AssistantList = () => {
|
|
|
5189
5320
|
}
|
|
5190
5321
|
)
|
|
5191
5322
|
}));
|
|
5192
|
-
return /* @__PURE__ */
|
|
5323
|
+
return /* @__PURE__ */ jsx39(
|
|
5193
5324
|
Conversations2,
|
|
5194
5325
|
{
|
|
5195
5326
|
items,
|
|
@@ -5203,9 +5334,9 @@ var AssistantList = () => {
|
|
|
5203
5334
|
};
|
|
5204
5335
|
|
|
5205
5336
|
// src/components/Chat/ChatSidebar.tsx
|
|
5206
|
-
import { createStyles as
|
|
5207
|
-
import { Fragment as Fragment5, jsx as
|
|
5208
|
-
var useStyles3 =
|
|
5337
|
+
import { createStyles as createStyles11 } from "antd-style";
|
|
5338
|
+
import { Fragment as Fragment5, jsx as jsx40, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
5339
|
+
var useStyles3 = createStyles11(({ token, css }) => ({
|
|
5209
5340
|
sidebar: css`
|
|
5210
5341
|
display: flex;
|
|
5211
5342
|
flex-direction: column;
|
|
@@ -5382,7 +5513,7 @@ var ChatSidebar = ({
|
|
|
5382
5513
|
const { styles } = useStyles3();
|
|
5383
5514
|
const { setMenuCollapsed, menuCollapsed, sideAppVisible } = useChatUIContext();
|
|
5384
5515
|
const { setSettingsModalOpen } = useLatticeChatShellContext();
|
|
5385
|
-
const [isHovered, setIsHovered] =
|
|
5516
|
+
const [isHovered, setIsHovered] = useState21(false);
|
|
5386
5517
|
const handleToggleCollapse = () => {
|
|
5387
5518
|
setMenuCollapsed(!menuCollapsed);
|
|
5388
5519
|
};
|
|
@@ -5399,87 +5530,87 @@ var ChatSidebar = ({
|
|
|
5399
5530
|
const handleMouseLeave = () => {
|
|
5400
5531
|
setIsHovered(false);
|
|
5401
5532
|
};
|
|
5402
|
-
return /* @__PURE__ */
|
|
5403
|
-
/* @__PURE__ */
|
|
5533
|
+
return /* @__PURE__ */ jsxs20(Fragment5, { children: [
|
|
5534
|
+
/* @__PURE__ */ jsx40(
|
|
5404
5535
|
"div",
|
|
5405
5536
|
{
|
|
5406
5537
|
className: styles.sidebar,
|
|
5407
5538
|
onMouseEnter: handleMouseEnter,
|
|
5408
5539
|
onMouseLeave: handleMouseLeave,
|
|
5409
|
-
children: !isCollapsed && /* @__PURE__ */
|
|
5410
|
-
/* @__PURE__ */
|
|
5411
|
-
/* @__PURE__ */
|
|
5412
|
-
/* @__PURE__ */
|
|
5413
|
-
/* @__PURE__ */
|
|
5540
|
+
children: !isCollapsed && /* @__PURE__ */ jsxs20(Fragment5, { children: [
|
|
5541
|
+
/* @__PURE__ */ jsxs20("div", { className: styles.content, children: [
|
|
5542
|
+
/* @__PURE__ */ jsxs20("div", { className: styles.section, children: [
|
|
5543
|
+
/* @__PURE__ */ jsx40("div", { className: styles.sectionTitle, children: "Assistants" }),
|
|
5544
|
+
/* @__PURE__ */ jsx40(AssistantList, {})
|
|
5414
5545
|
] }),
|
|
5415
|
-
/* @__PURE__ */
|
|
5416
|
-
/* @__PURE__ */
|
|
5417
|
-
/* @__PURE__ */
|
|
5418
|
-
/* @__PURE__ */
|
|
5546
|
+
/* @__PURE__ */ jsx40(Divider2, { className: styles.divider }),
|
|
5547
|
+
/* @__PURE__ */ jsxs20("div", { className: styles.section, children: [
|
|
5548
|
+
/* @__PURE__ */ jsx40("div", { className: styles.sectionTitle, children: "Threads" }),
|
|
5549
|
+
/* @__PURE__ */ jsx40(AgentConversations, {})
|
|
5419
5550
|
] })
|
|
5420
5551
|
] }),
|
|
5421
|
-
/* @__PURE__ */
|
|
5422
|
-
/* @__PURE__ */
|
|
5552
|
+
/* @__PURE__ */ jsxs20("div", { className: styles.footer, children: [
|
|
5553
|
+
/* @__PURE__ */ jsx40(
|
|
5423
5554
|
"button",
|
|
5424
5555
|
{
|
|
5425
5556
|
className: styles.actionButton,
|
|
5426
5557
|
onClick: handleToggleCollapse,
|
|
5427
5558
|
title: isCollapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
5428
5559
|
"aria-label": isCollapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
5429
|
-
children: isCollapsed ? /* @__PURE__ */
|
|
5560
|
+
children: isCollapsed ? /* @__PURE__ */ jsx40(MenuUnfoldOutlined, {}) : /* @__PURE__ */ jsx40(MenuFoldOutlined, {})
|
|
5430
5561
|
}
|
|
5431
5562
|
),
|
|
5432
|
-
/* @__PURE__ */
|
|
5563
|
+
/* @__PURE__ */ jsx40(
|
|
5433
5564
|
"button",
|
|
5434
5565
|
{
|
|
5435
5566
|
className: styles.actionButton,
|
|
5436
5567
|
onClick: handleSettingsClick,
|
|
5437
5568
|
title: "Settings",
|
|
5438
5569
|
"aria-label": "Settings",
|
|
5439
|
-
children: /* @__PURE__ */
|
|
5570
|
+
children: /* @__PURE__ */ jsx40(SettingOutlined, {})
|
|
5440
5571
|
}
|
|
5441
5572
|
)
|
|
5442
5573
|
] })
|
|
5443
5574
|
] })
|
|
5444
5575
|
}
|
|
5445
5576
|
),
|
|
5446
|
-
isCollapsed && /* @__PURE__ */
|
|
5577
|
+
isCollapsed && /* @__PURE__ */ jsxs20(
|
|
5447
5578
|
"div",
|
|
5448
5579
|
{
|
|
5449
5580
|
className: `${styles.hoverOverlay} ${isHovered ? "visible" : ""}`,
|
|
5450
5581
|
onMouseEnter: handleMouseEnter,
|
|
5451
5582
|
onMouseLeave: handleMouseLeave,
|
|
5452
5583
|
children: [
|
|
5453
|
-
/* @__PURE__ */
|
|
5454
|
-
/* @__PURE__ */
|
|
5455
|
-
/* @__PURE__ */
|
|
5456
|
-
/* @__PURE__ */
|
|
5584
|
+
/* @__PURE__ */ jsxs20("div", { className: styles.hoverContent, children: [
|
|
5585
|
+
/* @__PURE__ */ jsxs20("div", { className: styles.section, children: [
|
|
5586
|
+
/* @__PURE__ */ jsx40("div", { className: styles.sectionTitle, children: "Assistants" }),
|
|
5587
|
+
/* @__PURE__ */ jsx40(AssistantList, {})
|
|
5457
5588
|
] }),
|
|
5458
|
-
/* @__PURE__ */
|
|
5459
|
-
/* @__PURE__ */
|
|
5460
|
-
/* @__PURE__ */
|
|
5461
|
-
/* @__PURE__ */
|
|
5589
|
+
/* @__PURE__ */ jsx40(Divider2, { className: styles.divider }),
|
|
5590
|
+
/* @__PURE__ */ jsxs20("div", { className: styles.section, children: [
|
|
5591
|
+
/* @__PURE__ */ jsx40("div", { className: styles.sectionTitle, children: "Threads" }),
|
|
5592
|
+
/* @__PURE__ */ jsx40(AgentConversations, {})
|
|
5462
5593
|
] })
|
|
5463
5594
|
] }),
|
|
5464
|
-
/* @__PURE__ */
|
|
5465
|
-
/* @__PURE__ */
|
|
5595
|
+
/* @__PURE__ */ jsxs20("div", { className: styles.footer, children: [
|
|
5596
|
+
/* @__PURE__ */ jsx40(
|
|
5466
5597
|
"button",
|
|
5467
5598
|
{
|
|
5468
5599
|
className: styles.actionButton,
|
|
5469
5600
|
onClick: handleToggleCollapse,
|
|
5470
5601
|
title: isCollapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
5471
5602
|
"aria-label": isCollapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
5472
|
-
children: isCollapsed ? /* @__PURE__ */
|
|
5603
|
+
children: isCollapsed ? /* @__PURE__ */ jsx40(MenuUnfoldOutlined, {}) : /* @__PURE__ */ jsx40(MenuFoldOutlined, {})
|
|
5473
5604
|
}
|
|
5474
5605
|
),
|
|
5475
|
-
/* @__PURE__ */
|
|
5606
|
+
/* @__PURE__ */ jsx40(
|
|
5476
5607
|
"button",
|
|
5477
5608
|
{
|
|
5478
5609
|
className: styles.actionButton,
|
|
5479
5610
|
onClick: handleSettingsClick,
|
|
5480
5611
|
title: "Settings",
|
|
5481
5612
|
"aria-label": "Settings",
|
|
5482
|
-
children: /* @__PURE__ */
|
|
5613
|
+
children: /* @__PURE__ */ jsx40(SettingOutlined, {})
|
|
5483
5614
|
}
|
|
5484
5615
|
)
|
|
5485
5616
|
] })
|
|
@@ -5490,14 +5621,14 @@ var ChatSidebar = ({
|
|
|
5490
5621
|
};
|
|
5491
5622
|
|
|
5492
5623
|
// src/components/Chat/LatticeChatView.tsx
|
|
5493
|
-
import { jsx as
|
|
5624
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
5494
5625
|
var LatticeChatView = (props) => {
|
|
5495
5626
|
const { assistantId, thread } = useConversationContext();
|
|
5496
5627
|
const { currentAssistant } = useAssistantContext();
|
|
5497
5628
|
const {
|
|
5498
5629
|
config: { baseURL }
|
|
5499
5630
|
} = useLatticeChatShellContext();
|
|
5500
|
-
return assistantId && thread ? /* @__PURE__ */
|
|
5631
|
+
return assistantId && thread ? /* @__PURE__ */ jsx41(
|
|
5501
5632
|
AxiomLatticeProvider,
|
|
5502
5633
|
{
|
|
5503
5634
|
config: {
|
|
@@ -5506,14 +5637,14 @@ var LatticeChatView = (props) => {
|
|
|
5506
5637
|
assistantId,
|
|
5507
5638
|
transport: "sse"
|
|
5508
5639
|
},
|
|
5509
|
-
children: /* @__PURE__ */
|
|
5640
|
+
children: /* @__PURE__ */ jsx41(
|
|
5510
5641
|
LatticeChat,
|
|
5511
5642
|
{
|
|
5512
5643
|
thread_id: thread?.id,
|
|
5513
5644
|
assistant_id: assistantId,
|
|
5514
5645
|
name: currentAssistant?.name,
|
|
5515
5646
|
description: currentAssistant?.description,
|
|
5516
|
-
menu: /* @__PURE__ */
|
|
5647
|
+
menu: /* @__PURE__ */ jsx41(ChatSidebar, {})
|
|
5517
5648
|
}
|
|
5518
5649
|
)
|
|
5519
5650
|
}
|
|
@@ -5521,17 +5652,17 @@ var LatticeChatView = (props) => {
|
|
|
5521
5652
|
};
|
|
5522
5653
|
|
|
5523
5654
|
// src/components/Chat/SettingsModal.tsx
|
|
5524
|
-
import { useState as
|
|
5655
|
+
import { useState as useState22, useEffect as useEffect14, useRef as useRef11 } from "react";
|
|
5525
5656
|
import {
|
|
5526
5657
|
Modal,
|
|
5527
5658
|
Input,
|
|
5528
|
-
Button as
|
|
5659
|
+
Button as Button14,
|
|
5529
5660
|
message as message4,
|
|
5530
|
-
Typography as
|
|
5661
|
+
Typography as Typography15,
|
|
5531
5662
|
Alert as Alert3,
|
|
5532
5663
|
Select,
|
|
5533
5664
|
Switch,
|
|
5534
|
-
Space as
|
|
5665
|
+
Space as Space14,
|
|
5535
5666
|
Tabs as Tabs2
|
|
5536
5667
|
} from "antd";
|
|
5537
5668
|
import {
|
|
@@ -5546,11 +5677,11 @@ import {
|
|
|
5546
5677
|
PlusOutlined,
|
|
5547
5678
|
CloudServerOutlined
|
|
5548
5679
|
} from "@ant-design/icons";
|
|
5549
|
-
import { createStyles as
|
|
5550
|
-
import { Fragment as Fragment6, jsx as
|
|
5551
|
-
var { Text:
|
|
5680
|
+
import { createStyles as createStyles12 } from "antd-style";
|
|
5681
|
+
import { Fragment as Fragment6, jsx as jsx42, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
5682
|
+
var { Text: Text13, Title: Title2 } = Typography15;
|
|
5552
5683
|
var { TextArea } = Input;
|
|
5553
|
-
var useStyles4 =
|
|
5684
|
+
var useStyles4 = createStyles12(({ token, css }) => ({
|
|
5554
5685
|
// settingsModal: css`
|
|
5555
5686
|
// .ant-modal {
|
|
5556
5687
|
// max-width: 100vw !important;
|
|
@@ -5896,12 +6027,12 @@ var SETTINGS_MENU_ITEMS = [
|
|
|
5896
6027
|
{
|
|
5897
6028
|
key: "environment",
|
|
5898
6029
|
label: "Environment Variables",
|
|
5899
|
-
icon: /* @__PURE__ */
|
|
6030
|
+
icon: /* @__PURE__ */ jsx42(EnvironmentOutlined, {})
|
|
5900
6031
|
},
|
|
5901
6032
|
{
|
|
5902
6033
|
key: "models",
|
|
5903
6034
|
label: "Model Configuration",
|
|
5904
|
-
icon: /* @__PURE__ */
|
|
6035
|
+
icon: /* @__PURE__ */ jsx42(ApiOutlined, {})
|
|
5905
6036
|
}
|
|
5906
6037
|
];
|
|
5907
6038
|
var SettingsModal = ({
|
|
@@ -5910,7 +6041,7 @@ var SettingsModal = ({
|
|
|
5910
6041
|
}) => {
|
|
5911
6042
|
const { styles } = useStyles4();
|
|
5912
6043
|
const { config: shellConfig, updateConfigValue } = useLatticeChatShellContext();
|
|
5913
|
-
const [connections, setConnections] =
|
|
6044
|
+
const [connections, setConnections] = useState22(() => {
|
|
5914
6045
|
if (typeof window !== "undefined") {
|
|
5915
6046
|
try {
|
|
5916
6047
|
const stored = localStorage.getItem("lattice_server_connections");
|
|
@@ -5933,21 +6064,21 @@ var SettingsModal = ({
|
|
|
5933
6064
|
}
|
|
5934
6065
|
return [];
|
|
5935
6066
|
});
|
|
5936
|
-
const [serverConfigs, setServerConfigs] =
|
|
6067
|
+
const [serverConfigs, setServerConfigs] = useState22({});
|
|
5937
6068
|
const connectionsRef = useRef11(connections);
|
|
5938
6069
|
useEffect14(() => {
|
|
5939
6070
|
connectionsRef.current = connections;
|
|
5940
6071
|
}, [connections]);
|
|
5941
|
-
const [activeTabKey, setActiveTabKey] =
|
|
6072
|
+
const [activeTabKey, setActiveTabKey] = useState22(
|
|
5942
6073
|
connections.length > 0 ? connections[0].id : ""
|
|
5943
6074
|
);
|
|
5944
|
-
const [activeMenu, setActiveMenu] =
|
|
5945
|
-
const [loading, setLoading] =
|
|
5946
|
-
const [showAddServerModal, setShowAddServerModal] =
|
|
5947
|
-
const [newServerUrl, setNewServerUrl] =
|
|
5948
|
-
const [newServerName, setNewServerName] =
|
|
5949
|
-
const [newServerApiKey, setNewServerApiKey] =
|
|
5950
|
-
const [addingServer, setAddingServer] =
|
|
6075
|
+
const [activeMenu, setActiveMenu] = useState22("environment");
|
|
6076
|
+
const [loading, setLoading] = useState22(false);
|
|
6077
|
+
const [showAddServerModal, setShowAddServerModal] = useState22(false);
|
|
6078
|
+
const [newServerUrl, setNewServerUrl] = useState22("");
|
|
6079
|
+
const [newServerName, setNewServerName] = useState22("");
|
|
6080
|
+
const [newServerApiKey, setNewServerApiKey] = useState22("");
|
|
6081
|
+
const [addingServer, setAddingServer] = useState22(false);
|
|
5951
6082
|
const saveConnections = (newConnections) => {
|
|
5952
6083
|
setConnections(newConnections);
|
|
5953
6084
|
if (typeof window !== "undefined") {
|
|
@@ -6347,25 +6478,25 @@ var SettingsModal = ({
|
|
|
6347
6478
|
}
|
|
6348
6479
|
}));
|
|
6349
6480
|
};
|
|
6350
|
-
return /* @__PURE__ */
|
|
6351
|
-
/* @__PURE__ */
|
|
6481
|
+
return /* @__PURE__ */ jsxs21("div", { className: styles.formContainer, children: [
|
|
6482
|
+
/* @__PURE__ */ jsx42(
|
|
6352
6483
|
Alert3,
|
|
6353
6484
|
{
|
|
6354
6485
|
message: "Configuration Effect",
|
|
6355
|
-
description: /* @__PURE__ */
|
|
6356
|
-
/* @__PURE__ */
|
|
6357
|
-
/* @__PURE__ */
|
|
6486
|
+
description: /* @__PURE__ */ jsxs21("div", { children: [
|
|
6487
|
+
/* @__PURE__ */ jsxs21("div", { style: { marginBottom: 8 }, children: [
|
|
6488
|
+
/* @__PURE__ */ jsx42(
|
|
6358
6489
|
CheckCircleOutlined4,
|
|
6359
6490
|
{
|
|
6360
6491
|
style: { color: "#52c41a", marginRight: 8 }
|
|
6361
6492
|
}
|
|
6362
6493
|
),
|
|
6363
|
-
/* @__PURE__ */
|
|
6494
|
+
/* @__PURE__ */ jsx42("strong", { children: "Immediately effective:" }),
|
|
6364
6495
|
" QUEUE_SERVICE_TYPE, REDIS_URL, REDIS_PASSWORD, QUEUE_NAME"
|
|
6365
6496
|
] }),
|
|
6366
|
-
/* @__PURE__ */
|
|
6367
|
-
/* @__PURE__ */
|
|
6368
|
-
/* @__PURE__ */
|
|
6497
|
+
/* @__PURE__ */ jsxs21("div", { children: [
|
|
6498
|
+
/* @__PURE__ */ jsx42(ReloadOutlined2, { style: { color: "#faad14", marginRight: 8 } }),
|
|
6499
|
+
/* @__PURE__ */ jsx42("strong", { children: "Requires restart:" }),
|
|
6369
6500
|
" PORT (server must be restarted to change port)"
|
|
6370
6501
|
] })
|
|
6371
6502
|
] }),
|
|
@@ -6374,8 +6505,8 @@ var SettingsModal = ({
|
|
|
6374
6505
|
className: styles.alertCard
|
|
6375
6506
|
}
|
|
6376
6507
|
),
|
|
6377
|
-
/* @__PURE__ */
|
|
6378
|
-
/* @__PURE__ */
|
|
6508
|
+
/* @__PURE__ */ jsx42("div", { style: { marginBottom: 24 }, children: /* @__PURE__ */ jsx42(Text13, { type: "secondary", style: { fontSize: 14, lineHeight: 1.6 }, children: "Configure environment variables in .env format (key=value). One variable per line. Leave password fields empty to keep current values." }) }),
|
|
6509
|
+
/* @__PURE__ */ jsx42(
|
|
6379
6510
|
TextArea,
|
|
6380
6511
|
{
|
|
6381
6512
|
value: config.envText,
|
|
@@ -6452,10 +6583,10 @@ QUEUE_NAME=tasks`,
|
|
|
6452
6583
|
}));
|
|
6453
6584
|
}
|
|
6454
6585
|
};
|
|
6455
|
-
return /* @__PURE__ */
|
|
6456
|
-
/* @__PURE__ */
|
|
6457
|
-
config.models.map((model, index) => /* @__PURE__ */
|
|
6458
|
-
/* @__PURE__ */
|
|
6586
|
+
return /* @__PURE__ */ jsxs21("div", { className: styles.formContainer, children: [
|
|
6587
|
+
/* @__PURE__ */ jsx42("div", { style: { marginBottom: 32 }, children: /* @__PURE__ */ jsx42(Text13, { type: "secondary", style: { fontSize: 14, lineHeight: 1.6 }, children: "Configure model lattices. Each model will be registered with the provided key and can be used by agents." }) }),
|
|
6588
|
+
config.models.map((model, index) => /* @__PURE__ */ jsxs21("div", { className: styles.card, children: [
|
|
6589
|
+
/* @__PURE__ */ jsxs21(
|
|
6459
6590
|
"div",
|
|
6460
6591
|
{
|
|
6461
6592
|
style: {
|
|
@@ -6467,13 +6598,13 @@ QUEUE_NAME=tasks`,
|
|
|
6467
6598
|
borderBottom: "1px solid rgba(0, 0, 0, 0.06)"
|
|
6468
6599
|
},
|
|
6469
6600
|
children: [
|
|
6470
|
-
/* @__PURE__ */
|
|
6471
|
-
/* @__PURE__ */
|
|
6601
|
+
/* @__PURE__ */ jsxs21("div", { children: [
|
|
6602
|
+
/* @__PURE__ */ jsxs21(Text13, { strong: true, style: { fontSize: 16 }, children: [
|
|
6472
6603
|
"Model ",
|
|
6473
6604
|
index + 1
|
|
6474
6605
|
] }),
|
|
6475
|
-
model.key && /* @__PURE__ */
|
|
6476
|
-
|
|
6606
|
+
model.key && /* @__PURE__ */ jsxs21(
|
|
6607
|
+
Text13,
|
|
6477
6608
|
{
|
|
6478
6609
|
type: "secondary",
|
|
6479
6610
|
style: { marginLeft: 8, fontSize: 12 },
|
|
@@ -6485,8 +6616,8 @@ QUEUE_NAME=tasks`,
|
|
|
6485
6616
|
}
|
|
6486
6617
|
)
|
|
6487
6618
|
] }),
|
|
6488
|
-
config.models.length > 1 && /* @__PURE__ */
|
|
6489
|
-
|
|
6619
|
+
config.models.length > 1 && /* @__PURE__ */ jsx42(
|
|
6620
|
+
Button14,
|
|
6490
6621
|
{
|
|
6491
6622
|
type: "text",
|
|
6492
6623
|
danger: true,
|
|
@@ -6502,10 +6633,10 @@ QUEUE_NAME=tasks`,
|
|
|
6502
6633
|
]
|
|
6503
6634
|
}
|
|
6504
6635
|
),
|
|
6505
|
-
/* @__PURE__ */
|
|
6506
|
-
/* @__PURE__ */
|
|
6507
|
-
/* @__PURE__ */
|
|
6508
|
-
/* @__PURE__ */
|
|
6636
|
+
/* @__PURE__ */ jsxs21(Space14, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
|
|
6637
|
+
/* @__PURE__ */ jsxs21("div", { children: [
|
|
6638
|
+
/* @__PURE__ */ jsx42(Text13, { className: styles.formLabel, children: "Key *" }),
|
|
6639
|
+
/* @__PURE__ */ jsx42(
|
|
6509
6640
|
Input,
|
|
6510
6641
|
{
|
|
6511
6642
|
placeholder: "e.g., default, gpt-4, claude",
|
|
@@ -6514,11 +6645,11 @@ QUEUE_NAME=tasks`,
|
|
|
6514
6645
|
style: { height: 40 }
|
|
6515
6646
|
}
|
|
6516
6647
|
),
|
|
6517
|
-
/* @__PURE__ */
|
|
6648
|
+
/* @__PURE__ */ jsx42(Text13, { className: styles.formDescription, children: "Unique identifier for this model" })
|
|
6518
6649
|
] }),
|
|
6519
|
-
/* @__PURE__ */
|
|
6520
|
-
/* @__PURE__ */
|
|
6521
|
-
/* @__PURE__ */
|
|
6650
|
+
/* @__PURE__ */ jsxs21("div", { children: [
|
|
6651
|
+
/* @__PURE__ */ jsx42(Text13, { className: styles.formLabel, children: "Provider *" }),
|
|
6652
|
+
/* @__PURE__ */ jsx42(
|
|
6522
6653
|
Select,
|
|
6523
6654
|
{
|
|
6524
6655
|
style: { width: "100%", height: 40 },
|
|
@@ -6534,9 +6665,9 @@ QUEUE_NAME=tasks`,
|
|
|
6534
6665
|
}
|
|
6535
6666
|
)
|
|
6536
6667
|
] }),
|
|
6537
|
-
/* @__PURE__ */
|
|
6538
|
-
/* @__PURE__ */
|
|
6539
|
-
/* @__PURE__ */
|
|
6668
|
+
/* @__PURE__ */ jsxs21("div", { children: [
|
|
6669
|
+
/* @__PURE__ */ jsx42(Text13, { className: styles.formLabel, children: "Model Name *" }),
|
|
6670
|
+
/* @__PURE__ */ jsx42(
|
|
6540
6671
|
Input,
|
|
6541
6672
|
{
|
|
6542
6673
|
placeholder: "e.g., gpt-4, claude-3-opus, kimi-k2-250905",
|
|
@@ -6546,9 +6677,9 @@ QUEUE_NAME=tasks`,
|
|
|
6546
6677
|
}
|
|
6547
6678
|
)
|
|
6548
6679
|
] }),
|
|
6549
|
-
/* @__PURE__ */
|
|
6550
|
-
/* @__PURE__ */
|
|
6551
|
-
/* @__PURE__ */
|
|
6680
|
+
/* @__PURE__ */ jsxs21("div", { children: [
|
|
6681
|
+
/* @__PURE__ */ jsx42(Text13, { className: styles.formLabel, children: "API Key" }),
|
|
6682
|
+
/* @__PURE__ */ jsx42(
|
|
6552
6683
|
Input.Password,
|
|
6553
6684
|
{
|
|
6554
6685
|
placeholder: "Enter your API key",
|
|
@@ -6557,11 +6688,11 @@ QUEUE_NAME=tasks`,
|
|
|
6557
6688
|
style: { height: 40 }
|
|
6558
6689
|
}
|
|
6559
6690
|
),
|
|
6560
|
-
/* @__PURE__ */
|
|
6691
|
+
/* @__PURE__ */ jsx42(Text13, { className: styles.formDescription, children: "API key for the model provider. Leave empty to use environment variable." })
|
|
6561
6692
|
] }),
|
|
6562
|
-
/* @__PURE__ */
|
|
6563
|
-
/* @__PURE__ */
|
|
6564
|
-
/* @__PURE__ */
|
|
6693
|
+
/* @__PURE__ */ jsxs21("div", { children: [
|
|
6694
|
+
/* @__PURE__ */ jsx42(Text13, { className: styles.formLabel, children: "Base URL" }),
|
|
6695
|
+
/* @__PURE__ */ jsx42(
|
|
6565
6696
|
Input,
|
|
6566
6697
|
{
|
|
6567
6698
|
placeholder: "e.g., https://api.openai.com/v1",
|
|
@@ -6570,22 +6701,22 @@ QUEUE_NAME=tasks`,
|
|
|
6570
6701
|
style: { height: 40 }
|
|
6571
6702
|
}
|
|
6572
6703
|
),
|
|
6573
|
-
/* @__PURE__ */
|
|
6704
|
+
/* @__PURE__ */ jsx42(Text13, { className: styles.formDescription, children: "Optional custom base URL for the API" })
|
|
6574
6705
|
] }),
|
|
6575
|
-
/* @__PURE__ */
|
|
6576
|
-
/* @__PURE__ */
|
|
6706
|
+
/* @__PURE__ */ jsx42("div", { children: /* @__PURE__ */ jsxs21(Space14, { children: [
|
|
6707
|
+
/* @__PURE__ */ jsx42(
|
|
6577
6708
|
Switch,
|
|
6578
6709
|
{
|
|
6579
6710
|
checked: model.streaming,
|
|
6580
6711
|
onChange: (checked) => handleModelChange(index, "streaming", checked)
|
|
6581
6712
|
}
|
|
6582
6713
|
),
|
|
6583
|
-
/* @__PURE__ */
|
|
6714
|
+
/* @__PURE__ */ jsx42(Text13, { children: "Enable Streaming" })
|
|
6584
6715
|
] }) }),
|
|
6585
|
-
/* @__PURE__ */
|
|
6586
|
-
/* @__PURE__ */
|
|
6587
|
-
/* @__PURE__ */
|
|
6588
|
-
/* @__PURE__ */
|
|
6716
|
+
/* @__PURE__ */ jsxs21("div", { style: { display: "flex", gap: 20 }, children: [
|
|
6717
|
+
/* @__PURE__ */ jsxs21("div", { style: { flex: 1 }, children: [
|
|
6718
|
+
/* @__PURE__ */ jsx42(Text13, { className: styles.formLabel, children: "Max Tokens" }),
|
|
6719
|
+
/* @__PURE__ */ jsx42(
|
|
6589
6720
|
Input,
|
|
6590
6721
|
{
|
|
6591
6722
|
type: "number",
|
|
@@ -6600,9 +6731,9 @@ QUEUE_NAME=tasks`,
|
|
|
6600
6731
|
}
|
|
6601
6732
|
)
|
|
6602
6733
|
] }),
|
|
6603
|
-
/* @__PURE__ */
|
|
6604
|
-
/* @__PURE__ */
|
|
6605
|
-
/* @__PURE__ */
|
|
6734
|
+
/* @__PURE__ */ jsxs21("div", { style: { flex: 1 }, children: [
|
|
6735
|
+
/* @__PURE__ */ jsx42(Text13, { className: styles.formLabel, children: "Temperature" }),
|
|
6736
|
+
/* @__PURE__ */ jsx42(
|
|
6606
6737
|
Input,
|
|
6607
6738
|
{
|
|
6608
6739
|
type: "number",
|
|
@@ -6621,8 +6752,8 @@ QUEUE_NAME=tasks`,
|
|
|
6621
6752
|
] })
|
|
6622
6753
|
] })
|
|
6623
6754
|
] }, index)),
|
|
6624
|
-
/* @__PURE__ */
|
|
6625
|
-
|
|
6755
|
+
/* @__PURE__ */ jsx42(
|
|
6756
|
+
Button14,
|
|
6626
6757
|
{
|
|
6627
6758
|
type: "dashed",
|
|
6628
6759
|
onClick: handleAddModel,
|
|
@@ -6649,8 +6780,8 @@ QUEUE_NAME=tasks`,
|
|
|
6649
6780
|
);
|
|
6650
6781
|
const currentConnection = connections.find((c) => c.id === activeTabKey);
|
|
6651
6782
|
const renderTabLabel = (connection) => {
|
|
6652
|
-
return /* @__PURE__ */
|
|
6653
|
-
/* @__PURE__ */
|
|
6783
|
+
return /* @__PURE__ */ jsxs21("div", { style: { display: "flex", alignItems: "center" }, children: [
|
|
6784
|
+
/* @__PURE__ */ jsx42(
|
|
6654
6785
|
CloudServerOutlined,
|
|
6655
6786
|
{
|
|
6656
6787
|
style: {
|
|
@@ -6659,14 +6790,14 @@ QUEUE_NAME=tasks`,
|
|
|
6659
6790
|
}
|
|
6660
6791
|
}
|
|
6661
6792
|
),
|
|
6662
|
-
/* @__PURE__ */
|
|
6663
|
-
connection.connected && /* @__PURE__ */
|
|
6793
|
+
/* @__PURE__ */ jsx42("span", { children: connection.name }),
|
|
6794
|
+
connection.connected && /* @__PURE__ */ jsx42(
|
|
6664
6795
|
CheckCircleFilled,
|
|
6665
6796
|
{
|
|
6666
6797
|
style: { color: "#52c41a", fontSize: 12, marginLeft: 8 }
|
|
6667
6798
|
}
|
|
6668
6799
|
),
|
|
6669
|
-
connection.error && !connection.connecting && /* @__PURE__ */
|
|
6800
|
+
connection.error && !connection.connecting && /* @__PURE__ */ jsx42(
|
|
6670
6801
|
CloseCircleFilled,
|
|
6671
6802
|
{
|
|
6672
6803
|
style: { color: "#ff4d4f", fontSize: 12, marginLeft: 8 }
|
|
@@ -6677,35 +6808,35 @@ QUEUE_NAME=tasks`,
|
|
|
6677
6808
|
const tabItems = connections.map((connection) => ({
|
|
6678
6809
|
key: connection.id,
|
|
6679
6810
|
label: renderTabLabel(connection),
|
|
6680
|
-
children: /* @__PURE__ */
|
|
6681
|
-
/* @__PURE__ */
|
|
6811
|
+
children: /* @__PURE__ */ jsx42("div", { className: styles.tabContent, children: connection.connected ? /* @__PURE__ */ jsx42(Fragment6, { children: /* @__PURE__ */ jsxs21("div", { style: { display: "flex", height: "100%" }, children: [
|
|
6812
|
+
/* @__PURE__ */ jsx42("div", { className: styles.sidebar, children: SETTINGS_MENU_ITEMS.map((item) => /* @__PURE__ */ jsxs21(
|
|
6682
6813
|
"div",
|
|
6683
6814
|
{
|
|
6684
6815
|
className: `${styles.menuItem} ${activeMenu === item.key ? "active" : ""}`,
|
|
6685
6816
|
onClick: () => setActiveMenu(item.key),
|
|
6686
6817
|
children: [
|
|
6687
|
-
/* @__PURE__ */
|
|
6688
|
-
/* @__PURE__ */
|
|
6818
|
+
/* @__PURE__ */ jsx42("span", { className: styles.menuItemIcon, children: item.icon }),
|
|
6819
|
+
/* @__PURE__ */ jsx42("span", { className: styles.menuItemText, children: item.label })
|
|
6689
6820
|
]
|
|
6690
6821
|
},
|
|
6691
6822
|
item.key
|
|
6692
6823
|
)) }),
|
|
6693
|
-
/* @__PURE__ */
|
|
6694
|
-
/* @__PURE__ */
|
|
6695
|
-
/* @__PURE__ */
|
|
6696
|
-
/* @__PURE__ */
|
|
6697
|
-
/* @__PURE__ */
|
|
6824
|
+
/* @__PURE__ */ jsxs21("div", { className: styles.content, children: [
|
|
6825
|
+
/* @__PURE__ */ jsxs21("div", { className: styles.contentHeader, children: [
|
|
6826
|
+
/* @__PURE__ */ jsxs21("div", { className: styles.contentHeaderLeft, children: [
|
|
6827
|
+
/* @__PURE__ */ jsx42(Title2, { level: 3, className: styles.contentTitle, children: activeMenuItem?.label }),
|
|
6828
|
+
/* @__PURE__ */ jsxs21(Text13, { className: styles.contentDescription, children: [
|
|
6698
6829
|
activeMenu === "environment" && "Manage environment variables for the gateway server",
|
|
6699
6830
|
activeMenu === "models" && "Configure and register model lattices for use by agents"
|
|
6700
6831
|
] })
|
|
6701
6832
|
] }),
|
|
6702
|
-
/* @__PURE__ */
|
|
6703
|
-
/* @__PURE__ */
|
|
6704
|
-
/* @__PURE__ */
|
|
6705
|
-
|
|
6833
|
+
/* @__PURE__ */ jsxs21("div", { className: styles.contentHeaderRight, children: [
|
|
6834
|
+
/* @__PURE__ */ jsx42(Button14, { onClick: onClose, children: "Cancel" }),
|
|
6835
|
+
/* @__PURE__ */ jsx42(
|
|
6836
|
+
Button14,
|
|
6706
6837
|
{
|
|
6707
6838
|
type: "primary",
|
|
6708
|
-
icon: /* @__PURE__ */
|
|
6839
|
+
icon: /* @__PURE__ */ jsx42(SaveOutlined, {}),
|
|
6709
6840
|
onClick: handleSave,
|
|
6710
6841
|
loading,
|
|
6711
6842
|
children: "Save Configuration"
|
|
@@ -6713,9 +6844,9 @@ QUEUE_NAME=tasks`,
|
|
|
6713
6844
|
)
|
|
6714
6845
|
] })
|
|
6715
6846
|
] }),
|
|
6716
|
-
/* @__PURE__ */
|
|
6847
|
+
/* @__PURE__ */ jsx42("div", { className: styles.contentBody, children: renderContent(connection.id) })
|
|
6717
6848
|
] })
|
|
6718
|
-
] }) }) : /* @__PURE__ */
|
|
6849
|
+
] }) }) : /* @__PURE__ */ jsx42(
|
|
6719
6850
|
"div",
|
|
6720
6851
|
{
|
|
6721
6852
|
style: {
|
|
@@ -6727,29 +6858,29 @@ QUEUE_NAME=tasks`,
|
|
|
6727
6858
|
gap: 16,
|
|
6728
6859
|
padding: 48
|
|
6729
6860
|
},
|
|
6730
|
-
children: connection.connecting ? /* @__PURE__ */
|
|
6731
|
-
/* @__PURE__ */
|
|
6732
|
-
/* @__PURE__ */
|
|
6733
|
-
/* @__PURE__ */
|
|
6861
|
+
children: connection.connecting ? /* @__PURE__ */ jsxs21(Fragment6, { children: [
|
|
6862
|
+
/* @__PURE__ */ jsx42(LinkOutlined, { style: { fontSize: 64, color: "#1890ff" }, spin: true }),
|
|
6863
|
+
/* @__PURE__ */ jsx42(Title2, { level: 4, children: "Connecting..." }),
|
|
6864
|
+
/* @__PURE__ */ jsxs21(Text13, { type: "secondary", style: { textAlign: "center" }, children: [
|
|
6734
6865
|
"Connecting to ",
|
|
6735
6866
|
connection.url
|
|
6736
6867
|
] })
|
|
6737
|
-
] }) : /* @__PURE__ */
|
|
6738
|
-
/* @__PURE__ */
|
|
6739
|
-
/* @__PURE__ */
|
|
6740
|
-
/* @__PURE__ */
|
|
6741
|
-
|
|
6868
|
+
] }) : /* @__PURE__ */ jsxs21(Fragment6, { children: [
|
|
6869
|
+
/* @__PURE__ */ jsx42(LinkOutlined, { style: { fontSize: 64, color: "#d9d9d9" } }),
|
|
6870
|
+
/* @__PURE__ */ jsx42(Title2, { level: 4, type: "secondary", children: connection.error || "Not Connected" }),
|
|
6871
|
+
/* @__PURE__ */ jsx42(
|
|
6872
|
+
Text13,
|
|
6742
6873
|
{
|
|
6743
6874
|
type: "secondary",
|
|
6744
6875
|
style: { textAlign: "center", maxWidth: 400 },
|
|
6745
6876
|
children: connection.error ? `Failed to connect to ${connection.url}. Please check the server URL and try again.` : `Click "Reconnect" to connect to ${connection.url}`
|
|
6746
6877
|
}
|
|
6747
6878
|
),
|
|
6748
|
-
/* @__PURE__ */
|
|
6749
|
-
|
|
6879
|
+
/* @__PURE__ */ jsx42(
|
|
6880
|
+
Button14,
|
|
6750
6881
|
{
|
|
6751
6882
|
type: "primary",
|
|
6752
|
-
icon: /* @__PURE__ */
|
|
6883
|
+
icon: /* @__PURE__ */ jsx42(LinkOutlined, {}),
|
|
6753
6884
|
onClick: () => checkConnection(connection.id),
|
|
6754
6885
|
loading: connection.connecting,
|
|
6755
6886
|
style: { marginTop: 16 },
|
|
@@ -6761,8 +6892,8 @@ QUEUE_NAME=tasks`,
|
|
|
6761
6892
|
) }),
|
|
6762
6893
|
closable: connections.length > 1
|
|
6763
6894
|
}));
|
|
6764
|
-
return /* @__PURE__ */
|
|
6765
|
-
/* @__PURE__ */
|
|
6895
|
+
return /* @__PURE__ */ jsxs21(Fragment6, { children: [
|
|
6896
|
+
/* @__PURE__ */ jsx42(
|
|
6766
6897
|
Modal,
|
|
6767
6898
|
{
|
|
6768
6899
|
open,
|
|
@@ -6771,7 +6902,7 @@ QUEUE_NAME=tasks`,
|
|
|
6771
6902
|
width: "80%",
|
|
6772
6903
|
footer: null,
|
|
6773
6904
|
title: "Settings",
|
|
6774
|
-
children: /* @__PURE__ */
|
|
6905
|
+
children: /* @__PURE__ */ jsx42("div", { children: /* @__PURE__ */ jsx42(
|
|
6775
6906
|
Tabs2,
|
|
6776
6907
|
{
|
|
6777
6908
|
activeKey: activeTabKey,
|
|
@@ -6785,7 +6916,7 @@ QUEUE_NAME=tasks`,
|
|
|
6785
6916
|
}
|
|
6786
6917
|
},
|
|
6787
6918
|
items: tabItems,
|
|
6788
|
-
addIcon: /* @__PURE__ */
|
|
6919
|
+
addIcon: /* @__PURE__ */ jsxs21(
|
|
6789
6920
|
"div",
|
|
6790
6921
|
{
|
|
6791
6922
|
style: {
|
|
@@ -6795,8 +6926,8 @@ QUEUE_NAME=tasks`,
|
|
|
6795
6926
|
padding: "4px 8px"
|
|
6796
6927
|
},
|
|
6797
6928
|
children: [
|
|
6798
|
-
/* @__PURE__ */
|
|
6799
|
-
/* @__PURE__ */
|
|
6929
|
+
/* @__PURE__ */ jsx42(PlusOutlined, {}),
|
|
6930
|
+
/* @__PURE__ */ jsx42("span", { children: "Add Server" })
|
|
6800
6931
|
]
|
|
6801
6932
|
}
|
|
6802
6933
|
)
|
|
@@ -6804,7 +6935,7 @@ QUEUE_NAME=tasks`,
|
|
|
6804
6935
|
) })
|
|
6805
6936
|
}
|
|
6806
6937
|
),
|
|
6807
|
-
/* @__PURE__ */
|
|
6938
|
+
/* @__PURE__ */ jsx42(
|
|
6808
6939
|
Modal,
|
|
6809
6940
|
{
|
|
6810
6941
|
title: "Add New Server",
|
|
@@ -6818,10 +6949,10 @@ QUEUE_NAME=tasks`,
|
|
|
6818
6949
|
},
|
|
6819
6950
|
confirmLoading: addingServer,
|
|
6820
6951
|
className: styles.addServerModal,
|
|
6821
|
-
children: /* @__PURE__ */
|
|
6822
|
-
/* @__PURE__ */
|
|
6823
|
-
/* @__PURE__ */
|
|
6824
|
-
/* @__PURE__ */
|
|
6952
|
+
children: /* @__PURE__ */ jsxs21(Space14, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
|
|
6953
|
+
/* @__PURE__ */ jsxs21("div", { children: [
|
|
6954
|
+
/* @__PURE__ */ jsx42(Text13, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server Name" }),
|
|
6955
|
+
/* @__PURE__ */ jsx42(
|
|
6825
6956
|
Input,
|
|
6826
6957
|
{
|
|
6827
6958
|
placeholder: "e.g., Production Server",
|
|
@@ -6830,11 +6961,11 @@ QUEUE_NAME=tasks`,
|
|
|
6830
6961
|
onPressEnter: handleAddServer
|
|
6831
6962
|
}
|
|
6832
6963
|
),
|
|
6833
|
-
/* @__PURE__ */
|
|
6964
|
+
/* @__PURE__ */ jsx42(Text13, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: Leave empty to use URL as name" })
|
|
6834
6965
|
] }),
|
|
6835
|
-
/* @__PURE__ */
|
|
6836
|
-
/* @__PURE__ */
|
|
6837
|
-
/* @__PURE__ */
|
|
6966
|
+
/* @__PURE__ */ jsxs21("div", { children: [
|
|
6967
|
+
/* @__PURE__ */ jsx42(Text13, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server URL *" }),
|
|
6968
|
+
/* @__PURE__ */ jsx42(
|
|
6838
6969
|
Input,
|
|
6839
6970
|
{
|
|
6840
6971
|
placeholder: "e.g., http://localhost:4001",
|
|
@@ -6843,11 +6974,11 @@ QUEUE_NAME=tasks`,
|
|
|
6843
6974
|
onPressEnter: handleAddServer
|
|
6844
6975
|
}
|
|
6845
6976
|
),
|
|
6846
|
-
/* @__PURE__ */
|
|
6977
|
+
/* @__PURE__ */ jsx42(Text13, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Enter the full URL of the gateway server" })
|
|
6847
6978
|
] }),
|
|
6848
|
-
/* @__PURE__ */
|
|
6849
|
-
/* @__PURE__ */
|
|
6850
|
-
/* @__PURE__ */
|
|
6979
|
+
/* @__PURE__ */ jsxs21("div", { children: [
|
|
6980
|
+
/* @__PURE__ */ jsx42(Text13, { strong: true, style: { display: "block", marginBottom: 8 }, children: "API Key" }),
|
|
6981
|
+
/* @__PURE__ */ jsx42(
|
|
6851
6982
|
Input.Password,
|
|
6852
6983
|
{
|
|
6853
6984
|
placeholder: "Optional: Enter API key for authentication",
|
|
@@ -6856,7 +6987,7 @@ QUEUE_NAME=tasks`,
|
|
|
6856
6987
|
onPressEnter: handleAddServer
|
|
6857
6988
|
}
|
|
6858
6989
|
),
|
|
6859
|
-
/* @__PURE__ */
|
|
6990
|
+
/* @__PURE__ */ jsx42(Text13, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: API key for server authentication" })
|
|
6860
6991
|
] })
|
|
6861
6992
|
] })
|
|
6862
6993
|
}
|
|
@@ -6865,10 +6996,10 @@ QUEUE_NAME=tasks`,
|
|
|
6865
6996
|
};
|
|
6866
6997
|
|
|
6867
6998
|
// src/components/Chat/AgentServerSetting.tsx
|
|
6868
|
-
import { jsx as
|
|
6999
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
6869
7000
|
var AgentServerSetting = () => {
|
|
6870
7001
|
const { settingsModalOpen, setSettingsModalOpen } = useLatticeChatShellContext();
|
|
6871
|
-
return /* @__PURE__ */
|
|
7002
|
+
return /* @__PURE__ */ jsx43(
|
|
6872
7003
|
SettingsModal,
|
|
6873
7004
|
{
|
|
6874
7005
|
open: settingsModalOpen,
|
|
@@ -6878,11 +7009,11 @@ var AgentServerSetting = () => {
|
|
|
6878
7009
|
};
|
|
6879
7010
|
|
|
6880
7011
|
// src/components/Chat/LatticeChatShell.tsx
|
|
6881
|
-
import { jsx as
|
|
7012
|
+
import { jsx as jsx44, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
6882
7013
|
var LatticeChatShell = (props) => {
|
|
6883
|
-
return /* @__PURE__ */
|
|
6884
|
-
/* @__PURE__ */
|
|
6885
|
-
/* @__PURE__ */
|
|
7014
|
+
return /* @__PURE__ */ jsxs22(LatticeChatShellContextProvider, { ...props, children: [
|
|
7015
|
+
/* @__PURE__ */ jsx44(AssistantContextProvider, { autoLoad: true, children: /* @__PURE__ */ jsx44(ConversationContextProvider, { children: /* @__PURE__ */ jsx44(LatticeChatView, {}) }) }),
|
|
7016
|
+
/* @__PURE__ */ jsx44(AgentServerSetting, {})
|
|
6886
7017
|
] });
|
|
6887
7018
|
};
|
|
6888
7019
|
export {
|
|
@@ -6902,7 +7033,6 @@ export {
|
|
|
6902
7033
|
LatticeChatShell,
|
|
6903
7034
|
LatticeChatShellContext,
|
|
6904
7035
|
LatticeChatShellContextProvider,
|
|
6905
|
-
MDMermaid,
|
|
6906
7036
|
MDResponse,
|
|
6907
7037
|
MDViewFormItem,
|
|
6908
7038
|
SideAppViewBrowser,
|