@axiom-lattice/react-sdk 2.1.60 → 2.1.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +69 -115
- package/dist/index.d.ts +69 -115
- package/dist/index.js +1312 -932
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1311 -923
- 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
|
};
|
|
@@ -1279,6 +1281,29 @@ var DEFAULT_MIDDLEWARE_TYPES = [
|
|
|
1279
1281
|
{ id: "show_widget", name: "Show Widget", description: "Render interactive HTML widgets or SVG diagrams" }
|
|
1280
1282
|
]
|
|
1281
1283
|
},
|
|
1284
|
+
{
|
|
1285
|
+
type: "claw",
|
|
1286
|
+
name: "Memory",
|
|
1287
|
+
description: "Injects and manages memory/bootstrap files (such as AGENTS.md and USER.md) in the runtime workspace",
|
|
1288
|
+
schema: {
|
|
1289
|
+
type: "object",
|
|
1290
|
+
title: "Memory Configuration",
|
|
1291
|
+
description: "Configure bootstrap file injection behavior",
|
|
1292
|
+
properties: {
|
|
1293
|
+
injectBootstrapFiles: {
|
|
1294
|
+
type: "boolean",
|
|
1295
|
+
title: "Inject Bootstrap Files",
|
|
1296
|
+
description: "Automatically inject default bootstrap files into the workspace context",
|
|
1297
|
+
default: true,
|
|
1298
|
+
widget: "switch"
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
},
|
|
1302
|
+
defaultConfig: {
|
|
1303
|
+
injectBootstrapFiles: true
|
|
1304
|
+
},
|
|
1305
|
+
tools: []
|
|
1306
|
+
},
|
|
1282
1307
|
{
|
|
1283
1308
|
type: "date",
|
|
1284
1309
|
name: "Current Date",
|
|
@@ -1323,6 +1348,36 @@ var DEFAULT_MIDDLEWARE_TYPES = [
|
|
|
1323
1348
|
timezone: "UTC"
|
|
1324
1349
|
},
|
|
1325
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
|
+
]
|
|
1326
1381
|
}
|
|
1327
1382
|
];
|
|
1328
1383
|
var DEFAULT_CONFIG = {
|
|
@@ -1486,8 +1541,8 @@ function convertThreadToConversationThread(thread, label) {
|
|
|
1486
1541
|
function getThreadMetadata(label) {
|
|
1487
1542
|
return label ? { label } : {};
|
|
1488
1543
|
}
|
|
1489
|
-
function generateLabelFromMessage(
|
|
1490
|
-
const cleanMessage =
|
|
1544
|
+
function generateLabelFromMessage(message21) {
|
|
1545
|
+
const cleanMessage = message21.replace(/```attachments[\s\S]*?```/g, "").trim();
|
|
1491
1546
|
if (!cleanMessage) {
|
|
1492
1547
|
return "";
|
|
1493
1548
|
}
|
|
@@ -1679,8 +1734,13 @@ var ConversationContextProvider = ({
|
|
|
1679
1734
|
setIsLoading(true);
|
|
1680
1735
|
setError(null);
|
|
1681
1736
|
try {
|
|
1737
|
+
const existingThread = await client.threads.get(newThread.id);
|
|
1738
|
+
const existingMetadata = existingThread.metadata || {};
|
|
1682
1739
|
await client.threads.update(newThread.id, {
|
|
1683
|
-
metadata:
|
|
1740
|
+
metadata: {
|
|
1741
|
+
...existingMetadata,
|
|
1742
|
+
label: newThread.label
|
|
1743
|
+
}
|
|
1684
1744
|
});
|
|
1685
1745
|
await loadThreads();
|
|
1686
1746
|
} catch (err) {
|
|
@@ -1930,7 +1990,7 @@ function AgentThreadProvider({
|
|
|
1930
1990
|
throw new Error("Thread ID is required to send messages");
|
|
1931
1991
|
}
|
|
1932
1992
|
const { input, command, streaming = true, mode } = data;
|
|
1933
|
-
const { message:
|
|
1993
|
+
const { message: message21, files, ...rest } = input || {};
|
|
1934
1994
|
setState((prev) => ({
|
|
1935
1995
|
...prev,
|
|
1936
1996
|
isLoading: true,
|
|
@@ -1939,7 +1999,7 @@ function AgentThreadProvider({
|
|
|
1939
1999
|
}));
|
|
1940
2000
|
const userMessage = {
|
|
1941
2001
|
id: (0, import_uuid.v4)(),
|
|
1942
|
-
content:
|
|
2002
|
+
content: message21 || command?.resume?.message || "",
|
|
1943
2003
|
files,
|
|
1944
2004
|
role: "human"
|
|
1945
2005
|
};
|
|
@@ -1957,8 +2017,8 @@ function AgentThreadProvider({
|
|
|
1957
2017
|
]
|
|
1958
2018
|
}));
|
|
1959
2019
|
const isFirstMessage = messageCountRef.current === 0;
|
|
1960
|
-
if (isFirstMessage &&
|
|
1961
|
-
const label = generateLabelFromMessage(
|
|
2020
|
+
if (isFirstMessage && message21 && conversationContext) {
|
|
2021
|
+
const label = generateLabelFromMessage(message21);
|
|
1962
2022
|
if (label) {
|
|
1963
2023
|
conversationContext.updateThread({
|
|
1964
2024
|
id: threadId,
|
|
@@ -3633,8 +3693,8 @@ function useTenants(options) {
|
|
|
3633
3693
|
const { data } = await response.json();
|
|
3634
3694
|
setTenants(data || []);
|
|
3635
3695
|
} catch (err) {
|
|
3636
|
-
const
|
|
3637
|
-
setError(
|
|
3696
|
+
const message21 = err instanceof Error ? err.message : "Failed to fetch tenants";
|
|
3697
|
+
setError(message21);
|
|
3638
3698
|
} finally {
|
|
3639
3699
|
setIsLoading(false);
|
|
3640
3700
|
}
|
|
@@ -3676,8 +3736,8 @@ function useUsers(options) {
|
|
|
3676
3736
|
const { data } = await response.json();
|
|
3677
3737
|
setUsers(data || []);
|
|
3678
3738
|
} catch (err) {
|
|
3679
|
-
const
|
|
3680
|
-
setError(
|
|
3739
|
+
const message21 = err instanceof Error ? err.message : "Failed to fetch users";
|
|
3740
|
+
setError(message21);
|
|
3681
3741
|
} finally {
|
|
3682
3742
|
setIsLoading(false);
|
|
3683
3743
|
}
|
|
@@ -3719,6 +3779,9 @@ function useUsers(options) {
|
|
|
3719
3779
|
// src/index.ts
|
|
3720
3780
|
__reExport(index_exports, require("@axiom-lattice/protocols"), module.exports);
|
|
3721
3781
|
|
|
3782
|
+
// src/components/Chat/LatticeChat.tsx
|
|
3783
|
+
var import_lucide_react27 = require("lucide-react");
|
|
3784
|
+
|
|
3722
3785
|
// src/components/Chat/ChatUIContext.tsx
|
|
3723
3786
|
var import_react15 = require("react");
|
|
3724
3787
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
@@ -3726,6 +3789,21 @@ var emptyHandler = () => {
|
|
|
3726
3789
|
throw new Error("ChatUIContextProvider not found");
|
|
3727
3790
|
};
|
|
3728
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,
|
|
3729
3807
|
sideAppVisible: false,
|
|
3730
3808
|
setSideAppVisible: emptyHandler,
|
|
3731
3809
|
sideAppSize: "large",
|
|
@@ -3746,44 +3824,72 @@ var ChatUIContext = (0, import_react15.createContext)({
|
|
|
3746
3824
|
var ChatUIContextProvider = ({
|
|
3747
3825
|
children
|
|
3748
3826
|
}) => {
|
|
3749
|
-
const [
|
|
3827
|
+
const [detailVisible, setDetailVisible] = (0, import_react15.useState)(false);
|
|
3750
3828
|
const [contentAppVisible, setcontentAppVisible] = (0, import_react15.useState)(false);
|
|
3751
|
-
const [
|
|
3752
|
-
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);
|
|
3753
3833
|
const [contentAppSelectedCard, setContentAppSelectedCard] = (0, import_react15.useState)(null);
|
|
3754
3834
|
const [menuCollapsed, setMenuCollapsed] = (0, import_react15.useState)(false);
|
|
3755
|
-
const
|
|
3756
|
-
(card)
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
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
|
+
}, []);
|
|
3769
3858
|
const closeSideApp = (0, import_react15.useCallback)(() => {
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
}, [setSideAppSelectedCard, setSideAppVisible]);
|
|
3859
|
+
closeDetail();
|
|
3860
|
+
}, [closeDetail]);
|
|
3773
3861
|
const closeContentApp = (0, import_react15.useCallback)(() => {
|
|
3774
3862
|
setContentAppSelectedCard(null);
|
|
3775
3863
|
setcontentAppVisible(false);
|
|
3776
|
-
}, [
|
|
3864
|
+
}, []);
|
|
3865
|
+
const toggleTools = (0, import_react15.useCallback)(() => {
|
|
3866
|
+
setToolsVisible((prev) => !prev);
|
|
3867
|
+
}, []);
|
|
3777
3868
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3778
3869
|
ChatUIContext.Provider,
|
|
3779
3870
|
{
|
|
3780
3871
|
value: {
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
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,
|
|
3787
3893
|
openSideApp,
|
|
3788
3894
|
closeSideApp,
|
|
3789
3895
|
openContentApp,
|
|
@@ -3803,6 +3909,9 @@ var useChatUIContext = () => {
|
|
|
3803
3909
|
return (0, import_react15.useContext)(ChatUIContext);
|
|
3804
3910
|
};
|
|
3805
3911
|
|
|
3912
|
+
// src/components/Chat/LatticeChat.tsx
|
|
3913
|
+
var import_antd_style34 = require("antd-style");
|
|
3914
|
+
|
|
3806
3915
|
// src/components/Chat/useStyle.tsx
|
|
3807
3916
|
var import_antd_style2 = require("antd-style");
|
|
3808
3917
|
var useStyle = (0, import_antd_style2.createStyles)(({ token, css }) => {
|
|
@@ -4001,6 +4110,23 @@ var useStyle = (0, import_antd_style2.createStyles)(({ token, css }) => {
|
|
|
4001
4110
|
top: 2px;
|
|
4002
4111
|
}
|
|
4003
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
|
+
`,
|
|
4004
4130
|
detailContent: css`
|
|
4005
4131
|
// padding: 8px 8px;
|
|
4006
4132
|
height: 100%;
|
|
@@ -4568,39 +4694,44 @@ var useStyle = (0, import_antd_style2.createStyles)(({ token, css }) => {
|
|
|
4568
4694
|
// src/components/Chat/ColumnLayout.tsx
|
|
4569
4695
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
4570
4696
|
var ColumnLayout = ({
|
|
4571
|
-
|
|
4572
|
-
|
|
4697
|
+
main,
|
|
4698
|
+
detail,
|
|
4699
|
+
tools,
|
|
4573
4700
|
logo,
|
|
4574
4701
|
menu,
|
|
4575
4702
|
header
|
|
4576
4703
|
}) => {
|
|
4577
4704
|
const { styles } = useStyle();
|
|
4578
|
-
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";
|
|
4579
4718
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: `fina_chat ${styles.layout}`, children: [
|
|
4580
|
-
menu && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
children: [
|
|
4585
|
-
logo,
|
|
4586
|
-
menu
|
|
4587
|
-
]
|
|
4588
|
-
}
|
|
4589
|
-
),
|
|
4719
|
+
menu && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: `${styles.menu} ${menuStateClass}`, children: [
|
|
4720
|
+
logo,
|
|
4721
|
+
menu
|
|
4722
|
+
] }),
|
|
4590
4723
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: styles.contentArea, children: [
|
|
4591
4724
|
header && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: styles.header, children: header }),
|
|
4592
4725
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: styles.columns, children: [
|
|
4593
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: `${styles.mainContent} ${
|
|
4594
|
-
/* @__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)(
|
|
4595
4728
|
"div",
|
|
4596
4729
|
{
|
|
4597
|
-
className: `${styles.detailPanel} ${
|
|
4598
|
-
children:
|
|
4599
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_jsx_runtime12.Fragment, {}),
|
|
4600
|
-
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 }) })
|
|
4601
|
-
]
|
|
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
|
|
4602
4732
|
}
|
|
4603
|
-
)
|
|
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 })
|
|
4604
4735
|
] })
|
|
4605
4736
|
] })
|
|
4606
4737
|
] });
|
|
@@ -4672,7 +4803,7 @@ var import_icons3 = require("@ant-design/icons");
|
|
|
4672
4803
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
4673
4804
|
var { Text: Text3 } = import_antd5.Typography;
|
|
4674
4805
|
var GenericDataTable = ({ data, interactive = true, default_open_in_side_app = true }) => {
|
|
4675
|
-
const { dataSource, message:
|
|
4806
|
+
const { dataSource, message: message21 } = data ?? {};
|
|
4676
4807
|
const [expandedRowKeys, setExpandedRowKeys] = (0, import_react17.useState)([]);
|
|
4677
4808
|
const { openSideApp } = useChatUIContext();
|
|
4678
4809
|
const processedData = dataSource?.map((item, index) => ({
|
|
@@ -4771,7 +4902,7 @@ var GenericDataTable = ({ data, interactive = true, default_open_in_side_app = t
|
|
|
4771
4902
|
type: "text/csv;charset=utf-8;"
|
|
4772
4903
|
});
|
|
4773
4904
|
const link = document.createElement("a");
|
|
4774
|
-
const filename = `${
|
|
4905
|
+
const filename = `${message21 || "data"}_${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.csv`;
|
|
4775
4906
|
link.href = URL.createObjectURL(blob);
|
|
4776
4907
|
link.download = filename;
|
|
4777
4908
|
document.body.appendChild(link);
|
|
@@ -4792,7 +4923,7 @@ var GenericDataTable = ({ data, interactive = true, default_open_in_side_app = t
|
|
|
4792
4923
|
tableLayout: "fixed",
|
|
4793
4924
|
style: { width: "100% !important" },
|
|
4794
4925
|
title: () => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_antd5.Flex, { justify: "space-between", align: "center", children: [
|
|
4795
|
-
/* @__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 || "" }) }),
|
|
4796
4927
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_antd5.Space, { children: [
|
|
4797
4928
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4798
4929
|
import_antd5.Button,
|
|
@@ -4814,8 +4945,8 @@ var GenericDataTable = ({ data, interactive = true, default_open_in_side_app = t
|
|
|
4814
4945
|
onClick: () => {
|
|
4815
4946
|
openSideApp({
|
|
4816
4947
|
component_key: "generic_data_table",
|
|
4817
|
-
message:
|
|
4818
|
-
data: { dataSource, message:
|
|
4948
|
+
message: message21 || "",
|
|
4949
|
+
data: { dataSource, message: message21 }
|
|
4819
4950
|
});
|
|
4820
4951
|
},
|
|
4821
4952
|
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons3.ExpandAltOutlined, {})
|
|
@@ -6239,11 +6370,11 @@ var ConfirmFeedback = ({
|
|
|
6239
6370
|
data,
|
|
6240
6371
|
interactive = true
|
|
6241
6372
|
}) => {
|
|
6242
|
-
const { message:
|
|
6373
|
+
const { message: message21, type, config, feedback, options } = data ?? {};
|
|
6243
6374
|
const { sendMessage } = useAgentChat();
|
|
6244
6375
|
const [clicked, setClicked] = (0, import_react25.useState)(false);
|
|
6245
6376
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_antd12.Space, { direction: "vertical", style: { width: "100%" }, children: [
|
|
6246
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(MDResponse, { content:
|
|
6377
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(MDResponse, { content: message21 }),
|
|
6247
6378
|
options ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_antd12.Space, { style: { justifyContent: "flex-end", width: "100%" }, children: options?.map((option) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
6248
6379
|
import_antd12.Button,
|
|
6249
6380
|
{
|
|
@@ -7467,7 +7598,7 @@ var AttachmentsCard = ({
|
|
|
7467
7598
|
const { config } = useLatticeChatShellContext();
|
|
7468
7599
|
const baseURL = config.baseURL;
|
|
7469
7600
|
const fileBaseURL = `${baseURL}/api/assistants/${assistantId}/threads/${threadId}/sandbox/downloadfile?path=`;
|
|
7470
|
-
const { Text:
|
|
7601
|
+
const { Text: Text39 } = import_antd19.Typography;
|
|
7471
7602
|
const [showAll, setShowAll] = (0, import_react29.useState)(false);
|
|
7472
7603
|
const { openSideApp } = useChatUIContext();
|
|
7473
7604
|
const getStyles = () => {
|
|
@@ -7541,7 +7672,7 @@ var AttachmentsCard = ({
|
|
|
7541
7672
|
);
|
|
7542
7673
|
};
|
|
7543
7674
|
const renderFileDescription = (item) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_antd19.Space, { direction: "vertical", size: size === "small" ? 2 : 4, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_antd19.Space, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
7544
|
-
|
|
7675
|
+
Text39,
|
|
7545
7676
|
{
|
|
7546
7677
|
type: "secondary",
|
|
7547
7678
|
style: {
|
|
@@ -7615,7 +7746,7 @@ var AttachmentsCard = ({
|
|
|
7615
7746
|
}
|
|
7616
7747
|
),
|
|
7617
7748
|
item.files && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { style: { paddingLeft: "12px" }, children: [
|
|
7618
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
7749
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text39, { type: "secondary", style: { fontSize: "12px" }, children: [
|
|
7619
7750
|
"Contains ",
|
|
7620
7751
|
item.files.length,
|
|
7621
7752
|
" file(s)"
|
|
@@ -8270,7 +8401,7 @@ var import_ErrorBoundary = __toESM(require("antd/es/alert/ErrorBoundary"));
|
|
|
8270
8401
|
var import_react32 = require("react");
|
|
8271
8402
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
8272
8403
|
var LazyBubble = ({
|
|
8273
|
-
message:
|
|
8404
|
+
message: message21,
|
|
8274
8405
|
renderContent,
|
|
8275
8406
|
autoLoadRightPanel
|
|
8276
8407
|
}) => {
|
|
@@ -8301,10 +8432,10 @@ var LazyBubble = ({
|
|
|
8301
8432
|
autoLoadRightPanel?.();
|
|
8302
8433
|
}, []);
|
|
8303
8434
|
const getPlaceholder = () => {
|
|
8304
|
-
const estimatedHeight =
|
|
8435
|
+
const estimatedHeight = message21.content ? Math.min(100, message21.content.length / 5) : 100;
|
|
8305
8436
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { style: { height: `${estimatedHeight}px`, minHeight: "50px" } });
|
|
8306
8437
|
};
|
|
8307
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_ErrorBoundary.default, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { ref, style: { width: "100%" }, children: isVisible || wasEverVisible ? renderContent(
|
|
8438
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_ErrorBoundary.default, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { ref, style: { width: "100%" }, children: isVisible || wasEverVisible ? renderContent(message21) : getPlaceholder() }) });
|
|
8308
8439
|
};
|
|
8309
8440
|
var MemoizedBubbleList = (0, import_react32.memo)(
|
|
8310
8441
|
({
|
|
@@ -8335,8 +8466,8 @@ var MessageList = ({
|
|
|
8335
8466
|
messageLengthRef.current = messages?.length;
|
|
8336
8467
|
}
|
|
8337
8468
|
}, [messages?.length]);
|
|
8338
|
-
const renderContent = (0, import_react32.useCallback)((
|
|
8339
|
-
const { content } =
|
|
8469
|
+
const renderContent = (0, import_react32.useCallback)((message21) => {
|
|
8470
|
+
const { content } = message21;
|
|
8340
8471
|
try {
|
|
8341
8472
|
const json = JSON.parse(content);
|
|
8342
8473
|
if (json.action && json.message) {
|
|
@@ -8344,7 +8475,7 @@ var MessageList = ({
|
|
|
8344
8475
|
}
|
|
8345
8476
|
} catch (error) {
|
|
8346
8477
|
}
|
|
8347
|
-
const tool_calls_md =
|
|
8478
|
+
const tool_calls_md = message21.tool_calls?.map((tool_call) => {
|
|
8348
8479
|
return `\`\`\`tool_call
|
|
8349
8480
|
${JSON.stringify(tool_call)}
|
|
8350
8481
|
\`\`\``;
|
|
@@ -8353,17 +8484,17 @@ ${JSON.stringify(tool_call)}
|
|
|
8353
8484
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_antd25.Space, { direction: "vertical", style: { width: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(MDResponse, { content: content_md }) });
|
|
8354
8485
|
}, []);
|
|
8355
8486
|
const items = (0, import_react32.useMemo)(
|
|
8356
|
-
() => messages.map((
|
|
8357
|
-
key:
|
|
8358
|
-
role:
|
|
8487
|
+
() => messages.map((message21, index) => ({
|
|
8488
|
+
key: message21.id,
|
|
8489
|
+
role: message21.role,
|
|
8359
8490
|
typing: false,
|
|
8360
8491
|
content: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
8361
8492
|
LazyBubble,
|
|
8362
8493
|
{
|
|
8363
|
-
message:
|
|
8494
|
+
message: message21,
|
|
8364
8495
|
renderContent,
|
|
8365
8496
|
autoLoadRightPanel: () => {
|
|
8366
|
-
const { content, role: role2 } =
|
|
8497
|
+
const { content, role: role2 } = message21;
|
|
8367
8498
|
const isNewAddedMessage = messageLengthRef.current > 1 && messageLengthRef.current + 1 === messages.length;
|
|
8368
8499
|
if (index === messages.length - 1 && isNewAddedMessage && role2 === "ai") {
|
|
8369
8500
|
try {
|
|
@@ -10194,7 +10325,7 @@ var ProjectCardList = () => {
|
|
|
10194
10325
|
}
|
|
10195
10326
|
setIsCreateModalOpen(false);
|
|
10196
10327
|
};
|
|
10197
|
-
const
|
|
10328
|
+
const formatDate6 = (date) => {
|
|
10198
10329
|
const d = typeof date === "string" ? new Date(date) : date;
|
|
10199
10330
|
return d.toLocaleDateString("en-US", {
|
|
10200
10331
|
month: "short",
|
|
@@ -10285,7 +10416,7 @@ var ProjectCardList = () => {
|
|
|
10285
10416
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("h3", { className: styles.projectName, children: project.name }),
|
|
10286
10417
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("span", { className: styles.projectDate, children: [
|
|
10287
10418
|
"Created ",
|
|
10288
|
-
|
|
10419
|
+
formatDate6(project.createdAt)
|
|
10289
10420
|
] })
|
|
10290
10421
|
] })
|
|
10291
10422
|
] }) })
|
|
@@ -10303,7 +10434,7 @@ var ProjectCardList = () => {
|
|
|
10303
10434
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: styles.listProjectName, children: project.name }),
|
|
10304
10435
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("span", { className: styles.listProjectDate, children: [
|
|
10305
10436
|
"Created ",
|
|
10306
|
-
|
|
10437
|
+
formatDate6(project.createdAt)
|
|
10307
10438
|
] })
|
|
10308
10439
|
] })
|
|
10309
10440
|
] }, project.id))
|
|
@@ -15428,7 +15559,7 @@ var SkillNode = ({ data }) => {
|
|
|
15428
15559
|
) : [],
|
|
15429
15560
|
[currentSkill.metadata]
|
|
15430
15561
|
);
|
|
15431
|
-
const
|
|
15562
|
+
const formatDate6 = (value) => {
|
|
15432
15563
|
if (!value) return "";
|
|
15433
15564
|
const date = value instanceof Date ? value : new Date(value);
|
|
15434
15565
|
if (Number.isNaN(date.getTime())) return "";
|
|
@@ -16036,7 +16167,7 @@ var SkillNode = ({ data }) => {
|
|
|
16036
16167
|
},
|
|
16037
16168
|
children: [
|
|
16038
16169
|
"Created: ",
|
|
16039
|
-
|
|
16170
|
+
formatDate6(currentSkill.createdAt)
|
|
16040
16171
|
]
|
|
16041
16172
|
}
|
|
16042
16173
|
),
|
|
@@ -16050,7 +16181,7 @@ var SkillNode = ({ data }) => {
|
|
|
16050
16181
|
},
|
|
16051
16182
|
children: [
|
|
16052
16183
|
"Updated: ",
|
|
16053
|
-
|
|
16184
|
+
formatDate6(currentSkill.updatedAt)
|
|
16054
16185
|
]
|
|
16055
16186
|
}
|
|
16056
16187
|
)
|
|
@@ -17607,8 +17738,7 @@ var WorkspaceResourceManager = ({
|
|
|
17607
17738
|
}
|
|
17608
17739
|
),
|
|
17609
17740
|
logo,
|
|
17610
|
-
|
|
17611
|
-
right: null
|
|
17741
|
+
main: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(SideAppViewBrowser, { region: "content" })
|
|
17612
17742
|
}
|
|
17613
17743
|
),
|
|
17614
17744
|
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
@@ -20294,6 +20424,11 @@ var useStyles8 = (0, import_antd_style20.createStyles)(({ token, css }) => ({
|
|
|
20294
20424
|
padding: 2px 6px;
|
|
20295
20425
|
border-radius: 4px;
|
|
20296
20426
|
font-size: 12px;
|
|
20427
|
+
`,
|
|
20428
|
+
messageContent: css`
|
|
20429
|
+
margin-top: 4px;
|
|
20430
|
+
max-width: 300px;
|
|
20431
|
+
word-break: break-word;
|
|
20297
20432
|
`
|
|
20298
20433
|
}));
|
|
20299
20434
|
var getStatusColor = (status) => {
|
|
@@ -20479,7 +20614,8 @@ var ScheduleViewer = ({ data }) => {
|
|
|
20479
20614
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: styles.taskHeader, children: [
|
|
20480
20615
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { children: [
|
|
20481
20616
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: styles.taskType, children: task.taskType }),
|
|
20482
|
-
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: styles.taskId, children: task.taskId })
|
|
20617
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: styles.taskId, children: task.taskId }),
|
|
20618
|
+
task.payload?.message?.content && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: styles.messageContent, children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Text26, { type: "secondary", style: { fontSize: 12 }, children: task.payload.message.content }) })
|
|
20483
20619
|
] }),
|
|
20484
20620
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_antd64.Tag, { color: getStatusColor(task.status), icon: getStatusIcon2(task.status), children: task.status.toUpperCase() })
|
|
20485
20621
|
] }),
|
|
@@ -20519,19 +20655,6 @@ var ScheduleViewer = ({ data }) => {
|
|
|
20519
20655
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_icons34.ExclamationCircleOutlined, { style: { marginRight: 4 } }),
|
|
20520
20656
|
task.lastError
|
|
20521
20657
|
] }) }),
|
|
20522
|
-
task.metadata && Object.keys(task.metadata).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
20523
|
-
import_antd64.Descriptions,
|
|
20524
|
-
{
|
|
20525
|
-
size: "small",
|
|
20526
|
-
column: 1,
|
|
20527
|
-
style: { marginTop: 12 },
|
|
20528
|
-
items: Object.entries(task.metadata).map(([key, value]) => ({
|
|
20529
|
-
key,
|
|
20530
|
-
label: key,
|
|
20531
|
-
children: typeof value === "object" ? JSON.stringify(value) : String(value)
|
|
20532
|
-
}))
|
|
20533
|
-
}
|
|
20534
|
-
),
|
|
20535
20658
|
isActive && renderActions(task)
|
|
20536
20659
|
]
|
|
20537
20660
|
},
|
|
@@ -23190,12 +23313,12 @@ var formatDate3 = (timestamp) => {
|
|
|
23190
23313
|
});
|
|
23191
23314
|
};
|
|
23192
23315
|
var MailboxDetailModal = ({
|
|
23193
|
-
message:
|
|
23316
|
+
message: message21,
|
|
23194
23317
|
visible,
|
|
23195
23318
|
onClose
|
|
23196
23319
|
}) => {
|
|
23197
23320
|
const { styles } = useStyles15();
|
|
23198
|
-
if (!
|
|
23321
|
+
if (!message21) return null;
|
|
23199
23322
|
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
23200
23323
|
import_antd74.Modal,
|
|
23201
23324
|
{
|
|
@@ -23218,12 +23341,12 @@ var MailboxDetailModal = ({
|
|
|
23218
23341
|
children: /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: styles.modalContent, children: [
|
|
23219
23342
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: styles.header, children: [
|
|
23220
23343
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: styles.messageIcon, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_lucide_react22.Mail, { size: 20 }) }),
|
|
23221
|
-
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Text35, { className: styles.messageId, children:
|
|
23222
|
-
!
|
|
23344
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Text35, { className: styles.messageId, children: message21.id }),
|
|
23345
|
+
!message21.read && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_antd74.Tag, { color: "red", children: "Unread" })
|
|
23223
23346
|
] }),
|
|
23224
23347
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(Title11, { level: 4, className: styles.title, children: [
|
|
23225
23348
|
"Message from ",
|
|
23226
|
-
|
|
23349
|
+
message21.from
|
|
23227
23350
|
] }),
|
|
23228
23351
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: styles.metaSection, children: [
|
|
23229
23352
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: styles.metaItem, children: [
|
|
@@ -23233,11 +23356,11 @@ var MailboxDetailModal = ({
|
|
|
23233
23356
|
"div",
|
|
23234
23357
|
{
|
|
23235
23358
|
className: styles.avatar,
|
|
23236
|
-
style: { background: getAvatarColor7(
|
|
23237
|
-
children: getInitials7(
|
|
23359
|
+
style: { background: getAvatarColor7(message21.from) },
|
|
23360
|
+
children: getInitials7(message21.from)
|
|
23238
23361
|
}
|
|
23239
23362
|
),
|
|
23240
|
-
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { children:
|
|
23363
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { children: message21.from })
|
|
23241
23364
|
] })
|
|
23242
23365
|
] }),
|
|
23243
23366
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: styles.metaItem, children: [
|
|
@@ -23247,29 +23370,29 @@ var MailboxDetailModal = ({
|
|
|
23247
23370
|
"div",
|
|
23248
23371
|
{
|
|
23249
23372
|
className: styles.avatar,
|
|
23250
|
-
style: { background: getAvatarColor7(
|
|
23251
|
-
children: getInitials7(
|
|
23373
|
+
style: { background: getAvatarColor7(message21.to) },
|
|
23374
|
+
children: getInitials7(message21.to)
|
|
23252
23375
|
}
|
|
23253
23376
|
),
|
|
23254
|
-
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { children:
|
|
23377
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { children: message21.to })
|
|
23255
23378
|
] })
|
|
23256
23379
|
] }),
|
|
23257
23380
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: styles.metaItem, children: [
|
|
23258
23381
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Text35, { className: styles.metaLabel, children: "Time" }),
|
|
23259
23382
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: styles.metaValue, children: [
|
|
23260
23383
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_lucide_react22.Calendar, { size: 14 }),
|
|
23261
|
-
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { children: formatDate3(
|
|
23384
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { children: formatDate3(message21.timestamp) })
|
|
23262
23385
|
] })
|
|
23263
23386
|
] }),
|
|
23264
23387
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: styles.metaItem, children: [
|
|
23265
23388
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Text35, { className: styles.metaLabel, children: "Type" }),
|
|
23266
|
-
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: styles.metaValue, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_antd74.Tag, { color:
|
|
23389
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: styles.metaValue, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_antd74.Tag, { color: message21.type === "broadcast" ? "blue" : "default", children: message21.type }) })
|
|
23267
23390
|
] })
|
|
23268
23391
|
] }),
|
|
23269
23392
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_antd74.Divider, {}),
|
|
23270
23393
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: styles.contentSection, children: [
|
|
23271
23394
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Text35, { className: styles.contentLabel, children: "Message Content" }),
|
|
23272
|
-
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: styles.contentBox, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Paragraph2, { className: styles.messageContent, children:
|
|
23395
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: styles.contentBox, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Paragraph2, { className: styles.messageContent, children: message21.content }) })
|
|
23273
23396
|
] })
|
|
23274
23397
|
] })
|
|
23275
23398
|
}
|
|
@@ -23498,26 +23621,26 @@ var MessageGroupComponent = ({ group, styles, defaultExpanded = true, onMessageC
|
|
|
23498
23621
|
]
|
|
23499
23622
|
}
|
|
23500
23623
|
),
|
|
23501
|
-
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: styles.listGroupContent, children: group.messages.map((
|
|
23624
|
+
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: styles.listGroupContent, children: group.messages.map((message21) => /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(
|
|
23502
23625
|
"div",
|
|
23503
23626
|
{
|
|
23504
|
-
className: `${styles.listItem} ${!
|
|
23505
|
-
onClick: () => onMessageClick(
|
|
23627
|
+
className: `${styles.listItem} ${!message21.read ? styles.listItemUnread : ""}`,
|
|
23628
|
+
onClick: () => onMessageClick(message21),
|
|
23506
23629
|
children: [
|
|
23507
|
-
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: styles.listItemIcon, children: !
|
|
23630
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: styles.listItemIcon, children: !message21.read ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: styles.unreadBadge }) : /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_lucide_react23.Circle, { size: 8, style: { color: "#d9d9d9" } }) }),
|
|
23508
23631
|
/* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: styles.listItemContent, children: [
|
|
23509
|
-
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: styles.listItemPreview, children: getMessagePreview(
|
|
23632
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: styles.listItemPreview, children: getMessagePreview(message21.content) }),
|
|
23510
23633
|
/* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("span", { className: styles.listItemMeta, children: [
|
|
23511
23634
|
"To: ",
|
|
23512
|
-
|
|
23635
|
+
message21.to,
|
|
23513
23636
|
" \u2022 ",
|
|
23514
|
-
|
|
23637
|
+
message21.type
|
|
23515
23638
|
] })
|
|
23516
23639
|
] }),
|
|
23517
|
-
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: styles.listItemRight, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: styles.listItemDate, children: formatDate4(
|
|
23640
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: styles.listItemRight, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: styles.listItemDate, children: formatDate4(message21.timestamp) }) })
|
|
23518
23641
|
]
|
|
23519
23642
|
},
|
|
23520
|
-
|
|
23643
|
+
message21.id
|
|
23521
23644
|
)) })
|
|
23522
23645
|
] });
|
|
23523
23646
|
};
|
|
@@ -23528,12 +23651,12 @@ var MailboxPanel = ({ data }) => {
|
|
|
23528
23651
|
const { teamMailbox = [] } = data || {};
|
|
23529
23652
|
const messageGroups = (0, import_react72.useMemo)(() => {
|
|
23530
23653
|
const groupsMap = /* @__PURE__ */ new Map();
|
|
23531
|
-
teamMailbox.forEach((
|
|
23532
|
-
const sender =
|
|
23654
|
+
teamMailbox.forEach((message21) => {
|
|
23655
|
+
const sender = message21.from;
|
|
23533
23656
|
if (!groupsMap.has(sender)) {
|
|
23534
23657
|
groupsMap.set(sender, []);
|
|
23535
23658
|
}
|
|
23536
|
-
groupsMap.get(sender).push(
|
|
23659
|
+
groupsMap.get(sender).push(message21);
|
|
23537
23660
|
});
|
|
23538
23661
|
const groups = Array.from(groupsMap.entries()).map(([sender, messages]) => ({
|
|
23539
23662
|
sender,
|
|
@@ -23550,8 +23673,8 @@ var MailboxPanel = ({ data }) => {
|
|
|
23550
23673
|
return groups;
|
|
23551
23674
|
}, [teamMailbox]);
|
|
23552
23675
|
const totalUnread = teamMailbox.filter((m) => !m.read).length;
|
|
23553
|
-
const handleMessageClick = (
|
|
23554
|
-
setSelectedMessage(
|
|
23676
|
+
const handleMessageClick = (message21) => {
|
|
23677
|
+
setSelectedMessage(message21);
|
|
23555
23678
|
setModalVisible(true);
|
|
23556
23679
|
};
|
|
23557
23680
|
const handleCloseModal = () => {
|
|
@@ -25395,11 +25518,11 @@ var StreamingHTMLRenderer = ({
|
|
|
25395
25518
|
if (!iframe || event.source !== iframe.contentWindow) {
|
|
25396
25519
|
return;
|
|
25397
25520
|
}
|
|
25398
|
-
const
|
|
25399
|
-
if (!
|
|
25521
|
+
const message21 = event.data;
|
|
25522
|
+
if (!message21 || typeof message21 !== "object") {
|
|
25400
25523
|
return;
|
|
25401
25524
|
}
|
|
25402
|
-
switch (
|
|
25525
|
+
switch (message21.type) {
|
|
25403
25526
|
case "iframe-ready":
|
|
25404
25527
|
console.log("[StreamingHTMLRenderer] Iframe ready");
|
|
25405
25528
|
isReadyRef.current = true;
|
|
@@ -25414,25 +25537,25 @@ var StreamingHTMLRenderer = ({
|
|
|
25414
25537
|
}
|
|
25415
25538
|
break;
|
|
25416
25539
|
case "iframe-height":
|
|
25417
|
-
if (typeof
|
|
25418
|
-
setIframeHeight(
|
|
25540
|
+
if (typeof message21.height === "number" && message21.height > 0) {
|
|
25541
|
+
setIframeHeight(message21.height);
|
|
25419
25542
|
}
|
|
25420
25543
|
break;
|
|
25421
25544
|
case "iframe-error":
|
|
25422
25545
|
const streamingError = {
|
|
25423
25546
|
type: "RENDER_ERROR",
|
|
25424
|
-
message:
|
|
25547
|
+
message: message21.error || "Unknown iframe error"
|
|
25425
25548
|
};
|
|
25426
25549
|
onError?.(streamingError);
|
|
25427
25550
|
break;
|
|
25428
25551
|
case "widget-prompt":
|
|
25429
|
-
if (typeof
|
|
25430
|
-
onPrompt?.(
|
|
25552
|
+
if (typeof message21.text === "string") {
|
|
25553
|
+
onPrompt?.(message21.text);
|
|
25431
25554
|
}
|
|
25432
25555
|
break;
|
|
25433
25556
|
case "widget-open-link":
|
|
25434
|
-
if (typeof
|
|
25435
|
-
window.open(
|
|
25557
|
+
if (typeof message21.url === "string") {
|
|
25558
|
+
window.open(message21.url, "_blank", "noopener,noreferrer");
|
|
25436
25559
|
}
|
|
25437
25560
|
break;
|
|
25438
25561
|
}
|
|
@@ -26531,129 +26654,42 @@ var ProjectSelector = () => {
|
|
|
26531
26654
|
] });
|
|
26532
26655
|
};
|
|
26533
26656
|
|
|
26534
|
-
// src/components/Chat/
|
|
26535
|
-
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
26536
|
-
var LatticeChat = (props) => {
|
|
26537
|
-
const { assistant_id, thread_id = "", menu, header, ...chatingProps } = props;
|
|
26538
|
-
const { config } = useLatticeChatShellContext();
|
|
26539
|
-
const showWorkspaceSelector = config.enableWorkspace;
|
|
26540
|
-
const leftTop = showWorkspaceSelector ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(ProjectSelector, {}) : null;
|
|
26541
|
-
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
26542
|
-
AgentThreadProvider,
|
|
26543
|
-
{
|
|
26544
|
-
assistantId: assistant_id,
|
|
26545
|
-
threadId: thread_id,
|
|
26546
|
-
options: {
|
|
26547
|
-
streaming: true,
|
|
26548
|
-
enableReturnStateWhenStreamCompleted: true,
|
|
26549
|
-
enableResumeStream: true
|
|
26550
|
-
},
|
|
26551
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(ChatUIContextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(
|
|
26552
|
-
"div",
|
|
26553
|
-
{
|
|
26554
|
-
style: {
|
|
26555
|
-
display: "flex",
|
|
26556
|
-
flexDirection: "column",
|
|
26557
|
-
width: "100%",
|
|
26558
|
-
height: "100%"
|
|
26559
|
-
},
|
|
26560
|
-
children: [
|
|
26561
|
-
header,
|
|
26562
|
-
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
26563
|
-
ColumnLayout,
|
|
26564
|
-
{
|
|
26565
|
-
menu,
|
|
26566
|
-
header: leftTop,
|
|
26567
|
-
left: thread_id ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Chating, { ...chatingProps }) : /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { children: "Please create a conversation first" }),
|
|
26568
|
-
right: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(SideAppViewBrowser, {})
|
|
26569
|
-
}
|
|
26570
|
-
)
|
|
26571
|
-
]
|
|
26572
|
-
}
|
|
26573
|
-
) })
|
|
26574
|
-
}
|
|
26575
|
-
);
|
|
26576
|
-
};
|
|
26577
|
-
|
|
26578
|
-
// src/components/Chat/AgentConversations.tsx
|
|
26579
|
-
var import_x7 = require("@ant-design/x");
|
|
26580
|
-
var import_antd80 = require("antd");
|
|
26581
|
-
var import_react81 = require("react");
|
|
26582
|
-
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
26583
|
-
var AgentConversations = ({
|
|
26584
|
-
enableThreadCreation = true,
|
|
26585
|
-
enableThreadList = true
|
|
26586
|
-
}) => {
|
|
26587
|
-
const { token } = import_antd80.theme.useToken();
|
|
26588
|
-
const { currentAssistant } = useAssistantContext();
|
|
26589
|
-
const {
|
|
26590
|
-
assistantId,
|
|
26591
|
-
thread,
|
|
26592
|
-
selectThread,
|
|
26593
|
-
createThread,
|
|
26594
|
-
listThreads,
|
|
26595
|
-
threads
|
|
26596
|
-
} = useConversationContext();
|
|
26597
|
-
const style = {
|
|
26598
|
-
width: "100%",
|
|
26599
|
-
background: "transparent",
|
|
26600
|
-
borderRadius: token.borderRadius
|
|
26601
|
-
};
|
|
26602
|
-
const threadItems = (0, import_react81.useMemo)(() => {
|
|
26603
|
-
return threads || [];
|
|
26604
|
-
}, [threads]);
|
|
26605
|
-
const items = threadItems.map((thread2) => ({
|
|
26606
|
-
key: thread2.id,
|
|
26607
|
-
label: thread2.label
|
|
26608
|
-
}));
|
|
26609
|
-
const newChatClick = async () => {
|
|
26610
|
-
if (!assistantId) {
|
|
26611
|
-
return;
|
|
26612
|
-
}
|
|
26613
|
-
await createThread();
|
|
26614
|
-
};
|
|
26615
|
-
if (!enableThreadList) {
|
|
26616
|
-
return null;
|
|
26617
|
-
}
|
|
26618
|
-
const creation = enableThreadCreation ? {
|
|
26619
|
-
onClick: newChatClick
|
|
26620
|
-
} : void 0;
|
|
26621
|
-
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
26622
|
-
import_x7.Conversations,
|
|
26623
|
-
{
|
|
26624
|
-
creation,
|
|
26625
|
-
items,
|
|
26626
|
-
activeKey: thread?.id,
|
|
26627
|
-
style,
|
|
26628
|
-
groupable: true,
|
|
26629
|
-
onActiveChange: (key) => {
|
|
26630
|
-
selectThread(key);
|
|
26631
|
-
}
|
|
26632
|
-
}
|
|
26633
|
-
);
|
|
26634
|
-
};
|
|
26635
|
-
|
|
26636
|
-
// src/components/Chat/LatticeChatView.tsx
|
|
26637
|
-
var import_react85 = require("react");
|
|
26638
|
-
|
|
26639
|
-
// src/components/Chat/ChatSidebar.tsx
|
|
26640
|
-
var import_react84 = require("react");
|
|
26641
|
-
var import_antd83 = require("antd");
|
|
26642
|
-
var import_lucide_react28 = require("lucide-react");
|
|
26643
|
-
|
|
26644
|
-
// src/components/Chat/ProjectsMenuContent.tsx
|
|
26657
|
+
// src/components/Chat/ToolPanelFiles.tsx
|
|
26645
26658
|
var import_react82 = require("react");
|
|
26646
26659
|
var import_antd81 = require("antd");
|
|
26647
|
-
|
|
26660
|
+
|
|
26661
|
+
// src/components/Chat/FileDirectoryPanel.tsx
|
|
26662
|
+
var import_react81 = __toESM(require("react"));
|
|
26663
|
+
var import_antd80 = require("antd");
|
|
26648
26664
|
var import_lucide_react26 = require("lucide-react");
|
|
26649
|
-
var
|
|
26650
|
-
var
|
|
26665
|
+
var import_antd_style32 = require("antd-style");
|
|
26666
|
+
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
26651
26667
|
var useStyles19 = (0, import_antd_style32.createStyles)(({ token, css }) => ({
|
|
26652
26668
|
container: css`
|
|
26653
|
-
padding:
|
|
26669
|
+
padding: 12px;
|
|
26654
26670
|
font-size: 13px;
|
|
26655
26671
|
background: transparent;
|
|
26656
26672
|
`,
|
|
26673
|
+
header: css`
|
|
26674
|
+
display: flex;
|
|
26675
|
+
align-items: center;
|
|
26676
|
+
gap: 8px;
|
|
26677
|
+
margin-bottom: 12px;
|
|
26678
|
+
padding: 0 4px;
|
|
26679
|
+
font-size: 15px;
|
|
26680
|
+
line-height: 1.4;
|
|
26681
|
+
font-weight: 600;
|
|
26682
|
+
color: ${token.colorText};
|
|
26683
|
+
letter-spacing: -0.01em;
|
|
26684
|
+
padding-bottom: 8px;
|
|
26685
|
+
border-bottom: 1px solid ${token.colorBorderSecondary};
|
|
26686
|
+
|
|
26687
|
+
svg {
|
|
26688
|
+
width: 16px;
|
|
26689
|
+
height: 16px;
|
|
26690
|
+
color: ${token.colorTextSecondary};
|
|
26691
|
+
}
|
|
26692
|
+
`,
|
|
26657
26693
|
section: css`
|
|
26658
26694
|
margin-bottom: 12px;
|
|
26659
26695
|
`,
|
|
@@ -26667,7 +26703,7 @@ var useStyles19 = (0, import_antd_style32.createStyles)(({ token, css }) => ({
|
|
|
26667
26703
|
sectionTitle: css`
|
|
26668
26704
|
font-size: 10px;
|
|
26669
26705
|
font-weight: 600;
|
|
26670
|
-
letter-spacing: 0.
|
|
26706
|
+
letter-spacing: 0.05em;
|
|
26671
26707
|
color: ${token.colorTextSecondary};
|
|
26672
26708
|
text-transform: uppercase;
|
|
26673
26709
|
cursor: pointer;
|
|
@@ -26678,28 +26714,6 @@ var useStyles19 = (0, import_antd_style32.createStyles)(({ token, css }) => ({
|
|
|
26678
26714
|
color: ${token.colorPrimary};
|
|
26679
26715
|
}
|
|
26680
26716
|
`,
|
|
26681
|
-
sectionAction: css`
|
|
26682
|
-
display: flex;
|
|
26683
|
-
align-items: center;
|
|
26684
|
-
justify-content: center;
|
|
26685
|
-
width: 20px;
|
|
26686
|
-
height: 20px;
|
|
26687
|
-
border-radius: 4px;
|
|
26688
|
-
border: none;
|
|
26689
|
-
background: transparent;
|
|
26690
|
-
cursor: pointer;
|
|
26691
|
-
transition: all 0.15s ease;
|
|
26692
|
-
|
|
26693
|
-
&:hover {
|
|
26694
|
-
background: ${token.colorBgTextHover};
|
|
26695
|
-
}
|
|
26696
|
-
|
|
26697
|
-
svg {
|
|
26698
|
-
width: 14px;
|
|
26699
|
-
height: 14px;
|
|
26700
|
-
color: ${token.colorTextSecondary};
|
|
26701
|
-
}
|
|
26702
|
-
`,
|
|
26703
26717
|
badge: css`
|
|
26704
26718
|
display: flex;
|
|
26705
26719
|
align-items: center;
|
|
@@ -26708,88 +26722,66 @@ var useStyles19 = (0, import_antd_style32.createStyles)(({ token, css }) => ({
|
|
|
26708
26722
|
height: 16px;
|
|
26709
26723
|
padding: 0 4px;
|
|
26710
26724
|
border-radius: 8px;
|
|
26711
|
-
background:
|
|
26725
|
+
background: ${token.colorFillSecondary};
|
|
26712
26726
|
font-size: 10px;
|
|
26713
|
-
font-weight:
|
|
26727
|
+
font-weight: 500;
|
|
26714
26728
|
color: ${token.colorTextSecondary};
|
|
26715
26729
|
`,
|
|
26716
|
-
|
|
26730
|
+
assetList: css`
|
|
26717
26731
|
display: flex;
|
|
26718
26732
|
flex-direction: column;
|
|
26719
26733
|
gap: 2px;
|
|
26720
26734
|
`,
|
|
26721
|
-
|
|
26735
|
+
assetItem: css`
|
|
26722
26736
|
display: flex;
|
|
26723
26737
|
align-items: center;
|
|
26724
26738
|
gap: 8px;
|
|
26725
|
-
|
|
26726
|
-
|
|
26739
|
+
width: 100%;
|
|
26740
|
+
padding: 5px 8px;
|
|
26741
|
+
border-radius: 4px;
|
|
26727
26742
|
cursor: pointer;
|
|
26728
26743
|
transition: all 0.15s ease;
|
|
26729
|
-
border:
|
|
26744
|
+
border: none;
|
|
26745
|
+
background: transparent;
|
|
26746
|
+
text-align: left;
|
|
26730
26747
|
|
|
26731
26748
|
&:hover {
|
|
26732
26749
|
background: ${token.colorBgTextHover};
|
|
26733
|
-
border-color: ${token.colorBorder};
|
|
26734
|
-
}
|
|
26735
|
-
|
|
26736
|
-
&.active {
|
|
26737
|
-
background: ${token.colorPrimaryBg};
|
|
26738
|
-
border-color: ${token.colorPrimary};
|
|
26739
26750
|
}
|
|
26740
26751
|
`,
|
|
26741
|
-
|
|
26752
|
+
treeRow: css`
|
|
26742
26753
|
display: flex;
|
|
26743
26754
|
align-items: center;
|
|
26744
|
-
|
|
26745
|
-
|
|
26746
|
-
svg {
|
|
26747
|
-
width: 16px;
|
|
26748
|
-
height: 16px;
|
|
26749
|
-
color: ${token.colorPrimary};
|
|
26750
|
-
}
|
|
26755
|
+
gap: 8px;
|
|
26756
|
+
width: 100%;
|
|
26751
26757
|
`,
|
|
26752
|
-
|
|
26753
|
-
|
|
26758
|
+
treeIndent: css`
|
|
26759
|
+
flex-shrink: 0;
|
|
26760
|
+
width: 12px;
|
|
26761
|
+
`,
|
|
26762
|
+
treeToggle: css`
|
|
26763
|
+
display: inline-flex;
|
|
26754
26764
|
align-items: center;
|
|
26755
26765
|
justify-content: center;
|
|
26756
|
-
|
|
26757
|
-
|
|
26758
|
-
|
|
26759
|
-
|
|
26760
|
-
color: ${token.colorTextSecondary};
|
|
26761
|
-
}
|
|
26762
|
-
`,
|
|
26763
|
-
projectName: css`
|
|
26764
|
-
font-size: 13px;
|
|
26765
|
-
font-weight: 600;
|
|
26766
|
-
color: ${token.colorPrimary};
|
|
26767
|
-
flex: 1;
|
|
26768
|
-
`,
|
|
26769
|
-
projectNameInactive: css`
|
|
26770
|
-
font-size: 13px;
|
|
26771
|
-
font-weight: 500;
|
|
26772
|
-
color: ${token.colorText};
|
|
26773
|
-
flex: 1;
|
|
26774
|
-
`,
|
|
26775
|
-
assetList: css`
|
|
26776
|
-
display: flex;
|
|
26777
|
-
flex-direction: column;
|
|
26778
|
-
gap: 2px;
|
|
26779
|
-
`,
|
|
26780
|
-
assetItem: css`
|
|
26781
|
-
display: flex;
|
|
26782
|
-
align-items: center;
|
|
26783
|
-
gap: 8px;
|
|
26784
|
-
padding: 5px 8px;
|
|
26766
|
+
width: 18px;
|
|
26767
|
+
height: 18px;
|
|
26768
|
+
padding: 0;
|
|
26769
|
+
border: none;
|
|
26785
26770
|
border-radius: 4px;
|
|
26771
|
+
background: transparent;
|
|
26772
|
+
color: ${token.colorTextSecondary};
|
|
26786
26773
|
cursor: pointer;
|
|
26787
|
-
transition: all 0.15s ease;
|
|
26788
26774
|
|
|
26789
26775
|
&:hover {
|
|
26790
26776
|
background: ${token.colorBgTextHover};
|
|
26777
|
+
color: ${token.colorText};
|
|
26791
26778
|
}
|
|
26792
26779
|
`,
|
|
26780
|
+
treeSpacer: css`
|
|
26781
|
+
flex-shrink: 0;
|
|
26782
|
+
width: 18px;
|
|
26783
|
+
height: 18px;
|
|
26784
|
+
`,
|
|
26793
26785
|
assetIcon: css`
|
|
26794
26786
|
display: flex;
|
|
26795
26787
|
align-items: center;
|
|
@@ -26820,6 +26812,11 @@ var useStyles19 = (0, import_antd_style32.createStyles)(({ token, css }) => ({
|
|
|
26820
26812
|
font-size: 10px;
|
|
26821
26813
|
color: ${token.colorTextSecondary};
|
|
26822
26814
|
`,
|
|
26815
|
+
treeChildren: css`
|
|
26816
|
+
display: flex;
|
|
26817
|
+
flex-direction: column;
|
|
26818
|
+
gap: 2px;
|
|
26819
|
+
`,
|
|
26823
26820
|
emptyState: css`
|
|
26824
26821
|
padding: 12px;
|
|
26825
26822
|
text-align: center;
|
|
@@ -26863,262 +26860,245 @@ var useStyles19 = (0, import_antd_style32.createStyles)(({ token, css }) => ({
|
|
|
26863
26860
|
width: 14px;
|
|
26864
26861
|
height: 14px;
|
|
26865
26862
|
}
|
|
26866
|
-
`,
|
|
26867
|
-
projectSelector: css`
|
|
26868
|
-
margin-bottom: 12px;
|
|
26869
|
-
`,
|
|
26870
|
-
projectTrigger: css`
|
|
26871
|
-
display: flex;
|
|
26872
|
-
align-items: center;
|
|
26873
|
-
gap: 8px;
|
|
26874
|
-
cursor: pointer;
|
|
26875
|
-
padding: 8px;
|
|
26876
|
-
border-radius: 8px;
|
|
26877
|
-
transition: all 0.2s ease;
|
|
26878
|
-
border: 1px solid transparent;
|
|
26879
|
-
|
|
26880
|
-
&:hover {
|
|
26881
|
-
background: ${token.colorBgTextHover};
|
|
26882
|
-
border-color: ${token.colorBorder};
|
|
26883
|
-
}
|
|
26884
|
-
`,
|
|
26885
|
-
projectTriggerIcon: css`
|
|
26886
|
-
display: flex;
|
|
26887
|
-
align-items: center;
|
|
26888
|
-
justify-content: center;
|
|
26889
|
-
width: 28px;
|
|
26890
|
-
height: 28px;
|
|
26891
|
-
border-radius: 6px;
|
|
26892
|
-
background: ${token.colorPrimaryBg};
|
|
26893
|
-
|
|
26894
|
-
svg {
|
|
26895
|
-
width: 16px;
|
|
26896
|
-
height: 16px;
|
|
26897
|
-
color: ${token.colorPrimary};
|
|
26898
|
-
}
|
|
26899
|
-
`,
|
|
26900
|
-
projectTriggerInfo: css`
|
|
26901
|
-
flex: 1;
|
|
26902
|
-
min-width: 0;
|
|
26903
|
-
`,
|
|
26904
|
-
projectTriggerName: css`
|
|
26905
|
-
font-size: 13px;
|
|
26906
|
-
font-weight: 600;
|
|
26907
|
-
color: ${token.colorText};
|
|
26908
|
-
white-space: nowrap;
|
|
26909
|
-
overflow: hidden;
|
|
26910
|
-
text-overflow: ellipsis;
|
|
26911
|
-
`,
|
|
26912
|
-
projectTriggerArrow: css`
|
|
26913
|
-
display: flex;
|
|
26914
|
-
align-items: center;
|
|
26915
|
-
|
|
26916
|
-
svg {
|
|
26917
|
-
width: 14px;
|
|
26918
|
-
height: 14px;
|
|
26919
|
-
color: ${token.colorTextSecondary};
|
|
26920
|
-
transition: transform 0.2s ease;
|
|
26921
|
-
}
|
|
26922
|
-
|
|
26923
|
-
&.expanded svg {
|
|
26924
|
-
transform: rotate(180deg);
|
|
26925
|
-
}
|
|
26926
|
-
`,
|
|
26927
|
-
projectDropdown: css`
|
|
26928
|
-
display: flex;
|
|
26929
|
-
flex-direction: column;
|
|
26930
|
-
gap: 2px;
|
|
26931
|
-
margin-top: 4px;
|
|
26932
|
-
padding: 4px;
|
|
26933
|
-
background: ${token.colorBgContainer};
|
|
26934
|
-
border-radius: 8px;
|
|
26935
|
-
border: 1px solid ${token.colorBorder};
|
|
26936
|
-
`,
|
|
26937
|
-
projectDropdownItem: css`
|
|
26938
|
-
display: flex;
|
|
26939
|
-
align-items: center;
|
|
26940
|
-
gap: 8px;
|
|
26941
|
-
padding: 8px 10px;
|
|
26942
|
-
border-radius: 6px;
|
|
26943
|
-
cursor: pointer;
|
|
26944
|
-
transition: all 0.15s ease;
|
|
26945
|
-
|
|
26946
|
-
&:hover {
|
|
26947
|
-
background: ${token.colorBgTextHover};
|
|
26948
|
-
}
|
|
26949
|
-
|
|
26950
|
-
&.active {
|
|
26951
|
-
background: ${token.colorPrimaryBg};
|
|
26952
|
-
}
|
|
26953
|
-
`,
|
|
26954
|
-
projectDropdownItemIcon: css`
|
|
26955
|
-
display: flex;
|
|
26956
|
-
align-items: center;
|
|
26957
|
-
justify-content: center;
|
|
26958
|
-
|
|
26959
|
-
svg {
|
|
26960
|
-
width: 14px;
|
|
26961
|
-
height: 14px;
|
|
26962
|
-
color: ${token.colorTextSecondary};
|
|
26963
|
-
}
|
|
26964
|
-
`,
|
|
26965
|
-
projectDropdownItemName: css`
|
|
26966
|
-
font-size: 12px;
|
|
26967
|
-
font-weight: 500;
|
|
26968
|
-
color: ${token.colorText};
|
|
26969
|
-
flex: 1;
|
|
26970
|
-
`,
|
|
26971
|
-
projectDropdownItemNameActive: css`
|
|
26972
|
-
font-size: 12px;
|
|
26973
|
-
font-weight: 600;
|
|
26974
|
-
color: ${token.colorPrimary};
|
|
26975
|
-
flex: 1;
|
|
26976
|
-
`,
|
|
26977
|
-
modalWrap: css`
|
|
26978
|
-
.ant-modal-content {
|
|
26979
|
-
border-radius: 12px;
|
|
26980
|
-
overflow: hidden;
|
|
26981
|
-
}
|
|
26982
|
-
`,
|
|
26983
|
-
formLabel: css`
|
|
26984
|
-
display: block;
|
|
26985
|
-
font-size: 13px;
|
|
26986
|
-
font-weight: 600;
|
|
26987
|
-
color: ${token.colorText};
|
|
26988
|
-
margin-bottom: 8px;
|
|
26989
|
-
`,
|
|
26990
|
-
formInput: css`
|
|
26991
|
-
border-radius: 8px;
|
|
26992
|
-
`,
|
|
26993
|
-
formError: css`
|
|
26994
|
-
font-size: 12px;
|
|
26995
|
-
color: ${token.colorError};
|
|
26996
|
-
margin-top: 6px;
|
|
26997
|
-
`,
|
|
26998
|
-
modalFooter: css`
|
|
26999
|
-
display: flex;
|
|
27000
|
-
justify-content: flex-end;
|
|
27001
|
-
gap: 8px;
|
|
27002
26863
|
`
|
|
27003
26864
|
}));
|
|
27004
|
-
var
|
|
26865
|
+
var formatDate5 = (dateStr) => {
|
|
26866
|
+
if (!dateStr) return "";
|
|
26867
|
+
const date = new Date(dateStr);
|
|
26868
|
+
return date.toLocaleDateString("en-US", { month: "short", day: "numeric" });
|
|
26869
|
+
};
|
|
26870
|
+
var getFileName = (path) => {
|
|
26871
|
+
if (!path) return "";
|
|
26872
|
+
const parts = path.split(/[/\\]/);
|
|
26873
|
+
return parts[parts.length - 1];
|
|
26874
|
+
};
|
|
26875
|
+
var getEntryName = (entry) => getFileName(entry.name || entry.path);
|
|
26876
|
+
var FileDirectoryPanel = ({
|
|
26877
|
+
workspaceId,
|
|
26878
|
+
projectId,
|
|
26879
|
+
resourceFolders,
|
|
26880
|
+
folderEntries,
|
|
26881
|
+
folderLoading,
|
|
26882
|
+
directoryChildren,
|
|
26883
|
+
directoryLoading,
|
|
26884
|
+
directoryExpanded,
|
|
26885
|
+
uploadingFolder,
|
|
26886
|
+
onRefreshFolder,
|
|
26887
|
+
onUploadFolder,
|
|
26888
|
+
onToggleDirectory,
|
|
26889
|
+
onAssetClick
|
|
26890
|
+
}) => {
|
|
27005
26891
|
const { styles } = useStyles19();
|
|
26892
|
+
const renderEntry = import_react81.default.useCallback((entry, depth) => {
|
|
26893
|
+
const entryName = getEntryName(entry);
|
|
26894
|
+
if (entry.is_dir) {
|
|
26895
|
+
const isExpanded = directoryExpanded[entry.path] || false;
|
|
26896
|
+
const children = directoryChildren[entry.path] || [];
|
|
26897
|
+
const isLoading = directoryLoading[entry.path] || false;
|
|
26898
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: styles.treeChildren, children: [
|
|
26899
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: styles.treeRow, children: [
|
|
26900
|
+
Array.from({ length: depth }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { className: styles.treeIndent }, `${entry.path}-indent-${index}`)),
|
|
26901
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
26902
|
+
"button",
|
|
26903
|
+
{
|
|
26904
|
+
type: "button",
|
|
26905
|
+
className: styles.treeToggle,
|
|
26906
|
+
"aria-label": `${isExpanded ? "collapse" : "expand"} ${entryName}`,
|
|
26907
|
+
onClick: () => void onToggleDirectory(entry.path),
|
|
26908
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_lucide_react26.ChevronRight, { size: 14, style: { transform: isExpanded ? "rotate(90deg)" : void 0 } })
|
|
26909
|
+
}
|
|
26910
|
+
),
|
|
26911
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(
|
|
26912
|
+
"button",
|
|
26913
|
+
{
|
|
26914
|
+
type: "button",
|
|
26915
|
+
className: styles.assetItem,
|
|
26916
|
+
"aria-label": `toggle ${entryName}`,
|
|
26917
|
+
onClick: () => void onToggleDirectory(entry.path),
|
|
26918
|
+
title: entryName,
|
|
26919
|
+
children: [
|
|
26920
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.assetIcon, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_lucide_react26.FolderOpen, { size: 14 }) }),
|
|
26921
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.assetInfo, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.assetName, children: entryName }) })
|
|
26922
|
+
]
|
|
26923
|
+
}
|
|
26924
|
+
)
|
|
26925
|
+
] }),
|
|
26926
|
+
isExpanded ? isLoading ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.loading, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_antd80.Spin, { size: "small" }) }) : children.length > 0 ? children.map((child) => renderEntry(child, depth + 1)) : /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.emptyState, children: "No files in this folder" }) : null
|
|
26927
|
+
] }, entry.path);
|
|
26928
|
+
}
|
|
26929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: styles.treeRow, children: [
|
|
26930
|
+
Array.from({ length: depth }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { className: styles.treeIndent }, `${entry.path}-indent-${index}`)),
|
|
26931
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { className: styles.treeSpacer }),
|
|
26932
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(
|
|
26933
|
+
"button",
|
|
26934
|
+
{
|
|
26935
|
+
type: "button",
|
|
26936
|
+
className: styles.assetItem,
|
|
26937
|
+
onClick: () => onAssetClick(entry),
|
|
26938
|
+
"aria-label": `open ${entryName}`,
|
|
26939
|
+
title: entryName,
|
|
26940
|
+
children: [
|
|
26941
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.assetIcon, children: getFileIcon2(entryName) }),
|
|
26942
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: styles.assetInfo, children: [
|
|
26943
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.assetName, children: entryName }),
|
|
26944
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.assetMeta, children: formatDate5(entry.modified_at) })
|
|
26945
|
+
] })
|
|
26946
|
+
]
|
|
26947
|
+
}
|
|
26948
|
+
)
|
|
26949
|
+
] }, entry.path);
|
|
26950
|
+
}, [directoryChildren, directoryExpanded, directoryLoading, onAssetClick, onToggleDirectory, styles]);
|
|
26951
|
+
if (!projectId) {
|
|
26952
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.emptyState, children: "Please select a project to browse files" });
|
|
26953
|
+
}
|
|
26954
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: styles.container, children: [
|
|
26955
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("h3", { className: styles.header, children: [
|
|
26956
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_lucide_react26.FolderOpen, { size: 16 }),
|
|
26957
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { children: "Files" })
|
|
26958
|
+
] }),
|
|
26959
|
+
resourceFolders.map((folder) => {
|
|
26960
|
+
const entries = folderEntries[folder.name] || [];
|
|
26961
|
+
const isLoading = folderLoading[folder.name] || false;
|
|
26962
|
+
const itemCount = entries.length;
|
|
26963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: styles.section, children: [
|
|
26964
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: styles.sectionHeader, children: [
|
|
26965
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
26966
|
+
"span",
|
|
26967
|
+
{
|
|
26968
|
+
className: styles.sectionTitle,
|
|
26969
|
+
onClick: () => void onRefreshFolder(folder),
|
|
26970
|
+
title: "Click to refresh",
|
|
26971
|
+
children: folder.displayName || folder.name
|
|
26972
|
+
}
|
|
26973
|
+
),
|
|
26974
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { className: styles.badge, children: itemCount })
|
|
26975
|
+
] }),
|
|
26976
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.loading, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_antd80.Spin, { size: "small" }) }) : /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: styles.assetList, children: [
|
|
26977
|
+
entries.map((entry) => renderEntry(entry, 0)),
|
|
26978
|
+
entries.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: styles.emptyState, children: "No files in this folder" }) : null,
|
|
26979
|
+
folder.allowUpload ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
26980
|
+
"button",
|
|
26981
|
+
{
|
|
26982
|
+
type: "button",
|
|
26983
|
+
className: styles.uploadBtn,
|
|
26984
|
+
onClick: () => void onUploadFolder(folder.name),
|
|
26985
|
+
disabled: !workspaceId || !projectId || uploadingFolder === folder.name,
|
|
26986
|
+
children: uploadingFolder === folder.name ? /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(import_jsx_runtime105.Fragment, { children: [
|
|
26987
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_antd80.Spin, { size: "small" }),
|
|
26988
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { children: "Uploading..." })
|
|
26989
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(import_jsx_runtime105.Fragment, { children: [
|
|
26990
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_lucide_react26.Upload, { size: 14 }),
|
|
26991
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { children: "Upload" })
|
|
26992
|
+
] })
|
|
26993
|
+
}
|
|
26994
|
+
) : null
|
|
26995
|
+
] })
|
|
26996
|
+
] }, folder.name);
|
|
26997
|
+
})
|
|
26998
|
+
] });
|
|
26999
|
+
};
|
|
27000
|
+
|
|
27001
|
+
// src/components/Chat/ToolPanelFiles.tsx
|
|
27002
|
+
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
27003
|
+
var ToolPanelFiles = () => {
|
|
27006
27004
|
const { config } = useLatticeChatShellContext();
|
|
27007
27005
|
const { openSideApp } = useChatUIContext();
|
|
27008
27006
|
const {
|
|
27009
27007
|
workspaceId,
|
|
27010
27008
|
projectId,
|
|
27011
|
-
|
|
27012
|
-
setProject,
|
|
27009
|
+
listPath,
|
|
27013
27010
|
listPathByFolder,
|
|
27014
|
-
createProject,
|
|
27015
27011
|
getFileViewUrl,
|
|
27016
27012
|
uploadFileToFolder
|
|
27017
27013
|
} = useWorkspaceContext();
|
|
27018
|
-
const [
|
|
27014
|
+
const [folderEntries, setFolderEntries] = (0, import_react82.useState)({});
|
|
27019
27015
|
const [folderLoading, setFolderLoading] = (0, import_react82.useState)({});
|
|
27020
|
-
const [
|
|
27016
|
+
const [directoryChildren, setDirectoryChildren] = (0, import_react82.useState)({});
|
|
27017
|
+
const [directoryLoading, setDirectoryLoading] = (0, import_react82.useState)({});
|
|
27018
|
+
const [directoryExpanded, setDirectoryExpanded] = (0, import_react82.useState)({});
|
|
27021
27019
|
const [uploadingFolder, setUploadingFolder] = (0, import_react82.useState)(null);
|
|
27022
|
-
const [isModalOpen, setIsModalOpen] = (0, import_react82.useState)(false);
|
|
27023
|
-
const [projectName, setProjectName] = (0, import_react82.useState)("");
|
|
27024
|
-
const [validationError, setValidationError] = (0, import_react82.useState)(null);
|
|
27025
|
-
const [isCreating, setIsCreating] = (0, import_react82.useState)(false);
|
|
27026
|
-
const projectNameInputRef = (0, import_react82.useRef)(null);
|
|
27027
27020
|
const resourceFolders = (0, import_react82.useMemo)(() => {
|
|
27028
27021
|
return config.resourceFolders && config.resourceFolders.length > 0 ? config.resourceFolders : [{ name: "/", displayName: "Project Assets", allowUpload: true }];
|
|
27029
27022
|
}, [config.resourceFolders]);
|
|
27030
|
-
const currentProject = (0, import_react82.useMemo)(() => {
|
|
27031
|
-
return projects.find((p) => p.id === projectId);
|
|
27032
|
-
}, [projects, projectId]);
|
|
27033
27023
|
const loadAssetsForFolder = (0, import_react82.useCallback)(async (folder) => {
|
|
27034
27024
|
if (!workspaceId || !projectId) {
|
|
27035
|
-
|
|
27025
|
+
setFolderEntries((prev) => ({ ...prev, [folder.name]: [] }));
|
|
27036
27026
|
return;
|
|
27037
27027
|
}
|
|
27038
27028
|
setFolderLoading((prev) => ({ ...prev, [folder.name]: true }));
|
|
27039
27029
|
try {
|
|
27040
27030
|
const items = await listPathByFolder(folder.name);
|
|
27041
|
-
|
|
27031
|
+
setFolderEntries((prev) => ({ ...prev, [folder.name]: items }));
|
|
27032
|
+
setDirectoryChildren((prev) => {
|
|
27033
|
+
const next = { ...prev };
|
|
27034
|
+
const folderPath = folder.name === "/" ? "/" : folder.name.replace(/\/$/, "");
|
|
27035
|
+
Object.keys(next).forEach((key) => {
|
|
27036
|
+
if (key === folderPath || key.startsWith(`${folderPath}/`)) {
|
|
27037
|
+
delete next[key];
|
|
27038
|
+
}
|
|
27039
|
+
});
|
|
27040
|
+
return next;
|
|
27041
|
+
});
|
|
27042
|
+
setDirectoryExpanded((prev) => {
|
|
27043
|
+
const next = { ...prev };
|
|
27044
|
+
const folderPath = folder.name === "/" ? "/" : folder.name.replace(/\/$/, "");
|
|
27045
|
+
Object.keys(next).forEach((key) => {
|
|
27046
|
+
if (key === folderPath || key.startsWith(`${folderPath}/`)) {
|
|
27047
|
+
delete next[key];
|
|
27048
|
+
}
|
|
27049
|
+
});
|
|
27050
|
+
return next;
|
|
27051
|
+
});
|
|
27042
27052
|
} catch (error) {
|
|
27043
27053
|
console.error(`Failed to load assets for folder ${folder.name}:`, error);
|
|
27044
|
-
|
|
27054
|
+
setFolderEntries((prev) => ({ ...prev, [folder.name]: [] }));
|
|
27045
27055
|
} finally {
|
|
27046
27056
|
setFolderLoading((prev) => ({ ...prev, [folder.name]: false }));
|
|
27047
27057
|
}
|
|
27048
27058
|
}, [workspaceId, projectId, listPathByFolder]);
|
|
27049
|
-
(0, import_react82.
|
|
27050
|
-
|
|
27051
|
-
|
|
27052
|
-
|
|
27053
|
-
}, [workspaceId, projectId, loadAssetsForFolder, resourceFolders]);
|
|
27054
|
-
const handleSelectProject = (0, import_react82.useCallback)((selectedProjectId) => {
|
|
27055
|
-
setProject(selectedProjectId);
|
|
27056
|
-
setIsProjectListOpen(false);
|
|
27057
|
-
}, [setProject]);
|
|
27058
|
-
const toggleProjectList = (0, import_react82.useCallback)(() => {
|
|
27059
|
-
setIsProjectListOpen((prev) => !prev);
|
|
27060
|
-
}, []);
|
|
27061
|
-
const validateProjectName = (0, import_react82.useCallback)((name) => {
|
|
27062
|
-
const trimmed = name.trim();
|
|
27063
|
-
if (!trimmed) return "Project name is required";
|
|
27064
|
-
if (trimmed.length > PROJECT_NAME_MAX_LENGTH2) {
|
|
27065
|
-
return `Name must be ${PROJECT_NAME_MAX_LENGTH2} characters or less`;
|
|
27066
|
-
}
|
|
27067
|
-
return null;
|
|
27068
|
-
}, []);
|
|
27069
|
-
const handleOpenModal = (0, import_react82.useCallback)(() => {
|
|
27070
|
-
if (!workspaceId) {
|
|
27071
|
-
import_antd81.message.warning("Please select a workspace first");
|
|
27059
|
+
const handleToggleDirectory = (0, import_react82.useCallback)(async (path) => {
|
|
27060
|
+
const isExpanded = directoryExpanded[path] || false;
|
|
27061
|
+
if (isExpanded) {
|
|
27062
|
+
setDirectoryExpanded((prev) => ({ ...prev, [path]: false }));
|
|
27072
27063
|
return;
|
|
27073
27064
|
}
|
|
27074
|
-
|
|
27075
|
-
|
|
27076
|
-
setIsModalOpen(true);
|
|
27077
|
-
setTimeout(() => projectNameInputRef.current?.input?.focus(), 100);
|
|
27078
|
-
}, [workspaceId]);
|
|
27079
|
-
const handleCloseModal = (0, import_react82.useCallback)(() => {
|
|
27080
|
-
setIsModalOpen(false);
|
|
27081
|
-
setProjectName("");
|
|
27082
|
-
setValidationError(null);
|
|
27083
|
-
}, []);
|
|
27084
|
-
const handleProjectNameChange = (e) => {
|
|
27085
|
-
const value = e.target.value;
|
|
27086
|
-
setProjectName(value);
|
|
27087
|
-
setValidationError(validateProjectName(value));
|
|
27088
|
-
};
|
|
27089
|
-
const handleCreateProject = (0, import_react82.useCallback)(async () => {
|
|
27090
|
-
if (!workspaceId) return;
|
|
27091
|
-
const trimmed = projectName.trim();
|
|
27092
|
-
const error = validateProjectName(trimmed);
|
|
27093
|
-
if (error) {
|
|
27094
|
-
setValidationError(error);
|
|
27065
|
+
setDirectoryExpanded((prev) => ({ ...prev, [path]: true }));
|
|
27066
|
+
if (directoryChildren[path]) {
|
|
27095
27067
|
return;
|
|
27096
27068
|
}
|
|
27097
|
-
|
|
27098
|
-
setValidationError(null);
|
|
27069
|
+
setDirectoryLoading((prev) => ({ ...prev, [path]: true }));
|
|
27099
27070
|
try {
|
|
27100
|
-
const
|
|
27101
|
-
|
|
27102
|
-
|
|
27103
|
-
|
|
27104
|
-
|
|
27105
|
-
import_antd81.message.success(`Project "${project.name}" created`);
|
|
27106
|
-
} catch (err) {
|
|
27107
|
-
const errMsg = err instanceof Error ? err.message : "Failed to create project";
|
|
27108
|
-
setValidationError(errMsg);
|
|
27071
|
+
const items = await listPath(path);
|
|
27072
|
+
setDirectoryChildren((prev) => ({ ...prev, [path]: items }));
|
|
27073
|
+
} catch (error) {
|
|
27074
|
+
console.error(`Failed to load directory ${path}:`, error);
|
|
27075
|
+
setDirectoryChildren((prev) => ({ ...prev, [path]: [] }));
|
|
27109
27076
|
} finally {
|
|
27110
|
-
|
|
27077
|
+
setDirectoryLoading((prev) => ({ ...prev, [path]: false }));
|
|
27111
27078
|
}
|
|
27112
|
-
}, [
|
|
27113
|
-
|
|
27114
|
-
|
|
27115
|
-
|
|
27116
|
-
|
|
27117
|
-
|
|
27079
|
+
}, [directoryChildren, directoryExpanded, listPath]);
|
|
27080
|
+
(0, import_react82.useEffect)(() => {
|
|
27081
|
+
resourceFolders.forEach((folder) => {
|
|
27082
|
+
void loadAssetsForFolder(folder);
|
|
27083
|
+
});
|
|
27084
|
+
}, [resourceFolders, loadAssetsForFolder]);
|
|
27085
|
+
const handleAssetClick = (0, import_react82.useCallback)((asset) => {
|
|
27086
|
+
const fileUrl = getFileViewUrl(asset.path);
|
|
27087
|
+
if (!fileUrl) {
|
|
27088
|
+
import_antd81.message.warning("Please select a workspace and project first.");
|
|
27089
|
+
return;
|
|
27118
27090
|
}
|
|
27119
|
-
|
|
27120
|
-
|
|
27121
|
-
|
|
27091
|
+
openSideApp({
|
|
27092
|
+
component_key: "attachments",
|
|
27093
|
+
data: {
|
|
27094
|
+
file_id: asset.path,
|
|
27095
|
+
message: `Preview: ${asset.name || asset.path}`,
|
|
27096
|
+
full_url: fileUrl
|
|
27097
|
+
},
|
|
27098
|
+
message: `Preview: ${asset.name || asset.path}`
|
|
27099
|
+
});
|
|
27100
|
+
}, [getFileViewUrl, openSideApp]);
|
|
27101
|
+
const handleUploadFolder = (0, import_react82.useCallback)(async (folderName) => {
|
|
27122
27102
|
if (!workspaceId || !projectId) {
|
|
27123
27103
|
import_antd81.message.warning("Please select a workspace and project before uploading.");
|
|
27124
27104
|
return;
|
|
@@ -27135,7 +27115,7 @@ var ProjectsMenuContent = () => {
|
|
|
27135
27115
|
try {
|
|
27136
27116
|
await uploadFileToFolder(folderName, file);
|
|
27137
27117
|
import_antd81.message.success(`Uploaded "${file.name}" successfully`);
|
|
27138
|
-
const folder = resourceFolders.find((
|
|
27118
|
+
const folder = resourceFolders.find((item) => item.name === folderName);
|
|
27139
27119
|
if (folder) {
|
|
27140
27120
|
await loadAssetsForFolder(folder);
|
|
27141
27121
|
}
|
|
@@ -27148,143 +27128,226 @@ var ProjectsMenuContent = () => {
|
|
|
27148
27128
|
}
|
|
27149
27129
|
};
|
|
27150
27130
|
input.click();
|
|
27151
|
-
};
|
|
27152
|
-
|
|
27153
|
-
|
|
27154
|
-
|
|
27155
|
-
|
|
27156
|
-
|
|
27131
|
+
}, [workspaceId, projectId, uploadFileToFolder, resourceFolders, loadAssetsForFolder]);
|
|
27132
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
27133
|
+
FileDirectoryPanel,
|
|
27134
|
+
{
|
|
27135
|
+
workspaceId,
|
|
27136
|
+
projectId,
|
|
27137
|
+
resourceFolders,
|
|
27138
|
+
folderEntries,
|
|
27139
|
+
folderLoading,
|
|
27140
|
+
directoryChildren,
|
|
27141
|
+
directoryLoading,
|
|
27142
|
+
directoryExpanded,
|
|
27143
|
+
uploadingFolder,
|
|
27144
|
+
onRefreshFolder: loadAssetsForFolder,
|
|
27145
|
+
onUploadFolder: handleUploadFolder,
|
|
27146
|
+
onToggleDirectory: handleToggleDirectory,
|
|
27147
|
+
onAssetClick: handleAssetClick
|
|
27157
27148
|
}
|
|
27158
|
-
|
|
27159
|
-
|
|
27160
|
-
|
|
27161
|
-
|
|
27162
|
-
|
|
27163
|
-
|
|
27164
|
-
|
|
27165
|
-
|
|
27166
|
-
|
|
27167
|
-
|
|
27168
|
-
|
|
27169
|
-
|
|
27170
|
-
|
|
27171
|
-
|
|
27172
|
-
|
|
27173
|
-
|
|
27174
|
-
|
|
27175
|
-
|
|
27176
|
-
|
|
27177
|
-
|
|
27178
|
-
|
|
27179
|
-
|
|
27180
|
-
|
|
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
|
-
onChange: handleProjectNameChange,
|
|
27268
|
-
onKeyDown: handleModalKeyDown,
|
|
27269
|
-
maxLength: PROJECT_NAME_MAX_LENGTH2,
|
|
27270
|
-
status: validationError ? "error" : void 0,
|
|
27271
|
-
disabled: isCreating
|
|
27272
|
-
}
|
|
27273
|
-
),
|
|
27274
|
-
validationError && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: styles.formError, role: "alert", children: validationError })
|
|
27275
|
-
]
|
|
27149
|
+
);
|
|
27150
|
+
};
|
|
27151
|
+
|
|
27152
|
+
// src/components/Chat/HeaderIconButton.tsx
|
|
27153
|
+
var import_antd82 = require("antd");
|
|
27154
|
+
var import_antd_style33 = require("antd-style");
|
|
27155
|
+
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
27156
|
+
var useStyles20 = (0, import_antd_style33.createStyles)(({ token, css }) => ({
|
|
27157
|
+
button: css`
|
|
27158
|
+
display: inline-flex;
|
|
27159
|
+
align-items: center;
|
|
27160
|
+
justify-content: center;
|
|
27161
|
+
width: 32px;
|
|
27162
|
+
height: 32px;
|
|
27163
|
+
border-radius: 8px;
|
|
27164
|
+
border: 1px solid transparent;
|
|
27165
|
+
background: transparent;
|
|
27166
|
+
color: inherit;
|
|
27167
|
+
transition: all 0.2s ease;
|
|
27168
|
+
|
|
27169
|
+
&:hover {
|
|
27170
|
+
background: ${token.colorBgTextHover};
|
|
27171
|
+
border-color: ${token.colorBorderSecondary};
|
|
27172
|
+
}
|
|
27173
|
+
|
|
27174
|
+
&[aria-pressed="true"] {
|
|
27175
|
+
background: ${token.colorBgTextHover};
|
|
27176
|
+
border-color: ${token.colorBorderSecondary};
|
|
27177
|
+
}
|
|
27178
|
+
`
|
|
27179
|
+
}));
|
|
27180
|
+
var HeaderIconButton = ({
|
|
27181
|
+
ariaLabel,
|
|
27182
|
+
icon,
|
|
27183
|
+
onClick,
|
|
27184
|
+
pressed = false
|
|
27185
|
+
}) => {
|
|
27186
|
+
const { styles } = useStyles20();
|
|
27187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
27188
|
+
import_antd82.Button,
|
|
27189
|
+
{
|
|
27190
|
+
type: "text",
|
|
27191
|
+
size: "small",
|
|
27192
|
+
className: styles.button,
|
|
27193
|
+
icon,
|
|
27194
|
+
onClick,
|
|
27195
|
+
"aria-label": ariaLabel,
|
|
27196
|
+
"aria-pressed": pressed
|
|
27197
|
+
}
|
|
27198
|
+
);
|
|
27199
|
+
};
|
|
27200
|
+
|
|
27201
|
+
// src/components/Chat/LatticeChat.tsx
|
|
27202
|
+
var import_jsx_runtime108 = require("react/jsx-runtime");
|
|
27203
|
+
var useStyles21 = (0, import_antd_style34.createStyles)(({ css }) => ({
|
|
27204
|
+
wrapper: css`
|
|
27205
|
+
display: flex;
|
|
27206
|
+
flex-direction: column;
|
|
27207
|
+
width: 100%;
|
|
27208
|
+
height: 100%;
|
|
27209
|
+
`,
|
|
27210
|
+
headerBar: css`
|
|
27211
|
+
display: flex;
|
|
27212
|
+
align-items: center;
|
|
27213
|
+
justify-content: space-between;
|
|
27214
|
+
gap: 12px;
|
|
27215
|
+
width: 100%;
|
|
27216
|
+
`,
|
|
27217
|
+
headerLeft: css`
|
|
27218
|
+
display: flex;
|
|
27219
|
+
align-items: center;
|
|
27220
|
+
min-width: 0;
|
|
27221
|
+
flex: 1;
|
|
27222
|
+
`,
|
|
27223
|
+
headerRight: css`
|
|
27224
|
+
display: flex;
|
|
27225
|
+
align-items: center;
|
|
27226
|
+
justify-content: flex-end;
|
|
27227
|
+
flex-shrink: 0;
|
|
27228
|
+
`
|
|
27229
|
+
}));
|
|
27230
|
+
var LatticeChatContent = (props) => {
|
|
27231
|
+
const { assistant_id: _assistantId, thread_id = "", menu, header, ...chatingProps } = props;
|
|
27232
|
+
const { config } = useLatticeChatShellContext();
|
|
27233
|
+
const { styles } = useStyles21();
|
|
27234
|
+
const { toolsVisible, toggleTools } = useChatUIContext();
|
|
27235
|
+
const showWorkspaceSelector = config.enableWorkspace;
|
|
27236
|
+
const layoutHeader = /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: styles.headerBar, children: [
|
|
27237
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: styles.headerLeft, children: showWorkspaceSelector ? /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(ProjectSelector, {}) : null }),
|
|
27238
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: styles.headerRight, children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
27239
|
+
HeaderIconButton,
|
|
27240
|
+
{
|
|
27241
|
+
ariaLabel: "Toggle file directory",
|
|
27242
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_lucide_react27.FolderOpen, { size: 16 }),
|
|
27243
|
+
onClick: toggleTools,
|
|
27244
|
+
pressed: toolsVisible
|
|
27245
|
+
}
|
|
27246
|
+
) })
|
|
27247
|
+
] });
|
|
27248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: styles.wrapper, children: [
|
|
27249
|
+
header,
|
|
27250
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
27251
|
+
ColumnLayout,
|
|
27252
|
+
{
|
|
27253
|
+
menu,
|
|
27254
|
+
header: layoutHeader,
|
|
27255
|
+
main: thread_id ? /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(Chating, { ...chatingProps }) : /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { children: "Please create a conversation first" }),
|
|
27256
|
+
detail: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(SideAppViewBrowser, {}),
|
|
27257
|
+
tools: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(ToolPanelFiles, {})
|
|
27276
27258
|
}
|
|
27277
27259
|
)
|
|
27278
27260
|
] });
|
|
27279
27261
|
};
|
|
27262
|
+
var LatticeChat = (props) => {
|
|
27263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
27264
|
+
AgentThreadProvider,
|
|
27265
|
+
{
|
|
27266
|
+
assistantId: props.assistant_id,
|
|
27267
|
+
threadId: props.thread_id || "",
|
|
27268
|
+
options: {
|
|
27269
|
+
streaming: true,
|
|
27270
|
+
enableReturnStateWhenStreamCompleted: true,
|
|
27271
|
+
enableResumeStream: true
|
|
27272
|
+
},
|
|
27273
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(ChatUIContextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(LatticeChatContent, { ...props }) })
|
|
27274
|
+
}
|
|
27275
|
+
);
|
|
27276
|
+
};
|
|
27277
|
+
|
|
27278
|
+
// src/components/Chat/AgentConversations.tsx
|
|
27279
|
+
var import_x7 = require("@ant-design/x");
|
|
27280
|
+
var import_antd83 = require("antd");
|
|
27281
|
+
var import_react83 = require("react");
|
|
27282
|
+
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
27283
|
+
var AgentConversations = ({
|
|
27284
|
+
enableThreadCreation = true,
|
|
27285
|
+
enableThreadList = true
|
|
27286
|
+
}) => {
|
|
27287
|
+
const { token } = import_antd83.theme.useToken();
|
|
27288
|
+
const { currentAssistant } = useAssistantContext();
|
|
27289
|
+
const {
|
|
27290
|
+
assistantId,
|
|
27291
|
+
thread,
|
|
27292
|
+
selectThread,
|
|
27293
|
+
createThread,
|
|
27294
|
+
listThreads,
|
|
27295
|
+
threads
|
|
27296
|
+
} = useConversationContext();
|
|
27297
|
+
const style = {
|
|
27298
|
+
width: "100%",
|
|
27299
|
+
background: "transparent",
|
|
27300
|
+
borderRadius: token.borderRadius
|
|
27301
|
+
};
|
|
27302
|
+
const threadItems = (0, import_react83.useMemo)(() => {
|
|
27303
|
+
return threads || [];
|
|
27304
|
+
}, [threads]);
|
|
27305
|
+
const items = threadItems.map((thread2) => ({
|
|
27306
|
+
key: thread2.id,
|
|
27307
|
+
label: thread2.label
|
|
27308
|
+
}));
|
|
27309
|
+
const newChatClick = async () => {
|
|
27310
|
+
if (!assistantId) {
|
|
27311
|
+
return;
|
|
27312
|
+
}
|
|
27313
|
+
await createThread();
|
|
27314
|
+
};
|
|
27315
|
+
if (!enableThreadList) {
|
|
27316
|
+
return null;
|
|
27317
|
+
}
|
|
27318
|
+
const creation = enableThreadCreation ? {
|
|
27319
|
+
onClick: newChatClick
|
|
27320
|
+
} : void 0;
|
|
27321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
27322
|
+
import_x7.Conversations,
|
|
27323
|
+
{
|
|
27324
|
+
creation,
|
|
27325
|
+
items,
|
|
27326
|
+
activeKey: thread?.id,
|
|
27327
|
+
style,
|
|
27328
|
+
groupable: true,
|
|
27329
|
+
onActiveChange: (key) => {
|
|
27330
|
+
selectThread(key);
|
|
27331
|
+
}
|
|
27332
|
+
}
|
|
27333
|
+
);
|
|
27334
|
+
};
|
|
27335
|
+
|
|
27336
|
+
// src/components/Chat/LatticeChatView.tsx
|
|
27337
|
+
var import_react86 = require("react");
|
|
27338
|
+
|
|
27339
|
+
// src/components/Chat/ChatSidebar.tsx
|
|
27340
|
+
var import_react85 = require("react");
|
|
27341
|
+
var import_antd85 = require("antd");
|
|
27342
|
+
var import_lucide_react29 = require("lucide-react");
|
|
27280
27343
|
|
|
27281
27344
|
// src/components/Chat/ThreadHistoryMenuContent.tsx
|
|
27282
|
-
var
|
|
27283
|
-
var
|
|
27284
|
-
var
|
|
27285
|
-
var
|
|
27286
|
-
var
|
|
27287
|
-
var
|
|
27345
|
+
var import_react84 = __toESM(require("react"));
|
|
27346
|
+
var import_antd_style35 = require("antd-style");
|
|
27347
|
+
var import_lucide_react28 = require("lucide-react");
|
|
27348
|
+
var import_antd84 = require("antd");
|
|
27349
|
+
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
27350
|
+
var useStyles22 = (0, import_antd_style35.createStyles)(({ token, css }) => ({
|
|
27288
27351
|
container: css`
|
|
27289
27352
|
padding: 4px;
|
|
27290
27353
|
font-size: 13px;
|
|
@@ -27385,7 +27448,7 @@ var useStyles20 = (0, import_antd_style33.createStyles)(({ token, css }) => ({
|
|
|
27385
27448
|
`
|
|
27386
27449
|
}));
|
|
27387
27450
|
var ThreadHistoryMenuContent = () => {
|
|
27388
|
-
const { styles } =
|
|
27451
|
+
const { styles } = useStyles22();
|
|
27389
27452
|
const {
|
|
27390
27453
|
threads,
|
|
27391
27454
|
threadId,
|
|
@@ -27393,10 +27456,10 @@ var ThreadHistoryMenuContent = () => {
|
|
|
27393
27456
|
deleteThread,
|
|
27394
27457
|
isLoading
|
|
27395
27458
|
} = useConversationContext();
|
|
27396
|
-
const handleDeleteThread = (0,
|
|
27459
|
+
const handleDeleteThread = (0, import_react84.useCallback)(
|
|
27397
27460
|
async (e, threadIdToDelete) => {
|
|
27398
27461
|
e.stopPropagation();
|
|
27399
|
-
|
|
27462
|
+
import_antd84.Modal.confirm({
|
|
27400
27463
|
title: "Delete Conversation",
|
|
27401
27464
|
content: "Are you sure you want to delete this conversation? This action cannot be undone.",
|
|
27402
27465
|
okText: "Delete",
|
|
@@ -27405,16 +27468,16 @@ var ThreadHistoryMenuContent = () => {
|
|
|
27405
27468
|
onOk: async () => {
|
|
27406
27469
|
try {
|
|
27407
27470
|
await deleteThread(threadIdToDelete);
|
|
27408
|
-
|
|
27471
|
+
import_antd84.message.success("Conversation deleted");
|
|
27409
27472
|
} catch (error) {
|
|
27410
|
-
|
|
27473
|
+
import_antd84.message.error("Failed to delete conversation");
|
|
27411
27474
|
}
|
|
27412
27475
|
}
|
|
27413
27476
|
});
|
|
27414
27477
|
},
|
|
27415
27478
|
[deleteThread]
|
|
27416
27479
|
);
|
|
27417
|
-
const sortedThreads =
|
|
27480
|
+
const sortedThreads = import_react84.default.useMemo(() => {
|
|
27418
27481
|
return [...threads].sort((a, b) => {
|
|
27419
27482
|
const dateA = a.updatedAt ? new Date(a.updatedAt).getTime() : 0;
|
|
27420
27483
|
const dateB = b.updatedAt ? new Date(b.updatedAt).getTime() : 0;
|
|
@@ -27422,30 +27485,30 @@ var ThreadHistoryMenuContent = () => {
|
|
|
27422
27485
|
});
|
|
27423
27486
|
}, [threads]);
|
|
27424
27487
|
if (isLoading) {
|
|
27425
|
-
return /* @__PURE__ */ (0,
|
|
27488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { className: styles.container, children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { className: styles.loading, children: "Loading conversations..." }) });
|
|
27426
27489
|
}
|
|
27427
|
-
return /* @__PURE__ */ (0,
|
|
27490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { className: styles.container, children: sortedThreads.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { className: styles.emptyState, children: "No conversations yet" }) : /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { className: styles.threadList, children: sortedThreads.map((thread) => /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(
|
|
27428
27491
|
"div",
|
|
27429
27492
|
{
|
|
27430
27493
|
className: `${styles.threadItem} ${thread.id === threadId ? "active" : ""}`,
|
|
27431
27494
|
onClick: () => selectThread(thread.id),
|
|
27432
27495
|
title: thread.label,
|
|
27433
27496
|
children: [
|
|
27434
|
-
/* @__PURE__ */ (0,
|
|
27435
|
-
/* @__PURE__ */ (0,
|
|
27497
|
+
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { className: styles.threadIcon, children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_lucide_react28.MessageSquare, { size: 14 }) }),
|
|
27498
|
+
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
|
|
27436
27499
|
"div",
|
|
27437
27500
|
{
|
|
27438
27501
|
className: thread.id === threadId ? styles.threadNameActive : styles.threadName,
|
|
27439
27502
|
children: thread.label
|
|
27440
27503
|
}
|
|
27441
27504
|
),
|
|
27442
|
-
/* @__PURE__ */ (0,
|
|
27505
|
+
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
|
|
27443
27506
|
"button",
|
|
27444
27507
|
{
|
|
27445
27508
|
className: styles.deleteBtn,
|
|
27446
27509
|
onClick: (e) => handleDeleteThread(e, thread.id),
|
|
27447
27510
|
title: "Delete conversation",
|
|
27448
|
-
children: /* @__PURE__ */ (0,
|
|
27511
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_lucide_react28.Trash2, { size: 12 })
|
|
27449
27512
|
}
|
|
27450
27513
|
)
|
|
27451
27514
|
]
|
|
@@ -27455,7 +27518,7 @@ var ThreadHistoryMenuContent = () => {
|
|
|
27455
27518
|
};
|
|
27456
27519
|
|
|
27457
27520
|
// src/components/Chat/ChatSidebar.tsx
|
|
27458
|
-
var
|
|
27521
|
+
var import_jsx_runtime111 = require("react/jsx-runtime");
|
|
27459
27522
|
var DRAWER_STYLES2 = {
|
|
27460
27523
|
wrapper: {
|
|
27461
27524
|
background: "transparent",
|
|
@@ -27481,7 +27544,7 @@ var DEFAULT_MENU_ITEMS = [
|
|
|
27481
27544
|
builtin: "new-analysis",
|
|
27482
27545
|
type: "action",
|
|
27483
27546
|
name: "New Analysis",
|
|
27484
|
-
icon: /* @__PURE__ */ (0,
|
|
27547
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_lucide_react29.PlusCircle, { size: 20 }),
|
|
27485
27548
|
order: 0
|
|
27486
27549
|
},
|
|
27487
27550
|
// Second: Thread History (inline drawer)
|
|
@@ -27490,28 +27553,15 @@ var DEFAULT_MENU_ITEMS = [
|
|
|
27490
27553
|
builtin: "thread-history",
|
|
27491
27554
|
type: "drawer",
|
|
27492
27555
|
name: "History",
|
|
27493
|
-
icon: /* @__PURE__ */ (0,
|
|
27556
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_lucide_react29.History, { size: 20 }),
|
|
27494
27557
|
order: 1,
|
|
27495
27558
|
title: "Conversation History",
|
|
27496
27559
|
width: 320,
|
|
27497
27560
|
inline: true,
|
|
27498
|
-
inlineDefaultExpanded: false,
|
|
27499
|
-
content: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(ThreadHistoryMenuContent, {})
|
|
27500
|
-
},
|
|
27501
|
-
// Third: Projects (inline drawer)
|
|
27502
|
-
{
|
|
27503
|
-
id: "files",
|
|
27504
|
-
builtin: "projects",
|
|
27505
|
-
type: "drawer",
|
|
27506
|
-
name: "Project Files",
|
|
27507
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_lucide_react28.FolderOpen, {}),
|
|
27508
|
-
order: 2,
|
|
27509
|
-
title: "Project Files",
|
|
27510
|
-
width: 320,
|
|
27511
|
-
inline: true,
|
|
27512
27561
|
inlineDefaultExpanded: true,
|
|
27513
|
-
content: /* @__PURE__ */ (0,
|
|
27562
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(ThreadHistoryMenuContent, {})
|
|
27514
27563
|
}
|
|
27564
|
+
// Project Files removed - now accessed via header toggle
|
|
27515
27565
|
];
|
|
27516
27566
|
var ChatSidebar = ({
|
|
27517
27567
|
onSettingsClick,
|
|
@@ -27522,8 +27572,8 @@ var ChatSidebar = ({
|
|
|
27522
27572
|
const { sideAppVisible, menuCollapsed, setMenuCollapsed } = useChatUIContext();
|
|
27523
27573
|
const { user, logout } = useAuth();
|
|
27524
27574
|
const { createThread } = useConversationContext();
|
|
27525
|
-
const [drawerStates, setDrawerStates] = (0,
|
|
27526
|
-
const [changePasswordOpen, setChangePasswordOpen] = (0,
|
|
27575
|
+
const [drawerStates, setDrawerStates] = (0, import_react85.useState)({});
|
|
27576
|
+
const [changePasswordOpen, setChangePasswordOpen] = (0, import_react85.useState)(false);
|
|
27527
27577
|
const {
|
|
27528
27578
|
sidebarMode,
|
|
27529
27579
|
sidebarShowToggle,
|
|
@@ -27532,14 +27582,14 @@ var ChatSidebar = ({
|
|
|
27532
27582
|
sidebarLogoIcon
|
|
27533
27583
|
} = config;
|
|
27534
27584
|
const isExpandedMode = sidebarMode === "expanded";
|
|
27535
|
-
const menuItems = (0,
|
|
27585
|
+
const menuItems = (0, import_react85.useMemo)(() => {
|
|
27536
27586
|
const items = [...DEFAULT_MENU_ITEMS];
|
|
27537
27587
|
for (const item of customMenuItems) {
|
|
27538
27588
|
items.push(item);
|
|
27539
27589
|
}
|
|
27540
27590
|
return items.sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
|
|
27541
27591
|
}, [customMenuItems]);
|
|
27542
|
-
const handleMenuClick = (0,
|
|
27592
|
+
const handleMenuClick = (0, import_react85.useCallback)(async (item) => {
|
|
27543
27593
|
if (item.builtin === "settings") {
|
|
27544
27594
|
setSettingsModalOpen(true);
|
|
27545
27595
|
onSettingsClick?.();
|
|
@@ -27562,46 +27612,44 @@ var ChatSidebar = ({
|
|
|
27562
27612
|
}
|
|
27563
27613
|
}
|
|
27564
27614
|
}, [onSettingsClick, setSettingsModalOpen, createThread, logout]);
|
|
27565
|
-
const handleCloseDrawer = (0,
|
|
27615
|
+
const handleCloseDrawer = (0, import_react85.useCallback)((itemId) => {
|
|
27566
27616
|
setDrawerStates((prev) => ({ ...prev, [itemId]: false }));
|
|
27567
27617
|
}, []);
|
|
27568
|
-
const handleNewAnalysis = (0,
|
|
27618
|
+
const handleNewAnalysis = (0, import_react85.useCallback)(async () => {
|
|
27569
27619
|
try {
|
|
27570
27620
|
await createThread("New Analysis");
|
|
27571
27621
|
} catch (error) {
|
|
27572
27622
|
console.error("Failed to create new thread:", error);
|
|
27573
27623
|
}
|
|
27574
27624
|
}, [createThread]);
|
|
27575
|
-
const renderDrawerContent = (0,
|
|
27625
|
+
const renderDrawerContent = (0, import_react85.useCallback)((item) => {
|
|
27576
27626
|
switch (item.builtin) {
|
|
27577
|
-
case "projects":
|
|
27578
|
-
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(ProjectsMenuContent, {});
|
|
27579
27627
|
case "thread-history":
|
|
27580
|
-
return /* @__PURE__ */ (0,
|
|
27628
|
+
return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(ThreadHistoryMenuContent, {});
|
|
27581
27629
|
default:
|
|
27582
27630
|
return item.content;
|
|
27583
27631
|
}
|
|
27584
27632
|
}, []);
|
|
27585
|
-
const userMenuItems = /* @__PURE__ */ (0,
|
|
27586
|
-
/* @__PURE__ */ (0,
|
|
27587
|
-
/* @__PURE__ */ (0,
|
|
27588
|
-
/* @__PURE__ */ (0,
|
|
27633
|
+
const userMenuItems = /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { style: { minWidth: 160 }, children: [
|
|
27634
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { style: { padding: "8px 12px", borderBottom: "1px solid #f0f0f0" }, children: [
|
|
27635
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)("div", { style: { fontWeight: 500 }, children: user?.name || user?.email }),
|
|
27636
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)("div", { style: { fontSize: 12, color: "#666" }, children: user?.email })
|
|
27589
27637
|
] }),
|
|
27590
|
-
/* @__PURE__ */ (0,
|
|
27591
|
-
|
|
27638
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(
|
|
27639
|
+
import_antd85.Button,
|
|
27592
27640
|
{
|
|
27593
27641
|
type: "text",
|
|
27594
27642
|
block: true,
|
|
27595
27643
|
style: { justifyContent: "flex-start", padding: "8px 12px" },
|
|
27596
27644
|
onClick: () => setChangePasswordOpen(true),
|
|
27597
27645
|
children: [
|
|
27598
|
-
/* @__PURE__ */ (0,
|
|
27646
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_lucide_react29.Key, { size: 16, style: { marginRight: 8 } }),
|
|
27599
27647
|
"Change Password"
|
|
27600
27648
|
]
|
|
27601
27649
|
}
|
|
27602
27650
|
),
|
|
27603
|
-
/* @__PURE__ */ (0,
|
|
27604
|
-
|
|
27651
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(
|
|
27652
|
+
import_antd85.Button,
|
|
27605
27653
|
{
|
|
27606
27654
|
type: "text",
|
|
27607
27655
|
block: true,
|
|
@@ -27609,14 +27657,14 @@ var ChatSidebar = ({
|
|
|
27609
27657
|
style: { justifyContent: "flex-start", padding: "8px 12px" },
|
|
27610
27658
|
onClick: logout,
|
|
27611
27659
|
children: [
|
|
27612
|
-
/* @__PURE__ */ (0,
|
|
27660
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_lucide_react29.LogOut, { size: 16, style: { marginRight: 8 } }),
|
|
27613
27661
|
"Logout"
|
|
27614
27662
|
]
|
|
27615
27663
|
}
|
|
27616
27664
|
)
|
|
27617
27665
|
] });
|
|
27618
|
-
return /* @__PURE__ */ (0,
|
|
27619
|
-
/* @__PURE__ */ (0,
|
|
27666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(import_jsx_runtime111.Fragment, { children: [
|
|
27667
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
27620
27668
|
Menu,
|
|
27621
27669
|
{
|
|
27622
27670
|
items: menuItems,
|
|
@@ -27630,13 +27678,13 @@ var ChatSidebar = ({
|
|
|
27630
27678
|
forceIconMode: sideAppVisible,
|
|
27631
27679
|
collapsed: menuCollapsed,
|
|
27632
27680
|
onCollapsedChange: setMenuCollapsed,
|
|
27633
|
-
footer: ({ isIconMode }) => user && /* @__PURE__ */ (0,
|
|
27634
|
-
|
|
27681
|
+
footer: ({ isIconMode }) => user && /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
27682
|
+
import_antd85.Popover,
|
|
27635
27683
|
{
|
|
27636
27684
|
content: userMenuItems,
|
|
27637
27685
|
placement: "rightTop",
|
|
27638
27686
|
trigger: "click",
|
|
27639
|
-
children: /* @__PURE__ */ (0,
|
|
27687
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(
|
|
27640
27688
|
"div",
|
|
27641
27689
|
{
|
|
27642
27690
|
style: {
|
|
@@ -27650,8 +27698,8 @@ var ChatSidebar = ({
|
|
|
27650
27698
|
transition: "all 0.2s"
|
|
27651
27699
|
},
|
|
27652
27700
|
children: [
|
|
27653
|
-
/* @__PURE__ */ (0,
|
|
27654
|
-
|
|
27701
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
27702
|
+
import_antd85.Avatar,
|
|
27655
27703
|
{
|
|
27656
27704
|
size: isIconMode ? 32 : 36,
|
|
27657
27705
|
style: {
|
|
@@ -27662,8 +27710,8 @@ var ChatSidebar = ({
|
|
|
27662
27710
|
children: (user.name?.charAt(0) || user.email.charAt(0)).toUpperCase()
|
|
27663
27711
|
}
|
|
27664
27712
|
),
|
|
27665
|
-
!isIconMode && /* @__PURE__ */ (0,
|
|
27666
|
-
/* @__PURE__ */ (0,
|
|
27713
|
+
!isIconMode && /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
27714
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
27667
27715
|
"div",
|
|
27668
27716
|
{
|
|
27669
27717
|
style: {
|
|
@@ -27675,7 +27723,7 @@ var ChatSidebar = ({
|
|
|
27675
27723
|
children: user.name || user.email
|
|
27676
27724
|
}
|
|
27677
27725
|
),
|
|
27678
|
-
/* @__PURE__ */ (0,
|
|
27726
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
27679
27727
|
"div",
|
|
27680
27728
|
{
|
|
27681
27729
|
style: {
|
|
@@ -27696,19 +27744,19 @@ var ChatSidebar = ({
|
|
|
27696
27744
|
)
|
|
27697
27745
|
}
|
|
27698
27746
|
),
|
|
27699
|
-
/* @__PURE__ */ (0,
|
|
27747
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
27700
27748
|
ChangePasswordModal,
|
|
27701
27749
|
{
|
|
27702
27750
|
open: changePasswordOpen,
|
|
27703
27751
|
onClose: () => setChangePasswordOpen(false)
|
|
27704
27752
|
}
|
|
27705
27753
|
),
|
|
27706
|
-
menuItems.filter((item) => item.type === "drawer" && !item.inline).map((item) => /* @__PURE__ */ (0,
|
|
27707
|
-
|
|
27754
|
+
menuItems.filter((item) => item.type === "drawer" && !item.inline).map((item) => /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
27755
|
+
import_antd85.Drawer,
|
|
27708
27756
|
{
|
|
27709
|
-
title: /* @__PURE__ */ (0,
|
|
27710
|
-
/* @__PURE__ */ (0,
|
|
27711
|
-
/* @__PURE__ */ (0,
|
|
27757
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" }, children: [
|
|
27758
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { style: { fontSize: 16, fontWeight: 600, textTransform: "uppercase", letterSpacing: 0.5 }, children: item.title || item.name }),
|
|
27759
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
27712
27760
|
"button",
|
|
27713
27761
|
{
|
|
27714
27762
|
onClick: () => handleCloseDrawer(item.id),
|
|
@@ -27723,7 +27771,7 @@ var ChatSidebar = ({
|
|
|
27723
27771
|
background: "rgba(255, 255, 255, 0.5)",
|
|
27724
27772
|
cursor: "pointer"
|
|
27725
27773
|
},
|
|
27726
|
-
children: /* @__PURE__ */ (0,
|
|
27774
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_lucide_react29.PanelLeftClose, { size: 24 })
|
|
27727
27775
|
}
|
|
27728
27776
|
)
|
|
27729
27777
|
] }),
|
|
@@ -27754,16 +27802,16 @@ var ChatSidebar = ({
|
|
|
27754
27802
|
};
|
|
27755
27803
|
|
|
27756
27804
|
// src/components/Chat/LatticeChatView.tsx
|
|
27757
|
-
var
|
|
27805
|
+
var import_jsx_runtime112 = require("react/jsx-runtime");
|
|
27758
27806
|
var LatticeChatView = (props) => {
|
|
27759
|
-
const shellContext = (0,
|
|
27807
|
+
const shellContext = (0, import_react86.useContext)(LatticeChatShellContext);
|
|
27760
27808
|
const { showSideMenu, sideMenuItems } = shellContext.config;
|
|
27761
27809
|
const { assistantId, thread } = useConversationContext();
|
|
27762
27810
|
const { currentAssistant } = useAssistantContext();
|
|
27763
27811
|
const {
|
|
27764
27812
|
config: { baseURL }
|
|
27765
27813
|
} = useLatticeChatShellContext();
|
|
27766
|
-
return assistantId && thread ? /* @__PURE__ */ (0,
|
|
27814
|
+
return assistantId && thread ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
27767
27815
|
AxiomLatticeProvider,
|
|
27768
27816
|
{
|
|
27769
27817
|
config: {
|
|
@@ -27772,14 +27820,14 @@ var LatticeChatView = (props) => {
|
|
|
27772
27820
|
assistantId,
|
|
27773
27821
|
transport: "sse"
|
|
27774
27822
|
},
|
|
27775
|
-
children: /* @__PURE__ */ (0,
|
|
27823
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
27776
27824
|
LatticeChat,
|
|
27777
27825
|
{
|
|
27778
27826
|
thread_id: thread?.id,
|
|
27779
27827
|
assistant_id: assistantId,
|
|
27780
27828
|
name: currentAssistant?.name,
|
|
27781
27829
|
description: currentAssistant?.description,
|
|
27782
|
-
menu: showSideMenu ? /* @__PURE__ */ (0,
|
|
27830
|
+
menu: showSideMenu ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(ChatSidebar, { customMenuItems: sideMenuItems }) : void 0
|
|
27783
27831
|
}
|
|
27784
27832
|
)
|
|
27785
27833
|
}
|
|
@@ -27787,14 +27835,14 @@ var LatticeChatView = (props) => {
|
|
|
27787
27835
|
};
|
|
27788
27836
|
|
|
27789
27837
|
// src/components/Chat/SettingsModal.tsx
|
|
27790
|
-
var
|
|
27791
|
-
var
|
|
27838
|
+
var import_react87 = require("react");
|
|
27839
|
+
var import_antd86 = require("antd");
|
|
27792
27840
|
var import_icons39 = require("@ant-design/icons");
|
|
27793
|
-
var
|
|
27794
|
-
var
|
|
27795
|
-
var { Text: Text37, Title: Title13 } =
|
|
27796
|
-
var { TextArea: TextArea8 } =
|
|
27797
|
-
var
|
|
27841
|
+
var import_antd_style36 = require("antd-style");
|
|
27842
|
+
var import_jsx_runtime113 = require("react/jsx-runtime");
|
|
27843
|
+
var { Text: Text37, Title: Title13 } = import_antd86.Typography;
|
|
27844
|
+
var { TextArea: TextArea8 } = import_antd86.Input;
|
|
27845
|
+
var useStyles23 = (0, import_antd_style36.createStyles)(({ token, css }) => ({
|
|
27798
27846
|
// settingsModal: css`
|
|
27799
27847
|
// .ant-modal {
|
|
27800
27848
|
// max-width: 100vw !important;
|
|
@@ -28139,21 +28187,21 @@ var SETTINGS_MENU_ITEMS = [
|
|
|
28139
28187
|
{
|
|
28140
28188
|
key: "environment",
|
|
28141
28189
|
label: "Environment Variables",
|
|
28142
|
-
icon: /* @__PURE__ */ (0,
|
|
28190
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_icons39.EnvironmentOutlined, {})
|
|
28143
28191
|
},
|
|
28144
28192
|
{
|
|
28145
28193
|
key: "models",
|
|
28146
28194
|
label: "Model Configuration",
|
|
28147
|
-
icon: /* @__PURE__ */ (0,
|
|
28195
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_icons39.ApiOutlined, {})
|
|
28148
28196
|
}
|
|
28149
28197
|
];
|
|
28150
28198
|
var SettingsModal = ({
|
|
28151
28199
|
open,
|
|
28152
28200
|
onClose
|
|
28153
28201
|
}) => {
|
|
28154
|
-
const { styles } =
|
|
28202
|
+
const { styles } = useStyles23();
|
|
28155
28203
|
const { config: shellConfig, updateConfigValue } = useLatticeChatShellContext();
|
|
28156
|
-
const [connections, setConnections] = (0,
|
|
28204
|
+
const [connections, setConnections] = (0, import_react87.useState)(() => {
|
|
28157
28205
|
if (typeof window !== "undefined") {
|
|
28158
28206
|
try {
|
|
28159
28207
|
const stored = localStorage.getItem("lattice_server_connections");
|
|
@@ -28176,21 +28224,21 @@ var SettingsModal = ({
|
|
|
28176
28224
|
}
|
|
28177
28225
|
return [];
|
|
28178
28226
|
});
|
|
28179
|
-
const [serverConfigs, setServerConfigs] = (0,
|
|
28180
|
-
const connectionsRef = (0,
|
|
28181
|
-
(0,
|
|
28227
|
+
const [serverConfigs, setServerConfigs] = (0, import_react87.useState)({});
|
|
28228
|
+
const connectionsRef = (0, import_react87.useRef)(connections);
|
|
28229
|
+
(0, import_react87.useEffect)(() => {
|
|
28182
28230
|
connectionsRef.current = connections;
|
|
28183
28231
|
}, [connections]);
|
|
28184
|
-
const [activeTabKey, setActiveTabKey] = (0,
|
|
28232
|
+
const [activeTabKey, setActiveTabKey] = (0, import_react87.useState)(
|
|
28185
28233
|
connections.length > 0 ? connections[0].id : ""
|
|
28186
28234
|
);
|
|
28187
|
-
const [activeMenu, setActiveMenu] = (0,
|
|
28188
|
-
const [loading, setLoading] = (0,
|
|
28189
|
-
const [showAddServerModal, setShowAddServerModal] = (0,
|
|
28190
|
-
const [newServerUrl, setNewServerUrl] = (0,
|
|
28191
|
-
const [newServerName, setNewServerName] = (0,
|
|
28192
|
-
const [newServerApiKey, setNewServerApiKey] = (0,
|
|
28193
|
-
const [addingServer, setAddingServer] = (0,
|
|
28235
|
+
const [activeMenu, setActiveMenu] = (0, import_react87.useState)("environment");
|
|
28236
|
+
const [loading, setLoading] = (0, import_react87.useState)(false);
|
|
28237
|
+
const [showAddServerModal, setShowAddServerModal] = (0, import_react87.useState)(false);
|
|
28238
|
+
const [newServerUrl, setNewServerUrl] = (0, import_react87.useState)("");
|
|
28239
|
+
const [newServerName, setNewServerName] = (0, import_react87.useState)("");
|
|
28240
|
+
const [newServerApiKey, setNewServerApiKey] = (0, import_react87.useState)("");
|
|
28241
|
+
const [addingServer, setAddingServer] = (0, import_react87.useState)(false);
|
|
28194
28242
|
const saveConnections = (newConnections) => {
|
|
28195
28243
|
setConnections(newConnections);
|
|
28196
28244
|
if (typeof window !== "undefined") {
|
|
@@ -28329,7 +28377,7 @@ var SettingsModal = ({
|
|
|
28329
28377
|
}
|
|
28330
28378
|
} catch (error) {
|
|
28331
28379
|
console.error("Failed to load configuration:", error);
|
|
28332
|
-
|
|
28380
|
+
import_antd86.message.error("Failed to load current configuration");
|
|
28333
28381
|
}
|
|
28334
28382
|
};
|
|
28335
28383
|
const loadModelsConfig = async (serverId) => {
|
|
@@ -28380,7 +28428,7 @@ var SettingsModal = ({
|
|
|
28380
28428
|
console.error("Failed to load models configuration:", error);
|
|
28381
28429
|
}
|
|
28382
28430
|
};
|
|
28383
|
-
(0,
|
|
28431
|
+
(0, import_react87.useEffect)(() => {
|
|
28384
28432
|
if (open && activeTabKey) {
|
|
28385
28433
|
initializeServerConfig(activeTabKey);
|
|
28386
28434
|
const connection = connections.find((c) => c.id === activeTabKey);
|
|
@@ -28389,7 +28437,7 @@ var SettingsModal = ({
|
|
|
28389
28437
|
}
|
|
28390
28438
|
}
|
|
28391
28439
|
}, [open, activeTabKey]);
|
|
28392
|
-
(0,
|
|
28440
|
+
(0, import_react87.useEffect)(() => {
|
|
28393
28441
|
if (open && activeTabKey) {
|
|
28394
28442
|
const connection = connections.find((c) => c.id === activeTabKey);
|
|
28395
28443
|
if (connection?.connected) {
|
|
@@ -28403,7 +28451,7 @@ var SettingsModal = ({
|
|
|
28403
28451
|
}, [open, activeTabKey, activeMenu]);
|
|
28404
28452
|
const handleAddServer = async () => {
|
|
28405
28453
|
if (!newServerUrl.trim()) {
|
|
28406
|
-
|
|
28454
|
+
import_antd86.message.error("Please enter a server URL");
|
|
28407
28455
|
return;
|
|
28408
28456
|
}
|
|
28409
28457
|
let normalizedUrl = newServerUrl.trim();
|
|
@@ -28429,7 +28477,7 @@ var SettingsModal = ({
|
|
|
28429
28477
|
setNewServerUrl("");
|
|
28430
28478
|
setNewServerName("");
|
|
28431
28479
|
setNewServerApiKey("");
|
|
28432
|
-
|
|
28480
|
+
import_antd86.notification.success({
|
|
28433
28481
|
message: "Added",
|
|
28434
28482
|
description: "Server added successfully"
|
|
28435
28483
|
});
|
|
@@ -28449,7 +28497,7 @@ var SettingsModal = ({
|
|
|
28449
28497
|
setActiveTabKey("");
|
|
28450
28498
|
}
|
|
28451
28499
|
}
|
|
28452
|
-
|
|
28500
|
+
import_antd86.notification.success({
|
|
28453
28501
|
message: "Deleted",
|
|
28454
28502
|
description: "Server deleted"
|
|
28455
28503
|
});
|
|
@@ -28466,12 +28514,12 @@ var SettingsModal = ({
|
|
|
28466
28514
|
const handleSave = async () => {
|
|
28467
28515
|
const connection = connections.find((c) => c.id === activeTabKey);
|
|
28468
28516
|
if (!connection || !connection.connected) {
|
|
28469
|
-
|
|
28517
|
+
import_antd86.message.error("Please connect to a server first");
|
|
28470
28518
|
return;
|
|
28471
28519
|
}
|
|
28472
28520
|
const url = connection.url;
|
|
28473
28521
|
if (!url) {
|
|
28474
|
-
|
|
28522
|
+
import_antd86.message.error("Please connect to a server first");
|
|
28475
28523
|
return;
|
|
28476
28524
|
}
|
|
28477
28525
|
try {
|
|
@@ -28535,26 +28583,26 @@ var SettingsModal = ({
|
|
|
28535
28583
|
const data = await response.json();
|
|
28536
28584
|
if (response.ok && data.success) {
|
|
28537
28585
|
if (data.requiresRestart && data.requiresRestart.length > 0) {
|
|
28538
|
-
|
|
28586
|
+
import_antd86.message.warning(
|
|
28539
28587
|
`Configuration saved. Please restart the server for ${data.requiresRestart.join(
|
|
28540
28588
|
", "
|
|
28541
28589
|
)} to take effect.`,
|
|
28542
28590
|
5
|
|
28543
28591
|
);
|
|
28544
28592
|
} else {
|
|
28545
|
-
|
|
28593
|
+
import_antd86.notification.success({
|
|
28546
28594
|
message: "Saved",
|
|
28547
28595
|
description: "Configuration saved and applied successfully"
|
|
28548
28596
|
});
|
|
28549
28597
|
}
|
|
28550
28598
|
if (data.warnings && data.warnings.length > 0) {
|
|
28551
28599
|
data.warnings.forEach((warning) => {
|
|
28552
|
-
|
|
28600
|
+
import_antd86.message.warning(warning, 5);
|
|
28553
28601
|
});
|
|
28554
28602
|
}
|
|
28555
28603
|
onClose();
|
|
28556
28604
|
} else {
|
|
28557
|
-
|
|
28605
|
+
import_antd86.message.error(data.error || "Failed to save configuration");
|
|
28558
28606
|
}
|
|
28559
28607
|
} else if (activeMenu === "models") {
|
|
28560
28608
|
const validModels = config.models.filter(
|
|
@@ -28573,18 +28621,18 @@ var SettingsModal = ({
|
|
|
28573
28621
|
});
|
|
28574
28622
|
const data = await response.json();
|
|
28575
28623
|
if (response.ok && data.success) {
|
|
28576
|
-
|
|
28624
|
+
import_antd86.notification.success({
|
|
28577
28625
|
message: "Saved",
|
|
28578
28626
|
description: "Model configuration saved and registered successfully"
|
|
28579
28627
|
});
|
|
28580
28628
|
onClose();
|
|
28581
28629
|
} else {
|
|
28582
|
-
|
|
28630
|
+
import_antd86.message.error(data.error || "Failed to save model configuration");
|
|
28583
28631
|
}
|
|
28584
28632
|
}
|
|
28585
28633
|
} catch (error) {
|
|
28586
28634
|
console.error("Failed to save configuration:", error);
|
|
28587
|
-
|
|
28635
|
+
import_antd86.message.error(error.message || "Failed to save configuration");
|
|
28588
28636
|
} finally {
|
|
28589
28637
|
setLoading(false);
|
|
28590
28638
|
}
|
|
@@ -28600,25 +28648,25 @@ var SettingsModal = ({
|
|
|
28600
28648
|
}
|
|
28601
28649
|
}));
|
|
28602
28650
|
};
|
|
28603
|
-
return /* @__PURE__ */ (0,
|
|
28604
|
-
/* @__PURE__ */ (0,
|
|
28605
|
-
|
|
28651
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: styles.formContainer, children: [
|
|
28652
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28653
|
+
import_antd86.Alert,
|
|
28606
28654
|
{
|
|
28607
28655
|
message: "Configuration Effect",
|
|
28608
|
-
description: /* @__PURE__ */ (0,
|
|
28609
|
-
/* @__PURE__ */ (0,
|
|
28610
|
-
/* @__PURE__ */ (0,
|
|
28656
|
+
description: /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
28657
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { style: { marginBottom: 8 }, children: [
|
|
28658
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28611
28659
|
import_icons39.CheckCircleOutlined,
|
|
28612
28660
|
{
|
|
28613
28661
|
style: { color: "#52c41a", marginRight: 8 }
|
|
28614
28662
|
}
|
|
28615
28663
|
),
|
|
28616
|
-
/* @__PURE__ */ (0,
|
|
28664
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("strong", { children: "Immediately effective:" }),
|
|
28617
28665
|
" QUEUE_SERVICE_TYPE, REDIS_URL, REDIS_PASSWORD, QUEUE_NAME"
|
|
28618
28666
|
] }),
|
|
28619
|
-
/* @__PURE__ */ (0,
|
|
28620
|
-
/* @__PURE__ */ (0,
|
|
28621
|
-
/* @__PURE__ */ (0,
|
|
28667
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
28668
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_icons39.ReloadOutlined, { style: { color: "#faad14", marginRight: 8 } }),
|
|
28669
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("strong", { children: "Requires restart:" }),
|
|
28622
28670
|
" PORT (server must be restarted to change port)"
|
|
28623
28671
|
] })
|
|
28624
28672
|
] }),
|
|
@@ -28627,8 +28675,8 @@ var SettingsModal = ({
|
|
|
28627
28675
|
className: styles.alertCard
|
|
28628
28676
|
}
|
|
28629
28677
|
),
|
|
28630
|
-
/* @__PURE__ */ (0,
|
|
28631
|
-
/* @__PURE__ */ (0,
|
|
28678
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { style: { marginBottom: 24 }, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { type: "secondary", style: { fontSize: 14, lineHeight: 1.6 }, children: "Configure environment variables in .env format (key=value). One variable per line. Leave password fields empty to keep current values." }) }),
|
|
28679
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28632
28680
|
TextArea8,
|
|
28633
28681
|
{
|
|
28634
28682
|
value: config.envText,
|
|
@@ -28705,10 +28753,10 @@ QUEUE_NAME=tasks`,
|
|
|
28705
28753
|
}));
|
|
28706
28754
|
}
|
|
28707
28755
|
};
|
|
28708
|
-
return /* @__PURE__ */ (0,
|
|
28709
|
-
/* @__PURE__ */ (0,
|
|
28710
|
-
config.models.map((model, index) => /* @__PURE__ */ (0,
|
|
28711
|
-
/* @__PURE__ */ (0,
|
|
28756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: styles.formContainer, children: [
|
|
28757
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { style: { marginBottom: 32 }, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { type: "secondary", style: { fontSize: 14, lineHeight: 1.6 }, children: "Configure model lattices. Each model will be registered with the provided key and can be used by agents." }) }),
|
|
28758
|
+
config.models.map((model, index) => /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: styles.card, children: [
|
|
28759
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
|
|
28712
28760
|
"div",
|
|
28713
28761
|
{
|
|
28714
28762
|
style: {
|
|
@@ -28720,12 +28768,12 @@ QUEUE_NAME=tasks`,
|
|
|
28720
28768
|
borderBottom: "1px solid rgba(0, 0, 0, 0.06)"
|
|
28721
28769
|
},
|
|
28722
28770
|
children: [
|
|
28723
|
-
/* @__PURE__ */ (0,
|
|
28724
|
-
/* @__PURE__ */ (0,
|
|
28771
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
28772
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Text37, { strong: true, style: { fontSize: 16 }, children: [
|
|
28725
28773
|
"Model ",
|
|
28726
28774
|
index + 1
|
|
28727
28775
|
] }),
|
|
28728
|
-
model.key && /* @__PURE__ */ (0,
|
|
28776
|
+
model.key && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
|
|
28729
28777
|
Text37,
|
|
28730
28778
|
{
|
|
28731
28779
|
type: "secondary",
|
|
@@ -28738,8 +28786,8 @@ QUEUE_NAME=tasks`,
|
|
|
28738
28786
|
}
|
|
28739
28787
|
)
|
|
28740
28788
|
] }),
|
|
28741
|
-
config.models.length > 1 && /* @__PURE__ */ (0,
|
|
28742
|
-
|
|
28789
|
+
config.models.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28790
|
+
import_antd86.Button,
|
|
28743
28791
|
{
|
|
28744
28792
|
type: "text",
|
|
28745
28793
|
danger: true,
|
|
@@ -28755,11 +28803,11 @@ QUEUE_NAME=tasks`,
|
|
|
28755
28803
|
]
|
|
28756
28804
|
}
|
|
28757
28805
|
),
|
|
28758
|
-
/* @__PURE__ */ (0,
|
|
28759
|
-
/* @__PURE__ */ (0,
|
|
28760
|
-
/* @__PURE__ */ (0,
|
|
28761
|
-
/* @__PURE__ */ (0,
|
|
28762
|
-
|
|
28806
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_antd86.Space, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
|
|
28807
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
28808
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formLabel, children: "Key *" }),
|
|
28809
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28810
|
+
import_antd86.Input,
|
|
28763
28811
|
{
|
|
28764
28812
|
placeholder: "e.g., default, gpt-4, claude",
|
|
28765
28813
|
value: model.key,
|
|
@@ -28767,12 +28815,12 @@ QUEUE_NAME=tasks`,
|
|
|
28767
28815
|
style: { height: 40 }
|
|
28768
28816
|
}
|
|
28769
28817
|
),
|
|
28770
|
-
/* @__PURE__ */ (0,
|
|
28818
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formDescription, children: "Unique identifier for this model" })
|
|
28771
28819
|
] }),
|
|
28772
|
-
/* @__PURE__ */ (0,
|
|
28773
|
-
/* @__PURE__ */ (0,
|
|
28774
|
-
/* @__PURE__ */ (0,
|
|
28775
|
-
|
|
28820
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
28821
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formLabel, children: "Provider *" }),
|
|
28822
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28823
|
+
import_antd86.Select,
|
|
28776
28824
|
{
|
|
28777
28825
|
style: { width: "100%", height: 40 },
|
|
28778
28826
|
value: model.provider,
|
|
@@ -28787,10 +28835,10 @@ QUEUE_NAME=tasks`,
|
|
|
28787
28835
|
}
|
|
28788
28836
|
)
|
|
28789
28837
|
] }),
|
|
28790
|
-
/* @__PURE__ */ (0,
|
|
28791
|
-
/* @__PURE__ */ (0,
|
|
28792
|
-
/* @__PURE__ */ (0,
|
|
28793
|
-
|
|
28838
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
28839
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formLabel, children: "Model Name *" }),
|
|
28840
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28841
|
+
import_antd86.Input,
|
|
28794
28842
|
{
|
|
28795
28843
|
placeholder: "e.g., gpt-4, claude-3-opus, kimi-k2-250905",
|
|
28796
28844
|
value: model.model,
|
|
@@ -28799,10 +28847,10 @@ QUEUE_NAME=tasks`,
|
|
|
28799
28847
|
}
|
|
28800
28848
|
)
|
|
28801
28849
|
] }),
|
|
28802
|
-
/* @__PURE__ */ (0,
|
|
28803
|
-
/* @__PURE__ */ (0,
|
|
28804
|
-
/* @__PURE__ */ (0,
|
|
28805
|
-
|
|
28850
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
28851
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formLabel, children: "API Key" }),
|
|
28852
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28853
|
+
import_antd86.Input.Password,
|
|
28806
28854
|
{
|
|
28807
28855
|
placeholder: "Enter your API key",
|
|
28808
28856
|
value: model.apiKey,
|
|
@@ -28810,12 +28858,12 @@ QUEUE_NAME=tasks`,
|
|
|
28810
28858
|
style: { height: 40 }
|
|
28811
28859
|
}
|
|
28812
28860
|
),
|
|
28813
|
-
/* @__PURE__ */ (0,
|
|
28861
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formDescription, children: "API key for the model provider. Leave empty to use environment variable." })
|
|
28814
28862
|
] }),
|
|
28815
|
-
/* @__PURE__ */ (0,
|
|
28816
|
-
/* @__PURE__ */ (0,
|
|
28817
|
-
/* @__PURE__ */ (0,
|
|
28818
|
-
|
|
28863
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
28864
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formLabel, children: "Base URL" }),
|
|
28865
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28866
|
+
import_antd86.Input,
|
|
28819
28867
|
{
|
|
28820
28868
|
placeholder: "e.g., https://api.openai.com/v1",
|
|
28821
28869
|
value: model.baseURL,
|
|
@@ -28823,23 +28871,23 @@ QUEUE_NAME=tasks`,
|
|
|
28823
28871
|
style: { height: 40 }
|
|
28824
28872
|
}
|
|
28825
28873
|
),
|
|
28826
|
-
/* @__PURE__ */ (0,
|
|
28874
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formDescription, children: "Optional custom base URL for the API" })
|
|
28827
28875
|
] }),
|
|
28828
|
-
/* @__PURE__ */ (0,
|
|
28829
|
-
/* @__PURE__ */ (0,
|
|
28830
|
-
|
|
28876
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_antd86.Space, { children: [
|
|
28877
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28878
|
+
import_antd86.Switch,
|
|
28831
28879
|
{
|
|
28832
28880
|
checked: model.streaming,
|
|
28833
28881
|
onChange: (checked) => handleModelChange(index, "streaming", checked)
|
|
28834
28882
|
}
|
|
28835
28883
|
),
|
|
28836
|
-
/* @__PURE__ */ (0,
|
|
28884
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { children: "Enable Streaming" })
|
|
28837
28885
|
] }) }),
|
|
28838
|
-
/* @__PURE__ */ (0,
|
|
28839
|
-
/* @__PURE__ */ (0,
|
|
28840
|
-
/* @__PURE__ */ (0,
|
|
28841
|
-
/* @__PURE__ */ (0,
|
|
28842
|
-
|
|
28886
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { style: { display: "flex", gap: 20 }, children: [
|
|
28887
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { style: { flex: 1 }, children: [
|
|
28888
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formLabel, children: "Max Tokens" }),
|
|
28889
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28890
|
+
import_antd86.Input,
|
|
28843
28891
|
{
|
|
28844
28892
|
type: "number",
|
|
28845
28893
|
placeholder: "e.g., 4096",
|
|
@@ -28853,10 +28901,10 @@ QUEUE_NAME=tasks`,
|
|
|
28853
28901
|
}
|
|
28854
28902
|
)
|
|
28855
28903
|
] }),
|
|
28856
|
-
/* @__PURE__ */ (0,
|
|
28857
|
-
/* @__PURE__ */ (0,
|
|
28858
|
-
/* @__PURE__ */ (0,
|
|
28859
|
-
|
|
28904
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { style: { flex: 1 }, children: [
|
|
28905
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { className: styles.formLabel, children: "Temperature" }),
|
|
28906
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28907
|
+
import_antd86.Input,
|
|
28860
28908
|
{
|
|
28861
28909
|
type: "number",
|
|
28862
28910
|
step: "0.1",
|
|
@@ -28874,8 +28922,8 @@ QUEUE_NAME=tasks`,
|
|
|
28874
28922
|
] })
|
|
28875
28923
|
] })
|
|
28876
28924
|
] }, index)),
|
|
28877
|
-
/* @__PURE__ */ (0,
|
|
28878
|
-
|
|
28925
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28926
|
+
import_antd86.Button,
|
|
28879
28927
|
{
|
|
28880
28928
|
type: "dashed",
|
|
28881
28929
|
onClick: handleAddModel,
|
|
@@ -28902,8 +28950,8 @@ QUEUE_NAME=tasks`,
|
|
|
28902
28950
|
);
|
|
28903
28951
|
const currentConnection = connections.find((c) => c.id === activeTabKey);
|
|
28904
28952
|
const renderTabLabel = (connection) => {
|
|
28905
|
-
return /* @__PURE__ */ (0,
|
|
28906
|
-
/* @__PURE__ */ (0,
|
|
28953
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { style: { display: "flex", alignItems: "center" }, children: [
|
|
28954
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28907
28955
|
import_icons39.CloudServerOutlined,
|
|
28908
28956
|
{
|
|
28909
28957
|
style: {
|
|
@@ -28912,14 +28960,14 @@ QUEUE_NAME=tasks`,
|
|
|
28912
28960
|
}
|
|
28913
28961
|
}
|
|
28914
28962
|
),
|
|
28915
|
-
/* @__PURE__ */ (0,
|
|
28916
|
-
connection.connected && /* @__PURE__ */ (0,
|
|
28963
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { children: connection.name }),
|
|
28964
|
+
connection.connected && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28917
28965
|
import_icons39.CheckCircleFilled,
|
|
28918
28966
|
{
|
|
28919
28967
|
style: { color: "#52c41a", fontSize: 12, marginLeft: 8 }
|
|
28920
28968
|
}
|
|
28921
28969
|
),
|
|
28922
|
-
connection.error && !connection.connecting && /* @__PURE__ */ (0,
|
|
28970
|
+
connection.error && !connection.connecting && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28923
28971
|
import_icons39.CloseCircleFilled,
|
|
28924
28972
|
{
|
|
28925
28973
|
style: { color: "#ff4d4f", fontSize: 12, marginLeft: 8 }
|
|
@@ -28930,35 +28978,35 @@ QUEUE_NAME=tasks`,
|
|
|
28930
28978
|
const tabItems = connections.map((connection) => ({
|
|
28931
28979
|
key: connection.id,
|
|
28932
28980
|
label: renderTabLabel(connection),
|
|
28933
|
-
children: /* @__PURE__ */ (0,
|
|
28934
|
-
/* @__PURE__ */ (0,
|
|
28981
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { className: styles.tabContent, children: connection.connected ? /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_jsx_runtime113.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { style: { display: "flex", height: "100%" }, children: [
|
|
28982
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { className: styles.sidebar, children: SETTINGS_MENU_ITEMS.map((item) => /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
|
|
28935
28983
|
"div",
|
|
28936
28984
|
{
|
|
28937
28985
|
className: `${styles.menuItem} ${activeMenu === item.key ? "active" : ""}`,
|
|
28938
28986
|
onClick: () => setActiveMenu(item.key),
|
|
28939
28987
|
children: [
|
|
28940
|
-
/* @__PURE__ */ (0,
|
|
28941
|
-
/* @__PURE__ */ (0,
|
|
28988
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { className: styles.menuItemIcon, children: item.icon }),
|
|
28989
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { className: styles.menuItemText, children: item.label })
|
|
28942
28990
|
]
|
|
28943
28991
|
},
|
|
28944
28992
|
item.key
|
|
28945
28993
|
)) }),
|
|
28946
|
-
/* @__PURE__ */ (0,
|
|
28947
|
-
/* @__PURE__ */ (0,
|
|
28948
|
-
/* @__PURE__ */ (0,
|
|
28949
|
-
/* @__PURE__ */ (0,
|
|
28950
|
-
/* @__PURE__ */ (0,
|
|
28994
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: styles.content, children: [
|
|
28995
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: styles.contentHeader, children: [
|
|
28996
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: styles.contentHeaderLeft, children: [
|
|
28997
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Title13, { level: 3, className: styles.contentTitle, children: activeMenuItem?.label }),
|
|
28998
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Text37, { className: styles.contentDescription, children: [
|
|
28951
28999
|
activeMenu === "environment" && "Manage environment variables for the gateway server",
|
|
28952
29000
|
activeMenu === "models" && "Configure and register model lattices for use by agents"
|
|
28953
29001
|
] })
|
|
28954
29002
|
] }),
|
|
28955
|
-
/* @__PURE__ */ (0,
|
|
28956
|
-
/* @__PURE__ */ (0,
|
|
28957
|
-
/* @__PURE__ */ (0,
|
|
28958
|
-
|
|
29003
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: styles.contentHeaderRight, children: [
|
|
29004
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_antd86.Button, { onClick: onClose, children: "Cancel" }),
|
|
29005
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29006
|
+
import_antd86.Button,
|
|
28959
29007
|
{
|
|
28960
29008
|
type: "primary",
|
|
28961
|
-
icon: /* @__PURE__ */ (0,
|
|
29009
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_icons39.SaveOutlined, {}),
|
|
28962
29010
|
onClick: handleSave,
|
|
28963
29011
|
loading,
|
|
28964
29012
|
children: "Save Configuration"
|
|
@@ -28966,9 +29014,9 @@ QUEUE_NAME=tasks`,
|
|
|
28966
29014
|
)
|
|
28967
29015
|
] })
|
|
28968
29016
|
] }),
|
|
28969
|
-
/* @__PURE__ */ (0,
|
|
29017
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { className: styles.contentBody, children: renderContent(connection.id) })
|
|
28970
29018
|
] })
|
|
28971
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
29019
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28972
29020
|
"div",
|
|
28973
29021
|
{
|
|
28974
29022
|
style: {
|
|
@@ -28980,17 +29028,17 @@ QUEUE_NAME=tasks`,
|
|
|
28980
29028
|
gap: 16,
|
|
28981
29029
|
padding: 48
|
|
28982
29030
|
},
|
|
28983
|
-
children: connection.connecting ? /* @__PURE__ */ (0,
|
|
28984
|
-
/* @__PURE__ */ (0,
|
|
28985
|
-
/* @__PURE__ */ (0,
|
|
28986
|
-
/* @__PURE__ */ (0,
|
|
29031
|
+
children: connection.connecting ? /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_jsx_runtime113.Fragment, { children: [
|
|
29032
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_icons39.LinkOutlined, { style: { fontSize: 64, color: "#1890ff" }, spin: true }),
|
|
29033
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Title13, { level: 4, children: "Connecting..." }),
|
|
29034
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Text37, { type: "secondary", style: { textAlign: "center" }, children: [
|
|
28987
29035
|
"Connecting to ",
|
|
28988
29036
|
connection.url
|
|
28989
29037
|
] })
|
|
28990
|
-
] }) : /* @__PURE__ */ (0,
|
|
28991
|
-
/* @__PURE__ */ (0,
|
|
28992
|
-
/* @__PURE__ */ (0,
|
|
28993
|
-
/* @__PURE__ */ (0,
|
|
29038
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_jsx_runtime113.Fragment, { children: [
|
|
29039
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_icons39.LinkOutlined, { style: { fontSize: 64, color: "#d9d9d9" } }),
|
|
29040
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Title13, { level: 4, type: "secondary", children: connection.error || "Not Connected" }),
|
|
29041
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
28994
29042
|
Text37,
|
|
28995
29043
|
{
|
|
28996
29044
|
type: "secondary",
|
|
@@ -28998,11 +29046,11 @@ QUEUE_NAME=tasks`,
|
|
|
28998
29046
|
children: connection.error ? `Failed to connect to ${connection.url}. Please check the server URL and try again.` : `Click "Reconnect" to connect to ${connection.url}`
|
|
28999
29047
|
}
|
|
29000
29048
|
),
|
|
29001
|
-
/* @__PURE__ */ (0,
|
|
29002
|
-
|
|
29049
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29050
|
+
import_antd86.Button,
|
|
29003
29051
|
{
|
|
29004
29052
|
type: "primary",
|
|
29005
|
-
icon: /* @__PURE__ */ (0,
|
|
29053
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_icons39.LinkOutlined, {}),
|
|
29006
29054
|
onClick: () => checkConnection(connection.id),
|
|
29007
29055
|
loading: connection.connecting,
|
|
29008
29056
|
style: { marginTop: 16 },
|
|
@@ -29014,9 +29062,9 @@ QUEUE_NAME=tasks`,
|
|
|
29014
29062
|
) }),
|
|
29015
29063
|
closable: connections.length > 1
|
|
29016
29064
|
}));
|
|
29017
|
-
return /* @__PURE__ */ (0,
|
|
29018
|
-
/* @__PURE__ */ (0,
|
|
29019
|
-
|
|
29065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_jsx_runtime113.Fragment, { children: [
|
|
29066
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29067
|
+
import_antd86.Modal,
|
|
29020
29068
|
{
|
|
29021
29069
|
open,
|
|
29022
29070
|
onCancel: onClose,
|
|
@@ -29024,8 +29072,8 @@ QUEUE_NAME=tasks`,
|
|
|
29024
29072
|
width: "80%",
|
|
29025
29073
|
footer: null,
|
|
29026
29074
|
title: "Settings",
|
|
29027
|
-
children: /* @__PURE__ */ (0,
|
|
29028
|
-
|
|
29075
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29076
|
+
import_antd86.Tabs,
|
|
29029
29077
|
{
|
|
29030
29078
|
activeKey: activeTabKey,
|
|
29031
29079
|
onChange: handleTabChange,
|
|
@@ -29038,7 +29086,7 @@ QUEUE_NAME=tasks`,
|
|
|
29038
29086
|
}
|
|
29039
29087
|
},
|
|
29040
29088
|
items: tabItems,
|
|
29041
|
-
addIcon: /* @__PURE__ */ (0,
|
|
29089
|
+
addIcon: /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
|
|
29042
29090
|
"div",
|
|
29043
29091
|
{
|
|
29044
29092
|
style: {
|
|
@@ -29048,8 +29096,8 @@ QUEUE_NAME=tasks`,
|
|
|
29048
29096
|
padding: "4px 8px"
|
|
29049
29097
|
},
|
|
29050
29098
|
children: [
|
|
29051
|
-
/* @__PURE__ */ (0,
|
|
29052
|
-
/* @__PURE__ */ (0,
|
|
29099
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_icons39.PlusOutlined, {}),
|
|
29100
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { children: "Add Server" })
|
|
29053
29101
|
]
|
|
29054
29102
|
}
|
|
29055
29103
|
)
|
|
@@ -29057,8 +29105,8 @@ QUEUE_NAME=tasks`,
|
|
|
29057
29105
|
) })
|
|
29058
29106
|
}
|
|
29059
29107
|
),
|
|
29060
|
-
/* @__PURE__ */ (0,
|
|
29061
|
-
|
|
29108
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29109
|
+
import_antd86.Modal,
|
|
29062
29110
|
{
|
|
29063
29111
|
title: "Add New Server",
|
|
29064
29112
|
open: showAddServerModal,
|
|
@@ -29071,11 +29119,11 @@ QUEUE_NAME=tasks`,
|
|
|
29071
29119
|
},
|
|
29072
29120
|
confirmLoading: addingServer,
|
|
29073
29121
|
className: styles.addServerModal,
|
|
29074
|
-
children: /* @__PURE__ */ (0,
|
|
29075
|
-
/* @__PURE__ */ (0,
|
|
29076
|
-
/* @__PURE__ */ (0,
|
|
29077
|
-
/* @__PURE__ */ (0,
|
|
29078
|
-
|
|
29122
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_antd86.Space, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
|
|
29123
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
29124
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server Name" }),
|
|
29125
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29126
|
+
import_antd86.Input,
|
|
29079
29127
|
{
|
|
29080
29128
|
placeholder: "e.g., Production Server",
|
|
29081
29129
|
value: newServerName,
|
|
@@ -29083,12 +29131,12 @@ QUEUE_NAME=tasks`,
|
|
|
29083
29131
|
onPressEnter: handleAddServer
|
|
29084
29132
|
}
|
|
29085
29133
|
),
|
|
29086
|
-
/* @__PURE__ */ (0,
|
|
29134
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: Leave empty to use URL as name" })
|
|
29087
29135
|
] }),
|
|
29088
|
-
/* @__PURE__ */ (0,
|
|
29089
|
-
/* @__PURE__ */ (0,
|
|
29090
|
-
/* @__PURE__ */ (0,
|
|
29091
|
-
|
|
29136
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
29137
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server URL *" }),
|
|
29138
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29139
|
+
import_antd86.Input,
|
|
29092
29140
|
{
|
|
29093
29141
|
placeholder: "e.g., http://localhost:4001",
|
|
29094
29142
|
value: newServerUrl,
|
|
@@ -29096,12 +29144,12 @@ QUEUE_NAME=tasks`,
|
|
|
29096
29144
|
onPressEnter: handleAddServer
|
|
29097
29145
|
}
|
|
29098
29146
|
),
|
|
29099
|
-
/* @__PURE__ */ (0,
|
|
29147
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Enter the full URL of the gateway server" })
|
|
29100
29148
|
] }),
|
|
29101
|
-
/* @__PURE__ */ (0,
|
|
29102
|
-
/* @__PURE__ */ (0,
|
|
29103
|
-
/* @__PURE__ */ (0,
|
|
29104
|
-
|
|
29149
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
|
|
29150
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { strong: true, style: { display: "block", marginBottom: 8 }, children: "API Key" }),
|
|
29151
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
29152
|
+
import_antd86.Input.Password,
|
|
29105
29153
|
{
|
|
29106
29154
|
placeholder: "Optional: Enter API key for authentication",
|
|
29107
29155
|
value: newServerApiKey,
|
|
@@ -29109,7 +29157,7 @@ QUEUE_NAME=tasks`,
|
|
|
29109
29157
|
onPressEnter: handleAddServer
|
|
29110
29158
|
}
|
|
29111
29159
|
),
|
|
29112
|
-
/* @__PURE__ */ (0,
|
|
29160
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text37, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: API key for server authentication" })
|
|
29113
29161
|
] })
|
|
29114
29162
|
] })
|
|
29115
29163
|
}
|
|
@@ -29118,10 +29166,10 @@ QUEUE_NAME=tasks`,
|
|
|
29118
29166
|
};
|
|
29119
29167
|
|
|
29120
29168
|
// src/components/Chat/AgentServerSetting.tsx
|
|
29121
|
-
var
|
|
29169
|
+
var import_jsx_runtime114 = require("react/jsx-runtime");
|
|
29122
29170
|
var AgentServerSetting = () => {
|
|
29123
29171
|
const { settingsModalOpen, setSettingsModalOpen } = useLatticeChatShellContext();
|
|
29124
|
-
return /* @__PURE__ */ (0,
|
|
29172
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
29125
29173
|
SettingsModal,
|
|
29126
29174
|
{
|
|
29127
29175
|
open: settingsModalOpen,
|
|
@@ -29131,24 +29179,24 @@ var AgentServerSetting = () => {
|
|
|
29131
29179
|
};
|
|
29132
29180
|
|
|
29133
29181
|
// src/components/Chat/LatticeChatShell.tsx
|
|
29134
|
-
var
|
|
29182
|
+
var import_jsx_runtime115 = require("react/jsx-runtime");
|
|
29135
29183
|
var ShellContent = ({
|
|
29136
29184
|
initialAssistantId,
|
|
29137
29185
|
enableWorkspace
|
|
29138
29186
|
}) => {
|
|
29139
29187
|
const { currentTenant } = useAuth();
|
|
29140
|
-
return /* @__PURE__ */ (0,
|
|
29141
|
-
/* @__PURE__ */ (0,
|
|
29142
|
-
/* @__PURE__ */ (0,
|
|
29143
|
-
] }) : /* @__PURE__ */ (0,
|
|
29144
|
-
/* @__PURE__ */ (0,
|
|
29145
|
-
/* @__PURE__ */ (0,
|
|
29188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_jsx_runtime115.Fragment, { children: enableWorkspace ? /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(WorkspaceContextProvider, { children: [
|
|
29189
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(AssistantContextProvider, { autoLoad: true, initialAssistantId, children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(ConversationContextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(LatticeChatView, {}) }) }),
|
|
29190
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(AgentServerSetting, {})
|
|
29191
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(import_jsx_runtime115.Fragment, { children: [
|
|
29192
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(AssistantContextProvider, { autoLoad: true, initialAssistantId, children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(ConversationContextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(LatticeChatView, {}) }) }),
|
|
29193
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(AgentServerSetting, {})
|
|
29146
29194
|
] }) });
|
|
29147
29195
|
};
|
|
29148
29196
|
var LatticeChatShell = (props) => {
|
|
29149
29197
|
const { enableAssistantCreation, enableAssistantEditing, enableWorkspace: enableWorkspaceProp, ...restProps } = props;
|
|
29150
29198
|
const enableWorkspace = enableWorkspaceProp ?? restProps.initialConfig?.enableWorkspace ?? false;
|
|
29151
|
-
return /* @__PURE__ */ (0,
|
|
29199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
29152
29200
|
LatticeChatShellContextProvider,
|
|
29153
29201
|
{
|
|
29154
29202
|
initialConfig: {
|
|
@@ -29157,7 +29205,7 @@ var LatticeChatShell = (props) => {
|
|
|
29157
29205
|
enableWorkspace,
|
|
29158
29206
|
...restProps.initialConfig
|
|
29159
29207
|
},
|
|
29160
|
-
children: /* @__PURE__ */ (0,
|
|
29208
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
29161
29209
|
ShellContent,
|
|
29162
29210
|
{
|
|
29163
29211
|
initialAssistantId: restProps.initialConfig?.assistantId,
|
|
@@ -29167,6 +29215,336 @@ var LatticeChatShell = (props) => {
|
|
|
29167
29215
|
}
|
|
29168
29216
|
);
|
|
29169
29217
|
};
|
|
29218
|
+
|
|
29219
|
+
// src/components/Chat/ChannelInstallationsDrawerContent.tsx
|
|
29220
|
+
var import_react88 = require("react");
|
|
29221
|
+
var import_antd87 = require("antd");
|
|
29222
|
+
var import_lucide_react30 = require("lucide-react");
|
|
29223
|
+
var import_jsx_runtime116 = require("react/jsx-runtime");
|
|
29224
|
+
var { Text: Text38, Title: Title14 } = import_antd87.Typography;
|
|
29225
|
+
var MAPPING_MODE_OPTIONS = [
|
|
29226
|
+
{ label: "User", value: "user" },
|
|
29227
|
+
{ label: "Group", value: "group" },
|
|
29228
|
+
{ label: "Hybrid", value: "hybrid" }
|
|
29229
|
+
];
|
|
29230
|
+
var ChannelInstallationsDrawerContent = () => {
|
|
29231
|
+
const { get, post, put, del } = useApi();
|
|
29232
|
+
const [installations, setInstallations] = (0, import_react88.useState)([]);
|
|
29233
|
+
const [loading, setLoading] = (0, import_react88.useState)(false);
|
|
29234
|
+
const [formModalOpen, setFormModalOpen] = (0, import_react88.useState)(false);
|
|
29235
|
+
const [editingInstallation, setEditingInstallation] = (0, import_react88.useState)(null);
|
|
29236
|
+
const loadInstallations = async () => {
|
|
29237
|
+
setLoading(true);
|
|
29238
|
+
try {
|
|
29239
|
+
const result = await get(
|
|
29240
|
+
"/api/channel-installations"
|
|
29241
|
+
);
|
|
29242
|
+
if (result.success) {
|
|
29243
|
+
setInstallations(result.data?.records ?? []);
|
|
29244
|
+
} else {
|
|
29245
|
+
setInstallations([]);
|
|
29246
|
+
import_antd87.message.error(result.message || "Failed to load channel installations");
|
|
29247
|
+
}
|
|
29248
|
+
} catch (error) {
|
|
29249
|
+
console.error("Failed to load channel installations:", error);
|
|
29250
|
+
setInstallations([]);
|
|
29251
|
+
import_antd87.message.error("Failed to load channel installations");
|
|
29252
|
+
} finally {
|
|
29253
|
+
setLoading(false);
|
|
29254
|
+
}
|
|
29255
|
+
};
|
|
29256
|
+
(0, import_react88.useEffect)(() => {
|
|
29257
|
+
loadInstallations();
|
|
29258
|
+
}, []);
|
|
29259
|
+
const handleDelete = async (installation) => {
|
|
29260
|
+
try {
|
|
29261
|
+
const result = await del(
|
|
29262
|
+
`/api/channel-installations/${installation.id}`
|
|
29263
|
+
);
|
|
29264
|
+
if (result.success) {
|
|
29265
|
+
setInstallations(
|
|
29266
|
+
(current) => current.filter((item) => item.id !== installation.id)
|
|
29267
|
+
);
|
|
29268
|
+
import_antd87.message.success("Installation deleted");
|
|
29269
|
+
} else {
|
|
29270
|
+
import_antd87.message.error(result.message || "Failed to delete installation");
|
|
29271
|
+
}
|
|
29272
|
+
} catch (error) {
|
|
29273
|
+
console.error("Failed to delete channel installation:", error);
|
|
29274
|
+
import_antd87.message.error("Failed to delete installation");
|
|
29275
|
+
}
|
|
29276
|
+
};
|
|
29277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
|
|
29278
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { style: { padding: 16 }, children: /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(
|
|
29279
|
+
"div",
|
|
29280
|
+
{
|
|
29281
|
+
style: {
|
|
29282
|
+
display: "flex",
|
|
29283
|
+
justifyContent: "space-between",
|
|
29284
|
+
alignItems: "center"
|
|
29285
|
+
},
|
|
29286
|
+
children: [
|
|
29287
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Title14, { level: 5, style: { margin: 0 }, children: "Channel Installations" }),
|
|
29288
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
29289
|
+
import_antd87.Button,
|
|
29290
|
+
{
|
|
29291
|
+
type: "primary",
|
|
29292
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_lucide_react30.Plus, { size: 16 }),
|
|
29293
|
+
onClick: () => {
|
|
29294
|
+
setEditingInstallation(null);
|
|
29295
|
+
setFormModalOpen(true);
|
|
29296
|
+
},
|
|
29297
|
+
children: "Add Installation"
|
|
29298
|
+
}
|
|
29299
|
+
)
|
|
29300
|
+
]
|
|
29301
|
+
}
|
|
29302
|
+
) }),
|
|
29303
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { style: { flex: 1, overflowY: "auto", padding: 16 }, children: loading ? /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { style: { display: "flex", justifyContent: "center", padding: 32 }, children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Spin, {}) }) : installations.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(
|
|
29304
|
+
"div",
|
|
29305
|
+
{
|
|
29306
|
+
style: {
|
|
29307
|
+
display: "flex",
|
|
29308
|
+
flexDirection: "column",
|
|
29309
|
+
alignItems: "center",
|
|
29310
|
+
justifyContent: "center",
|
|
29311
|
+
padding: "48px 16px"
|
|
29312
|
+
},
|
|
29313
|
+
children: [
|
|
29314
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_lucide_react30.RadioTower, { size: 48, style: { marginBottom: 16, opacity: 0.5 } }),
|
|
29315
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Text38, { strong: true, style: { fontSize: 15 }, children: "No channel installations" }),
|
|
29316
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Text38, { type: "secondary", style: { marginTop: 8 }, children: 'Click "Add Installation" to create one' })
|
|
29317
|
+
]
|
|
29318
|
+
}
|
|
29319
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: installations.map((installation) => {
|
|
29320
|
+
const webhookPath = installation.channel === "lark" ? `/api/channels/lark/installations/${installation.id}/events` : null;
|
|
29321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(import_antd87.Card, { size: "small", children: [
|
|
29322
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(
|
|
29323
|
+
"div",
|
|
29324
|
+
{
|
|
29325
|
+
style: {
|
|
29326
|
+
display: "flex",
|
|
29327
|
+
justifyContent: "space-between",
|
|
29328
|
+
alignItems: "flex-start",
|
|
29329
|
+
marginBottom: 10
|
|
29330
|
+
},
|
|
29331
|
+
children: [
|
|
29332
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Text38, { strong: true, style: { fontSize: 15 }, children: installation.name || installation.id }),
|
|
29333
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Tag, { color: "blue", children: installation.channel })
|
|
29334
|
+
]
|
|
29335
|
+
}
|
|
29336
|
+
),
|
|
29337
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(
|
|
29338
|
+
"div",
|
|
29339
|
+
{
|
|
29340
|
+
style: {
|
|
29341
|
+
display: "flex",
|
|
29342
|
+
flexDirection: "column",
|
|
29343
|
+
gap: 6,
|
|
29344
|
+
marginBottom: 12
|
|
29345
|
+
},
|
|
29346
|
+
children: [
|
|
29347
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(Text38, { type: "secondary", style: { fontSize: 12 }, children: [
|
|
29348
|
+
"ID: ",
|
|
29349
|
+
installation.id
|
|
29350
|
+
] }),
|
|
29351
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(Text38, { style: { fontSize: 13 }, children: [
|
|
29352
|
+
"Assistant ID: ",
|
|
29353
|
+
installation.config.assistantId
|
|
29354
|
+
] }),
|
|
29355
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(Text38, { style: { fontSize: 13 }, children: [
|
|
29356
|
+
"Mapping Mode: ",
|
|
29357
|
+
installation.config.mappingMode
|
|
29358
|
+
] }),
|
|
29359
|
+
installation.config.workspaceId ? /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(Text38, { style: { fontSize: 13 }, children: [
|
|
29360
|
+
"Workspace ID: ",
|
|
29361
|
+
installation.config.workspaceId
|
|
29362
|
+
] }) : null,
|
|
29363
|
+
installation.config.projectId ? /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(Text38, { style: { fontSize: 13 }, children: [
|
|
29364
|
+
"Project ID: ",
|
|
29365
|
+
installation.config.projectId
|
|
29366
|
+
] }) : null,
|
|
29367
|
+
webhookPath ? /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Text38, { code: true, style: { fontSize: 12 }, children: webhookPath }) : /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Text38, { type: "secondary", style: { fontSize: 12 }, children: "Unsupported channel configuration UI" })
|
|
29368
|
+
]
|
|
29369
|
+
}
|
|
29370
|
+
),
|
|
29371
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { style: { display: "flex", gap: 8 }, children: [
|
|
29372
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
29373
|
+
import_antd87.Button,
|
|
29374
|
+
{
|
|
29375
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_lucide_react30.Edit2, { size: 14 }),
|
|
29376
|
+
onClick: () => {
|
|
29377
|
+
setEditingInstallation(installation);
|
|
29378
|
+
setFormModalOpen(true);
|
|
29379
|
+
},
|
|
29380
|
+
children: "Edit"
|
|
29381
|
+
}
|
|
29382
|
+
),
|
|
29383
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
29384
|
+
import_antd87.Popconfirm,
|
|
29385
|
+
{
|
|
29386
|
+
title: "Delete Channel Installation",
|
|
29387
|
+
description: `Are you sure you want to delete "${installation.name || installation.id}"?`,
|
|
29388
|
+
onConfirm: () => handleDelete(installation),
|
|
29389
|
+
okText: "Delete",
|
|
29390
|
+
okType: "danger",
|
|
29391
|
+
cancelText: "Cancel",
|
|
29392
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Button, { danger: true, icon: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_lucide_react30.Trash2, { size: 14 }), children: "Delete" })
|
|
29393
|
+
}
|
|
29394
|
+
)
|
|
29395
|
+
] })
|
|
29396
|
+
] }, installation.id);
|
|
29397
|
+
}) }) }),
|
|
29398
|
+
formModalOpen ? /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
29399
|
+
LarkChannelInstallationFormModal,
|
|
29400
|
+
{
|
|
29401
|
+
installation: editingInstallation,
|
|
29402
|
+
open: formModalOpen,
|
|
29403
|
+
post,
|
|
29404
|
+
put,
|
|
29405
|
+
onCancel: () => {
|
|
29406
|
+
setFormModalOpen(false);
|
|
29407
|
+
setEditingInstallation(null);
|
|
29408
|
+
},
|
|
29409
|
+
onSave: () => {
|
|
29410
|
+
setFormModalOpen(false);
|
|
29411
|
+
setEditingInstallation(null);
|
|
29412
|
+
loadInstallations();
|
|
29413
|
+
}
|
|
29414
|
+
}
|
|
29415
|
+
) : null
|
|
29416
|
+
] });
|
|
29417
|
+
};
|
|
29418
|
+
var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCancel, onSave }) => {
|
|
29419
|
+
const [form] = import_antd87.Form.useForm();
|
|
29420
|
+
(0, import_react88.useEffect)(() => {
|
|
29421
|
+
if (installation) {
|
|
29422
|
+
form.setFieldsValue({
|
|
29423
|
+
name: installation.name,
|
|
29424
|
+
appId: installation.config.appId,
|
|
29425
|
+
appSecret: installation.config.appSecret,
|
|
29426
|
+
verificationToken: installation.config.verificationToken,
|
|
29427
|
+
encryptKey: installation.config.encryptKey,
|
|
29428
|
+
mappingMode: installation.config.mappingMode,
|
|
29429
|
+
assistantId: installation.config.assistantId,
|
|
29430
|
+
workspaceId: installation.config.workspaceId,
|
|
29431
|
+
projectId: installation.config.projectId
|
|
29432
|
+
});
|
|
29433
|
+
return;
|
|
29434
|
+
}
|
|
29435
|
+
form.resetFields();
|
|
29436
|
+
form.setFieldsValue({
|
|
29437
|
+
mappingMode: "hybrid"
|
|
29438
|
+
});
|
|
29439
|
+
}, [installation, form]);
|
|
29440
|
+
const handleSubmit = async () => {
|
|
29441
|
+
const values = await form.validateFields();
|
|
29442
|
+
const config = {
|
|
29443
|
+
appId: values.appId,
|
|
29444
|
+
appSecret: values.appSecret,
|
|
29445
|
+
verificationToken: values.verificationToken,
|
|
29446
|
+
encryptKey: values.encryptKey,
|
|
29447
|
+
mappingMode: values.mappingMode,
|
|
29448
|
+
assistantId: values.assistantId,
|
|
29449
|
+
workspaceId: values.workspaceId,
|
|
29450
|
+
projectId: values.projectId
|
|
29451
|
+
};
|
|
29452
|
+
try {
|
|
29453
|
+
if (installation) {
|
|
29454
|
+
const payload2 = {
|
|
29455
|
+
name: values.name,
|
|
29456
|
+
config
|
|
29457
|
+
};
|
|
29458
|
+
const result2 = await put(
|
|
29459
|
+
`/api/channel-installations/${installation.id}`,
|
|
29460
|
+
payload2
|
|
29461
|
+
);
|
|
29462
|
+
if (result2.success) {
|
|
29463
|
+
import_antd87.message.success("Installation updated");
|
|
29464
|
+
onSave();
|
|
29465
|
+
} else {
|
|
29466
|
+
import_antd87.message.error(result2.message || "Failed to update installation");
|
|
29467
|
+
}
|
|
29468
|
+
return;
|
|
29469
|
+
}
|
|
29470
|
+
const payload = {
|
|
29471
|
+
channel: "lark",
|
|
29472
|
+
name: values.name,
|
|
29473
|
+
config
|
|
29474
|
+
};
|
|
29475
|
+
const result = await post(
|
|
29476
|
+
"/api/channel-installations",
|
|
29477
|
+
payload
|
|
29478
|
+
);
|
|
29479
|
+
if (result.success) {
|
|
29480
|
+
import_antd87.message.success("Installation created");
|
|
29481
|
+
onSave();
|
|
29482
|
+
} else {
|
|
29483
|
+
import_antd87.message.error(result.message || "Failed to create installation");
|
|
29484
|
+
}
|
|
29485
|
+
} catch (error) {
|
|
29486
|
+
console.error("Failed to save channel installation:", error);
|
|
29487
|
+
import_antd87.message.error(
|
|
29488
|
+
installation ? "Failed to update installation" : "Failed to create installation"
|
|
29489
|
+
);
|
|
29490
|
+
}
|
|
29491
|
+
};
|
|
29492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
29493
|
+
import_antd87.Modal,
|
|
29494
|
+
{
|
|
29495
|
+
open,
|
|
29496
|
+
title: installation ? "Edit Installation" : "Add Installation",
|
|
29497
|
+
onCancel,
|
|
29498
|
+
onOk: handleSubmit,
|
|
29499
|
+
okText: installation ? "Save" : "Create",
|
|
29500
|
+
destroyOnHidden: true,
|
|
29501
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(import_antd87.Form, { form, layout: "vertical", children: [
|
|
29502
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Form.Item, { label: "Channel", children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Input, { value: "lark", disabled: true }) }),
|
|
29503
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Form.Item, { name: "name", label: "Name", children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Input, {}) }),
|
|
29504
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
29505
|
+
import_antd87.Form.Item,
|
|
29506
|
+
{
|
|
29507
|
+
name: "appId",
|
|
29508
|
+
label: "App ID",
|
|
29509
|
+
rules: [{ required: true, message: "App ID is required" }],
|
|
29510
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Input, {})
|
|
29511
|
+
}
|
|
29512
|
+
),
|
|
29513
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
29514
|
+
import_antd87.Form.Item,
|
|
29515
|
+
{
|
|
29516
|
+
name: "appSecret",
|
|
29517
|
+
label: "App Secret",
|
|
29518
|
+
rules: [{ required: true, message: "App Secret is required" }],
|
|
29519
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Input, {})
|
|
29520
|
+
}
|
|
29521
|
+
),
|
|
29522
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Form.Item, { name: "verificationToken", label: "Verification Token", children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Input, {}) }),
|
|
29523
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Form.Item, { name: "encryptKey", label: "Encrypt Key", children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Input, {}) }),
|
|
29524
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
29525
|
+
import_antd87.Form.Item,
|
|
29526
|
+
{
|
|
29527
|
+
name: "mappingMode",
|
|
29528
|
+
label: "Mapping Mode",
|
|
29529
|
+
rules: [{ required: true, message: "Mapping Mode is required" }],
|
|
29530
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Select, { options: MAPPING_MODE_OPTIONS })
|
|
29531
|
+
}
|
|
29532
|
+
),
|
|
29533
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
29534
|
+
import_antd87.Form.Item,
|
|
29535
|
+
{
|
|
29536
|
+
name: "assistantId",
|
|
29537
|
+
label: "Assistant ID",
|
|
29538
|
+
rules: [{ required: true, message: "Assistant ID is required" }],
|
|
29539
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Input, {})
|
|
29540
|
+
}
|
|
29541
|
+
),
|
|
29542
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Form.Item, { name: "workspaceId", label: "Workspace ID", children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Input, {}) }),
|
|
29543
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Form.Item, { name: "projectId", label: "Project ID", children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_antd87.Input, {}) })
|
|
29544
|
+
] })
|
|
29545
|
+
}
|
|
29546
|
+
);
|
|
29547
|
+
};
|
|
29170
29548
|
// Annotate the CommonJS export names for ESM import in node:
|
|
29171
29549
|
0 && (module.exports = {
|
|
29172
29550
|
AgentConversations,
|
|
@@ -29178,6 +29556,7 @@ var LatticeChatShell = (props) => {
|
|
|
29178
29556
|
AuthProvider,
|
|
29179
29557
|
AxiomLatticeProvider,
|
|
29180
29558
|
ChangePasswordModal,
|
|
29559
|
+
ChannelInstallationsDrawerContent,
|
|
29181
29560
|
ChatUIContext,
|
|
29182
29561
|
ChatUIContextProvider,
|
|
29183
29562
|
Chating,
|
|
@@ -29185,6 +29564,7 @@ var LatticeChatShell = (props) => {
|
|
|
29185
29564
|
ConversationContext,
|
|
29186
29565
|
ConversationContextProvider,
|
|
29187
29566
|
CreateAssistantModal,
|
|
29567
|
+
DEFAULT_MIDDLEWARE_TYPES,
|
|
29188
29568
|
FileExplorer,
|
|
29189
29569
|
LatticeChat,
|
|
29190
29570
|
LatticeChatShell,
|