@axiom-lattice/react-sdk 2.1.94 → 2.1.95
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.js +168 -138
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +201 -171
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -97,8 +97,8 @@ var AuthProvider = ({
|
|
|
97
97
|
onLoginSuccess?.(userData, tenantList || []);
|
|
98
98
|
return { requiresTenantSelection, hasTenants };
|
|
99
99
|
} catch (err) {
|
|
100
|
-
const
|
|
101
|
-
setError(
|
|
100
|
+
const message28 = err instanceof Error ? err.message : "Login failed";
|
|
101
|
+
setError(message28);
|
|
102
102
|
throw err;
|
|
103
103
|
} finally {
|
|
104
104
|
setIsLoading(false);
|
|
@@ -122,8 +122,8 @@ var AuthProvider = ({
|
|
|
122
122
|
}
|
|
123
123
|
return { message: data.message || "Registration successful!", token: data.data?.token };
|
|
124
124
|
} catch (err) {
|
|
125
|
-
const
|
|
126
|
-
setError(
|
|
125
|
+
const message28 = err instanceof Error ? err.message : "Registration failed";
|
|
126
|
+
setError(message28);
|
|
127
127
|
throw err;
|
|
128
128
|
} finally {
|
|
129
129
|
setIsLoading(false);
|
|
@@ -182,8 +182,8 @@ var AuthProvider = ({
|
|
|
182
182
|
}
|
|
183
183
|
onTenantSelected?.(tenantData);
|
|
184
184
|
} catch (err) {
|
|
185
|
-
const
|
|
186
|
-
setError(
|
|
185
|
+
const message28 = err instanceof Error ? err.message : "Failed to select tenant";
|
|
186
|
+
setError(message28);
|
|
187
187
|
throw err;
|
|
188
188
|
} finally {
|
|
189
189
|
setIsLoading(false);
|
|
@@ -222,8 +222,8 @@ var AuthProvider = ({
|
|
|
222
222
|
setTenants(tenantList);
|
|
223
223
|
sessionStorage.setItem("lattice_tenants", JSON.stringify(tenantList));
|
|
224
224
|
} catch (err) {
|
|
225
|
-
const
|
|
226
|
-
setError(
|
|
225
|
+
const message28 = err instanceof Error ? err.message : "Failed to fetch tenants";
|
|
226
|
+
setError(message28);
|
|
227
227
|
} finally {
|
|
228
228
|
setIsLoading(false);
|
|
229
229
|
}
|
|
@@ -253,8 +253,8 @@ var AuthProvider = ({
|
|
|
253
253
|
setUser(data);
|
|
254
254
|
sessionStorage.setItem("lattice_user", JSON.stringify(data));
|
|
255
255
|
} catch (err) {
|
|
256
|
-
const
|
|
257
|
-
setError(
|
|
256
|
+
const message28 = err instanceof Error ? err.message : "Failed to refresh user";
|
|
257
|
+
setError(message28);
|
|
258
258
|
} finally {
|
|
259
259
|
setIsLoading(false);
|
|
260
260
|
}
|
|
@@ -290,8 +290,8 @@ var AuthProvider = ({
|
|
|
290
290
|
const result = await response.json();
|
|
291
291
|
return result;
|
|
292
292
|
} catch (err) {
|
|
293
|
-
const
|
|
294
|
-
setError(
|
|
293
|
+
const message28 = err instanceof Error ? err.message : "Failed to change password";
|
|
294
|
+
setError(message28);
|
|
295
295
|
throw err;
|
|
296
296
|
} finally {
|
|
297
297
|
setIsLoading(false);
|
|
@@ -510,7 +510,7 @@ function useChat(threadId, assistantId, options = {}) {
|
|
|
510
510
|
throw new Error("Thread ID is required to send messages");
|
|
511
511
|
}
|
|
512
512
|
const { input, command, streaming = true } = data;
|
|
513
|
-
const { message:
|
|
513
|
+
const { message: message28, files, ...rest } = input || {};
|
|
514
514
|
setState((prev) => ({
|
|
515
515
|
...prev,
|
|
516
516
|
isLoading: true,
|
|
@@ -519,7 +519,7 @@ function useChat(threadId, assistantId, options = {}) {
|
|
|
519
519
|
}));
|
|
520
520
|
const userMessage = {
|
|
521
521
|
id: uuidv4(),
|
|
522
|
-
content:
|
|
522
|
+
content: message28 || command?.resume?.message || "",
|
|
523
523
|
files,
|
|
524
524
|
role: "human"
|
|
525
525
|
};
|
|
@@ -1555,8 +1555,8 @@ function convertThreadToConversationThread(thread, label) {
|
|
|
1555
1555
|
function getThreadMetadata(label) {
|
|
1556
1556
|
return label ? { label } : {};
|
|
1557
1557
|
}
|
|
1558
|
-
function generateLabelFromMessage(
|
|
1559
|
-
const cleanMessage =
|
|
1558
|
+
function generateLabelFromMessage(message28) {
|
|
1559
|
+
const cleanMessage = message28.replace(/```attachments[\s\S]*?```/g, "").trim();
|
|
1560
1560
|
if (!cleanMessage) {
|
|
1561
1561
|
return "";
|
|
1562
1562
|
}
|
|
@@ -2029,7 +2029,7 @@ function AgentThreadProvider({
|
|
|
2029
2029
|
throw new Error("Thread ID is required to send messages");
|
|
2030
2030
|
}
|
|
2031
2031
|
const { input, command, streaming = true, mode } = data;
|
|
2032
|
-
const { message:
|
|
2032
|
+
const { message: message28, files, ...rest } = input || {};
|
|
2033
2033
|
setState((prev) => ({
|
|
2034
2034
|
...prev,
|
|
2035
2035
|
isLoading: true,
|
|
@@ -2038,7 +2038,7 @@ function AgentThreadProvider({
|
|
|
2038
2038
|
}));
|
|
2039
2039
|
const userMessage = {
|
|
2040
2040
|
id: uuidv42(),
|
|
2041
|
-
content:
|
|
2041
|
+
content: message28 || command?.resume?.message || "",
|
|
2042
2042
|
files,
|
|
2043
2043
|
role: "human"
|
|
2044
2044
|
};
|
|
@@ -2056,8 +2056,8 @@ function AgentThreadProvider({
|
|
|
2056
2056
|
]
|
|
2057
2057
|
}));
|
|
2058
2058
|
const isFirstMessage = messageCountRef.current === 0;
|
|
2059
|
-
if (isFirstMessage &&
|
|
2060
|
-
const label = generateLabelFromMessage(
|
|
2059
|
+
if (isFirstMessage && message28 && conversationContext) {
|
|
2060
|
+
const label = generateLabelFromMessage(message28);
|
|
2061
2061
|
if (label) {
|
|
2062
2062
|
conversationContext.updateThread({
|
|
2063
2063
|
id: threadId,
|
|
@@ -3954,8 +3954,8 @@ function useTenants(options) {
|
|
|
3954
3954
|
const { data } = await response.json();
|
|
3955
3955
|
setTenants(data || []);
|
|
3956
3956
|
} catch (err) {
|
|
3957
|
-
const
|
|
3958
|
-
setError(
|
|
3957
|
+
const message28 = err instanceof Error ? err.message : "Failed to fetch tenants";
|
|
3958
|
+
setError(message28);
|
|
3959
3959
|
} finally {
|
|
3960
3960
|
setIsLoading(false);
|
|
3961
3961
|
}
|
|
@@ -3997,8 +3997,8 @@ function useUsers(options) {
|
|
|
3997
3997
|
const { data } = await response.json();
|
|
3998
3998
|
setUsers(data || []);
|
|
3999
3999
|
} catch (err) {
|
|
4000
|
-
const
|
|
4001
|
-
setError(
|
|
4000
|
+
const message28 = err instanceof Error ? err.message : "Failed to fetch users";
|
|
4001
|
+
setError(message28);
|
|
4002
4002
|
} finally {
|
|
4003
4003
|
setIsLoading(false);
|
|
4004
4004
|
}
|
|
@@ -13499,11 +13499,11 @@ var ConfirmFeedback = ({
|
|
|
13499
13499
|
data,
|
|
13500
13500
|
interactive = true
|
|
13501
13501
|
}) => {
|
|
13502
|
-
const { message:
|
|
13502
|
+
const { message: message28, type, config, feedback, options } = data ?? {};
|
|
13503
13503
|
const { sendMessage } = useAgentChat();
|
|
13504
13504
|
const [clicked, setClicked] = useState36(false);
|
|
13505
13505
|
return /* @__PURE__ */ jsxs22(Space9, { direction: "vertical", style: { width: "100%" }, children: [
|
|
13506
|
-
/* @__PURE__ */ jsx31(MDResponse, { content:
|
|
13506
|
+
/* @__PURE__ */ jsx31(MDResponse, { content: message28 }),
|
|
13507
13507
|
options ? /* @__PURE__ */ jsx31(Space9, { style: { justifyContent: "flex-end", width: "100%" }, children: options?.map((option) => /* @__PURE__ */ jsx31(
|
|
13508
13508
|
Button17,
|
|
13509
13509
|
{
|
|
@@ -13826,7 +13826,7 @@ var useSideAppOpener = () => {
|
|
|
13826
13826
|
import { jsx as jsx33, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
13827
13827
|
var { Text: Text16 } = Typography16;
|
|
13828
13828
|
var GenericDataTable = ({ data, interactive = true, default_open_in_side_app = true }) => {
|
|
13829
|
-
const { dataSource, message:
|
|
13829
|
+
const { dataSource, message: message28 } = data ?? {};
|
|
13830
13830
|
const [expandedRowKeys, setExpandedRowKeys] = useState38([]);
|
|
13831
13831
|
const openSideApp = useSideAppOpener();
|
|
13832
13832
|
const processedData = dataSource?.map((item, index) => ({
|
|
@@ -13925,7 +13925,7 @@ var GenericDataTable = ({ data, interactive = true, default_open_in_side_app = t
|
|
|
13925
13925
|
type: "text/csv;charset=utf-8;"
|
|
13926
13926
|
});
|
|
13927
13927
|
const link = document.createElement("a");
|
|
13928
|
-
const filename = `${
|
|
13928
|
+
const filename = `${message28 || "data"}_${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.csv`;
|
|
13929
13929
|
link.href = URL.createObjectURL(blob);
|
|
13930
13930
|
link.download = filename;
|
|
13931
13931
|
document.body.appendChild(link);
|
|
@@ -13946,7 +13946,7 @@ var GenericDataTable = ({ data, interactive = true, default_open_in_side_app = t
|
|
|
13946
13946
|
tableLayout: "fixed",
|
|
13947
13947
|
style: { width: "100% !important" },
|
|
13948
13948
|
title: () => /* @__PURE__ */ jsxs24(Flex, { justify: "space-between", align: "center", children: [
|
|
13949
|
-
/* @__PURE__ */ jsx33(Space11, { children: /* @__PURE__ */ jsx33(Text16, { strong: true, style: { fontSize: 16 }, children:
|
|
13949
|
+
/* @__PURE__ */ jsx33(Space11, { children: /* @__PURE__ */ jsx33(Text16, { strong: true, style: { fontSize: 16 }, children: message28 || "" }) }),
|
|
13950
13950
|
/* @__PURE__ */ jsxs24(Space11, { children: [
|
|
13951
13951
|
/* @__PURE__ */ jsx33(
|
|
13952
13952
|
Button19,
|
|
@@ -13968,8 +13968,8 @@ var GenericDataTable = ({ data, interactive = true, default_open_in_side_app = t
|
|
|
13968
13968
|
onClick: () => {
|
|
13969
13969
|
openSideApp({
|
|
13970
13970
|
component_key: "generic_data_table",
|
|
13971
|
-
message:
|
|
13972
|
-
data: { dataSource, message:
|
|
13971
|
+
message: message28 || "",
|
|
13972
|
+
data: { dataSource, message: message28 }
|
|
13973
13973
|
});
|
|
13974
13974
|
},
|
|
13975
13975
|
children: /* @__PURE__ */ jsx33(ExpandAltOutlined, {})
|
|
@@ -15779,6 +15779,8 @@ var ShareModal = ({
|
|
|
15779
15779
|
onUpdated
|
|
15780
15780
|
}) => {
|
|
15781
15781
|
const { shareFile } = useWorkspaceContext();
|
|
15782
|
+
const { config: shellConfig } = useLatticeChatShellContext();
|
|
15783
|
+
const baseURL = (shellConfig?.baseURL ?? "").replace(/\/$/, "");
|
|
15782
15784
|
const isEditMode = !!existingToken;
|
|
15783
15785
|
const [state, setState] = useState44(isEditMode ? "edit" : "creating");
|
|
15784
15786
|
const [token, setToken] = useState44(existingToken ?? "");
|
|
@@ -15820,13 +15822,18 @@ var ShareModal = ({
|
|
|
15820
15822
|
shareFile
|
|
15821
15823
|
]);
|
|
15822
15824
|
const handleCopy = useCallback23(() => {
|
|
15823
|
-
const fullUrl = `${
|
|
15824
|
-
|
|
15825
|
+
const fullUrl = `${baseURL}${url}`;
|
|
15826
|
+
const titleText = title ? `${title}
|
|
15827
|
+
` : "";
|
|
15828
|
+
const pwdText = visibility === "password" && password ? `Password: ${password}
|
|
15829
|
+
` : "";
|
|
15830
|
+
navigator.clipboard.writeText(`${titleText}${fullUrl}
|
|
15831
|
+
${pwdText}`.trim());
|
|
15825
15832
|
message11.success("Copied to clipboard");
|
|
15826
|
-
}, [url]);
|
|
15833
|
+
}, [url, baseURL, title, visibility, password]);
|
|
15827
15834
|
const handleOpen = useCallback23(() => {
|
|
15828
|
-
window.open(url
|
|
15829
|
-
}, [url]);
|
|
15835
|
+
window.open(`${baseURL}${url}`, "_blank");
|
|
15836
|
+
}, [url, baseURL]);
|
|
15830
15837
|
return /* @__PURE__ */ jsxs33(
|
|
15831
15838
|
Modal10,
|
|
15832
15839
|
{
|
|
@@ -15893,7 +15900,7 @@ var ShareModal = ({
|
|
|
15893
15900
|
!isEditMode && /* @__PURE__ */ jsx46(Button25, { type: "primary", block: true, onClick: handleShare, children: "Create Share" })
|
|
15894
15901
|
] }),
|
|
15895
15902
|
state === "result" && /* @__PURE__ */ jsxs33(Space17, { direction: "vertical", style: { width: "100%" }, size: "middle", children: [
|
|
15896
|
-
/* @__PURE__ */ jsx46(Input13, { value: url
|
|
15903
|
+
/* @__PURE__ */ jsx46(Input13, { value: `${baseURL}${url}`, readOnly: true, style: { fontFamily: "monospace" } }),
|
|
15897
15904
|
/* @__PURE__ */ jsx46("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ jsxs33(Space17, { children: [
|
|
15898
15905
|
/* @__PURE__ */ jsx46(Button25, { icon: /* @__PURE__ */ jsx46(CopyOutlined3, {}), onClick: handleCopy, children: "Copy" }),
|
|
15899
15906
|
/* @__PURE__ */ jsx46(Button25, { type: "primary", icon: /* @__PURE__ */ jsx46(LinkOutlined2, {}), onClick: handleOpen, children: "Open" })
|
|
@@ -16584,7 +16591,7 @@ import {
|
|
|
16584
16591
|
} from "react";
|
|
16585
16592
|
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
16586
16593
|
var LazyBubble = ({
|
|
16587
|
-
message:
|
|
16594
|
+
message: message28,
|
|
16588
16595
|
renderContent,
|
|
16589
16596
|
autoLoadRightPanel
|
|
16590
16597
|
}) => {
|
|
@@ -16615,10 +16622,10 @@ var LazyBubble = ({
|
|
|
16615
16622
|
autoLoadRightPanel?.();
|
|
16616
16623
|
}, []);
|
|
16617
16624
|
const getPlaceholder = () => {
|
|
16618
|
-
const estimatedHeight =
|
|
16625
|
+
const estimatedHeight = message28.content ? Math.min(100, message28.content.length / 5) : 100;
|
|
16619
16626
|
return /* @__PURE__ */ jsx53("div", { style: { height: `${estimatedHeight}px`, minHeight: "50px" } });
|
|
16620
16627
|
};
|
|
16621
|
-
return /* @__PURE__ */ jsx53(ErrorBoundary, { children: /* @__PURE__ */ jsx53("div", { ref, style: { width: "100%" }, children: isVisible || wasEverVisible ? renderContent(
|
|
16628
|
+
return /* @__PURE__ */ jsx53(ErrorBoundary, { children: /* @__PURE__ */ jsx53("div", { ref, style: { width: "100%" }, children: isVisible || wasEverVisible ? renderContent(message28) : getPlaceholder() }) });
|
|
16622
16629
|
};
|
|
16623
16630
|
var MemoizedBubbleList = memo(
|
|
16624
16631
|
({
|
|
@@ -16649,8 +16656,8 @@ var MessageList = ({
|
|
|
16649
16656
|
messageLengthRef.current = messages?.length;
|
|
16650
16657
|
}
|
|
16651
16658
|
}, [messages?.length]);
|
|
16652
|
-
const renderContent = useCallback25((
|
|
16653
|
-
const { content } =
|
|
16659
|
+
const renderContent = useCallback25((message28) => {
|
|
16660
|
+
const { content } = message28;
|
|
16654
16661
|
try {
|
|
16655
16662
|
const json = JSON.parse(content);
|
|
16656
16663
|
if (json.action && json.message) {
|
|
@@ -16658,7 +16665,7 @@ var MessageList = ({
|
|
|
16658
16665
|
}
|
|
16659
16666
|
} catch (error) {
|
|
16660
16667
|
}
|
|
16661
|
-
const tool_calls_md =
|
|
16668
|
+
const tool_calls_md = message28.tool_calls?.map((tool_call) => {
|
|
16662
16669
|
return `\`\`\`tool_call
|
|
16663
16670
|
${JSON.stringify(tool_call)}
|
|
16664
16671
|
\`\`\``;
|
|
@@ -16667,17 +16674,17 @@ ${JSON.stringify(tool_call)}
|
|
|
16667
16674
|
return /* @__PURE__ */ jsx53(Space21, { direction: "vertical", style: { width: "100%" }, children: /* @__PURE__ */ jsx53(MDResponse, { content: content_md }) });
|
|
16668
16675
|
}, []);
|
|
16669
16676
|
const items = useMemo11(
|
|
16670
|
-
() => messages.map((
|
|
16671
|
-
key:
|
|
16672
|
-
role:
|
|
16677
|
+
() => messages.map((message28, index) => ({
|
|
16678
|
+
key: message28.id,
|
|
16679
|
+
role: message28.role,
|
|
16673
16680
|
typing: false,
|
|
16674
16681
|
content: /* @__PURE__ */ jsx53(
|
|
16675
16682
|
LazyBubble,
|
|
16676
16683
|
{
|
|
16677
|
-
message:
|
|
16684
|
+
message: message28,
|
|
16678
16685
|
renderContent,
|
|
16679
16686
|
autoLoadRightPanel: () => {
|
|
16680
|
-
const { content, role: role2 } =
|
|
16687
|
+
const { content, role: role2 } = message28;
|
|
16681
16688
|
const isNewAddedMessage = messageLengthRef.current > 1 && messageLengthRef.current + 1 === messages.length;
|
|
16682
16689
|
if (index === messages.length - 1 && isNewAddedMessage && role2 === "ai") {
|
|
16683
16690
|
try {
|
|
@@ -23164,12 +23171,12 @@ var formatDate3 = (timestamp) => {
|
|
|
23164
23171
|
});
|
|
23165
23172
|
};
|
|
23166
23173
|
var MailboxDetailModal = ({
|
|
23167
|
-
message:
|
|
23174
|
+
message: message28,
|
|
23168
23175
|
visible,
|
|
23169
23176
|
onClose
|
|
23170
23177
|
}) => {
|
|
23171
23178
|
const { styles } = useStyles14();
|
|
23172
|
-
if (!
|
|
23179
|
+
if (!message28) return null;
|
|
23173
23180
|
return /* @__PURE__ */ jsx87(
|
|
23174
23181
|
Modal16,
|
|
23175
23182
|
{
|
|
@@ -23192,12 +23199,12 @@ var MailboxDetailModal = ({
|
|
|
23192
23199
|
children: /* @__PURE__ */ jsxs64("div", { className: styles.modalContent, children: [
|
|
23193
23200
|
/* @__PURE__ */ jsxs64("div", { className: styles.header, children: [
|
|
23194
23201
|
/* @__PURE__ */ jsx87("div", { className: styles.messageIcon, children: /* @__PURE__ */ jsx87(Mail2, { size: 20 }) }),
|
|
23195
|
-
/* @__PURE__ */ jsx87(Text36, { className: styles.messageId, children:
|
|
23196
|
-
!
|
|
23202
|
+
/* @__PURE__ */ jsx87(Text36, { className: styles.messageId, children: message28.id }),
|
|
23203
|
+
!message28.read && /* @__PURE__ */ jsx87(Tag20, { color: "red", children: "Unread" })
|
|
23197
23204
|
] }),
|
|
23198
23205
|
/* @__PURE__ */ jsxs64(Title11, { level: 4, className: styles.title, children: [
|
|
23199
23206
|
"Message from ",
|
|
23200
|
-
|
|
23207
|
+
message28.from
|
|
23201
23208
|
] }),
|
|
23202
23209
|
/* @__PURE__ */ jsxs64("div", { className: styles.metaSection, children: [
|
|
23203
23210
|
/* @__PURE__ */ jsxs64("div", { className: styles.metaItem, children: [
|
|
@@ -23207,11 +23214,11 @@ var MailboxDetailModal = ({
|
|
|
23207
23214
|
"div",
|
|
23208
23215
|
{
|
|
23209
23216
|
className: styles.avatar,
|
|
23210
|
-
style: { background: getAvatarColor7(
|
|
23211
|
-
children: getInitials7(
|
|
23217
|
+
style: { background: getAvatarColor7(message28.from) },
|
|
23218
|
+
children: getInitials7(message28.from)
|
|
23212
23219
|
}
|
|
23213
23220
|
),
|
|
23214
|
-
/* @__PURE__ */ jsx87("span", { children:
|
|
23221
|
+
/* @__PURE__ */ jsx87("span", { children: message28.from })
|
|
23215
23222
|
] })
|
|
23216
23223
|
] }),
|
|
23217
23224
|
/* @__PURE__ */ jsxs64("div", { className: styles.metaItem, children: [
|
|
@@ -23221,29 +23228,29 @@ var MailboxDetailModal = ({
|
|
|
23221
23228
|
"div",
|
|
23222
23229
|
{
|
|
23223
23230
|
className: styles.avatar,
|
|
23224
|
-
style: { background: getAvatarColor7(
|
|
23225
|
-
children: getInitials7(
|
|
23231
|
+
style: { background: getAvatarColor7(message28.to) },
|
|
23232
|
+
children: getInitials7(message28.to)
|
|
23226
23233
|
}
|
|
23227
23234
|
),
|
|
23228
|
-
/* @__PURE__ */ jsx87("span", { children:
|
|
23235
|
+
/* @__PURE__ */ jsx87("span", { children: message28.to })
|
|
23229
23236
|
] })
|
|
23230
23237
|
] }),
|
|
23231
23238
|
/* @__PURE__ */ jsxs64("div", { className: styles.metaItem, children: [
|
|
23232
23239
|
/* @__PURE__ */ jsx87(Text36, { className: styles.metaLabel, children: "Time" }),
|
|
23233
23240
|
/* @__PURE__ */ jsxs64("div", { className: styles.metaValue, children: [
|
|
23234
23241
|
/* @__PURE__ */ jsx87(Calendar2, { size: 14 }),
|
|
23235
|
-
/* @__PURE__ */ jsx87("span", { children: formatDate3(
|
|
23242
|
+
/* @__PURE__ */ jsx87("span", { children: formatDate3(message28.timestamp) })
|
|
23236
23243
|
] })
|
|
23237
23244
|
] }),
|
|
23238
23245
|
/* @__PURE__ */ jsxs64("div", { className: styles.metaItem, children: [
|
|
23239
23246
|
/* @__PURE__ */ jsx87(Text36, { className: styles.metaLabel, children: "Type" }),
|
|
23240
|
-
/* @__PURE__ */ jsx87("div", { className: styles.metaValue, children: /* @__PURE__ */ jsx87(Tag20, { color:
|
|
23247
|
+
/* @__PURE__ */ jsx87("div", { className: styles.metaValue, children: /* @__PURE__ */ jsx87(Tag20, { color: message28.type === "broadcast" ? "blue" : "default", children: message28.type }) })
|
|
23241
23248
|
] })
|
|
23242
23249
|
] }),
|
|
23243
23250
|
/* @__PURE__ */ jsx87(Divider8, {}),
|
|
23244
23251
|
/* @__PURE__ */ jsxs64("div", { className: styles.contentSection, children: [
|
|
23245
23252
|
/* @__PURE__ */ jsx87(Text36, { className: styles.contentLabel, children: "Message Content" }),
|
|
23246
|
-
/* @__PURE__ */ jsx87("div", { className: styles.contentBox, children: /* @__PURE__ */ jsx87(Paragraph2, { className: styles.messageContent, children:
|
|
23253
|
+
/* @__PURE__ */ jsx87("div", { className: styles.contentBox, children: /* @__PURE__ */ jsx87(Paragraph2, { className: styles.messageContent, children: message28.content }) })
|
|
23247
23254
|
] })
|
|
23248
23255
|
] })
|
|
23249
23256
|
}
|
|
@@ -23472,26 +23479,26 @@ var MessageGroupComponent = ({ group, styles, defaultExpanded = true, onMessageC
|
|
|
23472
23479
|
]
|
|
23473
23480
|
}
|
|
23474
23481
|
),
|
|
23475
|
-
isExpanded && /* @__PURE__ */ jsx88("div", { className: styles.listGroupContent, children: group.messages.map((
|
|
23482
|
+
isExpanded && /* @__PURE__ */ jsx88("div", { className: styles.listGroupContent, children: group.messages.map((message28) => /* @__PURE__ */ jsxs65(
|
|
23476
23483
|
"div",
|
|
23477
23484
|
{
|
|
23478
|
-
className: `${styles.listItem} ${!
|
|
23479
|
-
onClick: () => onMessageClick(
|
|
23485
|
+
className: `${styles.listItem} ${!message28.read ? styles.listItemUnread : ""}`,
|
|
23486
|
+
onClick: () => onMessageClick(message28),
|
|
23480
23487
|
children: [
|
|
23481
|
-
/* @__PURE__ */ jsx88("div", { className: styles.listItemIcon, children: !
|
|
23488
|
+
/* @__PURE__ */ jsx88("div", { className: styles.listItemIcon, children: !message28.read ? /* @__PURE__ */ jsx88("div", { className: styles.unreadBadge }) : /* @__PURE__ */ jsx88(Circle2, { size: 8, style: { color: "#d9d9d9" } }) }),
|
|
23482
23489
|
/* @__PURE__ */ jsxs65("div", { className: styles.listItemContent, children: [
|
|
23483
|
-
/* @__PURE__ */ jsx88("span", { className: styles.listItemPreview, children: getMessagePreview(
|
|
23490
|
+
/* @__PURE__ */ jsx88("span", { className: styles.listItemPreview, children: getMessagePreview(message28.content) }),
|
|
23484
23491
|
/* @__PURE__ */ jsxs65("span", { className: styles.listItemMeta, children: [
|
|
23485
23492
|
"To: ",
|
|
23486
|
-
|
|
23493
|
+
message28.to,
|
|
23487
23494
|
" \u2022 ",
|
|
23488
|
-
|
|
23495
|
+
message28.type
|
|
23489
23496
|
] })
|
|
23490
23497
|
] }),
|
|
23491
|
-
/* @__PURE__ */ jsx88("div", { className: styles.listItemRight, children: /* @__PURE__ */ jsx88("span", { className: styles.listItemDate, children: formatDate4(
|
|
23498
|
+
/* @__PURE__ */ jsx88("div", { className: styles.listItemRight, children: /* @__PURE__ */ jsx88("span", { className: styles.listItemDate, children: formatDate4(message28.timestamp) }) })
|
|
23492
23499
|
]
|
|
23493
23500
|
},
|
|
23494
|
-
|
|
23501
|
+
message28.id
|
|
23495
23502
|
)) })
|
|
23496
23503
|
] });
|
|
23497
23504
|
};
|
|
@@ -23502,12 +23509,12 @@ var MailboxPanel = ({ data }) => {
|
|
|
23502
23509
|
const { teamMailbox = [] } = data || {};
|
|
23503
23510
|
const messageGroups = useMemo17(() => {
|
|
23504
23511
|
const groupsMap = /* @__PURE__ */ new Map();
|
|
23505
|
-
teamMailbox.forEach((
|
|
23506
|
-
const sender =
|
|
23512
|
+
teamMailbox.forEach((message28) => {
|
|
23513
|
+
const sender = message28.from;
|
|
23507
23514
|
if (!groupsMap.has(sender)) {
|
|
23508
23515
|
groupsMap.set(sender, []);
|
|
23509
23516
|
}
|
|
23510
|
-
groupsMap.get(sender).push(
|
|
23517
|
+
groupsMap.get(sender).push(message28);
|
|
23511
23518
|
});
|
|
23512
23519
|
const groups = Array.from(groupsMap.entries()).map(([sender, messages]) => ({
|
|
23513
23520
|
sender,
|
|
@@ -23524,8 +23531,8 @@ var MailboxPanel = ({ data }) => {
|
|
|
23524
23531
|
return groups;
|
|
23525
23532
|
}, [teamMailbox]);
|
|
23526
23533
|
const totalUnread = teamMailbox.filter((m) => !m.read).length;
|
|
23527
|
-
const handleMessageClick = (
|
|
23528
|
-
setSelectedMessage(
|
|
23534
|
+
const handleMessageClick = (message28) => {
|
|
23535
|
+
setSelectedMessage(message28);
|
|
23529
23536
|
setModalVisible(true);
|
|
23530
23537
|
};
|
|
23531
23538
|
const handleCloseModal = () => {
|
|
@@ -25369,11 +25376,11 @@ var StreamingHTMLRenderer = ({
|
|
|
25369
25376
|
if (!iframe || event.source !== iframe.contentWindow) {
|
|
25370
25377
|
return;
|
|
25371
25378
|
}
|
|
25372
|
-
const
|
|
25373
|
-
if (!
|
|
25379
|
+
const message28 = event.data;
|
|
25380
|
+
if (!message28 || typeof message28 !== "object") {
|
|
25374
25381
|
return;
|
|
25375
25382
|
}
|
|
25376
|
-
switch (
|
|
25383
|
+
switch (message28.type) {
|
|
25377
25384
|
case "iframe-ready":
|
|
25378
25385
|
console.log("[StreamingHTMLRenderer] Iframe ready");
|
|
25379
25386
|
isReadyRef.current = true;
|
|
@@ -25388,26 +25395,26 @@ var StreamingHTMLRenderer = ({
|
|
|
25388
25395
|
}
|
|
25389
25396
|
break;
|
|
25390
25397
|
case "iframe-height":
|
|
25391
|
-
if (typeof
|
|
25392
|
-
setIframeHeight(
|
|
25398
|
+
if (typeof message28.height === "number" && message28.height > 0) {
|
|
25399
|
+
setIframeHeight(message28.height);
|
|
25393
25400
|
}
|
|
25394
25401
|
break;
|
|
25395
25402
|
case "iframe-error": {
|
|
25396
25403
|
const streamingError = {
|
|
25397
25404
|
type: "RENDER_ERROR",
|
|
25398
|
-
message:
|
|
25405
|
+
message: message28.error || "Unknown iframe error"
|
|
25399
25406
|
};
|
|
25400
25407
|
onError?.(streamingError);
|
|
25401
25408
|
break;
|
|
25402
25409
|
}
|
|
25403
25410
|
case "widget-prompt":
|
|
25404
|
-
if (typeof
|
|
25405
|
-
onPrompt?.(
|
|
25411
|
+
if (typeof message28.text === "string") {
|
|
25412
|
+
onPrompt?.(message28.text);
|
|
25406
25413
|
}
|
|
25407
25414
|
break;
|
|
25408
25415
|
case "widget-open-link":
|
|
25409
|
-
if (typeof
|
|
25410
|
-
window.open(
|
|
25416
|
+
if (typeof message28.url === "string") {
|
|
25417
|
+
window.open(message28.url, "_blank", "noopener,noreferrer");
|
|
25411
25418
|
}
|
|
25412
25419
|
break;
|
|
25413
25420
|
}
|
|
@@ -28546,8 +28553,8 @@ var TopologyRuntimeView = () => {
|
|
|
28546
28553
|
setRuns((prev) => prev.filter((r) => r.id !== runId));
|
|
28547
28554
|
setSelectedRun((prev) => prev?.id === runId ? null : prev);
|
|
28548
28555
|
} catch (err) {
|
|
28549
|
-
const
|
|
28550
|
-
setError(
|
|
28556
|
+
const message28 = err instanceof Error ? err.message : "Failed to delete run";
|
|
28557
|
+
setError(message28);
|
|
28551
28558
|
}
|
|
28552
28559
|
}, [del]);
|
|
28553
28560
|
const refreshRuns = useCallback37(async () => {
|
|
@@ -31185,7 +31192,7 @@ var EvalPanel = () => {
|
|
|
31185
31192
|
import { useEffect as useEffect51, useState as useState77, useCallback as useCallback40, useRef as useRef28 } from "react";
|
|
31186
31193
|
import { Card as Card29, Button as Button57, Input as Input18, Typography as Typography61, message as message20, Dropdown as Dropdown3, Modal as Modal21 } from "antd";
|
|
31187
31194
|
import { createStyles as createStyles36 } from "antd-style";
|
|
31188
|
-
import { Bot as Bot4, Sparkles as Sparkles3, ArrowRight as ArrowRight4, ArrowLeft as ArrowLeft3, Smile, Zap, Heart, Lightbulb, Edit3, MoreHorizontal,
|
|
31195
|
+
import { Bot as Bot4, Sparkles as Sparkles3, ArrowRight as ArrowRight4, ArrowLeft as ArrowLeft3, Smile, Zap, Heart, Lightbulb, Edit3, MoreHorizontal, MessagesSquare as MessagesSquare2, Trash2 as Trash29 } from "lucide-react";
|
|
31189
31196
|
import { Client as Client2 } from "@axiom-lattice/client-sdk";
|
|
31190
31197
|
|
|
31191
31198
|
// src/components/Chat/LatticeAgentWorkspace.tsx
|
|
@@ -31213,7 +31220,7 @@ import {
|
|
|
31213
31220
|
QRCode
|
|
31214
31221
|
} from "antd";
|
|
31215
31222
|
import { createStyles as createStyles35 } from "antd-style";
|
|
31216
|
-
import { Trash2 as Trash28, X as X2,
|
|
31223
|
+
import { Trash2 as Trash28, X as X2, MessagesSquare, User as User6, UserPlus } from "lucide-react";
|
|
31217
31224
|
import { Fragment as Fragment23, jsx as jsx119, jsxs as jsxs86 } from "react/jsx-runtime";
|
|
31218
31225
|
var { Text: Text49 } = Typography60;
|
|
31219
31226
|
var AVATAR_COLORS = [
|
|
@@ -31823,7 +31830,7 @@ var PersonalAssistantChannelModal = ({
|
|
|
31823
31830
|
Button56,
|
|
31824
31831
|
{
|
|
31825
31832
|
block: true,
|
|
31826
|
-
icon: /* @__PURE__ */ jsx119(
|
|
31833
|
+
icon: /* @__PURE__ */ jsx119(MessagesSquare, { size: 14 }),
|
|
31827
31834
|
onClick: openCreateForm,
|
|
31828
31835
|
children: "Connect"
|
|
31829
31836
|
}
|
|
@@ -31832,7 +31839,7 @@ var PersonalAssistantChannelModal = ({
|
|
|
31832
31839
|
const renderRightContent = () => {
|
|
31833
31840
|
if (formMode === "view" && !selectedId) {
|
|
31834
31841
|
return /* @__PURE__ */ jsxs86("div", { className: styles.emptyState, children: [
|
|
31835
|
-
/* @__PURE__ */ jsx119(
|
|
31842
|
+
/* @__PURE__ */ jsx119(MessagesSquare, { size: 40, style: { opacity: 0.25, marginBottom: 16 } }),
|
|
31836
31843
|
/* @__PURE__ */ jsx119(Text49, { style: { fontSize: 14, color: "var(--color-text-secondary, #666)" }, children: "Select a channel from the left or add a new one" })
|
|
31837
31844
|
] });
|
|
31838
31845
|
}
|
|
@@ -31894,7 +31901,7 @@ var PersonalAssistantChannelModal = ({
|
|
|
31894
31901
|
Button56,
|
|
31895
31902
|
{
|
|
31896
31903
|
type: "primary",
|
|
31897
|
-
icon: /* @__PURE__ */ jsx119(
|
|
31904
|
+
icon: /* @__PURE__ */ jsx119(MessagesSquare, { size: 14 }),
|
|
31898
31905
|
loading: qrLoading,
|
|
31899
31906
|
onClick: fetchQrCode,
|
|
31900
31907
|
children: "Get QR Code"
|
|
@@ -32104,7 +32111,7 @@ var PersonalAssistantChannelModal = ({
|
|
|
32104
32111
|
Modal20,
|
|
32105
32112
|
{
|
|
32106
32113
|
title: /* @__PURE__ */ jsxs86("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
32107
|
-
/* @__PURE__ */ jsx119(
|
|
32114
|
+
/* @__PURE__ */ jsx119(MessagesSquare, { size: 18 }),
|
|
32108
32115
|
/* @__PURE__ */ jsx119("span", { children: "Connect Channels" })
|
|
32109
32116
|
] }),
|
|
32110
32117
|
open,
|
|
@@ -32310,7 +32317,7 @@ var PersonalAssistantPage = () => {
|
|
|
32310
32317
|
HeaderIconButton,
|
|
32311
32318
|
{
|
|
32312
32319
|
ariaLabel: "Channel settings",
|
|
32313
|
-
icon: /* @__PURE__ */ jsx120(
|
|
32320
|
+
icon: /* @__PURE__ */ jsx120(MessagesSquare2, { size: 16 }),
|
|
32314
32321
|
onClick: () => setChannelModalOpen(true)
|
|
32315
32322
|
}
|
|
32316
32323
|
),
|
|
@@ -32500,7 +32507,7 @@ var FileView = ({ parsed }) => {
|
|
|
32500
32507
|
const baseURL = shellConfig?.baseURL ?? "";
|
|
32501
32508
|
const resourcePath = decodeURIComponent(parsed.payload);
|
|
32502
32509
|
const params = new URLSearchParams({
|
|
32503
|
-
path: `/${resourcePath}`
|
|
32510
|
+
path: resourcePath.startsWith("/") ? resourcePath : `/${resourcePath}`
|
|
32504
32511
|
});
|
|
32505
32512
|
if (parsed.assistantId) params.set("assistantId", parsed.assistantId);
|
|
32506
32513
|
const url = `${baseURL}/api/workspaces/${parsed.workspaceId}/projects/${parsed.projectId}/viewfile?${params}`;
|
|
@@ -32590,8 +32597,15 @@ var SharesPage = ({ client }) => {
|
|
|
32590
32597
|
useEffect52(() => {
|
|
32591
32598
|
loadShares();
|
|
32592
32599
|
}, []);
|
|
32593
|
-
const handleCopy = (
|
|
32594
|
-
|
|
32600
|
+
const handleCopy = (record) => {
|
|
32601
|
+
const baseURL = client.baseURL ?? "";
|
|
32602
|
+
const fullUrl = `${baseURL.replace(/\/$/, "")}/s/${record.token}`;
|
|
32603
|
+
const titleText = record.title ? `${record.title}
|
|
32604
|
+
` : `${record.address.resourcePath.split("/").pop() || "file"}
|
|
32605
|
+
`;
|
|
32606
|
+
const pwdText = record.visibility === "password" ? "Password protected\n" : "";
|
|
32607
|
+
navigator.clipboard.writeText(`${titleText}${fullUrl}
|
|
32608
|
+
${pwdText}`.trim());
|
|
32595
32609
|
message21.success("Copied");
|
|
32596
32610
|
};
|
|
32597
32611
|
const handleRevoke = async (token) => {
|
|
@@ -32644,7 +32658,7 @@ var SharesPage = ({ client }) => {
|
|
|
32644
32658
|
key: "copy",
|
|
32645
32659
|
icon: /* @__PURE__ */ jsx123(CopyOutlined4, {}),
|
|
32646
32660
|
label: "Copy Link",
|
|
32647
|
-
onClick: () => handleCopy(
|
|
32661
|
+
onClick: () => handleCopy(r)
|
|
32648
32662
|
},
|
|
32649
32663
|
...r.revoked ? [] : [
|
|
32650
32664
|
{
|
|
@@ -33843,7 +33857,15 @@ var MODAL_BODY_STYLE = {
|
|
|
33843
33857
|
flexDirection: "column",
|
|
33844
33858
|
gap: 12
|
|
33845
33859
|
};
|
|
33846
|
-
var PinToMenuButton = ({
|
|
33860
|
+
var PinToMenuButton = ({
|
|
33861
|
+
assistantId,
|
|
33862
|
+
contentType = "agent",
|
|
33863
|
+
contentConfig: externalContentConfig,
|
|
33864
|
+
isMatch,
|
|
33865
|
+
size = "small",
|
|
33866
|
+
label,
|
|
33867
|
+
block
|
|
33868
|
+
}) => {
|
|
33847
33869
|
const workspaceCtx = React74.useContext(WorkspaceContext);
|
|
33848
33870
|
const { config } = useLatticeChatShellContext();
|
|
33849
33871
|
const { post, get, del } = useApi();
|
|
@@ -33854,8 +33876,9 @@ var PinToMenuButton = ({ assistantId }) => {
|
|
|
33854
33876
|
const [isPinned, setIsPinned] = useState82(false);
|
|
33855
33877
|
const [pinnedItemId, setPinnedItemId] = useState82(null);
|
|
33856
33878
|
const [checking, setChecking] = useState82(true);
|
|
33879
|
+
const hasTarget = contentType === "agent" ? !!assistantId : !!externalContentConfig;
|
|
33857
33880
|
const checkPinned = useCallback42(async () => {
|
|
33858
|
-
if (!
|
|
33881
|
+
if (!hasTarget || !config.enableCustomMenu) {
|
|
33859
33882
|
setChecking(false);
|
|
33860
33883
|
return;
|
|
33861
33884
|
}
|
|
@@ -33865,8 +33888,11 @@ var PinToMenuButton = ({ assistantId }) => {
|
|
|
33865
33888
|
"/api/menu-items?menuTarget=workspace"
|
|
33866
33889
|
);
|
|
33867
33890
|
if (json.success && json.data?.records) {
|
|
33891
|
+
const matchFn = isMatch ?? ((cfg) => {
|
|
33892
|
+
return contentType === "agent" && cfg.agentId === assistantId;
|
|
33893
|
+
});
|
|
33868
33894
|
const pinned = json.data.records.find(
|
|
33869
|
-
(item) => item.
|
|
33895
|
+
(item) => item.contentType === contentType && matchFn(item.contentConfig)
|
|
33870
33896
|
);
|
|
33871
33897
|
if (pinned) {
|
|
33872
33898
|
setIsPinned(true);
|
|
@@ -33880,11 +33906,11 @@ var PinToMenuButton = ({ assistantId }) => {
|
|
|
33880
33906
|
} finally {
|
|
33881
33907
|
setChecking(false);
|
|
33882
33908
|
}
|
|
33883
|
-
}, [
|
|
33909
|
+
}, [hasTarget, config.enableCustomMenu, get, contentType, assistantId, isMatch]);
|
|
33884
33910
|
useEffect56(() => {
|
|
33885
33911
|
checkPinned();
|
|
33886
33912
|
}, [checkPinned]);
|
|
33887
|
-
if (!
|
|
33913
|
+
if (!hasTarget || !config.enableCustomMenu) return null;
|
|
33888
33914
|
const handlePin = async () => {
|
|
33889
33915
|
if (!name.trim()) {
|
|
33890
33916
|
message22.warning("Please enter a menu name");
|
|
@@ -33892,14 +33918,19 @@ var PinToMenuButton = ({ assistantId }) => {
|
|
|
33892
33918
|
}
|
|
33893
33919
|
setLoading(true);
|
|
33894
33920
|
try {
|
|
33921
|
+
const contentConfig = contentType === "agent" ? {
|
|
33922
|
+
agentId: assistantId,
|
|
33923
|
+
workspaceId: workspaceCtx?.workspaceId || void 0,
|
|
33924
|
+
projectId: workspaceCtx?.projectId || void 0
|
|
33925
|
+
} : {
|
|
33926
|
+
...externalContentConfig,
|
|
33927
|
+
workspaceId: workspaceCtx?.workspaceId || void 0,
|
|
33928
|
+
projectId: workspaceCtx?.projectId || void 0
|
|
33929
|
+
};
|
|
33895
33930
|
const body = {
|
|
33896
33931
|
menuTarget: "workspace",
|
|
33897
|
-
contentType
|
|
33898
|
-
contentConfig
|
|
33899
|
-
agentId: assistantId,
|
|
33900
|
-
workspaceId: workspaceCtx?.workspaceId || void 0,
|
|
33901
|
-
projectId: workspaceCtx?.projectId || void 0
|
|
33902
|
-
},
|
|
33932
|
+
contentType,
|
|
33933
|
+
contentConfig,
|
|
33903
33934
|
group: group.trim() || void 0,
|
|
33904
33935
|
name: name.trim(),
|
|
33905
33936
|
sortOrder: 0
|
|
@@ -33946,11 +33977,23 @@ var PinToMenuButton = ({ assistantId }) => {
|
|
|
33946
33977
|
}
|
|
33947
33978
|
};
|
|
33948
33979
|
return /* @__PURE__ */ jsxs92(Fragment26, { children: [
|
|
33949
|
-
/* @__PURE__ */ jsx127(Tooltip26, { title: isPinned ? "Unpin from Menu" : "Pin to Menu", children: /* @__PURE__ */ jsx127(
|
|
33980
|
+
/* @__PURE__ */ jsx127(Tooltip26, { title: isPinned ? "Unpin from Menu" : "Pin to Menu", children: label ? /* @__PURE__ */ jsx127(
|
|
33950
33981
|
Button60,
|
|
33951
33982
|
{
|
|
33952
33983
|
type: "text",
|
|
33953
|
-
size
|
|
33984
|
+
size,
|
|
33985
|
+
block,
|
|
33986
|
+
icon: isPinned ? /* @__PURE__ */ jsx127(Pin, { size: 14, fill: "currentColor" }) : /* @__PURE__ */ jsx127(Pin, { size: 14 }),
|
|
33987
|
+
onClick: handleClick,
|
|
33988
|
+
loading: checking || loading && isPinned,
|
|
33989
|
+
children: label
|
|
33990
|
+
}
|
|
33991
|
+
) : /* @__PURE__ */ jsx127(
|
|
33992
|
+
Button60,
|
|
33993
|
+
{
|
|
33994
|
+
type: "text",
|
|
33995
|
+
size,
|
|
33996
|
+
block,
|
|
33954
33997
|
icon: isPinned ? /* @__PURE__ */ jsx127(Pin, { size: 14, fill: "currentColor" }) : /* @__PURE__ */ jsx127(Pin, { size: 14 }),
|
|
33955
33998
|
onClick: handleClick,
|
|
33956
33999
|
loading: checking || loading && isPinned
|
|
@@ -34404,12 +34447,12 @@ var ProjectSelector = ({
|
|
|
34404
34447
|
|
|
34405
34448
|
// src/components/Chat/ToolPanelFiles.tsx
|
|
34406
34449
|
import { useCallback as useCallback44, useEffect as useEffect57, useMemo as useMemo37, useState as useState85 } from "react";
|
|
34407
|
-
import { message as
|
|
34450
|
+
import { message as message24 } from "antd";
|
|
34408
34451
|
|
|
34409
34452
|
// src/components/Chat/FileDirectoryPanel.tsx
|
|
34410
34453
|
import React76, { useState as useState84 } from "react";
|
|
34411
|
-
import { Spin as Spin23, Dropdown as Dropdown6, Button as Button62
|
|
34412
|
-
import { ChevronRight as ChevronRight8, FolderOpen as FolderOpen4, Upload
|
|
34454
|
+
import { Spin as Spin23, Dropdown as Dropdown6, Button as Button62 } from "antd";
|
|
34455
|
+
import { ChevronRight as ChevronRight8, FolderOpen as FolderOpen4, Upload } from "lucide-react";
|
|
34413
34456
|
import { createStyles as createStyles39 } from "antd-style";
|
|
34414
34457
|
import { MoreOutlined as MoreOutlined5, LinkOutlined as LinkOutlined5, DownloadOutlined as DownloadOutlined4, EyeOutlined } from "@ant-design/icons";
|
|
34415
34458
|
import { Fragment as Fragment28, jsx as jsx129, jsxs as jsxs94 } from "react/jsx-runtime";
|
|
@@ -34417,6 +34460,7 @@ var useStyles22 = createStyles39(({ token, css }) => ({
|
|
|
34417
34460
|
container: css`
|
|
34418
34461
|
height: 100%;
|
|
34419
34462
|
overflow-y: auto;
|
|
34463
|
+
overflow-x: hidden;
|
|
34420
34464
|
padding: 12px;
|
|
34421
34465
|
font-size: 13px;
|
|
34422
34466
|
background: transparent;
|
|
@@ -34487,7 +34531,8 @@ var useStyles22 = createStyles39(({ token, css }) => ({
|
|
|
34487
34531
|
display: flex;
|
|
34488
34532
|
align-items: center;
|
|
34489
34533
|
gap: 8px;
|
|
34490
|
-
|
|
34534
|
+
flex: 1;
|
|
34535
|
+
min-width: 0;
|
|
34491
34536
|
padding: 5px 8px;
|
|
34492
34537
|
border-radius: 4px;
|
|
34493
34538
|
cursor: pointer;
|
|
@@ -34642,7 +34687,6 @@ var FileDirectoryPanel = ({
|
|
|
34642
34687
|
const { styles } = useStyles22();
|
|
34643
34688
|
const { currentAssistant } = useAssistantContext();
|
|
34644
34689
|
const { getFileViewUrl } = useWorkspaceContext();
|
|
34645
|
-
const { post } = useApi();
|
|
34646
34690
|
const [sharePath, setSharePath] = useState84(null);
|
|
34647
34691
|
const renderEntry = React76.useCallback((entry, depth) => {
|
|
34648
34692
|
const entryName = getEntryName(entry);
|
|
@@ -34701,6 +34745,18 @@ var FileDirectoryPanel = ({
|
|
|
34701
34745
|
]
|
|
34702
34746
|
}
|
|
34703
34747
|
),
|
|
34748
|
+
/* @__PURE__ */ jsx129(
|
|
34749
|
+
PinToMenuButton,
|
|
34750
|
+
{
|
|
34751
|
+
contentType: "file",
|
|
34752
|
+
contentConfig: {
|
|
34753
|
+
resourcePath: entry.path,
|
|
34754
|
+
assistantId: currentAssistant?.id || "",
|
|
34755
|
+
fileName: entry.path.split("/").pop() || entry.path
|
|
34756
|
+
},
|
|
34757
|
+
isMatch: (cfg) => cfg.resourcePath === entry.path
|
|
34758
|
+
}
|
|
34759
|
+
),
|
|
34704
34760
|
/* @__PURE__ */ jsx129(
|
|
34705
34761
|
Dropdown6,
|
|
34706
34762
|
{
|
|
@@ -34730,32 +34786,6 @@ var FileDirectoryPanel = ({
|
|
|
34730
34786
|
icon: /* @__PURE__ */ jsx129(LinkOutlined5, {}),
|
|
34731
34787
|
label: "Share",
|
|
34732
34788
|
onClick: () => setSharePath(entry.path)
|
|
34733
|
-
},
|
|
34734
|
-
{
|
|
34735
|
-
key: "pin",
|
|
34736
|
-
icon: /* @__PURE__ */ jsx129(Pin2, { size: 14 }),
|
|
34737
|
-
label: "Pin to Menu",
|
|
34738
|
-
onClick: async () => {
|
|
34739
|
-
try {
|
|
34740
|
-
const fileName = entry.path.split("/").pop() || entry.path;
|
|
34741
|
-
await post("/api/menu-items", {
|
|
34742
|
-
menuTarget: "workspace",
|
|
34743
|
-
contentType: "file",
|
|
34744
|
-
contentConfig: {
|
|
34745
|
-
resourcePath: entry.path,
|
|
34746
|
-
workspaceId: workspaceId || "",
|
|
34747
|
-
projectId: projectId || "",
|
|
34748
|
-
assistantId: currentAssistant?.id || "",
|
|
34749
|
-
fileName
|
|
34750
|
-
},
|
|
34751
|
-
name: fileName,
|
|
34752
|
-
sortOrder: 0
|
|
34753
|
-
});
|
|
34754
|
-
message24.success(`Pinned "${fileName}" to menu`);
|
|
34755
|
-
} catch {
|
|
34756
|
-
message24.error("Failed to pin to menu");
|
|
34757
|
-
}
|
|
34758
|
-
}
|
|
34759
34789
|
}
|
|
34760
34790
|
]
|
|
34761
34791
|
},
|
|
@@ -34920,7 +34950,7 @@ var ToolPanelFiles = () => {
|
|
|
34920
34950
|
const handleAssetClick = useCallback44((asset) => {
|
|
34921
34951
|
const fileUrl = getFileViewUrl(asset.path, currentAssistant?.id);
|
|
34922
34952
|
if (!fileUrl) {
|
|
34923
|
-
|
|
34953
|
+
message24.warning("Please select a workspace and project first.");
|
|
34924
34954
|
return;
|
|
34925
34955
|
}
|
|
34926
34956
|
openSideApp({
|
|
@@ -34935,7 +34965,7 @@ var ToolPanelFiles = () => {
|
|
|
34935
34965
|
}, [getFileViewUrl, openSideApp, currentAssistant?.id]);
|
|
34936
34966
|
const handleUploadFolder = useCallback44(async (folderName) => {
|
|
34937
34967
|
if (!workspaceId || !projectId) {
|
|
34938
|
-
|
|
34968
|
+
message24.warning("Please select a workspace and project before uploading.");
|
|
34939
34969
|
return;
|
|
34940
34970
|
}
|
|
34941
34971
|
const input = document.createElement("input");
|
|
@@ -34949,14 +34979,14 @@ var ToolPanelFiles = () => {
|
|
|
34949
34979
|
setUploadingFolder(folderName);
|
|
34950
34980
|
try {
|
|
34951
34981
|
await uploadFileToFolder(folderName, file, currentAssistant?.id);
|
|
34952
|
-
|
|
34982
|
+
message24.success(`Uploaded "${file.name}" successfully`);
|
|
34953
34983
|
const folder = resourceFolders.find((item) => item.name === folderName);
|
|
34954
34984
|
if (folder) {
|
|
34955
34985
|
await loadAssetsForFolder(folder);
|
|
34956
34986
|
}
|
|
34957
34987
|
} catch (error) {
|
|
34958
34988
|
const errMsg = error instanceof Error ? error.message : "Failed to upload file";
|
|
34959
|
-
|
|
34989
|
+
message24.error(errMsg);
|
|
34960
34990
|
} finally {
|
|
34961
34991
|
setUploadingFolder(null);
|
|
34962
34992
|
input.remove();
|
|
@@ -35073,7 +35103,7 @@ import {
|
|
|
35073
35103
|
import React78, { useCallback as useCallback45 } from "react";
|
|
35074
35104
|
import { createStyles as createStyles41 } from "antd-style";
|
|
35075
35105
|
import { MessageSquare as MessageSquare4, Trash2 as Trash210 } from "lucide-react";
|
|
35076
|
-
import { message as
|
|
35106
|
+
import { message as message25, Modal as Modal26 } from "antd";
|
|
35077
35107
|
import { jsx as jsx132, jsxs as jsxs96 } from "react/jsx-runtime";
|
|
35078
35108
|
var useStyles24 = createStyles41(({ token, css }) => ({
|
|
35079
35109
|
container: css`
|
|
@@ -35196,9 +35226,9 @@ var ThreadHistoryMenuContent = () => {
|
|
|
35196
35226
|
onOk: async () => {
|
|
35197
35227
|
try {
|
|
35198
35228
|
await deleteThread(threadIdToDelete);
|
|
35199
|
-
|
|
35229
|
+
message25.success("Conversation deleted");
|
|
35200
35230
|
} catch (error) {
|
|
35201
|
-
|
|
35231
|
+
message25.error("Failed to delete conversation");
|
|
35202
35232
|
}
|
|
35203
35233
|
}
|
|
35204
35234
|
});
|
|
@@ -35562,7 +35592,7 @@ import {
|
|
|
35562
35592
|
Modal as Modal27,
|
|
35563
35593
|
Input as Input21,
|
|
35564
35594
|
Button as Button64,
|
|
35565
|
-
message as
|
|
35595
|
+
message as message26,
|
|
35566
35596
|
notification as notification5,
|
|
35567
35597
|
Typography as Typography63,
|
|
35568
35598
|
Alert as Alert9,
|
|
@@ -36122,7 +36152,7 @@ var SettingsModal = ({
|
|
|
36122
36152
|
}
|
|
36123
36153
|
} catch (error) {
|
|
36124
36154
|
console.error("Failed to load configuration:", error);
|
|
36125
|
-
|
|
36155
|
+
message26.error("Failed to load current configuration");
|
|
36126
36156
|
}
|
|
36127
36157
|
};
|
|
36128
36158
|
const loadModelsConfig = async (serverId) => {
|
|
@@ -36196,7 +36226,7 @@ var SettingsModal = ({
|
|
|
36196
36226
|
}, [open, activeTabKey, activeMenu]);
|
|
36197
36227
|
const handleAddServer = async () => {
|
|
36198
36228
|
if (!newServerUrl.trim()) {
|
|
36199
|
-
|
|
36229
|
+
message26.error("Please enter a server URL");
|
|
36200
36230
|
return;
|
|
36201
36231
|
}
|
|
36202
36232
|
let normalizedUrl = newServerUrl.trim();
|
|
@@ -36259,12 +36289,12 @@ var SettingsModal = ({
|
|
|
36259
36289
|
const handleSave = async () => {
|
|
36260
36290
|
const connection = connections.find((c) => c.id === activeTabKey);
|
|
36261
36291
|
if (!connection || !connection.connected) {
|
|
36262
|
-
|
|
36292
|
+
message26.error("Please connect to a server first");
|
|
36263
36293
|
return;
|
|
36264
36294
|
}
|
|
36265
36295
|
const url = connection.url;
|
|
36266
36296
|
if (!url) {
|
|
36267
|
-
|
|
36297
|
+
message26.error("Please connect to a server first");
|
|
36268
36298
|
return;
|
|
36269
36299
|
}
|
|
36270
36300
|
try {
|
|
@@ -36328,7 +36358,7 @@ var SettingsModal = ({
|
|
|
36328
36358
|
const data = await response.json();
|
|
36329
36359
|
if (response.ok && data.success) {
|
|
36330
36360
|
if (data.requiresRestart && data.requiresRestart.length > 0) {
|
|
36331
|
-
|
|
36361
|
+
message26.warning(
|
|
36332
36362
|
`Configuration saved. Please restart the server for ${data.requiresRestart.join(
|
|
36333
36363
|
", "
|
|
36334
36364
|
)} to take effect.`,
|
|
@@ -36342,12 +36372,12 @@ var SettingsModal = ({
|
|
|
36342
36372
|
}
|
|
36343
36373
|
if (data.warnings && data.warnings.length > 0) {
|
|
36344
36374
|
data.warnings.forEach((warning) => {
|
|
36345
|
-
|
|
36375
|
+
message26.warning(warning, 5);
|
|
36346
36376
|
});
|
|
36347
36377
|
}
|
|
36348
36378
|
onClose();
|
|
36349
36379
|
} else {
|
|
36350
|
-
|
|
36380
|
+
message26.error(data.error || "Failed to save configuration");
|
|
36351
36381
|
}
|
|
36352
36382
|
} else if (activeMenu === "models") {
|
|
36353
36383
|
const validModels = config.models.filter(
|
|
@@ -36372,12 +36402,12 @@ var SettingsModal = ({
|
|
|
36372
36402
|
});
|
|
36373
36403
|
onClose();
|
|
36374
36404
|
} else {
|
|
36375
|
-
|
|
36405
|
+
message26.error(data.error || "Failed to save model configuration");
|
|
36376
36406
|
}
|
|
36377
36407
|
}
|
|
36378
36408
|
} catch (error) {
|
|
36379
36409
|
console.error("Failed to save configuration:", error);
|
|
36380
|
-
|
|
36410
|
+
message26.error(error.message || "Failed to save configuration");
|
|
36381
36411
|
} finally {
|
|
36382
36412
|
setLoading(false);
|
|
36383
36413
|
}
|
|
@@ -36973,7 +37003,7 @@ import {
|
|
|
36973
37003
|
Spin as Spin24,
|
|
36974
37004
|
Tag as Tag31,
|
|
36975
37005
|
Typography as Typography64,
|
|
36976
|
-
message as
|
|
37006
|
+
message as message27
|
|
36977
37007
|
} from "antd";
|
|
36978
37008
|
import { Edit2 as Edit24, Plus as Plus10, RadioTower, Trash2 as Trash211 } from "lucide-react";
|
|
36979
37009
|
import { jsx as jsx138, jsxs as jsxs100 } from "react/jsx-runtime";
|
|
@@ -36994,12 +37024,12 @@ var ChannelInstallationsDrawerContent = () => {
|
|
|
36994
37024
|
setInstallations(result.data?.records ?? []);
|
|
36995
37025
|
} else {
|
|
36996
37026
|
setInstallations([]);
|
|
36997
|
-
|
|
37027
|
+
message27.error(result.message || "Failed to load channel installations");
|
|
36998
37028
|
}
|
|
36999
37029
|
} catch (error) {
|
|
37000
37030
|
console.error("Failed to load channel installations:", error);
|
|
37001
37031
|
setInstallations([]);
|
|
37002
|
-
|
|
37032
|
+
message27.error("Failed to load channel installations");
|
|
37003
37033
|
} finally {
|
|
37004
37034
|
setLoading(false);
|
|
37005
37035
|
}
|
|
@@ -37016,13 +37046,13 @@ var ChannelInstallationsDrawerContent = () => {
|
|
|
37016
37046
|
setInstallations(
|
|
37017
37047
|
(current) => current.filter((item) => item.id !== installation.id)
|
|
37018
37048
|
);
|
|
37019
|
-
|
|
37049
|
+
message27.success("Installation deleted");
|
|
37020
37050
|
} else {
|
|
37021
|
-
|
|
37051
|
+
message27.error(result.message || "Failed to delete installation");
|
|
37022
37052
|
}
|
|
37023
37053
|
} catch (error) {
|
|
37024
37054
|
console.error("Failed to delete channel installation:", error);
|
|
37025
|
-
|
|
37055
|
+
message27.error("Failed to delete installation");
|
|
37026
37056
|
}
|
|
37027
37057
|
};
|
|
37028
37058
|
return /* @__PURE__ */ jsxs100("div", { style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
|
|
@@ -37185,10 +37215,10 @@ var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCance
|
|
|
37185
37215
|
payload2
|
|
37186
37216
|
);
|
|
37187
37217
|
if (result2.success) {
|
|
37188
|
-
|
|
37218
|
+
message27.success("Installation updated");
|
|
37189
37219
|
onSave();
|
|
37190
37220
|
} else {
|
|
37191
|
-
|
|
37221
|
+
message27.error(result2.message || "Failed to update installation");
|
|
37192
37222
|
}
|
|
37193
37223
|
return;
|
|
37194
37224
|
}
|
|
@@ -37202,14 +37232,14 @@ var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCance
|
|
|
37202
37232
|
payload
|
|
37203
37233
|
);
|
|
37204
37234
|
if (result.success) {
|
|
37205
|
-
|
|
37235
|
+
message27.success("Installation created");
|
|
37206
37236
|
onSave();
|
|
37207
37237
|
} else {
|
|
37208
|
-
|
|
37238
|
+
message27.error(result.message || "Failed to create installation");
|
|
37209
37239
|
}
|
|
37210
37240
|
} catch (error) {
|
|
37211
37241
|
console.error("Failed to save channel installation:", error);
|
|
37212
|
-
|
|
37242
|
+
message27.error(
|
|
37213
37243
|
installation ? "Failed to update installation" : "Failed to create installation"
|
|
37214
37244
|
);
|
|
37215
37245
|
}
|