@axiom-lattice/react-sdk 2.1.27 → 2.1.28
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 +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +716 -725
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +776 -786
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -980,40 +980,16 @@ var useStyle = createStyles(({ token, css }) => {
|
|
|
980
980
|
}
|
|
981
981
|
`,
|
|
982
982
|
menu: css`
|
|
983
|
-
background: ${token.colorBgContainer}90;
|
|
984
|
-
width:
|
|
983
|
+
// background: ${token.colorBgContainer}90;
|
|
984
|
+
width: 60px;
|
|
985
985
|
display: flex;
|
|
986
986
|
flex-direction: column;
|
|
987
987
|
flex-shrink: 0;
|
|
988
988
|
transition: all 0.3s ease;
|
|
989
989
|
overflow: hidden;
|
|
990
990
|
position: relative;
|
|
991
|
-
border-radius: ${token.borderRadiusLG}px;
|
|
992
|
-
box-shadow: ${token.boxShadow};
|
|
993
|
-
|
|
994
|
-
&.open {
|
|
995
|
-
background: transparent;
|
|
996
|
-
box-shadow: none;
|
|
997
|
-
margin-left: -8px;
|
|
998
|
-
height: 100%;
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
&.collapsed {
|
|
1002
|
-
width: 8px;
|
|
1003
|
-
height: 100%;
|
|
1004
|
-
margin-right: -8px;
|
|
1005
|
-
.ant-conversations {
|
|
1006
|
-
width: 64px;
|
|
1007
|
-
}
|
|
1008
|
-
|
|
1009
|
-
.ant-conversations-list {
|
|
1010
|
-
display: none !important;
|
|
1011
|
-
}
|
|
1012
|
-
|
|
1013
|
-
.btn-text {
|
|
1014
|
-
display: none !important;
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
991
|
+
// border-radius: ${token.borderRadiusLG}px;
|
|
992
|
+
// box-shadow: ${token.boxShadow};
|
|
1017
993
|
`,
|
|
1018
994
|
menuToggle: css`
|
|
1019
995
|
position: relative;
|
|
@@ -2442,7 +2418,11 @@ var ToolCall = ({ data }) => {
|
|
|
2442
2418
|
const expandIcon = ({ isActive }) => {
|
|
2443
2419
|
return getStatusIcon(toolCallData.status);
|
|
2444
2420
|
};
|
|
2445
|
-
|
|
2421
|
+
let toolCallName = toolCallData.name.toLowerCase();
|
|
2422
|
+
if (toolCallName.startsWith("browser_")) {
|
|
2423
|
+
toolCallName = "browser_viewer";
|
|
2424
|
+
}
|
|
2425
|
+
const toolCallElement = getElement(toolCallName);
|
|
2446
2426
|
if (toolCallElement) {
|
|
2447
2427
|
return toolCallElement.card_view({
|
|
2448
2428
|
data: toolCallData,
|
|
@@ -3267,7 +3247,7 @@ var AttachmentsCard = ({
|
|
|
3267
3247
|
columns = 1,
|
|
3268
3248
|
showDownloadButton = false
|
|
3269
3249
|
}) => {
|
|
3270
|
-
const { Text:
|
|
3250
|
+
const { Text: Text18 } = Typography7;
|
|
3271
3251
|
const [showAll, setShowAll] = useState13(false);
|
|
3272
3252
|
const { openSideApp } = useChatUIContext();
|
|
3273
3253
|
const getStyles = () => {
|
|
@@ -3342,7 +3322,7 @@ var AttachmentsCard = ({
|
|
|
3342
3322
|
);
|
|
3343
3323
|
};
|
|
3344
3324
|
const renderFileDescription = (item) => /* @__PURE__ */ jsx19(Space7, { direction: "vertical", size: size === "small" ? 2 : 4, children: /* @__PURE__ */ jsx19(Space7, { children: /* @__PURE__ */ jsx19(
|
|
3345
|
-
|
|
3325
|
+
Text18,
|
|
3346
3326
|
{
|
|
3347
3327
|
type: "secondary",
|
|
3348
3328
|
style: {
|
|
@@ -3414,7 +3394,7 @@ var AttachmentsCard = ({
|
|
|
3414
3394
|
}
|
|
3415
3395
|
),
|
|
3416
3396
|
item.files && /* @__PURE__ */ jsxs10("div", { style: { paddingLeft: "12px" }, children: [
|
|
3417
|
-
/* @__PURE__ */ jsxs10(
|
|
3397
|
+
/* @__PURE__ */ jsxs10(Text18, { type: "secondary", style: { fontSize: "12px" }, children: [
|
|
3418
3398
|
"\u5305\u542B\u6587\u4EF6(",
|
|
3419
3399
|
item.files.length,
|
|
3420
3400
|
")"
|
|
@@ -6373,6 +6353,99 @@ var ScheduleViewer = ({ data }) => {
|
|
|
6373
6353
|
] });
|
|
6374
6354
|
};
|
|
6375
6355
|
|
|
6356
|
+
// src/components/GenUI/elements/browser_view_card.tsx
|
|
6357
|
+
import { Button as Button16, Flex as Flex6, Typography as Typography15 } from "antd";
|
|
6358
|
+
import { CheckCircleOutlined as CheckCircleOutlined5, InfoCircleOutlined as InfoCircleOutlined2, LoadingOutlined as LoadingOutlined3 } from "@ant-design/icons";
|
|
6359
|
+
import { jsx as jsx40, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
6360
|
+
var { Text: Text13 } = Typography15;
|
|
6361
|
+
var BrowserViewer = ({
|
|
6362
|
+
data,
|
|
6363
|
+
component_key,
|
|
6364
|
+
interactive = true
|
|
6365
|
+
}) => {
|
|
6366
|
+
const toolCallData = data;
|
|
6367
|
+
const { threadId, assistantId } = useConversationContext();
|
|
6368
|
+
const { config } = useLatticeChatShellContext();
|
|
6369
|
+
const ws_path = `/sandbox/assistants/${assistantId}/threads/${threadId}/sandbox/websockify`;
|
|
6370
|
+
let targetUrl = `/api/assistants/${assistantId}/threads/${threadId}/sandbox?autoconnect=true&resize=scale&reconnect=1&path${ws_path}`;
|
|
6371
|
+
if (config.globalSharedSandboxURL) {
|
|
6372
|
+
targetUrl = `${config.globalSharedSandboxURL}/vnc/index.html?autoconnect=true&resize=scale&reconnect=1&path=/sandbox/global/websockify`;
|
|
6373
|
+
}
|
|
6374
|
+
function getStatusIcon3(status) {
|
|
6375
|
+
switch (status) {
|
|
6376
|
+
case "success":
|
|
6377
|
+
return /* @__PURE__ */ jsx40(CheckCircleOutlined5, { style: { color: "#52c41a" } });
|
|
6378
|
+
case "error":
|
|
6379
|
+
return /* @__PURE__ */ jsx40(InfoCircleOutlined2, { style: { color: "#ff4d4f" } });
|
|
6380
|
+
default:
|
|
6381
|
+
return /* @__PURE__ */ jsx40(LoadingOutlined3, { style: { color: "#1890ff" } });
|
|
6382
|
+
}
|
|
6383
|
+
}
|
|
6384
|
+
const formatToolName = (name) => {
|
|
6385
|
+
if (!name) {
|
|
6386
|
+
return "";
|
|
6387
|
+
}
|
|
6388
|
+
return name.replace(/([a-z])([A-Z])/g, "$1 $2").split(/[_-]/).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
6389
|
+
};
|
|
6390
|
+
const formatArgsPreview = (args) => {
|
|
6391
|
+
try {
|
|
6392
|
+
const argsStr = Object.values(args).map((value) => {
|
|
6393
|
+
const valueStr = typeof value === "object" ? JSON.stringify(value).substring(0, 50) + (JSON.stringify(value).length > 50 ? "..." : "") : String(value).substring(0, 50) + (String(value).length > 50 ? "..." : "");
|
|
6394
|
+
return valueStr;
|
|
6395
|
+
}).join(" ");
|
|
6396
|
+
const result = argsStr.length > 100 ? argsStr.substring(0, 100) + "..." : argsStr;
|
|
6397
|
+
return result.replaceAll("\n", " ");
|
|
6398
|
+
} catch (e) {
|
|
6399
|
+
return "Error parsing args";
|
|
6400
|
+
}
|
|
6401
|
+
};
|
|
6402
|
+
const header = /* @__PURE__ */ jsxs22(Flex6, { align: "center", wrap: "wrap", children: [
|
|
6403
|
+
/* @__PURE__ */ jsx40(Typography15.Text, { strong: true, children: formatToolName(toolCallData.name) }),
|
|
6404
|
+
/* @__PURE__ */ jsx40(
|
|
6405
|
+
Typography15.Text,
|
|
6406
|
+
{
|
|
6407
|
+
type: "secondary",
|
|
6408
|
+
style: { fontSize: "12px", marginLeft: "8px" },
|
|
6409
|
+
children: formatArgsPreview(toolCallData.args)
|
|
6410
|
+
}
|
|
6411
|
+
)
|
|
6412
|
+
] });
|
|
6413
|
+
const { openSideApp } = useChatUIContext();
|
|
6414
|
+
if (!toolCallData) {
|
|
6415
|
+
return null;
|
|
6416
|
+
}
|
|
6417
|
+
const handleItemClick = (toolCallData2) => {
|
|
6418
|
+
openSideApp({
|
|
6419
|
+
component_key: "browser_viewer",
|
|
6420
|
+
message: "View Browser",
|
|
6421
|
+
data: {
|
|
6422
|
+
url: targetUrl
|
|
6423
|
+
}
|
|
6424
|
+
});
|
|
6425
|
+
};
|
|
6426
|
+
return /* @__PURE__ */ jsx40(
|
|
6427
|
+
ContentPreviewCollapse,
|
|
6428
|
+
{
|
|
6429
|
+
panelKey: toolCallData.id,
|
|
6430
|
+
header,
|
|
6431
|
+
expandIcon: () => getStatusIcon3(toolCallData.status),
|
|
6432
|
+
extra: /* @__PURE__ */ jsx40(
|
|
6433
|
+
Button16,
|
|
6434
|
+
{
|
|
6435
|
+
type: "link",
|
|
6436
|
+
size: "small",
|
|
6437
|
+
onClick: (evt) => {
|
|
6438
|
+
evt.stopPropagation();
|
|
6439
|
+
handleItemClick(toolCallData);
|
|
6440
|
+
},
|
|
6441
|
+
children: "View Browser"
|
|
6442
|
+
}
|
|
6443
|
+
),
|
|
6444
|
+
children: /* @__PURE__ */ jsx40(MDResponse, { content: toolCallData.response || "" })
|
|
6445
|
+
}
|
|
6446
|
+
);
|
|
6447
|
+
};
|
|
6448
|
+
|
|
6376
6449
|
// src/components/GenUI/elements/builtIns.tsx
|
|
6377
6450
|
var elements = {
|
|
6378
6451
|
action_show_attachments_uploader: {
|
|
@@ -6428,6 +6501,10 @@ var elements = {
|
|
|
6428
6501
|
schedule_viewer: {
|
|
6429
6502
|
card_view: () => null,
|
|
6430
6503
|
side_app_view: ScheduleViewer
|
|
6504
|
+
},
|
|
6505
|
+
browser_viewer: {
|
|
6506
|
+
card_view: BrowserViewer,
|
|
6507
|
+
side_app_view: AttachmentsViewerSideApp
|
|
6431
6508
|
}
|
|
6432
6509
|
};
|
|
6433
6510
|
|
|
@@ -6445,10 +6522,10 @@ var regsiterElement = (language, ElementMeta) => {
|
|
|
6445
6522
|
};
|
|
6446
6523
|
|
|
6447
6524
|
// src/components/Chat/SideAppViewBrowser.tsx
|
|
6448
|
-
import { Button as
|
|
6525
|
+
import { Button as Button17, Tabs } from "antd";
|
|
6449
6526
|
import { createStyles as createStyles12 } from "antd-style";
|
|
6450
6527
|
import { useEffect as useEffect16, useState as useState23 } from "react";
|
|
6451
|
-
import { jsx as
|
|
6528
|
+
import { jsx as jsx41, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
6452
6529
|
var useStyle8 = createStyles12(({ token, css }) => {
|
|
6453
6530
|
return {
|
|
6454
6531
|
tabContainer: css`
|
|
@@ -6468,9 +6545,9 @@ var useStyle8 = createStyles12(({ token, css }) => {
|
|
|
6468
6545
|
};
|
|
6469
6546
|
});
|
|
6470
6547
|
var EmptySideAppView = ({ component_key, data }) => {
|
|
6471
|
-
return /* @__PURE__ */
|
|
6472
|
-
/* @__PURE__ */
|
|
6473
|
-
/* @__PURE__ */
|
|
6548
|
+
return /* @__PURE__ */ jsxs23("div", { children: [
|
|
6549
|
+
/* @__PURE__ */ jsx41("p", { children: "\u672A\u627E\u5230\u5BF9\u5E94\u7684\u7EC4\u4EF6\u89C6\u56FE" }),
|
|
6550
|
+
/* @__PURE__ */ jsx41("pre", { children: JSON.stringify({ component_key, data }, null, 2) })
|
|
6474
6551
|
] });
|
|
6475
6552
|
};
|
|
6476
6553
|
var SideAppViewBrowser = () => {
|
|
@@ -6531,7 +6608,7 @@ var SideAppViewBrowser = () => {
|
|
|
6531
6608
|
add(
|
|
6532
6609
|
key,
|
|
6533
6610
|
sideAppSelectedCard?.message || sideAppSelectedCard?.data.message || "\u672A\u547D\u540D",
|
|
6534
|
-
/* @__PURE__ */
|
|
6611
|
+
/* @__PURE__ */ jsx41(
|
|
6535
6612
|
SideAppView,
|
|
6536
6613
|
{
|
|
6537
6614
|
component_key: sideAppSelectedCard?.component_key || "",
|
|
@@ -6572,16 +6649,16 @@ var SideAppViewBrowser = () => {
|
|
|
6572
6649
|
const getSizeIcon = (size) => {
|
|
6573
6650
|
switch (size) {
|
|
6574
6651
|
case "middle":
|
|
6575
|
-
return /* @__PURE__ */
|
|
6652
|
+
return /* @__PURE__ */ jsx41(CompressOutlined, {});
|
|
6576
6653
|
case "large":
|
|
6577
|
-
return /* @__PURE__ */
|
|
6654
|
+
return /* @__PURE__ */ jsx41(ExpandOutlined, {});
|
|
6578
6655
|
case "full":
|
|
6579
|
-
return /* @__PURE__ */
|
|
6656
|
+
return /* @__PURE__ */ jsx41(FullscreenOutlined, {});
|
|
6580
6657
|
default:
|
|
6581
|
-
return /* @__PURE__ */
|
|
6658
|
+
return /* @__PURE__ */ jsx41(ExpandOutlined, {});
|
|
6582
6659
|
}
|
|
6583
6660
|
};
|
|
6584
|
-
return /* @__PURE__ */
|
|
6661
|
+
return /* @__PURE__ */ jsx41(
|
|
6585
6662
|
Tabs,
|
|
6586
6663
|
{
|
|
6587
6664
|
className: styles.tabContainer,
|
|
@@ -6589,9 +6666,9 @@ var SideAppViewBrowser = () => {
|
|
|
6589
6666
|
style: { height: "100%" },
|
|
6590
6667
|
hideAdd: true,
|
|
6591
6668
|
tabBarExtraContent: {
|
|
6592
|
-
right: /* @__PURE__ */
|
|
6593
|
-
/* @__PURE__ */
|
|
6594
|
-
|
|
6669
|
+
right: /* @__PURE__ */ jsxs23("div", { style: { display: "flex", gap: "4px" }, children: [
|
|
6670
|
+
/* @__PURE__ */ jsx41(
|
|
6671
|
+
Button17,
|
|
6595
6672
|
{
|
|
6596
6673
|
style: { margin: "8px 0" },
|
|
6597
6674
|
size: "large",
|
|
@@ -6601,13 +6678,13 @@ var SideAppViewBrowser = () => {
|
|
|
6601
6678
|
title: `\u5F53\u524D\u5C3A\u5BF8: ${getSizeLabel(sideAppSize)}, \u70B9\u51FB\u5207\u6362`
|
|
6602
6679
|
}
|
|
6603
6680
|
),
|
|
6604
|
-
/* @__PURE__ */
|
|
6605
|
-
|
|
6681
|
+
/* @__PURE__ */ jsx41(
|
|
6682
|
+
Button17,
|
|
6606
6683
|
{
|
|
6607
6684
|
style: { margin: "8px 0" },
|
|
6608
6685
|
size: "large",
|
|
6609
6686
|
type: "text",
|
|
6610
|
-
icon: /* @__PURE__ */
|
|
6687
|
+
icon: /* @__PURE__ */ jsx41(CloseOutlined, {}),
|
|
6611
6688
|
onClick: () => {
|
|
6612
6689
|
closeSideApp();
|
|
6613
6690
|
}
|
|
@@ -6624,10 +6701,10 @@ var SideAppViewBrowser = () => {
|
|
|
6624
6701
|
};
|
|
6625
6702
|
|
|
6626
6703
|
// src/components/Chat/LatticeChat.tsx
|
|
6627
|
-
import { jsx as
|
|
6704
|
+
import { jsx as jsx42, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
6628
6705
|
var LatticeChat = (props) => {
|
|
6629
6706
|
const { assistant_id, thread_id = "", menu, header, ...chatingProps } = props;
|
|
6630
|
-
return /* @__PURE__ */
|
|
6707
|
+
return /* @__PURE__ */ jsx42(
|
|
6631
6708
|
AgentThreadProvider,
|
|
6632
6709
|
{
|
|
6633
6710
|
assistantId: assistant_id,
|
|
@@ -6637,7 +6714,7 @@ var LatticeChat = (props) => {
|
|
|
6637
6714
|
enableReturnStateWhenStreamCompleted: true,
|
|
6638
6715
|
enableResumeStream: true
|
|
6639
6716
|
},
|
|
6640
|
-
children: /* @__PURE__ */
|
|
6717
|
+
children: /* @__PURE__ */ jsx42(ChatUIContextProvider, { children: /* @__PURE__ */ jsxs24(
|
|
6641
6718
|
"div",
|
|
6642
6719
|
{
|
|
6643
6720
|
style: {
|
|
@@ -6648,12 +6725,12 @@ var LatticeChat = (props) => {
|
|
|
6648
6725
|
},
|
|
6649
6726
|
children: [
|
|
6650
6727
|
header,
|
|
6651
|
-
/* @__PURE__ */
|
|
6728
|
+
/* @__PURE__ */ jsx42(
|
|
6652
6729
|
ColumnLayout,
|
|
6653
6730
|
{
|
|
6654
6731
|
menu,
|
|
6655
|
-
left: thread_id ? /* @__PURE__ */
|
|
6656
|
-
right: /* @__PURE__ */
|
|
6732
|
+
left: thread_id ? /* @__PURE__ */ jsx42(Chating, { ...chatingProps }) : /* @__PURE__ */ jsx42("div", { children: "\u9700\u8981\u5148\u521B\u5EFA\u4F1A\u8BDD" }),
|
|
6733
|
+
right: /* @__PURE__ */ jsx42(SideAppViewBrowser, {})
|
|
6657
6734
|
}
|
|
6658
6735
|
)
|
|
6659
6736
|
]
|
|
@@ -6667,7 +6744,7 @@ var LatticeChat = (props) => {
|
|
|
6667
6744
|
import { Conversations } from "@ant-design/x";
|
|
6668
6745
|
import { theme } from "antd";
|
|
6669
6746
|
import { useMemo as useMemo8 } from "react";
|
|
6670
|
-
import { jsx as
|
|
6747
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
6671
6748
|
var AgentConversations = ({
|
|
6672
6749
|
enableThreadCreation = true,
|
|
6673
6750
|
enableThreadList = true
|
|
@@ -6706,7 +6783,7 @@ var AgentConversations = ({
|
|
|
6706
6783
|
const creation = enableThreadCreation ? {
|
|
6707
6784
|
onClick: newChatClick
|
|
6708
6785
|
} : void 0;
|
|
6709
|
-
return /* @__PURE__ */
|
|
6786
|
+
return /* @__PURE__ */ jsx43(
|
|
6710
6787
|
Conversations,
|
|
6711
6788
|
{
|
|
6712
6789
|
creation,
|
|
@@ -6725,57 +6802,14 @@ var AgentConversations = ({
|
|
|
6725
6802
|
import { useContext as useContext8 } from "react";
|
|
6726
6803
|
|
|
6727
6804
|
// src/components/Chat/ChatSidebar.tsx
|
|
6728
|
-
import { useState as
|
|
6729
|
-
import {
|
|
6805
|
+
import { useState as useState29 } from "react";
|
|
6806
|
+
import { Modal as Modal3 } from "antd";
|
|
6730
6807
|
import {
|
|
6731
|
-
MenuFoldOutlined,
|
|
6732
|
-
MenuUnfoldOutlined,
|
|
6733
6808
|
SettingOutlined as SettingOutlined2,
|
|
6734
6809
|
ApartmentOutlined,
|
|
6735
|
-
ThunderboltOutlined as ThunderboltOutlined2
|
|
6810
|
+
ThunderboltOutlined as ThunderboltOutlined2,
|
|
6811
|
+
ToolOutlined as ToolOutlined3
|
|
6736
6812
|
} from "@ant-design/icons";
|
|
6737
|
-
|
|
6738
|
-
// src/components/Chat/AssistantList.tsx
|
|
6739
|
-
import { Conversations as Conversations2 } from "@ant-design/x";
|
|
6740
|
-
import { Avatar as Avatar4, theme as theme2 } from "antd";
|
|
6741
|
-
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
6742
|
-
var AssistantList = () => {
|
|
6743
|
-
const { token } = theme2.useToken();
|
|
6744
|
-
const { assistants, selectAssistant, currentAssistant } = useAssistantContext();
|
|
6745
|
-
const style = {
|
|
6746
|
-
width: "100%",
|
|
6747
|
-
background: "transparent",
|
|
6748
|
-
borderRadius: token.borderRadius
|
|
6749
|
-
};
|
|
6750
|
-
const items = assistants.map((assistant) => ({
|
|
6751
|
-
key: assistant.id,
|
|
6752
|
-
label: assistant.name,
|
|
6753
|
-
icon: /* @__PURE__ */ jsx43(
|
|
6754
|
-
Avatar4,
|
|
6755
|
-
{
|
|
6756
|
-
size: "small",
|
|
6757
|
-
style: {
|
|
6758
|
-
backgroundColor: token.colorFillSecondary,
|
|
6759
|
-
color: token.colorText
|
|
6760
|
-
},
|
|
6761
|
-
children: assistant.name.charAt(0).toUpperCase()
|
|
6762
|
-
}
|
|
6763
|
-
)
|
|
6764
|
-
}));
|
|
6765
|
-
return /* @__PURE__ */ jsx43(
|
|
6766
|
-
Conversations2,
|
|
6767
|
-
{
|
|
6768
|
-
items,
|
|
6769
|
-
activeKey: currentAssistant?.id,
|
|
6770
|
-
style,
|
|
6771
|
-
onActiveChange: (key) => {
|
|
6772
|
-
selectAssistant(key);
|
|
6773
|
-
}
|
|
6774
|
-
}
|
|
6775
|
-
);
|
|
6776
|
-
};
|
|
6777
|
-
|
|
6778
|
-
// src/components/Chat/ChatSidebar.tsx
|
|
6779
6813
|
import { createStyles as createStyles13 } from "antd-style";
|
|
6780
6814
|
|
|
6781
6815
|
// src/components/Chat/AssistantFlow.tsx
|
|
@@ -6793,19 +6827,19 @@ import "@xyflow/react/dist/style.css";
|
|
|
6793
6827
|
// src/components/Chat/AssistantNode.tsx
|
|
6794
6828
|
import { useMemo as useMemo9 } from "react";
|
|
6795
6829
|
import { Handle, Position } from "@xyflow/react";
|
|
6796
|
-
import { Avatar as
|
|
6830
|
+
import { Avatar as Avatar4, Typography as Typography16, theme as theme2, Tag as Tag6, Tooltip as Tooltip8, Space as Space16, Popover as Popover2, Button as Button18, Divider as Divider2 } from "antd";
|
|
6797
6831
|
import {
|
|
6798
6832
|
UserOutlined as UserOutlined3,
|
|
6799
6833
|
ToolOutlined as ToolOutlined2,
|
|
6800
6834
|
SettingOutlined,
|
|
6801
6835
|
IdcardOutlined,
|
|
6802
|
-
InfoCircleOutlined as
|
|
6836
|
+
InfoCircleOutlined as InfoCircleOutlined3,
|
|
6803
6837
|
CopyOutlined as CopyOutlined2,
|
|
6804
6838
|
CodeOutlined as CodeOutlined4,
|
|
6805
6839
|
BranchesOutlined
|
|
6806
6840
|
} from "@ant-design/icons";
|
|
6807
|
-
import { jsx as jsx44, jsxs as
|
|
6808
|
-
var { Text:
|
|
6841
|
+
import { jsx as jsx44, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
6842
|
+
var { Text: Text14 } = Typography16;
|
|
6809
6843
|
var getBadgeColor = (id) => {
|
|
6810
6844
|
const colors = [
|
|
6811
6845
|
"#1890ff",
|
|
@@ -6834,7 +6868,7 @@ var getBadgeColor = (id) => {
|
|
|
6834
6868
|
var AssistantNode = ({
|
|
6835
6869
|
data
|
|
6836
6870
|
}) => {
|
|
6837
|
-
const { token } =
|
|
6871
|
+
const { token } = theme2.useToken();
|
|
6838
6872
|
if (!data) {
|
|
6839
6873
|
return null;
|
|
6840
6874
|
}
|
|
@@ -6886,7 +6920,7 @@ var AssistantNode = ({
|
|
|
6886
6920
|
const handleCopy = (text) => {
|
|
6887
6921
|
navigator.clipboard.writeText(text);
|
|
6888
6922
|
};
|
|
6889
|
-
const detailCardContent = /* @__PURE__ */
|
|
6923
|
+
const detailCardContent = /* @__PURE__ */ jsxs25(
|
|
6890
6924
|
"div",
|
|
6891
6925
|
{
|
|
6892
6926
|
style: {
|
|
@@ -6905,8 +6939,8 @@ var AssistantNode = ({
|
|
|
6905
6939
|
justifyContent: "space-between",
|
|
6906
6940
|
marginBottom: 16
|
|
6907
6941
|
},
|
|
6908
|
-
children: /* @__PURE__ */
|
|
6909
|
-
/* @__PURE__ */
|
|
6942
|
+
children: /* @__PURE__ */ jsxs25("div", { style: { flex: 1 }, children: [
|
|
6943
|
+
/* @__PURE__ */ jsxs25(
|
|
6910
6944
|
"div",
|
|
6911
6945
|
{
|
|
6912
6946
|
style: {
|
|
@@ -6917,7 +6951,7 @@ var AssistantNode = ({
|
|
|
6917
6951
|
},
|
|
6918
6952
|
children: [
|
|
6919
6953
|
/* @__PURE__ */ jsx44(
|
|
6920
|
-
|
|
6954
|
+
Text14,
|
|
6921
6955
|
{
|
|
6922
6956
|
strong: true,
|
|
6923
6957
|
style: {
|
|
@@ -6953,7 +6987,7 @@ var AssistantNode = ({
|
|
|
6953
6987
|
gap: 6
|
|
6954
6988
|
},
|
|
6955
6989
|
children: /* @__PURE__ */ jsx44(
|
|
6956
|
-
|
|
6990
|
+
Text14,
|
|
6957
6991
|
{
|
|
6958
6992
|
style: {
|
|
6959
6993
|
fontSize: 11,
|
|
@@ -6968,8 +7002,8 @@ var AssistantNode = ({
|
|
|
6968
7002
|
] })
|
|
6969
7003
|
}
|
|
6970
7004
|
),
|
|
6971
|
-
assistant.description && /* @__PURE__ */ jsx44("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */
|
|
6972
|
-
|
|
7005
|
+
assistant.description && /* @__PURE__ */ jsx44("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ jsxs25(
|
|
7006
|
+
Text14,
|
|
6973
7007
|
{
|
|
6974
7008
|
style: {
|
|
6975
7009
|
fontSize: 12,
|
|
@@ -6984,8 +7018,8 @@ var AssistantNode = ({
|
|
|
6984
7018
|
]
|
|
6985
7019
|
}
|
|
6986
7020
|
) }),
|
|
6987
|
-
modelKey && /* @__PURE__ */
|
|
6988
|
-
/* @__PURE__ */
|
|
7021
|
+
modelKey && /* @__PURE__ */ jsxs25("div", { style: { marginBottom: 16 }, children: [
|
|
7022
|
+
/* @__PURE__ */ jsxs25(
|
|
6989
7023
|
"div",
|
|
6990
7024
|
{
|
|
6991
7025
|
style: {
|
|
@@ -7005,7 +7039,7 @@ var AssistantNode = ({
|
|
|
7005
7039
|
}
|
|
7006
7040
|
),
|
|
7007
7041
|
/* @__PURE__ */ jsx44(
|
|
7008
|
-
|
|
7042
|
+
Text14,
|
|
7009
7043
|
{
|
|
7010
7044
|
style: {
|
|
7011
7045
|
fontSize: 12,
|
|
@@ -7030,8 +7064,8 @@ var AssistantNode = ({
|
|
|
7030
7064
|
}
|
|
7031
7065
|
)
|
|
7032
7066
|
] }),
|
|
7033
|
-
prompt && /* @__PURE__ */
|
|
7034
|
-
/* @__PURE__ */
|
|
7067
|
+
prompt && /* @__PURE__ */ jsxs25("div", { style: { marginBottom: 16 }, children: [
|
|
7068
|
+
/* @__PURE__ */ jsxs25(
|
|
7035
7069
|
"div",
|
|
7036
7070
|
{
|
|
7037
7071
|
style: {
|
|
@@ -7051,7 +7085,7 @@ var AssistantNode = ({
|
|
|
7051
7085
|
}
|
|
7052
7086
|
),
|
|
7053
7087
|
/* @__PURE__ */ jsx44(
|
|
7054
|
-
|
|
7088
|
+
Text14,
|
|
7055
7089
|
{
|
|
7056
7090
|
style: {
|
|
7057
7091
|
fontSize: 12,
|
|
@@ -7077,7 +7111,7 @@ var AssistantNode = ({
|
|
|
7077
7111
|
overflowY: "auto"
|
|
7078
7112
|
},
|
|
7079
7113
|
children: /* @__PURE__ */ jsx44(
|
|
7080
|
-
|
|
7114
|
+
Text14,
|
|
7081
7115
|
{
|
|
7082
7116
|
style: {
|
|
7083
7117
|
fontSize: 11,
|
|
@@ -7091,8 +7125,8 @@ var AssistantNode = ({
|
|
|
7091
7125
|
}
|
|
7092
7126
|
)
|
|
7093
7127
|
] }),
|
|
7094
|
-
tools && tools.length > 0 && /* @__PURE__ */
|
|
7095
|
-
/* @__PURE__ */
|
|
7128
|
+
tools && tools.length > 0 && /* @__PURE__ */ jsxs25("div", { style: { marginBottom: 16 }, children: [
|
|
7129
|
+
/* @__PURE__ */ jsxs25(
|
|
7096
7130
|
"div",
|
|
7097
7131
|
{
|
|
7098
7132
|
style: {
|
|
@@ -7111,8 +7145,8 @@ var AssistantNode = ({
|
|
|
7111
7145
|
}
|
|
7112
7146
|
}
|
|
7113
7147
|
),
|
|
7114
|
-
/* @__PURE__ */
|
|
7115
|
-
|
|
7148
|
+
/* @__PURE__ */ jsxs25(
|
|
7149
|
+
Text14,
|
|
7116
7150
|
{
|
|
7117
7151
|
style: {
|
|
7118
7152
|
fontSize: 12,
|
|
@@ -7129,7 +7163,7 @@ var AssistantNode = ({
|
|
|
7129
7163
|
]
|
|
7130
7164
|
}
|
|
7131
7165
|
),
|
|
7132
|
-
/* @__PURE__ */ jsx44(
|
|
7166
|
+
/* @__PURE__ */ jsx44(Space16, { size: [8, 8], wrap: true, children: tools.map((tool, index) => /* @__PURE__ */ jsx44(
|
|
7133
7167
|
Tag6,
|
|
7134
7168
|
{
|
|
7135
7169
|
color: "blue",
|
|
@@ -7142,8 +7176,8 @@ var AssistantNode = ({
|
|
|
7142
7176
|
index
|
|
7143
7177
|
)) })
|
|
7144
7178
|
] }),
|
|
7145
|
-
subAgents && subAgents.length > 0 && /* @__PURE__ */
|
|
7146
|
-
/* @__PURE__ */
|
|
7179
|
+
subAgents && subAgents.length > 0 && /* @__PURE__ */ jsxs25("div", { style: { marginBottom: 16 }, children: [
|
|
7180
|
+
/* @__PURE__ */ jsxs25(
|
|
7147
7181
|
"div",
|
|
7148
7182
|
{
|
|
7149
7183
|
style: {
|
|
@@ -7162,8 +7196,8 @@ var AssistantNode = ({
|
|
|
7162
7196
|
}
|
|
7163
7197
|
}
|
|
7164
7198
|
),
|
|
7165
|
-
/* @__PURE__ */
|
|
7166
|
-
|
|
7199
|
+
/* @__PURE__ */ jsxs25(
|
|
7200
|
+
Text14,
|
|
7167
7201
|
{
|
|
7168
7202
|
style: {
|
|
7169
7203
|
fontSize: 12,
|
|
@@ -7180,7 +7214,7 @@ var AssistantNode = ({
|
|
|
7180
7214
|
]
|
|
7181
7215
|
}
|
|
7182
7216
|
),
|
|
7183
|
-
/* @__PURE__ */ jsx44(
|
|
7217
|
+
/* @__PURE__ */ jsx44(Space16, { size: [8, 8], wrap: true, children: subAgents.map((subAgent, index) => /* @__PURE__ */ jsx44(
|
|
7184
7218
|
Tag6,
|
|
7185
7219
|
{
|
|
7186
7220
|
style: {
|
|
@@ -7196,7 +7230,7 @@ var AssistantNode = ({
|
|
|
7196
7230
|
)) })
|
|
7197
7231
|
] }),
|
|
7198
7232
|
/* @__PURE__ */ jsx44(Divider2, { style: { margin: "16px 0" } }),
|
|
7199
|
-
/* @__PURE__ */
|
|
7233
|
+
/* @__PURE__ */ jsxs25(
|
|
7200
7234
|
"div",
|
|
7201
7235
|
{
|
|
7202
7236
|
style: {
|
|
@@ -7207,7 +7241,7 @@ var AssistantNode = ({
|
|
|
7207
7241
|
},
|
|
7208
7242
|
children: [
|
|
7209
7243
|
/* @__PURE__ */ jsx44(
|
|
7210
|
-
|
|
7244
|
+
Button18,
|
|
7211
7245
|
{
|
|
7212
7246
|
type: "primary",
|
|
7213
7247
|
block: true,
|
|
@@ -7219,7 +7253,7 @@ var AssistantNode = ({
|
|
|
7219
7253
|
}
|
|
7220
7254
|
),
|
|
7221
7255
|
/* @__PURE__ */ jsx44(
|
|
7222
|
-
|
|
7256
|
+
Button18,
|
|
7223
7257
|
{
|
|
7224
7258
|
icon: /* @__PURE__ */ jsx44(CopyOutlined2, {}),
|
|
7225
7259
|
onClick: () => handleCopy(assistant.id),
|
|
@@ -7232,7 +7266,7 @@ var AssistantNode = ({
|
|
|
7232
7266
|
]
|
|
7233
7267
|
}
|
|
7234
7268
|
);
|
|
7235
|
-
return /* @__PURE__ */
|
|
7269
|
+
return /* @__PURE__ */ jsxs25(
|
|
7236
7270
|
"div",
|
|
7237
7271
|
{
|
|
7238
7272
|
style: {
|
|
@@ -7240,7 +7274,7 @@ var AssistantNode = ({
|
|
|
7240
7274
|
},
|
|
7241
7275
|
children: [
|
|
7242
7276
|
/* @__PURE__ */ jsx44(Handle, { type: "target", position: Position.Top }),
|
|
7243
|
-
/* @__PURE__ */
|
|
7277
|
+
/* @__PURE__ */ jsxs25(
|
|
7244
7278
|
"div",
|
|
7245
7279
|
{
|
|
7246
7280
|
onClick: () => onClick?.(assistant),
|
|
@@ -7309,7 +7343,7 @@ var AssistantNode = ({
|
|
|
7309
7343
|
e.currentTarget.style.background = token.colorBgContainer;
|
|
7310
7344
|
},
|
|
7311
7345
|
children: /* @__PURE__ */ jsx44(
|
|
7312
|
-
|
|
7346
|
+
InfoCircleOutlined3,
|
|
7313
7347
|
{
|
|
7314
7348
|
style: {
|
|
7315
7349
|
fontSize: 14,
|
|
@@ -7321,7 +7355,7 @@ var AssistantNode = ({
|
|
|
7321
7355
|
)
|
|
7322
7356
|
}
|
|
7323
7357
|
),
|
|
7324
|
-
/* @__PURE__ */
|
|
7358
|
+
/* @__PURE__ */ jsxs25(
|
|
7325
7359
|
"div",
|
|
7326
7360
|
{
|
|
7327
7361
|
style: {
|
|
@@ -7331,7 +7365,7 @@ var AssistantNode = ({
|
|
|
7331
7365
|
gap: 10
|
|
7332
7366
|
},
|
|
7333
7367
|
children: [
|
|
7334
|
-
/* @__PURE__ */
|
|
7368
|
+
/* @__PURE__ */ jsxs25(
|
|
7335
7369
|
"div",
|
|
7336
7370
|
{
|
|
7337
7371
|
style: {
|
|
@@ -7340,7 +7374,7 @@ var AssistantNode = ({
|
|
|
7340
7374
|
gap: 10
|
|
7341
7375
|
},
|
|
7342
7376
|
children: [
|
|
7343
|
-
/* @__PURE__ */
|
|
7377
|
+
/* @__PURE__ */ jsxs25(
|
|
7344
7378
|
"div",
|
|
7345
7379
|
{
|
|
7346
7380
|
style: {
|
|
@@ -7349,7 +7383,7 @@ var AssistantNode = ({
|
|
|
7349
7383
|
},
|
|
7350
7384
|
children: [
|
|
7351
7385
|
/* @__PURE__ */ jsx44(
|
|
7352
|
-
|
|
7386
|
+
Avatar4,
|
|
7353
7387
|
{
|
|
7354
7388
|
size: 44,
|
|
7355
7389
|
icon: /* @__PURE__ */ jsx44(UserOutlined3, {}),
|
|
@@ -7380,7 +7414,7 @@ var AssistantNode = ({
|
|
|
7380
7414
|
]
|
|
7381
7415
|
}
|
|
7382
7416
|
),
|
|
7383
|
-
/* @__PURE__ */
|
|
7417
|
+
/* @__PURE__ */ jsxs25(
|
|
7384
7418
|
"div",
|
|
7385
7419
|
{
|
|
7386
7420
|
style: {
|
|
@@ -7389,7 +7423,7 @@ var AssistantNode = ({
|
|
|
7389
7423
|
},
|
|
7390
7424
|
children: [
|
|
7391
7425
|
/* @__PURE__ */ jsx44(
|
|
7392
|
-
|
|
7426
|
+
Text14,
|
|
7393
7427
|
{
|
|
7394
7428
|
strong: true,
|
|
7395
7429
|
style: {
|
|
@@ -7404,7 +7438,7 @@ var AssistantNode = ({
|
|
|
7404
7438
|
children: assistant.name
|
|
7405
7439
|
}
|
|
7406
7440
|
),
|
|
7407
|
-
/* @__PURE__ */
|
|
7441
|
+
/* @__PURE__ */ jsxs25(
|
|
7408
7442
|
"div",
|
|
7409
7443
|
{
|
|
7410
7444
|
style: {
|
|
@@ -7423,7 +7457,7 @@ var AssistantNode = ({
|
|
|
7423
7457
|
}
|
|
7424
7458
|
),
|
|
7425
7459
|
/* @__PURE__ */ jsx44(
|
|
7426
|
-
|
|
7460
|
+
Text14,
|
|
7427
7461
|
{
|
|
7428
7462
|
style: {
|
|
7429
7463
|
fontSize: 9,
|
|
@@ -7457,7 +7491,7 @@ var AssistantNode = ({
|
|
|
7457
7491
|
{
|
|
7458
7492
|
title: assistant.description.length > 150 ? assistant.description : void 0,
|
|
7459
7493
|
placement: "top",
|
|
7460
|
-
children: /* @__PURE__ */
|
|
7494
|
+
children: /* @__PURE__ */ jsxs25(
|
|
7461
7495
|
"div",
|
|
7462
7496
|
{
|
|
7463
7497
|
style: {
|
|
@@ -7483,7 +7517,7 @@ var AssistantNode = ({
|
|
|
7483
7517
|
)
|
|
7484
7518
|
}
|
|
7485
7519
|
),
|
|
7486
|
-
/* @__PURE__ */
|
|
7520
|
+
/* @__PURE__ */ jsxs25(
|
|
7487
7521
|
"div",
|
|
7488
7522
|
{
|
|
7489
7523
|
style: {
|
|
@@ -7511,7 +7545,7 @@ var AssistantNode = ({
|
|
|
7511
7545
|
children: getAgentTypeLabel(agentType)
|
|
7512
7546
|
}
|
|
7513
7547
|
),
|
|
7514
|
-
tools && tools.length > 0 && /* @__PURE__ */
|
|
7548
|
+
tools && tools.length > 0 && /* @__PURE__ */ jsxs25(
|
|
7515
7549
|
Tag6,
|
|
7516
7550
|
{
|
|
7517
7551
|
style: {
|
|
@@ -7566,7 +7600,7 @@ var AssistantNode = ({
|
|
|
7566
7600
|
var AssistantNode_default = AssistantNode;
|
|
7567
7601
|
|
|
7568
7602
|
// src/components/Chat/AssistantFlow.tsx
|
|
7569
|
-
import { jsx as jsx45, jsxs as
|
|
7603
|
+
import { jsx as jsx45, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
7570
7604
|
var AssistantFlowInner = ({ onNodeClick }) => {
|
|
7571
7605
|
const [nodes, setNodes, onNodesChange] = useNodesState([]);
|
|
7572
7606
|
const [edges, setEdges, onEdgesChange] = useEdgesState([]);
|
|
@@ -7810,7 +7844,7 @@ var AssistantFlowInner = ({ onNodeClick }) => {
|
|
|
7810
7844
|
}
|
|
7811
7845
|
);
|
|
7812
7846
|
}
|
|
7813
|
-
return /* @__PURE__ */ jsx45("div", { style: { width: "100%", height: "100%", background: "#fafafa" }, children: /* @__PURE__ */
|
|
7847
|
+
return /* @__PURE__ */ jsx45("div", { style: { width: "100%", height: "100%", background: "#fafafa" }, children: /* @__PURE__ */ jsxs26(
|
|
7814
7848
|
ReactFlow,
|
|
7815
7849
|
{
|
|
7816
7850
|
nodes,
|
|
@@ -7840,20 +7874,20 @@ import {
|
|
|
7840
7874
|
ReactFlowProvider as ReactFlowProvider2
|
|
7841
7875
|
} from "@xyflow/react";
|
|
7842
7876
|
import "@xyflow/react/dist/style.css";
|
|
7843
|
-
import { Button as
|
|
7877
|
+
import { Button as Button21, theme as theme5 } from "antd";
|
|
7844
7878
|
import { PlusOutlined as PlusOutlined4 } from "@ant-design/icons";
|
|
7845
7879
|
|
|
7846
7880
|
// src/components/Chat/SkillNode.tsx
|
|
7847
7881
|
import { useEffect as useEffect18, useMemo as useMemo11, useState as useState25 } from "react";
|
|
7848
7882
|
import { Handle as Handle2, Position as Position2 } from "@xyflow/react";
|
|
7849
7883
|
import {
|
|
7850
|
-
Avatar as
|
|
7851
|
-
Typography as
|
|
7852
|
-
theme as
|
|
7884
|
+
Avatar as Avatar5,
|
|
7885
|
+
Typography as Typography17,
|
|
7886
|
+
theme as theme3,
|
|
7853
7887
|
Tag as Tag7,
|
|
7854
7888
|
Tooltip as Tooltip9,
|
|
7855
|
-
Space as
|
|
7856
|
-
Button as
|
|
7889
|
+
Space as Space17,
|
|
7890
|
+
Button as Button19,
|
|
7857
7891
|
Divider as Divider3,
|
|
7858
7892
|
Input,
|
|
7859
7893
|
Modal,
|
|
@@ -7863,14 +7897,14 @@ import {
|
|
|
7863
7897
|
BookOutlined,
|
|
7864
7898
|
BranchesOutlined as BranchesOutlined2,
|
|
7865
7899
|
CopyrightOutlined,
|
|
7866
|
-
InfoCircleOutlined as
|
|
7900
|
+
InfoCircleOutlined as InfoCircleOutlined4,
|
|
7867
7901
|
FileTextOutlined as FileTextOutlined5,
|
|
7868
7902
|
CopyOutlined as CopyOutlined3,
|
|
7869
7903
|
PlusOutlined as PlusOutlined2
|
|
7870
7904
|
} from "@ant-design/icons";
|
|
7871
7905
|
import { Client as Client4 } from "@axiom-lattice/client-sdk";
|
|
7872
|
-
import { Fragment as Fragment6, jsx as jsx46, jsxs as
|
|
7873
|
-
var { Text:
|
|
7906
|
+
import { Fragment as Fragment6, jsx as jsx46, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
7907
|
+
var { Text: Text15 } = Typography17;
|
|
7874
7908
|
var { TextArea } = Input;
|
|
7875
7909
|
var getBadgeColor2 = (name) => {
|
|
7876
7910
|
const colors = [
|
|
@@ -7898,7 +7932,7 @@ var getBadgeColor2 = (name) => {
|
|
|
7898
7932
|
return colors[Math.abs(hash) % colors.length];
|
|
7899
7933
|
};
|
|
7900
7934
|
var SkillNode = ({ data }) => {
|
|
7901
|
-
const { token } =
|
|
7935
|
+
const { token } = theme3.useToken();
|
|
7902
7936
|
const { config } = useLatticeChatShellContext();
|
|
7903
7937
|
const client = useMemo11(
|
|
7904
7938
|
() => new Client4({
|
|
@@ -8072,7 +8106,7 @@ var SkillNode = ({ data }) => {
|
|
|
8072
8106
|
setSaving(false);
|
|
8073
8107
|
}
|
|
8074
8108
|
};
|
|
8075
|
-
const editingView = /* @__PURE__ */
|
|
8109
|
+
const editingView = /* @__PURE__ */ jsxs27(
|
|
8076
8110
|
"div",
|
|
8077
8111
|
{
|
|
8078
8112
|
style: {
|
|
@@ -8081,8 +8115,8 @@ var SkillNode = ({ data }) => {
|
|
|
8081
8115
|
gap: 12
|
|
8082
8116
|
},
|
|
8083
8117
|
children: [
|
|
8084
|
-
/* @__PURE__ */
|
|
8085
|
-
/* @__PURE__ */ jsx46(
|
|
8118
|
+
/* @__PURE__ */ jsxs27("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
8119
|
+
/* @__PURE__ */ jsx46(Text15, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Description" }),
|
|
8086
8120
|
/* @__PURE__ */ jsx46(
|
|
8087
8121
|
TextArea,
|
|
8088
8122
|
{
|
|
@@ -8093,8 +8127,8 @@ var SkillNode = ({ data }) => {
|
|
|
8093
8127
|
}
|
|
8094
8128
|
)
|
|
8095
8129
|
] }),
|
|
8096
|
-
/* @__PURE__ */
|
|
8097
|
-
/* @__PURE__ */ jsx46(
|
|
8130
|
+
/* @__PURE__ */ jsxs27("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
8131
|
+
/* @__PURE__ */ jsx46(Text15, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "License" }),
|
|
8098
8132
|
/* @__PURE__ */ jsx46(
|
|
8099
8133
|
Input,
|
|
8100
8134
|
{
|
|
@@ -8104,8 +8138,8 @@ var SkillNode = ({ data }) => {
|
|
|
8104
8138
|
}
|
|
8105
8139
|
)
|
|
8106
8140
|
] }),
|
|
8107
|
-
/* @__PURE__ */
|
|
8108
|
-
/* @__PURE__ */ jsx46(
|
|
8141
|
+
/* @__PURE__ */ jsxs27("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
8142
|
+
/* @__PURE__ */ jsx46(Text15, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Compatibility" }),
|
|
8109
8143
|
/* @__PURE__ */ jsx46(
|
|
8110
8144
|
Input,
|
|
8111
8145
|
{
|
|
@@ -8115,7 +8149,7 @@ var SkillNode = ({ data }) => {
|
|
|
8115
8149
|
}
|
|
8116
8150
|
)
|
|
8117
8151
|
] }),
|
|
8118
|
-
/* @__PURE__ */
|
|
8152
|
+
/* @__PURE__ */ jsxs27(
|
|
8119
8153
|
"div",
|
|
8120
8154
|
{
|
|
8121
8155
|
style: {
|
|
@@ -8126,7 +8160,7 @@ var SkillNode = ({ data }) => {
|
|
|
8126
8160
|
},
|
|
8127
8161
|
children: [
|
|
8128
8162
|
/* @__PURE__ */ jsx46(
|
|
8129
|
-
|
|
8163
|
+
Text15,
|
|
8130
8164
|
{
|
|
8131
8165
|
style: {
|
|
8132
8166
|
fontSize: 12,
|
|
@@ -8137,7 +8171,7 @@ var SkillNode = ({ data }) => {
|
|
|
8137
8171
|
}
|
|
8138
8172
|
),
|
|
8139
8173
|
/* @__PURE__ */ jsx46(
|
|
8140
|
-
|
|
8174
|
+
Button19,
|
|
8141
8175
|
{
|
|
8142
8176
|
size: "small",
|
|
8143
8177
|
icon: /* @__PURE__ */ jsx46(PlusOutlined2, {}),
|
|
@@ -8148,9 +8182,9 @@ var SkillNode = ({ data }) => {
|
|
|
8148
8182
|
]
|
|
8149
8183
|
}
|
|
8150
8184
|
),
|
|
8151
|
-
/* @__PURE__ */
|
|
8185
|
+
/* @__PURE__ */ jsxs27(Space17, { direction: "vertical", size: 8, style: { width: "100%" }, children: [
|
|
8152
8186
|
metadataRows.length === 0 && /* @__PURE__ */ jsx46(
|
|
8153
|
-
|
|
8187
|
+
Text15,
|
|
8154
8188
|
{
|
|
8155
8189
|
style: {
|
|
8156
8190
|
fontSize: 11,
|
|
@@ -8159,7 +8193,7 @@ var SkillNode = ({ data }) => {
|
|
|
8159
8193
|
children: "No metadata yet. Use Add to create one."
|
|
8160
8194
|
}
|
|
8161
8195
|
),
|
|
8162
|
-
metadataRows.map((row, index) => /* @__PURE__ */
|
|
8196
|
+
metadataRows.map((row, index) => /* @__PURE__ */ jsxs27(
|
|
8163
8197
|
"div",
|
|
8164
8198
|
{
|
|
8165
8199
|
style: {
|
|
@@ -8169,11 +8203,11 @@ var SkillNode = ({ data }) => {
|
|
|
8169
8203
|
width: "100%"
|
|
8170
8204
|
},
|
|
8171
8205
|
children: [
|
|
8172
|
-
/* @__PURE__ */
|
|
8206
|
+
/* @__PURE__ */ jsxs27(Text15, { style: { fontSize: 11, color: token.colorTextSecondary }, children: [
|
|
8173
8207
|
"Meta ",
|
|
8174
8208
|
index + 1
|
|
8175
8209
|
] }),
|
|
8176
|
-
/* @__PURE__ */
|
|
8210
|
+
/* @__PURE__ */ jsxs27(Space17, { style: { width: "100%" }, size: 8, wrap: true, children: [
|
|
8177
8211
|
/* @__PURE__ */ jsx46(
|
|
8178
8212
|
Input,
|
|
8179
8213
|
{
|
|
@@ -8198,8 +8232,8 @@ var SkillNode = ({ data }) => {
|
|
|
8198
8232
|
index
|
|
8199
8233
|
))
|
|
8200
8234
|
] }),
|
|
8201
|
-
/* @__PURE__ */
|
|
8202
|
-
/* @__PURE__ */ jsx46(
|
|
8235
|
+
/* @__PURE__ */ jsxs27("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
8236
|
+
/* @__PURE__ */ jsx46(Text15, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Content" }),
|
|
8203
8237
|
/* @__PURE__ */ jsx46(
|
|
8204
8238
|
TextArea,
|
|
8205
8239
|
{
|
|
@@ -8213,7 +8247,7 @@ var SkillNode = ({ data }) => {
|
|
|
8213
8247
|
]
|
|
8214
8248
|
}
|
|
8215
8249
|
);
|
|
8216
|
-
const detailCardContent = /* @__PURE__ */
|
|
8250
|
+
const detailCardContent = /* @__PURE__ */ jsxs27(
|
|
8217
8251
|
"div",
|
|
8218
8252
|
{
|
|
8219
8253
|
style: {
|
|
@@ -8232,8 +8266,8 @@ var SkillNode = ({ data }) => {
|
|
|
8232
8266
|
justifyContent: "space-between",
|
|
8233
8267
|
marginBottom: 16
|
|
8234
8268
|
},
|
|
8235
|
-
children: /* @__PURE__ */
|
|
8236
|
-
/* @__PURE__ */
|
|
8269
|
+
children: /* @__PURE__ */ jsxs27("div", { style: { flex: 1 }, children: [
|
|
8270
|
+
/* @__PURE__ */ jsxs27(
|
|
8237
8271
|
"div",
|
|
8238
8272
|
{
|
|
8239
8273
|
style: {
|
|
@@ -8244,7 +8278,7 @@ var SkillNode = ({ data }) => {
|
|
|
8244
8278
|
},
|
|
8245
8279
|
children: [
|
|
8246
8280
|
/* @__PURE__ */ jsx46(
|
|
8247
|
-
|
|
8281
|
+
Text15,
|
|
8248
8282
|
{
|
|
8249
8283
|
strong: true,
|
|
8250
8284
|
style: {
|
|
@@ -8280,7 +8314,7 @@ var SkillNode = ({ data }) => {
|
|
|
8280
8314
|
gap: 6
|
|
8281
8315
|
},
|
|
8282
8316
|
children: /* @__PURE__ */ jsx46(
|
|
8283
|
-
|
|
8317
|
+
Text15,
|
|
8284
8318
|
{
|
|
8285
8319
|
style: {
|
|
8286
8320
|
fontSize: 11,
|
|
@@ -8295,9 +8329,9 @@ var SkillNode = ({ data }) => {
|
|
|
8295
8329
|
] })
|
|
8296
8330
|
}
|
|
8297
8331
|
),
|
|
8298
|
-
isEditing ? editingView : /* @__PURE__ */
|
|
8299
|
-
currentSkill.description && /* @__PURE__ */ jsx46("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */
|
|
8300
|
-
|
|
8332
|
+
isEditing ? editingView : /* @__PURE__ */ jsxs27(Fragment6, { children: [
|
|
8333
|
+
currentSkill.description && /* @__PURE__ */ jsx46("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ jsxs27(
|
|
8334
|
+
Text15,
|
|
8301
8335
|
{
|
|
8302
8336
|
style: {
|
|
8303
8337
|
fontSize: 12,
|
|
@@ -8312,8 +8346,8 @@ var SkillNode = ({ data }) => {
|
|
|
8312
8346
|
]
|
|
8313
8347
|
}
|
|
8314
8348
|
) }),
|
|
8315
|
-
metadataEntries.length > 0 && /* @__PURE__ */
|
|
8316
|
-
/* @__PURE__ */
|
|
8349
|
+
metadataEntries.length > 0 && /* @__PURE__ */ jsxs27("div", { style: { marginBottom: 16 }, children: [
|
|
8350
|
+
/* @__PURE__ */ jsxs27(
|
|
8317
8351
|
"div",
|
|
8318
8352
|
{
|
|
8319
8353
|
style: {
|
|
@@ -8324,7 +8358,7 @@ var SkillNode = ({ data }) => {
|
|
|
8324
8358
|
},
|
|
8325
8359
|
children: [
|
|
8326
8360
|
/* @__PURE__ */ jsx46(
|
|
8327
|
-
|
|
8361
|
+
InfoCircleOutlined4,
|
|
8328
8362
|
{
|
|
8329
8363
|
style: {
|
|
8330
8364
|
fontSize: 14,
|
|
@@ -8332,8 +8366,8 @@ var SkillNode = ({ data }) => {
|
|
|
8332
8366
|
}
|
|
8333
8367
|
}
|
|
8334
8368
|
),
|
|
8335
|
-
/* @__PURE__ */
|
|
8336
|
-
|
|
8369
|
+
/* @__PURE__ */ jsxs27(
|
|
8370
|
+
Text15,
|
|
8337
8371
|
{
|
|
8338
8372
|
style: {
|
|
8339
8373
|
fontSize: 12,
|
|
@@ -8358,7 +8392,7 @@ var SkillNode = ({ data }) => {
|
|
|
8358
8392
|
borderRadius: 6,
|
|
8359
8393
|
overflow: "hidden"
|
|
8360
8394
|
},
|
|
8361
|
-
children: metadataEntries.map(([key, value], index) => /* @__PURE__ */
|
|
8395
|
+
children: metadataEntries.map(([key, value], index) => /* @__PURE__ */ jsxs27(
|
|
8362
8396
|
"div",
|
|
8363
8397
|
{
|
|
8364
8398
|
style: {
|
|
@@ -8403,8 +8437,8 @@ var SkillNode = ({ data }) => {
|
|
|
8403
8437
|
}
|
|
8404
8438
|
)
|
|
8405
8439
|
] }),
|
|
8406
|
-
hasSubSkills && /* @__PURE__ */
|
|
8407
|
-
/* @__PURE__ */
|
|
8440
|
+
hasSubSkills && /* @__PURE__ */ jsxs27("div", { style: { marginBottom: 16 }, children: [
|
|
8441
|
+
/* @__PURE__ */ jsxs27(
|
|
8408
8442
|
"div",
|
|
8409
8443
|
{
|
|
8410
8444
|
style: {
|
|
@@ -8423,8 +8457,8 @@ var SkillNode = ({ data }) => {
|
|
|
8423
8457
|
}
|
|
8424
8458
|
}
|
|
8425
8459
|
),
|
|
8426
|
-
/* @__PURE__ */
|
|
8427
|
-
|
|
8460
|
+
/* @__PURE__ */ jsxs27(
|
|
8461
|
+
Text15,
|
|
8428
8462
|
{
|
|
8429
8463
|
style: {
|
|
8430
8464
|
fontSize: 12,
|
|
@@ -8441,7 +8475,7 @@ var SkillNode = ({ data }) => {
|
|
|
8441
8475
|
]
|
|
8442
8476
|
}
|
|
8443
8477
|
),
|
|
8444
|
-
/* @__PURE__ */ jsx46(
|
|
8478
|
+
/* @__PURE__ */ jsx46(Space17, { size: [8, 8], wrap: true, children: currentSkill.subSkills.map(
|
|
8445
8479
|
(subSkill, index) => /* @__PURE__ */ jsx46(
|
|
8446
8480
|
Tag7,
|
|
8447
8481
|
{
|
|
@@ -8458,7 +8492,7 @@ var SkillNode = ({ data }) => {
|
|
|
8458
8492
|
)
|
|
8459
8493
|
) })
|
|
8460
8494
|
] }),
|
|
8461
|
-
(currentSkill.license || currentSkill.compatibility) && /* @__PURE__ */ jsx46("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */
|
|
8495
|
+
(currentSkill.license || currentSkill.compatibility) && /* @__PURE__ */ jsx46("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ jsxs27(Space17, { size: [8, 8], wrap: true, children: [
|
|
8462
8496
|
currentSkill.license && /* @__PURE__ */ jsx46(
|
|
8463
8497
|
Tag7,
|
|
8464
8498
|
{
|
|
@@ -8498,9 +8532,9 @@ var SkillNode = ({ data }) => {
|
|
|
8498
8532
|
}
|
|
8499
8533
|
)
|
|
8500
8534
|
] }) }),
|
|
8501
|
-
(currentSkill.createdAt || currentSkill.updatedAt) && /* @__PURE__ */ jsx46("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */
|
|
8502
|
-
currentSkill.createdAt && /* @__PURE__ */
|
|
8503
|
-
|
|
8535
|
+
(currentSkill.createdAt || currentSkill.updatedAt) && /* @__PURE__ */ jsx46("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ jsxs27(Space17, { direction: "vertical", size: 4, children: [
|
|
8536
|
+
currentSkill.createdAt && /* @__PURE__ */ jsxs27(
|
|
8537
|
+
Text15,
|
|
8504
8538
|
{
|
|
8505
8539
|
style: {
|
|
8506
8540
|
fontSize: 11,
|
|
@@ -8513,8 +8547,8 @@ var SkillNode = ({ data }) => {
|
|
|
8513
8547
|
]
|
|
8514
8548
|
}
|
|
8515
8549
|
),
|
|
8516
|
-
currentSkill.updatedAt && /* @__PURE__ */
|
|
8517
|
-
|
|
8550
|
+
currentSkill.updatedAt && /* @__PURE__ */ jsxs27(
|
|
8551
|
+
Text15,
|
|
8518
8552
|
{
|
|
8519
8553
|
style: {
|
|
8520
8554
|
fontSize: 11,
|
|
@@ -8528,8 +8562,8 @@ var SkillNode = ({ data }) => {
|
|
|
8528
8562
|
}
|
|
8529
8563
|
)
|
|
8530
8564
|
] }) }),
|
|
8531
|
-
currentSkill.content && /* @__PURE__ */
|
|
8532
|
-
/* @__PURE__ */
|
|
8565
|
+
currentSkill.content && /* @__PURE__ */ jsxs27("div", { style: { marginBottom: 0 }, children: [
|
|
8566
|
+
/* @__PURE__ */ jsxs27(
|
|
8533
8567
|
"div",
|
|
8534
8568
|
{
|
|
8535
8569
|
style: {
|
|
@@ -8549,7 +8583,7 @@ var SkillNode = ({ data }) => {
|
|
|
8549
8583
|
}
|
|
8550
8584
|
),
|
|
8551
8585
|
/* @__PURE__ */ jsx46(
|
|
8552
|
-
|
|
8586
|
+
Text15,
|
|
8553
8587
|
{
|
|
8554
8588
|
style: {
|
|
8555
8589
|
fontSize: 12,
|
|
@@ -8575,7 +8609,7 @@ var SkillNode = ({ data }) => {
|
|
|
8575
8609
|
overflowY: "auto"
|
|
8576
8610
|
},
|
|
8577
8611
|
children: /* @__PURE__ */ jsx46(
|
|
8578
|
-
|
|
8612
|
+
Text15,
|
|
8579
8613
|
{
|
|
8580
8614
|
style: {
|
|
8581
8615
|
fontSize: 11,
|
|
@@ -8600,9 +8634,9 @@ var SkillNode = ({ data }) => {
|
|
|
8600
8634
|
justifyContent: "space-between",
|
|
8601
8635
|
gap: 8
|
|
8602
8636
|
},
|
|
8603
|
-
children: isEditing ? /* @__PURE__ */
|
|
8637
|
+
children: isEditing ? /* @__PURE__ */ jsxs27(Fragment6, { children: [
|
|
8604
8638
|
/* @__PURE__ */ jsx46(
|
|
8605
|
-
|
|
8639
|
+
Button19,
|
|
8606
8640
|
{
|
|
8607
8641
|
block: true,
|
|
8608
8642
|
onClick: () => {
|
|
@@ -8616,7 +8650,7 @@ var SkillNode = ({ data }) => {
|
|
|
8616
8650
|
}
|
|
8617
8651
|
),
|
|
8618
8652
|
/* @__PURE__ */ jsx46(
|
|
8619
|
-
|
|
8653
|
+
Button19,
|
|
8620
8654
|
{
|
|
8621
8655
|
type: "primary",
|
|
8622
8656
|
block: true,
|
|
@@ -8628,9 +8662,9 @@ var SkillNode = ({ data }) => {
|
|
|
8628
8662
|
children: "Save"
|
|
8629
8663
|
}
|
|
8630
8664
|
)
|
|
8631
|
-
] }) : /* @__PURE__ */
|
|
8665
|
+
] }) : /* @__PURE__ */ jsxs27(Fragment6, { children: [
|
|
8632
8666
|
/* @__PURE__ */ jsx46(
|
|
8633
|
-
|
|
8667
|
+
Button19,
|
|
8634
8668
|
{
|
|
8635
8669
|
type: "primary",
|
|
8636
8670
|
block: true,
|
|
@@ -8642,7 +8676,7 @@ var SkillNode = ({ data }) => {
|
|
|
8642
8676
|
}
|
|
8643
8677
|
),
|
|
8644
8678
|
/* @__PURE__ */ jsx46(
|
|
8645
|
-
|
|
8679
|
+
Button19,
|
|
8646
8680
|
{
|
|
8647
8681
|
danger: true,
|
|
8648
8682
|
onClick: (e) => {
|
|
@@ -8653,7 +8687,7 @@ var SkillNode = ({ data }) => {
|
|
|
8653
8687
|
}
|
|
8654
8688
|
),
|
|
8655
8689
|
/* @__PURE__ */ jsx46(
|
|
8656
|
-
|
|
8690
|
+
Button19,
|
|
8657
8691
|
{
|
|
8658
8692
|
icon: /* @__PURE__ */ jsx46(CopyOutlined3, {}),
|
|
8659
8693
|
onClick: () => handleCopy(currentSkill.id),
|
|
@@ -8674,7 +8708,7 @@ var SkillNode = ({ data }) => {
|
|
|
8674
8708
|
height: 0,
|
|
8675
8709
|
pointerEvents: "none"
|
|
8676
8710
|
};
|
|
8677
|
-
return /* @__PURE__ */
|
|
8711
|
+
return /* @__PURE__ */ jsxs27(
|
|
8678
8712
|
"div",
|
|
8679
8713
|
{
|
|
8680
8714
|
style: {
|
|
@@ -8720,7 +8754,7 @@ var SkillNode = ({ data }) => {
|
|
|
8720
8754
|
e.currentTarget.style.transform = "translateY(0)";
|
|
8721
8755
|
e.currentTarget.style.boxShadow = `0 1px 4px rgba(0, 0, 0, 0.08)`;
|
|
8722
8756
|
},
|
|
8723
|
-
children: /* @__PURE__ */
|
|
8757
|
+
children: /* @__PURE__ */ jsxs27(
|
|
8724
8758
|
"div",
|
|
8725
8759
|
{
|
|
8726
8760
|
style: {
|
|
@@ -8730,7 +8764,7 @@ var SkillNode = ({ data }) => {
|
|
|
8730
8764
|
gap: 10
|
|
8731
8765
|
},
|
|
8732
8766
|
children: [
|
|
8733
|
-
/* @__PURE__ */
|
|
8767
|
+
/* @__PURE__ */ jsxs27(
|
|
8734
8768
|
"div",
|
|
8735
8769
|
{
|
|
8736
8770
|
style: {
|
|
@@ -8739,7 +8773,7 @@ var SkillNode = ({ data }) => {
|
|
|
8739
8773
|
gap: 10
|
|
8740
8774
|
},
|
|
8741
8775
|
children: [
|
|
8742
|
-
/* @__PURE__ */
|
|
8776
|
+
/* @__PURE__ */ jsxs27(
|
|
8743
8777
|
"div",
|
|
8744
8778
|
{
|
|
8745
8779
|
style: {
|
|
@@ -8748,7 +8782,7 @@ var SkillNode = ({ data }) => {
|
|
|
8748
8782
|
},
|
|
8749
8783
|
children: [
|
|
8750
8784
|
/* @__PURE__ */ jsx46(
|
|
8751
|
-
|
|
8785
|
+
Avatar5,
|
|
8752
8786
|
{
|
|
8753
8787
|
size: 44,
|
|
8754
8788
|
icon: /* @__PURE__ */ jsx46(BookOutlined, {}),
|
|
@@ -8791,7 +8825,7 @@ var SkillNode = ({ data }) => {
|
|
|
8791
8825
|
]
|
|
8792
8826
|
}
|
|
8793
8827
|
),
|
|
8794
|
-
/* @__PURE__ */
|
|
8828
|
+
/* @__PURE__ */ jsxs27(
|
|
8795
8829
|
"div",
|
|
8796
8830
|
{
|
|
8797
8831
|
style: {
|
|
@@ -8800,7 +8834,7 @@ var SkillNode = ({ data }) => {
|
|
|
8800
8834
|
},
|
|
8801
8835
|
children: [
|
|
8802
8836
|
/* @__PURE__ */ jsx46(
|
|
8803
|
-
|
|
8837
|
+
Text15,
|
|
8804
8838
|
{
|
|
8805
8839
|
strong: true,
|
|
8806
8840
|
style: {
|
|
@@ -8815,7 +8849,7 @@ var SkillNode = ({ data }) => {
|
|
|
8815
8849
|
children: currentSkill.name
|
|
8816
8850
|
}
|
|
8817
8851
|
),
|
|
8818
|
-
/* @__PURE__ */
|
|
8852
|
+
/* @__PURE__ */ jsxs27(
|
|
8819
8853
|
"div",
|
|
8820
8854
|
{
|
|
8821
8855
|
style: {
|
|
@@ -8834,7 +8868,7 @@ var SkillNode = ({ data }) => {
|
|
|
8834
8868
|
}
|
|
8835
8869
|
),
|
|
8836
8870
|
/* @__PURE__ */ jsx46(
|
|
8837
|
-
|
|
8871
|
+
Text15,
|
|
8838
8872
|
{
|
|
8839
8873
|
style: {
|
|
8840
8874
|
fontSize: 9,
|
|
@@ -8868,7 +8902,7 @@ var SkillNode = ({ data }) => {
|
|
|
8868
8902
|
{
|
|
8869
8903
|
title: currentSkill.description.length > 150 ? currentSkill.description : void 0,
|
|
8870
8904
|
placement: "top",
|
|
8871
|
-
children: /* @__PURE__ */
|
|
8905
|
+
children: /* @__PURE__ */ jsxs27(
|
|
8872
8906
|
"div",
|
|
8873
8907
|
{
|
|
8874
8908
|
style: {
|
|
@@ -8894,7 +8928,7 @@ var SkillNode = ({ data }) => {
|
|
|
8894
8928
|
)
|
|
8895
8929
|
}
|
|
8896
8930
|
),
|
|
8897
|
-
/* @__PURE__ */
|
|
8931
|
+
/* @__PURE__ */ jsxs27(
|
|
8898
8932
|
"div",
|
|
8899
8933
|
{
|
|
8900
8934
|
style: {
|
|
@@ -8923,7 +8957,7 @@ var SkillNode = ({ data }) => {
|
|
|
8923
8957
|
children: category.toUpperCase()
|
|
8924
8958
|
}
|
|
8925
8959
|
),
|
|
8926
|
-
hasSubSkills && /* @__PURE__ */
|
|
8960
|
+
hasSubSkills && /* @__PURE__ */ jsxs27(
|
|
8927
8961
|
Tag7,
|
|
8928
8962
|
{
|
|
8929
8963
|
style: {
|
|
@@ -8978,7 +9012,7 @@ var SkillNode = ({ data }) => {
|
|
|
8978
9012
|
fontWeight: 500,
|
|
8979
9013
|
lineHeight: "14px"
|
|
8980
9014
|
},
|
|
8981
|
-
icon: /* @__PURE__ */ jsx46(
|
|
9015
|
+
icon: /* @__PURE__ */ jsx46(InfoCircleOutlined4, {}),
|
|
8982
9016
|
children: currentSkill.compatibility
|
|
8983
9017
|
}
|
|
8984
9018
|
)
|
|
@@ -9030,16 +9064,16 @@ import {
|
|
|
9030
9064
|
Modal as Modal2,
|
|
9031
9065
|
Form,
|
|
9032
9066
|
Input as Input2,
|
|
9033
|
-
Button as
|
|
9067
|
+
Button as Button20,
|
|
9034
9068
|
message as message6,
|
|
9035
|
-
Space as
|
|
9036
|
-
Typography as
|
|
9069
|
+
Space as Space18,
|
|
9070
|
+
Typography as Typography18
|
|
9037
9071
|
} from "antd";
|
|
9038
9072
|
import { PlusOutlined as PlusOutlined3 } from "@ant-design/icons";
|
|
9039
|
-
import { theme as
|
|
9040
|
-
import { jsx as jsx47, jsxs as
|
|
9073
|
+
import { theme as theme4 } from "antd";
|
|
9074
|
+
import { jsx as jsx47, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
9041
9075
|
var { TextArea: TextArea2 } = Input2;
|
|
9042
|
-
var { Text:
|
|
9076
|
+
var { Text: Text16 } = Typography18;
|
|
9043
9077
|
var CreateSkillModal = ({
|
|
9044
9078
|
open,
|
|
9045
9079
|
onCancel,
|
|
@@ -9048,7 +9082,7 @@ var CreateSkillModal = ({
|
|
|
9048
9082
|
const [form] = Form.useForm();
|
|
9049
9083
|
const [loading, setLoading] = useState26(false);
|
|
9050
9084
|
const { config } = useLatticeChatShellContext();
|
|
9051
|
-
const { token } =
|
|
9085
|
+
const { token } = theme4.useToken();
|
|
9052
9086
|
const defaultMetadataRows = [{ key: "category", value: "global" }];
|
|
9053
9087
|
const [metadataRows, setMetadataRows] = useState26(defaultMetadataRows);
|
|
9054
9088
|
const handleSubmit = async () => {
|
|
@@ -9140,7 +9174,7 @@ var CreateSkillModal = ({
|
|
|
9140
9174
|
layout: "vertical",
|
|
9141
9175
|
onFinish: handleSubmit,
|
|
9142
9176
|
autoComplete: "off",
|
|
9143
|
-
children: /* @__PURE__ */
|
|
9177
|
+
children: /* @__PURE__ */ jsxs28(
|
|
9144
9178
|
"div",
|
|
9145
9179
|
{
|
|
9146
9180
|
style: {
|
|
@@ -9149,8 +9183,8 @@ var CreateSkillModal = ({
|
|
|
9149
9183
|
gap: 12
|
|
9150
9184
|
},
|
|
9151
9185
|
children: [
|
|
9152
|
-
/* @__PURE__ */
|
|
9153
|
-
/* @__PURE__ */ jsx47(
|
|
9186
|
+
/* @__PURE__ */ jsxs28("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
9187
|
+
/* @__PURE__ */ jsx47(Text16, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Name" }),
|
|
9154
9188
|
/* @__PURE__ */ jsx47(
|
|
9155
9189
|
Form.Item,
|
|
9156
9190
|
{
|
|
@@ -9168,8 +9202,8 @@ var CreateSkillModal = ({
|
|
|
9168
9202
|
}
|
|
9169
9203
|
)
|
|
9170
9204
|
] }),
|
|
9171
|
-
/* @__PURE__ */
|
|
9172
|
-
/* @__PURE__ */ jsx47(
|
|
9205
|
+
/* @__PURE__ */ jsxs28("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
9206
|
+
/* @__PURE__ */ jsx47(Text16, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Description" }),
|
|
9173
9207
|
/* @__PURE__ */ jsx47(
|
|
9174
9208
|
Form.Item,
|
|
9175
9209
|
{
|
|
@@ -9188,16 +9222,16 @@ var CreateSkillModal = ({
|
|
|
9188
9222
|
}
|
|
9189
9223
|
)
|
|
9190
9224
|
] }),
|
|
9191
|
-
/* @__PURE__ */
|
|
9192
|
-
/* @__PURE__ */ jsx47(
|
|
9225
|
+
/* @__PURE__ */ jsxs28("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
9226
|
+
/* @__PURE__ */ jsx47(Text16, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "License" }),
|
|
9193
9227
|
/* @__PURE__ */ jsx47(Form.Item, { name: "license", style: { marginBottom: 0 }, children: /* @__PURE__ */ jsx47(Input2, { placeholder: "License" }) })
|
|
9194
9228
|
] }),
|
|
9195
|
-
/* @__PURE__ */
|
|
9196
|
-
/* @__PURE__ */ jsx47(
|
|
9229
|
+
/* @__PURE__ */ jsxs28("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
9230
|
+
/* @__PURE__ */ jsx47(Text16, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Compatibility" }),
|
|
9197
9231
|
/* @__PURE__ */ jsx47(Form.Item, { name: "compatibility", style: { marginBottom: 0 }, children: /* @__PURE__ */ jsx47(Input2, { placeholder: "Compatibility" }) })
|
|
9198
9232
|
] }),
|
|
9199
|
-
/* @__PURE__ */
|
|
9200
|
-
/* @__PURE__ */
|
|
9233
|
+
/* @__PURE__ */ jsxs28("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
9234
|
+
/* @__PURE__ */ jsxs28(
|
|
9201
9235
|
"div",
|
|
9202
9236
|
{
|
|
9203
9237
|
style: {
|
|
@@ -9208,7 +9242,7 @@ var CreateSkillModal = ({
|
|
|
9208
9242
|
},
|
|
9209
9243
|
children: [
|
|
9210
9244
|
/* @__PURE__ */ jsx47(
|
|
9211
|
-
|
|
9245
|
+
Text16,
|
|
9212
9246
|
{
|
|
9213
9247
|
style: {
|
|
9214
9248
|
fontSize: 12,
|
|
@@ -9219,7 +9253,7 @@ var CreateSkillModal = ({
|
|
|
9219
9253
|
}
|
|
9220
9254
|
),
|
|
9221
9255
|
/* @__PURE__ */ jsx47(
|
|
9222
|
-
|
|
9256
|
+
Button20,
|
|
9223
9257
|
{
|
|
9224
9258
|
size: "small",
|
|
9225
9259
|
icon: /* @__PURE__ */ jsx47(PlusOutlined3, {}),
|
|
@@ -9230,9 +9264,9 @@ var CreateSkillModal = ({
|
|
|
9230
9264
|
]
|
|
9231
9265
|
}
|
|
9232
9266
|
),
|
|
9233
|
-
/* @__PURE__ */
|
|
9267
|
+
/* @__PURE__ */ jsxs28(Space18, { direction: "vertical", size: 8, style: { width: "100%" }, children: [
|
|
9234
9268
|
metadataRows.length === 0 && /* @__PURE__ */ jsx47(
|
|
9235
|
-
|
|
9269
|
+
Text16,
|
|
9236
9270
|
{
|
|
9237
9271
|
style: {
|
|
9238
9272
|
fontSize: 11,
|
|
@@ -9241,7 +9275,7 @@ var CreateSkillModal = ({
|
|
|
9241
9275
|
children: "No metadata yet. Use Add to create one."
|
|
9242
9276
|
}
|
|
9243
9277
|
),
|
|
9244
|
-
metadataRows.map((row, index) => /* @__PURE__ */
|
|
9278
|
+
metadataRows.map((row, index) => /* @__PURE__ */ jsxs28(
|
|
9245
9279
|
"div",
|
|
9246
9280
|
{
|
|
9247
9281
|
style: {
|
|
@@ -9251,8 +9285,8 @@ var CreateSkillModal = ({
|
|
|
9251
9285
|
width: "100%"
|
|
9252
9286
|
},
|
|
9253
9287
|
children: [
|
|
9254
|
-
/* @__PURE__ */
|
|
9255
|
-
|
|
9288
|
+
/* @__PURE__ */ jsxs28(
|
|
9289
|
+
Text16,
|
|
9256
9290
|
{
|
|
9257
9291
|
style: { fontSize: 11, color: token.colorTextSecondary },
|
|
9258
9292
|
children: [
|
|
@@ -9261,7 +9295,7 @@ var CreateSkillModal = ({
|
|
|
9261
9295
|
]
|
|
9262
9296
|
}
|
|
9263
9297
|
),
|
|
9264
|
-
/* @__PURE__ */
|
|
9298
|
+
/* @__PURE__ */ jsxs28(Space18, { style: { width: "100%" }, size: 8, wrap: true, children: [
|
|
9265
9299
|
/* @__PURE__ */ jsx47(
|
|
9266
9300
|
Input2,
|
|
9267
9301
|
{
|
|
@@ -9287,8 +9321,8 @@ var CreateSkillModal = ({
|
|
|
9287
9321
|
))
|
|
9288
9322
|
] })
|
|
9289
9323
|
] }),
|
|
9290
|
-
/* @__PURE__ */
|
|
9291
|
-
/* @__PURE__ */ jsx47(
|
|
9324
|
+
/* @__PURE__ */ jsxs28("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
9325
|
+
/* @__PURE__ */ jsx47(Text16, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Content" }),
|
|
9292
9326
|
/* @__PURE__ */ jsx47(Form.Item, { name: "content", style: { marginBottom: 0 }, children: /* @__PURE__ */ jsx47(
|
|
9293
9327
|
TextArea2,
|
|
9294
9328
|
{
|
|
@@ -9297,7 +9331,7 @@ var CreateSkillModal = ({
|
|
|
9297
9331
|
}
|
|
9298
9332
|
) })
|
|
9299
9333
|
] }),
|
|
9300
|
-
/* @__PURE__ */
|
|
9334
|
+
/* @__PURE__ */ jsxs28(
|
|
9301
9335
|
"div",
|
|
9302
9336
|
{
|
|
9303
9337
|
style: {
|
|
@@ -9308,8 +9342,8 @@ var CreateSkillModal = ({
|
|
|
9308
9342
|
marginTop: 8
|
|
9309
9343
|
},
|
|
9310
9344
|
children: [
|
|
9311
|
-
/* @__PURE__ */ jsx47(
|
|
9312
|
-
/* @__PURE__ */ jsx47(
|
|
9345
|
+
/* @__PURE__ */ jsx47(Button20, { onClick: handleCancel, children: "Cancel" }),
|
|
9346
|
+
/* @__PURE__ */ jsx47(Button20, { type: "primary", htmlType: "submit", loading, children: "Create Skill" })
|
|
9313
9347
|
]
|
|
9314
9348
|
}
|
|
9315
9349
|
)
|
|
@@ -9324,14 +9358,14 @@ var CreateSkillModal = ({
|
|
|
9324
9358
|
var CreateSkillModal_default = CreateSkillModal;
|
|
9325
9359
|
|
|
9326
9360
|
// src/components/Chat/SkillFlow.tsx
|
|
9327
|
-
import { jsx as jsx48, jsxs as
|
|
9361
|
+
import { jsx as jsx48, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
9328
9362
|
var SkillFlowInner = ({ onNodeClick }) => {
|
|
9329
9363
|
const [nodes, setNodes, onNodesChange] = useNodesState2([]);
|
|
9330
9364
|
const [edges, setEdges, onEdgesChange] = useEdgesState2([]);
|
|
9331
9365
|
const [isCreateModalOpen, setIsCreateModalOpen] = useState27(false);
|
|
9332
9366
|
const [skills, setSkills] = useState27([]);
|
|
9333
9367
|
const [skillsLoading, setSkillsLoading] = useState27(false);
|
|
9334
|
-
const { token } =
|
|
9368
|
+
const { token } = theme5.useToken();
|
|
9335
9369
|
const { config } = useLatticeChatShellContext();
|
|
9336
9370
|
const nodeTypes = useMemo12(
|
|
9337
9371
|
() => ({
|
|
@@ -9512,8 +9546,8 @@ var SkillFlowInner = ({ onNodeClick }) => {
|
|
|
9512
9546
|
}
|
|
9513
9547
|
);
|
|
9514
9548
|
}
|
|
9515
|
-
return /* @__PURE__ */
|
|
9516
|
-
/* @__PURE__ */
|
|
9549
|
+
return /* @__PURE__ */ jsxs29("div", { style: { width: "100%", height: "100%", background: "#fafafa", position: "relative" }, children: [
|
|
9550
|
+
/* @__PURE__ */ jsxs29(
|
|
9517
9551
|
ReactFlow2,
|
|
9518
9552
|
{
|
|
9519
9553
|
nodes,
|
|
@@ -9538,7 +9572,7 @@ var SkillFlowInner = ({ onNodeClick }) => {
|
|
|
9538
9572
|
zIndex: 10
|
|
9539
9573
|
},
|
|
9540
9574
|
children: /* @__PURE__ */ jsx48(
|
|
9541
|
-
|
|
9575
|
+
Button21,
|
|
9542
9576
|
{
|
|
9543
9577
|
type: "primary",
|
|
9544
9578
|
size: "large",
|
|
@@ -9571,164 +9605,274 @@ var SkillFlowInner = ({ onNodeClick }) => {
|
|
|
9571
9605
|
var SkillFlow = (props) => /* @__PURE__ */ jsx48(ReactFlowProvider2, { children: /* @__PURE__ */ jsx48(SkillFlowInner, { ...props }) });
|
|
9572
9606
|
var SkillFlow_default = SkillFlow;
|
|
9573
9607
|
|
|
9574
|
-
// src/components/Chat/
|
|
9575
|
-
import {
|
|
9576
|
-
|
|
9577
|
-
|
|
9578
|
-
|
|
9579
|
-
|
|
9580
|
-
|
|
9581
|
-
|
|
9582
|
-
|
|
9583
|
-
|
|
9584
|
-
|
|
9585
|
-
|
|
9586
|
-
|
|
9587
|
-
|
|
9588
|
-
|
|
9589
|
-
|
|
9590
|
-
|
|
9591
|
-
|
|
9592
|
-
|
|
9593
|
-
|
|
9594
|
-
|
|
9595
|
-
|
|
9596
|
-
|
|
9597
|
-
|
|
9598
|
-
|
|
9599
|
-
|
|
9600
|
-
|
|
9601
|
-
|
|
9602
|
-
|
|
9603
|
-
|
|
9604
|
-
|
|
9605
|
-
|
|
9606
|
-
|
|
9607
|
-
|
|
9608
|
-
|
|
9609
|
-
|
|
9610
|
-
|
|
9611
|
-
|
|
9612
|
-
|
|
9613
|
-
|
|
9608
|
+
// src/components/Chat/ToolsList.tsx
|
|
9609
|
+
import { List as List4, Avatar as Avatar6, theme as theme6, Alert as Alert4, Button as Button22, Tag as Tag8 } from "antd";
|
|
9610
|
+
import { ReloadOutlined as ReloadOutlined3 } from "@ant-design/icons";
|
|
9611
|
+
import { useEffect as useEffect20, useState as useState28, useCallback as useCallback14 } from "react";
|
|
9612
|
+
import { jsx as jsx49, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
9613
|
+
var ToolsList = ({
|
|
9614
|
+
onToolSelect,
|
|
9615
|
+
autoLoad = true
|
|
9616
|
+
}) => {
|
|
9617
|
+
const { token } = theme6.useToken();
|
|
9618
|
+
const { config } = useLatticeChatShellContext();
|
|
9619
|
+
const [state, setState] = useState28({
|
|
9620
|
+
tools: [],
|
|
9621
|
+
isLoading: false,
|
|
9622
|
+
error: null
|
|
9623
|
+
});
|
|
9624
|
+
const [selectedToolId, setSelectedToolId] = useState28(null);
|
|
9625
|
+
const fetchTools = useCallback14(async () => {
|
|
9626
|
+
setState((prev) => ({ ...prev, isLoading: true, error: null }));
|
|
9627
|
+
try {
|
|
9628
|
+
const headers = {};
|
|
9629
|
+
if (config.apiKey) {
|
|
9630
|
+
headers["Authorization"] = `Bearer ${config.apiKey}`;
|
|
9631
|
+
}
|
|
9632
|
+
const response = await fetch(`${config.baseURL}/api/tools`, {
|
|
9633
|
+
headers
|
|
9634
|
+
});
|
|
9635
|
+
if (response.ok) {
|
|
9636
|
+
const data = await response.json();
|
|
9637
|
+
if (data.success && data.data && Array.isArray(data.data.records)) {
|
|
9638
|
+
setState((prev) => ({
|
|
9639
|
+
...prev,
|
|
9640
|
+
tools: data.data.records,
|
|
9641
|
+
isLoading: false
|
|
9642
|
+
}));
|
|
9643
|
+
} else {
|
|
9644
|
+
throw new Error("Invalid response format");
|
|
9645
|
+
}
|
|
9646
|
+
} else {
|
|
9647
|
+
throw new Error(`Failed to fetch tools: ${response.statusText}`);
|
|
9614
9648
|
}
|
|
9649
|
+
} catch (error) {
|
|
9650
|
+
setState((prev) => ({
|
|
9651
|
+
...prev,
|
|
9652
|
+
tools: [],
|
|
9653
|
+
isLoading: false,
|
|
9654
|
+
error: error instanceof Error ? error : new Error(String(error))
|
|
9655
|
+
}));
|
|
9615
9656
|
}
|
|
9616
|
-
|
|
9617
|
-
|
|
9618
|
-
|
|
9619
|
-
|
|
9620
|
-
|
|
9621
|
-
|
|
9622
|
-
|
|
9623
|
-
|
|
9624
|
-
|
|
9625
|
-
|
|
9626
|
-
|
|
9627
|
-
|
|
9628
|
-
|
|
9629
|
-
|
|
9630
|
-
display: flex;
|
|
9631
|
-
flex-direction: column;
|
|
9632
|
-
padding-top: ${token.paddingMD}px;
|
|
9633
|
-
|
|
9634
|
-
&.visible {
|
|
9635
|
-
transform: translateX(0);
|
|
9657
|
+
}, [config]);
|
|
9658
|
+
const handleToolSelect = useCallback14(
|
|
9659
|
+
(tool) => {
|
|
9660
|
+
setSelectedToolId(tool.id);
|
|
9661
|
+
onToolSelect?.(tool);
|
|
9662
|
+
},
|
|
9663
|
+
[onToolSelect]
|
|
9664
|
+
);
|
|
9665
|
+
const handleRefresh = useCallback14(() => {
|
|
9666
|
+
fetchTools();
|
|
9667
|
+
}, [fetchTools]);
|
|
9668
|
+
useEffect20(() => {
|
|
9669
|
+
if (autoLoad) {
|
|
9670
|
+
fetchTools();
|
|
9636
9671
|
}
|
|
9637
|
-
|
|
9638
|
-
|
|
9639
|
-
|
|
9640
|
-
|
|
9641
|
-
|
|
9642
|
-
|
|
9643
|
-
padding
|
|
9644
|
-
|
|
9645
|
-
|
|
9646
|
-
|
|
9647
|
-
|
|
9648
|
-
|
|
9649
|
-
|
|
9650
|
-
|
|
9651
|
-
|
|
9652
|
-
|
|
9653
|
-
|
|
9654
|
-
|
|
9655
|
-
|
|
9656
|
-
|
|
9657
|
-
|
|
9658
|
-
|
|
9659
|
-
|
|
9672
|
+
}, [autoLoad, fetchTools]);
|
|
9673
|
+
const style = {
|
|
9674
|
+
width: "100%",
|
|
9675
|
+
height: "100%",
|
|
9676
|
+
background: "transparent",
|
|
9677
|
+
borderRadius: token.borderRadius,
|
|
9678
|
+
padding: token.paddingSM
|
|
9679
|
+
};
|
|
9680
|
+
if (state.error) {
|
|
9681
|
+
return /* @__PURE__ */ jsx49("div", { style, children: /* @__PURE__ */ jsx49(
|
|
9682
|
+
Alert4,
|
|
9683
|
+
{
|
|
9684
|
+
message: "Error Loading Tools",
|
|
9685
|
+
description: state.error.message,
|
|
9686
|
+
type: "error",
|
|
9687
|
+
showIcon: true,
|
|
9688
|
+
action: /* @__PURE__ */ jsx49(
|
|
9689
|
+
Button22,
|
|
9690
|
+
{
|
|
9691
|
+
size: "small",
|
|
9692
|
+
icon: /* @__PURE__ */ jsx49(ReloadOutlined3, {}),
|
|
9693
|
+
onClick: handleRefresh,
|
|
9694
|
+
children: "Retry"
|
|
9695
|
+
}
|
|
9696
|
+
)
|
|
9660
9697
|
}
|
|
9661
|
-
}
|
|
9662
|
-
|
|
9663
|
-
|
|
9664
|
-
|
|
9698
|
+
) });
|
|
9699
|
+
}
|
|
9700
|
+
return /* @__PURE__ */ jsxs30("div", { style: { position: "relative", width: "100%", height: "100%" }, children: [
|
|
9701
|
+
/* @__PURE__ */ jsx49(
|
|
9702
|
+
"div",
|
|
9703
|
+
{
|
|
9704
|
+
style: {
|
|
9705
|
+
position: "absolute",
|
|
9706
|
+
top: token.paddingSM,
|
|
9707
|
+
right: token.paddingSM,
|
|
9708
|
+
zIndex: 1
|
|
9709
|
+
},
|
|
9710
|
+
children: /* @__PURE__ */ jsx49(
|
|
9711
|
+
Button22,
|
|
9712
|
+
{
|
|
9713
|
+
type: "text",
|
|
9714
|
+
size: "small",
|
|
9715
|
+
icon: /* @__PURE__ */ jsx49(ReloadOutlined3, {}),
|
|
9716
|
+
onClick: handleRefresh,
|
|
9717
|
+
title: "Refresh tools",
|
|
9718
|
+
style: {
|
|
9719
|
+
color: token.colorTextSecondary
|
|
9720
|
+
}
|
|
9721
|
+
}
|
|
9722
|
+
)
|
|
9723
|
+
}
|
|
9724
|
+
),
|
|
9725
|
+
/* @__PURE__ */ jsx49(
|
|
9726
|
+
"div",
|
|
9727
|
+
{
|
|
9728
|
+
style: {
|
|
9729
|
+
width: "100%",
|
|
9730
|
+
height: "100%",
|
|
9731
|
+
overflowY: "auto",
|
|
9732
|
+
overflowX: "hidden",
|
|
9733
|
+
paddingTop: token.paddingLG
|
|
9734
|
+
},
|
|
9735
|
+
children: /* @__PURE__ */ jsx49(
|
|
9736
|
+
List4,
|
|
9737
|
+
{
|
|
9738
|
+
dataSource: state.tools,
|
|
9739
|
+
loading: state.isLoading,
|
|
9740
|
+
locale: {
|
|
9741
|
+
emptyText: /* @__PURE__ */ jsxs30(
|
|
9742
|
+
"div",
|
|
9743
|
+
{
|
|
9744
|
+
style: {
|
|
9745
|
+
display: "flex",
|
|
9746
|
+
flexDirection: "column",
|
|
9747
|
+
alignItems: "center",
|
|
9748
|
+
gap: token.marginSM,
|
|
9749
|
+
padding: token.paddingLG
|
|
9750
|
+
},
|
|
9751
|
+
children: [
|
|
9752
|
+
/* @__PURE__ */ jsx49("div", { style: { color: token.colorTextSecondary }, children: "No tools available" }),
|
|
9753
|
+
/* @__PURE__ */ jsx49(
|
|
9754
|
+
Button22,
|
|
9755
|
+
{
|
|
9756
|
+
icon: /* @__PURE__ */ jsx49(ReloadOutlined3, {}),
|
|
9757
|
+
onClick: handleRefresh,
|
|
9758
|
+
type: "dashed",
|
|
9759
|
+
size: "small",
|
|
9760
|
+
children: "Refresh"
|
|
9761
|
+
}
|
|
9762
|
+
)
|
|
9763
|
+
]
|
|
9764
|
+
}
|
|
9765
|
+
)
|
|
9766
|
+
},
|
|
9767
|
+
style: {
|
|
9768
|
+
...style,
|
|
9769
|
+
paddingTop: 0
|
|
9770
|
+
},
|
|
9771
|
+
renderItem: (tool) => /* @__PURE__ */ jsx49(
|
|
9772
|
+
List4.Item,
|
|
9773
|
+
{
|
|
9774
|
+
onClick: () => handleToolSelect(tool),
|
|
9775
|
+
style: {
|
|
9776
|
+
cursor: "pointer",
|
|
9777
|
+
padding: token.paddingSM,
|
|
9778
|
+
borderRadius: token.borderRadius,
|
|
9779
|
+
backgroundColor: selectedToolId === tool.id ? token.colorFillSecondary : "transparent",
|
|
9780
|
+
transition: "background-color 0.2s"
|
|
9781
|
+
},
|
|
9782
|
+
onMouseEnter: (e) => {
|
|
9783
|
+
if (selectedToolId !== tool.id) {
|
|
9784
|
+
e.currentTarget.style.backgroundColor = token.colorFillTertiary;
|
|
9785
|
+
}
|
|
9786
|
+
},
|
|
9787
|
+
onMouseLeave: (e) => {
|
|
9788
|
+
if (selectedToolId !== tool.id) {
|
|
9789
|
+
e.currentTarget.style.backgroundColor = "transparent";
|
|
9790
|
+
}
|
|
9791
|
+
},
|
|
9792
|
+
children: /* @__PURE__ */ jsx49(
|
|
9793
|
+
List4.Item.Meta,
|
|
9794
|
+
{
|
|
9795
|
+
avatar: /* @__PURE__ */ jsx49(
|
|
9796
|
+
Avatar6,
|
|
9797
|
+
{
|
|
9798
|
+
size: "small",
|
|
9799
|
+
style: {
|
|
9800
|
+
backgroundColor: token.colorFillSecondary,
|
|
9801
|
+
color: token.colorText
|
|
9802
|
+
},
|
|
9803
|
+
children: tool.name.charAt(0).toUpperCase()
|
|
9804
|
+
}
|
|
9805
|
+
),
|
|
9806
|
+
title: /* @__PURE__ */ jsxs30(
|
|
9807
|
+
"div",
|
|
9808
|
+
{
|
|
9809
|
+
style: {
|
|
9810
|
+
display: "flex",
|
|
9811
|
+
alignItems: "center",
|
|
9812
|
+
gap: token.marginXS
|
|
9813
|
+
},
|
|
9814
|
+
children: [
|
|
9815
|
+
/* @__PURE__ */ jsx49("span", { children: tool.name }),
|
|
9816
|
+
tool.needUserApprove && /* @__PURE__ */ jsx49(
|
|
9817
|
+
Tag8,
|
|
9818
|
+
{
|
|
9819
|
+
color: "warning",
|
|
9820
|
+
style: {
|
|
9821
|
+
fontSize: "10px",
|
|
9822
|
+
padding: "2px 6px",
|
|
9823
|
+
margin: 0,
|
|
9824
|
+
lineHeight: "1.2"
|
|
9825
|
+
},
|
|
9826
|
+
children: "Requires approval"
|
|
9827
|
+
}
|
|
9828
|
+
)
|
|
9829
|
+
]
|
|
9830
|
+
}
|
|
9831
|
+
),
|
|
9832
|
+
description: /* @__PURE__ */ jsx49(
|
|
9833
|
+
"div",
|
|
9834
|
+
{
|
|
9835
|
+
style: {
|
|
9836
|
+
color: token.colorTextSecondary,
|
|
9837
|
+
fontSize: token.fontSizeSM,
|
|
9838
|
+
overflow: "hidden",
|
|
9839
|
+
textOverflow: "ellipsis",
|
|
9840
|
+
whiteSpace: "nowrap"
|
|
9841
|
+
},
|
|
9842
|
+
children: tool.description
|
|
9843
|
+
}
|
|
9844
|
+
)
|
|
9845
|
+
}
|
|
9846
|
+
)
|
|
9847
|
+
},
|
|
9848
|
+
tool.id
|
|
9849
|
+
)
|
|
9850
|
+
}
|
|
9851
|
+
)
|
|
9852
|
+
}
|
|
9853
|
+
)
|
|
9854
|
+
] });
|
|
9855
|
+
};
|
|
9665
9856
|
|
|
9666
|
-
|
|
9667
|
-
|
|
9668
|
-
|
|
9669
|
-
|
|
9670
|
-
sectionTitle: css`
|
|
9671
|
-
font-size: ${token.fontSizeSM}px;
|
|
9672
|
-
font-weight: 600;
|
|
9673
|
-
color: ${token.colorTextSecondary};
|
|
9674
|
-
text-transform: uppercase;
|
|
9675
|
-
letter-spacing: 0.5px;
|
|
9676
|
-
padding: 0 ${token.paddingXS}px;
|
|
9677
|
-
margin-bottom: ${token.marginSM}px;
|
|
9857
|
+
// src/components/Chat/ChatSidebar.tsx
|
|
9858
|
+
import { Fragment as Fragment7, jsx as jsx50, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
9859
|
+
var useStyles4 = createStyles13(({ token, css }) => ({
|
|
9860
|
+
sidebar: css`
|
|
9678
9861
|
display: flex;
|
|
9679
|
-
|
|
9680
|
-
|
|
9681
|
-
|
|
9682
|
-
|
|
9683
|
-
font-size: ${token.fontSizeSM}px;
|
|
9684
|
-
padding: 0;
|
|
9685
|
-
height: auto;
|
|
9686
|
-
color: ${token.colorTextSecondary};
|
|
9687
|
-
border: none;
|
|
9862
|
+
flex-direction: column;
|
|
9863
|
+
height: 100%;
|
|
9864
|
+
width: 100%;
|
|
9865
|
+
position: relative;
|
|
9688
9866
|
background: transparent;
|
|
9689
|
-
|
|
9690
|
-
|
|
9691
|
-
|
|
9692
|
-
background: transparent;
|
|
9693
|
-
}
|
|
9867
|
+
border-radius: ${token.borderRadiusLG}px;
|
|
9868
|
+
overflow: visible;
|
|
9869
|
+
padding: ${token.paddingMD}px ${token.paddingSM}px;
|
|
9694
9870
|
`,
|
|
9695
|
-
|
|
9871
|
+
buttonContainer: css`
|
|
9696
9872
|
display: flex;
|
|
9697
|
-
|
|
9873
|
+
flex-direction: column;
|
|
9874
|
+
gap: ${token.marginSM}px;
|
|
9698
9875
|
align-items: center;
|
|
9699
|
-
padding: ${token.paddingSM}px;
|
|
9700
|
-
background: transparent;
|
|
9701
|
-
border-top: 1px solid ${token.colorBorderSecondary};
|
|
9702
|
-
gap: ${token.marginXS}px;
|
|
9703
|
-
flex-shrink: 0;
|
|
9704
|
-
position: relative;
|
|
9705
|
-
|
|
9706
|
-
&::before {
|
|
9707
|
-
content: "";
|
|
9708
|
-
position: absolute;
|
|
9709
|
-
top: 0;
|
|
9710
|
-
left: 0;
|
|
9711
|
-
right: 0;
|
|
9712
|
-
height: 1px;
|
|
9713
|
-
background: linear-gradient(
|
|
9714
|
-
90deg,
|
|
9715
|
-
transparent,
|
|
9716
|
-
${token.colorBorder},
|
|
9717
|
-
transparent
|
|
9718
|
-
);
|
|
9719
|
-
}
|
|
9720
|
-
|
|
9721
|
-
&.collapsed {
|
|
9722
|
-
border: 0;
|
|
9723
|
-
&::before {
|
|
9724
|
-
content: "";
|
|
9725
|
-
position: absolute;
|
|
9726
|
-
top: 0;
|
|
9727
|
-
left: 0;
|
|
9728
|
-
right: 0;
|
|
9729
|
-
height: 0px;
|
|
9730
|
-
}
|
|
9731
|
-
}
|
|
9732
9876
|
`,
|
|
9733
9877
|
actionButton: css`
|
|
9734
9878
|
display: flex;
|
|
@@ -9758,252 +9902,74 @@ var useStyles4 = createStyles13(({ token, css }) => ({
|
|
|
9758
9902
|
.anticon {
|
|
9759
9903
|
font-size: 16px;
|
|
9760
9904
|
}
|
|
9761
|
-
`,
|
|
9762
|
-
divider: css`
|
|
9763
|
-
margin: ${token.marginMD}px 0;
|
|
9764
|
-
border-color: ${token.colorBorderSecondary};
|
|
9765
|
-
`,
|
|
9766
|
-
hintTooltip: css`
|
|
9767
|
-
position: absolute;
|
|
9768
|
-
top: ${token.paddingMD}px;
|
|
9769
|
-
left: ${token.paddingMD}px;
|
|
9770
|
-
right: ${token.paddingMD}px;
|
|
9771
|
-
padding: ${token.paddingSM}px ${token.paddingMD}px;
|
|
9772
|
-
background: ${token.colorPrimary};
|
|
9773
|
-
color: ${token.colorTextLightSolid};
|
|
9774
|
-
border-radius: ${token.borderRadius}px;
|
|
9775
|
-
font-size: ${token.fontSizeSM}px;
|
|
9776
|
-
z-index: 1001;
|
|
9777
|
-
animation: slideIn 0.3s ease-out;
|
|
9778
|
-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
9779
|
-
|
|
9780
|
-
@keyframes slideIn {
|
|
9781
|
-
from {
|
|
9782
|
-
opacity: 0;
|
|
9783
|
-
transform: translateY(-10px);
|
|
9784
|
-
}
|
|
9785
|
-
to {
|
|
9786
|
-
opacity: 1;
|
|
9787
|
-
transform: translateY(0);
|
|
9788
|
-
}
|
|
9789
|
-
}
|
|
9790
9905
|
`
|
|
9791
9906
|
}));
|
|
9792
|
-
var FIRST_COLLAPSE_KEY = "chat-sidebar-first-collapse-seen";
|
|
9793
9907
|
var ChatSidebar = ({
|
|
9794
|
-
onSettingsClick
|
|
9795
|
-
defaultCollapsed = false
|
|
9908
|
+
onSettingsClick
|
|
9796
9909
|
}) => {
|
|
9797
9910
|
const { styles } = useStyles4();
|
|
9798
|
-
const {
|
|
9799
|
-
const { setSettingsModalOpen, config } = useLatticeChatShellContext();
|
|
9911
|
+
const { setSettingsModalOpen } = useLatticeChatShellContext();
|
|
9800
9912
|
const { selectAssistant } = useAssistantContext();
|
|
9801
|
-
const [
|
|
9802
|
-
const [
|
|
9803
|
-
const [
|
|
9804
|
-
const [isSkillFlowModalOpen, setIsSkillFlowModalOpen] = useState28(false);
|
|
9805
|
-
const prevIsCollapsedRef = useRef13(false);
|
|
9806
|
-
const handleToggleCollapse = () => {
|
|
9807
|
-
setMenuCollapsed(!menuCollapsed);
|
|
9808
|
-
};
|
|
9913
|
+
const [isFlowModalOpen, setIsFlowModalOpen] = useState29(false);
|
|
9914
|
+
const [isSkillFlowModalOpen, setIsSkillFlowModalOpen] = useState29(false);
|
|
9915
|
+
const [isToolsModalOpen, setIsToolsModalOpen] = useState29(false);
|
|
9809
9916
|
const handleSettingsClick = () => {
|
|
9810
9917
|
setSettingsModalOpen(true);
|
|
9811
9918
|
onSettingsClick?.();
|
|
9812
9919
|
};
|
|
9920
|
+
const handleAssistantFlowClick = () => {
|
|
9921
|
+
setIsFlowModalOpen(true);
|
|
9922
|
+
};
|
|
9813
9923
|
const handleSkillFlowClick = () => {
|
|
9814
9924
|
setIsSkillFlowModalOpen(true);
|
|
9815
9925
|
};
|
|
9816
|
-
const
|
|
9817
|
-
|
|
9818
|
-
const prevIsCollapsed = prevIsCollapsedRef.current;
|
|
9819
|
-
if (isCollapsed) {
|
|
9820
|
-
const hasSeenFirstCollapse = localStorage.getItem(FIRST_COLLAPSE_KEY);
|
|
9821
|
-
if (!hasSeenFirstCollapse) {
|
|
9822
|
-
setIsFirstCollapse(true);
|
|
9823
|
-
}
|
|
9824
|
-
} else if (prevIsCollapsed && !isCollapsed) {
|
|
9825
|
-
setIsFirstCollapse((prev) => {
|
|
9826
|
-
if (prev) {
|
|
9827
|
-
return false;
|
|
9828
|
-
}
|
|
9829
|
-
return prev;
|
|
9830
|
-
});
|
|
9831
|
-
}
|
|
9832
|
-
prevIsCollapsedRef.current = isCollapsed;
|
|
9833
|
-
}, [isCollapsed]);
|
|
9834
|
-
const handleMouseEnter = () => {
|
|
9835
|
-
if (isCollapsed) {
|
|
9836
|
-
setIsHovered(true);
|
|
9837
|
-
if (isFirstCollapse) {
|
|
9838
|
-
localStorage.setItem(FIRST_COLLAPSE_KEY, "true");
|
|
9839
|
-
setIsFirstCollapse(false);
|
|
9840
|
-
}
|
|
9841
|
-
}
|
|
9926
|
+
const handleToolsClick = () => {
|
|
9927
|
+
setIsToolsModalOpen(true);
|
|
9842
9928
|
};
|
|
9843
|
-
|
|
9844
|
-
|
|
9845
|
-
|
|
9846
|
-
|
|
9847
|
-
|
|
9848
|
-
|
|
9849
|
-
|
|
9850
|
-
|
|
9851
|
-
|
|
9852
|
-
|
|
9853
|
-
|
|
9854
|
-
|
|
9855
|
-
|
|
9856
|
-
|
|
9857
|
-
|
|
9858
|
-
|
|
9859
|
-
|
|
9860
|
-
|
|
9861
|
-
|
|
9862
|
-
|
|
9863
|
-
|
|
9864
|
-
|
|
9865
|
-
|
|
9866
|
-
|
|
9867
|
-
|
|
9868
|
-
|
|
9869
|
-
|
|
9870
|
-
|
|
9871
|
-
|
|
9872
|
-
|
|
9873
|
-
|
|
9874
|
-
|
|
9875
|
-
|
|
9876
|
-
|
|
9877
|
-
|
|
9878
|
-
|
|
9879
|
-
|
|
9880
|
-
|
|
9881
|
-
|
|
9882
|
-
|
|
9883
|
-
|
|
9884
|
-
|
|
9885
|
-
|
|
9886
|
-
|
|
9887
|
-
enableThreadList && /* @__PURE__ */ jsxs29("div", { className: styles.section, children: [
|
|
9888
|
-
/* @__PURE__ */ jsx49("div", { className: styles.sectionTitle, children: "Threads" }),
|
|
9889
|
-
/* @__PURE__ */ jsx49(
|
|
9890
|
-
AgentConversations,
|
|
9891
|
-
{
|
|
9892
|
-
enableThreadCreation,
|
|
9893
|
-
enableThreadList
|
|
9894
|
-
}
|
|
9895
|
-
)
|
|
9896
|
-
] })
|
|
9897
|
-
] }),
|
|
9898
|
-
/* @__PURE__ */ jsxs29("div", { className: styles.footer, children: [
|
|
9899
|
-
/* @__PURE__ */ jsx49(
|
|
9900
|
-
"button",
|
|
9901
|
-
{
|
|
9902
|
-
className: styles.actionButton,
|
|
9903
|
-
onClick: handleToggleCollapse,
|
|
9904
|
-
title: isCollapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
9905
|
-
"aria-label": isCollapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
9906
|
-
children: isCollapsed ? /* @__PURE__ */ jsx49(MenuUnfoldOutlined, {}) : /* @__PURE__ */ jsx49(MenuFoldOutlined, {})
|
|
9907
|
-
}
|
|
9908
|
-
),
|
|
9909
|
-
/* @__PURE__ */ jsx49(
|
|
9910
|
-
"button",
|
|
9911
|
-
{
|
|
9912
|
-
className: styles.actionButton,
|
|
9913
|
-
onClick: handleSkillFlowClick,
|
|
9914
|
-
title: "Skill Flow Canvas",
|
|
9915
|
-
"aria-label": "Skill Flow Canvas",
|
|
9916
|
-
children: /* @__PURE__ */ jsx49(ThunderboltOutlined2, {})
|
|
9917
|
-
}
|
|
9918
|
-
),
|
|
9919
|
-
/* @__PURE__ */ jsx49(
|
|
9920
|
-
"button",
|
|
9921
|
-
{
|
|
9922
|
-
className: styles.actionButton,
|
|
9923
|
-
onClick: handleSettingsClick,
|
|
9924
|
-
title: "Settings",
|
|
9925
|
-
"aria-label": "Settings",
|
|
9926
|
-
children: /* @__PURE__ */ jsx49(SettingOutlined2, {})
|
|
9927
|
-
}
|
|
9928
|
-
)
|
|
9929
|
-
] })
|
|
9930
|
-
] })
|
|
9931
|
-
]
|
|
9932
|
-
}
|
|
9933
|
-
),
|
|
9934
|
-
isCollapsed && /* @__PURE__ */ jsxs29(
|
|
9935
|
-
"div",
|
|
9936
|
-
{
|
|
9937
|
-
className: `${styles.hoverOverlay} ${isHovered ? "visible" : ""}`,
|
|
9938
|
-
onMouseEnter: handleMouseEnter,
|
|
9939
|
-
onMouseLeave: handleMouseLeave,
|
|
9940
|
-
children: [
|
|
9941
|
-
/* @__PURE__ */ jsxs29("div", { className: styles.hoverContent, children: [
|
|
9942
|
-
/* @__PURE__ */ jsxs29("div", { className: styles.section, children: [
|
|
9943
|
-
/* @__PURE__ */ jsxs29("div", { className: styles.sectionTitle, children: [
|
|
9944
|
-
/* @__PURE__ */ jsx49("span", { children: "Assistants" }),
|
|
9945
|
-
/* @__PURE__ */ jsx49(
|
|
9946
|
-
Button21,
|
|
9947
|
-
{
|
|
9948
|
-
type: "text",
|
|
9949
|
-
icon: /* @__PURE__ */ jsx49(ApartmentOutlined, {}),
|
|
9950
|
-
onClick: () => setIsFlowModalOpen(true),
|
|
9951
|
-
className: styles.sectionTitleButton,
|
|
9952
|
-
title: "View Assistant Flow Canvas",
|
|
9953
|
-
size: "small"
|
|
9954
|
-
}
|
|
9955
|
-
)
|
|
9956
|
-
] }),
|
|
9957
|
-
/* @__PURE__ */ jsx49(AssistantList, {})
|
|
9958
|
-
] }),
|
|
9959
|
-
/* @__PURE__ */ jsx49(Divider4, { className: styles.divider }),
|
|
9960
|
-
enableThreadList && /* @__PURE__ */ jsxs29("div", { className: styles.section, children: [
|
|
9961
|
-
/* @__PURE__ */ jsx49("div", { className: styles.sectionTitle, children: "Threads" }),
|
|
9962
|
-
/* @__PURE__ */ jsx49(
|
|
9963
|
-
AgentConversations,
|
|
9964
|
-
{
|
|
9965
|
-
enableThreadCreation,
|
|
9966
|
-
enableThreadList
|
|
9967
|
-
}
|
|
9968
|
-
)
|
|
9969
|
-
] })
|
|
9970
|
-
] }),
|
|
9971
|
-
/* @__PURE__ */ jsxs29("div", { className: styles.footer, children: [
|
|
9972
|
-
/* @__PURE__ */ jsx49(
|
|
9973
|
-
"button",
|
|
9974
|
-
{
|
|
9975
|
-
className: styles.actionButton,
|
|
9976
|
-
onClick: handleToggleCollapse,
|
|
9977
|
-
title: isCollapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
9978
|
-
"aria-label": isCollapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
9979
|
-
children: isCollapsed ? /* @__PURE__ */ jsx49(MenuUnfoldOutlined, {}) : /* @__PURE__ */ jsx49(MenuFoldOutlined, {})
|
|
9980
|
-
}
|
|
9981
|
-
),
|
|
9982
|
-
/* @__PURE__ */ jsx49(
|
|
9983
|
-
"button",
|
|
9984
|
-
{
|
|
9985
|
-
className: styles.actionButton,
|
|
9986
|
-
onClick: handleSkillFlowClick,
|
|
9987
|
-
title: "Skill Flow Canvas",
|
|
9988
|
-
"aria-label": "Skill Flow Canvas",
|
|
9989
|
-
children: /* @__PURE__ */ jsx49(ThunderboltOutlined2, {})
|
|
9990
|
-
}
|
|
9991
|
-
),
|
|
9992
|
-
/* @__PURE__ */ jsx49(
|
|
9993
|
-
"button",
|
|
9994
|
-
{
|
|
9995
|
-
className: styles.actionButton,
|
|
9996
|
-
onClick: handleSettingsClick,
|
|
9997
|
-
title: "Settings",
|
|
9998
|
-
"aria-label": "Settings",
|
|
9999
|
-
children: /* @__PURE__ */ jsx49(SettingOutlined2, {})
|
|
10000
|
-
}
|
|
10001
|
-
)
|
|
10002
|
-
] })
|
|
10003
|
-
]
|
|
10004
|
-
}
|
|
10005
|
-
),
|
|
10006
|
-
/* @__PURE__ */ jsx49(
|
|
9929
|
+
return /* @__PURE__ */ jsxs31(Fragment7, { children: [
|
|
9930
|
+
/* @__PURE__ */ jsx50("div", { className: styles.sidebar, children: /* @__PURE__ */ jsxs31("div", { className: styles.buttonContainer, children: [
|
|
9931
|
+
/* @__PURE__ */ jsx50(
|
|
9932
|
+
"button",
|
|
9933
|
+
{
|
|
9934
|
+
className: styles.actionButton,
|
|
9935
|
+
onClick: handleAssistantFlowClick,
|
|
9936
|
+
title: "Assistant Flow Canvas",
|
|
9937
|
+
"aria-label": "Assistant Flow Canvas",
|
|
9938
|
+
children: /* @__PURE__ */ jsx50(ApartmentOutlined, {})
|
|
9939
|
+
}
|
|
9940
|
+
),
|
|
9941
|
+
/* @__PURE__ */ jsx50(
|
|
9942
|
+
"button",
|
|
9943
|
+
{
|
|
9944
|
+
className: styles.actionButton,
|
|
9945
|
+
onClick: handleSkillFlowClick,
|
|
9946
|
+
title: "Skill Flow Canvas",
|
|
9947
|
+
"aria-label": "Skill Flow Canvas",
|
|
9948
|
+
children: /* @__PURE__ */ jsx50(ThunderboltOutlined2, {})
|
|
9949
|
+
}
|
|
9950
|
+
),
|
|
9951
|
+
/* @__PURE__ */ jsx50(
|
|
9952
|
+
"button",
|
|
9953
|
+
{
|
|
9954
|
+
className: styles.actionButton,
|
|
9955
|
+
onClick: handleToolsClick,
|
|
9956
|
+
title: "Tools List",
|
|
9957
|
+
"aria-label": "Tools List",
|
|
9958
|
+
children: /* @__PURE__ */ jsx50(ToolOutlined3, {})
|
|
9959
|
+
}
|
|
9960
|
+
),
|
|
9961
|
+
/* @__PURE__ */ jsx50(
|
|
9962
|
+
"button",
|
|
9963
|
+
{
|
|
9964
|
+
className: styles.actionButton,
|
|
9965
|
+
onClick: handleSettingsClick,
|
|
9966
|
+
title: "Settings",
|
|
9967
|
+
"aria-label": "Settings",
|
|
9968
|
+
children: /* @__PURE__ */ jsx50(SettingOutlined2, {})
|
|
9969
|
+
}
|
|
9970
|
+
)
|
|
9971
|
+
] }) }),
|
|
9972
|
+
/* @__PURE__ */ jsx50(
|
|
10007
9973
|
Modal3,
|
|
10008
9974
|
{
|
|
10009
9975
|
destroyOnHidden: true,
|
|
@@ -10017,7 +9983,7 @@ var ChatSidebar = ({
|
|
|
10017
9983
|
height: "calc(100vh - 120px)",
|
|
10018
9984
|
padding: 0
|
|
10019
9985
|
},
|
|
10020
|
-
children: /* @__PURE__ */
|
|
9986
|
+
children: /* @__PURE__ */ jsx50("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsx50(
|
|
10021
9987
|
AssistantFlow_default,
|
|
10022
9988
|
{
|
|
10023
9989
|
onNodeClick: (assistant) => {
|
|
@@ -10028,7 +9994,7 @@ var ChatSidebar = ({
|
|
|
10028
9994
|
) })
|
|
10029
9995
|
}
|
|
10030
9996
|
),
|
|
10031
|
-
/* @__PURE__ */
|
|
9997
|
+
/* @__PURE__ */ jsx50(
|
|
10032
9998
|
Modal3,
|
|
10033
9999
|
{
|
|
10034
10000
|
destroyOnHidden: true,
|
|
@@ -10042,7 +10008,7 @@ var ChatSidebar = ({
|
|
|
10042
10008
|
height: "calc(100vh - 120px)",
|
|
10043
10009
|
padding: 0
|
|
10044
10010
|
},
|
|
10045
|
-
children: /* @__PURE__ */
|
|
10011
|
+
children: /* @__PURE__ */ jsx50("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsx50(
|
|
10046
10012
|
SkillFlow_default,
|
|
10047
10013
|
{
|
|
10048
10014
|
onNodeClick: (skill) => {
|
|
@@ -10051,12 +10017,36 @@ var ChatSidebar = ({
|
|
|
10051
10017
|
}
|
|
10052
10018
|
) })
|
|
10053
10019
|
}
|
|
10020
|
+
),
|
|
10021
|
+
/* @__PURE__ */ jsx50(
|
|
10022
|
+
Modal3,
|
|
10023
|
+
{
|
|
10024
|
+
destroyOnHidden: true,
|
|
10025
|
+
title: "Tools Overview",
|
|
10026
|
+
open: isToolsModalOpen,
|
|
10027
|
+
onCancel: () => setIsToolsModalOpen(false),
|
|
10028
|
+
footer: null,
|
|
10029
|
+
width: "90%",
|
|
10030
|
+
style: { top: 20 },
|
|
10031
|
+
bodyStyle: {
|
|
10032
|
+
height: "calc(100vh - 120px)",
|
|
10033
|
+
padding: 0
|
|
10034
|
+
},
|
|
10035
|
+
children: /* @__PURE__ */ jsx50("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsx50(
|
|
10036
|
+
ToolsList,
|
|
10037
|
+
{
|
|
10038
|
+
onToolSelect: (tool) => {
|
|
10039
|
+
console.log("Tool selected:", tool);
|
|
10040
|
+
}
|
|
10041
|
+
}
|
|
10042
|
+
) })
|
|
10043
|
+
}
|
|
10054
10044
|
)
|
|
10055
10045
|
] });
|
|
10056
10046
|
};
|
|
10057
10047
|
|
|
10058
10048
|
// src/components/Chat/LatticeChatView.tsx
|
|
10059
|
-
import { jsx as
|
|
10049
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
10060
10050
|
var LatticeChatView = (props) => {
|
|
10061
10051
|
const shellContext = useContext8(LatticeChatShellContext);
|
|
10062
10052
|
const { showSideMenu } = shellContext.config;
|
|
@@ -10065,7 +10055,7 @@ var LatticeChatView = (props) => {
|
|
|
10065
10055
|
const {
|
|
10066
10056
|
config: { baseURL }
|
|
10067
10057
|
} = useLatticeChatShellContext();
|
|
10068
|
-
return assistantId && thread ? /* @__PURE__ */
|
|
10058
|
+
return assistantId && thread ? /* @__PURE__ */ jsx51(
|
|
10069
10059
|
AxiomLatticeProvider,
|
|
10070
10060
|
{
|
|
10071
10061
|
config: {
|
|
@@ -10074,14 +10064,14 @@ var LatticeChatView = (props) => {
|
|
|
10074
10064
|
assistantId,
|
|
10075
10065
|
transport: "sse"
|
|
10076
10066
|
},
|
|
10077
|
-
children: /* @__PURE__ */
|
|
10067
|
+
children: /* @__PURE__ */ jsx51(
|
|
10078
10068
|
LatticeChat,
|
|
10079
10069
|
{
|
|
10080
10070
|
thread_id: thread?.id,
|
|
10081
10071
|
assistant_id: assistantId,
|
|
10082
10072
|
name: currentAssistant?.name,
|
|
10083
10073
|
description: currentAssistant?.description,
|
|
10084
|
-
menu: showSideMenu ? /* @__PURE__ */
|
|
10074
|
+
menu: showSideMenu ? /* @__PURE__ */ jsx51(ChatSidebar, {}) : void 0
|
|
10085
10075
|
}
|
|
10086
10076
|
)
|
|
10087
10077
|
}
|
|
@@ -10089,24 +10079,24 @@ var LatticeChatView = (props) => {
|
|
|
10089
10079
|
};
|
|
10090
10080
|
|
|
10091
10081
|
// src/components/Chat/SettingsModal.tsx
|
|
10092
|
-
import { useState as
|
|
10082
|
+
import { useState as useState30, useEffect as useEffect21, useRef as useRef13 } from "react";
|
|
10093
10083
|
import {
|
|
10094
10084
|
Modal as Modal4,
|
|
10095
10085
|
Input as Input3,
|
|
10096
|
-
Button as
|
|
10086
|
+
Button as Button24,
|
|
10097
10087
|
message as message7,
|
|
10098
|
-
Typography as
|
|
10099
|
-
Alert as
|
|
10088
|
+
Typography as Typography19,
|
|
10089
|
+
Alert as Alert5,
|
|
10100
10090
|
Select,
|
|
10101
10091
|
Switch,
|
|
10102
|
-
Space as
|
|
10092
|
+
Space as Space19,
|
|
10103
10093
|
Tabs as Tabs2
|
|
10104
10094
|
} from "antd";
|
|
10105
10095
|
import {
|
|
10106
10096
|
SaveOutlined,
|
|
10107
10097
|
EnvironmentOutlined,
|
|
10108
|
-
ReloadOutlined as
|
|
10109
|
-
CheckCircleOutlined as
|
|
10098
|
+
ReloadOutlined as ReloadOutlined4,
|
|
10099
|
+
CheckCircleOutlined as CheckCircleOutlined6,
|
|
10110
10100
|
ApiOutlined as ApiOutlined2,
|
|
10111
10101
|
LinkOutlined,
|
|
10112
10102
|
CheckCircleFilled,
|
|
@@ -10115,8 +10105,8 @@ import {
|
|
|
10115
10105
|
CloudServerOutlined
|
|
10116
10106
|
} from "@ant-design/icons";
|
|
10117
10107
|
import { createStyles as createStyles14 } from "antd-style";
|
|
10118
|
-
import { Fragment as Fragment8, jsx as
|
|
10119
|
-
var { Text:
|
|
10108
|
+
import { Fragment as Fragment8, jsx as jsx52, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
10109
|
+
var { Text: Text17, Title: Title3 } = Typography19;
|
|
10120
10110
|
var { TextArea: TextArea3 } = Input3;
|
|
10121
10111
|
var useStyles5 = createStyles14(({ token, css }) => ({
|
|
10122
10112
|
// settingsModal: css`
|
|
@@ -10464,12 +10454,12 @@ var SETTINGS_MENU_ITEMS = [
|
|
|
10464
10454
|
{
|
|
10465
10455
|
key: "environment",
|
|
10466
10456
|
label: "Environment Variables",
|
|
10467
|
-
icon: /* @__PURE__ */
|
|
10457
|
+
icon: /* @__PURE__ */ jsx52(EnvironmentOutlined, {})
|
|
10468
10458
|
},
|
|
10469
10459
|
{
|
|
10470
10460
|
key: "models",
|
|
10471
10461
|
label: "Model Configuration",
|
|
10472
|
-
icon: /* @__PURE__ */
|
|
10462
|
+
icon: /* @__PURE__ */ jsx52(ApiOutlined2, {})
|
|
10473
10463
|
}
|
|
10474
10464
|
];
|
|
10475
10465
|
var SettingsModal = ({
|
|
@@ -10478,7 +10468,7 @@ var SettingsModal = ({
|
|
|
10478
10468
|
}) => {
|
|
10479
10469
|
const { styles } = useStyles5();
|
|
10480
10470
|
const { config: shellConfig, updateConfigValue } = useLatticeChatShellContext();
|
|
10481
|
-
const [connections, setConnections] =
|
|
10471
|
+
const [connections, setConnections] = useState30(() => {
|
|
10482
10472
|
if (typeof window !== "undefined") {
|
|
10483
10473
|
try {
|
|
10484
10474
|
const stored = localStorage.getItem("lattice_server_connections");
|
|
@@ -10501,21 +10491,21 @@ var SettingsModal = ({
|
|
|
10501
10491
|
}
|
|
10502
10492
|
return [];
|
|
10503
10493
|
});
|
|
10504
|
-
const [serverConfigs, setServerConfigs] =
|
|
10505
|
-
const connectionsRef =
|
|
10494
|
+
const [serverConfigs, setServerConfigs] = useState30({});
|
|
10495
|
+
const connectionsRef = useRef13(connections);
|
|
10506
10496
|
useEffect21(() => {
|
|
10507
10497
|
connectionsRef.current = connections;
|
|
10508
10498
|
}, [connections]);
|
|
10509
|
-
const [activeTabKey, setActiveTabKey] =
|
|
10499
|
+
const [activeTabKey, setActiveTabKey] = useState30(
|
|
10510
10500
|
connections.length > 0 ? connections[0].id : ""
|
|
10511
10501
|
);
|
|
10512
|
-
const [activeMenu, setActiveMenu] =
|
|
10513
|
-
const [loading, setLoading] =
|
|
10514
|
-
const [showAddServerModal, setShowAddServerModal] =
|
|
10515
|
-
const [newServerUrl, setNewServerUrl] =
|
|
10516
|
-
const [newServerName, setNewServerName] =
|
|
10517
|
-
const [newServerApiKey, setNewServerApiKey] =
|
|
10518
|
-
const [addingServer, setAddingServer] =
|
|
10502
|
+
const [activeMenu, setActiveMenu] = useState30("environment");
|
|
10503
|
+
const [loading, setLoading] = useState30(false);
|
|
10504
|
+
const [showAddServerModal, setShowAddServerModal] = useState30(false);
|
|
10505
|
+
const [newServerUrl, setNewServerUrl] = useState30("");
|
|
10506
|
+
const [newServerName, setNewServerName] = useState30("");
|
|
10507
|
+
const [newServerApiKey, setNewServerApiKey] = useState30("");
|
|
10508
|
+
const [addingServer, setAddingServer] = useState30(false);
|
|
10519
10509
|
const saveConnections = (newConnections) => {
|
|
10520
10510
|
setConnections(newConnections);
|
|
10521
10511
|
if (typeof window !== "undefined") {
|
|
@@ -10915,25 +10905,25 @@ var SettingsModal = ({
|
|
|
10915
10905
|
}
|
|
10916
10906
|
}));
|
|
10917
10907
|
};
|
|
10918
|
-
return /* @__PURE__ */
|
|
10919
|
-
/* @__PURE__ */
|
|
10920
|
-
|
|
10908
|
+
return /* @__PURE__ */ jsxs32("div", { className: styles.formContainer, children: [
|
|
10909
|
+
/* @__PURE__ */ jsx52(
|
|
10910
|
+
Alert5,
|
|
10921
10911
|
{
|
|
10922
10912
|
message: "Configuration Effect",
|
|
10923
|
-
description: /* @__PURE__ */
|
|
10924
|
-
/* @__PURE__ */
|
|
10925
|
-
/* @__PURE__ */
|
|
10926
|
-
|
|
10913
|
+
description: /* @__PURE__ */ jsxs32("div", { children: [
|
|
10914
|
+
/* @__PURE__ */ jsxs32("div", { style: { marginBottom: 8 }, children: [
|
|
10915
|
+
/* @__PURE__ */ jsx52(
|
|
10916
|
+
CheckCircleOutlined6,
|
|
10927
10917
|
{
|
|
10928
10918
|
style: { color: "#52c41a", marginRight: 8 }
|
|
10929
10919
|
}
|
|
10930
10920
|
),
|
|
10931
|
-
/* @__PURE__ */
|
|
10921
|
+
/* @__PURE__ */ jsx52("strong", { children: "Immediately effective:" }),
|
|
10932
10922
|
" QUEUE_SERVICE_TYPE, REDIS_URL, REDIS_PASSWORD, QUEUE_NAME"
|
|
10933
10923
|
] }),
|
|
10934
|
-
/* @__PURE__ */
|
|
10935
|
-
/* @__PURE__ */
|
|
10936
|
-
/* @__PURE__ */
|
|
10924
|
+
/* @__PURE__ */ jsxs32("div", { children: [
|
|
10925
|
+
/* @__PURE__ */ jsx52(ReloadOutlined4, { style: { color: "#faad14", marginRight: 8 } }),
|
|
10926
|
+
/* @__PURE__ */ jsx52("strong", { children: "Requires restart:" }),
|
|
10937
10927
|
" PORT (server must be restarted to change port)"
|
|
10938
10928
|
] })
|
|
10939
10929
|
] }),
|
|
@@ -10942,8 +10932,8 @@ var SettingsModal = ({
|
|
|
10942
10932
|
className: styles.alertCard
|
|
10943
10933
|
}
|
|
10944
10934
|
),
|
|
10945
|
-
/* @__PURE__ */
|
|
10946
|
-
/* @__PURE__ */
|
|
10935
|
+
/* @__PURE__ */ jsx52("div", { style: { marginBottom: 24 }, children: /* @__PURE__ */ jsx52(Text17, { 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." }) }),
|
|
10936
|
+
/* @__PURE__ */ jsx52(
|
|
10947
10937
|
TextArea3,
|
|
10948
10938
|
{
|
|
10949
10939
|
value: config.envText,
|
|
@@ -11020,10 +11010,10 @@ QUEUE_NAME=tasks`,
|
|
|
11020
11010
|
}));
|
|
11021
11011
|
}
|
|
11022
11012
|
};
|
|
11023
|
-
return /* @__PURE__ */
|
|
11024
|
-
/* @__PURE__ */
|
|
11025
|
-
config.models.map((model, index) => /* @__PURE__ */
|
|
11026
|
-
/* @__PURE__ */
|
|
11013
|
+
return /* @__PURE__ */ jsxs32("div", { className: styles.formContainer, children: [
|
|
11014
|
+
/* @__PURE__ */ jsx52("div", { style: { marginBottom: 32 }, children: /* @__PURE__ */ jsx52(Text17, { 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." }) }),
|
|
11015
|
+
config.models.map((model, index) => /* @__PURE__ */ jsxs32("div", { className: styles.card, children: [
|
|
11016
|
+
/* @__PURE__ */ jsxs32(
|
|
11027
11017
|
"div",
|
|
11028
11018
|
{
|
|
11029
11019
|
style: {
|
|
@@ -11035,13 +11025,13 @@ QUEUE_NAME=tasks`,
|
|
|
11035
11025
|
borderBottom: "1px solid rgba(0, 0, 0, 0.06)"
|
|
11036
11026
|
},
|
|
11037
11027
|
children: [
|
|
11038
|
-
/* @__PURE__ */
|
|
11039
|
-
/* @__PURE__ */
|
|
11028
|
+
/* @__PURE__ */ jsxs32("div", { children: [
|
|
11029
|
+
/* @__PURE__ */ jsxs32(Text17, { strong: true, style: { fontSize: 16 }, children: [
|
|
11040
11030
|
"Model ",
|
|
11041
11031
|
index + 1
|
|
11042
11032
|
] }),
|
|
11043
|
-
model.key && /* @__PURE__ */
|
|
11044
|
-
|
|
11033
|
+
model.key && /* @__PURE__ */ jsxs32(
|
|
11034
|
+
Text17,
|
|
11045
11035
|
{
|
|
11046
11036
|
type: "secondary",
|
|
11047
11037
|
style: { marginLeft: 8, fontSize: 12 },
|
|
@@ -11053,8 +11043,8 @@ QUEUE_NAME=tasks`,
|
|
|
11053
11043
|
}
|
|
11054
11044
|
)
|
|
11055
11045
|
] }),
|
|
11056
|
-
config.models.length > 1 && /* @__PURE__ */
|
|
11057
|
-
|
|
11046
|
+
config.models.length > 1 && /* @__PURE__ */ jsx52(
|
|
11047
|
+
Button24,
|
|
11058
11048
|
{
|
|
11059
11049
|
type: "text",
|
|
11060
11050
|
danger: true,
|
|
@@ -11070,10 +11060,10 @@ QUEUE_NAME=tasks`,
|
|
|
11070
11060
|
]
|
|
11071
11061
|
}
|
|
11072
11062
|
),
|
|
11073
|
-
/* @__PURE__ */
|
|
11074
|
-
/* @__PURE__ */
|
|
11075
|
-
/* @__PURE__ */
|
|
11076
|
-
/* @__PURE__ */
|
|
11063
|
+
/* @__PURE__ */ jsxs32(Space19, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
|
|
11064
|
+
/* @__PURE__ */ jsxs32("div", { children: [
|
|
11065
|
+
/* @__PURE__ */ jsx52(Text17, { className: styles.formLabel, children: "Key *" }),
|
|
11066
|
+
/* @__PURE__ */ jsx52(
|
|
11077
11067
|
Input3,
|
|
11078
11068
|
{
|
|
11079
11069
|
placeholder: "e.g., default, gpt-4, claude",
|
|
@@ -11082,11 +11072,11 @@ QUEUE_NAME=tasks`,
|
|
|
11082
11072
|
style: { height: 40 }
|
|
11083
11073
|
}
|
|
11084
11074
|
),
|
|
11085
|
-
/* @__PURE__ */
|
|
11075
|
+
/* @__PURE__ */ jsx52(Text17, { className: styles.formDescription, children: "Unique identifier for this model" })
|
|
11086
11076
|
] }),
|
|
11087
|
-
/* @__PURE__ */
|
|
11088
|
-
/* @__PURE__ */
|
|
11089
|
-
/* @__PURE__ */
|
|
11077
|
+
/* @__PURE__ */ jsxs32("div", { children: [
|
|
11078
|
+
/* @__PURE__ */ jsx52(Text17, { className: styles.formLabel, children: "Provider *" }),
|
|
11079
|
+
/* @__PURE__ */ jsx52(
|
|
11090
11080
|
Select,
|
|
11091
11081
|
{
|
|
11092
11082
|
style: { width: "100%", height: 40 },
|
|
@@ -11102,9 +11092,9 @@ QUEUE_NAME=tasks`,
|
|
|
11102
11092
|
}
|
|
11103
11093
|
)
|
|
11104
11094
|
] }),
|
|
11105
|
-
/* @__PURE__ */
|
|
11106
|
-
/* @__PURE__ */
|
|
11107
|
-
/* @__PURE__ */
|
|
11095
|
+
/* @__PURE__ */ jsxs32("div", { children: [
|
|
11096
|
+
/* @__PURE__ */ jsx52(Text17, { className: styles.formLabel, children: "Model Name *" }),
|
|
11097
|
+
/* @__PURE__ */ jsx52(
|
|
11108
11098
|
Input3,
|
|
11109
11099
|
{
|
|
11110
11100
|
placeholder: "e.g., gpt-4, claude-3-opus, kimi-k2-250905",
|
|
@@ -11114,9 +11104,9 @@ QUEUE_NAME=tasks`,
|
|
|
11114
11104
|
}
|
|
11115
11105
|
)
|
|
11116
11106
|
] }),
|
|
11117
|
-
/* @__PURE__ */
|
|
11118
|
-
/* @__PURE__ */
|
|
11119
|
-
/* @__PURE__ */
|
|
11107
|
+
/* @__PURE__ */ jsxs32("div", { children: [
|
|
11108
|
+
/* @__PURE__ */ jsx52(Text17, { className: styles.formLabel, children: "API Key" }),
|
|
11109
|
+
/* @__PURE__ */ jsx52(
|
|
11120
11110
|
Input3.Password,
|
|
11121
11111
|
{
|
|
11122
11112
|
placeholder: "Enter your API key",
|
|
@@ -11125,11 +11115,11 @@ QUEUE_NAME=tasks`,
|
|
|
11125
11115
|
style: { height: 40 }
|
|
11126
11116
|
}
|
|
11127
11117
|
),
|
|
11128
|
-
/* @__PURE__ */
|
|
11118
|
+
/* @__PURE__ */ jsx52(Text17, { className: styles.formDescription, children: "API key for the model provider. Leave empty to use environment variable." })
|
|
11129
11119
|
] }),
|
|
11130
|
-
/* @__PURE__ */
|
|
11131
|
-
/* @__PURE__ */
|
|
11132
|
-
/* @__PURE__ */
|
|
11120
|
+
/* @__PURE__ */ jsxs32("div", { children: [
|
|
11121
|
+
/* @__PURE__ */ jsx52(Text17, { className: styles.formLabel, children: "Base URL" }),
|
|
11122
|
+
/* @__PURE__ */ jsx52(
|
|
11133
11123
|
Input3,
|
|
11134
11124
|
{
|
|
11135
11125
|
placeholder: "e.g., https://api.openai.com/v1",
|
|
@@ -11138,22 +11128,22 @@ QUEUE_NAME=tasks`,
|
|
|
11138
11128
|
style: { height: 40 }
|
|
11139
11129
|
}
|
|
11140
11130
|
),
|
|
11141
|
-
/* @__PURE__ */
|
|
11131
|
+
/* @__PURE__ */ jsx52(Text17, { className: styles.formDescription, children: "Optional custom base URL for the API" })
|
|
11142
11132
|
] }),
|
|
11143
|
-
/* @__PURE__ */
|
|
11144
|
-
/* @__PURE__ */
|
|
11133
|
+
/* @__PURE__ */ jsx52("div", { children: /* @__PURE__ */ jsxs32(Space19, { children: [
|
|
11134
|
+
/* @__PURE__ */ jsx52(
|
|
11145
11135
|
Switch,
|
|
11146
11136
|
{
|
|
11147
11137
|
checked: model.streaming,
|
|
11148
11138
|
onChange: (checked) => handleModelChange(index, "streaming", checked)
|
|
11149
11139
|
}
|
|
11150
11140
|
),
|
|
11151
|
-
/* @__PURE__ */
|
|
11141
|
+
/* @__PURE__ */ jsx52(Text17, { children: "Enable Streaming" })
|
|
11152
11142
|
] }) }),
|
|
11153
|
-
/* @__PURE__ */
|
|
11154
|
-
/* @__PURE__ */
|
|
11155
|
-
/* @__PURE__ */
|
|
11156
|
-
/* @__PURE__ */
|
|
11143
|
+
/* @__PURE__ */ jsxs32("div", { style: { display: "flex", gap: 20 }, children: [
|
|
11144
|
+
/* @__PURE__ */ jsxs32("div", { style: { flex: 1 }, children: [
|
|
11145
|
+
/* @__PURE__ */ jsx52(Text17, { className: styles.formLabel, children: "Max Tokens" }),
|
|
11146
|
+
/* @__PURE__ */ jsx52(
|
|
11157
11147
|
Input3,
|
|
11158
11148
|
{
|
|
11159
11149
|
type: "number",
|
|
@@ -11168,9 +11158,9 @@ QUEUE_NAME=tasks`,
|
|
|
11168
11158
|
}
|
|
11169
11159
|
)
|
|
11170
11160
|
] }),
|
|
11171
|
-
/* @__PURE__ */
|
|
11172
|
-
/* @__PURE__ */
|
|
11173
|
-
/* @__PURE__ */
|
|
11161
|
+
/* @__PURE__ */ jsxs32("div", { style: { flex: 1 }, children: [
|
|
11162
|
+
/* @__PURE__ */ jsx52(Text17, { className: styles.formLabel, children: "Temperature" }),
|
|
11163
|
+
/* @__PURE__ */ jsx52(
|
|
11174
11164
|
Input3,
|
|
11175
11165
|
{
|
|
11176
11166
|
type: "number",
|
|
@@ -11189,8 +11179,8 @@ QUEUE_NAME=tasks`,
|
|
|
11189
11179
|
] })
|
|
11190
11180
|
] })
|
|
11191
11181
|
] }, index)),
|
|
11192
|
-
/* @__PURE__ */
|
|
11193
|
-
|
|
11182
|
+
/* @__PURE__ */ jsx52(
|
|
11183
|
+
Button24,
|
|
11194
11184
|
{
|
|
11195
11185
|
type: "dashed",
|
|
11196
11186
|
onClick: handleAddModel,
|
|
@@ -11217,8 +11207,8 @@ QUEUE_NAME=tasks`,
|
|
|
11217
11207
|
);
|
|
11218
11208
|
const currentConnection = connections.find((c) => c.id === activeTabKey);
|
|
11219
11209
|
const renderTabLabel = (connection) => {
|
|
11220
|
-
return /* @__PURE__ */
|
|
11221
|
-
/* @__PURE__ */
|
|
11210
|
+
return /* @__PURE__ */ jsxs32("div", { style: { display: "flex", alignItems: "center" }, children: [
|
|
11211
|
+
/* @__PURE__ */ jsx52(
|
|
11222
11212
|
CloudServerOutlined,
|
|
11223
11213
|
{
|
|
11224
11214
|
style: {
|
|
@@ -11227,14 +11217,14 @@ QUEUE_NAME=tasks`,
|
|
|
11227
11217
|
}
|
|
11228
11218
|
}
|
|
11229
11219
|
),
|
|
11230
|
-
/* @__PURE__ */
|
|
11231
|
-
connection.connected && /* @__PURE__ */
|
|
11220
|
+
/* @__PURE__ */ jsx52("span", { children: connection.name }),
|
|
11221
|
+
connection.connected && /* @__PURE__ */ jsx52(
|
|
11232
11222
|
CheckCircleFilled,
|
|
11233
11223
|
{
|
|
11234
11224
|
style: { color: "#52c41a", fontSize: 12, marginLeft: 8 }
|
|
11235
11225
|
}
|
|
11236
11226
|
),
|
|
11237
|
-
connection.error && !connection.connecting && /* @__PURE__ */
|
|
11227
|
+
connection.error && !connection.connecting && /* @__PURE__ */ jsx52(
|
|
11238
11228
|
CloseCircleFilled,
|
|
11239
11229
|
{
|
|
11240
11230
|
style: { color: "#ff4d4f", fontSize: 12, marginLeft: 8 }
|
|
@@ -11245,35 +11235,35 @@ QUEUE_NAME=tasks`,
|
|
|
11245
11235
|
const tabItems = connections.map((connection) => ({
|
|
11246
11236
|
key: connection.id,
|
|
11247
11237
|
label: renderTabLabel(connection),
|
|
11248
|
-
children: /* @__PURE__ */
|
|
11249
|
-
/* @__PURE__ */
|
|
11238
|
+
children: /* @__PURE__ */ jsx52("div", { className: styles.tabContent, children: connection.connected ? /* @__PURE__ */ jsx52(Fragment8, { children: /* @__PURE__ */ jsxs32("div", { style: { display: "flex", height: "100%" }, children: [
|
|
11239
|
+
/* @__PURE__ */ jsx52("div", { className: styles.sidebar, children: SETTINGS_MENU_ITEMS.map((item) => /* @__PURE__ */ jsxs32(
|
|
11250
11240
|
"div",
|
|
11251
11241
|
{
|
|
11252
11242
|
className: `${styles.menuItem} ${activeMenu === item.key ? "active" : ""}`,
|
|
11253
11243
|
onClick: () => setActiveMenu(item.key),
|
|
11254
11244
|
children: [
|
|
11255
|
-
/* @__PURE__ */
|
|
11256
|
-
/* @__PURE__ */
|
|
11245
|
+
/* @__PURE__ */ jsx52("span", { className: styles.menuItemIcon, children: item.icon }),
|
|
11246
|
+
/* @__PURE__ */ jsx52("span", { className: styles.menuItemText, children: item.label })
|
|
11257
11247
|
]
|
|
11258
11248
|
},
|
|
11259
11249
|
item.key
|
|
11260
11250
|
)) }),
|
|
11261
|
-
/* @__PURE__ */
|
|
11262
|
-
/* @__PURE__ */
|
|
11263
|
-
/* @__PURE__ */
|
|
11264
|
-
/* @__PURE__ */
|
|
11265
|
-
/* @__PURE__ */
|
|
11251
|
+
/* @__PURE__ */ jsxs32("div", { className: styles.content, children: [
|
|
11252
|
+
/* @__PURE__ */ jsxs32("div", { className: styles.contentHeader, children: [
|
|
11253
|
+
/* @__PURE__ */ jsxs32("div", { className: styles.contentHeaderLeft, children: [
|
|
11254
|
+
/* @__PURE__ */ jsx52(Title3, { level: 3, className: styles.contentTitle, children: activeMenuItem?.label }),
|
|
11255
|
+
/* @__PURE__ */ jsxs32(Text17, { className: styles.contentDescription, children: [
|
|
11266
11256
|
activeMenu === "environment" && "Manage environment variables for the gateway server",
|
|
11267
11257
|
activeMenu === "models" && "Configure and register model lattices for use by agents"
|
|
11268
11258
|
] })
|
|
11269
11259
|
] }),
|
|
11270
|
-
/* @__PURE__ */
|
|
11271
|
-
/* @__PURE__ */
|
|
11272
|
-
/* @__PURE__ */
|
|
11273
|
-
|
|
11260
|
+
/* @__PURE__ */ jsxs32("div", { className: styles.contentHeaderRight, children: [
|
|
11261
|
+
/* @__PURE__ */ jsx52(Button24, { onClick: onClose, children: "Cancel" }),
|
|
11262
|
+
/* @__PURE__ */ jsx52(
|
|
11263
|
+
Button24,
|
|
11274
11264
|
{
|
|
11275
11265
|
type: "primary",
|
|
11276
|
-
icon: /* @__PURE__ */
|
|
11266
|
+
icon: /* @__PURE__ */ jsx52(SaveOutlined, {}),
|
|
11277
11267
|
onClick: handleSave,
|
|
11278
11268
|
loading,
|
|
11279
11269
|
children: "Save Configuration"
|
|
@@ -11281,9 +11271,9 @@ QUEUE_NAME=tasks`,
|
|
|
11281
11271
|
)
|
|
11282
11272
|
] })
|
|
11283
11273
|
] }),
|
|
11284
|
-
/* @__PURE__ */
|
|
11274
|
+
/* @__PURE__ */ jsx52("div", { className: styles.contentBody, children: renderContent(connection.id) })
|
|
11285
11275
|
] })
|
|
11286
|
-
] }) }) : /* @__PURE__ */
|
|
11276
|
+
] }) }) : /* @__PURE__ */ jsx52(
|
|
11287
11277
|
"div",
|
|
11288
11278
|
{
|
|
11289
11279
|
style: {
|
|
@@ -11295,29 +11285,29 @@ QUEUE_NAME=tasks`,
|
|
|
11295
11285
|
gap: 16,
|
|
11296
11286
|
padding: 48
|
|
11297
11287
|
},
|
|
11298
|
-
children: connection.connecting ? /* @__PURE__ */
|
|
11299
|
-
/* @__PURE__ */
|
|
11300
|
-
/* @__PURE__ */
|
|
11301
|
-
/* @__PURE__ */
|
|
11288
|
+
children: connection.connecting ? /* @__PURE__ */ jsxs32(Fragment8, { children: [
|
|
11289
|
+
/* @__PURE__ */ jsx52(LinkOutlined, { style: { fontSize: 64, color: "#1890ff" }, spin: true }),
|
|
11290
|
+
/* @__PURE__ */ jsx52(Title3, { level: 4, children: "Connecting..." }),
|
|
11291
|
+
/* @__PURE__ */ jsxs32(Text17, { type: "secondary", style: { textAlign: "center" }, children: [
|
|
11302
11292
|
"Connecting to ",
|
|
11303
11293
|
connection.url
|
|
11304
11294
|
] })
|
|
11305
|
-
] }) : /* @__PURE__ */
|
|
11306
|
-
/* @__PURE__ */
|
|
11307
|
-
/* @__PURE__ */
|
|
11308
|
-
/* @__PURE__ */
|
|
11309
|
-
|
|
11295
|
+
] }) : /* @__PURE__ */ jsxs32(Fragment8, { children: [
|
|
11296
|
+
/* @__PURE__ */ jsx52(LinkOutlined, { style: { fontSize: 64, color: "#d9d9d9" } }),
|
|
11297
|
+
/* @__PURE__ */ jsx52(Title3, { level: 4, type: "secondary", children: connection.error || "Not Connected" }),
|
|
11298
|
+
/* @__PURE__ */ jsx52(
|
|
11299
|
+
Text17,
|
|
11310
11300
|
{
|
|
11311
11301
|
type: "secondary",
|
|
11312
11302
|
style: { textAlign: "center", maxWidth: 400 },
|
|
11313
11303
|
children: connection.error ? `Failed to connect to ${connection.url}. Please check the server URL and try again.` : `Click "Reconnect" to connect to ${connection.url}`
|
|
11314
11304
|
}
|
|
11315
11305
|
),
|
|
11316
|
-
/* @__PURE__ */
|
|
11317
|
-
|
|
11306
|
+
/* @__PURE__ */ jsx52(
|
|
11307
|
+
Button24,
|
|
11318
11308
|
{
|
|
11319
11309
|
type: "primary",
|
|
11320
|
-
icon: /* @__PURE__ */
|
|
11310
|
+
icon: /* @__PURE__ */ jsx52(LinkOutlined, {}),
|
|
11321
11311
|
onClick: () => checkConnection(connection.id),
|
|
11322
11312
|
loading: connection.connecting,
|
|
11323
11313
|
style: { marginTop: 16 },
|
|
@@ -11329,8 +11319,8 @@ QUEUE_NAME=tasks`,
|
|
|
11329
11319
|
) }),
|
|
11330
11320
|
closable: connections.length > 1
|
|
11331
11321
|
}));
|
|
11332
|
-
return /* @__PURE__ */
|
|
11333
|
-
/* @__PURE__ */
|
|
11322
|
+
return /* @__PURE__ */ jsxs32(Fragment8, { children: [
|
|
11323
|
+
/* @__PURE__ */ jsx52(
|
|
11334
11324
|
Modal4,
|
|
11335
11325
|
{
|
|
11336
11326
|
open,
|
|
@@ -11339,7 +11329,7 @@ QUEUE_NAME=tasks`,
|
|
|
11339
11329
|
width: "80%",
|
|
11340
11330
|
footer: null,
|
|
11341
11331
|
title: "Settings",
|
|
11342
|
-
children: /* @__PURE__ */
|
|
11332
|
+
children: /* @__PURE__ */ jsx52("div", { children: /* @__PURE__ */ jsx52(
|
|
11343
11333
|
Tabs2,
|
|
11344
11334
|
{
|
|
11345
11335
|
activeKey: activeTabKey,
|
|
@@ -11353,7 +11343,7 @@ QUEUE_NAME=tasks`,
|
|
|
11353
11343
|
}
|
|
11354
11344
|
},
|
|
11355
11345
|
items: tabItems,
|
|
11356
|
-
addIcon: /* @__PURE__ */
|
|
11346
|
+
addIcon: /* @__PURE__ */ jsxs32(
|
|
11357
11347
|
"div",
|
|
11358
11348
|
{
|
|
11359
11349
|
style: {
|
|
@@ -11363,8 +11353,8 @@ QUEUE_NAME=tasks`,
|
|
|
11363
11353
|
padding: "4px 8px"
|
|
11364
11354
|
},
|
|
11365
11355
|
children: [
|
|
11366
|
-
/* @__PURE__ */
|
|
11367
|
-
/* @__PURE__ */
|
|
11356
|
+
/* @__PURE__ */ jsx52(PlusOutlined5, {}),
|
|
11357
|
+
/* @__PURE__ */ jsx52("span", { children: "Add Server" })
|
|
11368
11358
|
]
|
|
11369
11359
|
}
|
|
11370
11360
|
)
|
|
@@ -11372,7 +11362,7 @@ QUEUE_NAME=tasks`,
|
|
|
11372
11362
|
) })
|
|
11373
11363
|
}
|
|
11374
11364
|
),
|
|
11375
|
-
/* @__PURE__ */
|
|
11365
|
+
/* @__PURE__ */ jsx52(
|
|
11376
11366
|
Modal4,
|
|
11377
11367
|
{
|
|
11378
11368
|
title: "Add New Server",
|
|
@@ -11386,10 +11376,10 @@ QUEUE_NAME=tasks`,
|
|
|
11386
11376
|
},
|
|
11387
11377
|
confirmLoading: addingServer,
|
|
11388
11378
|
className: styles.addServerModal,
|
|
11389
|
-
children: /* @__PURE__ */
|
|
11390
|
-
/* @__PURE__ */
|
|
11391
|
-
/* @__PURE__ */
|
|
11392
|
-
/* @__PURE__ */
|
|
11379
|
+
children: /* @__PURE__ */ jsxs32(Space19, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
|
|
11380
|
+
/* @__PURE__ */ jsxs32("div", { children: [
|
|
11381
|
+
/* @__PURE__ */ jsx52(Text17, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server Name" }),
|
|
11382
|
+
/* @__PURE__ */ jsx52(
|
|
11393
11383
|
Input3,
|
|
11394
11384
|
{
|
|
11395
11385
|
placeholder: "e.g., Production Server",
|
|
@@ -11398,11 +11388,11 @@ QUEUE_NAME=tasks`,
|
|
|
11398
11388
|
onPressEnter: handleAddServer
|
|
11399
11389
|
}
|
|
11400
11390
|
),
|
|
11401
|
-
/* @__PURE__ */
|
|
11391
|
+
/* @__PURE__ */ jsx52(Text17, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: Leave empty to use URL as name" })
|
|
11402
11392
|
] }),
|
|
11403
|
-
/* @__PURE__ */
|
|
11404
|
-
/* @__PURE__ */
|
|
11405
|
-
/* @__PURE__ */
|
|
11393
|
+
/* @__PURE__ */ jsxs32("div", { children: [
|
|
11394
|
+
/* @__PURE__ */ jsx52(Text17, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server URL *" }),
|
|
11395
|
+
/* @__PURE__ */ jsx52(
|
|
11406
11396
|
Input3,
|
|
11407
11397
|
{
|
|
11408
11398
|
placeholder: "e.g., http://localhost:4001",
|
|
@@ -11411,11 +11401,11 @@ QUEUE_NAME=tasks`,
|
|
|
11411
11401
|
onPressEnter: handleAddServer
|
|
11412
11402
|
}
|
|
11413
11403
|
),
|
|
11414
|
-
/* @__PURE__ */
|
|
11404
|
+
/* @__PURE__ */ jsx52(Text17, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Enter the full URL of the gateway server" })
|
|
11415
11405
|
] }),
|
|
11416
|
-
/* @__PURE__ */
|
|
11417
|
-
/* @__PURE__ */
|
|
11418
|
-
/* @__PURE__ */
|
|
11406
|
+
/* @__PURE__ */ jsxs32("div", { children: [
|
|
11407
|
+
/* @__PURE__ */ jsx52(Text17, { strong: true, style: { display: "block", marginBottom: 8 }, children: "API Key" }),
|
|
11408
|
+
/* @__PURE__ */ jsx52(
|
|
11419
11409
|
Input3.Password,
|
|
11420
11410
|
{
|
|
11421
11411
|
placeholder: "Optional: Enter API key for authentication",
|
|
@@ -11424,7 +11414,7 @@ QUEUE_NAME=tasks`,
|
|
|
11424
11414
|
onPressEnter: handleAddServer
|
|
11425
11415
|
}
|
|
11426
11416
|
),
|
|
11427
|
-
/* @__PURE__ */
|
|
11417
|
+
/* @__PURE__ */ jsx52(Text17, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: API key for server authentication" })
|
|
11428
11418
|
] })
|
|
11429
11419
|
] })
|
|
11430
11420
|
}
|
|
@@ -11433,10 +11423,10 @@ QUEUE_NAME=tasks`,
|
|
|
11433
11423
|
};
|
|
11434
11424
|
|
|
11435
11425
|
// src/components/Chat/AgentServerSetting.tsx
|
|
11436
|
-
import { jsx as
|
|
11426
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
11437
11427
|
var AgentServerSetting = () => {
|
|
11438
11428
|
const { settingsModalOpen, setSettingsModalOpen } = useLatticeChatShellContext();
|
|
11439
|
-
return /* @__PURE__ */
|
|
11429
|
+
return /* @__PURE__ */ jsx53(
|
|
11440
11430
|
SettingsModal,
|
|
11441
11431
|
{
|
|
11442
11432
|
open: settingsModalOpen,
|
|
@@ -11446,12 +11436,12 @@ var AgentServerSetting = () => {
|
|
|
11446
11436
|
};
|
|
11447
11437
|
|
|
11448
11438
|
// src/components/Chat/LatticeChatShell.tsx
|
|
11449
|
-
import { jsx as
|
|
11439
|
+
import { jsx as jsx54, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
11450
11440
|
var LatticeChatShell = (props) => {
|
|
11451
11441
|
const { initialConfig } = props;
|
|
11452
|
-
return /* @__PURE__ */
|
|
11453
|
-
/* @__PURE__ */
|
|
11454
|
-
/* @__PURE__ */
|
|
11442
|
+
return /* @__PURE__ */ jsxs33(LatticeChatShellContextProvider, { ...props, children: [
|
|
11443
|
+
/* @__PURE__ */ jsx54(AssistantContextProvider, { autoLoad: true, initialAssistantId: initialConfig?.assistantId, children: /* @__PURE__ */ jsx54(ConversationContextProvider, { children: /* @__PURE__ */ jsx54(LatticeChatView, {}) }) }),
|
|
11444
|
+
/* @__PURE__ */ jsx54(AgentServerSetting, {})
|
|
11455
11445
|
] });
|
|
11456
11446
|
};
|
|
11457
11447
|
export {
|