@axiom-lattice/react-sdk 2.1.61 → 2.1.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +69 -115
- package/dist/index.d.ts +69 -115
- package/dist/index.js +1584 -1092
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1581 -1081
- 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
|
};
|
|
@@ -1061,20 +1063,20 @@ var DEFAULT_MIDDLEWARE_TYPES = [
|
|
|
1061
1063
|
type: "object",
|
|
1062
1064
|
title: "Filesystem Configuration",
|
|
1063
1065
|
description: "Configure filesystem isolation and access settings",
|
|
1064
|
-
required: ["
|
|
1066
|
+
required: ["vmIsolation"],
|
|
1065
1067
|
properties: {
|
|
1066
|
-
|
|
1068
|
+
vmIsolation: {
|
|
1067
1069
|
type: "string",
|
|
1068
|
-
title: "Isolation
|
|
1069
|
-
description: "Controls how filesystem access is isolated between agents and
|
|
1070
|
-
enum: ["global", "agent", "
|
|
1070
|
+
title: "VM Isolation",
|
|
1071
|
+
description: "Controls how filesystem access is isolated between agents and projects",
|
|
1072
|
+
enum: ["global", "agent", "project"],
|
|
1071
1073
|
default: "global",
|
|
1072
1074
|
widget: "segmented"
|
|
1073
1075
|
}
|
|
1074
1076
|
}
|
|
1075
1077
|
},
|
|
1076
1078
|
defaultConfig: {
|
|
1077
|
-
|
|
1079
|
+
vmIsolation: "global"
|
|
1078
1080
|
},
|
|
1079
1081
|
tools: [
|
|
1080
1082
|
{ id: "sandbox_ls", name: "List Files", description: "List files in the directory" },
|
|
@@ -1094,20 +1096,20 @@ var DEFAULT_MIDDLEWARE_TYPES = [
|
|
|
1094
1096
|
type: "object",
|
|
1095
1097
|
title: "Code Evaluation Configuration",
|
|
1096
1098
|
description: "Configure code execution sandbox settings",
|
|
1097
|
-
required: ["
|
|
1099
|
+
required: ["vmIsolation"],
|
|
1098
1100
|
properties: {
|
|
1099
|
-
|
|
1101
|
+
vmIsolation: {
|
|
1100
1102
|
type: "string",
|
|
1101
|
-
title: "Isolation
|
|
1102
|
-
description: "Controls how code execution is isolated between agents and
|
|
1103
|
-
enum: ["global", "agent", "
|
|
1103
|
+
title: "VM Isolation",
|
|
1104
|
+
description: "Controls how code execution is isolated between agents and projects",
|
|
1105
|
+
enum: ["global", "agent", "project"],
|
|
1104
1106
|
default: "global",
|
|
1105
1107
|
widget: "segmented"
|
|
1106
1108
|
}
|
|
1107
1109
|
}
|
|
1108
1110
|
},
|
|
1109
1111
|
defaultConfig: {
|
|
1110
|
-
|
|
1112
|
+
vmIsolation: "global"
|
|
1111
1113
|
},
|
|
1112
1114
|
tools: [
|
|
1113
1115
|
{ id: "execute_code", name: "Execute Code", description: "Execute code snippets" },
|
|
@@ -1123,20 +1125,20 @@ var DEFAULT_MIDDLEWARE_TYPES = [
|
|
|
1123
1125
|
type: "object",
|
|
1124
1126
|
title: "Browser Configuration",
|
|
1125
1127
|
description: "Configure browser automation settings",
|
|
1126
|
-
required: ["
|
|
1128
|
+
required: ["vmIsolation"],
|
|
1127
1129
|
properties: {
|
|
1128
|
-
|
|
1130
|
+
vmIsolation: {
|
|
1129
1131
|
type: "string",
|
|
1130
|
-
title: "Isolation
|
|
1131
|
-
description: "Controls how browser instances are isolated between agents and
|
|
1132
|
-
enum: ["global", "agent", "
|
|
1132
|
+
title: "VM Isolation",
|
|
1133
|
+
description: "Controls how browser instances are isolated between agents and projects",
|
|
1134
|
+
enum: ["global", "agent", "project"],
|
|
1133
1135
|
default: "agent",
|
|
1134
1136
|
widget: "segmented"
|
|
1135
1137
|
}
|
|
1136
1138
|
}
|
|
1137
1139
|
},
|
|
1138
1140
|
defaultConfig: {
|
|
1139
|
-
|
|
1141
|
+
vmIsolation: "agent",
|
|
1140
1142
|
headless: true
|
|
1141
1143
|
},
|
|
1142
1144
|
tools: [
|
|
@@ -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, {})
|
|
@@ -5315,12 +5423,239 @@ var import_antd8 = require("antd");
|
|
|
5315
5423
|
var import_antd_style4 = require("antd-style");
|
|
5316
5424
|
|
|
5317
5425
|
// src/components/GenUI/MarkdownViewer.tsx
|
|
5318
|
-
var import_react19 = require("react");
|
|
5426
|
+
var import_react19 = __toESM(require("react"));
|
|
5319
5427
|
var import_antd7 = require("antd");
|
|
5320
5428
|
var import_icons4 = require("@ant-design/icons");
|
|
5321
5429
|
var import_jspdf = require("jspdf");
|
|
5322
5430
|
var import_html2canvas = __toESM(require("html2canvas"));
|
|
5323
5431
|
var import_antd_style3 = require("antd-style");
|
|
5432
|
+
|
|
5433
|
+
// src/utils/fileUtils.ts
|
|
5434
|
+
function extractFileName(pathOrUrl) {
|
|
5435
|
+
if (!pathOrUrl) return "";
|
|
5436
|
+
const withoutQuery = pathOrUrl.split("?")[0];
|
|
5437
|
+
return withoutQuery.split("/").pop() || pathOrUrl;
|
|
5438
|
+
}
|
|
5439
|
+
function getFileExtension(pathOrUrl) {
|
|
5440
|
+
const fileName = extractFileName(pathOrUrl);
|
|
5441
|
+
if (!fileName) return "";
|
|
5442
|
+
const extension = fileName.split(".").pop()?.toLowerCase();
|
|
5443
|
+
return extension || "";
|
|
5444
|
+
}
|
|
5445
|
+
function getFileCategory(pathOrUrl) {
|
|
5446
|
+
const extension = getFileExtension(pathOrUrl);
|
|
5447
|
+
if (!extension) return "unknown";
|
|
5448
|
+
if (["md", "markdown", "mdx"].includes(extension)) return "markdown";
|
|
5449
|
+
if ([
|
|
5450
|
+
"txt",
|
|
5451
|
+
"json",
|
|
5452
|
+
"csv",
|
|
5453
|
+
"xml",
|
|
5454
|
+
"yaml",
|
|
5455
|
+
"yml",
|
|
5456
|
+
"ini",
|
|
5457
|
+
"conf",
|
|
5458
|
+
"sh",
|
|
5459
|
+
"bat",
|
|
5460
|
+
"cmd",
|
|
5461
|
+
"ts",
|
|
5462
|
+
"tsx",
|
|
5463
|
+
"js",
|
|
5464
|
+
"jsx",
|
|
5465
|
+
"mjs",
|
|
5466
|
+
"cjs",
|
|
5467
|
+
"py",
|
|
5468
|
+
"rb",
|
|
5469
|
+
"go",
|
|
5470
|
+
"rs",
|
|
5471
|
+
"java",
|
|
5472
|
+
"kt",
|
|
5473
|
+
"swift",
|
|
5474
|
+
"c",
|
|
5475
|
+
"cpp",
|
|
5476
|
+
"h",
|
|
5477
|
+
"hpp",
|
|
5478
|
+
"cs",
|
|
5479
|
+
"php",
|
|
5480
|
+
"vue",
|
|
5481
|
+
"svelte",
|
|
5482
|
+
"sql",
|
|
5483
|
+
"css",
|
|
5484
|
+
"less",
|
|
5485
|
+
"scss",
|
|
5486
|
+
"bash",
|
|
5487
|
+
"zsh",
|
|
5488
|
+
"toml"
|
|
5489
|
+
].includes(extension)) {
|
|
5490
|
+
return "text";
|
|
5491
|
+
}
|
|
5492
|
+
if (["jpg", "jpeg", "png", "gif", "svg", "bmp", "webp", "ico", "tiff", "tif"].includes(extension)) {
|
|
5493
|
+
return "image";
|
|
5494
|
+
}
|
|
5495
|
+
if (extension === "pdf") return "pdf";
|
|
5496
|
+
if (["mp3", "wav", "ogg", "flac", "aac", "m4a", "wma"].includes(extension)) return "audio";
|
|
5497
|
+
if (["mp4", "webm", "ogv", "mov", "avi", "mkv", "flv"].includes(extension)) return "video";
|
|
5498
|
+
if (["html", "htm"].includes(extension)) return "iframe";
|
|
5499
|
+
return "unknown";
|
|
5500
|
+
}
|
|
5501
|
+
function getLanguageFromFileName(pathOrUrl) {
|
|
5502
|
+
const ext = getFileExtension(pathOrUrl);
|
|
5503
|
+
switch (ext) {
|
|
5504
|
+
case "ts":
|
|
5505
|
+
case "tsx":
|
|
5506
|
+
return "typescript";
|
|
5507
|
+
case "js":
|
|
5508
|
+
case "jsx":
|
|
5509
|
+
case "mjs":
|
|
5510
|
+
case "cjs":
|
|
5511
|
+
return "javascript";
|
|
5512
|
+
case "py":
|
|
5513
|
+
return "python";
|
|
5514
|
+
case "rb":
|
|
5515
|
+
return "ruby";
|
|
5516
|
+
case "go":
|
|
5517
|
+
return "go";
|
|
5518
|
+
case "md":
|
|
5519
|
+
case "markdown":
|
|
5520
|
+
case "mdx":
|
|
5521
|
+
return "markdown";
|
|
5522
|
+
case "json":
|
|
5523
|
+
return "json";
|
|
5524
|
+
case "html":
|
|
5525
|
+
case "htm":
|
|
5526
|
+
return "html";
|
|
5527
|
+
case "css":
|
|
5528
|
+
return "css";
|
|
5529
|
+
case "less":
|
|
5530
|
+
return "less";
|
|
5531
|
+
case "scss":
|
|
5532
|
+
return "scss";
|
|
5533
|
+
case "java":
|
|
5534
|
+
return "java";
|
|
5535
|
+
case "kt":
|
|
5536
|
+
return "kotlin";
|
|
5537
|
+
case "swift":
|
|
5538
|
+
return "swift";
|
|
5539
|
+
case "rs":
|
|
5540
|
+
return "rust";
|
|
5541
|
+
case "c":
|
|
5542
|
+
case "h":
|
|
5543
|
+
return "c";
|
|
5544
|
+
case "cpp":
|
|
5545
|
+
case "hpp":
|
|
5546
|
+
return "cpp";
|
|
5547
|
+
case "cs":
|
|
5548
|
+
return "csharp";
|
|
5549
|
+
case "php":
|
|
5550
|
+
return "php";
|
|
5551
|
+
case "vue":
|
|
5552
|
+
return "vue";
|
|
5553
|
+
case "svelte":
|
|
5554
|
+
return "svelte";
|
|
5555
|
+
case "yaml":
|
|
5556
|
+
case "yml":
|
|
5557
|
+
return "yaml";
|
|
5558
|
+
case "sql":
|
|
5559
|
+
return "sql";
|
|
5560
|
+
case "sh":
|
|
5561
|
+
case "bash":
|
|
5562
|
+
case "zsh":
|
|
5563
|
+
return "bash";
|
|
5564
|
+
case "toml":
|
|
5565
|
+
return "toml";
|
|
5566
|
+
case "xml":
|
|
5567
|
+
return "xml";
|
|
5568
|
+
case "ini":
|
|
5569
|
+
case "conf":
|
|
5570
|
+
return "ini";
|
|
5571
|
+
default:
|
|
5572
|
+
return "text";
|
|
5573
|
+
}
|
|
5574
|
+
}
|
|
5575
|
+
function canPreviewInline(pathOrUrl) {
|
|
5576
|
+
const category = getFileCategory(pathOrUrl);
|
|
5577
|
+
return category !== "unknown";
|
|
5578
|
+
}
|
|
5579
|
+
function isTextFile(pathOrUrl) {
|
|
5580
|
+
const category = getFileCategory(pathOrUrl);
|
|
5581
|
+
return category === "markdown" || category === "text";
|
|
5582
|
+
}
|
|
5583
|
+
var COMMON_FILE_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
5584
|
+
// Code
|
|
5585
|
+
"ts",
|
|
5586
|
+
"tsx",
|
|
5587
|
+
"js",
|
|
5588
|
+
"jsx",
|
|
5589
|
+
"mjs",
|
|
5590
|
+
"cjs",
|
|
5591
|
+
"html",
|
|
5592
|
+
"htm",
|
|
5593
|
+
"css",
|
|
5594
|
+
"less",
|
|
5595
|
+
"scss",
|
|
5596
|
+
"md",
|
|
5597
|
+
"txt",
|
|
5598
|
+
"mdx",
|
|
5599
|
+
"json",
|
|
5600
|
+
"yaml",
|
|
5601
|
+
"yml",
|
|
5602
|
+
"py",
|
|
5603
|
+
"rb",
|
|
5604
|
+
"go",
|
|
5605
|
+
"rs",
|
|
5606
|
+
"java",
|
|
5607
|
+
"kt",
|
|
5608
|
+
"swift",
|
|
5609
|
+
"c",
|
|
5610
|
+
"cpp",
|
|
5611
|
+
"h",
|
|
5612
|
+
"hpp",
|
|
5613
|
+
"cs",
|
|
5614
|
+
"php",
|
|
5615
|
+
"vue",
|
|
5616
|
+
"svelte",
|
|
5617
|
+
"sql",
|
|
5618
|
+
"sh",
|
|
5619
|
+
"bash",
|
|
5620
|
+
"zsh",
|
|
5621
|
+
"toml",
|
|
5622
|
+
"xml",
|
|
5623
|
+
// Media
|
|
5624
|
+
"png",
|
|
5625
|
+
"jpg",
|
|
5626
|
+
"jpeg",
|
|
5627
|
+
"gif",
|
|
5628
|
+
"svg",
|
|
5629
|
+
"webp",
|
|
5630
|
+
"ico",
|
|
5631
|
+
"mp4",
|
|
5632
|
+
"webm",
|
|
5633
|
+
"mp3",
|
|
5634
|
+
"wav",
|
|
5635
|
+
"pdf",
|
|
5636
|
+
// Office
|
|
5637
|
+
"ppt",
|
|
5638
|
+
"pptx",
|
|
5639
|
+
"doc",
|
|
5640
|
+
"docx",
|
|
5641
|
+
"xls",
|
|
5642
|
+
"xlsx",
|
|
5643
|
+
"odt",
|
|
5644
|
+
"ods",
|
|
5645
|
+
"odp",
|
|
5646
|
+
"rtf",
|
|
5647
|
+
"csv",
|
|
5648
|
+
"key",
|
|
5649
|
+
"numbers",
|
|
5650
|
+
"pages"
|
|
5651
|
+
]);
|
|
5652
|
+
function isFileName(value) {
|
|
5653
|
+
if (!value || typeof value !== "string" || !value.trim()) return false;
|
|
5654
|
+
const ext = getFileExtension(value);
|
|
5655
|
+
return ext ? COMMON_FILE_EXTENSIONS.has(ext) : false;
|
|
5656
|
+
}
|
|
5657
|
+
|
|
5658
|
+
// src/components/GenUI/MarkdownViewer.tsx
|
|
5324
5659
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
5325
5660
|
var useStyles = (0, import_antd_style3.createStyles)(({ token, css }) => ({
|
|
5326
5661
|
container: css`
|
|
@@ -5473,6 +5808,15 @@ var MarkdownViewer = ({
|
|
|
5473
5808
|
import_antd7.message.error({ content: "Failed to generate PDF", key: "pdf" });
|
|
5474
5809
|
}
|
|
5475
5810
|
};
|
|
5811
|
+
const displayContent = import_react19.default.useMemo(() => {
|
|
5812
|
+
const lang = getLanguageFromFileName(fileName);
|
|
5813
|
+
if (lang && lang !== "markdown" && lang !== "text") {
|
|
5814
|
+
return `\`\`\`${lang}
|
|
5815
|
+
${content}
|
|
5816
|
+
\`\`\``;
|
|
5817
|
+
}
|
|
5818
|
+
return content;
|
|
5819
|
+
}, [content, fileName]);
|
|
5476
5820
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: cx(styles.container, className), style, children: [
|
|
5477
5821
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: styles.header, children: [
|
|
5478
5822
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_antd7.Tooltip, { title: "Copy Content", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
@@ -5512,125 +5856,12 @@ var MarkdownViewer = ({
|
|
|
5512
5856
|
}
|
|
5513
5857
|
) })
|
|
5514
5858
|
] }),
|
|
5515
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: styles.contentBody, ref: contentRef, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(MDResponse, { content }) })
|
|
5859
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: styles.contentBody, ref: contentRef, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(MDResponse, { content: displayContent }) })
|
|
5516
5860
|
] });
|
|
5517
5861
|
};
|
|
5518
5862
|
|
|
5519
5863
|
// src/components/GenUI/FileRenderer.tsx
|
|
5520
5864
|
var import_icons5 = require("@ant-design/icons");
|
|
5521
|
-
|
|
5522
|
-
// src/utils/fileUtils.ts
|
|
5523
|
-
function extractFileName(pathOrUrl) {
|
|
5524
|
-
if (!pathOrUrl) return "";
|
|
5525
|
-
const withoutQuery = pathOrUrl.split("?")[0];
|
|
5526
|
-
return withoutQuery.split("/").pop() || pathOrUrl;
|
|
5527
|
-
}
|
|
5528
|
-
function getFileExtension(pathOrUrl) {
|
|
5529
|
-
const fileName = extractFileName(pathOrUrl);
|
|
5530
|
-
if (!fileName) return "";
|
|
5531
|
-
const extension = fileName.split(".").pop()?.toLowerCase();
|
|
5532
|
-
return extension || "";
|
|
5533
|
-
}
|
|
5534
|
-
function getFileCategory(pathOrUrl) {
|
|
5535
|
-
const extension = getFileExtension(pathOrUrl);
|
|
5536
|
-
if (!extension) return "unknown";
|
|
5537
|
-
if (["md", "markdown", "mdx"].includes(extension)) return "markdown";
|
|
5538
|
-
if (["txt", "json", "csv", "xml", "yaml", "yml", "ini", "conf", "sh", "bat", "cmd"].includes(extension)) {
|
|
5539
|
-
return "text";
|
|
5540
|
-
}
|
|
5541
|
-
if (["jpg", "jpeg", "png", "gif", "svg", "bmp", "webp", "ico", "tiff", "tif"].includes(extension)) {
|
|
5542
|
-
return "image";
|
|
5543
|
-
}
|
|
5544
|
-
if (extension === "pdf") return "pdf";
|
|
5545
|
-
if (["mp3", "wav", "ogg", "flac", "aac", "m4a", "wma"].includes(extension)) return "audio";
|
|
5546
|
-
if (["mp4", "webm", "ogv", "mov", "avi", "mkv", "flv"].includes(extension)) return "video";
|
|
5547
|
-
if (["html", "htm"].includes(extension)) return "iframe";
|
|
5548
|
-
return "unknown";
|
|
5549
|
-
}
|
|
5550
|
-
function canPreviewInline(pathOrUrl) {
|
|
5551
|
-
const category = getFileCategory(pathOrUrl);
|
|
5552
|
-
return category !== "unknown";
|
|
5553
|
-
}
|
|
5554
|
-
function isTextFile(pathOrUrl) {
|
|
5555
|
-
const category = getFileCategory(pathOrUrl);
|
|
5556
|
-
return category === "markdown" || category === "text";
|
|
5557
|
-
}
|
|
5558
|
-
var COMMON_FILE_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
5559
|
-
// Code
|
|
5560
|
-
"ts",
|
|
5561
|
-
"tsx",
|
|
5562
|
-
"js",
|
|
5563
|
-
"jsx",
|
|
5564
|
-
"mjs",
|
|
5565
|
-
"cjs",
|
|
5566
|
-
"html",
|
|
5567
|
-
"htm",
|
|
5568
|
-
"css",
|
|
5569
|
-
"less",
|
|
5570
|
-
"scss",
|
|
5571
|
-
"md",
|
|
5572
|
-
"txt",
|
|
5573
|
-
"mdx",
|
|
5574
|
-
"json",
|
|
5575
|
-
"yaml",
|
|
5576
|
-
"yml",
|
|
5577
|
-
"py",
|
|
5578
|
-
"rb",
|
|
5579
|
-
"go",
|
|
5580
|
-
"rs",
|
|
5581
|
-
"java",
|
|
5582
|
-
"kt",
|
|
5583
|
-
"swift",
|
|
5584
|
-
"c",
|
|
5585
|
-
"cpp",
|
|
5586
|
-
"h",
|
|
5587
|
-
"hpp",
|
|
5588
|
-
"cs",
|
|
5589
|
-
"php",
|
|
5590
|
-
"vue",
|
|
5591
|
-
"svelte",
|
|
5592
|
-
"sql",
|
|
5593
|
-
"sh",
|
|
5594
|
-
"bash",
|
|
5595
|
-
"zsh",
|
|
5596
|
-
"toml",
|
|
5597
|
-
"xml",
|
|
5598
|
-
// Media
|
|
5599
|
-
"png",
|
|
5600
|
-
"jpg",
|
|
5601
|
-
"jpeg",
|
|
5602
|
-
"gif",
|
|
5603
|
-
"svg",
|
|
5604
|
-
"webp",
|
|
5605
|
-
"ico",
|
|
5606
|
-
"mp4",
|
|
5607
|
-
"webm",
|
|
5608
|
-
"mp3",
|
|
5609
|
-
"wav",
|
|
5610
|
-
"pdf",
|
|
5611
|
-
// Office
|
|
5612
|
-
"ppt",
|
|
5613
|
-
"pptx",
|
|
5614
|
-
"doc",
|
|
5615
|
-
"docx",
|
|
5616
|
-
"xls",
|
|
5617
|
-
"xlsx",
|
|
5618
|
-
"odt",
|
|
5619
|
-
"ods",
|
|
5620
|
-
"odp",
|
|
5621
|
-
"rtf",
|
|
5622
|
-
"csv",
|
|
5623
|
-
"key",
|
|
5624
|
-
"numbers",
|
|
5625
|
-
"pages"
|
|
5626
|
-
]);
|
|
5627
|
-
function isFileName(value) {
|
|
5628
|
-
if (!value || typeof value !== "string" || !value.trim()) return false;
|
|
5629
|
-
const ext = getFileExtension(value);
|
|
5630
|
-
return ext ? COMMON_FILE_EXTENSIONS.has(ext) : false;
|
|
5631
|
-
}
|
|
5632
|
-
|
|
5633
|
-
// src/components/GenUI/FileRenderer.tsx
|
|
5634
5865
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
5635
5866
|
var useStyles2 = (0, import_antd_style4.createStyles)(({ token, css }) => ({
|
|
5636
5867
|
container: css`
|
|
@@ -6262,11 +6493,11 @@ var ConfirmFeedback = ({
|
|
|
6262
6493
|
data,
|
|
6263
6494
|
interactive = true
|
|
6264
6495
|
}) => {
|
|
6265
|
-
const { message:
|
|
6496
|
+
const { message: message21, type, config, feedback, options } = data ?? {};
|
|
6266
6497
|
const { sendMessage } = useAgentChat();
|
|
6267
6498
|
const [clicked, setClicked] = (0, import_react25.useState)(false);
|
|
6268
6499
|
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:
|
|
6500
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(MDResponse, { content: message21 }),
|
|
6270
6501
|
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
6502
|
import_antd12.Button,
|
|
6272
6503
|
{
|
|
@@ -7490,7 +7721,7 @@ var AttachmentsCard = ({
|
|
|
7490
7721
|
const { config } = useLatticeChatShellContext();
|
|
7491
7722
|
const baseURL = config.baseURL;
|
|
7492
7723
|
const fileBaseURL = `${baseURL}/api/assistants/${assistantId}/threads/${threadId}/sandbox/downloadfile?path=`;
|
|
7493
|
-
const { Text:
|
|
7724
|
+
const { Text: Text39 } = import_antd19.Typography;
|
|
7494
7725
|
const [showAll, setShowAll] = (0, import_react29.useState)(false);
|
|
7495
7726
|
const { openSideApp } = useChatUIContext();
|
|
7496
7727
|
const getStyles = () => {
|
|
@@ -7564,7 +7795,7 @@ var AttachmentsCard = ({
|
|
|
7564
7795
|
);
|
|
7565
7796
|
};
|
|
7566
7797
|
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
|
-
|
|
7798
|
+
Text39,
|
|
7568
7799
|
{
|
|
7569
7800
|
type: "secondary",
|
|
7570
7801
|
style: {
|
|
@@ -7638,7 +7869,7 @@ var AttachmentsCard = ({
|
|
|
7638
7869
|
}
|
|
7639
7870
|
),
|
|
7640
7871
|
item.files && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { style: { paddingLeft: "12px" }, children: [
|
|
7641
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
7872
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text39, { type: "secondary", style: { fontSize: "12px" }, children: [
|
|
7642
7873
|
"Contains ",
|
|
7643
7874
|
item.files.length,
|
|
7644
7875
|
" file(s)"
|
|
@@ -8293,7 +8524,7 @@ var import_ErrorBoundary = __toESM(require("antd/es/alert/ErrorBoundary"));
|
|
|
8293
8524
|
var import_react32 = require("react");
|
|
8294
8525
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
8295
8526
|
var LazyBubble = ({
|
|
8296
|
-
message:
|
|
8527
|
+
message: message21,
|
|
8297
8528
|
renderContent,
|
|
8298
8529
|
autoLoadRightPanel
|
|
8299
8530
|
}) => {
|
|
@@ -8324,10 +8555,10 @@ var LazyBubble = ({
|
|
|
8324
8555
|
autoLoadRightPanel?.();
|
|
8325
8556
|
}, []);
|
|
8326
8557
|
const getPlaceholder = () => {
|
|
8327
|
-
const estimatedHeight =
|
|
8558
|
+
const estimatedHeight = message21.content ? Math.min(100, message21.content.length / 5) : 100;
|
|
8328
8559
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { style: { height: `${estimatedHeight}px`, minHeight: "50px" } });
|
|
8329
8560
|
};
|
|
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(
|
|
8561
|
+
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
8562
|
};
|
|
8332
8563
|
var MemoizedBubbleList = (0, import_react32.memo)(
|
|
8333
8564
|
({
|
|
@@ -8358,8 +8589,8 @@ var MessageList = ({
|
|
|
8358
8589
|
messageLengthRef.current = messages?.length;
|
|
8359
8590
|
}
|
|
8360
8591
|
}, [messages?.length]);
|
|
8361
|
-
const renderContent = (0, import_react32.useCallback)((
|
|
8362
|
-
const { content } =
|
|
8592
|
+
const renderContent = (0, import_react32.useCallback)((message21) => {
|
|
8593
|
+
const { content } = message21;
|
|
8363
8594
|
try {
|
|
8364
8595
|
const json = JSON.parse(content);
|
|
8365
8596
|
if (json.action && json.message) {
|
|
@@ -8367,7 +8598,7 @@ var MessageList = ({
|
|
|
8367
8598
|
}
|
|
8368
8599
|
} catch (error) {
|
|
8369
8600
|
}
|
|
8370
|
-
const tool_calls_md =
|
|
8601
|
+
const tool_calls_md = message21.tool_calls?.map((tool_call) => {
|
|
8371
8602
|
return `\`\`\`tool_call
|
|
8372
8603
|
${JSON.stringify(tool_call)}
|
|
8373
8604
|
\`\`\``;
|
|
@@ -8376,17 +8607,17 @@ ${JSON.stringify(tool_call)}
|
|
|
8376
8607
|
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
8608
|
}, []);
|
|
8378
8609
|
const items = (0, import_react32.useMemo)(
|
|
8379
|
-
() => messages.map((
|
|
8380
|
-
key:
|
|
8381
|
-
role:
|
|
8610
|
+
() => messages.map((message21, index) => ({
|
|
8611
|
+
key: message21.id,
|
|
8612
|
+
role: message21.role,
|
|
8382
8613
|
typing: false,
|
|
8383
8614
|
content: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
8384
8615
|
LazyBubble,
|
|
8385
8616
|
{
|
|
8386
|
-
message:
|
|
8617
|
+
message: message21,
|
|
8387
8618
|
renderContent,
|
|
8388
8619
|
autoLoadRightPanel: () => {
|
|
8389
|
-
const { content, role: role2 } =
|
|
8620
|
+
const { content, role: role2 } = message21;
|
|
8390
8621
|
const isNewAddedMessage = messageLengthRef.current > 1 && messageLengthRef.current + 1 === messages.length;
|
|
8391
8622
|
if (index === messages.length - 1 && isNewAddedMessage && role2 === "ai") {
|
|
8392
8623
|
try {
|
|
@@ -10217,7 +10448,7 @@ var ProjectCardList = () => {
|
|
|
10217
10448
|
}
|
|
10218
10449
|
setIsCreateModalOpen(false);
|
|
10219
10450
|
};
|
|
10220
|
-
const
|
|
10451
|
+
const formatDate6 = (date) => {
|
|
10221
10452
|
const d = typeof date === "string" ? new Date(date) : date;
|
|
10222
10453
|
return d.toLocaleDateString("en-US", {
|
|
10223
10454
|
month: "short",
|
|
@@ -10308,7 +10539,7 @@ var ProjectCardList = () => {
|
|
|
10308
10539
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("h3", { className: styles.projectName, children: project.name }),
|
|
10309
10540
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("span", { className: styles.projectDate, children: [
|
|
10310
10541
|
"Created ",
|
|
10311
|
-
|
|
10542
|
+
formatDate6(project.createdAt)
|
|
10312
10543
|
] })
|
|
10313
10544
|
] })
|
|
10314
10545
|
] }) })
|
|
@@ -10326,7 +10557,7 @@ var ProjectCardList = () => {
|
|
|
10326
10557
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: styles.listProjectName, children: project.name }),
|
|
10327
10558
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("span", { className: styles.listProjectDate, children: [
|
|
10328
10559
|
"Created ",
|
|
10329
|
-
|
|
10560
|
+
formatDate6(project.createdAt)
|
|
10330
10561
|
] })
|
|
10331
10562
|
] })
|
|
10332
10563
|
] }, project.id))
|
|
@@ -13544,7 +13775,7 @@ var MiddlewareSectionCard = ({ middleware, middlewareType, onToggle, onConfigCha
|
|
|
13544
13775
|
if (key === "serverKeys" && middleware.config.connectAll === true) {
|
|
13545
13776
|
return null;
|
|
13546
13777
|
}
|
|
13547
|
-
if (key === "
|
|
13778
|
+
if (key === "vmIsolation") {
|
|
13548
13779
|
return null;
|
|
13549
13780
|
}
|
|
13550
13781
|
return renderConfigField(
|
|
@@ -15451,7 +15682,7 @@ var SkillNode = ({ data }) => {
|
|
|
15451
15682
|
) : [],
|
|
15452
15683
|
[currentSkill.metadata]
|
|
15453
15684
|
);
|
|
15454
|
-
const
|
|
15685
|
+
const formatDate6 = (value) => {
|
|
15455
15686
|
if (!value) return "";
|
|
15456
15687
|
const date = value instanceof Date ? value : new Date(value);
|
|
15457
15688
|
if (Number.isNaN(date.getTime())) return "";
|
|
@@ -16059,7 +16290,7 @@ var SkillNode = ({ data }) => {
|
|
|
16059
16290
|
},
|
|
16060
16291
|
children: [
|
|
16061
16292
|
"Created: ",
|
|
16062
|
-
|
|
16293
|
+
formatDate6(currentSkill.createdAt)
|
|
16063
16294
|
]
|
|
16064
16295
|
}
|
|
16065
16296
|
),
|
|
@@ -16073,7 +16304,7 @@ var SkillNode = ({ data }) => {
|
|
|
16073
16304
|
},
|
|
16074
16305
|
children: [
|
|
16075
16306
|
"Updated: ",
|
|
16076
|
-
|
|
16307
|
+
formatDate6(currentSkill.updatedAt)
|
|
16077
16308
|
]
|
|
16078
16309
|
}
|
|
16079
16310
|
)
|
|
@@ -17630,8 +17861,7 @@ var WorkspaceResourceManager = ({
|
|
|
17630
17861
|
}
|
|
17631
17862
|
),
|
|
17632
17863
|
logo,
|
|
17633
|
-
|
|
17634
|
-
right: null
|
|
17864
|
+
main: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(SideAppViewBrowser, { region: "content" })
|
|
17635
17865
|
}
|
|
17636
17866
|
),
|
|
17637
17867
|
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
@@ -17952,8 +18182,7 @@ var WorkspaceContextProvider = ({
|
|
|
17952
18182
|
);
|
|
17953
18183
|
const uploadFileToFolder = (0, import_react56.useCallback)(
|
|
17954
18184
|
async (folder, file) => {
|
|
17955
|
-
|
|
17956
|
-
return uploadFile(normalizedPath, file);
|
|
18185
|
+
return uploadFile(folder, file);
|
|
17957
18186
|
},
|
|
17958
18187
|
[uploadFile]
|
|
17959
18188
|
);
|
|
@@ -20317,6 +20546,11 @@ var useStyles8 = (0, import_antd_style20.createStyles)(({ token, css }) => ({
|
|
|
20317
20546
|
padding: 2px 6px;
|
|
20318
20547
|
border-radius: 4px;
|
|
20319
20548
|
font-size: 12px;
|
|
20549
|
+
`,
|
|
20550
|
+
messageContent: css`
|
|
20551
|
+
margin-top: 4px;
|
|
20552
|
+
max-width: 300px;
|
|
20553
|
+
word-break: break-word;
|
|
20320
20554
|
`
|
|
20321
20555
|
}));
|
|
20322
20556
|
var getStatusColor = (status) => {
|
|
@@ -20502,7 +20736,8 @@ var ScheduleViewer = ({ data }) => {
|
|
|
20502
20736
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: styles.taskHeader, children: [
|
|
20503
20737
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { children: [
|
|
20504
20738
|
/* @__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 })
|
|
20739
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: styles.taskId, children: task.taskId }),
|
|
20740
|
+
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
20741
|
] }),
|
|
20507
20742
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_antd64.Tag, { color: getStatusColor(task.status), icon: getStatusIcon2(task.status), children: task.status.toUpperCase() })
|
|
20508
20743
|
] }),
|
|
@@ -20542,19 +20777,6 @@ var ScheduleViewer = ({ data }) => {
|
|
|
20542
20777
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_icons34.ExclamationCircleOutlined, { style: { marginRight: 4 } }),
|
|
20543
20778
|
task.lastError
|
|
20544
20779
|
] }) }),
|
|
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
20780
|
isActive && renderActions(task)
|
|
20559
20781
|
]
|
|
20560
20782
|
},
|
|
@@ -23213,12 +23435,12 @@ var formatDate3 = (timestamp) => {
|
|
|
23213
23435
|
});
|
|
23214
23436
|
};
|
|
23215
23437
|
var MailboxDetailModal = ({
|
|
23216
|
-
message:
|
|
23438
|
+
message: message21,
|
|
23217
23439
|
visible,
|
|
23218
23440
|
onClose
|
|
23219
23441
|
}) => {
|
|
23220
23442
|
const { styles } = useStyles15();
|
|
23221
|
-
if (!
|
|
23443
|
+
if (!message21) return null;
|
|
23222
23444
|
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
23223
23445
|
import_antd74.Modal,
|
|
23224
23446
|
{
|
|
@@ -23241,12 +23463,12 @@ var MailboxDetailModal = ({
|
|
|
23241
23463
|
children: /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: styles.modalContent, children: [
|
|
23242
23464
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: styles.header, children: [
|
|
23243
23465
|
/* @__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
|
-
!
|
|
23466
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Text35, { className: styles.messageId, children: message21.id }),
|
|
23467
|
+
!message21.read && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_antd74.Tag, { color: "red", children: "Unread" })
|
|
23246
23468
|
] }),
|
|
23247
23469
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(Title11, { level: 4, className: styles.title, children: [
|
|
23248
23470
|
"Message from ",
|
|
23249
|
-
|
|
23471
|
+
message21.from
|
|
23250
23472
|
] }),
|
|
23251
23473
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: styles.metaSection, children: [
|
|
23252
23474
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: styles.metaItem, children: [
|
|
@@ -23256,11 +23478,11 @@ var MailboxDetailModal = ({
|
|
|
23256
23478
|
"div",
|
|
23257
23479
|
{
|
|
23258
23480
|
className: styles.avatar,
|
|
23259
|
-
style: { background: getAvatarColor7(
|
|
23260
|
-
children: getInitials7(
|
|
23481
|
+
style: { background: getAvatarColor7(message21.from) },
|
|
23482
|
+
children: getInitials7(message21.from)
|
|
23261
23483
|
}
|
|
23262
23484
|
),
|
|
23263
|
-
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { children:
|
|
23485
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { children: message21.from })
|
|
23264
23486
|
] })
|
|
23265
23487
|
] }),
|
|
23266
23488
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: styles.metaItem, children: [
|
|
@@ -23270,29 +23492,29 @@ var MailboxDetailModal = ({
|
|
|
23270
23492
|
"div",
|
|
23271
23493
|
{
|
|
23272
23494
|
className: styles.avatar,
|
|
23273
|
-
style: { background: getAvatarColor7(
|
|
23274
|
-
children: getInitials7(
|
|
23495
|
+
style: { background: getAvatarColor7(message21.to) },
|
|
23496
|
+
children: getInitials7(message21.to)
|
|
23275
23497
|
}
|
|
23276
23498
|
),
|
|
23277
|
-
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { children:
|
|
23499
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { children: message21.to })
|
|
23278
23500
|
] })
|
|
23279
23501
|
] }),
|
|
23280
23502
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: styles.metaItem, children: [
|
|
23281
23503
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Text35, { className: styles.metaLabel, children: "Time" }),
|
|
23282
23504
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: styles.metaValue, children: [
|
|
23283
23505
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_lucide_react22.Calendar, { size: 14 }),
|
|
23284
|
-
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { children: formatDate3(
|
|
23506
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { children: formatDate3(message21.timestamp) })
|
|
23285
23507
|
] })
|
|
23286
23508
|
] }),
|
|
23287
23509
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: styles.metaItem, children: [
|
|
23288
23510
|
/* @__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:
|
|
23511
|
+
/* @__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
23512
|
] })
|
|
23291
23513
|
] }),
|
|
23292
23514
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_antd74.Divider, {}),
|
|
23293
23515
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: styles.contentSection, children: [
|
|
23294
23516
|
/* @__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:
|
|
23517
|
+
/* @__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
23518
|
] })
|
|
23297
23519
|
] })
|
|
23298
23520
|
}
|
|
@@ -23521,26 +23743,26 @@ var MessageGroupComponent = ({ group, styles, defaultExpanded = true, onMessageC
|
|
|
23521
23743
|
]
|
|
23522
23744
|
}
|
|
23523
23745
|
),
|
|
23524
|
-
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: styles.listGroupContent, children: group.messages.map((
|
|
23746
|
+
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: styles.listGroupContent, children: group.messages.map((message21) => /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(
|
|
23525
23747
|
"div",
|
|
23526
23748
|
{
|
|
23527
|
-
className: `${styles.listItem} ${!
|
|
23528
|
-
onClick: () => onMessageClick(
|
|
23749
|
+
className: `${styles.listItem} ${!message21.read ? styles.listItemUnread : ""}`,
|
|
23750
|
+
onClick: () => onMessageClick(message21),
|
|
23529
23751
|
children: [
|
|
23530
|
-
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: styles.listItemIcon, children: !
|
|
23752
|
+
/* @__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
23753
|
/* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: styles.listItemContent, children: [
|
|
23532
|
-
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: styles.listItemPreview, children: getMessagePreview(
|
|
23754
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: styles.listItemPreview, children: getMessagePreview(message21.content) }),
|
|
23533
23755
|
/* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("span", { className: styles.listItemMeta, children: [
|
|
23534
23756
|
"To: ",
|
|
23535
|
-
|
|
23757
|
+
message21.to,
|
|
23536
23758
|
" \u2022 ",
|
|
23537
|
-
|
|
23759
|
+
message21.type
|
|
23538
23760
|
] })
|
|
23539
23761
|
] }),
|
|
23540
|
-
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: styles.listItemRight, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: styles.listItemDate, children: formatDate4(
|
|
23762
|
+
/* @__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
23763
|
]
|
|
23542
23764
|
},
|
|
23543
|
-
|
|
23765
|
+
message21.id
|
|
23544
23766
|
)) })
|
|
23545
23767
|
] });
|
|
23546
23768
|
};
|
|
@@ -23551,12 +23773,12 @@ var MailboxPanel = ({ data }) => {
|
|
|
23551
23773
|
const { teamMailbox = [] } = data || {};
|
|
23552
23774
|
const messageGroups = (0, import_react72.useMemo)(() => {
|
|
23553
23775
|
const groupsMap = /* @__PURE__ */ new Map();
|
|
23554
|
-
teamMailbox.forEach((
|
|
23555
|
-
const sender =
|
|
23776
|
+
teamMailbox.forEach((message21) => {
|
|
23777
|
+
const sender = message21.from;
|
|
23556
23778
|
if (!groupsMap.has(sender)) {
|
|
23557
23779
|
groupsMap.set(sender, []);
|
|
23558
23780
|
}
|
|
23559
|
-
groupsMap.get(sender).push(
|
|
23781
|
+
groupsMap.get(sender).push(message21);
|
|
23560
23782
|
});
|
|
23561
23783
|
const groups = Array.from(groupsMap.entries()).map(([sender, messages]) => ({
|
|
23562
23784
|
sender,
|
|
@@ -23573,8 +23795,8 @@ var MailboxPanel = ({ data }) => {
|
|
|
23573
23795
|
return groups;
|
|
23574
23796
|
}, [teamMailbox]);
|
|
23575
23797
|
const totalUnread = teamMailbox.filter((m) => !m.read).length;
|
|
23576
|
-
const handleMessageClick = (
|
|
23577
|
-
setSelectedMessage(
|
|
23798
|
+
const handleMessageClick = (message21) => {
|
|
23799
|
+
setSelectedMessage(message21);
|
|
23578
23800
|
setModalVisible(true);
|
|
23579
23801
|
};
|
|
23580
23802
|
const handleCloseModal = () => {
|
|
@@ -25418,11 +25640,11 @@ var StreamingHTMLRenderer = ({
|
|
|
25418
25640
|
if (!iframe || event.source !== iframe.contentWindow) {
|
|
25419
25641
|
return;
|
|
25420
25642
|
}
|
|
25421
|
-
const
|
|
25422
|
-
if (!
|
|
25643
|
+
const message21 = event.data;
|
|
25644
|
+
if (!message21 || typeof message21 !== "object") {
|
|
25423
25645
|
return;
|
|
25424
25646
|
}
|
|
25425
|
-
switch (
|
|
25647
|
+
switch (message21.type) {
|
|
25426
25648
|
case "iframe-ready":
|
|
25427
25649
|
console.log("[StreamingHTMLRenderer] Iframe ready");
|
|
25428
25650
|
isReadyRef.current = true;
|
|
@@ -25437,25 +25659,25 @@ var StreamingHTMLRenderer = ({
|
|
|
25437
25659
|
}
|
|
25438
25660
|
break;
|
|
25439
25661
|
case "iframe-height":
|
|
25440
|
-
if (typeof
|
|
25441
|
-
setIframeHeight(
|
|
25662
|
+
if (typeof message21.height === "number" && message21.height > 0) {
|
|
25663
|
+
setIframeHeight(message21.height);
|
|
25442
25664
|
}
|
|
25443
25665
|
break;
|
|
25444
25666
|
case "iframe-error":
|
|
25445
25667
|
const streamingError = {
|
|
25446
25668
|
type: "RENDER_ERROR",
|
|
25447
|
-
message:
|
|
25669
|
+
message: message21.error || "Unknown iframe error"
|
|
25448
25670
|
};
|
|
25449
25671
|
onError?.(streamingError);
|
|
25450
25672
|
break;
|
|
25451
25673
|
case "widget-prompt":
|
|
25452
|
-
if (typeof
|
|
25453
|
-
onPrompt?.(
|
|
25674
|
+
if (typeof message21.text === "string") {
|
|
25675
|
+
onPrompt?.(message21.text);
|
|
25454
25676
|
}
|
|
25455
25677
|
break;
|
|
25456
25678
|
case "widget-open-link":
|
|
25457
|
-
if (typeof
|
|
25458
|
-
window.open(
|
|
25679
|
+
if (typeof message21.url === "string") {
|
|
25680
|
+
window.open(message21.url, "_blank", "noopener,noreferrer");
|
|
25459
25681
|
}
|
|
25460
25682
|
break;
|
|
25461
25683
|
}
|
|
@@ -26377,7 +26599,9 @@ var useStyles18 = (0, import_antd_style31.createStyles)(({ token, css }) => ({
|
|
|
26377
26599
|
gap: 8px;
|
|
26378
26600
|
`
|
|
26379
26601
|
}));
|
|
26380
|
-
var ProjectSelector = (
|
|
26602
|
+
var ProjectSelector = ({
|
|
26603
|
+
disableDropdown = true
|
|
26604
|
+
}) => {
|
|
26381
26605
|
const { styles } = useStyles18();
|
|
26382
26606
|
const {
|
|
26383
26607
|
workspaceId,
|
|
@@ -26488,12 +26712,20 @@ var ProjectSelector = () => {
|
|
|
26488
26712
|
}
|
|
26489
26713
|
) }),
|
|
26490
26714
|
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("span", { className: styles.divider, children: "/" }),
|
|
26491
|
-
/* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(
|
|
26492
|
-
|
|
26493
|
-
|
|
26494
|
-
|
|
26495
|
-
|
|
26496
|
-
|
|
26715
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(
|
|
26716
|
+
"div",
|
|
26717
|
+
{
|
|
26718
|
+
className: styles.projectTrigger,
|
|
26719
|
+
onClick: disableDropdown ? void 0 : toggleProjectList,
|
|
26720
|
+
style: { cursor: disableDropdown ? "default" : "pointer" },
|
|
26721
|
+
children: [
|
|
26722
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: styles.projectTriggerIcon, children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_lucide_react25.Folder, { size: 16 }) }),
|
|
26723
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: styles.projectTriggerInfo, children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: styles.projectTriggerName, children: currentProject?.name || "Select Project" }) }),
|
|
26724
|
+
!disableDropdown && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: `${styles.projectTriggerArrow} ${isProjectListOpen ? "expanded" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_lucide_react25.ChevronDown, { size: 14 }) })
|
|
26725
|
+
]
|
|
26726
|
+
}
|
|
26727
|
+
),
|
|
26728
|
+
!disableDropdown && isProjectListOpen && /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: styles.projectDropdown, children: [
|
|
26497
26729
|
projects.map((project) => /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(
|
|
26498
26730
|
"div",
|
|
26499
26731
|
{
|
|
@@ -26554,129 +26786,44 @@ var ProjectSelector = () => {
|
|
|
26554
26786
|
] });
|
|
26555
26787
|
};
|
|
26556
26788
|
|
|
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
|
|
26789
|
+
// src/components/Chat/ToolPanelFiles.tsx
|
|
26668
26790
|
var import_react82 = require("react");
|
|
26669
26791
|
var import_antd81 = require("antd");
|
|
26670
|
-
|
|
26792
|
+
|
|
26793
|
+
// src/components/Chat/FileDirectoryPanel.tsx
|
|
26794
|
+
var import_react81 = __toESM(require("react"));
|
|
26795
|
+
var import_antd80 = require("antd");
|
|
26671
26796
|
var import_lucide_react26 = require("lucide-react");
|
|
26672
|
-
var
|
|
26673
|
-
var
|
|
26797
|
+
var import_antd_style32 = require("antd-style");
|
|
26798
|
+
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
26674
26799
|
var useStyles19 = (0, import_antd_style32.createStyles)(({ token, css }) => ({
|
|
26675
26800
|
container: css`
|
|
26676
|
-
|
|
26801
|
+
height: 100%;
|
|
26802
|
+
overflow-y: auto;
|
|
26803
|
+
padding: 12px;
|
|
26677
26804
|
font-size: 13px;
|
|
26678
26805
|
background: transparent;
|
|
26679
26806
|
`,
|
|
26807
|
+
header: css`
|
|
26808
|
+
display: flex;
|
|
26809
|
+
align-items: center;
|
|
26810
|
+
gap: 8px;
|
|
26811
|
+
margin-bottom: 12px;
|
|
26812
|
+
padding: 0 4px;
|
|
26813
|
+
font-size: 15px;
|
|
26814
|
+
line-height: 1.4;
|
|
26815
|
+
font-weight: 600;
|
|
26816
|
+
color: ${token.colorText};
|
|
26817
|
+
letter-spacing: -0.01em;
|
|
26818
|
+
padding-bottom: 8px;
|
|
26819
|
+
border-bottom: 1px solid ${token.colorBorderSecondary};
|
|
26820
|
+
|
|
26821
|
+
svg {
|
|
26822
|
+
width: 16px;
|
|
26823
|
+
height: 16px;
|
|
26824
|
+
color: ${token.colorTextSecondary};
|
|
26825
|
+
}
|
|
26826
|
+
`,
|
|
26680
26827
|
section: css`
|
|
26681
26828
|
margin-bottom: 12px;
|
|
26682
26829
|
`,
|
|
@@ -26690,7 +26837,7 @@ var useStyles19 = (0, import_antd_style32.createStyles)(({ token, css }) => ({
|
|
|
26690
26837
|
sectionTitle: css`
|
|
26691
26838
|
font-size: 10px;
|
|
26692
26839
|
font-weight: 600;
|
|
26693
|
-
letter-spacing: 0.
|
|
26840
|
+
letter-spacing: 0.05em;
|
|
26694
26841
|
color: ${token.colorTextSecondary};
|
|
26695
26842
|
text-transform: uppercase;
|
|
26696
26843
|
cursor: pointer;
|
|
@@ -26701,28 +26848,6 @@ var useStyles19 = (0, import_antd_style32.createStyles)(({ token, css }) => ({
|
|
|
26701
26848
|
color: ${token.colorPrimary};
|
|
26702
26849
|
}
|
|
26703
26850
|
`,
|
|
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
26851
|
badge: css`
|
|
26727
26852
|
display: flex;
|
|
26728
26853
|
align-items: center;
|
|
@@ -26731,89 +26856,67 @@ var useStyles19 = (0, import_antd_style32.createStyles)(({ token, css }) => ({
|
|
|
26731
26856
|
height: 16px;
|
|
26732
26857
|
padding: 0 4px;
|
|
26733
26858
|
border-radius: 8px;
|
|
26734
|
-
background:
|
|
26859
|
+
background: ${token.colorFillSecondary};
|
|
26735
26860
|
font-size: 10px;
|
|
26736
|
-
font-weight:
|
|
26861
|
+
font-weight: 500;
|
|
26737
26862
|
color: ${token.colorTextSecondary};
|
|
26738
26863
|
`,
|
|
26739
|
-
|
|
26864
|
+
assetList: css`
|
|
26740
26865
|
display: flex;
|
|
26741
26866
|
flex-direction: column;
|
|
26742
26867
|
gap: 2px;
|
|
26743
26868
|
`,
|
|
26744
|
-
|
|
26869
|
+
assetItem: css`
|
|
26745
26870
|
display: flex;
|
|
26746
26871
|
align-items: center;
|
|
26747
26872
|
gap: 8px;
|
|
26748
|
-
|
|
26749
|
-
|
|
26873
|
+
width: 100%;
|
|
26874
|
+
padding: 5px 8px;
|
|
26875
|
+
border-radius: 4px;
|
|
26750
26876
|
cursor: pointer;
|
|
26751
26877
|
transition: all 0.15s ease;
|
|
26752
|
-
border:
|
|
26878
|
+
border: none;
|
|
26879
|
+
background: transparent;
|
|
26880
|
+
text-align: left;
|
|
26753
26881
|
|
|
26754
26882
|
&:hover {
|
|
26755
26883
|
background: ${token.colorBgTextHover};
|
|
26756
|
-
border-color: ${token.colorBorder};
|
|
26757
|
-
}
|
|
26758
|
-
|
|
26759
|
-
&.active {
|
|
26760
|
-
background: ${token.colorPrimaryBg};
|
|
26761
|
-
border-color: ${token.colorPrimary};
|
|
26762
26884
|
}
|
|
26763
26885
|
`,
|
|
26764
|
-
|
|
26886
|
+
treeRow: css`
|
|
26765
26887
|
display: flex;
|
|
26766
26888
|
align-items: center;
|
|
26889
|
+
gap: 8px;
|
|
26890
|
+
width: 100%;
|
|
26891
|
+
`,
|
|
26892
|
+
treeIndent: css`
|
|
26893
|
+
flex-shrink: 0;
|
|
26894
|
+
width: 12px;
|
|
26895
|
+
`,
|
|
26896
|
+
treeToggle: css`
|
|
26897
|
+
display: inline-flex;
|
|
26898
|
+
align-items: center;
|
|
26767
26899
|
justify-content: center;
|
|
26900
|
+
width: 18px;
|
|
26901
|
+
height: 18px;
|
|
26902
|
+
padding: 0;
|
|
26903
|
+
border: none;
|
|
26904
|
+
border-radius: 4px;
|
|
26905
|
+
background: transparent;
|
|
26906
|
+
color: ${token.colorTextSecondary};
|
|
26907
|
+
cursor: pointer;
|
|
26768
26908
|
|
|
26769
|
-
|
|
26770
|
-
|
|
26771
|
-
|
|
26772
|
-
color: ${token.colorPrimary};
|
|
26909
|
+
&:hover {
|
|
26910
|
+
background: ${token.colorBgTextHover};
|
|
26911
|
+
color: ${token.colorText};
|
|
26773
26912
|
}
|
|
26774
26913
|
`,
|
|
26775
|
-
|
|
26776
|
-
|
|
26777
|
-
|
|
26778
|
-
|
|
26779
|
-
|
|
26780
|
-
|
|
26781
|
-
width: 16px;
|
|
26782
|
-
height: 16px;
|
|
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`
|
|
26914
|
+
treeSpacer: css`
|
|
26915
|
+
flex-shrink: 0;
|
|
26916
|
+
width: 18px;
|
|
26917
|
+
height: 18px;
|
|
26918
|
+
`,
|
|
26919
|
+
assetIcon: css`
|
|
26817
26920
|
display: flex;
|
|
26818
26921
|
align-items: center;
|
|
26819
26922
|
justify-content: center;
|
|
@@ -26843,6 +26946,11 @@ var useStyles19 = (0, import_antd_style32.createStyles)(({ token, css }) => ({
|
|
|
26843
26946
|
font-size: 10px;
|
|
26844
26947
|
color: ${token.colorTextSecondary};
|
|
26845
26948
|
`,
|
|
26949
|
+
treeChildren: css`
|
|
26950
|
+
display: flex;
|
|
26951
|
+
flex-direction: column;
|
|
26952
|
+
gap: 2px;
|
|
26953
|
+
`,
|
|
26846
26954
|
emptyState: css`
|
|
26847
26955
|
padding: 12px;
|
|
26848
26956
|
text-align: center;
|
|
@@ -26886,262 +26994,246 @@ var useStyles19 = (0, import_antd_style32.createStyles)(({ token, css }) => ({
|
|
|
26886
26994
|
width: 14px;
|
|
26887
26995
|
height: 14px;
|
|
26888
26996
|
}
|
|
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
26997
|
`
|
|
27026
26998
|
}));
|
|
27027
|
-
var
|
|
26999
|
+
var formatDate5 = (dateStr) => {
|
|
27000
|
+
if (!dateStr) return "";
|
|
27001
|
+
const date = new Date(dateStr);
|
|
27002
|
+
return date.toLocaleDateString("en-US", { month: "short", day: "numeric" });
|
|
27003
|
+
};
|
|
27004
|
+
var getFileName = (path) => {
|
|
27005
|
+
if (!path) return "";
|
|
27006
|
+
const parts = path.split(/[/\\]/);
|
|
27007
|
+
return parts[parts.length - 1];
|
|
27008
|
+
};
|
|
27009
|
+
var getEntryName = (entry) => getFileName(entry.name || entry.path);
|
|
27010
|
+
var FileDirectoryPanel = ({
|
|
27011
|
+
workspaceId,
|
|
27012
|
+
projectId,
|
|
27013
|
+
resourceFolders,
|
|
27014
|
+
folderEntries,
|
|
27015
|
+
folderLoading,
|
|
27016
|
+
directoryChildren,
|
|
27017
|
+
directoryLoading,
|
|
27018
|
+
directoryExpanded,
|
|
27019
|
+
uploadingFolder,
|
|
27020
|
+
onRefreshFolder,
|
|
27021
|
+
onUploadFolder,
|
|
27022
|
+
onToggleDirectory,
|
|
27023
|
+
onAssetClick
|
|
27024
|
+
}) => {
|
|
27028
27025
|
const { styles } = useStyles19();
|
|
27026
|
+
const renderEntry = import_react81.default.useCallback((entry, depth) => {
|
|
27027
|
+
const entryName = getEntryName(entry);
|
|
27028
|
+
if (entry.is_dir) {
|
|
27029
|
+
const isExpanded = directoryExpanded[entry.path] || false;
|
|
27030
|
+
const children = directoryChildren[entry.path] || [];
|
|
27031
|
+
const isLoading = directoryLoading[entry.path] || false;
|
|
27032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: styles.treeChildren, children: [
|
|
27033
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: styles.treeRow, children: [
|
|
27034
|
+
Array.from({ length: depth }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { className: styles.treeIndent }, `${entry.path}-indent-${index}`)),
|
|
27035
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
27036
|
+
"button",
|
|
27037
|
+
{
|
|
27038
|
+
type: "button",
|
|
27039
|
+
className: styles.treeToggle,
|
|
27040
|
+
"aria-label": `${isExpanded ? "collapse" : "expand"} ${entryName}`,
|
|
27041
|
+
onClick: () => void onToggleDirectory(entry.path),
|
|
27042
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_lucide_react26.ChevronRight, { size: 14, style: { transform: isExpanded ? "rotate(90deg)" : void 0 } })
|
|
27043
|
+
}
|
|
27044
|
+
),
|
|
27045
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(
|
|
27046
|
+
"button",
|
|
27047
|
+
{
|
|
27048
|
+
type: "button",
|
|
27049
|
+
className: styles.assetItem,
|
|
27050
|
+
"aria-label": `toggle ${entryName}`,
|
|
27051
|
+
onClick: () => void onToggleDirectory(entry.path),
|
|
27052
|
+
title: entryName,
|
|
27053
|
+
children: [
|
|
27054
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.assetIcon, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_lucide_react26.FolderOpen, { size: 14 }) }),
|
|
27055
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.assetInfo, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.assetName, children: entryName }) })
|
|
27056
|
+
]
|
|
27057
|
+
}
|
|
27058
|
+
)
|
|
27059
|
+
] }),
|
|
27060
|
+
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
|
|
27061
|
+
] }, entry.path);
|
|
27062
|
+
}
|
|
27063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: styles.treeRow, children: [
|
|
27064
|
+
Array.from({ length: depth }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { className: styles.treeIndent }, `${entry.path}-indent-${index}`)),
|
|
27065
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { className: styles.treeSpacer }),
|
|
27066
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(
|
|
27067
|
+
"button",
|
|
27068
|
+
{
|
|
27069
|
+
type: "button",
|
|
27070
|
+
className: styles.assetItem,
|
|
27071
|
+
onClick: () => onAssetClick(entry),
|
|
27072
|
+
"aria-label": `open ${entryName}`,
|
|
27073
|
+
title: entryName,
|
|
27074
|
+
children: [
|
|
27075
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.assetIcon, children: getFileIcon2(entryName) }),
|
|
27076
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: styles.assetInfo, children: [
|
|
27077
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.assetName, children: entryName }),
|
|
27078
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.assetMeta, children: formatDate5(entry.modified_at) })
|
|
27079
|
+
] })
|
|
27080
|
+
]
|
|
27081
|
+
}
|
|
27082
|
+
)
|
|
27083
|
+
] }, entry.path);
|
|
27084
|
+
}, [directoryChildren, directoryExpanded, directoryLoading, onAssetClick, onToggleDirectory, styles]);
|
|
27085
|
+
if (!projectId) {
|
|
27086
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.emptyState, children: "Please select a project to browse files" });
|
|
27087
|
+
}
|
|
27088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: styles.container, children: [
|
|
27089
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("h3", { className: styles.header, children: [
|
|
27090
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_lucide_react26.FolderOpen, { size: 16 }),
|
|
27091
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { children: "Files" })
|
|
27092
|
+
] }),
|
|
27093
|
+
resourceFolders.map((folder) => {
|
|
27094
|
+
const entries = folderEntries[folder.name] || [];
|
|
27095
|
+
const isLoading = folderLoading[folder.name] || false;
|
|
27096
|
+
const itemCount = entries.length;
|
|
27097
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: styles.section, children: [
|
|
27098
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: styles.sectionHeader, children: [
|
|
27099
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
27100
|
+
"span",
|
|
27101
|
+
{
|
|
27102
|
+
className: styles.sectionTitle,
|
|
27103
|
+
onClick: () => void onRefreshFolder(folder),
|
|
27104
|
+
title: "Click to refresh",
|
|
27105
|
+
children: folder.displayName || folder.name
|
|
27106
|
+
}
|
|
27107
|
+
),
|
|
27108
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { className: styles.badge, children: itemCount })
|
|
27109
|
+
] }),
|
|
27110
|
+
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: [
|
|
27111
|
+
entries.map((entry) => renderEntry(entry, 0)),
|
|
27112
|
+
entries.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.emptyState, children: "No files in this folder" }) : null,
|
|
27113
|
+
folder.allowUpload ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
27114
|
+
"button",
|
|
27115
|
+
{
|
|
27116
|
+
type: "button",
|
|
27117
|
+
className: styles.uploadBtn,
|
|
27118
|
+
onClick: () => void onUploadFolder(folder.name),
|
|
27119
|
+
disabled: !workspaceId || !projectId || uploadingFolder === folder.name,
|
|
27120
|
+
children: uploadingFolder === folder.name ? /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(import_jsx_runtime105.Fragment, { children: [
|
|
27121
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_antd80.Spin, { size: "small" }),
|
|
27122
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { children: "Uploading..." })
|
|
27123
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(import_jsx_runtime105.Fragment, { children: [
|
|
27124
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_lucide_react26.Upload, { size: 14 }),
|
|
27125
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { children: "Upload" })
|
|
27126
|
+
] })
|
|
27127
|
+
}
|
|
27128
|
+
) : null
|
|
27129
|
+
] })
|
|
27130
|
+
] }, folder.name);
|
|
27131
|
+
})
|
|
27132
|
+
] });
|
|
27133
|
+
};
|
|
27134
|
+
|
|
27135
|
+
// src/components/Chat/ToolPanelFiles.tsx
|
|
27136
|
+
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
27137
|
+
var ToolPanelFiles = () => {
|
|
27029
27138
|
const { config } = useLatticeChatShellContext();
|
|
27030
27139
|
const { openSideApp } = useChatUIContext();
|
|
27031
27140
|
const {
|
|
27032
27141
|
workspaceId,
|
|
27033
27142
|
projectId,
|
|
27034
|
-
|
|
27035
|
-
setProject,
|
|
27143
|
+
listPath,
|
|
27036
27144
|
listPathByFolder,
|
|
27037
|
-
createProject,
|
|
27038
27145
|
getFileViewUrl,
|
|
27039
27146
|
uploadFileToFolder
|
|
27040
27147
|
} = useWorkspaceContext();
|
|
27041
|
-
const [
|
|
27148
|
+
const [folderEntries, setFolderEntries] = (0, import_react82.useState)({});
|
|
27042
27149
|
const [folderLoading, setFolderLoading] = (0, import_react82.useState)({});
|
|
27043
|
-
const [
|
|
27150
|
+
const [directoryChildren, setDirectoryChildren] = (0, import_react82.useState)({});
|
|
27151
|
+
const [directoryLoading, setDirectoryLoading] = (0, import_react82.useState)({});
|
|
27152
|
+
const [directoryExpanded, setDirectoryExpanded] = (0, import_react82.useState)({});
|
|
27044
27153
|
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
27154
|
const resourceFolders = (0, import_react82.useMemo)(() => {
|
|
27051
27155
|
return config.resourceFolders && config.resourceFolders.length > 0 ? config.resourceFolders : [{ name: "/", displayName: "Project Assets", allowUpload: true }];
|
|
27052
27156
|
}, [config.resourceFolders]);
|
|
27053
|
-
const
|
|
27054
|
-
|
|
27055
|
-
|
|
27056
|
-
|
|
27057
|
-
|
|
27058
|
-
|
|
27157
|
+
const loadAssetsForFolder = (0, import_react82.useCallback)(
|
|
27158
|
+
async (folder, clearSubdirectoryCache = true) => {
|
|
27159
|
+
if (!workspaceId || !projectId) {
|
|
27160
|
+
setFolderEntries((prev) => ({ ...prev, [folder.name]: [] }));
|
|
27161
|
+
return;
|
|
27162
|
+
}
|
|
27163
|
+
setFolderLoading((prev) => ({ ...prev, [folder.name]: true }));
|
|
27164
|
+
try {
|
|
27165
|
+
const items = await listPathByFolder(folder.name);
|
|
27166
|
+
setFolderEntries((prev) => ({ ...prev, [folder.name]: items }));
|
|
27167
|
+
if (clearSubdirectoryCache) {
|
|
27168
|
+
const folderPath = folder.name === "/" ? "/" : folder.name.replace(/\/$/, "");
|
|
27169
|
+
setDirectoryChildren((prev) => {
|
|
27170
|
+
const next = { ...prev };
|
|
27171
|
+
Object.keys(next).forEach((key) => {
|
|
27172
|
+
if (key === folderPath || key.startsWith(`${folderPath}/`)) {
|
|
27173
|
+
delete next[key];
|
|
27174
|
+
}
|
|
27175
|
+
});
|
|
27176
|
+
return next;
|
|
27177
|
+
});
|
|
27178
|
+
setDirectoryExpanded((prev) => {
|
|
27179
|
+
const next = { ...prev };
|
|
27180
|
+
Object.keys(next).forEach((key) => {
|
|
27181
|
+
if (key === folderPath || key.startsWith(`${folderPath}/`)) {
|
|
27182
|
+
delete next[key];
|
|
27183
|
+
}
|
|
27184
|
+
});
|
|
27185
|
+
return next;
|
|
27186
|
+
});
|
|
27187
|
+
}
|
|
27188
|
+
} catch (error) {
|
|
27189
|
+
console.error(`Failed to load assets for folder ${folder.name}:`, error);
|
|
27190
|
+
setFolderEntries((prev) => ({ ...prev, [folder.name]: [] }));
|
|
27191
|
+
} finally {
|
|
27192
|
+
setFolderLoading((prev) => ({ ...prev, [folder.name]: false }));
|
|
27193
|
+
}
|
|
27194
|
+
},
|
|
27195
|
+
[workspaceId, projectId, listPathByFolder]
|
|
27196
|
+
);
|
|
27197
|
+
const handleToggleDirectory = (0, import_react82.useCallback)(async (path) => {
|
|
27198
|
+
const isExpanded = directoryExpanded[path] || false;
|
|
27199
|
+
if (isExpanded) {
|
|
27200
|
+
setDirectoryExpanded((prev) => ({ ...prev, [path]: false }));
|
|
27059
27201
|
return;
|
|
27060
27202
|
}
|
|
27061
|
-
|
|
27203
|
+
setDirectoryExpanded((prev) => ({ ...prev, [path]: true }));
|
|
27204
|
+
setDirectoryLoading((prev) => ({ ...prev, [path]: true }));
|
|
27062
27205
|
try {
|
|
27063
|
-
const items = await
|
|
27064
|
-
|
|
27206
|
+
const items = await listPath(path);
|
|
27207
|
+
setDirectoryChildren((prev) => ({ ...prev, [path]: items }));
|
|
27065
27208
|
} catch (error) {
|
|
27066
|
-
console.error(`Failed to load
|
|
27067
|
-
|
|
27209
|
+
console.error(`Failed to load directory ${path}:`, error);
|
|
27210
|
+
setDirectoryChildren((prev) => ({ ...prev, [path]: [] }));
|
|
27068
27211
|
} finally {
|
|
27069
|
-
|
|
27212
|
+
setDirectoryLoading((prev) => ({ ...prev, [path]: false }));
|
|
27070
27213
|
}
|
|
27071
|
-
}, [
|
|
27214
|
+
}, [directoryExpanded, listPath]);
|
|
27072
27215
|
(0, import_react82.useEffect)(() => {
|
|
27073
27216
|
resourceFolders.forEach((folder) => {
|
|
27074
|
-
loadAssetsForFolder(folder);
|
|
27217
|
+
void loadAssetsForFolder(folder, false);
|
|
27075
27218
|
});
|
|
27076
|
-
}, [
|
|
27077
|
-
const
|
|
27078
|
-
|
|
27079
|
-
|
|
27080
|
-
|
|
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");
|
|
27095
|
-
return;
|
|
27096
|
-
}
|
|
27097
|
-
setProjectName("");
|
|
27098
|
-
setValidationError(null);
|
|
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);
|
|
27219
|
+
}, [resourceFolders, loadAssetsForFolder]);
|
|
27220
|
+
const handleAssetClick = (0, import_react82.useCallback)((asset) => {
|
|
27221
|
+
const fileUrl = getFileViewUrl(asset.path);
|
|
27222
|
+
if (!fileUrl) {
|
|
27223
|
+
import_antd81.message.warning("Please select a workspace and project first.");
|
|
27118
27224
|
return;
|
|
27119
27225
|
}
|
|
27120
|
-
|
|
27121
|
-
|
|
27122
|
-
|
|
27123
|
-
|
|
27124
|
-
|
|
27125
|
-
|
|
27126
|
-
|
|
27127
|
-
|
|
27128
|
-
|
|
27129
|
-
|
|
27130
|
-
|
|
27131
|
-
setValidationError(errMsg);
|
|
27132
|
-
} finally {
|
|
27133
|
-
setIsCreating(false);
|
|
27134
|
-
}
|
|
27135
|
-
}, [workspaceId, projectName, validateProjectName, createProject, setProject]);
|
|
27136
|
-
const handleModalKeyDown = (e) => {
|
|
27137
|
-
if (e.key === "Enter" && !e.shiftKey) {
|
|
27138
|
-
e.preventDefault();
|
|
27139
|
-
const error = validateProjectName(projectName.trim());
|
|
27140
|
-
if (!error) handleCreateProject();
|
|
27141
|
-
}
|
|
27142
|
-
};
|
|
27143
|
-
const isProjectNameValid = !validateProjectName(projectName.trim());
|
|
27144
|
-
const handleUploadClick = async (folderName) => {
|
|
27226
|
+
openSideApp({
|
|
27227
|
+
component_key: "attachments",
|
|
27228
|
+
data: {
|
|
27229
|
+
file_id: asset.path,
|
|
27230
|
+
message: `Preview: ${asset.name || asset.path}`,
|
|
27231
|
+
full_url: fileUrl
|
|
27232
|
+
},
|
|
27233
|
+
message: `Preview: ${asset.name || asset.path}`
|
|
27234
|
+
});
|
|
27235
|
+
}, [getFileViewUrl, openSideApp]);
|
|
27236
|
+
const handleUploadFolder = (0, import_react82.useCallback)(async (folderName) => {
|
|
27145
27237
|
if (!workspaceId || !projectId) {
|
|
27146
27238
|
import_antd81.message.warning("Please select a workspace and project before uploading.");
|
|
27147
27239
|
return;
|
|
@@ -27158,7 +27250,7 @@ var ProjectsMenuContent = () => {
|
|
|
27158
27250
|
try {
|
|
27159
27251
|
await uploadFileToFolder(folderName, file);
|
|
27160
27252
|
import_antd81.message.success(`Uploaded "${file.name}" successfully`);
|
|
27161
|
-
const folder = resourceFolders.find((
|
|
27253
|
+
const folder = resourceFolders.find((item) => item.name === folderName);
|
|
27162
27254
|
if (folder) {
|
|
27163
27255
|
await loadAssetsForFolder(folder);
|
|
27164
27256
|
}
|
|
@@ -27171,143 +27263,226 @@ var ProjectsMenuContent = () => {
|
|
|
27171
27263
|
}
|
|
27172
27264
|
};
|
|
27173
27265
|
input.click();
|
|
27174
|
-
};
|
|
27175
|
-
|
|
27176
|
-
|
|
27177
|
-
|
|
27178
|
-
|
|
27179
|
-
|
|
27266
|
+
}, [workspaceId, projectId, uploadFileToFolder, resourceFolders, loadAssetsForFolder]);
|
|
27267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
27268
|
+
FileDirectoryPanel,
|
|
27269
|
+
{
|
|
27270
|
+
workspaceId,
|
|
27271
|
+
projectId,
|
|
27272
|
+
resourceFolders,
|
|
27273
|
+
folderEntries,
|
|
27274
|
+
folderLoading,
|
|
27275
|
+
directoryChildren,
|
|
27276
|
+
directoryLoading,
|
|
27277
|
+
directoryExpanded,
|
|
27278
|
+
uploadingFolder,
|
|
27279
|
+
onRefreshFolder: loadAssetsForFolder,
|
|
27280
|
+
onUploadFolder: handleUploadFolder,
|
|
27281
|
+
onToggleDirectory: handleToggleDirectory,
|
|
27282
|
+
onAssetClick: handleAssetClick
|
|
27180
27283
|
}
|
|
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
|
-
]
|
|
27284
|
+
);
|
|
27285
|
+
};
|
|
27286
|
+
|
|
27287
|
+
// src/components/Chat/HeaderIconButton.tsx
|
|
27288
|
+
var import_antd82 = require("antd");
|
|
27289
|
+
var import_antd_style33 = require("antd-style");
|
|
27290
|
+
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
27291
|
+
var useStyles20 = (0, import_antd_style33.createStyles)(({ token, css }) => ({
|
|
27292
|
+
button: css`
|
|
27293
|
+
display: inline-flex;
|
|
27294
|
+
align-items: center;
|
|
27295
|
+
justify-content: center;
|
|
27296
|
+
width: 32px;
|
|
27297
|
+
height: 32px;
|
|
27298
|
+
border-radius: 8px;
|
|
27299
|
+
border: 1px solid transparent;
|
|
27300
|
+
background: transparent;
|
|
27301
|
+
color: inherit;
|
|
27302
|
+
transition: all 0.2s ease;
|
|
27303
|
+
|
|
27304
|
+
&:hover {
|
|
27305
|
+
background: ${token.colorBgTextHover};
|
|
27306
|
+
border-color: ${token.colorBorderSecondary};
|
|
27307
|
+
}
|
|
27308
|
+
|
|
27309
|
+
&[aria-pressed="true"] {
|
|
27310
|
+
background: ${token.colorBgTextHover};
|
|
27311
|
+
border-color: ${token.colorBorderSecondary};
|
|
27312
|
+
}
|
|
27313
|
+
`
|
|
27314
|
+
}));
|
|
27315
|
+
var HeaderIconButton = ({
|
|
27316
|
+
ariaLabel,
|
|
27317
|
+
icon,
|
|
27318
|
+
onClick,
|
|
27319
|
+
pressed = false
|
|
27320
|
+
}) => {
|
|
27321
|
+
const { styles } = useStyles20();
|
|
27322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
27323
|
+
import_antd82.Button,
|
|
27324
|
+
{
|
|
27325
|
+
type: "text",
|
|
27326
|
+
size: "small",
|
|
27327
|
+
className: styles.button,
|
|
27328
|
+
icon,
|
|
27329
|
+
onClick,
|
|
27330
|
+
"aria-label": ariaLabel,
|
|
27331
|
+
"aria-pressed": pressed
|
|
27332
|
+
}
|
|
27333
|
+
);
|
|
27334
|
+
};
|
|
27335
|
+
|
|
27336
|
+
// src/components/Chat/LatticeChat.tsx
|
|
27337
|
+
var import_jsx_runtime108 = require("react/jsx-runtime");
|
|
27338
|
+
var useStyles21 = (0, import_antd_style34.createStyles)(({ css }) => ({
|
|
27339
|
+
wrapper: css`
|
|
27340
|
+
display: flex;
|
|
27341
|
+
flex-direction: column;
|
|
27342
|
+
width: 100%;
|
|
27343
|
+
height: 100%;
|
|
27344
|
+
`,
|
|
27345
|
+
headerBar: css`
|
|
27346
|
+
display: flex;
|
|
27347
|
+
align-items: center;
|
|
27348
|
+
justify-content: space-between;
|
|
27349
|
+
gap: 12px;
|
|
27350
|
+
width: 100%;
|
|
27351
|
+
`,
|
|
27352
|
+
headerLeft: css`
|
|
27353
|
+
display: flex;
|
|
27354
|
+
align-items: center;
|
|
27355
|
+
min-width: 0;
|
|
27356
|
+
flex: 1;
|
|
27357
|
+
`,
|
|
27358
|
+
headerRight: css`
|
|
27359
|
+
display: flex;
|
|
27360
|
+
align-items: center;
|
|
27361
|
+
justify-content: flex-end;
|
|
27362
|
+
flex-shrink: 0;
|
|
27363
|
+
`
|
|
27364
|
+
}));
|
|
27365
|
+
var LatticeChatContent = (props) => {
|
|
27366
|
+
const { assistant_id: _assistantId, thread_id = "", menu, header, ...chatingProps } = props;
|
|
27367
|
+
const { config } = useLatticeChatShellContext();
|
|
27368
|
+
const { styles } = useStyles21();
|
|
27369
|
+
const { toolsVisible, toggleTools } = useChatUIContext();
|
|
27370
|
+
const showWorkspaceSelector = config.enableWorkspace;
|
|
27371
|
+
const layoutHeader = /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: styles.headerBar, children: [
|
|
27372
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: styles.headerLeft, children: showWorkspaceSelector ? /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(ProjectSelector, {}) : null }),
|
|
27373
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: styles.headerRight, children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
27374
|
+
HeaderIconButton,
|
|
27375
|
+
{
|
|
27376
|
+
ariaLabel: "Toggle file directory",
|
|
27377
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_lucide_react27.FolderOpen, { size: 16 }),
|
|
27378
|
+
onClick: toggleTools,
|
|
27379
|
+
pressed: toolsVisible
|
|
27380
|
+
}
|
|
27381
|
+
) })
|
|
27382
|
+
] });
|
|
27383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: styles.wrapper, children: [
|
|
27384
|
+
header,
|
|
27385
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
27386
|
+
ColumnLayout,
|
|
27387
|
+
{
|
|
27388
|
+
menu,
|
|
27389
|
+
header: layoutHeader,
|
|
27390
|
+
main: thread_id ? /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(Chating, { ...chatingProps }) : /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { children: "Please create a conversation first" }),
|
|
27391
|
+
detail: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(SideAppViewBrowser, {}),
|
|
27392
|
+
tools: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(ToolPanelFiles, {})
|
|
27299
27393
|
}
|
|
27300
27394
|
)
|
|
27301
27395
|
] });
|
|
27302
27396
|
};
|
|
27397
|
+
var LatticeChat = (props) => {
|
|
27398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
27399
|
+
AgentThreadProvider,
|
|
27400
|
+
{
|
|
27401
|
+
assistantId: props.assistant_id,
|
|
27402
|
+
threadId: props.thread_id || "",
|
|
27403
|
+
options: {
|
|
27404
|
+
streaming: true,
|
|
27405
|
+
enableReturnStateWhenStreamCompleted: true,
|
|
27406
|
+
enableResumeStream: true
|
|
27407
|
+
},
|
|
27408
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(ChatUIContextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(LatticeChatContent, { ...props }) })
|
|
27409
|
+
}
|
|
27410
|
+
);
|
|
27411
|
+
};
|
|
27412
|
+
|
|
27413
|
+
// src/components/Chat/AgentConversations.tsx
|
|
27414
|
+
var import_x7 = require("@ant-design/x");
|
|
27415
|
+
var import_antd83 = require("antd");
|
|
27416
|
+
var import_react83 = require("react");
|
|
27417
|
+
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
27418
|
+
var AgentConversations = ({
|
|
27419
|
+
enableThreadCreation = true,
|
|
27420
|
+
enableThreadList = true
|
|
27421
|
+
}) => {
|
|
27422
|
+
const { token } = import_antd83.theme.useToken();
|
|
27423
|
+
const { currentAssistant } = useAssistantContext();
|
|
27424
|
+
const {
|
|
27425
|
+
assistantId,
|
|
27426
|
+
thread,
|
|
27427
|
+
selectThread,
|
|
27428
|
+
createThread,
|
|
27429
|
+
listThreads,
|
|
27430
|
+
threads
|
|
27431
|
+
} = useConversationContext();
|
|
27432
|
+
const style = {
|
|
27433
|
+
width: "100%",
|
|
27434
|
+
background: "transparent",
|
|
27435
|
+
borderRadius: token.borderRadius
|
|
27436
|
+
};
|
|
27437
|
+
const threadItems = (0, import_react83.useMemo)(() => {
|
|
27438
|
+
return threads || [];
|
|
27439
|
+
}, [threads]);
|
|
27440
|
+
const items = threadItems.map((thread2) => ({
|
|
27441
|
+
key: thread2.id,
|
|
27442
|
+
label: thread2.label
|
|
27443
|
+
}));
|
|
27444
|
+
const newChatClick = async () => {
|
|
27445
|
+
if (!assistantId) {
|
|
27446
|
+
return;
|
|
27447
|
+
}
|
|
27448
|
+
await createThread();
|
|
27449
|
+
};
|
|
27450
|
+
if (!enableThreadList) {
|
|
27451
|
+
return null;
|
|
27452
|
+
}
|
|
27453
|
+
const creation = enableThreadCreation ? {
|
|
27454
|
+
onClick: newChatClick
|
|
27455
|
+
} : void 0;
|
|
27456
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
27457
|
+
import_x7.Conversations,
|
|
27458
|
+
{
|
|
27459
|
+
creation,
|
|
27460
|
+
items,
|
|
27461
|
+
activeKey: thread?.id,
|
|
27462
|
+
style,
|
|
27463
|
+
groupable: true,
|
|
27464
|
+
onActiveChange: (key) => {
|
|
27465
|
+
selectThread(key);
|
|
27466
|
+
}
|
|
27467
|
+
}
|
|
27468
|
+
);
|
|
27469
|
+
};
|
|
27470
|
+
|
|
27471
|
+
// src/components/Chat/LatticeChatView.tsx
|
|
27472
|
+
var import_react86 = require("react");
|
|
27473
|
+
|
|
27474
|
+
// src/components/Chat/ChatSidebar.tsx
|
|
27475
|
+
var import_react85 = require("react");
|
|
27476
|
+
var import_antd85 = require("antd");
|
|
27477
|
+
var import_lucide_react29 = require("lucide-react");
|
|
27303
27478
|
|
|
27304
27479
|
// src/components/Chat/ThreadHistoryMenuContent.tsx
|
|
27305
|
-
var
|
|
27306
|
-
var
|
|
27307
|
-
var
|
|
27308
|
-
var
|
|
27309
|
-
var
|
|
27310
|
-
var
|
|
27480
|
+
var import_react84 = __toESM(require("react"));
|
|
27481
|
+
var import_antd_style35 = require("antd-style");
|
|
27482
|
+
var import_lucide_react28 = require("lucide-react");
|
|
27483
|
+
var import_antd84 = require("antd");
|
|
27484
|
+
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
27485
|
+
var useStyles22 = (0, import_antd_style35.createStyles)(({ token, css }) => ({
|
|
27311
27486
|
container: css`
|
|
27312
27487
|
padding: 4px;
|
|
27313
27488
|
font-size: 13px;
|
|
@@ -27408,7 +27583,7 @@ var useStyles20 = (0, import_antd_style33.createStyles)(({ token, css }) => ({
|
|
|
27408
27583
|
`
|
|
27409
27584
|
}));
|
|
27410
27585
|
var ThreadHistoryMenuContent = () => {
|
|
27411
|
-
const { styles } =
|
|
27586
|
+
const { styles } = useStyles22();
|
|
27412
27587
|
const {
|
|
27413
27588
|
threads,
|
|
27414
27589
|
threadId,
|
|
@@ -27416,10 +27591,10 @@ var ThreadHistoryMenuContent = () => {
|
|
|
27416
27591
|
deleteThread,
|
|
27417
27592
|
isLoading
|
|
27418
27593
|
} = useConversationContext();
|
|
27419
|
-
const handleDeleteThread = (0,
|
|
27594
|
+
const handleDeleteThread = (0, import_react84.useCallback)(
|
|
27420
27595
|
async (e, threadIdToDelete) => {
|
|
27421
27596
|
e.stopPropagation();
|
|
27422
|
-
|
|
27597
|
+
import_antd84.Modal.confirm({
|
|
27423
27598
|
title: "Delete Conversation",
|
|
27424
27599
|
content: "Are you sure you want to delete this conversation? This action cannot be undone.",
|
|
27425
27600
|
okText: "Delete",
|
|
@@ -27428,16 +27603,16 @@ var ThreadHistoryMenuContent = () => {
|
|
|
27428
27603
|
onOk: async () => {
|
|
27429
27604
|
try {
|
|
27430
27605
|
await deleteThread(threadIdToDelete);
|
|
27431
|
-
|
|
27606
|
+
import_antd84.message.success("Conversation deleted");
|
|
27432
27607
|
} catch (error) {
|
|
27433
|
-
|
|
27608
|
+
import_antd84.message.error("Failed to delete conversation");
|
|
27434
27609
|
}
|
|
27435
27610
|
}
|
|
27436
27611
|
});
|
|
27437
27612
|
},
|
|
27438
27613
|
[deleteThread]
|
|
27439
27614
|
);
|
|
27440
|
-
const sortedThreads =
|
|
27615
|
+
const sortedThreads = import_react84.default.useMemo(() => {
|
|
27441
27616
|
return [...threads].sort((a, b) => {
|
|
27442
27617
|
const dateA = a.updatedAt ? new Date(a.updatedAt).getTime() : 0;
|
|
27443
27618
|
const dateB = b.updatedAt ? new Date(b.updatedAt).getTime() : 0;
|
|
@@ -27445,30 +27620,30 @@ var ThreadHistoryMenuContent = () => {
|
|
|
27445
27620
|
});
|
|
27446
27621
|
}, [threads]);
|
|
27447
27622
|
if (isLoading) {
|
|
27448
|
-
return /* @__PURE__ */ (0,
|
|
27623
|
+
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
27624
|
}
|
|
27450
|
-
return /* @__PURE__ */ (0,
|
|
27625
|
+
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
27626
|
"div",
|
|
27452
27627
|
{
|
|
27453
27628
|
className: `${styles.threadItem} ${thread.id === threadId ? "active" : ""}`,
|
|
27454
27629
|
onClick: () => selectThread(thread.id),
|
|
27455
27630
|
title: thread.label,
|
|
27456
27631
|
children: [
|
|
27457
|
-
/* @__PURE__ */ (0,
|
|
27458
|
-
/* @__PURE__ */ (0,
|
|
27632
|
+
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { className: styles.threadIcon, children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_lucide_react28.MessageSquare, { size: 14 }) }),
|
|
27633
|
+
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
|
|
27459
27634
|
"div",
|
|
27460
27635
|
{
|
|
27461
27636
|
className: thread.id === threadId ? styles.threadNameActive : styles.threadName,
|
|
27462
27637
|
children: thread.label
|
|
27463
27638
|
}
|
|
27464
27639
|
),
|
|
27465
|
-
/* @__PURE__ */ (0,
|
|
27640
|
+
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
|
|
27466
27641
|
"button",
|
|
27467
27642
|
{
|
|
27468
27643
|
className: styles.deleteBtn,
|
|
27469
27644
|
onClick: (e) => handleDeleteThread(e, thread.id),
|
|
27470
27645
|
title: "Delete conversation",
|
|
27471
|
-
children: /* @__PURE__ */ (0,
|
|
27646
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_lucide_react28.Trash2, { size: 12 })
|
|
27472
27647
|
}
|
|
27473
27648
|
)
|
|
27474
27649
|
]
|
|
@@ -27478,7 +27653,7 @@ var ThreadHistoryMenuContent = () => {
|
|
|
27478
27653
|
};
|
|
27479
27654
|
|
|
27480
27655
|
// src/components/Chat/ChatSidebar.tsx
|
|
27481
|
-
var
|
|
27656
|
+
var import_jsx_runtime111 = require("react/jsx-runtime");
|
|
27482
27657
|
var DRAWER_STYLES2 = {
|
|
27483
27658
|
wrapper: {
|
|
27484
27659
|
background: "transparent",
|
|
@@ -27504,7 +27679,7 @@ var DEFAULT_MENU_ITEMS = [
|
|
|
27504
27679
|
builtin: "new-analysis",
|
|
27505
27680
|
type: "action",
|
|
27506
27681
|
name: "New Analysis",
|
|
27507
|
-
icon: /* @__PURE__ */ (0,
|
|
27682
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_lucide_react29.PlusCircle, { size: 20 }),
|
|
27508
27683
|
order: 0
|
|
27509
27684
|
},
|
|
27510
27685
|
// Second: Thread History (inline drawer)
|
|
@@ -27513,28 +27688,15 @@ var DEFAULT_MENU_ITEMS = [
|
|
|
27513
27688
|
builtin: "thread-history",
|
|
27514
27689
|
type: "drawer",
|
|
27515
27690
|
name: "History",
|
|
27516
|
-
icon: /* @__PURE__ */ (0,
|
|
27691
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_lucide_react29.History, { size: 20 }),
|
|
27517
27692
|
order: 1,
|
|
27518
27693
|
title: "Conversation History",
|
|
27519
27694
|
width: 320,
|
|
27520
27695
|
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
27696
|
inlineDefaultExpanded: true,
|
|
27536
|
-
content: /* @__PURE__ */ (0,
|
|
27697
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(ThreadHistoryMenuContent, {})
|
|
27537
27698
|
}
|
|
27699
|
+
// Project Files removed - now accessed via header toggle
|
|
27538
27700
|
];
|
|
27539
27701
|
var ChatSidebar = ({
|
|
27540
27702
|
onSettingsClick,
|
|
@@ -27545,8 +27707,8 @@ var ChatSidebar = ({
|
|
|
27545
27707
|
const { sideAppVisible, menuCollapsed, setMenuCollapsed } = useChatUIContext();
|
|
27546
27708
|
const { user, logout } = useAuth();
|
|
27547
27709
|
const { createThread } = useConversationContext();
|
|
27548
|
-
const [drawerStates, setDrawerStates] = (0,
|
|
27549
|
-
const [changePasswordOpen, setChangePasswordOpen] = (0,
|
|
27710
|
+
const [drawerStates, setDrawerStates] = (0, import_react85.useState)({});
|
|
27711
|
+
const [changePasswordOpen, setChangePasswordOpen] = (0, import_react85.useState)(false);
|
|
27550
27712
|
const {
|
|
27551
27713
|
sidebarMode,
|
|
27552
27714
|
sidebarShowToggle,
|
|
@@ -27555,14 +27717,14 @@ var ChatSidebar = ({
|
|
|
27555
27717
|
sidebarLogoIcon
|
|
27556
27718
|
} = config;
|
|
27557
27719
|
const isExpandedMode = sidebarMode === "expanded";
|
|
27558
|
-
const menuItems = (0,
|
|
27720
|
+
const menuItems = (0, import_react85.useMemo)(() => {
|
|
27559
27721
|
const items = [...DEFAULT_MENU_ITEMS];
|
|
27560
27722
|
for (const item of customMenuItems) {
|
|
27561
27723
|
items.push(item);
|
|
27562
27724
|
}
|
|
27563
27725
|
return items.sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
|
|
27564
27726
|
}, [customMenuItems]);
|
|
27565
|
-
const handleMenuClick = (0,
|
|
27727
|
+
const handleMenuClick = (0, import_react85.useCallback)(async (item) => {
|
|
27566
27728
|
if (item.builtin === "settings") {
|
|
27567
27729
|
setSettingsModalOpen(true);
|
|
27568
27730
|
onSettingsClick?.();
|
|
@@ -27585,46 +27747,44 @@ var ChatSidebar = ({
|
|
|
27585
27747
|
}
|
|
27586
27748
|
}
|
|
27587
27749
|
}, [onSettingsClick, setSettingsModalOpen, createThread, logout]);
|
|
27588
|
-
const handleCloseDrawer = (0,
|
|
27750
|
+
const handleCloseDrawer = (0, import_react85.useCallback)((itemId) => {
|
|
27589
27751
|
setDrawerStates((prev) => ({ ...prev, [itemId]: false }));
|
|
27590
27752
|
}, []);
|
|
27591
|
-
const handleNewAnalysis = (0,
|
|
27753
|
+
const handleNewAnalysis = (0, import_react85.useCallback)(async () => {
|
|
27592
27754
|
try {
|
|
27593
27755
|
await createThread("New Analysis");
|
|
27594
27756
|
} catch (error) {
|
|
27595
27757
|
console.error("Failed to create new thread:", error);
|
|
27596
27758
|
}
|
|
27597
27759
|
}, [createThread]);
|
|
27598
|
-
const renderDrawerContent = (0,
|
|
27760
|
+
const renderDrawerContent = (0, import_react85.useCallback)((item) => {
|
|
27599
27761
|
switch (item.builtin) {
|
|
27600
|
-
case "projects":
|
|
27601
|
-
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(ProjectsMenuContent, {});
|
|
27602
27762
|
case "thread-history":
|
|
27603
|
-
return /* @__PURE__ */ (0,
|
|
27763
|
+
return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(ThreadHistoryMenuContent, {});
|
|
27604
27764
|
default:
|
|
27605
27765
|
return item.content;
|
|
27606
27766
|
}
|
|
27607
27767
|
}, []);
|
|
27608
|
-
const userMenuItems = /* @__PURE__ */ (0,
|
|
27609
|
-
/* @__PURE__ */ (0,
|
|
27610
|
-
/* @__PURE__ */ (0,
|
|
27611
|
-
/* @__PURE__ */ (0,
|
|
27768
|
+
const userMenuItems = /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { style: { minWidth: 160 }, children: [
|
|
27769
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { style: { padding: "8px 12px", borderBottom: "1px solid #f0f0f0" }, children: [
|
|
27770
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)("div", { style: { fontWeight: 500 }, children: user?.name || user?.email }),
|
|
27771
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)("div", { style: { fontSize: 12, color: "#666" }, children: user?.email })
|
|
27612
27772
|
] }),
|
|
27613
|
-
/* @__PURE__ */ (0,
|
|
27614
|
-
|
|
27773
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(
|
|
27774
|
+
import_antd85.Button,
|
|
27615
27775
|
{
|
|
27616
27776
|
type: "text",
|
|
27617
27777
|
block: true,
|
|
27618
27778
|
style: { justifyContent: "flex-start", padding: "8px 12px" },
|
|
27619
27779
|
onClick: () => setChangePasswordOpen(true),
|
|
27620
27780
|
children: [
|
|
27621
|
-
/* @__PURE__ */ (0,
|
|
27781
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_lucide_react29.Key, { size: 16, style: { marginRight: 8 } }),
|
|
27622
27782
|
"Change Password"
|
|
27623
27783
|
]
|
|
27624
27784
|
}
|
|
27625
27785
|
),
|
|
27626
|
-
/* @__PURE__ */ (0,
|
|
27627
|
-
|
|
27786
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(
|
|
27787
|
+
import_antd85.Button,
|
|
27628
27788
|
{
|
|
27629
27789
|
type: "text",
|
|
27630
27790
|
block: true,
|
|
@@ -27632,14 +27792,14 @@ var ChatSidebar = ({
|
|
|
27632
27792
|
style: { justifyContent: "flex-start", padding: "8px 12px" },
|
|
27633
27793
|
onClick: logout,
|
|
27634
27794
|
children: [
|
|
27635
|
-
/* @__PURE__ */ (0,
|
|
27795
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_lucide_react29.LogOut, { size: 16, style: { marginRight: 8 } }),
|
|
27636
27796
|
"Logout"
|
|
27637
27797
|
]
|
|
27638
27798
|
}
|
|
27639
27799
|
)
|
|
27640
27800
|
] });
|
|
27641
|
-
return /* @__PURE__ */ (0,
|
|
27642
|
-
/* @__PURE__ */ (0,
|
|
27801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(import_jsx_runtime111.Fragment, { children: [
|
|
27802
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
27643
27803
|
Menu,
|
|
27644
27804
|
{
|
|
27645
27805
|
items: menuItems,
|
|
@@ -27653,13 +27813,13 @@ var ChatSidebar = ({
|
|
|
27653
27813
|
forceIconMode: sideAppVisible,
|
|
27654
27814
|
collapsed: menuCollapsed,
|
|
27655
27815
|
onCollapsedChange: setMenuCollapsed,
|
|
27656
|
-
footer: ({ isIconMode }) => user && /* @__PURE__ */ (0,
|
|
27657
|
-
|
|
27816
|
+
footer: ({ isIconMode }) => user && /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
27817
|
+
import_antd85.Popover,
|
|
27658
27818
|
{
|
|
27659
27819
|
content: userMenuItems,
|
|
27660
27820
|
placement: "rightTop",
|
|
27661
27821
|
trigger: "click",
|
|
27662
|
-
children: /* @__PURE__ */ (0,
|
|
27822
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(
|
|
27663
27823
|
"div",
|
|
27664
27824
|
{
|
|
27665
27825
|
style: {
|
|
@@ -27673,8 +27833,8 @@ var ChatSidebar = ({
|
|
|
27673
27833
|
transition: "all 0.2s"
|
|
27674
27834
|
},
|
|
27675
27835
|
children: [
|
|
27676
|
-
/* @__PURE__ */ (0,
|
|
27677
|
-
|
|
27836
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
27837
|
+
import_antd85.Avatar,
|
|
27678
27838
|
{
|
|
27679
27839
|
size: isIconMode ? 32 : 36,
|
|
27680
27840
|
style: {
|
|
@@ -27685,8 +27845,8 @@ var ChatSidebar = ({
|
|
|
27685
27845
|
children: (user.name?.charAt(0) || user.email.charAt(0)).toUpperCase()
|
|
27686
27846
|
}
|
|
27687
27847
|
),
|
|
27688
|
-
!isIconMode && /* @__PURE__ */ (0,
|
|
27689
|
-
/* @__PURE__ */ (0,
|
|
27848
|
+
!isIconMode && /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
27849
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
27690
27850
|
"div",
|
|
27691
27851
|
{
|
|
27692
27852
|
style: {
|
|
@@ -27698,7 +27858,7 @@ var ChatSidebar = ({
|
|
|
27698
27858
|
children: user.name || user.email
|
|
27699
27859
|
}
|
|
27700
27860
|
),
|
|
27701
|
-
/* @__PURE__ */ (0,
|
|
27861
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
27702
27862
|
"div",
|
|
27703
27863
|
{
|
|
27704
27864
|
style: {
|
|
@@ -27719,19 +27879,19 @@ var ChatSidebar = ({
|
|
|
27719
27879
|
)
|
|
27720
27880
|
}
|
|
27721
27881
|
),
|
|
27722
|
-
/* @__PURE__ */ (0,
|
|
27882
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
27723
27883
|
ChangePasswordModal,
|
|
27724
27884
|
{
|
|
27725
27885
|
open: changePasswordOpen,
|
|
27726
27886
|
onClose: () => setChangePasswordOpen(false)
|
|
27727
27887
|
}
|
|
27728
27888
|
),
|
|
27729
|
-
menuItems.filter((item) => item.type === "drawer" && !item.inline).map((item) => /* @__PURE__ */ (0,
|
|
27730
|
-
|
|
27889
|
+
menuItems.filter((item) => item.type === "drawer" && !item.inline).map((item) => /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
27890
|
+
import_antd85.Drawer,
|
|
27731
27891
|
{
|
|
27732
|
-
title: /* @__PURE__ */ (0,
|
|
27733
|
-
/* @__PURE__ */ (0,
|
|
27734
|
-
/* @__PURE__ */ (0,
|
|
27892
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" }, children: [
|
|
27893
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { style: { fontSize: 16, fontWeight: 600, textTransform: "uppercase", letterSpacing: 0.5 }, children: item.title || item.name }),
|
|
27894
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
27735
27895
|
"button",
|
|
27736
27896
|
{
|
|
27737
27897
|
onClick: () => handleCloseDrawer(item.id),
|
|
@@ -27746,7 +27906,7 @@ var ChatSidebar = ({
|
|
|
27746
27906
|
background: "rgba(255, 255, 255, 0.5)",
|
|
27747
27907
|
cursor: "pointer"
|
|
27748
27908
|
},
|
|
27749
|
-
children: /* @__PURE__ */ (0,
|
|
27909
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_lucide_react29.PanelLeftClose, { size: 24 })
|
|
27750
27910
|
}
|
|
27751
27911
|
)
|
|
27752
27912
|
] }),
|
|
@@ -27777,16 +27937,16 @@ var ChatSidebar = ({
|
|
|
27777
27937
|
};
|
|
27778
27938
|
|
|
27779
27939
|
// src/components/Chat/LatticeChatView.tsx
|
|
27780
|
-
var
|
|
27940
|
+
var import_jsx_runtime112 = require("react/jsx-runtime");
|
|
27781
27941
|
var LatticeChatView = (props) => {
|
|
27782
|
-
const shellContext = (0,
|
|
27942
|
+
const shellContext = (0, import_react86.useContext)(LatticeChatShellContext);
|
|
27783
27943
|
const { showSideMenu, sideMenuItems } = shellContext.config;
|
|
27784
27944
|
const { assistantId, thread } = useConversationContext();
|
|
27785
27945
|
const { currentAssistant } = useAssistantContext();
|
|
27786
27946
|
const {
|
|
27787
27947
|
config: { baseURL }
|
|
27788
27948
|
} = useLatticeChatShellContext();
|
|
27789
|
-
return assistantId && thread ? /* @__PURE__ */ (0,
|
|
27949
|
+
return assistantId && thread ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
27790
27950
|
AxiomLatticeProvider,
|
|
27791
27951
|
{
|
|
27792
27952
|
config: {
|
|
@@ -27795,14 +27955,14 @@ var LatticeChatView = (props) => {
|
|
|
27795
27955
|
assistantId,
|
|
27796
27956
|
transport: "sse"
|
|
27797
27957
|
},
|
|
27798
|
-
children: /* @__PURE__ */ (0,
|
|
27958
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
27799
27959
|
LatticeChat,
|
|
27800
27960
|
{
|
|
27801
27961
|
thread_id: thread?.id,
|
|
27802
27962
|
assistant_id: assistantId,
|
|
27803
27963
|
name: currentAssistant?.name,
|
|
27804
27964
|
description: currentAssistant?.description,
|
|
27805
|
-
menu: showSideMenu ? /* @__PURE__ */ (0,
|
|
27965
|
+
menu: showSideMenu ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(ChatSidebar, { customMenuItems: sideMenuItems }) : void 0
|
|
27806
27966
|
}
|
|
27807
27967
|
)
|
|
27808
27968
|
}
|
|
@@ -27810,14 +27970,14 @@ var LatticeChatView = (props) => {
|
|
|
27810
27970
|
};
|
|
27811
27971
|
|
|
27812
27972
|
// src/components/Chat/SettingsModal.tsx
|
|
27813
|
-
var
|
|
27814
|
-
var
|
|
27973
|
+
var import_react87 = require("react");
|
|
27974
|
+
var import_antd86 = require("antd");
|
|
27815
27975
|
var import_icons39 = require("@ant-design/icons");
|
|
27816
|
-
var
|
|
27817
|
-
var
|
|
27818
|
-
var { Text: Text37, Title: Title13 } =
|
|
27819
|
-
var { TextArea: TextArea8 } =
|
|
27820
|
-
var
|
|
27976
|
+
var import_antd_style36 = require("antd-style");
|
|
27977
|
+
var import_jsx_runtime113 = require("react/jsx-runtime");
|
|
27978
|
+
var { Text: Text37, Title: Title13 } = import_antd86.Typography;
|
|
27979
|
+
var { TextArea: TextArea8 } = import_antd86.Input;
|
|
27980
|
+
var useStyles23 = (0, import_antd_style36.createStyles)(({ token, css }) => ({
|
|
27821
27981
|
// settingsModal: css`
|
|
27822
27982
|
// .ant-modal {
|
|
27823
27983
|
// max-width: 100vw !important;
|
|
@@ -28162,21 +28322,21 @@ var SETTINGS_MENU_ITEMS = [
|
|
|
28162
28322
|
{
|
|
28163
28323
|
key: "environment",
|
|
28164
28324
|
label: "Environment Variables",
|
|
28165
|
-
icon: /* @__PURE__ */ (0,
|
|
28325
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_icons39.EnvironmentOutlined, {})
|
|
28166
28326
|
},
|
|
28167
28327
|
{
|
|
28168
28328
|
key: "models",
|
|
28169
28329
|
label: "Model Configuration",
|
|
28170
|
-
icon: /* @__PURE__ */ (0,
|
|
28330
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_icons39.ApiOutlined, {})
|
|
28171
28331
|
}
|
|
28172
28332
|
];
|
|
28173
28333
|
var SettingsModal = ({
|
|
28174
28334
|
open,
|
|
28175
28335
|
onClose
|
|
28176
28336
|
}) => {
|
|
28177
|
-
const { styles } =
|
|
28337
|
+
const { styles } = useStyles23();
|
|
28178
28338
|
const { config: shellConfig, updateConfigValue } = useLatticeChatShellContext();
|
|
28179
|
-
const [connections, setConnections] = (0,
|
|
28339
|
+
const [connections, setConnections] = (0, import_react87.useState)(() => {
|
|
28180
28340
|
if (typeof window !== "undefined") {
|
|
28181
28341
|
try {
|
|
28182
28342
|
const stored = localStorage.getItem("lattice_server_connections");
|
|
@@ -28199,21 +28359,21 @@ var SettingsModal = ({
|
|
|
28199
28359
|
}
|
|
28200
28360
|
return [];
|
|
28201
28361
|
});
|
|
28202
|
-
const [serverConfigs, setServerConfigs] = (0,
|
|
28203
|
-
const connectionsRef = (0,
|
|
28204
|
-
(0,
|
|
28362
|
+
const [serverConfigs, setServerConfigs] = (0, import_react87.useState)({});
|
|
28363
|
+
const connectionsRef = (0, import_react87.useRef)(connections);
|
|
28364
|
+
(0, import_react87.useEffect)(() => {
|
|
28205
28365
|
connectionsRef.current = connections;
|
|
28206
28366
|
}, [connections]);
|
|
28207
|
-
const [activeTabKey, setActiveTabKey] = (0,
|
|
28367
|
+
const [activeTabKey, setActiveTabKey] = (0, import_react87.useState)(
|
|
28208
28368
|
connections.length > 0 ? connections[0].id : ""
|
|
28209
28369
|
);
|
|
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,
|
|
28370
|
+
const [activeMenu, setActiveMenu] = (0, import_react87.useState)("environment");
|
|
28371
|
+
const [loading, setLoading] = (0, import_react87.useState)(false);
|
|
28372
|
+
const [showAddServerModal, setShowAddServerModal] = (0, import_react87.useState)(false);
|
|
28373
|
+
const [newServerUrl, setNewServerUrl] = (0, import_react87.useState)("");
|
|
28374
|
+
const [newServerName, setNewServerName] = (0, import_react87.useState)("");
|
|
28375
|
+
const [newServerApiKey, setNewServerApiKey] = (0, import_react87.useState)("");
|
|
28376
|
+
const [addingServer, setAddingServer] = (0, import_react87.useState)(false);
|
|
28217
28377
|
const saveConnections = (newConnections) => {
|
|
28218
28378
|
setConnections(newConnections);
|
|
28219
28379
|
if (typeof window !== "undefined") {
|
|
@@ -28352,7 +28512,7 @@ var SettingsModal = ({
|
|
|
28352
28512
|
}
|
|
28353
28513
|
} catch (error) {
|
|
28354
28514
|
console.error("Failed to load configuration:", error);
|
|
28355
|
-
|
|
28515
|
+
import_antd86.message.error("Failed to load current configuration");
|
|
28356
28516
|
}
|
|
28357
28517
|
};
|
|
28358
28518
|
const loadModelsConfig = async (serverId) => {
|
|
@@ -28403,7 +28563,7 @@ var SettingsModal = ({
|
|
|
28403
28563
|
console.error("Failed to load models configuration:", error);
|
|
28404
28564
|
}
|
|
28405
28565
|
};
|
|
28406
|
-
(0,
|
|
28566
|
+
(0, import_react87.useEffect)(() => {
|
|
28407
28567
|
if (open && activeTabKey) {
|
|
28408
28568
|
initializeServerConfig(activeTabKey);
|
|
28409
28569
|
const connection = connections.find((c) => c.id === activeTabKey);
|
|
@@ -28412,7 +28572,7 @@ var SettingsModal = ({
|
|
|
28412
28572
|
}
|
|
28413
28573
|
}
|
|
28414
28574
|
}, [open, activeTabKey]);
|
|
28415
|
-
(0,
|
|
28575
|
+
(0, import_react87.useEffect)(() => {
|
|
28416
28576
|
if (open && activeTabKey) {
|
|
28417
28577
|
const connection = connections.find((c) => c.id === activeTabKey);
|
|
28418
28578
|
if (connection?.connected) {
|
|
@@ -28426,7 +28586,7 @@ var SettingsModal = ({
|
|
|
28426
28586
|
}, [open, activeTabKey, activeMenu]);
|
|
28427
28587
|
const handleAddServer = async () => {
|
|
28428
28588
|
if (!newServerUrl.trim()) {
|
|
28429
|
-
|
|
28589
|
+
import_antd86.message.error("Please enter a server URL");
|
|
28430
28590
|
return;
|
|
28431
28591
|
}
|
|
28432
28592
|
let normalizedUrl = newServerUrl.trim();
|
|
@@ -28452,7 +28612,7 @@ var SettingsModal = ({
|
|
|
28452
28612
|
setNewServerUrl("");
|
|
28453
28613
|
setNewServerName("");
|
|
28454
28614
|
setNewServerApiKey("");
|
|
28455
|
-
|
|
28615
|
+
import_antd86.notification.success({
|
|
28456
28616
|
message: "Added",
|
|
28457
28617
|
description: "Server added successfully"
|
|
28458
28618
|
});
|
|
@@ -28472,7 +28632,7 @@ var SettingsModal = ({
|
|
|
28472
28632
|
setActiveTabKey("");
|
|
28473
28633
|
}
|
|
28474
28634
|
}
|
|
28475
|
-
|
|
28635
|
+
import_antd86.notification.success({
|
|
28476
28636
|
message: "Deleted",
|
|
28477
28637
|
description: "Server deleted"
|
|
28478
28638
|
});
|
|
@@ -28489,12 +28649,12 @@ var SettingsModal = ({
|
|
|
28489
28649
|
const handleSave = async () => {
|
|
28490
28650
|
const connection = connections.find((c) => c.id === activeTabKey);
|
|
28491
28651
|
if (!connection || !connection.connected) {
|
|
28492
|
-
|
|
28652
|
+
import_antd86.message.error("Please connect to a server first");
|
|
28493
28653
|
return;
|
|
28494
28654
|
}
|
|
28495
28655
|
const url = connection.url;
|
|
28496
28656
|
if (!url) {
|
|
28497
|
-
|
|
28657
|
+
import_antd86.message.error("Please connect to a server first");
|
|
28498
28658
|
return;
|
|
28499
28659
|
}
|
|
28500
28660
|
try {
|
|
@@ -28558,26 +28718,26 @@ var SettingsModal = ({
|
|
|
28558
28718
|
const data = await response.json();
|
|
28559
28719
|
if (response.ok && data.success) {
|
|
28560
28720
|
if (data.requiresRestart && data.requiresRestart.length > 0) {
|
|
28561
|
-
|
|
28721
|
+
import_antd86.message.warning(
|
|
28562
28722
|
`Configuration saved. Please restart the server for ${data.requiresRestart.join(
|
|
28563
28723
|
", "
|
|
28564
28724
|
)} to take effect.`,
|
|
28565
28725
|
5
|
|
28566
28726
|
);
|
|
28567
28727
|
} else {
|
|
28568
|
-
|
|
28728
|
+
import_antd86.notification.success({
|
|
28569
28729
|
message: "Saved",
|
|
28570
28730
|
description: "Configuration saved and applied successfully"
|
|
28571
28731
|
});
|
|
28572
28732
|
}
|
|
28573
28733
|
if (data.warnings && data.warnings.length > 0) {
|
|
28574
28734
|
data.warnings.forEach((warning) => {
|
|
28575
|
-
|
|
28735
|
+
import_antd86.message.warning(warning, 5);
|
|
28576
28736
|
});
|
|
28577
28737
|
}
|
|
28578
28738
|
onClose();
|
|
28579
28739
|
} else {
|
|
28580
|
-
|
|
28740
|
+
import_antd86.message.error(data.error || "Failed to save configuration");
|
|
28581
28741
|
}
|
|
28582
28742
|
} else if (activeMenu === "models") {
|
|
28583
28743
|
const validModels = config.models.filter(
|
|
@@ -28596,18 +28756,18 @@ var SettingsModal = ({
|
|
|
28596
28756
|
});
|
|
28597
28757
|
const data = await response.json();
|
|
28598
28758
|
if (response.ok && data.success) {
|
|
28599
|
-
|
|
28759
|
+
import_antd86.notification.success({
|
|
28600
28760
|
message: "Saved",
|
|
28601
28761
|
description: "Model configuration saved and registered successfully"
|
|
28602
28762
|
});
|
|
28603
28763
|
onClose();
|
|
28604
28764
|
} else {
|
|
28605
|
-
|
|
28765
|
+
import_antd86.message.error(data.error || "Failed to save model configuration");
|
|
28606
28766
|
}
|
|
28607
28767
|
}
|
|
28608
28768
|
} catch (error) {
|
|
28609
28769
|
console.error("Failed to save configuration:", error);
|
|
28610
|
-
|
|
28770
|
+
import_antd86.message.error(error.message || "Failed to save configuration");
|
|
28611
28771
|
} finally {
|
|
28612
28772
|
setLoading(false);
|
|
28613
28773
|
}
|
|
@@ -28623,25 +28783,25 @@ var SettingsModal = ({
|
|
|
28623
28783
|
}
|
|
28624
28784
|
}));
|
|
28625
28785
|
};
|
|
28626
|
-
return /* @__PURE__ */ (0,
|
|
28627
|
-
/* @__PURE__ */ (0,
|
|
28628
|
-
|
|
28786
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: styles.formContainer, children: [
|
|
28787
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28788
|
+
import_antd86.Alert,
|
|
28629
28789
|
{
|
|
28630
28790
|
message: "Configuration Effect",
|
|
28631
|
-
description: /* @__PURE__ */ (0,
|
|
28632
|
-
/* @__PURE__ */ (0,
|
|
28633
|
-
/* @__PURE__ */ (0,
|
|
28791
|
+
description: /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
28792
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { style: { marginBottom: 8 }, children: [
|
|
28793
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28634
28794
|
import_icons39.CheckCircleOutlined,
|
|
28635
28795
|
{
|
|
28636
28796
|
style: { color: "#52c41a", marginRight: 8 }
|
|
28637
28797
|
}
|
|
28638
28798
|
),
|
|
28639
|
-
/* @__PURE__ */ (0,
|
|
28799
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("strong", { children: "Immediately effective:" }),
|
|
28640
28800
|
" QUEUE_SERVICE_TYPE, REDIS_URL, REDIS_PASSWORD, QUEUE_NAME"
|
|
28641
28801
|
] }),
|
|
28642
|
-
/* @__PURE__ */ (0,
|
|
28643
|
-
/* @__PURE__ */ (0,
|
|
28644
|
-
/* @__PURE__ */ (0,
|
|
28802
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
28803
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_icons39.ReloadOutlined, { style: { color: "#faad14", marginRight: 8 } }),
|
|
28804
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("strong", { children: "Requires restart:" }),
|
|
28645
28805
|
" PORT (server must be restarted to change port)"
|
|
28646
28806
|
] })
|
|
28647
28807
|
] }),
|
|
@@ -28650,8 +28810,8 @@ var SettingsModal = ({
|
|
|
28650
28810
|
className: styles.alertCard
|
|
28651
28811
|
}
|
|
28652
28812
|
),
|
|
28653
|
-
/* @__PURE__ */ (0,
|
|
28654
|
-
/* @__PURE__ */ (0,
|
|
28813
|
+
/* @__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." }) }),
|
|
28814
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28655
28815
|
TextArea8,
|
|
28656
28816
|
{
|
|
28657
28817
|
value: config.envText,
|
|
@@ -28728,10 +28888,10 @@ QUEUE_NAME=tasks`,
|
|
|
28728
28888
|
}));
|
|
28729
28889
|
}
|
|
28730
28890
|
};
|
|
28731
|
-
return /* @__PURE__ */ (0,
|
|
28732
|
-
/* @__PURE__ */ (0,
|
|
28733
|
-
config.models.map((model, index) => /* @__PURE__ */ (0,
|
|
28734
|
-
/* @__PURE__ */ (0,
|
|
28891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: styles.formContainer, children: [
|
|
28892
|
+
/* @__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." }) }),
|
|
28893
|
+
config.models.map((model, index) => /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: styles.card, children: [
|
|
28894
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
|
|
28735
28895
|
"div",
|
|
28736
28896
|
{
|
|
28737
28897
|
style: {
|
|
@@ -28743,12 +28903,12 @@ QUEUE_NAME=tasks`,
|
|
|
28743
28903
|
borderBottom: "1px solid rgba(0, 0, 0, 0.06)"
|
|
28744
28904
|
},
|
|
28745
28905
|
children: [
|
|
28746
|
-
/* @__PURE__ */ (0,
|
|
28747
|
-
/* @__PURE__ */ (0,
|
|
28906
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
28907
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Text37, { strong: true, style: { fontSize: 16 }, children: [
|
|
28748
28908
|
"Model ",
|
|
28749
28909
|
index + 1
|
|
28750
28910
|
] }),
|
|
28751
|
-
model.key && /* @__PURE__ */ (0,
|
|
28911
|
+
model.key && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
|
|
28752
28912
|
Text37,
|
|
28753
28913
|
{
|
|
28754
28914
|
type: "secondary",
|
|
@@ -28761,8 +28921,8 @@ QUEUE_NAME=tasks`,
|
|
|
28761
28921
|
}
|
|
28762
28922
|
)
|
|
28763
28923
|
] }),
|
|
28764
|
-
config.models.length > 1 && /* @__PURE__ */ (0,
|
|
28765
|
-
|
|
28924
|
+
config.models.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28925
|
+
import_antd86.Button,
|
|
28766
28926
|
{
|
|
28767
28927
|
type: "text",
|
|
28768
28928
|
danger: true,
|
|
@@ -28778,11 +28938,11 @@ QUEUE_NAME=tasks`,
|
|
|
28778
28938
|
]
|
|
28779
28939
|
}
|
|
28780
28940
|
),
|
|
28781
|
-
/* @__PURE__ */ (0,
|
|
28782
|
-
/* @__PURE__ */ (0,
|
|
28783
|
-
/* @__PURE__ */ (0,
|
|
28784
|
-
/* @__PURE__ */ (0,
|
|
28785
|
-
|
|
28941
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_antd86.Space, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
|
|
28942
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
28943
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formLabel, children: "Key *" }),
|
|
28944
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28945
|
+
import_antd86.Input,
|
|
28786
28946
|
{
|
|
28787
28947
|
placeholder: "e.g., default, gpt-4, claude",
|
|
28788
28948
|
value: model.key,
|
|
@@ -28790,12 +28950,12 @@ QUEUE_NAME=tasks`,
|
|
|
28790
28950
|
style: { height: 40 }
|
|
28791
28951
|
}
|
|
28792
28952
|
),
|
|
28793
|
-
/* @__PURE__ */ (0,
|
|
28953
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formDescription, children: "Unique identifier for this model" })
|
|
28794
28954
|
] }),
|
|
28795
|
-
/* @__PURE__ */ (0,
|
|
28796
|
-
/* @__PURE__ */ (0,
|
|
28797
|
-
/* @__PURE__ */ (0,
|
|
28798
|
-
|
|
28955
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
28956
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formLabel, children: "Provider *" }),
|
|
28957
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28958
|
+
import_antd86.Select,
|
|
28799
28959
|
{
|
|
28800
28960
|
style: { width: "100%", height: 40 },
|
|
28801
28961
|
value: model.provider,
|
|
@@ -28810,10 +28970,10 @@ QUEUE_NAME=tasks`,
|
|
|
28810
28970
|
}
|
|
28811
28971
|
)
|
|
28812
28972
|
] }),
|
|
28813
|
-
/* @__PURE__ */ (0,
|
|
28814
|
-
/* @__PURE__ */ (0,
|
|
28815
|
-
/* @__PURE__ */ (0,
|
|
28816
|
-
|
|
28973
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
28974
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formLabel, children: "Model Name *" }),
|
|
28975
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28976
|
+
import_antd86.Input,
|
|
28817
28977
|
{
|
|
28818
28978
|
placeholder: "e.g., gpt-4, claude-3-opus, kimi-k2-250905",
|
|
28819
28979
|
value: model.model,
|
|
@@ -28822,10 +28982,10 @@ QUEUE_NAME=tasks`,
|
|
|
28822
28982
|
}
|
|
28823
28983
|
)
|
|
28824
28984
|
] }),
|
|
28825
|
-
/* @__PURE__ */ (0,
|
|
28826
|
-
/* @__PURE__ */ (0,
|
|
28827
|
-
/* @__PURE__ */ (0,
|
|
28828
|
-
|
|
28985
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
28986
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formLabel, children: "API Key" }),
|
|
28987
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28988
|
+
import_antd86.Input.Password,
|
|
28829
28989
|
{
|
|
28830
28990
|
placeholder: "Enter your API key",
|
|
28831
28991
|
value: model.apiKey,
|
|
@@ -28833,12 +28993,12 @@ QUEUE_NAME=tasks`,
|
|
|
28833
28993
|
style: { height: 40 }
|
|
28834
28994
|
}
|
|
28835
28995
|
),
|
|
28836
|
-
/* @__PURE__ */ (0,
|
|
28996
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formDescription, children: "API key for the model provider. Leave empty to use environment variable." })
|
|
28837
28997
|
] }),
|
|
28838
|
-
/* @__PURE__ */ (0,
|
|
28839
|
-
/* @__PURE__ */ (0,
|
|
28840
|
-
/* @__PURE__ */ (0,
|
|
28841
|
-
|
|
28998
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
28999
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formLabel, children: "Base URL" }),
|
|
29000
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29001
|
+
import_antd86.Input,
|
|
28842
29002
|
{
|
|
28843
29003
|
placeholder: "e.g., https://api.openai.com/v1",
|
|
28844
29004
|
value: model.baseURL,
|
|
@@ -28846,23 +29006,23 @@ QUEUE_NAME=tasks`,
|
|
|
28846
29006
|
style: { height: 40 }
|
|
28847
29007
|
}
|
|
28848
29008
|
),
|
|
28849
|
-
/* @__PURE__ */ (0,
|
|
29009
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formDescription, children: "Optional custom base URL for the API" })
|
|
28850
29010
|
] }),
|
|
28851
|
-
/* @__PURE__ */ (0,
|
|
28852
|
-
/* @__PURE__ */ (0,
|
|
28853
|
-
|
|
29011
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_antd86.Space, { children: [
|
|
29012
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29013
|
+
import_antd86.Switch,
|
|
28854
29014
|
{
|
|
28855
29015
|
checked: model.streaming,
|
|
28856
29016
|
onChange: (checked) => handleModelChange(index, "streaming", checked)
|
|
28857
29017
|
}
|
|
28858
29018
|
),
|
|
28859
|
-
/* @__PURE__ */ (0,
|
|
29019
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { children: "Enable Streaming" })
|
|
28860
29020
|
] }) }),
|
|
28861
|
-
/* @__PURE__ */ (0,
|
|
28862
|
-
/* @__PURE__ */ (0,
|
|
28863
|
-
/* @__PURE__ */ (0,
|
|
28864
|
-
/* @__PURE__ */ (0,
|
|
28865
|
-
|
|
29021
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { style: { display: "flex", gap: 20 }, children: [
|
|
29022
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { style: { flex: 1 }, children: [
|
|
29023
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formLabel, children: "Max Tokens" }),
|
|
29024
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29025
|
+
import_antd86.Input,
|
|
28866
29026
|
{
|
|
28867
29027
|
type: "number",
|
|
28868
29028
|
placeholder: "e.g., 4096",
|
|
@@ -28876,10 +29036,10 @@ QUEUE_NAME=tasks`,
|
|
|
28876
29036
|
}
|
|
28877
29037
|
)
|
|
28878
29038
|
] }),
|
|
28879
|
-
/* @__PURE__ */ (0,
|
|
28880
|
-
/* @__PURE__ */ (0,
|
|
28881
|
-
/* @__PURE__ */ (0,
|
|
28882
|
-
|
|
29039
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { style: { flex: 1 }, children: [
|
|
29040
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formLabel, children: "Temperature" }),
|
|
29041
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29042
|
+
import_antd86.Input,
|
|
28883
29043
|
{
|
|
28884
29044
|
type: "number",
|
|
28885
29045
|
step: "0.1",
|
|
@@ -28897,8 +29057,8 @@ QUEUE_NAME=tasks`,
|
|
|
28897
29057
|
] })
|
|
28898
29058
|
] })
|
|
28899
29059
|
] }, index)),
|
|
28900
|
-
/* @__PURE__ */ (0,
|
|
28901
|
-
|
|
29060
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29061
|
+
import_antd86.Button,
|
|
28902
29062
|
{
|
|
28903
29063
|
type: "dashed",
|
|
28904
29064
|
onClick: handleAddModel,
|
|
@@ -28925,8 +29085,8 @@ QUEUE_NAME=tasks`,
|
|
|
28925
29085
|
);
|
|
28926
29086
|
const currentConnection = connections.find((c) => c.id === activeTabKey);
|
|
28927
29087
|
const renderTabLabel = (connection) => {
|
|
28928
|
-
return /* @__PURE__ */ (0,
|
|
28929
|
-
/* @__PURE__ */ (0,
|
|
29088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { style: { display: "flex", alignItems: "center" }, children: [
|
|
29089
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28930
29090
|
import_icons39.CloudServerOutlined,
|
|
28931
29091
|
{
|
|
28932
29092
|
style: {
|
|
@@ -28935,14 +29095,14 @@ QUEUE_NAME=tasks`,
|
|
|
28935
29095
|
}
|
|
28936
29096
|
}
|
|
28937
29097
|
),
|
|
28938
|
-
/* @__PURE__ */ (0,
|
|
28939
|
-
connection.connected && /* @__PURE__ */ (0,
|
|
29098
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { children: connection.name }),
|
|
29099
|
+
connection.connected && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28940
29100
|
import_icons39.CheckCircleFilled,
|
|
28941
29101
|
{
|
|
28942
29102
|
style: { color: "#52c41a", fontSize: 12, marginLeft: 8 }
|
|
28943
29103
|
}
|
|
28944
29104
|
),
|
|
28945
|
-
connection.error && !connection.connecting && /* @__PURE__ */ (0,
|
|
29105
|
+
connection.error && !connection.connecting && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28946
29106
|
import_icons39.CloseCircleFilled,
|
|
28947
29107
|
{
|
|
28948
29108
|
style: { color: "#ff4d4f", fontSize: 12, marginLeft: 8 }
|
|
@@ -28953,35 +29113,35 @@ QUEUE_NAME=tasks`,
|
|
|
28953
29113
|
const tabItems = connections.map((connection) => ({
|
|
28954
29114
|
key: connection.id,
|
|
28955
29115
|
label: renderTabLabel(connection),
|
|
28956
|
-
children: /* @__PURE__ */ (0,
|
|
28957
|
-
/* @__PURE__ */ (0,
|
|
29116
|
+
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: [
|
|
29117
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { className: styles.sidebar, children: SETTINGS_MENU_ITEMS.map((item) => /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
|
|
28958
29118
|
"div",
|
|
28959
29119
|
{
|
|
28960
29120
|
className: `${styles.menuItem} ${activeMenu === item.key ? "active" : ""}`,
|
|
28961
29121
|
onClick: () => setActiveMenu(item.key),
|
|
28962
29122
|
children: [
|
|
28963
|
-
/* @__PURE__ */ (0,
|
|
28964
|
-
/* @__PURE__ */ (0,
|
|
29123
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { className: styles.menuItemIcon, children: item.icon }),
|
|
29124
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { className: styles.menuItemText, children: item.label })
|
|
28965
29125
|
]
|
|
28966
29126
|
},
|
|
28967
29127
|
item.key
|
|
28968
29128
|
)) }),
|
|
28969
|
-
/* @__PURE__ */ (0,
|
|
28970
|
-
/* @__PURE__ */ (0,
|
|
28971
|
-
/* @__PURE__ */ (0,
|
|
28972
|
-
/* @__PURE__ */ (0,
|
|
28973
|
-
/* @__PURE__ */ (0,
|
|
29129
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: styles.content, children: [
|
|
29130
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: styles.contentHeader, children: [
|
|
29131
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: styles.contentHeaderLeft, children: [
|
|
29132
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Title13, { level: 3, className: styles.contentTitle, children: activeMenuItem?.label }),
|
|
29133
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Text37, { className: styles.contentDescription, children: [
|
|
28974
29134
|
activeMenu === "environment" && "Manage environment variables for the gateway server",
|
|
28975
29135
|
activeMenu === "models" && "Configure and register model lattices for use by agents"
|
|
28976
29136
|
] })
|
|
28977
29137
|
] }),
|
|
28978
|
-
/* @__PURE__ */ (0,
|
|
28979
|
-
/* @__PURE__ */ (0,
|
|
28980
|
-
/* @__PURE__ */ (0,
|
|
28981
|
-
|
|
29138
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: styles.contentHeaderRight, children: [
|
|
29139
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_antd86.Button, { onClick: onClose, children: "Cancel" }),
|
|
29140
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29141
|
+
import_antd86.Button,
|
|
28982
29142
|
{
|
|
28983
29143
|
type: "primary",
|
|
28984
|
-
icon: /* @__PURE__ */ (0,
|
|
29144
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_icons39.SaveOutlined, {}),
|
|
28985
29145
|
onClick: handleSave,
|
|
28986
29146
|
loading,
|
|
28987
29147
|
children: "Save Configuration"
|
|
@@ -28989,9 +29149,9 @@ QUEUE_NAME=tasks`,
|
|
|
28989
29149
|
)
|
|
28990
29150
|
] })
|
|
28991
29151
|
] }),
|
|
28992
|
-
/* @__PURE__ */ (0,
|
|
29152
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { className: styles.contentBody, children: renderContent(connection.id) })
|
|
28993
29153
|
] })
|
|
28994
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
29154
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28995
29155
|
"div",
|
|
28996
29156
|
{
|
|
28997
29157
|
style: {
|
|
@@ -29003,17 +29163,17 @@ QUEUE_NAME=tasks`,
|
|
|
29003
29163
|
gap: 16,
|
|
29004
29164
|
padding: 48
|
|
29005
29165
|
},
|
|
29006
|
-
children: connection.connecting ? /* @__PURE__ */ (0,
|
|
29007
|
-
/* @__PURE__ */ (0,
|
|
29008
|
-
/* @__PURE__ */ (0,
|
|
29009
|
-
/* @__PURE__ */ (0,
|
|
29166
|
+
children: connection.connecting ? /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_jsx_runtime113.Fragment, { children: [
|
|
29167
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_icons39.LinkOutlined, { style: { fontSize: 64, color: "#1890ff" }, spin: true }),
|
|
29168
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Title13, { level: 4, children: "Connecting..." }),
|
|
29169
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Text37, { type: "secondary", style: { textAlign: "center" }, children: [
|
|
29010
29170
|
"Connecting to ",
|
|
29011
29171
|
connection.url
|
|
29012
29172
|
] })
|
|
29013
|
-
] }) : /* @__PURE__ */ (0,
|
|
29014
|
-
/* @__PURE__ */ (0,
|
|
29015
|
-
/* @__PURE__ */ (0,
|
|
29016
|
-
/* @__PURE__ */ (0,
|
|
29173
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_jsx_runtime113.Fragment, { children: [
|
|
29174
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_icons39.LinkOutlined, { style: { fontSize: 64, color: "#d9d9d9" } }),
|
|
29175
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Title13, { level: 4, type: "secondary", children: connection.error || "Not Connected" }),
|
|
29176
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29017
29177
|
Text37,
|
|
29018
29178
|
{
|
|
29019
29179
|
type: "secondary",
|
|
@@ -29021,11 +29181,11 @@ QUEUE_NAME=tasks`,
|
|
|
29021
29181
|
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
29182
|
}
|
|
29023
29183
|
),
|
|
29024
|
-
/* @__PURE__ */ (0,
|
|
29025
|
-
|
|
29184
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29185
|
+
import_antd86.Button,
|
|
29026
29186
|
{
|
|
29027
29187
|
type: "primary",
|
|
29028
|
-
icon: /* @__PURE__ */ (0,
|
|
29188
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_icons39.LinkOutlined, {}),
|
|
29029
29189
|
onClick: () => checkConnection(connection.id),
|
|
29030
29190
|
loading: connection.connecting,
|
|
29031
29191
|
style: { marginTop: 16 },
|
|
@@ -29037,9 +29197,9 @@ QUEUE_NAME=tasks`,
|
|
|
29037
29197
|
) }),
|
|
29038
29198
|
closable: connections.length > 1
|
|
29039
29199
|
}));
|
|
29040
|
-
return /* @__PURE__ */ (0,
|
|
29041
|
-
/* @__PURE__ */ (0,
|
|
29042
|
-
|
|
29200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_jsx_runtime113.Fragment, { children: [
|
|
29201
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29202
|
+
import_antd86.Modal,
|
|
29043
29203
|
{
|
|
29044
29204
|
open,
|
|
29045
29205
|
onCancel: onClose,
|
|
@@ -29047,8 +29207,8 @@ QUEUE_NAME=tasks`,
|
|
|
29047
29207
|
width: "80%",
|
|
29048
29208
|
footer: null,
|
|
29049
29209
|
title: "Settings",
|
|
29050
|
-
children: /* @__PURE__ */ (0,
|
|
29051
|
-
|
|
29210
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29211
|
+
import_antd86.Tabs,
|
|
29052
29212
|
{
|
|
29053
29213
|
activeKey: activeTabKey,
|
|
29054
29214
|
onChange: handleTabChange,
|
|
@@ -29061,7 +29221,7 @@ QUEUE_NAME=tasks`,
|
|
|
29061
29221
|
}
|
|
29062
29222
|
},
|
|
29063
29223
|
items: tabItems,
|
|
29064
|
-
addIcon: /* @__PURE__ */ (0,
|
|
29224
|
+
addIcon: /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
|
|
29065
29225
|
"div",
|
|
29066
29226
|
{
|
|
29067
29227
|
style: {
|
|
@@ -29071,8 +29231,8 @@ QUEUE_NAME=tasks`,
|
|
|
29071
29231
|
padding: "4px 8px"
|
|
29072
29232
|
},
|
|
29073
29233
|
children: [
|
|
29074
|
-
/* @__PURE__ */ (0,
|
|
29075
|
-
/* @__PURE__ */ (0,
|
|
29234
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_icons39.PlusOutlined, {}),
|
|
29235
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { children: "Add Server" })
|
|
29076
29236
|
]
|
|
29077
29237
|
}
|
|
29078
29238
|
)
|
|
@@ -29080,8 +29240,8 @@ QUEUE_NAME=tasks`,
|
|
|
29080
29240
|
) })
|
|
29081
29241
|
}
|
|
29082
29242
|
),
|
|
29083
|
-
/* @__PURE__ */ (0,
|
|
29084
|
-
|
|
29243
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29244
|
+
import_antd86.Modal,
|
|
29085
29245
|
{
|
|
29086
29246
|
title: "Add New Server",
|
|
29087
29247
|
open: showAddServerModal,
|
|
@@ -29094,11 +29254,11 @@ QUEUE_NAME=tasks`,
|
|
|
29094
29254
|
},
|
|
29095
29255
|
confirmLoading: addingServer,
|
|
29096
29256
|
className: styles.addServerModal,
|
|
29097
|
-
children: /* @__PURE__ */ (0,
|
|
29098
|
-
/* @__PURE__ */ (0,
|
|
29099
|
-
/* @__PURE__ */ (0,
|
|
29100
|
-
/* @__PURE__ */ (0,
|
|
29101
|
-
|
|
29257
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_antd86.Space, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
|
|
29258
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
29259
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server Name" }),
|
|
29260
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29261
|
+
import_antd86.Input,
|
|
29102
29262
|
{
|
|
29103
29263
|
placeholder: "e.g., Production Server",
|
|
29104
29264
|
value: newServerName,
|
|
@@ -29106,12 +29266,12 @@ QUEUE_NAME=tasks`,
|
|
|
29106
29266
|
onPressEnter: handleAddServer
|
|
29107
29267
|
}
|
|
29108
29268
|
),
|
|
29109
|
-
/* @__PURE__ */ (0,
|
|
29269
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: Leave empty to use URL as name" })
|
|
29110
29270
|
] }),
|
|
29111
|
-
/* @__PURE__ */ (0,
|
|
29112
|
-
/* @__PURE__ */ (0,
|
|
29113
|
-
/* @__PURE__ */ (0,
|
|
29114
|
-
|
|
29271
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
29272
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server URL *" }),
|
|
29273
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29274
|
+
import_antd86.Input,
|
|
29115
29275
|
{
|
|
29116
29276
|
placeholder: "e.g., http://localhost:4001",
|
|
29117
29277
|
value: newServerUrl,
|
|
@@ -29119,12 +29279,12 @@ QUEUE_NAME=tasks`,
|
|
|
29119
29279
|
onPressEnter: handleAddServer
|
|
29120
29280
|
}
|
|
29121
29281
|
),
|
|
29122
|
-
/* @__PURE__ */ (0,
|
|
29282
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Enter the full URL of the gateway server" })
|
|
29123
29283
|
] }),
|
|
29124
|
-
/* @__PURE__ */ (0,
|
|
29125
|
-
/* @__PURE__ */ (0,
|
|
29126
|
-
/* @__PURE__ */ (0,
|
|
29127
|
-
|
|
29284
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
29285
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { strong: true, style: { display: "block", marginBottom: 8 }, children: "API Key" }),
|
|
29286
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29287
|
+
import_antd86.Input.Password,
|
|
29128
29288
|
{
|
|
29129
29289
|
placeholder: "Optional: Enter API key for authentication",
|
|
29130
29290
|
value: newServerApiKey,
|
|
@@ -29132,7 +29292,7 @@ QUEUE_NAME=tasks`,
|
|
|
29132
29292
|
onPressEnter: handleAddServer
|
|
29133
29293
|
}
|
|
29134
29294
|
),
|
|
29135
|
-
/* @__PURE__ */ (0,
|
|
29295
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: API key for server authentication" })
|
|
29136
29296
|
] })
|
|
29137
29297
|
] })
|
|
29138
29298
|
}
|
|
@@ -29141,10 +29301,10 @@ QUEUE_NAME=tasks`,
|
|
|
29141
29301
|
};
|
|
29142
29302
|
|
|
29143
29303
|
// src/components/Chat/AgentServerSetting.tsx
|
|
29144
|
-
var
|
|
29304
|
+
var import_jsx_runtime114 = require("react/jsx-runtime");
|
|
29145
29305
|
var AgentServerSetting = () => {
|
|
29146
29306
|
const { settingsModalOpen, setSettingsModalOpen } = useLatticeChatShellContext();
|
|
29147
|
-
return /* @__PURE__ */ (0,
|
|
29307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
29148
29308
|
SettingsModal,
|
|
29149
29309
|
{
|
|
29150
29310
|
open: settingsModalOpen,
|
|
@@ -29154,24 +29314,24 @@ var AgentServerSetting = () => {
|
|
|
29154
29314
|
};
|
|
29155
29315
|
|
|
29156
29316
|
// src/components/Chat/LatticeChatShell.tsx
|
|
29157
|
-
var
|
|
29317
|
+
var import_jsx_runtime115 = require("react/jsx-runtime");
|
|
29158
29318
|
var ShellContent = ({
|
|
29159
29319
|
initialAssistantId,
|
|
29160
29320
|
enableWorkspace
|
|
29161
29321
|
}) => {
|
|
29162
29322
|
const { currentTenant } = useAuth();
|
|
29163
|
-
return /* @__PURE__ */ (0,
|
|
29164
|
-
/* @__PURE__ */ (0,
|
|
29165
|
-
/* @__PURE__ */ (0,
|
|
29166
|
-
] }) : /* @__PURE__ */ (0,
|
|
29167
|
-
/* @__PURE__ */ (0,
|
|
29168
|
-
/* @__PURE__ */ (0,
|
|
29323
|
+
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_jsx_runtime115.Fragment, { children: enableWorkspace ? /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(WorkspaceContextProvider, { children: [
|
|
29324
|
+
/* @__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, {}) }) }),
|
|
29325
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(AgentServerSetting, {})
|
|
29326
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(import_jsx_runtime115.Fragment, { children: [
|
|
29327
|
+
/* @__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, {}) }) }),
|
|
29328
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(AgentServerSetting, {})
|
|
29169
29329
|
] }) });
|
|
29170
29330
|
};
|
|
29171
29331
|
var LatticeChatShell = (props) => {
|
|
29172
29332
|
const { enableAssistantCreation, enableAssistantEditing, enableWorkspace: enableWorkspaceProp, ...restProps } = props;
|
|
29173
29333
|
const enableWorkspace = enableWorkspaceProp ?? restProps.initialConfig?.enableWorkspace ?? false;
|
|
29174
|
-
return /* @__PURE__ */ (0,
|
|
29334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
29175
29335
|
LatticeChatShellContextProvider,
|
|
29176
29336
|
{
|
|
29177
29337
|
initialConfig: {
|
|
@@ -29180,7 +29340,7 @@ var LatticeChatShell = (props) => {
|
|
|
29180
29340
|
enableWorkspace,
|
|
29181
29341
|
...restProps.initialConfig
|
|
29182
29342
|
},
|
|
29183
|
-
children: /* @__PURE__ */ (0,
|
|
29343
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
29184
29344
|
ShellContent,
|
|
29185
29345
|
{
|
|
29186
29346
|
initialAssistantId: restProps.initialConfig?.assistantId,
|
|
@@ -29190,6 +29350,336 @@ var LatticeChatShell = (props) => {
|
|
|
29190
29350
|
}
|
|
29191
29351
|
);
|
|
29192
29352
|
};
|
|
29353
|
+
|
|
29354
|
+
// src/components/Chat/ChannelInstallationsDrawerContent.tsx
|
|
29355
|
+
var import_react88 = require("react");
|
|
29356
|
+
var import_antd87 = require("antd");
|
|
29357
|
+
var import_lucide_react30 = require("lucide-react");
|
|
29358
|
+
var import_jsx_runtime116 = require("react/jsx-runtime");
|
|
29359
|
+
var { Text: Text38, Title: Title14 } = import_antd87.Typography;
|
|
29360
|
+
var MAPPING_MODE_OPTIONS = [
|
|
29361
|
+
{ label: "User", value: "user" },
|
|
29362
|
+
{ label: "Group", value: "group" },
|
|
29363
|
+
{ label: "Hybrid", value: "hybrid" }
|
|
29364
|
+
];
|
|
29365
|
+
var ChannelInstallationsDrawerContent = () => {
|
|
29366
|
+
const { get, post, put, del } = useApi();
|
|
29367
|
+
const [installations, setInstallations] = (0, import_react88.useState)([]);
|
|
29368
|
+
const [loading, setLoading] = (0, import_react88.useState)(false);
|
|
29369
|
+
const [formModalOpen, setFormModalOpen] = (0, import_react88.useState)(false);
|
|
29370
|
+
const [editingInstallation, setEditingInstallation] = (0, import_react88.useState)(null);
|
|
29371
|
+
const loadInstallations = async () => {
|
|
29372
|
+
setLoading(true);
|
|
29373
|
+
try {
|
|
29374
|
+
const result = await get(
|
|
29375
|
+
"/api/channel-installations"
|
|
29376
|
+
);
|
|
29377
|
+
if (result.success) {
|
|
29378
|
+
setInstallations(result.data?.records ?? []);
|
|
29379
|
+
} else {
|
|
29380
|
+
setInstallations([]);
|
|
29381
|
+
import_antd87.message.error(result.message || "Failed to load channel installations");
|
|
29382
|
+
}
|
|
29383
|
+
} catch (error) {
|
|
29384
|
+
console.error("Failed to load channel installations:", error);
|
|
29385
|
+
setInstallations([]);
|
|
29386
|
+
import_antd87.message.error("Failed to load channel installations");
|
|
29387
|
+
} finally {
|
|
29388
|
+
setLoading(false);
|
|
29389
|
+
}
|
|
29390
|
+
};
|
|
29391
|
+
(0, import_react88.useEffect)(() => {
|
|
29392
|
+
loadInstallations();
|
|
29393
|
+
}, []);
|
|
29394
|
+
const handleDelete = async (installation) => {
|
|
29395
|
+
try {
|
|
29396
|
+
const result = await del(
|
|
29397
|
+
`/api/channel-installations/${installation.id}`
|
|
29398
|
+
);
|
|
29399
|
+
if (result.success) {
|
|
29400
|
+
setInstallations(
|
|
29401
|
+
(current) => current.filter((item) => item.id !== installation.id)
|
|
29402
|
+
);
|
|
29403
|
+
import_antd87.message.success("Installation deleted");
|
|
29404
|
+
} else {
|
|
29405
|
+
import_antd87.message.error(result.message || "Failed to delete installation");
|
|
29406
|
+
}
|
|
29407
|
+
} catch (error) {
|
|
29408
|
+
console.error("Failed to delete channel installation:", error);
|
|
29409
|
+
import_antd87.message.error("Failed to delete installation");
|
|
29410
|
+
}
|
|
29411
|
+
};
|
|
29412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
|
|
29413
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { style: { padding: 16 }, children: /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(
|
|
29414
|
+
"div",
|
|
29415
|
+
{
|
|
29416
|
+
style: {
|
|
29417
|
+
display: "flex",
|
|
29418
|
+
justifyContent: "space-between",
|
|
29419
|
+
alignItems: "center"
|
|
29420
|
+
},
|
|
29421
|
+
children: [
|
|
29422
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Title14, { level: 5, style: { margin: 0 }, children: "Channel Installations" }),
|
|
29423
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
29424
|
+
import_antd87.Button,
|
|
29425
|
+
{
|
|
29426
|
+
type: "primary",
|
|
29427
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_lucide_react30.Plus, { size: 16 }),
|
|
29428
|
+
onClick: () => {
|
|
29429
|
+
setEditingInstallation(null);
|
|
29430
|
+
setFormModalOpen(true);
|
|
29431
|
+
},
|
|
29432
|
+
children: "Add Installation"
|
|
29433
|
+
}
|
|
29434
|
+
)
|
|
29435
|
+
]
|
|
29436
|
+
}
|
|
29437
|
+
) }),
|
|
29438
|
+
/* @__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)(
|
|
29439
|
+
"div",
|
|
29440
|
+
{
|
|
29441
|
+
style: {
|
|
29442
|
+
display: "flex",
|
|
29443
|
+
flexDirection: "column",
|
|
29444
|
+
alignItems: "center",
|
|
29445
|
+
justifyContent: "center",
|
|
29446
|
+
padding: "48px 16px"
|
|
29447
|
+
},
|
|
29448
|
+
children: [
|
|
29449
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_lucide_react30.RadioTower, { size: 48, style: { marginBottom: 16, opacity: 0.5 } }),
|
|
29450
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Text38, { strong: true, style: { fontSize: 15 }, children: "No channel installations" }),
|
|
29451
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Text38, { type: "secondary", style: { marginTop: 8 }, children: 'Click "Add Installation" to create one' })
|
|
29452
|
+
]
|
|
29453
|
+
}
|
|
29454
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: installations.map((installation) => {
|
|
29455
|
+
const webhookPath = installation.channel === "lark" ? `/api/channels/lark/installations/${installation.id}/events` : null;
|
|
29456
|
+
return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(import_antd87.Card, { size: "small", children: [
|
|
29457
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(
|
|
29458
|
+
"div",
|
|
29459
|
+
{
|
|
29460
|
+
style: {
|
|
29461
|
+
display: "flex",
|
|
29462
|
+
justifyContent: "space-between",
|
|
29463
|
+
alignItems: "flex-start",
|
|
29464
|
+
marginBottom: 10
|
|
29465
|
+
},
|
|
29466
|
+
children: [
|
|
29467
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Text38, { strong: true, style: { fontSize: 15 }, children: installation.name || installation.id }),
|
|
29468
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Tag, { color: "blue", children: installation.channel })
|
|
29469
|
+
]
|
|
29470
|
+
}
|
|
29471
|
+
),
|
|
29472
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(
|
|
29473
|
+
"div",
|
|
29474
|
+
{
|
|
29475
|
+
style: {
|
|
29476
|
+
display: "flex",
|
|
29477
|
+
flexDirection: "column",
|
|
29478
|
+
gap: 6,
|
|
29479
|
+
marginBottom: 12
|
|
29480
|
+
},
|
|
29481
|
+
children: [
|
|
29482
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(Text38, { type: "secondary", style: { fontSize: 12 }, children: [
|
|
29483
|
+
"ID: ",
|
|
29484
|
+
installation.id
|
|
29485
|
+
] }),
|
|
29486
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(Text38, { style: { fontSize: 13 }, children: [
|
|
29487
|
+
"Assistant ID: ",
|
|
29488
|
+
installation.config.assistantId
|
|
29489
|
+
] }),
|
|
29490
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(Text38, { style: { fontSize: 13 }, children: [
|
|
29491
|
+
"Mapping Mode: ",
|
|
29492
|
+
installation.config.mappingMode
|
|
29493
|
+
] }),
|
|
29494
|
+
installation.config.workspaceId ? /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(Text38, { style: { fontSize: 13 }, children: [
|
|
29495
|
+
"Workspace ID: ",
|
|
29496
|
+
installation.config.workspaceId
|
|
29497
|
+
] }) : null,
|
|
29498
|
+
installation.config.projectId ? /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(Text38, { style: { fontSize: 13 }, children: [
|
|
29499
|
+
"Project ID: ",
|
|
29500
|
+
installation.config.projectId
|
|
29501
|
+
] }) : null,
|
|
29502
|
+
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" })
|
|
29503
|
+
]
|
|
29504
|
+
}
|
|
29505
|
+
),
|
|
29506
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { style: { display: "flex", gap: 8 }, children: [
|
|
29507
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
29508
|
+
import_antd87.Button,
|
|
29509
|
+
{
|
|
29510
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_lucide_react30.Edit2, { size: 14 }),
|
|
29511
|
+
onClick: () => {
|
|
29512
|
+
setEditingInstallation(installation);
|
|
29513
|
+
setFormModalOpen(true);
|
|
29514
|
+
},
|
|
29515
|
+
children: "Edit"
|
|
29516
|
+
}
|
|
29517
|
+
),
|
|
29518
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
29519
|
+
import_antd87.Popconfirm,
|
|
29520
|
+
{
|
|
29521
|
+
title: "Delete Channel Installation",
|
|
29522
|
+
description: `Are you sure you want to delete "${installation.name || installation.id}"?`,
|
|
29523
|
+
onConfirm: () => handleDelete(installation),
|
|
29524
|
+
okText: "Delete",
|
|
29525
|
+
okType: "danger",
|
|
29526
|
+
cancelText: "Cancel",
|
|
29527
|
+
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" })
|
|
29528
|
+
}
|
|
29529
|
+
)
|
|
29530
|
+
] })
|
|
29531
|
+
] }, installation.id);
|
|
29532
|
+
}) }) }),
|
|
29533
|
+
formModalOpen ? /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
29534
|
+
LarkChannelInstallationFormModal,
|
|
29535
|
+
{
|
|
29536
|
+
installation: editingInstallation,
|
|
29537
|
+
open: formModalOpen,
|
|
29538
|
+
post,
|
|
29539
|
+
put,
|
|
29540
|
+
onCancel: () => {
|
|
29541
|
+
setFormModalOpen(false);
|
|
29542
|
+
setEditingInstallation(null);
|
|
29543
|
+
},
|
|
29544
|
+
onSave: () => {
|
|
29545
|
+
setFormModalOpen(false);
|
|
29546
|
+
setEditingInstallation(null);
|
|
29547
|
+
loadInstallations();
|
|
29548
|
+
}
|
|
29549
|
+
}
|
|
29550
|
+
) : null
|
|
29551
|
+
] });
|
|
29552
|
+
};
|
|
29553
|
+
var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCancel, onSave }) => {
|
|
29554
|
+
const [form] = import_antd87.Form.useForm();
|
|
29555
|
+
(0, import_react88.useEffect)(() => {
|
|
29556
|
+
if (installation) {
|
|
29557
|
+
form.setFieldsValue({
|
|
29558
|
+
name: installation.name,
|
|
29559
|
+
appId: installation.config.appId,
|
|
29560
|
+
appSecret: installation.config.appSecret,
|
|
29561
|
+
verificationToken: installation.config.verificationToken,
|
|
29562
|
+
encryptKey: installation.config.encryptKey,
|
|
29563
|
+
mappingMode: installation.config.mappingMode,
|
|
29564
|
+
assistantId: installation.config.assistantId,
|
|
29565
|
+
workspaceId: installation.config.workspaceId,
|
|
29566
|
+
projectId: installation.config.projectId
|
|
29567
|
+
});
|
|
29568
|
+
return;
|
|
29569
|
+
}
|
|
29570
|
+
form.resetFields();
|
|
29571
|
+
form.setFieldsValue({
|
|
29572
|
+
mappingMode: "hybrid"
|
|
29573
|
+
});
|
|
29574
|
+
}, [installation, form]);
|
|
29575
|
+
const handleSubmit = async () => {
|
|
29576
|
+
const values = await form.validateFields();
|
|
29577
|
+
const config = {
|
|
29578
|
+
appId: values.appId,
|
|
29579
|
+
appSecret: values.appSecret,
|
|
29580
|
+
verificationToken: values.verificationToken,
|
|
29581
|
+
encryptKey: values.encryptKey,
|
|
29582
|
+
mappingMode: values.mappingMode,
|
|
29583
|
+
assistantId: values.assistantId,
|
|
29584
|
+
workspaceId: values.workspaceId,
|
|
29585
|
+
projectId: values.projectId
|
|
29586
|
+
};
|
|
29587
|
+
try {
|
|
29588
|
+
if (installation) {
|
|
29589
|
+
const payload2 = {
|
|
29590
|
+
name: values.name,
|
|
29591
|
+
config
|
|
29592
|
+
};
|
|
29593
|
+
const result2 = await put(
|
|
29594
|
+
`/api/channel-installations/${installation.id}`,
|
|
29595
|
+
payload2
|
|
29596
|
+
);
|
|
29597
|
+
if (result2.success) {
|
|
29598
|
+
import_antd87.message.success("Installation updated");
|
|
29599
|
+
onSave();
|
|
29600
|
+
} else {
|
|
29601
|
+
import_antd87.message.error(result2.message || "Failed to update installation");
|
|
29602
|
+
}
|
|
29603
|
+
return;
|
|
29604
|
+
}
|
|
29605
|
+
const payload = {
|
|
29606
|
+
channel: "lark",
|
|
29607
|
+
name: values.name,
|
|
29608
|
+
config
|
|
29609
|
+
};
|
|
29610
|
+
const result = await post(
|
|
29611
|
+
"/api/channel-installations",
|
|
29612
|
+
payload
|
|
29613
|
+
);
|
|
29614
|
+
if (result.success) {
|
|
29615
|
+
import_antd87.message.success("Installation created");
|
|
29616
|
+
onSave();
|
|
29617
|
+
} else {
|
|
29618
|
+
import_antd87.message.error(result.message || "Failed to create installation");
|
|
29619
|
+
}
|
|
29620
|
+
} catch (error) {
|
|
29621
|
+
console.error("Failed to save channel installation:", error);
|
|
29622
|
+
import_antd87.message.error(
|
|
29623
|
+
installation ? "Failed to update installation" : "Failed to create installation"
|
|
29624
|
+
);
|
|
29625
|
+
}
|
|
29626
|
+
};
|
|
29627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
29628
|
+
import_antd87.Modal,
|
|
29629
|
+
{
|
|
29630
|
+
open,
|
|
29631
|
+
title: installation ? "Edit Installation" : "Add Installation",
|
|
29632
|
+
onCancel,
|
|
29633
|
+
onOk: handleSubmit,
|
|
29634
|
+
okText: installation ? "Save" : "Create",
|
|
29635
|
+
destroyOnHidden: true,
|
|
29636
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(import_antd87.Form, { form, layout: "vertical", children: [
|
|
29637
|
+
/* @__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 }) }),
|
|
29638
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Form.Item, { name: "name", label: "Name", children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Input, {}) }),
|
|
29639
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
29640
|
+
import_antd87.Form.Item,
|
|
29641
|
+
{
|
|
29642
|
+
name: "appId",
|
|
29643
|
+
label: "App ID",
|
|
29644
|
+
rules: [{ required: true, message: "App ID is required" }],
|
|
29645
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Input, {})
|
|
29646
|
+
}
|
|
29647
|
+
),
|
|
29648
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
29649
|
+
import_antd87.Form.Item,
|
|
29650
|
+
{
|
|
29651
|
+
name: "appSecret",
|
|
29652
|
+
label: "App Secret",
|
|
29653
|
+
rules: [{ required: true, message: "App Secret is required" }],
|
|
29654
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Input, {})
|
|
29655
|
+
}
|
|
29656
|
+
),
|
|
29657
|
+
/* @__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, {}) }),
|
|
29658
|
+
/* @__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, {}) }),
|
|
29659
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
29660
|
+
import_antd87.Form.Item,
|
|
29661
|
+
{
|
|
29662
|
+
name: "mappingMode",
|
|
29663
|
+
label: "Mapping Mode",
|
|
29664
|
+
rules: [{ required: true, message: "Mapping Mode is required" }],
|
|
29665
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Select, { options: MAPPING_MODE_OPTIONS })
|
|
29666
|
+
}
|
|
29667
|
+
),
|
|
29668
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
29669
|
+
import_antd87.Form.Item,
|
|
29670
|
+
{
|
|
29671
|
+
name: "assistantId",
|
|
29672
|
+
label: "Assistant ID",
|
|
29673
|
+
rules: [{ required: true, message: "Assistant ID is required" }],
|
|
29674
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Input, {})
|
|
29675
|
+
}
|
|
29676
|
+
),
|
|
29677
|
+
/* @__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, {}) }),
|
|
29678
|
+
/* @__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, {}) })
|
|
29679
|
+
] })
|
|
29680
|
+
}
|
|
29681
|
+
);
|
|
29682
|
+
};
|
|
29193
29683
|
// Annotate the CommonJS export names for ESM import in node:
|
|
29194
29684
|
0 && (module.exports = {
|
|
29195
29685
|
AgentConversations,
|
|
@@ -29201,6 +29691,7 @@ var LatticeChatShell = (props) => {
|
|
|
29201
29691
|
AuthProvider,
|
|
29202
29692
|
AxiomLatticeProvider,
|
|
29203
29693
|
ChangePasswordModal,
|
|
29694
|
+
ChannelInstallationsDrawerContent,
|
|
29204
29695
|
ChatUIContext,
|
|
29205
29696
|
ChatUIContextProvider,
|
|
29206
29697
|
Chating,
|
|
@@ -29208,6 +29699,7 @@ var LatticeChatShell = (props) => {
|
|
|
29208
29699
|
ConversationContext,
|
|
29209
29700
|
ConversationContextProvider,
|
|
29210
29701
|
CreateAssistantModal,
|
|
29702
|
+
DEFAULT_MIDDLEWARE_TYPES,
|
|
29211
29703
|
FileExplorer,
|
|
29212
29704
|
LatticeChat,
|
|
29213
29705
|
LatticeChatShell,
|