@axiom-lattice/react-sdk 2.1.61 → 2.1.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -86,8 +86,8 @@ var AuthProvider = ({
86
86
  onLoginSuccess?.(userData, tenantList || []);
87
87
  return { requiresTenantSelection, hasTenants };
88
88
  } catch (err) {
89
- const message20 = err instanceof Error ? err.message : "Login failed";
90
- setError(message20);
89
+ const message21 = err instanceof Error ? err.message : "Login failed";
90
+ setError(message21);
91
91
  throw err;
92
92
  } finally {
93
93
  setIsLoading(false);
@@ -111,8 +111,8 @@ var AuthProvider = ({
111
111
  }
112
112
  return { message: data.message || "Registration successful!", token: data.data?.token };
113
113
  } catch (err) {
114
- const message20 = err instanceof Error ? err.message : "Registration failed";
115
- setError(message20);
114
+ const message21 = err instanceof Error ? err.message : "Registration failed";
115
+ setError(message21);
116
116
  throw err;
117
117
  } finally {
118
118
  setIsLoading(false);
@@ -159,8 +159,8 @@ var AuthProvider = ({
159
159
  }
160
160
  onTenantSelected?.(tenantData);
161
161
  } catch (err) {
162
- const message20 = err instanceof Error ? err.message : "Failed to select tenant";
163
- setError(message20);
162
+ const message21 = err instanceof Error ? err.message : "Failed to select tenant";
163
+ setError(message21);
164
164
  throw err;
165
165
  } finally {
166
166
  setIsLoading(false);
@@ -199,8 +199,8 @@ var AuthProvider = ({
199
199
  setTenants(tenantList);
200
200
  sessionStorage.setItem("lattice_tenants", JSON.stringify(tenantList));
201
201
  } catch (err) {
202
- const message20 = err instanceof Error ? err.message : "Failed to fetch tenants";
203
- setError(message20);
202
+ const message21 = err instanceof Error ? err.message : "Failed to fetch tenants";
203
+ setError(message21);
204
204
  } finally {
205
205
  setIsLoading(false);
206
206
  }
@@ -230,8 +230,8 @@ var AuthProvider = ({
230
230
  setUser(data);
231
231
  sessionStorage.setItem("lattice_user", JSON.stringify(data));
232
232
  } catch (err) {
233
- const message20 = err instanceof Error ? err.message : "Failed to refresh user";
234
- setError(message20);
233
+ const message21 = err instanceof Error ? err.message : "Failed to refresh user";
234
+ setError(message21);
235
235
  } finally {
236
236
  setIsLoading(false);
237
237
  }
@@ -267,8 +267,8 @@ var AuthProvider = ({
267
267
  const result = await response.json();
268
268
  return result;
269
269
  } catch (err) {
270
- const message20 = err instanceof Error ? err.message : "Failed to change password";
271
- setError(message20);
270
+ const message21 = err instanceof Error ? err.message : "Failed to change password";
271
+ setError(message21);
272
272
  throw err;
273
273
  } finally {
274
274
  setIsLoading(false);
@@ -466,7 +466,7 @@ function useChat(threadId, assistantId, options = {}) {
466
466
  throw new Error("Thread ID is required to send messages");
467
467
  }
468
468
  const { input, command, streaming = true } = data;
469
- const { message: message20, files, ...rest } = input || {};
469
+ const { message: message21, files, ...rest } = input || {};
470
470
  setState((prev) => ({
471
471
  ...prev,
472
472
  isLoading: true,
@@ -475,7 +475,7 @@ function useChat(threadId, assistantId, options = {}) {
475
475
  }));
476
476
  const userMessage = {
477
477
  id: Date.now().toString(),
478
- content: message20 || command?.resume?.message || "",
478
+ content: message21 || command?.resume?.message || "",
479
479
  files,
480
480
  role: "human"
481
481
  };
@@ -1276,6 +1276,36 @@ var DEFAULT_MIDDLEWARE_TYPES = [
1276
1276
  timezone: "UTC"
1277
1277
  },
1278
1278
  tools: []
1279
+ },
1280
+ {
1281
+ type: "scheduler",
1282
+ name: "Scheduler",
1283
+ description: "Enables the agent to schedule future work that re-enters through addMessage",
1284
+ schema: {
1285
+ type: "object",
1286
+ title: "Scheduler Configuration",
1287
+ description: "Configure retry behavior for scheduled tasks",
1288
+ properties: {
1289
+ defaultMaxRetries: {
1290
+ type: "integer",
1291
+ title: "Default Max Retries",
1292
+ description: "Default retry count for scheduled tasks created through the middleware",
1293
+ default: 0,
1294
+ minimum: 0,
1295
+ widget: "numberInput"
1296
+ }
1297
+ }
1298
+ },
1299
+ defaultConfig: {
1300
+ defaultMaxRetries: 0
1301
+ },
1302
+ tools: [
1303
+ { id: "schedule_at", name: "Schedule At", description: "Schedule a task for an absolute time" },
1304
+ { id: "schedule_after", name: "Schedule After", description: "Schedule a task after a relative delay" },
1305
+ { id: "schedule_recurring", name: "Schedule Recurring", description: "Schedule a recurring task with a cron expression" },
1306
+ { id: "cancel_scheduled_task", name: "Cancel Scheduled Task", description: "Cancel an existing scheduled task" },
1307
+ { id: "list_scheduled_tasks", name: "List Scheduled Tasks", description: "List scheduled tasks in the current agent context" }
1308
+ ]
1279
1309
  }
1280
1310
  ];
1281
1311
  var DEFAULT_CONFIG = {
@@ -1439,8 +1469,8 @@ function convertThreadToConversationThread(thread, label) {
1439
1469
  function getThreadMetadata(label) {
1440
1470
  return label ? { label } : {};
1441
1471
  }
1442
- function generateLabelFromMessage(message20) {
1443
- const cleanMessage = message20.replace(/```attachments[\s\S]*?```/g, "").trim();
1472
+ function generateLabelFromMessage(message21) {
1473
+ const cleanMessage = message21.replace(/```attachments[\s\S]*?```/g, "").trim();
1444
1474
  if (!cleanMessage) {
1445
1475
  return "";
1446
1476
  }
@@ -1632,8 +1662,13 @@ var ConversationContextProvider = ({
1632
1662
  setIsLoading(true);
1633
1663
  setError(null);
1634
1664
  try {
1665
+ const existingThread = await client.threads.get(newThread.id);
1666
+ const existingMetadata = existingThread.metadata || {};
1635
1667
  await client.threads.update(newThread.id, {
1636
- metadata: getThreadMetadata(newThread.label)
1668
+ metadata: {
1669
+ ...existingMetadata,
1670
+ label: newThread.label
1671
+ }
1637
1672
  });
1638
1673
  await loadThreads();
1639
1674
  } catch (err) {
@@ -1883,7 +1918,7 @@ function AgentThreadProvider({
1883
1918
  throw new Error("Thread ID is required to send messages");
1884
1919
  }
1885
1920
  const { input, command, streaming = true, mode } = data;
1886
- const { message: message20, files, ...rest } = input || {};
1921
+ const { message: message21, files, ...rest } = input || {};
1887
1922
  setState((prev) => ({
1888
1923
  ...prev,
1889
1924
  isLoading: true,
@@ -1892,7 +1927,7 @@ function AgentThreadProvider({
1892
1927
  }));
1893
1928
  const userMessage = {
1894
1929
  id: uuidv4(),
1895
- content: message20 || command?.resume?.message || "",
1930
+ content: message21 || command?.resume?.message || "",
1896
1931
  files,
1897
1932
  role: "human"
1898
1933
  };
@@ -1910,8 +1945,8 @@ function AgentThreadProvider({
1910
1945
  ]
1911
1946
  }));
1912
1947
  const isFirstMessage = messageCountRef.current === 0;
1913
- if (isFirstMessage && message20 && conversationContext) {
1914
- const label = generateLabelFromMessage(message20);
1948
+ if (isFirstMessage && message21 && conversationContext) {
1949
+ const label = generateLabelFromMessage(message21);
1915
1950
  if (label) {
1916
1951
  conversationContext.updateThread({
1917
1952
  id: threadId,
@@ -3586,8 +3621,8 @@ function useTenants(options) {
3586
3621
  const { data } = await response.json();
3587
3622
  setTenants(data || []);
3588
3623
  } catch (err) {
3589
- const message20 = err instanceof Error ? err.message : "Failed to fetch tenants";
3590
- setError(message20);
3624
+ const message21 = err instanceof Error ? err.message : "Failed to fetch tenants";
3625
+ setError(message21);
3591
3626
  } finally {
3592
3627
  setIsLoading(false);
3593
3628
  }
@@ -3629,8 +3664,8 @@ function useUsers(options) {
3629
3664
  const { data } = await response.json();
3630
3665
  setUsers(data || []);
3631
3666
  } catch (err) {
3632
- const message20 = err instanceof Error ? err.message : "Failed to fetch users";
3633
- setError(message20);
3667
+ const message21 = err instanceof Error ? err.message : "Failed to fetch users";
3668
+ setError(message21);
3634
3669
  } finally {
3635
3670
  setIsLoading(false);
3636
3671
  }
@@ -3672,6 +3707,9 @@ function useUsers(options) {
3672
3707
  // src/index.ts
3673
3708
  export * from "@axiom-lattice/protocols";
3674
3709
 
3710
+ // src/components/Chat/LatticeChat.tsx
3711
+ import { FolderOpen as FolderOpen4 } from "lucide-react";
3712
+
3675
3713
  // src/components/Chat/ChatUIContext.tsx
3676
3714
  import { createContext as createContext7, useCallback as useCallback12, useContext as useContext7, useState as useState15 } from "react";
3677
3715
  import { jsx as jsx11 } from "react/jsx-runtime";
@@ -3679,6 +3717,21 @@ var emptyHandler = () => {
3679
3717
  throw new Error("ChatUIContextProvider not found");
3680
3718
  };
3681
3719
  var ChatUIContext = createContext7({
3720
+ detailVisible: false,
3721
+ setDetailVisible: emptyHandler,
3722
+ detailSize: "large",
3723
+ setDetailSize: emptyHandler,
3724
+ detailSelectedCard: null,
3725
+ setDetailSelectedCard: emptyHandler,
3726
+ openDetail: emptyHandler,
3727
+ closeDetail: emptyHandler,
3728
+ toolsVisible: false,
3729
+ setToolsVisible: emptyHandler,
3730
+ toggleTools: emptyHandler,
3731
+ toolSelectedCard: null,
3732
+ setToolSelectedCard: emptyHandler,
3733
+ openTools: emptyHandler,
3734
+ closeTools: emptyHandler,
3682
3735
  sideAppVisible: false,
3683
3736
  setSideAppVisible: emptyHandler,
3684
3737
  sideAppSize: "large",
@@ -3699,44 +3752,72 @@ var ChatUIContext = createContext7({
3699
3752
  var ChatUIContextProvider = ({
3700
3753
  children
3701
3754
  }) => {
3702
- const [sideAppVisible, setSideAppVisible] = useState15(false);
3755
+ const [detailVisible, setDetailVisible] = useState15(false);
3703
3756
  const [contentAppVisible, setcontentAppVisible] = useState15(false);
3704
- const [sideAppSize, setSideAppSize] = useState15("large");
3705
- const [sideAppSelectedCard, setSideAppSelectedCard] = useState15(null);
3757
+ const [detailSize, setDetailSize] = useState15("large");
3758
+ const [detailSelectedCard, setDetailSelectedCard] = useState15(null);
3759
+ const [toolsVisible, setToolsVisible] = useState15(false);
3760
+ const [toolSelectedCard, setToolSelectedCard] = useState15(null);
3706
3761
  const [contentAppSelectedCard, setContentAppSelectedCard] = useState15(null);
3707
3762
  const [menuCollapsed, setMenuCollapsed] = useState15(false);
3708
- const openSideApp = useCallback12(
3709
- (card) => {
3710
- setSideAppSelectedCard(card);
3711
- setSideAppVisible(true);
3712
- },
3713
- [setSideAppSelectedCard, setSideAppVisible]
3714
- );
3715
- const openContentApp = useCallback12(
3716
- (card) => {
3717
- setContentAppSelectedCard(card);
3718
- setcontentAppVisible(true);
3719
- },
3720
- [setContentAppSelectedCard, setcontentAppVisible]
3721
- );
3763
+ const openDetail = useCallback12((card) => {
3764
+ setDetailSelectedCard(card);
3765
+ setDetailVisible(true);
3766
+ }, []);
3767
+ const closeDetail = useCallback12(() => {
3768
+ setDetailSelectedCard(null);
3769
+ setDetailVisible(false);
3770
+ }, []);
3771
+ const openTools = useCallback12((card) => {
3772
+ setToolSelectedCard(card);
3773
+ setToolsVisible(true);
3774
+ }, []);
3775
+ const closeTools = useCallback12(() => {
3776
+ setToolSelectedCard(null);
3777
+ setToolsVisible(false);
3778
+ }, []);
3779
+ const openSideApp = useCallback12((card) => {
3780
+ openDetail(card);
3781
+ }, [openDetail]);
3782
+ const openContentApp = useCallback12((card) => {
3783
+ setContentAppSelectedCard(card);
3784
+ setcontentAppVisible(true);
3785
+ }, []);
3722
3786
  const closeSideApp = useCallback12(() => {
3723
- setSideAppSelectedCard(null);
3724
- setSideAppVisible(false);
3725
- }, [setSideAppSelectedCard, setSideAppVisible]);
3787
+ closeDetail();
3788
+ }, [closeDetail]);
3726
3789
  const closeContentApp = useCallback12(() => {
3727
3790
  setContentAppSelectedCard(null);
3728
3791
  setcontentAppVisible(false);
3729
- }, [setContentAppSelectedCard, setcontentAppVisible]);
3792
+ }, []);
3793
+ const toggleTools = useCallback12(() => {
3794
+ setToolsVisible((prev) => !prev);
3795
+ }, []);
3730
3796
  return /* @__PURE__ */ jsx11(
3731
3797
  ChatUIContext.Provider,
3732
3798
  {
3733
3799
  value: {
3734
- sideAppVisible,
3735
- setSideAppVisible,
3736
- sideAppSize,
3737
- setSideAppSize,
3738
- sideAppSelectedCard,
3739
- setSideAppSelectedCard,
3800
+ detailVisible,
3801
+ setDetailVisible,
3802
+ detailSize,
3803
+ setDetailSize,
3804
+ detailSelectedCard,
3805
+ setDetailSelectedCard,
3806
+ openDetail,
3807
+ closeDetail,
3808
+ toolsVisible,
3809
+ setToolsVisible,
3810
+ toggleTools,
3811
+ toolSelectedCard,
3812
+ setToolSelectedCard,
3813
+ openTools,
3814
+ closeTools,
3815
+ sideAppVisible: detailVisible,
3816
+ setSideAppVisible: setDetailVisible,
3817
+ sideAppSize: detailSize,
3818
+ setSideAppSize: setDetailSize,
3819
+ sideAppSelectedCard: detailSelectedCard,
3820
+ setSideAppSelectedCard: setDetailSelectedCard,
3740
3821
  openSideApp,
3741
3822
  closeSideApp,
3742
3823
  openContentApp,
@@ -3756,6 +3837,9 @@ var useChatUIContext = () => {
3756
3837
  return useContext7(ChatUIContext);
3757
3838
  };
3758
3839
 
3840
+ // src/components/Chat/LatticeChat.tsx
3841
+ import { createStyles as createStyles34 } from "antd-style";
3842
+
3759
3843
  // src/components/Chat/useStyle.tsx
3760
3844
  import { createStyles as createStyles2 } from "antd-style";
3761
3845
  var useStyle = createStyles2(({ token, css }) => {
@@ -3954,6 +4038,23 @@ var useStyle = createStyles2(({ token, css }) => {
3954
4038
  top: 2px;
3955
4039
  }
3956
4040
  `,
4041
+ toolPanel: css`
4042
+ display: flex;
4043
+ flex-direction: column;
4044
+ width: 0;
4045
+ background: ${token.colorBgContainer};
4046
+ transition: all 0.3s ease;
4047
+ overflow: hidden;
4048
+ flex-shrink: 0;
4049
+ border-radius: ${token.borderRadiusLG}px;
4050
+ border: 1px solid transparent;
4051
+
4052
+ &.open {
4053
+ width: 320px;
4054
+ box-shadow: ${token.boxShadow};
4055
+ border-color: ${token.colorBorder};
4056
+ }
4057
+ `,
3957
4058
  detailContent: css`
3958
4059
  // padding: 8px 8px;
3959
4060
  height: 100%;
@@ -4519,41 +4620,46 @@ var useStyle = createStyles2(({ token, css }) => {
4519
4620
  });
4520
4621
 
4521
4622
  // src/components/Chat/ColumnLayout.tsx
4522
- import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
4623
+ import { jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
4523
4624
  var ColumnLayout = ({
4524
- left,
4525
- right,
4625
+ main,
4626
+ detail,
4627
+ tools,
4526
4628
  logo,
4527
4629
  menu,
4528
4630
  header
4529
4631
  }) => {
4530
4632
  const { styles } = useStyle();
4531
- const { sideAppVisible, sideAppSize, sideAppSelectedCard, contentAppSelectedCard, menuCollapsed } = useChatUIContext();
4633
+ const {
4634
+ detailVisible,
4635
+ detailSize,
4636
+ detailSelectedCard,
4637
+ toolsVisible,
4638
+ toolSelectedCard,
4639
+ contentAppSelectedCard,
4640
+ menuCollapsed
4641
+ } = useChatUIContext();
4642
+ const isMenuCollapsed = menuCollapsed || detailVisible;
4643
+ const menuStateClass = isMenuCollapsed ? "collapsed" : "expanded";
4644
+ const hasSidePanelsOpen = detailVisible || toolsVisible;
4645
+ const resolvedDetailSize = toolsVisible && (detailSize || "large") === "large" ? "middle" : detailSize || "large";
4532
4646
  return /* @__PURE__ */ jsxs5("div", { className: `fina_chat ${styles.layout}`, children: [
4533
- menu && /* @__PURE__ */ jsxs5(
4534
- "div",
4535
- {
4536
- className: `${styles.menu} ${"open"} ${sideAppVisible || menuCollapsed ? "collapsed" : "expanded"}`,
4537
- children: [
4538
- logo,
4539
- menu
4540
- ]
4541
- }
4542
- ),
4647
+ menu && /* @__PURE__ */ jsxs5("div", { className: `${styles.menu} ${menuStateClass}`, children: [
4648
+ logo,
4649
+ menu
4650
+ ] }),
4543
4651
  /* @__PURE__ */ jsxs5("div", { className: styles.contentArea, children: [
4544
4652
  header && /* @__PURE__ */ jsx12("div", { className: styles.header, children: header }),
4545
4653
  /* @__PURE__ */ jsxs5("div", { className: styles.columns, children: [
4546
- /* @__PURE__ */ jsx12("div", { className: `${styles.mainContent} ${sideAppVisible ? "open" : ""}`, children: /* @__PURE__ */ jsx12("div", { className: `${styles.chat} ${contentAppSelectedCard ? "full_content_width" : ""}`, children: left }) }),
4547
- /* @__PURE__ */ jsxs5(
4654
+ /* @__PURE__ */ jsx12("div", { className: `${styles.mainContent} ${hasSidePanelsOpen ? "open" : ""}`, children: /* @__PURE__ */ jsx12("div", { className: `${styles.chat} ${contentAppSelectedCard ? "full_content_width" : ""}`, children: main }) }),
4655
+ /* @__PURE__ */ jsx12(
4548
4656
  "div",
4549
4657
  {
4550
- className: `${styles.detailPanel} ${sideAppVisible ? `open ${sideAppSize || "large"}` : ""}`,
4551
- children: [
4552
- /* @__PURE__ */ jsx12(Fragment2, {}),
4553
- sideAppSelectedCard && sideAppVisible && /* @__PURE__ */ jsx12(Fragment2, { children: /* @__PURE__ */ jsx12("div", { className: styles.detailContent, children: right }) })
4554
- ]
4658
+ className: `${styles.detailPanel} ${detailVisible ? `open ${resolvedDetailSize}` : ""}`,
4659
+ children: detailVisible && detailSelectedCard && detail ? /* @__PURE__ */ jsx12("div", { className: styles.detailContent, children: detail }) : null
4555
4660
  }
4556
- )
4661
+ ),
4662
+ /* @__PURE__ */ jsx12("div", { className: `${styles.toolPanel} ${toolsVisible ? "open" : ""}`, children: toolsVisible && tools ? /* @__PURE__ */ jsx12("div", { className: styles.detailContent, children: tools }) : null })
4557
4663
  ] })
4558
4664
  ] })
4559
4665
  ] });
@@ -4572,7 +4678,7 @@ import { useState as useState21 } from "react";
4572
4678
 
4573
4679
  // src/components/GenUI/MDResponse.tsx
4574
4680
  import XMarkdown from "@ant-design/x-markdown";
4575
- import React12, { useRef as useRef10, useState as useState20, useMemo as useMemo7, useDeferredValue } from "react";
4681
+ import React13, { useRef as useRef10, useState as useState20, useMemo as useMemo7, useDeferredValue } from "react";
4576
4682
  import { createStyles as createStyles6 } from "antd-style";
4577
4683
 
4578
4684
  // src/components/GenUI/Code.tsx
@@ -4629,7 +4735,7 @@ import { DownloadOutlined, ExpandAltOutlined } from "@ant-design/icons";
4629
4735
  import { jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
4630
4736
  var { Text: Text3 } = Typography3;
4631
4737
  var GenericDataTable = ({ data, interactive = true, default_open_in_side_app = true }) => {
4632
- const { dataSource, message: message20 } = data ?? {};
4738
+ const { dataSource, message: message21 } = data ?? {};
4633
4739
  const [expandedRowKeys, setExpandedRowKeys] = useState16([]);
4634
4740
  const { openSideApp } = useChatUIContext();
4635
4741
  const processedData = dataSource?.map((item, index) => ({
@@ -4728,7 +4834,7 @@ var GenericDataTable = ({ data, interactive = true, default_open_in_side_app = t
4728
4834
  type: "text/csv;charset=utf-8;"
4729
4835
  });
4730
4836
  const link = document.createElement("a");
4731
- const filename = `${message20 || "data"}_${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.csv`;
4837
+ const filename = `${message21 || "data"}_${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.csv`;
4732
4838
  link.href = URL.createObjectURL(blob);
4733
4839
  link.download = filename;
4734
4840
  document.body.appendChild(link);
@@ -4749,7 +4855,7 @@ var GenericDataTable = ({ data, interactive = true, default_open_in_side_app = t
4749
4855
  tableLayout: "fixed",
4750
4856
  style: { width: "100% !important" },
4751
4857
  title: () => /* @__PURE__ */ jsxs6(Flex, { justify: "space-between", align: "center", children: [
4752
- /* @__PURE__ */ jsx14(Space2, { children: /* @__PURE__ */ jsx14(Text3, { strong: true, style: { fontSize: 16 }, children: message20 || "" }) }),
4858
+ /* @__PURE__ */ jsx14(Space2, { children: /* @__PURE__ */ jsx14(Text3, { strong: true, style: { fontSize: 16 }, children: message21 || "" }) }),
4753
4859
  /* @__PURE__ */ jsxs6(Space2, { children: [
4754
4860
  /* @__PURE__ */ jsx14(
4755
4861
  Button5,
@@ -4771,8 +4877,8 @@ var GenericDataTable = ({ data, interactive = true, default_open_in_side_app = t
4771
4877
  onClick: () => {
4772
4878
  openSideApp({
4773
4879
  component_key: "generic_data_table",
4774
- message: message20 || "",
4775
- data: { dataSource, message: message20 }
4880
+ message: message21 || "",
4881
+ data: { dataSource, message: message21 }
4776
4882
  });
4777
4883
  },
4778
4884
  children: /* @__PURE__ */ jsx14(ExpandAltOutlined, {})
@@ -5945,13 +6051,13 @@ var MDComponentWrap = (Element) => {
5945
6051
  // src/components/GenUI/elements/file_link.tsx
5946
6052
  import { Button as Button8 } from "antd";
5947
6053
  import { useMemo as useMemo5, useCallback as useCallback13 } from "react";
5948
- import { Fragment as Fragment3, jsx as jsx21 } from "react/jsx-runtime";
6054
+ import { Fragment as Fragment2, jsx as jsx21 } from "react/jsx-runtime";
5949
6055
  var FileLink = ({ data }) => {
5950
6056
  if (!data) {
5951
6057
  return null;
5952
6058
  }
5953
6059
  if (!isFileName(data)) {
5954
- return /* @__PURE__ */ jsx21(Fragment3, { children: data });
6060
+ return /* @__PURE__ */ jsx21(Fragment2, { children: data });
5955
6061
  }
5956
6062
  const { openSideApp } = useChatUIContext();
5957
6063
  const { threadId, assistantId } = useConversationContext();
@@ -6146,7 +6252,7 @@ var useStyles4 = createStyles6(({ token, css }) => ({
6146
6252
  }
6147
6253
  `
6148
6254
  }));
6149
- var MarkdownErrorBoundary = class extends React12.Component {
6255
+ var MarkdownErrorBoundary = class extends React13.Component {
6150
6256
  constructor(props) {
6151
6257
  super(props);
6152
6258
  this.state = { hasError: false };
@@ -6164,7 +6270,7 @@ var MarkdownErrorBoundary = class extends React12.Component {
6164
6270
  return this.props.children;
6165
6271
  }
6166
6272
  };
6167
- var SafeXMarkdown = React12.memo(({ content, components, className }) => {
6273
+ var SafeXMarkdown = React13.memo(({ content, components, className }) => {
6168
6274
  const deferredContent = useDeferredValue(content);
6169
6275
  if (typeof deferredContent !== "string") {
6170
6276
  console.warn("[MDResponse] Content is not a string:", typeof deferredContent, deferredContent);
@@ -6199,7 +6305,7 @@ var MDResponseInner = ({
6199
6305
  }
6200
6306
  ) });
6201
6307
  };
6202
- var MDResponse = React12.memo(MDResponseInner);
6308
+ var MDResponse = React13.memo(MDResponseInner);
6203
6309
  MDResponse.displayName = "MDResponse";
6204
6310
  var MDViewFormItem = ({ value }) => {
6205
6311
  return /* @__PURE__ */ jsx23(MDResponse, { content: value || "" });
@@ -6212,11 +6318,11 @@ var ConfirmFeedback = ({
6212
6318
  data,
6213
6319
  interactive = true
6214
6320
  }) => {
6215
- const { message: message20, type, config, feedback, options } = data ?? {};
6321
+ const { message: message21, type, config, feedback, options } = data ?? {};
6216
6322
  const { sendMessage } = useAgentChat();
6217
6323
  const [clicked, setClicked] = useState21(false);
6218
6324
  return /* @__PURE__ */ jsxs11(Space3, { direction: "vertical", style: { width: "100%" }, children: [
6219
- /* @__PURE__ */ jsx24(MDResponse, { content: message20 }),
6325
+ /* @__PURE__ */ jsx24(MDResponse, { content: message21 }),
6220
6326
  options ? /* @__PURE__ */ jsx24(Space3, { style: { justifyContent: "flex-end", width: "100%" }, children: options?.map((option) => /* @__PURE__ */ jsx24(
6221
6327
  Button9,
6222
6328
  {
@@ -6294,7 +6400,7 @@ var ConfirmFeedback = ({
6294
6400
  // src/components/GenUI/elements/clarify_feedback.tsx
6295
6401
  import { Button as Button10, Space as Space4, Typography as Typography5, List, Checkbox, Input as Input3 } from "antd";
6296
6402
  import { useState as useState22 } from "react";
6297
- import { Fragment as Fragment4, jsx as jsx25, jsxs as jsxs12 } from "react/jsx-runtime";
6403
+ import { Fragment as Fragment3, jsx as jsx25, jsxs as jsxs12 } from "react/jsx-runtime";
6298
6404
  var { Text: Text5 } = Typography5;
6299
6405
  var ClarifyFeedback = ({
6300
6406
  data,
@@ -6403,7 +6509,7 @@ var ClarifyFeedback = ({
6403
6509
  }
6404
6510
  )
6405
6511
  ] }),
6406
- /* @__PURE__ */ jsx25(Space4, { direction: "vertical", style: { width: "100%" }, size: 4, children: currentQuestion.type === "single" ? /* @__PURE__ */ jsxs12(Fragment4, { children: [
6512
+ /* @__PURE__ */ jsx25(Space4, { direction: "vertical", style: { width: "100%" }, size: 4, children: currentQuestion.type === "single" ? /* @__PURE__ */ jsxs12(Fragment3, { children: [
6407
6513
  /* @__PURE__ */ jsx25(
6408
6514
  List,
6409
6515
  {
@@ -7470,7 +7576,7 @@ var AttachmentsCard = ({
7470
7576
  const { config } = useLatticeChatShellContext();
7471
7577
  const baseURL = config.baseURL;
7472
7578
  const fileBaseURL = `${baseURL}/api/assistants/${assistantId}/threads/${threadId}/sandbox/downloadfile?path=`;
7473
- const { Text: Text38 } = Typography10;
7579
+ const { Text: Text39 } = Typography10;
7474
7580
  const [showAll, setShowAll] = useState25(false);
7475
7581
  const { openSideApp } = useChatUIContext();
7476
7582
  const getStyles = () => {
@@ -7544,7 +7650,7 @@ var AttachmentsCard = ({
7544
7650
  );
7545
7651
  };
7546
7652
  const renderFileDescription = (item) => /* @__PURE__ */ jsx34(Space9, { direction: "vertical", size: size === "small" ? 2 : 4, children: /* @__PURE__ */ jsx34(Space9, { children: /* @__PURE__ */ jsx34(
7547
- Text38,
7653
+ Text39,
7548
7654
  {
7549
7655
  type: "secondary",
7550
7656
  style: {
@@ -7618,7 +7724,7 @@ var AttachmentsCard = ({
7618
7724
  }
7619
7725
  ),
7620
7726
  item.files && /* @__PURE__ */ jsxs18("div", { style: { paddingLeft: "12px" }, children: [
7621
- /* @__PURE__ */ jsxs18(Text38, { type: "secondary", style: { fontSize: "12px" }, children: [
7727
+ /* @__PURE__ */ jsxs18(Text39, { type: "secondary", style: { fontSize: "12px" }, children: [
7622
7728
  "Contains ",
7623
7729
  item.files.length,
7624
7730
  " file(s)"
@@ -7669,7 +7775,7 @@ var RenderMDFromURL = ({ url, file_id }) => {
7669
7775
  };
7670
7776
 
7671
7777
  // src/components/GenUI/elements/attachments_viewer_side_app.tsx
7672
- import { Fragment as Fragment5, jsx as jsx36, jsxs as jsxs19 } from "react/jsx-runtime";
7778
+ import { Fragment as Fragment4, jsx as jsx36, jsxs as jsxs19 } from "react/jsx-runtime";
7673
7779
  function AttachmentsViewerSideApp({
7674
7780
  data,
7675
7781
  component_key
@@ -7708,7 +7814,7 @@ function AttachmentsViewerSideApp({
7708
7814
  return /* @__PURE__ */ jsx36(
7709
7815
  Empty2,
7710
7816
  {
7711
- description: /* @__PURE__ */ jsxs19(Fragment5, { children: [
7817
+ description: /* @__PURE__ */ jsxs19(Fragment4, { children: [
7712
7818
  /* @__PURE__ */ jsx36("div", { children: "Preview not supported. Please download to view." }),
7713
7819
  /* @__PURE__ */ jsxs19(Button14, { type: "link", href: fileUri?.url, download: fileUri?.fileName, children: [
7714
7820
  "Download ",
@@ -7729,7 +7835,7 @@ import { Collapse as Collapse5 } from "antd";
7729
7835
  import { createStyles as createStyles10 } from "antd-style";
7730
7836
  import { DownOutlined as DownOutlined3, UpOutlined as UpOutlined2 } from "@ant-design/icons";
7731
7837
  import CollapsePanel3 from "antd/es/collapse/CollapsePanel";
7732
- import { Fragment as Fragment6, jsx as jsx37, jsxs as jsxs20 } from "react/jsx-runtime";
7838
+ import { Fragment as Fragment5, jsx as jsx37, jsxs as jsxs20 } from "react/jsx-runtime";
7733
7839
  var DEFAULT_COLLAPSED_MAX_HEIGHT = 180;
7734
7840
  var DEFAULT_EXPANDED_MAX_HEIGHT = 500;
7735
7841
  var useStyle4 = createStyles10(
@@ -7846,10 +7952,10 @@ var ContentPreviewCollapse = ({
7846
7952
  children: /* @__PURE__ */ jsx37("div", { ref: contentRef, className: styles.content, children })
7847
7953
  }
7848
7954
  ),
7849
- isOverflowing && /* @__PURE__ */ jsx37("div", { className: styles.toggleButton, onClick: handleToggleContent, children: showFullContent ? /* @__PURE__ */ jsxs20(Fragment6, { children: [
7955
+ isOverflowing && /* @__PURE__ */ jsx37("div", { className: styles.toggleButton, onClick: handleToggleContent, children: showFullContent ? /* @__PURE__ */ jsxs20(Fragment5, { children: [
7850
7956
  /* @__PURE__ */ jsx37(UpOutlined2, { style: { fontSize: 10 } }),
7851
7957
  /* @__PURE__ */ jsx37("span", { children: showLessText })
7852
- ] }) : /* @__PURE__ */ jsxs20(Fragment6, { children: [
7958
+ ] }) : /* @__PURE__ */ jsxs20(Fragment5, { children: [
7853
7959
  /* @__PURE__ */ jsx37(DownOutlined3, { style: { fontSize: 10 } }),
7854
7960
  /* @__PURE__ */ jsx37("span", { children: showAllText })
7855
7961
  ] }) })
@@ -8306,7 +8412,7 @@ import {
8306
8412
  } from "react";
8307
8413
  import { jsx as jsx42 } from "react/jsx-runtime";
8308
8414
  var LazyBubble = ({
8309
- message: message20,
8415
+ message: message21,
8310
8416
  renderContent,
8311
8417
  autoLoadRightPanel
8312
8418
  }) => {
@@ -8337,10 +8443,10 @@ var LazyBubble = ({
8337
8443
  autoLoadRightPanel?.();
8338
8444
  }, []);
8339
8445
  const getPlaceholder = () => {
8340
- const estimatedHeight = message20.content ? Math.min(100, message20.content.length / 5) : 100;
8446
+ const estimatedHeight = message21.content ? Math.min(100, message21.content.length / 5) : 100;
8341
8447
  return /* @__PURE__ */ jsx42("div", { style: { height: `${estimatedHeight}px`, minHeight: "50px" } });
8342
8448
  };
8343
- return /* @__PURE__ */ jsx42(ErrorBoundary, { children: /* @__PURE__ */ jsx42("div", { ref, style: { width: "100%" }, children: isVisible || wasEverVisible ? renderContent(message20) : getPlaceholder() }) });
8449
+ return /* @__PURE__ */ jsx42(ErrorBoundary, { children: /* @__PURE__ */ jsx42("div", { ref, style: { width: "100%" }, children: isVisible || wasEverVisible ? renderContent(message21) : getPlaceholder() }) });
8344
8450
  };
8345
8451
  var MemoizedBubbleList = memo(
8346
8452
  ({
@@ -8371,8 +8477,8 @@ var MessageList = ({
8371
8477
  messageLengthRef.current = messages?.length;
8372
8478
  }
8373
8479
  }, [messages?.length]);
8374
- const renderContent = useCallback16((message20) => {
8375
- const { content } = message20;
8480
+ const renderContent = useCallback16((message21) => {
8481
+ const { content } = message21;
8376
8482
  try {
8377
8483
  const json = JSON.parse(content);
8378
8484
  if (json.action && json.message) {
@@ -8380,7 +8486,7 @@ var MessageList = ({
8380
8486
  }
8381
8487
  } catch (error) {
8382
8488
  }
8383
- const tool_calls_md = message20.tool_calls?.map((tool_call) => {
8489
+ const tool_calls_md = message21.tool_calls?.map((tool_call) => {
8384
8490
  return `\`\`\`tool_call
8385
8491
  ${JSON.stringify(tool_call)}
8386
8492
  \`\`\``;
@@ -8389,17 +8495,17 @@ ${JSON.stringify(tool_call)}
8389
8495
  return /* @__PURE__ */ jsx42(Space12, { direction: "vertical", style: { width: "100%" }, children: /* @__PURE__ */ jsx42(MDResponse, { content: content_md }) });
8390
8496
  }, []);
8391
8497
  const items = useMemo9(
8392
- () => messages.map((message20, index) => ({
8393
- key: message20.id,
8394
- role: message20.role,
8498
+ () => messages.map((message21, index) => ({
8499
+ key: message21.id,
8500
+ role: message21.role,
8395
8501
  typing: false,
8396
8502
  content: /* @__PURE__ */ jsx42(
8397
8503
  LazyBubble,
8398
8504
  {
8399
- message: message20,
8505
+ message: message21,
8400
8506
  renderContent,
8401
8507
  autoLoadRightPanel: () => {
8402
- const { content, role: role2 } = message20;
8508
+ const { content, role: role2 } = message21;
8403
8509
  const isNewAddedMessage = messageLengthRef.current > 1 && messageLengthRef.current + 1 === messages.length;
8404
8510
  if (index === messages.length - 1 && isNewAddedMessage && role2 === "ai") {
8405
8511
  try {
@@ -8476,7 +8582,7 @@ import {
8476
8582
  Space as Space28,
8477
8583
  Typography as Typography33
8478
8584
  } from "antd";
8479
- import React42, { useCallback as useCallback26, useContext as useContext10, useEffect as useEffect35, useRef as useRef21, useState as useState54 } from "react";
8585
+ import React43, { useCallback as useCallback26, useContext as useContext10, useEffect as useEffect35, useRef as useRef21, useState as useState54 } from "react";
8480
8586
  import { BrainCircuit as BrainCircuit3 } from "lucide-react";
8481
8587
 
8482
8588
  // src/components/GenUI/HITLContainer.tsx
@@ -9426,7 +9532,7 @@ var AgentHeader = ({
9426
9532
  import { useCallback as useCallback18, useContext as useContext8 } from "react";
9427
9533
  import { Tooltip as Tooltip9, Button as Button23, Dropdown } from "antd";
9428
9534
  import { HistoryOutlined, PlusOutlined } from "@ant-design/icons";
9429
- import { Fragment as Fragment7, jsx as jsx55, jsxs as jsxs30 } from "react/jsx-runtime";
9535
+ import { Fragment as Fragment6, jsx as jsx55, jsxs as jsxs30 } from "react/jsx-runtime";
9430
9536
  var CreateThreadButton = () => {
9431
9537
  const { createThread, assistantId, isLoading } = useConversationContext();
9432
9538
  const { config } = useLatticeChatShellContext();
@@ -9527,14 +9633,14 @@ var ThreadManagementButtons = () => {
9527
9633
  if (!conversationContext.assistantId) {
9528
9634
  return null;
9529
9635
  }
9530
- return /* @__PURE__ */ jsxs30(Fragment7, { children: [
9636
+ return /* @__PURE__ */ jsxs30(Fragment6, { children: [
9531
9637
  showCreateButton && /* @__PURE__ */ jsx55(CreateThreadButton, {}),
9532
9638
  showListButton && /* @__PURE__ */ jsx55(ThreadListButton, {})
9533
9639
  ] });
9534
9640
  };
9535
9641
 
9536
9642
  // src/context/WorkspaceContext.tsx
9537
- import React34, {
9643
+ import React35, {
9538
9644
  createContext as createContext8,
9539
9645
  useContext as useContext9,
9540
9646
  useState as useState46,
@@ -9549,11 +9655,11 @@ import { FolderOpen as FolderOpen2, Activity as Activity3, Database as Database4
9549
9655
  import { Modal as Modal10, Avatar as Avatar7, Popover as Popover2, Button as Button35 } from "antd";
9550
9656
 
9551
9657
  // src/components/Chat/Menu.tsx
9552
- import React18, { useState as useState31, useMemo as useMemo10, useCallback as useCallback19 } from "react";
9658
+ import React19, { useState as useState31, useMemo as useMemo10, useCallback as useCallback19 } from "react";
9553
9659
  import { Drawer } from "antd";
9554
9660
  import { Plus, ChevronRight, ChevronDown, Cpu, PanelLeftClose } from "lucide-react";
9555
9661
  import { createStyles as createStyles16 } from "antd-style";
9556
- import { Fragment as Fragment8, jsx as jsx56, jsxs as jsxs31 } from "react/jsx-runtime";
9662
+ import { Fragment as Fragment7, jsx as jsx56, jsxs as jsxs31 } from "react/jsx-runtime";
9557
9663
  var DRAWER_STYLES = {
9558
9664
  wrapper: {
9559
9665
  background: "transparent",
@@ -9716,7 +9822,7 @@ var Menu = ({
9716
9822
  }, [forceIconMode, isIconView, isControlled, onCollapsedChange]);
9717
9823
  const renderIconMode = () => /* @__PURE__ */ jsxs31("div", { className: `${menuStyles.sidebar} ${styles.iconMode} ${className || ""}`, style, children: [
9718
9824
  /* @__PURE__ */ jsx56("div", { className: styles.iconModeLogo, children: logo || logoIcon || /* @__PURE__ */ jsx56(Cpu, { size: 28, color: "#1677ff" }) }),
9719
- /* @__PURE__ */ jsx56("div", { className: styles.iconModeContainer, children: groupedItems.map(({ group, items: items2 }, groupIndex) => /* @__PURE__ */ jsxs31(React18.Fragment, { children: [
9825
+ /* @__PURE__ */ jsx56("div", { className: styles.iconModeContainer, children: groupedItems.map(({ group, items: items2 }, groupIndex) => /* @__PURE__ */ jsxs31(React19.Fragment, { children: [
9720
9826
  groupIndex > 0 && /* @__PURE__ */ jsx56("div", { className: styles.iconModeDivider }),
9721
9827
  /* @__PURE__ */ jsx56("div", { className: styles.iconModeGroup, children: items2.map((item) => /* @__PURE__ */ jsx56(
9722
9828
  "button",
@@ -9767,7 +9873,7 @@ var Menu = ({
9767
9873
  items2.map((item) => {
9768
9874
  const isInline = item.inline ?? false;
9769
9875
  const isExpanded2 = expandedInlineDrawers.has(item.id);
9770
- return /* @__PURE__ */ jsxs31(React18.Fragment, { children: [
9876
+ return /* @__PURE__ */ jsxs31(React19.Fragment, { children: [
9771
9877
  /* @__PURE__ */ jsxs31(
9772
9878
  "button",
9773
9879
  {
@@ -9789,7 +9895,7 @@ var Menu = ({
9789
9895
  ] }, group || "ungrouped")) }),
9790
9896
  footer && /* @__PURE__ */ jsx56("div", { style: { marginTop: "auto", paddingTop: 16, borderTop: "1px solid rgba(0, 0, 0, 0.06)" }, children: typeof footer === "function" ? footer({ isIconMode: shouldShowIconMode }) : footer })
9791
9897
  ] });
9792
- return /* @__PURE__ */ jsxs31(Fragment8, { children: [
9898
+ return /* @__PURE__ */ jsxs31(Fragment7, { children: [
9793
9899
  shouldShowIconMode ? renderIconMode() : renderExpandedMode(),
9794
9900
  items.filter((item) => item.type === "drawer").map((item) => /* @__PURE__ */ jsx56(
9795
9901
  Drawer,
@@ -10250,7 +10356,7 @@ var ProjectCardList = () => {
10250
10356
  }
10251
10357
  setIsCreateModalOpen(false);
10252
10358
  };
10253
- const formatDate5 = (date) => {
10359
+ const formatDate6 = (date) => {
10254
10360
  const d = typeof date === "string" ? new Date(date) : date;
10255
10361
  return d.toLocaleDateString("en-US", {
10256
10362
  month: "short",
@@ -10341,7 +10447,7 @@ var ProjectCardList = () => {
10341
10447
  /* @__PURE__ */ jsx58("h3", { className: styles.projectName, children: project.name }),
10342
10448
  /* @__PURE__ */ jsxs33("span", { className: styles.projectDate, children: [
10343
10449
  "Created ",
10344
- formatDate5(project.createdAt)
10450
+ formatDate6(project.createdAt)
10345
10451
  ] })
10346
10452
  ] })
10347
10453
  ] }) })
@@ -10359,7 +10465,7 @@ var ProjectCardList = () => {
10359
10465
  /* @__PURE__ */ jsx58("span", { className: styles.listProjectName, children: project.name }),
10360
10466
  /* @__PURE__ */ jsxs33("span", { className: styles.listProjectDate, children: [
10361
10467
  "Created ",
10362
- formatDate5(project.createdAt)
10468
+ formatDate6(project.createdAt)
10363
10469
  ] })
10364
10470
  ] })
10365
10471
  ] }, project.id))
@@ -11046,7 +11152,7 @@ import { useState as useState35, useEffect as useEffect21 } from "react";
11046
11152
  import { createStyles as createStyles18 } from "antd-style";
11047
11153
  import { Database as Database2, Plus as Plus4, Edit2 as Edit22, Trash2 as Trash22, TestTube2 as TestTube22, Loader2 as Loader22 } from "lucide-react";
11048
11154
  import { Card as Card13, Button as Button26, Space as Space17, Typography as Typography18, Tag as Tag7, Modal as Modal4, message as message6, Input as Input6, Select as Select2, Popconfirm as Popconfirm2 } from "antd";
11049
- import { Fragment as Fragment9, jsx as jsx60, jsxs as jsxs35 } from "react/jsx-runtime";
11155
+ import { Fragment as Fragment8, jsx as jsx60, jsxs as jsxs35 } from "react/jsx-runtime";
11050
11156
  var { Text: Text15 } = Typography18;
11051
11157
  var { TextArea: TextArea2 } = Input6;
11052
11158
  var useStyles7 = createStyles18(({ token, css }) => ({
@@ -11236,7 +11342,7 @@ var DatabaseConfigDrawerContent = ({
11236
11342
  configItem.id
11237
11343
  ] }),
11238
11344
  configItem.description && /* @__PURE__ */ jsx60("div", { style: { fontSize: 13, color: "#666", marginBottom: 12 }, children: configItem.description }),
11239
- /* @__PURE__ */ jsx60("div", { style: { marginBottom: 12 }, children: configItem.config.connectionString ? /* @__PURE__ */ jsx60(Tag7, { color: "success", style: { fontSize: 11 }, children: "Connection String Mode" }) : /* @__PURE__ */ jsxs35(Fragment9, { children: [
11345
+ /* @__PURE__ */ jsx60("div", { style: { marginBottom: 12 }, children: configItem.config.connectionString ? /* @__PURE__ */ jsx60(Tag7, { color: "success", style: { fontSize: 11 }, children: "Connection String Mode" }) : /* @__PURE__ */ jsxs35(Fragment8, { children: [
11240
11346
  /* @__PURE__ */ jsxs35(Text15, { code: true, style: { fontSize: 12, marginRight: 8 }, children: [
11241
11347
  configItem.config.host || "localhost",
11242
11348
  ":",
@@ -11557,7 +11663,7 @@ var DatabaseConfigFormModal = ({
11557
11663
  import { useState as useState36, useEffect as useEffect22 } from "react";
11558
11664
  import { Plug, Plus as Plus5, Edit2 as Edit23, Trash2 as Trash23, TestTube2 as TestTube23, Loader2 as Loader23, Settings as Settings2, Database as Database3, ChevronRight as ChevronRight3, ChevronLeft as ChevronLeft3, Check as Check3, Terminal, Globe, Server } from "lucide-react";
11559
11665
  import { Card as Card14, Button as Button27, Space as Space18, Typography as Typography19, Tag as Tag8, Modal as Modal5, message as message7, Input as Input7, Select as Select3, Popconfirm as Popconfirm3, Steps as Steps2, Checkbox as Checkbox3, Spin as Spin6, theme as theme4, Collapse as Collapse7 } from "antd";
11560
- import { Fragment as Fragment10, jsx as jsx61, jsxs as jsxs36 } from "react/jsx-runtime";
11666
+ import { Fragment as Fragment9, jsx as jsx61, jsxs as jsxs36 } from "react/jsx-runtime";
11561
11667
  var { Text: Text16, Title: Title3 } = Typography19;
11562
11668
  var { TextArea: TextArea3 } = Input7;
11563
11669
  var { useToken: useToken3 } = theme4;
@@ -12015,7 +12121,7 @@ var McpConfigFormModal = ({
12015
12121
  }
12016
12122
  )
12017
12123
  ] }),
12018
- formData.transport === "stdio" ? /* @__PURE__ */ jsxs36(Fragment10, { children: [
12124
+ formData.transport === "stdio" ? /* @__PURE__ */ jsxs36(Fragment9, { children: [
12019
12125
  /* @__PURE__ */ jsxs36("div", { children: [
12020
12126
  /* @__PURE__ */ jsx61(Text16, { strong: true, children: "Command" }),
12021
12127
  /* @__PURE__ */ jsx61(
@@ -13032,7 +13138,7 @@ import {
13032
13138
  DeleteOutlined as DeleteOutlined2
13033
13139
  } from "@ant-design/icons";
13034
13140
  import { Activity as Activity2 } from "lucide-react";
13035
- import { Fragment as Fragment11, jsx as jsx63, jsxs as jsxs38 } from "react/jsx-runtime";
13141
+ import { Fragment as Fragment10, jsx as jsx63, jsxs as jsxs38 } from "react/jsx-runtime";
13036
13142
  var { TextArea: TextArea4 } = Input8;
13037
13143
  var { Text: Text18, Title: Title4 } = Typography21;
13038
13144
  var SectionCard = ({ title, icon, badge, children, defaultExpanded = true }) => {
@@ -13115,7 +13221,7 @@ var SectionCard = ({ title, icon, badge, children, defaultExpanded = true }) =>
13115
13221
  var renderConfigField = (propertyKey, property, value, onChange, token) => {
13116
13222
  const label = /* @__PURE__ */ jsxs38("span", { children: [
13117
13223
  property.title || propertyKey,
13118
- property.description && /* @__PURE__ */ jsxs38(Fragment11, { children: [
13224
+ property.description && /* @__PURE__ */ jsxs38(Fragment10, { children: [
13119
13225
  "\xA0",
13120
13226
  /* @__PURE__ */ jsx63(Tooltip11, { title: property.description, children: /* @__PURE__ */ jsx63(QuestionCircleOutlined, { style: { color: token.colorTextSecondary, cursor: "pointer" } }) })
13121
13227
  ] })
@@ -14226,7 +14332,7 @@ var AgentConfigPanel = ({
14226
14332
  description: "No tools available",
14227
14333
  image: Empty4.PRESENTED_IMAGE_SIMPLE
14228
14334
  }
14229
- ) : /* @__PURE__ */ jsxs38(Fragment11, { children: [
14335
+ ) : /* @__PURE__ */ jsxs38(Fragment10, { children: [
14230
14336
  /* @__PURE__ */ jsxs38(
14231
14337
  "div",
14232
14338
  {
@@ -14282,7 +14388,7 @@ var AgentConfigPanel = ({
14282
14388
  description: "No other agents available",
14283
14389
  image: Empty4.PRESENTED_IMAGE_SIMPLE
14284
14390
  }
14285
- ) : /* @__PURE__ */ jsxs38(Fragment11, { children: [
14391
+ ) : /* @__PURE__ */ jsxs38(Fragment10, { children: [
14286
14392
  /* @__PURE__ */ jsxs38(
14287
14393
  "div",
14288
14394
  {
@@ -14633,7 +14739,7 @@ var SubAgentInheritList = ({
14633
14739
  };
14634
14740
 
14635
14741
  // src/components/Chat/CreateAssistantModal.tsx
14636
- import { Fragment as Fragment12, jsx as jsx66, jsxs as jsxs41 } from "react/jsx-runtime";
14742
+ import { Fragment as Fragment11, jsx as jsx66, jsxs as jsxs41 } from "react/jsx-runtime";
14637
14743
  var { TextArea: TextArea5 } = Input10;
14638
14744
  var { Text: Text21 } = Typography24;
14639
14745
  var CreateAssistantModal = ({
@@ -15006,7 +15112,7 @@ var CreateAssistantModal = ({
15006
15112
  ]
15007
15113
  }
15008
15114
  ),
15009
- showSubAgentList && /* @__PURE__ */ jsxs41(Fragment12, { children: [
15115
+ showSubAgentList && /* @__PURE__ */ jsxs41(Fragment11, { children: [
15010
15116
  /* @__PURE__ */ jsx66(Divider4, { style: { margin: "12px 0" } }),
15011
15117
  /* @__PURE__ */ jsx66(Text21, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Sub-Agents" }),
15012
15118
  /* @__PURE__ */ jsx66(
@@ -15522,7 +15628,7 @@ import {
15522
15628
  CopyOutlined as CopyOutlined2,
15523
15629
  PlusOutlined as PlusOutlined4
15524
15630
  } from "@ant-design/icons";
15525
- import { Fragment as Fragment13, jsx as jsx68, jsxs as jsxs43 } from "react/jsx-runtime";
15631
+ import { Fragment as Fragment12, jsx as jsx68, jsxs as jsxs43 } from "react/jsx-runtime";
15526
15632
  var { Text: Text22 } = Typography25;
15527
15633
  var { TextArea: TextArea6 } = Input11;
15528
15634
  var getBadgeColor2 = (name) => {
@@ -15575,7 +15681,7 @@ var SkillNode = ({ data }) => {
15575
15681
  ) : [],
15576
15682
  [currentSkill.metadata]
15577
15683
  );
15578
- const formatDate5 = (value) => {
15684
+ const formatDate6 = (value) => {
15579
15685
  if (!value) return "";
15580
15686
  const date = value instanceof Date ? value : new Date(value);
15581
15687
  if (Number.isNaN(date.getTime())) return "";
@@ -15969,7 +16075,7 @@ var SkillNode = ({ data }) => {
15969
16075
  ] })
15970
16076
  }
15971
16077
  ),
15972
- isEditing ? editingView : /* @__PURE__ */ jsxs43(Fragment13, { children: [
16078
+ isEditing ? editingView : /* @__PURE__ */ jsxs43(Fragment12, { children: [
15973
16079
  currentSkill.description && /* @__PURE__ */ jsx68("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ jsxs43(
15974
16080
  Text22,
15975
16081
  {
@@ -16183,7 +16289,7 @@ var SkillNode = ({ data }) => {
16183
16289
  },
16184
16290
  children: [
16185
16291
  "Created: ",
16186
- formatDate5(currentSkill.createdAt)
16292
+ formatDate6(currentSkill.createdAt)
16187
16293
  ]
16188
16294
  }
16189
16295
  ),
@@ -16197,7 +16303,7 @@ var SkillNode = ({ data }) => {
16197
16303
  },
16198
16304
  children: [
16199
16305
  "Updated: ",
16200
- formatDate5(currentSkill.updatedAt)
16306
+ formatDate6(currentSkill.updatedAt)
16201
16307
  ]
16202
16308
  }
16203
16309
  )
@@ -16275,7 +16381,7 @@ var SkillNode = ({ data }) => {
16275
16381
  justifyContent: "space-between",
16276
16382
  gap: 8
16277
16383
  },
16278
- children: isEditing ? /* @__PURE__ */ jsxs43(Fragment13, { children: [
16384
+ children: isEditing ? /* @__PURE__ */ jsxs43(Fragment12, { children: [
16279
16385
  /* @__PURE__ */ jsx68(
16280
16386
  Button31,
16281
16387
  {
@@ -16303,7 +16409,7 @@ var SkillNode = ({ data }) => {
16303
16409
  children: "Save"
16304
16410
  }
16305
16411
  )
16306
- ] }) : /* @__PURE__ */ jsxs43(Fragment13, { children: [
16412
+ ] }) : /* @__PURE__ */ jsxs43(Fragment12, { children: [
16307
16413
  /* @__PURE__ */ jsx68(
16308
16414
  Button31,
16309
16415
  {
@@ -17763,8 +17869,7 @@ var WorkspaceResourceManager = ({
17763
17869
  }
17764
17870
  ),
17765
17871
  logo,
17766
- left: /* @__PURE__ */ jsx72(SideAppViewBrowser, { region: "content" }),
17767
- right: null
17872
+ main: /* @__PURE__ */ jsx72(SideAppViewBrowser, { region: "content" })
17768
17873
  }
17769
17874
  ),
17770
17875
  /* @__PURE__ */ jsx72(
@@ -17848,7 +17953,7 @@ var WorkspaceContextProvider = ({
17848
17953
  };
17849
17954
  const [workspaceId, setWorkspaceId] = useState46(getInitialWorkspaceId);
17850
17955
  const [projectId, setProjectId] = useState46(getInitialProjectId);
17851
- React34.useEffect(() => {
17956
+ React35.useEffect(() => {
17852
17957
  const wsId = getInitialWorkspaceId();
17853
17958
  const pjId = getInitialProjectId();
17854
17959
  if (wsId || pjId) {
@@ -17862,7 +17967,7 @@ var WorkspaceContextProvider = ({
17862
17967
  const [projects, setProjects] = useState46([]);
17863
17968
  const [loading, setLoading] = useState46(false);
17864
17969
  const [error, setError] = useState46(null);
17865
- const client = React34.useMemo(() => {
17970
+ const client = React35.useMemo(() => {
17866
17971
  return new WorkspaceClient({
17867
17972
  baseURL: config.baseURL,
17868
17973
  apiKey: config.apiKey || "",
@@ -18145,7 +18250,7 @@ var WorkspaceContextProvider = ({
18145
18250
  import { useRef as useRef16, useState as useState47 } from "react";
18146
18251
  import { Modal as Modal11, List as List7, Checkbox as Checkbox5, Spin as Spin8, Empty as Empty5, Typography as Typography27, Button as Button36, Space as Space23, Tooltip as Tooltip13 } from "antd";
18147
18252
  import { Database as Database5 } from "lucide-react";
18148
- import { Fragment as Fragment14, jsx as jsx74, jsxs as jsxs48 } from "react/jsx-runtime";
18253
+ import { Fragment as Fragment13, jsx as jsx74, jsxs as jsxs48 } from "react/jsx-runtime";
18149
18254
  var DatabasePicker = ({ senderRef, iconOnly }) => {
18150
18255
  const [modalOpen, setModalOpen] = useState47(false);
18151
18256
  const [databases, setDatabases] = useState47([]);
@@ -18200,7 +18305,7 @@ var DatabasePicker = ({ senderRef, iconOnly }) => {
18200
18305
  setModalOpen(false);
18201
18306
  setSelectedDatabases([]);
18202
18307
  };
18203
- return /* @__PURE__ */ jsxs48(Fragment14, { children: [
18308
+ return /* @__PURE__ */ jsxs48(Fragment13, { children: [
18204
18309
  /* @__PURE__ */ jsx74(Tooltip13, { title: iconOnly ? "Database" : void 0, children: /* @__PURE__ */ jsx74(
18205
18310
  Button36,
18206
18311
  {
@@ -18295,7 +18400,7 @@ var DatabasePicker = ({ senderRef, iconOnly }) => {
18295
18400
  import { useRef as useRef17, useState as useState48 } from "react";
18296
18401
  import { Modal as Modal12, List as List8, Checkbox as Checkbox6, Spin as Spin9, Empty as Empty6, Typography as Typography28, Button as Button37, Space as Space24, Tooltip as Tooltip14 } from "antd";
18297
18402
  import { BrainCircuit } from "lucide-react";
18298
- import { Fragment as Fragment15, jsx as jsx75, jsxs as jsxs49 } from "react/jsx-runtime";
18403
+ import { Fragment as Fragment14, jsx as jsx75, jsxs as jsxs49 } from "react/jsx-runtime";
18299
18404
  var SkillPicker = ({ senderRef, iconOnly }) => {
18300
18405
  const [modalOpen, setModalOpen] = useState48(false);
18301
18406
  const [skills, setSkills] = useState48([]);
@@ -18350,7 +18455,7 @@ var SkillPicker = ({ senderRef, iconOnly }) => {
18350
18455
  setModalOpen(false);
18351
18456
  setSelectedSkills([]);
18352
18457
  };
18353
- return /* @__PURE__ */ jsxs49(Fragment15, { children: [
18458
+ return /* @__PURE__ */ jsxs49(Fragment14, { children: [
18354
18459
  /* @__PURE__ */ jsx75(Tooltip14, { title: iconOnly ? "Skills" : void 0, children: /* @__PURE__ */ jsx75(
18355
18460
  Button37,
18356
18461
  {
@@ -18445,7 +18550,7 @@ var SkillPicker = ({ senderRef, iconOnly }) => {
18445
18550
  import { useRef as useRef18, useState as useState49 } from "react";
18446
18551
  import { Modal as Modal13, List as List9, Empty as Empty7, Typography as Typography29, Button as Button38, Tooltip as Tooltip15 } from "antd";
18447
18552
  import { Bot as Bot2 } from "lucide-react";
18448
- import { Fragment as Fragment16, jsx as jsx76, jsxs as jsxs50 } from "react/jsx-runtime";
18553
+ import { Fragment as Fragment15, jsx as jsx76, jsxs as jsxs50 } from "react/jsx-runtime";
18449
18554
  var AgentPicker = ({ senderRef, iconOnly }) => {
18450
18555
  const [modalOpen, setModalOpen] = useState49(false);
18451
18556
  const [loading, setLoading] = useState49(false);
@@ -18465,7 +18570,7 @@ var AgentPicker = ({ senderRef, iconOnly }) => {
18465
18570
  const handleAgentClick = (agentId) => {
18466
18571
  setSelectedAgent(agentId);
18467
18572
  };
18468
- return /* @__PURE__ */ jsxs50(Fragment16, { children: [
18573
+ return /* @__PURE__ */ jsxs50(Fragment15, { children: [
18469
18574
  /* @__PURE__ */ jsx76(Tooltip15, { title: iconOnly ? currentAssistant?.name || "Agent" : void 0, children: /* @__PURE__ */ jsx76(
18470
18575
  Button38,
18471
18576
  {
@@ -18561,7 +18666,7 @@ var AgentPicker = ({ senderRef, iconOnly }) => {
18561
18666
  import { useEffect as useEffect32, useState as useState50, useRef as useRef19 } from "react";
18562
18667
  import { Modal as Modal14, List as List10, Spin as Spin11, Empty as Empty8, Typography as Typography30, Button as Button39, Tag as Tag14, Tooltip as Tooltip16 } from "antd";
18563
18668
  import { Database as Database6, Check as Check4, Server as Server2 } from "lucide-react";
18564
- import { Fragment as Fragment17, jsx as jsx77, jsxs as jsxs51 } from "react/jsx-runtime";
18669
+ import { Fragment as Fragment16, jsx as jsx77, jsxs as jsxs51 } from "react/jsx-runtime";
18565
18670
  var SESSION_STORAGE_KEY = "metrics_datasource_selection";
18566
18671
  var MetricsDataSourcePicker = ({
18567
18672
  senderRef,
@@ -18705,7 +18810,7 @@ var MetricsDataSourcePicker = ({
18705
18810
  acc[ds.serverName].push(ds);
18706
18811
  return acc;
18707
18812
  }, {});
18708
- return /* @__PURE__ */ jsxs51(Fragment17, { children: [
18813
+ return /* @__PURE__ */ jsxs51(Fragment16, { children: [
18709
18814
  /* @__PURE__ */ jsx77(Tooltip16, { title: iconOnly ? getSelectedName() || "Select Data Source" : dataSources.length === 0 ? "No data sources available" : void 0, children: /* @__PURE__ */ jsx77(
18710
18815
  Button39,
18711
18816
  {
@@ -19638,7 +19743,7 @@ var BusinessAnalysisPrompts = ({
19638
19743
  };
19639
19744
 
19640
19745
  // src/components/Chat/Chating.tsx
19641
- import { Fragment as Fragment18, jsx as jsx81, jsxs as jsxs54 } from "react/jsx-runtime";
19746
+ import { Fragment as Fragment17, jsx as jsx81, jsxs as jsxs54 } from "react/jsx-runtime";
19642
19747
  var slotConfig = [];
19643
19748
  var Chating = ({
19644
19749
  avatar,
@@ -19665,7 +19770,7 @@ var Chating = ({
19665
19770
  const { styles } = useStyle();
19666
19771
  const [headerOpen, setHeaderOpen] = useState54(false);
19667
19772
  const attachmentsRef = useRef21(null);
19668
- const senderRef = React42.useRef(null);
19773
+ const senderRef = React43.useRef(null);
19669
19774
  const {
19670
19775
  assistantId,
19671
19776
  threadId,
@@ -20101,7 +20206,7 @@ var Chating = ({
20101
20206
  }
20102
20207
  );
20103
20208
  };
20104
- return /* @__PURE__ */ jsxs54(Fragment18, { children: [
20209
+ return /* @__PURE__ */ jsxs54(Fragment17, { children: [
20105
20210
  /* @__PURE__ */ jsx81(
20106
20211
  "div",
20107
20212
  {
@@ -20140,7 +20245,7 @@ var Chating = ({
20140
20245
  className: `${styles.emptyStateContainer} ${isTransitioning ? styles.exiting : ""}`,
20141
20246
  children: [
20142
20247
  /* @__PURE__ */ jsxs54("div", { className: styles.welcomeSection, children: [
20143
- /* @__PURE__ */ jsx81("div", { className: styles.greeting, children: emptyStateGreeting ? emptyStateGreeting : /* @__PURE__ */ jsxs54(Fragment18, { children: [
20248
+ /* @__PURE__ */ jsx81("div", { className: styles.greeting, children: emptyStateGreeting ? emptyStateGreeting : /* @__PURE__ */ jsxs54(Fragment17, { children: [
20144
20249
  welcomePrefix,
20145
20250
  " ",
20146
20251
  /* @__PURE__ */ jsx81("span", { className: "user-name", children: displayUserName })
@@ -20168,7 +20273,7 @@ var Chating = ({
20168
20273
  ]
20169
20274
  }
20170
20275
  ),
20171
- !isEmptyState && /* @__PURE__ */ jsxs54(Fragment18, { children: [
20276
+ !isEmptyState && /* @__PURE__ */ jsxs54(Fragment17, { children: [
20172
20277
  /* @__PURE__ */ jsx81(
20173
20278
  MessageList,
20174
20279
  {
@@ -20401,8 +20506,7 @@ import {
20401
20506
  Tooltip as Tooltip17,
20402
20507
  Popconfirm as Popconfirm4,
20403
20508
  message as message14,
20404
- Card as Card16,
20405
- Descriptions
20509
+ Card as Card16
20406
20510
  } from "antd";
20407
20511
  import {
20408
20512
  ClockCircleOutlined as ClockCircleOutlined3,
@@ -20500,6 +20604,11 @@ var useStyles8 = createStyles20(({ token, css }) => ({
20500
20604
  padding: 2px 6px;
20501
20605
  border-radius: 4px;
20502
20606
  font-size: 12px;
20607
+ `,
20608
+ messageContent: css`
20609
+ margin-top: 4px;
20610
+ max-width: 300px;
20611
+ word-break: break-word;
20503
20612
  `
20504
20613
  }));
20505
20614
  var getStatusColor = (status) => {
@@ -20685,7 +20794,8 @@ var ScheduleViewer = ({ data }) => {
20685
20794
  /* @__PURE__ */ jsxs56("div", { className: styles.taskHeader, children: [
20686
20795
  /* @__PURE__ */ jsxs56("div", { children: [
20687
20796
  /* @__PURE__ */ jsx84("div", { className: styles.taskType, children: task.taskType }),
20688
- /* @__PURE__ */ jsx84("div", { className: styles.taskId, children: task.taskId })
20797
+ /* @__PURE__ */ jsx84("div", { className: styles.taskId, children: task.taskId }),
20798
+ task.payload?.message?.content && /* @__PURE__ */ jsx84("div", { className: styles.messageContent, children: /* @__PURE__ */ jsx84(Text26, { type: "secondary", style: { fontSize: 12 }, children: task.payload.message.content }) })
20689
20799
  ] }),
20690
20800
  /* @__PURE__ */ jsx84(Tag15, { color: getStatusColor(task.status), icon: getStatusIcon2(task.status), children: task.status.toUpperCase() })
20691
20801
  ] }),
@@ -20725,19 +20835,6 @@ var ScheduleViewer = ({ data }) => {
20725
20835
  /* @__PURE__ */ jsx84(ExclamationCircleOutlined, { style: { marginRight: 4 } }),
20726
20836
  task.lastError
20727
20837
  ] }) }),
20728
- task.metadata && Object.keys(task.metadata).length > 0 && /* @__PURE__ */ jsx84(
20729
- Descriptions,
20730
- {
20731
- size: "small",
20732
- column: 1,
20733
- style: { marginTop: 12 },
20734
- items: Object.entries(task.metadata).map(([key, value]) => ({
20735
- key,
20736
- label: key,
20737
- children: typeof value === "object" ? JSON.stringify(value) : String(value)
20738
- }))
20739
- }
20740
- ),
20741
20838
  isActive && renderActions(task)
20742
20839
  ]
20743
20840
  },
@@ -21106,7 +21203,7 @@ import { RefreshCw } from "lucide-react";
21106
21203
  import { createStyles as createStyles29 } from "antd-style";
21107
21204
 
21108
21205
  // src/components/GenUI/elements/TeamWorkspace/TeamWorkspaceMenu.tsx
21109
- import React44, { useState as useState56 } from "react";
21206
+ import React45, { useState as useState56 } from "react";
21110
21207
  import {
21111
21208
  LayoutDashboard,
21112
21209
  Inbox,
@@ -21118,7 +21215,7 @@ import {
21118
21215
  } from "lucide-react";
21119
21216
  import { Tooltip as Tooltip18, Badge as Badge6 } from "antd";
21120
21217
  import { createStyles as createStyles21 } from "antd-style";
21121
- import { Fragment as Fragment19, jsx as jsx88, jsxs as jsxs60 } from "react/jsx-runtime";
21218
+ import { Fragment as Fragment18, jsx as jsx88, jsxs as jsxs60 } from "react/jsx-runtime";
21122
21219
  var useStyles9 = createStyles21(({ token, css }) => ({
21123
21220
  container: css`
21124
21221
  display: flex;
@@ -21328,11 +21425,11 @@ var TeamWorkspaceMenu = ({
21328
21425
  if (showTooltip && !isExpanded) {
21329
21426
  return /* @__PURE__ */ jsx88(Tooltip18, { title: item.name, placement: "right", children: content }, item.id);
21330
21427
  }
21331
- return /* @__PURE__ */ jsx88(React44.Fragment, { children: content }, item.id);
21428
+ return /* @__PURE__ */ jsx88(React45.Fragment, { children: content }, item.id);
21332
21429
  };
21333
21430
  const renderGroup = (groupItems, groupLabel, showDivider) => {
21334
21431
  if (groupItems.length === 0) return null;
21335
- return /* @__PURE__ */ jsxs60(Fragment19, { children: [
21432
+ return /* @__PURE__ */ jsxs60(Fragment18, { children: [
21336
21433
  showDivider && /* @__PURE__ */ jsx88("div", { className: styles.groupDivider }),
21337
21434
  /* @__PURE__ */ jsxs60("div", { className: styles.menuGroup, children: [
21338
21435
  isExpanded && groupLabel && /* @__PURE__ */ jsx88("div", { className: styles.groupLabel, children: groupLabel }),
@@ -21806,7 +21903,7 @@ import {
21806
21903
  Activity as Activity4,
21807
21904
  GitCommit
21808
21905
  } from "lucide-react";
21809
- import { Fragment as Fragment20, jsx as jsx90, jsxs as jsxs62 } from "react/jsx-runtime";
21906
+ import { Fragment as Fragment19, jsx as jsx90, jsxs as jsxs62 } from "react/jsx-runtime";
21810
21907
  var { Title: Title7, Text: Text31, Paragraph } = Typography41;
21811
21908
  var useStyles11 = createStyles23(({ token, css }) => ({
21812
21909
  modalContent: css`
@@ -22291,7 +22388,7 @@ var TaskDetailModal = ({
22291
22388
  ] }),
22292
22389
  /* @__PURE__ */ jsxs62("div", { className: styles.metaItem, children: [
22293
22390
  /* @__PURE__ */ jsx90(Text31, { className: styles.metaLabel, children: "Assignee" }),
22294
- /* @__PURE__ */ jsx90("div", { className: styles.metaValue, children: task.assignee ? /* @__PURE__ */ jsxs62(Fragment20, { children: [
22391
+ /* @__PURE__ */ jsx90("div", { className: styles.metaValue, children: task.assignee ? /* @__PURE__ */ jsxs62(Fragment19, { children: [
22295
22392
  /* @__PURE__ */ jsx90(
22296
22393
  "div",
22297
22394
  {
@@ -22861,7 +22958,7 @@ var IssuesView = ({
22861
22958
  };
22862
22959
 
22863
22960
  // src/components/GenUI/elements/TeamWorkspace/TeamOrgCanvas.tsx
22864
- import React47, { useMemo as useMemo21 } from "react";
22961
+ import React48, { useMemo as useMemo21 } from "react";
22865
22962
  import {
22866
22963
  ReactFlow as ReactFlow3,
22867
22964
  Background as Background3,
@@ -23102,7 +23199,7 @@ var TeamOrgCanvasInner = ({
23102
23199
  }, [team, teammates, taskStatsByTeammate]);
23103
23200
  const [flowNodes, setNodes, onNodesChange] = useNodesState3(nodes);
23104
23201
  const [flowEdges, setEdges, onEdgesChange] = useEdgesState3(edges);
23105
- React47.useEffect(() => {
23202
+ React48.useEffect(() => {
23106
23203
  setNodes(nodes);
23107
23204
  setEdges(edges);
23108
23205
  setTimeout(() => fitView({ padding: 0.2 }), 100);
@@ -23444,12 +23541,12 @@ var formatDate3 = (timestamp) => {
23444
23541
  });
23445
23542
  };
23446
23543
  var MailboxDetailModal = ({
23447
- message: message20,
23544
+ message: message21,
23448
23545
  visible,
23449
23546
  onClose
23450
23547
  }) => {
23451
23548
  const { styles } = useStyles15();
23452
- if (!message20) return null;
23549
+ if (!message21) return null;
23453
23550
  return /* @__PURE__ */ jsx94(
23454
23551
  Modal16,
23455
23552
  {
@@ -23472,12 +23569,12 @@ var MailboxDetailModal = ({
23472
23569
  children: /* @__PURE__ */ jsxs66("div", { className: styles.modalContent, children: [
23473
23570
  /* @__PURE__ */ jsxs66("div", { className: styles.header, children: [
23474
23571
  /* @__PURE__ */ jsx94("div", { className: styles.messageIcon, children: /* @__PURE__ */ jsx94(Mail2, { size: 20 }) }),
23475
- /* @__PURE__ */ jsx94(Text35, { className: styles.messageId, children: message20.id }),
23476
- !message20.read && /* @__PURE__ */ jsx94(Tag20, { color: "red", children: "Unread" })
23572
+ /* @__PURE__ */ jsx94(Text35, { className: styles.messageId, children: message21.id }),
23573
+ !message21.read && /* @__PURE__ */ jsx94(Tag20, { color: "red", children: "Unread" })
23477
23574
  ] }),
23478
23575
  /* @__PURE__ */ jsxs66(Title11, { level: 4, className: styles.title, children: [
23479
23576
  "Message from ",
23480
- message20.from
23577
+ message21.from
23481
23578
  ] }),
23482
23579
  /* @__PURE__ */ jsxs66("div", { className: styles.metaSection, children: [
23483
23580
  /* @__PURE__ */ jsxs66("div", { className: styles.metaItem, children: [
@@ -23487,11 +23584,11 @@ var MailboxDetailModal = ({
23487
23584
  "div",
23488
23585
  {
23489
23586
  className: styles.avatar,
23490
- style: { background: getAvatarColor7(message20.from) },
23491
- children: getInitials7(message20.from)
23587
+ style: { background: getAvatarColor7(message21.from) },
23588
+ children: getInitials7(message21.from)
23492
23589
  }
23493
23590
  ),
23494
- /* @__PURE__ */ jsx94("span", { children: message20.from })
23591
+ /* @__PURE__ */ jsx94("span", { children: message21.from })
23495
23592
  ] })
23496
23593
  ] }),
23497
23594
  /* @__PURE__ */ jsxs66("div", { className: styles.metaItem, children: [
@@ -23501,29 +23598,29 @@ var MailboxDetailModal = ({
23501
23598
  "div",
23502
23599
  {
23503
23600
  className: styles.avatar,
23504
- style: { background: getAvatarColor7(message20.to) },
23505
- children: getInitials7(message20.to)
23601
+ style: { background: getAvatarColor7(message21.to) },
23602
+ children: getInitials7(message21.to)
23506
23603
  }
23507
23604
  ),
23508
- /* @__PURE__ */ jsx94("span", { children: message20.to })
23605
+ /* @__PURE__ */ jsx94("span", { children: message21.to })
23509
23606
  ] })
23510
23607
  ] }),
23511
23608
  /* @__PURE__ */ jsxs66("div", { className: styles.metaItem, children: [
23512
23609
  /* @__PURE__ */ jsx94(Text35, { className: styles.metaLabel, children: "Time" }),
23513
23610
  /* @__PURE__ */ jsxs66("div", { className: styles.metaValue, children: [
23514
23611
  /* @__PURE__ */ jsx94(Calendar2, { size: 14 }),
23515
- /* @__PURE__ */ jsx94("span", { children: formatDate3(message20.timestamp) })
23612
+ /* @__PURE__ */ jsx94("span", { children: formatDate3(message21.timestamp) })
23516
23613
  ] })
23517
23614
  ] }),
23518
23615
  /* @__PURE__ */ jsxs66("div", { className: styles.metaItem, children: [
23519
23616
  /* @__PURE__ */ jsx94(Text35, { className: styles.metaLabel, children: "Type" }),
23520
- /* @__PURE__ */ jsx94("div", { className: styles.metaValue, children: /* @__PURE__ */ jsx94(Tag20, { color: message20.type === "broadcast" ? "blue" : "default", children: message20.type }) })
23617
+ /* @__PURE__ */ jsx94("div", { className: styles.metaValue, children: /* @__PURE__ */ jsx94(Tag20, { color: message21.type === "broadcast" ? "blue" : "default", children: message21.type }) })
23521
23618
  ] })
23522
23619
  ] }),
23523
23620
  /* @__PURE__ */ jsx94(Divider8, {}),
23524
23621
  /* @__PURE__ */ jsxs66("div", { className: styles.contentSection, children: [
23525
23622
  /* @__PURE__ */ jsx94(Text35, { className: styles.contentLabel, children: "Message Content" }),
23526
- /* @__PURE__ */ jsx94("div", { className: styles.contentBox, children: /* @__PURE__ */ jsx94(Paragraph2, { className: styles.messageContent, children: message20.content }) })
23623
+ /* @__PURE__ */ jsx94("div", { className: styles.contentBox, children: /* @__PURE__ */ jsx94(Paragraph2, { className: styles.messageContent, children: message21.content }) })
23527
23624
  ] })
23528
23625
  ] })
23529
23626
  }
@@ -23752,26 +23849,26 @@ var MessageGroupComponent = ({ group, styles, defaultExpanded = true, onMessageC
23752
23849
  ]
23753
23850
  }
23754
23851
  ),
23755
- isExpanded && /* @__PURE__ */ jsx95("div", { className: styles.listGroupContent, children: group.messages.map((message20) => /* @__PURE__ */ jsxs67(
23852
+ isExpanded && /* @__PURE__ */ jsx95("div", { className: styles.listGroupContent, children: group.messages.map((message21) => /* @__PURE__ */ jsxs67(
23756
23853
  "div",
23757
23854
  {
23758
- className: `${styles.listItem} ${!message20.read ? styles.listItemUnread : ""}`,
23759
- onClick: () => onMessageClick(message20),
23855
+ className: `${styles.listItem} ${!message21.read ? styles.listItemUnread : ""}`,
23856
+ onClick: () => onMessageClick(message21),
23760
23857
  children: [
23761
- /* @__PURE__ */ jsx95("div", { className: styles.listItemIcon, children: !message20.read ? /* @__PURE__ */ jsx95("div", { className: styles.unreadBadge }) : /* @__PURE__ */ jsx95(Circle2, { size: 8, style: { color: "#d9d9d9" } }) }),
23858
+ /* @__PURE__ */ jsx95("div", { className: styles.listItemIcon, children: !message21.read ? /* @__PURE__ */ jsx95("div", { className: styles.unreadBadge }) : /* @__PURE__ */ jsx95(Circle2, { size: 8, style: { color: "#d9d9d9" } }) }),
23762
23859
  /* @__PURE__ */ jsxs67("div", { className: styles.listItemContent, children: [
23763
- /* @__PURE__ */ jsx95("span", { className: styles.listItemPreview, children: getMessagePreview(message20.content) }),
23860
+ /* @__PURE__ */ jsx95("span", { className: styles.listItemPreview, children: getMessagePreview(message21.content) }),
23764
23861
  /* @__PURE__ */ jsxs67("span", { className: styles.listItemMeta, children: [
23765
23862
  "To: ",
23766
- message20.to,
23863
+ message21.to,
23767
23864
  " \u2022 ",
23768
- message20.type
23865
+ message21.type
23769
23866
  ] })
23770
23867
  ] }),
23771
- /* @__PURE__ */ jsx95("div", { className: styles.listItemRight, children: /* @__PURE__ */ jsx95("span", { className: styles.listItemDate, children: formatDate4(message20.timestamp) }) })
23868
+ /* @__PURE__ */ jsx95("div", { className: styles.listItemRight, children: /* @__PURE__ */ jsx95("span", { className: styles.listItemDate, children: formatDate4(message21.timestamp) }) })
23772
23869
  ]
23773
23870
  },
23774
- message20.id
23871
+ message21.id
23775
23872
  )) })
23776
23873
  ] });
23777
23874
  };
@@ -23782,12 +23879,12 @@ var MailboxPanel = ({ data }) => {
23782
23879
  const { teamMailbox = [] } = data || {};
23783
23880
  const messageGroups = useMemo22(() => {
23784
23881
  const groupsMap = /* @__PURE__ */ new Map();
23785
- teamMailbox.forEach((message20) => {
23786
- const sender = message20.from;
23882
+ teamMailbox.forEach((message21) => {
23883
+ const sender = message21.from;
23787
23884
  if (!groupsMap.has(sender)) {
23788
23885
  groupsMap.set(sender, []);
23789
23886
  }
23790
- groupsMap.get(sender).push(message20);
23887
+ groupsMap.get(sender).push(message21);
23791
23888
  });
23792
23889
  const groups = Array.from(groupsMap.entries()).map(([sender, messages]) => ({
23793
23890
  sender,
@@ -23804,8 +23901,8 @@ var MailboxPanel = ({ data }) => {
23804
23901
  return groups;
23805
23902
  }, [teamMailbox]);
23806
23903
  const totalUnread = teamMailbox.filter((m) => !m.read).length;
23807
- const handleMessageClick = (message20) => {
23808
- setSelectedMessage(message20);
23904
+ const handleMessageClick = (message21) => {
23905
+ setSelectedMessage(message21);
23809
23906
  setModalVisible(true);
23810
23907
  };
23811
23908
  const handleCloseModal = () => {
@@ -24861,7 +24958,7 @@ import { Button as Button47, Typography as Typography47 } from "antd";
24861
24958
  import { ExpandOutlined as ExpandOutlined2 } from "@ant-design/icons";
24862
24959
 
24863
24960
  // src/streaming-html/StreamingHTMLRenderer.tsx
24864
- import React52, { useEffect as useEffect38, useRef as useRef23, useCallback as useCallback28, useState as useState62 } from "react";
24961
+ import React53, { useEffect as useEffect38, useRef as useRef23, useCallback as useCallback28, useState as useState62 } from "react";
24865
24962
 
24866
24963
  // src/streaming-html/show-widget-css-generator.ts
24867
24964
  function generateShowWidgetCSS(tokens) {
@@ -25560,8 +25657,8 @@ var StreamingHTMLRenderer = ({
25560
25657
  const pendingChunksRef = useRef23([]);
25561
25658
  const isCompleteRef = useRef23(isComplete);
25562
25659
  const isScriptExecuted = useRef23(false);
25563
- const [iframeHeight, setIframeHeight] = React52.useState(0);
25564
- const [iframeWidth, setIframeWidth] = React52.useState(void 0);
25660
+ const [iframeHeight, setIframeHeight] = React53.useState(0);
25661
+ const [iframeWidth, setIframeWidth] = React53.useState(void 0);
25565
25662
  const [currentMessageIndex, setCurrentMessageIndex] = useState62(0);
25566
25663
  const [showLoading, setShowLoading] = useState62(true);
25567
25664
  useEffect38(() => {
@@ -25649,11 +25746,11 @@ var StreamingHTMLRenderer = ({
25649
25746
  if (!iframe || event.source !== iframe.contentWindow) {
25650
25747
  return;
25651
25748
  }
25652
- const message20 = event.data;
25653
- if (!message20 || typeof message20 !== "object") {
25749
+ const message21 = event.data;
25750
+ if (!message21 || typeof message21 !== "object") {
25654
25751
  return;
25655
25752
  }
25656
- switch (message20.type) {
25753
+ switch (message21.type) {
25657
25754
  case "iframe-ready":
25658
25755
  console.log("[StreamingHTMLRenderer] Iframe ready");
25659
25756
  isReadyRef.current = true;
@@ -25668,25 +25765,25 @@ var StreamingHTMLRenderer = ({
25668
25765
  }
25669
25766
  break;
25670
25767
  case "iframe-height":
25671
- if (typeof message20.height === "number" && message20.height > 0) {
25672
- setIframeHeight(message20.height);
25768
+ if (typeof message21.height === "number" && message21.height > 0) {
25769
+ setIframeHeight(message21.height);
25673
25770
  }
25674
25771
  break;
25675
25772
  case "iframe-error":
25676
25773
  const streamingError = {
25677
25774
  type: "RENDER_ERROR",
25678
- message: message20.error || "Unknown iframe error"
25775
+ message: message21.error || "Unknown iframe error"
25679
25776
  };
25680
25777
  onError?.(streamingError);
25681
25778
  break;
25682
25779
  case "widget-prompt":
25683
- if (typeof message20.text === "string") {
25684
- onPrompt?.(message20.text);
25780
+ if (typeof message21.text === "string") {
25781
+ onPrompt?.(message21.text);
25685
25782
  }
25686
25783
  break;
25687
25784
  case "widget-open-link":
25688
- if (typeof message20.url === "string") {
25689
- window.open(message20.url, "_blank", "noopener,noreferrer");
25785
+ if (typeof message21.url === "string") {
25786
+ window.open(message21.url, "_blank", "noopener,noreferrer");
25690
25787
  }
25691
25788
  break;
25692
25789
  }
@@ -26052,7 +26149,7 @@ var regsiterElement = (language, ElementMeta) => {
26052
26149
  import { Dropdown as Dropdown2, Tooltip as Tooltip22 } from "antd";
26053
26150
  import { createStyles as createStyles30 } from "antd-style";
26054
26151
  import { useEffect as useEffect39, useState as useState63 } from "react";
26055
- import { Fragment as Fragment21, jsx as jsx103, jsxs as jsxs74 } from "react/jsx-runtime";
26152
+ import { Fragment as Fragment20, jsx as jsx103, jsxs as jsxs74 } from "react/jsx-runtime";
26056
26153
  var useStyle13 = createStyles30(({ token, css }) => {
26057
26154
  return {
26058
26155
  container: css`
@@ -26229,7 +26326,7 @@ var useStyle13 = createStyles30(({ token, css }) => {
26229
26326
  });
26230
26327
  var EmptySideAppView = ({ component_key, data }) => {
26231
26328
  if (data?.component) {
26232
- return /* @__PURE__ */ jsx103(Fragment21, { children: data.component });
26329
+ return /* @__PURE__ */ jsx103(Fragment20, { children: data.component });
26233
26330
  }
26234
26331
  return /* @__PURE__ */ jsxs74("div", { children: [
26235
26332
  /* @__PURE__ */ jsx103("p", { children: "Component view not found" }),
@@ -26389,7 +26486,7 @@ import { useState as useState64, useCallback as useCallback31, useMemo as useMem
26389
26486
  import { Modal as Modal17, Input as Input13, Button as Button48, message as message16 } from "antd";
26390
26487
  import { createStyles as createStyles31 } from "antd-style";
26391
26488
  import { Folder, ChevronDown as ChevronDown4, Building2 as Building24 } from "lucide-react";
26392
- import { Fragment as Fragment22, jsx as jsx104, jsxs as jsxs75 } from "react/jsx-runtime";
26489
+ import { Fragment as Fragment21, jsx as jsx104, jsxs as jsxs75 } from "react/jsx-runtime";
26393
26490
  var PROJECT_NAME_MAX_LENGTH = 50;
26394
26491
  var useStyles18 = createStyles31(({ token, css }) => ({
26395
26492
  container: css`
@@ -26707,7 +26804,7 @@ var ProjectSelector = () => {
26707
26804
  }
26708
26805
  };
26709
26806
  const isProjectNameValid = !validateProjectName(projectName.trim());
26710
- return /* @__PURE__ */ jsxs75(Fragment22, { children: [
26807
+ return /* @__PURE__ */ jsxs75(Fragment21, { children: [
26711
26808
  /* @__PURE__ */ jsx104("div", { className: styles.container, children: /* @__PURE__ */ jsxs75("div", { className: styles.selectorWrapper, children: [
26712
26809
  /* @__PURE__ */ jsx104("div", { style: { position: "relative" }, ref: workspaceDropdownRef, children: /* @__PURE__ */ jsx104(
26713
26810
  "button",
@@ -26785,136 +26882,42 @@ var ProjectSelector = () => {
26785
26882
  ] });
26786
26883
  };
26787
26884
 
26788
- // src/components/Chat/LatticeChat.tsx
26789
- import { jsx as jsx105, jsxs as jsxs76 } from "react/jsx-runtime";
26790
- var LatticeChat = (props) => {
26791
- const { assistant_id, thread_id = "", menu, header, ...chatingProps } = props;
26792
- const { config } = useLatticeChatShellContext();
26793
- const showWorkspaceSelector = config.enableWorkspace;
26794
- const leftTop = showWorkspaceSelector ? /* @__PURE__ */ jsx105(ProjectSelector, {}) : null;
26795
- return /* @__PURE__ */ jsx105(
26796
- AgentThreadProvider,
26797
- {
26798
- assistantId: assistant_id,
26799
- threadId: thread_id,
26800
- options: {
26801
- streaming: true,
26802
- enableReturnStateWhenStreamCompleted: true,
26803
- enableResumeStream: true
26804
- },
26805
- children: /* @__PURE__ */ jsx105(ChatUIContextProvider, { children: /* @__PURE__ */ jsxs76(
26806
- "div",
26807
- {
26808
- style: {
26809
- display: "flex",
26810
- flexDirection: "column",
26811
- width: "100%",
26812
- height: "100%"
26813
- },
26814
- children: [
26815
- header,
26816
- /* @__PURE__ */ jsx105(
26817
- ColumnLayout,
26818
- {
26819
- menu,
26820
- header: leftTop,
26821
- left: thread_id ? /* @__PURE__ */ jsx105(Chating, { ...chatingProps }) : /* @__PURE__ */ jsx105("div", { children: "Please create a conversation first" }),
26822
- right: /* @__PURE__ */ jsx105(SideAppViewBrowser, {})
26823
- }
26824
- )
26825
- ]
26826
- }
26827
- ) })
26828
- }
26829
- );
26830
- };
26831
-
26832
- // src/components/Chat/AgentConversations.tsx
26833
- import { Conversations } from "@ant-design/x";
26834
- import { theme as theme14 } from "antd";
26835
- import { useMemo as useMemo27 } from "react";
26836
- import { jsx as jsx106 } from "react/jsx-runtime";
26837
- var AgentConversations = ({
26838
- enableThreadCreation = true,
26839
- enableThreadList = true
26840
- }) => {
26841
- const { token } = theme14.useToken();
26842
- const { currentAssistant } = useAssistantContext();
26843
- const {
26844
- assistantId,
26845
- thread,
26846
- selectThread,
26847
- createThread,
26848
- listThreads,
26849
- threads
26850
- } = useConversationContext();
26851
- const style = {
26852
- width: "100%",
26853
- background: "transparent",
26854
- borderRadius: token.borderRadius
26855
- };
26856
- const threadItems = useMemo27(() => {
26857
- return threads || [];
26858
- }, [threads]);
26859
- const items = threadItems.map((thread2) => ({
26860
- key: thread2.id,
26861
- label: thread2.label
26862
- }));
26863
- const newChatClick = async () => {
26864
- if (!assistantId) {
26865
- return;
26866
- }
26867
- await createThread();
26868
- };
26869
- if (!enableThreadList) {
26870
- return null;
26871
- }
26872
- const creation = enableThreadCreation ? {
26873
- onClick: newChatClick
26874
- } : void 0;
26875
- return /* @__PURE__ */ jsx106(
26876
- Conversations,
26877
- {
26878
- creation,
26879
- items,
26880
- activeKey: thread?.id,
26881
- style,
26882
- groupable: true,
26883
- onActiveChange: (key) => {
26884
- selectThread(key);
26885
- }
26886
- }
26887
- );
26888
- };
26889
-
26890
- // src/components/Chat/LatticeChatView.tsx
26891
- import { useContext as useContext11 } from "react";
26892
-
26893
- // src/components/Chat/ChatSidebar.tsx
26894
- import { useState as useState66, useMemo as useMemo29, useCallback as useCallback34 } from "react";
26895
- import { Drawer as Drawer2, Avatar as Avatar13, Popover as Popover3, Button as Button50 } from "antd";
26896
- import {
26897
- History,
26898
- LogOut as LogOut4,
26899
- FolderOpen as FolderOpen4,
26900
- PlusCircle,
26901
- PanelLeftClose as PanelLeftClose2,
26902
- Key as Key2
26903
- } from "lucide-react";
26885
+ // src/components/Chat/ToolPanelFiles.tsx
26886
+ import { useCallback as useCallback32, useEffect as useEffect40, useMemo as useMemo27, useState as useState65 } from "react";
26887
+ import { message as message17 } from "antd";
26904
26888
 
26905
- // src/components/Chat/ProjectsMenuContent.tsx
26906
- import { useState as useState65, useEffect as useEffect40, useCallback as useCallback32, useMemo as useMemo28, useRef as useRef25 } from "react";
26907
- import { Spin as Spin15, Modal as Modal18, Input as Input14, Button as Button49, message as message17 } from "antd";
26889
+ // src/components/Chat/FileDirectoryPanel.tsx
26890
+ import React58 from "react";
26891
+ import { Spin as Spin15 } from "antd";
26892
+ import { ChevronRight as ChevronRight7, FolderOpen as FolderOpen3, Upload } from "lucide-react";
26908
26893
  import { createStyles as createStyles32 } from "antd-style";
26909
- import { Upload } from "lucide-react";
26910
- import { Fragment as Fragment23, jsx as jsx107, jsxs as jsxs77 } from "react/jsx-runtime";
26911
- var PROJECT_NAME_MAX_LENGTH2 = 50;
26894
+ import { Fragment as Fragment22, jsx as jsx105, jsxs as jsxs76 } from "react/jsx-runtime";
26912
26895
  var useStyles19 = createStyles32(({ token, css }) => ({
26913
26896
  container: css`
26914
- padding: 4px;
26897
+ padding: 12px;
26915
26898
  font-size: 13px;
26916
26899
  background: transparent;
26917
26900
  `,
26901
+ header: css`
26902
+ display: flex;
26903
+ align-items: center;
26904
+ gap: 8px;
26905
+ margin-bottom: 12px;
26906
+ padding: 0 4px;
26907
+ font-size: 15px;
26908
+ line-height: 1.4;
26909
+ font-weight: 600;
26910
+ color: ${token.colorText};
26911
+ letter-spacing: -0.01em;
26912
+ padding-bottom: 8px;
26913
+ border-bottom: 1px solid ${token.colorBorderSecondary};
26914
+
26915
+ svg {
26916
+ width: 16px;
26917
+ height: 16px;
26918
+ color: ${token.colorTextSecondary};
26919
+ }
26920
+ `,
26918
26921
  section: css`
26919
26922
  margin-bottom: 12px;
26920
26923
  `,
@@ -26928,7 +26931,7 @@ var useStyles19 = createStyles32(({ token, css }) => ({
26928
26931
  sectionTitle: css`
26929
26932
  font-size: 10px;
26930
26933
  font-weight: 600;
26931
- letter-spacing: 0.5px;
26934
+ letter-spacing: 0.05em;
26932
26935
  color: ${token.colorTextSecondary};
26933
26936
  text-transform: uppercase;
26934
26937
  cursor: pointer;
@@ -26939,28 +26942,6 @@ var useStyles19 = createStyles32(({ token, css }) => ({
26939
26942
  color: ${token.colorPrimary};
26940
26943
  }
26941
26944
  `,
26942
- sectionAction: css`
26943
- display: flex;
26944
- align-items: center;
26945
- justify-content: center;
26946
- width: 20px;
26947
- height: 20px;
26948
- border-radius: 4px;
26949
- border: none;
26950
- background: transparent;
26951
- cursor: pointer;
26952
- transition: all 0.15s ease;
26953
-
26954
- &:hover {
26955
- background: ${token.colorBgTextHover};
26956
- }
26957
-
26958
- svg {
26959
- width: 14px;
26960
- height: 14px;
26961
- color: ${token.colorTextSecondary};
26962
- }
26963
- `,
26964
26945
  badge: css`
26965
26946
  display: flex;
26966
26947
  align-items: center;
@@ -26969,100 +26950,78 @@ var useStyles19 = createStyles32(({ token, css }) => ({
26969
26950
  height: 16px;
26970
26951
  padding: 0 4px;
26971
26952
  border-radius: 8px;
26972
- background: rgba(0, 0, 0, 0.06);
26953
+ background: ${token.colorFillSecondary};
26973
26954
  font-size: 10px;
26974
- font-weight: 600;
26955
+ font-weight: 500;
26975
26956
  color: ${token.colorTextSecondary};
26976
26957
  `,
26977
- projectList: css`
26958
+ assetList: css`
26978
26959
  display: flex;
26979
26960
  flex-direction: column;
26980
26961
  gap: 2px;
26981
26962
  `,
26982
- projectItem: css`
26963
+ assetItem: css`
26983
26964
  display: flex;
26984
26965
  align-items: center;
26985
26966
  gap: 8px;
26986
- padding: 6px 8px;
26987
- border-radius: 6px;
26967
+ width: 100%;
26968
+ padding: 5px 8px;
26969
+ border-radius: 4px;
26988
26970
  cursor: pointer;
26989
26971
  transition: all 0.15s ease;
26990
- border: 1px solid transparent;
26972
+ border: none;
26973
+ background: transparent;
26974
+ text-align: left;
26991
26975
 
26992
26976
  &:hover {
26993
26977
  background: ${token.colorBgTextHover};
26994
- border-color: ${token.colorBorder};
26995
- }
26996
-
26997
- &.active {
26998
- background: ${token.colorPrimaryBg};
26999
- border-color: ${token.colorPrimary};
27000
26978
  }
27001
26979
  `,
27002
- projectIcon: css`
26980
+ treeRow: css`
27003
26981
  display: flex;
27004
26982
  align-items: center;
26983
+ gap: 8px;
26984
+ width: 100%;
26985
+ `,
26986
+ treeIndent: css`
26987
+ flex-shrink: 0;
26988
+ width: 12px;
26989
+ `,
26990
+ treeToggle: css`
26991
+ display: inline-flex;
26992
+ align-items: center;
27005
26993
  justify-content: center;
26994
+ width: 18px;
26995
+ height: 18px;
26996
+ padding: 0;
26997
+ border: none;
26998
+ border-radius: 4px;
26999
+ background: transparent;
27000
+ color: ${token.colorTextSecondary};
27001
+ cursor: pointer;
27006
27002
 
27007
- svg {
27008
- width: 16px;
27009
- height: 16px;
27010
- color: ${token.colorPrimary};
27003
+ &:hover {
27004
+ background: ${token.colorBgTextHover};
27005
+ color: ${token.colorText};
27011
27006
  }
27012
27007
  `,
27013
- projectIconInactive: css`
27008
+ treeSpacer: css`
27009
+ flex-shrink: 0;
27010
+ width: 18px;
27011
+ height: 18px;
27012
+ `,
27013
+ assetIcon: css`
27014
27014
  display: flex;
27015
27015
  align-items: center;
27016
27016
  justify-content: center;
27017
+ width: 20px;
27018
+ height: 20px;
27019
+ border-radius: 4px;
27020
+ background: rgba(0, 0, 0, 0.04);
27017
27021
 
27018
27022
  svg {
27019
- width: 16px;
27020
- height: 16px;
27021
- color: ${token.colorTextSecondary};
27022
- }
27023
- `,
27024
- projectName: css`
27025
- font-size: 13px;
27026
- font-weight: 600;
27027
- color: ${token.colorPrimary};
27028
- flex: 1;
27029
- `,
27030
- projectNameInactive: css`
27031
- font-size: 13px;
27032
- font-weight: 500;
27033
- color: ${token.colorText};
27034
- flex: 1;
27035
- `,
27036
- assetList: css`
27037
- display: flex;
27038
- flex-direction: column;
27039
- gap: 2px;
27040
- `,
27041
- assetItem: css`
27042
- display: flex;
27043
- align-items: center;
27044
- gap: 8px;
27045
- padding: 5px 8px;
27046
- border-radius: 4px;
27047
- cursor: pointer;
27048
- transition: all 0.15s ease;
27049
-
27050
- &:hover {
27051
- background: ${token.colorBgTextHover};
27052
- }
27053
- `,
27054
- assetIcon: css`
27055
- display: flex;
27056
- align-items: center;
27057
- justify-content: center;
27058
- width: 20px;
27059
- height: 20px;
27060
- border-radius: 4px;
27061
- background: rgba(0, 0, 0, 0.04);
27062
-
27063
- svg {
27064
- width: 14px;
27065
- height: 14px;
27023
+ width: 14px;
27024
+ height: 14px;
27066
27025
  }
27067
27026
  `,
27068
27027
  assetInfo: css`
@@ -27081,6 +27040,11 @@ var useStyles19 = createStyles32(({ token, css }) => ({
27081
27040
  font-size: 10px;
27082
27041
  color: ${token.colorTextSecondary};
27083
27042
  `,
27043
+ treeChildren: css`
27044
+ display: flex;
27045
+ flex-direction: column;
27046
+ gap: 2px;
27047
+ `,
27084
27048
  emptyState: css`
27085
27049
  padding: 12px;
27086
27050
  text-align: center;
@@ -27124,262 +27088,245 @@ var useStyles19 = createStyles32(({ token, css }) => ({
27124
27088
  width: 14px;
27125
27089
  height: 14px;
27126
27090
  }
27127
- `,
27128
- projectSelector: css`
27129
- margin-bottom: 12px;
27130
- `,
27131
- projectTrigger: css`
27132
- display: flex;
27133
- align-items: center;
27134
- gap: 8px;
27135
- cursor: pointer;
27136
- padding: 8px;
27137
- border-radius: 8px;
27138
- transition: all 0.2s ease;
27139
- border: 1px solid transparent;
27140
-
27141
- &:hover {
27142
- background: ${token.colorBgTextHover};
27143
- border-color: ${token.colorBorder};
27144
- }
27145
- `,
27146
- projectTriggerIcon: css`
27147
- display: flex;
27148
- align-items: center;
27149
- justify-content: center;
27150
- width: 28px;
27151
- height: 28px;
27152
- border-radius: 6px;
27153
- background: ${token.colorPrimaryBg};
27154
-
27155
- svg {
27156
- width: 16px;
27157
- height: 16px;
27158
- color: ${token.colorPrimary};
27159
- }
27160
- `,
27161
- projectTriggerInfo: css`
27162
- flex: 1;
27163
- min-width: 0;
27164
- `,
27165
- projectTriggerName: css`
27166
- font-size: 13px;
27167
- font-weight: 600;
27168
- color: ${token.colorText};
27169
- white-space: nowrap;
27170
- overflow: hidden;
27171
- text-overflow: ellipsis;
27172
- `,
27173
- projectTriggerArrow: css`
27174
- display: flex;
27175
- align-items: center;
27176
-
27177
- svg {
27178
- width: 14px;
27179
- height: 14px;
27180
- color: ${token.colorTextSecondary};
27181
- transition: transform 0.2s ease;
27182
- }
27183
-
27184
- &.expanded svg {
27185
- transform: rotate(180deg);
27186
- }
27187
- `,
27188
- projectDropdown: css`
27189
- display: flex;
27190
- flex-direction: column;
27191
- gap: 2px;
27192
- margin-top: 4px;
27193
- padding: 4px;
27194
- background: ${token.colorBgContainer};
27195
- border-radius: 8px;
27196
- border: 1px solid ${token.colorBorder};
27197
- `,
27198
- projectDropdownItem: css`
27199
- display: flex;
27200
- align-items: center;
27201
- gap: 8px;
27202
- padding: 8px 10px;
27203
- border-radius: 6px;
27204
- cursor: pointer;
27205
- transition: all 0.15s ease;
27206
-
27207
- &:hover {
27208
- background: ${token.colorBgTextHover};
27209
- }
27210
-
27211
- &.active {
27212
- background: ${token.colorPrimaryBg};
27213
- }
27214
- `,
27215
- projectDropdownItemIcon: css`
27216
- display: flex;
27217
- align-items: center;
27218
- justify-content: center;
27219
-
27220
- svg {
27221
- width: 14px;
27222
- height: 14px;
27223
- color: ${token.colorTextSecondary};
27224
- }
27225
- `,
27226
- projectDropdownItemName: css`
27227
- font-size: 12px;
27228
- font-weight: 500;
27229
- color: ${token.colorText};
27230
- flex: 1;
27231
- `,
27232
- projectDropdownItemNameActive: css`
27233
- font-size: 12px;
27234
- font-weight: 600;
27235
- color: ${token.colorPrimary};
27236
- flex: 1;
27237
- `,
27238
- modalWrap: css`
27239
- .ant-modal-content {
27240
- border-radius: 12px;
27241
- overflow: hidden;
27242
- }
27243
- `,
27244
- formLabel: css`
27245
- display: block;
27246
- font-size: 13px;
27247
- font-weight: 600;
27248
- color: ${token.colorText};
27249
- margin-bottom: 8px;
27250
- `,
27251
- formInput: css`
27252
- border-radius: 8px;
27253
- `,
27254
- formError: css`
27255
- font-size: 12px;
27256
- color: ${token.colorError};
27257
- margin-top: 6px;
27258
- `,
27259
- modalFooter: css`
27260
- display: flex;
27261
- justify-content: flex-end;
27262
- gap: 8px;
27263
27091
  `
27264
27092
  }));
27265
- var ProjectsMenuContent = () => {
27093
+ var formatDate5 = (dateStr) => {
27094
+ if (!dateStr) return "";
27095
+ const date = new Date(dateStr);
27096
+ return date.toLocaleDateString("en-US", { month: "short", day: "numeric" });
27097
+ };
27098
+ var getFileName = (path) => {
27099
+ if (!path) return "";
27100
+ const parts = path.split(/[/\\]/);
27101
+ return parts[parts.length - 1];
27102
+ };
27103
+ var getEntryName = (entry) => getFileName(entry.name || entry.path);
27104
+ var FileDirectoryPanel = ({
27105
+ workspaceId,
27106
+ projectId,
27107
+ resourceFolders,
27108
+ folderEntries,
27109
+ folderLoading,
27110
+ directoryChildren,
27111
+ directoryLoading,
27112
+ directoryExpanded,
27113
+ uploadingFolder,
27114
+ onRefreshFolder,
27115
+ onUploadFolder,
27116
+ onToggleDirectory,
27117
+ onAssetClick
27118
+ }) => {
27266
27119
  const { styles } = useStyles19();
27120
+ const renderEntry = React58.useCallback((entry, depth) => {
27121
+ const entryName = getEntryName(entry);
27122
+ if (entry.is_dir) {
27123
+ const isExpanded = directoryExpanded[entry.path] || false;
27124
+ const children = directoryChildren[entry.path] || [];
27125
+ const isLoading = directoryLoading[entry.path] || false;
27126
+ return /* @__PURE__ */ jsxs76("div", { className: styles.treeChildren, children: [
27127
+ /* @__PURE__ */ jsxs76("div", { className: styles.treeRow, children: [
27128
+ Array.from({ length: depth }).map((_, index) => /* @__PURE__ */ jsx105("span", { className: styles.treeIndent }, `${entry.path}-indent-${index}`)),
27129
+ /* @__PURE__ */ jsx105(
27130
+ "button",
27131
+ {
27132
+ type: "button",
27133
+ className: styles.treeToggle,
27134
+ "aria-label": `${isExpanded ? "collapse" : "expand"} ${entryName}`,
27135
+ onClick: () => void onToggleDirectory(entry.path),
27136
+ children: /* @__PURE__ */ jsx105(ChevronRight7, { size: 14, style: { transform: isExpanded ? "rotate(90deg)" : void 0 } })
27137
+ }
27138
+ ),
27139
+ /* @__PURE__ */ jsxs76(
27140
+ "button",
27141
+ {
27142
+ type: "button",
27143
+ className: styles.assetItem,
27144
+ "aria-label": `toggle ${entryName}`,
27145
+ onClick: () => void onToggleDirectory(entry.path),
27146
+ title: entryName,
27147
+ children: [
27148
+ /* @__PURE__ */ jsx105("div", { className: styles.assetIcon, children: /* @__PURE__ */ jsx105(FolderOpen3, { size: 14 }) }),
27149
+ /* @__PURE__ */ jsx105("div", { className: styles.assetInfo, children: /* @__PURE__ */ jsx105("div", { className: styles.assetName, children: entryName }) })
27150
+ ]
27151
+ }
27152
+ )
27153
+ ] }),
27154
+ isExpanded ? isLoading ? /* @__PURE__ */ jsx105("div", { className: styles.loading, children: /* @__PURE__ */ jsx105(Spin15, { size: "small" }) }) : children.length > 0 ? children.map((child) => renderEntry(child, depth + 1)) : /* @__PURE__ */ jsx105("div", { className: styles.emptyState, children: "No files in this folder" }) : null
27155
+ ] }, entry.path);
27156
+ }
27157
+ return /* @__PURE__ */ jsxs76("div", { className: styles.treeRow, children: [
27158
+ Array.from({ length: depth }).map((_, index) => /* @__PURE__ */ jsx105("span", { className: styles.treeIndent }, `${entry.path}-indent-${index}`)),
27159
+ /* @__PURE__ */ jsx105("span", { className: styles.treeSpacer }),
27160
+ /* @__PURE__ */ jsxs76(
27161
+ "button",
27162
+ {
27163
+ type: "button",
27164
+ className: styles.assetItem,
27165
+ onClick: () => onAssetClick(entry),
27166
+ "aria-label": `open ${entryName}`,
27167
+ title: entryName,
27168
+ children: [
27169
+ /* @__PURE__ */ jsx105("div", { className: styles.assetIcon, children: getFileIcon2(entryName) }),
27170
+ /* @__PURE__ */ jsxs76("div", { className: styles.assetInfo, children: [
27171
+ /* @__PURE__ */ jsx105("div", { className: styles.assetName, children: entryName }),
27172
+ /* @__PURE__ */ jsx105("div", { className: styles.assetMeta, children: formatDate5(entry.modified_at) })
27173
+ ] })
27174
+ ]
27175
+ }
27176
+ )
27177
+ ] }, entry.path);
27178
+ }, [directoryChildren, directoryExpanded, directoryLoading, onAssetClick, onToggleDirectory, styles]);
27179
+ if (!projectId) {
27180
+ return /* @__PURE__ */ jsx105("div", { className: styles.emptyState, children: "Please select a project to browse files" });
27181
+ }
27182
+ return /* @__PURE__ */ jsxs76("div", { className: styles.container, children: [
27183
+ /* @__PURE__ */ jsxs76("h3", { className: styles.header, children: [
27184
+ /* @__PURE__ */ jsx105(FolderOpen3, { size: 16 }),
27185
+ /* @__PURE__ */ jsx105("span", { children: "Files" })
27186
+ ] }),
27187
+ resourceFolders.map((folder) => {
27188
+ const entries = folderEntries[folder.name] || [];
27189
+ const isLoading = folderLoading[folder.name] || false;
27190
+ const itemCount = entries.length;
27191
+ return /* @__PURE__ */ jsxs76("div", { className: styles.section, children: [
27192
+ /* @__PURE__ */ jsxs76("div", { className: styles.sectionHeader, children: [
27193
+ /* @__PURE__ */ jsx105(
27194
+ "span",
27195
+ {
27196
+ className: styles.sectionTitle,
27197
+ onClick: () => void onRefreshFolder(folder),
27198
+ title: "Click to refresh",
27199
+ children: folder.displayName || folder.name
27200
+ }
27201
+ ),
27202
+ /* @__PURE__ */ jsx105("span", { className: styles.badge, children: itemCount })
27203
+ ] }),
27204
+ isLoading ? /* @__PURE__ */ jsx105("div", { className: styles.loading, children: /* @__PURE__ */ jsx105(Spin15, { size: "small" }) }) : /* @__PURE__ */ jsxs76("div", { className: styles.assetList, children: [
27205
+ entries.map((entry) => renderEntry(entry, 0)),
27206
+ entries.length === 0 ? /* @__PURE__ */ jsx105("div", { className: styles.emptyState, children: "No files in this folder" }) : null,
27207
+ folder.allowUpload ? /* @__PURE__ */ jsx105(
27208
+ "button",
27209
+ {
27210
+ type: "button",
27211
+ className: styles.uploadBtn,
27212
+ onClick: () => void onUploadFolder(folder.name),
27213
+ disabled: !workspaceId || !projectId || uploadingFolder === folder.name,
27214
+ children: uploadingFolder === folder.name ? /* @__PURE__ */ jsxs76(Fragment22, { children: [
27215
+ /* @__PURE__ */ jsx105(Spin15, { size: "small" }),
27216
+ /* @__PURE__ */ jsx105("span", { children: "Uploading..." })
27217
+ ] }) : /* @__PURE__ */ jsxs76(Fragment22, { children: [
27218
+ /* @__PURE__ */ jsx105(Upload, { size: 14 }),
27219
+ /* @__PURE__ */ jsx105("span", { children: "Upload" })
27220
+ ] })
27221
+ }
27222
+ ) : null
27223
+ ] })
27224
+ ] }, folder.name);
27225
+ })
27226
+ ] });
27227
+ };
27228
+
27229
+ // src/components/Chat/ToolPanelFiles.tsx
27230
+ import { jsx as jsx106 } from "react/jsx-runtime";
27231
+ var ToolPanelFiles = () => {
27267
27232
  const { config } = useLatticeChatShellContext();
27268
27233
  const { openSideApp } = useChatUIContext();
27269
27234
  const {
27270
27235
  workspaceId,
27271
27236
  projectId,
27272
- projects,
27273
- setProject,
27237
+ listPath,
27274
27238
  listPathByFolder,
27275
- createProject,
27276
27239
  getFileViewUrl,
27277
27240
  uploadFileToFolder
27278
27241
  } = useWorkspaceContext();
27279
- const [folderAssets, setFolderAssets] = useState65({});
27242
+ const [folderEntries, setFolderEntries] = useState65({});
27280
27243
  const [folderLoading, setFolderLoading] = useState65({});
27281
- const [isProjectListOpen, setIsProjectListOpen] = useState65(false);
27244
+ const [directoryChildren, setDirectoryChildren] = useState65({});
27245
+ const [directoryLoading, setDirectoryLoading] = useState65({});
27246
+ const [directoryExpanded, setDirectoryExpanded] = useState65({});
27282
27247
  const [uploadingFolder, setUploadingFolder] = useState65(null);
27283
- const [isModalOpen, setIsModalOpen] = useState65(false);
27284
- const [projectName, setProjectName] = useState65("");
27285
- const [validationError, setValidationError] = useState65(null);
27286
- const [isCreating, setIsCreating] = useState65(false);
27287
- const projectNameInputRef = useRef25(null);
27288
- const resourceFolders = useMemo28(() => {
27248
+ const resourceFolders = useMemo27(() => {
27289
27249
  return config.resourceFolders && config.resourceFolders.length > 0 ? config.resourceFolders : [{ name: "/", displayName: "Project Assets", allowUpload: true }];
27290
27250
  }, [config.resourceFolders]);
27291
- const currentProject = useMemo28(() => {
27292
- return projects.find((p) => p.id === projectId);
27293
- }, [projects, projectId]);
27294
27251
  const loadAssetsForFolder = useCallback32(async (folder) => {
27295
27252
  if (!workspaceId || !projectId) {
27296
- setFolderAssets((prev) => ({ ...prev, [folder.name]: [] }));
27253
+ setFolderEntries((prev) => ({ ...prev, [folder.name]: [] }));
27297
27254
  return;
27298
27255
  }
27299
27256
  setFolderLoading((prev) => ({ ...prev, [folder.name]: true }));
27300
27257
  try {
27301
27258
  const items = await listPathByFolder(folder.name);
27302
- setFolderAssets((prev) => ({ ...prev, [folder.name]: items.filter((item) => !item.is_dir) }));
27259
+ setFolderEntries((prev) => ({ ...prev, [folder.name]: items }));
27260
+ setDirectoryChildren((prev) => {
27261
+ const next = { ...prev };
27262
+ const folderPath = folder.name === "/" ? "/" : folder.name.replace(/\/$/, "");
27263
+ Object.keys(next).forEach((key) => {
27264
+ if (key === folderPath || key.startsWith(`${folderPath}/`)) {
27265
+ delete next[key];
27266
+ }
27267
+ });
27268
+ return next;
27269
+ });
27270
+ setDirectoryExpanded((prev) => {
27271
+ const next = { ...prev };
27272
+ const folderPath = folder.name === "/" ? "/" : folder.name.replace(/\/$/, "");
27273
+ Object.keys(next).forEach((key) => {
27274
+ if (key === folderPath || key.startsWith(`${folderPath}/`)) {
27275
+ delete next[key];
27276
+ }
27277
+ });
27278
+ return next;
27279
+ });
27303
27280
  } catch (error) {
27304
27281
  console.error(`Failed to load assets for folder ${folder.name}:`, error);
27305
- setFolderAssets((prev) => ({ ...prev, [folder.name]: [] }));
27282
+ setFolderEntries((prev) => ({ ...prev, [folder.name]: [] }));
27306
27283
  } finally {
27307
27284
  setFolderLoading((prev) => ({ ...prev, [folder.name]: false }));
27308
27285
  }
27309
27286
  }, [workspaceId, projectId, listPathByFolder]);
27310
- useEffect40(() => {
27311
- resourceFolders.forEach((folder) => {
27312
- loadAssetsForFolder(folder);
27313
- });
27314
- }, [workspaceId, projectId, loadAssetsForFolder, resourceFolders]);
27315
- const handleSelectProject = useCallback32((selectedProjectId) => {
27316
- setProject(selectedProjectId);
27317
- setIsProjectListOpen(false);
27318
- }, [setProject]);
27319
- const toggleProjectList = useCallback32(() => {
27320
- setIsProjectListOpen((prev) => !prev);
27321
- }, []);
27322
- const validateProjectName = useCallback32((name) => {
27323
- const trimmed = name.trim();
27324
- if (!trimmed) return "Project name is required";
27325
- if (trimmed.length > PROJECT_NAME_MAX_LENGTH2) {
27326
- return `Name must be ${PROJECT_NAME_MAX_LENGTH2} characters or less`;
27327
- }
27328
- return null;
27329
- }, []);
27330
- const handleOpenModal = useCallback32(() => {
27331
- if (!workspaceId) {
27332
- message17.warning("Please select a workspace first");
27287
+ const handleToggleDirectory = useCallback32(async (path) => {
27288
+ const isExpanded = directoryExpanded[path] || false;
27289
+ if (isExpanded) {
27290
+ setDirectoryExpanded((prev) => ({ ...prev, [path]: false }));
27333
27291
  return;
27334
27292
  }
27335
- setProjectName("");
27336
- setValidationError(null);
27337
- setIsModalOpen(true);
27338
- setTimeout(() => projectNameInputRef.current?.input?.focus(), 100);
27339
- }, [workspaceId]);
27340
- const handleCloseModal = useCallback32(() => {
27341
- setIsModalOpen(false);
27342
- setProjectName("");
27343
- setValidationError(null);
27344
- }, []);
27345
- const handleProjectNameChange = (e) => {
27346
- const value = e.target.value;
27347
- setProjectName(value);
27348
- setValidationError(validateProjectName(value));
27349
- };
27350
- const handleCreateProject = useCallback32(async () => {
27351
- if (!workspaceId) return;
27352
- const trimmed = projectName.trim();
27353
- const error = validateProjectName(trimmed);
27354
- if (error) {
27355
- setValidationError(error);
27293
+ setDirectoryExpanded((prev) => ({ ...prev, [path]: true }));
27294
+ if (directoryChildren[path]) {
27356
27295
  return;
27357
27296
  }
27358
- setIsCreating(true);
27359
- setValidationError(null);
27297
+ setDirectoryLoading((prev) => ({ ...prev, [path]: true }));
27360
27298
  try {
27361
- const project = await createProject(workspaceId, { name: trimmed });
27362
- setIsModalOpen(false);
27363
- setProjectName("");
27364
- setValidationError(null);
27365
- setProject(project.id);
27366
- message17.success(`Project "${project.name}" created`);
27367
- } catch (err) {
27368
- const errMsg = err instanceof Error ? err.message : "Failed to create project";
27369
- setValidationError(errMsg);
27299
+ const items = await listPath(path);
27300
+ setDirectoryChildren((prev) => ({ ...prev, [path]: items }));
27301
+ } catch (error) {
27302
+ console.error(`Failed to load directory ${path}:`, error);
27303
+ setDirectoryChildren((prev) => ({ ...prev, [path]: [] }));
27370
27304
  } finally {
27371
- setIsCreating(false);
27305
+ setDirectoryLoading((prev) => ({ ...prev, [path]: false }));
27372
27306
  }
27373
- }, [workspaceId, projectName, validateProjectName, createProject, setProject]);
27374
- const handleModalKeyDown = (e) => {
27375
- if (e.key === "Enter" && !e.shiftKey) {
27376
- e.preventDefault();
27377
- const error = validateProjectName(projectName.trim());
27378
- if (!error) handleCreateProject();
27307
+ }, [directoryChildren, directoryExpanded, listPath]);
27308
+ useEffect40(() => {
27309
+ resourceFolders.forEach((folder) => {
27310
+ void loadAssetsForFolder(folder);
27311
+ });
27312
+ }, [resourceFolders, loadAssetsForFolder]);
27313
+ const handleAssetClick = useCallback32((asset) => {
27314
+ const fileUrl = getFileViewUrl(asset.path);
27315
+ if (!fileUrl) {
27316
+ message17.warning("Please select a workspace and project first.");
27317
+ return;
27379
27318
  }
27380
- };
27381
- const isProjectNameValid = !validateProjectName(projectName.trim());
27382
- const handleUploadClick = async (folderName) => {
27319
+ openSideApp({
27320
+ component_key: "attachments",
27321
+ data: {
27322
+ file_id: asset.path,
27323
+ message: `Preview: ${asset.name || asset.path}`,
27324
+ full_url: fileUrl
27325
+ },
27326
+ message: `Preview: ${asset.name || asset.path}`
27327
+ });
27328
+ }, [getFileViewUrl, openSideApp]);
27329
+ const handleUploadFolder = useCallback32(async (folderName) => {
27383
27330
  if (!workspaceId || !projectId) {
27384
27331
  message17.warning("Please select a workspace and project before uploading.");
27385
27332
  return;
@@ -27396,7 +27343,7 @@ var ProjectsMenuContent = () => {
27396
27343
  try {
27397
27344
  await uploadFileToFolder(folderName, file);
27398
27345
  message17.success(`Uploaded "${file.name}" successfully`);
27399
- const folder = resourceFolders.find((f) => f.name === folderName);
27346
+ const folder = resourceFolders.find((item) => item.name === folderName);
27400
27347
  if (folder) {
27401
27348
  await loadAssetsForFolder(folder);
27402
27349
  }
@@ -27409,143 +27356,232 @@ var ProjectsMenuContent = () => {
27409
27356
  }
27410
27357
  };
27411
27358
  input.click();
27412
- };
27413
- const handleAssetClick = (asset) => {
27414
- const fileUrl = getFileViewUrl(asset.path);
27415
- if (!fileUrl) {
27416
- message17.warning("Please select a workspace and project first.");
27417
- return;
27359
+ }, [workspaceId, projectId, uploadFileToFolder, resourceFolders, loadAssetsForFolder]);
27360
+ return /* @__PURE__ */ jsx106(
27361
+ FileDirectoryPanel,
27362
+ {
27363
+ workspaceId,
27364
+ projectId,
27365
+ resourceFolders,
27366
+ folderEntries,
27367
+ folderLoading,
27368
+ directoryChildren,
27369
+ directoryLoading,
27370
+ directoryExpanded,
27371
+ uploadingFolder,
27372
+ onRefreshFolder: loadAssetsForFolder,
27373
+ onUploadFolder: handleUploadFolder,
27374
+ onToggleDirectory: handleToggleDirectory,
27375
+ onAssetClick: handleAssetClick
27418
27376
  }
27419
- openSideApp({
27420
- component_key: "attachments",
27421
- data: {
27422
- file_id: asset.path,
27423
- message: `Preview: ${asset.name || asset.path}`,
27424
- full_url: fileUrl
27425
- },
27426
- message: `Preview: ${asset.name || asset.path}`
27427
- });
27428
- };
27429
- const formatDate5 = (dateStr) => {
27430
- if (!dateStr) return "";
27431
- const date = new Date(dateStr);
27432
- return date.toLocaleDateString("en-US", { month: "short", day: "numeric" });
27433
- };
27434
- const getFileName = (path) => {
27435
- if (!path) return "";
27436
- const parts = path.split(/[/\\]/);
27437
- return parts[parts.length - 1];
27438
- };
27439
- return /* @__PURE__ */ jsxs77("div", { className: styles.container, children: [
27440
- resourceFolders.map((folder) => {
27441
- const assets = folderAssets[folder.name] || [];
27442
- const isLoading = folderLoading[folder.name] || false;
27443
- return /* @__PURE__ */ jsxs77("div", { className: styles.section, children: [
27444
- /* @__PURE__ */ jsxs77("div", { className: styles.sectionHeader, children: [
27445
- /* @__PURE__ */ jsx107(
27446
- "span",
27447
- {
27448
- className: styles.sectionTitle,
27449
- onClick: () => loadAssetsForFolder(folder),
27450
- title: "Click to refresh",
27451
- children: folder.displayName || folder.name
27452
- }
27453
- ),
27454
- /* @__PURE__ */ jsx107("span", { className: styles.badge, children: assets.length })
27455
- ] }),
27456
- isLoading ? /* @__PURE__ */ jsx107("div", { className: styles.loading, children: /* @__PURE__ */ jsx107(Spin15, { size: "small" }) }) : /* @__PURE__ */ jsxs77("div", { className: styles.assetList, children: [
27457
- assets.map((asset) => /* @__PURE__ */ jsxs77(
27458
- "div",
27459
- {
27460
- className: styles.assetItem,
27461
- onClick: () => handleAssetClick(asset),
27462
- title: getFileName(asset.name || asset.path),
27463
- children: [
27464
- /* @__PURE__ */ jsx107("div", { className: styles.assetIcon, children: getFileIcon2(getFileName(asset.name || asset.path)) }),
27465
- /* @__PURE__ */ jsxs77("div", { className: styles.assetInfo, children: [
27466
- /* @__PURE__ */ jsx107("div", { className: styles.assetName, children: getFileName(asset.name || asset.path) }),
27467
- /* @__PURE__ */ jsx107("div", { className: styles.assetMeta, children: formatDate5(asset.modified_at) })
27468
- ] })
27469
- ]
27470
- },
27471
- asset.path
27472
- )),
27473
- assets.length === 0 && /* @__PURE__ */ jsx107("div", { className: styles.emptyState, children: "No files in this folder" }),
27474
- folder.allowUpload && /* @__PURE__ */ jsx107(
27475
- "button",
27476
- {
27477
- type: "button",
27478
- className: styles.uploadBtn,
27479
- onClick: () => handleUploadClick(folder.name),
27480
- disabled: !workspaceId || !projectId || uploadingFolder === folder.name,
27481
- children: uploadingFolder === folder.name ? /* @__PURE__ */ jsxs77(Fragment23, { children: [
27482
- /* @__PURE__ */ jsx107(Spin15, { size: "small" }),
27483
- /* @__PURE__ */ jsx107("span", { children: "Uploading..." })
27484
- ] }) : /* @__PURE__ */ jsxs77(Fragment23, { children: [
27485
- /* @__PURE__ */ jsx107(Upload, { size: 14 }),
27486
- /* @__PURE__ */ jsx107("span", { children: "Upload" })
27487
- ] })
27488
- }
27489
- )
27490
- ] })
27491
- ] }, folder.name);
27492
- }),
27493
- /* @__PURE__ */ jsxs77(
27494
- Modal18,
27495
- {
27496
- title: "Create New Project",
27497
- open: isModalOpen,
27498
- onCancel: handleCloseModal,
27499
- wrapClassName: styles.modalWrap,
27500
- centered: true,
27501
- destroyOnClose: true,
27502
- maskClosable: !isCreating,
27503
- keyboard: true,
27504
- closable: true,
27505
- footer: /* @__PURE__ */ jsxs77("div", { className: styles.modalFooter, children: [
27506
- /* @__PURE__ */ jsx107(Button49, { onClick: handleCloseModal, disabled: isCreating, children: "Cancel" }),
27507
- /* @__PURE__ */ jsx107(
27508
- Button49,
27509
- {
27510
- type: "primary",
27511
- onClick: handleCreateProject,
27512
- disabled: !isProjectNameValid,
27513
- loading: isCreating,
27514
- children: "Create Project"
27515
- }
27516
- )
27517
- ] }),
27518
- children: [
27519
- /* @__PURE__ */ jsx107("label", { className: styles.formLabel, htmlFor: "project-name", children: "Project Name" }),
27520
- /* @__PURE__ */ jsx107(
27521
- Input14,
27522
- {
27523
- id: "project-name",
27524
- ref: projectNameInputRef,
27525
- className: styles.formInput,
27526
- placeholder: "e.g., Q4 Analysis, Marketing Campaign...",
27527
- value: projectName,
27528
- onChange: handleProjectNameChange,
27529
- onKeyDown: handleModalKeyDown,
27530
- maxLength: PROJECT_NAME_MAX_LENGTH2,
27531
- status: validationError ? "error" : void 0,
27532
- disabled: isCreating
27533
- }
27534
- ),
27535
- validationError && /* @__PURE__ */ jsx107("div", { className: styles.formError, role: "alert", children: validationError })
27536
- ]
27377
+ );
27378
+ };
27379
+
27380
+ // src/components/Chat/HeaderIconButton.tsx
27381
+ import { Button as Button49 } from "antd";
27382
+ import { createStyles as createStyles33 } from "antd-style";
27383
+ import { jsx as jsx107 } from "react/jsx-runtime";
27384
+ var useStyles20 = createStyles33(({ token, css }) => ({
27385
+ button: css`
27386
+ display: inline-flex;
27387
+ align-items: center;
27388
+ justify-content: center;
27389
+ width: 32px;
27390
+ height: 32px;
27391
+ border-radius: 8px;
27392
+ border: 1px solid transparent;
27393
+ background: transparent;
27394
+ color: inherit;
27395
+ transition: all 0.2s ease;
27396
+
27397
+ &:hover {
27398
+ background: ${token.colorBgTextHover};
27399
+ border-color: ${token.colorBorderSecondary};
27400
+ }
27401
+
27402
+ &[aria-pressed="true"] {
27403
+ background: ${token.colorBgTextHover};
27404
+ border-color: ${token.colorBorderSecondary};
27405
+ }
27406
+ `
27407
+ }));
27408
+ var HeaderIconButton = ({
27409
+ ariaLabel,
27410
+ icon,
27411
+ onClick,
27412
+ pressed = false
27413
+ }) => {
27414
+ const { styles } = useStyles20();
27415
+ return /* @__PURE__ */ jsx107(
27416
+ Button49,
27417
+ {
27418
+ type: "text",
27419
+ size: "small",
27420
+ className: styles.button,
27421
+ icon,
27422
+ onClick,
27423
+ "aria-label": ariaLabel,
27424
+ "aria-pressed": pressed
27425
+ }
27426
+ );
27427
+ };
27428
+
27429
+ // src/components/Chat/LatticeChat.tsx
27430
+ import { jsx as jsx108, jsxs as jsxs77 } from "react/jsx-runtime";
27431
+ var useStyles21 = createStyles34(({ css }) => ({
27432
+ wrapper: css`
27433
+ display: flex;
27434
+ flex-direction: column;
27435
+ width: 100%;
27436
+ height: 100%;
27437
+ `,
27438
+ headerBar: css`
27439
+ display: flex;
27440
+ align-items: center;
27441
+ justify-content: space-between;
27442
+ gap: 12px;
27443
+ width: 100%;
27444
+ `,
27445
+ headerLeft: css`
27446
+ display: flex;
27447
+ align-items: center;
27448
+ min-width: 0;
27449
+ flex: 1;
27450
+ `,
27451
+ headerRight: css`
27452
+ display: flex;
27453
+ align-items: center;
27454
+ justify-content: flex-end;
27455
+ flex-shrink: 0;
27456
+ `
27457
+ }));
27458
+ var LatticeChatContent = (props) => {
27459
+ const { assistant_id: _assistantId, thread_id = "", menu, header, ...chatingProps } = props;
27460
+ const { config } = useLatticeChatShellContext();
27461
+ const { styles } = useStyles21();
27462
+ const { toolsVisible, toggleTools } = useChatUIContext();
27463
+ const showWorkspaceSelector = config.enableWorkspace;
27464
+ const layoutHeader = /* @__PURE__ */ jsxs77("div", { className: styles.headerBar, children: [
27465
+ /* @__PURE__ */ jsx108("div", { className: styles.headerLeft, children: showWorkspaceSelector ? /* @__PURE__ */ jsx108(ProjectSelector, {}) : null }),
27466
+ /* @__PURE__ */ jsx108("div", { className: styles.headerRight, children: /* @__PURE__ */ jsx108(
27467
+ HeaderIconButton,
27468
+ {
27469
+ ariaLabel: "Toggle file directory",
27470
+ icon: /* @__PURE__ */ jsx108(FolderOpen4, { size: 16 }),
27471
+ onClick: toggleTools,
27472
+ pressed: toolsVisible
27473
+ }
27474
+ ) })
27475
+ ] });
27476
+ return /* @__PURE__ */ jsxs77("div", { className: styles.wrapper, children: [
27477
+ header,
27478
+ /* @__PURE__ */ jsx108(
27479
+ ColumnLayout,
27480
+ {
27481
+ menu,
27482
+ header: layoutHeader,
27483
+ main: thread_id ? /* @__PURE__ */ jsx108(Chating, { ...chatingProps }) : /* @__PURE__ */ jsx108("div", { children: "Please create a conversation first" }),
27484
+ detail: /* @__PURE__ */ jsx108(SideAppViewBrowser, {}),
27485
+ tools: /* @__PURE__ */ jsx108(ToolPanelFiles, {})
27537
27486
  }
27538
27487
  )
27539
27488
  ] });
27540
27489
  };
27490
+ var LatticeChat = (props) => {
27491
+ return /* @__PURE__ */ jsx108(
27492
+ AgentThreadProvider,
27493
+ {
27494
+ assistantId: props.assistant_id,
27495
+ threadId: props.thread_id || "",
27496
+ options: {
27497
+ streaming: true,
27498
+ enableReturnStateWhenStreamCompleted: true,
27499
+ enableResumeStream: true
27500
+ },
27501
+ children: /* @__PURE__ */ jsx108(ChatUIContextProvider, { children: /* @__PURE__ */ jsx108(LatticeChatContent, { ...props }) })
27502
+ }
27503
+ );
27504
+ };
27505
+
27506
+ // src/components/Chat/AgentConversations.tsx
27507
+ import { Conversations } from "@ant-design/x";
27508
+ import { theme as theme14 } from "antd";
27509
+ import { useMemo as useMemo28 } from "react";
27510
+ import { jsx as jsx109 } from "react/jsx-runtime";
27511
+ var AgentConversations = ({
27512
+ enableThreadCreation = true,
27513
+ enableThreadList = true
27514
+ }) => {
27515
+ const { token } = theme14.useToken();
27516
+ const { currentAssistant } = useAssistantContext();
27517
+ const {
27518
+ assistantId,
27519
+ thread,
27520
+ selectThread,
27521
+ createThread,
27522
+ listThreads,
27523
+ threads
27524
+ } = useConversationContext();
27525
+ const style = {
27526
+ width: "100%",
27527
+ background: "transparent",
27528
+ borderRadius: token.borderRadius
27529
+ };
27530
+ const threadItems = useMemo28(() => {
27531
+ return threads || [];
27532
+ }, [threads]);
27533
+ const items = threadItems.map((thread2) => ({
27534
+ key: thread2.id,
27535
+ label: thread2.label
27536
+ }));
27537
+ const newChatClick = async () => {
27538
+ if (!assistantId) {
27539
+ return;
27540
+ }
27541
+ await createThread();
27542
+ };
27543
+ if (!enableThreadList) {
27544
+ return null;
27545
+ }
27546
+ const creation = enableThreadCreation ? {
27547
+ onClick: newChatClick
27548
+ } : void 0;
27549
+ return /* @__PURE__ */ jsx109(
27550
+ Conversations,
27551
+ {
27552
+ creation,
27553
+ items,
27554
+ activeKey: thread?.id,
27555
+ style,
27556
+ groupable: true,
27557
+ onActiveChange: (key) => {
27558
+ selectThread(key);
27559
+ }
27560
+ }
27561
+ );
27562
+ };
27563
+
27564
+ // src/components/Chat/LatticeChatView.tsx
27565
+ import { useContext as useContext11 } from "react";
27566
+
27567
+ // src/components/Chat/ChatSidebar.tsx
27568
+ import { useState as useState66, useMemo as useMemo29, useCallback as useCallback34 } from "react";
27569
+ import { Drawer as Drawer2, Avatar as Avatar13, Popover as Popover3, Button as Button50 } from "antd";
27570
+ import {
27571
+ History,
27572
+ LogOut as LogOut4,
27573
+ PlusCircle,
27574
+ PanelLeftClose as PanelLeftClose2,
27575
+ Key as Key2
27576
+ } from "lucide-react";
27541
27577
 
27542
27578
  // src/components/Chat/ThreadHistoryMenuContent.tsx
27543
- import React59, { useCallback as useCallback33 } from "react";
27544
- import { createStyles as createStyles33 } from "antd-style";
27579
+ import React61, { useCallback as useCallback33 } from "react";
27580
+ import { createStyles as createStyles35 } from "antd-style";
27545
27581
  import { MessageSquare as MessageSquare2, Trash2 as Trash24 } from "lucide-react";
27546
- import { message as message18, Modal as Modal19 } from "antd";
27547
- import { jsx as jsx108, jsxs as jsxs78 } from "react/jsx-runtime";
27548
- var useStyles20 = createStyles33(({ token, css }) => ({
27582
+ import { message as message18, Modal as Modal18 } from "antd";
27583
+ import { jsx as jsx110, jsxs as jsxs78 } from "react/jsx-runtime";
27584
+ var useStyles22 = createStyles35(({ token, css }) => ({
27549
27585
  container: css`
27550
27586
  padding: 4px;
27551
27587
  font-size: 13px;
@@ -27646,7 +27682,7 @@ var useStyles20 = createStyles33(({ token, css }) => ({
27646
27682
  `
27647
27683
  }));
27648
27684
  var ThreadHistoryMenuContent = () => {
27649
- const { styles } = useStyles20();
27685
+ const { styles } = useStyles22();
27650
27686
  const {
27651
27687
  threads,
27652
27688
  threadId,
@@ -27657,7 +27693,7 @@ var ThreadHistoryMenuContent = () => {
27657
27693
  const handleDeleteThread = useCallback33(
27658
27694
  async (e, threadIdToDelete) => {
27659
27695
  e.stopPropagation();
27660
- Modal19.confirm({
27696
+ Modal18.confirm({
27661
27697
  title: "Delete Conversation",
27662
27698
  content: "Are you sure you want to delete this conversation? This action cannot be undone.",
27663
27699
  okText: "Delete",
@@ -27675,7 +27711,7 @@ var ThreadHistoryMenuContent = () => {
27675
27711
  },
27676
27712
  [deleteThread]
27677
27713
  );
27678
- const sortedThreads = React59.useMemo(() => {
27714
+ const sortedThreads = React61.useMemo(() => {
27679
27715
  return [...threads].sort((a, b) => {
27680
27716
  const dateA = a.updatedAt ? new Date(a.updatedAt).getTime() : 0;
27681
27717
  const dateB = b.updatedAt ? new Date(b.updatedAt).getTime() : 0;
@@ -27683,30 +27719,30 @@ var ThreadHistoryMenuContent = () => {
27683
27719
  });
27684
27720
  }, [threads]);
27685
27721
  if (isLoading) {
27686
- return /* @__PURE__ */ jsx108("div", { className: styles.container, children: /* @__PURE__ */ jsx108("div", { className: styles.loading, children: "Loading conversations..." }) });
27722
+ return /* @__PURE__ */ jsx110("div", { className: styles.container, children: /* @__PURE__ */ jsx110("div", { className: styles.loading, children: "Loading conversations..." }) });
27687
27723
  }
27688
- return /* @__PURE__ */ jsx108("div", { className: styles.container, children: sortedThreads.length === 0 ? /* @__PURE__ */ jsx108("div", { className: styles.emptyState, children: "No conversations yet" }) : /* @__PURE__ */ jsx108("div", { className: styles.threadList, children: sortedThreads.map((thread) => /* @__PURE__ */ jsxs78(
27724
+ return /* @__PURE__ */ jsx110("div", { className: styles.container, children: sortedThreads.length === 0 ? /* @__PURE__ */ jsx110("div", { className: styles.emptyState, children: "No conversations yet" }) : /* @__PURE__ */ jsx110("div", { className: styles.threadList, children: sortedThreads.map((thread) => /* @__PURE__ */ jsxs78(
27689
27725
  "div",
27690
27726
  {
27691
27727
  className: `${styles.threadItem} ${thread.id === threadId ? "active" : ""}`,
27692
27728
  onClick: () => selectThread(thread.id),
27693
27729
  title: thread.label,
27694
27730
  children: [
27695
- /* @__PURE__ */ jsx108("div", { className: styles.threadIcon, children: /* @__PURE__ */ jsx108(MessageSquare2, { size: 14 }) }),
27696
- /* @__PURE__ */ jsx108(
27731
+ /* @__PURE__ */ jsx110("div", { className: styles.threadIcon, children: /* @__PURE__ */ jsx110(MessageSquare2, { size: 14 }) }),
27732
+ /* @__PURE__ */ jsx110(
27697
27733
  "div",
27698
27734
  {
27699
27735
  className: thread.id === threadId ? styles.threadNameActive : styles.threadName,
27700
27736
  children: thread.label
27701
27737
  }
27702
27738
  ),
27703
- /* @__PURE__ */ jsx108(
27739
+ /* @__PURE__ */ jsx110(
27704
27740
  "button",
27705
27741
  {
27706
27742
  className: styles.deleteBtn,
27707
27743
  onClick: (e) => handleDeleteThread(e, thread.id),
27708
27744
  title: "Delete conversation",
27709
- children: /* @__PURE__ */ jsx108(Trash24, { size: 12 })
27745
+ children: /* @__PURE__ */ jsx110(Trash24, { size: 12 })
27710
27746
  }
27711
27747
  )
27712
27748
  ]
@@ -27716,7 +27752,7 @@ var ThreadHistoryMenuContent = () => {
27716
27752
  };
27717
27753
 
27718
27754
  // src/components/Chat/ChatSidebar.tsx
27719
- import { Fragment as Fragment24, jsx as jsx109, jsxs as jsxs79 } from "react/jsx-runtime";
27755
+ import { Fragment as Fragment23, jsx as jsx111, jsxs as jsxs79 } from "react/jsx-runtime";
27720
27756
  var DRAWER_STYLES2 = {
27721
27757
  wrapper: {
27722
27758
  background: "transparent",
@@ -27742,7 +27778,7 @@ var DEFAULT_MENU_ITEMS = [
27742
27778
  builtin: "new-analysis",
27743
27779
  type: "action",
27744
27780
  name: "New Analysis",
27745
- icon: /* @__PURE__ */ jsx109(PlusCircle, { size: 20 }),
27781
+ icon: /* @__PURE__ */ jsx111(PlusCircle, { size: 20 }),
27746
27782
  order: 0
27747
27783
  },
27748
27784
  // Second: Thread History (inline drawer)
@@ -27751,28 +27787,15 @@ var DEFAULT_MENU_ITEMS = [
27751
27787
  builtin: "thread-history",
27752
27788
  type: "drawer",
27753
27789
  name: "History",
27754
- icon: /* @__PURE__ */ jsx109(History, { size: 20 }),
27790
+ icon: /* @__PURE__ */ jsx111(History, { size: 20 }),
27755
27791
  order: 1,
27756
27792
  title: "Conversation History",
27757
27793
  width: 320,
27758
27794
  inline: true,
27759
- inlineDefaultExpanded: false,
27760
- content: /* @__PURE__ */ jsx109(ThreadHistoryMenuContent, {})
27761
- },
27762
- // Third: Projects (inline drawer)
27763
- {
27764
- id: "files",
27765
- builtin: "projects",
27766
- type: "drawer",
27767
- name: "Project Files",
27768
- icon: /* @__PURE__ */ jsx109(FolderOpen4, {}),
27769
- order: 2,
27770
- title: "Project Files",
27771
- width: 320,
27772
- inline: true,
27773
27795
  inlineDefaultExpanded: true,
27774
- content: /* @__PURE__ */ jsx109(ProjectsMenuContent, {})
27796
+ content: /* @__PURE__ */ jsx111(ThreadHistoryMenuContent, {})
27775
27797
  }
27798
+ // Project Files removed - now accessed via header toggle
27776
27799
  ];
27777
27800
  var ChatSidebar = ({
27778
27801
  onSettingsClick,
@@ -27835,18 +27858,16 @@ var ChatSidebar = ({
27835
27858
  }, [createThread]);
27836
27859
  const renderDrawerContent = useCallback34((item) => {
27837
27860
  switch (item.builtin) {
27838
- case "projects":
27839
- return /* @__PURE__ */ jsx109(ProjectsMenuContent, {});
27840
27861
  case "thread-history":
27841
- return /* @__PURE__ */ jsx109(ThreadHistoryMenuContent, {});
27862
+ return /* @__PURE__ */ jsx111(ThreadHistoryMenuContent, {});
27842
27863
  default:
27843
27864
  return item.content;
27844
27865
  }
27845
27866
  }, []);
27846
27867
  const userMenuItems = /* @__PURE__ */ jsxs79("div", { style: { minWidth: 160 }, children: [
27847
27868
  /* @__PURE__ */ jsxs79("div", { style: { padding: "8px 12px", borderBottom: "1px solid #f0f0f0" }, children: [
27848
- /* @__PURE__ */ jsx109("div", { style: { fontWeight: 500 }, children: user?.name || user?.email }),
27849
- /* @__PURE__ */ jsx109("div", { style: { fontSize: 12, color: "#666" }, children: user?.email })
27869
+ /* @__PURE__ */ jsx111("div", { style: { fontWeight: 500 }, children: user?.name || user?.email }),
27870
+ /* @__PURE__ */ jsx111("div", { style: { fontSize: 12, color: "#666" }, children: user?.email })
27850
27871
  ] }),
27851
27872
  /* @__PURE__ */ jsxs79(
27852
27873
  Button50,
@@ -27856,7 +27877,7 @@ var ChatSidebar = ({
27856
27877
  style: { justifyContent: "flex-start", padding: "8px 12px" },
27857
27878
  onClick: () => setChangePasswordOpen(true),
27858
27879
  children: [
27859
- /* @__PURE__ */ jsx109(Key2, { size: 16, style: { marginRight: 8 } }),
27880
+ /* @__PURE__ */ jsx111(Key2, { size: 16, style: { marginRight: 8 } }),
27860
27881
  "Change Password"
27861
27882
  ]
27862
27883
  }
@@ -27870,14 +27891,14 @@ var ChatSidebar = ({
27870
27891
  style: { justifyContent: "flex-start", padding: "8px 12px" },
27871
27892
  onClick: logout,
27872
27893
  children: [
27873
- /* @__PURE__ */ jsx109(LogOut4, { size: 16, style: { marginRight: 8 } }),
27894
+ /* @__PURE__ */ jsx111(LogOut4, { size: 16, style: { marginRight: 8 } }),
27874
27895
  "Logout"
27875
27896
  ]
27876
27897
  }
27877
27898
  )
27878
27899
  ] });
27879
- return /* @__PURE__ */ jsxs79(Fragment24, { children: [
27880
- /* @__PURE__ */ jsx109(
27900
+ return /* @__PURE__ */ jsxs79(Fragment23, { children: [
27901
+ /* @__PURE__ */ jsx111(
27881
27902
  Menu,
27882
27903
  {
27883
27904
  items: menuItems,
@@ -27891,7 +27912,7 @@ var ChatSidebar = ({
27891
27912
  forceIconMode: sideAppVisible,
27892
27913
  collapsed: menuCollapsed,
27893
27914
  onCollapsedChange: setMenuCollapsed,
27894
- footer: ({ isIconMode }) => user && /* @__PURE__ */ jsx109(
27915
+ footer: ({ isIconMode }) => user && /* @__PURE__ */ jsx111(
27895
27916
  Popover3,
27896
27917
  {
27897
27918
  content: userMenuItems,
@@ -27911,7 +27932,7 @@ var ChatSidebar = ({
27911
27932
  transition: "all 0.2s"
27912
27933
  },
27913
27934
  children: [
27914
- /* @__PURE__ */ jsx109(
27935
+ /* @__PURE__ */ jsx111(
27915
27936
  Avatar13,
27916
27937
  {
27917
27938
  size: isIconMode ? 32 : 36,
@@ -27924,7 +27945,7 @@ var ChatSidebar = ({
27924
27945
  }
27925
27946
  ),
27926
27947
  !isIconMode && /* @__PURE__ */ jsxs79("div", { style: { flex: 1, minWidth: 0 }, children: [
27927
- /* @__PURE__ */ jsx109(
27948
+ /* @__PURE__ */ jsx111(
27928
27949
  "div",
27929
27950
  {
27930
27951
  style: {
@@ -27936,7 +27957,7 @@ var ChatSidebar = ({
27936
27957
  children: user.name || user.email
27937
27958
  }
27938
27959
  ),
27939
- /* @__PURE__ */ jsx109(
27960
+ /* @__PURE__ */ jsx111(
27940
27961
  "div",
27941
27962
  {
27942
27963
  style: {
@@ -27957,19 +27978,19 @@ var ChatSidebar = ({
27957
27978
  )
27958
27979
  }
27959
27980
  ),
27960
- /* @__PURE__ */ jsx109(
27981
+ /* @__PURE__ */ jsx111(
27961
27982
  ChangePasswordModal,
27962
27983
  {
27963
27984
  open: changePasswordOpen,
27964
27985
  onClose: () => setChangePasswordOpen(false)
27965
27986
  }
27966
27987
  ),
27967
- menuItems.filter((item) => item.type === "drawer" && !item.inline).map((item) => /* @__PURE__ */ jsx109(
27988
+ menuItems.filter((item) => item.type === "drawer" && !item.inline).map((item) => /* @__PURE__ */ jsx111(
27968
27989
  Drawer2,
27969
27990
  {
27970
27991
  title: /* @__PURE__ */ jsxs79("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" }, children: [
27971
- /* @__PURE__ */ jsx109("span", { style: { fontSize: 16, fontWeight: 600, textTransform: "uppercase", letterSpacing: 0.5 }, children: item.title || item.name }),
27972
- /* @__PURE__ */ jsx109(
27992
+ /* @__PURE__ */ jsx111("span", { style: { fontSize: 16, fontWeight: 600, textTransform: "uppercase", letterSpacing: 0.5 }, children: item.title || item.name }),
27993
+ /* @__PURE__ */ jsx111(
27973
27994
  "button",
27974
27995
  {
27975
27996
  onClick: () => handleCloseDrawer(item.id),
@@ -27984,7 +28005,7 @@ var ChatSidebar = ({
27984
28005
  background: "rgba(255, 255, 255, 0.5)",
27985
28006
  cursor: "pointer"
27986
28007
  },
27987
- children: /* @__PURE__ */ jsx109(PanelLeftClose2, { size: 24 })
28008
+ children: /* @__PURE__ */ jsx111(PanelLeftClose2, { size: 24 })
27988
28009
  }
27989
28010
  )
27990
28011
  ] }),
@@ -28015,7 +28036,7 @@ var ChatSidebar = ({
28015
28036
  };
28016
28037
 
28017
28038
  // src/components/Chat/LatticeChatView.tsx
28018
- import { jsx as jsx110 } from "react/jsx-runtime";
28039
+ import { jsx as jsx112 } from "react/jsx-runtime";
28019
28040
  var LatticeChatView = (props) => {
28020
28041
  const shellContext = useContext11(LatticeChatShellContext);
28021
28042
  const { showSideMenu, sideMenuItems } = shellContext.config;
@@ -28024,7 +28045,7 @@ var LatticeChatView = (props) => {
28024
28045
  const {
28025
28046
  config: { baseURL }
28026
28047
  } = useLatticeChatShellContext();
28027
- return assistantId && thread ? /* @__PURE__ */ jsx110(
28048
+ return assistantId && thread ? /* @__PURE__ */ jsx112(
28028
28049
  AxiomLatticeProvider,
28029
28050
  {
28030
28051
  config: {
@@ -28033,14 +28054,14 @@ var LatticeChatView = (props) => {
28033
28054
  assistantId,
28034
28055
  transport: "sse"
28035
28056
  },
28036
- children: /* @__PURE__ */ jsx110(
28057
+ children: /* @__PURE__ */ jsx112(
28037
28058
  LatticeChat,
28038
28059
  {
28039
28060
  thread_id: thread?.id,
28040
28061
  assistant_id: assistantId,
28041
28062
  name: currentAssistant?.name,
28042
28063
  description: currentAssistant?.description,
28043
- menu: showSideMenu ? /* @__PURE__ */ jsx110(ChatSidebar, { customMenuItems: sideMenuItems }) : void 0
28064
+ menu: showSideMenu ? /* @__PURE__ */ jsx112(ChatSidebar, { customMenuItems: sideMenuItems }) : void 0
28044
28065
  }
28045
28066
  )
28046
28067
  }
@@ -28048,10 +28069,10 @@ var LatticeChatView = (props) => {
28048
28069
  };
28049
28070
 
28050
28071
  // src/components/Chat/SettingsModal.tsx
28051
- import { useState as useState67, useEffect as useEffect41, useRef as useRef26 } from "react";
28072
+ import { useState as useState67, useEffect as useEffect41, useRef as useRef25 } from "react";
28052
28073
  import {
28053
- Modal as Modal20,
28054
- Input as Input15,
28074
+ Modal as Modal19,
28075
+ Input as Input14,
28055
28076
  Button as Button51,
28056
28077
  message as message19,
28057
28078
  notification as notification5,
@@ -28074,11 +28095,11 @@ import {
28074
28095
  PlusOutlined as PlusOutlined7,
28075
28096
  CloudServerOutlined
28076
28097
  } from "@ant-design/icons";
28077
- import { createStyles as createStyles34 } from "antd-style";
28078
- import { Fragment as Fragment25, jsx as jsx111, jsxs as jsxs80 } from "react/jsx-runtime";
28098
+ import { createStyles as createStyles36 } from "antd-style";
28099
+ import { Fragment as Fragment24, jsx as jsx113, jsxs as jsxs80 } from "react/jsx-runtime";
28079
28100
  var { Text: Text37, Title: Title13 } = Typography48;
28080
- var { TextArea: TextArea8 } = Input15;
28081
- var useStyles21 = createStyles34(({ token, css }) => ({
28101
+ var { TextArea: TextArea8 } = Input14;
28102
+ var useStyles23 = createStyles36(({ token, css }) => ({
28082
28103
  // settingsModal: css`
28083
28104
  // .ant-modal {
28084
28105
  // max-width: 100vw !important;
@@ -28423,19 +28444,19 @@ var SETTINGS_MENU_ITEMS = [
28423
28444
  {
28424
28445
  key: "environment",
28425
28446
  label: "Environment Variables",
28426
- icon: /* @__PURE__ */ jsx111(EnvironmentOutlined, {})
28447
+ icon: /* @__PURE__ */ jsx113(EnvironmentOutlined, {})
28427
28448
  },
28428
28449
  {
28429
28450
  key: "models",
28430
28451
  label: "Model Configuration",
28431
- icon: /* @__PURE__ */ jsx111(ApiOutlined, {})
28452
+ icon: /* @__PURE__ */ jsx113(ApiOutlined, {})
28432
28453
  }
28433
28454
  ];
28434
28455
  var SettingsModal = ({
28435
28456
  open,
28436
28457
  onClose
28437
28458
  }) => {
28438
- const { styles } = useStyles21();
28459
+ const { styles } = useStyles23();
28439
28460
  const { config: shellConfig, updateConfigValue } = useLatticeChatShellContext();
28440
28461
  const [connections, setConnections] = useState67(() => {
28441
28462
  if (typeof window !== "undefined") {
@@ -28461,7 +28482,7 @@ var SettingsModal = ({
28461
28482
  return [];
28462
28483
  });
28463
28484
  const [serverConfigs, setServerConfigs] = useState67({});
28464
- const connectionsRef = useRef26(connections);
28485
+ const connectionsRef = useRef25(connections);
28465
28486
  useEffect41(() => {
28466
28487
  connectionsRef.current = connections;
28467
28488
  }, [connections]);
@@ -28885,24 +28906,24 @@ var SettingsModal = ({
28885
28906
  }));
28886
28907
  };
28887
28908
  return /* @__PURE__ */ jsxs80("div", { className: styles.formContainer, children: [
28888
- /* @__PURE__ */ jsx111(
28909
+ /* @__PURE__ */ jsx113(
28889
28910
  Alert9,
28890
28911
  {
28891
28912
  message: "Configuration Effect",
28892
28913
  description: /* @__PURE__ */ jsxs80("div", { children: [
28893
28914
  /* @__PURE__ */ jsxs80("div", { style: { marginBottom: 8 }, children: [
28894
- /* @__PURE__ */ jsx111(
28915
+ /* @__PURE__ */ jsx113(
28895
28916
  CheckCircleOutlined8,
28896
28917
  {
28897
28918
  style: { color: "#52c41a", marginRight: 8 }
28898
28919
  }
28899
28920
  ),
28900
- /* @__PURE__ */ jsx111("strong", { children: "Immediately effective:" }),
28921
+ /* @__PURE__ */ jsx113("strong", { children: "Immediately effective:" }),
28901
28922
  " QUEUE_SERVICE_TYPE, REDIS_URL, REDIS_PASSWORD, QUEUE_NAME"
28902
28923
  ] }),
28903
28924
  /* @__PURE__ */ jsxs80("div", { children: [
28904
- /* @__PURE__ */ jsx111(ReloadOutlined4, { style: { color: "#faad14", marginRight: 8 } }),
28905
- /* @__PURE__ */ jsx111("strong", { children: "Requires restart:" }),
28925
+ /* @__PURE__ */ jsx113(ReloadOutlined4, { style: { color: "#faad14", marginRight: 8 } }),
28926
+ /* @__PURE__ */ jsx113("strong", { children: "Requires restart:" }),
28906
28927
  " PORT (server must be restarted to change port)"
28907
28928
  ] })
28908
28929
  ] }),
@@ -28911,8 +28932,8 @@ var SettingsModal = ({
28911
28932
  className: styles.alertCard
28912
28933
  }
28913
28934
  ),
28914
- /* @__PURE__ */ jsx111("div", { style: { marginBottom: 24 }, children: /* @__PURE__ */ jsx111(Text37, { 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." }) }),
28915
- /* @__PURE__ */ jsx111(
28935
+ /* @__PURE__ */ jsx113("div", { style: { marginBottom: 24 }, children: /* @__PURE__ */ jsx113(Text37, { 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." }) }),
28936
+ /* @__PURE__ */ jsx113(
28916
28937
  TextArea8,
28917
28938
  {
28918
28939
  value: config.envText,
@@ -28990,7 +29011,7 @@ QUEUE_NAME=tasks`,
28990
29011
  }
28991
29012
  };
28992
29013
  return /* @__PURE__ */ jsxs80("div", { className: styles.formContainer, children: [
28993
- /* @__PURE__ */ jsx111("div", { style: { marginBottom: 32 }, children: /* @__PURE__ */ jsx111(Text37, { 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." }) }),
29014
+ /* @__PURE__ */ jsx113("div", { style: { marginBottom: 32 }, children: /* @__PURE__ */ jsx113(Text37, { 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." }) }),
28994
29015
  config.models.map((model, index) => /* @__PURE__ */ jsxs80("div", { className: styles.card, children: [
28995
29016
  /* @__PURE__ */ jsxs80(
28996
29017
  "div",
@@ -29022,7 +29043,7 @@ QUEUE_NAME=tasks`,
29022
29043
  }
29023
29044
  )
29024
29045
  ] }),
29025
- config.models.length > 1 && /* @__PURE__ */ jsx111(
29046
+ config.models.length > 1 && /* @__PURE__ */ jsx113(
29026
29047
  Button51,
29027
29048
  {
29028
29049
  type: "text",
@@ -29041,9 +29062,9 @@ QUEUE_NAME=tasks`,
29041
29062
  ),
29042
29063
  /* @__PURE__ */ jsxs80(Space37, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
29043
29064
  /* @__PURE__ */ jsxs80("div", { children: [
29044
- /* @__PURE__ */ jsx111(Text37, { className: styles.formLabel, children: "Key *" }),
29045
- /* @__PURE__ */ jsx111(
29046
- Input15,
29065
+ /* @__PURE__ */ jsx113(Text37, { className: styles.formLabel, children: "Key *" }),
29066
+ /* @__PURE__ */ jsx113(
29067
+ Input14,
29047
29068
  {
29048
29069
  placeholder: "e.g., default, gpt-4, claude",
29049
29070
  value: model.key,
@@ -29051,11 +29072,11 @@ QUEUE_NAME=tasks`,
29051
29072
  style: { height: 40 }
29052
29073
  }
29053
29074
  ),
29054
- /* @__PURE__ */ jsx111(Text37, { className: styles.formDescription, children: "Unique identifier for this model" })
29075
+ /* @__PURE__ */ jsx113(Text37, { className: styles.formDescription, children: "Unique identifier for this model" })
29055
29076
  ] }),
29056
29077
  /* @__PURE__ */ jsxs80("div", { children: [
29057
- /* @__PURE__ */ jsx111(Text37, { className: styles.formLabel, children: "Provider *" }),
29058
- /* @__PURE__ */ jsx111(
29078
+ /* @__PURE__ */ jsx113(Text37, { className: styles.formLabel, children: "Provider *" }),
29079
+ /* @__PURE__ */ jsx113(
29059
29080
  Select7,
29060
29081
  {
29061
29082
  style: { width: "100%", height: 40 },
@@ -29072,9 +29093,9 @@ QUEUE_NAME=tasks`,
29072
29093
  )
29073
29094
  ] }),
29074
29095
  /* @__PURE__ */ jsxs80("div", { children: [
29075
- /* @__PURE__ */ jsx111(Text37, { className: styles.formLabel, children: "Model Name *" }),
29076
- /* @__PURE__ */ jsx111(
29077
- Input15,
29096
+ /* @__PURE__ */ jsx113(Text37, { className: styles.formLabel, children: "Model Name *" }),
29097
+ /* @__PURE__ */ jsx113(
29098
+ Input14,
29078
29099
  {
29079
29100
  placeholder: "e.g., gpt-4, claude-3-opus, kimi-k2-250905",
29080
29101
  value: model.model,
@@ -29084,9 +29105,9 @@ QUEUE_NAME=tasks`,
29084
29105
  )
29085
29106
  ] }),
29086
29107
  /* @__PURE__ */ jsxs80("div", { children: [
29087
- /* @__PURE__ */ jsx111(Text37, { className: styles.formLabel, children: "API Key" }),
29088
- /* @__PURE__ */ jsx111(
29089
- Input15.Password,
29108
+ /* @__PURE__ */ jsx113(Text37, { className: styles.formLabel, children: "API Key" }),
29109
+ /* @__PURE__ */ jsx113(
29110
+ Input14.Password,
29090
29111
  {
29091
29112
  placeholder: "Enter your API key",
29092
29113
  value: model.apiKey,
@@ -29094,12 +29115,12 @@ QUEUE_NAME=tasks`,
29094
29115
  style: { height: 40 }
29095
29116
  }
29096
29117
  ),
29097
- /* @__PURE__ */ jsx111(Text37, { className: styles.formDescription, children: "API key for the model provider. Leave empty to use environment variable." })
29118
+ /* @__PURE__ */ jsx113(Text37, { className: styles.formDescription, children: "API key for the model provider. Leave empty to use environment variable." })
29098
29119
  ] }),
29099
29120
  /* @__PURE__ */ jsxs80("div", { children: [
29100
- /* @__PURE__ */ jsx111(Text37, { className: styles.formLabel, children: "Base URL" }),
29101
- /* @__PURE__ */ jsx111(
29102
- Input15,
29121
+ /* @__PURE__ */ jsx113(Text37, { className: styles.formLabel, children: "Base URL" }),
29122
+ /* @__PURE__ */ jsx113(
29123
+ Input14,
29103
29124
  {
29104
29125
  placeholder: "e.g., https://api.openai.com/v1",
29105
29126
  value: model.baseURL,
@@ -29107,23 +29128,23 @@ QUEUE_NAME=tasks`,
29107
29128
  style: { height: 40 }
29108
29129
  }
29109
29130
  ),
29110
- /* @__PURE__ */ jsx111(Text37, { className: styles.formDescription, children: "Optional custom base URL for the API" })
29131
+ /* @__PURE__ */ jsx113(Text37, { className: styles.formDescription, children: "Optional custom base URL for the API" })
29111
29132
  ] }),
29112
- /* @__PURE__ */ jsx111("div", { children: /* @__PURE__ */ jsxs80(Space37, { children: [
29113
- /* @__PURE__ */ jsx111(
29133
+ /* @__PURE__ */ jsx113("div", { children: /* @__PURE__ */ jsxs80(Space37, { children: [
29134
+ /* @__PURE__ */ jsx113(
29114
29135
  Switch3,
29115
29136
  {
29116
29137
  checked: model.streaming,
29117
29138
  onChange: (checked) => handleModelChange(index, "streaming", checked)
29118
29139
  }
29119
29140
  ),
29120
- /* @__PURE__ */ jsx111(Text37, { children: "Enable Streaming" })
29141
+ /* @__PURE__ */ jsx113(Text37, { children: "Enable Streaming" })
29121
29142
  ] }) }),
29122
29143
  /* @__PURE__ */ jsxs80("div", { style: { display: "flex", gap: 20 }, children: [
29123
29144
  /* @__PURE__ */ jsxs80("div", { style: { flex: 1 }, children: [
29124
- /* @__PURE__ */ jsx111(Text37, { className: styles.formLabel, children: "Max Tokens" }),
29125
- /* @__PURE__ */ jsx111(
29126
- Input15,
29145
+ /* @__PURE__ */ jsx113(Text37, { className: styles.formLabel, children: "Max Tokens" }),
29146
+ /* @__PURE__ */ jsx113(
29147
+ Input14,
29127
29148
  {
29128
29149
  type: "number",
29129
29150
  placeholder: "e.g., 4096",
@@ -29138,9 +29159,9 @@ QUEUE_NAME=tasks`,
29138
29159
  )
29139
29160
  ] }),
29140
29161
  /* @__PURE__ */ jsxs80("div", { style: { flex: 1 }, children: [
29141
- /* @__PURE__ */ jsx111(Text37, { className: styles.formLabel, children: "Temperature" }),
29142
- /* @__PURE__ */ jsx111(
29143
- Input15,
29162
+ /* @__PURE__ */ jsx113(Text37, { className: styles.formLabel, children: "Temperature" }),
29163
+ /* @__PURE__ */ jsx113(
29164
+ Input14,
29144
29165
  {
29145
29166
  type: "number",
29146
29167
  step: "0.1",
@@ -29158,7 +29179,7 @@ QUEUE_NAME=tasks`,
29158
29179
  ] })
29159
29180
  ] })
29160
29181
  ] }, index)),
29161
- /* @__PURE__ */ jsx111(
29182
+ /* @__PURE__ */ jsx113(
29162
29183
  Button51,
29163
29184
  {
29164
29185
  type: "dashed",
@@ -29187,7 +29208,7 @@ QUEUE_NAME=tasks`,
29187
29208
  const currentConnection = connections.find((c) => c.id === activeTabKey);
29188
29209
  const renderTabLabel = (connection) => {
29189
29210
  return /* @__PURE__ */ jsxs80("div", { style: { display: "flex", alignItems: "center" }, children: [
29190
- /* @__PURE__ */ jsx111(
29211
+ /* @__PURE__ */ jsx113(
29191
29212
  CloudServerOutlined,
29192
29213
  {
29193
29214
  style: {
@@ -29196,14 +29217,14 @@ QUEUE_NAME=tasks`,
29196
29217
  }
29197
29218
  }
29198
29219
  ),
29199
- /* @__PURE__ */ jsx111("span", { children: connection.name }),
29200
- connection.connected && /* @__PURE__ */ jsx111(
29220
+ /* @__PURE__ */ jsx113("span", { children: connection.name }),
29221
+ connection.connected && /* @__PURE__ */ jsx113(
29201
29222
  CheckCircleFilled,
29202
29223
  {
29203
29224
  style: { color: "#52c41a", fontSize: 12, marginLeft: 8 }
29204
29225
  }
29205
29226
  ),
29206
- connection.error && !connection.connecting && /* @__PURE__ */ jsx111(
29227
+ connection.error && !connection.connecting && /* @__PURE__ */ jsx113(
29207
29228
  CloseCircleFilled,
29208
29229
  {
29209
29230
  style: { color: "#ff4d4f", fontSize: 12, marginLeft: 8 }
@@ -29214,15 +29235,15 @@ QUEUE_NAME=tasks`,
29214
29235
  const tabItems = connections.map((connection) => ({
29215
29236
  key: connection.id,
29216
29237
  label: renderTabLabel(connection),
29217
- children: /* @__PURE__ */ jsx111("div", { className: styles.tabContent, children: connection.connected ? /* @__PURE__ */ jsx111(Fragment25, { children: /* @__PURE__ */ jsxs80("div", { style: { display: "flex", height: "100%" }, children: [
29218
- /* @__PURE__ */ jsx111("div", { className: styles.sidebar, children: SETTINGS_MENU_ITEMS.map((item) => /* @__PURE__ */ jsxs80(
29238
+ children: /* @__PURE__ */ jsx113("div", { className: styles.tabContent, children: connection.connected ? /* @__PURE__ */ jsx113(Fragment24, { children: /* @__PURE__ */ jsxs80("div", { style: { display: "flex", height: "100%" }, children: [
29239
+ /* @__PURE__ */ jsx113("div", { className: styles.sidebar, children: SETTINGS_MENU_ITEMS.map((item) => /* @__PURE__ */ jsxs80(
29219
29240
  "div",
29220
29241
  {
29221
29242
  className: `${styles.menuItem} ${activeMenu === item.key ? "active" : ""}`,
29222
29243
  onClick: () => setActiveMenu(item.key),
29223
29244
  children: [
29224
- /* @__PURE__ */ jsx111("span", { className: styles.menuItemIcon, children: item.icon }),
29225
- /* @__PURE__ */ jsx111("span", { className: styles.menuItemText, children: item.label })
29245
+ /* @__PURE__ */ jsx113("span", { className: styles.menuItemIcon, children: item.icon }),
29246
+ /* @__PURE__ */ jsx113("span", { className: styles.menuItemText, children: item.label })
29226
29247
  ]
29227
29248
  },
29228
29249
  item.key
@@ -29230,19 +29251,19 @@ QUEUE_NAME=tasks`,
29230
29251
  /* @__PURE__ */ jsxs80("div", { className: styles.content, children: [
29231
29252
  /* @__PURE__ */ jsxs80("div", { className: styles.contentHeader, children: [
29232
29253
  /* @__PURE__ */ jsxs80("div", { className: styles.contentHeaderLeft, children: [
29233
- /* @__PURE__ */ jsx111(Title13, { level: 3, className: styles.contentTitle, children: activeMenuItem?.label }),
29254
+ /* @__PURE__ */ jsx113(Title13, { level: 3, className: styles.contentTitle, children: activeMenuItem?.label }),
29234
29255
  /* @__PURE__ */ jsxs80(Text37, { className: styles.contentDescription, children: [
29235
29256
  activeMenu === "environment" && "Manage environment variables for the gateway server",
29236
29257
  activeMenu === "models" && "Configure and register model lattices for use by agents"
29237
29258
  ] })
29238
29259
  ] }),
29239
29260
  /* @__PURE__ */ jsxs80("div", { className: styles.contentHeaderRight, children: [
29240
- /* @__PURE__ */ jsx111(Button51, { onClick: onClose, children: "Cancel" }),
29241
- /* @__PURE__ */ jsx111(
29261
+ /* @__PURE__ */ jsx113(Button51, { onClick: onClose, children: "Cancel" }),
29262
+ /* @__PURE__ */ jsx113(
29242
29263
  Button51,
29243
29264
  {
29244
29265
  type: "primary",
29245
- icon: /* @__PURE__ */ jsx111(SaveOutlined2, {}),
29266
+ icon: /* @__PURE__ */ jsx113(SaveOutlined2, {}),
29246
29267
  onClick: handleSave,
29247
29268
  loading,
29248
29269
  children: "Save Configuration"
@@ -29250,9 +29271,9 @@ QUEUE_NAME=tasks`,
29250
29271
  )
29251
29272
  ] })
29252
29273
  ] }),
29253
- /* @__PURE__ */ jsx111("div", { className: styles.contentBody, children: renderContent(connection.id) })
29274
+ /* @__PURE__ */ jsx113("div", { className: styles.contentBody, children: renderContent(connection.id) })
29254
29275
  ] })
29255
- ] }) }) : /* @__PURE__ */ jsx111(
29276
+ ] }) }) : /* @__PURE__ */ jsx113(
29256
29277
  "div",
29257
29278
  {
29258
29279
  style: {
@@ -29264,17 +29285,17 @@ QUEUE_NAME=tasks`,
29264
29285
  gap: 16,
29265
29286
  padding: 48
29266
29287
  },
29267
- children: connection.connecting ? /* @__PURE__ */ jsxs80(Fragment25, { children: [
29268
- /* @__PURE__ */ jsx111(LinkOutlined2, { style: { fontSize: 64, color: "#1890ff" }, spin: true }),
29269
- /* @__PURE__ */ jsx111(Title13, { level: 4, children: "Connecting..." }),
29288
+ children: connection.connecting ? /* @__PURE__ */ jsxs80(Fragment24, { children: [
29289
+ /* @__PURE__ */ jsx113(LinkOutlined2, { style: { fontSize: 64, color: "#1890ff" }, spin: true }),
29290
+ /* @__PURE__ */ jsx113(Title13, { level: 4, children: "Connecting..." }),
29270
29291
  /* @__PURE__ */ jsxs80(Text37, { type: "secondary", style: { textAlign: "center" }, children: [
29271
29292
  "Connecting to ",
29272
29293
  connection.url
29273
29294
  ] })
29274
- ] }) : /* @__PURE__ */ jsxs80(Fragment25, { children: [
29275
- /* @__PURE__ */ jsx111(LinkOutlined2, { style: { fontSize: 64, color: "#d9d9d9" } }),
29276
- /* @__PURE__ */ jsx111(Title13, { level: 4, type: "secondary", children: connection.error || "Not Connected" }),
29277
- /* @__PURE__ */ jsx111(
29295
+ ] }) : /* @__PURE__ */ jsxs80(Fragment24, { children: [
29296
+ /* @__PURE__ */ jsx113(LinkOutlined2, { style: { fontSize: 64, color: "#d9d9d9" } }),
29297
+ /* @__PURE__ */ jsx113(Title13, { level: 4, type: "secondary", children: connection.error || "Not Connected" }),
29298
+ /* @__PURE__ */ jsx113(
29278
29299
  Text37,
29279
29300
  {
29280
29301
  type: "secondary",
@@ -29282,11 +29303,11 @@ QUEUE_NAME=tasks`,
29282
29303
  children: connection.error ? `Failed to connect to ${connection.url}. Please check the server URL and try again.` : `Click "Reconnect" to connect to ${connection.url}`
29283
29304
  }
29284
29305
  ),
29285
- /* @__PURE__ */ jsx111(
29306
+ /* @__PURE__ */ jsx113(
29286
29307
  Button51,
29287
29308
  {
29288
29309
  type: "primary",
29289
- icon: /* @__PURE__ */ jsx111(LinkOutlined2, {}),
29310
+ icon: /* @__PURE__ */ jsx113(LinkOutlined2, {}),
29290
29311
  onClick: () => checkConnection(connection.id),
29291
29312
  loading: connection.connecting,
29292
29313
  style: { marginTop: 16 },
@@ -29298,9 +29319,9 @@ QUEUE_NAME=tasks`,
29298
29319
  ) }),
29299
29320
  closable: connections.length > 1
29300
29321
  }));
29301
- return /* @__PURE__ */ jsxs80(Fragment25, { children: [
29302
- /* @__PURE__ */ jsx111(
29303
- Modal20,
29322
+ return /* @__PURE__ */ jsxs80(Fragment24, { children: [
29323
+ /* @__PURE__ */ jsx113(
29324
+ Modal19,
29304
29325
  {
29305
29326
  open,
29306
29327
  onCancel: onClose,
@@ -29308,7 +29329,7 @@ QUEUE_NAME=tasks`,
29308
29329
  width: "80%",
29309
29330
  footer: null,
29310
29331
  title: "Settings",
29311
- children: /* @__PURE__ */ jsx111("div", { children: /* @__PURE__ */ jsx111(
29332
+ children: /* @__PURE__ */ jsx113("div", { children: /* @__PURE__ */ jsx113(
29312
29333
  Tabs3,
29313
29334
  {
29314
29335
  activeKey: activeTabKey,
@@ -29332,8 +29353,8 @@ QUEUE_NAME=tasks`,
29332
29353
  padding: "4px 8px"
29333
29354
  },
29334
29355
  children: [
29335
- /* @__PURE__ */ jsx111(PlusOutlined7, {}),
29336
- /* @__PURE__ */ jsx111("span", { children: "Add Server" })
29356
+ /* @__PURE__ */ jsx113(PlusOutlined7, {}),
29357
+ /* @__PURE__ */ jsx113("span", { children: "Add Server" })
29337
29358
  ]
29338
29359
  }
29339
29360
  )
@@ -29341,8 +29362,8 @@ QUEUE_NAME=tasks`,
29341
29362
  ) })
29342
29363
  }
29343
29364
  ),
29344
- /* @__PURE__ */ jsx111(
29345
- Modal20,
29365
+ /* @__PURE__ */ jsx113(
29366
+ Modal19,
29346
29367
  {
29347
29368
  title: "Add New Server",
29348
29369
  open: showAddServerModal,
@@ -29357,9 +29378,9 @@ QUEUE_NAME=tasks`,
29357
29378
  className: styles.addServerModal,
29358
29379
  children: /* @__PURE__ */ jsxs80(Space37, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
29359
29380
  /* @__PURE__ */ jsxs80("div", { children: [
29360
- /* @__PURE__ */ jsx111(Text37, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server Name" }),
29361
- /* @__PURE__ */ jsx111(
29362
- Input15,
29381
+ /* @__PURE__ */ jsx113(Text37, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server Name" }),
29382
+ /* @__PURE__ */ jsx113(
29383
+ Input14,
29363
29384
  {
29364
29385
  placeholder: "e.g., Production Server",
29365
29386
  value: newServerName,
@@ -29367,12 +29388,12 @@ QUEUE_NAME=tasks`,
29367
29388
  onPressEnter: handleAddServer
29368
29389
  }
29369
29390
  ),
29370
- /* @__PURE__ */ jsx111(Text37, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: Leave empty to use URL as name" })
29391
+ /* @__PURE__ */ jsx113(Text37, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: Leave empty to use URL as name" })
29371
29392
  ] }),
29372
29393
  /* @__PURE__ */ jsxs80("div", { children: [
29373
- /* @__PURE__ */ jsx111(Text37, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server URL *" }),
29374
- /* @__PURE__ */ jsx111(
29375
- Input15,
29394
+ /* @__PURE__ */ jsx113(Text37, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server URL *" }),
29395
+ /* @__PURE__ */ jsx113(
29396
+ Input14,
29376
29397
  {
29377
29398
  placeholder: "e.g., http://localhost:4001",
29378
29399
  value: newServerUrl,
@@ -29380,12 +29401,12 @@ QUEUE_NAME=tasks`,
29380
29401
  onPressEnter: handleAddServer
29381
29402
  }
29382
29403
  ),
29383
- /* @__PURE__ */ jsx111(Text37, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Enter the full URL of the gateway server" })
29404
+ /* @__PURE__ */ jsx113(Text37, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Enter the full URL of the gateway server" })
29384
29405
  ] }),
29385
29406
  /* @__PURE__ */ jsxs80("div", { children: [
29386
- /* @__PURE__ */ jsx111(Text37, { strong: true, style: { display: "block", marginBottom: 8 }, children: "API Key" }),
29387
- /* @__PURE__ */ jsx111(
29388
- Input15.Password,
29407
+ /* @__PURE__ */ jsx113(Text37, { strong: true, style: { display: "block", marginBottom: 8 }, children: "API Key" }),
29408
+ /* @__PURE__ */ jsx113(
29409
+ Input14.Password,
29389
29410
  {
29390
29411
  placeholder: "Optional: Enter API key for authentication",
29391
29412
  value: newServerApiKey,
@@ -29393,7 +29414,7 @@ QUEUE_NAME=tasks`,
29393
29414
  onPressEnter: handleAddServer
29394
29415
  }
29395
29416
  ),
29396
- /* @__PURE__ */ jsx111(Text37, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: API key for server authentication" })
29417
+ /* @__PURE__ */ jsx113(Text37, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: API key for server authentication" })
29397
29418
  ] })
29398
29419
  ] })
29399
29420
  }
@@ -29402,10 +29423,10 @@ QUEUE_NAME=tasks`,
29402
29423
  };
29403
29424
 
29404
29425
  // src/components/Chat/AgentServerSetting.tsx
29405
- import { jsx as jsx112 } from "react/jsx-runtime";
29426
+ import { jsx as jsx114 } from "react/jsx-runtime";
29406
29427
  var AgentServerSetting = () => {
29407
29428
  const { settingsModalOpen, setSettingsModalOpen } = useLatticeChatShellContext();
29408
- return /* @__PURE__ */ jsx112(
29429
+ return /* @__PURE__ */ jsx114(
29409
29430
  SettingsModal,
29410
29431
  {
29411
29432
  open: settingsModalOpen,
@@ -29415,24 +29436,24 @@ var AgentServerSetting = () => {
29415
29436
  };
29416
29437
 
29417
29438
  // src/components/Chat/LatticeChatShell.tsx
29418
- import { Fragment as Fragment26, jsx as jsx113, jsxs as jsxs81 } from "react/jsx-runtime";
29439
+ import { Fragment as Fragment25, jsx as jsx115, jsxs as jsxs81 } from "react/jsx-runtime";
29419
29440
  var ShellContent = ({
29420
29441
  initialAssistantId,
29421
29442
  enableWorkspace
29422
29443
  }) => {
29423
29444
  const { currentTenant } = useAuth();
29424
- return /* @__PURE__ */ jsx113(Fragment26, { children: enableWorkspace ? /* @__PURE__ */ jsxs81(WorkspaceContextProvider, { children: [
29425
- /* @__PURE__ */ jsx113(AssistantContextProvider, { autoLoad: true, initialAssistantId, children: /* @__PURE__ */ jsx113(ConversationContextProvider, { children: /* @__PURE__ */ jsx113(LatticeChatView, {}) }) }),
29426
- /* @__PURE__ */ jsx113(AgentServerSetting, {})
29427
- ] }) : /* @__PURE__ */ jsxs81(Fragment26, { children: [
29428
- /* @__PURE__ */ jsx113(AssistantContextProvider, { autoLoad: true, initialAssistantId, children: /* @__PURE__ */ jsx113(ConversationContextProvider, { children: /* @__PURE__ */ jsx113(LatticeChatView, {}) }) }),
29429
- /* @__PURE__ */ jsx113(AgentServerSetting, {})
29445
+ return /* @__PURE__ */ jsx115(Fragment25, { children: enableWorkspace ? /* @__PURE__ */ jsxs81(WorkspaceContextProvider, { children: [
29446
+ /* @__PURE__ */ jsx115(AssistantContextProvider, { autoLoad: true, initialAssistantId, children: /* @__PURE__ */ jsx115(ConversationContextProvider, { children: /* @__PURE__ */ jsx115(LatticeChatView, {}) }) }),
29447
+ /* @__PURE__ */ jsx115(AgentServerSetting, {})
29448
+ ] }) : /* @__PURE__ */ jsxs81(Fragment25, { children: [
29449
+ /* @__PURE__ */ jsx115(AssistantContextProvider, { autoLoad: true, initialAssistantId, children: /* @__PURE__ */ jsx115(ConversationContextProvider, { children: /* @__PURE__ */ jsx115(LatticeChatView, {}) }) }),
29450
+ /* @__PURE__ */ jsx115(AgentServerSetting, {})
29430
29451
  ] }) });
29431
29452
  };
29432
29453
  var LatticeChatShell = (props) => {
29433
29454
  const { enableAssistantCreation, enableAssistantEditing, enableWorkspace: enableWorkspaceProp, ...restProps } = props;
29434
29455
  const enableWorkspace = enableWorkspaceProp ?? restProps.initialConfig?.enableWorkspace ?? false;
29435
- return /* @__PURE__ */ jsx113(
29456
+ return /* @__PURE__ */ jsx115(
29436
29457
  LatticeChatShellContextProvider,
29437
29458
  {
29438
29459
  initialConfig: {
@@ -29441,7 +29462,7 @@ var LatticeChatShell = (props) => {
29441
29462
  enableWorkspace,
29442
29463
  ...restProps.initialConfig
29443
29464
  },
29444
- children: /* @__PURE__ */ jsx113(
29465
+ children: /* @__PURE__ */ jsx115(
29445
29466
  ShellContent,
29446
29467
  {
29447
29468
  initialAssistantId: restProps.initialConfig?.assistantId,
@@ -29451,6 +29472,348 @@ var LatticeChatShell = (props) => {
29451
29472
  }
29452
29473
  );
29453
29474
  };
29475
+
29476
+ // src/components/Chat/ChannelInstallationsDrawerContent.tsx
29477
+ import { useEffect as useEffect42, useState as useState68 } from "react";
29478
+ import {
29479
+ Button as Button52,
29480
+ Card as Card23,
29481
+ Form as Form7,
29482
+ Input as Input15,
29483
+ Modal as Modal20,
29484
+ Popconfirm as Popconfirm6,
29485
+ Select as Select8,
29486
+ Spin as Spin16,
29487
+ Tag as Tag22,
29488
+ Typography as Typography49,
29489
+ message as message20
29490
+ } from "antd";
29491
+ import { Edit2 as Edit24, Plus as Plus8, RadioTower, Trash2 as Trash25 } from "lucide-react";
29492
+ import { jsx as jsx116, jsxs as jsxs82 } from "react/jsx-runtime";
29493
+ var { Text: Text38, Title: Title14 } = Typography49;
29494
+ var MAPPING_MODE_OPTIONS = [
29495
+ { label: "User", value: "user" },
29496
+ { label: "Group", value: "group" },
29497
+ { label: "Hybrid", value: "hybrid" }
29498
+ ];
29499
+ var ChannelInstallationsDrawerContent = () => {
29500
+ const { get, post, put, del } = useApi();
29501
+ const [installations, setInstallations] = useState68([]);
29502
+ const [loading, setLoading] = useState68(false);
29503
+ const [formModalOpen, setFormModalOpen] = useState68(false);
29504
+ const [editingInstallation, setEditingInstallation] = useState68(null);
29505
+ const loadInstallations = async () => {
29506
+ setLoading(true);
29507
+ try {
29508
+ const result = await get(
29509
+ "/api/channel-installations"
29510
+ );
29511
+ if (result.success) {
29512
+ setInstallations(result.data?.records ?? []);
29513
+ } else {
29514
+ setInstallations([]);
29515
+ message20.error(result.message || "Failed to load channel installations");
29516
+ }
29517
+ } catch (error) {
29518
+ console.error("Failed to load channel installations:", error);
29519
+ setInstallations([]);
29520
+ message20.error("Failed to load channel installations");
29521
+ } finally {
29522
+ setLoading(false);
29523
+ }
29524
+ };
29525
+ useEffect42(() => {
29526
+ loadInstallations();
29527
+ }, []);
29528
+ const handleDelete = async (installation) => {
29529
+ try {
29530
+ const result = await del(
29531
+ `/api/channel-installations/${installation.id}`
29532
+ );
29533
+ if (result.success) {
29534
+ setInstallations(
29535
+ (current) => current.filter((item) => item.id !== installation.id)
29536
+ );
29537
+ message20.success("Installation deleted");
29538
+ } else {
29539
+ message20.error(result.message || "Failed to delete installation");
29540
+ }
29541
+ } catch (error) {
29542
+ console.error("Failed to delete channel installation:", error);
29543
+ message20.error("Failed to delete installation");
29544
+ }
29545
+ };
29546
+ return /* @__PURE__ */ jsxs82("div", { style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
29547
+ /* @__PURE__ */ jsx116("div", { style: { padding: 16 }, children: /* @__PURE__ */ jsxs82(
29548
+ "div",
29549
+ {
29550
+ style: {
29551
+ display: "flex",
29552
+ justifyContent: "space-between",
29553
+ alignItems: "center"
29554
+ },
29555
+ children: [
29556
+ /* @__PURE__ */ jsx116(Title14, { level: 5, style: { margin: 0 }, children: "Channel Installations" }),
29557
+ /* @__PURE__ */ jsx116(
29558
+ Button52,
29559
+ {
29560
+ type: "primary",
29561
+ icon: /* @__PURE__ */ jsx116(Plus8, { size: 16 }),
29562
+ onClick: () => {
29563
+ setEditingInstallation(null);
29564
+ setFormModalOpen(true);
29565
+ },
29566
+ children: "Add Installation"
29567
+ }
29568
+ )
29569
+ ]
29570
+ }
29571
+ ) }),
29572
+ /* @__PURE__ */ jsx116("div", { style: { flex: 1, overflowY: "auto", padding: 16 }, children: loading ? /* @__PURE__ */ jsx116("div", { style: { display: "flex", justifyContent: "center", padding: 32 }, children: /* @__PURE__ */ jsx116(Spin16, {}) }) : installations.length === 0 ? /* @__PURE__ */ jsxs82(
29573
+ "div",
29574
+ {
29575
+ style: {
29576
+ display: "flex",
29577
+ flexDirection: "column",
29578
+ alignItems: "center",
29579
+ justifyContent: "center",
29580
+ padding: "48px 16px"
29581
+ },
29582
+ children: [
29583
+ /* @__PURE__ */ jsx116(RadioTower, { size: 48, style: { marginBottom: 16, opacity: 0.5 } }),
29584
+ /* @__PURE__ */ jsx116(Text38, { strong: true, style: { fontSize: 15 }, children: "No channel installations" }),
29585
+ /* @__PURE__ */ jsx116(Text38, { type: "secondary", style: { marginTop: 8 }, children: 'Click "Add Installation" to create one' })
29586
+ ]
29587
+ }
29588
+ ) : /* @__PURE__ */ jsx116("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: installations.map((installation) => {
29589
+ const webhookPath = installation.channel === "lark" ? `/api/channels/lark/installations/${installation.id}/events` : null;
29590
+ return /* @__PURE__ */ jsxs82(Card23, { size: "small", children: [
29591
+ /* @__PURE__ */ jsxs82(
29592
+ "div",
29593
+ {
29594
+ style: {
29595
+ display: "flex",
29596
+ justifyContent: "space-between",
29597
+ alignItems: "flex-start",
29598
+ marginBottom: 10
29599
+ },
29600
+ children: [
29601
+ /* @__PURE__ */ jsx116(Text38, { strong: true, style: { fontSize: 15 }, children: installation.name || installation.id }),
29602
+ /* @__PURE__ */ jsx116(Tag22, { color: "blue", children: installation.channel })
29603
+ ]
29604
+ }
29605
+ ),
29606
+ /* @__PURE__ */ jsxs82(
29607
+ "div",
29608
+ {
29609
+ style: {
29610
+ display: "flex",
29611
+ flexDirection: "column",
29612
+ gap: 6,
29613
+ marginBottom: 12
29614
+ },
29615
+ children: [
29616
+ /* @__PURE__ */ jsxs82(Text38, { type: "secondary", style: { fontSize: 12 }, children: [
29617
+ "ID: ",
29618
+ installation.id
29619
+ ] }),
29620
+ /* @__PURE__ */ jsxs82(Text38, { style: { fontSize: 13 }, children: [
29621
+ "Assistant ID: ",
29622
+ installation.config.assistantId
29623
+ ] }),
29624
+ /* @__PURE__ */ jsxs82(Text38, { style: { fontSize: 13 }, children: [
29625
+ "Mapping Mode: ",
29626
+ installation.config.mappingMode
29627
+ ] }),
29628
+ installation.config.workspaceId ? /* @__PURE__ */ jsxs82(Text38, { style: { fontSize: 13 }, children: [
29629
+ "Workspace ID: ",
29630
+ installation.config.workspaceId
29631
+ ] }) : null,
29632
+ installation.config.projectId ? /* @__PURE__ */ jsxs82(Text38, { style: { fontSize: 13 }, children: [
29633
+ "Project ID: ",
29634
+ installation.config.projectId
29635
+ ] }) : null,
29636
+ webhookPath ? /* @__PURE__ */ jsx116(Text38, { code: true, style: { fontSize: 12 }, children: webhookPath }) : /* @__PURE__ */ jsx116(Text38, { type: "secondary", style: { fontSize: 12 }, children: "Unsupported channel configuration UI" })
29637
+ ]
29638
+ }
29639
+ ),
29640
+ /* @__PURE__ */ jsxs82("div", { style: { display: "flex", gap: 8 }, children: [
29641
+ /* @__PURE__ */ jsx116(
29642
+ Button52,
29643
+ {
29644
+ icon: /* @__PURE__ */ jsx116(Edit24, { size: 14 }),
29645
+ onClick: () => {
29646
+ setEditingInstallation(installation);
29647
+ setFormModalOpen(true);
29648
+ },
29649
+ children: "Edit"
29650
+ }
29651
+ ),
29652
+ /* @__PURE__ */ jsx116(
29653
+ Popconfirm6,
29654
+ {
29655
+ title: "Delete Channel Installation",
29656
+ description: `Are you sure you want to delete "${installation.name || installation.id}"?`,
29657
+ onConfirm: () => handleDelete(installation),
29658
+ okText: "Delete",
29659
+ okType: "danger",
29660
+ cancelText: "Cancel",
29661
+ children: /* @__PURE__ */ jsx116(Button52, { danger: true, icon: /* @__PURE__ */ jsx116(Trash25, { size: 14 }), children: "Delete" })
29662
+ }
29663
+ )
29664
+ ] })
29665
+ ] }, installation.id);
29666
+ }) }) }),
29667
+ formModalOpen ? /* @__PURE__ */ jsx116(
29668
+ LarkChannelInstallationFormModal,
29669
+ {
29670
+ installation: editingInstallation,
29671
+ open: formModalOpen,
29672
+ post,
29673
+ put,
29674
+ onCancel: () => {
29675
+ setFormModalOpen(false);
29676
+ setEditingInstallation(null);
29677
+ },
29678
+ onSave: () => {
29679
+ setFormModalOpen(false);
29680
+ setEditingInstallation(null);
29681
+ loadInstallations();
29682
+ }
29683
+ }
29684
+ ) : null
29685
+ ] });
29686
+ };
29687
+ var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCancel, onSave }) => {
29688
+ const [form] = Form7.useForm();
29689
+ useEffect42(() => {
29690
+ if (installation) {
29691
+ form.setFieldsValue({
29692
+ name: installation.name,
29693
+ appId: installation.config.appId,
29694
+ appSecret: installation.config.appSecret,
29695
+ verificationToken: installation.config.verificationToken,
29696
+ encryptKey: installation.config.encryptKey,
29697
+ mappingMode: installation.config.mappingMode,
29698
+ assistantId: installation.config.assistantId,
29699
+ workspaceId: installation.config.workspaceId,
29700
+ projectId: installation.config.projectId
29701
+ });
29702
+ return;
29703
+ }
29704
+ form.resetFields();
29705
+ form.setFieldsValue({
29706
+ mappingMode: "hybrid"
29707
+ });
29708
+ }, [installation, form]);
29709
+ const handleSubmit = async () => {
29710
+ const values = await form.validateFields();
29711
+ const config = {
29712
+ appId: values.appId,
29713
+ appSecret: values.appSecret,
29714
+ verificationToken: values.verificationToken,
29715
+ encryptKey: values.encryptKey,
29716
+ mappingMode: values.mappingMode,
29717
+ assistantId: values.assistantId,
29718
+ workspaceId: values.workspaceId,
29719
+ projectId: values.projectId
29720
+ };
29721
+ try {
29722
+ if (installation) {
29723
+ const payload2 = {
29724
+ name: values.name,
29725
+ config
29726
+ };
29727
+ const result2 = await put(
29728
+ `/api/channel-installations/${installation.id}`,
29729
+ payload2
29730
+ );
29731
+ if (result2.success) {
29732
+ message20.success("Installation updated");
29733
+ onSave();
29734
+ } else {
29735
+ message20.error(result2.message || "Failed to update installation");
29736
+ }
29737
+ return;
29738
+ }
29739
+ const payload = {
29740
+ channel: "lark",
29741
+ name: values.name,
29742
+ config
29743
+ };
29744
+ const result = await post(
29745
+ "/api/channel-installations",
29746
+ payload
29747
+ );
29748
+ if (result.success) {
29749
+ message20.success("Installation created");
29750
+ onSave();
29751
+ } else {
29752
+ message20.error(result.message || "Failed to create installation");
29753
+ }
29754
+ } catch (error) {
29755
+ console.error("Failed to save channel installation:", error);
29756
+ message20.error(
29757
+ installation ? "Failed to update installation" : "Failed to create installation"
29758
+ );
29759
+ }
29760
+ };
29761
+ return /* @__PURE__ */ jsx116(
29762
+ Modal20,
29763
+ {
29764
+ open,
29765
+ title: installation ? "Edit Installation" : "Add Installation",
29766
+ onCancel,
29767
+ onOk: handleSubmit,
29768
+ okText: installation ? "Save" : "Create",
29769
+ destroyOnHidden: true,
29770
+ children: /* @__PURE__ */ jsxs82(Form7, { form, layout: "vertical", children: [
29771
+ /* @__PURE__ */ jsx116(Form7.Item, { label: "Channel", children: /* @__PURE__ */ jsx116(Input15, { value: "lark", disabled: true }) }),
29772
+ /* @__PURE__ */ jsx116(Form7.Item, { name: "name", label: "Name", children: /* @__PURE__ */ jsx116(Input15, {}) }),
29773
+ /* @__PURE__ */ jsx116(
29774
+ Form7.Item,
29775
+ {
29776
+ name: "appId",
29777
+ label: "App ID",
29778
+ rules: [{ required: true, message: "App ID is required" }],
29779
+ children: /* @__PURE__ */ jsx116(Input15, {})
29780
+ }
29781
+ ),
29782
+ /* @__PURE__ */ jsx116(
29783
+ Form7.Item,
29784
+ {
29785
+ name: "appSecret",
29786
+ label: "App Secret",
29787
+ rules: [{ required: true, message: "App Secret is required" }],
29788
+ children: /* @__PURE__ */ jsx116(Input15, {})
29789
+ }
29790
+ ),
29791
+ /* @__PURE__ */ jsx116(Form7.Item, { name: "verificationToken", label: "Verification Token", children: /* @__PURE__ */ jsx116(Input15, {}) }),
29792
+ /* @__PURE__ */ jsx116(Form7.Item, { name: "encryptKey", label: "Encrypt Key", children: /* @__PURE__ */ jsx116(Input15, {}) }),
29793
+ /* @__PURE__ */ jsx116(
29794
+ Form7.Item,
29795
+ {
29796
+ name: "mappingMode",
29797
+ label: "Mapping Mode",
29798
+ rules: [{ required: true, message: "Mapping Mode is required" }],
29799
+ children: /* @__PURE__ */ jsx116(Select8, { options: MAPPING_MODE_OPTIONS })
29800
+ }
29801
+ ),
29802
+ /* @__PURE__ */ jsx116(
29803
+ Form7.Item,
29804
+ {
29805
+ name: "assistantId",
29806
+ label: "Assistant ID",
29807
+ rules: [{ required: true, message: "Assistant ID is required" }],
29808
+ children: /* @__PURE__ */ jsx116(Input15, {})
29809
+ }
29810
+ ),
29811
+ /* @__PURE__ */ jsx116(Form7.Item, { name: "workspaceId", label: "Workspace ID", children: /* @__PURE__ */ jsx116(Input15, {}) }),
29812
+ /* @__PURE__ */ jsx116(Form7.Item, { name: "projectId", label: "Project ID", children: /* @__PURE__ */ jsx116(Input15, {}) })
29813
+ ] })
29814
+ }
29815
+ );
29816
+ };
29454
29817
  export {
29455
29818
  AgentConversations,
29456
29819
  AgentThreadProvider,
@@ -29461,6 +29824,7 @@ export {
29461
29824
  AuthProvider,
29462
29825
  AxiomLatticeProvider,
29463
29826
  ChangePasswordModal,
29827
+ ChannelInstallationsDrawerContent,
29464
29828
  ChatUIContext,
29465
29829
  ChatUIContextProvider,
29466
29830
  Chating,
@@ -29468,6 +29832,7 @@ export {
29468
29832
  ConversationContext,
29469
29833
  ConversationContextProvider,
29470
29834
  CreateAssistantModal_default as CreateAssistantModal,
29835
+ DEFAULT_MIDDLEWARE_TYPES,
29471
29836
  FileExplorer,
29472
29837
  LatticeChat,
29473
29838
  LatticeChatShell,