@axiom-lattice/react-sdk 2.1.61 → 2.1.63

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
  };
@@ -991,20 +991,20 @@ var DEFAULT_MIDDLEWARE_TYPES = [
991
991
  type: "object",
992
992
  title: "Filesystem Configuration",
993
993
  description: "Configure filesystem isolation and access settings",
994
- required: ["isolatedLevel"],
994
+ required: ["vmIsolation"],
995
995
  properties: {
996
- isolatedLevel: {
996
+ vmIsolation: {
997
997
  type: "string",
998
- title: "Isolation Level",
999
- description: "Controls how filesystem access is isolated between agents and threads",
1000
- enum: ["global", "agent", "thread"],
998
+ title: "VM Isolation",
999
+ description: "Controls how filesystem access is isolated between agents and projects",
1000
+ enum: ["global", "agent", "project"],
1001
1001
  default: "global",
1002
1002
  widget: "segmented"
1003
1003
  }
1004
1004
  }
1005
1005
  },
1006
1006
  defaultConfig: {
1007
- isolatedLevel: "global"
1007
+ vmIsolation: "global"
1008
1008
  },
1009
1009
  tools: [
1010
1010
  { id: "sandbox_ls", name: "List Files", description: "List files in the directory" },
@@ -1024,20 +1024,20 @@ var DEFAULT_MIDDLEWARE_TYPES = [
1024
1024
  type: "object",
1025
1025
  title: "Code Evaluation Configuration",
1026
1026
  description: "Configure code execution sandbox settings",
1027
- required: ["isolatedLevel"],
1027
+ required: ["vmIsolation"],
1028
1028
  properties: {
1029
- isolatedLevel: {
1029
+ vmIsolation: {
1030
1030
  type: "string",
1031
- title: "Isolation Level",
1032
- description: "Controls how code execution is isolated between agents and threads",
1033
- enum: ["global", "agent", "thread"],
1031
+ title: "VM Isolation",
1032
+ description: "Controls how code execution is isolated between agents and projects",
1033
+ enum: ["global", "agent", "project"],
1034
1034
  default: "global",
1035
1035
  widget: "segmented"
1036
1036
  }
1037
1037
  }
1038
1038
  },
1039
1039
  defaultConfig: {
1040
- isolatedLevel: "global"
1040
+ vmIsolation: "global"
1041
1041
  },
1042
1042
  tools: [
1043
1043
  { id: "execute_code", name: "Execute Code", description: "Execute code snippets" },
@@ -1053,20 +1053,20 @@ var DEFAULT_MIDDLEWARE_TYPES = [
1053
1053
  type: "object",
1054
1054
  title: "Browser Configuration",
1055
1055
  description: "Configure browser automation settings",
1056
- required: ["isolatedLevel"],
1056
+ required: ["vmIsolation"],
1057
1057
  properties: {
1058
- isolatedLevel: {
1058
+ vmIsolation: {
1059
1059
  type: "string",
1060
- title: "Isolation Level",
1061
- description: "Controls how browser instances are isolated between agents and threads",
1062
- enum: ["global", "agent", "thread"],
1060
+ title: "VM Isolation",
1061
+ description: "Controls how browser instances are isolated between agents and projects",
1062
+ enum: ["global", "agent", "project"],
1063
1063
  default: "agent",
1064
1064
  widget: "segmented"
1065
1065
  }
1066
1066
  }
1067
1067
  },
1068
1068
  defaultConfig: {
1069
- isolatedLevel: "agent",
1069
+ vmIsolation: "agent",
1070
1070
  headless: true
1071
1071
  },
1072
1072
  tools: [
@@ -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, {})
@@ -5249,7 +5355,7 @@ import { Spin as Spin2, Alert as Alert4, Button as Button7 } from "antd";
5249
5355
  import { createStyles as createStyles4 } from "antd-style";
5250
5356
 
5251
5357
  // src/components/GenUI/MarkdownViewer.tsx
5252
- import { useState as useState18, useEffect as useEffect11, useRef as useRef9 } from "react";
5358
+ import React9, { useState as useState18, useEffect as useEffect11, useRef as useRef9 } from "react";
5253
5359
  import { Button as Button6, Tooltip, message } from "antd";
5254
5360
  import {
5255
5361
  CopyOutlined,
@@ -5261,6 +5367,233 @@ import {
5261
5367
  import { jsPDF } from "jspdf";
5262
5368
  import html2canvas from "html2canvas";
5263
5369
  import { createStyles as createStyles3 } from "antd-style";
5370
+
5371
+ // src/utils/fileUtils.ts
5372
+ function extractFileName(pathOrUrl) {
5373
+ if (!pathOrUrl) return "";
5374
+ const withoutQuery = pathOrUrl.split("?")[0];
5375
+ return withoutQuery.split("/").pop() || pathOrUrl;
5376
+ }
5377
+ function getFileExtension(pathOrUrl) {
5378
+ const fileName = extractFileName(pathOrUrl);
5379
+ if (!fileName) return "";
5380
+ const extension = fileName.split(".").pop()?.toLowerCase();
5381
+ return extension || "";
5382
+ }
5383
+ function getFileCategory(pathOrUrl) {
5384
+ const extension = getFileExtension(pathOrUrl);
5385
+ if (!extension) return "unknown";
5386
+ if (["md", "markdown", "mdx"].includes(extension)) return "markdown";
5387
+ if ([
5388
+ "txt",
5389
+ "json",
5390
+ "csv",
5391
+ "xml",
5392
+ "yaml",
5393
+ "yml",
5394
+ "ini",
5395
+ "conf",
5396
+ "sh",
5397
+ "bat",
5398
+ "cmd",
5399
+ "ts",
5400
+ "tsx",
5401
+ "js",
5402
+ "jsx",
5403
+ "mjs",
5404
+ "cjs",
5405
+ "py",
5406
+ "rb",
5407
+ "go",
5408
+ "rs",
5409
+ "java",
5410
+ "kt",
5411
+ "swift",
5412
+ "c",
5413
+ "cpp",
5414
+ "h",
5415
+ "hpp",
5416
+ "cs",
5417
+ "php",
5418
+ "vue",
5419
+ "svelte",
5420
+ "sql",
5421
+ "css",
5422
+ "less",
5423
+ "scss",
5424
+ "bash",
5425
+ "zsh",
5426
+ "toml"
5427
+ ].includes(extension)) {
5428
+ return "text";
5429
+ }
5430
+ if (["jpg", "jpeg", "png", "gif", "svg", "bmp", "webp", "ico", "tiff", "tif"].includes(extension)) {
5431
+ return "image";
5432
+ }
5433
+ if (extension === "pdf") return "pdf";
5434
+ if (["mp3", "wav", "ogg", "flac", "aac", "m4a", "wma"].includes(extension)) return "audio";
5435
+ if (["mp4", "webm", "ogv", "mov", "avi", "mkv", "flv"].includes(extension)) return "video";
5436
+ if (["html", "htm"].includes(extension)) return "iframe";
5437
+ return "unknown";
5438
+ }
5439
+ function getLanguageFromFileName(pathOrUrl) {
5440
+ const ext = getFileExtension(pathOrUrl);
5441
+ switch (ext) {
5442
+ case "ts":
5443
+ case "tsx":
5444
+ return "typescript";
5445
+ case "js":
5446
+ case "jsx":
5447
+ case "mjs":
5448
+ case "cjs":
5449
+ return "javascript";
5450
+ case "py":
5451
+ return "python";
5452
+ case "rb":
5453
+ return "ruby";
5454
+ case "go":
5455
+ return "go";
5456
+ case "md":
5457
+ case "markdown":
5458
+ case "mdx":
5459
+ return "markdown";
5460
+ case "json":
5461
+ return "json";
5462
+ case "html":
5463
+ case "htm":
5464
+ return "html";
5465
+ case "css":
5466
+ return "css";
5467
+ case "less":
5468
+ return "less";
5469
+ case "scss":
5470
+ return "scss";
5471
+ case "java":
5472
+ return "java";
5473
+ case "kt":
5474
+ return "kotlin";
5475
+ case "swift":
5476
+ return "swift";
5477
+ case "rs":
5478
+ return "rust";
5479
+ case "c":
5480
+ case "h":
5481
+ return "c";
5482
+ case "cpp":
5483
+ case "hpp":
5484
+ return "cpp";
5485
+ case "cs":
5486
+ return "csharp";
5487
+ case "php":
5488
+ return "php";
5489
+ case "vue":
5490
+ return "vue";
5491
+ case "svelte":
5492
+ return "svelte";
5493
+ case "yaml":
5494
+ case "yml":
5495
+ return "yaml";
5496
+ case "sql":
5497
+ return "sql";
5498
+ case "sh":
5499
+ case "bash":
5500
+ case "zsh":
5501
+ return "bash";
5502
+ case "toml":
5503
+ return "toml";
5504
+ case "xml":
5505
+ return "xml";
5506
+ case "ini":
5507
+ case "conf":
5508
+ return "ini";
5509
+ default:
5510
+ return "text";
5511
+ }
5512
+ }
5513
+ function canPreviewInline(pathOrUrl) {
5514
+ const category = getFileCategory(pathOrUrl);
5515
+ return category !== "unknown";
5516
+ }
5517
+ function isTextFile(pathOrUrl) {
5518
+ const category = getFileCategory(pathOrUrl);
5519
+ return category === "markdown" || category === "text";
5520
+ }
5521
+ var COMMON_FILE_EXTENSIONS = /* @__PURE__ */ new Set([
5522
+ // Code
5523
+ "ts",
5524
+ "tsx",
5525
+ "js",
5526
+ "jsx",
5527
+ "mjs",
5528
+ "cjs",
5529
+ "html",
5530
+ "htm",
5531
+ "css",
5532
+ "less",
5533
+ "scss",
5534
+ "md",
5535
+ "txt",
5536
+ "mdx",
5537
+ "json",
5538
+ "yaml",
5539
+ "yml",
5540
+ "py",
5541
+ "rb",
5542
+ "go",
5543
+ "rs",
5544
+ "java",
5545
+ "kt",
5546
+ "swift",
5547
+ "c",
5548
+ "cpp",
5549
+ "h",
5550
+ "hpp",
5551
+ "cs",
5552
+ "php",
5553
+ "vue",
5554
+ "svelte",
5555
+ "sql",
5556
+ "sh",
5557
+ "bash",
5558
+ "zsh",
5559
+ "toml",
5560
+ "xml",
5561
+ // Media
5562
+ "png",
5563
+ "jpg",
5564
+ "jpeg",
5565
+ "gif",
5566
+ "svg",
5567
+ "webp",
5568
+ "ico",
5569
+ "mp4",
5570
+ "webm",
5571
+ "mp3",
5572
+ "wav",
5573
+ "pdf",
5574
+ // Office
5575
+ "ppt",
5576
+ "pptx",
5577
+ "doc",
5578
+ "docx",
5579
+ "xls",
5580
+ "xlsx",
5581
+ "odt",
5582
+ "ods",
5583
+ "odp",
5584
+ "rtf",
5585
+ "csv",
5586
+ "key",
5587
+ "numbers",
5588
+ "pages"
5589
+ ]);
5590
+ function isFileName(value) {
5591
+ if (!value || typeof value !== "string" || !value.trim()) return false;
5592
+ const ext = getFileExtension(value);
5593
+ return ext ? COMMON_FILE_EXTENSIONS.has(ext) : false;
5594
+ }
5595
+
5596
+ // src/components/GenUI/MarkdownViewer.tsx
5264
5597
  import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
5265
5598
  var useStyles = createStyles3(({ token, css }) => ({
5266
5599
  container: css`
@@ -5413,6 +5746,15 @@ var MarkdownViewer = ({
5413
5746
  message.error({ content: "Failed to generate PDF", key: "pdf" });
5414
5747
  }
5415
5748
  };
5749
+ const displayContent = React9.useMemo(() => {
5750
+ const lang = getLanguageFromFileName(fileName);
5751
+ if (lang && lang !== "markdown" && lang !== "text") {
5752
+ return `\`\`\`${lang}
5753
+ ${content}
5754
+ \`\`\``;
5755
+ }
5756
+ return content;
5757
+ }, [content, fileName]);
5416
5758
  return /* @__PURE__ */ jsxs8("div", { className: cx(styles.container, className), style, children: [
5417
5759
  /* @__PURE__ */ jsxs8("div", { className: styles.header, children: [
5418
5760
  /* @__PURE__ */ jsx16(Tooltip, { title: "Copy Content", children: /* @__PURE__ */ jsx16(
@@ -5452,125 +5794,12 @@ var MarkdownViewer = ({
5452
5794
  }
5453
5795
  ) })
5454
5796
  ] }),
5455
- /* @__PURE__ */ jsx16("div", { className: styles.contentBody, ref: contentRef, children: /* @__PURE__ */ jsx16(MDResponse, { content }) })
5797
+ /* @__PURE__ */ jsx16("div", { className: styles.contentBody, ref: contentRef, children: /* @__PURE__ */ jsx16(MDResponse, { content: displayContent }) })
5456
5798
  ] });
5457
5799
  };
5458
5800
 
5459
5801
  // src/components/GenUI/FileRenderer.tsx
5460
5802
  import { FileImageOutlined, FilePdfOutlined as FilePdfOutlined2, FileTextOutlined, FileUnknownOutlined } from "@ant-design/icons";
5461
-
5462
- // src/utils/fileUtils.ts
5463
- function extractFileName(pathOrUrl) {
5464
- if (!pathOrUrl) return "";
5465
- const withoutQuery = pathOrUrl.split("?")[0];
5466
- return withoutQuery.split("/").pop() || pathOrUrl;
5467
- }
5468
- function getFileExtension(pathOrUrl) {
5469
- const fileName = extractFileName(pathOrUrl);
5470
- if (!fileName) return "";
5471
- const extension = fileName.split(".").pop()?.toLowerCase();
5472
- return extension || "";
5473
- }
5474
- function getFileCategory(pathOrUrl) {
5475
- const extension = getFileExtension(pathOrUrl);
5476
- if (!extension) return "unknown";
5477
- if (["md", "markdown", "mdx"].includes(extension)) return "markdown";
5478
- if (["txt", "json", "csv", "xml", "yaml", "yml", "ini", "conf", "sh", "bat", "cmd"].includes(extension)) {
5479
- return "text";
5480
- }
5481
- if (["jpg", "jpeg", "png", "gif", "svg", "bmp", "webp", "ico", "tiff", "tif"].includes(extension)) {
5482
- return "image";
5483
- }
5484
- if (extension === "pdf") return "pdf";
5485
- if (["mp3", "wav", "ogg", "flac", "aac", "m4a", "wma"].includes(extension)) return "audio";
5486
- if (["mp4", "webm", "ogv", "mov", "avi", "mkv", "flv"].includes(extension)) return "video";
5487
- if (["html", "htm"].includes(extension)) return "iframe";
5488
- return "unknown";
5489
- }
5490
- function canPreviewInline(pathOrUrl) {
5491
- const category = getFileCategory(pathOrUrl);
5492
- return category !== "unknown";
5493
- }
5494
- function isTextFile(pathOrUrl) {
5495
- const category = getFileCategory(pathOrUrl);
5496
- return category === "markdown" || category === "text";
5497
- }
5498
- var COMMON_FILE_EXTENSIONS = /* @__PURE__ */ new Set([
5499
- // Code
5500
- "ts",
5501
- "tsx",
5502
- "js",
5503
- "jsx",
5504
- "mjs",
5505
- "cjs",
5506
- "html",
5507
- "htm",
5508
- "css",
5509
- "less",
5510
- "scss",
5511
- "md",
5512
- "txt",
5513
- "mdx",
5514
- "json",
5515
- "yaml",
5516
- "yml",
5517
- "py",
5518
- "rb",
5519
- "go",
5520
- "rs",
5521
- "java",
5522
- "kt",
5523
- "swift",
5524
- "c",
5525
- "cpp",
5526
- "h",
5527
- "hpp",
5528
- "cs",
5529
- "php",
5530
- "vue",
5531
- "svelte",
5532
- "sql",
5533
- "sh",
5534
- "bash",
5535
- "zsh",
5536
- "toml",
5537
- "xml",
5538
- // Media
5539
- "png",
5540
- "jpg",
5541
- "jpeg",
5542
- "gif",
5543
- "svg",
5544
- "webp",
5545
- "ico",
5546
- "mp4",
5547
- "webm",
5548
- "mp3",
5549
- "wav",
5550
- "pdf",
5551
- // Office
5552
- "ppt",
5553
- "pptx",
5554
- "doc",
5555
- "docx",
5556
- "xls",
5557
- "xlsx",
5558
- "odt",
5559
- "ods",
5560
- "odp",
5561
- "rtf",
5562
- "csv",
5563
- "key",
5564
- "numbers",
5565
- "pages"
5566
- ]);
5567
- function isFileName(value) {
5568
- if (!value || typeof value !== "string" || !value.trim()) return false;
5569
- const ext = getFileExtension(value);
5570
- return ext ? COMMON_FILE_EXTENSIONS.has(ext) : false;
5571
- }
5572
-
5573
- // src/components/GenUI/FileRenderer.tsx
5574
5803
  import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
5575
5804
  var useStyles2 = createStyles4(({ token, css }) => ({
5576
5805
  container: css`
@@ -5945,13 +6174,13 @@ var MDComponentWrap = (Element) => {
5945
6174
  // src/components/GenUI/elements/file_link.tsx
5946
6175
  import { Button as Button8 } from "antd";
5947
6176
  import { useMemo as useMemo5, useCallback as useCallback13 } from "react";
5948
- import { Fragment as Fragment3, jsx as jsx21 } from "react/jsx-runtime";
6177
+ import { Fragment as Fragment2, jsx as jsx21 } from "react/jsx-runtime";
5949
6178
  var FileLink = ({ data }) => {
5950
6179
  if (!data) {
5951
6180
  return null;
5952
6181
  }
5953
6182
  if (!isFileName(data)) {
5954
- return /* @__PURE__ */ jsx21(Fragment3, { children: data });
6183
+ return /* @__PURE__ */ jsx21(Fragment2, { children: data });
5955
6184
  }
5956
6185
  const { openSideApp } = useChatUIContext();
5957
6186
  const { threadId, assistantId } = useConversationContext();
@@ -6146,7 +6375,7 @@ var useStyles4 = createStyles6(({ token, css }) => ({
6146
6375
  }
6147
6376
  `
6148
6377
  }));
6149
- var MarkdownErrorBoundary = class extends React12.Component {
6378
+ var MarkdownErrorBoundary = class extends React13.Component {
6150
6379
  constructor(props) {
6151
6380
  super(props);
6152
6381
  this.state = { hasError: false };
@@ -6164,7 +6393,7 @@ var MarkdownErrorBoundary = class extends React12.Component {
6164
6393
  return this.props.children;
6165
6394
  }
6166
6395
  };
6167
- var SafeXMarkdown = React12.memo(({ content, components, className }) => {
6396
+ var SafeXMarkdown = React13.memo(({ content, components, className }) => {
6168
6397
  const deferredContent = useDeferredValue(content);
6169
6398
  if (typeof deferredContent !== "string") {
6170
6399
  console.warn("[MDResponse] Content is not a string:", typeof deferredContent, deferredContent);
@@ -6199,7 +6428,7 @@ var MDResponseInner = ({
6199
6428
  }
6200
6429
  ) });
6201
6430
  };
6202
- var MDResponse = React12.memo(MDResponseInner);
6431
+ var MDResponse = React13.memo(MDResponseInner);
6203
6432
  MDResponse.displayName = "MDResponse";
6204
6433
  var MDViewFormItem = ({ value }) => {
6205
6434
  return /* @__PURE__ */ jsx23(MDResponse, { content: value || "" });
@@ -6212,11 +6441,11 @@ var ConfirmFeedback = ({
6212
6441
  data,
6213
6442
  interactive = true
6214
6443
  }) => {
6215
- const { message: message20, type, config, feedback, options } = data ?? {};
6444
+ const { message: message21, type, config, feedback, options } = data ?? {};
6216
6445
  const { sendMessage } = useAgentChat();
6217
6446
  const [clicked, setClicked] = useState21(false);
6218
6447
  return /* @__PURE__ */ jsxs11(Space3, { direction: "vertical", style: { width: "100%" }, children: [
6219
- /* @__PURE__ */ jsx24(MDResponse, { content: message20 }),
6448
+ /* @__PURE__ */ jsx24(MDResponse, { content: message21 }),
6220
6449
  options ? /* @__PURE__ */ jsx24(Space3, { style: { justifyContent: "flex-end", width: "100%" }, children: options?.map((option) => /* @__PURE__ */ jsx24(
6221
6450
  Button9,
6222
6451
  {
@@ -6294,7 +6523,7 @@ var ConfirmFeedback = ({
6294
6523
  // src/components/GenUI/elements/clarify_feedback.tsx
6295
6524
  import { Button as Button10, Space as Space4, Typography as Typography5, List, Checkbox, Input as Input3 } from "antd";
6296
6525
  import { useState as useState22 } from "react";
6297
- import { Fragment as Fragment4, jsx as jsx25, jsxs as jsxs12 } from "react/jsx-runtime";
6526
+ import { Fragment as Fragment3, jsx as jsx25, jsxs as jsxs12 } from "react/jsx-runtime";
6298
6527
  var { Text: Text5 } = Typography5;
6299
6528
  var ClarifyFeedback = ({
6300
6529
  data,
@@ -6403,7 +6632,7 @@ var ClarifyFeedback = ({
6403
6632
  }
6404
6633
  )
6405
6634
  ] }),
6406
- /* @__PURE__ */ jsx25(Space4, { direction: "vertical", style: { width: "100%" }, size: 4, children: currentQuestion.type === "single" ? /* @__PURE__ */ jsxs12(Fragment4, { children: [
6635
+ /* @__PURE__ */ jsx25(Space4, { direction: "vertical", style: { width: "100%" }, size: 4, children: currentQuestion.type === "single" ? /* @__PURE__ */ jsxs12(Fragment3, { children: [
6407
6636
  /* @__PURE__ */ jsx25(
6408
6637
  List,
6409
6638
  {
@@ -7470,7 +7699,7 @@ var AttachmentsCard = ({
7470
7699
  const { config } = useLatticeChatShellContext();
7471
7700
  const baseURL = config.baseURL;
7472
7701
  const fileBaseURL = `${baseURL}/api/assistants/${assistantId}/threads/${threadId}/sandbox/downloadfile?path=`;
7473
- const { Text: Text38 } = Typography10;
7702
+ const { Text: Text39 } = Typography10;
7474
7703
  const [showAll, setShowAll] = useState25(false);
7475
7704
  const { openSideApp } = useChatUIContext();
7476
7705
  const getStyles = () => {
@@ -7544,7 +7773,7 @@ var AttachmentsCard = ({
7544
7773
  );
7545
7774
  };
7546
7775
  const renderFileDescription = (item) => /* @__PURE__ */ jsx34(Space9, { direction: "vertical", size: size === "small" ? 2 : 4, children: /* @__PURE__ */ jsx34(Space9, { children: /* @__PURE__ */ jsx34(
7547
- Text38,
7776
+ Text39,
7548
7777
  {
7549
7778
  type: "secondary",
7550
7779
  style: {
@@ -7618,7 +7847,7 @@ var AttachmentsCard = ({
7618
7847
  }
7619
7848
  ),
7620
7849
  item.files && /* @__PURE__ */ jsxs18("div", { style: { paddingLeft: "12px" }, children: [
7621
- /* @__PURE__ */ jsxs18(Text38, { type: "secondary", style: { fontSize: "12px" }, children: [
7850
+ /* @__PURE__ */ jsxs18(Text39, { type: "secondary", style: { fontSize: "12px" }, children: [
7622
7851
  "Contains ",
7623
7852
  item.files.length,
7624
7853
  " file(s)"
@@ -7669,7 +7898,7 @@ var RenderMDFromURL = ({ url, file_id }) => {
7669
7898
  };
7670
7899
 
7671
7900
  // src/components/GenUI/elements/attachments_viewer_side_app.tsx
7672
- import { Fragment as Fragment5, jsx as jsx36, jsxs as jsxs19 } from "react/jsx-runtime";
7901
+ import { Fragment as Fragment4, jsx as jsx36, jsxs as jsxs19 } from "react/jsx-runtime";
7673
7902
  function AttachmentsViewerSideApp({
7674
7903
  data,
7675
7904
  component_key
@@ -7708,7 +7937,7 @@ function AttachmentsViewerSideApp({
7708
7937
  return /* @__PURE__ */ jsx36(
7709
7938
  Empty2,
7710
7939
  {
7711
- description: /* @__PURE__ */ jsxs19(Fragment5, { children: [
7940
+ description: /* @__PURE__ */ jsxs19(Fragment4, { children: [
7712
7941
  /* @__PURE__ */ jsx36("div", { children: "Preview not supported. Please download to view." }),
7713
7942
  /* @__PURE__ */ jsxs19(Button14, { type: "link", href: fileUri?.url, download: fileUri?.fileName, children: [
7714
7943
  "Download ",
@@ -7729,7 +7958,7 @@ import { Collapse as Collapse5 } from "antd";
7729
7958
  import { createStyles as createStyles10 } from "antd-style";
7730
7959
  import { DownOutlined as DownOutlined3, UpOutlined as UpOutlined2 } from "@ant-design/icons";
7731
7960
  import CollapsePanel3 from "antd/es/collapse/CollapsePanel";
7732
- import { Fragment as Fragment6, jsx as jsx37, jsxs as jsxs20 } from "react/jsx-runtime";
7961
+ import { Fragment as Fragment5, jsx as jsx37, jsxs as jsxs20 } from "react/jsx-runtime";
7733
7962
  var DEFAULT_COLLAPSED_MAX_HEIGHT = 180;
7734
7963
  var DEFAULT_EXPANDED_MAX_HEIGHT = 500;
7735
7964
  var useStyle4 = createStyles10(
@@ -7846,10 +8075,10 @@ var ContentPreviewCollapse = ({
7846
8075
  children: /* @__PURE__ */ jsx37("div", { ref: contentRef, className: styles.content, children })
7847
8076
  }
7848
8077
  ),
7849
- isOverflowing && /* @__PURE__ */ jsx37("div", { className: styles.toggleButton, onClick: handleToggleContent, children: showFullContent ? /* @__PURE__ */ jsxs20(Fragment6, { children: [
8078
+ isOverflowing && /* @__PURE__ */ jsx37("div", { className: styles.toggleButton, onClick: handleToggleContent, children: showFullContent ? /* @__PURE__ */ jsxs20(Fragment5, { children: [
7850
8079
  /* @__PURE__ */ jsx37(UpOutlined2, { style: { fontSize: 10 } }),
7851
8080
  /* @__PURE__ */ jsx37("span", { children: showLessText })
7852
- ] }) : /* @__PURE__ */ jsxs20(Fragment6, { children: [
8081
+ ] }) : /* @__PURE__ */ jsxs20(Fragment5, { children: [
7853
8082
  /* @__PURE__ */ jsx37(DownOutlined3, { style: { fontSize: 10 } }),
7854
8083
  /* @__PURE__ */ jsx37("span", { children: showAllText })
7855
8084
  ] }) })
@@ -8306,7 +8535,7 @@ import {
8306
8535
  } from "react";
8307
8536
  import { jsx as jsx42 } from "react/jsx-runtime";
8308
8537
  var LazyBubble = ({
8309
- message: message20,
8538
+ message: message21,
8310
8539
  renderContent,
8311
8540
  autoLoadRightPanel
8312
8541
  }) => {
@@ -8337,10 +8566,10 @@ var LazyBubble = ({
8337
8566
  autoLoadRightPanel?.();
8338
8567
  }, []);
8339
8568
  const getPlaceholder = () => {
8340
- const estimatedHeight = message20.content ? Math.min(100, message20.content.length / 5) : 100;
8569
+ const estimatedHeight = message21.content ? Math.min(100, message21.content.length / 5) : 100;
8341
8570
  return /* @__PURE__ */ jsx42("div", { style: { height: `${estimatedHeight}px`, minHeight: "50px" } });
8342
8571
  };
8343
- return /* @__PURE__ */ jsx42(ErrorBoundary, { children: /* @__PURE__ */ jsx42("div", { ref, style: { width: "100%" }, children: isVisible || wasEverVisible ? renderContent(message20) : getPlaceholder() }) });
8572
+ return /* @__PURE__ */ jsx42(ErrorBoundary, { children: /* @__PURE__ */ jsx42("div", { ref, style: { width: "100%" }, children: isVisible || wasEverVisible ? renderContent(message21) : getPlaceholder() }) });
8344
8573
  };
8345
8574
  var MemoizedBubbleList = memo(
8346
8575
  ({
@@ -8371,8 +8600,8 @@ var MessageList = ({
8371
8600
  messageLengthRef.current = messages?.length;
8372
8601
  }
8373
8602
  }, [messages?.length]);
8374
- const renderContent = useCallback16((message20) => {
8375
- const { content } = message20;
8603
+ const renderContent = useCallback16((message21) => {
8604
+ const { content } = message21;
8376
8605
  try {
8377
8606
  const json = JSON.parse(content);
8378
8607
  if (json.action && json.message) {
@@ -8380,7 +8609,7 @@ var MessageList = ({
8380
8609
  }
8381
8610
  } catch (error) {
8382
8611
  }
8383
- const tool_calls_md = message20.tool_calls?.map((tool_call) => {
8612
+ const tool_calls_md = message21.tool_calls?.map((tool_call) => {
8384
8613
  return `\`\`\`tool_call
8385
8614
  ${JSON.stringify(tool_call)}
8386
8615
  \`\`\``;
@@ -8389,17 +8618,17 @@ ${JSON.stringify(tool_call)}
8389
8618
  return /* @__PURE__ */ jsx42(Space12, { direction: "vertical", style: { width: "100%" }, children: /* @__PURE__ */ jsx42(MDResponse, { content: content_md }) });
8390
8619
  }, []);
8391
8620
  const items = useMemo9(
8392
- () => messages.map((message20, index) => ({
8393
- key: message20.id,
8394
- role: message20.role,
8621
+ () => messages.map((message21, index) => ({
8622
+ key: message21.id,
8623
+ role: message21.role,
8395
8624
  typing: false,
8396
8625
  content: /* @__PURE__ */ jsx42(
8397
8626
  LazyBubble,
8398
8627
  {
8399
- message: message20,
8628
+ message: message21,
8400
8629
  renderContent,
8401
8630
  autoLoadRightPanel: () => {
8402
- const { content, role: role2 } = message20;
8631
+ const { content, role: role2 } = message21;
8403
8632
  const isNewAddedMessage = messageLengthRef.current > 1 && messageLengthRef.current + 1 === messages.length;
8404
8633
  if (index === messages.length - 1 && isNewAddedMessage && role2 === "ai") {
8405
8634
  try {
@@ -8476,7 +8705,7 @@ import {
8476
8705
  Space as Space28,
8477
8706
  Typography as Typography33
8478
8707
  } from "antd";
8479
- import React42, { useCallback as useCallback26, useContext as useContext10, useEffect as useEffect35, useRef as useRef21, useState as useState54 } from "react";
8708
+ import React43, { useCallback as useCallback26, useContext as useContext10, useEffect as useEffect35, useRef as useRef21, useState as useState54 } from "react";
8480
8709
  import { BrainCircuit as BrainCircuit3 } from "lucide-react";
8481
8710
 
8482
8711
  // src/components/GenUI/HITLContainer.tsx
@@ -9426,7 +9655,7 @@ var AgentHeader = ({
9426
9655
  import { useCallback as useCallback18, useContext as useContext8 } from "react";
9427
9656
  import { Tooltip as Tooltip9, Button as Button23, Dropdown } from "antd";
9428
9657
  import { HistoryOutlined, PlusOutlined } from "@ant-design/icons";
9429
- import { Fragment as Fragment7, jsx as jsx55, jsxs as jsxs30 } from "react/jsx-runtime";
9658
+ import { Fragment as Fragment6, jsx as jsx55, jsxs as jsxs30 } from "react/jsx-runtime";
9430
9659
  var CreateThreadButton = () => {
9431
9660
  const { createThread, assistantId, isLoading } = useConversationContext();
9432
9661
  const { config } = useLatticeChatShellContext();
@@ -9527,14 +9756,14 @@ var ThreadManagementButtons = () => {
9527
9756
  if (!conversationContext.assistantId) {
9528
9757
  return null;
9529
9758
  }
9530
- return /* @__PURE__ */ jsxs30(Fragment7, { children: [
9759
+ return /* @__PURE__ */ jsxs30(Fragment6, { children: [
9531
9760
  showCreateButton && /* @__PURE__ */ jsx55(CreateThreadButton, {}),
9532
9761
  showListButton && /* @__PURE__ */ jsx55(ThreadListButton, {})
9533
9762
  ] });
9534
9763
  };
9535
9764
 
9536
9765
  // src/context/WorkspaceContext.tsx
9537
- import React34, {
9766
+ import React35, {
9538
9767
  createContext as createContext8,
9539
9768
  useContext as useContext9,
9540
9769
  useState as useState46,
@@ -9549,11 +9778,11 @@ import { FolderOpen as FolderOpen2, Activity as Activity3, Database as Database4
9549
9778
  import { Modal as Modal10, Avatar as Avatar7, Popover as Popover2, Button as Button35 } from "antd";
9550
9779
 
9551
9780
  // src/components/Chat/Menu.tsx
9552
- import React18, { useState as useState31, useMemo as useMemo10, useCallback as useCallback19 } from "react";
9781
+ import React19, { useState as useState31, useMemo as useMemo10, useCallback as useCallback19 } from "react";
9553
9782
  import { Drawer } from "antd";
9554
9783
  import { Plus, ChevronRight, ChevronDown, Cpu, PanelLeftClose } from "lucide-react";
9555
9784
  import { createStyles as createStyles16 } from "antd-style";
9556
- import { Fragment as Fragment8, jsx as jsx56, jsxs as jsxs31 } from "react/jsx-runtime";
9785
+ import { Fragment as Fragment7, jsx as jsx56, jsxs as jsxs31 } from "react/jsx-runtime";
9557
9786
  var DRAWER_STYLES = {
9558
9787
  wrapper: {
9559
9788
  background: "transparent",
@@ -9716,7 +9945,7 @@ var Menu = ({
9716
9945
  }, [forceIconMode, isIconView, isControlled, onCollapsedChange]);
9717
9946
  const renderIconMode = () => /* @__PURE__ */ jsxs31("div", { className: `${menuStyles.sidebar} ${styles.iconMode} ${className || ""}`, style, children: [
9718
9947
  /* @__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: [
9948
+ /* @__PURE__ */ jsx56("div", { className: styles.iconModeContainer, children: groupedItems.map(({ group, items: items2 }, groupIndex) => /* @__PURE__ */ jsxs31(React19.Fragment, { children: [
9720
9949
  groupIndex > 0 && /* @__PURE__ */ jsx56("div", { className: styles.iconModeDivider }),
9721
9950
  /* @__PURE__ */ jsx56("div", { className: styles.iconModeGroup, children: items2.map((item) => /* @__PURE__ */ jsx56(
9722
9951
  "button",
@@ -9767,7 +9996,7 @@ var Menu = ({
9767
9996
  items2.map((item) => {
9768
9997
  const isInline = item.inline ?? false;
9769
9998
  const isExpanded2 = expandedInlineDrawers.has(item.id);
9770
- return /* @__PURE__ */ jsxs31(React18.Fragment, { children: [
9999
+ return /* @__PURE__ */ jsxs31(React19.Fragment, { children: [
9771
10000
  /* @__PURE__ */ jsxs31(
9772
10001
  "button",
9773
10002
  {
@@ -9789,7 +10018,7 @@ var Menu = ({
9789
10018
  ] }, group || "ungrouped")) }),
9790
10019
  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
10020
  ] });
9792
- return /* @__PURE__ */ jsxs31(Fragment8, { children: [
10021
+ return /* @__PURE__ */ jsxs31(Fragment7, { children: [
9793
10022
  shouldShowIconMode ? renderIconMode() : renderExpandedMode(),
9794
10023
  items.filter((item) => item.type === "drawer").map((item) => /* @__PURE__ */ jsx56(
9795
10024
  Drawer,
@@ -10250,7 +10479,7 @@ var ProjectCardList = () => {
10250
10479
  }
10251
10480
  setIsCreateModalOpen(false);
10252
10481
  };
10253
- const formatDate5 = (date) => {
10482
+ const formatDate6 = (date) => {
10254
10483
  const d = typeof date === "string" ? new Date(date) : date;
10255
10484
  return d.toLocaleDateString("en-US", {
10256
10485
  month: "short",
@@ -10341,7 +10570,7 @@ var ProjectCardList = () => {
10341
10570
  /* @__PURE__ */ jsx58("h3", { className: styles.projectName, children: project.name }),
10342
10571
  /* @__PURE__ */ jsxs33("span", { className: styles.projectDate, children: [
10343
10572
  "Created ",
10344
- formatDate5(project.createdAt)
10573
+ formatDate6(project.createdAt)
10345
10574
  ] })
10346
10575
  ] })
10347
10576
  ] }) })
@@ -10359,7 +10588,7 @@ var ProjectCardList = () => {
10359
10588
  /* @__PURE__ */ jsx58("span", { className: styles.listProjectName, children: project.name }),
10360
10589
  /* @__PURE__ */ jsxs33("span", { className: styles.listProjectDate, children: [
10361
10590
  "Created ",
10362
- formatDate5(project.createdAt)
10591
+ formatDate6(project.createdAt)
10363
10592
  ] })
10364
10593
  ] })
10365
10594
  ] }, project.id))
@@ -11046,7 +11275,7 @@ import { useState as useState35, useEffect as useEffect21 } from "react";
11046
11275
  import { createStyles as createStyles18 } from "antd-style";
11047
11276
  import { Database as Database2, Plus as Plus4, Edit2 as Edit22, Trash2 as Trash22, TestTube2 as TestTube22, Loader2 as Loader22 } from "lucide-react";
11048
11277
  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";
11278
+ import { Fragment as Fragment8, jsx as jsx60, jsxs as jsxs35 } from "react/jsx-runtime";
11050
11279
  var { Text: Text15 } = Typography18;
11051
11280
  var { TextArea: TextArea2 } = Input6;
11052
11281
  var useStyles7 = createStyles18(({ token, css }) => ({
@@ -11236,7 +11465,7 @@ var DatabaseConfigDrawerContent = ({
11236
11465
  configItem.id
11237
11466
  ] }),
11238
11467
  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: [
11468
+ /* @__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
11469
  /* @__PURE__ */ jsxs35(Text15, { code: true, style: { fontSize: 12, marginRight: 8 }, children: [
11241
11470
  configItem.config.host || "localhost",
11242
11471
  ":",
@@ -11557,7 +11786,7 @@ var DatabaseConfigFormModal = ({
11557
11786
  import { useState as useState36, useEffect as useEffect22 } from "react";
11558
11787
  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
11788
  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";
11789
+ import { Fragment as Fragment9, jsx as jsx61, jsxs as jsxs36 } from "react/jsx-runtime";
11561
11790
  var { Text: Text16, Title: Title3 } = Typography19;
11562
11791
  var { TextArea: TextArea3 } = Input7;
11563
11792
  var { useToken: useToken3 } = theme4;
@@ -12015,7 +12244,7 @@ var McpConfigFormModal = ({
12015
12244
  }
12016
12245
  )
12017
12246
  ] }),
12018
- formData.transport === "stdio" ? /* @__PURE__ */ jsxs36(Fragment10, { children: [
12247
+ formData.transport === "stdio" ? /* @__PURE__ */ jsxs36(Fragment9, { children: [
12019
12248
  /* @__PURE__ */ jsxs36("div", { children: [
12020
12249
  /* @__PURE__ */ jsx61(Text16, { strong: true, children: "Command" }),
12021
12250
  /* @__PURE__ */ jsx61(
@@ -13032,7 +13261,7 @@ import {
13032
13261
  DeleteOutlined as DeleteOutlined2
13033
13262
  } from "@ant-design/icons";
13034
13263
  import { Activity as Activity2 } from "lucide-react";
13035
- import { Fragment as Fragment11, jsx as jsx63, jsxs as jsxs38 } from "react/jsx-runtime";
13264
+ import { Fragment as Fragment10, jsx as jsx63, jsxs as jsxs38 } from "react/jsx-runtime";
13036
13265
  var { TextArea: TextArea4 } = Input8;
13037
13266
  var { Text: Text18, Title: Title4 } = Typography21;
13038
13267
  var SectionCard = ({ title, icon, badge, children, defaultExpanded = true }) => {
@@ -13115,7 +13344,7 @@ var SectionCard = ({ title, icon, badge, children, defaultExpanded = true }) =>
13115
13344
  var renderConfigField = (propertyKey, property, value, onChange, token) => {
13116
13345
  const label = /* @__PURE__ */ jsxs38("span", { children: [
13117
13346
  property.title || propertyKey,
13118
- property.description && /* @__PURE__ */ jsxs38(Fragment11, { children: [
13347
+ property.description && /* @__PURE__ */ jsxs38(Fragment10, { children: [
13119
13348
  "\xA0",
13120
13349
  /* @__PURE__ */ jsx63(Tooltip11, { title: property.description, children: /* @__PURE__ */ jsx63(QuestionCircleOutlined, { style: { color: token.colorTextSecondary, cursor: "pointer" } }) })
13121
13350
  ] })
@@ -13629,7 +13858,7 @@ var MiddlewareSectionCard = ({ middleware, middlewareType, onToggle, onConfigCha
13629
13858
  if (key === "serverKeys" && middleware.config.connectAll === true) {
13630
13859
  return null;
13631
13860
  }
13632
- if (key === "isolatedLevel") {
13861
+ if (key === "vmIsolation") {
13633
13862
  return null;
13634
13863
  }
13635
13864
  return renderConfigField(
@@ -14226,7 +14455,7 @@ var AgentConfigPanel = ({
14226
14455
  description: "No tools available",
14227
14456
  image: Empty4.PRESENTED_IMAGE_SIMPLE
14228
14457
  }
14229
- ) : /* @__PURE__ */ jsxs38(Fragment11, { children: [
14458
+ ) : /* @__PURE__ */ jsxs38(Fragment10, { children: [
14230
14459
  /* @__PURE__ */ jsxs38(
14231
14460
  "div",
14232
14461
  {
@@ -14282,7 +14511,7 @@ var AgentConfigPanel = ({
14282
14511
  description: "No other agents available",
14283
14512
  image: Empty4.PRESENTED_IMAGE_SIMPLE
14284
14513
  }
14285
- ) : /* @__PURE__ */ jsxs38(Fragment11, { children: [
14514
+ ) : /* @__PURE__ */ jsxs38(Fragment10, { children: [
14286
14515
  /* @__PURE__ */ jsxs38(
14287
14516
  "div",
14288
14517
  {
@@ -14633,7 +14862,7 @@ var SubAgentInheritList = ({
14633
14862
  };
14634
14863
 
14635
14864
  // src/components/Chat/CreateAssistantModal.tsx
14636
- import { Fragment as Fragment12, jsx as jsx66, jsxs as jsxs41 } from "react/jsx-runtime";
14865
+ import { Fragment as Fragment11, jsx as jsx66, jsxs as jsxs41 } from "react/jsx-runtime";
14637
14866
  var { TextArea: TextArea5 } = Input10;
14638
14867
  var { Text: Text21 } = Typography24;
14639
14868
  var CreateAssistantModal = ({
@@ -15006,7 +15235,7 @@ var CreateAssistantModal = ({
15006
15235
  ]
15007
15236
  }
15008
15237
  ),
15009
- showSubAgentList && /* @__PURE__ */ jsxs41(Fragment12, { children: [
15238
+ showSubAgentList && /* @__PURE__ */ jsxs41(Fragment11, { children: [
15010
15239
  /* @__PURE__ */ jsx66(Divider4, { style: { margin: "12px 0" } }),
15011
15240
  /* @__PURE__ */ jsx66(Text21, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Sub-Agents" }),
15012
15241
  /* @__PURE__ */ jsx66(
@@ -15522,7 +15751,7 @@ import {
15522
15751
  CopyOutlined as CopyOutlined2,
15523
15752
  PlusOutlined as PlusOutlined4
15524
15753
  } from "@ant-design/icons";
15525
- import { Fragment as Fragment13, jsx as jsx68, jsxs as jsxs43 } from "react/jsx-runtime";
15754
+ import { Fragment as Fragment12, jsx as jsx68, jsxs as jsxs43 } from "react/jsx-runtime";
15526
15755
  var { Text: Text22 } = Typography25;
15527
15756
  var { TextArea: TextArea6 } = Input11;
15528
15757
  var getBadgeColor2 = (name) => {
@@ -15575,7 +15804,7 @@ var SkillNode = ({ data }) => {
15575
15804
  ) : [],
15576
15805
  [currentSkill.metadata]
15577
15806
  );
15578
- const formatDate5 = (value) => {
15807
+ const formatDate6 = (value) => {
15579
15808
  if (!value) return "";
15580
15809
  const date = value instanceof Date ? value : new Date(value);
15581
15810
  if (Number.isNaN(date.getTime())) return "";
@@ -15969,7 +16198,7 @@ var SkillNode = ({ data }) => {
15969
16198
  ] })
15970
16199
  }
15971
16200
  ),
15972
- isEditing ? editingView : /* @__PURE__ */ jsxs43(Fragment13, { children: [
16201
+ isEditing ? editingView : /* @__PURE__ */ jsxs43(Fragment12, { children: [
15973
16202
  currentSkill.description && /* @__PURE__ */ jsx68("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ jsxs43(
15974
16203
  Text22,
15975
16204
  {
@@ -16183,7 +16412,7 @@ var SkillNode = ({ data }) => {
16183
16412
  },
16184
16413
  children: [
16185
16414
  "Created: ",
16186
- formatDate5(currentSkill.createdAt)
16415
+ formatDate6(currentSkill.createdAt)
16187
16416
  ]
16188
16417
  }
16189
16418
  ),
@@ -16197,7 +16426,7 @@ var SkillNode = ({ data }) => {
16197
16426
  },
16198
16427
  children: [
16199
16428
  "Updated: ",
16200
- formatDate5(currentSkill.updatedAt)
16429
+ formatDate6(currentSkill.updatedAt)
16201
16430
  ]
16202
16431
  }
16203
16432
  )
@@ -16275,7 +16504,7 @@ var SkillNode = ({ data }) => {
16275
16504
  justifyContent: "space-between",
16276
16505
  gap: 8
16277
16506
  },
16278
- children: isEditing ? /* @__PURE__ */ jsxs43(Fragment13, { children: [
16507
+ children: isEditing ? /* @__PURE__ */ jsxs43(Fragment12, { children: [
16279
16508
  /* @__PURE__ */ jsx68(
16280
16509
  Button31,
16281
16510
  {
@@ -16303,7 +16532,7 @@ var SkillNode = ({ data }) => {
16303
16532
  children: "Save"
16304
16533
  }
16305
16534
  )
16306
- ] }) : /* @__PURE__ */ jsxs43(Fragment13, { children: [
16535
+ ] }) : /* @__PURE__ */ jsxs43(Fragment12, { children: [
16307
16536
  /* @__PURE__ */ jsx68(
16308
16537
  Button31,
16309
16538
  {
@@ -17763,8 +17992,7 @@ var WorkspaceResourceManager = ({
17763
17992
  }
17764
17993
  ),
17765
17994
  logo,
17766
- left: /* @__PURE__ */ jsx72(SideAppViewBrowser, { region: "content" }),
17767
- right: null
17995
+ main: /* @__PURE__ */ jsx72(SideAppViewBrowser, { region: "content" })
17768
17996
  }
17769
17997
  ),
17770
17998
  /* @__PURE__ */ jsx72(
@@ -17848,7 +18076,7 @@ var WorkspaceContextProvider = ({
17848
18076
  };
17849
18077
  const [workspaceId, setWorkspaceId] = useState46(getInitialWorkspaceId);
17850
18078
  const [projectId, setProjectId] = useState46(getInitialProjectId);
17851
- React34.useEffect(() => {
18079
+ React35.useEffect(() => {
17852
18080
  const wsId = getInitialWorkspaceId();
17853
18081
  const pjId = getInitialProjectId();
17854
18082
  if (wsId || pjId) {
@@ -17862,7 +18090,7 @@ var WorkspaceContextProvider = ({
17862
18090
  const [projects, setProjects] = useState46([]);
17863
18091
  const [loading, setLoading] = useState46(false);
17864
18092
  const [error, setError] = useState46(null);
17865
- const client = React34.useMemo(() => {
18093
+ const client = React35.useMemo(() => {
17866
18094
  return new WorkspaceClient({
17867
18095
  baseURL: config.baseURL,
17868
18096
  apiKey: config.apiKey || "",
@@ -18085,8 +18313,7 @@ var WorkspaceContextProvider = ({
18085
18313
  );
18086
18314
  const uploadFileToFolder = useCallback24(
18087
18315
  async (folder, file) => {
18088
- const normalizedPath = folder.startsWith("/") ? folder : `/${folder}`;
18089
- return uploadFile(normalizedPath, file);
18316
+ return uploadFile(folder, file);
18090
18317
  },
18091
18318
  [uploadFile]
18092
18319
  );
@@ -18145,7 +18372,7 @@ var WorkspaceContextProvider = ({
18145
18372
  import { useRef as useRef16, useState as useState47 } from "react";
18146
18373
  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
18374
  import { Database as Database5 } from "lucide-react";
18148
- import { Fragment as Fragment14, jsx as jsx74, jsxs as jsxs48 } from "react/jsx-runtime";
18375
+ import { Fragment as Fragment13, jsx as jsx74, jsxs as jsxs48 } from "react/jsx-runtime";
18149
18376
  var DatabasePicker = ({ senderRef, iconOnly }) => {
18150
18377
  const [modalOpen, setModalOpen] = useState47(false);
18151
18378
  const [databases, setDatabases] = useState47([]);
@@ -18200,7 +18427,7 @@ var DatabasePicker = ({ senderRef, iconOnly }) => {
18200
18427
  setModalOpen(false);
18201
18428
  setSelectedDatabases([]);
18202
18429
  };
18203
- return /* @__PURE__ */ jsxs48(Fragment14, { children: [
18430
+ return /* @__PURE__ */ jsxs48(Fragment13, { children: [
18204
18431
  /* @__PURE__ */ jsx74(Tooltip13, { title: iconOnly ? "Database" : void 0, children: /* @__PURE__ */ jsx74(
18205
18432
  Button36,
18206
18433
  {
@@ -18295,7 +18522,7 @@ var DatabasePicker = ({ senderRef, iconOnly }) => {
18295
18522
  import { useRef as useRef17, useState as useState48 } from "react";
18296
18523
  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
18524
  import { BrainCircuit } from "lucide-react";
18298
- import { Fragment as Fragment15, jsx as jsx75, jsxs as jsxs49 } from "react/jsx-runtime";
18525
+ import { Fragment as Fragment14, jsx as jsx75, jsxs as jsxs49 } from "react/jsx-runtime";
18299
18526
  var SkillPicker = ({ senderRef, iconOnly }) => {
18300
18527
  const [modalOpen, setModalOpen] = useState48(false);
18301
18528
  const [skills, setSkills] = useState48([]);
@@ -18350,7 +18577,7 @@ var SkillPicker = ({ senderRef, iconOnly }) => {
18350
18577
  setModalOpen(false);
18351
18578
  setSelectedSkills([]);
18352
18579
  };
18353
- return /* @__PURE__ */ jsxs49(Fragment15, { children: [
18580
+ return /* @__PURE__ */ jsxs49(Fragment14, { children: [
18354
18581
  /* @__PURE__ */ jsx75(Tooltip14, { title: iconOnly ? "Skills" : void 0, children: /* @__PURE__ */ jsx75(
18355
18582
  Button37,
18356
18583
  {
@@ -18445,7 +18672,7 @@ var SkillPicker = ({ senderRef, iconOnly }) => {
18445
18672
  import { useRef as useRef18, useState as useState49 } from "react";
18446
18673
  import { Modal as Modal13, List as List9, Empty as Empty7, Typography as Typography29, Button as Button38, Tooltip as Tooltip15 } from "antd";
18447
18674
  import { Bot as Bot2 } from "lucide-react";
18448
- import { Fragment as Fragment16, jsx as jsx76, jsxs as jsxs50 } from "react/jsx-runtime";
18675
+ import { Fragment as Fragment15, jsx as jsx76, jsxs as jsxs50 } from "react/jsx-runtime";
18449
18676
  var AgentPicker = ({ senderRef, iconOnly }) => {
18450
18677
  const [modalOpen, setModalOpen] = useState49(false);
18451
18678
  const [loading, setLoading] = useState49(false);
@@ -18465,7 +18692,7 @@ var AgentPicker = ({ senderRef, iconOnly }) => {
18465
18692
  const handleAgentClick = (agentId) => {
18466
18693
  setSelectedAgent(agentId);
18467
18694
  };
18468
- return /* @__PURE__ */ jsxs50(Fragment16, { children: [
18695
+ return /* @__PURE__ */ jsxs50(Fragment15, { children: [
18469
18696
  /* @__PURE__ */ jsx76(Tooltip15, { title: iconOnly ? currentAssistant?.name || "Agent" : void 0, children: /* @__PURE__ */ jsx76(
18470
18697
  Button38,
18471
18698
  {
@@ -18561,7 +18788,7 @@ var AgentPicker = ({ senderRef, iconOnly }) => {
18561
18788
  import { useEffect as useEffect32, useState as useState50, useRef as useRef19 } from "react";
18562
18789
  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
18790
  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";
18791
+ import { Fragment as Fragment16, jsx as jsx77, jsxs as jsxs51 } from "react/jsx-runtime";
18565
18792
  var SESSION_STORAGE_KEY = "metrics_datasource_selection";
18566
18793
  var MetricsDataSourcePicker = ({
18567
18794
  senderRef,
@@ -18705,7 +18932,7 @@ var MetricsDataSourcePicker = ({
18705
18932
  acc[ds.serverName].push(ds);
18706
18933
  return acc;
18707
18934
  }, {});
18708
- return /* @__PURE__ */ jsxs51(Fragment17, { children: [
18935
+ return /* @__PURE__ */ jsxs51(Fragment16, { children: [
18709
18936
  /* @__PURE__ */ jsx77(Tooltip16, { title: iconOnly ? getSelectedName() || "Select Data Source" : dataSources.length === 0 ? "No data sources available" : void 0, children: /* @__PURE__ */ jsx77(
18710
18937
  Button39,
18711
18938
  {
@@ -19638,7 +19865,7 @@ var BusinessAnalysisPrompts = ({
19638
19865
  };
19639
19866
 
19640
19867
  // src/components/Chat/Chating.tsx
19641
- import { Fragment as Fragment18, jsx as jsx81, jsxs as jsxs54 } from "react/jsx-runtime";
19868
+ import { Fragment as Fragment17, jsx as jsx81, jsxs as jsxs54 } from "react/jsx-runtime";
19642
19869
  var slotConfig = [];
19643
19870
  var Chating = ({
19644
19871
  avatar,
@@ -19665,7 +19892,7 @@ var Chating = ({
19665
19892
  const { styles } = useStyle();
19666
19893
  const [headerOpen, setHeaderOpen] = useState54(false);
19667
19894
  const attachmentsRef = useRef21(null);
19668
- const senderRef = React42.useRef(null);
19895
+ const senderRef = React43.useRef(null);
19669
19896
  const {
19670
19897
  assistantId,
19671
19898
  threadId,
@@ -20101,7 +20328,7 @@ var Chating = ({
20101
20328
  }
20102
20329
  );
20103
20330
  };
20104
- return /* @__PURE__ */ jsxs54(Fragment18, { children: [
20331
+ return /* @__PURE__ */ jsxs54(Fragment17, { children: [
20105
20332
  /* @__PURE__ */ jsx81(
20106
20333
  "div",
20107
20334
  {
@@ -20140,7 +20367,7 @@ var Chating = ({
20140
20367
  className: `${styles.emptyStateContainer} ${isTransitioning ? styles.exiting : ""}`,
20141
20368
  children: [
20142
20369
  /* @__PURE__ */ jsxs54("div", { className: styles.welcomeSection, children: [
20143
- /* @__PURE__ */ jsx81("div", { className: styles.greeting, children: emptyStateGreeting ? emptyStateGreeting : /* @__PURE__ */ jsxs54(Fragment18, { children: [
20370
+ /* @__PURE__ */ jsx81("div", { className: styles.greeting, children: emptyStateGreeting ? emptyStateGreeting : /* @__PURE__ */ jsxs54(Fragment17, { children: [
20144
20371
  welcomePrefix,
20145
20372
  " ",
20146
20373
  /* @__PURE__ */ jsx81("span", { className: "user-name", children: displayUserName })
@@ -20168,7 +20395,7 @@ var Chating = ({
20168
20395
  ]
20169
20396
  }
20170
20397
  ),
20171
- !isEmptyState && /* @__PURE__ */ jsxs54(Fragment18, { children: [
20398
+ !isEmptyState && /* @__PURE__ */ jsxs54(Fragment17, { children: [
20172
20399
  /* @__PURE__ */ jsx81(
20173
20400
  MessageList,
20174
20401
  {
@@ -20401,8 +20628,7 @@ import {
20401
20628
  Tooltip as Tooltip17,
20402
20629
  Popconfirm as Popconfirm4,
20403
20630
  message as message14,
20404
- Card as Card16,
20405
- Descriptions
20631
+ Card as Card16
20406
20632
  } from "antd";
20407
20633
  import {
20408
20634
  ClockCircleOutlined as ClockCircleOutlined3,
@@ -20500,6 +20726,11 @@ var useStyles8 = createStyles20(({ token, css }) => ({
20500
20726
  padding: 2px 6px;
20501
20727
  border-radius: 4px;
20502
20728
  font-size: 12px;
20729
+ `,
20730
+ messageContent: css`
20731
+ margin-top: 4px;
20732
+ max-width: 300px;
20733
+ word-break: break-word;
20503
20734
  `
20504
20735
  }));
20505
20736
  var getStatusColor = (status) => {
@@ -20685,7 +20916,8 @@ var ScheduleViewer = ({ data }) => {
20685
20916
  /* @__PURE__ */ jsxs56("div", { className: styles.taskHeader, children: [
20686
20917
  /* @__PURE__ */ jsxs56("div", { children: [
20687
20918
  /* @__PURE__ */ jsx84("div", { className: styles.taskType, children: task.taskType }),
20688
- /* @__PURE__ */ jsx84("div", { className: styles.taskId, children: task.taskId })
20919
+ /* @__PURE__ */ jsx84("div", { className: styles.taskId, children: task.taskId }),
20920
+ 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
20921
  ] }),
20690
20922
  /* @__PURE__ */ jsx84(Tag15, { color: getStatusColor(task.status), icon: getStatusIcon2(task.status), children: task.status.toUpperCase() })
20691
20923
  ] }),
@@ -20725,19 +20957,6 @@ var ScheduleViewer = ({ data }) => {
20725
20957
  /* @__PURE__ */ jsx84(ExclamationCircleOutlined, { style: { marginRight: 4 } }),
20726
20958
  task.lastError
20727
20959
  ] }) }),
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
20960
  isActive && renderActions(task)
20742
20961
  ]
20743
20962
  },
@@ -21106,7 +21325,7 @@ import { RefreshCw } from "lucide-react";
21106
21325
  import { createStyles as createStyles29 } from "antd-style";
21107
21326
 
21108
21327
  // src/components/GenUI/elements/TeamWorkspace/TeamWorkspaceMenu.tsx
21109
- import React44, { useState as useState56 } from "react";
21328
+ import React45, { useState as useState56 } from "react";
21110
21329
  import {
21111
21330
  LayoutDashboard,
21112
21331
  Inbox,
@@ -21118,7 +21337,7 @@ import {
21118
21337
  } from "lucide-react";
21119
21338
  import { Tooltip as Tooltip18, Badge as Badge6 } from "antd";
21120
21339
  import { createStyles as createStyles21 } from "antd-style";
21121
- import { Fragment as Fragment19, jsx as jsx88, jsxs as jsxs60 } from "react/jsx-runtime";
21340
+ import { Fragment as Fragment18, jsx as jsx88, jsxs as jsxs60 } from "react/jsx-runtime";
21122
21341
  var useStyles9 = createStyles21(({ token, css }) => ({
21123
21342
  container: css`
21124
21343
  display: flex;
@@ -21328,11 +21547,11 @@ var TeamWorkspaceMenu = ({
21328
21547
  if (showTooltip && !isExpanded) {
21329
21548
  return /* @__PURE__ */ jsx88(Tooltip18, { title: item.name, placement: "right", children: content }, item.id);
21330
21549
  }
21331
- return /* @__PURE__ */ jsx88(React44.Fragment, { children: content }, item.id);
21550
+ return /* @__PURE__ */ jsx88(React45.Fragment, { children: content }, item.id);
21332
21551
  };
21333
21552
  const renderGroup = (groupItems, groupLabel, showDivider) => {
21334
21553
  if (groupItems.length === 0) return null;
21335
- return /* @__PURE__ */ jsxs60(Fragment19, { children: [
21554
+ return /* @__PURE__ */ jsxs60(Fragment18, { children: [
21336
21555
  showDivider && /* @__PURE__ */ jsx88("div", { className: styles.groupDivider }),
21337
21556
  /* @__PURE__ */ jsxs60("div", { className: styles.menuGroup, children: [
21338
21557
  isExpanded && groupLabel && /* @__PURE__ */ jsx88("div", { className: styles.groupLabel, children: groupLabel }),
@@ -21806,7 +22025,7 @@ import {
21806
22025
  Activity as Activity4,
21807
22026
  GitCommit
21808
22027
  } from "lucide-react";
21809
- import { Fragment as Fragment20, jsx as jsx90, jsxs as jsxs62 } from "react/jsx-runtime";
22028
+ import { Fragment as Fragment19, jsx as jsx90, jsxs as jsxs62 } from "react/jsx-runtime";
21810
22029
  var { Title: Title7, Text: Text31, Paragraph } = Typography41;
21811
22030
  var useStyles11 = createStyles23(({ token, css }) => ({
21812
22031
  modalContent: css`
@@ -22291,7 +22510,7 @@ var TaskDetailModal = ({
22291
22510
  ] }),
22292
22511
  /* @__PURE__ */ jsxs62("div", { className: styles.metaItem, children: [
22293
22512
  /* @__PURE__ */ jsx90(Text31, { className: styles.metaLabel, children: "Assignee" }),
22294
- /* @__PURE__ */ jsx90("div", { className: styles.metaValue, children: task.assignee ? /* @__PURE__ */ jsxs62(Fragment20, { children: [
22513
+ /* @__PURE__ */ jsx90("div", { className: styles.metaValue, children: task.assignee ? /* @__PURE__ */ jsxs62(Fragment19, { children: [
22295
22514
  /* @__PURE__ */ jsx90(
22296
22515
  "div",
22297
22516
  {
@@ -22861,7 +23080,7 @@ var IssuesView = ({
22861
23080
  };
22862
23081
 
22863
23082
  // src/components/GenUI/elements/TeamWorkspace/TeamOrgCanvas.tsx
22864
- import React47, { useMemo as useMemo21 } from "react";
23083
+ import React48, { useMemo as useMemo21 } from "react";
22865
23084
  import {
22866
23085
  ReactFlow as ReactFlow3,
22867
23086
  Background as Background3,
@@ -23102,7 +23321,7 @@ var TeamOrgCanvasInner = ({
23102
23321
  }, [team, teammates, taskStatsByTeammate]);
23103
23322
  const [flowNodes, setNodes, onNodesChange] = useNodesState3(nodes);
23104
23323
  const [flowEdges, setEdges, onEdgesChange] = useEdgesState3(edges);
23105
- React47.useEffect(() => {
23324
+ React48.useEffect(() => {
23106
23325
  setNodes(nodes);
23107
23326
  setEdges(edges);
23108
23327
  setTimeout(() => fitView({ padding: 0.2 }), 100);
@@ -23444,12 +23663,12 @@ var formatDate3 = (timestamp) => {
23444
23663
  });
23445
23664
  };
23446
23665
  var MailboxDetailModal = ({
23447
- message: message20,
23666
+ message: message21,
23448
23667
  visible,
23449
23668
  onClose
23450
23669
  }) => {
23451
23670
  const { styles } = useStyles15();
23452
- if (!message20) return null;
23671
+ if (!message21) return null;
23453
23672
  return /* @__PURE__ */ jsx94(
23454
23673
  Modal16,
23455
23674
  {
@@ -23472,12 +23691,12 @@ var MailboxDetailModal = ({
23472
23691
  children: /* @__PURE__ */ jsxs66("div", { className: styles.modalContent, children: [
23473
23692
  /* @__PURE__ */ jsxs66("div", { className: styles.header, children: [
23474
23693
  /* @__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" })
23694
+ /* @__PURE__ */ jsx94(Text35, { className: styles.messageId, children: message21.id }),
23695
+ !message21.read && /* @__PURE__ */ jsx94(Tag20, { color: "red", children: "Unread" })
23477
23696
  ] }),
23478
23697
  /* @__PURE__ */ jsxs66(Title11, { level: 4, className: styles.title, children: [
23479
23698
  "Message from ",
23480
- message20.from
23699
+ message21.from
23481
23700
  ] }),
23482
23701
  /* @__PURE__ */ jsxs66("div", { className: styles.metaSection, children: [
23483
23702
  /* @__PURE__ */ jsxs66("div", { className: styles.metaItem, children: [
@@ -23487,11 +23706,11 @@ var MailboxDetailModal = ({
23487
23706
  "div",
23488
23707
  {
23489
23708
  className: styles.avatar,
23490
- style: { background: getAvatarColor7(message20.from) },
23491
- children: getInitials7(message20.from)
23709
+ style: { background: getAvatarColor7(message21.from) },
23710
+ children: getInitials7(message21.from)
23492
23711
  }
23493
23712
  ),
23494
- /* @__PURE__ */ jsx94("span", { children: message20.from })
23713
+ /* @__PURE__ */ jsx94("span", { children: message21.from })
23495
23714
  ] })
23496
23715
  ] }),
23497
23716
  /* @__PURE__ */ jsxs66("div", { className: styles.metaItem, children: [
@@ -23501,29 +23720,29 @@ var MailboxDetailModal = ({
23501
23720
  "div",
23502
23721
  {
23503
23722
  className: styles.avatar,
23504
- style: { background: getAvatarColor7(message20.to) },
23505
- children: getInitials7(message20.to)
23723
+ style: { background: getAvatarColor7(message21.to) },
23724
+ children: getInitials7(message21.to)
23506
23725
  }
23507
23726
  ),
23508
- /* @__PURE__ */ jsx94("span", { children: message20.to })
23727
+ /* @__PURE__ */ jsx94("span", { children: message21.to })
23509
23728
  ] })
23510
23729
  ] }),
23511
23730
  /* @__PURE__ */ jsxs66("div", { className: styles.metaItem, children: [
23512
23731
  /* @__PURE__ */ jsx94(Text35, { className: styles.metaLabel, children: "Time" }),
23513
23732
  /* @__PURE__ */ jsxs66("div", { className: styles.metaValue, children: [
23514
23733
  /* @__PURE__ */ jsx94(Calendar2, { size: 14 }),
23515
- /* @__PURE__ */ jsx94("span", { children: formatDate3(message20.timestamp) })
23734
+ /* @__PURE__ */ jsx94("span", { children: formatDate3(message21.timestamp) })
23516
23735
  ] })
23517
23736
  ] }),
23518
23737
  /* @__PURE__ */ jsxs66("div", { className: styles.metaItem, children: [
23519
23738
  /* @__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 }) })
23739
+ /* @__PURE__ */ jsx94("div", { className: styles.metaValue, children: /* @__PURE__ */ jsx94(Tag20, { color: message21.type === "broadcast" ? "blue" : "default", children: message21.type }) })
23521
23740
  ] })
23522
23741
  ] }),
23523
23742
  /* @__PURE__ */ jsx94(Divider8, {}),
23524
23743
  /* @__PURE__ */ jsxs66("div", { className: styles.contentSection, children: [
23525
23744
  /* @__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 }) })
23745
+ /* @__PURE__ */ jsx94("div", { className: styles.contentBox, children: /* @__PURE__ */ jsx94(Paragraph2, { className: styles.messageContent, children: message21.content }) })
23527
23746
  ] })
23528
23747
  ] })
23529
23748
  }
@@ -23752,26 +23971,26 @@ var MessageGroupComponent = ({ group, styles, defaultExpanded = true, onMessageC
23752
23971
  ]
23753
23972
  }
23754
23973
  ),
23755
- isExpanded && /* @__PURE__ */ jsx95("div", { className: styles.listGroupContent, children: group.messages.map((message20) => /* @__PURE__ */ jsxs67(
23974
+ isExpanded && /* @__PURE__ */ jsx95("div", { className: styles.listGroupContent, children: group.messages.map((message21) => /* @__PURE__ */ jsxs67(
23756
23975
  "div",
23757
23976
  {
23758
- className: `${styles.listItem} ${!message20.read ? styles.listItemUnread : ""}`,
23759
- onClick: () => onMessageClick(message20),
23977
+ className: `${styles.listItem} ${!message21.read ? styles.listItemUnread : ""}`,
23978
+ onClick: () => onMessageClick(message21),
23760
23979
  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" } }) }),
23980
+ /* @__PURE__ */ jsx95("div", { className: styles.listItemIcon, children: !message21.read ? /* @__PURE__ */ jsx95("div", { className: styles.unreadBadge }) : /* @__PURE__ */ jsx95(Circle2, { size: 8, style: { color: "#d9d9d9" } }) }),
23762
23981
  /* @__PURE__ */ jsxs67("div", { className: styles.listItemContent, children: [
23763
- /* @__PURE__ */ jsx95("span", { className: styles.listItemPreview, children: getMessagePreview(message20.content) }),
23982
+ /* @__PURE__ */ jsx95("span", { className: styles.listItemPreview, children: getMessagePreview(message21.content) }),
23764
23983
  /* @__PURE__ */ jsxs67("span", { className: styles.listItemMeta, children: [
23765
23984
  "To: ",
23766
- message20.to,
23985
+ message21.to,
23767
23986
  " \u2022 ",
23768
- message20.type
23987
+ message21.type
23769
23988
  ] })
23770
23989
  ] }),
23771
- /* @__PURE__ */ jsx95("div", { className: styles.listItemRight, children: /* @__PURE__ */ jsx95("span", { className: styles.listItemDate, children: formatDate4(message20.timestamp) }) })
23990
+ /* @__PURE__ */ jsx95("div", { className: styles.listItemRight, children: /* @__PURE__ */ jsx95("span", { className: styles.listItemDate, children: formatDate4(message21.timestamp) }) })
23772
23991
  ]
23773
23992
  },
23774
- message20.id
23993
+ message21.id
23775
23994
  )) })
23776
23995
  ] });
23777
23996
  };
@@ -23782,12 +24001,12 @@ var MailboxPanel = ({ data }) => {
23782
24001
  const { teamMailbox = [] } = data || {};
23783
24002
  const messageGroups = useMemo22(() => {
23784
24003
  const groupsMap = /* @__PURE__ */ new Map();
23785
- teamMailbox.forEach((message20) => {
23786
- const sender = message20.from;
24004
+ teamMailbox.forEach((message21) => {
24005
+ const sender = message21.from;
23787
24006
  if (!groupsMap.has(sender)) {
23788
24007
  groupsMap.set(sender, []);
23789
24008
  }
23790
- groupsMap.get(sender).push(message20);
24009
+ groupsMap.get(sender).push(message21);
23791
24010
  });
23792
24011
  const groups = Array.from(groupsMap.entries()).map(([sender, messages]) => ({
23793
24012
  sender,
@@ -23804,8 +24023,8 @@ var MailboxPanel = ({ data }) => {
23804
24023
  return groups;
23805
24024
  }, [teamMailbox]);
23806
24025
  const totalUnread = teamMailbox.filter((m) => !m.read).length;
23807
- const handleMessageClick = (message20) => {
23808
- setSelectedMessage(message20);
24026
+ const handleMessageClick = (message21) => {
24027
+ setSelectedMessage(message21);
23809
24028
  setModalVisible(true);
23810
24029
  };
23811
24030
  const handleCloseModal = () => {
@@ -24861,7 +25080,7 @@ import { Button as Button47, Typography as Typography47 } from "antd";
24861
25080
  import { ExpandOutlined as ExpandOutlined2 } from "@ant-design/icons";
24862
25081
 
24863
25082
  // src/streaming-html/StreamingHTMLRenderer.tsx
24864
- import React52, { useEffect as useEffect38, useRef as useRef23, useCallback as useCallback28, useState as useState62 } from "react";
25083
+ import React53, { useEffect as useEffect38, useRef as useRef23, useCallback as useCallback28, useState as useState62 } from "react";
24865
25084
 
24866
25085
  // src/streaming-html/show-widget-css-generator.ts
24867
25086
  function generateShowWidgetCSS(tokens) {
@@ -25560,8 +25779,8 @@ var StreamingHTMLRenderer = ({
25560
25779
  const pendingChunksRef = useRef23([]);
25561
25780
  const isCompleteRef = useRef23(isComplete);
25562
25781
  const isScriptExecuted = useRef23(false);
25563
- const [iframeHeight, setIframeHeight] = React52.useState(0);
25564
- const [iframeWidth, setIframeWidth] = React52.useState(void 0);
25782
+ const [iframeHeight, setIframeHeight] = React53.useState(0);
25783
+ const [iframeWidth, setIframeWidth] = React53.useState(void 0);
25565
25784
  const [currentMessageIndex, setCurrentMessageIndex] = useState62(0);
25566
25785
  const [showLoading, setShowLoading] = useState62(true);
25567
25786
  useEffect38(() => {
@@ -25649,11 +25868,11 @@ var StreamingHTMLRenderer = ({
25649
25868
  if (!iframe || event.source !== iframe.contentWindow) {
25650
25869
  return;
25651
25870
  }
25652
- const message20 = event.data;
25653
- if (!message20 || typeof message20 !== "object") {
25871
+ const message21 = event.data;
25872
+ if (!message21 || typeof message21 !== "object") {
25654
25873
  return;
25655
25874
  }
25656
- switch (message20.type) {
25875
+ switch (message21.type) {
25657
25876
  case "iframe-ready":
25658
25877
  console.log("[StreamingHTMLRenderer] Iframe ready");
25659
25878
  isReadyRef.current = true;
@@ -25668,25 +25887,25 @@ var StreamingHTMLRenderer = ({
25668
25887
  }
25669
25888
  break;
25670
25889
  case "iframe-height":
25671
- if (typeof message20.height === "number" && message20.height > 0) {
25672
- setIframeHeight(message20.height);
25890
+ if (typeof message21.height === "number" && message21.height > 0) {
25891
+ setIframeHeight(message21.height);
25673
25892
  }
25674
25893
  break;
25675
25894
  case "iframe-error":
25676
25895
  const streamingError = {
25677
25896
  type: "RENDER_ERROR",
25678
- message: message20.error || "Unknown iframe error"
25897
+ message: message21.error || "Unknown iframe error"
25679
25898
  };
25680
25899
  onError?.(streamingError);
25681
25900
  break;
25682
25901
  case "widget-prompt":
25683
- if (typeof message20.text === "string") {
25684
- onPrompt?.(message20.text);
25902
+ if (typeof message21.text === "string") {
25903
+ onPrompt?.(message21.text);
25685
25904
  }
25686
25905
  break;
25687
25906
  case "widget-open-link":
25688
- if (typeof message20.url === "string") {
25689
- window.open(message20.url, "_blank", "noopener,noreferrer");
25907
+ if (typeof message21.url === "string") {
25908
+ window.open(message21.url, "_blank", "noopener,noreferrer");
25690
25909
  }
25691
25910
  break;
25692
25911
  }
@@ -26052,7 +26271,7 @@ var regsiterElement = (language, ElementMeta) => {
26052
26271
  import { Dropdown as Dropdown2, Tooltip as Tooltip22 } from "antd";
26053
26272
  import { createStyles as createStyles30 } from "antd-style";
26054
26273
  import { useEffect as useEffect39, useState as useState63 } from "react";
26055
- import { Fragment as Fragment21, jsx as jsx103, jsxs as jsxs74 } from "react/jsx-runtime";
26274
+ import { Fragment as Fragment20, jsx as jsx103, jsxs as jsxs74 } from "react/jsx-runtime";
26056
26275
  var useStyle13 = createStyles30(({ token, css }) => {
26057
26276
  return {
26058
26277
  container: css`
@@ -26229,7 +26448,7 @@ var useStyle13 = createStyles30(({ token, css }) => {
26229
26448
  });
26230
26449
  var EmptySideAppView = ({ component_key, data }) => {
26231
26450
  if (data?.component) {
26232
- return /* @__PURE__ */ jsx103(Fragment21, { children: data.component });
26451
+ return /* @__PURE__ */ jsx103(Fragment20, { children: data.component });
26233
26452
  }
26234
26453
  return /* @__PURE__ */ jsxs74("div", { children: [
26235
26454
  /* @__PURE__ */ jsx103("p", { children: "Component view not found" }),
@@ -26389,7 +26608,7 @@ import { useState as useState64, useCallback as useCallback31, useMemo as useMem
26389
26608
  import { Modal as Modal17, Input as Input13, Button as Button48, message as message16 } from "antd";
26390
26609
  import { createStyles as createStyles31 } from "antd-style";
26391
26610
  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";
26611
+ import { Fragment as Fragment21, jsx as jsx104, jsxs as jsxs75 } from "react/jsx-runtime";
26393
26612
  var PROJECT_NAME_MAX_LENGTH = 50;
26394
26613
  var useStyles18 = createStyles31(({ token, css }) => ({
26395
26614
  container: css`
@@ -26608,7 +26827,9 @@ var useStyles18 = createStyles31(({ token, css }) => ({
26608
26827
  gap: 8px;
26609
26828
  `
26610
26829
  }));
26611
- var ProjectSelector = () => {
26830
+ var ProjectSelector = ({
26831
+ disableDropdown = true
26832
+ }) => {
26612
26833
  const { styles } = useStyles18();
26613
26834
  const {
26614
26835
  workspaceId,
@@ -26707,7 +26928,7 @@ var ProjectSelector = () => {
26707
26928
  }
26708
26929
  };
26709
26930
  const isProjectNameValid = !validateProjectName(projectName.trim());
26710
- return /* @__PURE__ */ jsxs75(Fragment22, { children: [
26931
+ return /* @__PURE__ */ jsxs75(Fragment21, { children: [
26711
26932
  /* @__PURE__ */ jsx104("div", { className: styles.container, children: /* @__PURE__ */ jsxs75("div", { className: styles.selectorWrapper, children: [
26712
26933
  /* @__PURE__ */ jsx104("div", { style: { position: "relative" }, ref: workspaceDropdownRef, children: /* @__PURE__ */ jsx104(
26713
26934
  "button",
@@ -26719,12 +26940,20 @@ var ProjectSelector = () => {
26719
26940
  }
26720
26941
  ) }),
26721
26942
  /* @__PURE__ */ jsx104("span", { className: styles.divider, children: "/" }),
26722
- /* @__PURE__ */ jsxs75("div", { className: styles.projectTrigger, onClick: toggleProjectList, children: [
26723
- /* @__PURE__ */ jsx104("div", { className: styles.projectTriggerIcon, children: /* @__PURE__ */ jsx104(Folder, { size: 16 }) }),
26724
- /* @__PURE__ */ jsx104("div", { className: styles.projectTriggerInfo, children: /* @__PURE__ */ jsx104("div", { className: styles.projectTriggerName, children: currentProject?.name || "Select Project" }) }),
26725
- /* @__PURE__ */ jsx104("div", { className: `${styles.projectTriggerArrow} ${isProjectListOpen ? "expanded" : ""}`, children: /* @__PURE__ */ jsx104(ChevronDown4, { size: 14 }) })
26726
- ] }),
26727
- isProjectListOpen && /* @__PURE__ */ jsxs75("div", { className: styles.projectDropdown, children: [
26943
+ /* @__PURE__ */ jsxs75(
26944
+ "div",
26945
+ {
26946
+ className: styles.projectTrigger,
26947
+ onClick: disableDropdown ? void 0 : toggleProjectList,
26948
+ style: { cursor: disableDropdown ? "default" : "pointer" },
26949
+ children: [
26950
+ /* @__PURE__ */ jsx104("div", { className: styles.projectTriggerIcon, children: /* @__PURE__ */ jsx104(Folder, { size: 16 }) }),
26951
+ /* @__PURE__ */ jsx104("div", { className: styles.projectTriggerInfo, children: /* @__PURE__ */ jsx104("div", { className: styles.projectTriggerName, children: currentProject?.name || "Select Project" }) }),
26952
+ !disableDropdown && /* @__PURE__ */ jsx104("div", { className: `${styles.projectTriggerArrow} ${isProjectListOpen ? "expanded" : ""}`, children: /* @__PURE__ */ jsx104(ChevronDown4, { size: 14 }) })
26953
+ ]
26954
+ }
26955
+ ),
26956
+ !disableDropdown && isProjectListOpen && /* @__PURE__ */ jsxs75("div", { className: styles.projectDropdown, children: [
26728
26957
  projects.map((project) => /* @__PURE__ */ jsxs75(
26729
26958
  "div",
26730
26959
  {
@@ -26785,136 +27014,44 @@ var ProjectSelector = () => {
26785
27014
  ] });
26786
27015
  };
26787
27016
 
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";
27017
+ // src/components/Chat/ToolPanelFiles.tsx
27018
+ import { useCallback as useCallback32, useEffect as useEffect40, useMemo as useMemo27, useState as useState65 } from "react";
27019
+ import { message as message17 } from "antd";
26904
27020
 
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";
27021
+ // src/components/Chat/FileDirectoryPanel.tsx
27022
+ import React58 from "react";
27023
+ import { Spin as Spin15 } from "antd";
27024
+ import { ChevronRight as ChevronRight7, FolderOpen as FolderOpen3, Upload } from "lucide-react";
26908
27025
  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;
27026
+ import { Fragment as Fragment22, jsx as jsx105, jsxs as jsxs76 } from "react/jsx-runtime";
26912
27027
  var useStyles19 = createStyles32(({ token, css }) => ({
26913
27028
  container: css`
26914
- padding: 4px;
27029
+ height: 100%;
27030
+ overflow-y: auto;
27031
+ padding: 12px;
26915
27032
  font-size: 13px;
26916
27033
  background: transparent;
26917
27034
  `,
27035
+ header: css`
27036
+ display: flex;
27037
+ align-items: center;
27038
+ gap: 8px;
27039
+ margin-bottom: 12px;
27040
+ padding: 0 4px;
27041
+ font-size: 15px;
27042
+ line-height: 1.4;
27043
+ font-weight: 600;
27044
+ color: ${token.colorText};
27045
+ letter-spacing: -0.01em;
27046
+ padding-bottom: 8px;
27047
+ border-bottom: 1px solid ${token.colorBorderSecondary};
27048
+
27049
+ svg {
27050
+ width: 16px;
27051
+ height: 16px;
27052
+ color: ${token.colorTextSecondary};
27053
+ }
27054
+ `,
26918
27055
  section: css`
26919
27056
  margin-bottom: 12px;
26920
27057
  `,
@@ -26928,7 +27065,7 @@ var useStyles19 = createStyles32(({ token, css }) => ({
26928
27065
  sectionTitle: css`
26929
27066
  font-size: 10px;
26930
27067
  font-weight: 600;
26931
- letter-spacing: 0.5px;
27068
+ letter-spacing: 0.05em;
26932
27069
  color: ${token.colorTextSecondary};
26933
27070
  text-transform: uppercase;
26934
27071
  cursor: pointer;
@@ -26939,28 +27076,6 @@ var useStyles19 = createStyles32(({ token, css }) => ({
26939
27076
  color: ${token.colorPrimary};
26940
27077
  }
26941
27078
  `,
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
27079
  badge: css`
26965
27080
  display: flex;
26966
27081
  align-items: center;
@@ -26969,89 +27084,67 @@ var useStyles19 = createStyles32(({ token, css }) => ({
26969
27084
  height: 16px;
26970
27085
  padding: 0 4px;
26971
27086
  border-radius: 8px;
26972
- background: rgba(0, 0, 0, 0.06);
27087
+ background: ${token.colorFillSecondary};
26973
27088
  font-size: 10px;
26974
- font-weight: 600;
27089
+ font-weight: 500;
26975
27090
  color: ${token.colorTextSecondary};
26976
27091
  `,
26977
- projectList: css`
27092
+ assetList: css`
26978
27093
  display: flex;
26979
27094
  flex-direction: column;
26980
27095
  gap: 2px;
26981
27096
  `,
26982
- projectItem: css`
27097
+ assetItem: css`
26983
27098
  display: flex;
26984
27099
  align-items: center;
26985
27100
  gap: 8px;
26986
- padding: 6px 8px;
26987
- border-radius: 6px;
27101
+ width: 100%;
27102
+ padding: 5px 8px;
27103
+ border-radius: 4px;
26988
27104
  cursor: pointer;
26989
27105
  transition: all 0.15s ease;
26990
- border: 1px solid transparent;
27106
+ border: none;
27107
+ background: transparent;
27108
+ text-align: left;
26991
27109
 
26992
27110
  &:hover {
26993
27111
  background: ${token.colorBgTextHover};
26994
- border-color: ${token.colorBorder};
26995
- }
26996
-
26997
- &.active {
26998
- background: ${token.colorPrimaryBg};
26999
- border-color: ${token.colorPrimary};
27000
27112
  }
27001
27113
  `,
27002
- projectIcon: css`
27114
+ treeRow: css`
27003
27115
  display: flex;
27004
27116
  align-items: center;
27117
+ gap: 8px;
27118
+ width: 100%;
27119
+ `,
27120
+ treeIndent: css`
27121
+ flex-shrink: 0;
27122
+ width: 12px;
27123
+ `,
27124
+ treeToggle: css`
27125
+ display: inline-flex;
27126
+ align-items: center;
27005
27127
  justify-content: center;
27128
+ width: 18px;
27129
+ height: 18px;
27130
+ padding: 0;
27131
+ border: none;
27132
+ border-radius: 4px;
27133
+ background: transparent;
27134
+ color: ${token.colorTextSecondary};
27135
+ cursor: pointer;
27006
27136
 
27007
- svg {
27008
- width: 16px;
27009
- height: 16px;
27010
- color: ${token.colorPrimary};
27137
+ &:hover {
27138
+ background: ${token.colorBgTextHover};
27139
+ color: ${token.colorText};
27011
27140
  }
27012
27141
  `,
27013
- projectIconInactive: css`
27014
- display: flex;
27015
- align-items: center;
27016
- justify-content: center;
27017
-
27018
- 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`
27142
+ treeSpacer: css`
27143
+ flex-shrink: 0;
27144
+ width: 18px;
27145
+ height: 18px;
27146
+ `,
27147
+ assetIcon: css`
27055
27148
  display: flex;
27056
27149
  align-items: center;
27057
27150
  justify-content: center;
@@ -27081,6 +27174,11 @@ var useStyles19 = createStyles32(({ token, css }) => ({
27081
27174
  font-size: 10px;
27082
27175
  color: ${token.colorTextSecondary};
27083
27176
  `,
27177
+ treeChildren: css`
27178
+ display: flex;
27179
+ flex-direction: column;
27180
+ gap: 2px;
27181
+ `,
27084
27182
  emptyState: css`
27085
27183
  padding: 12px;
27086
27184
  text-align: center;
@@ -27124,262 +27222,246 @@ var useStyles19 = createStyles32(({ token, css }) => ({
27124
27222
  width: 14px;
27125
27223
  height: 14px;
27126
27224
  }
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
27225
  `
27264
27226
  }));
27265
- var ProjectsMenuContent = () => {
27227
+ var formatDate5 = (dateStr) => {
27228
+ if (!dateStr) return "";
27229
+ const date = new Date(dateStr);
27230
+ return date.toLocaleDateString("en-US", { month: "short", day: "numeric" });
27231
+ };
27232
+ var getFileName = (path) => {
27233
+ if (!path) return "";
27234
+ const parts = path.split(/[/\\]/);
27235
+ return parts[parts.length - 1];
27236
+ };
27237
+ var getEntryName = (entry) => getFileName(entry.name || entry.path);
27238
+ var FileDirectoryPanel = ({
27239
+ workspaceId,
27240
+ projectId,
27241
+ resourceFolders,
27242
+ folderEntries,
27243
+ folderLoading,
27244
+ directoryChildren,
27245
+ directoryLoading,
27246
+ directoryExpanded,
27247
+ uploadingFolder,
27248
+ onRefreshFolder,
27249
+ onUploadFolder,
27250
+ onToggleDirectory,
27251
+ onAssetClick
27252
+ }) => {
27266
27253
  const { styles } = useStyles19();
27254
+ const renderEntry = React58.useCallback((entry, depth) => {
27255
+ const entryName = getEntryName(entry);
27256
+ if (entry.is_dir) {
27257
+ const isExpanded = directoryExpanded[entry.path] || false;
27258
+ const children = directoryChildren[entry.path] || [];
27259
+ const isLoading = directoryLoading[entry.path] || false;
27260
+ return /* @__PURE__ */ jsxs76("div", { className: styles.treeChildren, children: [
27261
+ /* @__PURE__ */ jsxs76("div", { className: styles.treeRow, children: [
27262
+ Array.from({ length: depth }).map((_, index) => /* @__PURE__ */ jsx105("span", { className: styles.treeIndent }, `${entry.path}-indent-${index}`)),
27263
+ /* @__PURE__ */ jsx105(
27264
+ "button",
27265
+ {
27266
+ type: "button",
27267
+ className: styles.treeToggle,
27268
+ "aria-label": `${isExpanded ? "collapse" : "expand"} ${entryName}`,
27269
+ onClick: () => void onToggleDirectory(entry.path),
27270
+ children: /* @__PURE__ */ jsx105(ChevronRight7, { size: 14, style: { transform: isExpanded ? "rotate(90deg)" : void 0 } })
27271
+ }
27272
+ ),
27273
+ /* @__PURE__ */ jsxs76(
27274
+ "button",
27275
+ {
27276
+ type: "button",
27277
+ className: styles.assetItem,
27278
+ "aria-label": `toggle ${entryName}`,
27279
+ onClick: () => void onToggleDirectory(entry.path),
27280
+ title: entryName,
27281
+ children: [
27282
+ /* @__PURE__ */ jsx105("div", { className: styles.assetIcon, children: /* @__PURE__ */ jsx105(FolderOpen3, { size: 14 }) }),
27283
+ /* @__PURE__ */ jsx105("div", { className: styles.assetInfo, children: /* @__PURE__ */ jsx105("div", { className: styles.assetName, children: entryName }) })
27284
+ ]
27285
+ }
27286
+ )
27287
+ ] }),
27288
+ 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
27289
+ ] }, entry.path);
27290
+ }
27291
+ return /* @__PURE__ */ jsxs76("div", { className: styles.treeRow, children: [
27292
+ Array.from({ length: depth }).map((_, index) => /* @__PURE__ */ jsx105("span", { className: styles.treeIndent }, `${entry.path}-indent-${index}`)),
27293
+ /* @__PURE__ */ jsx105("span", { className: styles.treeSpacer }),
27294
+ /* @__PURE__ */ jsxs76(
27295
+ "button",
27296
+ {
27297
+ type: "button",
27298
+ className: styles.assetItem,
27299
+ onClick: () => onAssetClick(entry),
27300
+ "aria-label": `open ${entryName}`,
27301
+ title: entryName,
27302
+ children: [
27303
+ /* @__PURE__ */ jsx105("div", { className: styles.assetIcon, children: getFileIcon2(entryName) }),
27304
+ /* @__PURE__ */ jsxs76("div", { className: styles.assetInfo, children: [
27305
+ /* @__PURE__ */ jsx105("div", { className: styles.assetName, children: entryName }),
27306
+ /* @__PURE__ */ jsx105("div", { className: styles.assetMeta, children: formatDate5(entry.modified_at) })
27307
+ ] })
27308
+ ]
27309
+ }
27310
+ )
27311
+ ] }, entry.path);
27312
+ }, [directoryChildren, directoryExpanded, directoryLoading, onAssetClick, onToggleDirectory, styles]);
27313
+ if (!projectId) {
27314
+ return /* @__PURE__ */ jsx105("div", { className: styles.emptyState, children: "Please select a project to browse files" });
27315
+ }
27316
+ return /* @__PURE__ */ jsxs76("div", { className: styles.container, children: [
27317
+ /* @__PURE__ */ jsxs76("h3", { className: styles.header, children: [
27318
+ /* @__PURE__ */ jsx105(FolderOpen3, { size: 16 }),
27319
+ /* @__PURE__ */ jsx105("span", { children: "Files" })
27320
+ ] }),
27321
+ resourceFolders.map((folder) => {
27322
+ const entries = folderEntries[folder.name] || [];
27323
+ const isLoading = folderLoading[folder.name] || false;
27324
+ const itemCount = entries.length;
27325
+ return /* @__PURE__ */ jsxs76("div", { className: styles.section, children: [
27326
+ /* @__PURE__ */ jsxs76("div", { className: styles.sectionHeader, children: [
27327
+ /* @__PURE__ */ jsx105(
27328
+ "span",
27329
+ {
27330
+ className: styles.sectionTitle,
27331
+ onClick: () => void onRefreshFolder(folder),
27332
+ title: "Click to refresh",
27333
+ children: folder.displayName || folder.name
27334
+ }
27335
+ ),
27336
+ /* @__PURE__ */ jsx105("span", { className: styles.badge, children: itemCount })
27337
+ ] }),
27338
+ isLoading ? /* @__PURE__ */ jsx105("div", { className: styles.loading, children: /* @__PURE__ */ jsx105(Spin15, { size: "small" }) }) : /* @__PURE__ */ jsxs76("div", { className: styles.assetList, children: [
27339
+ entries.map((entry) => renderEntry(entry, 0)),
27340
+ entries.length === 0 ? /* @__PURE__ */ jsx105("div", { className: styles.emptyState, children: "No files in this folder" }) : null,
27341
+ folder.allowUpload ? /* @__PURE__ */ jsx105(
27342
+ "button",
27343
+ {
27344
+ type: "button",
27345
+ className: styles.uploadBtn,
27346
+ onClick: () => void onUploadFolder(folder.name),
27347
+ disabled: !workspaceId || !projectId || uploadingFolder === folder.name,
27348
+ children: uploadingFolder === folder.name ? /* @__PURE__ */ jsxs76(Fragment22, { children: [
27349
+ /* @__PURE__ */ jsx105(Spin15, { size: "small" }),
27350
+ /* @__PURE__ */ jsx105("span", { children: "Uploading..." })
27351
+ ] }) : /* @__PURE__ */ jsxs76(Fragment22, { children: [
27352
+ /* @__PURE__ */ jsx105(Upload, { size: 14 }),
27353
+ /* @__PURE__ */ jsx105("span", { children: "Upload" })
27354
+ ] })
27355
+ }
27356
+ ) : null
27357
+ ] })
27358
+ ] }, folder.name);
27359
+ })
27360
+ ] });
27361
+ };
27362
+
27363
+ // src/components/Chat/ToolPanelFiles.tsx
27364
+ import { jsx as jsx106 } from "react/jsx-runtime";
27365
+ var ToolPanelFiles = () => {
27267
27366
  const { config } = useLatticeChatShellContext();
27268
27367
  const { openSideApp } = useChatUIContext();
27269
27368
  const {
27270
27369
  workspaceId,
27271
27370
  projectId,
27272
- projects,
27273
- setProject,
27371
+ listPath,
27274
27372
  listPathByFolder,
27275
- createProject,
27276
27373
  getFileViewUrl,
27277
27374
  uploadFileToFolder
27278
27375
  } = useWorkspaceContext();
27279
- const [folderAssets, setFolderAssets] = useState65({});
27376
+ const [folderEntries, setFolderEntries] = useState65({});
27280
27377
  const [folderLoading, setFolderLoading] = useState65({});
27281
- const [isProjectListOpen, setIsProjectListOpen] = useState65(false);
27378
+ const [directoryChildren, setDirectoryChildren] = useState65({});
27379
+ const [directoryLoading, setDirectoryLoading] = useState65({});
27380
+ const [directoryExpanded, setDirectoryExpanded] = useState65({});
27282
27381
  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(() => {
27382
+ const resourceFolders = useMemo27(() => {
27289
27383
  return config.resourceFolders && config.resourceFolders.length > 0 ? config.resourceFolders : [{ name: "/", displayName: "Project Assets", allowUpload: true }];
27290
27384
  }, [config.resourceFolders]);
27291
- const currentProject = useMemo28(() => {
27292
- return projects.find((p) => p.id === projectId);
27293
- }, [projects, projectId]);
27294
- const loadAssetsForFolder = useCallback32(async (folder) => {
27295
- if (!workspaceId || !projectId) {
27296
- setFolderAssets((prev) => ({ ...prev, [folder.name]: [] }));
27385
+ const loadAssetsForFolder = useCallback32(
27386
+ async (folder, clearSubdirectoryCache = true) => {
27387
+ if (!workspaceId || !projectId) {
27388
+ setFolderEntries((prev) => ({ ...prev, [folder.name]: [] }));
27389
+ return;
27390
+ }
27391
+ setFolderLoading((prev) => ({ ...prev, [folder.name]: true }));
27392
+ try {
27393
+ const items = await listPathByFolder(folder.name);
27394
+ setFolderEntries((prev) => ({ ...prev, [folder.name]: items }));
27395
+ if (clearSubdirectoryCache) {
27396
+ const folderPath = folder.name === "/" ? "/" : folder.name.replace(/\/$/, "");
27397
+ setDirectoryChildren((prev) => {
27398
+ const next = { ...prev };
27399
+ Object.keys(next).forEach((key) => {
27400
+ if (key === folderPath || key.startsWith(`${folderPath}/`)) {
27401
+ delete next[key];
27402
+ }
27403
+ });
27404
+ return next;
27405
+ });
27406
+ setDirectoryExpanded((prev) => {
27407
+ const next = { ...prev };
27408
+ Object.keys(next).forEach((key) => {
27409
+ if (key === folderPath || key.startsWith(`${folderPath}/`)) {
27410
+ delete next[key];
27411
+ }
27412
+ });
27413
+ return next;
27414
+ });
27415
+ }
27416
+ } catch (error) {
27417
+ console.error(`Failed to load assets for folder ${folder.name}:`, error);
27418
+ setFolderEntries((prev) => ({ ...prev, [folder.name]: [] }));
27419
+ } finally {
27420
+ setFolderLoading((prev) => ({ ...prev, [folder.name]: false }));
27421
+ }
27422
+ },
27423
+ [workspaceId, projectId, listPathByFolder]
27424
+ );
27425
+ const handleToggleDirectory = useCallback32(async (path) => {
27426
+ const isExpanded = directoryExpanded[path] || false;
27427
+ if (isExpanded) {
27428
+ setDirectoryExpanded((prev) => ({ ...prev, [path]: false }));
27297
27429
  return;
27298
27430
  }
27299
- setFolderLoading((prev) => ({ ...prev, [folder.name]: true }));
27431
+ setDirectoryExpanded((prev) => ({ ...prev, [path]: true }));
27432
+ setDirectoryLoading((prev) => ({ ...prev, [path]: true }));
27300
27433
  try {
27301
- const items = await listPathByFolder(folder.name);
27302
- setFolderAssets((prev) => ({ ...prev, [folder.name]: items.filter((item) => !item.is_dir) }));
27434
+ const items = await listPath(path);
27435
+ setDirectoryChildren((prev) => ({ ...prev, [path]: items }));
27303
27436
  } catch (error) {
27304
- console.error(`Failed to load assets for folder ${folder.name}:`, error);
27305
- setFolderAssets((prev) => ({ ...prev, [folder.name]: [] }));
27437
+ console.error(`Failed to load directory ${path}:`, error);
27438
+ setDirectoryChildren((prev) => ({ ...prev, [path]: [] }));
27306
27439
  } finally {
27307
- setFolderLoading((prev) => ({ ...prev, [folder.name]: false }));
27440
+ setDirectoryLoading((prev) => ({ ...prev, [path]: false }));
27308
27441
  }
27309
- }, [workspaceId, projectId, listPathByFolder]);
27442
+ }, [directoryExpanded, listPath]);
27310
27443
  useEffect40(() => {
27311
27444
  resourceFolders.forEach((folder) => {
27312
- loadAssetsForFolder(folder);
27445
+ void loadAssetsForFolder(folder, false);
27313
27446
  });
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");
27333
- return;
27334
- }
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);
27447
+ }, [resourceFolders, loadAssetsForFolder]);
27448
+ const handleAssetClick = useCallback32((asset) => {
27449
+ const fileUrl = getFileViewUrl(asset.path);
27450
+ if (!fileUrl) {
27451
+ message17.warning("Please select a workspace and project first.");
27356
27452
  return;
27357
27453
  }
27358
- setIsCreating(true);
27359
- setValidationError(null);
27360
- 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);
27370
- } finally {
27371
- setIsCreating(false);
27372
- }
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();
27379
- }
27380
- };
27381
- const isProjectNameValid = !validateProjectName(projectName.trim());
27382
- const handleUploadClick = async (folderName) => {
27454
+ openSideApp({
27455
+ component_key: "attachments",
27456
+ data: {
27457
+ file_id: asset.path,
27458
+ message: `Preview: ${asset.name || asset.path}`,
27459
+ full_url: fileUrl
27460
+ },
27461
+ message: `Preview: ${asset.name || asset.path}`
27462
+ });
27463
+ }, [getFileViewUrl, openSideApp]);
27464
+ const handleUploadFolder = useCallback32(async (folderName) => {
27383
27465
  if (!workspaceId || !projectId) {
27384
27466
  message17.warning("Please select a workspace and project before uploading.");
27385
27467
  return;
@@ -27396,7 +27478,7 @@ var ProjectsMenuContent = () => {
27396
27478
  try {
27397
27479
  await uploadFileToFolder(folderName, file);
27398
27480
  message17.success(`Uploaded "${file.name}" successfully`);
27399
- const folder = resourceFolders.find((f) => f.name === folderName);
27481
+ const folder = resourceFolders.find((item) => item.name === folderName);
27400
27482
  if (folder) {
27401
27483
  await loadAssetsForFolder(folder);
27402
27484
  }
@@ -27409,143 +27491,232 @@ var ProjectsMenuContent = () => {
27409
27491
  }
27410
27492
  };
27411
27493
  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;
27494
+ }, [workspaceId, projectId, uploadFileToFolder, resourceFolders, loadAssetsForFolder]);
27495
+ return /* @__PURE__ */ jsx106(
27496
+ FileDirectoryPanel,
27497
+ {
27498
+ workspaceId,
27499
+ projectId,
27500
+ resourceFolders,
27501
+ folderEntries,
27502
+ folderLoading,
27503
+ directoryChildren,
27504
+ directoryLoading,
27505
+ directoryExpanded,
27506
+ uploadingFolder,
27507
+ onRefreshFolder: loadAssetsForFolder,
27508
+ onUploadFolder: handleUploadFolder,
27509
+ onToggleDirectory: handleToggleDirectory,
27510
+ onAssetClick: handleAssetClick
27418
27511
  }
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
- ]
27512
+ );
27513
+ };
27514
+
27515
+ // src/components/Chat/HeaderIconButton.tsx
27516
+ import { Button as Button49 } from "antd";
27517
+ import { createStyles as createStyles33 } from "antd-style";
27518
+ import { jsx as jsx107 } from "react/jsx-runtime";
27519
+ var useStyles20 = createStyles33(({ token, css }) => ({
27520
+ button: css`
27521
+ display: inline-flex;
27522
+ align-items: center;
27523
+ justify-content: center;
27524
+ width: 32px;
27525
+ height: 32px;
27526
+ border-radius: 8px;
27527
+ border: 1px solid transparent;
27528
+ background: transparent;
27529
+ color: inherit;
27530
+ transition: all 0.2s ease;
27531
+
27532
+ &:hover {
27533
+ background: ${token.colorBgTextHover};
27534
+ border-color: ${token.colorBorderSecondary};
27535
+ }
27536
+
27537
+ &[aria-pressed="true"] {
27538
+ background: ${token.colorBgTextHover};
27539
+ border-color: ${token.colorBorderSecondary};
27540
+ }
27541
+ `
27542
+ }));
27543
+ var HeaderIconButton = ({
27544
+ ariaLabel,
27545
+ icon,
27546
+ onClick,
27547
+ pressed = false
27548
+ }) => {
27549
+ const { styles } = useStyles20();
27550
+ return /* @__PURE__ */ jsx107(
27551
+ Button49,
27552
+ {
27553
+ type: "text",
27554
+ size: "small",
27555
+ className: styles.button,
27556
+ icon,
27557
+ onClick,
27558
+ "aria-label": ariaLabel,
27559
+ "aria-pressed": pressed
27560
+ }
27561
+ );
27562
+ };
27563
+
27564
+ // src/components/Chat/LatticeChat.tsx
27565
+ import { jsx as jsx108, jsxs as jsxs77 } from "react/jsx-runtime";
27566
+ var useStyles21 = createStyles34(({ css }) => ({
27567
+ wrapper: css`
27568
+ display: flex;
27569
+ flex-direction: column;
27570
+ width: 100%;
27571
+ height: 100%;
27572
+ `,
27573
+ headerBar: css`
27574
+ display: flex;
27575
+ align-items: center;
27576
+ justify-content: space-between;
27577
+ gap: 12px;
27578
+ width: 100%;
27579
+ `,
27580
+ headerLeft: css`
27581
+ display: flex;
27582
+ align-items: center;
27583
+ min-width: 0;
27584
+ flex: 1;
27585
+ `,
27586
+ headerRight: css`
27587
+ display: flex;
27588
+ align-items: center;
27589
+ justify-content: flex-end;
27590
+ flex-shrink: 0;
27591
+ `
27592
+ }));
27593
+ var LatticeChatContent = (props) => {
27594
+ const { assistant_id: _assistantId, thread_id = "", menu, header, ...chatingProps } = props;
27595
+ const { config } = useLatticeChatShellContext();
27596
+ const { styles } = useStyles21();
27597
+ const { toolsVisible, toggleTools } = useChatUIContext();
27598
+ const showWorkspaceSelector = config.enableWorkspace;
27599
+ const layoutHeader = /* @__PURE__ */ jsxs77("div", { className: styles.headerBar, children: [
27600
+ /* @__PURE__ */ jsx108("div", { className: styles.headerLeft, children: showWorkspaceSelector ? /* @__PURE__ */ jsx108(ProjectSelector, {}) : null }),
27601
+ /* @__PURE__ */ jsx108("div", { className: styles.headerRight, children: /* @__PURE__ */ jsx108(
27602
+ HeaderIconButton,
27603
+ {
27604
+ ariaLabel: "Toggle file directory",
27605
+ icon: /* @__PURE__ */ jsx108(FolderOpen4, { size: 16 }),
27606
+ onClick: toggleTools,
27607
+ pressed: toolsVisible
27608
+ }
27609
+ ) })
27610
+ ] });
27611
+ return /* @__PURE__ */ jsxs77("div", { className: styles.wrapper, children: [
27612
+ header,
27613
+ /* @__PURE__ */ jsx108(
27614
+ ColumnLayout,
27615
+ {
27616
+ menu,
27617
+ header: layoutHeader,
27618
+ main: thread_id ? /* @__PURE__ */ jsx108(Chating, { ...chatingProps }) : /* @__PURE__ */ jsx108("div", { children: "Please create a conversation first" }),
27619
+ detail: /* @__PURE__ */ jsx108(SideAppViewBrowser, {}),
27620
+ tools: /* @__PURE__ */ jsx108(ToolPanelFiles, {})
27537
27621
  }
27538
27622
  )
27539
27623
  ] });
27540
27624
  };
27625
+ var LatticeChat = (props) => {
27626
+ return /* @__PURE__ */ jsx108(
27627
+ AgentThreadProvider,
27628
+ {
27629
+ assistantId: props.assistant_id,
27630
+ threadId: props.thread_id || "",
27631
+ options: {
27632
+ streaming: true,
27633
+ enableReturnStateWhenStreamCompleted: true,
27634
+ enableResumeStream: true
27635
+ },
27636
+ children: /* @__PURE__ */ jsx108(ChatUIContextProvider, { children: /* @__PURE__ */ jsx108(LatticeChatContent, { ...props }) })
27637
+ }
27638
+ );
27639
+ };
27640
+
27641
+ // src/components/Chat/AgentConversations.tsx
27642
+ import { Conversations } from "@ant-design/x";
27643
+ import { theme as theme14 } from "antd";
27644
+ import { useMemo as useMemo28 } from "react";
27645
+ import { jsx as jsx109 } from "react/jsx-runtime";
27646
+ var AgentConversations = ({
27647
+ enableThreadCreation = true,
27648
+ enableThreadList = true
27649
+ }) => {
27650
+ const { token } = theme14.useToken();
27651
+ const { currentAssistant } = useAssistantContext();
27652
+ const {
27653
+ assistantId,
27654
+ thread,
27655
+ selectThread,
27656
+ createThread,
27657
+ listThreads,
27658
+ threads
27659
+ } = useConversationContext();
27660
+ const style = {
27661
+ width: "100%",
27662
+ background: "transparent",
27663
+ borderRadius: token.borderRadius
27664
+ };
27665
+ const threadItems = useMemo28(() => {
27666
+ return threads || [];
27667
+ }, [threads]);
27668
+ const items = threadItems.map((thread2) => ({
27669
+ key: thread2.id,
27670
+ label: thread2.label
27671
+ }));
27672
+ const newChatClick = async () => {
27673
+ if (!assistantId) {
27674
+ return;
27675
+ }
27676
+ await createThread();
27677
+ };
27678
+ if (!enableThreadList) {
27679
+ return null;
27680
+ }
27681
+ const creation = enableThreadCreation ? {
27682
+ onClick: newChatClick
27683
+ } : void 0;
27684
+ return /* @__PURE__ */ jsx109(
27685
+ Conversations,
27686
+ {
27687
+ creation,
27688
+ items,
27689
+ activeKey: thread?.id,
27690
+ style,
27691
+ groupable: true,
27692
+ onActiveChange: (key) => {
27693
+ selectThread(key);
27694
+ }
27695
+ }
27696
+ );
27697
+ };
27698
+
27699
+ // src/components/Chat/LatticeChatView.tsx
27700
+ import { useContext as useContext11 } from "react";
27701
+
27702
+ // src/components/Chat/ChatSidebar.tsx
27703
+ import { useState as useState66, useMemo as useMemo29, useCallback as useCallback34 } from "react";
27704
+ import { Drawer as Drawer2, Avatar as Avatar13, Popover as Popover3, Button as Button50 } from "antd";
27705
+ import {
27706
+ History,
27707
+ LogOut as LogOut4,
27708
+ PlusCircle,
27709
+ PanelLeftClose as PanelLeftClose2,
27710
+ Key as Key2
27711
+ } from "lucide-react";
27541
27712
 
27542
27713
  // src/components/Chat/ThreadHistoryMenuContent.tsx
27543
- import React59, { useCallback as useCallback33 } from "react";
27544
- import { createStyles as createStyles33 } from "antd-style";
27714
+ import React61, { useCallback as useCallback33 } from "react";
27715
+ import { createStyles as createStyles35 } from "antd-style";
27545
27716
  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 }) => ({
27717
+ import { message as message18, Modal as Modal18 } from "antd";
27718
+ import { jsx as jsx110, jsxs as jsxs78 } from "react/jsx-runtime";
27719
+ var useStyles22 = createStyles35(({ token, css }) => ({
27549
27720
  container: css`
27550
27721
  padding: 4px;
27551
27722
  font-size: 13px;
@@ -27646,7 +27817,7 @@ var useStyles20 = createStyles33(({ token, css }) => ({
27646
27817
  `
27647
27818
  }));
27648
27819
  var ThreadHistoryMenuContent = () => {
27649
- const { styles } = useStyles20();
27820
+ const { styles } = useStyles22();
27650
27821
  const {
27651
27822
  threads,
27652
27823
  threadId,
@@ -27657,7 +27828,7 @@ var ThreadHistoryMenuContent = () => {
27657
27828
  const handleDeleteThread = useCallback33(
27658
27829
  async (e, threadIdToDelete) => {
27659
27830
  e.stopPropagation();
27660
- Modal19.confirm({
27831
+ Modal18.confirm({
27661
27832
  title: "Delete Conversation",
27662
27833
  content: "Are you sure you want to delete this conversation? This action cannot be undone.",
27663
27834
  okText: "Delete",
@@ -27675,7 +27846,7 @@ var ThreadHistoryMenuContent = () => {
27675
27846
  },
27676
27847
  [deleteThread]
27677
27848
  );
27678
- const sortedThreads = React59.useMemo(() => {
27849
+ const sortedThreads = React61.useMemo(() => {
27679
27850
  return [...threads].sort((a, b) => {
27680
27851
  const dateA = a.updatedAt ? new Date(a.updatedAt).getTime() : 0;
27681
27852
  const dateB = b.updatedAt ? new Date(b.updatedAt).getTime() : 0;
@@ -27683,30 +27854,30 @@ var ThreadHistoryMenuContent = () => {
27683
27854
  });
27684
27855
  }, [threads]);
27685
27856
  if (isLoading) {
27686
- return /* @__PURE__ */ jsx108("div", { className: styles.container, children: /* @__PURE__ */ jsx108("div", { className: styles.loading, children: "Loading conversations..." }) });
27857
+ return /* @__PURE__ */ jsx110("div", { className: styles.container, children: /* @__PURE__ */ jsx110("div", { className: styles.loading, children: "Loading conversations..." }) });
27687
27858
  }
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(
27859
+ 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
27860
  "div",
27690
27861
  {
27691
27862
  className: `${styles.threadItem} ${thread.id === threadId ? "active" : ""}`,
27692
27863
  onClick: () => selectThread(thread.id),
27693
27864
  title: thread.label,
27694
27865
  children: [
27695
- /* @__PURE__ */ jsx108("div", { className: styles.threadIcon, children: /* @__PURE__ */ jsx108(MessageSquare2, { size: 14 }) }),
27696
- /* @__PURE__ */ jsx108(
27866
+ /* @__PURE__ */ jsx110("div", { className: styles.threadIcon, children: /* @__PURE__ */ jsx110(MessageSquare2, { size: 14 }) }),
27867
+ /* @__PURE__ */ jsx110(
27697
27868
  "div",
27698
27869
  {
27699
27870
  className: thread.id === threadId ? styles.threadNameActive : styles.threadName,
27700
27871
  children: thread.label
27701
27872
  }
27702
27873
  ),
27703
- /* @__PURE__ */ jsx108(
27874
+ /* @__PURE__ */ jsx110(
27704
27875
  "button",
27705
27876
  {
27706
27877
  className: styles.deleteBtn,
27707
27878
  onClick: (e) => handleDeleteThread(e, thread.id),
27708
27879
  title: "Delete conversation",
27709
- children: /* @__PURE__ */ jsx108(Trash24, { size: 12 })
27880
+ children: /* @__PURE__ */ jsx110(Trash24, { size: 12 })
27710
27881
  }
27711
27882
  )
27712
27883
  ]
@@ -27716,7 +27887,7 @@ var ThreadHistoryMenuContent = () => {
27716
27887
  };
27717
27888
 
27718
27889
  // src/components/Chat/ChatSidebar.tsx
27719
- import { Fragment as Fragment24, jsx as jsx109, jsxs as jsxs79 } from "react/jsx-runtime";
27890
+ import { Fragment as Fragment23, jsx as jsx111, jsxs as jsxs79 } from "react/jsx-runtime";
27720
27891
  var DRAWER_STYLES2 = {
27721
27892
  wrapper: {
27722
27893
  background: "transparent",
@@ -27742,7 +27913,7 @@ var DEFAULT_MENU_ITEMS = [
27742
27913
  builtin: "new-analysis",
27743
27914
  type: "action",
27744
27915
  name: "New Analysis",
27745
- icon: /* @__PURE__ */ jsx109(PlusCircle, { size: 20 }),
27916
+ icon: /* @__PURE__ */ jsx111(PlusCircle, { size: 20 }),
27746
27917
  order: 0
27747
27918
  },
27748
27919
  // Second: Thread History (inline drawer)
@@ -27751,28 +27922,15 @@ var DEFAULT_MENU_ITEMS = [
27751
27922
  builtin: "thread-history",
27752
27923
  type: "drawer",
27753
27924
  name: "History",
27754
- icon: /* @__PURE__ */ jsx109(History, { size: 20 }),
27925
+ icon: /* @__PURE__ */ jsx111(History, { size: 20 }),
27755
27926
  order: 1,
27756
27927
  title: "Conversation History",
27757
27928
  width: 320,
27758
27929
  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
27930
  inlineDefaultExpanded: true,
27774
- content: /* @__PURE__ */ jsx109(ProjectsMenuContent, {})
27931
+ content: /* @__PURE__ */ jsx111(ThreadHistoryMenuContent, {})
27775
27932
  }
27933
+ // Project Files removed - now accessed via header toggle
27776
27934
  ];
27777
27935
  var ChatSidebar = ({
27778
27936
  onSettingsClick,
@@ -27835,18 +27993,16 @@ var ChatSidebar = ({
27835
27993
  }, [createThread]);
27836
27994
  const renderDrawerContent = useCallback34((item) => {
27837
27995
  switch (item.builtin) {
27838
- case "projects":
27839
- return /* @__PURE__ */ jsx109(ProjectsMenuContent, {});
27840
27996
  case "thread-history":
27841
- return /* @__PURE__ */ jsx109(ThreadHistoryMenuContent, {});
27997
+ return /* @__PURE__ */ jsx111(ThreadHistoryMenuContent, {});
27842
27998
  default:
27843
27999
  return item.content;
27844
28000
  }
27845
28001
  }, []);
27846
28002
  const userMenuItems = /* @__PURE__ */ jsxs79("div", { style: { minWidth: 160 }, children: [
27847
28003
  /* @__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 })
28004
+ /* @__PURE__ */ jsx111("div", { style: { fontWeight: 500 }, children: user?.name || user?.email }),
28005
+ /* @__PURE__ */ jsx111("div", { style: { fontSize: 12, color: "#666" }, children: user?.email })
27850
28006
  ] }),
27851
28007
  /* @__PURE__ */ jsxs79(
27852
28008
  Button50,
@@ -27856,7 +28012,7 @@ var ChatSidebar = ({
27856
28012
  style: { justifyContent: "flex-start", padding: "8px 12px" },
27857
28013
  onClick: () => setChangePasswordOpen(true),
27858
28014
  children: [
27859
- /* @__PURE__ */ jsx109(Key2, { size: 16, style: { marginRight: 8 } }),
28015
+ /* @__PURE__ */ jsx111(Key2, { size: 16, style: { marginRight: 8 } }),
27860
28016
  "Change Password"
27861
28017
  ]
27862
28018
  }
@@ -27870,14 +28026,14 @@ var ChatSidebar = ({
27870
28026
  style: { justifyContent: "flex-start", padding: "8px 12px" },
27871
28027
  onClick: logout,
27872
28028
  children: [
27873
- /* @__PURE__ */ jsx109(LogOut4, { size: 16, style: { marginRight: 8 } }),
28029
+ /* @__PURE__ */ jsx111(LogOut4, { size: 16, style: { marginRight: 8 } }),
27874
28030
  "Logout"
27875
28031
  ]
27876
28032
  }
27877
28033
  )
27878
28034
  ] });
27879
- return /* @__PURE__ */ jsxs79(Fragment24, { children: [
27880
- /* @__PURE__ */ jsx109(
28035
+ return /* @__PURE__ */ jsxs79(Fragment23, { children: [
28036
+ /* @__PURE__ */ jsx111(
27881
28037
  Menu,
27882
28038
  {
27883
28039
  items: menuItems,
@@ -27891,7 +28047,7 @@ var ChatSidebar = ({
27891
28047
  forceIconMode: sideAppVisible,
27892
28048
  collapsed: menuCollapsed,
27893
28049
  onCollapsedChange: setMenuCollapsed,
27894
- footer: ({ isIconMode }) => user && /* @__PURE__ */ jsx109(
28050
+ footer: ({ isIconMode }) => user && /* @__PURE__ */ jsx111(
27895
28051
  Popover3,
27896
28052
  {
27897
28053
  content: userMenuItems,
@@ -27911,7 +28067,7 @@ var ChatSidebar = ({
27911
28067
  transition: "all 0.2s"
27912
28068
  },
27913
28069
  children: [
27914
- /* @__PURE__ */ jsx109(
28070
+ /* @__PURE__ */ jsx111(
27915
28071
  Avatar13,
27916
28072
  {
27917
28073
  size: isIconMode ? 32 : 36,
@@ -27924,7 +28080,7 @@ var ChatSidebar = ({
27924
28080
  }
27925
28081
  ),
27926
28082
  !isIconMode && /* @__PURE__ */ jsxs79("div", { style: { flex: 1, minWidth: 0 }, children: [
27927
- /* @__PURE__ */ jsx109(
28083
+ /* @__PURE__ */ jsx111(
27928
28084
  "div",
27929
28085
  {
27930
28086
  style: {
@@ -27936,7 +28092,7 @@ var ChatSidebar = ({
27936
28092
  children: user.name || user.email
27937
28093
  }
27938
28094
  ),
27939
- /* @__PURE__ */ jsx109(
28095
+ /* @__PURE__ */ jsx111(
27940
28096
  "div",
27941
28097
  {
27942
28098
  style: {
@@ -27957,19 +28113,19 @@ var ChatSidebar = ({
27957
28113
  )
27958
28114
  }
27959
28115
  ),
27960
- /* @__PURE__ */ jsx109(
28116
+ /* @__PURE__ */ jsx111(
27961
28117
  ChangePasswordModal,
27962
28118
  {
27963
28119
  open: changePasswordOpen,
27964
28120
  onClose: () => setChangePasswordOpen(false)
27965
28121
  }
27966
28122
  ),
27967
- menuItems.filter((item) => item.type === "drawer" && !item.inline).map((item) => /* @__PURE__ */ jsx109(
28123
+ menuItems.filter((item) => item.type === "drawer" && !item.inline).map((item) => /* @__PURE__ */ jsx111(
27968
28124
  Drawer2,
27969
28125
  {
27970
28126
  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(
28127
+ /* @__PURE__ */ jsx111("span", { style: { fontSize: 16, fontWeight: 600, textTransform: "uppercase", letterSpacing: 0.5 }, children: item.title || item.name }),
28128
+ /* @__PURE__ */ jsx111(
27973
28129
  "button",
27974
28130
  {
27975
28131
  onClick: () => handleCloseDrawer(item.id),
@@ -27984,7 +28140,7 @@ var ChatSidebar = ({
27984
28140
  background: "rgba(255, 255, 255, 0.5)",
27985
28141
  cursor: "pointer"
27986
28142
  },
27987
- children: /* @__PURE__ */ jsx109(PanelLeftClose2, { size: 24 })
28143
+ children: /* @__PURE__ */ jsx111(PanelLeftClose2, { size: 24 })
27988
28144
  }
27989
28145
  )
27990
28146
  ] }),
@@ -28015,7 +28171,7 @@ var ChatSidebar = ({
28015
28171
  };
28016
28172
 
28017
28173
  // src/components/Chat/LatticeChatView.tsx
28018
- import { jsx as jsx110 } from "react/jsx-runtime";
28174
+ import { jsx as jsx112 } from "react/jsx-runtime";
28019
28175
  var LatticeChatView = (props) => {
28020
28176
  const shellContext = useContext11(LatticeChatShellContext);
28021
28177
  const { showSideMenu, sideMenuItems } = shellContext.config;
@@ -28024,7 +28180,7 @@ var LatticeChatView = (props) => {
28024
28180
  const {
28025
28181
  config: { baseURL }
28026
28182
  } = useLatticeChatShellContext();
28027
- return assistantId && thread ? /* @__PURE__ */ jsx110(
28183
+ return assistantId && thread ? /* @__PURE__ */ jsx112(
28028
28184
  AxiomLatticeProvider,
28029
28185
  {
28030
28186
  config: {
@@ -28033,14 +28189,14 @@ var LatticeChatView = (props) => {
28033
28189
  assistantId,
28034
28190
  transport: "sse"
28035
28191
  },
28036
- children: /* @__PURE__ */ jsx110(
28192
+ children: /* @__PURE__ */ jsx112(
28037
28193
  LatticeChat,
28038
28194
  {
28039
28195
  thread_id: thread?.id,
28040
28196
  assistant_id: assistantId,
28041
28197
  name: currentAssistant?.name,
28042
28198
  description: currentAssistant?.description,
28043
- menu: showSideMenu ? /* @__PURE__ */ jsx110(ChatSidebar, { customMenuItems: sideMenuItems }) : void 0
28199
+ menu: showSideMenu ? /* @__PURE__ */ jsx112(ChatSidebar, { customMenuItems: sideMenuItems }) : void 0
28044
28200
  }
28045
28201
  )
28046
28202
  }
@@ -28048,10 +28204,10 @@ var LatticeChatView = (props) => {
28048
28204
  };
28049
28205
 
28050
28206
  // src/components/Chat/SettingsModal.tsx
28051
- import { useState as useState67, useEffect as useEffect41, useRef as useRef26 } from "react";
28207
+ import { useState as useState67, useEffect as useEffect41, useRef as useRef25 } from "react";
28052
28208
  import {
28053
- Modal as Modal20,
28054
- Input as Input15,
28209
+ Modal as Modal19,
28210
+ Input as Input14,
28055
28211
  Button as Button51,
28056
28212
  message as message19,
28057
28213
  notification as notification5,
@@ -28074,11 +28230,11 @@ import {
28074
28230
  PlusOutlined as PlusOutlined7,
28075
28231
  CloudServerOutlined
28076
28232
  } 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";
28233
+ import { createStyles as createStyles36 } from "antd-style";
28234
+ import { Fragment as Fragment24, jsx as jsx113, jsxs as jsxs80 } from "react/jsx-runtime";
28079
28235
  var { Text: Text37, Title: Title13 } = Typography48;
28080
- var { TextArea: TextArea8 } = Input15;
28081
- var useStyles21 = createStyles34(({ token, css }) => ({
28236
+ var { TextArea: TextArea8 } = Input14;
28237
+ var useStyles23 = createStyles36(({ token, css }) => ({
28082
28238
  // settingsModal: css`
28083
28239
  // .ant-modal {
28084
28240
  // max-width: 100vw !important;
@@ -28423,19 +28579,19 @@ var SETTINGS_MENU_ITEMS = [
28423
28579
  {
28424
28580
  key: "environment",
28425
28581
  label: "Environment Variables",
28426
- icon: /* @__PURE__ */ jsx111(EnvironmentOutlined, {})
28582
+ icon: /* @__PURE__ */ jsx113(EnvironmentOutlined, {})
28427
28583
  },
28428
28584
  {
28429
28585
  key: "models",
28430
28586
  label: "Model Configuration",
28431
- icon: /* @__PURE__ */ jsx111(ApiOutlined, {})
28587
+ icon: /* @__PURE__ */ jsx113(ApiOutlined, {})
28432
28588
  }
28433
28589
  ];
28434
28590
  var SettingsModal = ({
28435
28591
  open,
28436
28592
  onClose
28437
28593
  }) => {
28438
- const { styles } = useStyles21();
28594
+ const { styles } = useStyles23();
28439
28595
  const { config: shellConfig, updateConfigValue } = useLatticeChatShellContext();
28440
28596
  const [connections, setConnections] = useState67(() => {
28441
28597
  if (typeof window !== "undefined") {
@@ -28461,7 +28617,7 @@ var SettingsModal = ({
28461
28617
  return [];
28462
28618
  });
28463
28619
  const [serverConfigs, setServerConfigs] = useState67({});
28464
- const connectionsRef = useRef26(connections);
28620
+ const connectionsRef = useRef25(connections);
28465
28621
  useEffect41(() => {
28466
28622
  connectionsRef.current = connections;
28467
28623
  }, [connections]);
@@ -28885,24 +29041,24 @@ var SettingsModal = ({
28885
29041
  }));
28886
29042
  };
28887
29043
  return /* @__PURE__ */ jsxs80("div", { className: styles.formContainer, children: [
28888
- /* @__PURE__ */ jsx111(
29044
+ /* @__PURE__ */ jsx113(
28889
29045
  Alert9,
28890
29046
  {
28891
29047
  message: "Configuration Effect",
28892
29048
  description: /* @__PURE__ */ jsxs80("div", { children: [
28893
29049
  /* @__PURE__ */ jsxs80("div", { style: { marginBottom: 8 }, children: [
28894
- /* @__PURE__ */ jsx111(
29050
+ /* @__PURE__ */ jsx113(
28895
29051
  CheckCircleOutlined8,
28896
29052
  {
28897
29053
  style: { color: "#52c41a", marginRight: 8 }
28898
29054
  }
28899
29055
  ),
28900
- /* @__PURE__ */ jsx111("strong", { children: "Immediately effective:" }),
29056
+ /* @__PURE__ */ jsx113("strong", { children: "Immediately effective:" }),
28901
29057
  " QUEUE_SERVICE_TYPE, REDIS_URL, REDIS_PASSWORD, QUEUE_NAME"
28902
29058
  ] }),
28903
29059
  /* @__PURE__ */ jsxs80("div", { children: [
28904
- /* @__PURE__ */ jsx111(ReloadOutlined4, { style: { color: "#faad14", marginRight: 8 } }),
28905
- /* @__PURE__ */ jsx111("strong", { children: "Requires restart:" }),
29060
+ /* @__PURE__ */ jsx113(ReloadOutlined4, { style: { color: "#faad14", marginRight: 8 } }),
29061
+ /* @__PURE__ */ jsx113("strong", { children: "Requires restart:" }),
28906
29062
  " PORT (server must be restarted to change port)"
28907
29063
  ] })
28908
29064
  ] }),
@@ -28911,8 +29067,8 @@ var SettingsModal = ({
28911
29067
  className: styles.alertCard
28912
29068
  }
28913
29069
  ),
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(
29070
+ /* @__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." }) }),
29071
+ /* @__PURE__ */ jsx113(
28916
29072
  TextArea8,
28917
29073
  {
28918
29074
  value: config.envText,
@@ -28990,7 +29146,7 @@ QUEUE_NAME=tasks`,
28990
29146
  }
28991
29147
  };
28992
29148
  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." }) }),
29149
+ /* @__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
29150
  config.models.map((model, index) => /* @__PURE__ */ jsxs80("div", { className: styles.card, children: [
28995
29151
  /* @__PURE__ */ jsxs80(
28996
29152
  "div",
@@ -29022,7 +29178,7 @@ QUEUE_NAME=tasks`,
29022
29178
  }
29023
29179
  )
29024
29180
  ] }),
29025
- config.models.length > 1 && /* @__PURE__ */ jsx111(
29181
+ config.models.length > 1 && /* @__PURE__ */ jsx113(
29026
29182
  Button51,
29027
29183
  {
29028
29184
  type: "text",
@@ -29041,9 +29197,9 @@ QUEUE_NAME=tasks`,
29041
29197
  ),
29042
29198
  /* @__PURE__ */ jsxs80(Space37, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
29043
29199
  /* @__PURE__ */ jsxs80("div", { children: [
29044
- /* @__PURE__ */ jsx111(Text37, { className: styles.formLabel, children: "Key *" }),
29045
- /* @__PURE__ */ jsx111(
29046
- Input15,
29200
+ /* @__PURE__ */ jsx113(Text37, { className: styles.formLabel, children: "Key *" }),
29201
+ /* @__PURE__ */ jsx113(
29202
+ Input14,
29047
29203
  {
29048
29204
  placeholder: "e.g., default, gpt-4, claude",
29049
29205
  value: model.key,
@@ -29051,11 +29207,11 @@ QUEUE_NAME=tasks`,
29051
29207
  style: { height: 40 }
29052
29208
  }
29053
29209
  ),
29054
- /* @__PURE__ */ jsx111(Text37, { className: styles.formDescription, children: "Unique identifier for this model" })
29210
+ /* @__PURE__ */ jsx113(Text37, { className: styles.formDescription, children: "Unique identifier for this model" })
29055
29211
  ] }),
29056
29212
  /* @__PURE__ */ jsxs80("div", { children: [
29057
- /* @__PURE__ */ jsx111(Text37, { className: styles.formLabel, children: "Provider *" }),
29058
- /* @__PURE__ */ jsx111(
29213
+ /* @__PURE__ */ jsx113(Text37, { className: styles.formLabel, children: "Provider *" }),
29214
+ /* @__PURE__ */ jsx113(
29059
29215
  Select7,
29060
29216
  {
29061
29217
  style: { width: "100%", height: 40 },
@@ -29072,9 +29228,9 @@ QUEUE_NAME=tasks`,
29072
29228
  )
29073
29229
  ] }),
29074
29230
  /* @__PURE__ */ jsxs80("div", { children: [
29075
- /* @__PURE__ */ jsx111(Text37, { className: styles.formLabel, children: "Model Name *" }),
29076
- /* @__PURE__ */ jsx111(
29077
- Input15,
29231
+ /* @__PURE__ */ jsx113(Text37, { className: styles.formLabel, children: "Model Name *" }),
29232
+ /* @__PURE__ */ jsx113(
29233
+ Input14,
29078
29234
  {
29079
29235
  placeholder: "e.g., gpt-4, claude-3-opus, kimi-k2-250905",
29080
29236
  value: model.model,
@@ -29084,9 +29240,9 @@ QUEUE_NAME=tasks`,
29084
29240
  )
29085
29241
  ] }),
29086
29242
  /* @__PURE__ */ jsxs80("div", { children: [
29087
- /* @__PURE__ */ jsx111(Text37, { className: styles.formLabel, children: "API Key" }),
29088
- /* @__PURE__ */ jsx111(
29089
- Input15.Password,
29243
+ /* @__PURE__ */ jsx113(Text37, { className: styles.formLabel, children: "API Key" }),
29244
+ /* @__PURE__ */ jsx113(
29245
+ Input14.Password,
29090
29246
  {
29091
29247
  placeholder: "Enter your API key",
29092
29248
  value: model.apiKey,
@@ -29094,12 +29250,12 @@ QUEUE_NAME=tasks`,
29094
29250
  style: { height: 40 }
29095
29251
  }
29096
29252
  ),
29097
- /* @__PURE__ */ jsx111(Text37, { className: styles.formDescription, children: "API key for the model provider. Leave empty to use environment variable." })
29253
+ /* @__PURE__ */ jsx113(Text37, { className: styles.formDescription, children: "API key for the model provider. Leave empty to use environment variable." })
29098
29254
  ] }),
29099
29255
  /* @__PURE__ */ jsxs80("div", { children: [
29100
- /* @__PURE__ */ jsx111(Text37, { className: styles.formLabel, children: "Base URL" }),
29101
- /* @__PURE__ */ jsx111(
29102
- Input15,
29256
+ /* @__PURE__ */ jsx113(Text37, { className: styles.formLabel, children: "Base URL" }),
29257
+ /* @__PURE__ */ jsx113(
29258
+ Input14,
29103
29259
  {
29104
29260
  placeholder: "e.g., https://api.openai.com/v1",
29105
29261
  value: model.baseURL,
@@ -29107,23 +29263,23 @@ QUEUE_NAME=tasks`,
29107
29263
  style: { height: 40 }
29108
29264
  }
29109
29265
  ),
29110
- /* @__PURE__ */ jsx111(Text37, { className: styles.formDescription, children: "Optional custom base URL for the API" })
29266
+ /* @__PURE__ */ jsx113(Text37, { className: styles.formDescription, children: "Optional custom base URL for the API" })
29111
29267
  ] }),
29112
- /* @__PURE__ */ jsx111("div", { children: /* @__PURE__ */ jsxs80(Space37, { children: [
29113
- /* @__PURE__ */ jsx111(
29268
+ /* @__PURE__ */ jsx113("div", { children: /* @__PURE__ */ jsxs80(Space37, { children: [
29269
+ /* @__PURE__ */ jsx113(
29114
29270
  Switch3,
29115
29271
  {
29116
29272
  checked: model.streaming,
29117
29273
  onChange: (checked) => handleModelChange(index, "streaming", checked)
29118
29274
  }
29119
29275
  ),
29120
- /* @__PURE__ */ jsx111(Text37, { children: "Enable Streaming" })
29276
+ /* @__PURE__ */ jsx113(Text37, { children: "Enable Streaming" })
29121
29277
  ] }) }),
29122
29278
  /* @__PURE__ */ jsxs80("div", { style: { display: "flex", gap: 20 }, children: [
29123
29279
  /* @__PURE__ */ jsxs80("div", { style: { flex: 1 }, children: [
29124
- /* @__PURE__ */ jsx111(Text37, { className: styles.formLabel, children: "Max Tokens" }),
29125
- /* @__PURE__ */ jsx111(
29126
- Input15,
29280
+ /* @__PURE__ */ jsx113(Text37, { className: styles.formLabel, children: "Max Tokens" }),
29281
+ /* @__PURE__ */ jsx113(
29282
+ Input14,
29127
29283
  {
29128
29284
  type: "number",
29129
29285
  placeholder: "e.g., 4096",
@@ -29138,9 +29294,9 @@ QUEUE_NAME=tasks`,
29138
29294
  )
29139
29295
  ] }),
29140
29296
  /* @__PURE__ */ jsxs80("div", { style: { flex: 1 }, children: [
29141
- /* @__PURE__ */ jsx111(Text37, { className: styles.formLabel, children: "Temperature" }),
29142
- /* @__PURE__ */ jsx111(
29143
- Input15,
29297
+ /* @__PURE__ */ jsx113(Text37, { className: styles.formLabel, children: "Temperature" }),
29298
+ /* @__PURE__ */ jsx113(
29299
+ Input14,
29144
29300
  {
29145
29301
  type: "number",
29146
29302
  step: "0.1",
@@ -29158,7 +29314,7 @@ QUEUE_NAME=tasks`,
29158
29314
  ] })
29159
29315
  ] })
29160
29316
  ] }, index)),
29161
- /* @__PURE__ */ jsx111(
29317
+ /* @__PURE__ */ jsx113(
29162
29318
  Button51,
29163
29319
  {
29164
29320
  type: "dashed",
@@ -29187,7 +29343,7 @@ QUEUE_NAME=tasks`,
29187
29343
  const currentConnection = connections.find((c) => c.id === activeTabKey);
29188
29344
  const renderTabLabel = (connection) => {
29189
29345
  return /* @__PURE__ */ jsxs80("div", { style: { display: "flex", alignItems: "center" }, children: [
29190
- /* @__PURE__ */ jsx111(
29346
+ /* @__PURE__ */ jsx113(
29191
29347
  CloudServerOutlined,
29192
29348
  {
29193
29349
  style: {
@@ -29196,14 +29352,14 @@ QUEUE_NAME=tasks`,
29196
29352
  }
29197
29353
  }
29198
29354
  ),
29199
- /* @__PURE__ */ jsx111("span", { children: connection.name }),
29200
- connection.connected && /* @__PURE__ */ jsx111(
29355
+ /* @__PURE__ */ jsx113("span", { children: connection.name }),
29356
+ connection.connected && /* @__PURE__ */ jsx113(
29201
29357
  CheckCircleFilled,
29202
29358
  {
29203
29359
  style: { color: "#52c41a", fontSize: 12, marginLeft: 8 }
29204
29360
  }
29205
29361
  ),
29206
- connection.error && !connection.connecting && /* @__PURE__ */ jsx111(
29362
+ connection.error && !connection.connecting && /* @__PURE__ */ jsx113(
29207
29363
  CloseCircleFilled,
29208
29364
  {
29209
29365
  style: { color: "#ff4d4f", fontSize: 12, marginLeft: 8 }
@@ -29214,15 +29370,15 @@ QUEUE_NAME=tasks`,
29214
29370
  const tabItems = connections.map((connection) => ({
29215
29371
  key: connection.id,
29216
29372
  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(
29373
+ children: /* @__PURE__ */ jsx113("div", { className: styles.tabContent, children: connection.connected ? /* @__PURE__ */ jsx113(Fragment24, { children: /* @__PURE__ */ jsxs80("div", { style: { display: "flex", height: "100%" }, children: [
29374
+ /* @__PURE__ */ jsx113("div", { className: styles.sidebar, children: SETTINGS_MENU_ITEMS.map((item) => /* @__PURE__ */ jsxs80(
29219
29375
  "div",
29220
29376
  {
29221
29377
  className: `${styles.menuItem} ${activeMenu === item.key ? "active" : ""}`,
29222
29378
  onClick: () => setActiveMenu(item.key),
29223
29379
  children: [
29224
- /* @__PURE__ */ jsx111("span", { className: styles.menuItemIcon, children: item.icon }),
29225
- /* @__PURE__ */ jsx111("span", { className: styles.menuItemText, children: item.label })
29380
+ /* @__PURE__ */ jsx113("span", { className: styles.menuItemIcon, children: item.icon }),
29381
+ /* @__PURE__ */ jsx113("span", { className: styles.menuItemText, children: item.label })
29226
29382
  ]
29227
29383
  },
29228
29384
  item.key
@@ -29230,19 +29386,19 @@ QUEUE_NAME=tasks`,
29230
29386
  /* @__PURE__ */ jsxs80("div", { className: styles.content, children: [
29231
29387
  /* @__PURE__ */ jsxs80("div", { className: styles.contentHeader, children: [
29232
29388
  /* @__PURE__ */ jsxs80("div", { className: styles.contentHeaderLeft, children: [
29233
- /* @__PURE__ */ jsx111(Title13, { level: 3, className: styles.contentTitle, children: activeMenuItem?.label }),
29389
+ /* @__PURE__ */ jsx113(Title13, { level: 3, className: styles.contentTitle, children: activeMenuItem?.label }),
29234
29390
  /* @__PURE__ */ jsxs80(Text37, { className: styles.contentDescription, children: [
29235
29391
  activeMenu === "environment" && "Manage environment variables for the gateway server",
29236
29392
  activeMenu === "models" && "Configure and register model lattices for use by agents"
29237
29393
  ] })
29238
29394
  ] }),
29239
29395
  /* @__PURE__ */ jsxs80("div", { className: styles.contentHeaderRight, children: [
29240
- /* @__PURE__ */ jsx111(Button51, { onClick: onClose, children: "Cancel" }),
29241
- /* @__PURE__ */ jsx111(
29396
+ /* @__PURE__ */ jsx113(Button51, { onClick: onClose, children: "Cancel" }),
29397
+ /* @__PURE__ */ jsx113(
29242
29398
  Button51,
29243
29399
  {
29244
29400
  type: "primary",
29245
- icon: /* @__PURE__ */ jsx111(SaveOutlined2, {}),
29401
+ icon: /* @__PURE__ */ jsx113(SaveOutlined2, {}),
29246
29402
  onClick: handleSave,
29247
29403
  loading,
29248
29404
  children: "Save Configuration"
@@ -29250,9 +29406,9 @@ QUEUE_NAME=tasks`,
29250
29406
  )
29251
29407
  ] })
29252
29408
  ] }),
29253
- /* @__PURE__ */ jsx111("div", { className: styles.contentBody, children: renderContent(connection.id) })
29409
+ /* @__PURE__ */ jsx113("div", { className: styles.contentBody, children: renderContent(connection.id) })
29254
29410
  ] })
29255
- ] }) }) : /* @__PURE__ */ jsx111(
29411
+ ] }) }) : /* @__PURE__ */ jsx113(
29256
29412
  "div",
29257
29413
  {
29258
29414
  style: {
@@ -29264,17 +29420,17 @@ QUEUE_NAME=tasks`,
29264
29420
  gap: 16,
29265
29421
  padding: 48
29266
29422
  },
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..." }),
29423
+ children: connection.connecting ? /* @__PURE__ */ jsxs80(Fragment24, { children: [
29424
+ /* @__PURE__ */ jsx113(LinkOutlined2, { style: { fontSize: 64, color: "#1890ff" }, spin: true }),
29425
+ /* @__PURE__ */ jsx113(Title13, { level: 4, children: "Connecting..." }),
29270
29426
  /* @__PURE__ */ jsxs80(Text37, { type: "secondary", style: { textAlign: "center" }, children: [
29271
29427
  "Connecting to ",
29272
29428
  connection.url
29273
29429
  ] })
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(
29430
+ ] }) : /* @__PURE__ */ jsxs80(Fragment24, { children: [
29431
+ /* @__PURE__ */ jsx113(LinkOutlined2, { style: { fontSize: 64, color: "#d9d9d9" } }),
29432
+ /* @__PURE__ */ jsx113(Title13, { level: 4, type: "secondary", children: connection.error || "Not Connected" }),
29433
+ /* @__PURE__ */ jsx113(
29278
29434
  Text37,
29279
29435
  {
29280
29436
  type: "secondary",
@@ -29282,11 +29438,11 @@ QUEUE_NAME=tasks`,
29282
29438
  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
29439
  }
29284
29440
  ),
29285
- /* @__PURE__ */ jsx111(
29441
+ /* @__PURE__ */ jsx113(
29286
29442
  Button51,
29287
29443
  {
29288
29444
  type: "primary",
29289
- icon: /* @__PURE__ */ jsx111(LinkOutlined2, {}),
29445
+ icon: /* @__PURE__ */ jsx113(LinkOutlined2, {}),
29290
29446
  onClick: () => checkConnection(connection.id),
29291
29447
  loading: connection.connecting,
29292
29448
  style: { marginTop: 16 },
@@ -29298,9 +29454,9 @@ QUEUE_NAME=tasks`,
29298
29454
  ) }),
29299
29455
  closable: connections.length > 1
29300
29456
  }));
29301
- return /* @__PURE__ */ jsxs80(Fragment25, { children: [
29302
- /* @__PURE__ */ jsx111(
29303
- Modal20,
29457
+ return /* @__PURE__ */ jsxs80(Fragment24, { children: [
29458
+ /* @__PURE__ */ jsx113(
29459
+ Modal19,
29304
29460
  {
29305
29461
  open,
29306
29462
  onCancel: onClose,
@@ -29308,7 +29464,7 @@ QUEUE_NAME=tasks`,
29308
29464
  width: "80%",
29309
29465
  footer: null,
29310
29466
  title: "Settings",
29311
- children: /* @__PURE__ */ jsx111("div", { children: /* @__PURE__ */ jsx111(
29467
+ children: /* @__PURE__ */ jsx113("div", { children: /* @__PURE__ */ jsx113(
29312
29468
  Tabs3,
29313
29469
  {
29314
29470
  activeKey: activeTabKey,
@@ -29332,8 +29488,8 @@ QUEUE_NAME=tasks`,
29332
29488
  padding: "4px 8px"
29333
29489
  },
29334
29490
  children: [
29335
- /* @__PURE__ */ jsx111(PlusOutlined7, {}),
29336
- /* @__PURE__ */ jsx111("span", { children: "Add Server" })
29491
+ /* @__PURE__ */ jsx113(PlusOutlined7, {}),
29492
+ /* @__PURE__ */ jsx113("span", { children: "Add Server" })
29337
29493
  ]
29338
29494
  }
29339
29495
  )
@@ -29341,8 +29497,8 @@ QUEUE_NAME=tasks`,
29341
29497
  ) })
29342
29498
  }
29343
29499
  ),
29344
- /* @__PURE__ */ jsx111(
29345
- Modal20,
29500
+ /* @__PURE__ */ jsx113(
29501
+ Modal19,
29346
29502
  {
29347
29503
  title: "Add New Server",
29348
29504
  open: showAddServerModal,
@@ -29357,9 +29513,9 @@ QUEUE_NAME=tasks`,
29357
29513
  className: styles.addServerModal,
29358
29514
  children: /* @__PURE__ */ jsxs80(Space37, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
29359
29515
  /* @__PURE__ */ jsxs80("div", { children: [
29360
- /* @__PURE__ */ jsx111(Text37, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server Name" }),
29361
- /* @__PURE__ */ jsx111(
29362
- Input15,
29516
+ /* @__PURE__ */ jsx113(Text37, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server Name" }),
29517
+ /* @__PURE__ */ jsx113(
29518
+ Input14,
29363
29519
  {
29364
29520
  placeholder: "e.g., Production Server",
29365
29521
  value: newServerName,
@@ -29367,12 +29523,12 @@ QUEUE_NAME=tasks`,
29367
29523
  onPressEnter: handleAddServer
29368
29524
  }
29369
29525
  ),
29370
- /* @__PURE__ */ jsx111(Text37, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: Leave empty to use URL as name" })
29526
+ /* @__PURE__ */ jsx113(Text37, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: Leave empty to use URL as name" })
29371
29527
  ] }),
29372
29528
  /* @__PURE__ */ jsxs80("div", { children: [
29373
- /* @__PURE__ */ jsx111(Text37, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server URL *" }),
29374
- /* @__PURE__ */ jsx111(
29375
- Input15,
29529
+ /* @__PURE__ */ jsx113(Text37, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server URL *" }),
29530
+ /* @__PURE__ */ jsx113(
29531
+ Input14,
29376
29532
  {
29377
29533
  placeholder: "e.g., http://localhost:4001",
29378
29534
  value: newServerUrl,
@@ -29380,12 +29536,12 @@ QUEUE_NAME=tasks`,
29380
29536
  onPressEnter: handleAddServer
29381
29537
  }
29382
29538
  ),
29383
- /* @__PURE__ */ jsx111(Text37, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Enter the full URL of the gateway server" })
29539
+ /* @__PURE__ */ jsx113(Text37, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Enter the full URL of the gateway server" })
29384
29540
  ] }),
29385
29541
  /* @__PURE__ */ jsxs80("div", { children: [
29386
- /* @__PURE__ */ jsx111(Text37, { strong: true, style: { display: "block", marginBottom: 8 }, children: "API Key" }),
29387
- /* @__PURE__ */ jsx111(
29388
- Input15.Password,
29542
+ /* @__PURE__ */ jsx113(Text37, { strong: true, style: { display: "block", marginBottom: 8 }, children: "API Key" }),
29543
+ /* @__PURE__ */ jsx113(
29544
+ Input14.Password,
29389
29545
  {
29390
29546
  placeholder: "Optional: Enter API key for authentication",
29391
29547
  value: newServerApiKey,
@@ -29393,7 +29549,7 @@ QUEUE_NAME=tasks`,
29393
29549
  onPressEnter: handleAddServer
29394
29550
  }
29395
29551
  ),
29396
- /* @__PURE__ */ jsx111(Text37, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: API key for server authentication" })
29552
+ /* @__PURE__ */ jsx113(Text37, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: API key for server authentication" })
29397
29553
  ] })
29398
29554
  ] })
29399
29555
  }
@@ -29402,10 +29558,10 @@ QUEUE_NAME=tasks`,
29402
29558
  };
29403
29559
 
29404
29560
  // src/components/Chat/AgentServerSetting.tsx
29405
- import { jsx as jsx112 } from "react/jsx-runtime";
29561
+ import { jsx as jsx114 } from "react/jsx-runtime";
29406
29562
  var AgentServerSetting = () => {
29407
29563
  const { settingsModalOpen, setSettingsModalOpen } = useLatticeChatShellContext();
29408
- return /* @__PURE__ */ jsx112(
29564
+ return /* @__PURE__ */ jsx114(
29409
29565
  SettingsModal,
29410
29566
  {
29411
29567
  open: settingsModalOpen,
@@ -29415,24 +29571,24 @@ var AgentServerSetting = () => {
29415
29571
  };
29416
29572
 
29417
29573
  // src/components/Chat/LatticeChatShell.tsx
29418
- import { Fragment as Fragment26, jsx as jsx113, jsxs as jsxs81 } from "react/jsx-runtime";
29574
+ import { Fragment as Fragment25, jsx as jsx115, jsxs as jsxs81 } from "react/jsx-runtime";
29419
29575
  var ShellContent = ({
29420
29576
  initialAssistantId,
29421
29577
  enableWorkspace
29422
29578
  }) => {
29423
29579
  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, {})
29580
+ return /* @__PURE__ */ jsx115(Fragment25, { children: enableWorkspace ? /* @__PURE__ */ jsxs81(WorkspaceContextProvider, { children: [
29581
+ /* @__PURE__ */ jsx115(AssistantContextProvider, { autoLoad: true, initialAssistantId, children: /* @__PURE__ */ jsx115(ConversationContextProvider, { children: /* @__PURE__ */ jsx115(LatticeChatView, {}) }) }),
29582
+ /* @__PURE__ */ jsx115(AgentServerSetting, {})
29583
+ ] }) : /* @__PURE__ */ jsxs81(Fragment25, { children: [
29584
+ /* @__PURE__ */ jsx115(AssistantContextProvider, { autoLoad: true, initialAssistantId, children: /* @__PURE__ */ jsx115(ConversationContextProvider, { children: /* @__PURE__ */ jsx115(LatticeChatView, {}) }) }),
29585
+ /* @__PURE__ */ jsx115(AgentServerSetting, {})
29430
29586
  ] }) });
29431
29587
  };
29432
29588
  var LatticeChatShell = (props) => {
29433
29589
  const { enableAssistantCreation, enableAssistantEditing, enableWorkspace: enableWorkspaceProp, ...restProps } = props;
29434
29590
  const enableWorkspace = enableWorkspaceProp ?? restProps.initialConfig?.enableWorkspace ?? false;
29435
- return /* @__PURE__ */ jsx113(
29591
+ return /* @__PURE__ */ jsx115(
29436
29592
  LatticeChatShellContextProvider,
29437
29593
  {
29438
29594
  initialConfig: {
@@ -29441,7 +29597,7 @@ var LatticeChatShell = (props) => {
29441
29597
  enableWorkspace,
29442
29598
  ...restProps.initialConfig
29443
29599
  },
29444
- children: /* @__PURE__ */ jsx113(
29600
+ children: /* @__PURE__ */ jsx115(
29445
29601
  ShellContent,
29446
29602
  {
29447
29603
  initialAssistantId: restProps.initialConfig?.assistantId,
@@ -29451,6 +29607,348 @@ var LatticeChatShell = (props) => {
29451
29607
  }
29452
29608
  );
29453
29609
  };
29610
+
29611
+ // src/components/Chat/ChannelInstallationsDrawerContent.tsx
29612
+ import { useEffect as useEffect42, useState as useState68 } from "react";
29613
+ import {
29614
+ Button as Button52,
29615
+ Card as Card23,
29616
+ Form as Form7,
29617
+ Input as Input15,
29618
+ Modal as Modal20,
29619
+ Popconfirm as Popconfirm6,
29620
+ Select as Select8,
29621
+ Spin as Spin16,
29622
+ Tag as Tag22,
29623
+ Typography as Typography49,
29624
+ message as message20
29625
+ } from "antd";
29626
+ import { Edit2 as Edit24, Plus as Plus8, RadioTower, Trash2 as Trash25 } from "lucide-react";
29627
+ import { jsx as jsx116, jsxs as jsxs82 } from "react/jsx-runtime";
29628
+ var { Text: Text38, Title: Title14 } = Typography49;
29629
+ var MAPPING_MODE_OPTIONS = [
29630
+ { label: "User", value: "user" },
29631
+ { label: "Group", value: "group" },
29632
+ { label: "Hybrid", value: "hybrid" }
29633
+ ];
29634
+ var ChannelInstallationsDrawerContent = () => {
29635
+ const { get, post, put, del } = useApi();
29636
+ const [installations, setInstallations] = useState68([]);
29637
+ const [loading, setLoading] = useState68(false);
29638
+ const [formModalOpen, setFormModalOpen] = useState68(false);
29639
+ const [editingInstallation, setEditingInstallation] = useState68(null);
29640
+ const loadInstallations = async () => {
29641
+ setLoading(true);
29642
+ try {
29643
+ const result = await get(
29644
+ "/api/channel-installations"
29645
+ );
29646
+ if (result.success) {
29647
+ setInstallations(result.data?.records ?? []);
29648
+ } else {
29649
+ setInstallations([]);
29650
+ message20.error(result.message || "Failed to load channel installations");
29651
+ }
29652
+ } catch (error) {
29653
+ console.error("Failed to load channel installations:", error);
29654
+ setInstallations([]);
29655
+ message20.error("Failed to load channel installations");
29656
+ } finally {
29657
+ setLoading(false);
29658
+ }
29659
+ };
29660
+ useEffect42(() => {
29661
+ loadInstallations();
29662
+ }, []);
29663
+ const handleDelete = async (installation) => {
29664
+ try {
29665
+ const result = await del(
29666
+ `/api/channel-installations/${installation.id}`
29667
+ );
29668
+ if (result.success) {
29669
+ setInstallations(
29670
+ (current) => current.filter((item) => item.id !== installation.id)
29671
+ );
29672
+ message20.success("Installation deleted");
29673
+ } else {
29674
+ message20.error(result.message || "Failed to delete installation");
29675
+ }
29676
+ } catch (error) {
29677
+ console.error("Failed to delete channel installation:", error);
29678
+ message20.error("Failed to delete installation");
29679
+ }
29680
+ };
29681
+ return /* @__PURE__ */ jsxs82("div", { style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
29682
+ /* @__PURE__ */ jsx116("div", { style: { padding: 16 }, children: /* @__PURE__ */ jsxs82(
29683
+ "div",
29684
+ {
29685
+ style: {
29686
+ display: "flex",
29687
+ justifyContent: "space-between",
29688
+ alignItems: "center"
29689
+ },
29690
+ children: [
29691
+ /* @__PURE__ */ jsx116(Title14, { level: 5, style: { margin: 0 }, children: "Channel Installations" }),
29692
+ /* @__PURE__ */ jsx116(
29693
+ Button52,
29694
+ {
29695
+ type: "primary",
29696
+ icon: /* @__PURE__ */ jsx116(Plus8, { size: 16 }),
29697
+ onClick: () => {
29698
+ setEditingInstallation(null);
29699
+ setFormModalOpen(true);
29700
+ },
29701
+ children: "Add Installation"
29702
+ }
29703
+ )
29704
+ ]
29705
+ }
29706
+ ) }),
29707
+ /* @__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(
29708
+ "div",
29709
+ {
29710
+ style: {
29711
+ display: "flex",
29712
+ flexDirection: "column",
29713
+ alignItems: "center",
29714
+ justifyContent: "center",
29715
+ padding: "48px 16px"
29716
+ },
29717
+ children: [
29718
+ /* @__PURE__ */ jsx116(RadioTower, { size: 48, style: { marginBottom: 16, opacity: 0.5 } }),
29719
+ /* @__PURE__ */ jsx116(Text38, { strong: true, style: { fontSize: 15 }, children: "No channel installations" }),
29720
+ /* @__PURE__ */ jsx116(Text38, { type: "secondary", style: { marginTop: 8 }, children: 'Click "Add Installation" to create one' })
29721
+ ]
29722
+ }
29723
+ ) : /* @__PURE__ */ jsx116("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: installations.map((installation) => {
29724
+ const webhookPath = installation.channel === "lark" ? `/api/channels/lark/installations/${installation.id}/events` : null;
29725
+ return /* @__PURE__ */ jsxs82(Card23, { size: "small", children: [
29726
+ /* @__PURE__ */ jsxs82(
29727
+ "div",
29728
+ {
29729
+ style: {
29730
+ display: "flex",
29731
+ justifyContent: "space-between",
29732
+ alignItems: "flex-start",
29733
+ marginBottom: 10
29734
+ },
29735
+ children: [
29736
+ /* @__PURE__ */ jsx116(Text38, { strong: true, style: { fontSize: 15 }, children: installation.name || installation.id }),
29737
+ /* @__PURE__ */ jsx116(Tag22, { color: "blue", children: installation.channel })
29738
+ ]
29739
+ }
29740
+ ),
29741
+ /* @__PURE__ */ jsxs82(
29742
+ "div",
29743
+ {
29744
+ style: {
29745
+ display: "flex",
29746
+ flexDirection: "column",
29747
+ gap: 6,
29748
+ marginBottom: 12
29749
+ },
29750
+ children: [
29751
+ /* @__PURE__ */ jsxs82(Text38, { type: "secondary", style: { fontSize: 12 }, children: [
29752
+ "ID: ",
29753
+ installation.id
29754
+ ] }),
29755
+ /* @__PURE__ */ jsxs82(Text38, { style: { fontSize: 13 }, children: [
29756
+ "Assistant ID: ",
29757
+ installation.config.assistantId
29758
+ ] }),
29759
+ /* @__PURE__ */ jsxs82(Text38, { style: { fontSize: 13 }, children: [
29760
+ "Mapping Mode: ",
29761
+ installation.config.mappingMode
29762
+ ] }),
29763
+ installation.config.workspaceId ? /* @__PURE__ */ jsxs82(Text38, { style: { fontSize: 13 }, children: [
29764
+ "Workspace ID: ",
29765
+ installation.config.workspaceId
29766
+ ] }) : null,
29767
+ installation.config.projectId ? /* @__PURE__ */ jsxs82(Text38, { style: { fontSize: 13 }, children: [
29768
+ "Project ID: ",
29769
+ installation.config.projectId
29770
+ ] }) : null,
29771
+ webhookPath ? /* @__PURE__ */ jsx116(Text38, { code: true, style: { fontSize: 12 }, children: webhookPath }) : /* @__PURE__ */ jsx116(Text38, { type: "secondary", style: { fontSize: 12 }, children: "Unsupported channel configuration UI" })
29772
+ ]
29773
+ }
29774
+ ),
29775
+ /* @__PURE__ */ jsxs82("div", { style: { display: "flex", gap: 8 }, children: [
29776
+ /* @__PURE__ */ jsx116(
29777
+ Button52,
29778
+ {
29779
+ icon: /* @__PURE__ */ jsx116(Edit24, { size: 14 }),
29780
+ onClick: () => {
29781
+ setEditingInstallation(installation);
29782
+ setFormModalOpen(true);
29783
+ },
29784
+ children: "Edit"
29785
+ }
29786
+ ),
29787
+ /* @__PURE__ */ jsx116(
29788
+ Popconfirm6,
29789
+ {
29790
+ title: "Delete Channel Installation",
29791
+ description: `Are you sure you want to delete "${installation.name || installation.id}"?`,
29792
+ onConfirm: () => handleDelete(installation),
29793
+ okText: "Delete",
29794
+ okType: "danger",
29795
+ cancelText: "Cancel",
29796
+ children: /* @__PURE__ */ jsx116(Button52, { danger: true, icon: /* @__PURE__ */ jsx116(Trash25, { size: 14 }), children: "Delete" })
29797
+ }
29798
+ )
29799
+ ] })
29800
+ ] }, installation.id);
29801
+ }) }) }),
29802
+ formModalOpen ? /* @__PURE__ */ jsx116(
29803
+ LarkChannelInstallationFormModal,
29804
+ {
29805
+ installation: editingInstallation,
29806
+ open: formModalOpen,
29807
+ post,
29808
+ put,
29809
+ onCancel: () => {
29810
+ setFormModalOpen(false);
29811
+ setEditingInstallation(null);
29812
+ },
29813
+ onSave: () => {
29814
+ setFormModalOpen(false);
29815
+ setEditingInstallation(null);
29816
+ loadInstallations();
29817
+ }
29818
+ }
29819
+ ) : null
29820
+ ] });
29821
+ };
29822
+ var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCancel, onSave }) => {
29823
+ const [form] = Form7.useForm();
29824
+ useEffect42(() => {
29825
+ if (installation) {
29826
+ form.setFieldsValue({
29827
+ name: installation.name,
29828
+ appId: installation.config.appId,
29829
+ appSecret: installation.config.appSecret,
29830
+ verificationToken: installation.config.verificationToken,
29831
+ encryptKey: installation.config.encryptKey,
29832
+ mappingMode: installation.config.mappingMode,
29833
+ assistantId: installation.config.assistantId,
29834
+ workspaceId: installation.config.workspaceId,
29835
+ projectId: installation.config.projectId
29836
+ });
29837
+ return;
29838
+ }
29839
+ form.resetFields();
29840
+ form.setFieldsValue({
29841
+ mappingMode: "hybrid"
29842
+ });
29843
+ }, [installation, form]);
29844
+ const handleSubmit = async () => {
29845
+ const values = await form.validateFields();
29846
+ const config = {
29847
+ appId: values.appId,
29848
+ appSecret: values.appSecret,
29849
+ verificationToken: values.verificationToken,
29850
+ encryptKey: values.encryptKey,
29851
+ mappingMode: values.mappingMode,
29852
+ assistantId: values.assistantId,
29853
+ workspaceId: values.workspaceId,
29854
+ projectId: values.projectId
29855
+ };
29856
+ try {
29857
+ if (installation) {
29858
+ const payload2 = {
29859
+ name: values.name,
29860
+ config
29861
+ };
29862
+ const result2 = await put(
29863
+ `/api/channel-installations/${installation.id}`,
29864
+ payload2
29865
+ );
29866
+ if (result2.success) {
29867
+ message20.success("Installation updated");
29868
+ onSave();
29869
+ } else {
29870
+ message20.error(result2.message || "Failed to update installation");
29871
+ }
29872
+ return;
29873
+ }
29874
+ const payload = {
29875
+ channel: "lark",
29876
+ name: values.name,
29877
+ config
29878
+ };
29879
+ const result = await post(
29880
+ "/api/channel-installations",
29881
+ payload
29882
+ );
29883
+ if (result.success) {
29884
+ message20.success("Installation created");
29885
+ onSave();
29886
+ } else {
29887
+ message20.error(result.message || "Failed to create installation");
29888
+ }
29889
+ } catch (error) {
29890
+ console.error("Failed to save channel installation:", error);
29891
+ message20.error(
29892
+ installation ? "Failed to update installation" : "Failed to create installation"
29893
+ );
29894
+ }
29895
+ };
29896
+ return /* @__PURE__ */ jsx116(
29897
+ Modal20,
29898
+ {
29899
+ open,
29900
+ title: installation ? "Edit Installation" : "Add Installation",
29901
+ onCancel,
29902
+ onOk: handleSubmit,
29903
+ okText: installation ? "Save" : "Create",
29904
+ destroyOnHidden: true,
29905
+ children: /* @__PURE__ */ jsxs82(Form7, { form, layout: "vertical", children: [
29906
+ /* @__PURE__ */ jsx116(Form7.Item, { label: "Channel", children: /* @__PURE__ */ jsx116(Input15, { value: "lark", disabled: true }) }),
29907
+ /* @__PURE__ */ jsx116(Form7.Item, { name: "name", label: "Name", children: /* @__PURE__ */ jsx116(Input15, {}) }),
29908
+ /* @__PURE__ */ jsx116(
29909
+ Form7.Item,
29910
+ {
29911
+ name: "appId",
29912
+ label: "App ID",
29913
+ rules: [{ required: true, message: "App ID is required" }],
29914
+ children: /* @__PURE__ */ jsx116(Input15, {})
29915
+ }
29916
+ ),
29917
+ /* @__PURE__ */ jsx116(
29918
+ Form7.Item,
29919
+ {
29920
+ name: "appSecret",
29921
+ label: "App Secret",
29922
+ rules: [{ required: true, message: "App Secret is required" }],
29923
+ children: /* @__PURE__ */ jsx116(Input15, {})
29924
+ }
29925
+ ),
29926
+ /* @__PURE__ */ jsx116(Form7.Item, { name: "verificationToken", label: "Verification Token", children: /* @__PURE__ */ jsx116(Input15, {}) }),
29927
+ /* @__PURE__ */ jsx116(Form7.Item, { name: "encryptKey", label: "Encrypt Key", children: /* @__PURE__ */ jsx116(Input15, {}) }),
29928
+ /* @__PURE__ */ jsx116(
29929
+ Form7.Item,
29930
+ {
29931
+ name: "mappingMode",
29932
+ label: "Mapping Mode",
29933
+ rules: [{ required: true, message: "Mapping Mode is required" }],
29934
+ children: /* @__PURE__ */ jsx116(Select8, { options: MAPPING_MODE_OPTIONS })
29935
+ }
29936
+ ),
29937
+ /* @__PURE__ */ jsx116(
29938
+ Form7.Item,
29939
+ {
29940
+ name: "assistantId",
29941
+ label: "Assistant ID",
29942
+ rules: [{ required: true, message: "Assistant ID is required" }],
29943
+ children: /* @__PURE__ */ jsx116(Input15, {})
29944
+ }
29945
+ ),
29946
+ /* @__PURE__ */ jsx116(Form7.Item, { name: "workspaceId", label: "Workspace ID", children: /* @__PURE__ */ jsx116(Input15, {}) }),
29947
+ /* @__PURE__ */ jsx116(Form7.Item, { name: "projectId", label: "Project ID", children: /* @__PURE__ */ jsx116(Input15, {}) })
29948
+ ] })
29949
+ }
29950
+ );
29951
+ };
29454
29952
  export {
29455
29953
  AgentConversations,
29456
29954
  AgentThreadProvider,
@@ -29461,6 +29959,7 @@ export {
29461
29959
  AuthProvider,
29462
29960
  AxiomLatticeProvider,
29463
29961
  ChangePasswordModal,
29962
+ ChannelInstallationsDrawerContent,
29464
29963
  ChatUIContext,
29465
29964
  ChatUIContextProvider,
29466
29965
  Chating,
@@ -29468,6 +29967,7 @@ export {
29468
29967
  ConversationContext,
29469
29968
  ConversationContextProvider,
29470
29969
  CreateAssistantModal_default as CreateAssistantModal,
29970
+ DEFAULT_MIDDLEWARE_TYPES,
29471
29971
  FileExplorer,
29472
29972
  LatticeChat,
29473
29973
  LatticeChatShell,