@axiom-lattice/react-sdk 2.1.26 → 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.js CHANGED
@@ -1037,40 +1037,16 @@ var useStyle = (0, import_antd_style.createStyles)(({ token, css }) => {
1037
1037
  }
1038
1038
  `,
1039
1039
  menu: css`
1040
- background: ${token.colorBgContainer}90;
1041
- width: 240px;
1040
+ // background: ${token.colorBgContainer}90;
1041
+ width: 60px;
1042
1042
  display: flex;
1043
1043
  flex-direction: column;
1044
1044
  flex-shrink: 0;
1045
1045
  transition: all 0.3s ease;
1046
1046
  overflow: hidden;
1047
1047
  position: relative;
1048
- border-radius: ${token.borderRadiusLG}px;
1049
- box-shadow: ${token.boxShadow};
1050
-
1051
- &.open {
1052
- background: transparent;
1053
- box-shadow: none;
1054
- margin-left: -8px;
1055
- height: 100%;
1056
- }
1057
-
1058
- &.collapsed {
1059
- width: 8px;
1060
- height: 100%;
1061
- margin-right: -8px;
1062
- .ant-conversations {
1063
- width: 64px;
1064
- }
1065
-
1066
- .ant-conversations-list {
1067
- display: none !important;
1068
- }
1069
-
1070
- .btn-text {
1071
- display: none !important;
1072
- }
1073
- }
1048
+ // border-radius: ${token.borderRadiusLG}px;
1049
+ // box-shadow: ${token.boxShadow};
1074
1050
  `,
1075
1051
  menuToggle: css`
1076
1052
  position: relative;
@@ -1354,7 +1330,7 @@ var ColumnLayout = ({
1354
1330
  };
1355
1331
 
1356
1332
  // src/components/Chat/SideAppViewBrowser.tsx
1357
- var import_icons16 = require("@ant-design/icons");
1333
+ var import_icons17 = require("@ant-design/icons");
1358
1334
 
1359
1335
  // src/components/GenUI/elements/confirm_feedback.tsx
1360
1336
  var import_antd3 = require("antd");
@@ -2490,7 +2466,11 @@ var ToolCall = ({ data }) => {
2490
2466
  const expandIcon = ({ isActive }) => {
2491
2467
  return getStatusIcon(toolCallData.status);
2492
2468
  };
2493
- const toolCallElement = getElement(toolCallData.name.toLowerCase());
2469
+ let toolCallName = toolCallData.name.toLowerCase();
2470
+ if (toolCallName.startsWith("browser_")) {
2471
+ toolCallName = "browser_viewer";
2472
+ }
2473
+ const toolCallElement = getElement(toolCallName);
2494
2474
  if (toolCallElement) {
2495
2475
  return toolCallElement.card_view({
2496
2476
  data: toolCallData,
@@ -3285,7 +3265,7 @@ var AttachmentsCard = ({
3285
3265
  columns = 1,
3286
3266
  showDownloadButton = false
3287
3267
  }) => {
3288
- const { Text: Text17 } = import_antd9.Typography;
3268
+ const { Text: Text18 } = import_antd9.Typography;
3289
3269
  const [showAll, setShowAll] = (0, import_react14.useState)(false);
3290
3270
  const { openSideApp } = useChatUIContext();
3291
3271
  const getStyles = () => {
@@ -3360,7 +3340,7 @@ var AttachmentsCard = ({
3360
3340
  );
3361
3341
  };
3362
3342
  const renderFileDescription = (item) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_antd9.Space, { direction: "vertical", size: size === "small" ? 2 : 4, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_antd9.Space, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3363
- Text17,
3343
+ Text18,
3364
3344
  {
3365
3345
  type: "secondary",
3366
3346
  style: {
@@ -3432,7 +3412,7 @@ var AttachmentsCard = ({
3432
3412
  }
3433
3413
  ),
3434
3414
  item.files && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { style: { paddingLeft: "12px" }, children: [
3435
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Text17, { type: "secondary", style: { fontSize: "12px" }, children: [
3415
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Text18, { type: "secondary", style: { fontSize: "12px" }, children: [
3436
3416
  "\u5305\u542B\u6587\u4EF6(",
3437
3417
  item.files.length,
3438
3418
  ")"
@@ -4757,7 +4737,8 @@ var DEFAULT_CONFIG = {
4757
4737
  timeout: 3e5,
4758
4738
  headers: {},
4759
4739
  enableThreadCreation: true,
4760
- enableThreadList: true
4740
+ enableThreadList: true,
4741
+ showSideMenu: true
4761
4742
  };
4762
4743
  var LatticeChatShellContext = (0, import_react20.createContext)({
4763
4744
  config: DEFAULT_CONFIG,
@@ -6307,6 +6288,99 @@ var ScheduleViewer = ({ data }) => {
6307
6288
  ] });
6308
6289
  };
6309
6290
 
6291
+ // src/components/GenUI/elements/browser_view_card.tsx
6292
+ var import_antd26 = require("antd");
6293
+ var import_icons16 = require("@ant-design/icons");
6294
+ var import_jsx_runtime40 = require("react/jsx-runtime");
6295
+ var { Text: Text13 } = import_antd26.Typography;
6296
+ var BrowserViewer = ({
6297
+ data,
6298
+ component_key,
6299
+ interactive = true
6300
+ }) => {
6301
+ const toolCallData = data;
6302
+ const { threadId, assistantId } = useConversationContext();
6303
+ const { config } = useLatticeChatShellContext();
6304
+ const ws_path = `/sandbox/assistants/${assistantId}/threads/${threadId}/sandbox/websockify`;
6305
+ let targetUrl = `/api/assistants/${assistantId}/threads/${threadId}/sandbox?autoconnect=true&resize=scale&reconnect=1&path${ws_path}`;
6306
+ if (config.globalSharedSandboxURL) {
6307
+ targetUrl = `${config.globalSharedSandboxURL}/vnc/index.html?autoconnect=true&resize=scale&reconnect=1&path=/sandbox/global/websockify`;
6308
+ }
6309
+ function getStatusIcon3(status) {
6310
+ switch (status) {
6311
+ case "success":
6312
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_icons16.CheckCircleOutlined, { style: { color: "#52c41a" } });
6313
+ case "error":
6314
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_icons16.InfoCircleOutlined, { style: { color: "#ff4d4f" } });
6315
+ default:
6316
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_icons16.LoadingOutlined, { style: { color: "#1890ff" } });
6317
+ }
6318
+ }
6319
+ const formatToolName = (name) => {
6320
+ if (!name) {
6321
+ return "";
6322
+ }
6323
+ return name.replace(/([a-z])([A-Z])/g, "$1 $2").split(/[_-]/).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
6324
+ };
6325
+ const formatArgsPreview = (args) => {
6326
+ try {
6327
+ const argsStr = Object.values(args).map((value) => {
6328
+ 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 ? "..." : "");
6329
+ return valueStr;
6330
+ }).join(" ");
6331
+ const result = argsStr.length > 100 ? argsStr.substring(0, 100) + "..." : argsStr;
6332
+ return result.replaceAll("\n", " ");
6333
+ } catch (e) {
6334
+ return "Error parsing args";
6335
+ }
6336
+ };
6337
+ const header = /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_antd26.Flex, { align: "center", wrap: "wrap", children: [
6338
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_antd26.Typography.Text, { strong: true, children: formatToolName(toolCallData.name) }),
6339
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
6340
+ import_antd26.Typography.Text,
6341
+ {
6342
+ type: "secondary",
6343
+ style: { fontSize: "12px", marginLeft: "8px" },
6344
+ children: formatArgsPreview(toolCallData.args)
6345
+ }
6346
+ )
6347
+ ] });
6348
+ const { openSideApp } = useChatUIContext();
6349
+ if (!toolCallData) {
6350
+ return null;
6351
+ }
6352
+ const handleItemClick = (toolCallData2) => {
6353
+ openSideApp({
6354
+ component_key: "browser_viewer",
6355
+ message: "View Browser",
6356
+ data: {
6357
+ url: targetUrl
6358
+ }
6359
+ });
6360
+ };
6361
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
6362
+ ContentPreviewCollapse,
6363
+ {
6364
+ panelKey: toolCallData.id,
6365
+ header,
6366
+ expandIcon: () => getStatusIcon3(toolCallData.status),
6367
+ extra: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
6368
+ import_antd26.Button,
6369
+ {
6370
+ type: "link",
6371
+ size: "small",
6372
+ onClick: (evt) => {
6373
+ evt.stopPropagation();
6374
+ handleItemClick(toolCallData);
6375
+ },
6376
+ children: "View Browser"
6377
+ }
6378
+ ),
6379
+ children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(MDResponse, { content: toolCallData.response || "" })
6380
+ }
6381
+ );
6382
+ };
6383
+
6310
6384
  // src/components/GenUI/elements/builtIns.tsx
6311
6385
  var elements = {
6312
6386
  action_show_attachments_uploader: {
@@ -6362,6 +6436,10 @@ var elements = {
6362
6436
  schedule_viewer: {
6363
6437
  card_view: () => null,
6364
6438
  side_app_view: ScheduleViewer
6439
+ },
6440
+ browser_viewer: {
6441
+ card_view: BrowserViewer,
6442
+ side_app_view: AttachmentsViewerSideApp
6365
6443
  }
6366
6444
  };
6367
6445
 
@@ -6379,10 +6457,10 @@ var regsiterElement = (language, ElementMeta) => {
6379
6457
  };
6380
6458
 
6381
6459
  // src/components/Chat/SideAppViewBrowser.tsx
6382
- var import_antd26 = require("antd");
6460
+ var import_antd27 = require("antd");
6383
6461
  var import_antd_style12 = require("antd-style");
6384
6462
  var import_react26 = require("react");
6385
- var import_jsx_runtime40 = require("react/jsx-runtime");
6463
+ var import_jsx_runtime41 = require("react/jsx-runtime");
6386
6464
  var useStyle8 = (0, import_antd_style12.createStyles)(({ token, css }) => {
6387
6465
  return {
6388
6466
  tabContainer: css`
@@ -6402,9 +6480,9 @@ var useStyle8 = (0, import_antd_style12.createStyles)(({ token, css }) => {
6402
6480
  };
6403
6481
  });
6404
6482
  var EmptySideAppView = ({ component_key, data }) => {
6405
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { children: [
6406
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { children: "\u672A\u627E\u5230\u5BF9\u5E94\u7684\u7EC4\u4EF6\u89C6\u56FE" }),
6407
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("pre", { children: JSON.stringify({ component_key, data }, null, 2) })
6483
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { children: [
6484
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { children: "\u672A\u627E\u5230\u5BF9\u5E94\u7684\u7EC4\u4EF6\u89C6\u56FE" }),
6485
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("pre", { children: JSON.stringify({ component_key, data }, null, 2) })
6408
6486
  ] });
6409
6487
  };
6410
6488
  var SideAppViewBrowser = () => {
@@ -6465,7 +6543,7 @@ var SideAppViewBrowser = () => {
6465
6543
  add(
6466
6544
  key,
6467
6545
  sideAppSelectedCard?.message || sideAppSelectedCard?.data.message || "\u672A\u547D\u540D",
6468
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
6546
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
6469
6547
  SideAppView,
6470
6548
  {
6471
6549
  component_key: sideAppSelectedCard?.component_key || "",
@@ -6506,26 +6584,26 @@ var SideAppViewBrowser = () => {
6506
6584
  const getSizeIcon = (size) => {
6507
6585
  switch (size) {
6508
6586
  case "middle":
6509
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_icons16.CompressOutlined, {});
6587
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_icons17.CompressOutlined, {});
6510
6588
  case "large":
6511
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_icons16.ExpandOutlined, {});
6589
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_icons17.ExpandOutlined, {});
6512
6590
  case "full":
6513
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_icons16.FullscreenOutlined, {});
6591
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_icons17.FullscreenOutlined, {});
6514
6592
  default:
6515
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_icons16.ExpandOutlined, {});
6593
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_icons17.ExpandOutlined, {});
6516
6594
  }
6517
6595
  };
6518
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
6519
- import_antd26.Tabs,
6596
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
6597
+ import_antd27.Tabs,
6520
6598
  {
6521
6599
  className: styles.tabContainer,
6522
6600
  type: "editable-card",
6523
6601
  style: { height: "100%" },
6524
6602
  hideAdd: true,
6525
6603
  tabBarExtraContent: {
6526
- right: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { style: { display: "flex", gap: "4px" }, children: [
6527
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
6528
- import_antd26.Button,
6604
+ right: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { style: { display: "flex", gap: "4px" }, children: [
6605
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
6606
+ import_antd27.Button,
6529
6607
  {
6530
6608
  style: { margin: "8px 0" },
6531
6609
  size: "large",
@@ -6535,13 +6613,13 @@ var SideAppViewBrowser = () => {
6535
6613
  title: `\u5F53\u524D\u5C3A\u5BF8: ${getSizeLabel(sideAppSize)}, \u70B9\u51FB\u5207\u6362`
6536
6614
  }
6537
6615
  ),
6538
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
6539
- import_antd26.Button,
6616
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
6617
+ import_antd27.Button,
6540
6618
  {
6541
6619
  style: { margin: "8px 0" },
6542
6620
  size: "large",
6543
6621
  type: "text",
6544
- icon: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_icons16.CloseOutlined, {}),
6622
+ icon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_icons17.CloseOutlined, {}),
6545
6623
  onClick: () => {
6546
6624
  closeSideApp();
6547
6625
  }
@@ -6558,10 +6636,10 @@ var SideAppViewBrowser = () => {
6558
6636
  };
6559
6637
 
6560
6638
  // src/components/Chat/LatticeChat.tsx
6561
- var import_jsx_runtime41 = require("react/jsx-runtime");
6639
+ var import_jsx_runtime42 = require("react/jsx-runtime");
6562
6640
  var LatticeChat = (props) => {
6563
6641
  const { assistant_id, thread_id = "", menu, header, ...chatingProps } = props;
6564
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
6642
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
6565
6643
  AgentThreadProvider,
6566
6644
  {
6567
6645
  assistantId: assistant_id,
@@ -6571,7 +6649,7 @@ var LatticeChat = (props) => {
6571
6649
  enableReturnStateWhenStreamCompleted: true,
6572
6650
  enableResumeStream: true
6573
6651
  },
6574
- children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ChatUIContextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
6652
+ children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ChatUIContextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
6575
6653
  "div",
6576
6654
  {
6577
6655
  style: {
@@ -6582,12 +6660,12 @@ var LatticeChat = (props) => {
6582
6660
  },
6583
6661
  children: [
6584
6662
  header,
6585
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
6663
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
6586
6664
  ColumnLayout,
6587
6665
  {
6588
6666
  menu,
6589
- left: thread_id ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Chating, { ...chatingProps }) : /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { children: "\u9700\u8981\u5148\u521B\u5EFA\u4F1A\u8BDD" }),
6590
- right: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(SideAppViewBrowser, {})
6667
+ left: thread_id ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Chating, { ...chatingProps }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { children: "\u9700\u8981\u5148\u521B\u5EFA\u4F1A\u8BDD" }),
6668
+ right: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(SideAppViewBrowser, {})
6591
6669
  }
6592
6670
  )
6593
6671
  ]
@@ -6599,14 +6677,14 @@ var LatticeChat = (props) => {
6599
6677
 
6600
6678
  // src/components/Chat/AgentConversations.tsx
6601
6679
  var import_x6 = require("@ant-design/x");
6602
- var import_antd27 = require("antd");
6680
+ var import_antd28 = require("antd");
6603
6681
  var import_react27 = require("react");
6604
- var import_jsx_runtime42 = require("react/jsx-runtime");
6682
+ var import_jsx_runtime43 = require("react/jsx-runtime");
6605
6683
  var AgentConversations = ({
6606
6684
  enableThreadCreation = true,
6607
6685
  enableThreadList = true
6608
6686
  }) => {
6609
- const { token } = import_antd27.theme.useToken();
6687
+ const { token } = import_antd28.theme.useToken();
6610
6688
  const { currentAssistant } = useAssistantContext();
6611
6689
  const {
6612
6690
  assistantId,
@@ -6640,7 +6718,7 @@ var AgentConversations = ({
6640
6718
  const creation = enableThreadCreation ? {
6641
6719
  onClick: newChatClick
6642
6720
  } : void 0;
6643
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
6721
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
6644
6722
  import_x6.Conversations,
6645
6723
  {
6646
6724
  creation,
@@ -6655,52 +6733,13 @@ var AgentConversations = ({
6655
6733
  );
6656
6734
  };
6657
6735
 
6658
- // src/components/Chat/ChatSidebar.tsx
6659
- var import_react37 = require("react");
6660
- var import_antd34 = require("antd");
6661
- var import_icons21 = require("@ant-design/icons");
6662
-
6663
- // src/components/Chat/AssistantList.tsx
6664
- var import_x7 = require("@ant-design/x");
6665
- var import_antd28 = require("antd");
6666
- var import_jsx_runtime43 = require("react/jsx-runtime");
6667
- var AssistantList = () => {
6668
- const { token } = import_antd28.theme.useToken();
6669
- const { assistants, selectAssistant, currentAssistant } = useAssistantContext();
6670
- const style = {
6671
- width: "100%",
6672
- background: "transparent",
6673
- borderRadius: token.borderRadius
6674
- };
6675
- const items = assistants.map((assistant) => ({
6676
- key: assistant.id,
6677
- label: assistant.name,
6678
- icon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
6679
- import_antd28.Avatar,
6680
- {
6681
- size: "small",
6682
- style: {
6683
- backgroundColor: token.colorFillSecondary,
6684
- color: token.colorText
6685
- },
6686
- children: assistant.name.charAt(0).toUpperCase()
6687
- }
6688
- )
6689
- }));
6690
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
6691
- import_x7.Conversations,
6692
- {
6693
- items,
6694
- activeKey: currentAssistant?.id,
6695
- style,
6696
- onActiveChange: (key) => {
6697
- selectAssistant(key);
6698
- }
6699
- }
6700
- );
6701
- };
6736
+ // src/components/Chat/LatticeChatView.tsx
6737
+ var import_react39 = require("react");
6702
6738
 
6703
6739
  // src/components/Chat/ChatSidebar.tsx
6740
+ var import_react38 = require("react");
6741
+ var import_antd35 = require("antd");
6742
+ var import_icons23 = require("@ant-design/icons");
6704
6743
  var import_antd_style13 = require("antd-style");
6705
6744
 
6706
6745
  // src/components/Chat/AssistantFlow.tsx
@@ -6712,9 +6751,9 @@ var import_style = require("@xyflow/react/dist/style.css");
6712
6751
  var import_react28 = require("react");
6713
6752
  var import_react29 = require("@xyflow/react");
6714
6753
  var import_antd29 = require("antd");
6715
- var import_icons17 = require("@ant-design/icons");
6754
+ var import_icons18 = require("@ant-design/icons");
6716
6755
  var import_jsx_runtime44 = require("react/jsx-runtime");
6717
- var { Text: Text13 } = import_antd29.Typography;
6756
+ var { Text: Text14 } = import_antd29.Typography;
6718
6757
  var getBadgeColor = (id) => {
6719
6758
  const colors = [
6720
6759
  "#1890ff",
@@ -6826,7 +6865,7 @@ var AssistantNode = ({
6826
6865
  },
6827
6866
  children: [
6828
6867
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
6829
- Text13,
6868
+ Text14,
6830
6869
  {
6831
6870
  strong: true,
6832
6871
  style: {
@@ -6862,7 +6901,7 @@ var AssistantNode = ({
6862
6901
  gap: 6
6863
6902
  },
6864
6903
  children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
6865
- Text13,
6904
+ Text14,
6866
6905
  {
6867
6906
  style: {
6868
6907
  fontSize: 11,
@@ -6878,7 +6917,7 @@ var AssistantNode = ({
6878
6917
  }
6879
6918
  ),
6880
6919
  assistant.description && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
6881
- Text13,
6920
+ Text14,
6882
6921
  {
6883
6922
  style: {
6884
6923
  fontSize: 12,
@@ -6905,7 +6944,7 @@ var AssistantNode = ({
6905
6944
  },
6906
6945
  children: [
6907
6946
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
6908
- import_icons17.SettingOutlined,
6947
+ import_icons18.SettingOutlined,
6909
6948
  {
6910
6949
  style: {
6911
6950
  fontSize: 14,
@@ -6914,7 +6953,7 @@ var AssistantNode = ({
6914
6953
  }
6915
6954
  ),
6916
6955
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
6917
- Text13,
6956
+ Text14,
6918
6957
  {
6919
6958
  style: {
6920
6959
  fontSize: 12,
@@ -6951,7 +6990,7 @@ var AssistantNode = ({
6951
6990
  },
6952
6991
  children: [
6953
6992
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
6954
- import_icons17.CodeOutlined,
6993
+ import_icons18.CodeOutlined,
6955
6994
  {
6956
6995
  style: {
6957
6996
  fontSize: 14,
@@ -6960,7 +6999,7 @@ var AssistantNode = ({
6960
6999
  }
6961
7000
  ),
6962
7001
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
6963
- Text13,
7002
+ Text14,
6964
7003
  {
6965
7004
  style: {
6966
7005
  fontSize: 12,
@@ -6986,7 +7025,7 @@ var AssistantNode = ({
6986
7025
  overflowY: "auto"
6987
7026
  },
6988
7027
  children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
6989
- Text13,
7028
+ Text14,
6990
7029
  {
6991
7030
  style: {
6992
7031
  fontSize: 11,
@@ -7012,7 +7051,7 @@ var AssistantNode = ({
7012
7051
  },
7013
7052
  children: [
7014
7053
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
7015
- import_icons17.ToolOutlined,
7054
+ import_icons18.ToolOutlined,
7016
7055
  {
7017
7056
  style: {
7018
7057
  fontSize: 14,
@@ -7021,7 +7060,7 @@ var AssistantNode = ({
7021
7060
  }
7022
7061
  ),
7023
7062
  /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
7024
- Text13,
7063
+ Text14,
7025
7064
  {
7026
7065
  style: {
7027
7066
  fontSize: 12,
@@ -7063,7 +7102,7 @@ var AssistantNode = ({
7063
7102
  },
7064
7103
  children: [
7065
7104
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
7066
- import_icons17.BranchesOutlined,
7105
+ import_icons18.BranchesOutlined,
7067
7106
  {
7068
7107
  style: {
7069
7108
  fontSize: 14,
@@ -7072,7 +7111,7 @@ var AssistantNode = ({
7072
7111
  }
7073
7112
  ),
7074
7113
  /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
7075
- Text13,
7114
+ Text14,
7076
7115
  {
7077
7116
  style: {
7078
7117
  fontSize: 12,
@@ -7130,7 +7169,7 @@ var AssistantNode = ({
7130
7169
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
7131
7170
  import_antd29.Button,
7132
7171
  {
7133
- icon: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_icons17.CopyOutlined, {}),
7172
+ icon: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_icons18.CopyOutlined, {}),
7134
7173
  onClick: () => handleCopy(assistant.id),
7135
7174
  title: "\u590D\u5236 ID"
7136
7175
  }
@@ -7218,7 +7257,7 @@ var AssistantNode = ({
7218
7257
  e.currentTarget.style.background = token.colorBgContainer;
7219
7258
  },
7220
7259
  children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
7221
- import_icons17.InfoCircleOutlined,
7260
+ import_icons18.InfoCircleOutlined,
7222
7261
  {
7223
7262
  style: {
7224
7263
  fontSize: 14,
@@ -7261,7 +7300,7 @@ var AssistantNode = ({
7261
7300
  import_antd29.Avatar,
7262
7301
  {
7263
7302
  size: 44,
7264
- icon: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_icons17.UserOutlined, {}),
7303
+ icon: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_icons18.UserOutlined, {}),
7265
7304
  style: {
7266
7305
  backgroundColor: badgeColor,
7267
7306
  color: "#fff",
@@ -7298,7 +7337,7 @@ var AssistantNode = ({
7298
7337
  },
7299
7338
  children: [
7300
7339
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
7301
- Text13,
7340
+ Text14,
7302
7341
  {
7303
7342
  strong: true,
7304
7343
  style: {
@@ -7323,7 +7362,7 @@ var AssistantNode = ({
7323
7362
  },
7324
7363
  children: [
7325
7364
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
7326
- import_icons17.IdcardOutlined,
7365
+ import_icons18.IdcardOutlined,
7327
7366
  {
7328
7367
  style: {
7329
7368
  fontSize: 9,
@@ -7332,7 +7371,7 @@ var AssistantNode = ({
7332
7371
  }
7333
7372
  ),
7334
7373
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
7335
- Text13,
7374
+ Text14,
7336
7375
  {
7337
7376
  style: {
7338
7377
  fontSize: 9,
@@ -7743,16 +7782,16 @@ var import_react35 = require("react");
7743
7782
  var import_react36 = require("@xyflow/react");
7744
7783
  var import_style2 = require("@xyflow/react/dist/style.css");
7745
7784
  var import_antd33 = require("antd");
7746
- var import_icons20 = require("@ant-design/icons");
7785
+ var import_icons21 = require("@ant-design/icons");
7747
7786
 
7748
7787
  // src/components/Chat/SkillNode.tsx
7749
7788
  var import_react32 = require("react");
7750
7789
  var import_react33 = require("@xyflow/react");
7751
7790
  var import_antd30 = require("antd");
7752
- var import_icons18 = require("@ant-design/icons");
7791
+ var import_icons19 = require("@ant-design/icons");
7753
7792
  var import_client_sdk8 = require("@axiom-lattice/client-sdk");
7754
7793
  var import_jsx_runtime46 = require("react/jsx-runtime");
7755
- var { Text: Text14 } = import_antd30.Typography;
7794
+ var { Text: Text15 } = import_antd30.Typography;
7756
7795
  var { TextArea } = import_antd30.Input;
7757
7796
  var getBadgeColor2 = (name) => {
7758
7797
  const colors = [
@@ -7964,7 +8003,7 @@ var SkillNode = ({ data }) => {
7964
8003
  },
7965
8004
  children: [
7966
8005
  /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
7967
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text14, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Description" }),
8006
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text15, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Description" }),
7968
8007
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
7969
8008
  TextArea,
7970
8009
  {
@@ -7976,7 +8015,7 @@ var SkillNode = ({ data }) => {
7976
8015
  )
7977
8016
  ] }),
7978
8017
  /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
7979
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text14, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "License" }),
8018
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text15, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "License" }),
7980
8019
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
7981
8020
  import_antd30.Input,
7982
8021
  {
@@ -7987,7 +8026,7 @@ var SkillNode = ({ data }) => {
7987
8026
  )
7988
8027
  ] }),
7989
8028
  /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
7990
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text14, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Compatibility" }),
8029
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text15, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Compatibility" }),
7991
8030
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
7992
8031
  import_antd30.Input,
7993
8032
  {
@@ -8008,7 +8047,7 @@ var SkillNode = ({ data }) => {
8008
8047
  },
8009
8048
  children: [
8010
8049
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
8011
- Text14,
8050
+ Text15,
8012
8051
  {
8013
8052
  style: {
8014
8053
  fontSize: 12,
@@ -8022,7 +8061,7 @@ var SkillNode = ({ data }) => {
8022
8061
  import_antd30.Button,
8023
8062
  {
8024
8063
  size: "small",
8025
- icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_icons18.PlusOutlined, {}),
8064
+ icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_icons19.PlusOutlined, {}),
8026
8065
  onClick: handleAddMetadataRow,
8027
8066
  children: "Add"
8028
8067
  }
@@ -8032,7 +8071,7 @@ var SkillNode = ({ data }) => {
8032
8071
  ),
8033
8072
  /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_antd30.Space, { direction: "vertical", size: 8, style: { width: "100%" }, children: [
8034
8073
  metadataRows.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
8035
- Text14,
8074
+ Text15,
8036
8075
  {
8037
8076
  style: {
8038
8077
  fontSize: 11,
@@ -8051,7 +8090,7 @@ var SkillNode = ({ data }) => {
8051
8090
  width: "100%"
8052
8091
  },
8053
8092
  children: [
8054
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Text14, { style: { fontSize: 11, color: token.colorTextSecondary }, children: [
8093
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Text15, { style: { fontSize: 11, color: token.colorTextSecondary }, children: [
8055
8094
  "Meta ",
8056
8095
  index + 1
8057
8096
  ] }),
@@ -8081,7 +8120,7 @@ var SkillNode = ({ data }) => {
8081
8120
  ))
8082
8121
  ] }),
8083
8122
  /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
8084
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text14, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Content" }),
8123
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text15, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Content" }),
8085
8124
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
8086
8125
  TextArea,
8087
8126
  {
@@ -8126,7 +8165,7 @@ var SkillNode = ({ data }) => {
8126
8165
  },
8127
8166
  children: [
8128
8167
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
8129
- Text14,
8168
+ Text15,
8130
8169
  {
8131
8170
  strong: true,
8132
8171
  style: {
@@ -8162,7 +8201,7 @@ var SkillNode = ({ data }) => {
8162
8201
  gap: 6
8163
8202
  },
8164
8203
  children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
8165
- Text14,
8204
+ Text15,
8166
8205
  {
8167
8206
  style: {
8168
8207
  fontSize: 11,
@@ -8179,7 +8218,7 @@ var SkillNode = ({ data }) => {
8179
8218
  ),
8180
8219
  isEditing ? editingView : /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
8181
8220
  currentSkill.description && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
8182
- Text14,
8221
+ Text15,
8183
8222
  {
8184
8223
  style: {
8185
8224
  fontSize: 12,
@@ -8206,7 +8245,7 @@ var SkillNode = ({ data }) => {
8206
8245
  },
8207
8246
  children: [
8208
8247
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
8209
- import_icons18.InfoCircleOutlined,
8248
+ import_icons19.InfoCircleOutlined,
8210
8249
  {
8211
8250
  style: {
8212
8251
  fontSize: 14,
@@ -8215,7 +8254,7 @@ var SkillNode = ({ data }) => {
8215
8254
  }
8216
8255
  ),
8217
8256
  /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
8218
- Text14,
8257
+ Text15,
8219
8258
  {
8220
8259
  style: {
8221
8260
  fontSize: 12,
@@ -8297,7 +8336,7 @@ var SkillNode = ({ data }) => {
8297
8336
  },
8298
8337
  children: [
8299
8338
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
8300
- import_icons18.BranchesOutlined,
8339
+ import_icons19.BranchesOutlined,
8301
8340
  {
8302
8341
  style: {
8303
8342
  fontSize: 14,
@@ -8306,7 +8345,7 @@ var SkillNode = ({ data }) => {
8306
8345
  }
8307
8346
  ),
8308
8347
  /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
8309
- Text14,
8348
+ Text15,
8310
8349
  {
8311
8350
  style: {
8312
8351
  fontSize: 12,
@@ -8344,7 +8383,7 @@ var SkillNode = ({ data }) => {
8344
8383
  currentSkill.license && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
8345
8384
  import_antd30.Tag,
8346
8385
  {
8347
- icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_icons18.CopyrightOutlined, {}),
8386
+ icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_icons19.CopyrightOutlined, {}),
8348
8387
  style: {
8349
8388
  margin: 0,
8350
8389
  fontSize: 11,
@@ -8382,7 +8421,7 @@ var SkillNode = ({ data }) => {
8382
8421
  ] }) }),
8383
8422
  (currentSkill.createdAt || currentSkill.updatedAt) && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_antd30.Space, { direction: "vertical", size: 4, children: [
8384
8423
  currentSkill.createdAt && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
8385
- Text14,
8424
+ Text15,
8386
8425
  {
8387
8426
  style: {
8388
8427
  fontSize: 11,
@@ -8396,7 +8435,7 @@ var SkillNode = ({ data }) => {
8396
8435
  }
8397
8436
  ),
8398
8437
  currentSkill.updatedAt && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
8399
- Text14,
8438
+ Text15,
8400
8439
  {
8401
8440
  style: {
8402
8441
  fontSize: 11,
@@ -8422,7 +8461,7 @@ var SkillNode = ({ data }) => {
8422
8461
  },
8423
8462
  children: [
8424
8463
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
8425
- import_icons18.FileTextOutlined,
8464
+ import_icons19.FileTextOutlined,
8426
8465
  {
8427
8466
  style: {
8428
8467
  fontSize: 14,
@@ -8431,7 +8470,7 @@ var SkillNode = ({ data }) => {
8431
8470
  }
8432
8471
  ),
8433
8472
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
8434
- Text14,
8473
+ Text15,
8435
8474
  {
8436
8475
  style: {
8437
8476
  fontSize: 12,
@@ -8457,7 +8496,7 @@ var SkillNode = ({ data }) => {
8457
8496
  overflowY: "auto"
8458
8497
  },
8459
8498
  children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
8460
- Text14,
8499
+ Text15,
8461
8500
  {
8462
8501
  style: {
8463
8502
  fontSize: 11,
@@ -8537,7 +8576,7 @@ var SkillNode = ({ data }) => {
8537
8576
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
8538
8577
  import_antd30.Button,
8539
8578
  {
8540
- icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_icons18.CopyOutlined, {}),
8579
+ icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_icons19.CopyOutlined, {}),
8541
8580
  onClick: () => handleCopy(currentSkill.id),
8542
8581
  title: "Copy ID"
8543
8582
  }
@@ -8633,7 +8672,7 @@ var SkillNode = ({ data }) => {
8633
8672
  import_antd30.Avatar,
8634
8673
  {
8635
8674
  size: 44,
8636
- icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_icons18.BookOutlined, {}),
8675
+ icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_icons19.BookOutlined, {}),
8637
8676
  style: {
8638
8677
  backgroundColor: badgeColor,
8639
8678
  color: "#fff",
@@ -8660,7 +8699,7 @@ var SkillNode = ({ data }) => {
8660
8699
  justifyContent: "center"
8661
8700
  },
8662
8701
  children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
8663
- import_icons18.BranchesOutlined,
8702
+ import_icons19.BranchesOutlined,
8664
8703
  {
8665
8704
  style: {
8666
8705
  fontSize: 10,
@@ -8682,7 +8721,7 @@ var SkillNode = ({ data }) => {
8682
8721
  },
8683
8722
  children: [
8684
8723
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
8685
- Text14,
8724
+ Text15,
8686
8725
  {
8687
8726
  strong: true,
8688
8727
  style: {
@@ -8707,7 +8746,7 @@ var SkillNode = ({ data }) => {
8707
8746
  },
8708
8747
  children: [
8709
8748
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
8710
- import_icons18.FileTextOutlined,
8749
+ import_icons19.FileTextOutlined,
8711
8750
  {
8712
8751
  style: {
8713
8752
  fontSize: 9,
@@ -8716,7 +8755,7 @@ var SkillNode = ({ data }) => {
8716
8755
  }
8717
8756
  ),
8718
8757
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
8719
- Text14,
8758
+ Text15,
8720
8759
  {
8721
8760
  style: {
8722
8761
  fontSize: 9,
@@ -8842,7 +8881,7 @@ var SkillNode = ({ data }) => {
8842
8881
  fontWeight: 500,
8843
8882
  lineHeight: "14px"
8844
8883
  },
8845
- icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_icons18.CopyrightOutlined, {}),
8884
+ icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_icons19.CopyrightOutlined, {}),
8846
8885
  children: currentSkill.license
8847
8886
  }
8848
8887
  ),
@@ -8860,7 +8899,7 @@ var SkillNode = ({ data }) => {
8860
8899
  fontWeight: 500,
8861
8900
  lineHeight: "14px"
8862
8901
  },
8863
- icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_icons18.InfoCircleOutlined, {}),
8902
+ icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_icons19.InfoCircleOutlined, {}),
8864
8903
  children: currentSkill.compatibility
8865
8904
  }
8866
8905
  )
@@ -8909,11 +8948,11 @@ var SkillNode_default = SkillNode;
8909
8948
  // src/components/Chat/CreateSkillModal.tsx
8910
8949
  var import_react34 = require("react");
8911
8950
  var import_antd31 = require("antd");
8912
- var import_icons19 = require("@ant-design/icons");
8951
+ var import_icons20 = require("@ant-design/icons");
8913
8952
  var import_antd32 = require("antd");
8914
8953
  var import_jsx_runtime47 = require("react/jsx-runtime");
8915
8954
  var { TextArea: TextArea2 } = import_antd31.Input;
8916
- var { Text: Text15 } = import_antd31.Typography;
8955
+ var { Text: Text16 } = import_antd31.Typography;
8917
8956
  var CreateSkillModal = ({
8918
8957
  open,
8919
8958
  onCancel,
@@ -9024,7 +9063,7 @@ var CreateSkillModal = ({
9024
9063
  },
9025
9064
  children: [
9026
9065
  /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
9027
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Text15, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Name" }),
9066
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Text16, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Name" }),
9028
9067
  /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
9029
9068
  import_antd31.Form.Item,
9030
9069
  {
@@ -9043,7 +9082,7 @@ var CreateSkillModal = ({
9043
9082
  )
9044
9083
  ] }),
9045
9084
  /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
9046
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Text15, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Description" }),
9085
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Text16, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Description" }),
9047
9086
  /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
9048
9087
  import_antd31.Form.Item,
9049
9088
  {
@@ -9063,11 +9102,11 @@ var CreateSkillModal = ({
9063
9102
  )
9064
9103
  ] }),
9065
9104
  /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
9066
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Text15, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "License" }),
9105
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Text16, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "License" }),
9067
9106
  /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_antd31.Form.Item, { name: "license", style: { marginBottom: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_antd31.Input, { placeholder: "License" }) })
9068
9107
  ] }),
9069
9108
  /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
9070
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Text15, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Compatibility" }),
9109
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Text16, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Compatibility" }),
9071
9110
  /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_antd31.Form.Item, { name: "compatibility", style: { marginBottom: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_antd31.Input, { placeholder: "Compatibility" }) })
9072
9111
  ] }),
9073
9112
  /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
@@ -9082,7 +9121,7 @@ var CreateSkillModal = ({
9082
9121
  },
9083
9122
  children: [
9084
9123
  /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
9085
- Text15,
9124
+ Text16,
9086
9125
  {
9087
9126
  style: {
9088
9127
  fontSize: 12,
@@ -9096,7 +9135,7 @@ var CreateSkillModal = ({
9096
9135
  import_antd31.Button,
9097
9136
  {
9098
9137
  size: "small",
9099
- icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_icons19.PlusOutlined, {}),
9138
+ icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_icons20.PlusOutlined, {}),
9100
9139
  onClick: handleAddMetadataRow,
9101
9140
  children: "Add"
9102
9141
  }
@@ -9106,7 +9145,7 @@ var CreateSkillModal = ({
9106
9145
  ),
9107
9146
  /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_antd31.Space, { direction: "vertical", size: 8, style: { width: "100%" }, children: [
9108
9147
  metadataRows.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
9109
- Text15,
9148
+ Text16,
9110
9149
  {
9111
9150
  style: {
9112
9151
  fontSize: 11,
@@ -9126,7 +9165,7 @@ var CreateSkillModal = ({
9126
9165
  },
9127
9166
  children: [
9128
9167
  /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
9129
- Text15,
9168
+ Text16,
9130
9169
  {
9131
9170
  style: { fontSize: 11, color: token.colorTextSecondary },
9132
9171
  children: [
@@ -9162,7 +9201,7 @@ var CreateSkillModal = ({
9162
9201
  ] })
9163
9202
  ] }),
9164
9203
  /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
9165
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Text15, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Content" }),
9204
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Text16, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Content" }),
9166
9205
  /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_antd31.Form.Item, { name: "content", style: { marginBottom: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
9167
9206
  TextArea2,
9168
9207
  {
@@ -9416,7 +9455,7 @@ var SkillFlowInner = ({ onNodeClick }) => {
9416
9455
  {
9417
9456
  type: "primary",
9418
9457
  size: "large",
9419
- icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_icons20.PlusOutlined, {}),
9458
+ icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_icons21.PlusOutlined, {}),
9420
9459
  onClick: () => setIsCreateModalOpen(true),
9421
9460
  style: {
9422
9461
  height: 48,
@@ -9445,164 +9484,274 @@ var SkillFlowInner = ({ onNodeClick }) => {
9445
9484
  var SkillFlow = (props) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react36.ReactFlowProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SkillFlowInner, { ...props }) });
9446
9485
  var SkillFlow_default = SkillFlow;
9447
9486
 
9448
- // src/components/Chat/ChatSidebar.tsx
9487
+ // src/components/Chat/ToolsList.tsx
9488
+ var import_antd34 = require("antd");
9489
+ var import_icons22 = require("@ant-design/icons");
9490
+ var import_react37 = require("react");
9449
9491
  var import_jsx_runtime49 = require("react/jsx-runtime");
9450
- var useStyles4 = (0, import_antd_style13.createStyles)(({ token, css }) => ({
9451
- sidebar: css`
9452
- display: flex;
9453
- flex-direction: column;
9454
- height: 100%;
9455
- width: 100%;
9456
- position: relative;
9457
- background: transparent;
9458
- border-radius: ${token.borderRadiusLG}px;
9459
- overflow: visible;
9460
-
9461
- &.firstTimeHighlight {
9462
- border: 2px dashed ${token.colorPrimary};
9463
- background: ${token.colorPrimaryBg};
9464
- }
9465
- `,
9466
- content: css`
9467
- flex: 1;
9468
- overflow-y: auto;
9469
- overflow-x: hidden;
9470
- padding: ${token.paddingMD}px ${token.paddingSM}px;
9471
- padding-bottom: ${token.paddingLG}px;
9472
-
9473
- /* Custom scrollbar styling */
9474
- &::-webkit-scrollbar {
9475
- width: 6px;
9476
- }
9477
-
9478
- &::-webkit-scrollbar-track {
9479
- background: transparent;
9480
- }
9481
-
9482
- &::-webkit-scrollbar-thumb {
9483
- background: ${token.colorBorder};
9484
- border-radius: 3px;
9485
-
9486
- &:hover {
9487
- background: ${token.colorBorderSecondary};
9492
+ var ToolsList = ({
9493
+ onToolSelect,
9494
+ autoLoad = true
9495
+ }) => {
9496
+ const { token } = import_antd34.theme.useToken();
9497
+ const { config } = useLatticeChatShellContext();
9498
+ const [state, setState] = (0, import_react37.useState)({
9499
+ tools: [],
9500
+ isLoading: false,
9501
+ error: null
9502
+ });
9503
+ const [selectedToolId, setSelectedToolId] = (0, import_react37.useState)(null);
9504
+ const fetchTools = (0, import_react37.useCallback)(async () => {
9505
+ setState((prev) => ({ ...prev, isLoading: true, error: null }));
9506
+ try {
9507
+ const headers = {};
9508
+ if (config.apiKey) {
9509
+ headers["Authorization"] = `Bearer ${config.apiKey}`;
9488
9510
  }
9511
+ const response = await fetch(`${config.baseURL}/api/tools`, {
9512
+ headers
9513
+ });
9514
+ if (response.ok) {
9515
+ const data = await response.json();
9516
+ if (data.success && data.data && Array.isArray(data.data.records)) {
9517
+ setState((prev) => ({
9518
+ ...prev,
9519
+ tools: data.data.records,
9520
+ isLoading: false
9521
+ }));
9522
+ } else {
9523
+ throw new Error("Invalid response format");
9524
+ }
9525
+ } else {
9526
+ throw new Error(`Failed to fetch tools: ${response.statusText}`);
9527
+ }
9528
+ } catch (error) {
9529
+ setState((prev) => ({
9530
+ ...prev,
9531
+ tools: [],
9532
+ isLoading: false,
9533
+ error: error instanceof Error ? error : new Error(String(error))
9534
+ }));
9489
9535
  }
9490
- `,
9491
- hoverOverlay: css`
9492
- position: fixed;
9493
- top: 0;
9494
- left: 0;
9495
- height: 100vh;
9496
- width: 240px;
9497
- background: ${token.colorBgContainer};
9498
- box-shadow: ${token.boxShadowSecondary};
9499
- border-radius: 0 ${token.borderRadiusLG}px ${token.borderRadiusLG}px 0;
9500
- z-index: 1000;
9501
- transform: translateX(-100%);
9502
- transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
9503
- overflow: hidden;
9504
- display: flex;
9505
- flex-direction: column;
9506
- padding-top: ${token.paddingMD}px;
9507
-
9508
- &.visible {
9509
- transform: translateX(0);
9510
- }
9511
- `,
9512
- hoverContent: css`
9513
- flex: 1;
9514
- overflow-y: auto;
9515
- overflow-x: hidden;
9516
- padding: ${token.paddingMD}px ${token.paddingSM}px;
9517
- padding-bottom: ${token.paddingLG}px;
9518
-
9519
- /* Custom scrollbar styling */
9520
- &::-webkit-scrollbar {
9521
- width: 6px;
9522
- }
9523
-
9524
- &::-webkit-scrollbar-track {
9525
- background: transparent;
9536
+ }, [config]);
9537
+ const handleToolSelect = (0, import_react37.useCallback)(
9538
+ (tool) => {
9539
+ setSelectedToolId(tool.id);
9540
+ onToolSelect?.(tool);
9541
+ },
9542
+ [onToolSelect]
9543
+ );
9544
+ const handleRefresh = (0, import_react37.useCallback)(() => {
9545
+ fetchTools();
9546
+ }, [fetchTools]);
9547
+ (0, import_react37.useEffect)(() => {
9548
+ if (autoLoad) {
9549
+ fetchTools();
9526
9550
  }
9527
-
9528
- &::-webkit-scrollbar-thumb {
9529
- background: ${token.colorBorder};
9530
- border-radius: 3px;
9531
-
9532
- &:hover {
9533
- background: ${token.colorBorderSecondary};
9551
+ }, [autoLoad, fetchTools]);
9552
+ const style = {
9553
+ width: "100%",
9554
+ height: "100%",
9555
+ background: "transparent",
9556
+ borderRadius: token.borderRadius,
9557
+ padding: token.paddingSM
9558
+ };
9559
+ if (state.error) {
9560
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { style, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
9561
+ import_antd34.Alert,
9562
+ {
9563
+ message: "Error Loading Tools",
9564
+ description: state.error.message,
9565
+ type: "error",
9566
+ showIcon: true,
9567
+ action: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
9568
+ import_antd34.Button,
9569
+ {
9570
+ size: "small",
9571
+ icon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_icons22.ReloadOutlined, {}),
9572
+ onClick: handleRefresh,
9573
+ children: "Retry"
9574
+ }
9575
+ )
9534
9576
  }
9535
- }
9536
- `,
9537
- section: css`
9538
- margin-bottom: ${token.marginLG}px;
9577
+ ) });
9578
+ }
9579
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { style: { position: "relative", width: "100%", height: "100%" }, children: [
9580
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
9581
+ "div",
9582
+ {
9583
+ style: {
9584
+ position: "absolute",
9585
+ top: token.paddingSM,
9586
+ right: token.paddingSM,
9587
+ zIndex: 1
9588
+ },
9589
+ children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
9590
+ import_antd34.Button,
9591
+ {
9592
+ type: "text",
9593
+ size: "small",
9594
+ icon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_icons22.ReloadOutlined, {}),
9595
+ onClick: handleRefresh,
9596
+ title: "Refresh tools",
9597
+ style: {
9598
+ color: token.colorTextSecondary
9599
+ }
9600
+ }
9601
+ )
9602
+ }
9603
+ ),
9604
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
9605
+ "div",
9606
+ {
9607
+ style: {
9608
+ width: "100%",
9609
+ height: "100%",
9610
+ overflowY: "auto",
9611
+ overflowX: "hidden",
9612
+ paddingTop: token.paddingLG
9613
+ },
9614
+ children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
9615
+ import_antd34.List,
9616
+ {
9617
+ dataSource: state.tools,
9618
+ loading: state.isLoading,
9619
+ locale: {
9620
+ emptyText: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
9621
+ "div",
9622
+ {
9623
+ style: {
9624
+ display: "flex",
9625
+ flexDirection: "column",
9626
+ alignItems: "center",
9627
+ gap: token.marginSM,
9628
+ padding: token.paddingLG
9629
+ },
9630
+ children: [
9631
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { style: { color: token.colorTextSecondary }, children: "No tools available" }),
9632
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
9633
+ import_antd34.Button,
9634
+ {
9635
+ icon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_icons22.ReloadOutlined, {}),
9636
+ onClick: handleRefresh,
9637
+ type: "dashed",
9638
+ size: "small",
9639
+ children: "Refresh"
9640
+ }
9641
+ )
9642
+ ]
9643
+ }
9644
+ )
9645
+ },
9646
+ style: {
9647
+ ...style,
9648
+ paddingTop: 0
9649
+ },
9650
+ renderItem: (tool) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
9651
+ import_antd34.List.Item,
9652
+ {
9653
+ onClick: () => handleToolSelect(tool),
9654
+ style: {
9655
+ cursor: "pointer",
9656
+ padding: token.paddingSM,
9657
+ borderRadius: token.borderRadius,
9658
+ backgroundColor: selectedToolId === tool.id ? token.colorFillSecondary : "transparent",
9659
+ transition: "background-color 0.2s"
9660
+ },
9661
+ onMouseEnter: (e) => {
9662
+ if (selectedToolId !== tool.id) {
9663
+ e.currentTarget.style.backgroundColor = token.colorFillTertiary;
9664
+ }
9665
+ },
9666
+ onMouseLeave: (e) => {
9667
+ if (selectedToolId !== tool.id) {
9668
+ e.currentTarget.style.backgroundColor = "transparent";
9669
+ }
9670
+ },
9671
+ children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
9672
+ import_antd34.List.Item.Meta,
9673
+ {
9674
+ avatar: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
9675
+ import_antd34.Avatar,
9676
+ {
9677
+ size: "small",
9678
+ style: {
9679
+ backgroundColor: token.colorFillSecondary,
9680
+ color: token.colorText
9681
+ },
9682
+ children: tool.name.charAt(0).toUpperCase()
9683
+ }
9684
+ ),
9685
+ title: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
9686
+ "div",
9687
+ {
9688
+ style: {
9689
+ display: "flex",
9690
+ alignItems: "center",
9691
+ gap: token.marginXS
9692
+ },
9693
+ children: [
9694
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { children: tool.name }),
9695
+ tool.needUserApprove && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
9696
+ import_antd34.Tag,
9697
+ {
9698
+ color: "warning",
9699
+ style: {
9700
+ fontSize: "10px",
9701
+ padding: "2px 6px",
9702
+ margin: 0,
9703
+ lineHeight: "1.2"
9704
+ },
9705
+ children: "Requires approval"
9706
+ }
9707
+ )
9708
+ ]
9709
+ }
9710
+ ),
9711
+ description: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
9712
+ "div",
9713
+ {
9714
+ style: {
9715
+ color: token.colorTextSecondary,
9716
+ fontSize: token.fontSizeSM,
9717
+ overflow: "hidden",
9718
+ textOverflow: "ellipsis",
9719
+ whiteSpace: "nowrap"
9720
+ },
9721
+ children: tool.description
9722
+ }
9723
+ )
9724
+ }
9725
+ )
9726
+ },
9727
+ tool.id
9728
+ )
9729
+ }
9730
+ )
9731
+ }
9732
+ )
9733
+ ] });
9734
+ };
9539
9735
 
