@axiom-lattice/react-sdk 2.1.75 → 2.1.77

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
@@ -1359,6 +1359,7 @@ var DEFAULT_CONFIG = {
1359
1359
  enableModelSelector: false,
1360
1360
  sidebarMode: "icon",
1361
1361
  sidebarDefaultExpanded: true,
1362
+ workspaceMenuDefaultExpanded: true,
1362
1363
  sidebarShowToggle: true,
1363
1364
  sidebarShowNewAnalysis: true,
1364
1365
  sidebarLogoText: "Lattice"
@@ -8778,7 +8779,7 @@ import { Typography as Typography43 } from "antd";
8778
8779
  import {
8779
8780
  CloudUploadOutlined,
8780
8781
  PaperClipOutlined,
8781
- ReloadOutlined as ReloadOutlined3,
8782
+ ReloadOutlined as ReloadOutlined4,
8782
8783
  FileImageOutlined as FileImageOutlined5,
8783
8784
  FileTextOutlined as FileTextOutlined10,
8784
8785
  FilePdfOutlined as FilePdfOutlined5,
@@ -8981,7 +8982,7 @@ import {
8981
8982
  Space as Space30,
8982
8983
  Typography as Typography42
8983
8984
  } from "antd";
8984
- import React51, { useCallback as useCallback34, useContext as useContext10, useEffect as useEffect46, useRef as useRef23, useState as useState66 } from "react";
8985
+ import React51, { useCallback as useCallback34, useContext as useContext10, useEffect as useEffect46, useRef as useRef24, useState as useState66 } from "react";
8985
8986
  import { BrainCircuit as BrainCircuit3 } from "lucide-react";
8986
8987
 
8987
8988
  // src/components/GenUI/HITLContainer.tsx
@@ -10049,7 +10050,7 @@ import React43, {
10049
10050
  import { WorkspaceClient, Client as Client2 } from "@axiom-lattice/client-sdk";
10050
10051
 
10051
10052
  // src/components/Chat/WorkspaceResourceManager.tsx
10052
- import { useMemo as useMemo19, useEffect as useEffect40, useRef as useRef17, useState as useState57 } from "react";
10053
+ import { useMemo as useMemo19, useEffect as useEffect40, useRef as useRef18, useState as useState57 } from "react";
10053
10054
  import { FolderOpen as FolderOpen2, Activity as Activity3, Database as Database4, Plug as Plug2, Bot as Bot2, Wrench, Zap, LogOut as LogOut3, Building2 as Building23, Key, Share2, History, Inbox, FlaskConical as FlaskConical3 } from "lucide-react";
10054
10055
  import { Modal as Modal13, Avatar as Avatar8, Popover as Popover2, Button as Button41 } from "antd";
10055
10056
 
@@ -19038,7 +19039,7 @@ var TopologyAutomationView = () => {
19038
19039
  };
19039
19040
 
19040
19041
  // src/components/Chat/TopologyRuntimeView.tsx
19041
- import { useEffect as useEffect37, useState as useState52, useMemo as useMemo17, useCallback as useCallback31 } from "react";
19042
+ import { useEffect as useEffect37, useState as useState52, useMemo as useMemo17, useCallback as useCallback31, useRef as useRef17 } from "react";
19042
19043
  import {
19043
19044
  Spin as Spin10,
19044
19045
  Empty as Empty6,
@@ -19049,13 +19050,16 @@ import {
19049
19050
  Card as Card17,
19050
19051
  Drawer as Drawer2,
19051
19052
  Badge as Badge5,
19052
- Progress as Progress3
19053
+ Tooltip as Tooltip13,
19054
+ Progress as Progress3,
19055
+ Switch as Switch3
19053
19056
  } from "antd";
19054
19057
  import {
19055
19058
  CheckCircleOutlined as CheckCircleOutlined5,
19056
19059
  SyncOutlined as SyncOutlined2,
19057
19060
  CloseCircleOutlined as CloseCircleOutlined2,
19058
- ClockCircleOutlined as ClockCircleOutlined3
19061
+ ClockCircleOutlined as ClockCircleOutlined3,
19062
+ ReloadOutlined as ReloadOutlined2
19059
19063
  } from "@ant-design/icons";
19060
19064
  import {
19061
19065
  ReactFlow as ReactFlow4,
@@ -19549,20 +19553,59 @@ function RunSummaryBanner({ run, agentName }) {
19549
19553
  }
19550
19554
  );
19551
19555
  }
19552
- var RunDetail = ({ run, agentName, open, onClose }) => {
19556
+ var RunDetail = ({ run, agentName, open, onClose, onRunUpdate, autoRefresh }) => {
19553
19557
  const { get } = useApi();
19554
19558
  const [steps, setSteps] = useState52([]);
19555
19559
  const [loading, setLoading] = useState52(false);
19560
+ const stepsPollTimeoutRef = useRef17(null);
19561
+ const stepsPollSessionRef = useRef17(0);
19562
+ const fetchSteps = useCallback31(async () => {
19563
+ try {
19564
+ const [stepsRes, runsRes] = await Promise.all([
19565
+ get(
19566
+ `/api/workflows/runs/${run.id}/steps`
19567
+ ),
19568
+ get(
19569
+ "/api/workflows/runs"
19570
+ )
19571
+ ]);
19572
+ if (stepsRes.success) setSteps(stepsRes.data?.records || []);
19573
+ if (runsRes.success && runsRes.data?.records) {
19574
+ const matched = runsRes.data.records.find((r) => r.id === run.id);
19575
+ if (matched) onRunUpdate(matched);
19576
+ }
19577
+ } catch {
19578
+ }
19579
+ }, [get, run.id, onRunUpdate]);
19556
19580
  useEffect37(() => {
19557
19581
  if (!open) return;
19558
19582
  setLoading(true);
19559
- get(
19560
- `/api/workflows/runs/${run.id}/steps`
19561
- ).then((res) => {
19562
- if (res.success) setSteps(res.data?.records || []);
19563
- }).catch(() => {
19564
- }).finally(() => setLoading(false));
19565
- }, [open, run.id, get]);
19583
+ fetchSteps().finally(() => setLoading(false));
19584
+ }, [open, run.id, fetchSteps]);
19585
+ useEffect37(() => {
19586
+ if (stepsPollTimeoutRef.current) {
19587
+ clearTimeout(stepsPollTimeoutRef.current);
19588
+ stepsPollTimeoutRef.current = null;
19589
+ }
19590
+ if (!open || run.status !== "running" || !autoRefresh) return;
19591
+ const sessionId = Date.now();
19592
+ stepsPollSessionRef.current = sessionId;
19593
+ const poll = async () => {
19594
+ if (stepsPollSessionRef.current !== sessionId) return;
19595
+ await fetchSteps();
19596
+ if (stepsPollSessionRef.current === sessionId) {
19597
+ stepsPollTimeoutRef.current = setTimeout(poll, POLLING_INTERVAL);
19598
+ }
19599
+ };
19600
+ poll();
19601
+ return () => {
19602
+ stepsPollSessionRef.current = 0;
19603
+ if (stepsPollTimeoutRef.current) {
19604
+ clearTimeout(stepsPollTimeoutRef.current);
19605
+ stepsPollTimeoutRef.current = null;
19606
+ }
19607
+ };
19608
+ }, [open, run.status, fetchSteps, autoRefresh]);
19566
19609
  return /* @__PURE__ */ jsxs50(
19567
19610
  Drawer2,
19568
19611
  {
@@ -19594,6 +19637,7 @@ var RunDetail = ({ run, agentName, open, onClose }) => {
19594
19637
  }
19595
19638
  );
19596
19639
  };
19640
+ var POLLING_INTERVAL = 3e3;
19597
19641
  var TopologyRuntimeView = () => {
19598
19642
  const { get } = useApi();
19599
19643
  const [runs, setRuns] = useState52([]);
@@ -19601,9 +19645,46 @@ var TopologyRuntimeView = () => {
19601
19645
  const [loading, setLoading] = useState52(true);
19602
19646
  const [error, setError] = useState52(null);
19603
19647
  const [selectedRun, setSelectedRun] = useState52(null);
19648
+ const [autoRefresh, setAutoRefresh] = useState52(true);
19649
+ const pollingSessionRef = useRef17(0);
19650
+ const handleRunUpdate = useCallback31((updated) => {
19651
+ setRuns(
19652
+ (prev) => prev.map((r) => r.id === updated.id ? updated : r)
19653
+ );
19654
+ setSelectedRun((prev) => prev?.id === updated.id ? updated : prev);
19655
+ }, []);
19656
+ const refreshRuns = useCallback31(async () => {
19657
+ setLoading(true);
19658
+ try {
19659
+ const defsRes = await get("/api/workflows/definitions");
19660
+ const nameMap = {};
19661
+ if (defsRes.success && defsRes.data?.records) {
19662
+ defsRes.data.records.forEach((d) => {
19663
+ nameMap[d.assistantId] = d.assistantName;
19664
+ });
19665
+ }
19666
+ setAgentNames(nameMap);
19667
+ const runsRes = await get("/api/workflows/runs");
19668
+ if (runsRes.success && runsRes.data?.records) {
19669
+ runsRes.data.records.sort(
19670
+ (a, b) => new Date(b.startedAt).getTime() - new Date(a.startedAt).getTime()
19671
+ );
19672
+ setRuns(runsRes.data.records);
19673
+ setSelectedRun((prev) => {
19674
+ if (!prev) return null;
19675
+ return runsRes.data.records.find((r) => r.id === prev.id) || prev;
19676
+ });
19677
+ }
19678
+ setError(null);
19679
+ } catch (err) {
19680
+ setError(err instanceof Error ? err.message : "Failed to load workflow runs");
19681
+ } finally {
19682
+ setLoading(false);
19683
+ }
19684
+ }, [get]);
19604
19685
  useEffect37(() => {
19605
19686
  let cancelled = false;
19606
- const fetchData = async () => {
19687
+ const init2 = async () => {
19607
19688
  try {
19608
19689
  setLoading(true);
19609
19690
  const defsRes = await get("/api/workflows/definitions");
@@ -19632,11 +19713,16 @@ var TopologyRuntimeView = () => {
19632
19713
  if (!cancelled) setLoading(false);
19633
19714
  }
19634
19715
  };
19635
- fetchData();
19716
+ init2();
19636
19717
  return () => {
19637
19718
  cancelled = true;
19638
19719
  };
19639
19720
  }, [get]);
19721
+ useEffect37(() => {
19722
+ return () => {
19723
+ pollingSessionRef.current = 0;
19724
+ };
19725
+ }, []);
19640
19726
  if (loading) {
19641
19727
  return /* @__PURE__ */ jsx76("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%" }, children: /* @__PURE__ */ jsx76(Spin10, { size: "large" }) });
19642
19728
  }
@@ -19647,7 +19733,27 @@ var TopologyRuntimeView = () => {
19647
19733
  return /* @__PURE__ */ jsx76(Empty6, { description: "No workflow runs yet. Execute a processing agent to see results here." });
19648
19734
  }
19649
19735
  return /* @__PURE__ */ jsxs50("div", { style: { padding: 16, overflow: "auto", height: "100%" }, children: [
19650
- /* @__PURE__ */ jsx76(Title5, { level: 5, style: { marginBottom: 16 }, children: "Workflow Runs" }),
19736
+ /* @__PURE__ */ jsxs50("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 16 }, children: [
19737
+ /* @__PURE__ */ jsx76(Title5, { level: 5, style: { marginBottom: 0 }, children: "Workflow Runs" }),
19738
+ /* @__PURE__ */ jsxs50(Space23, { size: 8, children: [
19739
+ /* @__PURE__ */ jsx76(Text27, { type: "secondary", style: { fontSize: 11 }, children: "Auto-refresh" }),
19740
+ /* @__PURE__ */ jsx76(
19741
+ Switch3,
19742
+ {
19743
+ size: "small",
19744
+ checked: autoRefresh,
19745
+ onChange: setAutoRefresh
19746
+ }
19747
+ ),
19748
+ /* @__PURE__ */ jsx76(Tooltip13, { title: "Refresh now", children: /* @__PURE__ */ jsx76(
19749
+ ReloadOutlined2,
19750
+ {
19751
+ style: { cursor: "pointer", color: "#999" },
19752
+ onClick: () => refreshRuns()
19753
+ }
19754
+ ) })
19755
+ ] })
19756
+ ] }),
19651
19757
  /* @__PURE__ */ jsx76(
19652
19758
  List7,
19653
19759
  {
@@ -19703,7 +19809,9 @@ var TopologyRuntimeView = () => {
19703
19809
  run: selectedRun,
19704
19810
  agentName: agentNames[selectedRun.assistantId] || selectedRun.assistantId,
19705
19811
  open: !!selectedRun,
19706
- onClose: () => setSelectedRun(null)
19812
+ onClose: () => setSelectedRun(null),
19813
+ onRunUpdate: handleRunUpdate,
19814
+ autoRefresh
19707
19815
  }
19708
19816
  )
19709
19817
  ] });
@@ -19712,7 +19820,7 @@ var TopologyRuntimeView = () => {
19712
19820
  // src/components/Chat/TopologyInboxView.tsx
19713
19821
  import { useEffect as useEffect38, useState as useState53 } from "react";
19714
19822
  import { Card as Card18, Typography as Typography31, Spin as Spin11, Empty as Empty7, List as List8, Button as Button37, Space as Space24, Tag as Tag17 } from "antd";
19715
- import { InboxOutlined, ReloadOutlined as ReloadOutlined2 } from "@ant-design/icons";
19823
+ import { InboxOutlined, ReloadOutlined as ReloadOutlined3 } from "@ant-design/icons";
19716
19824
  import { jsx as jsx77, jsxs as jsxs51 } from "react/jsx-runtime";
19717
19825
  var { Text: Text28, Title: Title6 } = Typography31;
19718
19826
  var TopologyInboxView = () => {
@@ -19769,7 +19877,7 @@ var TopologyInboxView = () => {
19769
19877
  /* @__PURE__ */ jsx77(
19770
19878
  Button37,
19771
19879
  {
19772
- icon: /* @__PURE__ */ jsx77(ReloadOutlined2, {}),
19880
+ icon: /* @__PURE__ */ jsx77(ReloadOutlined3, {}),
19773
19881
  onClick: fetchInbox,
19774
19882
  loading,
19775
19883
  size: "small",
@@ -21000,8 +21108,8 @@ var WorkspaceResourceManager = ({
21000
21108
  logo
21001
21109
  }) => {
21002
21110
  const { openContentApp, menuCollapsed, setMenuCollapsed } = useChatUIContext();
21003
- const hasOpenedDefault = useRef17(false);
21004
- const hasRegistered = useRef17(false);
21111
+ const hasOpenedDefault = useRef18(false);
21112
+ const hasRegistered = useRef18(false);
21005
21113
  useEffect40(() => {
21006
21114
  if (!hasRegistered.current) {
21007
21115
  hasRegistered.current = true;
@@ -21157,7 +21265,7 @@ var WorkspaceResourceManager = ({
21157
21265
  logo,
21158
21266
  logoText: workspaceName || "Workspace",
21159
21267
  showToggle: true,
21160
- defaultExpanded: true,
21268
+ defaultExpanded: config.workspaceMenuDefaultExpanded ?? true,
21161
21269
  collapsed: menuCollapsed,
21162
21270
  onCollapsedChange: setMenuCollapsed,
21163
21271
  footer: ({ isIconMode }) => user && /* @__PURE__ */ jsx82(
@@ -21616,7 +21724,7 @@ var WorkspaceContextProvider = ({
21616
21724
  };
21617
21725
 
21618
21726
  // src/components/Chat/DatabasePicker.tsx
21619
- import { useRef as useRef18, useState as useState59 } from "react";
21727
+ import { useRef as useRef19, useState as useState59 } from "react";
21620
21728
  import { Modal as Modal14, List as List9, Checkbox as Checkbox5, Spin as Spin13, Empty as Empty11, Typography as Typography36, Button as Button42, Space as Space25, Tooltip as Tooltip14 } from "antd";
21621
21729
  import { Database as Database5 } from "lucide-react";
21622
21730
  import { Fragment as Fragment14, jsx as jsx84, jsxs as jsxs57 } from "react/jsx-runtime";
@@ -21626,7 +21734,7 @@ var DatabasePicker = ({ senderRef, iconOnly }) => {
21626
21734
  const [loading, setLoading] = useState59(false);
21627
21735
  const [selectedDatabases, setSelectedDatabases] = useState59([]);
21628
21736
  const { get } = useApi();
21629
- const fetchedRef = useRef18(false);
21737
+ const fetchedRef = useRef19(false);
21630
21738
  const loadDatabases = async () => {
21631
21739
  setLoading(true);
21632
21740
  try {
@@ -21766,7 +21874,7 @@ var DatabasePicker = ({ senderRef, iconOnly }) => {
21766
21874
  };
21767
21875
 
21768
21876
  // src/components/Chat/SkillPicker.tsx
21769
- import { useRef as useRef19, useState as useState60 } from "react";
21877
+ import { useRef as useRef20, useState as useState60 } from "react";
21770
21878
  import { Modal as Modal15, List as List10, Checkbox as Checkbox6, Spin as Spin14, Empty as Empty12, Typography as Typography37, Button as Button43, Space as Space26, Tooltip as Tooltip15 } from "antd";
21771
21879
  import { BrainCircuit } from "lucide-react";
21772
21880
  import { Fragment as Fragment15, jsx as jsx85, jsxs as jsxs58 } from "react/jsx-runtime";
@@ -21776,7 +21884,7 @@ var SkillPicker = ({ senderRef, iconOnly }) => {
21776
21884
  const [loading, setLoading] = useState60(false);
21777
21885
  const [selectedSkills, setSelectedSkills] = useState60([]);
21778
21886
  const { get } = useApi();
21779
- const fetchedRef = useRef19(false);
21887
+ const fetchedRef = useRef20(false);
21780
21888
  const loadSkills = async () => {
21781
21889
  setLoading(true);
21782
21890
  try {
@@ -21916,7 +22024,7 @@ var SkillPicker = ({ senderRef, iconOnly }) => {
21916
22024
  };
21917
22025
 
21918
22026
  // src/components/Chat/AgentPicker.tsx
21919
- import { useRef as useRef20, useState as useState61 } from "react";
22027
+ import { useRef as useRef21, useState as useState61 } from "react";
21920
22028
  import { Modal as Modal16, List as List11, Empty as Empty13, Typography as Typography38, Button as Button44, Tooltip as Tooltip16 } from "antd";
21921
22029
  import { Bot as Bot3 } from "lucide-react";
21922
22030
  import { Fragment as Fragment16, jsx as jsx86, jsxs as jsxs59 } from "react/jsx-runtime";
@@ -21925,7 +22033,7 @@ var AgentPicker = ({ senderRef, iconOnly }) => {
21925
22033
  const [loading, setLoading] = useState61(false);
21926
22034
  const [selectedAgent, setSelectedAgent] = useState61(null);
21927
22035
  const { assistants, currentAssistant, selectAssistant } = useAssistantContext();
21928
- const fetchedRef = useRef20(false);
22036
+ const fetchedRef = useRef21(false);
21929
22037
  const handleOpenModal = () => {
21930
22038
  setSelectedAgent(currentAssistant?.id || null);
21931
22039
  setModalOpen(true);
@@ -22032,7 +22140,7 @@ var AgentPicker = ({ senderRef, iconOnly }) => {
22032
22140
  };
22033
22141
 
22034
22142
  // src/components/Chat/MetricsDataSourcePicker.tsx
22035
- import { useEffect as useEffect43, useState as useState62, useRef as useRef21 } from "react";
22143
+ import { useEffect as useEffect43, useState as useState62, useRef as useRef22 } from "react";
22036
22144
  import { Modal as Modal17, List as List12, Spin as Spin16, Empty as Empty14, Typography as Typography39, Button as Button45, Tag as Tag21, Tooltip as Tooltip17 } from "antd";
22037
22145
  import { Database as Database6, Check as Check4, Server as Server3 } from "lucide-react";
22038
22146
  import { Fragment as Fragment17, jsx as jsx87, jsxs as jsxs60 } from "react/jsx-runtime";
@@ -22047,7 +22155,7 @@ var MetricsDataSourcePicker = ({
22047
22155
  const { config } = useLatticeChatShellContext();
22048
22156
  const { customRunConfig, updateCustomRunConfig } = useConversationContext();
22049
22157
  const { get } = useApi();
22050
- const hasInitializedRef = useRef21(false);
22158
+ const hasInitializedRef = useRef22(false);
22051
22159
  const loadDataSources = async () => {
22052
22160
  setLoading(true);
22053
22161
  try {
@@ -22372,7 +22480,7 @@ var MetricsDataSourcePicker = ({
22372
22480
  };
22373
22481
 
22374
22482
  // src/components/Chat/ModelSelector.tsx
22375
- import { useState as useState63, useEffect as useEffect44, useCallback as useCallback33, useRef as useRef22 } from "react";
22483
+ import { useState as useState63, useEffect as useEffect44, useCallback as useCallback33, useRef as useRef23 } from "react";
22376
22484
  import { Select as Select7 } from "antd";
22377
22485
  import { jsx as jsx88 } from "react/jsx-runtime";
22378
22486
  var ModelSelector = ({
@@ -22386,8 +22494,8 @@ var ModelSelector = ({
22386
22494
  const [internalValue, setInternalValue] = useState63(null);
22387
22495
  const [dropdownOpen, setDropdownOpen] = useState63(false);
22388
22496
  const [isHovered, setIsHovered] = useState63(false);
22389
- const hasFetchedRef = useRef22(false);
22390
- const hasSetDefaultRef = useRef22(false);
22497
+ const hasFetchedRef = useRef23(false);
22498
+ const hasSetDefaultRef = useRef23(false);
22391
22499
  const { get } = useApi();
22392
22500
  const selectedModelConfig = value !== void 0 ? value : internalValue;
22393
22501
  const setSelectedModelConfig = useCallback33((config) => {
@@ -23138,7 +23246,7 @@ var Chating = ({
23138
23246
  const [attachedFiles, setAttachedFiles] = useState66([]);
23139
23247
  const { styles } = useStyle();
23140
23248
  const [headerOpen, setHeaderOpen] = useState66(false);
23141
- const attachmentsRef = useRef23(null);
23249
+ const attachmentsRef = useRef24(null);
23142
23250
  const senderRef = React51.useRef(null);
23143
23251
  const {
23144
23252
  assistantId,
@@ -23450,7 +23558,7 @@ var Chating = ({
23450
23558
  Button46,
23451
23559
  {
23452
23560
  type: "text",
23453
- icon: /* @__PURE__ */ jsx91(ReloadOutlined3, {}),
23561
+ icon: /* @__PURE__ */ jsx91(ReloadOutlined4, {}),
23454
23562
  onClick: () => {
23455
23563
  loadMessages();
23456
23564
  }
@@ -23882,7 +23990,7 @@ import {
23882
23990
  PauseCircleOutlined,
23883
23991
  PlayCircleOutlined as PlayCircleOutlined2,
23884
23992
  StopOutlined,
23885
- ReloadOutlined as ReloadOutlined4,
23993
+ ReloadOutlined as ReloadOutlined5,
23886
23994
  CheckCircleOutlined as CheckCircleOutlined7,
23887
23995
  CloseCircleOutlined as CloseCircleOutlined3,
23888
23996
  ExclamationCircleOutlined,
@@ -24217,7 +24325,7 @@ var ScheduleViewer = ({ data }) => {
24217
24325
  Button48,
24218
24326
  {
24219
24327
  type: "text",
24220
- icon: /* @__PURE__ */ jsx94(ReloadOutlined4, { spin: loading }),
24328
+ icon: /* @__PURE__ */ jsx94(ReloadOutlined5, { spin: loading }),
24221
24329
  onClick: handleRefresh,
24222
24330
  loading
24223
24331
  }
@@ -27857,7 +27965,7 @@ var TaskBoard = ({
27857
27965
  };
27858
27966
 
27859
27967
  // src/components/GenUI/elements/Mailbox.tsx
27860
- import { useState as useState73, useMemo as useMemo28, useRef as useRef24, useEffect as useEffect48 } from "react";
27968
+ import { useState as useState73, useMemo as useMemo28, useRef as useRef25, useEffect as useEffect48 } from "react";
27861
27969
  import { jsx as jsx109, jsxs as jsxs80 } from "react/jsx-runtime";
27862
27970
  var useStyle16 = () => {
27863
27971
  return {
@@ -28144,7 +28252,7 @@ var TeamChat = ({ data }) => {
28144
28252
  const styles = useStyle16();
28145
28253
  const { teamName, currentUser, teammates, messages, onSendMessage } = data || {};
28146
28254
  const [inputValue, setInputValue] = useState73("");
28147
- const messagesEndRef = useRef24(null);
28255
+ const messagesEndRef = useRef25(null);
28148
28256
  const sortedMessages = useMemo28(() => {
28149
28257
  return [...messages || []].sort(
28150
28258
  (a, b) => new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime()
@@ -28327,7 +28435,7 @@ import { Button as Button53, Typography as Typography56 } from "antd";
28327
28435
  import { ExpandOutlined as ExpandOutlined2 } from "@ant-design/icons";
28328
28436
 
28329
28437
  // src/streaming-html/StreamingHTMLRenderer.tsx
28330
- import React61, { useEffect as useEffect49, useRef as useRef25, useCallback as useCallback36, useState as useState74 } from "react";
28438
+ import React61, { useEffect as useEffect49, useRef as useRef26, useCallback as useCallback36, useState as useState74 } from "react";
28331
28439
 
28332
28440
  // src/streaming-html/show-widget-css-generator.ts
28333
28441
  function generateShowWidgetCSS(tokens) {
@@ -29018,14 +29126,14 @@ var StreamingHTMLRenderer = ({
29018
29126
  title,
29019
29127
  loadingMessages
29020
29128
  }) => {
29021
- const iframeRef = useRef25(null);
29022
- const containerRef = useRef25(null);
29023
- const resizeObserverRef = useRef25(null);
29024
- const prevHTMLRef = useRef25("");
29025
- const isReadyRef = useRef25(false);
29026
- const pendingChunksRef = useRef25([]);
29027
- const isCompleteRef = useRef25(isComplete);
29028
- const isScriptExecuted = useRef25(false);
29129
+ const iframeRef = useRef26(null);
29130
+ const containerRef = useRef26(null);
29131
+ const resizeObserverRef = useRef26(null);
29132
+ const prevHTMLRef = useRef26("");
29133
+ const isReadyRef = useRef26(false);
29134
+ const pendingChunksRef = useRef26([]);
29135
+ const isCompleteRef = useRef26(isComplete);
29136
+ const isScriptExecuted = useRef26(false);
29029
29137
  const [iframeHeight, setIframeHeight] = React61.useState(0);
29030
29138
  const [iframeWidth, setIframeWidth] = React61.useState(void 0);
29031
29139
  const [currentMessageIndex, setCurrentMessageIndex] = useState74(0);
@@ -29851,7 +29959,7 @@ var SideAppViewBrowser = ({ region = "side" }) => {
29851
29959
  };
29852
29960
 
29853
29961
  // src/components/Chat/ProjectSelector.tsx
29854
- import { useState as useState76, useCallback as useCallback39, useMemo as useMemo29, useRef as useRef26 } from "react";
29962
+ import { useState as useState76, useCallback as useCallback39, useMemo as useMemo29, useRef as useRef27 } from "react";
29855
29963
  import { Modal as Modal20, Input as Input15, Button as Button54, message as message18 } from "antd";
29856
29964
  import { createStyles as createStyles35 } from "antd-style";
29857
29965
  import { Folder, ChevronDown as ChevronDown6, Building2 as Building24 } from "lucide-react";
@@ -30088,13 +30196,13 @@ var ProjectSelector = ({
30088
30196
  createProject
30089
30197
  } = useWorkspaceContext();
30090
30198
  const [isWorkspaceListOpen, setIsWorkspaceListOpen] = useState76(false);
30091
- const workspaceDropdownRef = useRef26(null);
30199
+ const workspaceDropdownRef = useRef27(null);
30092
30200
  const [isProjectListOpen, setIsProjectListOpen] = useState76(false);
30093
30201
  const [isModalOpen, setIsModalOpen] = useState76(false);
30094
30202
  const [projectName, setProjectName] = useState76("");
30095
30203
  const [validationError, setValidationError] = useState76(null);
30096
30204
  const [isCreating, setIsCreating] = useState76(false);
30097
- const projectNameInputRef = useRef26(null);
30205
+ const projectNameInputRef = useRef27(null);
30098
30206
  const currentProject = useMemo29(() => {
30099
30207
  return projects.find((p) => p.id === projectId);
30100
30208
  }, [projects, projectId]);
@@ -31446,7 +31554,7 @@ var LatticeChatView = (props) => {
31446
31554
  };
31447
31555
 
31448
31556
  // src/components/Chat/SettingsModal.tsx
31449
- import { useState as useState79, useEffect as useEffect52, useRef as useRef27 } from "react";
31557
+ import { useState as useState79, useEffect as useEffect52, useRef as useRef28 } from "react";
31450
31558
  import {
31451
31559
  Modal as Modal22,
31452
31560
  Input as Input16,
@@ -31456,14 +31564,14 @@ import {
31456
31564
  Typography as Typography57,
31457
31565
  Alert as Alert9,
31458
31566
  Select as Select8,
31459
- Switch as Switch3,
31567
+ Switch as Switch4,
31460
31568
  Space as Space39,
31461
31569
  Tabs as Tabs3
31462
31570
  } from "antd";
31463
31571
  import {
31464
31572
  SaveOutlined as SaveOutlined2,
31465
31573
  EnvironmentOutlined,
31466
- ReloadOutlined as ReloadOutlined5,
31574
+ ReloadOutlined as ReloadOutlined6,
31467
31575
  CheckCircleOutlined as CheckCircleOutlined9,
31468
31576
  ApiOutlined,
31469
31577
  LinkOutlined as LinkOutlined2,
@@ -31859,7 +31967,7 @@ var SettingsModal = ({
31859
31967
  return [];
31860
31968
  });
31861
31969
  const [serverConfigs, setServerConfigs] = useState79({});
31862
- const connectionsRef = useRef27(connections);
31970
+ const connectionsRef = useRef28(connections);
31863
31971
  useEffect52(() => {
31864
31972
  connectionsRef.current = connections;
31865
31973
  }, [connections]);
@@ -32299,7 +32407,7 @@ var SettingsModal = ({
32299
32407
  " QUEUE_SERVICE_TYPE, REDIS_URL, REDIS_PASSWORD, QUEUE_NAME"
32300
32408
  ] }),
32301
32409
  /* @__PURE__ */ jsxs89("div", { children: [
32302
- /* @__PURE__ */ jsx123(ReloadOutlined5, { style: { color: "#faad14", marginRight: 8 } }),
32410
+ /* @__PURE__ */ jsx123(ReloadOutlined6, { style: { color: "#faad14", marginRight: 8 } }),
32303
32411
  /* @__PURE__ */ jsx123("strong", { children: "Requires restart:" }),
32304
32412
  " PORT (server must be restarted to change port)"
32305
32413
  ] })
@@ -32509,7 +32617,7 @@ QUEUE_NAME=tasks`,
32509
32617
  ] }),
32510
32618
  /* @__PURE__ */ jsx123("div", { children: /* @__PURE__ */ jsxs89(Space39, { children: [
32511
32619
  /* @__PURE__ */ jsx123(
32512
- Switch3,
32620
+ Switch4,
32513
32621
  {
32514
32622
  checked: model.streaming,
32515
32623
  onChange: (checked) => handleModelChange(index, "streaming", checked)
@@ -32859,7 +32967,6 @@ import {
32859
32967
  Input as Input17,
32860
32968
  Modal as Modal23,
32861
32969
  Popconfirm as Popconfirm10,
32862
- Select as Select9,
32863
32970
  Spin as Spin21,
32864
32971
  Tag as Tag29,
32865
32972
  Typography as Typography58,
@@ -32868,11 +32975,6 @@ import {
32868
32975
  import { Edit2 as Edit24, Plus as Plus9, RadioTower, Trash2 as Trash29 } from "lucide-react";
32869
32976
  import { jsx as jsx126, jsxs as jsxs91 } from "react/jsx-runtime";
32870
32977
  var { Text: Text47, Title: Title17 } = Typography58;
32871
- var MAPPING_MODE_OPTIONS = [
32872
- { label: "User", value: "user" },
32873
- { label: "Group", value: "group" },
32874
- { label: "Hybrid", value: "hybrid" }
32875
- ];
32876
32978
  var ChannelInstallationsDrawerContent = () => {
32877
32979
  const { get, post, put, del } = useApi();
32878
32980
  const [installations, setInstallations] = useState80([]);
@@ -32994,22 +33096,6 @@ var ChannelInstallationsDrawerContent = () => {
32994
33096
  "ID: ",
32995
33097
  installation.id
32996
33098
  ] }),
32997
- /* @__PURE__ */ jsxs91(Text47, { style: { fontSize: 13 }, children: [
32998
- "Assistant ID: ",
32999
- installation.config.assistantId
33000
- ] }),
33001
- /* @__PURE__ */ jsxs91(Text47, { style: { fontSize: 13 }, children: [
33002
- "Mapping Mode: ",
33003
- installation.config.mappingMode
33004
- ] }),
33005
- installation.config.workspaceId ? /* @__PURE__ */ jsxs91(Text47, { style: { fontSize: 13 }, children: [
33006
- "Workspace ID: ",
33007
- installation.config.workspaceId
33008
- ] }) : null,
33009
- installation.config.projectId ? /* @__PURE__ */ jsxs91(Text47, { style: { fontSize: 13 }, children: [
33010
- "Project ID: ",
33011
- installation.config.projectId
33012
- ] }) : null,
33013
33099
  webhookPath ? /* @__PURE__ */ jsx126(Text47, { code: true, style: { fontSize: 12 }, children: webhookPath }) : /* @__PURE__ */ jsx126(Text47, { type: "secondary", style: { fontSize: 12 }, children: "Unsupported channel configuration UI" })
33014
33100
  ]
33015
33101
  }
@@ -33065,23 +33151,17 @@ var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCance
33065
33151
  const [form] = Form9.useForm();
33066
33152
  useEffect53(() => {
33067
33153
  if (installation) {
33154
+ const config = installation.config;
33068
33155
  form.setFieldsValue({
33069
33156
  name: installation.name,
33070
- appId: installation.config.appId,
33071
- appSecret: installation.config.appSecret,
33072
- verificationToken: installation.config.verificationToken,
33073
- encryptKey: installation.config.encryptKey,
33074
- mappingMode: installation.config.mappingMode,
33075
- assistantId: installation.config.assistantId,
33076
- workspaceId: installation.config.workspaceId,
33077
- projectId: installation.config.projectId
33157
+ appId: config.appId,
33158
+ appSecret: config.appSecret,
33159
+ verificationToken: config.verificationToken,
33160
+ encryptKey: config.encryptKey
33078
33161
  });
33079
33162
  return;
33080
33163
  }
33081
33164
  form.resetFields();
33082
- form.setFieldsValue({
33083
- mappingMode: "hybrid"
33084
- });
33085
33165
  }, [installation, form]);
33086
33166
  const handleSubmit = async () => {
33087
33167
  const values = await form.validateFields();
@@ -33089,11 +33169,7 @@ var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCance
33089
33169
  appId: values.appId,
33090
33170
  appSecret: values.appSecret,
33091
33171
  verificationToken: values.verificationToken,
33092
- encryptKey: values.encryptKey,
33093
- mappingMode: values.mappingMode,
33094
- assistantId: values.assistantId,
33095
- workspaceId: values.workspaceId,
33096
- projectId: values.projectId
33172
+ encryptKey: values.encryptKey
33097
33173
  };
33098
33174
  try {
33099
33175
  if (installation) {
@@ -33166,27 +33242,7 @@ var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCance
33166
33242
  }
33167
33243
  ),
33168
33244
  /* @__PURE__ */ jsx126(Form9.Item, { name: "verificationToken", label: "Verification Token", children: /* @__PURE__ */ jsx126(Input17, {}) }),
33169
- /* @__PURE__ */ jsx126(Form9.Item, { name: "encryptKey", label: "Encrypt Key", children: /* @__PURE__ */ jsx126(Input17, {}) }),
33170
- /* @__PURE__ */ jsx126(
33171
- Form9.Item,
33172
- {
33173
- name: "mappingMode",
33174
- label: "Mapping Mode",
33175
- rules: [{ required: true, message: "Mapping Mode is required" }],
33176
- children: /* @__PURE__ */ jsx126(Select9, { options: MAPPING_MODE_OPTIONS })
33177
- }
33178
- ),
33179
- /* @__PURE__ */ jsx126(
33180
- Form9.Item,
33181
- {
33182
- name: "assistantId",
33183
- label: "Assistant ID",
33184
- rules: [{ required: true, message: "Assistant ID is required" }],
33185
- children: /* @__PURE__ */ jsx126(Input17, {})
33186
- }
33187
- ),
33188
- /* @__PURE__ */ jsx126(Form9.Item, { name: "workspaceId", label: "Workspace ID", children: /* @__PURE__ */ jsx126(Input17, {}) }),
33189
- /* @__PURE__ */ jsx126(Form9.Item, { name: "projectId", label: "Project ID", children: /* @__PURE__ */ jsx126(Input17, {}) })
33245
+ /* @__PURE__ */ jsx126(Form9.Item, { name: "encryptKey", label: "Encrypt Key", children: /* @__PURE__ */ jsx126(Input17, {}) })
33190
33246
  ] })
33191
33247
  }
33192
33248
  );