@axiom-lattice/react-sdk 2.1.61 → 2.1.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +69 -115
- package/dist/index.d.ts +69 -115
- package/dist/index.js +1300 -943
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1299 -934
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -40,6 +40,7 @@ __export(index_exports, {
|
|
|
40
40
|
AuthProvider: () => AuthProvider,
|
|
41
41
|
AxiomLatticeProvider: () => AxiomLatticeProvider,
|
|
42
42
|
ChangePasswordModal: () => ChangePasswordModal,
|
|
43
|
+
ChannelInstallationsDrawerContent: () => ChannelInstallationsDrawerContent,
|
|
43
44
|
ChatUIContext: () => ChatUIContext,
|
|
44
45
|
ChatUIContextProvider: () => ChatUIContextProvider,
|
|
45
46
|
Chating: () => Chating,
|
|
@@ -47,6 +48,7 @@ __export(index_exports, {
|
|
|
47
48
|
ConversationContext: () => ConversationContext,
|
|
48
49
|
ConversationContextProvider: () => ConversationContextProvider,
|
|
49
50
|
CreateAssistantModal: () => CreateAssistantModal_default,
|
|
51
|
+
DEFAULT_MIDDLEWARE_TYPES: () => DEFAULT_MIDDLEWARE_TYPES,
|
|
50
52
|
FileExplorer: () => FileExplorer,
|
|
51
53
|
LatticeChat: () => LatticeChat,
|
|
52
54
|
LatticeChatShell: () => LatticeChatShell,
|
|
@@ -185,8 +187,8 @@ var AuthProvider = ({
|
|
|
185
187
|
onLoginSuccess?.(userData, tenantList || []);
|
|
186
188
|
return { requiresTenantSelection, hasTenants };
|
|
187
189
|
} catch (err) {
|
|
188
|
-
const
|
|
189
|
-
setError(
|
|
190
|
+
const message21 = err instanceof Error ? err.message : "Login failed";
|
|
191
|
+
setError(message21);
|
|
190
192
|
throw err;
|
|
191
193
|
} finally {
|
|
192
194
|
setIsLoading(false);
|
|
@@ -210,8 +212,8 @@ var AuthProvider = ({
|
|
|
210
212
|
}
|
|
211
213
|
return { message: data.message || "Registration successful!", token: data.data?.token };
|
|
212
214
|
} catch (err) {
|
|
213
|
-
const
|
|
214
|
-
setError(
|
|
215
|
+
const message21 = err instanceof Error ? err.message : "Registration failed";
|
|
216
|
+
setError(message21);
|
|
215
217
|
throw err;
|
|
216
218
|
} finally {
|
|
217
219
|
setIsLoading(false);
|
|
@@ -258,8 +260,8 @@ var AuthProvider = ({
|
|
|
258
260
|
}
|
|
259
261
|
onTenantSelected?.(tenantData);
|
|
260
262
|
} catch (err) {
|
|
261
|
-
const
|
|
262
|
-
setError(
|
|
263
|
+
const message21 = err instanceof Error ? err.message : "Failed to select tenant";
|
|
264
|
+
setError(message21);
|
|
263
265
|
throw err;
|
|
264
266
|
} finally {
|
|
265
267
|
setIsLoading(false);
|
|
@@ -298,8 +300,8 @@ var AuthProvider = ({
|
|
|
298
300
|
setTenants(tenantList);
|
|
299
301
|
sessionStorage.setItem("lattice_tenants", JSON.stringify(tenantList));
|
|
300
302
|
} catch (err) {
|
|
301
|
-
const
|
|
302
|
-
setError(
|
|
303
|
+
const message21 = err instanceof Error ? err.message : "Failed to fetch tenants";
|
|
304
|
+
setError(message21);
|
|
303
305
|
} finally {
|
|
304
306
|
setIsLoading(false);
|
|
305
307
|
}
|
|
@@ -329,8 +331,8 @@ var AuthProvider = ({
|
|
|
329
331
|
setUser(data);
|
|
330
332
|
sessionStorage.setItem("lattice_user", JSON.stringify(data));
|
|
331
333
|
} catch (err) {
|
|
332
|
-
const
|
|
333
|
-
setError(
|
|
334
|
+
const message21 = err instanceof Error ? err.message : "Failed to refresh user";
|
|
335
|
+
setError(message21);
|
|
334
336
|
} finally {
|
|
335
337
|
setIsLoading(false);
|
|
336
338
|
}
|
|
@@ -366,8 +368,8 @@ var AuthProvider = ({
|
|
|
366
368
|
const result = await response.json();
|
|
367
369
|
return result;
|
|
368
370
|
} catch (err) {
|
|
369
|
-
const
|
|
370
|
-
setError(
|
|
371
|
+
const message21 = err instanceof Error ? err.message : "Failed to change password";
|
|
372
|
+
setError(message21);
|
|
371
373
|
throw err;
|
|
372
374
|
} finally {
|
|
373
375
|
setIsLoading(false);
|
|
@@ -565,7 +567,7 @@ function useChat(threadId, assistantId, options = {}) {
|
|
|
565
567
|
throw new Error("Thread ID is required to send messages");
|
|
566
568
|
}
|
|
567
569
|
const { input, command, streaming = true } = data;
|
|
568
|
-
const { message:
|
|
570
|
+
const { message: message21, files, ...rest } = input || {};
|
|
569
571
|
setState((prev) => ({
|
|
570
572
|
...prev,
|
|
571
573
|
isLoading: true,
|
|
@@ -574,7 +576,7 @@ function useChat(threadId, assistantId, options = {}) {
|
|
|
574
576
|
}));
|
|
575
577
|
const userMessage = {
|
|
576
578
|
id: Date.now().toString(),
|
|
577
|
-
content:
|
|
579
|
+
content: message21 || command?.resume?.message || "",
|
|
578
580
|
files,
|
|
579
581
|
role: "human"
|
|
580
582
|
};
|
|
@@ -1346,6 +1348,36 @@ var DEFAULT_MIDDLEWARE_TYPES = [
|
|
|
1346
1348
|
timezone: "UTC"
|
|
1347
1349
|
},
|
|
1348
1350
|
tools: []
|
|
1351
|
+
},
|
|
1352
|
+
{
|
|
1353
|
+
type: "scheduler",
|
|
1354
|
+
name: "Scheduler",
|
|
1355
|
+
description: "Enables the agent to schedule future work that re-enters through addMessage",
|
|
1356
|
+
schema: {
|
|
1357
|
+
type: "object",
|
|
1358
|
+
title: "Scheduler Configuration",
|
|
1359
|
+
description: "Configure retry behavior for scheduled tasks",
|
|
1360
|
+
properties: {
|
|
1361
|
+
defaultMaxRetries: {
|
|
1362
|
+
type: "integer",
|
|
1363
|
+
title: "Default Max Retries",
|
|
1364
|
+
description: "Default retry count for scheduled tasks created through the middleware",
|
|
1365
|
+
default: 0,
|
|
1366
|
+
minimum: 0,
|
|
1367
|
+
widget: "numberInput"
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
},
|
|
1371
|
+
defaultConfig: {
|
|
1372
|
+
defaultMaxRetries: 0
|
|
1373
|
+
},
|
|
1374
|
+
tools: [
|
|
1375
|
+
{ id: "schedule_at", name: "Schedule At", description: "Schedule a task for an absolute time" },
|
|
1376
|
+
{ id: "schedule_after", name: "Schedule After", description: "Schedule a task after a relative delay" },
|
|
1377
|
+
{ id: "schedule_recurring", name: "Schedule Recurring", description: "Schedule a recurring task with a cron expression" },
|
|
1378
|
+
{ id: "cancel_scheduled_task", name: "Cancel Scheduled Task", description: "Cancel an existing scheduled task" },
|
|
1379
|
+
{ id: "list_scheduled_tasks", name: "List Scheduled Tasks", description: "List scheduled tasks in the current agent context" }
|
|
1380
|
+
]
|
|
1349
1381
|
}
|
|
1350
1382
|
];
|
|
1351
1383
|
var DEFAULT_CONFIG = {
|
|
@@ -1509,8 +1541,8 @@ function convertThreadToConversationThread(thread, label) {
|
|
|
1509
1541
|
function getThreadMetadata(label) {
|
|
1510
1542
|
return label ? { label } : {};
|
|
1511
1543
|
}
|
|
1512
|
-
function generateLabelFromMessage(
|
|
1513
|
-
const cleanMessage =
|
|
1544
|
+
function generateLabelFromMessage(message21) {
|
|
1545
|
+
const cleanMessage = message21.replace(/```attachments[\s\S]*?```/g, "").trim();
|
|
1514
1546
|
if (!cleanMessage) {
|
|
1515
1547
|
return "";
|
|
1516
1548
|
}
|
|
@@ -1702,8 +1734,13 @@ var ConversationContextProvider = ({
|
|
|
1702
1734
|
setIsLoading(true);
|
|
1703
1735
|
setError(null);
|
|
1704
1736
|
try {
|
|
1737
|
+
const existingThread = await client.threads.get(newThread.id);
|
|
1738
|
+
const existingMetadata = existingThread.metadata || {};
|
|
1705
1739
|
await client.threads.update(newThread.id, {
|
|
1706
|
-
metadata:
|
|
1740
|
+
metadata: {
|
|
1741
|
+
...existingMetadata,
|
|
1742
|
+
label: newThread.label
|
|
1743
|
+
}
|
|
1707
1744
|
});
|
|
1708
1745
|
await loadThreads();
|
|
1709
1746
|
} catch (err) {
|
|
@@ -1953,7 +1990,7 @@ function AgentThreadProvider({
|
|
|
1953
1990
|
throw new Error("Thread ID is required to send messages");
|
|
1954
1991
|
}
|
|
1955
1992
|
const { input, command, streaming = true, mode } = data;
|
|
1956
|
-
const { message:
|
|
1993
|
+
const { message: message21, files, ...rest } = input || {};
|
|
1957
1994
|
setState((prev) => ({
|
|
1958
1995
|
...prev,
|
|
1959
1996
|
isLoading: true,
|
|
@@ -1962,7 +1999,7 @@ function AgentThreadProvider({
|
|
|
1962
1999
|
}));
|
|
1963
2000
|
const userMessage = {
|
|
1964
2001
|
id: (0, import_uuid.v4)(),
|
|
1965
|
-
content:
|
|
2002
|
+
content: message21 || command?.resume?.message || "",
|
|
1966
2003
|
files,
|
|
1967
2004
|
role: "human"
|
|
1968
2005
|
};
|
|
@@ -1980,8 +2017,8 @@ function AgentThreadProvider({
|
|
|
1980
2017
|
]
|
|
1981
2018
|
}));
|
|
1982
2019
|
const isFirstMessage = messageCountRef.current === 0;
|
|
1983
|
-
if (isFirstMessage &&
|
|
1984
|
-
const label = generateLabelFromMessage(
|
|
2020
|
+
if (isFirstMessage && message21 && conversationContext) {
|
|
2021
|
+
const label = generateLabelFromMessage(message21);
|
|
1985
2022
|
if (label) {
|
|
1986
2023
|
conversationContext.updateThread({
|
|
1987
2024
|
id: threadId,
|
|
@@ -3656,8 +3693,8 @@ function useTenants(options) {
|
|
|
3656
3693
|
const { data } = await response.json();
|
|
3657
3694
|
setTenants(data || []);
|
|
3658
3695
|
} catch (err) {
|
|
3659
|
-
const
|
|
3660
|
-
setError(
|
|
3696
|
+
const message21 = err instanceof Error ? err.message : "Failed to fetch tenants";
|
|
3697
|
+
setError(message21);
|
|
3661
3698
|
} finally {
|
|
3662
3699
|
setIsLoading(false);
|
|
3663
3700
|
}
|
|
@@ -3699,8 +3736,8 @@ function useUsers(options) {
|
|
|
3699
3736
|
const { data } = await response.json();
|
|
3700
3737
|
setUsers(data || []);
|
|
3701
3738
|
} catch (err) {
|
|
3702
|
-
const
|
|
3703
|
-
setError(
|
|
3739
|
+
const message21 = err instanceof Error ? err.message : "Failed to fetch users";
|
|
3740
|
+
setError(message21);
|
|
3704
3741
|
} finally {
|
|
3705
3742
|
setIsLoading(false);
|
|
3706
3743
|
}
|
|
@@ -3742,6 +3779,9 @@ function useUsers(options) {
|
|
|
3742
3779
|
// src/index.ts
|
|
3743
3780
|
__reExport(index_exports, require("@axiom-lattice/protocols"), module.exports);
|
|
3744
3781
|
|
|
3782
|
+
// src/components/Chat/LatticeChat.tsx
|
|
3783
|
+
var import_lucide_react27 = require("lucide-react");
|
|
3784
|
+
|
|
3745
3785
|
// src/components/Chat/ChatUIContext.tsx
|
|
3746
3786
|
var import_react15 = require("react");
|
|
3747
3787
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
@@ -3749,6 +3789,21 @@ var emptyHandler = () => {
|
|
|
3749
3789
|
throw new Error("ChatUIContextProvider not found");
|
|
3750
3790
|
};
|
|
3751
3791
|
var ChatUIContext = (0, import_react15.createContext)({
|
|
3792
|
+
detailVisible: false,
|
|
3793
|
+
setDetailVisible: emptyHandler,
|
|
3794
|
+
detailSize: "large",
|
|
3795
|
+
setDetailSize: emptyHandler,
|
|
3796
|
+
detailSelectedCard: null,
|
|
3797
|
+
setDetailSelectedCard: emptyHandler,
|
|
3798
|
+
openDetail: emptyHandler,
|
|
3799
|
+
closeDetail: emptyHandler,
|
|
3800
|
+
toolsVisible: false,
|
|
3801
|
+
setToolsVisible: emptyHandler,
|
|
3802
|
+
toggleTools: emptyHandler,
|
|
3803
|
+
toolSelectedCard: null,
|
|
3804
|
+
setToolSelectedCard: emptyHandler,
|
|
3805
|
+
openTools: emptyHandler,
|
|
3806
|
+
closeTools: emptyHandler,
|
|
3752
3807
|
sideAppVisible: false,
|
|
3753
3808
|
setSideAppVisible: emptyHandler,
|
|
3754
3809
|
sideAppSize: "large",
|
|
@@ -3769,44 +3824,72 @@ var ChatUIContext = (0, import_react15.createContext)({
|
|
|
3769
3824
|
var ChatUIContextProvider = ({
|
|
3770
3825
|
children
|
|
3771
3826
|
}) => {
|
|
3772
|
-
const [
|
|
3827
|
+
const [detailVisible, setDetailVisible] = (0, import_react15.useState)(false);
|
|
3773
3828
|
const [contentAppVisible, setcontentAppVisible] = (0, import_react15.useState)(false);
|
|
3774
|
-
const [
|
|
3775
|
-
const [
|
|
3829
|
+
const [detailSize, setDetailSize] = (0, import_react15.useState)("large");
|
|
3830
|
+
const [detailSelectedCard, setDetailSelectedCard] = (0, import_react15.useState)(null);
|
|
3831
|
+
const [toolsVisible, setToolsVisible] = (0, import_react15.useState)(false);
|
|
3832
|
+
const [toolSelectedCard, setToolSelectedCard] = (0, import_react15.useState)(null);
|
|
3776
3833
|
const [contentAppSelectedCard, setContentAppSelectedCard] = (0, import_react15.useState)(null);
|
|
3777
3834
|
const [menuCollapsed, setMenuCollapsed] = (0, import_react15.useState)(false);
|
|
3778
|
-
const
|
|
3779
|
-
(card)
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3835
|
+
const openDetail = (0, import_react15.useCallback)((card) => {
|
|
3836
|
+
setDetailSelectedCard(card);
|
|
3837
|
+
setDetailVisible(true);
|
|
3838
|
+
}, []);
|
|
3839
|
+
const closeDetail = (0, import_react15.useCallback)(() => {
|
|
3840
|
+
setDetailSelectedCard(null);
|
|
3841
|
+
setDetailVisible(false);
|
|
3842
|
+
}, []);
|
|
3843
|
+
const openTools = (0, import_react15.useCallback)((card) => {
|
|
3844
|
+
setToolSelectedCard(card);
|
|
3845
|
+
setToolsVisible(true);
|
|
3846
|
+
}, []);
|
|
3847
|
+
const closeTools = (0, import_react15.useCallback)(() => {
|
|
3848
|
+
setToolSelectedCard(null);
|
|
3849
|
+
setToolsVisible(false);
|
|
3850
|
+
}, []);
|
|
3851
|
+
const openSideApp = (0, import_react15.useCallback)((card) => {
|
|
3852
|
+
openDetail(card);
|
|
3853
|
+
}, [openDetail]);
|
|
3854
|
+
const openContentApp = (0, import_react15.useCallback)((card) => {
|
|
3855
|
+
setContentAppSelectedCard(card);
|
|
3856
|
+
setcontentAppVisible(true);
|
|
3857
|
+
}, []);
|
|
3792
3858
|
const closeSideApp = (0, import_react15.useCallback)(() => {
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
}, [setSideAppSelectedCard, setSideAppVisible]);
|
|
3859
|
+
closeDetail();
|
|
3860
|
+
}, [closeDetail]);
|
|
3796
3861
|
const closeContentApp = (0, import_react15.useCallback)(() => {
|
|
3797
3862
|
setContentAppSelectedCard(null);
|
|
3798
3863
|
setcontentAppVisible(false);
|
|
3799
|
-
}, [
|
|
3864
|
+
}, []);
|
|
3865
|
+
const toggleTools = (0, import_react15.useCallback)(() => {
|
|
3866
|
+
setToolsVisible((prev) => !prev);
|
|
3867
|
+
}, []);
|
|
3800
3868
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3801
3869
|
ChatUIContext.Provider,
|
|
3802
3870
|
{
|
|
3803
3871
|
value: {
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3872
|
+
detailVisible,
|
|
3873
|
+
setDetailVisible,
|
|
3874
|
+
detailSize,
|
|
3875
|
+
setDetailSize,
|
|
3876
|
+
detailSelectedCard,
|
|
3877
|
+
setDetailSelectedCard,
|
|
3878
|
+
openDetail,
|
|
3879
|
+
closeDetail,
|
|
3880
|
+
toolsVisible,
|
|
3881
|
+
setToolsVisible,
|
|
3882
|
+
toggleTools,
|
|
3883
|
+
toolSelectedCard,
|
|
3884
|
+
setToolSelectedCard,
|
|
3885
|
+
openTools,
|
|
3886
|
+
closeTools,
|
|
3887
|
+
sideAppVisible: detailVisible,
|
|
3888
|
+
setSideAppVisible: setDetailVisible,
|
|
3889
|
+
sideAppSize: detailSize,
|
|
3890
|
+
setSideAppSize: setDetailSize,
|
|
3891
|
+
sideAppSelectedCard: detailSelectedCard,
|
|
3892
|
+
setSideAppSelectedCard: setDetailSelectedCard,
|
|
3810
3893
|
openSideApp,
|
|
3811
3894
|
closeSideApp,
|
|
3812
3895
|
openContentApp,
|
|
@@ -3826,6 +3909,9 @@ var useChatUIContext = () => {
|
|
|
3826
3909
|
return (0, import_react15.useContext)(ChatUIContext);
|
|
3827
3910
|
};
|
|
3828
3911
|
|
|
3912
|
+
// src/components/Chat/LatticeChat.tsx
|
|
3913
|
+
var import_antd_style34 = require("antd-style");
|
|
3914
|
+
|
|
3829
3915
|
// src/components/Chat/useStyle.tsx
|
|
3830
3916
|
var import_antd_style2 = require("antd-style");
|
|
3831
3917
|
var useStyle = (0, import_antd_style2.createStyles)(({ token, css }) => {
|
|
@@ -4024,6 +4110,23 @@ var useStyle = (0, import_antd_style2.createStyles)(({ token, css }) => {
|
|
|
4024
4110
|
top: 2px;
|
|
4025
4111
|
}
|
|
4026
4112
|
`,
|
|
4113
|
+
toolPanel: css`
|
|
4114
|
+
display: flex;
|
|
4115
|
+
flex-direction: column;
|
|
4116
|
+
width: 0;
|
|
4117
|
+
background: ${token.colorBgContainer};
|
|
4118
|
+
transition: all 0.3s ease;
|
|
4119
|
+
overflow: hidden;
|
|
4120
|
+
flex-shrink: 0;
|
|
4121
|
+
border-radius: ${token.borderRadiusLG}px;
|
|
4122
|
+
border: 1px solid transparent;
|
|
4123
|
+
|
|
4124
|
+
&.open {
|
|
4125
|
+
width: 320px;
|
|
4126
|
+
box-shadow: ${token.boxShadow};
|
|
4127
|
+
border-color: ${token.colorBorder};
|
|
4128
|
+
}
|
|
4129
|
+
`,
|
|
4027
4130
|
detailContent: css`
|
|
4028
4131
|
// padding: 8px 8px;
|
|
4029
4132
|
height: 100%;
|
|
@@ -4591,39 +4694,44 @@ var useStyle = (0, import_antd_style2.createStyles)(({ token, css }) => {
|
|
|
4591
4694
|
// src/components/Chat/ColumnLayout.tsx
|
|
4592
4695
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
4593
4696
|
var ColumnLayout = ({
|
|
4594
|
-
|
|
4595
|
-
|
|
4697
|
+
main,
|
|
4698
|
+
detail,
|
|
4699
|
+
tools,
|
|
4596
4700
|
logo,
|
|
4597
4701
|
menu,
|
|
4598
4702
|
header
|
|
4599
4703
|
}) => {
|
|
4600
4704
|
const { styles } = useStyle();
|
|
4601
|
-
const {
|
|
4705
|
+
const {
|
|
4706
|
+
detailVisible,
|
|
4707
|
+
detailSize,
|
|
4708
|
+
detailSelectedCard,
|
|
4709
|
+
toolsVisible,
|
|
4710
|
+
toolSelectedCard,
|
|
4711
|
+
contentAppSelectedCard,
|
|
4712
|
+
menuCollapsed
|
|
4713
|
+
} = useChatUIContext();
|
|
4714
|
+
const isMenuCollapsed = menuCollapsed || detailVisible;
|
|
4715
|
+
const menuStateClass = isMenuCollapsed ? "collapsed" : "expanded";
|
|
4716
|
+
const hasSidePanelsOpen = detailVisible || toolsVisible;
|
|
4717
|
+
const resolvedDetailSize = toolsVisible && (detailSize || "large") === "large" ? "middle" : detailSize || "large";
|
|
4602
4718
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: `fina_chat ${styles.layout}`, children: [
|
|
4603
|
-
menu && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
children: [
|
|
4608
|
-
logo,
|
|
4609
|
-
menu
|
|
4610
|
-
]
|
|
4611
|
-
}
|
|
4612
|
-
),
|
|
4719
|
+
menu && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: `${styles.menu} ${menuStateClass}`, children: [
|
|
4720
|
+
logo,
|
|
4721
|
+
menu
|
|
4722
|
+
] }),
|
|
4613
4723
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: styles.contentArea, children: [
|
|
4614
4724
|
header && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: styles.header, children: header }),
|
|
4615
4725
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: styles.columns, children: [
|
|
4616
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: `${styles.mainContent} ${
|
|
4617
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.
|
|
4726
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: `${styles.mainContent} ${hasSidePanelsOpen ? "open" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: `${styles.chat} ${contentAppSelectedCard ? "full_content_width" : ""}`, children: main }) }),
|
|
4727
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
4618
4728
|
"div",
|
|
4619
4729
|
{
|
|
4620
|
-
className: `${styles.detailPanel} ${
|
|
4621
|
-
children:
|
|
4622
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_jsx_runtime12.Fragment, {}),
|
|
4623
|
-
sideAppSelectedCard && sideAppVisible && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_jsx_runtime12.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: styles.detailContent, children: right }) })
|
|
4624
|
-
]
|
|
4730
|
+
className: `${styles.detailPanel} ${detailVisible ? `open ${resolvedDetailSize}` : ""}`,
|
|
4731
|
+
children: detailVisible && detailSelectedCard && detail ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: styles.detailContent, children: detail }) : null
|
|
4625
4732
|
}
|
|
4626
|
-
)
|
|
4733
|
+
),
|
|
4734
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: `${styles.toolPanel} ${toolsVisible ? "open" : ""}`, children: toolsVisible && tools ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: styles.detailContent, children: tools }) : null })
|
|
4627
4735
|
] })
|
|
4628
4736
|
] })
|
|
4629
4737
|
] });
|
|
@@ -4695,7 +4803,7 @@ var import_icons3 = require("@ant-design/icons");
|
|
|
4695
4803
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
4696
4804
|
var { Text: Text3 } = import_antd5.Typography;
|
|
4697
4805
|
var GenericDataTable = ({ data, interactive = true, default_open_in_side_app = true }) => {
|
|
4698
|
-
const { dataSource, message:
|
|
4806
|
+
const { dataSource, message: message21 } = data ?? {};
|
|
4699
4807
|
const [expandedRowKeys, setExpandedRowKeys] = (0, import_react17.useState)([]);
|
|
4700
4808
|
const { openSideApp } = useChatUIContext();
|
|
4701
4809
|
const processedData = dataSource?.map((item, index) => ({
|
|
@@ -4794,7 +4902,7 @@ var GenericDataTable = ({ data, interactive = true, default_open_in_side_app = t
|
|
|
4794
4902
|
type: "text/csv;charset=utf-8;"
|
|
4795
4903
|
});
|
|
4796
4904
|
const link = document.createElement("a");
|
|
4797
|
-
const filename = `${
|
|
4905
|
+
const filename = `${message21 || "data"}_${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.csv`;
|
|
4798
4906
|
link.href = URL.createObjectURL(blob);
|
|
4799
4907
|
link.download = filename;
|
|
4800
4908
|
document.body.appendChild(link);
|
|
@@ -4815,7 +4923,7 @@ var GenericDataTable = ({ data, interactive = true, default_open_in_side_app = t
|
|
|
4815
4923
|
tableLayout: "fixed",
|
|
4816
4924
|
style: { width: "100% !important" },
|
|
4817
4925
|
title: () => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_antd5.Flex, { justify: "space-between", align: "center", children: [
|
|
4818
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_antd5.Space, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text3, { strong: true, style: { fontSize: 16 }, children:
|
|
4926
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_antd5.Space, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text3, { strong: true, style: { fontSize: 16 }, children: message21 || "" }) }),
|
|
4819
4927
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_antd5.Space, { children: [
|
|
4820
4928
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4821
4929
|
import_antd5.Button,
|
|
@@ -4837,8 +4945,8 @@ var GenericDataTable = ({ data, interactive = true, default_open_in_side_app = t
|
|
|
4837
4945
|
onClick: () => {
|
|
4838
4946
|
openSideApp({
|
|
4839
4947
|
component_key: "generic_data_table",
|
|
4840
|
-
message:
|
|
4841
|
-
data: { dataSource, message:
|
|
4948
|
+
message: message21 || "",
|
|
4949
|
+
data: { dataSource, message: message21 }
|
|
4842
4950
|
});
|
|
4843
4951
|
},
|
|
4844
4952
|
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons3.ExpandAltOutlined, {})
|
|
@@ -6262,11 +6370,11 @@ var ConfirmFeedback = ({
|
|
|
6262
6370
|
data,
|
|
6263
6371
|
interactive = true
|
|
6264
6372
|
}) => {
|
|
6265
|
-
const { message:
|
|
6373
|
+
const { message: message21, type, config, feedback, options } = data ?? {};
|
|
6266
6374
|
const { sendMessage } = useAgentChat();
|
|
6267
6375
|
const [clicked, setClicked] = (0, import_react25.useState)(false);
|
|
6268
6376
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_antd12.Space, { direction: "vertical", style: { width: "100%" }, children: [
|
|
6269
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(MDResponse, { content:
|
|
6377
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(MDResponse, { content: message21 }),
|
|
6270
6378
|
options ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_antd12.Space, { style: { justifyContent: "flex-end", width: "100%" }, children: options?.map((option) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
6271
6379
|
import_antd12.Button,
|
|
6272
6380
|
{
|
|
@@ -7490,7 +7598,7 @@ var AttachmentsCard = ({
|
|
|
7490
7598
|
const { config } = useLatticeChatShellContext();
|
|
7491
7599
|
const baseURL = config.baseURL;
|
|
7492
7600
|
const fileBaseURL = `${baseURL}/api/assistants/${assistantId}/threads/${threadId}/sandbox/downloadfile?path=`;
|
|
7493
|
-
const { Text:
|
|
7601
|
+
const { Text: Text39 } = import_antd19.Typography;
|
|
7494
7602
|
const [showAll, setShowAll] = (0, import_react29.useState)(false);
|
|
7495
7603
|
const { openSideApp } = useChatUIContext();
|
|
7496
7604
|
const getStyles = () => {
|
|
@@ -7564,7 +7672,7 @@ var AttachmentsCard = ({
|
|
|
7564
7672
|
);
|
|
7565
7673
|
};
|
|
7566
7674
|
const renderFileDescription = (item) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_antd19.Space, { direction: "vertical", size: size === "small" ? 2 : 4, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_antd19.Space, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
7567
|
-
|
|
7675
|
+
Text39,
|
|
7568
7676
|
{
|
|
7569
7677
|
type: "secondary",
|
|
7570
7678
|
style: {
|
|
@@ -7638,7 +7746,7 @@ var AttachmentsCard = ({
|
|
|
7638
7746
|
}
|
|
7639
7747
|
),
|
|
7640
7748
|
item.files && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { style: { paddingLeft: "12px" }, children: [
|
|
7641
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
7749
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text39, { type: "secondary", style: { fontSize: "12px" }, children: [
|
|
7642
7750
|
"Contains ",
|
|
7643
7751
|
item.files.length,
|
|
7644
7752
|
" file(s)"
|
|
@@ -8293,7 +8401,7 @@ var import_ErrorBoundary = __toESM(require("antd/es/alert/ErrorBoundary"));
|
|
|
8293
8401
|
var import_react32 = require("react");
|
|
8294
8402
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
8295
8403
|
var LazyBubble = ({
|
|
8296
|
-
message:
|
|
8404
|
+
message: message21,
|
|
8297
8405
|
renderContent,
|
|
8298
8406
|
autoLoadRightPanel
|
|
8299
8407
|
}) => {
|
|
@@ -8324,10 +8432,10 @@ var LazyBubble = ({
|
|
|
8324
8432
|
autoLoadRightPanel?.();
|
|
8325
8433
|
}, []);
|
|
8326
8434
|
const getPlaceholder = () => {
|
|
8327
|
-
const estimatedHeight =
|
|
8435
|
+
const estimatedHeight = message21.content ? Math.min(100, message21.content.length / 5) : 100;
|
|
8328
8436
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { style: { height: `${estimatedHeight}px`, minHeight: "50px" } });
|
|
8329
8437
|
};
|
|
8330
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_ErrorBoundary.default, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { ref, style: { width: "100%" }, children: isVisible || wasEverVisible ? renderContent(
|
|
8438
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_ErrorBoundary.default, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { ref, style: { width: "100%" }, children: isVisible || wasEverVisible ? renderContent(message21) : getPlaceholder() }) });
|
|
8331
8439
|
};
|
|
8332
8440
|
var MemoizedBubbleList = (0, import_react32.memo)(
|
|
8333
8441
|
({
|
|
@@ -8358,8 +8466,8 @@ var MessageList = ({
|
|
|
8358
8466
|
messageLengthRef.current = messages?.length;
|
|
8359
8467
|
}
|
|
8360
8468
|
}, [messages?.length]);
|
|
8361
|
-
const renderContent = (0, import_react32.useCallback)((
|
|
8362
|
-
const { content } =
|
|
8469
|
+
const renderContent = (0, import_react32.useCallback)((message21) => {
|
|
8470
|
+
const { content } = message21;
|
|
8363
8471
|
try {
|
|
8364
8472
|
const json = JSON.parse(content);
|
|
8365
8473
|
if (json.action && json.message) {
|
|
@@ -8367,7 +8475,7 @@ var MessageList = ({
|
|
|
8367
8475
|
}
|
|
8368
8476
|
} catch (error) {
|
|
8369
8477
|
}
|
|
8370
|
-
const tool_calls_md =
|
|
8478
|
+
const tool_calls_md = message21.tool_calls?.map((tool_call) => {
|
|
8371
8479
|
return `\`\`\`tool_call
|
|
8372
8480
|
${JSON.stringify(tool_call)}
|
|
8373
8481
|
\`\`\``;
|
|
@@ -8376,17 +8484,17 @@ ${JSON.stringify(tool_call)}
|
|
|
8376
8484
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_antd25.Space, { direction: "vertical", style: { width: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(MDResponse, { content: content_md }) });
|
|
8377
8485
|
}, []);
|
|
8378
8486
|
const items = (0, import_react32.useMemo)(
|
|
8379
|
-
() => messages.map((
|
|
8380
|
-
key:
|
|
8381
|
-
role:
|
|
8487
|
+
() => messages.map((message21, index) => ({
|
|
8488
|
+
key: message21.id,
|
|
8489
|
+
role: message21.role,
|
|
8382
8490
|
typing: false,
|
|
8383
8491
|
content: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
8384
8492
|
LazyBubble,
|
|
8385
8493
|
{
|
|
8386
|
-
message:
|
|
8494
|
+
message: message21,
|
|
8387
8495
|
renderContent,
|
|
8388
8496
|
autoLoadRightPanel: () => {
|
|
8389
|
-
const { content, role: role2 } =
|
|
8497
|
+
const { content, role: role2 } = message21;
|
|
8390
8498
|
const isNewAddedMessage = messageLengthRef.current > 1 && messageLengthRef.current + 1 === messages.length;
|
|
8391
8499
|
if (index === messages.length - 1 && isNewAddedMessage && role2 === "ai") {
|
|
8392
8500
|
try {
|
|
@@ -10217,7 +10325,7 @@ var ProjectCardList = () => {
|
|
|
10217
10325
|
}
|
|
10218
10326
|
setIsCreateModalOpen(false);
|
|
10219
10327
|
};
|
|
10220
|
-
const
|
|
10328
|
+
const formatDate6 = (date) => {
|
|
10221
10329
|
const d = typeof date === "string" ? new Date(date) : date;
|
|
10222
10330
|
return d.toLocaleDateString("en-US", {
|
|
10223
10331
|
month: "short",
|
|
@@ -10308,7 +10416,7 @@ var ProjectCardList = () => {
|
|
|
10308
10416
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("h3", { className: styles.projectName, children: project.name }),
|
|
10309
10417
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("span", { className: styles.projectDate, children: [
|
|
10310
10418
|
"Created ",
|
|
10311
|
-
|
|
10419
|
+
formatDate6(project.createdAt)
|
|
10312
10420
|
] })
|
|
10313
10421
|
] })
|
|
10314
10422
|
] }) })
|
|
@@ -10326,7 +10434,7 @@ var ProjectCardList = () => {
|
|
|
10326
10434
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: styles.listProjectName, children: project.name }),
|
|
10327
10435
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("span", { className: styles.listProjectDate, children: [
|
|
10328
10436
|
"Created ",
|
|
10329
|
-
|
|
10437
|
+
formatDate6(project.createdAt)
|
|
10330
10438
|
] })
|
|
10331
10439
|
] })
|
|
10332
10440
|
] }, project.id))
|
|
@@ -15451,7 +15559,7 @@ var SkillNode = ({ data }) => {
|
|
|
15451
15559
|
) : [],
|
|
15452
15560
|
[currentSkill.metadata]
|
|
15453
15561
|
);
|
|
15454
|
-
const
|
|
15562
|
+
const formatDate6 = (value) => {
|
|
15455
15563
|
if (!value) return "";
|
|
15456
15564
|
const date = value instanceof Date ? value : new Date(value);
|
|
15457
15565
|
if (Number.isNaN(date.getTime())) return "";
|
|
@@ -16059,7 +16167,7 @@ var SkillNode = ({ data }) => {
|
|
|
16059
16167
|
},
|
|
16060
16168
|
children: [
|
|
16061
16169
|
"Created: ",
|
|
16062
|
-
|
|
16170
|
+
formatDate6(currentSkill.createdAt)
|
|
16063
16171
|
]
|
|
16064
16172
|
}
|
|
16065
16173
|
),
|
|
@@ -16073,7 +16181,7 @@ var SkillNode = ({ data }) => {
|
|
|
16073
16181
|
},
|
|
16074
16182
|
children: [
|
|
16075
16183
|
"Updated: ",
|
|
16076
|
-
|
|
16184
|
+
formatDate6(currentSkill.updatedAt)
|
|
16077
16185
|
]
|
|
16078
16186
|
}
|
|
16079
16187
|
)
|
|
@@ -17630,8 +17738,7 @@ var WorkspaceResourceManager = ({
|
|
|
17630
17738
|
}
|
|
17631
17739
|
),
|
|
17632
17740
|
logo,
|
|
17633
|
-
|
|
17634
|
-
right: null
|
|
17741
|
+
main: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(SideAppViewBrowser, { region: "content" })
|
|
17635
17742
|
}
|
|
17636
17743
|
),
|
|
17637
17744
|
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
@@ -20317,6 +20424,11 @@ var useStyles8 = (0, import_antd_style20.createStyles)(({ token, css }) => ({
|
|
|
20317
20424
|
padding: 2px 6px;
|
|
20318
20425
|
border-radius: 4px;
|
|
20319
20426
|
font-size: 12px;
|
|
20427
|
+
`,
|
|
20428
|
+
messageContent: css`
|
|
20429
|
+
margin-top: 4px;
|
|
20430
|
+
max-width: 300px;
|
|
20431
|
+
word-break: break-word;
|
|
20320
20432
|
`
|
|
20321
20433
|
}));
|
|
20322
20434
|
var getStatusColor = (status) => {
|
|
@@ -20502,7 +20614,8 @@ var ScheduleViewer = ({ data }) => {
|
|
|
20502
20614
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: styles.taskHeader, children: [
|
|
20503
20615
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { children: [
|
|
20504
20616
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: styles.taskType, children: task.taskType }),
|
|
20505
|
-
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: styles.taskId, children: task.taskId })
|
|
20617
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: styles.taskId, children: task.taskId }),
|
|
20618
|
+
task.payload?.message?.content && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: styles.messageContent, children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Text26, { type: "secondary", style: { fontSize: 12 }, children: task.payload.message.content }) })
|
|
20506
20619
|
] }),
|
|
20507
20620
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_antd64.Tag, { color: getStatusColor(task.status), icon: getStatusIcon2(task.status), children: task.status.toUpperCase() })
|
|
20508
20621
|
] }),
|
|
@@ -20542,19 +20655,6 @@ var ScheduleViewer = ({ data }) => {
|
|
|
20542
20655
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_icons34.ExclamationCircleOutlined, { style: { marginRight: 4 } }),
|
|
20543
20656
|
task.lastError
|
|
20544
20657
|
] }) }),
|
|
20545
|
-
task.metadata && Object.keys(task.metadata).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
20546
|
-
import_antd64.Descriptions,
|
|
20547
|
-
{
|
|
20548
|
-
size: "small",
|
|
20549
|
-
column: 1,
|
|
20550
|
-
style: { marginTop: 12 },
|
|
20551
|
-
items: Object.entries(task.metadata).map(([key, value]) => ({
|
|
20552
|
-
key,
|
|
20553
|
-
label: key,
|
|
20554
|
-
children: typeof value === "object" ? JSON.stringify(value) : String(value)
|
|
20555
|
-
}))
|
|
20556
|
-
}
|
|
20557
|
-
),
|
|
20558
20658
|
isActive && renderActions(task)
|
|
20559
20659
|
]
|
|
20560
20660
|
},
|
|
@@ -23213,12 +23313,12 @@ var formatDate3 = (timestamp) => {
|
|
|
23213
23313
|
});
|
|
23214
23314
|
};
|
|
23215
23315
|
var MailboxDetailModal = ({
|
|
23216
|
-
message:
|
|
23316
|
+
message: message21,
|
|
23217
23317
|
visible,
|
|
23218
23318
|
onClose
|
|
23219
23319
|
}) => {
|
|
23220
23320
|
const { styles } = useStyles15();
|
|
23221
|
-
if (!
|
|
23321
|
+
if (!message21) return null;
|
|
23222
23322
|
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
23223
23323
|
import_antd74.Modal,
|
|
23224
23324
|
{
|
|
@@ -23241,12 +23341,12 @@ var MailboxDetailModal = ({
|
|
|
23241
23341
|
children: /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: styles.modalContent, children: [
|
|
23242
23342
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: styles.header, children: [
|
|
23243
23343
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: styles.messageIcon, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_lucide_react22.Mail, { size: 20 }) }),
|
|
23244
|
-
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Text35, { className: styles.messageId, children:
|
|
23245
|
-
!
|
|
23344
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Text35, { className: styles.messageId, children: message21.id }),
|
|
23345
|
+
!message21.read && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_antd74.Tag, { color: "red", children: "Unread" })
|
|
23246
23346
|
] }),
|
|
23247
23347
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(Title11, { level: 4, className: styles.title, children: [
|
|
23248
23348
|
"Message from ",
|
|
23249
|
-
|
|
23349
|
+
message21.from
|
|
23250
23350
|
] }),
|
|
23251
23351
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: styles.metaSection, children: [
|
|
23252
23352
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: styles.metaItem, children: [
|
|
@@ -23256,11 +23356,11 @@ var MailboxDetailModal = ({
|
|
|
23256
23356
|
"div",
|
|
23257
23357
|
{
|
|
23258
23358
|
className: styles.avatar,
|
|
23259
|
-
style: { background: getAvatarColor7(
|
|
23260
|
-
children: getInitials7(
|
|
23359
|
+
style: { background: getAvatarColor7(message21.from) },
|
|
23360
|
+
children: getInitials7(message21.from)
|
|
23261
23361
|
}
|
|
23262
23362
|
),
|
|
23263
|
-
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { children:
|
|
23363
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { children: message21.from })
|
|
23264
23364
|
] })
|
|
23265
23365
|
] }),
|
|
23266
23366
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: styles.metaItem, children: [
|
|
@@ -23270,29 +23370,29 @@ var MailboxDetailModal = ({
|
|
|
23270
23370
|
"div",
|
|
23271
23371
|
{
|
|
23272
23372
|
className: styles.avatar,
|
|
23273
|
-
style: { background: getAvatarColor7(
|
|
23274
|
-
children: getInitials7(
|
|
23373
|
+
style: { background: getAvatarColor7(message21.to) },
|
|
23374
|
+
children: getInitials7(message21.to)
|
|
23275
23375
|
}
|
|
23276
23376
|
),
|
|
23277
|
-
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { children:
|
|
23377
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { children: message21.to })
|
|
23278
23378
|
] })
|
|
23279
23379
|
] }),
|
|
23280
23380
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: styles.metaItem, children: [
|
|
23281
23381
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Text35, { className: styles.metaLabel, children: "Time" }),
|
|
23282
23382
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: styles.metaValue, children: [
|
|
23283
23383
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_lucide_react22.Calendar, { size: 14 }),
|
|
23284
|
-
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { children: formatDate3(
|
|
23384
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { children: formatDate3(message21.timestamp) })
|
|
23285
23385
|
] })
|
|
23286
23386
|
] }),
|
|
23287
23387
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: styles.metaItem, children: [
|
|
23288
23388
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Text35, { className: styles.metaLabel, children: "Type" }),
|
|
23289
|
-
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: styles.metaValue, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_antd74.Tag, { color:
|
|
23389
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: styles.metaValue, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_antd74.Tag, { color: message21.type === "broadcast" ? "blue" : "default", children: message21.type }) })
|
|
23290
23390
|
] })
|
|
23291
23391
|
] }),
|
|
23292
23392
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_antd74.Divider, {}),
|
|
23293
23393
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: styles.contentSection, children: [
|
|
23294
23394
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Text35, { className: styles.contentLabel, children: "Message Content" }),
|
|
23295
|
-
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: styles.contentBox, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Paragraph2, { className: styles.messageContent, children:
|
|
23395
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: styles.contentBox, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Paragraph2, { className: styles.messageContent, children: message21.content }) })
|
|
23296
23396
|
] })
|
|
23297
23397
|
] })
|
|
23298
23398
|
}
|
|
@@ -23521,26 +23621,26 @@ var MessageGroupComponent = ({ group, styles, defaultExpanded = true, onMessageC
|
|
|
23521
23621
|
]
|
|
23522
23622
|
}
|
|
23523
23623
|
),
|
|
23524
|
-
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: styles.listGroupContent, children: group.messages.map((
|
|
23624
|
+
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: styles.listGroupContent, children: group.messages.map((message21) => /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(
|
|
23525
23625
|
"div",
|
|
23526
23626
|
{
|
|
23527
|
-
className: `${styles.listItem} ${!
|
|
23528
|
-
onClick: () => onMessageClick(
|
|
23627
|
+
className: `${styles.listItem} ${!message21.read ? styles.listItemUnread : ""}`,
|
|
23628
|
+
onClick: () => onMessageClick(message21),
|
|
23529
23629
|
children: [
|
|
23530
|
-
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: styles.listItemIcon, children: !
|
|
23630
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: styles.listItemIcon, children: !message21.read ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: styles.unreadBadge }) : /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_lucide_react23.Circle, { size: 8, style: { color: "#d9d9d9" } }) }),
|
|
23531
23631
|
/* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: styles.listItemContent, children: [
|
|
23532
|
-
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: styles.listItemPreview, children: getMessagePreview(
|
|
23632
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: styles.listItemPreview, children: getMessagePreview(message21.content) }),
|
|
23533
23633
|
/* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("span", { className: styles.listItemMeta, children: [
|
|
23534
23634
|
"To: ",
|
|
23535
|
-
|
|
23635
|
+
message21.to,
|
|
23536
23636
|
" \u2022 ",
|
|
23537
|
-
|
|
23637
|
+
message21.type
|
|
23538
23638
|
] })
|
|
23539
23639
|
] }),
|
|
23540
|
-
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: styles.listItemRight, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: styles.listItemDate, children: formatDate4(
|
|
23640
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: styles.listItemRight, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: styles.listItemDate, children: formatDate4(message21.timestamp) }) })
|
|
23541
23641
|
]
|
|
23542
23642
|
},
|
|
23543
|
-
|
|
23643
|
+
message21.id
|
|
23544
23644
|
)) })
|
|
23545
23645
|
] });
|
|
23546
23646
|
};
|
|
@@ -23551,12 +23651,12 @@ var MailboxPanel = ({ data }) => {
|
|
|
23551
23651
|
const { teamMailbox = [] } = data || {};
|
|
23552
23652
|
const messageGroups = (0, import_react72.useMemo)(() => {
|
|
23553
23653
|
const groupsMap = /* @__PURE__ */ new Map();
|
|
23554
|
-
teamMailbox.forEach((
|
|
23555
|
-
const sender =
|
|
23654
|
+
teamMailbox.forEach((message21) => {
|
|
23655
|
+
const sender = message21.from;
|
|
23556
23656
|
if (!groupsMap.has(sender)) {
|
|
23557
23657
|
groupsMap.set(sender, []);
|
|
23558
23658
|
}
|
|
23559
|
-
groupsMap.get(sender).push(
|
|
23659
|
+
groupsMap.get(sender).push(message21);
|
|
23560
23660
|
});
|
|
23561
23661
|
const groups = Array.from(groupsMap.entries()).map(([sender, messages]) => ({
|
|
23562
23662
|
sender,
|
|
@@ -23573,8 +23673,8 @@ var MailboxPanel = ({ data }) => {
|
|
|
23573
23673
|
return groups;
|
|
23574
23674
|
}, [teamMailbox]);
|
|
23575
23675
|
const totalUnread = teamMailbox.filter((m) => !m.read).length;
|
|
23576
|
-
const handleMessageClick = (
|
|
23577
|
-
setSelectedMessage(
|
|
23676
|
+
const handleMessageClick = (message21) => {
|
|
23677
|
+
setSelectedMessage(message21);
|
|
23578
23678
|
setModalVisible(true);
|
|
23579
23679
|
};
|
|
23580
23680
|
const handleCloseModal = () => {
|
|
@@ -25418,11 +25518,11 @@ var StreamingHTMLRenderer = ({
|
|
|
25418
25518
|
if (!iframe || event.source !== iframe.contentWindow) {
|
|
25419
25519
|
return;
|
|
25420
25520
|
}
|
|
25421
|
-
const
|
|
25422
|
-
if (!
|
|
25521
|
+
const message21 = event.data;
|
|
25522
|
+
if (!message21 || typeof message21 !== "object") {
|
|
25423
25523
|
return;
|
|
25424
25524
|
}
|
|
25425
|
-
switch (
|
|
25525
|
+
switch (message21.type) {
|
|
25426
25526
|
case "iframe-ready":
|
|
25427
25527
|
console.log("[StreamingHTMLRenderer] Iframe ready");
|
|
25428
25528
|
isReadyRef.current = true;
|
|
@@ -25437,25 +25537,25 @@ var StreamingHTMLRenderer = ({
|
|
|
25437
25537
|
}
|
|
25438
25538
|
break;
|
|
25439
25539
|
case "iframe-height":
|
|
25440
|
-
if (typeof
|
|
25441
|
-
setIframeHeight(
|
|
25540
|
+
if (typeof message21.height === "number" && message21.height > 0) {
|
|
25541
|
+
setIframeHeight(message21.height);
|
|
25442
25542
|
}
|
|
25443
25543
|
break;
|
|
25444
25544
|
case "iframe-error":
|
|
25445
25545
|
const streamingError = {
|
|
25446
25546
|
type: "RENDER_ERROR",
|
|
25447
|
-
message:
|
|
25547
|
+
message: message21.error || "Unknown iframe error"
|
|
25448
25548
|
};
|
|
25449
25549
|
onError?.(streamingError);
|
|
25450
25550
|
break;
|
|
25451
25551
|
case "widget-prompt":
|
|
25452
|
-
if (typeof
|
|
25453
|
-
onPrompt?.(
|
|
25552
|
+
if (typeof message21.text === "string") {
|
|
25553
|
+
onPrompt?.(message21.text);
|
|
25454
25554
|
}
|
|
25455
25555
|
break;
|
|
25456
25556
|
case "widget-open-link":
|
|
25457
|
-
if (typeof
|
|
25458
|
-
window.open(
|
|
25557
|
+
if (typeof message21.url === "string") {
|
|
25558
|
+
window.open(message21.url, "_blank", "noopener,noreferrer");
|
|
25459
25559
|
}
|
|
25460
25560
|
break;
|
|
25461
25561
|
}
|
|
@@ -26554,129 +26654,42 @@ var ProjectSelector = () => {
|
|
|
26554
26654
|
] });
|
|
26555
26655
|
};
|
|
26556
26656
|
|
|
26557
|
-
// src/components/Chat/
|
|
26558
|
-
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
26559
|
-
var LatticeChat = (props) => {
|
|
26560
|
-
const { assistant_id, thread_id = "", menu, header, ...chatingProps } = props;
|
|
26561
|
-
const { config } = useLatticeChatShellContext();
|
|
26562
|
-
const showWorkspaceSelector = config.enableWorkspace;
|
|
26563
|
-
const leftTop = showWorkspaceSelector ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(ProjectSelector, {}) : null;
|
|
26564
|
-
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
26565
|
-
AgentThreadProvider,
|
|
26566
|
-
{
|
|
26567
|
-
assistantId: assistant_id,
|
|
26568
|
-
threadId: thread_id,
|
|
26569
|
-
options: {
|
|
26570
|
-
streaming: true,
|
|
26571
|
-
enableReturnStateWhenStreamCompleted: true,
|
|
26572
|
-
enableResumeStream: true
|
|
26573
|
-
},
|
|
26574
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(ChatUIContextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(
|
|
26575
|
-
"div",
|
|
26576
|
-
{
|
|
26577
|
-
style: {
|
|
26578
|
-
display: "flex",
|
|
26579
|
-
flexDirection: "column",
|
|
26580
|
-
width: "100%",
|
|
26581
|
-
height: "100%"
|
|
26582
|
-
},
|
|
26583
|
-
children: [
|
|
26584
|
-
header,
|
|
26585
|
-
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
26586
|
-
ColumnLayout,
|
|
26587
|
-
{
|
|
26588
|
-
menu,
|
|
26589
|
-
header: leftTop,
|
|
26590
|
-
left: thread_id ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Chating, { ...chatingProps }) : /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { children: "Please create a conversation first" }),
|
|
26591
|
-
right: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(SideAppViewBrowser, {})
|
|
26592
|
-
}
|
|
26593
|
-
)
|
|
26594
|
-
]
|
|
26595
|
-
}
|
|
26596
|
-
) })
|
|
26597
|
-
}
|
|
26598
|
-
);
|
|
26599
|
-
};
|
|
26600
|
-
|
|
26601
|
-
// src/components/Chat/AgentConversations.tsx
|
|
26602
|
-
var import_x7 = require("@ant-design/x");
|
|
26603
|
-
var import_antd80 = require("antd");
|
|
26604
|
-
var import_react81 = require("react");
|
|
26605
|
-
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
26606
|
-
var AgentConversations = ({
|
|
26607
|
-
enableThreadCreation = true,
|
|
26608
|
-
enableThreadList = true
|
|
26609
|
-
}) => {
|
|
26610
|
-
const { token } = import_antd80.theme.useToken();
|
|
26611
|
-
const { currentAssistant } = useAssistantContext();
|
|
26612
|
-
const {
|
|
26613
|
-
assistantId,
|
|
26614
|
-
thread,
|
|
26615
|
-
selectThread,
|
|
26616
|
-
createThread,
|
|
26617
|
-
listThreads,
|
|
26618
|
-
threads
|
|
26619
|
-
} = useConversationContext();
|
|
26620
|
-
const style = {
|
|
26621
|
-
width: "100%",
|
|
26622
|
-
background: "transparent",
|
|
26623
|
-
borderRadius: token.borderRadius
|
|
26624
|
-
};
|
|
26625
|
-
const threadItems = (0, import_react81.useMemo)(() => {
|
|
26626
|
-
return threads || [];
|
|
26627
|
-
}, [threads]);
|
|
26628
|
-
const items = threadItems.map((thread2) => ({
|
|
26629
|
-
key: thread2.id,
|
|
26630
|
-
label: thread2.label
|
|
26631
|
-
}));
|
|
26632
|
-
const newChatClick = async () => {
|
|
26633
|
-
if (!assistantId) {
|
|
26634
|
-
return;
|
|
26635
|
-
}
|
|
26636
|
-
await createThread();
|
|
26637
|
-
};
|
|
26638
|
-
if (!enableThreadList) {
|
|
26639
|
-
return null;
|
|
26640
|
-
}
|
|
26641
|
-
const creation = enableThreadCreation ? {
|
|
26642
|
-
onClick: newChatClick
|
|
26643
|
-
} : void 0;
|
|
26644
|
-
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
26645
|
-
import_x7.Conversations,
|
|
26646
|
-
{
|
|
26647
|
-
creation,
|
|
26648
|
-
items,
|
|
26649
|
-
activeKey: thread?.id,
|
|
26650
|
-
style,
|
|
26651
|
-
groupable: true,
|
|
26652
|
-
onActiveChange: (key) => {
|
|
26653
|
-
selectThread(key);
|
|
26654
|
-
}
|
|
26655
|
-
}
|
|
26656
|
-
);
|
|
26657
|
-
};
|
|
26658
|
-
|
|
26659
|
-
// src/components/Chat/LatticeChatView.tsx
|
|
26660
|
-
var import_react85 = require("react");
|
|
26661
|
-
|
|
26662
|
-
// src/components/Chat/ChatSidebar.tsx
|
|
26663
|
-
var import_react84 = require("react");
|
|
26664
|
-
var import_antd83 = require("antd");
|
|
26665
|
-
var import_lucide_react28 = require("lucide-react");
|
|
26666
|
-
|
|
26667
|
-
// src/components/Chat/ProjectsMenuContent.tsx
|
|
26657
|
+
// src/components/Chat/ToolPanelFiles.tsx
|
|
26668
26658
|
var import_react82 = require("react");
|
|
26669
26659
|
var import_antd81 = require("antd");
|
|
26670
|
-
|
|
26660
|
+
|
|
26661
|
+
// src/components/Chat/FileDirectoryPanel.tsx
|
|
26662
|
+
var import_react81 = __toESM(require("react"));
|
|
26663
|
+
var import_antd80 = require("antd");
|
|
26671
26664
|
var import_lucide_react26 = require("lucide-react");
|
|
26672
|
-
var
|
|
26673
|
-
var
|
|
26665
|
+
var import_antd_style32 = require("antd-style");
|
|
26666
|
+
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
26674
26667
|
var useStyles19 = (0, import_antd_style32.createStyles)(({ token, css }) => ({
|
|
26675
26668
|
container: css`
|
|
26676
|
-
padding:
|
|
26669
|
+
padding: 12px;
|
|
26677
26670
|
font-size: 13px;
|
|
26678
26671
|
background: transparent;
|
|
26679
26672
|
`,
|
|
26673
|
+
header: css`
|
|
26674
|
+
display: flex;
|
|
26675
|
+
align-items: center;
|
|
26676
|
+
gap: 8px;
|
|
26677
|
+
margin-bottom: 12px;
|
|
26678
|
+
padding: 0 4px;
|
|
26679
|
+
font-size: 15px;
|
|
26680
|
+
line-height: 1.4;
|
|
26681
|
+
font-weight: 600;
|
|
26682
|
+
color: ${token.colorText};
|
|
26683
|
+
letter-spacing: -0.01em;
|
|
26684
|
+
padding-bottom: 8px;
|
|
26685
|
+
border-bottom: 1px solid ${token.colorBorderSecondary};
|
|
26686
|
+
|
|
26687
|
+
svg {
|
|
26688
|
+
width: 16px;
|
|
26689
|
+
height: 16px;
|
|
26690
|
+
color: ${token.colorTextSecondary};
|
|
26691
|
+
}
|
|
26692
|
+
`,
|
|
26680
26693
|
section: css`
|
|
26681
26694
|
margin-bottom: 12px;
|
|
26682
26695
|
`,
|
|
@@ -26690,7 +26703,7 @@ var useStyles19 = (0, import_antd_style32.createStyles)(({ token, css }) => ({
|
|
|
26690
26703
|
sectionTitle: css`
|
|
26691
26704
|
font-size: 10px;
|
|
26692
26705
|
font-weight: 600;
|
|
26693
|
-
letter-spacing: 0.
|
|
26706
|
+
letter-spacing: 0.05em;
|
|
26694
26707
|
color: ${token.colorTextSecondary};
|
|
26695
26708
|
text-transform: uppercase;
|
|
26696
26709
|
cursor: pointer;
|
|
@@ -26701,28 +26714,6 @@ var useStyles19 = (0, import_antd_style32.createStyles)(({ token, css }) => ({
|
|
|
26701
26714
|
color: ${token.colorPrimary};
|
|
26702
26715
|
}
|
|
26703
26716
|
`,
|
|
26704
|
-
sectionAction: css`
|
|
26705
|
-
display: flex;
|
|
26706
|
-
align-items: center;
|
|
26707
|
-
justify-content: center;
|
|
26708
|
-
width: 20px;
|
|
26709
|
-
height: 20px;
|
|
26710
|
-
border-radius: 4px;
|
|
26711
|
-
border: none;
|
|
26712
|
-
background: transparent;
|
|
26713
|
-
cursor: pointer;
|
|
26714
|
-
transition: all 0.15s ease;
|
|
26715
|
-
|
|
26716
|
-
&:hover {
|
|
26717
|
-
background: ${token.colorBgTextHover};
|
|
26718
|
-
}
|
|
26719
|
-
|
|
26720
|
-
svg {
|
|
26721
|
-
width: 14px;
|
|
26722
|
-
height: 14px;
|
|
26723
|
-
color: ${token.colorTextSecondary};
|
|
26724
|
-
}
|
|
26725
|
-
`,
|
|
26726
26717
|
badge: css`
|
|
26727
26718
|
display: flex;
|
|
26728
26719
|
align-items: center;
|
|
@@ -26731,96 +26722,74 @@ var useStyles19 = (0, import_antd_style32.createStyles)(({ token, css }) => ({
|
|
|
26731
26722
|
height: 16px;
|
|
26732
26723
|
padding: 0 4px;
|
|
26733
26724
|
border-radius: 8px;
|
|
26734
|
-
background:
|
|
26725
|
+
background: ${token.colorFillSecondary};
|
|
26735
26726
|
font-size: 10px;
|
|
26736
|
-
font-weight:
|
|
26727
|
+
font-weight: 500;
|
|
26737
26728
|
color: ${token.colorTextSecondary};
|
|
26738
26729
|
`,
|
|
26739
|
-
|
|
26730
|
+
assetList: css`
|
|
26740
26731
|
display: flex;
|
|
26741
26732
|
flex-direction: column;
|
|
26742
26733
|
gap: 2px;
|
|
26743
26734
|
`,
|
|
26744
|
-
|
|
26735
|
+
assetItem: css`
|
|
26745
26736
|
display: flex;
|
|
26746
26737
|
align-items: center;
|
|
26747
26738
|
gap: 8px;
|
|
26748
|
-
|
|
26749
|
-
|
|
26739
|
+
width: 100%;
|
|
26740
|
+
padding: 5px 8px;
|
|
26741
|
+
border-radius: 4px;
|
|
26750
26742
|
cursor: pointer;
|
|
26751
26743
|
transition: all 0.15s ease;
|
|
26752
|
-
border:
|
|
26744
|
+
border: none;
|
|
26745
|
+
background: transparent;
|
|
26746
|
+
text-align: left;
|
|
26753
26747
|
|
|
26754
26748
|
&:hover {
|
|
26755
26749
|
background: ${token.colorBgTextHover};
|
|
26756
|
-
border-color: ${token.colorBorder};
|
|
26757
|
-
}
|
|
26758
|
-
|
|
26759
|
-
&.active {
|
|
26760
|
-
background: ${token.colorPrimaryBg};
|
|
26761
|
-
border-color: ${token.colorPrimary};
|
|
26762
26750
|
}
|
|
26763
26751
|
`,
|
|
26764
|
-
|
|
26752
|
+
treeRow: css`
|
|
26765
26753
|
display: flex;
|
|
26766
26754
|
align-items: center;
|
|
26755
|
+
gap: 8px;
|
|
26756
|
+
width: 100%;
|
|
26757
|
+
`,
|
|
26758
|
+
treeIndent: css`
|
|
26759
|
+
flex-shrink: 0;
|
|
26760
|
+
width: 12px;
|
|
26761
|
+
`,
|
|
26762
|
+
treeToggle: css`
|
|
26763
|
+
display: inline-flex;
|
|
26764
|
+
align-items: center;
|
|
26767
26765
|
justify-content: center;
|
|
26766
|
+
width: 18px;
|
|
26767
|
+
height: 18px;
|
|
26768
|
+
padding: 0;
|
|
26769
|
+
border: none;
|
|
26770
|
+
border-radius: 4px;
|
|
26771
|
+
background: transparent;
|
|
26772
|
+
color: ${token.colorTextSecondary};
|
|
26773
|
+
cursor: pointer;
|
|
26768
26774
|
|
|
26769
|
-
|
|
26770
|
-
|
|
26771
|
-
|
|
26772
|
-
color: ${token.colorPrimary};
|
|
26775
|
+
&:hover {
|
|
26776
|
+
background: ${token.colorBgTextHover};
|
|
26777
|
+
color: ${token.colorText};
|
|
26773
26778
|
}
|
|
26774
26779
|
`,
|
|
26775
|
-
|
|
26780
|
+
treeSpacer: css`
|
|
26781
|
+
flex-shrink: 0;
|
|
26782
|
+
width: 18px;
|
|
26783
|
+
height: 18px;
|
|
26784
|
+
`,
|
|
26785
|
+
assetIcon: css`
|
|
26776
26786
|
display: flex;
|
|
26777
26787
|
align-items: center;
|
|
26778
26788
|
justify-content: center;
|
|
26779
|
-
|
|
26780
|
-
|
|
26781
|
-
|
|
26782
|
-
|
|
26783
|
-
color: ${token.colorTextSecondary};
|
|
26784
|
-
}
|
|
26785
|
-
`,
|
|
26786
|
-
projectName: css`
|
|
26787
|
-
font-size: 13px;
|
|
26788
|
-
font-weight: 600;
|
|
26789
|
-
color: ${token.colorPrimary};
|
|
26790
|
-
flex: 1;
|
|
26791
|
-
`,
|
|
26792
|
-
projectNameInactive: css`
|
|
26793
|
-
font-size: 13px;
|
|
26794
|
-
font-weight: 500;
|
|
26795
|
-
color: ${token.colorText};
|
|
26796
|
-
flex: 1;
|
|
26797
|
-
`,
|
|
26798
|
-
assetList: css`
|
|
26799
|
-
display: flex;
|
|
26800
|
-
flex-direction: column;
|
|
26801
|
-
gap: 2px;
|
|
26802
|
-
`,
|
|
26803
|
-
assetItem: css`
|
|
26804
|
-
display: flex;
|
|
26805
|
-
align-items: center;
|
|
26806
|
-
gap: 8px;
|
|
26807
|
-
padding: 5px 8px;
|
|
26808
|
-
border-radius: 4px;
|
|
26809
|
-
cursor: pointer;
|
|
26810
|
-
transition: all 0.15s ease;
|
|
26811
|
-
|
|
26812
|
-
&:hover {
|
|
26813
|
-
background: ${token.colorBgTextHover};
|
|
26814
|
-
}
|
|
26815
|
-
`,
|
|
26816
|
-
assetIcon: css`
|
|
26817
|
-
display: flex;
|
|
26818
|
-
align-items: center;
|
|
26819
|
-
justify-content: center;
|
|
26820
|
-
width: 20px;
|
|
26821
|
-
height: 20px;
|
|
26822
|
-
border-radius: 4px;
|
|
26823
|
-
background: rgba(0, 0, 0, 0.04);
|
|
26789
|
+
width: 20px;
|
|
26790
|
+
height: 20px;
|
|
26791
|
+
border-radius: 4px;
|
|
26792
|
+
background: rgba(0, 0, 0, 0.04);
|
|
26824
26793
|
|
|
26825
26794
|
svg {
|
|
26826
26795
|
width: 14px;
|
|
@@ -26843,6 +26812,11 @@ var useStyles19 = (0, import_antd_style32.createStyles)(({ token, css }) => ({
|
|
|
26843
26812
|
font-size: 10px;
|
|
26844
26813
|
color: ${token.colorTextSecondary};
|
|
26845
26814
|
`,
|
|
26815
|
+
treeChildren: css`
|
|
26816
|
+
display: flex;
|
|
26817
|
+
flex-direction: column;
|
|
26818
|
+
gap: 2px;
|
|
26819
|
+
`,
|
|
26846
26820
|
emptyState: css`
|
|
26847
26821
|
padding: 12px;
|
|
26848
26822
|
text-align: center;
|
|
@@ -26886,262 +26860,245 @@ var useStyles19 = (0, import_antd_style32.createStyles)(({ token, css }) => ({
|
|
|
26886
26860
|
width: 14px;
|
|
26887
26861
|
height: 14px;
|
|
26888
26862
|
}
|
|
26889
|
-
`,
|
|
26890
|
-
projectSelector: css`
|
|
26891
|
-
margin-bottom: 12px;
|
|
26892
|
-
`,
|
|
26893
|
-
projectTrigger: css`
|
|
26894
|
-
display: flex;
|
|
26895
|
-
align-items: center;
|
|
26896
|
-
gap: 8px;
|
|
26897
|
-
cursor: pointer;
|
|
26898
|
-
padding: 8px;
|
|
26899
|
-
border-radius: 8px;
|
|
26900
|
-
transition: all 0.2s ease;
|
|
26901
|
-
border: 1px solid transparent;
|
|
26902
|
-
|
|
26903
|
-
&:hover {
|
|
26904
|
-
background: ${token.colorBgTextHover};
|
|
26905
|
-
border-color: ${token.colorBorder};
|
|
26906
|
-
}
|
|
26907
|
-
`,
|
|
26908
|
-
projectTriggerIcon: css`
|
|
26909
|
-
display: flex;
|
|
26910
|
-
align-items: center;
|
|
26911
|
-
justify-content: center;
|
|
26912
|
-
width: 28px;
|
|
26913
|
-
height: 28px;
|
|
26914
|
-
border-radius: 6px;
|
|
26915
|
-
background: ${token.colorPrimaryBg};
|
|
26916
|
-
|
|
26917
|
-
svg {
|
|
26918
|
-
width: 16px;
|
|
26919
|
-
height: 16px;
|
|
26920
|
-
color: ${token.colorPrimary};
|
|
26921
|
-
}
|
|
26922
|
-
`,
|
|
26923
|
-
projectTriggerInfo: css`
|
|
26924
|
-
flex: 1;
|
|
26925
|
-
min-width: 0;
|
|
26926
|
-
`,
|
|
26927
|
-
projectTriggerName: css`
|
|
26928
|
-
font-size: 13px;
|
|
26929
|
-
font-weight: 600;
|
|
26930
|
-
color: ${token.colorText};
|
|
26931
|
-
white-space: nowrap;
|
|
26932
|
-
overflow: hidden;
|
|
26933
|
-
text-overflow: ellipsis;
|
|
26934
|
-
`,
|
|
26935
|
-
projectTriggerArrow: css`
|
|
26936
|
-
display: flex;
|
|
26937
|
-
align-items: center;
|
|
26938
|
-
|
|
26939
|
-
svg {
|
|
26940
|
-
width: 14px;
|
|
26941
|
-
height: 14px;
|
|
26942
|
-
color: ${token.colorTextSecondary};
|
|
26943
|
-
transition: transform 0.2s ease;
|
|
26944
|
-
}
|
|
26945
|
-
|
|
26946
|
-
&.expanded svg {
|
|
26947
|
-
transform: rotate(180deg);
|
|
26948
|
-
}
|
|
26949
|
-
`,
|
|
26950
|
-
projectDropdown: css`
|
|
26951
|
-
display: flex;
|
|
26952
|
-
flex-direction: column;
|
|
26953
|
-
gap: 2px;
|
|
26954
|
-
margin-top: 4px;
|
|
26955
|
-
padding: 4px;
|
|
26956
|
-
background: ${token.colorBgContainer};
|
|
26957
|
-
border-radius: 8px;
|
|
26958
|
-
border: 1px solid ${token.colorBorder};
|
|
26959
|
-
`,
|
|
26960
|
-
projectDropdownItem: css`
|
|
26961
|
-
display: flex;
|
|
26962
|
-
align-items: center;
|
|
26963
|
-
gap: 8px;
|
|
26964
|
-
padding: 8px 10px;
|
|
26965
|
-
border-radius: 6px;
|
|
26966
|
-
cursor: pointer;
|
|
26967
|
-
transition: all 0.15s ease;
|
|
26968
|
-
|
|
26969
|
-
&:hover {
|
|
26970
|
-
background: ${token.colorBgTextHover};
|
|
26971
|
-
}
|
|
26972
|
-
|
|
26973
|
-
&.active {
|
|
26974
|
-
background: ${token.colorPrimaryBg};
|
|
26975
|
-
}
|
|
26976
|
-
`,
|
|
26977
|
-
projectDropdownItemIcon: css`
|
|
26978
|
-
display: flex;
|
|
26979
|
-
align-items: center;
|
|
26980
|
-
justify-content: center;
|
|
26981
|
-
|
|
26982
|
-
svg {
|
|
26983
|
-
width: 14px;
|
|
26984
|
-
height: 14px;
|
|
26985
|
-
color: ${token.colorTextSecondary};
|
|
26986
|
-
}
|
|
26987
|
-
`,
|
|
26988
|
-
projectDropdownItemName: css`
|
|
26989
|
-
font-size: 12px;
|
|
26990
|
-
font-weight: 500;
|
|
26991
|
-
color: ${token.colorText};
|
|
26992
|
-
flex: 1;
|
|
26993
|
-
`,
|
|
26994
|
-
projectDropdownItemNameActive: css`
|
|
26995
|
-
font-size: 12px;
|
|
26996
|
-
font-weight: 600;
|
|
26997
|
-
color: ${token.colorPrimary};
|
|
26998
|
-
flex: 1;
|
|
26999
|
-
`,
|
|
27000
|
-
modalWrap: css`
|
|
27001
|
-
.ant-modal-content {
|
|
27002
|
-
border-radius: 12px;
|
|
27003
|
-
overflow: hidden;
|
|
27004
|
-
}
|
|
27005
|
-
`,
|
|
27006
|
-
formLabel: css`
|
|
27007
|
-
display: block;
|
|
27008
|
-
font-size: 13px;
|
|
27009
|
-
font-weight: 600;
|
|
27010
|
-
color: ${token.colorText};
|
|
27011
|
-
margin-bottom: 8px;
|
|
27012
|
-
`,
|
|
27013
|
-
formInput: css`
|
|
27014
|
-
border-radius: 8px;
|
|
27015
|
-
`,
|
|
27016
|
-
formError: css`
|
|
27017
|
-
font-size: 12px;
|
|
27018
|
-
color: ${token.colorError};
|
|
27019
|
-
margin-top: 6px;
|
|
27020
|
-
`,
|
|
27021
|
-
modalFooter: css`
|
|
27022
|
-
display: flex;
|
|
27023
|
-
justify-content: flex-end;
|
|
27024
|
-
gap: 8px;
|
|
27025
26863
|
`
|
|
27026
26864
|
}));
|
|
27027
|
-
var
|
|
26865
|
+
var formatDate5 = (dateStr) => {
|
|
26866
|
+
if (!dateStr) return "";
|
|
26867
|
+
const date = new Date(dateStr);
|
|
26868
|
+
return date.toLocaleDateString("en-US", { month: "short", day: "numeric" });
|
|
26869
|
+
};
|
|
26870
|
+
var getFileName = (path) => {
|
|
26871
|
+
if (!path) return "";
|
|
26872
|
+
const parts = path.split(/[/\\]/);
|
|
26873
|
+
return parts[parts.length - 1];
|
|
26874
|
+
};
|
|
26875
|
+
var getEntryName = (entry) => getFileName(entry.name || entry.path);
|
|
26876
|
+
var FileDirectoryPanel = ({
|
|
26877
|
+
workspaceId,
|
|
26878
|
+
projectId,
|
|
26879
|
+
resourceFolders,
|
|
26880
|
+
folderEntries,
|
|
26881
|
+
folderLoading,
|
|
26882
|
+
directoryChildren,
|
|
26883
|
+
directoryLoading,
|
|
26884
|
+
directoryExpanded,
|
|
26885
|
+
uploadingFolder,
|
|
26886
|
+
onRefreshFolder,
|
|
26887
|
+
onUploadFolder,
|
|
26888
|
+
onToggleDirectory,
|
|
26889
|
+
onAssetClick
|
|
26890
|
+
}) => {
|
|
27028
26891
|
const { styles } = useStyles19();
|
|
26892
|
+
const renderEntry = import_react81.default.useCallback((entry, depth) => {
|
|
26893
|
+
const entryName = getEntryName(entry);
|
|
26894
|
+
if (entry.is_dir) {
|
|
26895
|
+
const isExpanded = directoryExpanded[entry.path] || false;
|
|
26896
|
+
const children = directoryChildren[entry.path] || [];
|
|
26897
|
+
const isLoading = directoryLoading[entry.path] || false;
|
|
26898
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: styles.treeChildren, children: [
|
|
26899
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: styles.treeRow, children: [
|
|
26900
|
+
Array.from({ length: depth }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { className: styles.treeIndent }, `${entry.path}-indent-${index}`)),
|
|
26901
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
26902
|
+
"button",
|
|
26903
|
+
{
|
|
26904
|
+
type: "button",
|
|
26905
|
+
className: styles.treeToggle,
|
|
26906
|
+
"aria-label": `${isExpanded ? "collapse" : "expand"} ${entryName}`,
|
|
26907
|
+
onClick: () => void onToggleDirectory(entry.path),
|
|
26908
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_lucide_react26.ChevronRight, { size: 14, style: { transform: isExpanded ? "rotate(90deg)" : void 0 } })
|
|
26909
|
+
}
|
|
26910
|
+
),
|
|
26911
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(
|
|
26912
|
+
"button",
|
|
26913
|
+
{
|
|
26914
|
+
type: "button",
|
|
26915
|
+
className: styles.assetItem,
|
|
26916
|
+
"aria-label": `toggle ${entryName}`,
|
|
26917
|
+
onClick: () => void onToggleDirectory(entry.path),
|
|
26918
|
+
title: entryName,
|
|
26919
|
+
children: [
|
|
26920
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.assetIcon, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_lucide_react26.FolderOpen, { size: 14 }) }),
|
|
26921
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.assetInfo, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.assetName, children: entryName }) })
|
|
26922
|
+
]
|
|
26923
|
+
}
|
|
26924
|
+
)
|
|
26925
|
+
] }),
|
|
26926
|
+
isExpanded ? isLoading ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.loading, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_antd80.Spin, { size: "small" }) }) : children.length > 0 ? children.map((child) => renderEntry(child, depth + 1)) : /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.emptyState, children: "No files in this folder" }) : null
|
|
26927
|
+
] }, entry.path);
|
|
26928
|
+
}
|
|
26929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: styles.treeRow, children: [
|
|
26930
|
+
Array.from({ length: depth }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { className: styles.treeIndent }, `${entry.path}-indent-${index}`)),
|
|
26931
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { className: styles.treeSpacer }),
|
|
26932
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(
|
|
26933
|
+
"button",
|
|
26934
|
+
{
|
|
26935
|
+
type: "button",
|
|
26936
|
+
className: styles.assetItem,
|
|
26937
|
+
onClick: () => onAssetClick(entry),
|
|
26938
|
+
"aria-label": `open ${entryName}`,
|
|
26939
|
+
title: entryName,
|
|
26940
|
+
children: [
|
|
26941
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.assetIcon, children: getFileIcon2(entryName) }),
|
|
26942
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: styles.assetInfo, children: [
|
|
26943
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.assetName, children: entryName }),
|
|
26944
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.assetMeta, children: formatDate5(entry.modified_at) })
|
|
26945
|
+
] })
|
|
26946
|
+
]
|
|
26947
|
+
}
|
|
26948
|
+
)
|
|
26949
|
+
] }, entry.path);
|
|
26950
|
+
}, [directoryChildren, directoryExpanded, directoryLoading, onAssetClick, onToggleDirectory, styles]);
|
|
26951
|
+
if (!projectId) {
|
|
26952
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.emptyState, children: "Please select a project to browse files" });
|
|
26953
|
+
}
|
|
26954
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: styles.container, children: [
|
|
26955
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("h3", { className: styles.header, children: [
|
|
26956
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_lucide_react26.FolderOpen, { size: 16 }),
|
|
26957
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { children: "Files" })
|
|
26958
|
+
] }),
|
|
26959
|
+
resourceFolders.map((folder) => {
|
|
26960
|
+
const entries = folderEntries[folder.name] || [];
|
|
26961
|
+
const isLoading = folderLoading[folder.name] || false;
|
|
26962
|
+
const itemCount = entries.length;
|
|
26963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: styles.section, children: [
|
|
26964
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: styles.sectionHeader, children: [
|
|
26965
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
26966
|
+
"span",
|
|
26967
|
+
{
|
|
26968
|
+
className: styles.sectionTitle,
|
|
26969
|
+
onClick: () => void onRefreshFolder(folder),
|
|
26970
|
+
title: "Click to refresh",
|
|
26971
|
+
children: folder.displayName || folder.name
|
|
26972
|
+
}
|
|
26973
|
+
),
|
|
26974
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { className: styles.badge, children: itemCount })
|
|
26975
|
+
] }),
|
|
26976
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.loading, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_antd80.Spin, { size: "small" }) }) : /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: styles.assetList, children: [
|
|
26977
|
+
entries.map((entry) => renderEntry(entry, 0)),
|
|
26978
|
+
entries.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.emptyState, children: "No files in this folder" }) : null,
|
|
26979
|
+
folder.allowUpload ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
26980
|
+
"button",
|
|
26981
|
+
{
|
|
26982
|
+
type: "button",
|
|
26983
|
+
className: styles.uploadBtn,
|
|
26984
|
+
onClick: () => void onUploadFolder(folder.name),
|
|
26985
|
+
disabled: !workspaceId || !projectId || uploadingFolder === folder.name,
|
|
26986
|
+
children: uploadingFolder === folder.name ? /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(import_jsx_runtime105.Fragment, { children: [
|
|
26987
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_antd80.Spin, { size: "small" }),
|
|
26988
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { children: "Uploading..." })
|
|
26989
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(import_jsx_runtime105.Fragment, { children: [
|
|
26990
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_lucide_react26.Upload, { size: 14 }),
|
|
26991
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { children: "Upload" })
|
|
26992
|
+
] })
|
|
26993
|
+
}
|
|
26994
|
+
) : null
|
|
26995
|
+
] })
|
|
26996
|
+
] }, folder.name);
|
|
26997
|
+
})
|
|
26998
|
+
] });
|
|
26999
|
+
};
|
|
27000
|
+
|
|
27001
|
+
// src/components/Chat/ToolPanelFiles.tsx
|
|
27002
|
+
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
27003
|
+
var ToolPanelFiles = () => {
|
|
27029
27004
|
const { config } = useLatticeChatShellContext();
|
|
27030
27005
|
const { openSideApp } = useChatUIContext();
|
|
27031
27006
|
const {
|
|
27032
27007
|
workspaceId,
|
|
27033
27008
|
projectId,
|
|
27034
|
-
|
|
27035
|
-
setProject,
|
|
27009
|
+
listPath,
|
|
27036
27010
|
listPathByFolder,
|
|
27037
|
-
createProject,
|
|
27038
27011
|
getFileViewUrl,
|
|
27039
27012
|
uploadFileToFolder
|
|
27040
27013
|
} = useWorkspaceContext();
|
|
27041
|
-
const [
|
|
27014
|
+
const [folderEntries, setFolderEntries] = (0, import_react82.useState)({});
|
|
27042
27015
|
const [folderLoading, setFolderLoading] = (0, import_react82.useState)({});
|
|
27043
|
-
const [
|
|
27016
|
+
const [directoryChildren, setDirectoryChildren] = (0, import_react82.useState)({});
|
|
27017
|
+
const [directoryLoading, setDirectoryLoading] = (0, import_react82.useState)({});
|
|
27018
|
+
const [directoryExpanded, setDirectoryExpanded] = (0, import_react82.useState)({});
|
|
27044
27019
|
const [uploadingFolder, setUploadingFolder] = (0, import_react82.useState)(null);
|
|
27045
|
-
const [isModalOpen, setIsModalOpen] = (0, import_react82.useState)(false);
|
|
27046
|
-
const [projectName, setProjectName] = (0, import_react82.useState)("");
|
|
27047
|
-
const [validationError, setValidationError] = (0, import_react82.useState)(null);
|
|
27048
|
-
const [isCreating, setIsCreating] = (0, import_react82.useState)(false);
|
|
27049
|
-
const projectNameInputRef = (0, import_react82.useRef)(null);
|
|
27050
27020
|
const resourceFolders = (0, import_react82.useMemo)(() => {
|
|
27051
27021
|
return config.resourceFolders && config.resourceFolders.length > 0 ? config.resourceFolders : [{ name: "/", displayName: "Project Assets", allowUpload: true }];
|
|
27052
27022
|
}, [config.resourceFolders]);
|
|
27053
|
-
const currentProject = (0, import_react82.useMemo)(() => {
|
|
27054
|
-
return projects.find((p) => p.id === projectId);
|
|
27055
|
-
}, [projects, projectId]);
|
|
27056
27023
|
const loadAssetsForFolder = (0, import_react82.useCallback)(async (folder) => {
|
|
27057
27024
|
if (!workspaceId || !projectId) {
|
|
27058
|
-
|
|
27025
|
+
setFolderEntries((prev) => ({ ...prev, [folder.name]: [] }));
|
|
27059
27026
|
return;
|
|
27060
27027
|
}
|
|
27061
27028
|
setFolderLoading((prev) => ({ ...prev, [folder.name]: true }));
|
|
27062
27029
|
try {
|
|
27063
27030
|
const items = await listPathByFolder(folder.name);
|
|
27064
|
-
|
|
27031
|
+
setFolderEntries((prev) => ({ ...prev, [folder.name]: items }));
|
|
27032
|
+
setDirectoryChildren((prev) => {
|
|
27033
|
+
const next = { ...prev };
|
|
27034
|
+
const folderPath = folder.name === "/" ? "/" : folder.name.replace(/\/$/, "");
|
|
27035
|
+
Object.keys(next).forEach((key) => {
|
|
27036
|
+
if (key === folderPath || key.startsWith(`${folderPath}/`)) {
|
|
27037
|
+
delete next[key];
|
|
27038
|
+
}
|
|
27039
|
+
});
|
|
27040
|
+
return next;
|
|
27041
|
+
});
|
|
27042
|
+
setDirectoryExpanded((prev) => {
|
|
27043
|
+
const next = { ...prev };
|
|
27044
|
+
const folderPath = folder.name === "/" ? "/" : folder.name.replace(/\/$/, "");
|
|
27045
|
+
Object.keys(next).forEach((key) => {
|
|
27046
|
+
if (key === folderPath || key.startsWith(`${folderPath}/`)) {
|
|
27047
|
+
delete next[key];
|
|
27048
|
+
}
|
|
27049
|
+
});
|
|
27050
|
+
return next;
|
|
27051
|
+
});
|
|
27065
27052
|
} catch (error) {
|
|
27066
27053
|
console.error(`Failed to load assets for folder ${folder.name}:`, error);
|
|
27067
|
-
|
|
27054
|
+
setFolderEntries((prev) => ({ ...prev, [folder.name]: [] }));
|
|
27068
27055
|
} finally {
|
|
27069
27056
|
setFolderLoading((prev) => ({ ...prev, [folder.name]: false }));
|
|
27070
27057
|
}
|
|
27071
27058
|
}, [workspaceId, projectId, listPathByFolder]);
|
|
27072
|
-
(0, import_react82.
|
|
27073
|
-
|
|
27074
|
-
|
|
27075
|
-
|
|
27076
|
-
}, [workspaceId, projectId, loadAssetsForFolder, resourceFolders]);
|
|
27077
|
-
const handleSelectProject = (0, import_react82.useCallback)((selectedProjectId) => {
|
|
27078
|
-
setProject(selectedProjectId);
|
|
27079
|
-
setIsProjectListOpen(false);
|
|
27080
|
-
}, [setProject]);
|
|
27081
|
-
const toggleProjectList = (0, import_react82.useCallback)(() => {
|
|
27082
|
-
setIsProjectListOpen((prev) => !prev);
|
|
27083
|
-
}, []);
|
|
27084
|
-
const validateProjectName = (0, import_react82.useCallback)((name) => {
|
|
27085
|
-
const trimmed = name.trim();
|
|
27086
|
-
if (!trimmed) return "Project name is required";
|
|
27087
|
-
if (trimmed.length > PROJECT_NAME_MAX_LENGTH2) {
|
|
27088
|
-
return `Name must be ${PROJECT_NAME_MAX_LENGTH2} characters or less`;
|
|
27089
|
-
}
|
|
27090
|
-
return null;
|
|
27091
|
-
}, []);
|
|
27092
|
-
const handleOpenModal = (0, import_react82.useCallback)(() => {
|
|
27093
|
-
if (!workspaceId) {
|
|
27094
|
-
import_antd81.message.warning("Please select a workspace first");
|
|
27059
|
+
const handleToggleDirectory = (0, import_react82.useCallback)(async (path) => {
|
|
27060
|
+
const isExpanded = directoryExpanded[path] || false;
|
|
27061
|
+
if (isExpanded) {
|
|
27062
|
+
setDirectoryExpanded((prev) => ({ ...prev, [path]: false }));
|
|
27095
27063
|
return;
|
|
27096
27064
|
}
|
|
27097
|
-
|
|
27098
|
-
|
|
27099
|
-
setIsModalOpen(true);
|
|
27100
|
-
setTimeout(() => projectNameInputRef.current?.input?.focus(), 100);
|
|
27101
|
-
}, [workspaceId]);
|
|
27102
|
-
const handleCloseModal = (0, import_react82.useCallback)(() => {
|
|
27103
|
-
setIsModalOpen(false);
|
|
27104
|
-
setProjectName("");
|
|
27105
|
-
setValidationError(null);
|
|
27106
|
-
}, []);
|
|
27107
|
-
const handleProjectNameChange = (e) => {
|
|
27108
|
-
const value = e.target.value;
|
|
27109
|
-
setProjectName(value);
|
|
27110
|
-
setValidationError(validateProjectName(value));
|
|
27111
|
-
};
|
|
27112
|
-
const handleCreateProject = (0, import_react82.useCallback)(async () => {
|
|
27113
|
-
if (!workspaceId) return;
|
|
27114
|
-
const trimmed = projectName.trim();
|
|
27115
|
-
const error = validateProjectName(trimmed);
|
|
27116
|
-
if (error) {
|
|
27117
|
-
setValidationError(error);
|
|
27065
|
+
setDirectoryExpanded((prev) => ({ ...prev, [path]: true }));
|
|
27066
|
+
if (directoryChildren[path]) {
|
|
27118
27067
|
return;
|
|
27119
27068
|
}
|
|
27120
|
-
|
|
27121
|
-
setValidationError(null);
|
|
27069
|
+
setDirectoryLoading((prev) => ({ ...prev, [path]: true }));
|
|
27122
27070
|
try {
|
|
27123
|
-
const
|
|
27124
|
-
|
|
27125
|
-
|
|
27126
|
-
|
|
27127
|
-
|
|
27128
|
-
import_antd81.message.success(`Project "${project.name}" created`);
|
|
27129
|
-
} catch (err) {
|
|
27130
|
-
const errMsg = err instanceof Error ? err.message : "Failed to create project";
|
|
27131
|
-
setValidationError(errMsg);
|
|
27071
|
+
const items = await listPath(path);
|
|
27072
|
+
setDirectoryChildren((prev) => ({ ...prev, [path]: items }));
|
|
27073
|
+
} catch (error) {
|
|
27074
|
+
console.error(`Failed to load directory ${path}:`, error);
|
|
27075
|
+
setDirectoryChildren((prev) => ({ ...prev, [path]: [] }));
|
|
27132
27076
|
} finally {
|
|
27133
|
-
|
|
27077
|
+
setDirectoryLoading((prev) => ({ ...prev, [path]: false }));
|
|
27134
27078
|
}
|
|
27135
|
-
}, [
|
|
27136
|
-
|
|
27137
|
-
|
|
27138
|
-
|
|
27139
|
-
|
|
27140
|
-
|
|
27079
|
+
}, [directoryChildren, directoryExpanded, listPath]);
|
|
27080
|
+
(0, import_react82.useEffect)(() => {
|
|
27081
|
+
resourceFolders.forEach((folder) => {
|
|
27082
|
+
void loadAssetsForFolder(folder);
|
|
27083
|
+
});
|
|
27084
|
+
}, [resourceFolders, loadAssetsForFolder]);
|
|
27085
|
+
const handleAssetClick = (0, import_react82.useCallback)((asset) => {
|
|
27086
|
+
const fileUrl = getFileViewUrl(asset.path);
|
|
27087
|
+
if (!fileUrl) {
|
|
27088
|
+
import_antd81.message.warning("Please select a workspace and project first.");
|
|
27089
|
+
return;
|
|
27141
27090
|
}
|
|
27142
|
-
|
|
27143
|
-
|
|
27144
|
-
|
|
27091
|
+
openSideApp({
|
|
27092
|
+
component_key: "attachments",
|
|
27093
|
+
data: {
|
|
27094
|
+
file_id: asset.path,
|
|
27095
|
+
message: `Preview: ${asset.name || asset.path}`,
|
|
27096
|
+
full_url: fileUrl
|
|
27097
|
+
},
|
|
27098
|
+
message: `Preview: ${asset.name || asset.path}`
|
|
27099
|
+
});
|
|
27100
|
+
}, [getFileViewUrl, openSideApp]);
|
|
27101
|
+
const handleUploadFolder = (0, import_react82.useCallback)(async (folderName) => {
|
|
27145
27102
|
if (!workspaceId || !projectId) {
|
|
27146
27103
|
import_antd81.message.warning("Please select a workspace and project before uploading.");
|
|
27147
27104
|
return;
|
|
@@ -27158,7 +27115,7 @@ var ProjectsMenuContent = () => {
|
|
|
27158
27115
|
try {
|
|
27159
27116
|
await uploadFileToFolder(folderName, file);
|
|
27160
27117
|
import_antd81.message.success(`Uploaded "${file.name}" successfully`);
|
|
27161
|
-
const folder = resourceFolders.find((
|
|
27118
|
+
const folder = resourceFolders.find((item) => item.name === folderName);
|
|
27162
27119
|
if (folder) {
|
|
27163
27120
|
await loadAssetsForFolder(folder);
|
|
27164
27121
|
}
|
|
@@ -27171,143 +27128,226 @@ var ProjectsMenuContent = () => {
|
|
|
27171
27128
|
}
|
|
27172
27129
|
};
|
|
27173
27130
|
input.click();
|
|
27174
|
-
};
|
|
27175
|
-
|
|
27176
|
-
|
|
27177
|
-
|
|
27178
|
-
|
|
27179
|
-
|
|
27131
|
+
}, [workspaceId, projectId, uploadFileToFolder, resourceFolders, loadAssetsForFolder]);
|
|
27132
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
27133
|
+
FileDirectoryPanel,
|
|
27134
|
+
{
|
|
27135
|
+
workspaceId,
|
|
27136
|
+
projectId,
|
|
27137
|
+
resourceFolders,
|
|
27138
|
+
folderEntries,
|
|
27139
|
+
folderLoading,
|
|
27140
|
+
directoryChildren,
|
|
27141
|
+
directoryLoading,
|
|
27142
|
+
directoryExpanded,
|
|
27143
|
+
uploadingFolder,
|
|
27144
|
+
onRefreshFolder: loadAssetsForFolder,
|
|
27145
|
+
onUploadFolder: handleUploadFolder,
|
|
27146
|
+
onToggleDirectory: handleToggleDirectory,
|
|
27147
|
+
onAssetClick: handleAssetClick
|
|
27180
27148
|
}
|
|
27181
|
-
|
|
27182
|
-
|
|
27183
|
-
|
|
27184
|
-
|
|
27185
|
-
|
|
27186
|
-
|
|
27187
|
-
|
|
27188
|
-
|
|
27189
|
-
|
|
27190
|
-
|
|
27191
|
-
|
|
27192
|
-
|
|
27193
|
-
|
|
27194
|
-
|
|
27195
|
-
|
|
27196
|
-
|
|
27197
|
-
|
|
27198
|
-
|
|
27199
|
-
|
|
27200
|
-
|
|
27201
|
-
|
|
27202
|
-
|
|
27203
|
-
|
|
27204
|
-
|
|
27205
|
-
|
|
27206
|
-
|
|
27207
|
-
|
|
27208
|
-
|
|
27209
|
-
|
|
27210
|
-
|
|
27211
|
-
|
|
27212
|
-
|
|
27213
|
-
|
|
27214
|
-
|
|
27215
|
-
|
|
27216
|
-
|
|
27217
|
-
|
|
27218
|
-
|
|
27219
|
-
|
|
27220
|
-
|
|
27221
|
-
|
|
27222
|
-
|
|
27223
|
-
|
|
27224
|
-
|
|
27225
|
-
|
|
27226
|
-
|
|
27227
|
-
|
|
27228
|
-
|
|
27229
|
-
|
|
27230
|
-
|
|
27231
|
-
|
|
27232
|
-
|
|
27233
|
-
|
|
27234
|
-
|
|
27235
|
-
|
|
27236
|
-
|
|
27237
|
-
|
|
27238
|
-
|
|
27239
|
-
|
|
27240
|
-
|
|
27241
|
-
|
|
27242
|
-
|
|
27243
|
-
|
|
27244
|
-
|
|
27245
|
-
|
|
27246
|
-
|
|
27247
|
-
|
|
27248
|
-
|
|
27249
|
-
|
|
27250
|
-
|
|
27251
|
-
|
|
27252
|
-
|
|
27253
|
-
|
|
27254
|
-
|
|
27255
|
-
|
|
27256
|
-
|
|
27257
|
-
|
|
27258
|
-
|
|
27259
|
-
|
|
27260
|
-
|
|
27261
|
-
|
|
27262
|
-
|
|
27263
|
-
|
|
27264
|
-
|
|
27265
|
-
|
|
27266
|
-
|
|
27267
|
-
|
|
27268
|
-
|
|
27269
|
-
|
|
27270
|
-
|
|
27271
|
-
|
|
27272
|
-
|
|
27273
|
-
|
|
27274
|
-
|
|
27275
|
-
|
|
27276
|
-
|
|
27277
|
-
|
|
27278
|
-
|
|
27279
|
-
|
|
27280
|
-
|
|
27281
|
-
|
|
27282
|
-
|
|
27283
|
-
|
|
27284
|
-
|
|
27285
|
-
|
|
27286
|
-
|
|
27287
|
-
|
|
27288
|
-
|
|
27289
|
-
|
|
27290
|
-
onChange: handleProjectNameChange,
|
|
27291
|
-
onKeyDown: handleModalKeyDown,
|
|
27292
|
-
maxLength: PROJECT_NAME_MAX_LENGTH2,
|
|
27293
|
-
status: validationError ? "error" : void 0,
|
|
27294
|
-
disabled: isCreating
|
|
27295
|
-
}
|
|
27296
|
-
),
|
|
27297
|
-
validationError && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: styles.formError, role: "alert", children: validationError })
|
|
27298
|
-
]
|
|
27149
|
+
);
|
|
27150
|
+
};
|
|
27151
|
+
|
|
27152
|
+
// src/components/Chat/HeaderIconButton.tsx
|
|
27153
|
+
var import_antd82 = require("antd");
|
|
27154
|
+
var import_antd_style33 = require("antd-style");
|
|
27155
|
+
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
27156
|
+
var useStyles20 = (0, import_antd_style33.createStyles)(({ token, css }) => ({
|
|
27157
|
+
button: css`
|
|
27158
|
+
display: inline-flex;
|
|
27159
|
+
align-items: center;
|
|
27160
|
+
justify-content: center;
|
|
27161
|
+
width: 32px;
|
|
27162
|
+
height: 32px;
|
|
27163
|
+
border-radius: 8px;
|
|
27164
|
+
border: 1px solid transparent;
|
|
27165
|
+
background: transparent;
|
|
27166
|
+
color: inherit;
|
|
27167
|
+
transition: all 0.2s ease;
|
|
27168
|
+
|
|
27169
|
+
&:hover {
|
|
27170
|
+
background: ${token.colorBgTextHover};
|
|
27171
|
+
border-color: ${token.colorBorderSecondary};
|
|
27172
|
+
}
|
|
27173
|
+
|
|
27174
|
+
&[aria-pressed="true"] {
|
|
27175
|
+
background: ${token.colorBgTextHover};
|
|
27176
|
+
border-color: ${token.colorBorderSecondary};
|
|
27177
|
+
}
|
|
27178
|
+
`
|
|
27179
|
+
}));
|
|
27180
|
+
var HeaderIconButton = ({
|
|
27181
|
+
ariaLabel,
|
|
27182
|
+
icon,
|
|
27183
|
+
onClick,
|
|
27184
|
+
pressed = false
|
|
27185
|
+
}) => {
|
|
27186
|
+
const { styles } = useStyles20();
|
|
27187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
27188
|
+
import_antd82.Button,
|
|
27189
|
+
{
|
|
27190
|
+
type: "text",
|
|
27191
|
+
size: "small",
|
|
27192
|
+
className: styles.button,
|
|
27193
|
+
icon,
|
|
27194
|
+
onClick,
|
|
27195
|
+
"aria-label": ariaLabel,
|
|
27196
|
+
"aria-pressed": pressed
|
|
27197
|
+
}
|
|
27198
|
+
);
|
|
27199
|
+
};
|
|
27200
|
+
|
|
27201
|
+
// src/components/Chat/LatticeChat.tsx
|
|
27202
|
+
var import_jsx_runtime108 = require("react/jsx-runtime");
|
|
27203
|
+
var useStyles21 = (0, import_antd_style34.createStyles)(({ css }) => ({
|
|
27204
|
+
wrapper: css`
|
|
27205
|
+
display: flex;
|
|
27206
|
+
flex-direction: column;
|
|
27207
|
+
width: 100%;
|
|
27208
|
+
height: 100%;
|
|
27209
|
+
`,
|
|
27210
|
+
headerBar: css`
|
|
27211
|
+
display: flex;
|
|
27212
|
+
align-items: center;
|
|
27213
|
+
justify-content: space-between;
|
|
27214
|
+
gap: 12px;
|
|
27215
|
+
width: 100%;
|
|
27216
|
+
`,
|
|
27217
|
+
headerLeft: css`
|
|
27218
|
+
display: flex;
|
|
27219
|
+
align-items: center;
|
|
27220
|
+
min-width: 0;
|
|
27221
|
+
flex: 1;
|
|
27222
|
+
`,
|
|
27223
|
+
headerRight: css`
|
|
27224
|
+
display: flex;
|
|
27225
|
+
align-items: center;
|
|
27226
|
+
justify-content: flex-end;
|
|
27227
|
+
flex-shrink: 0;
|
|
27228
|
+
`
|
|
27229
|
+
}));
|
|
27230
|
+
var LatticeChatContent = (props) => {
|
|
27231
|
+
const { assistant_id: _assistantId, thread_id = "", menu, header, ...chatingProps } = props;
|
|
27232
|
+
const { config } = useLatticeChatShellContext();
|
|
27233
|
+
const { styles } = useStyles21();
|
|
27234
|
+
const { toolsVisible, toggleTools } = useChatUIContext();
|
|
27235
|
+
const showWorkspaceSelector = config.enableWorkspace;
|
|
27236
|
+
const layoutHeader = /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: styles.headerBar, children: [
|
|
27237
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: styles.headerLeft, children: showWorkspaceSelector ? /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(ProjectSelector, {}) : null }),
|
|
27238
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: styles.headerRight, children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
27239
|
+
HeaderIconButton,
|
|
27240
|
+
{
|
|
27241
|
+
ariaLabel: "Toggle file directory",
|
|
27242
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_lucide_react27.FolderOpen, { size: 16 }),
|
|
27243
|
+
onClick: toggleTools,
|
|
27244
|
+
pressed: toolsVisible
|
|
27245
|
+
}
|
|
27246
|
+
) })
|
|
27247
|
+
] });
|
|
27248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: styles.wrapper, children: [
|
|
27249
|
+
header,
|
|
27250
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
27251
|
+
ColumnLayout,
|
|
27252
|
+
{
|
|
27253
|
+
menu,
|
|
27254
|
+
header: layoutHeader,
|
|
27255
|
+
main: thread_id ? /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(Chating, { ...chatingProps }) : /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { children: "Please create a conversation first" }),
|
|
27256
|
+
detail: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(SideAppViewBrowser, {}),
|
|
27257
|
+
tools: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(ToolPanelFiles, {})
|
|
27299
27258
|
}
|
|
27300
27259
|
)
|
|
27301
27260
|
] });
|
|
27302
27261
|
};
|
|
27262
|
+
var LatticeChat = (props) => {
|
|
27263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
27264
|
+
AgentThreadProvider,
|
|
27265
|
+
{
|
|
27266
|
+
assistantId: props.assistant_id,
|
|
27267
|
+
threadId: props.thread_id || "",
|
|
27268
|
+
options: {
|
|
27269
|
+
streaming: true,
|
|
27270
|
+
enableReturnStateWhenStreamCompleted: true,
|
|
27271
|
+
enableResumeStream: true
|
|
27272
|
+
},
|
|
27273
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(ChatUIContextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(LatticeChatContent, { ...props }) })
|
|
27274
|
+
}
|
|
27275
|
+
);
|
|
27276
|
+
};
|
|
27277
|
+
|
|
27278
|
+
// src/components/Chat/AgentConversations.tsx
|
|
27279
|
+
var import_x7 = require("@ant-design/x");
|
|
27280
|
+
var import_antd83 = require("antd");
|
|
27281
|
+
var import_react83 = require("react");
|
|
27282
|
+
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
27283
|
+
var AgentConversations = ({
|
|
27284
|
+
enableThreadCreation = true,
|
|
27285
|
+
enableThreadList = true
|
|
27286
|
+
}) => {
|
|
27287
|
+
const { token } = import_antd83.theme.useToken();
|
|
27288
|
+
const { currentAssistant } = useAssistantContext();
|
|
27289
|
+
const {
|
|
27290
|
+
assistantId,
|
|
27291
|
+
thread,
|
|
27292
|
+
selectThread,
|
|
27293
|
+
createThread,
|
|
27294
|
+
listThreads,
|
|
27295
|
+
threads
|
|
27296
|
+
} = useConversationContext();
|
|
27297
|
+
const style = {
|
|
27298
|
+
width: "100%",
|
|
27299
|
+
background: "transparent",
|
|
27300
|
+
borderRadius: token.borderRadius
|
|
27301
|
+
};
|
|
27302
|
+
const threadItems = (0, import_react83.useMemo)(() => {
|
|
27303
|
+
return threads || [];
|
|
27304
|
+
}, [threads]);
|
|
27305
|
+
const items = threadItems.map((thread2) => ({
|
|
27306
|
+
key: thread2.id,
|
|
27307
|
+
label: thread2.label
|
|
27308
|
+
}));
|
|
27309
|
+
const newChatClick = async () => {
|
|
27310
|
+
if (!assistantId) {
|
|
27311
|
+
return;
|
|
27312
|
+
}
|
|
27313
|
+
await createThread();
|
|
27314
|
+
};
|
|
27315
|
+
if (!enableThreadList) {
|
|
27316
|
+
return null;
|
|
27317
|
+
}
|
|
27318
|
+
const creation = enableThreadCreation ? {
|
|
27319
|
+
onClick: newChatClick
|
|
27320
|
+
} : void 0;
|
|
27321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
27322
|
+
import_x7.Conversations,
|
|
27323
|
+
{
|
|
27324
|
+
creation,
|
|
27325
|
+
items,
|
|
27326
|
+
activeKey: thread?.id,
|
|
27327
|
+
style,
|
|
27328
|
+
groupable: true,
|
|
27329
|
+
onActiveChange: (key) => {
|
|
27330
|
+
selectThread(key);
|
|
27331
|
+
}
|
|
27332
|
+
}
|
|
27333
|
+
);
|
|
27334
|
+
};
|
|
27335
|
+
|
|
27336
|
+
// src/components/Chat/LatticeChatView.tsx
|
|
27337
|
+
var import_react86 = require("react");
|
|
27338
|
+
|
|
27339
|
+
// src/components/Chat/ChatSidebar.tsx
|
|
27340
|
+
var import_react85 = require("react");
|
|
27341
|
+
var import_antd85 = require("antd");
|
|
27342
|
+
var import_lucide_react29 = require("lucide-react");
|
|
27303
27343
|
|
|
27304
27344
|
// src/components/Chat/ThreadHistoryMenuContent.tsx
|
|
27305
|
-
var
|
|
27306
|
-
var
|
|
27307
|
-
var
|
|
27308
|
-
var
|
|
27309
|
-
var
|
|
27310
|
-
var
|
|
27345
|
+
var import_react84 = __toESM(require("react"));
|
|
27346
|
+
var import_antd_style35 = require("antd-style");
|
|
27347
|
+
var import_lucide_react28 = require("lucide-react");
|
|
27348
|
+
var import_antd84 = require("antd");
|
|
27349
|
+
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
27350
|
+
var useStyles22 = (0, import_antd_style35.createStyles)(({ token, css }) => ({
|
|
27311
27351
|
container: css`
|
|
27312
27352
|
padding: 4px;
|
|
27313
27353
|
font-size: 13px;
|
|
@@ -27408,7 +27448,7 @@ var useStyles20 = (0, import_antd_style33.createStyles)(({ token, css }) => ({
|
|
|
27408
27448
|
`
|
|
27409
27449
|
}));
|
|
27410
27450
|
var ThreadHistoryMenuContent = () => {
|
|
27411
|
-
const { styles } =
|
|
27451
|
+
const { styles } = useStyles22();
|
|
27412
27452
|
const {
|
|
27413
27453
|
threads,
|
|
27414
27454
|
threadId,
|
|
@@ -27416,10 +27456,10 @@ var ThreadHistoryMenuContent = () => {
|
|
|
27416
27456
|
deleteThread,
|
|
27417
27457
|
isLoading
|
|
27418
27458
|
} = useConversationContext();
|
|
27419
|
-
const handleDeleteThread = (0,
|
|
27459
|
+
const handleDeleteThread = (0, import_react84.useCallback)(
|
|
27420
27460
|
async (e, threadIdToDelete) => {
|
|
27421
27461
|
e.stopPropagation();
|
|
27422
|
-
|
|
27462
|
+
import_antd84.Modal.confirm({
|
|
27423
27463
|
title: "Delete Conversation",
|
|
27424
27464
|
content: "Are you sure you want to delete this conversation? This action cannot be undone.",
|
|
27425
27465
|
okText: "Delete",
|
|
@@ -27428,16 +27468,16 @@ var ThreadHistoryMenuContent = () => {
|
|
|
27428
27468
|
onOk: async () => {
|
|
27429
27469
|
try {
|
|
27430
27470
|
await deleteThread(threadIdToDelete);
|
|
27431
|
-
|
|
27471
|
+
import_antd84.message.success("Conversation deleted");
|
|
27432
27472
|
} catch (error) {
|
|
27433
|
-
|
|
27473
|
+
import_antd84.message.error("Failed to delete conversation");
|
|
27434
27474
|
}
|
|
27435
27475
|
}
|
|
27436
27476
|
});
|
|
27437
27477
|
},
|
|
27438
27478
|
[deleteThread]
|
|
27439
27479
|
);
|
|
27440
|
-
const sortedThreads =
|
|
27480
|
+
const sortedThreads = import_react84.default.useMemo(() => {
|
|
27441
27481
|
return [...threads].sort((a, b) => {
|
|
27442
27482
|
const dateA = a.updatedAt ? new Date(a.updatedAt).getTime() : 0;
|
|
27443
27483
|
const dateB = b.updatedAt ? new Date(b.updatedAt).getTime() : 0;
|
|
@@ -27445,30 +27485,30 @@ var ThreadHistoryMenuContent = () => {
|
|
|
27445
27485
|
});
|
|
27446
27486
|
}, [threads]);
|
|
27447
27487
|
if (isLoading) {
|
|
27448
|
-
return /* @__PURE__ */ (0,
|
|
27488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { className: styles.container, children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { className: styles.loading, children: "Loading conversations..." }) });
|
|
27449
27489
|
}
|
|
27450
|
-
return /* @__PURE__ */ (0,
|
|
27490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { className: styles.container, children: sortedThreads.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { className: styles.emptyState, children: "No conversations yet" }) : /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { className: styles.threadList, children: sortedThreads.map((thread) => /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(
|
|
27451
27491
|
"div",
|
|
27452
27492
|
{
|
|
27453
27493
|
className: `${styles.threadItem} ${thread.id === threadId ? "active" : ""}`,
|
|
27454
27494
|
onClick: () => selectThread(thread.id),
|
|
27455
27495
|
title: thread.label,
|
|
27456
27496
|
children: [
|
|
27457
|
-
/* @__PURE__ */ (0,
|
|
27458
|
-
/* @__PURE__ */ (0,
|
|
27497
|
+
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { className: styles.threadIcon, children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_lucide_react28.MessageSquare, { size: 14 }) }),
|
|
27498
|
+
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
|
|
27459
27499
|
"div",
|
|
27460
27500
|
{
|
|
27461
27501
|
className: thread.id === threadId ? styles.threadNameActive : styles.threadName,
|
|
27462
27502
|
children: thread.label
|
|
27463
27503
|
}
|
|
27464
27504
|
),
|
|
27465
|
-
/* @__PURE__ */ (0,
|
|
27505
|
+
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
|
|
27466
27506
|
"button",
|
|
27467
27507
|
{
|
|
27468
27508
|
className: styles.deleteBtn,
|
|
27469
27509
|
onClick: (e) => handleDeleteThread(e, thread.id),
|
|
27470
27510
|
title: "Delete conversation",
|
|
27471
|
-
children: /* @__PURE__ */ (0,
|
|
27511
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_lucide_react28.Trash2, { size: 12 })
|
|
27472
27512
|
}
|
|
27473
27513
|
)
|
|
27474
27514
|
]
|
|
@@ -27478,7 +27518,7 @@ var ThreadHistoryMenuContent = () => {
|
|
|
27478
27518
|
};
|
|
27479
27519
|
|
|
27480
27520
|
// src/components/Chat/ChatSidebar.tsx
|
|
27481
|
-
var
|
|
27521
|
+
var import_jsx_runtime111 = require("react/jsx-runtime");
|
|
27482
27522
|
var DRAWER_STYLES2 = {
|
|
27483
27523
|
wrapper: {
|
|
27484
27524
|
background: "transparent",
|
|
@@ -27504,7 +27544,7 @@ var DEFAULT_MENU_ITEMS = [
|
|
|
27504
27544
|
builtin: "new-analysis",
|
|
27505
27545
|
type: "action",
|
|
27506
27546
|
name: "New Analysis",
|
|
27507
|
-
icon: /* @__PURE__ */ (0,
|
|
27547
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_lucide_react29.PlusCircle, { size: 20 }),
|
|
27508
27548
|
order: 0
|
|
27509
27549
|
},
|
|
27510
27550
|
// Second: Thread History (inline drawer)
|
|
@@ -27513,28 +27553,15 @@ var DEFAULT_MENU_ITEMS = [
|
|
|
27513
27553
|
builtin: "thread-history",
|
|
27514
27554
|
type: "drawer",
|
|
27515
27555
|
name: "History",
|
|
27516
|
-
icon: /* @__PURE__ */ (0,
|
|
27556
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_lucide_react29.History, { size: 20 }),
|
|
27517
27557
|
order: 1,
|
|
27518
27558
|
title: "Conversation History",
|
|
27519
27559
|
width: 320,
|
|
27520
27560
|
inline: true,
|
|
27521
|
-
inlineDefaultExpanded: false,
|
|
27522
|
-
content: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(ThreadHistoryMenuContent, {})
|
|
27523
|
-
},
|
|
27524
|
-
// Third: Projects (inline drawer)
|
|
27525
|
-
{
|
|
27526
|
-
id: "files",
|
|
27527
|
-
builtin: "projects",
|
|
27528
|
-
type: "drawer",
|
|
27529
|
-
name: "Project Files",
|
|
27530
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_lucide_react28.FolderOpen, {}),
|
|
27531
|
-
order: 2,
|
|
27532
|
-
title: "Project Files",
|
|
27533
|
-
width: 320,
|
|
27534
|
-
inline: true,
|
|
27535
27561
|
inlineDefaultExpanded: true,
|
|
27536
|
-
content: /* @__PURE__ */ (0,
|
|
27562
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(ThreadHistoryMenuContent, {})
|
|
27537
27563
|
}
|
|
27564
|
+
// Project Files removed - now accessed via header toggle
|
|
27538
27565
|
];
|
|
27539
27566
|
var ChatSidebar = ({
|
|
27540
27567
|
onSettingsClick,
|
|
@@ -27545,8 +27572,8 @@ var ChatSidebar = ({
|
|
|
27545
27572
|
const { sideAppVisible, menuCollapsed, setMenuCollapsed } = useChatUIContext();
|
|
27546
27573
|
const { user, logout } = useAuth();
|
|
27547
27574
|
const { createThread } = useConversationContext();
|
|
27548
|
-
const [drawerStates, setDrawerStates] = (0,
|
|
27549
|
-
const [changePasswordOpen, setChangePasswordOpen] = (0,
|
|
27575
|
+
const [drawerStates, setDrawerStates] = (0, import_react85.useState)({});
|
|
27576
|
+
const [changePasswordOpen, setChangePasswordOpen] = (0, import_react85.useState)(false);
|
|
27550
27577
|
const {
|
|
27551
27578
|
sidebarMode,
|
|
27552
27579
|
sidebarShowToggle,
|
|
@@ -27555,14 +27582,14 @@ var ChatSidebar = ({
|
|
|
27555
27582
|
sidebarLogoIcon
|
|
27556
27583
|
} = config;
|
|
27557
27584
|
const isExpandedMode = sidebarMode === "expanded";
|
|
27558
|
-
const menuItems = (0,
|
|
27585
|
+
const menuItems = (0, import_react85.useMemo)(() => {
|
|
27559
27586
|
const items = [...DEFAULT_MENU_ITEMS];
|
|
27560
27587
|
for (const item of customMenuItems) {
|
|
27561
27588
|
items.push(item);
|
|
27562
27589
|
}
|
|
27563
27590
|
return items.sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
|
|
27564
27591
|
}, [customMenuItems]);
|
|
27565
|
-
const handleMenuClick = (0,
|
|
27592
|
+
const handleMenuClick = (0, import_react85.useCallback)(async (item) => {
|
|
27566
27593
|
if (item.builtin === "settings") {
|
|
27567
27594
|
setSettingsModalOpen(true);
|
|
27568
27595
|
onSettingsClick?.();
|
|
@@ -27585,46 +27612,44 @@ var ChatSidebar = ({
|
|
|
27585
27612
|
}
|
|
27586
27613
|
}
|
|
27587
27614
|
}, [onSettingsClick, setSettingsModalOpen, createThread, logout]);
|
|
27588
|
-
const handleCloseDrawer = (0,
|
|
27615
|
+
const handleCloseDrawer = (0, import_react85.useCallback)((itemId) => {
|
|
27589
27616
|
setDrawerStates((prev) => ({ ...prev, [itemId]: false }));
|
|
27590
27617
|
}, []);
|
|
27591
|
-
const handleNewAnalysis = (0,
|
|
27618
|
+
const handleNewAnalysis = (0, import_react85.useCallback)(async () => {
|
|
27592
27619
|
try {
|
|
27593
27620
|
await createThread("New Analysis");
|
|
27594
27621
|
} catch (error) {
|
|
27595
27622
|
console.error("Failed to create new thread:", error);
|
|
27596
27623
|
}
|
|
27597
27624
|
}, [createThread]);
|
|
27598
|
-
const renderDrawerContent = (0,
|
|
27625
|
+
const renderDrawerContent = (0, import_react85.useCallback)((item) => {
|
|
27599
27626
|
switch (item.builtin) {
|
|
27600
|
-
case "projects":
|
|
27601
|
-
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(ProjectsMenuContent, {});
|
|
27602
27627
|
case "thread-history":
|
|
27603
|
-
return /* @__PURE__ */ (0,
|
|
27628
|
+
return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(ThreadHistoryMenuContent, {});
|
|
27604
27629
|
default:
|
|
27605
27630
|
return item.content;
|
|
27606
27631
|
}
|
|
27607
27632
|
}, []);
|
|
27608
|
-
const userMenuItems = /* @__PURE__ */ (0,
|
|
27609
|
-
/* @__PURE__ */ (0,
|
|
27610
|
-
/* @__PURE__ */ (0,
|
|
27611
|
-
/* @__PURE__ */ (0,
|
|
27633
|
+
const userMenuItems = /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { style: { minWidth: 160 }, children: [
|
|
27634
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { style: { padding: "8px 12px", borderBottom: "1px solid #f0f0f0" }, children: [
|
|
27635
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)("div", { style: { fontWeight: 500 }, children: user?.name || user?.email }),
|
|
27636
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)("div", { style: { fontSize: 12, color: "#666" }, children: user?.email })
|
|
27612
27637
|
] }),
|
|
27613
|
-
/* @__PURE__ */ (0,
|
|
27614
|
-
|
|
27638
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(
|
|
27639
|
+
import_antd85.Button,
|
|
27615
27640
|
{
|
|
27616
27641
|
type: "text",
|
|
27617
27642
|
block: true,
|
|
27618
27643
|
style: { justifyContent: "flex-start", padding: "8px 12px" },
|
|
27619
27644
|
onClick: () => setChangePasswordOpen(true),
|
|
27620
27645
|
children: [
|
|
27621
|
-
/* @__PURE__ */ (0,
|
|
27646
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_lucide_react29.Key, { size: 16, style: { marginRight: 8 } }),
|
|
27622
27647
|
"Change Password"
|
|
27623
27648
|
]
|
|
27624
27649
|
}
|
|
27625
27650
|
),
|
|
27626
|
-
/* @__PURE__ */ (0,
|
|
27627
|
-
|
|
27651
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(
|
|
27652
|
+
import_antd85.Button,
|
|
27628
27653
|
{
|
|
27629
27654
|
type: "text",
|
|
27630
27655
|
block: true,
|
|
@@ -27632,14 +27657,14 @@ var ChatSidebar = ({
|
|
|
27632
27657
|
style: { justifyContent: "flex-start", padding: "8px 12px" },
|
|
27633
27658
|
onClick: logout,
|
|
27634
27659
|
children: [
|
|
27635
|
-
/* @__PURE__ */ (0,
|
|
27660
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_lucide_react29.LogOut, { size: 16, style: { marginRight: 8 } }),
|
|
27636
27661
|
"Logout"
|
|
27637
27662
|
]
|
|
27638
27663
|
}
|
|
27639
27664
|
)
|
|
27640
27665
|
] });
|
|
27641
|
-
return /* @__PURE__ */ (0,
|
|
27642
|
-
/* @__PURE__ */ (0,
|
|
27666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(import_jsx_runtime111.Fragment, { children: [
|
|
27667
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
27643
27668
|
Menu,
|
|
27644
27669
|
{
|
|
27645
27670
|
items: menuItems,
|
|
@@ -27653,13 +27678,13 @@ var ChatSidebar = ({
|
|
|
27653
27678
|
forceIconMode: sideAppVisible,
|
|
27654
27679
|
collapsed: menuCollapsed,
|
|
27655
27680
|
onCollapsedChange: setMenuCollapsed,
|
|
27656
|
-
footer: ({ isIconMode }) => user && /* @__PURE__ */ (0,
|
|
27657
|
-
|
|
27681
|
+
footer: ({ isIconMode }) => user && /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
27682
|
+
import_antd85.Popover,
|
|
27658
27683
|
{
|
|
27659
27684
|
content: userMenuItems,
|
|
27660
27685
|
placement: "rightTop",
|
|
27661
27686
|
trigger: "click",
|
|
27662
|
-
children: /* @__PURE__ */ (0,
|
|
27687
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(
|
|
27663
27688
|
"div",
|
|
27664
27689
|
{
|
|
27665
27690
|
style: {
|
|
@@ -27673,8 +27698,8 @@ var ChatSidebar = ({
|
|
|
27673
27698
|
transition: "all 0.2s"
|
|
27674
27699
|
},
|
|
27675
27700
|
children: [
|
|
27676
|
-
/* @__PURE__ */ (0,
|
|
27677
|
-
|
|
27701
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
27702
|
+
import_antd85.Avatar,
|
|
27678
27703
|
{
|
|
27679
27704
|
size: isIconMode ? 32 : 36,
|
|
27680
27705
|
style: {
|
|
@@ -27685,8 +27710,8 @@ var ChatSidebar = ({
|
|
|
27685
27710
|
children: (user.name?.charAt(0) || user.email.charAt(0)).toUpperCase()
|
|
27686
27711
|
}
|
|
27687
27712
|
),
|
|
27688
|
-
!isIconMode && /* @__PURE__ */ (0,
|
|
27689
|
-
/* @__PURE__ */ (0,
|
|
27713
|
+
!isIconMode && /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
27714
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
27690
27715
|
"div",
|
|
27691
27716
|
{
|
|
27692
27717
|
style: {
|
|
@@ -27698,7 +27723,7 @@ var ChatSidebar = ({
|
|
|
27698
27723
|
children: user.name || user.email
|
|
27699
27724
|
}
|
|
27700
27725
|
),
|
|
27701
|
-
/* @__PURE__ */ (0,
|
|
27726
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
27702
27727
|
"div",
|
|
27703
27728
|
{
|
|
27704
27729
|
style: {
|
|
@@ -27719,19 +27744,19 @@ var ChatSidebar = ({
|
|
|
27719
27744
|
)
|
|
27720
27745
|
}
|
|
27721
27746
|
),
|
|
27722
|
-
/* @__PURE__ */ (0,
|
|
27747
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
27723
27748
|
ChangePasswordModal,
|
|
27724
27749
|
{
|
|
27725
27750
|
open: changePasswordOpen,
|
|
27726
27751
|
onClose: () => setChangePasswordOpen(false)
|
|
27727
27752
|
}
|
|
27728
27753
|
),
|
|
27729
|
-
menuItems.filter((item) => item.type === "drawer" && !item.inline).map((item) => /* @__PURE__ */ (0,
|
|
27730
|
-
|
|
27754
|
+
menuItems.filter((item) => item.type === "drawer" && !item.inline).map((item) => /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
27755
|
+
import_antd85.Drawer,
|
|
27731
27756
|
{
|
|
27732
|
-
title: /* @__PURE__ */ (0,
|
|
27733
|
-
/* @__PURE__ */ (0,
|
|
27734
|
-
/* @__PURE__ */ (0,
|
|
27757
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" }, children: [
|
|
27758
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { style: { fontSize: 16, fontWeight: 600, textTransform: "uppercase", letterSpacing: 0.5 }, children: item.title || item.name }),
|
|
27759
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
27735
27760
|
"button",
|
|
27736
27761
|
{
|
|
27737
27762
|
onClick: () => handleCloseDrawer(item.id),
|
|
@@ -27746,7 +27771,7 @@ var ChatSidebar = ({
|
|
|
27746
27771
|
background: "rgba(255, 255, 255, 0.5)",
|
|
27747
27772
|
cursor: "pointer"
|
|
27748
27773
|
},
|
|
27749
|
-
children: /* @__PURE__ */ (0,
|
|
27774
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_lucide_react29.PanelLeftClose, { size: 24 })
|
|
27750
27775
|
}
|
|
27751
27776
|
)
|
|
27752
27777
|
] }),
|
|
@@ -27777,16 +27802,16 @@ var ChatSidebar = ({
|
|
|
27777
27802
|
};
|
|
27778
27803
|
|
|
27779
27804
|
// src/components/Chat/LatticeChatView.tsx
|
|
27780
|
-
var
|
|
27805
|
+
var import_jsx_runtime112 = require("react/jsx-runtime");
|
|
27781
27806
|
var LatticeChatView = (props) => {
|
|
27782
|
-
const shellContext = (0,
|
|
27807
|
+
const shellContext = (0, import_react86.useContext)(LatticeChatShellContext);
|
|
27783
27808
|
const { showSideMenu, sideMenuItems } = shellContext.config;
|
|
27784
27809
|
const { assistantId, thread } = useConversationContext();
|
|
27785
27810
|
const { currentAssistant } = useAssistantContext();
|
|
27786
27811
|
const {
|
|
27787
27812
|
config: { baseURL }
|
|
27788
27813
|
} = useLatticeChatShellContext();
|
|
27789
|
-
return assistantId && thread ? /* @__PURE__ */ (0,
|
|
27814
|
+
return assistantId && thread ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
27790
27815
|
AxiomLatticeProvider,
|
|
27791
27816
|
{
|
|
27792
27817
|
config: {
|
|
@@ -27795,14 +27820,14 @@ var LatticeChatView = (props) => {
|
|
|
27795
27820
|
assistantId,
|
|
27796
27821
|
transport: "sse"
|
|
27797
27822
|
},
|
|
27798
|
-
children: /* @__PURE__ */ (0,
|
|
27823
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
27799
27824
|
LatticeChat,
|
|
27800
27825
|
{
|
|
27801
27826
|
thread_id: thread?.id,
|
|
27802
27827
|
assistant_id: assistantId,
|
|
27803
27828
|
name: currentAssistant?.name,
|
|
27804
27829
|
description: currentAssistant?.description,
|
|
27805
|
-
menu: showSideMenu ? /* @__PURE__ */ (0,
|
|
27830
|
+
menu: showSideMenu ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(ChatSidebar, { customMenuItems: sideMenuItems }) : void 0
|
|
27806
27831
|
}
|
|
27807
27832
|
)
|
|
27808
27833
|
}
|
|
@@ -27810,14 +27835,14 @@ var LatticeChatView = (props) => {
|
|
|
27810
27835
|
};
|
|
27811
27836
|
|
|
27812
27837
|
// src/components/Chat/SettingsModal.tsx
|
|
27813
|
-
var
|
|
27814
|
-
var
|
|
27838
|
+
var import_react87 = require("react");
|
|
27839
|
+
var import_antd86 = require("antd");
|
|
27815
27840
|
var import_icons39 = require("@ant-design/icons");
|
|
27816
|
-
var
|
|
27817
|
-
var
|
|
27818
|
-
var { Text: Text37, Title: Title13 } =
|
|
27819
|
-
var { TextArea: TextArea8 } =
|
|
27820
|
-
var
|
|
27841
|
+
var import_antd_style36 = require("antd-style");
|
|
27842
|
+
var import_jsx_runtime113 = require("react/jsx-runtime");
|
|
27843
|
+
var { Text: Text37, Title: Title13 } = import_antd86.Typography;
|
|
27844
|
+
var { TextArea: TextArea8 } = import_antd86.Input;
|
|
27845
|
+
var useStyles23 = (0, import_antd_style36.createStyles)(({ token, css }) => ({
|
|
27821
27846
|
// settingsModal: css`
|
|
27822
27847
|
// .ant-modal {
|
|
27823
27848
|
// max-width: 100vw !important;
|
|
@@ -28162,21 +28187,21 @@ var SETTINGS_MENU_ITEMS = [
|
|
|
28162
28187
|
{
|
|
28163
28188
|
key: "environment",
|
|
28164
28189
|
label: "Environment Variables",
|
|
28165
|
-
icon: /* @__PURE__ */ (0,
|
|
28190
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_icons39.EnvironmentOutlined, {})
|
|
28166
28191
|
},
|
|
28167
28192
|
{
|
|
28168
28193
|
key: "models",
|
|
28169
28194
|
label: "Model Configuration",
|
|
28170
|
-
icon: /* @__PURE__ */ (0,
|
|
28195
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_icons39.ApiOutlined, {})
|
|
28171
28196
|
}
|
|
28172
28197
|
];
|
|
28173
28198
|
var SettingsModal = ({
|
|
28174
28199
|
open,
|
|
28175
28200
|
onClose
|
|
28176
28201
|
}) => {
|
|
28177
|
-
const { styles } =
|
|
28202
|
+
const { styles } = useStyles23();
|
|
28178
28203
|
const { config: shellConfig, updateConfigValue } = useLatticeChatShellContext();
|
|
28179
|
-
const [connections, setConnections] = (0,
|
|
28204
|
+
const [connections, setConnections] = (0, import_react87.useState)(() => {
|
|
28180
28205
|
if (typeof window !== "undefined") {
|
|
28181
28206
|
try {
|
|
28182
28207
|
const stored = localStorage.getItem("lattice_server_connections");
|
|
@@ -28199,21 +28224,21 @@ var SettingsModal = ({
|
|
|
28199
28224
|
}
|
|
28200
28225
|
return [];
|
|
28201
28226
|
});
|
|
28202
|
-
const [serverConfigs, setServerConfigs] = (0,
|
|
28203
|
-
const connectionsRef = (0,
|
|
28204
|
-
(0,
|
|
28227
|
+
const [serverConfigs, setServerConfigs] = (0, import_react87.useState)({});
|
|
28228
|
+
const connectionsRef = (0, import_react87.useRef)(connections);
|
|
28229
|
+
(0, import_react87.useEffect)(() => {
|
|
28205
28230
|
connectionsRef.current = connections;
|
|
28206
28231
|
}, [connections]);
|
|
28207
|
-
const [activeTabKey, setActiveTabKey] = (0,
|
|
28232
|
+
const [activeTabKey, setActiveTabKey] = (0, import_react87.useState)(
|
|
28208
28233
|
connections.length > 0 ? connections[0].id : ""
|
|
28209
28234
|
);
|
|
28210
|
-
const [activeMenu, setActiveMenu] = (0,
|
|
28211
|
-
const [loading, setLoading] = (0,
|
|
28212
|
-
const [showAddServerModal, setShowAddServerModal] = (0,
|
|
28213
|
-
const [newServerUrl, setNewServerUrl] = (0,
|
|
28214
|
-
const [newServerName, setNewServerName] = (0,
|
|
28215
|
-
const [newServerApiKey, setNewServerApiKey] = (0,
|
|
28216
|
-
const [addingServer, setAddingServer] = (0,
|
|
28235
|
+
const [activeMenu, setActiveMenu] = (0, import_react87.useState)("environment");
|
|
28236
|
+
const [loading, setLoading] = (0, import_react87.useState)(false);
|
|
28237
|
+
const [showAddServerModal, setShowAddServerModal] = (0, import_react87.useState)(false);
|
|
28238
|
+
const [newServerUrl, setNewServerUrl] = (0, import_react87.useState)("");
|
|
28239
|
+
const [newServerName, setNewServerName] = (0, import_react87.useState)("");
|
|
28240
|
+
const [newServerApiKey, setNewServerApiKey] = (0, import_react87.useState)("");
|
|
28241
|
+
const [addingServer, setAddingServer] = (0, import_react87.useState)(false);
|
|
28217
28242
|
const saveConnections = (newConnections) => {
|
|
28218
28243
|
setConnections(newConnections);
|
|
28219
28244
|
if (typeof window !== "undefined") {
|
|
@@ -28352,7 +28377,7 @@ var SettingsModal = ({
|
|
|
28352
28377
|
}
|
|
28353
28378
|
} catch (error) {
|
|
28354
28379
|
console.error("Failed to load configuration:", error);
|
|
28355
|
-
|
|
28380
|
+
import_antd86.message.error("Failed to load current configuration");
|
|
28356
28381
|
}
|
|
28357
28382
|
};
|
|
28358
28383
|
const loadModelsConfig = async (serverId) => {
|
|
@@ -28403,7 +28428,7 @@ var SettingsModal = ({
|
|
|
28403
28428
|
console.error("Failed to load models configuration:", error);
|
|
28404
28429
|
}
|
|
28405
28430
|
};
|
|
28406
|
-
(0,
|
|
28431
|
+
(0, import_react87.useEffect)(() => {
|
|
28407
28432
|
if (open && activeTabKey) {
|
|
28408
28433
|
initializeServerConfig(activeTabKey);
|
|
28409
28434
|
const connection = connections.find((c) => c.id === activeTabKey);
|
|
@@ -28412,7 +28437,7 @@ var SettingsModal = ({
|
|
|
28412
28437
|
}
|
|
28413
28438
|
}
|
|
28414
28439
|
}, [open, activeTabKey]);
|
|
28415
|
-
(0,
|
|
28440
|
+
(0, import_react87.useEffect)(() => {
|
|
28416
28441
|
if (open && activeTabKey) {
|
|
28417
28442
|
const connection = connections.find((c) => c.id === activeTabKey);
|
|
28418
28443
|
if (connection?.connected) {
|
|
@@ -28426,7 +28451,7 @@ var SettingsModal = ({
|
|
|
28426
28451
|
}, [open, activeTabKey, activeMenu]);
|
|
28427
28452
|
const handleAddServer = async () => {
|
|
28428
28453
|
if (!newServerUrl.trim()) {
|
|
28429
|
-
|
|
28454
|
+
import_antd86.message.error("Please enter a server URL");
|
|
28430
28455
|
return;
|
|
28431
28456
|
}
|
|
28432
28457
|
let normalizedUrl = newServerUrl.trim();
|
|
@@ -28452,7 +28477,7 @@ var SettingsModal = ({
|
|
|
28452
28477
|
setNewServerUrl("");
|
|
28453
28478
|
setNewServerName("");
|
|
28454
28479
|
setNewServerApiKey("");
|
|
28455
|
-
|
|
28480
|
+
import_antd86.notification.success({
|
|
28456
28481
|
message: "Added",
|
|
28457
28482
|
description: "Server added successfully"
|
|
28458
28483
|
});
|
|
@@ -28472,7 +28497,7 @@ var SettingsModal = ({
|
|
|
28472
28497
|
setActiveTabKey("");
|
|
28473
28498
|
}
|
|
28474
28499
|
}
|
|
28475
|
-
|
|
28500
|
+
import_antd86.notification.success({
|
|
28476
28501
|
message: "Deleted",
|
|
28477
28502
|
description: "Server deleted"
|
|
28478
28503
|
});
|
|
@@ -28489,12 +28514,12 @@ var SettingsModal = ({
|
|
|
28489
28514
|
const handleSave = async () => {
|
|
28490
28515
|
const connection = connections.find((c) => c.id === activeTabKey);
|
|
28491
28516
|
if (!connection || !connection.connected) {
|
|
28492
|
-
|
|
28517
|
+
import_antd86.message.error("Please connect to a server first");
|
|
28493
28518
|
return;
|
|
28494
28519
|
}
|
|
28495
28520
|
const url = connection.url;
|
|
28496
28521
|
if (!url) {
|
|
28497
|
-
|
|
28522
|
+
import_antd86.message.error("Please connect to a server first");
|
|
28498
28523
|
return;
|
|
28499
28524
|
}
|
|
28500
28525
|
try {
|
|
@@ -28558,26 +28583,26 @@ var SettingsModal = ({
|
|
|
28558
28583
|
const data = await response.json();
|
|
28559
28584
|
if (response.ok && data.success) {
|
|
28560
28585
|
if (data.requiresRestart && data.requiresRestart.length > 0) {
|
|
28561
|
-
|
|
28586
|
+
import_antd86.message.warning(
|
|
28562
28587
|
`Configuration saved. Please restart the server for ${data.requiresRestart.join(
|
|
28563
28588
|
", "
|
|
28564
28589
|
)} to take effect.`,
|
|
28565
28590
|
5
|
|
28566
28591
|
);
|
|
28567
28592
|
} else {
|
|
28568
|
-
|
|
28593
|
+
import_antd86.notification.success({
|
|
28569
28594
|
message: "Saved",
|
|
28570
28595
|
description: "Configuration saved and applied successfully"
|
|
28571
28596
|
});
|
|
28572
28597
|
}
|
|
28573
28598
|
if (data.warnings && data.warnings.length > 0) {
|
|
28574
28599
|
data.warnings.forEach((warning) => {
|
|
28575
|
-
|
|
28600
|
+
import_antd86.message.warning(warning, 5);
|
|
28576
28601
|
});
|
|
28577
28602
|
}
|
|
28578
28603
|
onClose();
|
|
28579
28604
|
} else {
|
|
28580
|
-
|
|
28605
|
+
import_antd86.message.error(data.error || "Failed to save configuration");
|
|
28581
28606
|
}
|
|
28582
28607
|
} else if (activeMenu === "models") {
|
|
28583
28608
|
const validModels = config.models.filter(
|
|
@@ -28596,18 +28621,18 @@ var SettingsModal = ({
|
|
|
28596
28621
|
});
|
|
28597
28622
|
const data = await response.json();
|
|
28598
28623
|
if (response.ok && data.success) {
|
|
28599
|
-
|
|
28624
|
+
import_antd86.notification.success({
|
|
28600
28625
|
message: "Saved",
|
|
28601
28626
|
description: "Model configuration saved and registered successfully"
|
|
28602
28627
|
});
|
|
28603
28628
|
onClose();
|
|
28604
28629
|
} else {
|
|
28605
|
-
|
|
28630
|
+
import_antd86.message.error(data.error || "Failed to save model configuration");
|
|
28606
28631
|
}
|
|
28607
28632
|
}
|
|
28608
28633
|
} catch (error) {
|
|
28609
28634
|
console.error("Failed to save configuration:", error);
|
|
28610
|
-
|
|
28635
|
+
import_antd86.message.error(error.message || "Failed to save configuration");
|
|
28611
28636
|
} finally {
|
|
28612
28637
|
setLoading(false);
|
|
28613
28638
|
}
|
|
@@ -28623,25 +28648,25 @@ var SettingsModal = ({
|
|
|
28623
28648
|
}
|
|
28624
28649
|
}));
|
|
28625
28650
|
};
|
|
28626
|
-
return /* @__PURE__ */ (0,
|
|
28627
|
-
/* @__PURE__ */ (0,
|
|
28628
|
-
|
|
28651
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: styles.formContainer, children: [
|
|
28652
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28653
|
+
import_antd86.Alert,
|
|
28629
28654
|
{
|
|
28630
28655
|
message: "Configuration Effect",
|
|
28631
|
-
description: /* @__PURE__ */ (0,
|
|
28632
|
-
/* @__PURE__ */ (0,
|
|
28633
|
-
/* @__PURE__ */ (0,
|
|
28656
|
+
description: /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
28657
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { style: { marginBottom: 8 }, children: [
|
|
28658
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28634
28659
|
import_icons39.CheckCircleOutlined,
|
|
28635
28660
|
{
|
|
28636
28661
|
style: { color: "#52c41a", marginRight: 8 }
|
|
28637
28662
|
}
|
|
28638
28663
|
),
|
|
28639
|
-
/* @__PURE__ */ (0,
|
|
28664
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("strong", { children: "Immediately effective:" }),
|
|
28640
28665
|
" QUEUE_SERVICE_TYPE, REDIS_URL, REDIS_PASSWORD, QUEUE_NAME"
|
|
28641
28666
|
] }),
|
|
28642
|
-
/* @__PURE__ */ (0,
|
|
28643
|
-
/* @__PURE__ */ (0,
|
|
28644
|
-
/* @__PURE__ */ (0,
|
|
28667
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
28668
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_icons39.ReloadOutlined, { style: { color: "#faad14", marginRight: 8 } }),
|
|
28669
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("strong", { children: "Requires restart:" }),
|
|
28645
28670
|
" PORT (server must be restarted to change port)"
|
|
28646
28671
|
] })
|
|
28647
28672
|
] }),
|
|
@@ -28650,8 +28675,8 @@ var SettingsModal = ({
|
|
|
28650
28675
|
className: styles.alertCard
|
|
28651
28676
|
}
|
|
28652
28677
|
),
|
|
28653
|
-
/* @__PURE__ */ (0,
|
|
28654
|
-
/* @__PURE__ */ (0,
|
|
28678
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { style: { marginBottom: 24 }, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(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." }) }),
|
|
28679
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28655
28680
|
TextArea8,
|
|
28656
28681
|
{
|
|
28657
28682
|
value: config.envText,
|
|
@@ -28728,10 +28753,10 @@ QUEUE_NAME=tasks`,
|
|
|
28728
28753
|
}));
|
|
28729
28754
|
}
|
|
28730
28755
|
};
|
|
28731
|
-
return /* @__PURE__ */ (0,
|
|
28732
|
-
/* @__PURE__ */ (0,
|
|
28733
|
-
config.models.map((model, index) => /* @__PURE__ */ (0,
|
|
28734
|
-
/* @__PURE__ */ (0,
|
|
28756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: styles.formContainer, children: [
|
|
28757
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { style: { marginBottom: 32 }, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(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." }) }),
|
|
28758
|
+
config.models.map((model, index) => /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: styles.card, children: [
|
|
28759
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
|
|
28735
28760
|
"div",
|
|
28736
28761
|
{
|
|
28737
28762
|
style: {
|
|
@@ -28743,12 +28768,12 @@ QUEUE_NAME=tasks`,
|
|
|
28743
28768
|
borderBottom: "1px solid rgba(0, 0, 0, 0.06)"
|
|
28744
28769
|
},
|
|
28745
28770
|
children: [
|
|
28746
|
-
/* @__PURE__ */ (0,
|
|
28747
|
-
/* @__PURE__ */ (0,
|
|
28771
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
28772
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Text37, { strong: true, style: { fontSize: 16 }, children: [
|
|
28748
28773
|
"Model ",
|
|
28749
28774
|
index + 1
|
|
28750
28775
|
] }),
|
|
28751
|
-
model.key && /* @__PURE__ */ (0,
|
|
28776
|
+
model.key && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
|
|
28752
28777
|
Text37,
|
|
28753
28778
|
{
|
|
28754
28779
|
type: "secondary",
|
|
@@ -28761,8 +28786,8 @@ QUEUE_NAME=tasks`,
|
|
|
28761
28786
|
}
|
|
28762
28787
|
)
|
|
28763
28788
|
] }),
|
|
28764
|
-
config.models.length > 1 && /* @__PURE__ */ (0,
|
|
28765
|
-
|
|
28789
|
+
config.models.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28790
|
+
import_antd86.Button,
|
|
28766
28791
|
{
|
|
28767
28792
|
type: "text",
|
|
28768
28793
|
danger: true,
|
|
@@ -28778,11 +28803,11 @@ QUEUE_NAME=tasks`,
|
|
|
28778
28803
|
]
|
|
28779
28804
|
}
|
|
28780
28805
|
),
|
|
28781
|
-
/* @__PURE__ */ (0,
|
|
28782
|
-
/* @__PURE__ */ (0,
|
|
28783
|
-
/* @__PURE__ */ (0,
|
|
28784
|
-
/* @__PURE__ */ (0,
|
|
28785
|
-
|
|
28806
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_antd86.Space, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
|
|
28807
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
28808
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formLabel, children: "Key *" }),
|
|
28809
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28810
|
+
import_antd86.Input,
|
|
28786
28811
|
{
|
|
28787
28812
|
placeholder: "e.g., default, gpt-4, claude",
|
|
28788
28813
|
value: model.key,
|
|
@@ -28790,12 +28815,12 @@ QUEUE_NAME=tasks`,
|
|
|
28790
28815
|
style: { height: 40 }
|
|
28791
28816
|
}
|
|
28792
28817
|
),
|
|
28793
|
-
/* @__PURE__ */ (0,
|
|
28818
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formDescription, children: "Unique identifier for this model" })
|
|
28794
28819
|
] }),
|
|
28795
|
-
/* @__PURE__ */ (0,
|
|
28796
|
-
/* @__PURE__ */ (0,
|
|
28797
|
-
/* @__PURE__ */ (0,
|
|
28798
|
-
|
|
28820
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
28821
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formLabel, children: "Provider *" }),
|
|
28822
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28823
|
+
import_antd86.Select,
|
|
28799
28824
|
{
|
|
28800
28825
|
style: { width: "100%", height: 40 },
|
|
28801
28826
|
value: model.provider,
|
|
@@ -28810,10 +28835,10 @@ QUEUE_NAME=tasks`,
|
|
|
28810
28835
|
}
|
|
28811
28836
|
)
|
|
28812
28837
|
] }),
|
|
28813
|
-
/* @__PURE__ */ (0,
|
|
28814
|
-
/* @__PURE__ */ (0,
|
|
28815
|
-
/* @__PURE__ */ (0,
|
|
28816
|
-
|
|
28838
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
28839
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formLabel, children: "Model Name *" }),
|
|
28840
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28841
|
+
import_antd86.Input,
|
|
28817
28842
|
{
|
|
28818
28843
|
placeholder: "e.g., gpt-4, claude-3-opus, kimi-k2-250905",
|
|
28819
28844
|
value: model.model,
|
|
@@ -28822,10 +28847,10 @@ QUEUE_NAME=tasks`,
|
|
|
28822
28847
|
}
|
|
28823
28848
|
)
|
|
28824
28849
|
] }),
|
|
28825
|
-
/* @__PURE__ */ (0,
|
|
28826
|
-
/* @__PURE__ */ (0,
|
|
28827
|
-
/* @__PURE__ */ (0,
|
|
28828
|
-
|
|
28850
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
28851
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formLabel, children: "API Key" }),
|
|
28852
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28853
|
+
import_antd86.Input.Password,
|
|
28829
28854
|
{
|
|
28830
28855
|
placeholder: "Enter your API key",
|
|
28831
28856
|
value: model.apiKey,
|
|
@@ -28833,12 +28858,12 @@ QUEUE_NAME=tasks`,
|
|
|
28833
28858
|
style: { height: 40 }
|
|
28834
28859
|
}
|
|
28835
28860
|
),
|
|
28836
|
-
/* @__PURE__ */ (0,
|
|
28861
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formDescription, children: "API key for the model provider. Leave empty to use environment variable." })
|
|
28837
28862
|
] }),
|
|
28838
|
-
/* @__PURE__ */ (0,
|
|
28839
|
-
/* @__PURE__ */ (0,
|
|
28840
|
-
/* @__PURE__ */ (0,
|
|
28841
|
-
|
|
28863
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
28864
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formLabel, children: "Base URL" }),
|
|
28865
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28866
|
+
import_antd86.Input,
|
|
28842
28867
|
{
|
|
28843
28868
|
placeholder: "e.g., https://api.openai.com/v1",
|
|
28844
28869
|
value: model.baseURL,
|
|
@@ -28846,23 +28871,23 @@ QUEUE_NAME=tasks`,
|
|
|
28846
28871
|
style: { height: 40 }
|
|
28847
28872
|
}
|
|
28848
28873
|
),
|
|
28849
|
-
/* @__PURE__ */ (0,
|
|
28874
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formDescription, children: "Optional custom base URL for the API" })
|
|
28850
28875
|
] }),
|
|
28851
|
-
/* @__PURE__ */ (0,
|
|
28852
|
-
/* @__PURE__ */ (0,
|
|
28853
|
-
|
|
28876
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_antd86.Space, { children: [
|
|
28877
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28878
|
+
import_antd86.Switch,
|
|
28854
28879
|
{
|
|
28855
28880
|
checked: model.streaming,
|
|
28856
28881
|
onChange: (checked) => handleModelChange(index, "streaming", checked)
|
|
28857
28882
|
}
|
|
28858
28883
|
),
|
|
28859
|
-
/* @__PURE__ */ (0,
|
|
28884
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { children: "Enable Streaming" })
|
|
28860
28885
|
] }) }),
|
|
28861
|
-
/* @__PURE__ */ (0,
|
|
28862
|
-
/* @__PURE__ */ (0,
|
|
28863
|
-
/* @__PURE__ */ (0,
|
|
28864
|
-
/* @__PURE__ */ (0,
|
|
28865
|
-
|
|
28886
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { style: { display: "flex", gap: 20 }, children: [
|
|
28887
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { style: { flex: 1 }, children: [
|
|
28888
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formLabel, children: "Max Tokens" }),
|
|
28889
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28890
|
+
import_antd86.Input,
|
|
28866
28891
|
{
|
|
28867
28892
|
type: "number",
|
|
28868
28893
|
placeholder: "e.g., 4096",
|
|
@@ -28876,10 +28901,10 @@ QUEUE_NAME=tasks`,
|
|
|
28876
28901
|
}
|
|
28877
28902
|
)
|
|
28878
28903
|
] }),
|
|
28879
|
-
/* @__PURE__ */ (0,
|
|
28880
|
-
/* @__PURE__ */ (0,
|
|
28881
|
-
/* @__PURE__ */ (0,
|
|
28882
|
-
|
|
28904
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { style: { flex: 1 }, children: [
|
|
28905
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formLabel, children: "Temperature" }),
|
|
28906
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28907
|
+
import_antd86.Input,
|
|
28883
28908
|
{
|
|
28884
28909
|
type: "number",
|
|
28885
28910
|
step: "0.1",
|
|
@@ -28897,8 +28922,8 @@ QUEUE_NAME=tasks`,
|
|
|
28897
28922
|
] })
|
|
28898
28923
|
] })
|
|
28899
28924
|
] }, index)),
|
|
28900
|
-
/* @__PURE__ */ (0,
|
|
28901
|
-
|
|
28925
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28926
|
+
import_antd86.Button,
|
|
28902
28927
|
{
|
|
28903
28928
|
type: "dashed",
|
|
28904
28929
|
onClick: handleAddModel,
|
|
@@ -28925,8 +28950,8 @@ QUEUE_NAME=tasks`,
|
|
|
28925
28950
|
);
|
|
28926
28951
|
const currentConnection = connections.find((c) => c.id === activeTabKey);
|
|
28927
28952
|
const renderTabLabel = (connection) => {
|
|
28928
|
-
return /* @__PURE__ */ (0,
|
|
28929
|
-
/* @__PURE__ */ (0,
|
|
28953
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { style: { display: "flex", alignItems: "center" }, children: [
|
|
28954
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28930
28955
|
import_icons39.CloudServerOutlined,
|
|
28931
28956
|
{
|
|
28932
28957
|
style: {
|
|
@@ -28935,14 +28960,14 @@ QUEUE_NAME=tasks`,
|
|
|
28935
28960
|
}
|
|
28936
28961
|
}
|
|
28937
28962
|
),
|
|
28938
|
-
/* @__PURE__ */ (0,
|
|
28939
|
-
connection.connected && /* @__PURE__ */ (0,
|
|
28963
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { children: connection.name }),
|
|
28964
|
+
connection.connected && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28940
28965
|
import_icons39.CheckCircleFilled,
|
|
28941
28966
|
{
|
|
28942
28967
|
style: { color: "#52c41a", fontSize: 12, marginLeft: 8 }
|
|
28943
28968
|
}
|
|
28944
28969
|
),
|
|
28945
|
-
connection.error && !connection.connecting && /* @__PURE__ */ (0,
|
|
28970
|
+
connection.error && !connection.connecting && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28946
28971
|
import_icons39.CloseCircleFilled,
|
|
28947
28972
|
{
|
|
28948
28973
|
style: { color: "#ff4d4f", fontSize: 12, marginLeft: 8 }
|
|
@@ -28953,35 +28978,35 @@ QUEUE_NAME=tasks`,
|
|
|
28953
28978
|
const tabItems = connections.map((connection) => ({
|
|
28954
28979
|
key: connection.id,
|
|
28955
28980
|
label: renderTabLabel(connection),
|
|
28956
|
-
children: /* @__PURE__ */ (0,
|
|
28957
|
-
/* @__PURE__ */ (0,
|
|
28981
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { className: styles.tabContent, children: connection.connected ? /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_jsx_runtime113.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { style: { display: "flex", height: "100%" }, children: [
|
|
28982
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { className: styles.sidebar, children: SETTINGS_MENU_ITEMS.map((item) => /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
|
|
28958
28983
|
"div",
|
|
28959
28984
|
{
|
|
28960
28985
|
className: `${styles.menuItem} ${activeMenu === item.key ? "active" : ""}`,
|
|
28961
28986
|
onClick: () => setActiveMenu(item.key),
|
|
28962
28987
|
children: [
|
|
28963
|
-
/* @__PURE__ */ (0,
|
|
28964
|
-
/* @__PURE__ */ (0,
|
|
28988
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { className: styles.menuItemIcon, children: item.icon }),
|
|
28989
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { className: styles.menuItemText, children: item.label })
|
|
28965
28990
|
]
|
|
28966
28991
|
},
|
|
28967
28992
|
item.key
|
|
28968
28993
|
)) }),
|
|
28969
|
-
/* @__PURE__ */ (0,
|
|
28970
|
-
/* @__PURE__ */ (0,
|
|
28971
|
-
/* @__PURE__ */ (0,
|
|
28972
|
-
/* @__PURE__ */ (0,
|
|
28973
|
-
/* @__PURE__ */ (0,
|
|
28994
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: styles.content, children: [
|
|
28995
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: styles.contentHeader, children: [
|
|
28996
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: styles.contentHeaderLeft, children: [
|
|
28997
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Title13, { level: 3, className: styles.contentTitle, children: activeMenuItem?.label }),
|
|
28998
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Text37, { className: styles.contentDescription, children: [
|
|
28974
28999
|
activeMenu === "environment" && "Manage environment variables for the gateway server",
|
|
28975
29000
|
activeMenu === "models" && "Configure and register model lattices for use by agents"
|
|
28976
29001
|
] })
|
|
28977
29002
|
] }),
|
|
28978
|
-
/* @__PURE__ */ (0,
|
|
28979
|
-
/* @__PURE__ */ (0,
|
|
28980
|
-
/* @__PURE__ */ (0,
|
|
28981
|
-
|
|
29003
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: styles.contentHeaderRight, children: [
|
|
29004
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_antd86.Button, { onClick: onClose, children: "Cancel" }),
|
|
29005
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29006
|
+
import_antd86.Button,
|
|
28982
29007
|
{
|
|
28983
29008
|
type: "primary",
|
|
28984
|
-
icon: /* @__PURE__ */ (0,
|
|
29009
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_icons39.SaveOutlined, {}),
|
|
28985
29010
|
onClick: handleSave,
|
|
28986
29011
|
loading,
|
|
28987
29012
|
children: "Save Configuration"
|
|
@@ -28989,9 +29014,9 @@ QUEUE_NAME=tasks`,
|
|
|
28989
29014
|
)
|
|
28990
29015
|
] })
|
|
28991
29016
|
] }),
|
|
28992
|
-
/* @__PURE__ */ (0,
|
|
29017
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { className: styles.contentBody, children: renderContent(connection.id) })
|
|
28993
29018
|
] })
|
|
28994
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
29019
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28995
29020
|
"div",
|
|
28996
29021
|
{
|
|
28997
29022
|
style: {
|
|
@@ -29003,17 +29028,17 @@ QUEUE_NAME=tasks`,
|
|
|
29003
29028
|
gap: 16,
|
|
29004
29029
|
padding: 48
|
|
29005
29030
|
},
|
|
29006
|
-
children: connection.connecting ? /* @__PURE__ */ (0,
|
|
29007
|
-
/* @__PURE__ */ (0,
|
|
29008
|
-
/* @__PURE__ */ (0,
|
|
29009
|
-
/* @__PURE__ */ (0,
|
|
29031
|
+
children: connection.connecting ? /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_jsx_runtime113.Fragment, { children: [
|
|
29032
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_icons39.LinkOutlined, { style: { fontSize: 64, color: "#1890ff" }, spin: true }),
|
|
29033
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Title13, { level: 4, children: "Connecting..." }),
|
|
29034
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Text37, { type: "secondary", style: { textAlign: "center" }, children: [
|
|
29010
29035
|
"Connecting to ",
|
|
29011
29036
|
connection.url
|
|
29012
29037
|
] })
|
|
29013
|
-
] }) : /* @__PURE__ */ (0,
|
|
29014
|
-
/* @__PURE__ */ (0,
|
|
29015
|
-
/* @__PURE__ */ (0,
|
|
29016
|
-
/* @__PURE__ */ (0,
|
|
29038
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_jsx_runtime113.Fragment, { children: [
|
|
29039
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_icons39.LinkOutlined, { style: { fontSize: 64, color: "#d9d9d9" } }),
|
|
29040
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Title13, { level: 4, type: "secondary", children: connection.error || "Not Connected" }),
|
|
29041
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29017
29042
|
Text37,
|
|
29018
29043
|
{
|
|
29019
29044
|
type: "secondary",
|
|
@@ -29021,11 +29046,11 @@ QUEUE_NAME=tasks`,
|
|
|
29021
29046
|
children: connection.error ? `Failed to connect to ${connection.url}. Please check the server URL and try again.` : `Click "Reconnect" to connect to ${connection.url}`
|
|
29022
29047
|
}
|
|
29023
29048
|
),
|
|
29024
|
-
/* @__PURE__ */ (0,
|
|
29025
|
-
|
|
29049
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29050
|
+
import_antd86.Button,
|
|
29026
29051
|
{
|
|
29027
29052
|
type: "primary",
|
|
29028
|
-
icon: /* @__PURE__ */ (0,
|
|
29053
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_icons39.LinkOutlined, {}),
|
|
29029
29054
|
onClick: () => checkConnection(connection.id),
|
|
29030
29055
|
loading: connection.connecting,
|
|
29031
29056
|
style: { marginTop: 16 },
|
|
@@ -29037,9 +29062,9 @@ QUEUE_NAME=tasks`,
|
|
|
29037
29062
|
) }),
|
|
29038
29063
|
closable: connections.length > 1
|
|
29039
29064
|
}));
|
|
29040
|
-
return /* @__PURE__ */ (0,
|
|
29041
|
-
/* @__PURE__ */ (0,
|
|
29042
|
-
|
|
29065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_jsx_runtime113.Fragment, { children: [
|
|
29066
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29067
|
+
import_antd86.Modal,
|
|
29043
29068
|
{
|
|
29044
29069
|
open,
|
|
29045
29070
|
onCancel: onClose,
|
|
@@ -29047,8 +29072,8 @@ QUEUE_NAME=tasks`,
|
|
|
29047
29072
|
width: "80%",
|
|
29048
29073
|
footer: null,
|
|
29049
29074
|
title: "Settings",
|
|
29050
|
-
children: /* @__PURE__ */ (0,
|
|
29051
|
-
|
|
29075
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29076
|
+
import_antd86.Tabs,
|
|
29052
29077
|
{
|
|
29053
29078
|
activeKey: activeTabKey,
|
|
29054
29079
|
onChange: handleTabChange,
|
|
@@ -29061,7 +29086,7 @@ QUEUE_NAME=tasks`,
|
|
|
29061
29086
|
}
|
|
29062
29087
|
},
|
|
29063
29088
|
items: tabItems,
|
|
29064
|
-
addIcon: /* @__PURE__ */ (0,
|
|
29089
|
+
addIcon: /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
|
|
29065
29090
|
"div",
|
|
29066
29091
|
{
|
|
29067
29092
|
style: {
|
|
@@ -29071,8 +29096,8 @@ QUEUE_NAME=tasks`,
|
|
|
29071
29096
|
padding: "4px 8px"
|
|
29072
29097
|
},
|
|
29073
29098
|
children: [
|
|
29074
|
-
/* @__PURE__ */ (0,
|
|
29075
|
-
/* @__PURE__ */ (0,
|
|
29099
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_icons39.PlusOutlined, {}),
|
|
29100
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { children: "Add Server" })
|
|
29076
29101
|
]
|
|
29077
29102
|
}
|
|
29078
29103
|
)
|
|
@@ -29080,8 +29105,8 @@ QUEUE_NAME=tasks`,
|
|
|
29080
29105
|
) })
|
|
29081
29106
|
}
|
|
29082
29107
|
),
|
|
29083
|
-
/* @__PURE__ */ (0,
|
|
29084
|
-
|
|
29108
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29109
|
+
import_antd86.Modal,
|
|
29085
29110
|
{
|
|
29086
29111
|
title: "Add New Server",
|
|
29087
29112
|
open: showAddServerModal,
|
|
@@ -29094,11 +29119,11 @@ QUEUE_NAME=tasks`,
|
|
|
29094
29119
|
},
|
|
29095
29120
|
confirmLoading: addingServer,
|
|
29096
29121
|
className: styles.addServerModal,
|
|
29097
|
-
children: /* @__PURE__ */ (0,
|
|
29098
|
-
/* @__PURE__ */ (0,
|
|
29099
|
-
/* @__PURE__ */ (0,
|
|
29100
|
-
/* @__PURE__ */ (0,
|
|
29101
|
-
|
|
29122
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_antd86.Space, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
|
|
29123
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
29124
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server Name" }),
|
|
29125
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29126
|
+
import_antd86.Input,
|
|
29102
29127
|
{
|
|
29103
29128
|
placeholder: "e.g., Production Server",
|
|
29104
29129
|
value: newServerName,
|
|
@@ -29106,12 +29131,12 @@ QUEUE_NAME=tasks`,
|
|
|
29106
29131
|
onPressEnter: handleAddServer
|
|
29107
29132
|
}
|
|
29108
29133
|
),
|
|
29109
|
-
/* @__PURE__ */ (0,
|
|
29134
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: Leave empty to use URL as name" })
|
|
29110
29135
|
] }),
|
|
29111
|
-
/* @__PURE__ */ (0,
|
|
29112
|
-
/* @__PURE__ */ (0,
|
|
29113
|
-
/* @__PURE__ */ (0,
|
|
29114
|
-
|
|
29136
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
29137
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server URL *" }),
|
|
29138
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29139
|
+
import_antd86.Input,
|
|
29115
29140
|
{
|
|
29116
29141
|
placeholder: "e.g., http://localhost:4001",
|
|
29117
29142
|
value: newServerUrl,
|
|
@@ -29119,12 +29144,12 @@ QUEUE_NAME=tasks`,
|
|
|
29119
29144
|
onPressEnter: handleAddServer
|
|
29120
29145
|
}
|
|
29121
29146
|
),
|
|
29122
|
-
/* @__PURE__ */ (0,
|
|
29147
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Enter the full URL of the gateway server" })
|
|
29123
29148
|
] }),
|
|
29124
|
-
/* @__PURE__ */ (0,
|
|
29125
|
-
/* @__PURE__ */ (0,
|
|
29126
|
-
/* @__PURE__ */ (0,
|
|
29127
|
-
|
|
29149
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
29150
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { strong: true, style: { display: "block", marginBottom: 8 }, children: "API Key" }),
|
|
29151
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29152
|
+
import_antd86.Input.Password,
|
|
29128
29153
|
{
|
|
29129
29154
|
placeholder: "Optional: Enter API key for authentication",
|
|
29130
29155
|
value: newServerApiKey,
|
|
@@ -29132,7 +29157,7 @@ QUEUE_NAME=tasks`,
|
|
|
29132
29157
|
onPressEnter: handleAddServer
|
|
29133
29158
|
}
|
|
29134
29159
|
),
|
|
29135
|
-
/* @__PURE__ */ (0,
|
|
29160
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: API key for server authentication" })
|
|
29136
29161
|
] })
|
|
29137
29162
|
] })
|
|
29138
29163
|
}
|
|
@@ -29141,10 +29166,10 @@ QUEUE_NAME=tasks`,
|
|
|
29141
29166
|
};
|
|
29142
29167
|
|
|
29143
29168
|
// src/components/Chat/AgentServerSetting.tsx
|
|
29144
|
-
var
|
|
29169
|
+
var import_jsx_runtime114 = require("react/jsx-runtime");
|
|
29145
29170
|
var AgentServerSetting = () => {
|
|
29146
29171
|
const { settingsModalOpen, setSettingsModalOpen } = useLatticeChatShellContext();
|
|
29147
|
-
return /* @__PURE__ */ (0,
|
|
29172
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
29148
29173
|
SettingsModal,
|
|
29149
29174
|
{
|
|
29150
29175
|
open: settingsModalOpen,
|
|
@@ -29154,24 +29179,24 @@ var AgentServerSetting = () => {
|
|
|
29154
29179
|
};
|
|
29155
29180
|
|
|
29156
29181
|
// src/components/Chat/LatticeChatShell.tsx
|
|
29157
|
-
var
|
|
29182
|
+
var import_jsx_runtime115 = require("react/jsx-runtime");
|
|
29158
29183
|
var ShellContent = ({
|
|
29159
29184
|
initialAssistantId,
|
|
29160
29185
|
enableWorkspace
|
|
29161
29186
|
}) => {
|
|
29162
29187
|
const { currentTenant } = useAuth();
|
|
29163
|
-
return /* @__PURE__ */ (0,
|
|
29164
|
-
/* @__PURE__ */ (0,
|
|
29165
|
-
/* @__PURE__ */ (0,
|
|
29166
|
-
] }) : /* @__PURE__ */ (0,
|
|
29167
|
-
/* @__PURE__ */ (0,
|
|
29168
|
-
/* @__PURE__ */ (0,
|
|
29188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_jsx_runtime115.Fragment, { children: enableWorkspace ? /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(WorkspaceContextProvider, { children: [
|
|
29189
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(AssistantContextProvider, { autoLoad: true, initialAssistantId, children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(ConversationContextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(LatticeChatView, {}) }) }),
|
|
29190
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(AgentServerSetting, {})
|
|
29191
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(import_jsx_runtime115.Fragment, { children: [
|
|
29192
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(AssistantContextProvider, { autoLoad: true, initialAssistantId, children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(ConversationContextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(LatticeChatView, {}) }) }),
|
|
29193
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(AgentServerSetting, {})
|
|
29169
29194
|
] }) });
|
|
29170
29195
|
};
|
|
29171
29196
|
var LatticeChatShell = (props) => {
|
|
29172
29197
|
const { enableAssistantCreation, enableAssistantEditing, enableWorkspace: enableWorkspaceProp, ...restProps } = props;
|
|
29173
29198
|
const enableWorkspace = enableWorkspaceProp ?? restProps.initialConfig?.enableWorkspace ?? false;
|
|
29174
|
-
return /* @__PURE__ */ (0,
|
|
29199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
29175
29200
|
LatticeChatShellContextProvider,
|
|
29176
29201
|
{
|
|
29177
29202
|
initialConfig: {
|
|
@@ -29180,7 +29205,7 @@ var LatticeChatShell = (props) => {
|
|
|
29180
29205
|
enableWorkspace,
|
|
29181
29206
|
...restProps.initialConfig
|
|
29182
29207
|
},
|
|
29183
|
-
children: /* @__PURE__ */ (0,
|
|
29208
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
29184
29209
|
ShellContent,
|
|
29185
29210
|
{
|
|
29186
29211
|
initialAssistantId: restProps.initialConfig?.assistantId,
|
|
@@ -29190,6 +29215,336 @@ var LatticeChatShell = (props) => {
|
|
|
29190
29215
|
}
|
|
29191
29216
|
);
|
|
29192
29217
|
};
|
|
29218
|
+
|
|
29219
|
+
// src/components/Chat/ChannelInstallationsDrawerContent.tsx
|
|
29220
|
+
var import_react88 = require("react");
|
|
29221
|
+
var import_antd87 = require("antd");
|
|
29222
|
+
var import_lucide_react30 = require("lucide-react");
|
|
29223
|
+
var import_jsx_runtime116 = require("react/jsx-runtime");
|
|
29224
|
+
var { Text: Text38, Title: Title14 } = import_antd87.Typography;
|
|
29225
|
+
var MAPPING_MODE_OPTIONS = [
|
|
29226
|
+
{ label: "User", value: "user" },
|
|
29227
|
+
{ label: "Group", value: "group" },
|
|
29228
|
+
{ label: "Hybrid", value: "hybrid" }
|
|
29229
|
+
];
|
|
29230
|
+
var ChannelInstallationsDrawerContent = () => {
|
|
29231
|
+
const { get, post, put, del } = useApi();
|
|
29232
|
+
const [installations, setInstallations] = (0, import_react88.useState)([]);
|
|
29233
|
+
const [loading, setLoading] = (0, import_react88.useState)(false);
|
|
29234
|
+
const [formModalOpen, setFormModalOpen] = (0, import_react88.useState)(false);
|
|
29235
|
+
const [editingInstallation, setEditingInstallation] = (0, import_react88.useState)(null);
|
|
29236
|
+
const loadInstallations = async () => {
|
|
29237
|
+
setLoading(true);
|
|
29238
|
+
try {
|
|
29239
|
+
const result = await get(
|
|
29240
|
+
"/api/channel-installations"
|
|
29241
|
+
);
|
|
29242
|
+
if (result.success) {
|
|
29243
|
+
setInstallations(result.data?.records ?? []);
|
|
29244
|
+
} else {
|
|
29245
|
+
setInstallations([]);
|
|
29246
|
+
import_antd87.message.error(result.message || "Failed to load channel installations");
|
|
29247
|
+
}
|
|
29248
|
+
} catch (error) {
|
|
29249
|
+
console.error("Failed to load channel installations:", error);
|
|
29250
|
+
setInstallations([]);
|
|
29251
|
+
import_antd87.message.error("Failed to load channel installations");
|
|
29252
|
+
} finally {
|
|
29253
|
+
setLoading(false);
|
|
29254
|
+
}
|
|
29255
|
+
};
|
|
29256
|
+
(0, import_react88.useEffect)(() => {
|
|
29257
|
+
loadInstallations();
|
|
29258
|
+
}, []);
|
|
29259
|
+
const handleDelete = async (installation) => {
|
|
29260
|
+
try {
|
|
29261
|
+
const result = await del(
|
|
29262
|
+
`/api/channel-installations/${installation.id}`
|
|
29263
|
+
);
|
|
29264
|
+
if (result.success) {
|
|
29265
|
+
setInstallations(
|
|
29266
|
+
(current) => current.filter((item) => item.id !== installation.id)
|
|
29267
|
+
);
|
|
29268
|
+
import_antd87.message.success("Installation deleted");
|
|
29269
|
+
} else {
|
|
29270
|
+
import_antd87.message.error(result.message || "Failed to delete installation");
|
|
29271
|
+
}
|
|
29272
|
+
} catch (error) {
|
|
29273
|
+
console.error("Failed to delete channel installation:", error);
|
|
29274
|
+
import_antd87.message.error("Failed to delete installation");
|
|
29275
|
+
}
|
|
29276
|
+
};
|
|
29277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
|
|
29278
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { style: { padding: 16 }, children: /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(
|
|
29279
|
+
"div",
|
|
29280
|
+
{
|
|
29281
|
+
style: {
|
|
29282
|
+
display: "flex",
|
|
29283
|
+
justifyContent: "space-between",
|
|
29284
|
+
alignItems: "center"
|
|
29285
|
+
},
|
|
29286
|
+
children: [
|
|
29287
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Title14, { level: 5, style: { margin: 0 }, children: "Channel Installations" }),
|
|
29288
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
29289
|
+
import_antd87.Button,
|
|
29290
|
+
{
|
|
29291
|
+
type: "primary",
|
|
29292
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_lucide_react30.Plus, { size: 16 }),
|
|
29293
|
+
onClick: () => {
|
|
29294
|
+
setEditingInstallation(null);
|
|
29295
|
+
setFormModalOpen(true);
|
|
29296
|
+
},
|
|
29297
|
+
children: "Add Installation"
|
|
29298
|
+
}
|
|
29299
|
+
)
|
|
29300
|
+
]
|
|
29301
|
+
}
|
|
29302
|
+
) }),
|
|
29303
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { style: { flex: 1, overflowY: "auto", padding: 16 }, children: loading ? /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { style: { display: "flex", justifyContent: "center", padding: 32 }, children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Spin, {}) }) : installations.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(
|
|
29304
|
+
"div",
|
|
29305
|
+
{
|
|
29306
|
+
style: {
|
|
29307
|
+
display: "flex",
|
|
29308
|
+
flexDirection: "column",
|
|
29309
|
+
alignItems: "center",
|
|
29310
|
+
justifyContent: "center",
|
|
29311
|
+
padding: "48px 16px"
|
|
29312
|
+
},
|
|
29313
|
+
children: [
|
|
29314
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_lucide_react30.RadioTower, { size: 48, style: { marginBottom: 16, opacity: 0.5 } }),
|
|
29315
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Text38, { strong: true, style: { fontSize: 15 }, children: "No channel installations" }),
|
|
29316
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Text38, { type: "secondary", style: { marginTop: 8 }, children: 'Click "Add Installation" to create one' })
|
|
29317
|
+
]
|
|
29318
|
+
}
|
|
29319
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: installations.map((installation) => {
|
|
29320
|
+
const webhookPath = installation.channel === "lark" ? `/api/channels/lark/installations/${installation.id}/events` : null;
|
|
29321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(import_antd87.Card, { size: "small", children: [
|
|
29322
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(
|
|
29323
|
+
"div",
|
|
29324
|
+
{
|
|
29325
|
+
style: {
|
|
29326
|
+
display: "flex",
|
|
29327
|
+
justifyContent: "space-between",
|
|
29328
|
+
alignItems: "flex-start",
|
|
29329
|
+
marginBottom: 10
|
|
29330
|
+
},
|
|
29331
|
+
children: [
|
|
29332
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Text38, { strong: true, style: { fontSize: 15 }, children: installation.name || installation.id }),
|
|
29333
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Tag, { color: "blue", children: installation.channel })
|
|
29334
|
+
]
|
|
29335
|
+
}
|
|
29336
|
+
),
|
|
29337
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(
|
|
29338
|
+
"div",
|
|
29339
|
+
{
|
|
29340
|
+
style: {
|
|
29341
|
+
display: "flex",
|
|
29342
|
+
flexDirection: "column",
|
|
29343
|
+
gap: 6,
|
|
29344
|
+
marginBottom: 12
|
|
29345
|
+
},
|
|
29346
|
+
children: [
|
|
29347
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(Text38, { type: "secondary", style: { fontSize: 12 }, children: [
|
|
29348
|
+
"ID: ",
|
|
29349
|
+
installation.id
|
|
29350
|
+
] }),
|
|
29351
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(Text38, { style: { fontSize: 13 }, children: [
|
|
29352
|
+
"Assistant ID: ",
|
|
29353
|
+
installation.config.assistantId
|
|
29354
|
+
] }),
|
|
29355
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(Text38, { style: { fontSize: 13 }, children: [
|
|
29356
|
+
"Mapping Mode: ",
|
|
29357
|
+
installation.config.mappingMode
|
|
29358
|
+
] }),
|
|
29359
|
+
installation.config.workspaceId ? /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(Text38, { style: { fontSize: 13 }, children: [
|
|
29360
|
+
"Workspace ID: ",
|
|
29361
|
+
installation.config.workspaceId
|
|
29362
|
+
] }) : null,
|
|
29363
|
+
installation.config.projectId ? /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(Text38, { style: { fontSize: 13 }, children: [
|
|
29364
|
+
"Project ID: ",
|
|
29365
|
+
installation.config.projectId
|
|
29366
|
+
] }) : null,
|
|
29367
|
+
webhookPath ? /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Text38, { code: true, style: { fontSize: 12 }, children: webhookPath }) : /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Text38, { type: "secondary", style: { fontSize: 12 }, children: "Unsupported channel configuration UI" })
|
|
29368
|
+
]
|
|
29369
|
+
}
|
|
29370
|
+
),
|
|
29371
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { style: { display: "flex", gap: 8 }, children: [
|
|
29372
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
29373
|
+
import_antd87.Button,
|
|
29374
|
+
{
|
|
29375
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_lucide_react30.Edit2, { size: 14 }),
|
|
29376
|
+
onClick: () => {
|
|
29377
|
+
setEditingInstallation(installation);
|
|
29378
|
+
setFormModalOpen(true);
|
|
29379
|
+
},
|
|
29380
|
+
children: "Edit"
|
|
29381
|
+
}
|
|
29382
|
+
),
|
|
29383
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
29384
|
+
import_antd87.Popconfirm,
|
|
29385
|
+
{
|
|
29386
|
+
title: "Delete Channel Installation",
|
|
29387
|
+
description: `Are you sure you want to delete "${installation.name || installation.id}"?`,
|
|
29388
|
+
onConfirm: () => handleDelete(installation),
|
|
29389
|
+
okText: "Delete",
|
|
29390
|
+
okType: "danger",
|
|
29391
|
+
cancelText: "Cancel",
|
|
29392
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Button, { danger: true, icon: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_lucide_react30.Trash2, { size: 14 }), children: "Delete" })
|
|
29393
|
+
}
|
|
29394
|
+
)
|
|
29395
|
+
] })
|
|
29396
|
+
] }, installation.id);
|
|
29397
|
+
}) }) }),
|
|
29398
|
+
formModalOpen ? /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
29399
|
+
LarkChannelInstallationFormModal,
|
|
29400
|
+
{
|
|
29401
|
+
installation: editingInstallation,
|
|
29402
|
+
open: formModalOpen,
|
|
29403
|
+
post,
|
|
29404
|
+
put,
|
|
29405
|
+
onCancel: () => {
|
|
29406
|
+
setFormModalOpen(false);
|
|
29407
|
+
setEditingInstallation(null);
|
|
29408
|
+
},
|
|
29409
|
+
onSave: () => {
|
|
29410
|
+
setFormModalOpen(false);
|
|
29411
|
+
setEditingInstallation(null);
|
|
29412
|
+
loadInstallations();
|
|
29413
|
+
}
|
|
29414
|
+
}
|
|
29415
|
+
) : null
|
|
29416
|
+
] });
|
|
29417
|
+
};
|
|
29418
|
+
var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCancel, onSave }) => {
|
|
29419
|
+
const [form] = import_antd87.Form.useForm();
|
|
29420
|
+
(0, import_react88.useEffect)(() => {
|
|
29421
|
+
if (installation) {
|
|
29422
|
+
form.setFieldsValue({
|
|
29423
|
+
name: installation.name,
|
|
29424
|
+
appId: installation.config.appId,
|
|
29425
|
+
appSecret: installation.config.appSecret,
|
|
29426
|
+
verificationToken: installation.config.verificationToken,
|
|
29427
|
+
encryptKey: installation.config.encryptKey,
|
|
29428
|
+
mappingMode: installation.config.mappingMode,
|
|
29429
|
+
assistantId: installation.config.assistantId,
|
|
29430
|
+
workspaceId: installation.config.workspaceId,
|
|
29431
|
+
projectId: installation.config.projectId
|
|
29432
|
+
});
|
|
29433
|
+
return;
|
|
29434
|
+
}
|
|
29435
|
+
form.resetFields();
|
|
29436
|
+
form.setFieldsValue({
|
|
29437
|
+
mappingMode: "hybrid"
|
|
29438
|
+
});
|
|
29439
|
+
}, [installation, form]);
|
|
29440
|
+
const handleSubmit = async () => {
|
|
29441
|
+
const values = await form.validateFields();
|
|
29442
|
+
const config = {
|
|
29443
|
+
appId: values.appId,
|
|
29444
|
+
appSecret: values.appSecret,
|
|
29445
|
+
verificationToken: values.verificationToken,
|
|
29446
|
+
encryptKey: values.encryptKey,
|
|
29447
|
+
mappingMode: values.mappingMode,
|
|
29448
|
+
assistantId: values.assistantId,
|
|
29449
|
+
workspaceId: values.workspaceId,
|
|
29450
|
+
projectId: values.projectId
|
|
29451
|
+
};
|
|
29452
|
+
try {
|
|
29453
|
+
if (installation) {
|
|
29454
|
+
const payload2 = {
|
|
29455
|
+
name: values.name,
|
|
29456
|
+
config
|
|
29457
|
+
};
|
|
29458
|
+
const result2 = await put(
|
|
29459
|
+
`/api/channel-installations/${installation.id}`,
|
|
29460
|
+
payload2
|
|
29461
|
+
);
|
|
29462
|
+
if (result2.success) {
|
|
29463
|
+
import_antd87.message.success("Installation updated");
|
|
29464
|
+
onSave();
|
|
29465
|
+
} else {
|
|
29466
|
+
import_antd87.message.error(result2.message || "Failed to update installation");
|
|
29467
|
+
}
|
|
29468
|
+
return;
|
|
29469
|
+
}
|
|
29470
|
+
const payload = {
|
|
29471
|
+
channel: "lark",
|
|
29472
|
+
name: values.name,
|
|
29473
|
+
config
|
|
29474
|
+
};
|
|
29475
|
+
const result = await post(
|
|
29476
|
+
"/api/channel-installations",
|
|
29477
|
+
payload
|
|
29478
|
+
);
|
|
29479
|
+
if (result.success) {
|
|
29480
|
+
import_antd87.message.success("Installation created");
|
|
29481
|
+
onSave();
|
|
29482
|
+
} else {
|
|
29483
|
+
import_antd87.message.error(result.message || "Failed to create installation");
|
|
29484
|
+
}
|
|
29485
|
+
} catch (error) {
|
|
29486
|
+
console.error("Failed to save channel installation:", error);
|
|
29487
|
+
import_antd87.message.error(
|
|
29488
|
+
installation ? "Failed to update installation" : "Failed to create installation"
|
|
29489
|
+
);
|
|
29490
|
+
}
|
|
29491
|
+
};
|
|
29492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
29493
|
+
import_antd87.Modal,
|
|
29494
|
+
{
|
|
29495
|
+
open,
|
|
29496
|
+
title: installation ? "Edit Installation" : "Add Installation",
|
|
29497
|
+
onCancel,
|
|
29498
|
+
onOk: handleSubmit,
|
|
29499
|
+
okText: installation ? "Save" : "Create",
|
|
29500
|
+
destroyOnHidden: true,
|
|
29501
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(import_antd87.Form, { form, layout: "vertical", children: [
|
|
29502
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Form.Item, { label: "Channel", children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Input, { value: "lark", disabled: true }) }),
|
|
29503
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Form.Item, { name: "name", label: "Name", children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Input, {}) }),
|
|
29504
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
29505
|
+
import_antd87.Form.Item,
|
|
29506
|
+
{
|
|
29507
|
+
name: "appId",
|
|
29508
|
+
label: "App ID",
|
|
29509
|
+
rules: [{ required: true, message: "App ID is required" }],
|
|
29510
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Input, {})
|
|
29511
|
+
}
|
|
29512
|
+
),
|
|
29513
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
29514
|
+
import_antd87.Form.Item,
|
|
29515
|
+
{
|
|
29516
|
+
name: "appSecret",
|
|
29517
|
+
label: "App Secret",
|
|
29518
|
+
rules: [{ required: true, message: "App Secret is required" }],
|
|
29519
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Input, {})
|
|
29520
|
+
}
|
|
29521
|
+
),
|
|
29522
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Form.Item, { name: "verificationToken", label: "Verification Token", children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Input, {}) }),
|
|
29523
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Form.Item, { name: "encryptKey", label: "Encrypt Key", children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Input, {}) }),
|
|
29524
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
29525
|
+
import_antd87.Form.Item,
|
|
29526
|
+
{
|
|
29527
|
+
name: "mappingMode",
|
|
29528
|
+
label: "Mapping Mode",
|
|
29529
|
+
rules: [{ required: true, message: "Mapping Mode is required" }],
|
|
29530
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Select, { options: MAPPING_MODE_OPTIONS })
|
|
29531
|
+
}
|
|
29532
|
+
),
|
|
29533
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
29534
|
+
import_antd87.Form.Item,
|
|
29535
|
+
{
|
|
29536
|
+
name: "assistantId",
|
|
29537
|
+
label: "Assistant ID",
|
|
29538
|
+
rules: [{ required: true, message: "Assistant ID is required" }],
|
|
29539
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Input, {})
|
|
29540
|
+
}
|
|
29541
|
+
),
|
|
29542
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Form.Item, { name: "workspaceId", label: "Workspace ID", children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Input, {}) }),
|
|
29543
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Form.Item, { name: "projectId", label: "Project ID", children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Input, {}) })
|
|
29544
|
+
] })
|
|
29545
|
+
}
|
|
29546
|
+
);
|
|
29547
|
+
};
|
|
29193
29548
|
// Annotate the CommonJS export names for ESM import in node:
|
|
29194
29549
|
0 && (module.exports = {
|
|
29195
29550
|
AgentConversations,
|
|
@@ -29201,6 +29556,7 @@ var LatticeChatShell = (props) => {
|
|
|
29201
29556
|
AuthProvider,
|
|
29202
29557
|
AxiomLatticeProvider,
|
|
29203
29558
|
ChangePasswordModal,
|
|
29559
|
+
ChannelInstallationsDrawerContent,
|
|
29204
29560
|
ChatUIContext,
|
|
29205
29561
|
ChatUIContextProvider,
|
|
29206
29562
|
Chating,
|
|
@@ -29208,6 +29564,7 @@ var LatticeChatShell = (props) => {
|
|
|
29208
29564
|
ConversationContext,
|
|
29209
29565
|
ConversationContextProvider,
|
|
29210
29566
|
CreateAssistantModal,
|
|
29567
|
+
DEFAULT_MIDDLEWARE_TYPES,
|
|
29211
29568
|
FileExplorer,
|
|
29212
29569
|
LatticeChat,
|
|
29213
29570
|
LatticeChatShell,
|