9540
- &:last-child {
9541
- margin-bottom: 0;
9542
- }
9543
- `,
9544
- sectionTitle: css`
9545
- font-size: ${token.fontSizeSM}px;
9546
- font-weight: 600;
9547
- color: ${token.colorTextSecondary};
9548
- text-transform: uppercase;
9549
- letter-spacing: 0.5px;
9550
- padding: 0 ${token.paddingXS}px;
9551
- margin-bottom: ${token.marginSM}px;
9736
+ // src/components/Chat/ChatSidebar.tsx
9737
+ var import_jsx_runtime50 = require("react/jsx-runtime");
9738
+ var useStyles4 = (0, import_antd_style13.createStyles)(({ token, css }) => ({
9739
+ sidebar: css`
9552
9740
  display: flex;
9553
- align-items: center;
9554
- justify-content: space-between;
9555
- `,
9556
- sectionTitleButton: css`
9557
- font-size: ${token.fontSizeSM}px;
9558
- padding: 0;
9559
- height: auto;
9560
- color: ${token.colorTextSecondary};
9561
- border: none;
9741
+ flex-direction: column;
9742
+ height: 100%;
9743
+ width: 100%;
9744
+ position: relative;
9562
9745
  background: transparent;
9563
-
9564
- &:hover {
9565
- color: ${token.colorPrimary};
9566
- background: transparent;
9567
- }
9746
+ border-radius: ${token.borderRadiusLG}px;
9747
+ overflow: visible;
9748
+ padding: ${token.paddingMD}px ${token.paddingSM}px;
9568
9749
  `,
9569
- footer: css`
9750
+ buttonContainer: css`
9570
9751
  display: flex;
9571
- justify-content: center;
9752
+ flex-direction: column;
9753
+ gap: ${token.marginSM}px;
9572
9754
  align-items: center;
9573
- padding: ${token.paddingSM}px;
9574
- background: transparent;
9575
- border-top: 1px solid ${token.colorBorderSecondary};
9576
- gap: ${token.marginXS}px;
9577
- flex-shrink: 0;
9578
- position: relative;
9579
-
9580
- &::before {
9581
- content: "";
9582
- position: absolute;
9583
- top: 0;
9584
- left: 0;
9585
- right: 0;
9586
- height: 1px;
9587
- background: linear-gradient(
9588
- 90deg,
9589
- transparent,
9590
- ${token.colorBorder},
9591
- transparent
9592
- );
9593
- }
9594
-
9595
- &.collapsed {
9596
- border: 0;
9597
- &::before {
9598
- content: "";
9599
- position: absolute;
9600
- top: 0;
9601
- left: 0;
9602
- right: 0;
9603
- height: 0px;
9604
- }
9605
- }
9606
9755
  `,
9607
9756
  actionButton: css`
9608
9757
  display: flex;
@@ -9632,253 +9781,75 @@ var useStyles4 = (0, import_antd_style13.createStyles)(({ token, css }) => ({
9632
9781
  .anticon {
9633
9782
  font-size: 16px;
9634
9783
  }
9635
- `,
9636
- divider: css`
9637
- margin: ${token.marginMD}px 0;
9638
- border-color: ${token.colorBorderSecondary};
9639
- `,
9640
- hintTooltip: css`
9641
- position: absolute;
9642
- top: ${token.paddingMD}px;
9643
- left: ${token.paddingMD}px;
9644
- right: ${token.paddingMD}px;
9645
- padding: ${token.paddingSM}px ${token.paddingMD}px;
9646
- background: ${token.colorPrimary};
9647
- color: ${token.colorTextLightSolid};
9648
- border-radius: ${token.borderRadius}px;
9649
- font-size: ${token.fontSizeSM}px;
9650
- z-index: 1001;
9651
- animation: slideIn 0.3s ease-out;
9652
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
9653
-
9654
- @keyframes slideIn {
9655
- from {
9656
- opacity: 0;
9657
- transform: translateY(-10px);
9658
- }
9659
- to {
9660
- opacity: 1;
9661
- transform: translateY(0);
9662
- }
9663
- }
9664
9784
  `
9665
9785
  }));
9666
- var FIRST_COLLAPSE_KEY = "chat-sidebar-first-collapse-seen";
9667
9786
  var ChatSidebar = ({
9668
- onSettingsClick,
9669
- defaultCollapsed = false
9787
+ onSettingsClick
9670
9788
  }) => {
9671
9789
  const { styles } = useStyles4();
9672
- const { setMenuCollapsed, menuCollapsed, sideAppVisible } = useChatUIContext();
9673
- const { setSettingsModalOpen, config } = useLatticeChatShellContext();
9790
+ const { setSettingsModalOpen } = useLatticeChatShellContext();
9674
9791
  const { selectAssistant } = useAssistantContext();
9675
- const [isHovered, setIsHovered] = (0, import_react37.useState)(false);
9676
- const [isFirstCollapse, setIsFirstCollapse] = (0, import_react37.useState)(false);
9677
- const [isFlowModalOpen, setIsFlowModalOpen] = (0, import_react37.useState)(false);
9678
- const [isSkillFlowModalOpen, setIsSkillFlowModalOpen] = (0, import_react37.useState)(false);
9679
- const prevIsCollapsedRef = (0, import_react37.useRef)(false);
9680
- const handleToggleCollapse = () => {
9681
- setMenuCollapsed(!menuCollapsed);
9682
- };
9792
+ const [isFlowModalOpen, setIsFlowModalOpen] = (0, import_react38.useState)(false);
9793
+ const [isSkillFlowModalOpen, setIsSkillFlowModalOpen] = (0, import_react38.useState)(false);
9794
+ const [isToolsModalOpen, setIsToolsModalOpen] = (0, import_react38.useState)(false);
9683
9795
  const handleSettingsClick = () => {
9684
9796
  setSettingsModalOpen(true);
9685
9797
  onSettingsClick?.();
9686
9798
  };
9799
+ const handleAssistantFlowClick = () => {
9800
+ setIsFlowModalOpen(true);
9801
+ };
9687
9802
  const handleSkillFlowClick = () => {
9688
9803
  setIsSkillFlowModalOpen(true);
9689
9804
  };
9690
- const isCollapsed = menuCollapsed || sideAppVisible;
9691
- (0, import_react37.useEffect)(() => {
9692
- const prevIsCollapsed = prevIsCollapsedRef.current;
9693
- if (isCollapsed) {
9694
- const hasSeenFirstCollapse = localStorage.getItem(FIRST_COLLAPSE_KEY);
9695
- if (!hasSeenFirstCollapse) {
9696
- setIsFirstCollapse(true);
9697
- }
9698
- } else if (prevIsCollapsed && !isCollapsed) {
9699
- setIsFirstCollapse((prev) => {
9700
- if (prev) {
9701
- return false;
9702
- }
9703
- return prev;
9704
- });
9705
- }
9706
- prevIsCollapsedRef.current = isCollapsed;
9707
- }, [isCollapsed]);
9708
- const handleMouseEnter = () => {
9709
- if (isCollapsed) {
9710
- setIsHovered(true);
9711
- if (isFirstCollapse) {
9712
- localStorage.setItem(FIRST_COLLAPSE_KEY, "true");
9713
- setIsFirstCollapse(false);
9714
- }
9715
- }
9716
- };
9717
- const handleMouseLeave = () => {
9718
- setIsHovered(false);
9805
+ const handleToolsClick = () => {
9806
+ setIsToolsModalOpen(true);
9719
9807
  };
9720
- const {
9721
- enableThreadCreation = true,
9722
- enableThreadList = true
9723
- } = config || {};
9724
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
9725
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
9726
- "div",
9727
- {
9728
- className: `${styles.sidebar} ${isFirstCollapse ? "firstTimeHighlight" : ""}`,
9729
- onMouseEnter: handleMouseEnter,
9730
- onMouseLeave: handleMouseLeave,
9731
- children: [
9732
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
9733
- import_antd34.Tooltip,
9734
- {
9735
- title: "Move the mouse over the collapsed sidebar to see the assistants and threads",
9736
- open: isFirstCollapse,
9737
- placement: "right",
9738
- children: isFirstCollapse && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { style: { marginTop: "400px" } })
9739
- }
9740
- ),
9741
- !isCollapsed && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
9742
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: styles.content, children: [
9743
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: styles.section, children: [
9744
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: styles.sectionTitle, children: [
9745
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { children: "Assistants" }),
9746
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
9747
- import_antd34.Button,
9748
- {
9749
- type: "text",
9750
- icon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_icons21.ApartmentOutlined, {}),
9751
- onClick: () => setIsFlowModalOpen(true),
9752
- className: styles.sectionTitleButton,
9753
- title: "View Assistant Flow Canvas",
9754
- size: "small"
9755
- }
9756
- )
9757
- ] }),
9758
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(AssistantList, {})
9759
- ] }),
9760
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_antd34.Divider, { className: styles.divider }),
9761
- enableThreadList && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: styles.section, children: [
9762
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: styles.sectionTitle, children: "Threads" }),
9763
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
9764
- AgentConversations,
9765
- {
9766
- enableThreadCreation,
9767
- enableThreadList
9768
- }
9769
- )
9770
- ] })
9771
- ] }),
9772
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: styles.footer, children: [
9773
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
9774
- "button",
9775
- {
9776
- className: styles.actionButton,
9777
- onClick: handleToggleCollapse,
9778
- title: isCollapsed ? "Expand sidebar" : "Collapse sidebar",
9779
- "aria-label": isCollapsed ? "Expand sidebar" : "Collapse sidebar",
9780
- children: isCollapsed ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_icons21.MenuUnfoldOutlined, {}) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_icons21.MenuFoldOutlined, {})
9781
- }
9782
- ),
9783
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
9784
- "button",
9785
- {
9786
- className: styles.actionButton,
9787
- onClick: handleSkillFlowClick,
9788
- title: "Skill Flow Canvas",
9789
- "aria-label": "Skill Flow Canvas",
9790
- children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_icons21.ThunderboltOutlined, {})
9791
- }
9792
- ),
9793
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
9794
- "button",
9795
- {
9796
- className: styles.actionButton,
9797
- onClick: handleSettingsClick,
9798
- title: "Settings",
9799
- "aria-label": "Settings",
9800
- children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_icons21.SettingOutlined, {})
9801
- }
9802
- )
9803
- ] })
9804
- ] })
9805
- ]
9806
- }
9807
- ),
9808
- isCollapsed && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
9809
- "div",
9810
- {
9811
- className: `${styles.hoverOverlay} ${isHovered ? "visible" : ""}`,
9812
- onMouseEnter: handleMouseEnter,
9813
- onMouseLeave: handleMouseLeave,
9814
- children: [
9815
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: styles.hoverContent, children: [
9816
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: styles.section, children: [
9817
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: styles.sectionTitle, children: [
9818
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { children: "Assistants" }),
9819
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
9820
- import_antd34.Button,
9821
- {
9822
- type: "text",
9823
- icon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_icons21.ApartmentOutlined, {}),
9824
- onClick: () => setIsFlowModalOpen(true),
9825
- className: styles.sectionTitleButton,
9826
- title: "View Assistant Flow Canvas",
9827
- size: "small"
9828
- }
9829
- )
9830
- ] }),
9831
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(AssistantList, {})
9832
- ] }),
9833
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_antd34.Divider, { className: styles.divider }),
9834
- enableThreadList && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: styles.section, children: [
9835
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: styles.sectionTitle, children: "Threads" }),
9836
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
9837
- AgentConversations,
9838
- {
9839
- enableThreadCreation,
9840
- enableThreadList
9841
- }
9842
- )
9843
- ] })
9844
- ] }),
9845
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: styles.footer, children: [
9846
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
9847
- "button",
9848
- {
9849
- className: styles.actionButton,
9850
- onClick: handleToggleCollapse,
9851
- title: isCollapsed ? "Expand sidebar" : "Collapse sidebar",
9852
- "aria-label": isCollapsed ? "Expand sidebar" : "Collapse sidebar",
9853
- children: isCollapsed ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_icons21.MenuUnfoldOutlined, {}) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_icons21.MenuFoldOutlined, {})
9854
- }
9855
- ),
9856
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
9857
- "button",
9858
- {
9859
- className: styles.actionButton,
9860
- onClick: handleSkillFlowClick,
9861
- title: "Skill Flow Canvas",
9862
- "aria-label": "Skill Flow Canvas",
9863
- children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_icons21.ThunderboltOutlined, {})
9864
- }
9865
- ),
9866
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
9867
- "button",
9868
- {
9869
- className: styles.actionButton,
9870
- onClick: handleSettingsClick,
9871
- title: "Settings",
9872
- "aria-label": "Settings",
9873
- children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_icons21.SettingOutlined, {})
9874
- }
9875
- )
9876
- ] })
9877
- ]
9878
- }
9879
- ),
9880
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
9881
- import_antd34.Modal,
9808
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
9809
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: styles.sidebar, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: styles.buttonContainer, children: [
9810
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
9811
+ "button",
9812
+ {
9813
+ className: styles.actionButton,
9814
+ onClick: handleAssistantFlowClick,
9815
+ title: "Assistant Flow Canvas",
9816
+ "aria-label": "Assistant Flow Canvas",
9817
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_icons23.ApartmentOutlined, {})
9818
+ }
9819
+ ),
9820
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
9821
+ "button",
9822
+ {
9823
+ className: styles.actionButton,
9824
+ onClick: handleSkillFlowClick,
9825
+ title: "Skill Flow Canvas",
9826
+ "aria-label": "Skill Flow Canvas",
9827
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_icons23.ThunderboltOutlined, {})
9828
+ }
9829
+ ),
9830
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
9831
+ "button",
9832
+ {
9833
+ className: styles.actionButton,
9834
+ onClick: handleToolsClick,
9835
+ title: "Tools List",
9836
+ "aria-label": "Tools List",
9837
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_icons23.ToolOutlined, {})
9838
+ }
9839
+ ),
9840
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
9841
+ "button",
9842
+ {
9843
+ className: styles.actionButton,
9844
+ onClick: handleSettingsClick,
9845
+ title: "Settings",
9846
+ "aria-label": "Settings",
9847
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_icons23.SettingOutlined, {})
9848
+ }
9849
+ )
9850
+ ] }) }),
9851
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
9852
+ import_antd35.Modal,
9882
9853
  {
9883
9854
  destroyOnHidden: true,
9884
9855
  title: "Assistant Overview",
@@ -9891,7 +9862,7 @@ var ChatSidebar = ({
9891
9862
  height: "calc(100vh - 120px)",
9892
9863
  padding: 0
9893
9864
  },
9894
- children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
9865
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
9895
9866
  AssistantFlow_default,
9896
9867
  {
9897
9868
  onNodeClick: (assistant) => {
@@ -9902,8 +9873,8 @@ var ChatSidebar = ({
9902
9873
  ) })
9903
9874
  }
9904
9875
  ),
9905
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
9906
- import_antd34.Modal,
9876
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
9877
+ import_antd35.Modal,
9907
9878
  {
9908
9879
  destroyOnHidden: true,
9909
9880
  title: "Skill Overview",
@@ -9916,7 +9887,7 @@ var ChatSidebar = ({
9916
9887
  height: "calc(100vh - 120px)",
9917
9888
  padding: 0
9918
9889
  },
9919
- children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
9890
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
9920
9891
  SkillFlow_default,
9921
9892
  {
9922
9893
  onNodeClick: (skill) => {
@@ -9925,19 +9896,45 @@ var ChatSidebar = ({
9925
9896
  }
9926
9897
  ) })
9927
9898
  }
9899
+ ),
9900
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
9901
+ import_antd35.Modal,
9902
+ {
9903
+ destroyOnHidden: true,
9904
+ title: "Tools Overview",
9905
+ open: isToolsModalOpen,
9906
+ onCancel: () => setIsToolsModalOpen(false),
9907
+ footer: null,
9908
+ width: "90%",
9909
+ style: { top: 20 },
9910
+ bodyStyle: {
9911
+ height: "calc(100vh - 120px)",
9912
+ padding: 0
9913
+ },
9914
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
9915
+ ToolsList,
9916
+ {
9917
+ onToolSelect: (tool) => {
9918
+ console.log("Tool selected:", tool);
9919
+ }
9920
+ }
9921
+ ) })
9922
+ }
9928
9923
  )
9929
9924
  ] });
9930
9925
  };
9931
9926
 
9932
9927
  // src/components/Chat/LatticeChatView.tsx
9933
- var import_jsx_runtime50 = require("react/jsx-runtime");
9928
+ var import_jsx_runtime51 = require("react/jsx-runtime");
9934
9929
  var LatticeChatView = (props) => {
9930
+ const shellContext = (0, import_react39.useContext)(LatticeChatShellContext);
9931
+ const { showSideMenu } = shellContext.config;
9935
9932
  const { assistantId, thread } = useConversationContext();
9936
9933
  const { currentAssistant } = useAssistantContext();
9937
9934
  const {
9938
9935
  config: { baseURL }
9939
9936
  } = useLatticeChatShellContext();
9940
- return assistantId && thread ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
9937
+ return assistantId && thread ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
9941
9938
  AxiomLatticeProvider,
9942
9939
  {
9943
9940
  config: {
@@ -9946,14 +9943,14 @@ var LatticeChatView = (props) => {
9946
9943
  assistantId,
9947
9944
  transport: "sse"
9948
9945
  },
9949
- children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
9946
+ children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
9950
9947
  LatticeChat,
9951
9948
  {
9952
9949
  thread_id: thread?.id,
9953
9950
  assistant_id: assistantId,
9954
9951
  name: currentAssistant?.name,
9955
9952
  description: currentAssistant?.description,
9956
- menu: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ChatSidebar, {})
9953
+ menu: showSideMenu ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ChatSidebar, {}) : void 0
9957
9954
  }
9958
9955
  )
9959
9956
  }
@@ -9961,13 +9958,13 @@ var LatticeChatView = (props) => {
9961
9958
  };
9962
9959
 
9963
9960
  // src/components/Chat/SettingsModal.tsx
9964
- var import_react38 = require("react");
9965
- var import_antd35 = require("antd");
9966
- var import_icons22 = require("@ant-design/icons");
9961
+ var import_react40 = require("react");
9962
+ var import_antd36 = require("antd");
9963
+ var import_icons24 = require("@ant-design/icons");
9967
9964
  var import_antd_style14 = require("antd-style");
9968
- var import_jsx_runtime51 = require("react/jsx-runtime");
9969
- var { Text: Text16, Title: Title3 } = import_antd35.Typography;
9970
- var { TextArea: TextArea3 } = import_antd35.Input;
9965
+ var import_jsx_runtime52 = require("react/jsx-runtime");
9966
+ var { Text: Text17, Title: Title3 } = import_antd36.Typography;
9967
+ var { TextArea: TextArea3 } = import_antd36.Input;
9971
9968
  var useStyles5 = (0, import_antd_style14.createStyles)(({ token, css }) => ({
9972
9969
  // settingsModal: css`
9973
9970
  // .ant-modal {
@@ -10314,12 +10311,12 @@ var SETTINGS_MENU_ITEMS = [
10314
10311
  {
10315
10312
  key: "environment",
10316
10313
  label: "Environment Variables",
10317
- icon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_icons22.EnvironmentOutlined, {})
10314
+ icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_icons24.EnvironmentOutlined, {})
10318
10315
  },
10319
10316
  {
10320
10317
  key: "models",
10321
10318
  label: "Model Configuration",
10322
- icon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_icons22.ApiOutlined, {})
10319
+ icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_icons24.ApiOutlined, {})
10323
10320
  }
10324
10321
  ];
10325
10322
  var SettingsModal = ({
@@ -10328,7 +10325,7 @@ var SettingsModal = ({
10328
10325
  }) => {
10329
10326
  const { styles } = useStyles5();
10330
10327
  const { config: shellConfig, updateConfigValue } = useLatticeChatShellContext();
10331
- const [connections, setConnections] = (0, import_react38.useState)(() => {
10328
+ const [connections, setConnections] = (0, import_react40.useState)(() => {
10332
10329
  if (typeof window !== "undefined") {
10333
10330
  try {
10334
10331
  const stored = localStorage.getItem("lattice_server_connections");
@@ -10351,21 +10348,21 @@ var SettingsModal = ({
10351
10348
  }
10352
10349
  return [];
10353
10350
  });
10354
- const [serverConfigs, setServerConfigs] = (0, import_react38.useState)({});
10355
- const connectionsRef = (0, import_react38.useRef)(connections);
10356
- (0, import_react38.useEffect)(() => {
10351
+ const [serverConfigs, setServerConfigs] = (0, import_react40.useState)({});
10352
+ const connectionsRef = (0, import_react40.useRef)(connections);
10353
+ (0, import_react40.useEffect)(() => {
10357
10354
  connectionsRef.current = connections;
10358
10355
  }, [connections]);
10359
- const [activeTabKey, setActiveTabKey] = (0, import_react38.useState)(
10356
+ const [activeTabKey, setActiveTabKey] = (0, import_react40.useState)(
10360
10357
  connections.length > 0 ? connections[0].id : ""
10361
10358
  );
10362
- const [activeMenu, setActiveMenu] = (0, import_react38.useState)("environment");
10363
- const [loading, setLoading] = (0, import_react38.useState)(false);
10364
- const [showAddServerModal, setShowAddServerModal] = (0, import_react38.useState)(false);
10365
- const [newServerUrl, setNewServerUrl] = (0, import_react38.useState)("");
10366
- const [newServerName, setNewServerName] = (0, import_react38.useState)("");
10367
- const [newServerApiKey, setNewServerApiKey] = (0, import_react38.useState)("");
10368
- const [addingServer, setAddingServer] = (0, import_react38.useState)(false);
10359
+ const [activeMenu, setActiveMenu] = (0, import_react40.useState)("environment");
10360
+ const [loading, setLoading] = (0, import_react40.useState)(false);
10361
+ const [showAddServerModal, setShowAddServerModal] = (0, import_react40.useState)(false);
10362
+ const [newServerUrl, setNewServerUrl] = (0, import_react40.useState)("");
10363
+ const [newServerName, setNewServerName] = (0, import_react40.useState)("");
10364
+ const [newServerApiKey, setNewServerApiKey] = (0, import_react40.useState)("");
10365
+ const [addingServer, setAddingServer] = (0, import_react40.useState)(false);
10369
10366
  const saveConnections = (newConnections) => {
10370
10367
  setConnections(newConnections);
10371
10368
  if (typeof window !== "undefined") {
@@ -10504,7 +10501,7 @@ var SettingsModal = ({
10504
10501
  }
10505
10502
  } catch (error) {
10506
10503
  console.error("Failed to load configuration:", error);
10507
- import_antd35.message.error("Failed to load current configuration");
10504
+ import_antd36.message.error("Failed to load current configuration");
10508
10505
  }
10509
10506
  };
10510
10507
  const loadModelsConfig = async (serverId) => {
@@ -10555,7 +10552,7 @@ var SettingsModal = ({
10555
10552
  console.error("Failed to load models configuration:", error);
10556
10553
  }
10557
10554
  };
10558
- (0, import_react38.useEffect)(() => {
10555
+ (0, import_react40.useEffect)(() => {
10559
10556
  if (open && activeTabKey) {
10560
10557
  initializeServerConfig(activeTabKey);
10561
10558
  const connection = connections.find((c) => c.id === activeTabKey);
@@ -10564,7 +10561,7 @@ var SettingsModal = ({
10564
10561
  }
10565
10562
  }
10566
10563
  }, [open, activeTabKey]);
10567
- (0, import_react38.useEffect)(() => {
10564
+ (0, import_react40.useEffect)(() => {
10568
10565
  if (open && activeTabKey) {
10569
10566
  const connection = connections.find((c) => c.id === activeTabKey);
10570
10567
  if (connection?.connected) {
@@ -10578,7 +10575,7 @@ var SettingsModal = ({
10578
10575
  }, [open, activeTabKey, activeMenu]);
10579
10576
  const handleAddServer = async () => {
10580
10577
  if (!newServerUrl.trim()) {
10581
- import_antd35.message.error("Please enter a server URL");
10578
+ import_antd36.message.error("Please enter a server URL");
10582
10579
  return;
10583
10580
  }
10584
10581
  let normalizedUrl = newServerUrl.trim();
@@ -10604,7 +10601,7 @@ var SettingsModal = ({
10604
10601
  setNewServerUrl("");
10605
10602
  setNewServerName("");
10606
10603
  setNewServerApiKey("");
10607
- import_antd35.message.success("Server added successfully");
10604
+ import_antd36.message.success("Server added successfully");
10608
10605
  };
10609
10606
  const handleDeleteServer = (serverId) => {
10610
10607
  const newConnections = connections.filter((c) => c.id !== serverId);
@@ -10621,7 +10618,7 @@ var SettingsModal = ({
10621
10618
  setActiveTabKey("");
10622
10619
  }
10623
10620
  }
10624
- import_antd35.message.success("Server deleted");
10621
+ import_antd36.message.success("Server deleted");
10625
10622
  };
10626
10623
  const handleTabChange = (newTabKey) => {
10627
10624
  setConnections(
@@ -10635,12 +10632,12 @@ var SettingsModal = ({
10635
10632
  const handleSave = async () => {
10636
10633
  const connection = connections.find((c) => c.id === activeTabKey);
10637
10634
  if (!connection || !connection.connected) {
10638
- import_antd35.message.error("Please connect to a server first");
10635
+ import_antd36.message.error("Please connect to a server first");
10639
10636
  return;
10640
10637
  }
10641
10638
  const url = connection.url;
10642
10639
  if (!url) {
10643
- import_antd35.message.error("Please connect to a server first");
10640
+ import_antd36.message.error("Please connect to a server first");
10644
10641
  return;
10645
10642
  }
10646
10643
  try {
@@ -10704,23 +10701,23 @@ var SettingsModal = ({
10704
10701
  const data = await response.json();
10705
10702
  if (response.ok && data.success) {
10706
10703
  if (data.requiresRestart && data.requiresRestart.length > 0) {
10707
- import_antd35.message.warning(
10704
+ import_antd36.message.warning(
10708
10705
  `Configuration saved. Please restart the server for ${data.requiresRestart.join(
10709
10706
  ", "
10710
10707
  )} to take effect.`,
10711
10708
  5
10712
10709
  );
10713
10710
  } else {
10714
- import_antd35.message.success("Configuration saved and applied successfully");
10711
+ import_antd36.message.success("Configuration saved and applied successfully");
10715
10712
  }
10716
10713
  if (data.warnings && data.warnings.length > 0) {
10717
10714
  data.warnings.forEach((warning) => {
10718
- import_antd35.message.warning(warning, 5);
10715
+ import_antd36.message.warning(warning, 5);
10719
10716
  });
10720
10717
  }
10721
10718
  onClose();
10722
10719
  } else {
10723
- import_antd35.message.error(data.error || "Failed to save configuration");
10720
+ import_antd36.message.error(data.error || "Failed to save configuration");
10724
10721
  }
10725
10722
  } else if (activeMenu === "models") {
10726
10723
  const validModels = config.models.filter(
@@ -10739,17 +10736,17 @@ var SettingsModal = ({
10739
10736
  });
10740
10737
  const data = await response.json();
10741
10738
  if (response.ok && data.success) {
10742
- import_antd35.message.success(
10739
+ import_antd36.message.success(
10743
10740
  "Model configuration saved and registered successfully"
10744
10741
  );
10745
10742
  onClose();
10746
10743
  } else {
10747
- import_antd35.message.error(data.error || "Failed to save model configuration");
10744
+ import_antd36.message.error(data.error || "Failed to save model configuration");
10748
10745
  }
10749
10746
  }
10750
10747
  } catch (error) {
10751
10748
  console.error("Failed to save configuration:", error);
10752
- import_antd35.message.error(error.message || "Failed to save configuration");
10749
+ import_antd36.message.error(error.message || "Failed to save configuration");
10753
10750
  } finally {
10754
10751
  setLoading(false);
10755
10752
  }
@@ -10765,25 +10762,25 @@ var SettingsModal = ({
10765
10762
  }
10766
10763
  }));
10767
10764
  };
10768
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: styles.formContainer, children: [
10769
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
10770
- import_antd35.Alert,
10765
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: styles.formContainer, children: [
10766
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
10767
+ import_antd36.Alert,
10771
10768
  {
10772
10769
  message: "Configuration Effect",
10773
- description: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
10774
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { style: { marginBottom: 8 }, children: [
10775
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
10776
- import_icons22.CheckCircleOutlined,
10770
+ description: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { children: [
10771
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { style: { marginBottom: 8 }, children: [
10772
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
10773
+ import_icons24.CheckCircleOutlined,
10777
10774
  {
10778
10775
  style: { color: "#52c41a", marginRight: 8 }
10779
10776
  }
10780
10777
  ),
10781
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("strong", { children: "Immediately effective:" }),
10778
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("strong", { children: "Immediately effective:" }),
10782
10779
  " QUEUE_SERVICE_TYPE, REDIS_URL, REDIS_PASSWORD, QUEUE_NAME"
10783
10780
  ] }),
10784
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
10785
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_icons22.ReloadOutlined, { style: { color: "#faad14", marginRight: 8 } }),
10786
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("strong", { children: "Requires restart:" }),
10781
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { children: [
10782
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_icons24.ReloadOutlined, { style: { color: "#faad14", marginRight: 8 } }),
10783
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("strong", { children: "Requires restart:" }),
10787
10784
  " PORT (server must be restarted to change port)"
10788
10785
  ] })
10789
10786
  ] }),
@@ -10792,8 +10789,8 @@ var SettingsModal = ({
10792
10789
  className: styles.alertCard
10793
10790
  }
10794
10791
  ),
10795
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { style: { marginBottom: 24 }, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Text16, { 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." }) }),
10796
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
10792
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { style: { marginBottom: 24 }, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(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." }) }),
10793
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
10797
10794
  TextArea3,
10798
10795
  {
10799
10796
  value: config.envText,
@@ -10870,10 +10867,10 @@ QUEUE_NAME=tasks`,
10870
10867
  }));
10871
10868
  }
10872
10869
  };
10873
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: styles.formContainer, children: [
10874
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { style: { marginBottom: 32 }, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Text16, { 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." }) }),
10875
- config.models.map((model, index) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: styles.card, children: [
10876
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
10870
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: styles.formContainer, children: [
10871
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { style: { marginBottom: 32 }, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(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." }) }),
10872
+ config.models.map((model, index) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: styles.card, children: [
10873
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
10877
10874
  "div",
10878
10875
  {
10879
10876
  style: {
@@ -10885,13 +10882,13 @@ QUEUE_NAME=tasks`,
10885
10882
  borderBottom: "1px solid rgba(0, 0, 0, 0.06)"
10886
10883
  },
10887
10884
  children: [
10888
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
10889
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Text16, { strong: true, style: { fontSize: 16 }, children: [
10885
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { children: [
10886
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Text17, { strong: true, style: { fontSize: 16 }, children: [
10890
10887
  "Model ",
10891
10888
  index + 1
10892
10889
  ] }),
10893
- model.key && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
10894
- Text16,
10890
+ model.key && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
10891
+ Text17,
10895
10892
  {
10896
10893
  type: "secondary",
10897
10894
  style: { marginLeft: 8, fontSize: 12 },
@@ -10903,8 +10900,8 @@ QUEUE_NAME=tasks`,
10903
10900
  }
10904
10901
  )
10905
10902
  ] }),
10906
- config.models.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
10907
- import_antd35.Button,
10903
+ config.models.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
10904
+ import_antd36.Button,
10908
10905
  {
10909
10906
  type: "text",
10910
10907
  danger: true,
@@ -10920,11 +10917,11 @@ QUEUE_NAME=tasks`,
10920
10917
  ]
10921
10918
  }
10922
10919
  ),
10923
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_antd35.Space, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
10924
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
10925
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Text16, { className: styles.formLabel, children: "Key *" }),
10926
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
10927
- import_antd35.Input,
10920
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_antd36.Space, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
10921
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { children: [
10922
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text17, { className: styles.formLabel, children: "Key *" }),
10923
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
10924
+ import_antd36.Input,
10928
10925
  {
10929
10926
  placeholder: "e.g., default, gpt-4, claude",
10930
10927
  value: model.key,
@@ -10932,12 +10929,12 @@ QUEUE_NAME=tasks`,
10932
10929
  style: { height: 40 }
10933
10930
  }
10934
10931
  ),
10935
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Text16, { className: styles.formDescription, children: "Unique identifier for this model" })
10932
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text17, { className: styles.formDescription, children: "Unique identifier for this model" })
10936
10933
  ] }),
10937
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
10938
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Text16, { className: styles.formLabel, children: "Provider *" }),
10939
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
10940
- import_antd35.Select,
10934
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { children: [
10935
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text17, { className: styles.formLabel, children: "Provider *" }),
10936
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
10937
+ import_antd36.Select,
10941
10938
  {
10942
10939
  style: { width: "100%", height: 40 },
10943
10940
  value: model.provider,
@@ -10952,10 +10949,10 @@ QUEUE_NAME=tasks`,
10952
10949
  }
10953
10950
  )
10954
10951
  ] }),
10955
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
10956
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Text16, { className: styles.formLabel, children: "Model Name *" }),
10957
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
10958
- import_antd35.Input,
10952
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { children: [
10953
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text17, { className: styles.formLabel, children: "Model Name *" }),
10954
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
10955
+ import_antd36.Input,
10959
10956
  {
10960
10957
  placeholder: "e.g., gpt-4, claude-3-opus, kimi-k2-250905",
10961
10958
  value: model.model,
@@ -10964,10 +10961,10 @@ QUEUE_NAME=tasks`,
10964
10961
  }
10965
10962
  )
10966
10963
  ] }),
10967
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
10968
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Text16, { className: styles.formLabel, children: "API Key" }),
10969
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
10970
- import_antd35.Input.Password,
10964
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { children: [
10965
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text17, { className: styles.formLabel, children: "API Key" }),
10966
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
10967
+ import_antd36.Input.Password,
10971
10968
  {
10972
10969
  placeholder: "Enter your API key",
10973
10970
  value: model.apiKey,
@@ -10975,12 +10972,12 @@ QUEUE_NAME=tasks`,
10975
10972
  style: { height: 40 }
10976
10973
  }
10977
10974
  ),
10978
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Text16, { className: styles.formDescription, children: "API key for the model provider. Leave empty to use environment variable." })
10975
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text17, { className: styles.formDescription, children: "API key for the model provider. Leave empty to use environment variable." })
10979
10976
  ] }),
10980
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
10981
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Text16, { className: styles.formLabel, children: "Base URL" }),
10982
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
10983
- import_antd35.Input,
10977
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { children: [
10978
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text17, { className: styles.formLabel, children: "Base URL" }),
10979
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
10980
+ import_antd36.Input,
10984
10981
  {
10985
10982
  placeholder: "e.g., https://api.openai.com/v1",
10986
10983
  value: model.baseURL,
@@ -10988,23 +10985,23 @@ QUEUE_NAME=tasks`,
10988
10985
  style: { height: 40 }
10989
10986
  }
10990
10987
  ),
10991
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Text16, { className: styles.formDescription, children: "Optional custom base URL for the API" })
10988
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text17, { className: styles.formDescription, children: "Optional custom base URL for the API" })
10992
10989
  ] }),
10993
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_antd35.Space, { children: [
10994
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
10995
- import_antd35.Switch,
10990
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_antd36.Space, { children: [
10991
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
10992
+ import_antd36.Switch,
10996
10993
  {
10997
10994
  checked: model.streaming,
10998
10995
  onChange: (checked) => handleModelChange(index, "streaming", checked)
10999
10996
  }
11000
10997
  ),
11001
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Text16, { children: "Enable Streaming" })
10998
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text17, { children: "Enable Streaming" })
11002
10999
  ] }) }),
11003
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { style: { display: "flex", gap: 20 }, children: [
11004
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { style: { flex: 1 }, children: [
11005
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Text16, { className: styles.formLabel, children: "Max Tokens" }),
11006
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
11007
- import_antd35.Input,
11000
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { style: { display: "flex", gap: 20 }, children: [
11001
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { style: { flex: 1 }, children: [
11002
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text17, { className: styles.formLabel, children: "Max Tokens" }),
11003
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
11004
+ import_antd36.Input,
11008
11005
  {
11009
11006
  type: "number",
11010
11007
  placeholder: "e.g., 4096",
@@ -11018,10 +11015,10 @@ QUEUE_NAME=tasks`,
11018
11015
  }
11019
11016
  )
11020
11017
  ] }),
11021
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { style: { flex: 1 }, children: [
11022
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Text16, { className: styles.formLabel, children: "Temperature" }),
11023
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
11024
- import_antd35.Input,
11018
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { style: { flex: 1 }, children: [
11019
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text17, { className: styles.formLabel, children: "Temperature" }),
11020
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
11021
+ import_antd36.Input,
11025
11022
  {
11026
11023
  type: "number",
11027
11024
  step: "0.1",
@@ -11039,8 +11036,8 @@ QUEUE_NAME=tasks`,
11039
11036
  ] })
11040
11037
  ] })
11041
11038
  ] }, index)),
11042
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
11043
- import_antd35.Button,
11039
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
11040
+ import_antd36.Button,
11044
11041
  {
11045
11042
  type: "dashed",
11046
11043
  onClick: handleAddModel,
@@ -11067,9 +11064,9 @@ QUEUE_NAME=tasks`,
11067
11064
  );
11068
11065
  const currentConnection = connections.find((c) => c.id === activeTabKey);
11069
11066
  const renderTabLabel = (connection) => {
11070
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { style: { display: "flex", alignItems: "center" }, children: [
11071
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
11072
- import_icons22.CloudServerOutlined,
11067
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { style: { display: "flex", alignItems: "center" }, children: [
11068
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
11069
+ import_icons24.CloudServerOutlined,
11073
11070
  {
11074
11071
  style: {
11075
11072
  marginRight: 8,
@@ -11077,15 +11074,15 @@ QUEUE_NAME=tasks`,
11077
11074
  }
11078
11075
  }
11079
11076
  ),
11080
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { children: connection.name }),
11081
- connection.connected && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
11082
- import_icons22.CheckCircleFilled,
11077
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { children: connection.name }),
11078
+ connection.connected && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
11079
+ import_icons24.CheckCircleFilled,
11083
11080
  {
11084
11081
  style: { color: "#52c41a", fontSize: 12, marginLeft: 8 }
11085
11082
  }
11086
11083
  ),
11087
- connection.error && !connection.connecting && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
11088
- import_icons22.CloseCircleFilled,
11084
+ connection.error && !connection.connecting && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
11085
+ import_icons24.CloseCircleFilled,
11089
11086
  {
11090
11087
  style: { color: "#ff4d4f", fontSize: 12, marginLeft: 8 }
11091
11088
  }
@@ -11095,35 +11092,35 @@ QUEUE_NAME=tasks`,
11095
11092
  const tabItems = connections.map((connection) => ({
11096
11093
  key: connection.id,
11097
11094
  label: renderTabLabel(connection),
11098
- children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: styles.tabContent, children: connection.connected ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { style: { display: "flex", height: "100%" }, children: [
11099
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: styles.sidebar, children: SETTINGS_MENU_ITEMS.map((item) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
11095
+ children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: styles.tabContent, children: connection.connected ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_jsx_runtime52.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { style: { display: "flex", height: "100%" }, children: [
11096
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: styles.sidebar, children: SETTINGS_MENU_ITEMS.map((item) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
11100
11097
  "div",
11101
11098
  {
11102
11099
  className: `${styles.menuItem} ${activeMenu === item.key ? "active" : ""}`,
11103
11100
  onClick: () => setActiveMenu(item.key),
11104
11101
  children: [
11105
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: styles.menuItemIcon, children: item.icon }),
11106
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: styles.menuItemText, children: item.label })
11102
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: styles.menuItemIcon, children: item.icon }),
11103
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: styles.menuItemText, children: item.label })
11107
11104
  ]
11108
11105
  },
11109
11106
  item.key
11110
11107
  )) }),
11111
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: styles.content, children: [
11112
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: styles.contentHeader, children: [
11113
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: styles.contentHeaderLeft, children: [
11114
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Title3, { level: 3, className: styles.contentTitle, children: activeMenuItem?.label }),
11115
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Text16, { className: styles.contentDescription, children: [
11108
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: styles.content, children: [
11109
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: styles.contentHeader, children: [
11110
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: styles.contentHeaderLeft, children: [
11111
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Title3, { level: 3, className: styles.contentTitle, children: activeMenuItem?.label }),
11112
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Text17, { className: styles.contentDescription, children: [
11116
11113
  activeMenu === "environment" && "Manage environment variables for the gateway server",
11117
11114
  activeMenu === "models" && "Configure and register model lattices for use by agents"
11118
11115
  ] })
11119
11116
  ] }),
11120
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: styles.contentHeaderRight, children: [
11121
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_antd35.Button, { onClick: onClose, children: "Cancel" }),
11122
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
11123
- import_antd35.Button,
11117
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: styles.contentHeaderRight, children: [
11118
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_antd36.Button, { onClick: onClose, children: "Cancel" }),
11119
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
11120
+ import_antd36.Button,
11124
11121
  {
11125
11122
  type: "primary",
11126
- icon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_icons22.SaveOutlined, {}),
11123
+ icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_icons24.SaveOutlined, {}),
11127
11124
  onClick: handleSave,
11128
11125
  loading,
11129
11126
  children: "Save Configuration"
@@ -11131,9 +11128,9 @@ QUEUE_NAME=tasks`,
11131
11128
  )
11132
11129
  ] })
11133
11130
  ] }),
11134
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: styles.contentBody, children: renderContent(connection.id) })
11131
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: styles.contentBody, children: renderContent(connection.id) })
11135
11132
  ] })
11136
- ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
11133
+ ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
11137
11134
  "div",
11138
11135
  {
11139
11136
  style: {
@@ -11145,29 +11142,29 @@ QUEUE_NAME=tasks`,
11145
11142
  gap: 16,
11146
11143
  padding: 48
11147
11144
  },
11148
- children: connection.connecting ? /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
11149
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_icons22.LinkOutlined, { style: { fontSize: 64, color: "#1890ff" }, spin: true }),
11150
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Title3, { level: 4, children: "Connecting..." }),
11151
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Text16, { type: "secondary", style: { textAlign: "center" }, children: [
11145
+ children: connection.connecting ? /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
11146
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_icons24.LinkOutlined, { style: { fontSize: 64, color: "#1890ff" }, spin: true }),
11147
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Title3, { level: 4, children: "Connecting..." }),
11148
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Text17, { type: "secondary", style: { textAlign: "center" }, children: [
11152
11149
  "Connecting to ",
11153
11150
  connection.url
11154
11151
  ] })
11155
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
11156
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_icons22.LinkOutlined, { style: { fontSize: 64, color: "#d9d9d9" } }),
11157
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Title3, { level: 4, type: "secondary", children: connection.error || "Not Connected" }),
11158
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
11159
- Text16,
11152
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
11153
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_icons24.LinkOutlined, { style: { fontSize: 64, color: "#d9d9d9" } }),
11154
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Title3, { level: 4, type: "secondary", children: connection.error || "Not Connected" }),
11155
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
11156
+ Text17,
11160
11157
  {
11161
11158
  type: "secondary",
11162
11159
  style: { textAlign: "center", maxWidth: 400 },
11163
11160
  children: connection.error ? `Failed to connect to ${connection.url}. Please check the server URL and try again.` : `Click "Reconnect" to connect to ${connection.url}`
11164
11161
  }
11165
11162
  ),
11166
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
11167
- import_antd35.Button,
11163
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
11164
+ import_antd36.Button,
11168
11165
  {
11169
11166
  type: "primary",
11170
- icon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_icons22.LinkOutlined, {}),
11167
+ icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_icons24.LinkOutlined, {}),
11171
11168
  onClick: () => checkConnection(connection.id),
11172
11169
  loading: connection.connecting,
11173
11170
  style: { marginTop: 16 },
@@ -11179,9 +11176,9 @@ QUEUE_NAME=tasks`,
11179
11176
  ) }),
11180
11177
  closable: connections.length > 1
11181
11178
  }));
11182
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
11183
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
11184
- import_antd35.Modal,
11179
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
11180
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
11181
+ import_antd36.Modal,
11185
11182
  {
11186
11183
  open,
11187
11184
  onCancel: onClose,
@@ -11189,8 +11186,8 @@ QUEUE_NAME=tasks`,
11189
11186
  width: "80%",
11190
11187
  footer: null,
11191
11188
  title: "Settings",
11192
- children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
11193
- import_antd35.Tabs,
11189
+ children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
11190
+ import_antd36.Tabs,
11194
11191
  {
11195
11192
  activeKey: activeTabKey,
11196
11193
  onChange: handleTabChange,
@@ -11203,7 +11200,7 @@ QUEUE_NAME=tasks`,
11203
11200
  }
11204
11201
  },
11205
11202
  items: tabItems,
11206
- addIcon: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
11203
+ addIcon: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
11207
11204
  "div",
11208
11205
  {
11209
11206
  style: {
@@ -11213,8 +11210,8 @@ QUEUE_NAME=tasks`,
11213
11210
  padding: "4px 8px"
11214
11211
  },
11215
11212
  children: [
11216
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_icons22.PlusOutlined, {}),
11217
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { children: "Add Server" })
11213
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_icons24.PlusOutlined, {}),
11214
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { children: "Add Server" })
11218
11215
  ]
11219
11216
  }
11220
11217
  )
@@ -11222,8 +11219,8 @@ QUEUE_NAME=tasks`,
11222
11219
  ) })
11223
11220
  }
11224
11221
  ),
11225
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
11226
- import_antd35.Modal,
11222
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
11223
+ import_antd36.Modal,
11227
11224
  {
11228
11225
  title: "Add New Server",
11229
11226
  open: showAddServerModal,
@@ -11236,11 +11233,11 @@ QUEUE_NAME=tasks`,
11236
11233
  },
11237
11234
  confirmLoading: addingServer,
11238
11235
  className: styles.addServerModal,
11239
- children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_antd35.Space, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
11240
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
11241
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Text16, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server Name" }),
11242
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
11243
- import_antd35.Input,
11236
+ children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_antd36.Space, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
11237
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { children: [
11238
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text17, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server Name" }),
11239
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
11240
+ import_antd36.Input,
11244
11241
  {
11245
11242
  placeholder: "e.g., Production Server",
11246
11243
  value: newServerName,
@@ -11248,12 +11245,12 @@ QUEUE_NAME=tasks`,
11248
11245
  onPressEnter: handleAddServer
11249
11246
  }
11250
11247
  ),
11251
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Text16, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: Leave empty to use URL as name" })
11248
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text17, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: Leave empty to use URL as name" })
11252
11249
  ] }),
11253
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
11254
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Text16, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server URL *" }),
11255
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
11256
- import_antd35.Input,
11250
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { children: [
11251
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text17, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server URL *" }),
11252
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
11253
+ import_antd36.Input,
11257
11254
  {
11258
11255
  placeholder: "e.g., http://localhost:4001",
11259
11256
  value: newServerUrl,
@@ -11261,12 +11258,12 @@ QUEUE_NAME=tasks`,
11261
11258
  onPressEnter: handleAddServer
11262
11259
  }
11263
11260
  ),
11264
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Text16, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Enter the full URL of the gateway server" })
11261
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text17, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Enter the full URL of the gateway server" })
11265
11262
  ] }),
11266
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
11267
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Text16, { strong: true, style: { display: "block", marginBottom: 8 }, children: "API Key" }),
11268
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
11269
- import_antd35.Input.Password,
11263
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { children: [
11264
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text17, { strong: true, style: { display: "block", marginBottom: 8 }, children: "API Key" }),
11265
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
11266
+ import_antd36.Input.Password,
11270
11267
  {
11271
11268
  placeholder: "Optional: Enter API key for authentication",
11272
11269
  value: newServerApiKey,
@@ -11274,7 +11271,7 @@ QUEUE_NAME=tasks`,
11274
11271
  onPressEnter: handleAddServer
11275
11272
  }
11276
11273
  ),
11277
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Text16, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: API key for server authentication" })
11274
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text17, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: API key for server authentication" })
11278
11275
  ] })
11279
11276
  ] })
11280
11277
  }
@@ -11283,10 +11280,10 @@ QUEUE_NAME=tasks`,
11283
11280
  };
11284
11281
 
11285
11282
  // src/components/Chat/AgentServerSetting.tsx
11286
- var import_jsx_runtime52 = require("react/jsx-runtime");
11283
+ var import_jsx_runtime53 = require("react/jsx-runtime");
11287
11284
  var AgentServerSetting = () => {
11288
11285
  const { settingsModalOpen, setSettingsModalOpen } = useLatticeChatShellContext();
11289
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
11286
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
11290
11287
  SettingsModal,
11291
11288
  {
11292
11289
  open: settingsModalOpen,
@@ -11296,11 +11293,12 @@ var AgentServerSetting = () => {
11296
11293
  };
11297
11294
 
11298
11295
  // src/components/Chat/LatticeChatShell.tsx
11299
- var import_jsx_runtime53 = require("react/jsx-runtime");
11296
+ var import_jsx_runtime54 = require("react/jsx-runtime");
11300
11297
  var LatticeChatShell = (props) => {
11301
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(LatticeChatShellContextProvider, { ...props, children: [
11302
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(AssistantContextProvider, { autoLoad: true, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ConversationContextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(LatticeChatView, {}) }) }),
11303
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(AgentServerSetting, {})
11298
+ const { initialConfig } = props;
11299
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(LatticeChatShellContextProvider, { ...props, children: [
11300
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(AssistantContextProvider, { autoLoad: true, initialAssistantId: initialConfig?.assistantId, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ConversationContextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(LatticeChatView, {}) }) }),
11301
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(AgentServerSetting, {})
11304
11302
  ] });
11305
11303
  };
11306
11304
  // Annotate the CommonJS export names for ESM import in node: