@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.mjs
CHANGED
|
@@ -86,8 +86,8 @@ var AuthProvider = ({
|
|
|
86
86
|
onLoginSuccess?.(userData, tenantList || []);
|
|
87
87
|
return { requiresTenantSelection, hasTenants };
|
|
88
88
|
} catch (err) {
|
|
89
|
-
const
|
|
90
|
-
setError(
|
|
89
|
+
const message21 = err instanceof Error ? err.message : "Login failed";
|
|
90
|
+
setError(message21);
|
|
91
91
|
throw err;
|
|
92
92
|
} finally {
|
|
93
93
|
setIsLoading(false);
|
|
@@ -111,8 +111,8 @@ var AuthProvider = ({
|
|
|
111
111
|
}
|
|
112
112
|
return { message: data.message || "Registration successful!", token: data.data?.token };
|
|
113
113
|
} catch (err) {
|
|
114
|
-
const
|
|
115
|
-
setError(
|
|
114
|
+
const message21 = err instanceof Error ? err.message : "Registration failed";
|
|
115
|
+
setError(message21);
|
|
116
116
|
throw err;
|
|
117
117
|
} finally {
|
|
118
118
|
setIsLoading(false);
|
|
@@ -159,8 +159,8 @@ var AuthProvider = ({
|
|
|
159
159
|
}
|
|
160
160
|
onTenantSelected?.(tenantData);
|
|
161
161
|
} catch (err) {
|
|
162
|
-
const
|
|
163
|
-
setError(
|
|
162
|
+
const message21 = err instanceof Error ? err.message : "Failed to select tenant";
|
|
163
|
+
setError(message21);
|
|
164
164
|
throw err;
|
|
165
165
|
} finally {
|
|
166
166
|
setIsLoading(false);
|
|
@@ -199,8 +199,8 @@ var AuthProvider = ({
|
|
|
199
199
|
setTenants(tenantList);
|
|
200
200
|
sessionStorage.setItem("lattice_tenants", JSON.stringify(tenantList));
|
|
201
201
|
} catch (err) {
|
|
202
|
-
const
|
|
203
|
-
setError(
|
|
202
|
+
const message21 = err instanceof Error ? err.message : "Failed to fetch tenants";
|
|
203
|
+
setError(message21);
|
|
204
204
|
} finally {
|
|
205
205
|
setIsLoading(false);
|
|
206
206
|
}
|
|
@@ -230,8 +230,8 @@ var AuthProvider = ({
|
|
|
230
230
|
setUser(data);
|
|
231
231
|
sessionStorage.setItem("lattice_user", JSON.stringify(data));
|
|
232
232
|
} catch (err) {
|
|
233
|
-
const
|
|
234
|
-
setError(
|
|
233
|
+
const message21 = err instanceof Error ? err.message : "Failed to refresh user";
|
|
234
|
+
setError(message21);
|
|
235
235
|
} finally {
|
|
236
236
|
setIsLoading(false);
|
|
237
237
|
}
|
|
@@ -267,8 +267,8 @@ var AuthProvider = ({
|
|
|
267
267
|
const result = await response.json();
|
|
268
268
|
return result;
|
|
269
269
|
} catch (err) {
|
|
270
|
-
const
|
|
271
|
-
setError(
|
|
270
|
+
const message21 = err instanceof Error ? err.message : "Failed to change password";
|
|
271
|
+
setError(message21);
|
|
272
272
|
throw err;
|
|
273
273
|
} finally {
|
|
274
274
|
setIsLoading(false);
|
|
@@ -466,7 +466,7 @@ function useChat(threadId, assistantId, options = {}) {
|
|
|
466
466
|
throw new Error("Thread ID is required to send messages");
|
|
467
467
|
}
|
|
468
468
|
const { input, command, streaming = true } = data;
|
|
469
|
-
const { message:
|
|
469
|
+
const { message: message21, files, ...rest } = input || {};
|
|
470
470
|
setState((prev) => ({
|
|
471
471
|
...prev,
|
|
472
472
|
isLoading: true,
|
|
@@ -475,7 +475,7 @@ function useChat(threadId, assistantId, options = {}) {
|
|
|
475
475
|
}));
|
|
476
476
|
const userMessage = {
|
|
477
477
|
id: Date.now().toString(),
|
|
478
|
-
content:
|
|
478
|
+
content: message21 || command?.resume?.message || "",
|
|
479
479
|
files,
|
|
480
480
|
role: "human"
|
|
481
481
|
};
|
|
@@ -1209,6 +1209,29 @@ var DEFAULT_MIDDLEWARE_TYPES = [
|
|
|
1209
1209
|
{ id: "show_widget", name: "Show Widget", description: "Render interactive HTML widgets or SVG diagrams" }
|
|
1210
1210
|
]
|
|
1211
1211
|
},
|
|
1212
|
+
{
|
|
1213
|
+
type: "claw",
|
|
1214
|
+
name: "Memory",
|
|
1215
|
+
description: "Injects and manages memory/bootstrap files (such as AGENTS.md and USER.md) in the runtime workspace",
|
|
1216
|
+
schema: {
|
|
1217
|
+
type: "object",
|
|
1218
|
+
title: "Memory Configuration",
|
|
1219
|
+
description: "Configure bootstrap file injection behavior",
|
|
1220
|
+
properties: {
|
|
1221
|
+
injectBootstrapFiles: {
|
|
1222
|
+
type: "boolean",
|
|
1223
|
+
title: "Inject Bootstrap Files",
|
|
1224
|
+
description: "Automatically inject default bootstrap files into the workspace context",
|
|
1225
|
+
default: true,
|
|
1226
|
+
widget: "switch"
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
},
|
|
1230
|
+
defaultConfig: {
|
|
1231
|
+
injectBootstrapFiles: true
|
|
1232
|
+
},
|
|
1233
|
+
tools: []
|
|
1234
|
+
},
|
|
1212
1235
|
{
|
|
1213
1236
|
type: "date",
|
|
1214
1237
|
name: "Current Date",
|
|
@@ -1253,6 +1276,36 @@ var DEFAULT_MIDDLEWARE_TYPES = [
|
|
|
1253
1276
|
timezone: "UTC"
|
|
1254
1277
|
},
|
|
1255
1278
|
tools: []
|
|
1279
|
+
},
|
|
1280
|
+
{
|
|
1281
|
+
type: "scheduler",
|
|
1282
|
+
name: "Scheduler",
|
|
1283
|
+
description: "Enables the agent to schedule future work that re-enters through addMessage",
|
|
1284
|
+
schema: {
|
|
1285
|
+
type: "object",
|
|
1286
|
+
title: "Scheduler Configuration",
|
|
1287
|
+
description: "Configure retry behavior for scheduled tasks",
|
|
1288
|
+
properties: {
|
|
1289
|
+
defaultMaxRetries: {
|
|
1290
|
+
type: "integer",
|
|
1291
|
+
title: "Default Max Retries",
|
|
1292
|
+
description: "Default retry count for scheduled tasks created through the middleware",
|
|
1293
|
+
default: 0,
|
|
1294
|
+
minimum: 0,
|
|
1295
|
+
widget: "numberInput"
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
},
|
|
1299
|
+
defaultConfig: {
|
|
1300
|
+
defaultMaxRetries: 0
|
|
1301
|
+
},
|
|
1302
|
+
tools: [
|
|
1303
|
+
{ id: "schedule_at", name: "Schedule At", description: "Schedule a task for an absolute time" },
|
|
1304
|
+
{ id: "schedule_after", name: "Schedule After", description: "Schedule a task after a relative delay" },
|
|
1305
|
+
{ id: "schedule_recurring", name: "Schedule Recurring", description: "Schedule a recurring task with a cron expression" },
|
|
1306
|
+
{ id: "cancel_scheduled_task", name: "Cancel Scheduled Task", description: "Cancel an existing scheduled task" },
|
|
1307
|
+
{ id: "list_scheduled_tasks", name: "List Scheduled Tasks", description: "List scheduled tasks in the current agent context" }
|
|
1308
|
+
]
|
|
1256
1309
|
}
|
|
1257
1310
|
];
|
|
1258
1311
|
var DEFAULT_CONFIG = {
|
|
@@ -1416,8 +1469,8 @@ function convertThreadToConversationThread(thread, label) {
|
|
|
1416
1469
|
function getThreadMetadata(label) {
|
|
1417
1470
|
return label ? { label } : {};
|
|
1418
1471
|
}
|
|
1419
|
-
function generateLabelFromMessage(
|
|
1420
|
-
const cleanMessage =
|
|
1472
|
+
function generateLabelFromMessage(message21) {
|
|
1473
|
+
const cleanMessage = message21.replace(/```attachments[\s\S]*?```/g, "").trim();
|
|
1421
1474
|
if (!cleanMessage) {
|
|
1422
1475
|
return "";
|
|
1423
1476
|
}
|
|
@@ -1609,8 +1662,13 @@ var ConversationContextProvider = ({
|
|
|
1609
1662
|
setIsLoading(true);
|
|
1610
1663
|
setError(null);
|
|
1611
1664
|
try {
|
|
1665
|
+
const existingThread = await client.threads.get(newThread.id);
|
|
1666
|
+
const existingMetadata = existingThread.metadata || {};
|
|
1612
1667
|
await client.threads.update(newThread.id, {
|
|
1613
|
-
metadata:
|
|
1668
|
+
metadata: {
|
|
1669
|
+
...existingMetadata,
|
|
1670
|
+
label: newThread.label
|
|
1671
|
+
}
|
|
1614
1672
|
});
|
|
1615
1673
|
await loadThreads();
|
|
1616
1674
|
} catch (err) {
|
|
@@ -1860,7 +1918,7 @@ function AgentThreadProvider({
|
|
|
1860
1918
|
throw new Error("Thread ID is required to send messages");
|
|
1861
1919
|
}
|
|
1862
1920
|
const { input, command, streaming = true, mode } = data;
|
|
1863
|
-
const { message:
|
|
1921
|
+
const { message: message21, files, ...rest } = input || {};
|
|
1864
1922
|
setState((prev) => ({
|
|
1865
1923
|
...prev,
|
|
1866
1924
|
isLoading: true,
|
|
@@ -1869,7 +1927,7 @@ function AgentThreadProvider({
|
|
|
1869
1927
|
}));
|
|
1870
1928
|
const userMessage = {
|
|
1871
1929
|
id: uuidv4(),
|
|
1872
|
-
content:
|
|
1930
|
+
content: message21 || command?.resume?.message || "",
|
|
1873
1931
|
files,
|
|
1874
1932
|
role: "human"
|
|
1875
1933
|
};
|
|
@@ -1887,8 +1945,8 @@ function AgentThreadProvider({
|
|
|
1887
1945
|
]
|
|
1888
1946
|
}));
|
|
1889
1947
|
const isFirstMessage = messageCountRef.current === 0;
|
|
1890
|
-
if (isFirstMessage &&
|
|
1891
|
-
const label = generateLabelFromMessage(
|
|
1948
|
+
if (isFirstMessage && message21 && conversationContext) {
|
|
1949
|
+
const label = generateLabelFromMessage(message21);
|
|
1892
1950
|
if (label) {
|
|
1893
1951
|
conversationContext.updateThread({
|
|
1894
1952
|
id: threadId,
|
|
@@ -3563,8 +3621,8 @@ function useTenants(options) {
|
|
|
3563
3621
|
const { data } = await response.json();
|
|
3564
3622
|
setTenants(data || []);
|
|
3565
3623
|
} catch (err) {
|
|
3566
|
-
const
|
|
3567
|
-
setError(
|
|
3624
|
+
const message21 = err instanceof Error ? err.message : "Failed to fetch tenants";
|
|
3625
|
+
setError(message21);
|
|
3568
3626
|
} finally {
|
|
3569
3627
|
setIsLoading(false);
|
|
3570
3628
|
}
|
|
@@ -3606,8 +3664,8 @@ function useUsers(options) {
|
|
|
3606
3664
|
const { data } = await response.json();
|
|
3607
3665
|
setUsers(data || []);
|
|
3608
3666
|
} catch (err) {
|
|
3609
|
-
const
|
|
3610
|
-
setError(
|
|
3667
|
+
const message21 = err instanceof Error ? err.message : "Failed to fetch users";
|
|
3668
|
+
setError(message21);
|
|
3611
3669
|
} finally {
|
|
3612
3670
|
setIsLoading(false);
|
|
3613
3671
|
}
|
|
@@ -3649,6 +3707,9 @@ function useUsers(options) {
|
|
|
3649
3707
|
// src/index.ts
|
|
3650
3708
|
export * from "@axiom-lattice/protocols";
|
|
3651
3709
|
|
|
3710
|
+
// src/components/Chat/LatticeChat.tsx
|
|
3711
|
+
import { FolderOpen as FolderOpen4 } from "lucide-react";
|
|
3712
|
+
|
|
3652
3713
|
// src/components/Chat/ChatUIContext.tsx
|
|
3653
3714
|
import { createContext as createContext7, useCallback as useCallback12, useContext as useContext7, useState as useState15 } from "react";
|
|
3654
3715
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
@@ -3656,6 +3717,21 @@ var emptyHandler = () => {
|
|
|
3656
3717
|
throw new Error("ChatUIContextProvider not found");
|
|
3657
3718
|
};
|
|
3658
3719
|
var ChatUIContext = createContext7({
|
|
3720
|
+
detailVisible: false,
|
|
3721
|
+
setDetailVisible: emptyHandler,
|
|
3722
|
+
detailSize: "large",
|
|
3723
|
+
setDetailSize: emptyHandler,
|
|
3724
|
+
detailSelectedCard: null,
|
|
3725
|
+
setDetailSelectedCard: emptyHandler,
|
|
3726
|
+
openDetail: emptyHandler,
|
|
3727
|
+
closeDetail: emptyHandler,
|
|
3728
|
+
toolsVisible: false,
|
|
3729
|
+
setToolsVisible: emptyHandler,
|
|
3730
|
+
toggleTools: emptyHandler,
|
|
3731
|
+
toolSelectedCard: null,
|
|
3732
|
+
setToolSelectedCard: emptyHandler,
|
|
3733
|
+
openTools: emptyHandler,
|
|
3734
|
+
closeTools: emptyHandler,
|
|
3659
3735
|
sideAppVisible: false,
|
|
3660
3736
|
setSideAppVisible: emptyHandler,
|
|
3661
3737
|
sideAppSize: "large",
|
|
@@ -3676,44 +3752,72 @@ var ChatUIContext = createContext7({
|
|
|
3676
3752
|
var ChatUIContextProvider = ({
|
|
3677
3753
|
children
|
|
3678
3754
|
}) => {
|
|
3679
|
-
const [
|
|
3755
|
+
const [detailVisible, setDetailVisible] = useState15(false);
|
|
3680
3756
|
const [contentAppVisible, setcontentAppVisible] = useState15(false);
|
|
3681
|
-
const [
|
|
3682
|
-
const [
|
|
3757
|
+
const [detailSize, setDetailSize] = useState15("large");
|
|
3758
|
+
const [detailSelectedCard, setDetailSelectedCard] = useState15(null);
|
|
3759
|
+
const [toolsVisible, setToolsVisible] = useState15(false);
|
|
3760
|
+
const [toolSelectedCard, setToolSelectedCard] = useState15(null);
|
|
3683
3761
|
const [contentAppSelectedCard, setContentAppSelectedCard] = useState15(null);
|
|
3684
3762
|
const [menuCollapsed, setMenuCollapsed] = useState15(false);
|
|
3685
|
-
const
|
|
3686
|
-
(card)
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3763
|
+
const openDetail = useCallback12((card) => {
|
|
3764
|
+
setDetailSelectedCard(card);
|
|
3765
|
+
setDetailVisible(true);
|
|
3766
|
+
}, []);
|
|
3767
|
+
const closeDetail = useCallback12(() => {
|
|
3768
|
+
setDetailSelectedCard(null);
|
|
3769
|
+
setDetailVisible(false);
|
|
3770
|
+
}, []);
|
|
3771
|
+
const openTools = useCallback12((card) => {
|
|
3772
|
+
setToolSelectedCard(card);
|
|
3773
|
+
setToolsVisible(true);
|
|
3774
|
+
}, []);
|
|
3775
|
+
const closeTools = useCallback12(() => {
|
|
3776
|
+
setToolSelectedCard(null);
|
|
3777
|
+
setToolsVisible(false);
|
|
3778
|
+
}, []);
|
|
3779
|
+
const openSideApp = useCallback12((card) => {
|
|
3780
|
+
openDetail(card);
|
|
3781
|
+
}, [openDetail]);
|
|
3782
|
+
const openContentApp = useCallback12((card) => {
|
|
3783
|
+
setContentAppSelectedCard(card);
|
|
3784
|
+
setcontentAppVisible(true);
|
|
3785
|
+
}, []);
|
|
3699
3786
|
const closeSideApp = useCallback12(() => {
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
}, [setSideAppSelectedCard, setSideAppVisible]);
|
|
3787
|
+
closeDetail();
|
|
3788
|
+
}, [closeDetail]);
|
|
3703
3789
|
const closeContentApp = useCallback12(() => {
|
|
3704
3790
|
setContentAppSelectedCard(null);
|
|
3705
3791
|
setcontentAppVisible(false);
|
|
3706
|
-
}, [
|
|
3792
|
+
}, []);
|
|
3793
|
+
const toggleTools = useCallback12(() => {
|
|
3794
|
+
setToolsVisible((prev) => !prev);
|
|
3795
|
+
}, []);
|
|
3707
3796
|
return /* @__PURE__ */ jsx11(
|
|
3708
3797
|
ChatUIContext.Provider,
|
|
3709
3798
|
{
|
|
3710
3799
|
value: {
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3800
|
+
detailVisible,
|
|
3801
|
+
setDetailVisible,
|
|
3802
|
+
detailSize,
|
|
3803
|
+
setDetailSize,
|
|
3804
|
+
detailSelectedCard,
|
|
3805
|
+
setDetailSelectedCard,
|
|
3806
|
+
openDetail,
|
|
3807
|
+
closeDetail,
|
|
3808
|
+
toolsVisible,
|
|
3809
|
+
setToolsVisible,
|
|
3810
|
+
toggleTools,
|
|
3811
|
+
toolSelectedCard,
|
|
3812
|
+
setToolSelectedCard,
|
|
3813
|
+
openTools,
|
|
3814
|
+
closeTools,
|
|
3815
|
+
sideAppVisible: detailVisible,
|
|
3816
|
+
setSideAppVisible: setDetailVisible,
|
|
3817
|
+
sideAppSize: detailSize,
|
|
3818
|
+
setSideAppSize: setDetailSize,
|
|
3819
|
+
sideAppSelectedCard: detailSelectedCard,
|
|
3820
|
+
setSideAppSelectedCard: setDetailSelectedCard,
|
|
3717
3821
|
openSideApp,
|
|
3718
3822
|
closeSideApp,
|
|
3719
3823
|
openContentApp,
|
|
@@ -3733,6 +3837,9 @@ var useChatUIContext = () => {
|
|
|
3733
3837
|
return useContext7(ChatUIContext);
|
|
3734
3838
|
};
|
|
3735
3839
|
|
|
3840
|
+
// src/components/Chat/LatticeChat.tsx
|
|
3841
|
+
import { createStyles as createStyles34 } from "antd-style";
|
|
3842
|
+
|
|
3736
3843
|
// src/components/Chat/useStyle.tsx
|
|
3737
3844
|
import { createStyles as createStyles2 } from "antd-style";
|
|
3738
3845
|
var useStyle = createStyles2(({ token, css }) => {
|
|
@@ -3931,6 +4038,23 @@ var useStyle = createStyles2(({ token, css }) => {
|
|
|
3931
4038
|
top: 2px;
|
|
3932
4039
|
}
|
|
3933
4040
|
`,
|
|
4041
|
+
toolPanel: css`
|
|
4042
|
+
display: flex;
|
|
4043
|
+
flex-direction: column;
|
|
4044
|
+
width: 0;
|
|
4045
|
+
background: ${token.colorBgContainer};
|
|
4046
|
+
transition: all 0.3s ease;
|
|
4047
|
+
overflow: hidden;
|
|
4048
|
+
flex-shrink: 0;
|
|
4049
|
+
border-radius: ${token.borderRadiusLG}px;
|
|
4050
|
+
border: 1px solid transparent;
|
|
4051
|
+
|
|
4052
|
+
&.open {
|
|
4053
|
+
width: 320px;
|
|
4054
|
+
box-shadow: ${token.boxShadow};
|
|
4055
|
+
border-color: ${token.colorBorder};
|
|
4056
|
+
}
|
|
4057
|
+
`,
|
|
3934
4058
|
detailContent: css`
|
|
3935
4059
|
// padding: 8px 8px;
|
|
3936
4060
|
height: 100%;
|
|
@@ -4496,41 +4620,46 @@ var useStyle = createStyles2(({ token, css }) => {
|
|
|
4496
4620
|
});
|
|
4497
4621
|
|
|
4498
4622
|
// src/components/Chat/ColumnLayout.tsx
|
|
4499
|
-
import {
|
|
4623
|
+
import { jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
4500
4624
|
var ColumnLayout = ({
|
|
4501
|
-
|
|
4502
|
-
|
|
4625
|
+
main,
|
|
4626
|
+
detail,
|
|
4627
|
+
tools,
|
|
4503
4628
|
logo,
|
|
4504
4629
|
menu,
|
|
4505
4630
|
header
|
|
4506
4631
|
}) => {
|
|
4507
4632
|
const { styles } = useStyle();
|
|
4508
|
-
const {
|
|
4633
|
+
const {
|
|
4634
|
+
detailVisible,
|
|
4635
|
+
detailSize,
|
|
4636
|
+
detailSelectedCard,
|
|
4637
|
+
toolsVisible,
|
|
4638
|
+
toolSelectedCard,
|
|
4639
|
+
contentAppSelectedCard,
|
|
4640
|
+
menuCollapsed
|
|
4641
|
+
} = useChatUIContext();
|
|
4642
|
+
const isMenuCollapsed = menuCollapsed || detailVisible;
|
|
4643
|
+
const menuStateClass = isMenuCollapsed ? "collapsed" : "expanded";
|
|
4644
|
+
const hasSidePanelsOpen = detailVisible || toolsVisible;
|
|
4645
|
+
const resolvedDetailSize = toolsVisible && (detailSize || "large") === "large" ? "middle" : detailSize || "large";
|
|
4509
4646
|
return /* @__PURE__ */ jsxs5("div", { className: `fina_chat ${styles.layout}`, children: [
|
|
4510
|
-
menu && /* @__PURE__ */ jsxs5(
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
children: [
|
|
4515
|
-
logo,
|
|
4516
|
-
menu
|
|
4517
|
-
]
|
|
4518
|
-
}
|
|
4519
|
-
),
|
|
4647
|
+
menu && /* @__PURE__ */ jsxs5("div", { className: `${styles.menu} ${menuStateClass}`, children: [
|
|
4648
|
+
logo,
|
|
4649
|
+
menu
|
|
4650
|
+
] }),
|
|
4520
4651
|
/* @__PURE__ */ jsxs5("div", { className: styles.contentArea, children: [
|
|
4521
4652
|
header && /* @__PURE__ */ jsx12("div", { className: styles.header, children: header }),
|
|
4522
4653
|
/* @__PURE__ */ jsxs5("div", { className: styles.columns, children: [
|
|
4523
|
-
/* @__PURE__ */ jsx12("div", { className: `${styles.mainContent} ${
|
|
4524
|
-
/* @__PURE__ */
|
|
4654
|
+
/* @__PURE__ */ jsx12("div", { className: `${styles.mainContent} ${hasSidePanelsOpen ? "open" : ""}`, children: /* @__PURE__ */ jsx12("div", { className: `${styles.chat} ${contentAppSelectedCard ? "full_content_width" : ""}`, children: main }) }),
|
|
4655
|
+
/* @__PURE__ */ jsx12(
|
|
4525
4656
|
"div",
|
|
4526
4657
|
{
|
|
4527
|
-
className: `${styles.detailPanel} ${
|
|
4528
|
-
children:
|
|
4529
|
-
/* @__PURE__ */ jsx12(Fragment2, {}),
|
|
4530
|
-
sideAppSelectedCard && sideAppVisible && /* @__PURE__ */ jsx12(Fragment2, { children: /* @__PURE__ */ jsx12("div", { className: styles.detailContent, children: right }) })
|
|
4531
|
-
]
|
|
4658
|
+
className: `${styles.detailPanel} ${detailVisible ? `open ${resolvedDetailSize}` : ""}`,
|
|
4659
|
+
children: detailVisible && detailSelectedCard && detail ? /* @__PURE__ */ jsx12("div", { className: styles.detailContent, children: detail }) : null
|
|
4532
4660
|
}
|
|
4533
|
-
)
|
|
4661
|
+
),
|
|
4662
|
+
/* @__PURE__ */ jsx12("div", { className: `${styles.toolPanel} ${toolsVisible ? "open" : ""}`, children: toolsVisible && tools ? /* @__PURE__ */ jsx12("div", { className: styles.detailContent, children: tools }) : null })
|
|
4534
4663
|
] })
|
|
4535
4664
|
] })
|
|
4536
4665
|
] });
|
|
@@ -4549,7 +4678,7 @@ import { useState as useState21 } from "react";
|
|
|
4549
4678
|
|
|
4550
4679
|
// src/components/GenUI/MDResponse.tsx
|
|
4551
4680
|
import XMarkdown from "@ant-design/x-markdown";
|
|
4552
|
-
import
|
|
4681
|
+
import React13, { useRef as useRef10, useState as useState20, useMemo as useMemo7, useDeferredValue } from "react";
|
|
4553
4682
|
import { createStyles as createStyles6 } from "antd-style";
|
|
4554
4683
|
|
|
4555
4684
|
// src/components/GenUI/Code.tsx
|
|
@@ -4606,7 +4735,7 @@ import { DownloadOutlined, ExpandAltOutlined } from "@ant-design/icons";
|
|
|
4606
4735
|
import { jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
4607
4736
|
var { Text: Text3 } = Typography3;
|
|
4608
4737
|
var GenericDataTable = ({ data, interactive = true, default_open_in_side_app = true }) => {
|
|
4609
|
-
const { dataSource, message:
|
|
4738
|
+
const { dataSource, message: message21 } = data ?? {};
|
|
4610
4739
|
const [expandedRowKeys, setExpandedRowKeys] = useState16([]);
|
|
4611
4740
|
const { openSideApp } = useChatUIContext();
|
|
4612
4741
|
const processedData = dataSource?.map((item, index) => ({
|
|
@@ -4705,7 +4834,7 @@ var GenericDataTable = ({ data, interactive = true, default_open_in_side_app = t
|
|
|
4705
4834
|
type: "text/csv;charset=utf-8;"
|
|
4706
4835
|
});
|
|
4707
4836
|
const link = document.createElement("a");
|
|
4708
|
-
const filename = `${
|
|
4837
|
+
const filename = `${message21 || "data"}_${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.csv`;
|
|
4709
4838
|
link.href = URL.createObjectURL(blob);
|
|
4710
4839
|
link.download = filename;
|
|
4711
4840
|
document.body.appendChild(link);
|
|
@@ -4726,7 +4855,7 @@ var GenericDataTable = ({ data, interactive = true, default_open_in_side_app = t
|
|
|
4726
4855
|
tableLayout: "fixed",
|
|
4727
4856
|
style: { width: "100% !important" },
|
|
4728
4857
|
title: () => /* @__PURE__ */ jsxs6(Flex, { justify: "space-between", align: "center", children: [
|
|
4729
|
-
/* @__PURE__ */ jsx14(Space2, { children: /* @__PURE__ */ jsx14(Text3, { strong: true, style: { fontSize: 16 }, children:
|
|
4858
|
+
/* @__PURE__ */ jsx14(Space2, { children: /* @__PURE__ */ jsx14(Text3, { strong: true, style: { fontSize: 16 }, children: message21 || "" }) }),
|
|
4730
4859
|
/* @__PURE__ */ jsxs6(Space2, { children: [
|
|
4731
4860
|
/* @__PURE__ */ jsx14(
|
|
4732
4861
|
Button5,
|
|
@@ -4748,8 +4877,8 @@ var GenericDataTable = ({ data, interactive = true, default_open_in_side_app = t
|
|
|
4748
4877
|
onClick: () => {
|
|
4749
4878
|
openSideApp({
|
|
4750
4879
|
component_key: "generic_data_table",
|
|
4751
|
-
message:
|
|
4752
|
-
data: { dataSource, message:
|
|
4880
|
+
message: message21 || "",
|
|
4881
|
+
data: { dataSource, message: message21 }
|
|
4753
4882
|
});
|
|
4754
4883
|
},
|
|
4755
4884
|
children: /* @__PURE__ */ jsx14(ExpandAltOutlined, {})
|
|
@@ -5922,13 +6051,13 @@ var MDComponentWrap = (Element) => {
|
|
|
5922
6051
|
// src/components/GenUI/elements/file_link.tsx
|
|
5923
6052
|
import { Button as Button8 } from "antd";
|
|
5924
6053
|
import { useMemo as useMemo5, useCallback as useCallback13 } from "react";
|
|
5925
|
-
import { Fragment as
|
|
6054
|
+
import { Fragment as Fragment2, jsx as jsx21 } from "react/jsx-runtime";
|
|
5926
6055
|
var FileLink = ({ data }) => {
|
|
5927
6056
|
if (!data) {
|
|
5928
6057
|
return null;
|
|
5929
6058
|
}
|
|
5930
6059
|
if (!isFileName(data)) {
|
|
5931
|
-
return /* @__PURE__ */ jsx21(
|
|
6060
|
+
return /* @__PURE__ */ jsx21(Fragment2, { children: data });
|
|
5932
6061
|
}
|
|
5933
6062
|
const { openSideApp } = useChatUIContext();
|
|
5934
6063
|
const { threadId, assistantId } = useConversationContext();
|
|
@@ -6123,7 +6252,7 @@ var useStyles4 = createStyles6(({ token, css }) => ({
|
|
|
6123
6252
|
}
|
|
6124
6253
|
`
|
|
6125
6254
|
}));
|
|
6126
|
-
var MarkdownErrorBoundary = class extends
|
|
6255
|
+
var MarkdownErrorBoundary = class extends React13.Component {
|
|
6127
6256
|
constructor(props) {
|
|
6128
6257
|
super(props);
|
|
6129
6258
|
this.state = { hasError: false };
|
|
@@ -6141,7 +6270,7 @@ var MarkdownErrorBoundary = class extends React12.Component {
|
|
|
6141
6270
|
return this.props.children;
|
|
6142
6271
|
}
|
|
6143
6272
|
};
|
|
6144
|
-
var SafeXMarkdown =
|
|
6273
|
+
var SafeXMarkdown = React13.memo(({ content, components, className }) => {
|
|
6145
6274
|
const deferredContent = useDeferredValue(content);
|
|
6146
6275
|
if (typeof deferredContent !== "string") {
|
|
6147
6276
|
console.warn("[MDResponse] Content is not a string:", typeof deferredContent, deferredContent);
|
|
@@ -6176,7 +6305,7 @@ var MDResponseInner = ({
|
|
|
6176
6305
|
}
|
|
6177
6306
|
) });
|
|
6178
6307
|
};
|
|
6179
|
-
var MDResponse =
|
|
6308
|
+
var MDResponse = React13.memo(MDResponseInner);
|
|
6180
6309
|
MDResponse.displayName = "MDResponse";
|
|
6181
6310
|
var MDViewFormItem = ({ value }) => {
|
|
6182
6311
|
return /* @__PURE__ */ jsx23(MDResponse, { content: value || "" });
|
|
@@ -6189,11 +6318,11 @@ var ConfirmFeedback = ({
|
|
|
6189
6318
|
data,
|
|
6190
6319
|
interactive = true
|
|
6191
6320
|
}) => {
|
|
6192
|
-
const { message:
|
|
6321
|
+
const { message: message21, type, config, feedback, options } = data ?? {};
|
|
6193
6322
|
const { sendMessage } = useAgentChat();
|
|
6194
6323
|
const [clicked, setClicked] = useState21(false);
|
|
6195
6324
|
return /* @__PURE__ */ jsxs11(Space3, { direction: "vertical", style: { width: "100%" }, children: [
|
|
6196
|
-
/* @__PURE__ */ jsx24(MDResponse, { content:
|
|
6325
|
+
/* @__PURE__ */ jsx24(MDResponse, { content: message21 }),
|
|
6197
6326
|
options ? /* @__PURE__ */ jsx24(Space3, { style: { justifyContent: "flex-end", width: "100%" }, children: options?.map((option) => /* @__PURE__ */ jsx24(
|
|
6198
6327
|
Button9,
|
|
6199
6328
|
{
|
|
@@ -6271,7 +6400,7 @@ var ConfirmFeedback = ({
|
|
|
6271
6400
|
// src/components/GenUI/elements/clarify_feedback.tsx
|
|
6272
6401
|
import { Button as Button10, Space as Space4, Typography as Typography5, List, Checkbox, Input as Input3 } from "antd";
|
|
6273
6402
|
import { useState as useState22 } from "react";
|
|
6274
|
-
import { Fragment as
|
|
6403
|
+
import { Fragment as Fragment3, jsx as jsx25, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
6275
6404
|
var { Text: Text5 } = Typography5;
|
|
6276
6405
|
var ClarifyFeedback = ({
|
|
6277
6406
|
data,
|
|
@@ -6380,7 +6509,7 @@ var ClarifyFeedback = ({
|
|
|
6380
6509
|
}
|
|
6381
6510
|
)
|
|
6382
6511
|
] }),
|
|
6383
|
-
/* @__PURE__ */ jsx25(Space4, { direction: "vertical", style: { width: "100%" }, size: 4, children: currentQuestion.type === "single" ? /* @__PURE__ */ jsxs12(
|
|
6512
|
+
/* @__PURE__ */ jsx25(Space4, { direction: "vertical", style: { width: "100%" }, size: 4, children: currentQuestion.type === "single" ? /* @__PURE__ */ jsxs12(Fragment3, { children: [
|
|
6384
6513
|
/* @__PURE__ */ jsx25(
|
|
6385
6514
|
List,
|
|
6386
6515
|
{
|
|
@@ -7447,7 +7576,7 @@ var AttachmentsCard = ({
|
|
|
7447
7576
|
const { config } = useLatticeChatShellContext();
|
|
7448
7577
|
const baseURL = config.baseURL;
|
|
7449
7578
|
const fileBaseURL = `${baseURL}/api/assistants/${assistantId}/threads/${threadId}/sandbox/downloadfile?path=`;
|
|
7450
|
-
const { Text:
|
|
7579
|
+
const { Text: Text39 } = Typography10;
|
|
7451
7580
|
const [showAll, setShowAll] = useState25(false);
|
|
7452
7581
|
const { openSideApp } = useChatUIContext();
|
|
7453
7582
|
const getStyles = () => {
|
|
@@ -7521,7 +7650,7 @@ var AttachmentsCard = ({
|
|
|
7521
7650
|
);
|
|
7522
7651
|
};
|
|
7523
7652
|
const renderFileDescription = (item) => /* @__PURE__ */ jsx34(Space9, { direction: "vertical", size: size === "small" ? 2 : 4, children: /* @__PURE__ */ jsx34(Space9, { children: /* @__PURE__ */ jsx34(
|
|
7524
|
-
|
|
7653
|
+
Text39,
|
|
7525
7654
|
{
|
|
7526
7655
|
type: "secondary",
|
|
7527
7656
|
style: {
|
|
@@ -7595,7 +7724,7 @@ var AttachmentsCard = ({
|
|
|
7595
7724
|
}
|
|
7596
7725
|
),
|
|
7597
7726
|
item.files && /* @__PURE__ */ jsxs18("div", { style: { paddingLeft: "12px" }, children: [
|
|
7598
|
-
/* @__PURE__ */ jsxs18(
|
|
7727
|
+
/* @__PURE__ */ jsxs18(Text39, { type: "secondary", style: { fontSize: "12px" }, children: [
|
|
7599
7728
|
"Contains ",
|
|
7600
7729
|
item.files.length,
|
|
7601
7730
|
" file(s)"
|
|
@@ -7646,7 +7775,7 @@ var RenderMDFromURL = ({ url, file_id }) => {
|
|
|
7646
7775
|
};
|
|
7647
7776
|
|
|
7648
7777
|
// src/components/GenUI/elements/attachments_viewer_side_app.tsx
|
|
7649
|
-
import { Fragment as
|
|
7778
|
+
import { Fragment as Fragment4, jsx as jsx36, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
7650
7779
|
function AttachmentsViewerSideApp({
|
|
7651
7780
|
data,
|
|
7652
7781
|
component_key
|
|
@@ -7685,7 +7814,7 @@ function AttachmentsViewerSideApp({
|
|
|
7685
7814
|
return /* @__PURE__ */ jsx36(
|
|
7686
7815
|
Empty2,
|
|
7687
7816
|
{
|
|
7688
|
-
description: /* @__PURE__ */ jsxs19(
|
|
7817
|
+
description: /* @__PURE__ */ jsxs19(Fragment4, { children: [
|
|
7689
7818
|
/* @__PURE__ */ jsx36("div", { children: "Preview not supported. Please download to view." }),
|
|
7690
7819
|
/* @__PURE__ */ jsxs19(Button14, { type: "link", href: fileUri?.url, download: fileUri?.fileName, children: [
|
|
7691
7820
|
"Download ",
|
|
@@ -7706,7 +7835,7 @@ import { Collapse as Collapse5 } from "antd";
|
|
|
7706
7835
|
import { createStyles as createStyles10 } from "antd-style";
|
|
7707
7836
|
import { DownOutlined as DownOutlined3, UpOutlined as UpOutlined2 } from "@ant-design/icons";
|
|
7708
7837
|
import CollapsePanel3 from "antd/es/collapse/CollapsePanel";
|
|
7709
|
-
import { Fragment as
|
|
7838
|
+
import { Fragment as Fragment5, jsx as jsx37, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
7710
7839
|
var DEFAULT_COLLAPSED_MAX_HEIGHT = 180;
|
|
7711
7840
|
var DEFAULT_EXPANDED_MAX_HEIGHT = 500;
|
|
7712
7841
|
var useStyle4 = createStyles10(
|
|
@@ -7823,10 +7952,10 @@ var ContentPreviewCollapse = ({
|
|
|
7823
7952
|
children: /* @__PURE__ */ jsx37("div", { ref: contentRef, className: styles.content, children })
|
|
7824
7953
|
}
|
|
7825
7954
|
),
|
|
7826
|
-
isOverflowing && /* @__PURE__ */ jsx37("div", { className: styles.toggleButton, onClick: handleToggleContent, children: showFullContent ? /* @__PURE__ */ jsxs20(
|
|
7955
|
+
isOverflowing && /* @__PURE__ */ jsx37("div", { className: styles.toggleButton, onClick: handleToggleContent, children: showFullContent ? /* @__PURE__ */ jsxs20(Fragment5, { children: [
|
|
7827
7956
|
/* @__PURE__ */ jsx37(UpOutlined2, { style: { fontSize: 10 } }),
|
|
7828
7957
|
/* @__PURE__ */ jsx37("span", { children: showLessText })
|
|
7829
|
-
] }) : /* @__PURE__ */ jsxs20(
|
|
7958
|
+
] }) : /* @__PURE__ */ jsxs20(Fragment5, { children: [
|
|
7830
7959
|
/* @__PURE__ */ jsx37(DownOutlined3, { style: { fontSize: 10 } }),
|
|
7831
7960
|
/* @__PURE__ */ jsx37("span", { children: showAllText })
|
|
7832
7961
|
] }) })
|
|
@@ -8283,7 +8412,7 @@ import {
|
|
|
8283
8412
|
} from "react";
|
|
8284
8413
|
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
8285
8414
|
var LazyBubble = ({
|
|
8286
|
-
message:
|
|
8415
|
+
message: message21,
|
|
8287
8416
|
renderContent,
|
|
8288
8417
|
autoLoadRightPanel
|
|
8289
8418
|
}) => {
|
|
@@ -8314,10 +8443,10 @@ var LazyBubble = ({
|
|
|
8314
8443
|
autoLoadRightPanel?.();
|
|
8315
8444
|
}, []);
|
|
8316
8445
|
const getPlaceholder = () => {
|
|
8317
|
-
const estimatedHeight =
|
|
8446
|
+
const estimatedHeight = message21.content ? Math.min(100, message21.content.length / 5) : 100;
|
|
8318
8447
|
return /* @__PURE__ */ jsx42("div", { style: { height: `${estimatedHeight}px`, minHeight: "50px" } });
|
|
8319
8448
|
};
|
|
8320
|
-
return /* @__PURE__ */ jsx42(ErrorBoundary, { children: /* @__PURE__ */ jsx42("div", { ref, style: { width: "100%" }, children: isVisible || wasEverVisible ? renderContent(
|
|
8449
|
+
return /* @__PURE__ */ jsx42(ErrorBoundary, { children: /* @__PURE__ */ jsx42("div", { ref, style: { width: "100%" }, children: isVisible || wasEverVisible ? renderContent(message21) : getPlaceholder() }) });
|
|
8321
8450
|
};
|
|
8322
8451
|
var MemoizedBubbleList = memo(
|
|
8323
8452
|
({
|
|
@@ -8348,8 +8477,8 @@ var MessageList = ({
|
|
|
8348
8477
|
messageLengthRef.current = messages?.length;
|
|
8349
8478
|
}
|
|
8350
8479
|
}, [messages?.length]);
|
|
8351
|
-
const renderContent = useCallback16((
|
|
8352
|
-
const { content } =
|
|
8480
|
+
const renderContent = useCallback16((message21) => {
|
|
8481
|
+
const { content } = message21;
|
|
8353
8482
|
try {
|
|
8354
8483
|
const json = JSON.parse(content);
|
|
8355
8484
|
if (json.action && json.message) {
|
|
@@ -8357,7 +8486,7 @@ var MessageList = ({
|
|
|
8357
8486
|
}
|
|
8358
8487
|
} catch (error) {
|
|
8359
8488
|
}
|
|
8360
|
-
const tool_calls_md =
|
|
8489
|
+
const tool_calls_md = message21.tool_calls?.map((tool_call) => {
|
|
8361
8490
|
return `\`\`\`tool_call
|
|
8362
8491
|
${JSON.stringify(tool_call)}
|
|
8363
8492
|
\`\`\``;
|
|
@@ -8366,17 +8495,17 @@ ${JSON.stringify(tool_call)}
|
|
|
8366
8495
|
return /* @__PURE__ */ jsx42(Space12, { direction: "vertical", style: { width: "100%" }, children: /* @__PURE__ */ jsx42(MDResponse, { content: content_md }) });
|
|
8367
8496
|
}, []);
|
|
8368
8497
|
const items = useMemo9(
|
|
8369
|
-
() => messages.map((
|
|
8370
|
-
key:
|
|
8371
|
-
role:
|
|
8498
|
+
() => messages.map((message21, index) => ({
|
|
8499
|
+
key: message21.id,
|
|
8500
|
+
role: message21.role,
|
|
8372
8501
|
typing: false,
|
|
8373
8502
|
content: /* @__PURE__ */ jsx42(
|
|
8374
8503
|
LazyBubble,
|
|
8375
8504
|
{
|
|
8376
|
-
message:
|
|
8505
|
+
message: message21,
|
|
8377
8506
|
renderContent,
|
|
8378
8507
|
autoLoadRightPanel: () => {
|
|
8379
|
-
const { content, role: role2 } =
|
|
8508
|
+
const { content, role: role2 } = message21;
|
|
8380
8509
|
const isNewAddedMessage = messageLengthRef.current > 1 && messageLengthRef.current + 1 === messages.length;
|
|
8381
8510
|
if (index === messages.length - 1 && isNewAddedMessage && role2 === "ai") {
|
|
8382
8511
|
try {
|
|
@@ -8453,7 +8582,7 @@ import {
|
|
|
8453
8582
|
Space as Space28,
|
|
8454
8583
|
Typography as Typography33
|
|
8455
8584
|
} from "antd";
|
|
8456
|
-
import
|
|
8585
|
+
import React43, { useCallback as useCallback26, useContext as useContext10, useEffect as useEffect35, useRef as useRef21, useState as useState54 } from "react";
|
|
8457
8586
|
import { BrainCircuit as BrainCircuit3 } from "lucide-react";
|
|
8458
8587
|
|
|
8459
8588
|
// src/components/GenUI/HITLContainer.tsx
|
|
@@ -9403,7 +9532,7 @@ var AgentHeader = ({
|
|
|
9403
9532
|
import { useCallback as useCallback18, useContext as useContext8 } from "react";
|
|
9404
9533
|
import { Tooltip as Tooltip9, Button as Button23, Dropdown } from "antd";
|
|
9405
9534
|
import { HistoryOutlined, PlusOutlined } from "@ant-design/icons";
|
|
9406
|
-
import { Fragment as
|
|
9535
|
+
import { Fragment as Fragment6, jsx as jsx55, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
9407
9536
|
var CreateThreadButton = () => {
|
|
9408
9537
|
const { createThread, assistantId, isLoading } = useConversationContext();
|
|
9409
9538
|
const { config } = useLatticeChatShellContext();
|
|
@@ -9504,14 +9633,14 @@ var ThreadManagementButtons = () => {
|
|
|
9504
9633
|
if (!conversationContext.assistantId) {
|
|
9505
9634
|
return null;
|
|
9506
9635
|
}
|
|
9507
|
-
return /* @__PURE__ */ jsxs30(
|
|
9636
|
+
return /* @__PURE__ */ jsxs30(Fragment6, { children: [
|
|
9508
9637
|
showCreateButton && /* @__PURE__ */ jsx55(CreateThreadButton, {}),
|
|
9509
9638
|
showListButton && /* @__PURE__ */ jsx55(ThreadListButton, {})
|
|
9510
9639
|
] });
|
|
9511
9640
|
};
|
|
9512
9641
|
|
|
9513
9642
|
// src/context/WorkspaceContext.tsx
|
|
9514
|
-
import
|
|
9643
|
+
import React35, {
|
|
9515
9644
|
createContext as createContext8,
|
|
9516
9645
|
useContext as useContext9,
|
|
9517
9646
|
useState as useState46,
|
|
@@ -9526,11 +9655,11 @@ import { FolderOpen as FolderOpen2, Activity as Activity3, Database as Database4
|
|
|
9526
9655
|
import { Modal as Modal10, Avatar as Avatar7, Popover as Popover2, Button as Button35 } from "antd";
|
|
9527
9656
|
|
|
9528
9657
|
// src/components/Chat/Menu.tsx
|
|
9529
|
-
import
|
|
9658
|
+
import React19, { useState as useState31, useMemo as useMemo10, useCallback as useCallback19 } from "react";
|
|
9530
9659
|
import { Drawer } from "antd";
|
|
9531
9660
|
import { Plus, ChevronRight, ChevronDown, Cpu, PanelLeftClose } from "lucide-react";
|
|
9532
9661
|
import { createStyles as createStyles16 } from "antd-style";
|
|
9533
|
-
import { Fragment as
|
|
9662
|
+
import { Fragment as Fragment7, jsx as jsx56, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
9534
9663
|
var DRAWER_STYLES = {
|
|
9535
9664
|
wrapper: {
|
|
9536
9665
|
background: "transparent",
|
|
@@ -9693,7 +9822,7 @@ var Menu = ({
|
|
|
9693
9822
|
}, [forceIconMode, isIconView, isControlled, onCollapsedChange]);
|
|
9694
9823
|
const renderIconMode = () => /* @__PURE__ */ jsxs31("div", { className: `${menuStyles.sidebar} ${styles.iconMode} ${className || ""}`, style, children: [
|
|
9695
9824
|
/* @__PURE__ */ jsx56("div", { className: styles.iconModeLogo, children: logo || logoIcon || /* @__PURE__ */ jsx56(Cpu, { size: 28, color: "#1677ff" }) }),
|
|
9696
|
-
/* @__PURE__ */ jsx56("div", { className: styles.iconModeContainer, children: groupedItems.map(({ group, items: items2 }, groupIndex) => /* @__PURE__ */ jsxs31(
|
|
9825
|
+
/* @__PURE__ */ jsx56("div", { className: styles.iconModeContainer, children: groupedItems.map(({ group, items: items2 }, groupIndex) => /* @__PURE__ */ jsxs31(React19.Fragment, { children: [
|
|
9697
9826
|
groupIndex > 0 && /* @__PURE__ */ jsx56("div", { className: styles.iconModeDivider }),
|
|
9698
9827
|
/* @__PURE__ */ jsx56("div", { className: styles.iconModeGroup, children: items2.map((item) => /* @__PURE__ */ jsx56(
|
|
9699
9828
|
"button",
|
|
@@ -9744,7 +9873,7 @@ var Menu = ({
|
|
|
9744
9873
|
items2.map((item) => {
|
|
9745
9874
|
const isInline = item.inline ?? false;
|
|
9746
9875
|
const isExpanded2 = expandedInlineDrawers.has(item.id);
|
|
9747
|
-
return /* @__PURE__ */ jsxs31(
|
|
9876
|
+
return /* @__PURE__ */ jsxs31(React19.Fragment, { children: [
|
|
9748
9877
|
/* @__PURE__ */ jsxs31(
|
|
9749
9878
|
"button",
|
|
9750
9879
|
{
|
|
@@ -9766,7 +9895,7 @@ var Menu = ({
|
|
|
9766
9895
|
] }, group || "ungrouped")) }),
|
|
9767
9896
|
footer && /* @__PURE__ */ jsx56("div", { style: { marginTop: "auto", paddingTop: 16, borderTop: "1px solid rgba(0, 0, 0, 0.06)" }, children: typeof footer === "function" ? footer({ isIconMode: shouldShowIconMode }) : footer })
|
|
9768
9897
|
] });
|
|
9769
|
-
return /* @__PURE__ */ jsxs31(
|
|
9898
|
+
return /* @__PURE__ */ jsxs31(Fragment7, { children: [
|
|
9770
9899
|
shouldShowIconMode ? renderIconMode() : renderExpandedMode(),
|
|
9771
9900
|
items.filter((item) => item.type === "drawer").map((item) => /* @__PURE__ */ jsx56(
|
|
9772
9901
|
Drawer,
|
|
@@ -10227,7 +10356,7 @@ var ProjectCardList = () => {
|
|
|
10227
10356
|
}
|
|
10228
10357
|
setIsCreateModalOpen(false);
|
|
10229
10358
|
};
|
|
10230
|
-
const
|
|
10359
|
+
const formatDate6 = (date) => {
|
|
10231
10360
|
const d = typeof date === "string" ? new Date(date) : date;
|
|
10232
10361
|
return d.toLocaleDateString("en-US", {
|
|
10233
10362
|
month: "short",
|
|
@@ -10318,7 +10447,7 @@ var ProjectCardList = () => {
|
|
|
10318
10447
|
/* @__PURE__ */ jsx58("h3", { className: styles.projectName, children: project.name }),
|
|
10319
10448
|
/* @__PURE__ */ jsxs33("span", { className: styles.projectDate, children: [
|
|
10320
10449
|
"Created ",
|
|
10321
|
-
|
|
10450
|
+
formatDate6(project.createdAt)
|
|
10322
10451
|
] })
|
|
10323
10452
|
] })
|
|
10324
10453
|
] }) })
|
|
@@ -10336,7 +10465,7 @@ var ProjectCardList = () => {
|
|
|
10336
10465
|
/* @__PURE__ */ jsx58("span", { className: styles.listProjectName, children: project.name }),
|
|
10337
10466
|
/* @__PURE__ */ jsxs33("span", { className: styles.listProjectDate, children: [
|
|
10338
10467
|
"Created ",
|
|
10339
|
-
|
|
10468
|
+
formatDate6(project.createdAt)
|
|
10340
10469
|
] })
|
|
10341
10470
|
] })
|
|
10342
10471
|
] }, project.id))
|
|
@@ -11023,7 +11152,7 @@ import { useState as useState35, useEffect as useEffect21 } from "react";
|
|
|
11023
11152
|
import { createStyles as createStyles18 } from "antd-style";
|
|
11024
11153
|
import { Database as Database2, Plus as Plus4, Edit2 as Edit22, Trash2 as Trash22, TestTube2 as TestTube22, Loader2 as Loader22 } from "lucide-react";
|
|
11025
11154
|
import { Card as Card13, Button as Button26, Space as Space17, Typography as Typography18, Tag as Tag7, Modal as Modal4, message as message6, Input as Input6, Select as Select2, Popconfirm as Popconfirm2 } from "antd";
|
|
11026
|
-
import { Fragment as
|
|
11155
|
+
import { Fragment as Fragment8, jsx as jsx60, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
11027
11156
|
var { Text: Text15 } = Typography18;
|
|
11028
11157
|
var { TextArea: TextArea2 } = Input6;
|
|
11029
11158
|
var useStyles7 = createStyles18(({ token, css }) => ({
|
|
@@ -11213,7 +11342,7 @@ var DatabaseConfigDrawerContent = ({
|
|
|
11213
11342
|
configItem.id
|
|
11214
11343
|
] }),
|
|
11215
11344
|
configItem.description && /* @__PURE__ */ jsx60("div", { style: { fontSize: 13, color: "#666", marginBottom: 12 }, children: configItem.description }),
|
|
11216
|
-
/* @__PURE__ */ jsx60("div", { style: { marginBottom: 12 }, children: configItem.config.connectionString ? /* @__PURE__ */ jsx60(Tag7, { color: "success", style: { fontSize: 11 }, children: "Connection String Mode" }) : /* @__PURE__ */ jsxs35(
|
|
11345
|
+
/* @__PURE__ */ jsx60("div", { style: { marginBottom: 12 }, children: configItem.config.connectionString ? /* @__PURE__ */ jsx60(Tag7, { color: "success", style: { fontSize: 11 }, children: "Connection String Mode" }) : /* @__PURE__ */ jsxs35(Fragment8, { children: [
|
|
11217
11346
|
/* @__PURE__ */ jsxs35(Text15, { code: true, style: { fontSize: 12, marginRight: 8 }, children: [
|
|
11218
11347
|
configItem.config.host || "localhost",
|
|
11219
11348
|
":",
|
|
@@ -11534,7 +11663,7 @@ var DatabaseConfigFormModal = ({
|
|
|
11534
11663
|
import { useState as useState36, useEffect as useEffect22 } from "react";
|
|
11535
11664
|
import { Plug, Plus as Plus5, Edit2 as Edit23, Trash2 as Trash23, TestTube2 as TestTube23, Loader2 as Loader23, Settings as Settings2, Database as Database3, ChevronRight as ChevronRight3, ChevronLeft as ChevronLeft3, Check as Check3, Terminal, Globe, Server } from "lucide-react";
|
|
11536
11665
|
import { Card as Card14, Button as Button27, Space as Space18, Typography as Typography19, Tag as Tag8, Modal as Modal5, message as message7, Input as Input7, Select as Select3, Popconfirm as Popconfirm3, Steps as Steps2, Checkbox as Checkbox3, Spin as Spin6, theme as theme4, Collapse as Collapse7 } from "antd";
|
|
11537
|
-
import { Fragment as
|
|
11666
|
+
import { Fragment as Fragment9, jsx as jsx61, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
11538
11667
|
var { Text: Text16, Title: Title3 } = Typography19;
|
|
11539
11668
|
var { TextArea: TextArea3 } = Input7;
|
|
11540
11669
|
var { useToken: useToken3 } = theme4;
|
|
@@ -11992,7 +12121,7 @@ var McpConfigFormModal = ({
|
|
|
11992
12121
|
}
|
|
11993
12122
|
)
|
|
11994
12123
|
] }),
|
|
11995
|
-
formData.transport === "stdio" ? /* @__PURE__ */ jsxs36(
|
|
12124
|
+
formData.transport === "stdio" ? /* @__PURE__ */ jsxs36(Fragment9, { children: [
|
|
11996
12125
|
/* @__PURE__ */ jsxs36("div", { children: [
|
|
11997
12126
|
/* @__PURE__ */ jsx61(Text16, { strong: true, children: "Command" }),
|
|
11998
12127
|
/* @__PURE__ */ jsx61(
|
|
@@ -13009,7 +13138,7 @@ import {
|
|
|
13009
13138
|
DeleteOutlined as DeleteOutlined2
|
|
13010
13139
|
} from "@ant-design/icons";
|
|
13011
13140
|
import { Activity as Activity2 } from "lucide-react";
|
|
13012
|
-
import { Fragment as
|
|
13141
|
+
import { Fragment as Fragment10, jsx as jsx63, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
13013
13142
|
var { TextArea: TextArea4 } = Input8;
|
|
13014
13143
|
var { Text: Text18, Title: Title4 } = Typography21;
|
|
13015
13144
|
var SectionCard = ({ title, icon, badge, children, defaultExpanded = true }) => {
|
|
@@ -13092,7 +13221,7 @@ var SectionCard = ({ title, icon, badge, children, defaultExpanded = true }) =>
|
|
|
13092
13221
|
var renderConfigField = (propertyKey, property, value, onChange, token) => {
|
|
13093
13222
|
const label = /* @__PURE__ */ jsxs38("span", { children: [
|
|
13094
13223
|
property.title || propertyKey,
|
|
13095
|
-
property.description && /* @__PURE__ */ jsxs38(
|
|
13224
|
+
property.description && /* @__PURE__ */ jsxs38(Fragment10, { children: [
|
|
13096
13225
|
"\xA0",
|
|
13097
13226
|
/* @__PURE__ */ jsx63(Tooltip11, { title: property.description, children: /* @__PURE__ */ jsx63(QuestionCircleOutlined, { style: { color: token.colorTextSecondary, cursor: "pointer" } }) })
|
|
13098
13227
|
] })
|
|
@@ -14203,7 +14332,7 @@ var AgentConfigPanel = ({
|
|
|
14203
14332
|
description: "No tools available",
|
|
14204
14333
|
image: Empty4.PRESENTED_IMAGE_SIMPLE
|
|
14205
14334
|
}
|
|
14206
|
-
) : /* @__PURE__ */ jsxs38(
|
|
14335
|
+
) : /* @__PURE__ */ jsxs38(Fragment10, { children: [
|
|
14207
14336
|
/* @__PURE__ */ jsxs38(
|
|
14208
14337
|
"div",
|
|
14209
14338
|
{
|
|
@@ -14259,7 +14388,7 @@ var AgentConfigPanel = ({
|
|
|
14259
14388
|
description: "No other agents available",
|
|
14260
14389
|
image: Empty4.PRESENTED_IMAGE_SIMPLE
|
|
14261
14390
|
}
|
|
14262
|
-
) : /* @__PURE__ */ jsxs38(
|
|
14391
|
+
) : /* @__PURE__ */ jsxs38(Fragment10, { children: [
|
|
14263
14392
|
/* @__PURE__ */ jsxs38(
|
|
14264
14393
|
"div",
|
|
14265
14394
|
{
|
|
@@ -14610,7 +14739,7 @@ var SubAgentInheritList = ({
|
|
|
14610
14739
|
};
|
|
14611
14740
|
|
|
14612
14741
|
// src/components/Chat/CreateAssistantModal.tsx
|
|
14613
|
-
import { Fragment as
|
|
14742
|
+
import { Fragment as Fragment11, jsx as jsx66, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
14614
14743
|
var { TextArea: TextArea5 } = Input10;
|
|
14615
14744
|
var { Text: Text21 } = Typography24;
|
|
14616
14745
|
var CreateAssistantModal = ({
|
|
@@ -14983,7 +15112,7 @@ var CreateAssistantModal = ({
|
|
|
14983
15112
|
]
|
|
14984
15113
|
}
|
|
14985
15114
|
),
|
|
14986
|
-
showSubAgentList && /* @__PURE__ */ jsxs41(
|
|
15115
|
+
showSubAgentList && /* @__PURE__ */ jsxs41(Fragment11, { children: [
|
|
14987
15116
|
/* @__PURE__ */ jsx66(Divider4, { style: { margin: "12px 0" } }),
|
|
14988
15117
|
/* @__PURE__ */ jsx66(Text21, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Sub-Agents" }),
|
|
14989
15118
|
/* @__PURE__ */ jsx66(
|
|
@@ -15499,7 +15628,7 @@ import {
|
|
|
15499
15628
|
CopyOutlined as CopyOutlined2,
|
|
15500
15629
|
PlusOutlined as PlusOutlined4
|
|
15501
15630
|
} from "@ant-design/icons";
|
|
15502
|
-
import { Fragment as
|
|
15631
|
+
import { Fragment as Fragment12, jsx as jsx68, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
15503
15632
|
var { Text: Text22 } = Typography25;
|
|
15504
15633
|
var { TextArea: TextArea6 } = Input11;
|
|
15505
15634
|
var getBadgeColor2 = (name) => {
|
|
@@ -15552,7 +15681,7 @@ var SkillNode = ({ data }) => {
|
|
|
15552
15681
|
) : [],
|
|
15553
15682
|
[currentSkill.metadata]
|
|
15554
15683
|
);
|
|
15555
|
-
const
|
|
15684
|
+
const formatDate6 = (value) => {
|
|
15556
15685
|
if (!value) return "";
|
|
15557
15686
|
const date = value instanceof Date ? value : new Date(value);
|
|
15558
15687
|
if (Number.isNaN(date.getTime())) return "";
|
|
@@ -15946,7 +16075,7 @@ var SkillNode = ({ data }) => {
|
|
|
15946
16075
|
] })
|
|
15947
16076
|
}
|
|
15948
16077
|
),
|
|
15949
|
-
isEditing ? editingView : /* @__PURE__ */ jsxs43(
|
|
16078
|
+
isEditing ? editingView : /* @__PURE__ */ jsxs43(Fragment12, { children: [
|
|
15950
16079
|
currentSkill.description && /* @__PURE__ */ jsx68("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ jsxs43(
|
|
15951
16080
|
Text22,
|
|
15952
16081
|
{
|
|
@@ -16160,7 +16289,7 @@ var SkillNode = ({ data }) => {
|
|
|
16160
16289
|
},
|
|
16161
16290
|
children: [
|
|
16162
16291
|
"Created: ",
|
|
16163
|
-
|
|
16292
|
+
formatDate6(currentSkill.createdAt)
|
|
16164
16293
|
]
|
|
16165
16294
|
}
|
|
16166
16295
|
),
|
|
@@ -16174,7 +16303,7 @@ var SkillNode = ({ data }) => {
|
|
|
16174
16303
|
},
|
|
16175
16304
|
children: [
|
|
16176
16305
|
"Updated: ",
|
|
16177
|
-
|
|
16306
|
+
formatDate6(currentSkill.updatedAt)
|
|
16178
16307
|
]
|
|
16179
16308
|
}
|
|
16180
16309
|
)
|
|
@@ -16252,7 +16381,7 @@ var SkillNode = ({ data }) => {
|
|
|
16252
16381
|
justifyContent: "space-between",
|
|
16253
16382
|
gap: 8
|
|
16254
16383
|
},
|
|
16255
|
-
children: isEditing ? /* @__PURE__ */ jsxs43(
|
|
16384
|
+
children: isEditing ? /* @__PURE__ */ jsxs43(Fragment12, { children: [
|
|
16256
16385
|
/* @__PURE__ */ jsx68(
|
|
16257
16386
|
Button31,
|
|
16258
16387
|
{
|
|
@@ -16280,7 +16409,7 @@ var SkillNode = ({ data }) => {
|
|
|
16280
16409
|
children: "Save"
|
|
16281
16410
|
}
|
|
16282
16411
|
)
|
|
16283
|
-
] }) : /* @__PURE__ */ jsxs43(
|
|
16412
|
+
] }) : /* @__PURE__ */ jsxs43(Fragment12, { children: [
|
|
16284
16413
|
/* @__PURE__ */ jsx68(
|
|
16285
16414
|
Button31,
|
|
16286
16415
|
{
|
|
@@ -17740,8 +17869,7 @@ var WorkspaceResourceManager = ({
|
|
|
17740
17869
|
}
|
|
17741
17870
|
),
|
|
17742
17871
|
logo,
|
|
17743
|
-
|
|
17744
|
-
right: null
|
|
17872
|
+
main: /* @__PURE__ */ jsx72(SideAppViewBrowser, { region: "content" })
|
|
17745
17873
|
}
|
|
17746
17874
|
),
|
|
17747
17875
|
/* @__PURE__ */ jsx72(
|
|
@@ -17825,7 +17953,7 @@ var WorkspaceContextProvider = ({
|
|
|
17825
17953
|
};
|
|
17826
17954
|
const [workspaceId, setWorkspaceId] = useState46(getInitialWorkspaceId);
|
|
17827
17955
|
const [projectId, setProjectId] = useState46(getInitialProjectId);
|
|
17828
|
-
|
|
17956
|
+
React35.useEffect(() => {
|
|
17829
17957
|
const wsId = getInitialWorkspaceId();
|
|
17830
17958
|
const pjId = getInitialProjectId();
|
|
17831
17959
|
if (wsId || pjId) {
|
|
@@ -17839,7 +17967,7 @@ var WorkspaceContextProvider = ({
|
|
|
17839
17967
|
const [projects, setProjects] = useState46([]);
|
|
17840
17968
|
const [loading, setLoading] = useState46(false);
|
|
17841
17969
|
const [error, setError] = useState46(null);
|
|
17842
|
-
const client =
|
|
17970
|
+
const client = React35.useMemo(() => {
|
|
17843
17971
|
return new WorkspaceClient({
|
|
17844
17972
|
baseURL: config.baseURL,
|
|
17845
17973
|
apiKey: config.apiKey || "",
|
|
@@ -18122,7 +18250,7 @@ var WorkspaceContextProvider = ({
|
|
|
18122
18250
|
import { useRef as useRef16, useState as useState47 } from "react";
|
|
18123
18251
|
import { Modal as Modal11, List as List7, Checkbox as Checkbox5, Spin as Spin8, Empty as Empty5, Typography as Typography27, Button as Button36, Space as Space23, Tooltip as Tooltip13 } from "antd";
|
|
18124
18252
|
import { Database as Database5 } from "lucide-react";
|
|
18125
|
-
import { Fragment as
|
|
18253
|
+
import { Fragment as Fragment13, jsx as jsx74, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
18126
18254
|
var DatabasePicker = ({ senderRef, iconOnly }) => {
|
|
18127
18255
|
const [modalOpen, setModalOpen] = useState47(false);
|
|
18128
18256
|
const [databases, setDatabases] = useState47([]);
|
|
@@ -18177,7 +18305,7 @@ var DatabasePicker = ({ senderRef, iconOnly }) => {
|
|
|
18177
18305
|
setModalOpen(false);
|
|
18178
18306
|
setSelectedDatabases([]);
|
|
18179
18307
|
};
|
|
18180
|
-
return /* @__PURE__ */ jsxs48(
|
|
18308
|
+
return /* @__PURE__ */ jsxs48(Fragment13, { children: [
|
|
18181
18309
|
/* @__PURE__ */ jsx74(Tooltip13, { title: iconOnly ? "Database" : void 0, children: /* @__PURE__ */ jsx74(
|
|
18182
18310
|
Button36,
|
|
18183
18311
|
{
|
|
@@ -18272,7 +18400,7 @@ var DatabasePicker = ({ senderRef, iconOnly }) => {
|
|
|
18272
18400
|
import { useRef as useRef17, useState as useState48 } from "react";
|
|
18273
18401
|
import { Modal as Modal12, List as List8, Checkbox as Checkbox6, Spin as Spin9, Empty as Empty6, Typography as Typography28, Button as Button37, Space as Space24, Tooltip as Tooltip14 } from "antd";
|
|
18274
18402
|
import { BrainCircuit } from "lucide-react";
|
|
18275
|
-
import { Fragment as
|
|
18403
|
+
import { Fragment as Fragment14, jsx as jsx75, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
18276
18404
|
var SkillPicker = ({ senderRef, iconOnly }) => {
|
|
18277
18405
|
const [modalOpen, setModalOpen] = useState48(false);
|
|
18278
18406
|
const [skills, setSkills] = useState48([]);
|
|
@@ -18327,7 +18455,7 @@ var SkillPicker = ({ senderRef, iconOnly }) => {
|
|
|
18327
18455
|
setModalOpen(false);
|
|
18328
18456
|
setSelectedSkills([]);
|
|
18329
18457
|
};
|
|
18330
|
-
return /* @__PURE__ */ jsxs49(
|
|
18458
|
+
return /* @__PURE__ */ jsxs49(Fragment14, { children: [
|
|
18331
18459
|
/* @__PURE__ */ jsx75(Tooltip14, { title: iconOnly ? "Skills" : void 0, children: /* @__PURE__ */ jsx75(
|
|
18332
18460
|
Button37,
|
|
18333
18461
|
{
|
|
@@ -18422,7 +18550,7 @@ var SkillPicker = ({ senderRef, iconOnly }) => {
|
|
|
18422
18550
|
import { useRef as useRef18, useState as useState49 } from "react";
|
|
18423
18551
|
import { Modal as Modal13, List as List9, Empty as Empty7, Typography as Typography29, Button as Button38, Tooltip as Tooltip15 } from "antd";
|
|
18424
18552
|
import { Bot as Bot2 } from "lucide-react";
|
|
18425
|
-
import { Fragment as
|
|
18553
|
+
import { Fragment as Fragment15, jsx as jsx76, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
18426
18554
|
var AgentPicker = ({ senderRef, iconOnly }) => {
|
|
18427
18555
|
const [modalOpen, setModalOpen] = useState49(false);
|
|
18428
18556
|
const [loading, setLoading] = useState49(false);
|
|
@@ -18442,7 +18570,7 @@ var AgentPicker = ({ senderRef, iconOnly }) => {
|
|
|
18442
18570
|
const handleAgentClick = (agentId) => {
|
|
18443
18571
|
setSelectedAgent(agentId);
|
|
18444
18572
|
};
|
|
18445
|
-
return /* @__PURE__ */ jsxs50(
|
|
18573
|
+
return /* @__PURE__ */ jsxs50(Fragment15, { children: [
|
|
18446
18574
|
/* @__PURE__ */ jsx76(Tooltip15, { title: iconOnly ? currentAssistant?.name || "Agent" : void 0, children: /* @__PURE__ */ jsx76(
|
|
18447
18575
|
Button38,
|
|
18448
18576
|
{
|
|
@@ -18538,7 +18666,7 @@ var AgentPicker = ({ senderRef, iconOnly }) => {
|
|
|
18538
18666
|
import { useEffect as useEffect32, useState as useState50, useRef as useRef19 } from "react";
|
|
18539
18667
|
import { Modal as Modal14, List as List10, Spin as Spin11, Empty as Empty8, Typography as Typography30, Button as Button39, Tag as Tag14, Tooltip as Tooltip16 } from "antd";
|
|
18540
18668
|
import { Database as Database6, Check as Check4, Server as Server2 } from "lucide-react";
|
|
18541
|
-
import { Fragment as
|
|
18669
|
+
import { Fragment as Fragment16, jsx as jsx77, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
18542
18670
|
var SESSION_STORAGE_KEY = "metrics_datasource_selection";
|
|
18543
18671
|
var MetricsDataSourcePicker = ({
|
|
18544
18672
|
senderRef,
|
|
@@ -18682,7 +18810,7 @@ var MetricsDataSourcePicker = ({
|
|
|
18682
18810
|
acc[ds.serverName].push(ds);
|
|
18683
18811
|
return acc;
|
|
18684
18812
|
}, {});
|
|
18685
|
-
return /* @__PURE__ */ jsxs51(
|
|
18813
|
+
return /* @__PURE__ */ jsxs51(Fragment16, { children: [
|
|
18686
18814
|
/* @__PURE__ */ jsx77(Tooltip16, { title: iconOnly ? getSelectedName() || "Select Data Source" : dataSources.length === 0 ? "No data sources available" : void 0, children: /* @__PURE__ */ jsx77(
|
|
18687
18815
|
Button39,
|
|
18688
18816
|
{
|
|
@@ -19615,7 +19743,7 @@ var BusinessAnalysisPrompts = ({
|
|
|
19615
19743
|
};
|
|
19616
19744
|
|
|
19617
19745
|
// src/components/Chat/Chating.tsx
|
|
19618
|
-
import { Fragment as
|
|
19746
|
+
import { Fragment as Fragment17, jsx as jsx81, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
19619
19747
|
var slotConfig = [];
|
|
19620
19748
|
var Chating = ({
|
|
19621
19749
|
avatar,
|
|
@@ -19642,7 +19770,7 @@ var Chating = ({
|
|
|
19642
19770
|
const { styles } = useStyle();
|
|
19643
19771
|
const [headerOpen, setHeaderOpen] = useState54(false);
|
|
19644
19772
|
const attachmentsRef = useRef21(null);
|
|
19645
|
-
const senderRef =
|
|
19773
|
+
const senderRef = React43.useRef(null);
|
|
19646
19774
|
const {
|
|
19647
19775
|
assistantId,
|
|
19648
19776
|
threadId,
|
|
@@ -20078,7 +20206,7 @@ var Chating = ({
|
|
|
20078
20206
|
}
|
|
20079
20207
|
);
|
|
20080
20208
|
};
|
|
20081
|
-
return /* @__PURE__ */ jsxs54(
|
|
20209
|
+
return /* @__PURE__ */ jsxs54(Fragment17, { children: [
|
|
20082
20210
|
/* @__PURE__ */ jsx81(
|
|
20083
20211
|
"div",
|
|
20084
20212
|
{
|
|
@@ -20117,7 +20245,7 @@ var Chating = ({
|
|
|
20117
20245
|
className: `${styles.emptyStateContainer} ${isTransitioning ? styles.exiting : ""}`,
|
|
20118
20246
|
children: [
|
|
20119
20247
|
/* @__PURE__ */ jsxs54("div", { className: styles.welcomeSection, children: [
|
|
20120
|
-
/* @__PURE__ */ jsx81("div", { className: styles.greeting, children: emptyStateGreeting ? emptyStateGreeting : /* @__PURE__ */ jsxs54(
|
|
20248
|
+
/* @__PURE__ */ jsx81("div", { className: styles.greeting, children: emptyStateGreeting ? emptyStateGreeting : /* @__PURE__ */ jsxs54(Fragment17, { children: [
|
|
20121
20249
|
welcomePrefix,
|
|
20122
20250
|
" ",
|
|
20123
20251
|
/* @__PURE__ */ jsx81("span", { className: "user-name", children: displayUserName })
|
|
@@ -20145,7 +20273,7 @@ var Chating = ({
|
|
|
20145
20273
|
]
|
|
20146
20274
|
}
|
|
20147
20275
|
),
|
|
20148
|
-
!isEmptyState && /* @__PURE__ */ jsxs54(
|
|
20276
|
+
!isEmptyState && /* @__PURE__ */ jsxs54(Fragment17, { children: [
|
|
20149
20277
|
/* @__PURE__ */ jsx81(
|
|
20150
20278
|
MessageList,
|
|
20151
20279
|
{
|
|
@@ -20378,8 +20506,7 @@ import {
|
|
|
20378
20506
|
Tooltip as Tooltip17,
|
|
20379
20507
|
Popconfirm as Popconfirm4,
|
|
20380
20508
|
message as message14,
|
|
20381
|
-
Card as Card16
|
|
20382
|
-
Descriptions
|
|
20509
|
+
Card as Card16
|
|
20383
20510
|
} from "antd";
|
|
20384
20511
|
import {
|
|
20385
20512
|
ClockCircleOutlined as ClockCircleOutlined3,
|
|
@@ -20477,6 +20604,11 @@ var useStyles8 = createStyles20(({ token, css }) => ({
|
|
|
20477
20604
|
padding: 2px 6px;
|
|
20478
20605
|
border-radius: 4px;
|
|
20479
20606
|
font-size: 12px;
|
|
20607
|
+
`,
|
|
20608
|
+
messageContent: css`
|
|
20609
|
+
margin-top: 4px;
|
|
20610
|
+
max-width: 300px;
|
|
20611
|
+
word-break: break-word;
|
|
20480
20612
|
`
|
|
20481
20613
|
}));
|
|
20482
20614
|
var getStatusColor = (status) => {
|
|
@@ -20662,7 +20794,8 @@ var ScheduleViewer = ({ data }) => {
|
|
|
20662
20794
|
/* @__PURE__ */ jsxs56("div", { className: styles.taskHeader, children: [
|
|
20663
20795
|
/* @__PURE__ */ jsxs56("div", { children: [
|
|
20664
20796
|
/* @__PURE__ */ jsx84("div", { className: styles.taskType, children: task.taskType }),
|
|
20665
|
-
/* @__PURE__ */ jsx84("div", { className: styles.taskId, children: task.taskId })
|
|
20797
|
+
/* @__PURE__ */ jsx84("div", { className: styles.taskId, children: task.taskId }),
|
|
20798
|
+
task.payload?.message?.content && /* @__PURE__ */ jsx84("div", { className: styles.messageContent, children: /* @__PURE__ */ jsx84(Text26, { type: "secondary", style: { fontSize: 12 }, children: task.payload.message.content }) })
|
|
20666
20799
|
] }),
|
|
20667
20800
|
/* @__PURE__ */ jsx84(Tag15, { color: getStatusColor(task.status), icon: getStatusIcon2(task.status), children: task.status.toUpperCase() })
|
|
20668
20801
|
] }),
|
|
@@ -20702,19 +20835,6 @@ var ScheduleViewer = ({ data }) => {
|
|
|
20702
20835
|
/* @__PURE__ */ jsx84(ExclamationCircleOutlined, { style: { marginRight: 4 } }),
|
|
20703
20836
|
task.lastError
|
|
20704
20837
|
] }) }),
|
|
20705
|
-
task.metadata && Object.keys(task.metadata).length > 0 && /* @__PURE__ */ jsx84(
|
|
20706
|
-
Descriptions,
|
|
20707
|
-
{
|
|
20708
|
-
size: "small",
|
|
20709
|
-
column: 1,
|
|
20710
|
-
style: { marginTop: 12 },
|
|
20711
|
-
items: Object.entries(task.metadata).map(([key, value]) => ({
|
|
20712
|
-
key,
|
|
20713
|
-
label: key,
|
|
20714
|
-
children: typeof value === "object" ? JSON.stringify(value) : String(value)
|
|
20715
|
-
}))
|
|
20716
|
-
}
|
|
20717
|
-
),
|
|
20718
20838
|
isActive && renderActions(task)
|
|
20719
20839
|
]
|
|
20720
20840
|
},
|
|
@@ -21083,7 +21203,7 @@ import { RefreshCw } from "lucide-react";
|
|
|
21083
21203
|
import { createStyles as createStyles29 } from "antd-style";
|
|
21084
21204
|
|
|
21085
21205
|
// src/components/GenUI/elements/TeamWorkspace/TeamWorkspaceMenu.tsx
|
|
21086
|
-
import
|
|
21206
|
+
import React45, { useState as useState56 } from "react";
|
|
21087
21207
|
import {
|
|
21088
21208
|
LayoutDashboard,
|
|
21089
21209
|
Inbox,
|
|
@@ -21095,7 +21215,7 @@ import {
|
|
|
21095
21215
|
} from "lucide-react";
|
|
21096
21216
|
import { Tooltip as Tooltip18, Badge as Badge6 } from "antd";
|
|
21097
21217
|
import { createStyles as createStyles21 } from "antd-style";
|
|
21098
|
-
import { Fragment as
|
|
21218
|
+
import { Fragment as Fragment18, jsx as jsx88, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
21099
21219
|
var useStyles9 = createStyles21(({ token, css }) => ({
|
|
21100
21220
|
container: css`
|
|
21101
21221
|
display: flex;
|
|
@@ -21305,11 +21425,11 @@ var TeamWorkspaceMenu = ({
|
|
|
21305
21425
|
if (showTooltip && !isExpanded) {
|
|
21306
21426
|
return /* @__PURE__ */ jsx88(Tooltip18, { title: item.name, placement: "right", children: content }, item.id);
|
|
21307
21427
|
}
|
|
21308
|
-
return /* @__PURE__ */ jsx88(
|
|
21428
|
+
return /* @__PURE__ */ jsx88(React45.Fragment, { children: content }, item.id);
|
|
21309
21429
|
};
|
|
21310
21430
|
const renderGroup = (groupItems, groupLabel, showDivider) => {
|
|
21311
21431
|
if (groupItems.length === 0) return null;
|
|
21312
|
-
return /* @__PURE__ */ jsxs60(
|
|
21432
|
+
return /* @__PURE__ */ jsxs60(Fragment18, { children: [
|
|
21313
21433
|
showDivider && /* @__PURE__ */ jsx88("div", { className: styles.groupDivider }),
|
|
21314
21434
|
/* @__PURE__ */ jsxs60("div", { className: styles.menuGroup, children: [
|
|
21315
21435
|
isExpanded && groupLabel && /* @__PURE__ */ jsx88("div", { className: styles.groupLabel, children: groupLabel }),
|
|
@@ -21783,7 +21903,7 @@ import {
|
|
|
21783
21903
|
Activity as Activity4,
|
|
21784
21904
|
GitCommit
|
|
21785
21905
|
} from "lucide-react";
|
|
21786
|
-
import { Fragment as
|
|
21906
|
+
import { Fragment as Fragment19, jsx as jsx90, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
21787
21907
|
var { Title: Title7, Text: Text31, Paragraph } = Typography41;
|
|
21788
21908
|
var useStyles11 = createStyles23(({ token, css }) => ({
|
|
21789
21909
|
modalContent: css`
|
|
@@ -22268,7 +22388,7 @@ var TaskDetailModal = ({
|
|
|
22268
22388
|
] }),
|
|
22269
22389
|
/* @__PURE__ */ jsxs62("div", { className: styles.metaItem, children: [
|
|
22270
22390
|
/* @__PURE__ */ jsx90(Text31, { className: styles.metaLabel, children: "Assignee" }),
|
|
22271
|
-
/* @__PURE__ */ jsx90("div", { className: styles.metaValue, children: task.assignee ? /* @__PURE__ */ jsxs62(
|
|
22391
|
+
/* @__PURE__ */ jsx90("div", { className: styles.metaValue, children: task.assignee ? /* @__PURE__ */ jsxs62(Fragment19, { children: [
|
|
22272
22392
|
/* @__PURE__ */ jsx90(
|
|
22273
22393
|
"div",
|
|
22274
22394
|
{
|
|
@@ -22838,7 +22958,7 @@ var IssuesView = ({
|
|
|
22838
22958
|
};
|
|
22839
22959
|
|
|
22840
22960
|
// src/components/GenUI/elements/TeamWorkspace/TeamOrgCanvas.tsx
|
|
22841
|
-
import
|
|
22961
|
+
import React48, { useMemo as useMemo21 } from "react";
|
|
22842
22962
|
import {
|
|
22843
22963
|
ReactFlow as ReactFlow3,
|
|
22844
22964
|
Background as Background3,
|
|
@@ -23079,7 +23199,7 @@ var TeamOrgCanvasInner = ({
|
|
|
23079
23199
|
}, [team, teammates, taskStatsByTeammate]);
|
|
23080
23200
|
const [flowNodes, setNodes, onNodesChange] = useNodesState3(nodes);
|
|
23081
23201
|
const [flowEdges, setEdges, onEdgesChange] = useEdgesState3(edges);
|
|
23082
|
-
|
|
23202
|
+
React48.useEffect(() => {
|
|
23083
23203
|
setNodes(nodes);
|
|
23084
23204
|
setEdges(edges);
|
|
23085
23205
|
setTimeout(() => fitView({ padding: 0.2 }), 100);
|
|
@@ -23421,12 +23541,12 @@ var formatDate3 = (timestamp) => {
|
|
|
23421
23541
|
});
|
|
23422
23542
|
};
|
|
23423
23543
|
var MailboxDetailModal = ({
|
|
23424
|
-
message:
|
|
23544
|
+
message: message21,
|
|
23425
23545
|
visible,
|
|
23426
23546
|
onClose
|
|
23427
23547
|
}) => {
|
|
23428
23548
|
const { styles } = useStyles15();
|
|
23429
|
-
if (!
|
|
23549
|
+
if (!message21) return null;
|
|
23430
23550
|
return /* @__PURE__ */ jsx94(
|
|
23431
23551
|
Modal16,
|
|
23432
23552
|
{
|
|
@@ -23449,12 +23569,12 @@ var MailboxDetailModal = ({
|
|
|
23449
23569
|
children: /* @__PURE__ */ jsxs66("div", { className: styles.modalContent, children: [
|
|
23450
23570
|
/* @__PURE__ */ jsxs66("div", { className: styles.header, children: [
|
|
23451
23571
|
/* @__PURE__ */ jsx94("div", { className: styles.messageIcon, children: /* @__PURE__ */ jsx94(Mail2, { size: 20 }) }),
|
|
23452
|
-
/* @__PURE__ */ jsx94(Text35, { className: styles.messageId, children:
|
|
23453
|
-
!
|
|
23572
|
+
/* @__PURE__ */ jsx94(Text35, { className: styles.messageId, children: message21.id }),
|
|
23573
|
+
!message21.read && /* @__PURE__ */ jsx94(Tag20, { color: "red", children: "Unread" })
|
|
23454
23574
|
] }),
|
|
23455
23575
|
/* @__PURE__ */ jsxs66(Title11, { level: 4, className: styles.title, children: [
|
|
23456
23576
|
"Message from ",
|
|
23457
|
-
|
|
23577
|
+
message21.from
|
|
23458
23578
|
] }),
|
|
23459
23579
|
/* @__PURE__ */ jsxs66("div", { className: styles.metaSection, children: [
|
|
23460
23580
|
/* @__PURE__ */ jsxs66("div", { className: styles.metaItem, children: [
|
|
@@ -23464,11 +23584,11 @@ var MailboxDetailModal = ({
|
|
|
23464
23584
|
"div",
|
|
23465
23585
|
{
|
|
23466
23586
|
className: styles.avatar,
|
|
23467
|
-
style: { background: getAvatarColor7(
|
|
23468
|
-
children: getInitials7(
|
|
23587
|
+
style: { background: getAvatarColor7(message21.from) },
|
|
23588
|
+
children: getInitials7(message21.from)
|
|
23469
23589
|
}
|
|
23470
23590
|
),
|
|
23471
|
-
/* @__PURE__ */ jsx94("span", { children:
|
|
23591
|
+
/* @__PURE__ */ jsx94("span", { children: message21.from })
|
|
23472
23592
|
] })
|
|
23473
23593
|
] }),
|
|
23474
23594
|
/* @__PURE__ */ jsxs66("div", { className: styles.metaItem, children: [
|
|
@@ -23478,29 +23598,29 @@ var MailboxDetailModal = ({
|
|
|
23478
23598
|
"div",
|
|
23479
23599
|
{
|
|
23480
23600
|
className: styles.avatar,
|
|
23481
|
-
style: { background: getAvatarColor7(
|
|
23482
|
-
children: getInitials7(
|
|
23601
|
+
style: { background: getAvatarColor7(message21.to) },
|
|
23602
|
+
children: getInitials7(message21.to)
|
|
23483
23603
|
}
|
|
23484
23604
|
),
|
|
23485
|
-
/* @__PURE__ */ jsx94("span", { children:
|
|
23605
|
+
/* @__PURE__ */ jsx94("span", { children: message21.to })
|
|
23486
23606
|
] })
|
|
23487
23607
|
] }),
|
|
23488
23608
|
/* @__PURE__ */ jsxs66("div", { className: styles.metaItem, children: [
|
|
23489
23609
|
/* @__PURE__ */ jsx94(Text35, { className: styles.metaLabel, children: "Time" }),
|
|
23490
23610
|
/* @__PURE__ */ jsxs66("div", { className: styles.metaValue, children: [
|
|
23491
23611
|
/* @__PURE__ */ jsx94(Calendar2, { size: 14 }),
|
|
23492
|
-
/* @__PURE__ */ jsx94("span", { children: formatDate3(
|
|
23612
|
+
/* @__PURE__ */ jsx94("span", { children: formatDate3(message21.timestamp) })
|
|
23493
23613
|
] })
|
|
23494
23614
|
] }),
|
|
23495
23615
|
/* @__PURE__ */ jsxs66("div", { className: styles.metaItem, children: [
|
|
23496
23616
|
/* @__PURE__ */ jsx94(Text35, { className: styles.metaLabel, children: "Type" }),
|
|
23497
|
-
/* @__PURE__ */ jsx94("div", { className: styles.metaValue, children: /* @__PURE__ */ jsx94(Tag20, { color:
|
|
23617
|
+
/* @__PURE__ */ jsx94("div", { className: styles.metaValue, children: /* @__PURE__ */ jsx94(Tag20, { color: message21.type === "broadcast" ? "blue" : "default", children: message21.type }) })
|
|
23498
23618
|
] })
|
|
23499
23619
|
] }),
|
|
23500
23620
|
/* @__PURE__ */ jsx94(Divider8, {}),
|
|
23501
23621
|
/* @__PURE__ */ jsxs66("div", { className: styles.contentSection, children: [
|
|
23502
23622
|
/* @__PURE__ */ jsx94(Text35, { className: styles.contentLabel, children: "Message Content" }),
|
|
23503
|
-
/* @__PURE__ */ jsx94("div", { className: styles.contentBox, children: /* @__PURE__ */ jsx94(Paragraph2, { className: styles.messageContent, children:
|
|
23623
|
+
/* @__PURE__ */ jsx94("div", { className: styles.contentBox, children: /* @__PURE__ */ jsx94(Paragraph2, { className: styles.messageContent, children: message21.content }) })
|
|
23504
23624
|
] })
|
|
23505
23625
|
] })
|
|
23506
23626
|
}
|
|
@@ -23729,26 +23849,26 @@ var MessageGroupComponent = ({ group, styles, defaultExpanded = true, onMessageC
|
|
|
23729
23849
|
]
|
|
23730
23850
|
}
|
|
23731
23851
|
),
|
|
23732
|
-
isExpanded && /* @__PURE__ */ jsx95("div", { className: styles.listGroupContent, children: group.messages.map((
|
|
23852
|
+
isExpanded && /* @__PURE__ */ jsx95("div", { className: styles.listGroupContent, children: group.messages.map((message21) => /* @__PURE__ */ jsxs67(
|
|
23733
23853
|
"div",
|
|
23734
23854
|
{
|
|
23735
|
-
className: `${styles.listItem} ${!
|
|
23736
|
-
onClick: () => onMessageClick(
|
|
23855
|
+
className: `${styles.listItem} ${!message21.read ? styles.listItemUnread : ""}`,
|
|
23856
|
+
onClick: () => onMessageClick(message21),
|
|
23737
23857
|
children: [
|
|
23738
|
-
/* @__PURE__ */ jsx95("div", { className: styles.listItemIcon, children: !
|
|
23858
|
+
/* @__PURE__ */ jsx95("div", { className: styles.listItemIcon, children: !message21.read ? /* @__PURE__ */ jsx95("div", { className: styles.unreadBadge }) : /* @__PURE__ */ jsx95(Circle2, { size: 8, style: { color: "#d9d9d9" } }) }),
|
|
23739
23859
|
/* @__PURE__ */ jsxs67("div", { className: styles.listItemContent, children: [
|
|
23740
|
-
/* @__PURE__ */ jsx95("span", { className: styles.listItemPreview, children: getMessagePreview(
|
|
23860
|
+
/* @__PURE__ */ jsx95("span", { className: styles.listItemPreview, children: getMessagePreview(message21.content) }),
|
|
23741
23861
|
/* @__PURE__ */ jsxs67("span", { className: styles.listItemMeta, children: [
|
|
23742
23862
|
"To: ",
|
|
23743
|
-
|
|
23863
|
+
message21.to,
|
|
23744
23864
|
" \u2022 ",
|
|
23745
|
-
|
|
23865
|
+
message21.type
|
|
23746
23866
|
] })
|
|
23747
23867
|
] }),
|
|
23748
|
-
/* @__PURE__ */ jsx95("div", { className: styles.listItemRight, children: /* @__PURE__ */ jsx95("span", { className: styles.listItemDate, children: formatDate4(
|
|
23868
|
+
/* @__PURE__ */ jsx95("div", { className: styles.listItemRight, children: /* @__PURE__ */ jsx95("span", { className: styles.listItemDate, children: formatDate4(message21.timestamp) }) })
|
|
23749
23869
|
]
|
|
23750
23870
|
},
|
|
23751
|
-
|
|
23871
|
+
message21.id
|
|
23752
23872
|
)) })
|
|
23753
23873
|
] });
|
|
23754
23874
|
};
|
|
@@ -23759,12 +23879,12 @@ var MailboxPanel = ({ data }) => {
|
|
|
23759
23879
|
const { teamMailbox = [] } = data || {};
|
|
23760
23880
|
const messageGroups = useMemo22(() => {
|
|
23761
23881
|
const groupsMap = /* @__PURE__ */ new Map();
|
|
23762
|
-
teamMailbox.forEach((
|
|
23763
|
-
const sender =
|
|
23882
|
+
teamMailbox.forEach((message21) => {
|
|
23883
|
+
const sender = message21.from;
|
|
23764
23884
|
if (!groupsMap.has(sender)) {
|
|
23765
23885
|
groupsMap.set(sender, []);
|
|
23766
23886
|
}
|
|
23767
|
-
groupsMap.get(sender).push(
|
|
23887
|
+
groupsMap.get(sender).push(message21);
|
|
23768
23888
|
});
|
|
23769
23889
|
const groups = Array.from(groupsMap.entries()).map(([sender, messages]) => ({
|
|
23770
23890
|
sender,
|
|
@@ -23781,8 +23901,8 @@ var MailboxPanel = ({ data }) => {
|
|
|
23781
23901
|
return groups;
|
|
23782
23902
|
}, [teamMailbox]);
|
|
23783
23903
|
const totalUnread = teamMailbox.filter((m) => !m.read).length;
|
|
23784
|
-
const handleMessageClick = (
|
|
23785
|
-
setSelectedMessage(
|
|
23904
|
+
const handleMessageClick = (message21) => {
|
|
23905
|
+
setSelectedMessage(message21);
|
|
23786
23906
|
setModalVisible(true);
|
|
23787
23907
|
};
|
|
23788
23908
|
const handleCloseModal = () => {
|
|
@@ -24838,7 +24958,7 @@ import { Button as Button47, Typography as Typography47 } from "antd";
|
|
|
24838
24958
|
import { ExpandOutlined as ExpandOutlined2 } from "@ant-design/icons";
|
|
24839
24959
|
|
|
24840
24960
|
// src/streaming-html/StreamingHTMLRenderer.tsx
|
|
24841
|
-
import
|
|
24961
|
+
import React53, { useEffect as useEffect38, useRef as useRef23, useCallback as useCallback28, useState as useState62 } from "react";
|
|
24842
24962
|
|
|
24843
24963
|
// src/streaming-html/show-widget-css-generator.ts
|
|
24844
24964
|
function generateShowWidgetCSS(tokens) {
|
|
@@ -25537,8 +25657,8 @@ var StreamingHTMLRenderer = ({
|
|
|
25537
25657
|
const pendingChunksRef = useRef23([]);
|
|
25538
25658
|
const isCompleteRef = useRef23(isComplete);
|
|
25539
25659
|
const isScriptExecuted = useRef23(false);
|
|
25540
|
-
const [iframeHeight, setIframeHeight] =
|
|
25541
|
-
const [iframeWidth, setIframeWidth] =
|
|
25660
|
+
const [iframeHeight, setIframeHeight] = React53.useState(0);
|
|
25661
|
+
const [iframeWidth, setIframeWidth] = React53.useState(void 0);
|
|
25542
25662
|
const [currentMessageIndex, setCurrentMessageIndex] = useState62(0);
|
|
25543
25663
|
const [showLoading, setShowLoading] = useState62(true);
|
|
25544
25664
|
useEffect38(() => {
|
|
@@ -25626,11 +25746,11 @@ var StreamingHTMLRenderer = ({
|
|
|
25626
25746
|
if (!iframe || event.source !== iframe.contentWindow) {
|
|
25627
25747
|
return;
|
|
25628
25748
|
}
|
|
25629
|
-
const
|
|
25630
|
-
if (!
|
|
25749
|
+
const message21 = event.data;
|
|
25750
|
+
if (!message21 || typeof message21 !== "object") {
|
|
25631
25751
|
return;
|
|
25632
25752
|
}
|
|
25633
|
-
switch (
|
|
25753
|
+
switch (message21.type) {
|
|
25634
25754
|
case "iframe-ready":
|
|
25635
25755
|
console.log("[StreamingHTMLRenderer] Iframe ready");
|
|
25636
25756
|
isReadyRef.current = true;
|
|
@@ -25645,25 +25765,25 @@ var StreamingHTMLRenderer = ({
|
|
|
25645
25765
|
}
|
|
25646
25766
|
break;
|
|
25647
25767
|
case "iframe-height":
|
|
25648
|
-
if (typeof
|
|
25649
|
-
setIframeHeight(
|
|
25768
|
+
if (typeof message21.height === "number" && message21.height > 0) {
|
|
25769
|
+
setIframeHeight(message21.height);
|
|
25650
25770
|
}
|
|
25651
25771
|
break;
|
|
25652
25772
|
case "iframe-error":
|
|
25653
25773
|
const streamingError = {
|
|
25654
25774
|
type: "RENDER_ERROR",
|
|
25655
|
-
message:
|
|
25775
|
+
message: message21.error || "Unknown iframe error"
|
|
25656
25776
|
};
|
|
25657
25777
|
onError?.(streamingError);
|
|
25658
25778
|
break;
|
|
25659
25779
|
case "widget-prompt":
|
|
25660
|
-
if (typeof
|
|
25661
|
-
onPrompt?.(
|
|
25780
|
+
if (typeof message21.text === "string") {
|
|
25781
|
+
onPrompt?.(message21.text);
|
|
25662
25782
|
}
|
|
25663
25783
|
break;
|
|
25664
25784
|
case "widget-open-link":
|
|
25665
|
-
if (typeof
|
|
25666
|
-
window.open(
|
|
25785
|
+
if (typeof message21.url === "string") {
|
|
25786
|
+
window.open(message21.url, "_blank", "noopener,noreferrer");
|
|
25667
25787
|
}
|
|
25668
25788
|
break;
|
|
25669
25789
|
}
|
|
@@ -26029,7 +26149,7 @@ var regsiterElement = (language, ElementMeta) => {
|
|
|
26029
26149
|
import { Dropdown as Dropdown2, Tooltip as Tooltip22 } from "antd";
|
|
26030
26150
|
import { createStyles as createStyles30 } from "antd-style";
|
|
26031
26151
|
import { useEffect as useEffect39, useState as useState63 } from "react";
|
|
26032
|
-
import { Fragment as
|
|
26152
|
+
import { Fragment as Fragment20, jsx as jsx103, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
26033
26153
|
var useStyle13 = createStyles30(({ token, css }) => {
|
|
26034
26154
|
return {
|
|
26035
26155
|
container: css`
|
|
@@ -26206,7 +26326,7 @@ var useStyle13 = createStyles30(({ token, css }) => {
|
|
|
26206
26326
|
});
|
|
26207
26327
|
var EmptySideAppView = ({ component_key, data }) => {
|
|
26208
26328
|
if (data?.component) {
|
|
26209
|
-
return /* @__PURE__ */ jsx103(
|
|
26329
|
+
return /* @__PURE__ */ jsx103(Fragment20, { children: data.component });
|
|
26210
26330
|
}
|
|
26211
26331
|
return /* @__PURE__ */ jsxs74("div", { children: [
|
|
26212
26332
|
/* @__PURE__ */ jsx103("p", { children: "Component view not found" }),
|
|
@@ -26366,7 +26486,7 @@ import { useState as useState64, useCallback as useCallback31, useMemo as useMem
|
|
|
26366
26486
|
import { Modal as Modal17, Input as Input13, Button as Button48, message as message16 } from "antd";
|
|
26367
26487
|
import { createStyles as createStyles31 } from "antd-style";
|
|
26368
26488
|
import { Folder, ChevronDown as ChevronDown4, Building2 as Building24 } from "lucide-react";
|
|
26369
|
-
import { Fragment as
|
|
26489
|
+
import { Fragment as Fragment21, jsx as jsx104, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
26370
26490
|
var PROJECT_NAME_MAX_LENGTH = 50;
|
|
26371
26491
|
var useStyles18 = createStyles31(({ token, css }) => ({
|
|
26372
26492
|
container: css`
|
|
@@ -26684,7 +26804,7 @@ var ProjectSelector = () => {
|
|
|
26684
26804
|
}
|
|
26685
26805
|
};
|
|
26686
26806
|
const isProjectNameValid = !validateProjectName(projectName.trim());
|
|
26687
|
-
return /* @__PURE__ */ jsxs75(
|
|
26807
|
+
return /* @__PURE__ */ jsxs75(Fragment21, { children: [
|
|
26688
26808
|
/* @__PURE__ */ jsx104("div", { className: styles.container, children: /* @__PURE__ */ jsxs75("div", { className: styles.selectorWrapper, children: [
|
|
26689
26809
|
/* @__PURE__ */ jsx104("div", { style: { position: "relative" }, ref: workspaceDropdownRef, children: /* @__PURE__ */ jsx104(
|
|
26690
26810
|
"button",
|
|
@@ -26762,136 +26882,42 @@ var ProjectSelector = () => {
|
|
|
26762
26882
|
] });
|
|
26763
26883
|
};
|
|
26764
26884
|
|
|
26765
|
-
// src/components/Chat/
|
|
26766
|
-
import {
|
|
26767
|
-
|
|
26768
|
-
const { assistant_id, thread_id = "", menu, header, ...chatingProps } = props;
|
|
26769
|
-
const { config } = useLatticeChatShellContext();
|
|
26770
|
-
const showWorkspaceSelector = config.enableWorkspace;
|
|
26771
|
-
const leftTop = showWorkspaceSelector ? /* @__PURE__ */ jsx105(ProjectSelector, {}) : null;
|
|
26772
|
-
return /* @__PURE__ */ jsx105(
|
|
26773
|
-
AgentThreadProvider,
|
|
26774
|
-
{
|
|
26775
|
-
assistantId: assistant_id,
|
|
26776
|
-
threadId: thread_id,
|
|
26777
|
-
options: {
|
|
26778
|
-
streaming: true,
|
|
26779
|
-
enableReturnStateWhenStreamCompleted: true,
|
|
26780
|
-
enableResumeStream: true
|
|
26781
|
-
},
|
|
26782
|
-
children: /* @__PURE__ */ jsx105(ChatUIContextProvider, { children: /* @__PURE__ */ jsxs76(
|
|
26783
|
-
"div",
|
|
26784
|
-
{
|
|
26785
|
-
style: {
|
|
26786
|
-
display: "flex",
|
|
26787
|
-
flexDirection: "column",
|
|
26788
|
-
width: "100%",
|
|
26789
|
-
height: "100%"
|
|
26790
|
-
},
|
|
26791
|
-
children: [
|
|
26792
|
-
header,
|
|
26793
|
-
/* @__PURE__ */ jsx105(
|
|
26794
|
-
ColumnLayout,
|
|
26795
|
-
{
|
|
26796
|
-
menu,
|
|
26797
|
-
header: leftTop,
|
|
26798
|
-
left: thread_id ? /* @__PURE__ */ jsx105(Chating, { ...chatingProps }) : /* @__PURE__ */ jsx105("div", { children: "Please create a conversation first" }),
|
|
26799
|
-
right: /* @__PURE__ */ jsx105(SideAppViewBrowser, {})
|
|
26800
|
-
}
|
|
26801
|
-
)
|
|
26802
|
-
]
|
|
26803
|
-
}
|
|
26804
|
-
) })
|
|
26805
|
-
}
|
|
26806
|
-
);
|
|
26807
|
-
};
|
|
26808
|
-
|
|
26809
|
-
// src/components/Chat/AgentConversations.tsx
|
|
26810
|
-
import { Conversations } from "@ant-design/x";
|
|
26811
|
-
import { theme as theme14 } from "antd";
|
|
26812
|
-
import { useMemo as useMemo27 } from "react";
|
|
26813
|
-
import { jsx as jsx106 } from "react/jsx-runtime";
|
|
26814
|
-
var AgentConversations = ({
|
|
26815
|
-
enableThreadCreation = true,
|
|
26816
|
-
enableThreadList = true
|
|
26817
|
-
}) => {
|
|
26818
|
-
const { token } = theme14.useToken();
|
|
26819
|
-
const { currentAssistant } = useAssistantContext();
|
|
26820
|
-
const {
|
|
26821
|
-
assistantId,
|
|
26822
|
-
thread,
|
|
26823
|
-
selectThread,
|
|
26824
|
-
createThread,
|
|
26825
|
-
listThreads,
|
|
26826
|
-
threads
|
|
26827
|
-
} = useConversationContext();
|
|
26828
|
-
const style = {
|
|
26829
|
-
width: "100%",
|
|
26830
|
-
background: "transparent",
|
|
26831
|
-
borderRadius: token.borderRadius
|
|
26832
|
-
};
|
|
26833
|
-
const threadItems = useMemo27(() => {
|
|
26834
|
-
return threads || [];
|
|
26835
|
-
}, [threads]);
|
|
26836
|
-
const items = threadItems.map((thread2) => ({
|
|
26837
|
-
key: thread2.id,
|
|
26838
|
-
label: thread2.label
|
|
26839
|
-
}));
|
|
26840
|
-
const newChatClick = async () => {
|
|
26841
|
-
if (!assistantId) {
|
|
26842
|
-
return;
|
|
26843
|
-
}
|
|
26844
|
-
await createThread();
|
|
26845
|
-
};
|
|
26846
|
-
if (!enableThreadList) {
|
|
26847
|
-
return null;
|
|
26848
|
-
}
|
|
26849
|
-
const creation = enableThreadCreation ? {
|
|
26850
|
-
onClick: newChatClick
|
|
26851
|
-
} : void 0;
|
|
26852
|
-
return /* @__PURE__ */ jsx106(
|
|
26853
|
-
Conversations,
|
|
26854
|
-
{
|
|
26855
|
-
creation,
|
|
26856
|
-
items,
|
|
26857
|
-
activeKey: thread?.id,
|
|
26858
|
-
style,
|
|
26859
|
-
groupable: true,
|
|
26860
|
-
onActiveChange: (key) => {
|
|
26861
|
-
selectThread(key);
|
|
26862
|
-
}
|
|
26863
|
-
}
|
|
26864
|
-
);
|
|
26865
|
-
};
|
|
26866
|
-
|
|
26867
|
-
// src/components/Chat/LatticeChatView.tsx
|
|
26868
|
-
import { useContext as useContext11 } from "react";
|
|
26869
|
-
|
|
26870
|
-
// src/components/Chat/ChatSidebar.tsx
|
|
26871
|
-
import { useState as useState66, useMemo as useMemo29, useCallback as useCallback34 } from "react";
|
|
26872
|
-
import { Drawer as Drawer2, Avatar as Avatar13, Popover as Popover3, Button as Button50 } from "antd";
|
|
26873
|
-
import {
|
|
26874
|
-
History,
|
|
26875
|
-
LogOut as LogOut4,
|
|
26876
|
-
FolderOpen as FolderOpen4,
|
|
26877
|
-
PlusCircle,
|
|
26878
|
-
PanelLeftClose as PanelLeftClose2,
|
|
26879
|
-
Key as Key2
|
|
26880
|
-
} from "lucide-react";
|
|
26885
|
+
// src/components/Chat/ToolPanelFiles.tsx
|
|
26886
|
+
import { useCallback as useCallback32, useEffect as useEffect40, useMemo as useMemo27, useState as useState65 } from "react";
|
|
26887
|
+
import { message as message17 } from "antd";
|
|
26881
26888
|
|
|
26882
|
-
// src/components/Chat/
|
|
26883
|
-
import
|
|
26884
|
-
import { Spin as Spin15
|
|
26889
|
+
// src/components/Chat/FileDirectoryPanel.tsx
|
|
26890
|
+
import React58 from "react";
|
|
26891
|
+
import { Spin as Spin15 } from "antd";
|
|
26892
|
+
import { ChevronRight as ChevronRight7, FolderOpen as FolderOpen3, Upload } from "lucide-react";
|
|
26885
26893
|
import { createStyles as createStyles32 } from "antd-style";
|
|
26886
|
-
import {
|
|
26887
|
-
import { Fragment as Fragment23, jsx as jsx107, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
26888
|
-
var PROJECT_NAME_MAX_LENGTH2 = 50;
|
|
26894
|
+
import { Fragment as Fragment22, jsx as jsx105, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
26889
26895
|
var useStyles19 = createStyles32(({ token, css }) => ({
|
|
26890
26896
|
container: css`
|
|
26891
|
-
padding:
|
|
26897
|
+
padding: 12px;
|
|
26892
26898
|
font-size: 13px;
|
|
26893
26899
|
background: transparent;
|
|
26894
26900
|
`,
|
|
26901
|
+
header: css`
|
|
26902
|
+
display: flex;
|
|
26903
|
+
align-items: center;
|
|
26904
|
+
gap: 8px;
|
|
26905
|
+
margin-bottom: 12px;
|
|
26906
|
+
padding: 0 4px;
|
|
26907
|
+
font-size: 15px;
|
|
26908
|
+
line-height: 1.4;
|
|
26909
|
+
font-weight: 600;
|
|
26910
|
+
color: ${token.colorText};
|
|
26911
|
+
letter-spacing: -0.01em;
|
|
26912
|
+
padding-bottom: 8px;
|
|
26913
|
+
border-bottom: 1px solid ${token.colorBorderSecondary};
|
|
26914
|
+
|
|
26915
|
+
svg {
|
|
26916
|
+
width: 16px;
|
|
26917
|
+
height: 16px;
|
|
26918
|
+
color: ${token.colorTextSecondary};
|
|
26919
|
+
}
|
|
26920
|
+
`,
|
|
26895
26921
|
section: css`
|
|
26896
26922
|
margin-bottom: 12px;
|
|
26897
26923
|
`,
|
|
@@ -26905,7 +26931,7 @@ var useStyles19 = createStyles32(({ token, css }) => ({
|
|
|
26905
26931
|
sectionTitle: css`
|
|
26906
26932
|
font-size: 10px;
|
|
26907
26933
|
font-weight: 600;
|
|
26908
|
-
letter-spacing: 0.
|
|
26934
|
+
letter-spacing: 0.05em;
|
|
26909
26935
|
color: ${token.colorTextSecondary};
|
|
26910
26936
|
text-transform: uppercase;
|
|
26911
26937
|
cursor: pointer;
|
|
@@ -26916,28 +26942,6 @@ var useStyles19 = createStyles32(({ token, css }) => ({
|
|
|
26916
26942
|
color: ${token.colorPrimary};
|
|
26917
26943
|
}
|
|
26918
26944
|
`,
|
|
26919
|
-
sectionAction: css`
|
|
26920
|
-
display: flex;
|
|
26921
|
-
align-items: center;
|
|
26922
|
-
justify-content: center;
|
|
26923
|
-
width: 20px;
|
|
26924
|
-
height: 20px;
|
|
26925
|
-
border-radius: 4px;
|
|
26926
|
-
border: none;
|
|
26927
|
-
background: transparent;
|
|
26928
|
-
cursor: pointer;
|
|
26929
|
-
transition: all 0.15s ease;
|
|
26930
|
-
|
|
26931
|
-
&:hover {
|
|
26932
|
-
background: ${token.colorBgTextHover};
|
|
26933
|
-
}
|
|
26934
|
-
|
|
26935
|
-
svg {
|
|
26936
|
-
width: 14px;
|
|
26937
|
-
height: 14px;
|
|
26938
|
-
color: ${token.colorTextSecondary};
|
|
26939
|
-
}
|
|
26940
|
-
`,
|
|
26941
26945
|
badge: css`
|
|
26942
26946
|
display: flex;
|
|
26943
26947
|
align-items: center;
|
|
@@ -26946,88 +26950,66 @@ var useStyles19 = createStyles32(({ token, css }) => ({
|
|
|
26946
26950
|
height: 16px;
|
|
26947
26951
|
padding: 0 4px;
|
|
26948
26952
|
border-radius: 8px;
|
|
26949
|
-
background:
|
|
26953
|
+
background: ${token.colorFillSecondary};
|
|
26950
26954
|
font-size: 10px;
|
|
26951
|
-
font-weight:
|
|
26955
|
+
font-weight: 500;
|
|
26952
26956
|
color: ${token.colorTextSecondary};
|
|
26953
26957
|
`,
|
|
26954
|
-
|
|
26958
|
+
assetList: css`
|
|
26955
26959
|
display: flex;
|
|
26956
26960
|
flex-direction: column;
|
|
26957
26961
|
gap: 2px;
|
|
26958
26962
|
`,
|
|
26959
|
-
|
|
26963
|
+
assetItem: css`
|
|
26960
26964
|
display: flex;
|
|
26961
26965
|
align-items: center;
|
|
26962
26966
|
gap: 8px;
|
|
26963
|
-
|
|
26964
|
-
|
|
26967
|
+
width: 100%;
|
|
26968
|
+
padding: 5px 8px;
|
|
26969
|
+
border-radius: 4px;
|
|
26965
26970
|
cursor: pointer;
|
|
26966
26971
|
transition: all 0.15s ease;
|
|
26967
|
-
border:
|
|
26972
|
+
border: none;
|
|
26973
|
+
background: transparent;
|
|
26974
|
+
text-align: left;
|
|
26968
26975
|
|
|
26969
26976
|
&:hover {
|
|
26970
26977
|
background: ${token.colorBgTextHover};
|
|
26971
|
-
border-color: ${token.colorBorder};
|
|
26972
|
-
}
|
|
26973
|
-
|
|
26974
|
-
&.active {
|
|
26975
|
-
background: ${token.colorPrimaryBg};
|
|
26976
|
-
border-color: ${token.colorPrimary};
|
|
26977
26978
|
}
|
|
26978
26979
|
`,
|
|
26979
|
-
|
|
26980
|
+
treeRow: css`
|
|
26980
26981
|
display: flex;
|
|
26981
26982
|
align-items: center;
|
|
26982
|
-
|
|
26983
|
-
|
|
26984
|
-
svg {
|
|
26985
|
-
width: 16px;
|
|
26986
|
-
height: 16px;
|
|
26987
|
-
color: ${token.colorPrimary};
|
|
26988
|
-
}
|
|
26983
|
+
gap: 8px;
|
|
26984
|
+
width: 100%;
|
|
26989
26985
|
`,
|
|
26990
|
-
|
|
26991
|
-
|
|
26986
|
+
treeIndent: css`
|
|
26987
|
+
flex-shrink: 0;
|
|
26988
|
+
width: 12px;
|
|
26989
|
+
`,
|
|
26990
|
+
treeToggle: css`
|
|
26991
|
+
display: inline-flex;
|
|
26992
26992
|
align-items: center;
|
|
26993
26993
|
justify-content: center;
|
|
26994
|
-
|
|
26995
|
-
|
|
26996
|
-
|
|
26997
|
-
|
|
26998
|
-
|
|
26999
|
-
|
|
27000
|
-
|
|
27001
|
-
|
|
27002
|
-
font-size: 13px;
|
|
27003
|
-
font-weight: 600;
|
|
27004
|
-
color: ${token.colorPrimary};
|
|
27005
|
-
flex: 1;
|
|
27006
|
-
`,
|
|
27007
|
-
projectNameInactive: css`
|
|
27008
|
-
font-size: 13px;
|
|
27009
|
-
font-weight: 500;
|
|
27010
|
-
color: ${token.colorText};
|
|
27011
|
-
flex: 1;
|
|
27012
|
-
`,
|
|
27013
|
-
assetList: css`
|
|
27014
|
-
display: flex;
|
|
27015
|
-
flex-direction: column;
|
|
27016
|
-
gap: 2px;
|
|
27017
|
-
`,
|
|
27018
|
-
assetItem: css`
|
|
27019
|
-
display: flex;
|
|
27020
|
-
align-items: center;
|
|
27021
|
-
gap: 8px;
|
|
27022
|
-
padding: 5px 8px;
|
|
27023
|
-
border-radius: 4px;
|
|
27024
|
-
cursor: pointer;
|
|
27025
|
-
transition: all 0.15s ease;
|
|
26994
|
+
width: 18px;
|
|
26995
|
+
height: 18px;
|
|
26996
|
+
padding: 0;
|
|
26997
|
+
border: none;
|
|
26998
|
+
border-radius: 4px;
|
|
26999
|
+
background: transparent;
|
|
27000
|
+
color: ${token.colorTextSecondary};
|
|
27001
|
+
cursor: pointer;
|
|
27026
27002
|
|
|
27027
27003
|
&:hover {
|
|
27028
27004
|
background: ${token.colorBgTextHover};
|
|
27005
|
+
color: ${token.colorText};
|
|
27029
27006
|
}
|
|
27030
27007
|
`,
|
|
27008
|
+
treeSpacer: css`
|
|
27009
|
+
flex-shrink: 0;
|
|
27010
|
+
width: 18px;
|
|
27011
|
+
height: 18px;
|
|
27012
|
+
`,
|
|
27031
27013
|
assetIcon: css`
|
|
27032
27014
|
display: flex;
|
|
27033
27015
|
align-items: center;
|
|
@@ -27058,6 +27040,11 @@ var useStyles19 = createStyles32(({ token, css }) => ({
|
|
|
27058
27040
|
font-size: 10px;
|
|
27059
27041
|
color: ${token.colorTextSecondary};
|
|
27060
27042
|
`,
|
|
27043
|
+
treeChildren: css`
|
|
27044
|
+
display: flex;
|
|
27045
|
+
flex-direction: column;
|
|
27046
|
+
gap: 2px;
|
|
27047
|
+
`,
|
|
27061
27048
|
emptyState: css`
|
|
27062
27049
|
padding: 12px;
|
|
27063
27050
|
text-align: center;
|
|
@@ -27101,262 +27088,245 @@ var useStyles19 = createStyles32(({ token, css }) => ({
|
|
|
27101
27088
|
width: 14px;
|
|
27102
27089
|
height: 14px;
|
|
27103
27090
|
}
|
|
27104
|
-
`,
|
|
27105
|
-
projectSelector: css`
|
|
27106
|
-
margin-bottom: 12px;
|
|
27107
|
-
`,
|
|
27108
|
-
projectTrigger: css`
|
|
27109
|
-
display: flex;
|
|
27110
|
-
align-items: center;
|
|
27111
|
-
gap: 8px;
|
|
27112
|
-
cursor: pointer;
|
|
27113
|
-
padding: 8px;
|
|
27114
|
-
border-radius: 8px;
|
|
27115
|
-
transition: all 0.2s ease;
|
|
27116
|
-
border: 1px solid transparent;
|
|
27117
|
-
|
|
27118
|
-
&:hover {
|
|
27119
|
-
background: ${token.colorBgTextHover};
|
|
27120
|
-
border-color: ${token.colorBorder};
|
|
27121
|
-
}
|
|
27122
|
-
`,
|
|
27123
|
-
projectTriggerIcon: css`
|
|
27124
|
-
display: flex;
|
|
27125
|
-
align-items: center;
|
|
27126
|
-
justify-content: center;
|
|
27127
|
-
width: 28px;
|
|
27128
|
-
height: 28px;
|
|
27129
|
-
border-radius: 6px;
|
|
27130
|
-
background: ${token.colorPrimaryBg};
|
|
27131
|
-
|
|
27132
|
-
svg {
|
|
27133
|
-
width: 16px;
|
|
27134
|
-
height: 16px;
|
|
27135
|
-
color: ${token.colorPrimary};
|
|
27136
|
-
}
|
|
27137
|
-
`,
|
|
27138
|
-
projectTriggerInfo: css`
|
|
27139
|
-
flex: 1;
|
|
27140
|
-
min-width: 0;
|
|
27141
|
-
`,
|
|
27142
|
-
projectTriggerName: css`
|
|
27143
|
-
font-size: 13px;
|
|
27144
|
-
font-weight: 600;
|
|
27145
|
-
color: ${token.colorText};
|
|
27146
|
-
white-space: nowrap;
|
|
27147
|
-
overflow: hidden;
|
|
27148
|
-
text-overflow: ellipsis;
|
|
27149
|
-
`,
|
|
27150
|
-
projectTriggerArrow: css`
|
|
27151
|
-
display: flex;
|
|
27152
|
-
align-items: center;
|
|
27153
|
-
|
|
27154
|
-
svg {
|
|
27155
|
-
width: 14px;
|
|
27156
|
-
height: 14px;
|
|
27157
|
-
color: ${token.colorTextSecondary};
|
|
27158
|
-
transition: transform 0.2s ease;
|
|
27159
|
-
}
|
|
27160
|
-
|
|
27161
|
-
&.expanded svg {
|
|
27162
|
-
transform: rotate(180deg);
|
|
27163
|
-
}
|
|
27164
|
-
`,
|
|
27165
|
-
projectDropdown: css`
|
|
27166
|
-
display: flex;
|
|
27167
|
-
flex-direction: column;
|
|
27168
|
-
gap: 2px;
|
|
27169
|
-
margin-top: 4px;
|
|
27170
|
-
padding: 4px;
|
|
27171
|
-
background: ${token.colorBgContainer};
|
|
27172
|
-
border-radius: 8px;
|
|
27173
|
-
border: 1px solid ${token.colorBorder};
|
|
27174
|
-
`,
|
|
27175
|
-
projectDropdownItem: css`
|
|
27176
|
-
display: flex;
|
|
27177
|
-
align-items: center;
|
|
27178
|
-
gap: 8px;
|
|
27179
|
-
padding: 8px 10px;
|
|
27180
|
-
border-radius: 6px;
|
|
27181
|
-
cursor: pointer;
|
|
27182
|
-
transition: all 0.15s ease;
|
|
27183
|
-
|
|
27184
|
-
&:hover {
|
|
27185
|
-
background: ${token.colorBgTextHover};
|
|
27186
|
-
}
|
|
27187
|
-
|
|
27188
|
-
&.active {
|
|
27189
|
-
background: ${token.colorPrimaryBg};
|
|
27190
|
-
}
|
|
27191
|
-
`,
|
|
27192
|
-
projectDropdownItemIcon: css`
|
|
27193
|
-
display: flex;
|
|
27194
|
-
align-items: center;
|
|
27195
|
-
justify-content: center;
|
|
27196
|
-
|
|
27197
|
-
svg {
|
|
27198
|
-
width: 14px;
|
|
27199
|
-
height: 14px;
|
|
27200
|
-
color: ${token.colorTextSecondary};
|
|
27201
|
-
}
|
|
27202
|
-
`,
|
|
27203
|
-
projectDropdownItemName: css`
|
|
27204
|
-
font-size: 12px;
|
|
27205
|
-
font-weight: 500;
|
|
27206
|
-
color: ${token.colorText};
|
|
27207
|
-
flex: 1;
|
|
27208
|
-
`,
|
|
27209
|
-
projectDropdownItemNameActive: css`
|
|
27210
|
-
font-size: 12px;
|
|
27211
|
-
font-weight: 600;
|
|
27212
|
-
color: ${token.colorPrimary};
|
|
27213
|
-
flex: 1;
|
|
27214
|
-
`,
|
|
27215
|
-
modalWrap: css`
|
|
27216
|
-
.ant-modal-content {
|
|
27217
|
-
border-radius: 12px;
|
|
27218
|
-
overflow: hidden;
|
|
27219
|
-
}
|
|
27220
|
-
`,
|
|
27221
|
-
formLabel: css`
|
|
27222
|
-
display: block;
|
|
27223
|
-
font-size: 13px;
|
|
27224
|
-
font-weight: 600;
|
|
27225
|
-
color: ${token.colorText};
|
|
27226
|
-
margin-bottom: 8px;
|
|
27227
|
-
`,
|
|
27228
|
-
formInput: css`
|
|
27229
|
-
border-radius: 8px;
|
|
27230
|
-
`,
|
|
27231
|
-
formError: css`
|
|
27232
|
-
font-size: 12px;
|
|
27233
|
-
color: ${token.colorError};
|
|
27234
|
-
margin-top: 6px;
|
|
27235
|
-
`,
|
|
27236
|
-
modalFooter: css`
|
|
27237
|
-
display: flex;
|
|
27238
|
-
justify-content: flex-end;
|
|
27239
|
-
gap: 8px;
|
|
27240
27091
|
`
|
|
27241
27092
|
}));
|
|
27242
|
-
var
|
|
27093
|
+
var formatDate5 = (dateStr) => {
|
|
27094
|
+
if (!dateStr) return "";
|
|
27095
|
+
const date = new Date(dateStr);
|
|
27096
|
+
return date.toLocaleDateString("en-US", { month: "short", day: "numeric" });
|
|
27097
|
+
};
|
|
27098
|
+
var getFileName = (path) => {
|
|
27099
|
+
if (!path) return "";
|
|
27100
|
+
const parts = path.split(/[/\\]/);
|
|
27101
|
+
return parts[parts.length - 1];
|
|
27102
|
+
};
|
|
27103
|
+
var getEntryName = (entry) => getFileName(entry.name || entry.path);
|
|
27104
|
+
var FileDirectoryPanel = ({
|
|
27105
|
+
workspaceId,
|
|
27106
|
+
projectId,
|
|
27107
|
+
resourceFolders,
|
|
27108
|
+
folderEntries,
|
|
27109
|
+
folderLoading,
|
|
27110
|
+
directoryChildren,
|
|
27111
|
+
directoryLoading,
|
|
27112
|
+
directoryExpanded,
|
|
27113
|
+
uploadingFolder,
|
|
27114
|
+
onRefreshFolder,
|
|
27115
|
+
onUploadFolder,
|
|
27116
|
+
onToggleDirectory,
|
|
27117
|
+
onAssetClick
|
|
27118
|
+
}) => {
|
|
27243
27119
|
const { styles } = useStyles19();
|
|
27120
|
+
const renderEntry = React58.useCallback((entry, depth) => {
|
|
27121
|
+
const entryName = getEntryName(entry);
|
|
27122
|
+
if (entry.is_dir) {
|
|
27123
|
+
const isExpanded = directoryExpanded[entry.path] || false;
|
|
27124
|
+
const children = directoryChildren[entry.path] || [];
|
|
27125
|
+
const isLoading = directoryLoading[entry.path] || false;
|
|
27126
|
+
return /* @__PURE__ */ jsxs76("div", { className: styles.treeChildren, children: [
|
|
27127
|
+
/* @__PURE__ */ jsxs76("div", { className: styles.treeRow, children: [
|
|
27128
|
+
Array.from({ length: depth }).map((_, index) => /* @__PURE__ */ jsx105("span", { className: styles.treeIndent }, `${entry.path}-indent-${index}`)),
|
|
27129
|
+
/* @__PURE__ */ jsx105(
|
|
27130
|
+
"button",
|
|
27131
|
+
{
|
|
27132
|
+
type: "button",
|
|
27133
|
+
className: styles.treeToggle,
|
|
27134
|
+
"aria-label": `${isExpanded ? "collapse" : "expand"} ${entryName}`,
|
|
27135
|
+
onClick: () => void onToggleDirectory(entry.path),
|
|
27136
|
+
children: /* @__PURE__ */ jsx105(ChevronRight7, { size: 14, style: { transform: isExpanded ? "rotate(90deg)" : void 0 } })
|
|
27137
|
+
}
|
|
27138
|
+
),
|
|
27139
|
+
/* @__PURE__ */ jsxs76(
|
|
27140
|
+
"button",
|
|
27141
|
+
{
|
|
27142
|
+
type: "button",
|
|
27143
|
+
className: styles.assetItem,
|
|
27144
|
+
"aria-label": `toggle ${entryName}`,
|
|
27145
|
+
onClick: () => void onToggleDirectory(entry.path),
|
|
27146
|
+
title: entryName,
|
|
27147
|
+
children: [
|
|
27148
|
+
/* @__PURE__ */ jsx105("div", { className: styles.assetIcon, children: /* @__PURE__ */ jsx105(FolderOpen3, { size: 14 }) }),
|
|
27149
|
+
/* @__PURE__ */ jsx105("div", { className: styles.assetInfo, children: /* @__PURE__ */ jsx105("div", { className: styles.assetName, children: entryName }) })
|
|
27150
|
+
]
|
|
27151
|
+
}
|
|
27152
|
+
)
|
|
27153
|
+
] }),
|
|
27154
|
+
isExpanded ? isLoading ? /* @__PURE__ */ jsx105("div", { className: styles.loading, children: /* @__PURE__ */ jsx105(Spin15, { size: "small" }) }) : children.length > 0 ? children.map((child) => renderEntry(child, depth + 1)) : /* @__PURE__ */ jsx105("div", { className: styles.emptyState, children: "No files in this folder" }) : null
|
|
27155
|
+
] }, entry.path);
|
|
27156
|
+
}
|
|
27157
|
+
return /* @__PURE__ */ jsxs76("div", { className: styles.treeRow, children: [
|
|
27158
|
+
Array.from({ length: depth }).map((_, index) => /* @__PURE__ */ jsx105("span", { className: styles.treeIndent }, `${entry.path}-indent-${index}`)),
|
|
27159
|
+
/* @__PURE__ */ jsx105("span", { className: styles.treeSpacer }),
|
|
27160
|
+
/* @__PURE__ */ jsxs76(
|
|
27161
|
+
"button",
|
|
27162
|
+
{
|
|
27163
|
+
type: "button",
|
|
27164
|
+
className: styles.assetItem,
|
|
27165
|
+
onClick: () => onAssetClick(entry),
|
|
27166
|
+
"aria-label": `open ${entryName}`,
|
|
27167
|
+
title: entryName,
|
|
27168
|
+
children: [
|
|
27169
|
+
/* @__PURE__ */ jsx105("div", { className: styles.assetIcon, children: getFileIcon2(entryName) }),
|
|
27170
|
+
/* @__PURE__ */ jsxs76("div", { className: styles.assetInfo, children: [
|
|
27171
|
+
/* @__PURE__ */ jsx105("div", { className: styles.assetName, children: entryName }),
|
|
27172
|
+
/* @__PURE__ */ jsx105("div", { className: styles.assetMeta, children: formatDate5(entry.modified_at) })
|
|
27173
|
+
] })
|
|
27174
|
+
]
|
|
27175
|
+
}
|
|
27176
|
+
)
|
|
27177
|
+
] }, entry.path);
|
|
27178
|
+
}, [directoryChildren, directoryExpanded, directoryLoading, onAssetClick, onToggleDirectory, styles]);
|
|
27179
|
+
if (!projectId) {
|
|
27180
|
+
return /* @__PURE__ */ jsx105("div", { className: styles.emptyState, children: "Please select a project to browse files" });
|
|
27181
|
+
}
|
|
27182
|
+
return /* @__PURE__ */ jsxs76("div", { className: styles.container, children: [
|
|
27183
|
+
/* @__PURE__ */ jsxs76("h3", { className: styles.header, children: [
|
|
27184
|
+
/* @__PURE__ */ jsx105(FolderOpen3, { size: 16 }),
|
|
27185
|
+
/* @__PURE__ */ jsx105("span", { children: "Files" })
|
|
27186
|
+
] }),
|
|
27187
|
+
resourceFolders.map((folder) => {
|
|
27188
|
+
const entries = folderEntries[folder.name] || [];
|
|
27189
|
+
const isLoading = folderLoading[folder.name] || false;
|
|
27190
|
+
const itemCount = entries.length;
|
|
27191
|
+
return /* @__PURE__ */ jsxs76("div", { className: styles.section, children: [
|
|
27192
|
+
/* @__PURE__ */ jsxs76("div", { className: styles.sectionHeader, children: [
|
|
27193
|
+
/* @__PURE__ */ jsx105(
|
|
27194
|
+
"span",
|
|
27195
|
+
{
|
|
27196
|
+
className: styles.sectionTitle,
|
|
27197
|
+
onClick: () => void onRefreshFolder(folder),
|
|
27198
|
+
title: "Click to refresh",
|
|
27199
|
+
children: folder.displayName || folder.name
|
|
27200
|
+
}
|
|
27201
|
+
),
|
|
27202
|
+
/* @__PURE__ */ jsx105("span", { className: styles.badge, children: itemCount })
|
|
27203
|
+
] }),
|
|
27204
|
+
isLoading ? /* @__PURE__ */ jsx105("div", { className: styles.loading, children: /* @__PURE__ */ jsx105(Spin15, { size: "small" }) }) : /* @__PURE__ */ jsxs76("div", { className: styles.assetList, children: [
|
|
27205
|
+
entries.map((entry) => renderEntry(entry, 0)),
|
|
27206
|
+
entries.length === 0 ? /* @__PURE__ */ jsx105("div", { className: styles.emptyState, children: "No files in this folder" }) : null,
|
|
27207
|
+
folder.allowUpload ? /* @__PURE__ */ jsx105(
|
|
27208
|
+
"button",
|
|
27209
|
+
{
|
|
27210
|
+
type: "button",
|
|
27211
|
+
className: styles.uploadBtn,
|
|
27212
|
+
onClick: () => void onUploadFolder(folder.name),
|
|
27213
|
+
disabled: !workspaceId || !projectId || uploadingFolder === folder.name,
|
|
27214
|
+
children: uploadingFolder === folder.name ? /* @__PURE__ */ jsxs76(Fragment22, { children: [
|
|
27215
|
+
/* @__PURE__ */ jsx105(Spin15, { size: "small" }),
|
|
27216
|
+
/* @__PURE__ */ jsx105("span", { children: "Uploading..." })
|
|
27217
|
+
] }) : /* @__PURE__ */ jsxs76(Fragment22, { children: [
|
|
27218
|
+
/* @__PURE__ */ jsx105(Upload, { size: 14 }),
|
|
27219
|
+
/* @__PURE__ */ jsx105("span", { children: "Upload" })
|
|
27220
|
+
] })
|
|
27221
|
+
}
|
|
27222
|
+
) : null
|
|
27223
|
+
] })
|
|
27224
|
+
] }, folder.name);
|
|
27225
|
+
})
|
|
27226
|
+
] });
|
|
27227
|
+
};
|
|
27228
|
+
|
|
27229
|
+
// src/components/Chat/ToolPanelFiles.tsx
|
|
27230
|
+
import { jsx as jsx106 } from "react/jsx-runtime";
|
|
27231
|
+
var ToolPanelFiles = () => {
|
|
27244
27232
|
const { config } = useLatticeChatShellContext();
|
|
27245
27233
|
const { openSideApp } = useChatUIContext();
|
|
27246
27234
|
const {
|
|
27247
27235
|
workspaceId,
|
|
27248
27236
|
projectId,
|
|
27249
|
-
|
|
27250
|
-
setProject,
|
|
27237
|
+
listPath,
|
|
27251
27238
|
listPathByFolder,
|
|
27252
|
-
createProject,
|
|
27253
27239
|
getFileViewUrl,
|
|
27254
27240
|
uploadFileToFolder
|
|
27255
27241
|
} = useWorkspaceContext();
|
|
27256
|
-
const [
|
|
27242
|
+
const [folderEntries, setFolderEntries] = useState65({});
|
|
27257
27243
|
const [folderLoading, setFolderLoading] = useState65({});
|
|
27258
|
-
const [
|
|
27244
|
+
const [directoryChildren, setDirectoryChildren] = useState65({});
|
|
27245
|
+
const [directoryLoading, setDirectoryLoading] = useState65({});
|
|
27246
|
+
const [directoryExpanded, setDirectoryExpanded] = useState65({});
|
|
27259
27247
|
const [uploadingFolder, setUploadingFolder] = useState65(null);
|
|
27260
|
-
const
|
|
27261
|
-
const [projectName, setProjectName] = useState65("");
|
|
27262
|
-
const [validationError, setValidationError] = useState65(null);
|
|
27263
|
-
const [isCreating, setIsCreating] = useState65(false);
|
|
27264
|
-
const projectNameInputRef = useRef25(null);
|
|
27265
|
-
const resourceFolders = useMemo28(() => {
|
|
27248
|
+
const resourceFolders = useMemo27(() => {
|
|
27266
27249
|
return config.resourceFolders && config.resourceFolders.length > 0 ? config.resourceFolders : [{ name: "/", displayName: "Project Assets", allowUpload: true }];
|
|
27267
27250
|
}, [config.resourceFolders]);
|
|
27268
|
-
const currentProject = useMemo28(() => {
|
|
27269
|
-
return projects.find((p) => p.id === projectId);
|
|
27270
|
-
}, [projects, projectId]);
|
|
27271
27251
|
const loadAssetsForFolder = useCallback32(async (folder) => {
|
|
27272
27252
|
if (!workspaceId || !projectId) {
|
|
27273
|
-
|
|
27253
|
+
setFolderEntries((prev) => ({ ...prev, [folder.name]: [] }));
|
|
27274
27254
|
return;
|
|
27275
27255
|
}
|
|
27276
27256
|
setFolderLoading((prev) => ({ ...prev, [folder.name]: true }));
|
|
27277
27257
|
try {
|
|
27278
27258
|
const items = await listPathByFolder(folder.name);
|
|
27279
|
-
|
|
27259
|
+
setFolderEntries((prev) => ({ ...prev, [folder.name]: items }));
|
|
27260
|
+
setDirectoryChildren((prev) => {
|
|
27261
|
+
const next = { ...prev };
|
|
27262
|
+
const folderPath = folder.name === "/" ? "/" : folder.name.replace(/\/$/, "");
|
|
27263
|
+
Object.keys(next).forEach((key) => {
|
|
27264
|
+
if (key === folderPath || key.startsWith(`${folderPath}/`)) {
|
|
27265
|
+
delete next[key];
|
|
27266
|
+
}
|
|
27267
|
+
});
|
|
27268
|
+
return next;
|
|
27269
|
+
});
|
|
27270
|
+
setDirectoryExpanded((prev) => {
|
|
27271
|
+
const next = { ...prev };
|
|
27272
|
+
const folderPath = folder.name === "/" ? "/" : folder.name.replace(/\/$/, "");
|
|
27273
|
+
Object.keys(next).forEach((key) => {
|
|
27274
|
+
if (key === folderPath || key.startsWith(`${folderPath}/`)) {
|
|
27275
|
+
delete next[key];
|
|
27276
|
+
}
|
|
27277
|
+
});
|
|
27278
|
+
return next;
|
|
27279
|
+
});
|
|
27280
27280
|
} catch (error) {
|
|
27281
27281
|
console.error(`Failed to load assets for folder ${folder.name}:`, error);
|
|
27282
|
-
|
|
27282
|
+
setFolderEntries((prev) => ({ ...prev, [folder.name]: [] }));
|
|
27283
27283
|
} finally {
|
|
27284
27284
|
setFolderLoading((prev) => ({ ...prev, [folder.name]: false }));
|
|
27285
27285
|
}
|
|
27286
27286
|
}, [workspaceId, projectId, listPathByFolder]);
|
|
27287
|
-
|
|
27288
|
-
|
|
27289
|
-
|
|
27290
|
-
|
|
27291
|
-
}, [workspaceId, projectId, loadAssetsForFolder, resourceFolders]);
|
|
27292
|
-
const handleSelectProject = useCallback32((selectedProjectId) => {
|
|
27293
|
-
setProject(selectedProjectId);
|
|
27294
|
-
setIsProjectListOpen(false);
|
|
27295
|
-
}, [setProject]);
|
|
27296
|
-
const toggleProjectList = useCallback32(() => {
|
|
27297
|
-
setIsProjectListOpen((prev) => !prev);
|
|
27298
|
-
}, []);
|
|
27299
|
-
const validateProjectName = useCallback32((name) => {
|
|
27300
|
-
const trimmed = name.trim();
|
|
27301
|
-
if (!trimmed) return "Project name is required";
|
|
27302
|
-
if (trimmed.length > PROJECT_NAME_MAX_LENGTH2) {
|
|
27303
|
-
return `Name must be ${PROJECT_NAME_MAX_LENGTH2} characters or less`;
|
|
27304
|
-
}
|
|
27305
|
-
return null;
|
|
27306
|
-
}, []);
|
|
27307
|
-
const handleOpenModal = useCallback32(() => {
|
|
27308
|
-
if (!workspaceId) {
|
|
27309
|
-
message17.warning("Please select a workspace first");
|
|
27287
|
+
const handleToggleDirectory = useCallback32(async (path) => {
|
|
27288
|
+
const isExpanded = directoryExpanded[path] || false;
|
|
27289
|
+
if (isExpanded) {
|
|
27290
|
+
setDirectoryExpanded((prev) => ({ ...prev, [path]: false }));
|
|
27310
27291
|
return;
|
|
27311
27292
|
}
|
|
27312
|
-
|
|
27313
|
-
|
|
27314
|
-
setIsModalOpen(true);
|
|
27315
|
-
setTimeout(() => projectNameInputRef.current?.input?.focus(), 100);
|
|
27316
|
-
}, [workspaceId]);
|
|
27317
|
-
const handleCloseModal = useCallback32(() => {
|
|
27318
|
-
setIsModalOpen(false);
|
|
27319
|
-
setProjectName("");
|
|
27320
|
-
setValidationError(null);
|
|
27321
|
-
}, []);
|
|
27322
|
-
const handleProjectNameChange = (e) => {
|
|
27323
|
-
const value = e.target.value;
|
|
27324
|
-
setProjectName(value);
|
|
27325
|
-
setValidationError(validateProjectName(value));
|
|
27326
|
-
};
|
|
27327
|
-
const handleCreateProject = useCallback32(async () => {
|
|
27328
|
-
if (!workspaceId) return;
|
|
27329
|
-
const trimmed = projectName.trim();
|
|
27330
|
-
const error = validateProjectName(trimmed);
|
|
27331
|
-
if (error) {
|
|
27332
|
-
setValidationError(error);
|
|
27293
|
+
setDirectoryExpanded((prev) => ({ ...prev, [path]: true }));
|
|
27294
|
+
if (directoryChildren[path]) {
|
|
27333
27295
|
return;
|
|
27334
27296
|
}
|
|
27335
|
-
|
|
27336
|
-
setValidationError(null);
|
|
27297
|
+
setDirectoryLoading((prev) => ({ ...prev, [path]: true }));
|
|
27337
27298
|
try {
|
|
27338
|
-
const
|
|
27339
|
-
|
|
27340
|
-
|
|
27341
|
-
|
|
27342
|
-
|
|
27343
|
-
message17.success(`Project "${project.name}" created`);
|
|
27344
|
-
} catch (err) {
|
|
27345
|
-
const errMsg = err instanceof Error ? err.message : "Failed to create project";
|
|
27346
|
-
setValidationError(errMsg);
|
|
27299
|
+
const items = await listPath(path);
|
|
27300
|
+
setDirectoryChildren((prev) => ({ ...prev, [path]: items }));
|
|
27301
|
+
} catch (error) {
|
|
27302
|
+
console.error(`Failed to load directory ${path}:`, error);
|
|
27303
|
+
setDirectoryChildren((prev) => ({ ...prev, [path]: [] }));
|
|
27347
27304
|
} finally {
|
|
27348
|
-
|
|
27305
|
+
setDirectoryLoading((prev) => ({ ...prev, [path]: false }));
|
|
27349
27306
|
}
|
|
27350
|
-
}, [
|
|
27351
|
-
|
|
27352
|
-
|
|
27353
|
-
|
|
27354
|
-
|
|
27355
|
-
|
|
27307
|
+
}, [directoryChildren, directoryExpanded, listPath]);
|
|
27308
|
+
useEffect40(() => {
|
|
27309
|
+
resourceFolders.forEach((folder) => {
|
|
27310
|
+
void loadAssetsForFolder(folder);
|
|
27311
|
+
});
|
|
27312
|
+
}, [resourceFolders, loadAssetsForFolder]);
|
|
27313
|
+
const handleAssetClick = useCallback32((asset) => {
|
|
27314
|
+
const fileUrl = getFileViewUrl(asset.path);
|
|
27315
|
+
if (!fileUrl) {
|
|
27316
|
+
message17.warning("Please select a workspace and project first.");
|
|
27317
|
+
return;
|
|
27356
27318
|
}
|
|
27357
|
-
|
|
27358
|
-
|
|
27359
|
-
|
|
27319
|
+
openSideApp({
|
|
27320
|
+
component_key: "attachments",
|
|
27321
|
+
data: {
|
|
27322
|
+
file_id: asset.path,
|
|
27323
|
+
message: `Preview: ${asset.name || asset.path}`,
|
|
27324
|
+
full_url: fileUrl
|
|
27325
|
+
},
|
|
27326
|
+
message: `Preview: ${asset.name || asset.path}`
|
|
27327
|
+
});
|
|
27328
|
+
}, [getFileViewUrl, openSideApp]);
|
|
27329
|
+
const handleUploadFolder = useCallback32(async (folderName) => {
|
|
27360
27330
|
if (!workspaceId || !projectId) {
|
|
27361
27331
|
message17.warning("Please select a workspace and project before uploading.");
|
|
27362
27332
|
return;
|
|
@@ -27373,7 +27343,7 @@ var ProjectsMenuContent = () => {
|
|
|
27373
27343
|
try {
|
|
27374
27344
|
await uploadFileToFolder(folderName, file);
|
|
27375
27345
|
message17.success(`Uploaded "${file.name}" successfully`);
|
|
27376
|
-
const folder = resourceFolders.find((
|
|
27346
|
+
const folder = resourceFolders.find((item) => item.name === folderName);
|
|
27377
27347
|
if (folder) {
|
|
27378
27348
|
await loadAssetsForFolder(folder);
|
|
27379
27349
|
}
|
|
@@ -27386,143 +27356,232 @@ var ProjectsMenuContent = () => {
|
|
|
27386
27356
|
}
|
|
27387
27357
|
};
|
|
27388
27358
|
input.click();
|
|
27389
|
-
};
|
|
27390
|
-
|
|
27391
|
-
|
|
27392
|
-
|
|
27393
|
-
|
|
27394
|
-
|
|
27359
|
+
}, [workspaceId, projectId, uploadFileToFolder, resourceFolders, loadAssetsForFolder]);
|
|
27360
|
+
return /* @__PURE__ */ jsx106(
|
|
27361
|
+
FileDirectoryPanel,
|
|
27362
|
+
{
|
|
27363
|
+
workspaceId,
|
|
27364
|
+
projectId,
|
|
27365
|
+
resourceFolders,
|
|
27366
|
+
folderEntries,
|
|
27367
|
+
folderLoading,
|
|
27368
|
+
directoryChildren,
|
|
27369
|
+
directoryLoading,
|
|
27370
|
+
directoryExpanded,
|
|
27371
|
+
uploadingFolder,
|
|
27372
|
+
onRefreshFolder: loadAssetsForFolder,
|
|
27373
|
+
onUploadFolder: handleUploadFolder,
|
|
27374
|
+
onToggleDirectory: handleToggleDirectory,
|
|
27375
|
+
onAssetClick: handleAssetClick
|
|
27395
27376
|
}
|
|
27396
|
-
|
|
27397
|
-
|
|
27398
|
-
|
|
27399
|
-
|
|
27400
|
-
|
|
27401
|
-
|
|
27402
|
-
|
|
27403
|
-
|
|
27404
|
-
|
|
27405
|
-
|
|
27406
|
-
|
|
27407
|
-
|
|
27408
|
-
|
|
27409
|
-
|
|
27410
|
-
|
|
27411
|
-
|
|
27412
|
-
|
|
27413
|
-
|
|
27414
|
-
|
|
27415
|
-
|
|
27416
|
-
|
|
27417
|
-
|
|
27418
|
-
|
|
27419
|
-
|
|
27420
|
-
|
|
27421
|
-
|
|
27422
|
-
|
|
27423
|
-
|
|
27424
|
-
|
|
27425
|
-
|
|
27426
|
-
|
|
27427
|
-
|
|
27428
|
-
|
|
27429
|
-
|
|
27430
|
-
|
|
27431
|
-
|
|
27432
|
-
|
|
27433
|
-
|
|
27434
|
-
|
|
27435
|
-
|
|
27436
|
-
|
|
27437
|
-
|
|
27438
|
-
|
|
27439
|
-
|
|
27440
|
-
|
|
27441
|
-
|
|
27442
|
-
|
|
27443
|
-
|
|
27444
|
-
|
|
27445
|
-
|
|
27446
|
-
|
|
27447
|
-
|
|
27448
|
-
|
|
27449
|
-
|
|
27450
|
-
|
|
27451
|
-
|
|
27452
|
-
|
|
27453
|
-
|
|
27454
|
-
|
|
27455
|
-
|
|
27456
|
-
|
|
27457
|
-
|
|
27458
|
-
|
|
27459
|
-
|
|
27460
|
-
|
|
27461
|
-
|
|
27462
|
-
|
|
27463
|
-
|
|
27464
|
-
|
|
27465
|
-
|
|
27466
|
-
|
|
27467
|
-
|
|
27468
|
-
|
|
27469
|
-
|
|
27470
|
-
|
|
27471
|
-
|
|
27472
|
-
|
|
27473
|
-
|
|
27474
|
-
|
|
27475
|
-
|
|
27476
|
-
|
|
27477
|
-
|
|
27478
|
-
|
|
27479
|
-
|
|
27480
|
-
|
|
27481
|
-
|
|
27482
|
-
|
|
27483
|
-
|
|
27484
|
-
|
|
27485
|
-
|
|
27486
|
-
|
|
27487
|
-
|
|
27488
|
-
|
|
27489
|
-
|
|
27490
|
-
|
|
27491
|
-
|
|
27492
|
-
|
|
27493
|
-
|
|
27494
|
-
|
|
27495
|
-
|
|
27496
|
-
|
|
27497
|
-
|
|
27498
|
-
|
|
27499
|
-
|
|
27500
|
-
|
|
27501
|
-
|
|
27502
|
-
|
|
27503
|
-
|
|
27504
|
-
|
|
27505
|
-
onChange: handleProjectNameChange,
|
|
27506
|
-
onKeyDown: handleModalKeyDown,
|
|
27507
|
-
maxLength: PROJECT_NAME_MAX_LENGTH2,
|
|
27508
|
-
status: validationError ? "error" : void 0,
|
|
27509
|
-
disabled: isCreating
|
|
27510
|
-
}
|
|
27511
|
-
),
|
|
27512
|
-
validationError && /* @__PURE__ */ jsx107("div", { className: styles.formError, role: "alert", children: validationError })
|
|
27513
|
-
]
|
|
27377
|
+
);
|
|
27378
|
+
};
|
|
27379
|
+
|
|
27380
|
+
// src/components/Chat/HeaderIconButton.tsx
|
|
27381
|
+
import { Button as Button49 } from "antd";
|
|
27382
|
+
import { createStyles as createStyles33 } from "antd-style";
|
|
27383
|
+
import { jsx as jsx107 } from "react/jsx-runtime";
|
|
27384
|
+
var useStyles20 = createStyles33(({ token, css }) => ({
|
|
27385
|
+
button: css`
|
|
27386
|
+
display: inline-flex;
|
|
27387
|
+
align-items: center;
|
|
27388
|
+
justify-content: center;
|
|
27389
|
+
width: 32px;
|
|
27390
|
+
height: 32px;
|
|
27391
|
+
border-radius: 8px;
|
|
27392
|
+
border: 1px solid transparent;
|
|
27393
|
+
background: transparent;
|
|
27394
|
+
color: inherit;
|
|
27395
|
+
transition: all 0.2s ease;
|
|
27396
|
+
|
|
27397
|
+
&:hover {
|
|
27398
|
+
background: ${token.colorBgTextHover};
|
|
27399
|
+
border-color: ${token.colorBorderSecondary};
|
|
27400
|
+
}
|
|
27401
|
+
|
|
27402
|
+
&[aria-pressed="true"] {
|
|
27403
|
+
background: ${token.colorBgTextHover};
|
|
27404
|
+
border-color: ${token.colorBorderSecondary};
|
|
27405
|
+
}
|
|
27406
|
+
`
|
|
27407
|
+
}));
|
|
27408
|
+
var HeaderIconButton = ({
|
|
27409
|
+
ariaLabel,
|
|
27410
|
+
icon,
|
|
27411
|
+
onClick,
|
|
27412
|
+
pressed = false
|
|
27413
|
+
}) => {
|
|
27414
|
+
const { styles } = useStyles20();
|
|
27415
|
+
return /* @__PURE__ */ jsx107(
|
|
27416
|
+
Button49,
|
|
27417
|
+
{
|
|
27418
|
+
type: "text",
|
|
27419
|
+
size: "small",
|
|
27420
|
+
className: styles.button,
|
|
27421
|
+
icon,
|
|
27422
|
+
onClick,
|
|
27423
|
+
"aria-label": ariaLabel,
|
|
27424
|
+
"aria-pressed": pressed
|
|
27425
|
+
}
|
|
27426
|
+
);
|
|
27427
|
+
};
|
|
27428
|
+
|
|
27429
|
+
// src/components/Chat/LatticeChat.tsx
|
|
27430
|
+
import { jsx as jsx108, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
27431
|
+
var useStyles21 = createStyles34(({ css }) => ({
|
|
27432
|
+
wrapper: css`
|
|
27433
|
+
display: flex;
|
|
27434
|
+
flex-direction: column;
|
|
27435
|
+
width: 100%;
|
|
27436
|
+
height: 100%;
|
|
27437
|
+
`,
|
|
27438
|
+
headerBar: css`
|
|
27439
|
+
display: flex;
|
|
27440
|
+
align-items: center;
|
|
27441
|
+
justify-content: space-between;
|
|
27442
|
+
gap: 12px;
|
|
27443
|
+
width: 100%;
|
|
27444
|
+
`,
|
|
27445
|
+
headerLeft: css`
|
|
27446
|
+
display: flex;
|
|
27447
|
+
align-items: center;
|
|
27448
|
+
min-width: 0;
|
|
27449
|
+
flex: 1;
|
|
27450
|
+
`,
|
|
27451
|
+
headerRight: css`
|
|
27452
|
+
display: flex;
|
|
27453
|
+
align-items: center;
|
|
27454
|
+
justify-content: flex-end;
|
|
27455
|
+
flex-shrink: 0;
|
|
27456
|
+
`
|
|
27457
|
+
}));
|
|
27458
|
+
var LatticeChatContent = (props) => {
|
|
27459
|
+
const { assistant_id: _assistantId, thread_id = "", menu, header, ...chatingProps } = props;
|
|
27460
|
+
const { config } = useLatticeChatShellContext();
|
|
27461
|
+
const { styles } = useStyles21();
|
|
27462
|
+
const { toolsVisible, toggleTools } = useChatUIContext();
|
|
27463
|
+
const showWorkspaceSelector = config.enableWorkspace;
|
|
27464
|
+
const layoutHeader = /* @__PURE__ */ jsxs77("div", { className: styles.headerBar, children: [
|
|
27465
|
+
/* @__PURE__ */ jsx108("div", { className: styles.headerLeft, children: showWorkspaceSelector ? /* @__PURE__ */ jsx108(ProjectSelector, {}) : null }),
|
|
27466
|
+
/* @__PURE__ */ jsx108("div", { className: styles.headerRight, children: /* @__PURE__ */ jsx108(
|
|
27467
|
+
HeaderIconButton,
|
|
27468
|
+
{
|
|
27469
|
+
ariaLabel: "Toggle file directory",
|
|
27470
|
+
icon: /* @__PURE__ */ jsx108(FolderOpen4, { size: 16 }),
|
|
27471
|
+
onClick: toggleTools,
|
|
27472
|
+
pressed: toolsVisible
|
|
27473
|
+
}
|
|
27474
|
+
) })
|
|
27475
|
+
] });
|
|
27476
|
+
return /* @__PURE__ */ jsxs77("div", { className: styles.wrapper, children: [
|
|
27477
|
+
header,
|
|
27478
|
+
/* @__PURE__ */ jsx108(
|
|
27479
|
+
ColumnLayout,
|
|
27480
|
+
{
|
|
27481
|
+
menu,
|
|
27482
|
+
header: layoutHeader,
|
|
27483
|
+
main: thread_id ? /* @__PURE__ */ jsx108(Chating, { ...chatingProps }) : /* @__PURE__ */ jsx108("div", { children: "Please create a conversation first" }),
|
|
27484
|
+
detail: /* @__PURE__ */ jsx108(SideAppViewBrowser, {}),
|
|
27485
|
+
tools: /* @__PURE__ */ jsx108(ToolPanelFiles, {})
|
|
27514
27486
|
}
|
|
27515
27487
|
)
|
|
27516
27488
|
] });
|
|
27517
27489
|
};
|
|
27490
|
+
var LatticeChat = (props) => {
|
|
27491
|
+
return /* @__PURE__ */ jsx108(
|
|
27492
|
+
AgentThreadProvider,
|
|
27493
|
+
{
|
|
27494
|
+
assistantId: props.assistant_id,
|
|
27495
|
+
threadId: props.thread_id || "",
|
|
27496
|
+
options: {
|
|
27497
|
+
streaming: true,
|
|
27498
|
+
enableReturnStateWhenStreamCompleted: true,
|
|
27499
|
+
enableResumeStream: true
|
|
27500
|
+
},
|
|
27501
|
+
children: /* @__PURE__ */ jsx108(ChatUIContextProvider, { children: /* @__PURE__ */ jsx108(LatticeChatContent, { ...props }) })
|
|
27502
|
+
}
|
|
27503
|
+
);
|
|
27504
|
+
};
|
|
27505
|
+
|
|
27506
|
+
// src/components/Chat/AgentConversations.tsx
|
|
27507
|
+
import { Conversations } from "@ant-design/x";
|
|
27508
|
+
import { theme as theme14 } from "antd";
|
|
27509
|
+
import { useMemo as useMemo28 } from "react";
|
|
27510
|
+
import { jsx as jsx109 } from "react/jsx-runtime";
|
|
27511
|
+
var AgentConversations = ({
|
|
27512
|
+
enableThreadCreation = true,
|
|
27513
|
+
enableThreadList = true
|
|
27514
|
+
}) => {
|
|
27515
|
+
const { token } = theme14.useToken();
|
|
27516
|
+
const { currentAssistant } = useAssistantContext();
|
|
27517
|
+
const {
|
|
27518
|
+
assistantId,
|
|
27519
|
+
thread,
|
|
27520
|
+
selectThread,
|
|
27521
|
+
createThread,
|
|
27522
|
+
listThreads,
|
|
27523
|
+
threads
|
|
27524
|
+
} = useConversationContext();
|
|
27525
|
+
const style = {
|
|
27526
|
+
width: "100%",
|
|
27527
|
+
background: "transparent",
|
|
27528
|
+
borderRadius: token.borderRadius
|
|
27529
|
+
};
|
|
27530
|
+
const threadItems = useMemo28(() => {
|
|
27531
|
+
return threads || [];
|
|
27532
|
+
}, [threads]);
|
|
27533
|
+
const items = threadItems.map((thread2) => ({
|
|
27534
|
+
key: thread2.id,
|
|
27535
|
+
label: thread2.label
|
|
27536
|
+
}));
|
|
27537
|
+
const newChatClick = async () => {
|
|
27538
|
+
if (!assistantId) {
|
|
27539
|
+
return;
|
|
27540
|
+
}
|
|
27541
|
+
await createThread();
|
|
27542
|
+
};
|
|
27543
|
+
if (!enableThreadList) {
|
|
27544
|
+
return null;
|
|
27545
|
+
}
|
|
27546
|
+
const creation = enableThreadCreation ? {
|
|
27547
|
+
onClick: newChatClick
|
|
27548
|
+
} : void 0;
|
|
27549
|
+
return /* @__PURE__ */ jsx109(
|
|
27550
|
+
Conversations,
|
|
27551
|
+
{
|
|
27552
|
+
creation,
|
|
27553
|
+
items,
|
|
27554
|
+
activeKey: thread?.id,
|
|
27555
|
+
style,
|
|
27556
|
+
groupable: true,
|
|
27557
|
+
onActiveChange: (key) => {
|
|
27558
|
+
selectThread(key);
|
|
27559
|
+
}
|
|
27560
|
+
}
|
|
27561
|
+
);
|
|
27562
|
+
};
|
|
27563
|
+
|
|
27564
|
+
// src/components/Chat/LatticeChatView.tsx
|
|
27565
|
+
import { useContext as useContext11 } from "react";
|
|
27566
|
+
|
|
27567
|
+
// src/components/Chat/ChatSidebar.tsx
|
|
27568
|
+
import { useState as useState66, useMemo as useMemo29, useCallback as useCallback34 } from "react";
|
|
27569
|
+
import { Drawer as Drawer2, Avatar as Avatar13, Popover as Popover3, Button as Button50 } from "antd";
|
|
27570
|
+
import {
|
|
27571
|
+
History,
|
|
27572
|
+
LogOut as LogOut4,
|
|
27573
|
+
PlusCircle,
|
|
27574
|
+
PanelLeftClose as PanelLeftClose2,
|
|
27575
|
+
Key as Key2
|
|
27576
|
+
} from "lucide-react";
|
|
27518
27577
|
|
|
27519
27578
|
// src/components/Chat/ThreadHistoryMenuContent.tsx
|
|
27520
|
-
import
|
|
27521
|
-
import { createStyles as
|
|
27579
|
+
import React61, { useCallback as useCallback33 } from "react";
|
|
27580
|
+
import { createStyles as createStyles35 } from "antd-style";
|
|
27522
27581
|
import { MessageSquare as MessageSquare2, Trash2 as Trash24 } from "lucide-react";
|
|
27523
|
-
import { message as message18, Modal as
|
|
27524
|
-
import { jsx as
|
|
27525
|
-
var
|
|
27582
|
+
import { message as message18, Modal as Modal18 } from "antd";
|
|
27583
|
+
import { jsx as jsx110, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
27584
|
+
var useStyles22 = createStyles35(({ token, css }) => ({
|
|
27526
27585
|
container: css`
|
|
27527
27586
|
padding: 4px;
|
|
27528
27587
|
font-size: 13px;
|
|
@@ -27623,7 +27682,7 @@ var useStyles20 = createStyles33(({ token, css }) => ({
|
|
|
27623
27682
|
`
|
|
27624
27683
|
}));
|
|
27625
27684
|
var ThreadHistoryMenuContent = () => {
|
|
27626
|
-
const { styles } =
|
|
27685
|
+
const { styles } = useStyles22();
|
|
27627
27686
|
const {
|
|
27628
27687
|
threads,
|
|
27629
27688
|
threadId,
|
|
@@ -27634,7 +27693,7 @@ var ThreadHistoryMenuContent = () => {
|
|
|
27634
27693
|
const handleDeleteThread = useCallback33(
|
|
27635
27694
|
async (e, threadIdToDelete) => {
|
|
27636
27695
|
e.stopPropagation();
|
|
27637
|
-
|
|
27696
|
+
Modal18.confirm({
|
|
27638
27697
|
title: "Delete Conversation",
|
|
27639
27698
|
content: "Are you sure you want to delete this conversation? This action cannot be undone.",
|
|
27640
27699
|
okText: "Delete",
|
|
@@ -27652,7 +27711,7 @@ var ThreadHistoryMenuContent = () => {
|
|
|
27652
27711
|
},
|
|
27653
27712
|
[deleteThread]
|
|
27654
27713
|
);
|
|
27655
|
-
const sortedThreads =
|
|
27714
|
+
const sortedThreads = React61.useMemo(() => {
|
|
27656
27715
|
return [...threads].sort((a, b) => {
|
|
27657
27716
|
const dateA = a.updatedAt ? new Date(a.updatedAt).getTime() : 0;
|
|
27658
27717
|
const dateB = b.updatedAt ? new Date(b.updatedAt).getTime() : 0;
|
|
@@ -27660,30 +27719,30 @@ var ThreadHistoryMenuContent = () => {
|
|
|
27660
27719
|
});
|
|
27661
27720
|
}, [threads]);
|
|
27662
27721
|
if (isLoading) {
|
|
27663
|
-
return /* @__PURE__ */
|
|
27722
|
+
return /* @__PURE__ */ jsx110("div", { className: styles.container, children: /* @__PURE__ */ jsx110("div", { className: styles.loading, children: "Loading conversations..." }) });
|
|
27664
27723
|
}
|
|
27665
|
-
return /* @__PURE__ */
|
|
27724
|
+
return /* @__PURE__ */ jsx110("div", { className: styles.container, children: sortedThreads.length === 0 ? /* @__PURE__ */ jsx110("div", { className: styles.emptyState, children: "No conversations yet" }) : /* @__PURE__ */ jsx110("div", { className: styles.threadList, children: sortedThreads.map((thread) => /* @__PURE__ */ jsxs78(
|
|
27666
27725
|
"div",
|
|
27667
27726
|
{
|
|
27668
27727
|
className: `${styles.threadItem} ${thread.id === threadId ? "active" : ""}`,
|
|
27669
27728
|
onClick: () => selectThread(thread.id),
|
|
27670
27729
|
title: thread.label,
|
|
27671
27730
|
children: [
|
|
27672
|
-
/* @__PURE__ */
|
|
27673
|
-
/* @__PURE__ */
|
|
27731
|
+
/* @__PURE__ */ jsx110("div", { className: styles.threadIcon, children: /* @__PURE__ */ jsx110(MessageSquare2, { size: 14 }) }),
|
|
27732
|
+
/* @__PURE__ */ jsx110(
|
|
27674
27733
|
"div",
|
|
27675
27734
|
{
|
|
27676
27735
|
className: thread.id === threadId ? styles.threadNameActive : styles.threadName,
|
|
27677
27736
|
children: thread.label
|
|
27678
27737
|
}
|
|
27679
27738
|
),
|
|
27680
|
-
/* @__PURE__ */
|
|
27739
|
+
/* @__PURE__ */ jsx110(
|
|
27681
27740
|
"button",
|
|
27682
27741
|
{
|
|
27683
27742
|
className: styles.deleteBtn,
|
|
27684
27743
|
onClick: (e) => handleDeleteThread(e, thread.id),
|
|
27685
27744
|
title: "Delete conversation",
|
|
27686
|
-
children: /* @__PURE__ */
|
|
27745
|
+
children: /* @__PURE__ */ jsx110(Trash24, { size: 12 })
|
|
27687
27746
|
}
|
|
27688
27747
|
)
|
|
27689
27748
|
]
|
|
@@ -27693,7 +27752,7 @@ var ThreadHistoryMenuContent = () => {
|
|
|
27693
27752
|
};
|
|
27694
27753
|
|
|
27695
27754
|
// src/components/Chat/ChatSidebar.tsx
|
|
27696
|
-
import { Fragment as
|
|
27755
|
+
import { Fragment as Fragment23, jsx as jsx111, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
27697
27756
|
var DRAWER_STYLES2 = {
|
|
27698
27757
|
wrapper: {
|
|
27699
27758
|
background: "transparent",
|
|
@@ -27719,7 +27778,7 @@ var DEFAULT_MENU_ITEMS = [
|
|
|
27719
27778
|
builtin: "new-analysis",
|
|
27720
27779
|
type: "action",
|
|
27721
27780
|
name: "New Analysis",
|
|
27722
|
-
icon: /* @__PURE__ */
|
|
27781
|
+
icon: /* @__PURE__ */ jsx111(PlusCircle, { size: 20 }),
|
|
27723
27782
|
order: 0
|
|
27724
27783
|
},
|
|
27725
27784
|
// Second: Thread History (inline drawer)
|
|
@@ -27728,28 +27787,15 @@ var DEFAULT_MENU_ITEMS = [
|
|
|
27728
27787
|
builtin: "thread-history",
|
|
27729
27788
|
type: "drawer",
|
|
27730
27789
|
name: "History",
|
|
27731
|
-
icon: /* @__PURE__ */
|
|
27790
|
+
icon: /* @__PURE__ */ jsx111(History, { size: 20 }),
|
|
27732
27791
|
order: 1,
|
|
27733
27792
|
title: "Conversation History",
|
|
27734
27793
|
width: 320,
|
|
27735
27794
|
inline: true,
|
|
27736
|
-
inlineDefaultExpanded: false,
|
|
27737
|
-
content: /* @__PURE__ */ jsx109(ThreadHistoryMenuContent, {})
|
|
27738
|
-
},
|
|
27739
|
-
// Third: Projects (inline drawer)
|
|
27740
|
-
{
|
|
27741
|
-
id: "files",
|
|
27742
|
-
builtin: "projects",
|
|
27743
|
-
type: "drawer",
|
|
27744
|
-
name: "Project Files",
|
|
27745
|
-
icon: /* @__PURE__ */ jsx109(FolderOpen4, {}),
|
|
27746
|
-
order: 2,
|
|
27747
|
-
title: "Project Files",
|
|
27748
|
-
width: 320,
|
|
27749
|
-
inline: true,
|
|
27750
27795
|
inlineDefaultExpanded: true,
|
|
27751
|
-
content: /* @__PURE__ */
|
|
27796
|
+
content: /* @__PURE__ */ jsx111(ThreadHistoryMenuContent, {})
|
|
27752
27797
|
}
|
|
27798
|
+
// Project Files removed - now accessed via header toggle
|
|
27753
27799
|
];
|
|
27754
27800
|
var ChatSidebar = ({
|
|
27755
27801
|
onSettingsClick,
|
|
@@ -27812,18 +27858,16 @@ var ChatSidebar = ({
|
|
|
27812
27858
|
}, [createThread]);
|
|
27813
27859
|
const renderDrawerContent = useCallback34((item) => {
|
|
27814
27860
|
switch (item.builtin) {
|
|
27815
|
-
case "projects":
|
|
27816
|
-
return /* @__PURE__ */ jsx109(ProjectsMenuContent, {});
|
|
27817
27861
|
case "thread-history":
|
|
27818
|
-
return /* @__PURE__ */
|
|
27862
|
+
return /* @__PURE__ */ jsx111(ThreadHistoryMenuContent, {});
|
|
27819
27863
|
default:
|
|
27820
27864
|
return item.content;
|
|
27821
27865
|
}
|
|
27822
27866
|
}, []);
|
|
27823
27867
|
const userMenuItems = /* @__PURE__ */ jsxs79("div", { style: { minWidth: 160 }, children: [
|
|
27824
27868
|
/* @__PURE__ */ jsxs79("div", { style: { padding: "8px 12px", borderBottom: "1px solid #f0f0f0" }, children: [
|
|
27825
|
-
/* @__PURE__ */
|
|
27826
|
-
/* @__PURE__ */
|
|
27869
|
+
/* @__PURE__ */ jsx111("div", { style: { fontWeight: 500 }, children: user?.name || user?.email }),
|
|
27870
|
+
/* @__PURE__ */ jsx111("div", { style: { fontSize: 12, color: "#666" }, children: user?.email })
|
|
27827
27871
|
] }),
|
|
27828
27872
|
/* @__PURE__ */ jsxs79(
|
|
27829
27873
|
Button50,
|
|
@@ -27833,7 +27877,7 @@ var ChatSidebar = ({
|
|
|
27833
27877
|
style: { justifyContent: "flex-start", padding: "8px 12px" },
|
|
27834
27878
|
onClick: () => setChangePasswordOpen(true),
|
|
27835
27879
|
children: [
|
|
27836
|
-
/* @__PURE__ */
|
|
27880
|
+
/* @__PURE__ */ jsx111(Key2, { size: 16, style: { marginRight: 8 } }),
|
|
27837
27881
|
"Change Password"
|
|
27838
27882
|
]
|
|
27839
27883
|
}
|
|
@@ -27847,14 +27891,14 @@ var ChatSidebar = ({
|
|
|
27847
27891
|
style: { justifyContent: "flex-start", padding: "8px 12px" },
|
|
27848
27892
|
onClick: logout,
|
|
27849
27893
|
children: [
|
|
27850
|
-
/* @__PURE__ */
|
|
27894
|
+
/* @__PURE__ */ jsx111(LogOut4, { size: 16, style: { marginRight: 8 } }),
|
|
27851
27895
|
"Logout"
|
|
27852
27896
|
]
|
|
27853
27897
|
}
|
|
27854
27898
|
)
|
|
27855
27899
|
] });
|
|
27856
|
-
return /* @__PURE__ */ jsxs79(
|
|
27857
|
-
/* @__PURE__ */
|
|
27900
|
+
return /* @__PURE__ */ jsxs79(Fragment23, { children: [
|
|
27901
|
+
/* @__PURE__ */ jsx111(
|
|
27858
27902
|
Menu,
|
|
27859
27903
|
{
|
|
27860
27904
|
items: menuItems,
|
|
@@ -27868,7 +27912,7 @@ var ChatSidebar = ({
|
|
|
27868
27912
|
forceIconMode: sideAppVisible,
|
|
27869
27913
|
collapsed: menuCollapsed,
|
|
27870
27914
|
onCollapsedChange: setMenuCollapsed,
|
|
27871
|
-
footer: ({ isIconMode }) => user && /* @__PURE__ */
|
|
27915
|
+
footer: ({ isIconMode }) => user && /* @__PURE__ */ jsx111(
|
|
27872
27916
|
Popover3,
|
|
27873
27917
|
{
|
|
27874
27918
|
content: userMenuItems,
|
|
@@ -27888,7 +27932,7 @@ var ChatSidebar = ({
|
|
|
27888
27932
|
transition: "all 0.2s"
|
|
27889
27933
|
},
|
|
27890
27934
|
children: [
|
|
27891
|
-
/* @__PURE__ */
|
|
27935
|
+
/* @__PURE__ */ jsx111(
|
|
27892
27936
|
Avatar13,
|
|
27893
27937
|
{
|
|
27894
27938
|
size: isIconMode ? 32 : 36,
|
|
@@ -27901,7 +27945,7 @@ var ChatSidebar = ({
|
|
|
27901
27945
|
}
|
|
27902
27946
|
),
|
|
27903
27947
|
!isIconMode && /* @__PURE__ */ jsxs79("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
27904
|
-
/* @__PURE__ */
|
|
27948
|
+
/* @__PURE__ */ jsx111(
|
|
27905
27949
|
"div",
|
|
27906
27950
|
{
|
|
27907
27951
|
style: {
|
|
@@ -27913,7 +27957,7 @@ var ChatSidebar = ({
|
|
|
27913
27957
|
children: user.name || user.email
|
|
27914
27958
|
}
|
|
27915
27959
|
),
|
|
27916
|
-
/* @__PURE__ */
|
|
27960
|
+
/* @__PURE__ */ jsx111(
|
|
27917
27961
|
"div",
|
|
27918
27962
|
{
|
|
27919
27963
|
style: {
|
|
@@ -27934,19 +27978,19 @@ var ChatSidebar = ({
|
|
|
27934
27978
|
)
|
|
27935
27979
|
}
|
|
27936
27980
|
),
|
|
27937
|
-
/* @__PURE__ */
|
|
27981
|
+
/* @__PURE__ */ jsx111(
|
|
27938
27982
|
ChangePasswordModal,
|
|
27939
27983
|
{
|
|
27940
27984
|
open: changePasswordOpen,
|
|
27941
27985
|
onClose: () => setChangePasswordOpen(false)
|
|
27942
27986
|
}
|
|
27943
27987
|
),
|
|
27944
|
-
menuItems.filter((item) => item.type === "drawer" && !item.inline).map((item) => /* @__PURE__ */
|
|
27988
|
+
menuItems.filter((item) => item.type === "drawer" && !item.inline).map((item) => /* @__PURE__ */ jsx111(
|
|
27945
27989
|
Drawer2,
|
|
27946
27990
|
{
|
|
27947
27991
|
title: /* @__PURE__ */ jsxs79("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" }, children: [
|
|
27948
|
-
/* @__PURE__ */
|
|
27949
|
-
/* @__PURE__ */
|
|
27992
|
+
/* @__PURE__ */ jsx111("span", { style: { fontSize: 16, fontWeight: 600, textTransform: "uppercase", letterSpacing: 0.5 }, children: item.title || item.name }),
|
|
27993
|
+
/* @__PURE__ */ jsx111(
|
|
27950
27994
|
"button",
|
|
27951
27995
|
{
|
|
27952
27996
|
onClick: () => handleCloseDrawer(item.id),
|
|
@@ -27961,7 +28005,7 @@ var ChatSidebar = ({
|
|
|
27961
28005
|
background: "rgba(255, 255, 255, 0.5)",
|
|
27962
28006
|
cursor: "pointer"
|
|
27963
28007
|
},
|
|
27964
|
-
children: /* @__PURE__ */
|
|
28008
|
+
children: /* @__PURE__ */ jsx111(PanelLeftClose2, { size: 24 })
|
|
27965
28009
|
}
|
|
27966
28010
|
)
|
|
27967
28011
|
] }),
|
|
@@ -27992,7 +28036,7 @@ var ChatSidebar = ({
|
|
|
27992
28036
|
};
|
|
27993
28037
|
|
|
27994
28038
|
// src/components/Chat/LatticeChatView.tsx
|
|
27995
|
-
import { jsx as
|
|
28039
|
+
import { jsx as jsx112 } from "react/jsx-runtime";
|
|
27996
28040
|
var LatticeChatView = (props) => {
|
|
27997
28041
|
const shellContext = useContext11(LatticeChatShellContext);
|
|
27998
28042
|
const { showSideMenu, sideMenuItems } = shellContext.config;
|
|
@@ -28001,7 +28045,7 @@ var LatticeChatView = (props) => {
|
|
|
28001
28045
|
const {
|
|
28002
28046
|
config: { baseURL }
|
|
28003
28047
|
} = useLatticeChatShellContext();
|
|
28004
|
-
return assistantId && thread ? /* @__PURE__ */
|
|
28048
|
+
return assistantId && thread ? /* @__PURE__ */ jsx112(
|
|
28005
28049
|
AxiomLatticeProvider,
|
|
28006
28050
|
{
|
|
28007
28051
|
config: {
|
|
@@ -28010,14 +28054,14 @@ var LatticeChatView = (props) => {
|
|
|
28010
28054
|
assistantId,
|
|
28011
28055
|
transport: "sse"
|
|
28012
28056
|
},
|
|
28013
|
-
children: /* @__PURE__ */
|
|
28057
|
+
children: /* @__PURE__ */ jsx112(
|
|
28014
28058
|
LatticeChat,
|
|
28015
28059
|
{
|
|
28016
28060
|
thread_id: thread?.id,
|
|
28017
28061
|
assistant_id: assistantId,
|
|
28018
28062
|
name: currentAssistant?.name,
|
|
28019
28063
|
description: currentAssistant?.description,
|
|
28020
|
-
menu: showSideMenu ? /* @__PURE__ */
|
|
28064
|
+
menu: showSideMenu ? /* @__PURE__ */ jsx112(ChatSidebar, { customMenuItems: sideMenuItems }) : void 0
|
|
28021
28065
|
}
|
|
28022
28066
|
)
|
|
28023
28067
|
}
|
|
@@ -28025,10 +28069,10 @@ var LatticeChatView = (props) => {
|
|
|
28025
28069
|
};
|
|
28026
28070
|
|
|
28027
28071
|
// src/components/Chat/SettingsModal.tsx
|
|
28028
|
-
import { useState as useState67, useEffect as useEffect41, useRef as
|
|
28072
|
+
import { useState as useState67, useEffect as useEffect41, useRef as useRef25 } from "react";
|
|
28029
28073
|
import {
|
|
28030
|
-
Modal as
|
|
28031
|
-
Input as
|
|
28074
|
+
Modal as Modal19,
|
|
28075
|
+
Input as Input14,
|
|
28032
28076
|
Button as Button51,
|
|
28033
28077
|
message as message19,
|
|
28034
28078
|
notification as notification5,
|
|
@@ -28051,11 +28095,11 @@ import {
|
|
|
28051
28095
|
PlusOutlined as PlusOutlined7,
|
|
28052
28096
|
CloudServerOutlined
|
|
28053
28097
|
} from "@ant-design/icons";
|
|
28054
|
-
import { createStyles as
|
|
28055
|
-
import { Fragment as
|
|
28098
|
+
import { createStyles as createStyles36 } from "antd-style";
|
|
28099
|
+
import { Fragment as Fragment24, jsx as jsx113, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
28056
28100
|
var { Text: Text37, Title: Title13 } = Typography48;
|
|
28057
|
-
var { TextArea: TextArea8 } =
|
|
28058
|
-
var
|
|
28101
|
+
var { TextArea: TextArea8 } = Input14;
|
|
28102
|
+
var useStyles23 = createStyles36(({ token, css }) => ({
|
|
28059
28103
|
// settingsModal: css`
|
|
28060
28104
|
// .ant-modal {
|
|
28061
28105
|
// max-width: 100vw !important;
|
|
@@ -28400,19 +28444,19 @@ var SETTINGS_MENU_ITEMS = [
|
|
|
28400
28444
|
{
|
|
28401
28445
|
key: "environment",
|
|
28402
28446
|
label: "Environment Variables",
|
|
28403
|
-
icon: /* @__PURE__ */
|
|
28447
|
+
icon: /* @__PURE__ */ jsx113(EnvironmentOutlined, {})
|
|
28404
28448
|
},
|
|
28405
28449
|
{
|
|
28406
28450
|
key: "models",
|
|
28407
28451
|
label: "Model Configuration",
|
|
28408
|
-
icon: /* @__PURE__ */
|
|
28452
|
+
icon: /* @__PURE__ */ jsx113(ApiOutlined, {})
|
|
28409
28453
|
}
|
|
28410
28454
|
];
|
|
28411
28455
|
var SettingsModal = ({
|
|
28412
28456
|
open,
|
|
28413
28457
|
onClose
|
|
28414
28458
|
}) => {
|
|
28415
|
-
const { styles } =
|
|
28459
|
+
const { styles } = useStyles23();
|
|
28416
28460
|
const { config: shellConfig, updateConfigValue } = useLatticeChatShellContext();
|
|
28417
28461
|
const [connections, setConnections] = useState67(() => {
|
|
28418
28462
|
if (typeof window !== "undefined") {
|
|
@@ -28438,7 +28482,7 @@ var SettingsModal = ({
|
|
|
28438
28482
|
return [];
|
|
28439
28483
|
});
|
|
28440
28484
|
const [serverConfigs, setServerConfigs] = useState67({});
|
|
28441
|
-
const connectionsRef =
|
|
28485
|
+
const connectionsRef = useRef25(connections);
|
|
28442
28486
|
useEffect41(() => {
|
|
28443
28487
|
connectionsRef.current = connections;
|
|
28444
28488
|
}, [connections]);
|
|
@@ -28862,24 +28906,24 @@ var SettingsModal = ({
|
|
|
28862
28906
|
}));
|
|
28863
28907
|
};
|
|
28864
28908
|
return /* @__PURE__ */ jsxs80("div", { className: styles.formContainer, children: [
|
|
28865
|
-
/* @__PURE__ */
|
|
28909
|
+
/* @__PURE__ */ jsx113(
|
|
28866
28910
|
Alert9,
|
|
28867
28911
|
{
|
|
28868
28912
|
message: "Configuration Effect",
|
|
28869
28913
|
description: /* @__PURE__ */ jsxs80("div", { children: [
|
|
28870
28914
|
/* @__PURE__ */ jsxs80("div", { style: { marginBottom: 8 }, children: [
|
|
28871
|
-
/* @__PURE__ */
|
|
28915
|
+
/* @__PURE__ */ jsx113(
|
|
28872
28916
|
CheckCircleOutlined8,
|
|
28873
28917
|
{
|
|
28874
28918
|
style: { color: "#52c41a", marginRight: 8 }
|
|
28875
28919
|
}
|
|
28876
28920
|
),
|
|
28877
|
-
/* @__PURE__ */
|
|
28921
|
+
/* @__PURE__ */ jsx113("strong", { children: "Immediately effective:" }),
|
|
28878
28922
|
" QUEUE_SERVICE_TYPE, REDIS_URL, REDIS_PASSWORD, QUEUE_NAME"
|
|
28879
28923
|
] }),
|
|
28880
28924
|
/* @__PURE__ */ jsxs80("div", { children: [
|
|
28881
|
-
/* @__PURE__ */
|
|
28882
|
-
/* @__PURE__ */
|
|
28925
|
+
/* @__PURE__ */ jsx113(ReloadOutlined4, { style: { color: "#faad14", marginRight: 8 } }),
|
|
28926
|
+
/* @__PURE__ */ jsx113("strong", { children: "Requires restart:" }),
|
|
28883
28927
|
" PORT (server must be restarted to change port)"
|
|
28884
28928
|
] })
|
|
28885
28929
|
] }),
|
|
@@ -28888,8 +28932,8 @@ var SettingsModal = ({
|
|
|
28888
28932
|
className: styles.alertCard
|
|
28889
28933
|
}
|
|
28890
28934
|
),
|
|
28891
|
-
/* @__PURE__ */
|
|
28892
|
-
/* @__PURE__ */
|
|
28935
|
+
/* @__PURE__ */ jsx113("div", { style: { marginBottom: 24 }, children: /* @__PURE__ */ jsx113(Text37, { type: "secondary", style: { fontSize: 14, lineHeight: 1.6 }, children: "Configure environment variables in .env format (key=value). One variable per line. Leave password fields empty to keep current values." }) }),
|
|
28936
|
+
/* @__PURE__ */ jsx113(
|
|
28893
28937
|
TextArea8,
|
|
28894
28938
|
{
|
|
28895
28939
|
value: config.envText,
|
|
@@ -28967,7 +29011,7 @@ QUEUE_NAME=tasks`,
|
|
|
28967
29011
|
}
|
|
28968
29012
|
};
|
|
28969
29013
|
return /* @__PURE__ */ jsxs80("div", { className: styles.formContainer, children: [
|
|
28970
|
-
/* @__PURE__ */
|
|
29014
|
+
/* @__PURE__ */ jsx113("div", { style: { marginBottom: 32 }, children: /* @__PURE__ */ jsx113(Text37, { type: "secondary", style: { fontSize: 14, lineHeight: 1.6 }, children: "Configure model lattices. Each model will be registered with the provided key and can be used by agents." }) }),
|
|
28971
29015
|
config.models.map((model, index) => /* @__PURE__ */ jsxs80("div", { className: styles.card, children: [
|
|
28972
29016
|
/* @__PURE__ */ jsxs80(
|
|
28973
29017
|
"div",
|
|
@@ -28999,7 +29043,7 @@ QUEUE_NAME=tasks`,
|
|
|
28999
29043
|
}
|
|
29000
29044
|
)
|
|
29001
29045
|
] }),
|
|
29002
|
-
config.models.length > 1 && /* @__PURE__ */
|
|
29046
|
+
config.models.length > 1 && /* @__PURE__ */ jsx113(
|
|
29003
29047
|
Button51,
|
|
29004
29048
|
{
|
|
29005
29049
|
type: "text",
|
|
@@ -29018,9 +29062,9 @@ QUEUE_NAME=tasks`,
|
|
|
29018
29062
|
),
|
|
29019
29063
|
/* @__PURE__ */ jsxs80(Space37, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
|
|
29020
29064
|
/* @__PURE__ */ jsxs80("div", { children: [
|
|
29021
|
-
/* @__PURE__ */
|
|
29022
|
-
/* @__PURE__ */
|
|
29023
|
-
|
|
29065
|
+
/* @__PURE__ */ jsx113(Text37, { className: styles.formLabel, children: "Key *" }),
|
|
29066
|
+
/* @__PURE__ */ jsx113(
|
|
29067
|
+
Input14,
|
|
29024
29068
|
{
|
|
29025
29069
|
placeholder: "e.g., default, gpt-4, claude",
|
|
29026
29070
|
value: model.key,
|
|
@@ -29028,11 +29072,11 @@ QUEUE_NAME=tasks`,
|
|
|
29028
29072
|
style: { height: 40 }
|
|
29029
29073
|
}
|
|
29030
29074
|
),
|
|
29031
|
-
/* @__PURE__ */
|
|
29075
|
+
/* @__PURE__ */ jsx113(Text37, { className: styles.formDescription, children: "Unique identifier for this model" })
|
|
29032
29076
|
] }),
|
|
29033
29077
|
/* @__PURE__ */ jsxs80("div", { children: [
|
|
29034
|
-
/* @__PURE__ */
|
|
29035
|
-
/* @__PURE__ */
|
|
29078
|
+
/* @__PURE__ */ jsx113(Text37, { className: styles.formLabel, children: "Provider *" }),
|
|
29079
|
+
/* @__PURE__ */ jsx113(
|
|
29036
29080
|
Select7,
|
|
29037
29081
|
{
|
|
29038
29082
|
style: { width: "100%", height: 40 },
|
|
@@ -29049,9 +29093,9 @@ QUEUE_NAME=tasks`,
|
|
|
29049
29093
|
)
|
|
29050
29094
|
] }),
|
|
29051
29095
|
/* @__PURE__ */ jsxs80("div", { children: [
|
|
29052
|
-
/* @__PURE__ */
|
|
29053
|
-
/* @__PURE__ */
|
|
29054
|
-
|
|
29096
|
+
/* @__PURE__ */ jsx113(Text37, { className: styles.formLabel, children: "Model Name *" }),
|
|
29097
|
+
/* @__PURE__ */ jsx113(
|
|
29098
|
+
Input14,
|
|
29055
29099
|
{
|
|
29056
29100
|
placeholder: "e.g., gpt-4, claude-3-opus, kimi-k2-250905",
|
|
29057
29101
|
value: model.model,
|
|
@@ -29061,9 +29105,9 @@ QUEUE_NAME=tasks`,
|
|
|
29061
29105
|
)
|
|
29062
29106
|
] }),
|
|
29063
29107
|
/* @__PURE__ */ jsxs80("div", { children: [
|
|
29064
|
-
/* @__PURE__ */
|
|
29065
|
-
/* @__PURE__ */
|
|
29066
|
-
|
|
29108
|
+
/* @__PURE__ */ jsx113(Text37, { className: styles.formLabel, children: "API Key" }),
|
|
29109
|
+
/* @__PURE__ */ jsx113(
|
|
29110
|
+
Input14.Password,
|
|
29067
29111
|
{
|
|
29068
29112
|
placeholder: "Enter your API key",
|
|
29069
29113
|
value: model.apiKey,
|
|
@@ -29071,12 +29115,12 @@ QUEUE_NAME=tasks`,
|
|
|
29071
29115
|
style: { height: 40 }
|
|
29072
29116
|
}
|
|
29073
29117
|
),
|
|
29074
|
-
/* @__PURE__ */
|
|
29118
|
+
/* @__PURE__ */ jsx113(Text37, { className: styles.formDescription, children: "API key for the model provider. Leave empty to use environment variable." })
|
|
29075
29119
|
] }),
|
|
29076
29120
|
/* @__PURE__ */ jsxs80("div", { children: [
|
|
29077
|
-
/* @__PURE__ */
|
|
29078
|
-
/* @__PURE__ */
|
|
29079
|
-
|
|
29121
|
+
/* @__PURE__ */ jsx113(Text37, { className: styles.formLabel, children: "Base URL" }),
|
|
29122
|
+
/* @__PURE__ */ jsx113(
|
|
29123
|
+
Input14,
|
|
29080
29124
|
{
|
|
29081
29125
|
placeholder: "e.g., https://api.openai.com/v1",
|
|
29082
29126
|
value: model.baseURL,
|
|
@@ -29084,23 +29128,23 @@ QUEUE_NAME=tasks`,
|
|
|
29084
29128
|
style: { height: 40 }
|
|
29085
29129
|
}
|
|
29086
29130
|
),
|
|
29087
|
-
/* @__PURE__ */
|
|
29131
|
+
/* @__PURE__ */ jsx113(Text37, { className: styles.formDescription, children: "Optional custom base URL for the API" })
|
|
29088
29132
|
] }),
|
|
29089
|
-
/* @__PURE__ */
|
|
29090
|
-
/* @__PURE__ */
|
|
29133
|
+
/* @__PURE__ */ jsx113("div", { children: /* @__PURE__ */ jsxs80(Space37, { children: [
|
|
29134
|
+
/* @__PURE__ */ jsx113(
|
|
29091
29135
|
Switch3,
|
|
29092
29136
|
{
|
|
29093
29137
|
checked: model.streaming,
|
|
29094
29138
|
onChange: (checked) => handleModelChange(index, "streaming", checked)
|
|
29095
29139
|
}
|
|
29096
29140
|
),
|
|
29097
|
-
/* @__PURE__ */
|
|
29141
|
+
/* @__PURE__ */ jsx113(Text37, { children: "Enable Streaming" })
|
|
29098
29142
|
] }) }),
|
|
29099
29143
|
/* @__PURE__ */ jsxs80("div", { style: { display: "flex", gap: 20 }, children: [
|
|
29100
29144
|
/* @__PURE__ */ jsxs80("div", { style: { flex: 1 }, children: [
|
|
29101
|
-
/* @__PURE__ */
|
|
29102
|
-
/* @__PURE__ */
|
|
29103
|
-
|
|
29145
|
+
/* @__PURE__ */ jsx113(Text37, { className: styles.formLabel, children: "Max Tokens" }),
|
|
29146
|
+
/* @__PURE__ */ jsx113(
|
|
29147
|
+
Input14,
|
|
29104
29148
|
{
|
|
29105
29149
|
type: "number",
|
|
29106
29150
|
placeholder: "e.g., 4096",
|
|
@@ -29115,9 +29159,9 @@ QUEUE_NAME=tasks`,
|
|
|
29115
29159
|
)
|
|
29116
29160
|
] }),
|
|
29117
29161
|
/* @__PURE__ */ jsxs80("div", { style: { flex: 1 }, children: [
|
|
29118
|
-
/* @__PURE__ */
|
|
29119
|
-
/* @__PURE__ */
|
|
29120
|
-
|
|
29162
|
+
/* @__PURE__ */ jsx113(Text37, { className: styles.formLabel, children: "Temperature" }),
|
|
29163
|
+
/* @__PURE__ */ jsx113(
|
|
29164
|
+
Input14,
|
|
29121
29165
|
{
|
|
29122
29166
|
type: "number",
|
|
29123
29167
|
step: "0.1",
|
|
@@ -29135,7 +29179,7 @@ QUEUE_NAME=tasks`,
|
|
|
29135
29179
|
] })
|
|
29136
29180
|
] })
|
|
29137
29181
|
] }, index)),
|
|
29138
|
-
/* @__PURE__ */
|
|
29182
|
+
/* @__PURE__ */ jsx113(
|
|
29139
29183
|
Button51,
|
|
29140
29184
|
{
|
|
29141
29185
|
type: "dashed",
|
|
@@ -29164,7 +29208,7 @@ QUEUE_NAME=tasks`,
|
|
|
29164
29208
|
const currentConnection = connections.find((c) => c.id === activeTabKey);
|
|
29165
29209
|
const renderTabLabel = (connection) => {
|
|
29166
29210
|
return /* @__PURE__ */ jsxs80("div", { style: { display: "flex", alignItems: "center" }, children: [
|
|
29167
|
-
/* @__PURE__ */
|
|
29211
|
+
/* @__PURE__ */ jsx113(
|
|
29168
29212
|
CloudServerOutlined,
|
|
29169
29213
|
{
|
|
29170
29214
|
style: {
|
|
@@ -29173,14 +29217,14 @@ QUEUE_NAME=tasks`,
|
|
|
29173
29217
|
}
|
|
29174
29218
|
}
|
|
29175
29219
|
),
|
|
29176
|
-
/* @__PURE__ */
|
|
29177
|
-
connection.connected && /* @__PURE__ */
|
|
29220
|
+
/* @__PURE__ */ jsx113("span", { children: connection.name }),
|
|
29221
|
+
connection.connected && /* @__PURE__ */ jsx113(
|
|
29178
29222
|
CheckCircleFilled,
|
|
29179
29223
|
{
|
|
29180
29224
|
style: { color: "#52c41a", fontSize: 12, marginLeft: 8 }
|
|
29181
29225
|
}
|
|
29182
29226
|
),
|
|
29183
|
-
connection.error && !connection.connecting && /* @__PURE__ */
|
|
29227
|
+
connection.error && !connection.connecting && /* @__PURE__ */ jsx113(
|
|
29184
29228
|
CloseCircleFilled,
|
|
29185
29229
|
{
|
|
29186
29230
|
style: { color: "#ff4d4f", fontSize: 12, marginLeft: 8 }
|
|
@@ -29191,15 +29235,15 @@ QUEUE_NAME=tasks`,
|
|
|
29191
29235
|
const tabItems = connections.map((connection) => ({
|
|
29192
29236
|
key: connection.id,
|
|
29193
29237
|
label: renderTabLabel(connection),
|
|
29194
|
-
children: /* @__PURE__ */
|
|
29195
|
-
/* @__PURE__ */
|
|
29238
|
+
children: /* @__PURE__ */ jsx113("div", { className: styles.tabContent, children: connection.connected ? /* @__PURE__ */ jsx113(Fragment24, { children: /* @__PURE__ */ jsxs80("div", { style: { display: "flex", height: "100%" }, children: [
|
|
29239
|
+
/* @__PURE__ */ jsx113("div", { className: styles.sidebar, children: SETTINGS_MENU_ITEMS.map((item) => /* @__PURE__ */ jsxs80(
|
|
29196
29240
|
"div",
|
|
29197
29241
|
{
|
|
29198
29242
|
className: `${styles.menuItem} ${activeMenu === item.key ? "active" : ""}`,
|
|
29199
29243
|
onClick: () => setActiveMenu(item.key),
|
|
29200
29244
|
children: [
|
|
29201
|
-
/* @__PURE__ */
|
|
29202
|
-
/* @__PURE__ */
|
|
29245
|
+
/* @__PURE__ */ jsx113("span", { className: styles.menuItemIcon, children: item.icon }),
|
|
29246
|
+
/* @__PURE__ */ jsx113("span", { className: styles.menuItemText, children: item.label })
|
|
29203
29247
|
]
|
|
29204
29248
|
},
|
|
29205
29249
|
item.key
|
|
@@ -29207,19 +29251,19 @@ QUEUE_NAME=tasks`,
|
|
|
29207
29251
|
/* @__PURE__ */ jsxs80("div", { className: styles.content, children: [
|
|
29208
29252
|
/* @__PURE__ */ jsxs80("div", { className: styles.contentHeader, children: [
|
|
29209
29253
|
/* @__PURE__ */ jsxs80("div", { className: styles.contentHeaderLeft, children: [
|
|
29210
|
-
/* @__PURE__ */
|
|
29254
|
+
/* @__PURE__ */ jsx113(Title13, { level: 3, className: styles.contentTitle, children: activeMenuItem?.label }),
|
|
29211
29255
|
/* @__PURE__ */ jsxs80(Text37, { className: styles.contentDescription, children: [
|
|
29212
29256
|
activeMenu === "environment" && "Manage environment variables for the gateway server",
|
|
29213
29257
|
activeMenu === "models" && "Configure and register model lattices for use by agents"
|
|
29214
29258
|
] })
|
|
29215
29259
|
] }),
|
|
29216
29260
|
/* @__PURE__ */ jsxs80("div", { className: styles.contentHeaderRight, children: [
|
|
29217
|
-
/* @__PURE__ */
|
|
29218
|
-
/* @__PURE__ */
|
|
29261
|
+
/* @__PURE__ */ jsx113(Button51, { onClick: onClose, children: "Cancel" }),
|
|
29262
|
+
/* @__PURE__ */ jsx113(
|
|
29219
29263
|
Button51,
|
|
29220
29264
|
{
|
|
29221
29265
|
type: "primary",
|
|
29222
|
-
icon: /* @__PURE__ */
|
|
29266
|
+
icon: /* @__PURE__ */ jsx113(SaveOutlined2, {}),
|
|
29223
29267
|
onClick: handleSave,
|
|
29224
29268
|
loading,
|
|
29225
29269
|
children: "Save Configuration"
|
|
@@ -29227,9 +29271,9 @@ QUEUE_NAME=tasks`,
|
|
|
29227
29271
|
)
|
|
29228
29272
|
] })
|
|
29229
29273
|
] }),
|
|
29230
|
-
/* @__PURE__ */
|
|
29274
|
+
/* @__PURE__ */ jsx113("div", { className: styles.contentBody, children: renderContent(connection.id) })
|
|
29231
29275
|
] })
|
|
29232
|
-
] }) }) : /* @__PURE__ */
|
|
29276
|
+
] }) }) : /* @__PURE__ */ jsx113(
|
|
29233
29277
|
"div",
|
|
29234
29278
|
{
|
|
29235
29279
|
style: {
|
|
@@ -29241,17 +29285,17 @@ QUEUE_NAME=tasks`,
|
|
|
29241
29285
|
gap: 16,
|
|
29242
29286
|
padding: 48
|
|
29243
29287
|
},
|
|
29244
|
-
children: connection.connecting ? /* @__PURE__ */ jsxs80(
|
|
29245
|
-
/* @__PURE__ */
|
|
29246
|
-
/* @__PURE__ */
|
|
29288
|
+
children: connection.connecting ? /* @__PURE__ */ jsxs80(Fragment24, { children: [
|
|
29289
|
+
/* @__PURE__ */ jsx113(LinkOutlined2, { style: { fontSize: 64, color: "#1890ff" }, spin: true }),
|
|
29290
|
+
/* @__PURE__ */ jsx113(Title13, { level: 4, children: "Connecting..." }),
|
|
29247
29291
|
/* @__PURE__ */ jsxs80(Text37, { type: "secondary", style: { textAlign: "center" }, children: [
|
|
29248
29292
|
"Connecting to ",
|
|
29249
29293
|
connection.url
|
|
29250
29294
|
] })
|
|
29251
|
-
] }) : /* @__PURE__ */ jsxs80(
|
|
29252
|
-
/* @__PURE__ */
|
|
29253
|
-
/* @__PURE__ */
|
|
29254
|
-
/* @__PURE__ */
|
|
29295
|
+
] }) : /* @__PURE__ */ jsxs80(Fragment24, { children: [
|
|
29296
|
+
/* @__PURE__ */ jsx113(LinkOutlined2, { style: { fontSize: 64, color: "#d9d9d9" } }),
|
|
29297
|
+
/* @__PURE__ */ jsx113(Title13, { level: 4, type: "secondary", children: connection.error || "Not Connected" }),
|
|
29298
|
+
/* @__PURE__ */ jsx113(
|
|
29255
29299
|
Text37,
|
|
29256
29300
|
{
|
|
29257
29301
|
type: "secondary",
|
|
@@ -29259,11 +29303,11 @@ QUEUE_NAME=tasks`,
|
|
|
29259
29303
|
children: connection.error ? `Failed to connect to ${connection.url}. Please check the server URL and try again.` : `Click "Reconnect" to connect to ${connection.url}`
|
|
29260
29304
|
}
|
|
29261
29305
|
),
|
|
29262
|
-
/* @__PURE__ */
|
|
29306
|
+
/* @__PURE__ */ jsx113(
|
|
29263
29307
|
Button51,
|
|
29264
29308
|
{
|
|
29265
29309
|
type: "primary",
|
|
29266
|
-
icon: /* @__PURE__ */
|
|
29310
|
+
icon: /* @__PURE__ */ jsx113(LinkOutlined2, {}),
|
|
29267
29311
|
onClick: () => checkConnection(connection.id),
|
|
29268
29312
|
loading: connection.connecting,
|
|
29269
29313
|
style: { marginTop: 16 },
|
|
@@ -29275,9 +29319,9 @@ QUEUE_NAME=tasks`,
|
|
|
29275
29319
|
) }),
|
|
29276
29320
|
closable: connections.length > 1
|
|
29277
29321
|
}));
|
|
29278
|
-
return /* @__PURE__ */ jsxs80(
|
|
29279
|
-
/* @__PURE__ */
|
|
29280
|
-
|
|
29322
|
+
return /* @__PURE__ */ jsxs80(Fragment24, { children: [
|
|
29323
|
+
/* @__PURE__ */ jsx113(
|
|
29324
|
+
Modal19,
|
|
29281
29325
|
{
|
|
29282
29326
|
open,
|
|
29283
29327
|
onCancel: onClose,
|
|
@@ -29285,7 +29329,7 @@ QUEUE_NAME=tasks`,
|
|
|
29285
29329
|
width: "80%",
|
|
29286
29330
|
footer: null,
|
|
29287
29331
|
title: "Settings",
|
|
29288
|
-
children: /* @__PURE__ */
|
|
29332
|
+
children: /* @__PURE__ */ jsx113("div", { children: /* @__PURE__ */ jsx113(
|
|
29289
29333
|
Tabs3,
|
|
29290
29334
|
{
|
|
29291
29335
|
activeKey: activeTabKey,
|
|
@@ -29309,8 +29353,8 @@ QUEUE_NAME=tasks`,
|
|
|
29309
29353
|
padding: "4px 8px"
|
|
29310
29354
|
},
|
|
29311
29355
|
children: [
|
|
29312
|
-
/* @__PURE__ */
|
|
29313
|
-
/* @__PURE__ */
|
|
29356
|
+
/* @__PURE__ */ jsx113(PlusOutlined7, {}),
|
|
29357
|
+
/* @__PURE__ */ jsx113("span", { children: "Add Server" })
|
|
29314
29358
|
]
|
|
29315
29359
|
}
|
|
29316
29360
|
)
|
|
@@ -29318,8 +29362,8 @@ QUEUE_NAME=tasks`,
|
|
|
29318
29362
|
) })
|
|
29319
29363
|
}
|
|
29320
29364
|
),
|
|
29321
|
-
/* @__PURE__ */
|
|
29322
|
-
|
|
29365
|
+
/* @__PURE__ */ jsx113(
|
|
29366
|
+
Modal19,
|
|
29323
29367
|
{
|
|
29324
29368
|
title: "Add New Server",
|
|
29325
29369
|
open: showAddServerModal,
|
|
@@ -29334,9 +29378,9 @@ QUEUE_NAME=tasks`,
|
|
|
29334
29378
|
className: styles.addServerModal,
|
|
29335
29379
|
children: /* @__PURE__ */ jsxs80(Space37, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
|
|
29336
29380
|
/* @__PURE__ */ jsxs80("div", { children: [
|
|
29337
|
-
/* @__PURE__ */
|
|
29338
|
-
/* @__PURE__ */
|
|
29339
|
-
|
|
29381
|
+
/* @__PURE__ */ jsx113(Text37, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server Name" }),
|
|
29382
|
+
/* @__PURE__ */ jsx113(
|
|
29383
|
+
Input14,
|
|
29340
29384
|
{
|
|
29341
29385
|
placeholder: "e.g., Production Server",
|
|
29342
29386
|
value: newServerName,
|
|
@@ -29344,12 +29388,12 @@ QUEUE_NAME=tasks`,
|
|
|
29344
29388
|
onPressEnter: handleAddServer
|
|
29345
29389
|
}
|
|
29346
29390
|
),
|
|
29347
|
-
/* @__PURE__ */
|
|
29391
|
+
/* @__PURE__ */ jsx113(Text37, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: Leave empty to use URL as name" })
|
|
29348
29392
|
] }),
|
|
29349
29393
|
/* @__PURE__ */ jsxs80("div", { children: [
|
|
29350
|
-
/* @__PURE__ */
|
|
29351
|
-
/* @__PURE__ */
|
|
29352
|
-
|
|
29394
|
+
/* @__PURE__ */ jsx113(Text37, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server URL *" }),
|
|
29395
|
+
/* @__PURE__ */ jsx113(
|
|
29396
|
+
Input14,
|
|
29353
29397
|
{
|
|
29354
29398
|
placeholder: "e.g., http://localhost:4001",
|
|
29355
29399
|
value: newServerUrl,
|
|
@@ -29357,12 +29401,12 @@ QUEUE_NAME=tasks`,
|
|
|
29357
29401
|
onPressEnter: handleAddServer
|
|
29358
29402
|
}
|
|
29359
29403
|
),
|
|
29360
|
-
/* @__PURE__ */
|
|
29404
|
+
/* @__PURE__ */ jsx113(Text37, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Enter the full URL of the gateway server" })
|
|
29361
29405
|
] }),
|
|
29362
29406
|
/* @__PURE__ */ jsxs80("div", { children: [
|
|
29363
|
-
/* @__PURE__ */
|
|
29364
|
-
/* @__PURE__ */
|
|
29365
|
-
|
|
29407
|
+
/* @__PURE__ */ jsx113(Text37, { strong: true, style: { display: "block", marginBottom: 8 }, children: "API Key" }),
|
|
29408
|
+
/* @__PURE__ */ jsx113(
|
|
29409
|
+
Input14.Password,
|
|
29366
29410
|
{
|
|
29367
29411
|
placeholder: "Optional: Enter API key for authentication",
|
|
29368
29412
|
value: newServerApiKey,
|
|
@@ -29370,7 +29414,7 @@ QUEUE_NAME=tasks`,
|
|
|
29370
29414
|
onPressEnter: handleAddServer
|
|
29371
29415
|
}
|
|
29372
29416
|
),
|
|
29373
|
-
/* @__PURE__ */
|
|
29417
|
+
/* @__PURE__ */ jsx113(Text37, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: API key for server authentication" })
|
|
29374
29418
|
] })
|
|
29375
29419
|
] })
|
|
29376
29420
|
}
|
|
@@ -29379,10 +29423,10 @@ QUEUE_NAME=tasks`,
|
|
|
29379
29423
|
};
|
|
29380
29424
|
|
|
29381
29425
|
// src/components/Chat/AgentServerSetting.tsx
|
|
29382
|
-
import { jsx as
|
|
29426
|
+
import { jsx as jsx114 } from "react/jsx-runtime";
|
|
29383
29427
|
var AgentServerSetting = () => {
|
|
29384
29428
|
const { settingsModalOpen, setSettingsModalOpen } = useLatticeChatShellContext();
|
|
29385
|
-
return /* @__PURE__ */
|
|
29429
|
+
return /* @__PURE__ */ jsx114(
|
|
29386
29430
|
SettingsModal,
|
|
29387
29431
|
{
|
|
29388
29432
|
open: settingsModalOpen,
|
|
@@ -29392,24 +29436,24 @@ var AgentServerSetting = () => {
|
|
|
29392
29436
|
};
|
|
29393
29437
|
|
|
29394
29438
|
// src/components/Chat/LatticeChatShell.tsx
|
|
29395
|
-
import { Fragment as
|
|
29439
|
+
import { Fragment as Fragment25, jsx as jsx115, jsxs as jsxs81 } from "react/jsx-runtime";
|
|
29396
29440
|
var ShellContent = ({
|
|
29397
29441
|
initialAssistantId,
|
|
29398
29442
|
enableWorkspace
|
|
29399
29443
|
}) => {
|
|
29400
29444
|
const { currentTenant } = useAuth();
|
|
29401
|
-
return /* @__PURE__ */
|
|
29402
|
-
/* @__PURE__ */
|
|
29403
|
-
/* @__PURE__ */
|
|
29404
|
-
] }) : /* @__PURE__ */ jsxs81(
|
|
29405
|
-
/* @__PURE__ */
|
|
29406
|
-
/* @__PURE__ */
|
|
29445
|
+
return /* @__PURE__ */ jsx115(Fragment25, { children: enableWorkspace ? /* @__PURE__ */ jsxs81(WorkspaceContextProvider, { children: [
|
|
29446
|
+
/* @__PURE__ */ jsx115(AssistantContextProvider, { autoLoad: true, initialAssistantId, children: /* @__PURE__ */ jsx115(ConversationContextProvider, { children: /* @__PURE__ */ jsx115(LatticeChatView, {}) }) }),
|
|
29447
|
+
/* @__PURE__ */ jsx115(AgentServerSetting, {})
|
|
29448
|
+
] }) : /* @__PURE__ */ jsxs81(Fragment25, { children: [
|
|
29449
|
+
/* @__PURE__ */ jsx115(AssistantContextProvider, { autoLoad: true, initialAssistantId, children: /* @__PURE__ */ jsx115(ConversationContextProvider, { children: /* @__PURE__ */ jsx115(LatticeChatView, {}) }) }),
|
|
29450
|
+
/* @__PURE__ */ jsx115(AgentServerSetting, {})
|
|
29407
29451
|
] }) });
|
|
29408
29452
|
};
|
|
29409
29453
|
var LatticeChatShell = (props) => {
|
|
29410
29454
|
const { enableAssistantCreation, enableAssistantEditing, enableWorkspace: enableWorkspaceProp, ...restProps } = props;
|
|
29411
29455
|
const enableWorkspace = enableWorkspaceProp ?? restProps.initialConfig?.enableWorkspace ?? false;
|
|
29412
|
-
return /* @__PURE__ */
|
|
29456
|
+
return /* @__PURE__ */ jsx115(
|
|
29413
29457
|
LatticeChatShellContextProvider,
|
|
29414
29458
|
{
|
|
29415
29459
|
initialConfig: {
|
|
@@ -29418,7 +29462,7 @@ var LatticeChatShell = (props) => {
|
|
|
29418
29462
|
enableWorkspace,
|
|
29419
29463
|
...restProps.initialConfig
|
|
29420
29464
|
},
|
|
29421
|
-
children: /* @__PURE__ */
|
|
29465
|
+
children: /* @__PURE__ */ jsx115(
|
|
29422
29466
|
ShellContent,
|
|
29423
29467
|
{
|
|
29424
29468
|
initialAssistantId: restProps.initialConfig?.assistantId,
|
|
@@ -29428,6 +29472,348 @@ var LatticeChatShell = (props) => {
|
|
|
29428
29472
|
}
|
|
29429
29473
|
);
|
|
29430
29474
|
};
|
|
29475
|
+
|
|
29476
|
+
// src/components/Chat/ChannelInstallationsDrawerContent.tsx
|
|
29477
|
+
import { useEffect as useEffect42, useState as useState68 } from "react";
|
|
29478
|
+
import {
|
|
29479
|
+
Button as Button52,
|
|
29480
|
+
Card as Card23,
|
|
29481
|
+
Form as Form7,
|
|
29482
|
+
Input as Input15,
|
|
29483
|
+
Modal as Modal20,
|
|
29484
|
+
Popconfirm as Popconfirm6,
|
|
29485
|
+
Select as Select8,
|
|
29486
|
+
Spin as Spin16,
|
|
29487
|
+
Tag as Tag22,
|
|
29488
|
+
Typography as Typography49,
|
|
29489
|
+
message as message20
|
|
29490
|
+
} from "antd";
|
|
29491
|
+
import { Edit2 as Edit24, Plus as Plus8, RadioTower, Trash2 as Trash25 } from "lucide-react";
|
|
29492
|
+
import { jsx as jsx116, jsxs as jsxs82 } from "react/jsx-runtime";
|
|
29493
|
+
var { Text: Text38, Title: Title14 } = Typography49;
|
|
29494
|
+
var MAPPING_MODE_OPTIONS = [
|
|
29495
|
+
{ label: "User", value: "user" },
|
|
29496
|
+
{ label: "Group", value: "group" },
|
|
29497
|
+
{ label: "Hybrid", value: "hybrid" }
|
|
29498
|
+
];
|
|
29499
|
+
var ChannelInstallationsDrawerContent = () => {
|
|
29500
|
+
const { get, post, put, del } = useApi();
|
|
29501
|
+
const [installations, setInstallations] = useState68([]);
|
|
29502
|
+
const [loading, setLoading] = useState68(false);
|
|
29503
|
+
const [formModalOpen, setFormModalOpen] = useState68(false);
|
|
29504
|
+
const [editingInstallation, setEditingInstallation] = useState68(null);
|
|
29505
|
+
const loadInstallations = async () => {
|
|
29506
|
+
setLoading(true);
|
|
29507
|
+
try {
|
|
29508
|
+
const result = await get(
|
|
29509
|
+
"/api/channel-installations"
|
|
29510
|
+
);
|
|
29511
|
+
if (result.success) {
|
|
29512
|
+
setInstallations(result.data?.records ?? []);
|
|
29513
|
+
} else {
|
|
29514
|
+
setInstallations([]);
|
|
29515
|
+
message20.error(result.message || "Failed to load channel installations");
|
|
29516
|
+
}
|
|
29517
|
+
} catch (error) {
|
|
29518
|
+
console.error("Failed to load channel installations:", error);
|
|
29519
|
+
setInstallations([]);
|
|
29520
|
+
message20.error("Failed to load channel installations");
|
|
29521
|
+
} finally {
|
|
29522
|
+
setLoading(false);
|
|
29523
|
+
}
|
|
29524
|
+
};
|
|
29525
|
+
useEffect42(() => {
|
|
29526
|
+
loadInstallations();
|
|
29527
|
+
}, []);
|
|
29528
|
+
const handleDelete = async (installation) => {
|
|
29529
|
+
try {
|
|
29530
|
+
const result = await del(
|
|
29531
|
+
`/api/channel-installations/${installation.id}`
|
|
29532
|
+
);
|
|
29533
|
+
if (result.success) {
|
|
29534
|
+
setInstallations(
|
|
29535
|
+
(current) => current.filter((item) => item.id !== installation.id)
|
|
29536
|
+
);
|
|
29537
|
+
message20.success("Installation deleted");
|
|
29538
|
+
} else {
|
|
29539
|
+
message20.error(result.message || "Failed to delete installation");
|
|
29540
|
+
}
|
|
29541
|
+
} catch (error) {
|
|
29542
|
+
console.error("Failed to delete channel installation:", error);
|
|
29543
|
+
message20.error("Failed to delete installation");
|
|
29544
|
+
}
|
|
29545
|
+
};
|
|
29546
|
+
return /* @__PURE__ */ jsxs82("div", { style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
|
|
29547
|
+
/* @__PURE__ */ jsx116("div", { style: { padding: 16 }, children: /* @__PURE__ */ jsxs82(
|
|
29548
|
+
"div",
|
|
29549
|
+
{
|
|
29550
|
+
style: {
|
|
29551
|
+
display: "flex",
|
|
29552
|
+
justifyContent: "space-between",
|
|
29553
|
+
alignItems: "center"
|
|
29554
|
+
},
|
|
29555
|
+
children: [
|
|
29556
|
+
/* @__PURE__ */ jsx116(Title14, { level: 5, style: { margin: 0 }, children: "Channel Installations" }),
|
|
29557
|
+
/* @__PURE__ */ jsx116(
|
|
29558
|
+
Button52,
|
|
29559
|
+
{
|
|
29560
|
+
type: "primary",
|
|
29561
|
+
icon: /* @__PURE__ */ jsx116(Plus8, { size: 16 }),
|
|
29562
|
+
onClick: () => {
|
|
29563
|
+
setEditingInstallation(null);
|
|
29564
|
+
setFormModalOpen(true);
|
|
29565
|
+
},
|
|
29566
|
+
children: "Add Installation"
|
|
29567
|
+
}
|
|
29568
|
+
)
|
|
29569
|
+
]
|
|
29570
|
+
}
|
|
29571
|
+
) }),
|
|
29572
|
+
/* @__PURE__ */ jsx116("div", { style: { flex: 1, overflowY: "auto", padding: 16 }, children: loading ? /* @__PURE__ */ jsx116("div", { style: { display: "flex", justifyContent: "center", padding: 32 }, children: /* @__PURE__ */ jsx116(Spin16, {}) }) : installations.length === 0 ? /* @__PURE__ */ jsxs82(
|
|
29573
|
+
"div",
|
|
29574
|
+
{
|
|
29575
|
+
style: {
|
|
29576
|
+
display: "flex",
|
|
29577
|
+
flexDirection: "column",
|
|
29578
|
+
alignItems: "center",
|
|
29579
|
+
justifyContent: "center",
|
|
29580
|
+
padding: "48px 16px"
|
|
29581
|
+
},
|
|
29582
|
+
children: [
|
|
29583
|
+
/* @__PURE__ */ jsx116(RadioTower, { size: 48, style: { marginBottom: 16, opacity: 0.5 } }),
|
|
29584
|
+
/* @__PURE__ */ jsx116(Text38, { strong: true, style: { fontSize: 15 }, children: "No channel installations" }),
|
|
29585
|
+
/* @__PURE__ */ jsx116(Text38, { type: "secondary", style: { marginTop: 8 }, children: 'Click "Add Installation" to create one' })
|
|
29586
|
+
]
|
|
29587
|
+
}
|
|
29588
|
+
) : /* @__PURE__ */ jsx116("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: installations.map((installation) => {
|
|
29589
|
+
const webhookPath = installation.channel === "lark" ? `/api/channels/lark/installations/${installation.id}/events` : null;
|
|
29590
|
+
return /* @__PURE__ */ jsxs82(Card23, { size: "small", children: [
|
|
29591
|
+
/* @__PURE__ */ jsxs82(
|
|
29592
|
+
"div",
|
|
29593
|
+
{
|
|
29594
|
+
style: {
|
|
29595
|
+
display: "flex",
|
|
29596
|
+
justifyContent: "space-between",
|
|
29597
|
+
alignItems: "flex-start",
|
|
29598
|
+
marginBottom: 10
|
|
29599
|
+
},
|
|
29600
|
+
children: [
|
|
29601
|
+
/* @__PURE__ */ jsx116(Text38, { strong: true, style: { fontSize: 15 }, children: installation.name || installation.id }),
|
|
29602
|
+
/* @__PURE__ */ jsx116(Tag22, { color: "blue", children: installation.channel })
|
|
29603
|
+
]
|
|
29604
|
+
}
|
|
29605
|
+
),
|
|
29606
|
+
/* @__PURE__ */ jsxs82(
|
|
29607
|
+
"div",
|
|
29608
|
+
{
|
|
29609
|
+
style: {
|
|
29610
|
+
display: "flex",
|
|
29611
|
+
flexDirection: "column",
|
|
29612
|
+
gap: 6,
|
|
29613
|
+
marginBottom: 12
|
|
29614
|
+
},
|
|
29615
|
+
children: [
|
|
29616
|
+
/* @__PURE__ */ jsxs82(Text38, { type: "secondary", style: { fontSize: 12 }, children: [
|
|
29617
|
+
"ID: ",
|
|
29618
|
+
installation.id
|
|
29619
|
+
] }),
|
|
29620
|
+
/* @__PURE__ */ jsxs82(Text38, { style: { fontSize: 13 }, children: [
|
|
29621
|
+
"Assistant ID: ",
|
|
29622
|
+
installation.config.assistantId
|
|
29623
|
+
] }),
|
|
29624
|
+
/* @__PURE__ */ jsxs82(Text38, { style: { fontSize: 13 }, children: [
|
|
29625
|
+
"Mapping Mode: ",
|
|
29626
|
+
installation.config.mappingMode
|
|
29627
|
+
] }),
|
|
29628
|
+
installation.config.workspaceId ? /* @__PURE__ */ jsxs82(Text38, { style: { fontSize: 13 }, children: [
|
|
29629
|
+
"Workspace ID: ",
|
|
29630
|
+
installation.config.workspaceId
|
|
29631
|
+
] }) : null,
|
|
29632
|
+
installation.config.projectId ? /* @__PURE__ */ jsxs82(Text38, { style: { fontSize: 13 }, children: [
|
|
29633
|
+
"Project ID: ",
|
|
29634
|
+
installation.config.projectId
|
|
29635
|
+
] }) : null,
|
|
29636
|
+
webhookPath ? /* @__PURE__ */ jsx116(Text38, { code: true, style: { fontSize: 12 }, children: webhookPath }) : /* @__PURE__ */ jsx116(Text38, { type: "secondary", style: { fontSize: 12 }, children: "Unsupported channel configuration UI" })
|
|
29637
|
+
]
|
|
29638
|
+
}
|
|
29639
|
+
),
|
|
29640
|
+
/* @__PURE__ */ jsxs82("div", { style: { display: "flex", gap: 8 }, children: [
|
|
29641
|
+
/* @__PURE__ */ jsx116(
|
|
29642
|
+
Button52,
|
|
29643
|
+
{
|
|
29644
|
+
icon: /* @__PURE__ */ jsx116(Edit24, { size: 14 }),
|
|
29645
|
+
onClick: () => {
|
|
29646
|
+
setEditingInstallation(installation);
|
|
29647
|
+
setFormModalOpen(true);
|
|
29648
|
+
},
|
|
29649
|
+
children: "Edit"
|
|
29650
|
+
}
|
|
29651
|
+
),
|
|
29652
|
+
/* @__PURE__ */ jsx116(
|
|
29653
|
+
Popconfirm6,
|
|
29654
|
+
{
|
|
29655
|
+
title: "Delete Channel Installation",
|
|
29656
|
+
description: `Are you sure you want to delete "${installation.name || installation.id}"?`,
|
|
29657
|
+
onConfirm: () => handleDelete(installation),
|
|
29658
|
+
okText: "Delete",
|
|
29659
|
+
okType: "danger",
|
|
29660
|
+
cancelText: "Cancel",
|
|
29661
|
+
children: /* @__PURE__ */ jsx116(Button52, { danger: true, icon: /* @__PURE__ */ jsx116(Trash25, { size: 14 }), children: "Delete" })
|
|
29662
|
+
}
|
|
29663
|
+
)
|
|
29664
|
+
] })
|
|
29665
|
+
] }, installation.id);
|
|
29666
|
+
}) }) }),
|
|
29667
|
+
formModalOpen ? /* @__PURE__ */ jsx116(
|
|
29668
|
+
LarkChannelInstallationFormModal,
|
|
29669
|
+
{
|
|
29670
|
+
installation: editingInstallation,
|
|
29671
|
+
open: formModalOpen,
|
|
29672
|
+
post,
|
|
29673
|
+
put,
|
|
29674
|
+
onCancel: () => {
|
|
29675
|
+
setFormModalOpen(false);
|
|
29676
|
+
setEditingInstallation(null);
|
|
29677
|
+
},
|
|
29678
|
+
onSave: () => {
|
|
29679
|
+
setFormModalOpen(false);
|
|
29680
|
+
setEditingInstallation(null);
|
|
29681
|
+
loadInstallations();
|
|
29682
|
+
}
|
|
29683
|
+
}
|
|
29684
|
+
) : null
|
|
29685
|
+
] });
|
|
29686
|
+
};
|
|
29687
|
+
var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCancel, onSave }) => {
|
|
29688
|
+
const [form] = Form7.useForm();
|
|
29689
|
+
useEffect42(() => {
|
|
29690
|
+
if (installation) {
|
|
29691
|
+
form.setFieldsValue({
|
|
29692
|
+
name: installation.name,
|
|
29693
|
+
appId: installation.config.appId,
|
|
29694
|
+
appSecret: installation.config.appSecret,
|
|
29695
|
+
verificationToken: installation.config.verificationToken,
|
|
29696
|
+
encryptKey: installation.config.encryptKey,
|
|
29697
|
+
mappingMode: installation.config.mappingMode,
|
|
29698
|
+
assistantId: installation.config.assistantId,
|
|
29699
|
+
workspaceId: installation.config.workspaceId,
|
|
29700
|
+
projectId: installation.config.projectId
|
|
29701
|
+
});
|
|
29702
|
+
return;
|
|
29703
|
+
}
|
|
29704
|
+
form.resetFields();
|
|
29705
|
+
form.setFieldsValue({
|
|
29706
|
+
mappingMode: "hybrid"
|
|
29707
|
+
});
|
|
29708
|
+
}, [installation, form]);
|
|
29709
|
+
const handleSubmit = async () => {
|
|
29710
|
+
const values = await form.validateFields();
|
|
29711
|
+
const config = {
|
|
29712
|
+
appId: values.appId,
|
|
29713
|
+
appSecret: values.appSecret,
|
|
29714
|
+
verificationToken: values.verificationToken,
|
|
29715
|
+
encryptKey: values.encryptKey,
|
|
29716
|
+
mappingMode: values.mappingMode,
|
|
29717
|
+
assistantId: values.assistantId,
|
|
29718
|
+
workspaceId: values.workspaceId,
|
|
29719
|
+
projectId: values.projectId
|
|
29720
|
+
};
|
|
29721
|
+
try {
|
|
29722
|
+
if (installation) {
|
|
29723
|
+
const payload2 = {
|
|
29724
|
+
name: values.name,
|
|
29725
|
+
config
|
|
29726
|
+
};
|
|
29727
|
+
const result2 = await put(
|
|
29728
|
+
`/api/channel-installations/${installation.id}`,
|
|
29729
|
+
payload2
|
|
29730
|
+
);
|
|
29731
|
+
if (result2.success) {
|
|
29732
|
+
message20.success("Installation updated");
|
|
29733
|
+
onSave();
|
|
29734
|
+
} else {
|
|
29735
|
+
message20.error(result2.message || "Failed to update installation");
|
|
29736
|
+
}
|
|
29737
|
+
return;
|
|
29738
|
+
}
|
|
29739
|
+
const payload = {
|
|
29740
|
+
channel: "lark",
|
|
29741
|
+
name: values.name,
|
|
29742
|
+
config
|
|
29743
|
+
};
|
|
29744
|
+
const result = await post(
|
|
29745
|
+
"/api/channel-installations",
|
|
29746
|
+
payload
|
|
29747
|
+
);
|
|
29748
|
+
if (result.success) {
|
|
29749
|
+
message20.success("Installation created");
|
|
29750
|
+
onSave();
|
|
29751
|
+
} else {
|
|
29752
|
+
message20.error(result.message || "Failed to create installation");
|
|
29753
|
+
}
|
|
29754
|
+
} catch (error) {
|
|
29755
|
+
console.error("Failed to save channel installation:", error);
|
|
29756
|
+
message20.error(
|
|
29757
|
+
installation ? "Failed to update installation" : "Failed to create installation"
|
|
29758
|
+
);
|
|
29759
|
+
}
|
|
29760
|
+
};
|
|
29761
|
+
return /* @__PURE__ */ jsx116(
|
|
29762
|
+
Modal20,
|
|
29763
|
+
{
|
|
29764
|
+
open,
|
|
29765
|
+
title: installation ? "Edit Installation" : "Add Installation",
|
|
29766
|
+
onCancel,
|
|
29767
|
+
onOk: handleSubmit,
|
|
29768
|
+
okText: installation ? "Save" : "Create",
|
|
29769
|
+
destroyOnHidden: true,
|
|
29770
|
+
children: /* @__PURE__ */ jsxs82(Form7, { form, layout: "vertical", children: [
|
|
29771
|
+
/* @__PURE__ */ jsx116(Form7.Item, { label: "Channel", children: /* @__PURE__ */ jsx116(Input15, { value: "lark", disabled: true }) }),
|
|
29772
|
+
/* @__PURE__ */ jsx116(Form7.Item, { name: "name", label: "Name", children: /* @__PURE__ */ jsx116(Input15, {}) }),
|
|
29773
|
+
/* @__PURE__ */ jsx116(
|
|
29774
|
+
Form7.Item,
|
|
29775
|
+
{
|
|
29776
|
+
name: "appId",
|
|
29777
|
+
label: "App ID",
|
|
29778
|
+
rules: [{ required: true, message: "App ID is required" }],
|
|
29779
|
+
children: /* @__PURE__ */ jsx116(Input15, {})
|
|
29780
|
+
}
|
|
29781
|
+
),
|
|
29782
|
+
/* @__PURE__ */ jsx116(
|
|
29783
|
+
Form7.Item,
|
|
29784
|
+
{
|
|
29785
|
+
name: "appSecret",
|
|
29786
|
+
label: "App Secret",
|
|
29787
|
+
rules: [{ required: true, message: "App Secret is required" }],
|
|
29788
|
+
children: /* @__PURE__ */ jsx116(Input15, {})
|
|
29789
|
+
}
|
|
29790
|
+
),
|
|
29791
|
+
/* @__PURE__ */ jsx116(Form7.Item, { name: "verificationToken", label: "Verification Token", children: /* @__PURE__ */ jsx116(Input15, {}) }),
|
|
29792
|
+
/* @__PURE__ */ jsx116(Form7.Item, { name: "encryptKey", label: "Encrypt Key", children: /* @__PURE__ */ jsx116(Input15, {}) }),
|
|
29793
|
+
/* @__PURE__ */ jsx116(
|
|
29794
|
+
Form7.Item,
|
|
29795
|
+
{
|
|
29796
|
+
name: "mappingMode",
|
|
29797
|
+
label: "Mapping Mode",
|
|
29798
|
+
rules: [{ required: true, message: "Mapping Mode is required" }],
|
|
29799
|
+
children: /* @__PURE__ */ jsx116(Select8, { options: MAPPING_MODE_OPTIONS })
|
|
29800
|
+
}
|
|
29801
|
+
),
|
|
29802
|
+
/* @__PURE__ */ jsx116(
|
|
29803
|
+
Form7.Item,
|
|
29804
|
+
{
|
|
29805
|
+
name: "assistantId",
|
|
29806
|
+
label: "Assistant ID",
|
|
29807
|
+
rules: [{ required: true, message: "Assistant ID is required" }],
|
|
29808
|
+
children: /* @__PURE__ */ jsx116(Input15, {})
|
|
29809
|
+
}
|
|
29810
|
+
),
|
|
29811
|
+
/* @__PURE__ */ jsx116(Form7.Item, { name: "workspaceId", label: "Workspace ID", children: /* @__PURE__ */ jsx116(Input15, {}) }),
|
|
29812
|
+
/* @__PURE__ */ jsx116(Form7.Item, { name: "projectId", label: "Project ID", children: /* @__PURE__ */ jsx116(Input15, {}) })
|
|
29813
|
+
] })
|
|
29814
|
+
}
|
|
29815
|
+
);
|
|
29816
|
+
};
|
|
29431
29817
|
export {
|
|
29432
29818
|
AgentConversations,
|
|
29433
29819
|
AgentThreadProvider,
|
|
@@ -29438,6 +29824,7 @@ export {
|
|
|
29438
29824
|
AuthProvider,
|
|
29439
29825
|
AxiomLatticeProvider,
|
|
29440
29826
|
ChangePasswordModal,
|
|
29827
|
+
ChannelInstallationsDrawerContent,
|
|
29441
29828
|
ChatUIContext,
|
|
29442
29829
|
ChatUIContextProvider,
|
|
29443
29830
|
Chating,
|
|
@@ -29445,6 +29832,7 @@ export {
|
|
|
29445
29832
|
ConversationContext,
|
|
29446
29833
|
ConversationContextProvider,
|
|
29447
29834
|
CreateAssistantModal_default as CreateAssistantModal,
|
|
29835
|
+
DEFAULT_MIDDLEWARE_TYPES,
|
|
29448
29836
|
FileExplorer,
|
|
29449
29837
|
LatticeChat,
|
|
29450
29838
|
LatticeChatShell,
|