@axiom-lattice/react-sdk 2.1.76 → 2.1.78
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 +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +273 -176
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +598 -496
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -8779,7 +8779,7 @@ import { Typography as Typography43 } from "antd";
|
|
|
8779
8779
|
import {
|
|
8780
8780
|
CloudUploadOutlined,
|
|
8781
8781
|
PaperClipOutlined,
|
|
8782
|
-
ReloadOutlined as
|
|
8782
|
+
ReloadOutlined as ReloadOutlined4,
|
|
8783
8783
|
FileImageOutlined as FileImageOutlined5,
|
|
8784
8784
|
FileTextOutlined as FileTextOutlined10,
|
|
8785
8785
|
FilePdfOutlined as FilePdfOutlined5,
|
|
@@ -8794,7 +8794,7 @@ import {
|
|
|
8794
8794
|
import {
|
|
8795
8795
|
Attachments,
|
|
8796
8796
|
Prompts as Prompts3,
|
|
8797
|
-
Sender
|
|
8797
|
+
Sender,
|
|
8798
8798
|
Suggestion
|
|
8799
8799
|
} from "@ant-design/x";
|
|
8800
8800
|
|
|
@@ -8982,7 +8982,7 @@ import {
|
|
|
8982
8982
|
Space as Space30,
|
|
8983
8983
|
Typography as Typography42
|
|
8984
8984
|
} from "antd";
|
|
8985
|
-
import React51, { useCallback as
|
|
8985
|
+
import React51, { useCallback as useCallback33, useContext as useContext10, useEffect as useEffect45, useRef as useRef23, useState as useState65 } from "react";
|
|
8986
8986
|
import { BrainCircuit as BrainCircuit3 } from "lucide-react";
|
|
8987
8987
|
|
|
8988
8988
|
// src/components/GenUI/HITLContainer.tsx
|
|
@@ -10043,14 +10043,14 @@ var ThreadManagementButtons = () => {
|
|
|
10043
10043
|
import React43, {
|
|
10044
10044
|
createContext as createContext8,
|
|
10045
10045
|
useContext as useContext9,
|
|
10046
|
-
useState as
|
|
10047
|
-
useCallback as
|
|
10048
|
-
useEffect as
|
|
10046
|
+
useState as useState57,
|
|
10047
|
+
useCallback as useCallback31,
|
|
10048
|
+
useEffect as useEffect40
|
|
10049
10049
|
} from "react";
|
|
10050
10050
|
import { WorkspaceClient, Client as Client2 } from "@axiom-lattice/client-sdk";
|
|
10051
10051
|
|
|
10052
10052
|
// src/components/Chat/WorkspaceResourceManager.tsx
|
|
10053
|
-
import { useMemo as
|
|
10053
|
+
import { useMemo as useMemo20, useEffect as useEffect39, useRef as useRef17, useState as useState56 } from "react";
|
|
10054
10054
|
import { FolderOpen as FolderOpen2, Activity as Activity3, Database as Database4, Plug as Plug2, Bot as Bot2, Wrench, Zap, LogOut as LogOut3, Building2 as Building23, Key, Share2, History, Inbox, FlaskConical as FlaskConical3 } from "lucide-react";
|
|
10055
10055
|
import { Modal as Modal13, Avatar as Avatar8, Popover as Popover2, Button as Button41 } from "antd";
|
|
10056
10056
|
|
|
@@ -18089,7 +18089,7 @@ var ToolsList = ({
|
|
|
18089
18089
|
};
|
|
18090
18090
|
|
|
18091
18091
|
// src/components/Chat/TopologyAutomationView.tsx
|
|
18092
|
-
import { useEffect as
|
|
18092
|
+
import { useEffect as useEffect35, useState as useState50, useCallback as useCallback29, useMemo as useMemo17 } from "react";
|
|
18093
18093
|
import {
|
|
18094
18094
|
ReactFlow as ReactFlow3,
|
|
18095
18095
|
Background as Background3,
|
|
@@ -18102,8 +18102,8 @@ import {
|
|
|
18102
18102
|
ReactFlowProvider as ReactFlowProvider3
|
|
18103
18103
|
} from "@xyflow/react";
|
|
18104
18104
|
import "@xyflow/react/dist/style.css";
|
|
18105
|
-
import { Spin as
|
|
18106
|
-
import { PlusOutlined as PlusOutlined8, InfoCircleOutlined as InfoCircleOutlined5 } from "@ant-design/icons";
|
|
18105
|
+
import { Spin as Spin8, Empty as Empty5, Card as Card16, Typography as Typography29, Tag as Tag15, Avatar as Avatar7, Button as Button36, Modal as Modal11, Popconfirm as Popconfirm4 } from "antd";
|
|
18106
|
+
import { PlusOutlined as PlusOutlined8, InfoCircleOutlined as InfoCircleOutlined5, DeleteOutlined as DeleteOutlined3 } from "@ant-design/icons";
|
|
18107
18107
|
|
|
18108
18108
|
// src/components/Chat/TopologyNode.tsx
|
|
18109
18109
|
import { Handle as Handle3, Position as Position3 } from "@xyflow/react";
|
|
@@ -18220,143 +18220,11 @@ var TopologyNode = ({ data }) => {
|
|
|
18220
18220
|
var TopologyNode_default = TopologyNode;
|
|
18221
18221
|
|
|
18222
18222
|
// src/components/Chat/CopilotPanel.tsx
|
|
18223
|
-
import {
|
|
18224
|
-
import {
|
|
18225
|
-
import { Button as Button35, Typography as Typography28, Spin as Spin8 } from "antd";
|
|
18223
|
+
import { useMemo as useMemo16 } from "react";
|
|
18224
|
+
import { Button as Button35, Typography as Typography28 } from "antd";
|
|
18226
18225
|
import { CloseOutlined as CloseOutlined2 } from "@ant-design/icons";
|
|
18227
18226
|
import { jsx as jsx73, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
18228
18227
|
var { Text: Text25 } = Typography28;
|
|
18229
|
-
var CopilotPanelChatBody = ({ workflowContext, initialMessage, onInitialMessageSent }) => {
|
|
18230
|
-
const {
|
|
18231
|
-
messages,
|
|
18232
|
-
isLoading,
|
|
18233
|
-
error: chatError,
|
|
18234
|
-
sendMessage,
|
|
18235
|
-
stopStreaming,
|
|
18236
|
-
threadId
|
|
18237
|
-
} = useAgentChat();
|
|
18238
|
-
const [inputValue, setInputValue] = useState50("");
|
|
18239
|
-
const contextSentRef = useRef16(false);
|
|
18240
|
-
const initialMessageSentRef = useRef16(false);
|
|
18241
|
-
const prevLoadingRef = useRef16(false);
|
|
18242
|
-
const workflowId = workflowContext?.id;
|
|
18243
|
-
const workflowName = workflowContext?.name;
|
|
18244
|
-
useEffect34(() => {
|
|
18245
|
-
contextSentRef.current = false;
|
|
18246
|
-
}, [threadId]);
|
|
18247
|
-
useEffect34(() => {
|
|
18248
|
-
initialMessageSentRef.current = false;
|
|
18249
|
-
}, [threadId]);
|
|
18250
|
-
useEffect34(() => {
|
|
18251
|
-
const wasLoading = prevLoadingRef.current;
|
|
18252
|
-
prevLoadingRef.current = isLoading;
|
|
18253
|
-
if (wasLoading && !isLoading && initialMessage && threadId && !initialMessageSentRef.current) {
|
|
18254
|
-
initialMessageSentRef.current = true;
|
|
18255
|
-
const message23 = initialMessage.trim();
|
|
18256
|
-
if (message23) {
|
|
18257
|
-
const formattedMessage = [
|
|
18258
|
-
`Purpose: ${message23}`,
|
|
18259
|
-
"",
|
|
18260
|
-
`Configure the topology for workflow "${workflowId}" based on this purpose. Create sub-agents, set up the processing pipeline, and wire them together with topology edges.`,
|
|
18261
|
-
`The current name is a placeholder \u2014 feel free to update it via update_processing_agent if you have a better one.`
|
|
18262
|
-
].join("\n");
|
|
18263
|
-
sendMessage({
|
|
18264
|
-
input: { message: formattedMessage },
|
|
18265
|
-
streaming: true
|
|
18266
|
-
});
|
|
18267
|
-
onInitialMessageSent?.();
|
|
18268
|
-
}
|
|
18269
|
-
}
|
|
18270
|
-
}, [isLoading, initialMessage, threadId, sendMessage, onInitialMessageSent, workflowId, workflowName]);
|
|
18271
|
-
const handleSubmit = useCallback29(
|
|
18272
|
-
(nextContent) => {
|
|
18273
|
-
if (!nextContent.trim()) return;
|
|
18274
|
-
let finalContent = nextContent;
|
|
18275
|
-
if (workflowId && workflowName && !contextSentRef.current) {
|
|
18276
|
-
finalContent = `[Context: You're viewing workflow "${workflowName}" (agent: ${workflowId})]
|
|
18277
|
-
User: ${nextContent}`;
|
|
18278
|
-
contextSentRef.current = true;
|
|
18279
|
-
}
|
|
18280
|
-
sendMessage({
|
|
18281
|
-
input: { message: finalContent },
|
|
18282
|
-
streaming: true
|
|
18283
|
-
});
|
|
18284
|
-
setInputValue("");
|
|
18285
|
-
},
|
|
18286
|
-
[workflowId, workflowName, sendMessage]
|
|
18287
|
-
);
|
|
18288
|
-
const isEmpty = messages.length === 0 && !isLoading;
|
|
18289
|
-
const showContentLoading = isLoading && messages.length === 0;
|
|
18290
|
-
const hasContent = !isEmpty;
|
|
18291
|
-
return /* @__PURE__ */ jsxs48(
|
|
18292
|
-
"div",
|
|
18293
|
-
{
|
|
18294
|
-
style: {
|
|
18295
|
-
flex: 1,
|
|
18296
|
-
minHeight: 0,
|
|
18297
|
-
display: "flex",
|
|
18298
|
-
flexDirection: "column",
|
|
18299
|
-
padding: 0
|
|
18300
|
-
},
|
|
18301
|
-
children: [
|
|
18302
|
-
isEmpty && /* @__PURE__ */ jsxs48(
|
|
18303
|
-
"div",
|
|
18304
|
-
{
|
|
18305
|
-
style: {
|
|
18306
|
-
display: "flex",
|
|
18307
|
-
flexDirection: "column",
|
|
18308
|
-
justifyContent: "center",
|
|
18309
|
-
alignItems: "center",
|
|
18310
|
-
height: "100%",
|
|
18311
|
-
textAlign: "center",
|
|
18312
|
-
gap: 4
|
|
18313
|
-
},
|
|
18314
|
-
children: [
|
|
18315
|
-
/* @__PURE__ */ jsx73(Text25, { strong: true, children: "Workflow Builder" }),
|
|
18316
|
-
/* @__PURE__ */ jsx73(Text25, { type: "secondary", children: "Ask me to design, review, or modify your workflows" })
|
|
18317
|
-
]
|
|
18318
|
-
}
|
|
18319
|
-
),
|
|
18320
|
-
showContentLoading && /* @__PURE__ */ jsx73(
|
|
18321
|
-
"div",
|
|
18322
|
-
{
|
|
18323
|
-
style: {
|
|
18324
|
-
display: "flex",
|
|
18325
|
-
justifyContent: "center",
|
|
18326
|
-
alignItems: "center",
|
|
18327
|
-
height: "100%"
|
|
18328
|
-
},
|
|
18329
|
-
children: /* @__PURE__ */ jsx73(Spin8, {})
|
|
18330
|
-
}
|
|
18331
|
-
),
|
|
18332
|
-
hasContent && /* @__PURE__ */ jsx73("div", { style: { flex: 1, minHeight: 0, display: "flex" }, children: /* @__PURE__ */ jsx73(MessageList, { messages }) }),
|
|
18333
|
-
chatError && /* @__PURE__ */ jsx73("div", { style: { padding: "8px 8px" }, children: /* @__PURE__ */ jsx73(Text25, { type: "danger", children: chatError.message }) }),
|
|
18334
|
-
/* @__PURE__ */ jsx73(
|
|
18335
|
-
"div",
|
|
18336
|
-
{
|
|
18337
|
-
style: {
|
|
18338
|
-
padding: "12px 8px",
|
|
18339
|
-
borderTop: "1px solid #f0f0f0",
|
|
18340
|
-
flexShrink: 0
|
|
18341
|
-
},
|
|
18342
|
-
children: /* @__PURE__ */ jsx73(
|
|
18343
|
-
Sender,
|
|
18344
|
-
{
|
|
18345
|
-
value: inputValue,
|
|
18346
|
-
placeholder: "Ask about workflows...",
|
|
18347
|
-
onChange: setInputValue,
|
|
18348
|
-
onSubmit: handleSubmit,
|
|
18349
|
-
loading: isLoading,
|
|
18350
|
-
onCancel: () => stopStreaming(),
|
|
18351
|
-
allowSpeech: false
|
|
18352
|
-
}
|
|
18353
|
-
)
|
|
18354
|
-
}
|
|
18355
|
-
)
|
|
18356
|
-
]
|
|
18357
|
-
}
|
|
18358
|
-
);
|
|
18359
|
-
};
|
|
18360
18228
|
var CopilotPanel = ({
|
|
18361
18229
|
workflowContext,
|
|
18362
18230
|
onClose,
|
|
@@ -18366,6 +18234,21 @@ var CopilotPanel = ({
|
|
|
18366
18234
|
}) => {
|
|
18367
18235
|
const client = useClient("agent-architect");
|
|
18368
18236
|
const threadId = workflowContext?.id ? `${client.tenantId}:${workflowContext.id}` : null;
|
|
18237
|
+
const systemContext = useMemo16(() => {
|
|
18238
|
+
if (workflowContext?.id && workflowContext?.name) {
|
|
18239
|
+
return `[Context: You're viewing workflow "${workflowContext.name}" (agent: ${workflowContext.id})]`;
|
|
18240
|
+
}
|
|
18241
|
+
return void 0;
|
|
18242
|
+
}, [workflowContext]);
|
|
18243
|
+
const initialMessageContent = useMemo16(() => {
|
|
18244
|
+
if (!initialMessage || !workflowContext?.id) return void 0;
|
|
18245
|
+
return [
|
|
18246
|
+
`Purpose: ${initialMessage.trim()}`,
|
|
18247
|
+
"",
|
|
18248
|
+
`Configure the topology for workflow "${workflowContext.id}" based on this purpose. Create sub-agents, set up the processing pipeline, and wire them together with topology edges.`,
|
|
18249
|
+
`The current name is a placeholder \u2014 feel free to update it via update_processing_agent if you have a better one.`
|
|
18250
|
+
].join("\n");
|
|
18251
|
+
}, [initialMessage, workflowContext?.id]);
|
|
18369
18252
|
return /* @__PURE__ */ jsxs48(
|
|
18370
18253
|
"div",
|
|
18371
18254
|
{
|
|
@@ -18417,10 +18300,16 @@ var CopilotPanel = ({
|
|
|
18417
18300
|
options: { streaming: true },
|
|
18418
18301
|
onToolCompleted,
|
|
18419
18302
|
children: /* @__PURE__ */ jsx73(
|
|
18420
|
-
|
|
18303
|
+
Chating,
|
|
18421
18304
|
{
|
|
18422
|
-
|
|
18423
|
-
|
|
18305
|
+
showHeader: false,
|
|
18306
|
+
showEmptyState: false,
|
|
18307
|
+
showDatabaseSlot: false,
|
|
18308
|
+
showSkillSlot: false,
|
|
18309
|
+
showAgentSlot: false,
|
|
18310
|
+
showMetricsDataSourceSlot: false,
|
|
18311
|
+
systemContext,
|
|
18312
|
+
initialMessage: initialMessageContent,
|
|
18424
18313
|
onInitialMessageSent
|
|
18425
18314
|
}
|
|
18426
18315
|
)
|
|
@@ -18452,7 +18341,7 @@ var CopilotPanel = ({
|
|
|
18452
18341
|
};
|
|
18453
18342
|
|
|
18454
18343
|
// src/components/Chat/CreateWorkflowModal.tsx
|
|
18455
|
-
import { useEffect as
|
|
18344
|
+
import { useEffect as useEffect34 } from "react";
|
|
18456
18345
|
import { Modal as Modal10, Form as Form7, Input as Input13 } from "antd";
|
|
18457
18346
|
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
18458
18347
|
function extractName(purpose) {
|
|
@@ -18477,7 +18366,7 @@ var CreateWorkflowModal = ({
|
|
|
18477
18366
|
}) => {
|
|
18478
18367
|
const { post } = useApi();
|
|
18479
18368
|
const [form] = Form7.useForm();
|
|
18480
|
-
|
|
18369
|
+
useEffect34(() => {
|
|
18481
18370
|
if (open) {
|
|
18482
18371
|
form.resetFields();
|
|
18483
18372
|
}
|
|
@@ -18661,14 +18550,15 @@ function TopologyFlowInner({
|
|
|
18661
18550
|
selectedWorkflowId,
|
|
18662
18551
|
onSelectWorkflow,
|
|
18663
18552
|
onCreateWorkflow,
|
|
18553
|
+
onDeleteWorkflow,
|
|
18664
18554
|
nodes: initialNodes,
|
|
18665
18555
|
edges: initialEdges
|
|
18666
18556
|
}) {
|
|
18667
18557
|
const [nodes, setNodes, onNodesChange] = useNodesState3(initialNodes);
|
|
18668
18558
|
const [edges, setEdges, onEdgesChange] = useEdgesState3(initialEdges);
|
|
18669
|
-
const [specModalOpen, setSpecModalOpen] =
|
|
18670
|
-
const nodeTypes2 =
|
|
18671
|
-
|
|
18559
|
+
const [specModalOpen, setSpecModalOpen] = useState50(false);
|
|
18560
|
+
const nodeTypes2 = useMemo17(() => ({ topologyNode: TopologyNode_default }), []);
|
|
18561
|
+
useEffect35(() => {
|
|
18672
18562
|
setNodes(initialNodes);
|
|
18673
18563
|
setEdges(initialEdges);
|
|
18674
18564
|
}, [initialNodes, initialEdges, setNodes, setEdges]);
|
|
@@ -18792,7 +18682,8 @@ function TopologyFlowInner({
|
|
|
18792
18682
|
display: "flex",
|
|
18793
18683
|
alignItems: "center",
|
|
18794
18684
|
gap: 6,
|
|
18795
|
-
|
|
18685
|
+
height: 32,
|
|
18686
|
+
padding: "0 14px",
|
|
18796
18687
|
background: "rgba(255,255,255,0.95)",
|
|
18797
18688
|
borderRadius: 10,
|
|
18798
18689
|
boxShadow: "0 2px 12px rgba(0,0,0,0.08)",
|
|
@@ -18810,6 +18701,42 @@ function TopologyFlowInner({
|
|
|
18810
18701
|
]
|
|
18811
18702
|
}
|
|
18812
18703
|
),
|
|
18704
|
+
/* @__PURE__ */ jsx75(
|
|
18705
|
+
"div",
|
|
18706
|
+
{
|
|
18707
|
+
style: {
|
|
18708
|
+
position: "absolute",
|
|
18709
|
+
top: 12,
|
|
18710
|
+
right: 12,
|
|
18711
|
+
zIndex: 10,
|
|
18712
|
+
display: "flex",
|
|
18713
|
+
alignItems: "center",
|
|
18714
|
+
height: 32,
|
|
18715
|
+
padding: "0 14px",
|
|
18716
|
+
background: "rgba(255,255,255,0.95)",
|
|
18717
|
+
borderRadius: 10,
|
|
18718
|
+
boxShadow: "0 2px 12px rgba(0,0,0,0.08)",
|
|
18719
|
+
border: "1px solid #f0f0f0"
|
|
18720
|
+
},
|
|
18721
|
+
children: /* @__PURE__ */ jsx75(
|
|
18722
|
+
Popconfirm4,
|
|
18723
|
+
{
|
|
18724
|
+
title: "Delete workflow",
|
|
18725
|
+
description: "This will delete the workflow and all associated topology. This action cannot be undone.",
|
|
18726
|
+
onConfirm: () => onDeleteWorkflow(selectedAgent.id),
|
|
18727
|
+
okText: "Delete",
|
|
18728
|
+
cancelText: "Cancel",
|
|
18729
|
+
okButtonProps: { danger: true },
|
|
18730
|
+
children: /* @__PURE__ */ jsx75(
|
|
18731
|
+
DeleteOutlined3,
|
|
18732
|
+
{
|
|
18733
|
+
style: { color: "#ff4d4f", cursor: "pointer", fontSize: 15 }
|
|
18734
|
+
}
|
|
18735
|
+
)
|
|
18736
|
+
}
|
|
18737
|
+
)
|
|
18738
|
+
}
|
|
18739
|
+
),
|
|
18813
18740
|
/* @__PURE__ */ jsx75(
|
|
18814
18741
|
Modal11,
|
|
18815
18742
|
{
|
|
@@ -18838,16 +18765,16 @@ function TopologyFlowInner({
|
|
|
18838
18765
|
] });
|
|
18839
18766
|
}
|
|
18840
18767
|
var TopologyAutomationView = () => {
|
|
18841
|
-
const { get } = useApi();
|
|
18842
|
-
const [agents, setAgents] =
|
|
18843
|
-
const [agentNameMap, setAgentNameMap] =
|
|
18844
|
-
const [selectedWorkflowId, setSelectedWorkflowId] =
|
|
18845
|
-
const [copilotOpen, setCopilotOpen] =
|
|
18846
|
-
const [initialLoading, setInitialLoading] =
|
|
18847
|
-
const [error, setError] =
|
|
18848
|
-
const [isCreateModalOpen, setIsCreateModalOpen] =
|
|
18849
|
-
const [initialMessage, setInitialMessage] =
|
|
18850
|
-
const workflowTools =
|
|
18768
|
+
const { get, del } = useApi();
|
|
18769
|
+
const [agents, setAgents] = useState50([]);
|
|
18770
|
+
const [agentNameMap, setAgentNameMap] = useState50(/* @__PURE__ */ new Map());
|
|
18771
|
+
const [selectedWorkflowId, setSelectedWorkflowId] = useState50(null);
|
|
18772
|
+
const [copilotOpen, setCopilotOpen] = useState50(true);
|
|
18773
|
+
const [initialLoading, setInitialLoading] = useState50(true);
|
|
18774
|
+
const [error, setError] = useState50(null);
|
|
18775
|
+
const [isCreateModalOpen, setIsCreateModalOpen] = useState50(false);
|
|
18776
|
+
const [initialMessage, setInitialMessage] = useState50(null);
|
|
18777
|
+
const workflowTools = useMemo17(
|
|
18851
18778
|
() => [
|
|
18852
18779
|
"create_agent",
|
|
18853
18780
|
"create_processing_agent",
|
|
@@ -18857,7 +18784,7 @@ var TopologyAutomationView = () => {
|
|
|
18857
18784
|
],
|
|
18858
18785
|
[]
|
|
18859
18786
|
);
|
|
18860
|
-
const fetchData =
|
|
18787
|
+
const fetchData = useCallback29(async () => {
|
|
18861
18788
|
const [wfRes, assistantsRes] = await Promise.all([
|
|
18862
18789
|
get("/api/workflows/definitions"),
|
|
18863
18790
|
get("/api/assistants")
|
|
@@ -18881,7 +18808,7 @@ var TopologyAutomationView = () => {
|
|
|
18881
18808
|
}
|
|
18882
18809
|
setError(null);
|
|
18883
18810
|
}, [get]);
|
|
18884
|
-
|
|
18811
|
+
useEffect35(() => {
|
|
18885
18812
|
let cancelled = false;
|
|
18886
18813
|
const load = async () => {
|
|
18887
18814
|
try {
|
|
@@ -18900,7 +18827,7 @@ var TopologyAutomationView = () => {
|
|
|
18900
18827
|
cancelled = true;
|
|
18901
18828
|
};
|
|
18902
18829
|
}, [fetchData]);
|
|
18903
|
-
const handleWorkflowCreated =
|
|
18830
|
+
const handleWorkflowCreated = useCallback29((id, purpose) => {
|
|
18904
18831
|
setIsCreateModalOpen(false);
|
|
18905
18832
|
fetchData().then(() => {
|
|
18906
18833
|
setSelectedWorkflowId(id);
|
|
@@ -18909,27 +18836,37 @@ var TopologyAutomationView = () => {
|
|
|
18909
18836
|
}
|
|
18910
18837
|
});
|
|
18911
18838
|
}, [fetchData]);
|
|
18912
|
-
const handleSelectWorkflow =
|
|
18839
|
+
const handleSelectWorkflow = useCallback29((id) => {
|
|
18913
18840
|
setSelectedWorkflowId(id);
|
|
18914
18841
|
}, []);
|
|
18915
|
-
const
|
|
18842
|
+
const handleDeleteWorkflow = useCallback29(async (id) => {
|
|
18843
|
+
try {
|
|
18844
|
+
await del(`/api/assistants/${id}`);
|
|
18845
|
+
setSelectedWorkflowId(null);
|
|
18846
|
+
await fetchData();
|
|
18847
|
+
} catch (err) {
|
|
18848
|
+
const message23 = err instanceof Error ? err.message : "Failed to delete workflow";
|
|
18849
|
+
setError(message23);
|
|
18850
|
+
}
|
|
18851
|
+
}, [del, fetchData]);
|
|
18852
|
+
const selectedAgent = useMemo17(
|
|
18916
18853
|
() => agents.find((a) => a.id === selectedWorkflowId) || null,
|
|
18917
18854
|
[agents, selectedWorkflowId]
|
|
18918
18855
|
);
|
|
18919
|
-
const selectedWorkflowName =
|
|
18856
|
+
const selectedWorkflowName = useMemo17(
|
|
18920
18857
|
() => selectedAgent?.name || null,
|
|
18921
18858
|
[selectedAgent]
|
|
18922
18859
|
);
|
|
18923
|
-
const workflowContext =
|
|
18860
|
+
const workflowContext = useMemo17(
|
|
18924
18861
|
() => selectedWorkflowId && selectedWorkflowName ? { id: selectedWorkflowId, name: selectedWorkflowName } : null,
|
|
18925
18862
|
[selectedWorkflowId, selectedWorkflowName]
|
|
18926
18863
|
);
|
|
18927
|
-
const { nodes, edges } =
|
|
18864
|
+
const { nodes, edges } = useMemo17(
|
|
18928
18865
|
() => selectedAgent ? buildGraph([selectedAgent], agentNameMap) : { nodes: [], edges: [] },
|
|
18929
18866
|
[selectedAgent, agentNameMap]
|
|
18930
18867
|
);
|
|
18931
18868
|
if (initialLoading) {
|
|
18932
|
-
return /* @__PURE__ */ jsx75("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%" }, children: /* @__PURE__ */ jsx75(
|
|
18869
|
+
return /* @__PURE__ */ jsx75("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%" }, children: /* @__PURE__ */ jsx75(Spin8, { size: "large", tip: "Loading workflows..." }) });
|
|
18933
18870
|
}
|
|
18934
18871
|
if (error) {
|
|
18935
18872
|
return /* @__PURE__ */ jsx75(Empty5, { description: error });
|
|
@@ -18982,6 +18919,7 @@ var TopologyAutomationView = () => {
|
|
|
18982
18919
|
selectedWorkflowId,
|
|
18983
18920
|
onSelectWorkflow: handleSelectWorkflow,
|
|
18984
18921
|
onCreateWorkflow: () => setIsCreateModalOpen(true),
|
|
18922
|
+
onDeleteWorkflow: handleDeleteWorkflow,
|
|
18985
18923
|
nodes,
|
|
18986
18924
|
edges
|
|
18987
18925
|
}
|
|
@@ -19039,9 +18977,9 @@ var TopologyAutomationView = () => {
|
|
|
19039
18977
|
};
|
|
19040
18978
|
|
|
19041
18979
|
// src/components/Chat/TopologyRuntimeView.tsx
|
|
19042
|
-
import { useEffect as
|
|
18980
|
+
import { useEffect as useEffect36, useState as useState51, useMemo as useMemo18, useCallback as useCallback30, useRef as useRef16 } from "react";
|
|
19043
18981
|
import {
|
|
19044
|
-
Spin as
|
|
18982
|
+
Spin as Spin9,
|
|
19045
18983
|
Empty as Empty6,
|
|
19046
18984
|
List as List7,
|
|
19047
18985
|
Tag as Tag16,
|
|
@@ -19050,13 +18988,18 @@ import {
|
|
|
19050
18988
|
Card as Card17,
|
|
19051
18989
|
Drawer as Drawer2,
|
|
19052
18990
|
Badge as Badge5,
|
|
19053
|
-
|
|
18991
|
+
Tooltip as Tooltip13,
|
|
18992
|
+
Progress as Progress3,
|
|
18993
|
+
Switch as Switch3,
|
|
18994
|
+
Popconfirm as Popconfirm5
|
|
19054
18995
|
} from "antd";
|
|
19055
18996
|
import {
|
|
19056
18997
|
CheckCircleOutlined as CheckCircleOutlined5,
|
|
19057
18998
|
SyncOutlined as SyncOutlined2,
|
|
19058
18999
|
CloseCircleOutlined as CloseCircleOutlined2,
|
|
19059
|
-
ClockCircleOutlined as ClockCircleOutlined3
|
|
19000
|
+
ClockCircleOutlined as ClockCircleOutlined3,
|
|
19001
|
+
ReloadOutlined as ReloadOutlined2,
|
|
19002
|
+
DeleteOutlined as DeleteOutlined4
|
|
19060
19003
|
} from "@ant-design/icons";
|
|
19061
19004
|
import {
|
|
19062
19005
|
ReactFlow as ReactFlow4,
|
|
@@ -19179,7 +19122,7 @@ function StepNode({ data, selected }) {
|
|
|
19179
19122
|
}
|
|
19180
19123
|
var nodeTypes = { stepNode: StepNode };
|
|
19181
19124
|
function useLayoutedElements(steps) {
|
|
19182
|
-
return
|
|
19125
|
+
return useMemo18(() => {
|
|
19183
19126
|
if (steps.length === 0) return [];
|
|
19184
19127
|
const g = new dagre.graphlib.Graph();
|
|
19185
19128
|
g.setGraph({ rankdir: "TB", nodesep: 40, ranksep: 40 });
|
|
@@ -19205,7 +19148,7 @@ function useLayoutedElements(steps) {
|
|
|
19205
19148
|
}, [steps]);
|
|
19206
19149
|
}
|
|
19207
19150
|
function useEdgesFromSteps(steps) {
|
|
19208
|
-
return
|
|
19151
|
+
return useMemo18(() => {
|
|
19209
19152
|
const edges = [];
|
|
19210
19153
|
for (let i = 0; i < steps.length - 1; i++) {
|
|
19211
19154
|
const fromStep = steps[i];
|
|
@@ -19348,16 +19291,16 @@ function FlowCanvas({ steps }) {
|
|
|
19348
19291
|
const initialEdges = useEdgesFromSteps(steps);
|
|
19349
19292
|
const [nodes, setNodes, onNodesChange] = useNodesState4(initialNodes);
|
|
19350
19293
|
const [edges, setEdges, onEdgesChange] = useEdgesState4(initialEdges);
|
|
19351
|
-
const [selectedNodeId, setSelectedNodeId] =
|
|
19352
|
-
const selectedStep =
|
|
19294
|
+
const [selectedNodeId, setSelectedNodeId] = useState51(null);
|
|
19295
|
+
const selectedStep = useMemo18(
|
|
19353
19296
|
() => steps.find((s) => s.id === selectedNodeId) || null,
|
|
19354
19297
|
[steps, selectedNodeId]
|
|
19355
19298
|
);
|
|
19356
|
-
|
|
19299
|
+
useEffect36(() => {
|
|
19357
19300
|
setNodes(initialNodes);
|
|
19358
19301
|
setEdges(initialEdges);
|
|
19359
19302
|
}, [initialNodes, initialEdges, setNodes, setEdges]);
|
|
19360
|
-
|
|
19303
|
+
useEffect36(() => {
|
|
19361
19304
|
if (selectedNodeId) {
|
|
19362
19305
|
setNodes(
|
|
19363
19306
|
(nds) => nds.map((n) => ({
|
|
@@ -19367,13 +19310,13 @@ function FlowCanvas({ steps }) {
|
|
|
19367
19310
|
);
|
|
19368
19311
|
}
|
|
19369
19312
|
}, [selectedNodeId, setNodes]);
|
|
19370
|
-
const onNodeClick =
|
|
19313
|
+
const onNodeClick = useCallback30(
|
|
19371
19314
|
(_event, node) => {
|
|
19372
19315
|
setSelectedNodeId(node.id);
|
|
19373
19316
|
},
|
|
19374
19317
|
[]
|
|
19375
19318
|
);
|
|
19376
|
-
const onPaneClick =
|
|
19319
|
+
const onPaneClick = useCallback30(() => {
|
|
19377
19320
|
setNodes(
|
|
19378
19321
|
(nds) => nds.map((n) => ({
|
|
19379
19322
|
...n,
|
|
@@ -19550,26 +19493,69 @@ function RunSummaryBanner({ run, agentName }) {
|
|
|
19550
19493
|
}
|
|
19551
19494
|
);
|
|
19552
19495
|
}
|
|
19553
|
-
var RunDetail = ({ run, agentName, open, onClose }) => {
|
|
19496
|
+
var RunDetail = ({ run, agentName, open, onClose, onRunUpdate, autoRefresh, onAutoRefreshChange }) => {
|
|
19554
19497
|
const { get } = useApi();
|
|
19555
|
-
const [steps, setSteps] =
|
|
19556
|
-
const [loading, setLoading] =
|
|
19557
|
-
|
|
19498
|
+
const [steps, setSteps] = useState51([]);
|
|
19499
|
+
const [loading, setLoading] = useState51(false);
|
|
19500
|
+
const stepsPollTimeoutRef = useRef16(null);
|
|
19501
|
+
const stepsPollSessionRef = useRef16(0);
|
|
19502
|
+
const fetchSteps = useCallback30(async () => {
|
|
19503
|
+
try {
|
|
19504
|
+
const [stepsRes, runsRes] = await Promise.all([
|
|
19505
|
+
get(
|
|
19506
|
+
`/api/workflows/runs/${run.id}/steps`
|
|
19507
|
+
),
|
|
19508
|
+
get(
|
|
19509
|
+
"/api/workflows/runs"
|
|
19510
|
+
)
|
|
19511
|
+
]);
|
|
19512
|
+
if (stepsRes.success) setSteps(stepsRes.data?.records || []);
|
|
19513
|
+
if (runsRes.success && runsRes.data?.records) {
|
|
19514
|
+
const matched = runsRes.data.records.find((r) => r.id === run.id);
|
|
19515
|
+
if (matched) onRunUpdate(matched);
|
|
19516
|
+
}
|
|
19517
|
+
} catch {
|
|
19518
|
+
}
|
|
19519
|
+
}, [get, run.id, onRunUpdate]);
|
|
19520
|
+
useEffect36(() => {
|
|
19558
19521
|
if (!open) return;
|
|
19559
19522
|
setLoading(true);
|
|
19560
|
-
|
|
19561
|
-
|
|
19562
|
-
|
|
19563
|
-
|
|
19564
|
-
|
|
19565
|
-
|
|
19566
|
-
|
|
19523
|
+
fetchSteps().finally(() => setLoading(false));
|
|
19524
|
+
}, [open, run.id, fetchSteps]);
|
|
19525
|
+
useEffect36(() => {
|
|
19526
|
+
if (stepsPollTimeoutRef.current) {
|
|
19527
|
+
clearTimeout(stepsPollTimeoutRef.current);
|
|
19528
|
+
stepsPollTimeoutRef.current = null;
|
|
19529
|
+
}
|
|
19530
|
+
if (!open || run.status !== "running" || !autoRefresh) return;
|
|
19531
|
+
const sessionId = Date.now();
|
|
19532
|
+
stepsPollSessionRef.current = sessionId;
|
|
19533
|
+
const poll = async () => {
|
|
19534
|
+
if (stepsPollSessionRef.current !== sessionId) return;
|
|
19535
|
+
await fetchSteps();
|
|
19536
|
+
if (stepsPollSessionRef.current === sessionId) {
|
|
19537
|
+
stepsPollTimeoutRef.current = setTimeout(poll, POLLING_INTERVAL);
|
|
19538
|
+
}
|
|
19539
|
+
};
|
|
19540
|
+
poll();
|
|
19541
|
+
return () => {
|
|
19542
|
+
stepsPollSessionRef.current = 0;
|
|
19543
|
+
if (stepsPollTimeoutRef.current) {
|
|
19544
|
+
clearTimeout(stepsPollTimeoutRef.current);
|
|
19545
|
+
stepsPollTimeoutRef.current = null;
|
|
19546
|
+
}
|
|
19547
|
+
};
|
|
19548
|
+
}, [open, run.status, fetchSteps, autoRefresh]);
|
|
19567
19549
|
return /* @__PURE__ */ jsxs50(
|
|
19568
19550
|
Drawer2,
|
|
19569
19551
|
{
|
|
19570
19552
|
title: /* @__PURE__ */ jsxs50(Space23, { children: [
|
|
19571
19553
|
/* @__PURE__ */ jsx76(Text27, { strong: true, children: "Pipeline Execution" }),
|
|
19572
|
-
/* @__PURE__ */ jsx76(Tag16, { color: "purple", style: { fontSize: 11 }, children: "Flow View" })
|
|
19554
|
+
/* @__PURE__ */ jsx76(Tag16, { color: "purple", style: { fontSize: 11 }, children: "Flow View" }),
|
|
19555
|
+
/* @__PURE__ */ jsxs50(Space23, { size: 4, style: { marginLeft: 12 }, children: [
|
|
19556
|
+
/* @__PURE__ */ jsx76(Text27, { type: "secondary", style: { fontSize: 11 }, children: "Auto-refresh" }),
|
|
19557
|
+
/* @__PURE__ */ jsx76(Switch3, { size: "small", checked: autoRefresh, onChange: onAutoRefreshChange })
|
|
19558
|
+
] })
|
|
19573
19559
|
] }),
|
|
19574
19560
|
placement: "right",
|
|
19575
19561
|
width: "90%",
|
|
@@ -19578,7 +19564,7 @@ var RunDetail = ({ run, agentName, open, onClose }) => {
|
|
|
19578
19564
|
styles: { body: { padding: "12px 0" } },
|
|
19579
19565
|
children: [
|
|
19580
19566
|
/* @__PURE__ */ jsx76("div", { style: { padding: "0 12px", marginBottom: 12 }, children: /* @__PURE__ */ jsx76(RunSummaryBanner, { run, agentName }) }),
|
|
19581
|
-
loading ? /* @__PURE__ */ jsx76("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: 300 }, children: /* @__PURE__ */ jsx76(
|
|
19567
|
+
loading ? /* @__PURE__ */ jsx76("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: 300 }, children: /* @__PURE__ */ jsx76(Spin9, { size: "large" }) }) : steps.length === 0 ? /* @__PURE__ */ jsx76("div", { style: { padding: "0 12px" }, children: /* @__PURE__ */ jsx76(Text27, { type: "secondary", children: "No step records yet" }) }) : /* @__PURE__ */ jsx76("div", { style: { width: "100%", height: "calc(100vh - 200px)", position: "relative" }, children: /* @__PURE__ */ jsx76(ReactFlowProvider4, { children: /* @__PURE__ */ jsx76(FlowCanvas, { steps }) }) }),
|
|
19582
19568
|
run.errorMessage && /* @__PURE__ */ jsx76("div", { style: { padding: "0 12px", marginTop: 12 }, children: /* @__PURE__ */ jsx76(
|
|
19583
19569
|
"div",
|
|
19584
19570
|
{
|
|
@@ -19595,16 +19581,64 @@ var RunDetail = ({ run, agentName, open, onClose }) => {
|
|
|
19595
19581
|
}
|
|
19596
19582
|
);
|
|
19597
19583
|
};
|
|
19584
|
+
var POLLING_INTERVAL = 3e3;
|
|
19598
19585
|
var TopologyRuntimeView = () => {
|
|
19599
|
-
const { get } = useApi();
|
|
19600
|
-
const [runs, setRuns] =
|
|
19601
|
-
const [agentNames, setAgentNames] =
|
|
19602
|
-
const [loading, setLoading] =
|
|
19603
|
-
const [error, setError] =
|
|
19604
|
-
const [selectedRun, setSelectedRun] =
|
|
19605
|
-
|
|
19586
|
+
const { get, del } = useApi();
|
|
19587
|
+
const [runs, setRuns] = useState51([]);
|
|
19588
|
+
const [agentNames, setAgentNames] = useState51({});
|
|
19589
|
+
const [loading, setLoading] = useState51(true);
|
|
19590
|
+
const [error, setError] = useState51(null);
|
|
19591
|
+
const [selectedRun, setSelectedRun] = useState51(null);
|
|
19592
|
+
const [autoRefresh, setAutoRefresh] = useState51(true);
|
|
19593
|
+
const pollingSessionRef = useRef16(0);
|
|
19594
|
+
const handleRunUpdate = useCallback30((updated) => {
|
|
19595
|
+
setRuns(
|
|
19596
|
+
(prev) => prev.map((r) => r.id === updated.id ? updated : r)
|
|
19597
|
+
);
|
|
19598
|
+
setSelectedRun((prev) => prev?.id === updated.id ? updated : prev);
|
|
19599
|
+
}, []);
|
|
19600
|
+
const handleDeleteRun = useCallback30(async (runId) => {
|
|
19601
|
+
try {
|
|
19602
|
+
await del(`/api/workflows/runs/${runId}`);
|
|
19603
|
+
setRuns((prev) => prev.filter((r) => r.id !== runId));
|
|
19604
|
+
setSelectedRun((prev) => prev?.id === runId ? null : prev);
|
|
19605
|
+
} catch (err) {
|
|
19606
|
+
const message23 = err instanceof Error ? err.message : "Failed to delete run";
|
|
19607
|
+
setError(message23);
|
|
19608
|
+
}
|
|
19609
|
+
}, [del]);
|
|
19610
|
+
const refreshRuns = useCallback30(async () => {
|
|
19611
|
+
setLoading(true);
|
|
19612
|
+
try {
|
|
19613
|
+
const defsRes = await get("/api/workflows/definitions");
|
|
19614
|
+
const nameMap = {};
|
|
19615
|
+
if (defsRes.success && defsRes.data?.records) {
|
|
19616
|
+
defsRes.data.records.forEach((d) => {
|
|
19617
|
+
nameMap[d.assistantId] = d.assistantName;
|
|
19618
|
+
});
|
|
19619
|
+
}
|
|
19620
|
+
setAgentNames(nameMap);
|
|
19621
|
+
const runsRes = await get("/api/workflows/runs");
|
|
19622
|
+
if (runsRes.success && runsRes.data?.records) {
|
|
19623
|
+
runsRes.data.records.sort(
|
|
19624
|
+
(a, b) => new Date(b.startedAt).getTime() - new Date(a.startedAt).getTime()
|
|
19625
|
+
);
|
|
19626
|
+
setRuns(runsRes.data.records);
|
|
19627
|
+
setSelectedRun((prev) => {
|
|
19628
|
+
if (!prev) return null;
|
|
19629
|
+
return runsRes.data.records.find((r) => r.id === prev.id) || prev;
|
|
19630
|
+
});
|
|
19631
|
+
}
|
|
19632
|
+
setError(null);
|
|
19633
|
+
} catch (err) {
|
|
19634
|
+
setError(err instanceof Error ? err.message : "Failed to load workflow runs");
|
|
19635
|
+
} finally {
|
|
19636
|
+
setLoading(false);
|
|
19637
|
+
}
|
|
19638
|
+
}, [get]);
|
|
19639
|
+
useEffect36(() => {
|
|
19606
19640
|
let cancelled = false;
|
|
19607
|
-
const
|
|
19641
|
+
const init2 = async () => {
|
|
19608
19642
|
try {
|
|
19609
19643
|
setLoading(true);
|
|
19610
19644
|
const defsRes = await get("/api/workflows/definitions");
|
|
@@ -19633,13 +19667,18 @@ var TopologyRuntimeView = () => {
|
|
|
19633
19667
|
if (!cancelled) setLoading(false);
|
|
19634
19668
|
}
|
|
19635
19669
|
};
|
|
19636
|
-
|
|
19670
|
+
init2();
|
|
19637
19671
|
return () => {
|
|
19638
19672
|
cancelled = true;
|
|
19639
19673
|
};
|
|
19640
19674
|
}, [get]);
|
|
19675
|
+
useEffect36(() => {
|
|
19676
|
+
return () => {
|
|
19677
|
+
pollingSessionRef.current = 0;
|
|
19678
|
+
};
|
|
19679
|
+
}, []);
|
|
19641
19680
|
if (loading) {
|
|
19642
|
-
return /* @__PURE__ */ jsx76("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%" }, children: /* @__PURE__ */ jsx76(
|
|
19681
|
+
return /* @__PURE__ */ jsx76("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%" }, children: /* @__PURE__ */ jsx76(Spin9, { size: "large" }) });
|
|
19643
19682
|
}
|
|
19644
19683
|
if (error) {
|
|
19645
19684
|
return /* @__PURE__ */ jsx76(Empty6, { description: error });
|
|
@@ -19648,7 +19687,16 @@ var TopologyRuntimeView = () => {
|
|
|
19648
19687
|
return /* @__PURE__ */ jsx76(Empty6, { description: "No workflow runs yet. Execute a processing agent to see results here." });
|
|
19649
19688
|
}
|
|
19650
19689
|
return /* @__PURE__ */ jsxs50("div", { style: { padding: 16, overflow: "auto", height: "100%" }, children: [
|
|
19651
|
-
/* @__PURE__ */
|
|
19690
|
+
/* @__PURE__ */ jsxs50("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 16 }, children: [
|
|
19691
|
+
/* @__PURE__ */ jsx76(Title5, { level: 5, style: { marginBottom: 0 }, children: "Workflow Runs" }),
|
|
19692
|
+
/* @__PURE__ */ jsx76(Tooltip13, { title: "Refresh now", children: /* @__PURE__ */ jsx76(
|
|
19693
|
+
ReloadOutlined2,
|
|
19694
|
+
{
|
|
19695
|
+
style: { cursor: "pointer", color: "#999" },
|
|
19696
|
+
onClick: () => refreshRuns()
|
|
19697
|
+
}
|
|
19698
|
+
) })
|
|
19699
|
+
] }),
|
|
19652
19700
|
/* @__PURE__ */ jsx76(
|
|
19653
19701
|
List7,
|
|
19654
19702
|
{
|
|
@@ -19689,7 +19737,25 @@ var TopologyRuntimeView = () => {
|
|
|
19689
19737
|
run.totalEdges
|
|
19690
19738
|
] }),
|
|
19691
19739
|
/* @__PURE__ */ jsx76(Tag16, { color: sc.color, icon: sc.icon, children: sc.label }),
|
|
19692
|
-
/* @__PURE__ */ jsx76(Text27, { type: "secondary", style: { fontSize: 11 }, children: formatTime(run.startedAt) })
|
|
19740
|
+
/* @__PURE__ */ jsx76(Text27, { type: "secondary", style: { fontSize: 11 }, children: formatTime(run.startedAt) }),
|
|
19741
|
+
/* @__PURE__ */ jsx76(
|
|
19742
|
+
Popconfirm5,
|
|
19743
|
+
{
|
|
19744
|
+
title: "Delete run",
|
|
19745
|
+
description: "Delete this workflow run and all its step records?",
|
|
19746
|
+
onConfirm: () => handleDeleteRun(run.id),
|
|
19747
|
+
okText: "Delete",
|
|
19748
|
+
cancelText: "Cancel",
|
|
19749
|
+
okButtonProps: { danger: true },
|
|
19750
|
+
children: /* @__PURE__ */ jsx76(
|
|
19751
|
+
DeleteOutlined4,
|
|
19752
|
+
{
|
|
19753
|
+
style: { color: "#ff4d4f", cursor: "pointer", fontSize: 13 },
|
|
19754
|
+
onClick: (e) => e.stopPropagation()
|
|
19755
|
+
}
|
|
19756
|
+
)
|
|
19757
|
+
}
|
|
19758
|
+
)
|
|
19693
19759
|
] })
|
|
19694
19760
|
] })
|
|
19695
19761
|
},
|
|
@@ -19704,22 +19770,25 @@ var TopologyRuntimeView = () => {
|
|
|
19704
19770
|
run: selectedRun,
|
|
19705
19771
|
agentName: agentNames[selectedRun.assistantId] || selectedRun.assistantId,
|
|
19706
19772
|
open: !!selectedRun,
|
|
19707
|
-
onClose: () => setSelectedRun(null)
|
|
19773
|
+
onClose: () => setSelectedRun(null),
|
|
19774
|
+
onRunUpdate: handleRunUpdate,
|
|
19775
|
+
autoRefresh,
|
|
19776
|
+
onAutoRefreshChange: setAutoRefresh
|
|
19708
19777
|
}
|
|
19709
19778
|
)
|
|
19710
19779
|
] });
|
|
19711
19780
|
};
|
|
19712
19781
|
|
|
19713
19782
|
// src/components/Chat/TopologyInboxView.tsx
|
|
19714
|
-
import { useEffect as
|
|
19715
|
-
import { Card as Card18, Typography as Typography31, Spin as
|
|
19716
|
-
import { InboxOutlined, ReloadOutlined as
|
|
19783
|
+
import { useEffect as useEffect37, useState as useState52 } from "react";
|
|
19784
|
+
import { Card as Card18, Typography as Typography31, Spin as Spin10, Empty as Empty7, List as List8, Button as Button37, Space as Space24, Tag as Tag17 } from "antd";
|
|
19785
|
+
import { InboxOutlined, ReloadOutlined as ReloadOutlined3 } from "@ant-design/icons";
|
|
19717
19786
|
import { jsx as jsx77, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
19718
19787
|
var { Text: Text28, Title: Title6 } = Typography31;
|
|
19719
19788
|
var TopologyInboxView = () => {
|
|
19720
19789
|
const { get } = useApi();
|
|
19721
|
-
const [items, setItems] =
|
|
19722
|
-
const [loading, setLoading] =
|
|
19790
|
+
const [items, setItems] = useState52([]);
|
|
19791
|
+
const [loading, setLoading] = useState52(true);
|
|
19723
19792
|
const fetchInbox = async () => {
|
|
19724
19793
|
setLoading(true);
|
|
19725
19794
|
try {
|
|
@@ -19746,7 +19815,7 @@ var TopologyInboxView = () => {
|
|
|
19746
19815
|
setLoading(false);
|
|
19747
19816
|
}
|
|
19748
19817
|
};
|
|
19749
|
-
|
|
19818
|
+
useEffect37(() => {
|
|
19750
19819
|
fetchInbox();
|
|
19751
19820
|
}, [get]);
|
|
19752
19821
|
return /* @__PURE__ */ jsxs51("div", { style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
|
|
@@ -19770,7 +19839,7 @@ var TopologyInboxView = () => {
|
|
|
19770
19839
|
/* @__PURE__ */ jsx77(
|
|
19771
19840
|
Button37,
|
|
19772
19841
|
{
|
|
19773
|
-
icon: /* @__PURE__ */ jsx77(
|
|
19842
|
+
icon: /* @__PURE__ */ jsx77(ReloadOutlined3, {}),
|
|
19774
19843
|
onClick: fetchInbox,
|
|
19775
19844
|
loading,
|
|
19776
19845
|
size: "small",
|
|
@@ -19789,7 +19858,7 @@ var TopologyInboxView = () => {
|
|
|
19789
19858
|
justifyContent: "center",
|
|
19790
19859
|
height: 200
|
|
19791
19860
|
},
|
|
19792
|
-
children: /* @__PURE__ */ jsx77(
|
|
19861
|
+
children: /* @__PURE__ */ jsx77(Spin10, { size: "large" })
|
|
19793
19862
|
}
|
|
19794
19863
|
) : items.length === 0 ? /* @__PURE__ */ jsx77(Empty7, { description: "Inbox is empty" }) : /* @__PURE__ */ jsx77(
|
|
19795
19864
|
List8,
|
|
@@ -19829,14 +19898,14 @@ var TopologyInboxView = () => {
|
|
|
19829
19898
|
};
|
|
19830
19899
|
|
|
19831
19900
|
// src/components/Eval/EvalPanel.tsx
|
|
19832
|
-
import React41, { useState as
|
|
19901
|
+
import React41, { useState as useState55, useMemo as useMemo19 } from "react";
|
|
19833
19902
|
import { createStyles as createStyles22 } from "antd-style";
|
|
19834
|
-
import { Button as Button40, Card as Card22, Typography as Typography35, Row as Row3, Col as Col3, Tag as Tag20, theme as theme15, Dropdown as Dropdown2, Popconfirm as
|
|
19903
|
+
import { Button as Button40, Card as Card22, Typography as Typography35, Row as Row3, Col as Col3, Tag as Tag20, theme as theme15, Dropdown as Dropdown2, Popconfirm as Popconfirm9, message as message14 } from "antd";
|
|
19835
19904
|
import { Play as Play2, FlaskConical as FlaskConical2, TestTube2 as TestTube26, TrendingUp, CheckCircle as CheckCircle2, XCircle as XCircle2, ArrowRight as ArrowRight2, ChevronDown as ChevronDown3, Trash2 as Trash27, Clock } from "lucide-react";
|
|
19836
19905
|
|
|
19837
19906
|
// src/components/Eval/EvalSuiteCardList.tsx
|
|
19838
19907
|
import { createStyles as createStyles19 } from "antd-style";
|
|
19839
|
-
import { Card as Card19, Typography as Typography32, Row as Row2, Col as Col2, Empty as Empty8, Popconfirm as
|
|
19908
|
+
import { Card as Card19, Typography as Typography32, Row as Row2, Col as Col2, Empty as Empty8, Popconfirm as Popconfirm6, Spin as Spin11 } from "antd";
|
|
19840
19909
|
import { Trash2 as Trash24, TestTube2 as TestTube24 } from "lucide-react";
|
|
19841
19910
|
import { jsx as jsx78, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
19842
19911
|
var { Text: Text29 } = Typography32;
|
|
@@ -19901,7 +19970,7 @@ var EvalSuiteCardList = ({ projectId, onSelectSuite }) => {
|
|
|
19901
19970
|
const { styles } = useStyle9();
|
|
19902
19971
|
const { suites, loading, remove } = useEvalSuites(projectId);
|
|
19903
19972
|
if (loading) {
|
|
19904
|
-
return /* @__PURE__ */ jsx78("div", { style: { display: "flex", justifyContent: "center", padding: 48 }, children: /* @__PURE__ */ jsx78(
|
|
19973
|
+
return /* @__PURE__ */ jsx78("div", { style: { display: "flex", justifyContent: "center", padding: 48 }, children: /* @__PURE__ */ jsx78(Spin11, {}) });
|
|
19905
19974
|
}
|
|
19906
19975
|
if (suites.length === 0) {
|
|
19907
19976
|
return /* @__PURE__ */ jsx78(Empty8, { image: Empty8.PRESENTED_IMAGE_SIMPLE, description: /* @__PURE__ */ jsx78(Text29, { type: "secondary", children: "No test suites yet" }) });
|
|
@@ -19921,7 +19990,7 @@ var EvalSuiteCardList = ({ projectId, onSelectSuite }) => {
|
|
|
19921
19990
|
/* @__PURE__ */ jsx78("div", { className: styles.subtitle, children: "Server-side agent testing" })
|
|
19922
19991
|
] }),
|
|
19923
19992
|
/* @__PURE__ */ jsx78(
|
|
19924
|
-
|
|
19993
|
+
Popconfirm6,
|
|
19925
19994
|
{
|
|
19926
19995
|
title: "Delete this suite?",
|
|
19927
19996
|
onConfirm: (e) => {
|
|
@@ -19946,9 +20015,9 @@ var EvalSuiteCardList = ({ projectId, onSelectSuite }) => {
|
|
|
19946
20015
|
};
|
|
19947
20016
|
|
|
19948
20017
|
// src/components/Eval/EvalSuiteDetail.tsx
|
|
19949
|
-
import { useState as
|
|
20018
|
+
import { useState as useState53 } from "react";
|
|
19950
20019
|
import { createStyles as createStyles20 } from "antd-style";
|
|
19951
|
-
import { Button as Button38, Card as Card20, Typography as Typography33, Modal as Modal12, Form as Form8, Input as Input14, Select as Select6, Table as Table3, Popconfirm as
|
|
20020
|
+
import { Button as Button38, Card as Card20, Typography as Typography33, Modal as Modal12, Form as Form8, Input as Input14, Select as Select6, Table as Table3, Popconfirm as Popconfirm7, Empty as Empty9 } from "antd";
|
|
19952
20021
|
import { Play, Plus as Plus6, Trash2 as Trash25, Bot, MessageSquare, FlaskConical } from "lucide-react";
|
|
19953
20022
|
import { jsx as jsx79, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
19954
20023
|
var { Text: Text30 } = Typography33;
|
|
@@ -20050,9 +20119,9 @@ var EvalSuiteDetail = ({ projectId, suiteId, onBack, onRun }) => {
|
|
|
20050
20119
|
const { suites } = useEvalSuites(projectId);
|
|
20051
20120
|
const { cases, create: createCase, remove: removeCase } = useEvalCases(projectId, suiteId);
|
|
20052
20121
|
const { start } = useEvalRuns(projectId);
|
|
20053
|
-
const [modalOpen, setModalOpen] =
|
|
20122
|
+
const [modalOpen, setModalOpen] = useState53(false);
|
|
20054
20123
|
const [form] = Form8.useForm();
|
|
20055
|
-
const [agents, setAgents] =
|
|
20124
|
+
const [agents, setAgents] = useState53([]);
|
|
20056
20125
|
const suite = suites.find((s) => s.id === suiteId) || {};
|
|
20057
20126
|
const loadAgents = async () => {
|
|
20058
20127
|
try {
|
|
@@ -20108,7 +20177,7 @@ var EvalSuiteDetail = ({ projectId, suiteId, onBack, onRun }) => {
|
|
|
20108
20177
|
title: "",
|
|
20109
20178
|
key: "actions",
|
|
20110
20179
|
width: 40,
|
|
20111
|
-
render: (_, c) => /* @__PURE__ */ jsx79(
|
|
20180
|
+
render: (_, c) => /* @__PURE__ */ jsx79(Popconfirm7, { title: "Delete?", onConfirm: () => removeCase(projectId, suiteId, c.id), children: /* @__PURE__ */ jsx79(Button38, { type: "text", danger: true, size: "small", icon: /* @__PURE__ */ jsx79(Trash25, { size: 14 }) }) })
|
|
20112
20181
|
}
|
|
20113
20182
|
];
|
|
20114
20183
|
return /* @__PURE__ */ jsxs53("div", { className: styles.shell, children: [
|
|
@@ -20185,9 +20254,9 @@ var EvalSuiteDetail = ({ projectId, suiteId, onBack, onRun }) => {
|
|
|
20185
20254
|
};
|
|
20186
20255
|
|
|
20187
20256
|
// src/components/Eval/EvalRunResults.tsx
|
|
20188
|
-
import { useEffect as
|
|
20257
|
+
import { useEffect as useEffect38, useState as useState54 } from "react";
|
|
20189
20258
|
import { createStyles as createStyles21 } from "antd-style";
|
|
20190
|
-
import { Button as Button39, Card as Card21, Typography as Typography34, Progress as Progress4, Tag as Tag19, Table as Table4, Empty as Empty10, Popconfirm as
|
|
20259
|
+
import { Button as Button39, Card as Card21, Typography as Typography34, Progress as Progress4, Tag as Tag19, Table as Table4, Empty as Empty10, Popconfirm as Popconfirm8, message as message13 } from "antd";
|
|
20191
20260
|
import { CheckCircle, XCircle, Trash2 as Trash26 } from "lucide-react";
|
|
20192
20261
|
import { jsx as jsx80, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
20193
20262
|
var { Text: Text31 } = Typography34;
|
|
@@ -20274,9 +20343,9 @@ var useStyle11 = createStyles21(({ token, css }) => ({
|
|
|
20274
20343
|
var EvalRunResults = ({ runId, onBack }) => {
|
|
20275
20344
|
const { styles } = useStyle11();
|
|
20276
20345
|
const client = useClient("__GLOBAL__");
|
|
20277
|
-
const [run, setRun] =
|
|
20346
|
+
const [run, setRun] = useState54(null);
|
|
20278
20347
|
const { status: streamingStatus, progress, connected } = useEvalRunStream(runId);
|
|
20279
|
-
|
|
20348
|
+
useEffect38(() => {
|
|
20280
20349
|
client.eval.runs.get(runId).then(setRun).catch(console.error);
|
|
20281
20350
|
}, [runId, client]);
|
|
20282
20351
|
if (!run) {
|
|
@@ -20296,7 +20365,7 @@ var EvalRunResults = ({ runId, onBack }) => {
|
|
|
20296
20365
|
/* @__PURE__ */ jsx80(Tag19, { color: run.status === "completed" ? "success" : run.status === "running" ? "processing" : run.status === "failed" ? "error" : "warning", children: run.status })
|
|
20297
20366
|
] }),
|
|
20298
20367
|
/* @__PURE__ */ jsx80(
|
|
20299
|
-
|
|
20368
|
+
Popconfirm8,
|
|
20300
20369
|
{
|
|
20301
20370
|
title: "Delete this run?",
|
|
20302
20371
|
description: "Run results will be permanently deleted.",
|
|
@@ -20627,10 +20696,10 @@ var EvalPanel = () => {
|
|
|
20627
20696
|
const { styles, cx } = useStyle12();
|
|
20628
20697
|
const { token } = theme15.useToken();
|
|
20629
20698
|
const { projects } = useEvalProjects();
|
|
20630
|
-
const [projectId, setProjectId] =
|
|
20631
|
-
const [page, setPage] =
|
|
20632
|
-
const [suiteId, setSuiteId] =
|
|
20633
|
-
const [runId, setRunId] =
|
|
20699
|
+
const [projectId, setProjectId] = useState55("");
|
|
20700
|
+
const [page, setPage] = useState55("dashboard");
|
|
20701
|
+
const [suiteId, setSuiteId] = useState55("");
|
|
20702
|
+
const [runId, setRunId] = useState55("");
|
|
20634
20703
|
React41.useEffect(() => {
|
|
20635
20704
|
if (!projectId && projects.length > 0) {
|
|
20636
20705
|
setProjectId(projects[0].id);
|
|
@@ -20638,7 +20707,7 @@ var EvalPanel = () => {
|
|
|
20638
20707
|
}, [projects, projectId]);
|
|
20639
20708
|
const { suites } = useEvalSuites(projectId);
|
|
20640
20709
|
const { runs, start, remove } = useEvalRuns(projectId);
|
|
20641
|
-
const stats =
|
|
20710
|
+
const stats = useMemo19(() => {
|
|
20642
20711
|
const totalCases = suites.reduce((s, x) => s + (x.caseCount ?? 0), 0);
|
|
20643
20712
|
const latest = runs[0];
|
|
20644
20713
|
const passRate = latest?.totalCases > 0 ? Math.round(latest.passedCases / latest.totalCases * 100) : null;
|
|
@@ -20786,7 +20855,7 @@ var EvalPanel = () => {
|
|
|
20786
20855
|
/* @__PURE__ */ jsx81(Tag20, { color: meta.color, style: { margin: 0 }, children: meta.label }),
|
|
20787
20856
|
/* @__PURE__ */ jsx81(Text32, { strong: true, style: { fontSize: 15, minWidth: 40, textAlign: "right" }, children: typeof r.avgScore === "number" ? r.avgScore.toFixed(1) : "\u2014" }),
|
|
20788
20857
|
/* @__PURE__ */ jsx81(
|
|
20789
|
-
|
|
20858
|
+
Popconfirm9,
|
|
20790
20859
|
{
|
|
20791
20860
|
title: "Delete this run?",
|
|
20792
20861
|
description: "Run results will be permanently deleted.",
|
|
@@ -20818,8 +20887,8 @@ var EvalPanel = () => {
|
|
|
20818
20887
|
] });
|
|
20819
20888
|
}
|
|
20820
20889
|
const SuiteListPage = () => {
|
|
20821
|
-
const [showAdd, setShowAdd] =
|
|
20822
|
-
const [name, setName] =
|
|
20890
|
+
const [showAdd, setShowAdd] = useState55(false);
|
|
20891
|
+
const [name, setName] = useState55("");
|
|
20823
20892
|
const { create } = useEvalSuites(projectId);
|
|
20824
20893
|
const handleAdd = async () => {
|
|
20825
20894
|
if (!name.trim()) return;
|
|
@@ -21003,7 +21072,7 @@ var WorkspaceResourceManager = ({
|
|
|
21003
21072
|
const { openContentApp, menuCollapsed, setMenuCollapsed } = useChatUIContext();
|
|
21004
21073
|
const hasOpenedDefault = useRef17(false);
|
|
21005
21074
|
const hasRegistered = useRef17(false);
|
|
21006
|
-
|
|
21075
|
+
useEffect39(() => {
|
|
21007
21076
|
if (!hasRegistered.current) {
|
|
21008
21077
|
hasRegistered.current = true;
|
|
21009
21078
|
regsiterElement("workspace_projects", {
|
|
@@ -21062,9 +21131,9 @@ var WorkspaceResourceManager = ({
|
|
|
21062
21131
|
const { user, logout, tenants, currentTenant, selectTenant, isLoading } = useAuth();
|
|
21063
21132
|
const { setWorkspace, setProject } = useWorkspaceContext();
|
|
21064
21133
|
const { config } = useLatticeChatShellContext();
|
|
21065
|
-
const [tenantModalOpen, setTenantModalOpen] =
|
|
21066
|
-
const [changePasswordOpen, setChangePasswordOpen] =
|
|
21067
|
-
const menuItems =
|
|
21134
|
+
const [tenantModalOpen, setTenantModalOpen] = useState56(false);
|
|
21135
|
+
const [changePasswordOpen, setChangePasswordOpen] = useState56(false);
|
|
21136
|
+
const menuItems = useMemo20(() => {
|
|
21068
21137
|
const items = config.workspaceMenuItems?.length ? [...config.workspaceMenuItems] : [...DEFAULT_WORKSPACE_MENU_ITEMS];
|
|
21069
21138
|
return items.sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
|
|
21070
21139
|
}, [config.workspaceMenuItems]);
|
|
@@ -21095,7 +21164,7 @@ var WorkspaceResourceManager = ({
|
|
|
21095
21164
|
});
|
|
21096
21165
|
}
|
|
21097
21166
|
};
|
|
21098
|
-
|
|
21167
|
+
useEffect39(() => {
|
|
21099
21168
|
if (!hasOpenedDefault.current && menuItems.length > 0) {
|
|
21100
21169
|
hasOpenedDefault.current = true;
|
|
21101
21170
|
const firstRoute = menuItems.find((item) => item.type === "route");
|
|
@@ -21311,8 +21380,8 @@ var WorkspaceContextProvider = ({
|
|
|
21311
21380
|
}
|
|
21312
21381
|
return null;
|
|
21313
21382
|
};
|
|
21314
|
-
const [workspaceId, setWorkspaceId] =
|
|
21315
|
-
const [projectId, setProjectId] =
|
|
21383
|
+
const [workspaceId, setWorkspaceId] = useState57(getInitialWorkspaceId);
|
|
21384
|
+
const [projectId, setProjectId] = useState57(getInitialProjectId);
|
|
21316
21385
|
React43.useEffect(() => {
|
|
21317
21386
|
const wsId = getInitialWorkspaceId();
|
|
21318
21387
|
const pjId = getInitialProjectId();
|
|
@@ -21320,13 +21389,13 @@ var WorkspaceContextProvider = ({
|
|
|
21320
21389
|
Client2.setWorkspaceContext(wsId || void 0, pjId || void 0);
|
|
21321
21390
|
}
|
|
21322
21391
|
}, []);
|
|
21323
|
-
|
|
21392
|
+
useEffect40(() => {
|
|
21324
21393
|
Client2.setWorkspaceContext(workspaceId || void 0, projectId || void 0);
|
|
21325
21394
|
}, [workspaceId, projectId]);
|
|
21326
|
-
const [workspaces, setWorkspaces] =
|
|
21327
|
-
const [projects, setProjects] =
|
|
21328
|
-
const [loading, setLoading] =
|
|
21329
|
-
const [error, setError] =
|
|
21395
|
+
const [workspaces, setWorkspaces] = useState57([]);
|
|
21396
|
+
const [projects, setProjects] = useState57([]);
|
|
21397
|
+
const [loading, setLoading] = useState57(false);
|
|
21398
|
+
const [error, setError] = useState57(null);
|
|
21330
21399
|
const client = React43.useMemo(() => {
|
|
21331
21400
|
const authApiKey = isAuthenticated ? sessionStorage.getItem("lattice_token") || config.apiKey || "" : config.apiKey || "";
|
|
21332
21401
|
return new WorkspaceClient({
|
|
@@ -21336,22 +21405,22 @@ var WorkspaceContextProvider = ({
|
|
|
21336
21405
|
transport: "sse"
|
|
21337
21406
|
}, tenantId);
|
|
21338
21407
|
}, [config.baseURL, config.apiKey, tenantId, isAuthenticated]);
|
|
21339
|
-
const resetSelectedWorkspace =
|
|
21408
|
+
const resetSelectedWorkspace = useCallback31(() => {
|
|
21340
21409
|
setProjects([]);
|
|
21341
21410
|
setWorkspaceId(null);
|
|
21342
21411
|
sessionStorage.removeItem("workspaceId");
|
|
21343
21412
|
setProjectId(null);
|
|
21344
21413
|
sessionStorage.removeItem("projectId");
|
|
21345
21414
|
}, [setProjects, setWorkspaceId, setProjectId]);
|
|
21346
|
-
const resetWS =
|
|
21415
|
+
const resetWS = useCallback31(() => {
|
|
21347
21416
|
setWorkspaces([]);
|
|
21348
21417
|
resetSelectedWorkspace();
|
|
21349
21418
|
}, [resetSelectedWorkspace, setWorkspaces]);
|
|
21350
|
-
|
|
21419
|
+
useEffect40(() => {
|
|
21351
21420
|
resetWS();
|
|
21352
21421
|
refreshWorkspaces();
|
|
21353
21422
|
}, [tenantId]);
|
|
21354
|
-
const refreshWorkspaces =
|
|
21423
|
+
const refreshWorkspaces = useCallback31(async () => {
|
|
21355
21424
|
setLoading(true);
|
|
21356
21425
|
setError(null);
|
|
21357
21426
|
try {
|
|
@@ -21363,7 +21432,7 @@ var WorkspaceContextProvider = ({
|
|
|
21363
21432
|
setLoading(false);
|
|
21364
21433
|
}
|
|
21365
21434
|
}, [client]);
|
|
21366
|
-
const refreshProjects =
|
|
21435
|
+
const refreshProjects = useCallback31(async (wsId) => {
|
|
21367
21436
|
const targetWorkspaceId = wsId || workspaceId;
|
|
21368
21437
|
if (!targetWorkspaceId) {
|
|
21369
21438
|
setProjects([]);
|
|
@@ -21380,28 +21449,28 @@ var WorkspaceContextProvider = ({
|
|
|
21380
21449
|
setLoading(false);
|
|
21381
21450
|
}
|
|
21382
21451
|
}, [client, workspaceId]);
|
|
21383
|
-
|
|
21452
|
+
useEffect40(() => {
|
|
21384
21453
|
if (workspaceId && typeof window !== "undefined") {
|
|
21385
21454
|
sessionStorage.setItem("workspaceId", workspaceId);
|
|
21386
21455
|
}
|
|
21387
21456
|
}, [workspaceId]);
|
|
21388
|
-
|
|
21457
|
+
useEffect40(() => {
|
|
21389
21458
|
if (projectId && typeof window !== "undefined") {
|
|
21390
21459
|
sessionStorage.setItem("projectId", projectId);
|
|
21391
21460
|
}
|
|
21392
21461
|
}, [projectId]);
|
|
21393
|
-
|
|
21462
|
+
useEffect40(() => {
|
|
21394
21463
|
refreshWorkspaces().catch((err) => {
|
|
21395
21464
|
console.warn("Failed to load workspaces:", err);
|
|
21396
21465
|
});
|
|
21397
21466
|
}, [refreshWorkspaces]);
|
|
21398
|
-
|
|
21467
|
+
useEffect40(() => {
|
|
21399
21468
|
if (workspaces.length > 0 && !workspaceId) {
|
|
21400
21469
|
const firstWorkspace = workspaces[0];
|
|
21401
21470
|
setWorkspaceId(firstWorkspace.id);
|
|
21402
21471
|
}
|
|
21403
21472
|
}, [workspaces, workspaceId]);
|
|
21404
|
-
|
|
21473
|
+
useEffect40(() => {
|
|
21405
21474
|
if (workspaceId) {
|
|
21406
21475
|
refreshProjects(workspaceId);
|
|
21407
21476
|
} else {
|
|
@@ -21409,7 +21478,7 @@ var WorkspaceContextProvider = ({
|
|
|
21409
21478
|
}
|
|
21410
21479
|
setProjectId(null);
|
|
21411
21480
|
}, [workspaceId, refreshProjects]);
|
|
21412
|
-
const createWorkspace =
|
|
21481
|
+
const createWorkspace = useCallback31(async (data) => {
|
|
21413
21482
|
setLoading(true);
|
|
21414
21483
|
setError(null);
|
|
21415
21484
|
try {
|
|
@@ -21424,7 +21493,7 @@ var WorkspaceContextProvider = ({
|
|
|
21424
21493
|
setLoading(false);
|
|
21425
21494
|
}
|
|
21426
21495
|
}, [client, refreshWorkspaces]);
|
|
21427
|
-
const updateWorkspace =
|
|
21496
|
+
const updateWorkspace = useCallback31(async (id, updates) => {
|
|
21428
21497
|
setLoading(true);
|
|
21429
21498
|
setError(null);
|
|
21430
21499
|
try {
|
|
@@ -21439,7 +21508,7 @@ var WorkspaceContextProvider = ({
|
|
|
21439
21508
|
setLoading(false);
|
|
21440
21509
|
}
|
|
21441
21510
|
}, [client, refreshWorkspaces]);
|
|
21442
|
-
const deleteWorkspace =
|
|
21511
|
+
const deleteWorkspace = useCallback31(async (id) => {
|
|
21443
21512
|
setLoading(true);
|
|
21444
21513
|
setError(null);
|
|
21445
21514
|
try {
|
|
@@ -21456,7 +21525,7 @@ var WorkspaceContextProvider = ({
|
|
|
21456
21525
|
setLoading(false);
|
|
21457
21526
|
}
|
|
21458
21527
|
}, [client, workspaceId, refreshWorkspaces]);
|
|
21459
|
-
const createProject =
|
|
21528
|
+
const createProject = useCallback31(async (wsId, data) => {
|
|
21460
21529
|
setLoading(true);
|
|
21461
21530
|
setError(null);
|
|
21462
21531
|
try {
|
|
@@ -21471,7 +21540,7 @@ var WorkspaceContextProvider = ({
|
|
|
21471
21540
|
setLoading(false);
|
|
21472
21541
|
}
|
|
21473
21542
|
}, [client, refreshProjects]);
|
|
21474
|
-
const updateProject =
|
|
21543
|
+
const updateProject = useCallback31(async (wsId, id, updates) => {
|
|
21475
21544
|
setLoading(true);
|
|
21476
21545
|
setError(null);
|
|
21477
21546
|
try {
|
|
@@ -21486,7 +21555,7 @@ var WorkspaceContextProvider = ({
|
|
|
21486
21555
|
setLoading(false);
|
|
21487
21556
|
}
|
|
21488
21557
|
}, [client, refreshProjects]);
|
|
21489
|
-
const deleteProject =
|
|
21558
|
+
const deleteProject = useCallback31(async (wsId, id) => {
|
|
21490
21559
|
setLoading(true);
|
|
21491
21560
|
setError(null);
|
|
21492
21561
|
try {
|
|
@@ -21503,7 +21572,7 @@ var WorkspaceContextProvider = ({
|
|
|
21503
21572
|
setLoading(false);
|
|
21504
21573
|
}
|
|
21505
21574
|
}, [client, projectId, refreshProjects]);
|
|
21506
|
-
const listPath =
|
|
21575
|
+
const listPath = useCallback31(
|
|
21507
21576
|
async (path = "/", assistantId) => {
|
|
21508
21577
|
if (!workspaceId || !projectId) {
|
|
21509
21578
|
return [];
|
|
@@ -21522,7 +21591,7 @@ var WorkspaceContextProvider = ({
|
|
|
21522
21591
|
},
|
|
21523
21592
|
[client, workspaceId, projectId]
|
|
21524
21593
|
);
|
|
21525
|
-
const listPathByFolder =
|
|
21594
|
+
const listPathByFolder = useCallback31(
|
|
21526
21595
|
async (folder, assistantId) => {
|
|
21527
21596
|
let normalizedPath = folder;
|
|
21528
21597
|
if (normalizedPath.startsWith("~/")) {
|
|
@@ -21535,7 +21604,7 @@ var WorkspaceContextProvider = ({
|
|
|
21535
21604
|
},
|
|
21536
21605
|
[listPath]
|
|
21537
21606
|
);
|
|
21538
|
-
const uploadFile =
|
|
21607
|
+
const uploadFile = useCallback31(
|
|
21539
21608
|
async (path, file, assistantId) => {
|
|
21540
21609
|
if (!workspaceId || !projectId) {
|
|
21541
21610
|
throw new Error("Workspace and project must be selected before uploading files");
|
|
@@ -21555,7 +21624,7 @@ var WorkspaceContextProvider = ({
|
|
|
21555
21624
|
},
|
|
21556
21625
|
[client, workspaceId, projectId]
|
|
21557
21626
|
);
|
|
21558
|
-
const uploadFileToFolder =
|
|
21627
|
+
const uploadFileToFolder = useCallback31(
|
|
21559
21628
|
async (folder, file, assistantId) => {
|
|
21560
21629
|
let normalizedFolder = folder;
|
|
21561
21630
|
if (normalizedFolder.startsWith("~/")) {
|
|
@@ -21565,7 +21634,7 @@ var WorkspaceContextProvider = ({
|
|
|
21565
21634
|
},
|
|
21566
21635
|
[uploadFile]
|
|
21567
21636
|
);
|
|
21568
|
-
const getFileViewUrl =
|
|
21637
|
+
const getFileViewUrl = useCallback31(
|
|
21569
21638
|
(filePath, assistantId) => {
|
|
21570
21639
|
if (!workspaceId || !projectId) {
|
|
21571
21640
|
return "";
|
|
@@ -21617,15 +21686,15 @@ var WorkspaceContextProvider = ({
|
|
|
21617
21686
|
};
|
|
21618
21687
|
|
|
21619
21688
|
// src/components/Chat/DatabasePicker.tsx
|
|
21620
|
-
import { useRef as useRef18, useState as
|
|
21621
|
-
import { Modal as Modal14, List as List9, Checkbox as Checkbox5, Spin as
|
|
21689
|
+
import { useRef as useRef18, useState as useState58 } from "react";
|
|
21690
|
+
import { Modal as Modal14, List as List9, Checkbox as Checkbox5, Spin as Spin12, Empty as Empty11, Typography as Typography36, Button as Button42, Space as Space25, Tooltip as Tooltip14 } from "antd";
|
|
21622
21691
|
import { Database as Database5 } from "lucide-react";
|
|
21623
21692
|
import { Fragment as Fragment14, jsx as jsx84, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
21624
21693
|
var DatabasePicker = ({ senderRef, iconOnly }) => {
|
|
21625
|
-
const [modalOpen, setModalOpen] =
|
|
21626
|
-
const [databases, setDatabases] =
|
|
21627
|
-
const [loading, setLoading] =
|
|
21628
|
-
const [selectedDatabases, setSelectedDatabases] =
|
|
21694
|
+
const [modalOpen, setModalOpen] = useState58(false);
|
|
21695
|
+
const [databases, setDatabases] = useState58([]);
|
|
21696
|
+
const [loading, setLoading] = useState58(false);
|
|
21697
|
+
const [selectedDatabases, setSelectedDatabases] = useState58([]);
|
|
21629
21698
|
const { get } = useApi();
|
|
21630
21699
|
const fetchedRef = useRef18(false);
|
|
21631
21700
|
const loadDatabases = async () => {
|
|
@@ -21707,7 +21776,7 @@ var DatabasePicker = ({ senderRef, iconOnly }) => {
|
|
|
21707
21776
|
width: 600,
|
|
21708
21777
|
okText: "Confirm",
|
|
21709
21778
|
cancelText: "Cancel",
|
|
21710
|
-
children: loading ? /* @__PURE__ */ jsx84("div", { style: { textAlign: "center", padding: 40 }, children: /* @__PURE__ */ jsx84(
|
|
21779
|
+
children: loading ? /* @__PURE__ */ jsx84("div", { style: { textAlign: "center", padding: 40 }, children: /* @__PURE__ */ jsx84(Spin12, { size: "large" }) }) : databases.length === 0 ? /* @__PURE__ */ jsx84(
|
|
21711
21780
|
Empty11,
|
|
21712
21781
|
{
|
|
21713
21782
|
description: "No databases available",
|
|
@@ -21767,15 +21836,15 @@ var DatabasePicker = ({ senderRef, iconOnly }) => {
|
|
|
21767
21836
|
};
|
|
21768
21837
|
|
|
21769
21838
|
// src/components/Chat/SkillPicker.tsx
|
|
21770
|
-
import { useRef as useRef19, useState as
|
|
21771
|
-
import { Modal as Modal15, List as List10, Checkbox as Checkbox6, Spin as
|
|
21839
|
+
import { useRef as useRef19, useState as useState59 } from "react";
|
|
21840
|
+
import { Modal as Modal15, List as List10, Checkbox as Checkbox6, Spin as Spin13, Empty as Empty12, Typography as Typography37, Button as Button43, Space as Space26, Tooltip as Tooltip15 } from "antd";
|
|
21772
21841
|
import { BrainCircuit } from "lucide-react";
|
|
21773
21842
|
import { Fragment as Fragment15, jsx as jsx85, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
21774
21843
|
var SkillPicker = ({ senderRef, iconOnly }) => {
|
|
21775
|
-
const [modalOpen, setModalOpen] =
|
|
21776
|
-
const [skills, setSkills] =
|
|
21777
|
-
const [loading, setLoading] =
|
|
21778
|
-
const [selectedSkills, setSelectedSkills] =
|
|
21844
|
+
const [modalOpen, setModalOpen] = useState59(false);
|
|
21845
|
+
const [skills, setSkills] = useState59([]);
|
|
21846
|
+
const [loading, setLoading] = useState59(false);
|
|
21847
|
+
const [selectedSkills, setSelectedSkills] = useState59([]);
|
|
21779
21848
|
const { get } = useApi();
|
|
21780
21849
|
const fetchedRef = useRef19(false);
|
|
21781
21850
|
const loadSkills = async () => {
|
|
@@ -21857,7 +21926,7 @@ var SkillPicker = ({ senderRef, iconOnly }) => {
|
|
|
21857
21926
|
width: 600,
|
|
21858
21927
|
okText: "Confirm",
|
|
21859
21928
|
cancelText: "Cancel",
|
|
21860
|
-
children: loading ? /* @__PURE__ */ jsx85("div", { style: { textAlign: "center", padding: 40 }, children: /* @__PURE__ */ jsx85(
|
|
21929
|
+
children: loading ? /* @__PURE__ */ jsx85("div", { style: { textAlign: "center", padding: 40 }, children: /* @__PURE__ */ jsx85(Spin13, { size: "large" }) }) : skills.length === 0 ? /* @__PURE__ */ jsx85(
|
|
21861
21930
|
Empty12,
|
|
21862
21931
|
{
|
|
21863
21932
|
description: "No skills available",
|
|
@@ -21917,14 +21986,14 @@ var SkillPicker = ({ senderRef, iconOnly }) => {
|
|
|
21917
21986
|
};
|
|
21918
21987
|
|
|
21919
21988
|
// src/components/Chat/AgentPicker.tsx
|
|
21920
|
-
import { useRef as useRef20, useState as
|
|
21989
|
+
import { useRef as useRef20, useState as useState60 } from "react";
|
|
21921
21990
|
import { Modal as Modal16, List as List11, Empty as Empty13, Typography as Typography38, Button as Button44, Tooltip as Tooltip16 } from "antd";
|
|
21922
21991
|
import { Bot as Bot3 } from "lucide-react";
|
|
21923
21992
|
import { Fragment as Fragment16, jsx as jsx86, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
21924
21993
|
var AgentPicker = ({ senderRef, iconOnly }) => {
|
|
21925
|
-
const [modalOpen, setModalOpen] =
|
|
21926
|
-
const [loading, setLoading] =
|
|
21927
|
-
const [selectedAgent, setSelectedAgent] =
|
|
21994
|
+
const [modalOpen, setModalOpen] = useState60(false);
|
|
21995
|
+
const [loading, setLoading] = useState60(false);
|
|
21996
|
+
const [selectedAgent, setSelectedAgent] = useState60(null);
|
|
21928
21997
|
const { assistants, currentAssistant, selectAssistant } = useAssistantContext();
|
|
21929
21998
|
const fetchedRef = useRef20(false);
|
|
21930
21999
|
const handleOpenModal = () => {
|
|
@@ -22033,8 +22102,8 @@ var AgentPicker = ({ senderRef, iconOnly }) => {
|
|
|
22033
22102
|
};
|
|
22034
22103
|
|
|
22035
22104
|
// src/components/Chat/MetricsDataSourcePicker.tsx
|
|
22036
|
-
import { useEffect as
|
|
22037
|
-
import { Modal as Modal17, List as List12, Spin as
|
|
22105
|
+
import { useEffect as useEffect42, useState as useState61, useRef as useRef21 } from "react";
|
|
22106
|
+
import { Modal as Modal17, List as List12, Spin as Spin15, Empty as Empty14, Typography as Typography39, Button as Button45, Tag as Tag21, Tooltip as Tooltip17 } from "antd";
|
|
22038
22107
|
import { Database as Database6, Check as Check4, Server as Server3 } from "lucide-react";
|
|
22039
22108
|
import { Fragment as Fragment17, jsx as jsx87, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
22040
22109
|
var SESSION_STORAGE_KEY = "metrics_datasource_selection";
|
|
@@ -22042,9 +22111,9 @@ var MetricsDataSourcePicker = ({
|
|
|
22042
22111
|
senderRef,
|
|
22043
22112
|
iconOnly
|
|
22044
22113
|
}) => {
|
|
22045
|
-
const [modalOpen, setModalOpen] =
|
|
22046
|
-
const [loading, setLoading] =
|
|
22047
|
-
const [dataSources, setDataSources] =
|
|
22114
|
+
const [modalOpen, setModalOpen] = useState61(false);
|
|
22115
|
+
const [loading, setLoading] = useState61(false);
|
|
22116
|
+
const [dataSources, setDataSources] = useState61([]);
|
|
22048
22117
|
const { config } = useLatticeChatShellContext();
|
|
22049
22118
|
const { customRunConfig, updateCustomRunConfig } = useConversationContext();
|
|
22050
22119
|
const { get } = useApi();
|
|
@@ -22122,7 +22191,7 @@ var MetricsDataSourcePicker = ({
|
|
|
22122
22191
|
console.error("Failed to save datasource to sessionStorage:", error);
|
|
22123
22192
|
}
|
|
22124
22193
|
};
|
|
22125
|
-
|
|
22194
|
+
useEffect42(() => {
|
|
22126
22195
|
if (hasInitializedRef.current) return;
|
|
22127
22196
|
hasInitializedRef.current = true;
|
|
22128
22197
|
loadDataSources().then(() => {
|
|
@@ -22219,7 +22288,7 @@ var MetricsDataSourcePicker = ({
|
|
|
22219
22288
|
overflowY: "auto"
|
|
22220
22289
|
}
|
|
22221
22290
|
},
|
|
22222
|
-
children: loading ? /* @__PURE__ */ jsx87("div", { style: { textAlign: "center", padding: 40 }, children: /* @__PURE__ */ jsx87(
|
|
22291
|
+
children: loading ? /* @__PURE__ */ jsx87("div", { style: { textAlign: "center", padding: 40 }, children: /* @__PURE__ */ jsx87(Spin15, { size: "large" }) }) : dataSources.length === 0 ? /* @__PURE__ */ jsx87(
|
|
22223
22292
|
Empty14,
|
|
22224
22293
|
{
|
|
22225
22294
|
description: "No Metrics Data Sources Available",
|
|
@@ -22373,7 +22442,7 @@ var MetricsDataSourcePicker = ({
|
|
|
22373
22442
|
};
|
|
22374
22443
|
|
|
22375
22444
|
// src/components/Chat/ModelSelector.tsx
|
|
22376
|
-
import { useState as
|
|
22445
|
+
import { useState as useState62, useEffect as useEffect43, useCallback as useCallback32, useRef as useRef22 } from "react";
|
|
22377
22446
|
import { Select as Select7 } from "antd";
|
|
22378
22447
|
import { jsx as jsx88 } from "react/jsx-runtime";
|
|
22379
22448
|
var ModelSelector = ({
|
|
@@ -22382,22 +22451,22 @@ var ModelSelector = ({
|
|
|
22382
22451
|
defaultModelKey = "default",
|
|
22383
22452
|
style
|
|
22384
22453
|
}) => {
|
|
22385
|
-
const [models, setModels] =
|
|
22386
|
-
const [isLoading, setIsLoading] =
|
|
22387
|
-
const [internalValue, setInternalValue] =
|
|
22388
|
-
const [dropdownOpen, setDropdownOpen] =
|
|
22389
|
-
const [isHovered, setIsHovered] =
|
|
22454
|
+
const [models, setModels] = useState62([]);
|
|
22455
|
+
const [isLoading, setIsLoading] = useState62(false);
|
|
22456
|
+
const [internalValue, setInternalValue] = useState62(null);
|
|
22457
|
+
const [dropdownOpen, setDropdownOpen] = useState62(false);
|
|
22458
|
+
const [isHovered, setIsHovered] = useState62(false);
|
|
22390
22459
|
const hasFetchedRef = useRef22(false);
|
|
22391
22460
|
const hasSetDefaultRef = useRef22(false);
|
|
22392
22461
|
const { get } = useApi();
|
|
22393
22462
|
const selectedModelConfig = value !== void 0 ? value : internalValue;
|
|
22394
|
-
const setSelectedModelConfig =
|
|
22463
|
+
const setSelectedModelConfig = useCallback32((config) => {
|
|
22395
22464
|
if (value === void 0) {
|
|
22396
22465
|
setInternalValue(config);
|
|
22397
22466
|
}
|
|
22398
22467
|
onChange?.(config);
|
|
22399
22468
|
}, [value, onChange]);
|
|
22400
|
-
const fetchModels =
|
|
22469
|
+
const fetchModels = useCallback32(async () => {
|
|
22401
22470
|
if (hasFetchedRef.current) return;
|
|
22402
22471
|
hasFetchedRef.current = true;
|
|
22403
22472
|
setIsLoading(true);
|
|
@@ -22418,7 +22487,7 @@ var ModelSelector = ({
|
|
|
22418
22487
|
setIsLoading(false);
|
|
22419
22488
|
}
|
|
22420
22489
|
}, [get, defaultModelKey]);
|
|
22421
|
-
|
|
22490
|
+
useEffect43(() => {
|
|
22422
22491
|
fetchModels();
|
|
22423
22492
|
}, [fetchModels]);
|
|
22424
22493
|
const handleChange = (modelKey) => {
|
|
@@ -22480,8 +22549,8 @@ import {
|
|
|
22480
22549
|
WarningOutlined
|
|
22481
22550
|
} from "@ant-design/icons";
|
|
22482
22551
|
import { Prompts } from "@ant-design/x";
|
|
22483
|
-
import { Space as Space28, Typography as Typography40, Spin as
|
|
22484
|
-
import { useEffect as
|
|
22552
|
+
import { Space as Space28, Typography as Typography40, Spin as Spin16 } from "antd";
|
|
22553
|
+
import { useEffect as useEffect44, useState as useState63, useMemo as useMemo21 } from "react";
|
|
22485
22554
|
import { BrainCircuit as BrainCircuit2 } from "lucide-react";
|
|
22486
22555
|
import { jsx as jsx89, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
22487
22556
|
var categoryConfig = {
|
|
@@ -22566,12 +22635,12 @@ var SkillCategoryPrompts = ({
|
|
|
22566
22635
|
senderRef,
|
|
22567
22636
|
visible = true
|
|
22568
22637
|
}) => {
|
|
22569
|
-
const [skills, setSkills] =
|
|
22570
|
-
const [loading, setLoading] =
|
|
22571
|
-
const [showAll, setShowAll] =
|
|
22638
|
+
const [skills, setSkills] = useState63([]);
|
|
22639
|
+
const [loading, setLoading] = useState63(false);
|
|
22640
|
+
const [showAll, setShowAll] = useState63(false);
|
|
22572
22641
|
const { get } = useApi();
|
|
22573
22642
|
const MAX_SIMPLE_ITEMS = 10;
|
|
22574
|
-
|
|
22643
|
+
useEffect44(() => {
|
|
22575
22644
|
const loadSkills = async () => {
|
|
22576
22645
|
setLoading(true);
|
|
22577
22646
|
try {
|
|
@@ -22589,7 +22658,7 @@ var SkillCategoryPrompts = ({
|
|
|
22589
22658
|
loadSkills();
|
|
22590
22659
|
}
|
|
22591
22660
|
}, [get, visible]);
|
|
22592
|
-
const groupedSkills =
|
|
22661
|
+
const groupedSkills = useMemo21(() => {
|
|
22593
22662
|
const groups = {};
|
|
22594
22663
|
skills.forEach((skill) => {
|
|
22595
22664
|
const category = skill.metadata?.category || "global";
|
|
@@ -22658,7 +22727,7 @@ var SkillCategoryPrompts = ({
|
|
|
22658
22727
|
return null;
|
|
22659
22728
|
}
|
|
22660
22729
|
if (loading) {
|
|
22661
|
-
return /* @__PURE__ */ jsx89("div", { style: { textAlign: "center", padding: 40 }, children: /* @__PURE__ */ jsx89(
|
|
22730
|
+
return /* @__PURE__ */ jsx89("div", { style: { textAlign: "center", padding: 40 }, children: /* @__PURE__ */ jsx89(Spin16, { size: "large" }) });
|
|
22662
22731
|
}
|
|
22663
22732
|
if (skills.length === 0) {
|
|
22664
22733
|
return null;
|
|
@@ -22750,7 +22819,7 @@ import {
|
|
|
22750
22819
|
} from "@ant-design/icons";
|
|
22751
22820
|
import { Prompts as Prompts2 } from "@ant-design/x";
|
|
22752
22821
|
import { Space as Space29, Tabs } from "antd";
|
|
22753
|
-
import { useState as
|
|
22822
|
+
import { useState as useState64, useMemo as useMemo22 } from "react";
|
|
22754
22823
|
import { jsx as jsx90, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
22755
22824
|
var defaultCategoryIcons = {
|
|
22756
22825
|
financial: /* @__PURE__ */ jsx90(DollarOutlined, {}),
|
|
@@ -22969,9 +23038,9 @@ var BusinessAnalysisPrompts = ({
|
|
|
22969
23038
|
simpleModeTitle = "Quick Analysis",
|
|
22970
23039
|
expandModeTitle = "Analysis Categories"
|
|
22971
23040
|
}) => {
|
|
22972
|
-
const [showAll, setShowAll] =
|
|
23041
|
+
const [showAll, setShowAll] = useState64(false);
|
|
22973
23042
|
const { config } = useLatticeChatShellContext();
|
|
22974
|
-
const analysisData =
|
|
23043
|
+
const analysisData = useMemo22(() => {
|
|
22975
23044
|
const customData = config.quickPromptsData;
|
|
22976
23045
|
if (customData && Array.isArray(customData) && customData.length > 0) {
|
|
22977
23046
|
return customData.map((category) => ({
|
|
@@ -22991,7 +23060,7 @@ var BusinessAnalysisPrompts = ({
|
|
|
22991
23060
|
color: defaultCategoryColors[category.key] || "#8C8C8C"
|
|
22992
23061
|
}));
|
|
22993
23062
|
}, [config.quickPromptsData]);
|
|
22994
|
-
const allItems =
|
|
23063
|
+
const allItems = useMemo22(() => {
|
|
22995
23064
|
const items = [];
|
|
22996
23065
|
analysisData.forEach((category) => {
|
|
22997
23066
|
category.items.forEach((item) => {
|
|
@@ -23130,15 +23199,22 @@ var Chating = ({
|
|
|
23130
23199
|
showHITL = true,
|
|
23131
23200
|
showRefreshButton = false,
|
|
23132
23201
|
showModelSelector,
|
|
23202
|
+
showDatabaseSlot,
|
|
23203
|
+
showSkillSlot,
|
|
23204
|
+
showAgentSlot,
|
|
23205
|
+
showMetricsDataSourceSlot,
|
|
23133
23206
|
showEmptyState = true,
|
|
23134
23207
|
emptyStateGreeting,
|
|
23135
23208
|
emptyStateQuestion = "Ready to turn data into insightful charts in seconds?",
|
|
23136
|
-
welcomePrefix = "Hey"
|
|
23209
|
+
welcomePrefix = "Hey",
|
|
23210
|
+
systemContext,
|
|
23211
|
+
initialMessage,
|
|
23212
|
+
onInitialMessageSent
|
|
23137
23213
|
}) => {
|
|
23138
|
-
const [content, setContent] =
|
|
23139
|
-
const [attachedFiles, setAttachedFiles] =
|
|
23214
|
+
const [content, setContent] = useState65("");
|
|
23215
|
+
const [attachedFiles, setAttachedFiles] = useState65([]);
|
|
23140
23216
|
const { styles } = useStyle();
|
|
23141
|
-
const [headerOpen, setHeaderOpen] =
|
|
23217
|
+
const [headerOpen, setHeaderOpen] = useState65(false);
|
|
23142
23218
|
const attachmentsRef = useRef23(null);
|
|
23143
23219
|
const senderRef = React51.useRef(null);
|
|
23144
23220
|
const {
|
|
@@ -23163,8 +23239,8 @@ var Chating = ({
|
|
|
23163
23239
|
const hasPendingMessages = pendingMessages?.length > 0;
|
|
23164
23240
|
const isInputDisabled = interrupts && interrupts.length > 0;
|
|
23165
23241
|
const typingFrames = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
23166
|
-
const [typingFrameIndex, setTypingFrameIndex] =
|
|
23167
|
-
|
|
23242
|
+
const [typingFrameIndex, setTypingFrameIndex] = useState65(0);
|
|
23243
|
+
useEffect45(() => {
|
|
23168
23244
|
if (!isStreaming) return;
|
|
23169
23245
|
const interval = setInterval(() => {
|
|
23170
23246
|
setTypingFrameIndex((prev) => (prev + 1) % typingFrames.length);
|
|
@@ -23172,16 +23248,37 @@ var Chating = ({
|
|
|
23172
23248
|
return () => clearInterval(interval);
|
|
23173
23249
|
}, [isStreaming]);
|
|
23174
23250
|
const conversationContext = useConversationContext();
|
|
23175
|
-
const
|
|
23176
|
-
const
|
|
23251
|
+
const systemContextSentRef = useRef23(false);
|
|
23252
|
+
const initialMessageSentRef = useRef23(false);
|
|
23253
|
+
const prevLoadingRef = useRef23(false);
|
|
23254
|
+
useEffect45(() => {
|
|
23255
|
+
systemContextSentRef.current = false;
|
|
23256
|
+
}, [threadId]);
|
|
23257
|
+
useEffect45(() => {
|
|
23258
|
+
initialMessageSentRef.current = false;
|
|
23259
|
+
}, [threadId]);
|
|
23260
|
+
useEffect45(() => {
|
|
23261
|
+
const wasLoading = prevLoadingRef.current;
|
|
23262
|
+
prevLoadingRef.current = isLoading;
|
|
23263
|
+
if (wasLoading && !isLoading && initialMessage && threadId && !initialMessageSentRef.current) {
|
|
23264
|
+
initialMessageSentRef.current = true;
|
|
23265
|
+
sendMessage({
|
|
23266
|
+
input: { message: initialMessage },
|
|
23267
|
+
streaming: true
|
|
23268
|
+
});
|
|
23269
|
+
onInitialMessageSent?.();
|
|
23270
|
+
}
|
|
23271
|
+
}, [isLoading, initialMessage, threadId, sendMessage, onInitialMessageSent]);
|
|
23272
|
+
const [modelConfig, setModelConfig] = useState65(null);
|
|
23273
|
+
const handleModelChange = useCallback33((config2) => {
|
|
23177
23274
|
setModelConfig(config2);
|
|
23178
23275
|
if (config2) {
|
|
23179
23276
|
updateCustomRunConfig({ modelConfig: config2 });
|
|
23180
23277
|
}
|
|
23181
23278
|
}, [updateCustomRunConfig]);
|
|
23182
|
-
const [isEmptyState, setIsEmptyState] =
|
|
23183
|
-
const [isTransitioning, setIsTransitioning] =
|
|
23184
|
-
|
|
23279
|
+
const [isEmptyState, setIsEmptyState] = useState65(showEmptyState && messages.length === 0 && !pendingMessages?.length);
|
|
23280
|
+
const [isTransitioning, setIsTransitioning] = useState65(false);
|
|
23281
|
+
useEffect45(() => {
|
|
23185
23282
|
if (!showEmptyState) {
|
|
23186
23283
|
setIsEmptyState(false);
|
|
23187
23284
|
return;
|
|
@@ -23206,9 +23303,9 @@ var Chating = ({
|
|
|
23206
23303
|
const listPathByFolder = workspaceContext?.listPathByFolder ?? (async () => []);
|
|
23207
23304
|
const workspaceId = workspaceContext?.workspaceId ?? null;
|
|
23208
23305
|
const projectId = workspaceContext?.projectId ?? null;
|
|
23209
|
-
const [workspaceFiles, setWorkspaceFiles] =
|
|
23210
|
-
const [suggestionsLoading, setSuggestionsLoading] =
|
|
23211
|
-
const [suggestionsOpen, setSuggestionsOpen] =
|
|
23306
|
+
const [workspaceFiles, setWorkspaceFiles] = useState65([]);
|
|
23307
|
+
const [suggestionsLoading, setSuggestionsLoading] = useState65(false);
|
|
23308
|
+
const [suggestionsOpen, setSuggestionsOpen] = useState65(false);
|
|
23212
23309
|
const getFileIcon3 = (filename) => {
|
|
23213
23310
|
const ext = filename.split(".").pop()?.toLowerCase();
|
|
23214
23311
|
const iconStyle = { fontSize: 16 };
|
|
@@ -23268,7 +23365,7 @@ var Chating = ({
|
|
|
23268
23365
|
setSuggestionsLoading(false);
|
|
23269
23366
|
}
|
|
23270
23367
|
};
|
|
23271
|
-
|
|
23368
|
+
useEffect45(() => {
|
|
23272
23369
|
regsiterElement("action_show_attachments_uploader", {
|
|
23273
23370
|
card_view: () => null,
|
|
23274
23371
|
action: (data) => {
|
|
@@ -23296,6 +23393,11 @@ var Chating = ({
|
|
|
23296
23393
|
if (!nextContent && attachedFiles.length > 0) {
|
|
23297
23394
|
nextContent = default_submit_message || "";
|
|
23298
23395
|
}
|
|
23396
|
+
if (systemContext && !systemContextSentRef.current) {
|
|
23397
|
+
systemContextSentRef.current = true;
|
|
23398
|
+
nextContent = `${systemContext}
|
|
23399
|
+
${nextContent}`;
|
|
23400
|
+
}
|
|
23299
23401
|
const files = attachedFiles.map(
|
|
23300
23402
|
(file) => isArchiveFile(file) ? {
|
|
23301
23403
|
name: file.response.zipFileName || file.response.rarFileName,
|
|
@@ -23364,7 +23466,7 @@ var Chating = ({
|
|
|
23364
23466
|
return true;
|
|
23365
23467
|
};
|
|
23366
23468
|
const senderHeader = /* @__PURE__ */ jsx91(
|
|
23367
|
-
|
|
23469
|
+
Sender.Header,
|
|
23368
23470
|
{
|
|
23369
23471
|
title: "Attachments",
|
|
23370
23472
|
open: headerOpen,
|
|
@@ -23407,13 +23509,13 @@ var Chating = ({
|
|
|
23407
23509
|
)
|
|
23408
23510
|
}
|
|
23409
23511
|
);
|
|
23410
|
-
const
|
|
23411
|
-
const
|
|
23412
|
-
const
|
|
23413
|
-
const
|
|
23512
|
+
const effectiveShowDatabaseSlot = showDatabaseSlot !== void 0 ? showDatabaseSlot : config.enableDatabaseSlot;
|
|
23513
|
+
const effectiveShowSkillSlot = showSkillSlot !== void 0 ? showSkillSlot : config.enableSkillSlot;
|
|
23514
|
+
const effectiveShowAgentSlot = showAgentSlot !== void 0 ? showAgentSlot : config.enableAgentSlot;
|
|
23515
|
+
const effectiveShowMetricsDataSourceSlot = showMetricsDataSourceSlot !== void 0 ? showMetricsDataSourceSlot : config.enableMetricsDataSourceSlot;
|
|
23414
23516
|
const shouldShowModelSelector = showModelSelector !== void 0 ? showModelSelector : config.enableModelSelector;
|
|
23415
23517
|
const senderFooter = (actionNode) => {
|
|
23416
|
-
const hasSlotButtons =
|
|
23518
|
+
const hasSlotButtons = effectiveShowAgentSlot || effectiveShowDatabaseSlot || effectiveShowSkillSlot || effectiveShowMetricsDataSourceSlot;
|
|
23417
23519
|
return /* @__PURE__ */ jsxs63(Flex5, { justify: "space-between", align: "center", style: { padding: "8px 0" }, children: [
|
|
23418
23520
|
/* @__PURE__ */ jsxs63(Flex5, { align: "center", gap: 8, children: [
|
|
23419
23521
|
/* @__PURE__ */ jsx91(Badge6, { dot: attachedFiles.length > 0 && !headerOpen, children: /* @__PURE__ */ jsx91(
|
|
@@ -23426,10 +23528,10 @@ var Chating = ({
|
|
|
23426
23528
|
) }),
|
|
23427
23529
|
/* @__PURE__ */ jsx91(Divider6, { type: "vertical", style: { margin: 0 } }),
|
|
23428
23530
|
hasSlotButtons && /* @__PURE__ */ jsxs63(Flex5, { align: "center", gap: 8, children: [
|
|
23429
|
-
|
|
23430
|
-
|
|
23431
|
-
|
|
23432
|
-
|
|
23531
|
+
effectiveShowAgentSlot && /* @__PURE__ */ jsx91(AgentPicker, { senderRef, iconOnly: true }),
|
|
23532
|
+
effectiveShowDatabaseSlot && /* @__PURE__ */ jsx91(DatabasePicker, { senderRef, iconOnly: true }),
|
|
23533
|
+
effectiveShowSkillSlot && /* @__PURE__ */ jsx91(SkillPicker, { senderRef, iconOnly: true }),
|
|
23534
|
+
effectiveShowMetricsDataSourceSlot && /* @__PURE__ */ jsx91(MetricsDataSourcePicker, { senderRef, iconOnly: true })
|
|
23433
23535
|
] })
|
|
23434
23536
|
] }),
|
|
23435
23537
|
/* @__PURE__ */ jsxs63(Flex5, { align: "center", gap: 8, children: [
|
|
@@ -23451,7 +23553,7 @@ var Chating = ({
|
|
|
23451
23553
|
Button46,
|
|
23452
23554
|
{
|
|
23453
23555
|
type: "text",
|
|
23454
|
-
icon: /* @__PURE__ */ jsx91(
|
|
23556
|
+
icon: /* @__PURE__ */ jsx91(ReloadOutlined4, {}),
|
|
23455
23557
|
onClick: () => {
|
|
23456
23558
|
loadMessages();
|
|
23457
23559
|
}
|
|
@@ -23461,8 +23563,8 @@ var Chating = ({
|
|
|
23461
23563
|
...showRefreshButton ? [refreshButton] : [],
|
|
23462
23564
|
/* @__PURE__ */ jsx91(ThreadManagementButtons, {}, "thread-buttons")
|
|
23463
23565
|
];
|
|
23464
|
-
const [skills, setSkills] =
|
|
23465
|
-
const [skillsLoading, setSkillsLoading] =
|
|
23566
|
+
const [skills, setSkills] = useState65([]);
|
|
23567
|
+
const [skillsLoading, setSkillsLoading] = useState65(false);
|
|
23466
23568
|
const { get: apiGet } = useApi();
|
|
23467
23569
|
const loadSkills = async () => {
|
|
23468
23570
|
if (skills.length > 0) return;
|
|
@@ -23486,7 +23588,7 @@ var Chating = ({
|
|
|
23486
23588
|
return isEmpty ? "Type / to see available skills, or @ to reference files" : void 0;
|
|
23487
23589
|
};
|
|
23488
23590
|
const renderSender = (isEmpty) => {
|
|
23489
|
-
const [suggestionMode, setSuggestionMode] =
|
|
23591
|
+
const [suggestionMode, setSuggestionMode] = useState65(null);
|
|
23490
23592
|
const suggestionItems = suggestionMode === "skills" ? skills.map((skill) => ({
|
|
23491
23593
|
value: skill.name,
|
|
23492
23594
|
icon: /* @__PURE__ */ jsx91(BrainCircuit3, { size: 14, style: { color: "#722ed1" } }),
|
|
@@ -23530,7 +23632,7 @@ var Chating = ({
|
|
|
23530
23632
|
}
|
|
23531
23633
|
},
|
|
23532
23634
|
children: ({ onTrigger, onKeyDown }) => /* @__PURE__ */ jsx91(
|
|
23533
|
-
|
|
23635
|
+
Sender,
|
|
23534
23636
|
{
|
|
23535
23637
|
slotConfig,
|
|
23536
23638
|
disabled: isInputDisabled,
|
|
@@ -23865,16 +23967,16 @@ var InternetSearchCard = ({
|
|
|
23865
23967
|
};
|
|
23866
23968
|
|
|
23867
23969
|
// src/components/GenUI/elements/schedule_viewer.tsx
|
|
23868
|
-
import { useState as
|
|
23970
|
+
import { useState as useState66, useEffect as useEffect46, useCallback as useCallback34 } from "react";
|
|
23869
23971
|
import {
|
|
23870
23972
|
Tag as Tag22,
|
|
23871
23973
|
Button as Button48,
|
|
23872
23974
|
Empty as Empty16,
|
|
23873
|
-
Spin as
|
|
23975
|
+
Spin as Spin17,
|
|
23874
23976
|
Typography as Typography45,
|
|
23875
23977
|
Space as Space32,
|
|
23876
23978
|
Tooltip as Tooltip18,
|
|
23877
|
-
Popconfirm as
|
|
23979
|
+
Popconfirm as Popconfirm10,
|
|
23878
23980
|
message as message16,
|
|
23879
23981
|
Card as Card23
|
|
23880
23982
|
} from "antd";
|
|
@@ -23883,7 +23985,7 @@ import {
|
|
|
23883
23985
|
PauseCircleOutlined,
|
|
23884
23986
|
PlayCircleOutlined as PlayCircleOutlined2,
|
|
23885
23987
|
StopOutlined,
|
|
23886
|
-
ReloadOutlined as
|
|
23988
|
+
ReloadOutlined as ReloadOutlined5,
|
|
23887
23989
|
CheckCircleOutlined as CheckCircleOutlined7,
|
|
23888
23990
|
CloseCircleOutlined as CloseCircleOutlined3,
|
|
23889
23991
|
ExclamationCircleOutlined,
|
|
@@ -24029,10 +24131,10 @@ var ScheduleViewer = ({ data }) => {
|
|
|
24029
24131
|
const { styles } = useStyles8();
|
|
24030
24132
|
const { threadId, assistantId, tasks: initialTasks, onRefresh } = data ?? {};
|
|
24031
24133
|
const client = useClient(assistantId || "");
|
|
24032
|
-
const [tasks, setTasks] =
|
|
24033
|
-
const [loading, setLoading] =
|
|
24034
|
-
const [actionLoading, setActionLoading] =
|
|
24035
|
-
const handleRefresh =
|
|
24134
|
+
const [tasks, setTasks] = useState66(initialTasks || []);
|
|
24135
|
+
const [loading, setLoading] = useState66(false);
|
|
24136
|
+
const [actionLoading, setActionLoading] = useState66(null);
|
|
24137
|
+
const handleRefresh = useCallback34(async () => {
|
|
24036
24138
|
if (!threadId) return;
|
|
24037
24139
|
setLoading(true);
|
|
24038
24140
|
try {
|
|
@@ -24046,7 +24148,7 @@ var ScheduleViewer = ({ data }) => {
|
|
|
24046
24148
|
setLoading(false);
|
|
24047
24149
|
}
|
|
24048
24150
|
}, [client, threadId, onRefresh]);
|
|
24049
|
-
const handleCancel =
|
|
24151
|
+
const handleCancel = useCallback34(
|
|
24050
24152
|
async (taskId) => {
|
|
24051
24153
|
setActionLoading(taskId);
|
|
24052
24154
|
try {
|
|
@@ -24062,7 +24164,7 @@ var ScheduleViewer = ({ data }) => {
|
|
|
24062
24164
|
},
|
|
24063
24165
|
[client, handleRefresh]
|
|
24064
24166
|
);
|
|
24065
|
-
const handlePause =
|
|
24167
|
+
const handlePause = useCallback34(
|
|
24066
24168
|
async (taskId) => {
|
|
24067
24169
|
setActionLoading(taskId);
|
|
24068
24170
|
try {
|
|
@@ -24078,7 +24180,7 @@ var ScheduleViewer = ({ data }) => {
|
|
|
24078
24180
|
},
|
|
24079
24181
|
[client, handleRefresh]
|
|
24080
24182
|
);
|
|
24081
|
-
const handleResume =
|
|
24183
|
+
const handleResume = useCallback34(
|
|
24082
24184
|
async (taskId) => {
|
|
24083
24185
|
setActionLoading(taskId);
|
|
24084
24186
|
try {
|
|
@@ -24094,12 +24196,12 @@ var ScheduleViewer = ({ data }) => {
|
|
|
24094
24196
|
},
|
|
24095
24197
|
[client, handleRefresh]
|
|
24096
24198
|
);
|
|
24097
|
-
|
|
24199
|
+
useEffect46(() => {
|
|
24098
24200
|
if (threadId && (!initialTasks || initialTasks.length === 0)) {
|
|
24099
24201
|
handleRefresh();
|
|
24100
24202
|
}
|
|
24101
24203
|
}, [threadId]);
|
|
24102
|
-
|
|
24204
|
+
useEffect46(() => {
|
|
24103
24205
|
if (initialTasks) {
|
|
24104
24206
|
setTasks(initialTasks);
|
|
24105
24207
|
}
|
|
@@ -24131,7 +24233,7 @@ var ScheduleViewer = ({ data }) => {
|
|
|
24131
24233
|
}
|
|
24132
24234
|
) }),
|
|
24133
24235
|
(isPending || isPaused) && /* @__PURE__ */ jsx94(
|
|
24134
|
-
|
|
24236
|
+
Popconfirm10,
|
|
24135
24237
|
{
|
|
24136
24238
|
title: "Cancel this scheduled task?",
|
|
24137
24239
|
description: "This action cannot be undone.",
|
|
@@ -24218,14 +24320,14 @@ var ScheduleViewer = ({ data }) => {
|
|
|
24218
24320
|
Button48,
|
|
24219
24321
|
{
|
|
24220
24322
|
type: "text",
|
|
24221
|
-
icon: /* @__PURE__ */ jsx94(
|
|
24323
|
+
icon: /* @__PURE__ */ jsx94(ReloadOutlined5, { spin: loading }),
|
|
24222
24324
|
onClick: handleRefresh,
|
|
24223
24325
|
loading
|
|
24224
24326
|
}
|
|
24225
24327
|
) })
|
|
24226
24328
|
] }),
|
|
24227
24329
|
loading && tasks.length === 0 ? /* @__PURE__ */ jsxs65("div", { className: styles.emptyContainer, children: [
|
|
24228
|
-
/* @__PURE__ */ jsx94(
|
|
24330
|
+
/* @__PURE__ */ jsx94(Spin17, { size: "large" }),
|
|
24229
24331
|
/* @__PURE__ */ jsx94(Text35, { type: "secondary", style: { marginTop: 16 }, children: "Loading scheduled tasks..." })
|
|
24230
24332
|
] }) : tasks.length === 0 ? /* @__PURE__ */ jsx94("div", { className: styles.emptyContainer, children: /* @__PURE__ */ jsx94(
|
|
24231
24333
|
Empty16,
|
|
@@ -24567,13 +24669,13 @@ var TeamGraph = ({ data }) => {
|
|
|
24567
24669
|
var TeamGraph_default = TeamGraph;
|
|
24568
24670
|
|
|
24569
24671
|
// src/components/GenUI/elements/TeamWorkspace/index.tsx
|
|
24570
|
-
import { useState as
|
|
24571
|
-
import { Layout, Spin as
|
|
24672
|
+
import { useState as useState71, useMemo as useMemo27 } from "react";
|
|
24673
|
+
import { Layout, Spin as Spin18, Button as Button52 } from "antd";
|
|
24572
24674
|
import { RefreshCw } from "lucide-react";
|
|
24573
24675
|
import { createStyles as createStyles33 } from "antd-style";
|
|
24574
24676
|
|
|
24575
24677
|
// src/components/GenUI/elements/TeamWorkspace/TeamWorkspaceMenu.tsx
|
|
24576
|
-
import React53, { useState as
|
|
24678
|
+
import React53, { useState as useState67 } from "react";
|
|
24577
24679
|
import {
|
|
24578
24680
|
LayoutDashboard,
|
|
24579
24681
|
Inbox as Inbox2,
|
|
@@ -24767,7 +24869,7 @@ var TeamWorkspaceMenu = ({
|
|
|
24767
24869
|
onItemClick
|
|
24768
24870
|
}) => {
|
|
24769
24871
|
const { styles } = useStyles9();
|
|
24770
|
-
const [isExpanded, setIsExpanded] =
|
|
24872
|
+
const [isExpanded, setIsExpanded] = useState67(false);
|
|
24771
24873
|
const mainItems = items.filter((item) => !item.group);
|
|
24772
24874
|
const teammateItems = items.filter((item) => item.group === "Teammates");
|
|
24773
24875
|
const teamItems = items.filter((item) => item.group === "Team");
|
|
@@ -24849,13 +24951,13 @@ import {
|
|
|
24849
24951
|
import { createStyles as createStyles26 } from "antd-style";
|
|
24850
24952
|
|
|
24851
24953
|
// src/components/GenUI/elements/TeamWorkspace/hooks/useTeamWorkspaceData.ts
|
|
24852
|
-
import { useMemo as
|
|
24954
|
+
import { useMemo as useMemo23 } from "react";
|
|
24853
24955
|
function useTeamWorkspaceData(threadId, assistantId) {
|
|
24854
24956
|
const { agentState, isLoading, error, refresh } = useAgentState(threadId, assistantId, {
|
|
24855
24957
|
pollingInterval: 5e3,
|
|
24856
24958
|
autoStart: true
|
|
24857
24959
|
});
|
|
24858
|
-
const data =
|
|
24960
|
+
const data = useMemo23(() => {
|
|
24859
24961
|
const team = agentState?.values?.team || null;
|
|
24860
24962
|
const tasks = agentState?.values?.tasks || [];
|
|
24861
24963
|
const mailbox = agentState?.values?.team_mailbox || [];
|
|
@@ -25244,7 +25346,7 @@ var TeamDashboard = ({
|
|
|
25244
25346
|
};
|
|
25245
25347
|
|
|
25246
25348
|
// src/components/GenUI/elements/TeamWorkspace/IssuesView.tsx
|
|
25247
|
-
import { useState as
|
|
25349
|
+
import { useState as useState69, useMemo as useMemo24 } from "react";
|
|
25248
25350
|
import { Typography as Typography51, Badge as Badge8, Empty as Empty17, Tooltip as Tooltip21 } from "antd";
|
|
25249
25351
|
import {
|
|
25250
25352
|
CheckCircle2 as CheckCircle24,
|
|
@@ -25259,7 +25361,7 @@ import {
|
|
|
25259
25361
|
import { createStyles as createStyles28 } from "antd-style";
|
|
25260
25362
|
|
|
25261
25363
|
// src/components/GenUI/elements/TeamWorkspace/TaskDetailModal.tsx
|
|
25262
|
-
import { useState as
|
|
25364
|
+
import { useState as useState68 } from "react";
|
|
25263
25365
|
import { Modal as Modal18, Typography as Typography50, Tag as Tag24, Divider as Divider7, Tabs as Tabs2, Timeline } from "antd";
|
|
25264
25366
|
import { createStyles as createStyles27 } from "antd-style";
|
|
25265
25367
|
import {
|
|
@@ -25684,7 +25786,7 @@ var TaskDetailModal = ({
|
|
|
25684
25786
|
onClose
|
|
25685
25787
|
}) => {
|
|
25686
25788
|
const { styles } = useStyles11();
|
|
25687
|
-
const [activeTab, setActiveTab] =
|
|
25789
|
+
const [activeTab, setActiveTab] = useState68("comments");
|
|
25688
25790
|
if (!task) return null;
|
|
25689
25791
|
const statusConfig2 = getStatusConfig2(task.status);
|
|
25690
25792
|
const tabItems = [
|
|
@@ -26110,7 +26212,7 @@ var formatDate2 = (timestamp) => {
|
|
|
26110
26212
|
});
|
|
26111
26213
|
};
|
|
26112
26214
|
var ListGroupComponent = ({ group, styles, defaultExpanded = true, onTaskClick }) => {
|
|
26113
|
-
const [isExpanded, setIsExpanded] =
|
|
26215
|
+
const [isExpanded, setIsExpanded] = useState69(defaultExpanded);
|
|
26114
26216
|
return /* @__PURE__ */ jsxs72("div", { className: styles.listGroup, children: [
|
|
26115
26217
|
/* @__PURE__ */ jsxs72(
|
|
26116
26218
|
"div",
|
|
@@ -26153,10 +26255,10 @@ var IssuesView = ({
|
|
|
26153
26255
|
teammates
|
|
26154
26256
|
}) => {
|
|
26155
26257
|
const { styles } = useStyles12();
|
|
26156
|
-
const [viewMode, setViewMode] =
|
|
26157
|
-
const [selectedTask, setSelectedTask] =
|
|
26158
|
-
const [modalVisible, setModalVisible] =
|
|
26159
|
-
const listGroups =
|
|
26258
|
+
const [viewMode, setViewMode] = useState69("list");
|
|
26259
|
+
const [selectedTask, setSelectedTask] = useState69(null);
|
|
26260
|
+
const [modalVisible, setModalVisible] = useState69(false);
|
|
26261
|
+
const listGroups = useMemo24(() => {
|
|
26160
26262
|
const groups = [
|
|
26161
26263
|
{
|
|
26162
26264
|
id: "pending",
|
|
@@ -26195,7 +26297,7 @@ var IssuesView = ({
|
|
|
26195
26297
|
});
|
|
26196
26298
|
return groups;
|
|
26197
26299
|
}, [tasks]);
|
|
26198
|
-
const tasksByStatus =
|
|
26300
|
+
const tasksByStatus = useMemo24(() => {
|
|
26199
26301
|
const grouped = {
|
|
26200
26302
|
pending: [],
|
|
26201
26303
|
claimed: [],
|
|
@@ -26328,7 +26430,7 @@ var IssuesView = ({
|
|
|
26328
26430
|
};
|
|
26329
26431
|
|
|
26330
26432
|
// src/components/GenUI/elements/TeamWorkspace/TeamOrgCanvas.tsx
|
|
26331
|
-
import React56, { useMemo as
|
|
26433
|
+
import React56, { useMemo as useMemo25 } from "react";
|
|
26332
26434
|
import {
|
|
26333
26435
|
ReactFlow as ReactFlow5,
|
|
26334
26436
|
Background as Background5,
|
|
@@ -26494,7 +26596,7 @@ var TeamOrgCanvasInner = ({
|
|
|
26494
26596
|
}) => {
|
|
26495
26597
|
const { styles } = useStyles13();
|
|
26496
26598
|
const { fitView } = useReactFlow2();
|
|
26497
|
-
const taskStatsByTeammate =
|
|
26599
|
+
const taskStatsByTeammate = useMemo25(() => {
|
|
26498
26600
|
const stats = {};
|
|
26499
26601
|
teammates.forEach((t) => {
|
|
26500
26602
|
stats[t.name] = { completed: 0, inProgress: 0, pending: 0 };
|
|
@@ -26512,7 +26614,7 @@ var TeamOrgCanvasInner = ({
|
|
|
26512
26614
|
});
|
|
26513
26615
|
return stats;
|
|
26514
26616
|
}, [teammates, tasks]);
|
|
26515
|
-
const { nodes, edges } =
|
|
26617
|
+
const { nodes, edges } = useMemo25(() => {
|
|
26516
26618
|
const newNodes = [];
|
|
26517
26619
|
const newEdges = [];
|
|
26518
26620
|
const teamLeadId = team?.teamLeadId || "team_lead";
|
|
@@ -26766,7 +26868,7 @@ var TeamMemberChat = ({
|
|
|
26766
26868
|
};
|
|
26767
26869
|
|
|
26768
26870
|
// src/components/GenUI/elements/MailboxPanel.tsx
|
|
26769
|
-
import { useState as
|
|
26871
|
+
import { useState as useState70, useMemo as useMemo26 } from "react";
|
|
26770
26872
|
import { Typography as Typography55, Empty as Empty18 } from "antd";
|
|
26771
26873
|
import { createStyles as createStyles32 } from "antd-style";
|
|
26772
26874
|
import {
|
|
@@ -27189,7 +27291,7 @@ var getMessagePreview = (content) => {
|
|
|
27189
27291
|
return firstLine.length > 80 ? firstLine.slice(0, 80) + "..." : firstLine;
|
|
27190
27292
|
};
|
|
27191
27293
|
var MessageGroupComponent = ({ group, styles, defaultExpanded = true, onMessageClick }) => {
|
|
27192
|
-
const [isExpanded, setIsExpanded] =
|
|
27294
|
+
const [isExpanded, setIsExpanded] = useState70(defaultExpanded);
|
|
27193
27295
|
return /* @__PURE__ */ jsxs76("div", { className: styles.listGroup, children: [
|
|
27194
27296
|
/* @__PURE__ */ jsxs76(
|
|
27195
27297
|
"div",
|
|
@@ -27244,10 +27346,10 @@ var MessageGroupComponent = ({ group, styles, defaultExpanded = true, onMessageC
|
|
|
27244
27346
|
};
|
|
27245
27347
|
var MailboxPanel = ({ data }) => {
|
|
27246
27348
|
const { styles } = useStyles16();
|
|
27247
|
-
const [selectedMessage, setSelectedMessage] =
|
|
27248
|
-
const [modalVisible, setModalVisible] =
|
|
27349
|
+
const [selectedMessage, setSelectedMessage] = useState70(null);
|
|
27350
|
+
const [modalVisible, setModalVisible] = useState70(false);
|
|
27249
27351
|
const { teamMailbox = [] } = data || {};
|
|
27250
|
-
const messageGroups =
|
|
27352
|
+
const messageGroups = useMemo26(() => {
|
|
27251
27353
|
const groupsMap = /* @__PURE__ */ new Map();
|
|
27252
27354
|
teamMailbox.forEach((message23) => {
|
|
27253
27355
|
const sender = message23.from;
|
|
@@ -27375,8 +27477,8 @@ var TeamWorkspace = ({
|
|
|
27375
27477
|
isLoading,
|
|
27376
27478
|
refresh
|
|
27377
27479
|
} = useTeamWorkspaceData(parent_thread_id || null, assistantId);
|
|
27378
|
-
const [activeMenuId, setActiveMenuId] =
|
|
27379
|
-
const menuItems =
|
|
27480
|
+
const [activeMenuId, setActiveMenuId] = useState71("dashboard");
|
|
27481
|
+
const menuItems = useMemo27(() => {
|
|
27380
27482
|
const items = [
|
|
27381
27483
|
{
|
|
27382
27484
|
id: "dashboard",
|
|
@@ -27418,7 +27520,7 @@ var TeamWorkspace = ({
|
|
|
27418
27520
|
};
|
|
27419
27521
|
const renderContent = () => {
|
|
27420
27522
|
if (isLoading) {
|
|
27421
|
-
return /* @__PURE__ */ jsx106("div", { className: styles.loadingContainer, children: /* @__PURE__ */ jsx106(
|
|
27523
|
+
return /* @__PURE__ */ jsx106("div", { className: styles.loadingContainer, children: /* @__PURE__ */ jsx106(Spin18, { size: "large" }) });
|
|
27422
27524
|
}
|
|
27423
27525
|
const activeItem = menuItems.find((item) => item.id === activeMenuId);
|
|
27424
27526
|
switch (activeItem?.type) {
|
|
@@ -27513,7 +27615,7 @@ var TeamWorkspace = ({
|
|
|
27513
27615
|
};
|
|
27514
27616
|
|
|
27515
27617
|
// src/components/GenUI/elements/TaskBoard.tsx
|
|
27516
|
-
import { useMemo as
|
|
27618
|
+
import { useMemo as useMemo28 } from "react";
|
|
27517
27619
|
|
|
27518
27620
|
// src/components/GenUI/elements/TaskBoardCard.tsx
|
|
27519
27621
|
import { jsx as jsx107, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
@@ -27792,7 +27894,7 @@ var TaskBoard = ({
|
|
|
27792
27894
|
const { tasks: contextTasks } = useAgentChat();
|
|
27793
27895
|
const { tasks: propTasks, onAddTask, teammates } = data || {};
|
|
27794
27896
|
const tasks = contextTasks || propTasks || [];
|
|
27795
|
-
const tasksByStatus =
|
|
27897
|
+
const tasksByStatus = useMemo28(() => {
|
|
27796
27898
|
const grouped = {
|
|
27797
27899
|
pending: [],
|
|
27798
27900
|
in_progress: [],
|
|
@@ -27858,7 +27960,7 @@ var TaskBoard = ({
|
|
|
27858
27960
|
};
|
|
27859
27961
|
|
|
27860
27962
|
// src/components/GenUI/elements/Mailbox.tsx
|
|
27861
|
-
import { useState as
|
|
27963
|
+
import { useState as useState72, useMemo as useMemo29, useRef as useRef24, useEffect as useEffect47 } from "react";
|
|
27862
27964
|
import { jsx as jsx109, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
27863
27965
|
var useStyle16 = () => {
|
|
27864
27966
|
return {
|
|
@@ -28144,17 +28246,17 @@ var renderMessageWithMentions = (content, mentions, styles) => {
|
|
|
28144
28246
|
var TeamChat = ({ data }) => {
|
|
28145
28247
|
const styles = useStyle16();
|
|
28146
28248
|
const { teamName, currentUser, teammates, messages, onSendMessage } = data || {};
|
|
28147
|
-
const [inputValue, setInputValue] =
|
|
28249
|
+
const [inputValue, setInputValue] = useState72("");
|
|
28148
28250
|
const messagesEndRef = useRef24(null);
|
|
28149
|
-
const sortedMessages =
|
|
28251
|
+
const sortedMessages = useMemo29(() => {
|
|
28150
28252
|
return [...messages || []].sort(
|
|
28151
28253
|
(a, b) => new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime()
|
|
28152
28254
|
);
|
|
28153
28255
|
}, [messages]);
|
|
28154
|
-
const mentions =
|
|
28256
|
+
const mentions = useMemo29(() => {
|
|
28155
28257
|
return teammates?.map((t) => t.name) || [];
|
|
28156
28258
|
}, [teammates]);
|
|
28157
|
-
|
|
28259
|
+
useEffect47(() => {
|
|
28158
28260
|
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
28159
28261
|
}, [sortedMessages]);
|
|
28160
28262
|
const handleSend = () => {
|
|
@@ -28323,12 +28425,12 @@ var TeamChat = ({ data }) => {
|
|
|
28323
28425
|
};
|
|
28324
28426
|
|
|
28325
28427
|
// src/components/GenUI/elements/ShowWidget.tsx
|
|
28326
|
-
import { useCallback as
|
|
28428
|
+
import { useCallback as useCallback36 } from "react";
|
|
28327
28429
|
import { Button as Button53, Typography as Typography56 } from "antd";
|
|
28328
28430
|
import { ExpandOutlined as ExpandOutlined2 } from "@ant-design/icons";
|
|
28329
28431
|
|
|
28330
28432
|
// src/streaming-html/StreamingHTMLRenderer.tsx
|
|
28331
|
-
import React61, { useEffect as
|
|
28433
|
+
import React61, { useEffect as useEffect48, useRef as useRef25, useCallback as useCallback35, useState as useState73 } from "react";
|
|
28332
28434
|
|
|
28333
28435
|
// src/streaming-html/show-widget-css-generator.ts
|
|
28334
28436
|
function generateShowWidgetCSS(tokens) {
|
|
@@ -29029,12 +29131,12 @@ var StreamingHTMLRenderer = ({
|
|
|
29029
29131
|
const isScriptExecuted = useRef25(false);
|
|
29030
29132
|
const [iframeHeight, setIframeHeight] = React61.useState(0);
|
|
29031
29133
|
const [iframeWidth, setIframeWidth] = React61.useState(void 0);
|
|
29032
|
-
const [currentMessageIndex, setCurrentMessageIndex] =
|
|
29033
|
-
const [showLoading, setShowLoading] =
|
|
29034
|
-
|
|
29134
|
+
const [currentMessageIndex, setCurrentMessageIndex] = useState73(0);
|
|
29135
|
+
const [showLoading, setShowLoading] = useState73(true);
|
|
29136
|
+
useEffect48(() => {
|
|
29035
29137
|
isCompleteRef.current = isComplete;
|
|
29036
29138
|
}, [isComplete]);
|
|
29037
|
-
|
|
29139
|
+
useEffect48(() => {
|
|
29038
29140
|
if (iframeHeight > 0) {
|
|
29039
29141
|
setShowLoading(false);
|
|
29040
29142
|
return;
|
|
@@ -29059,7 +29161,7 @@ var StreamingHTMLRenderer = ({
|
|
|
29059
29161
|
}, 1500);
|
|
29060
29162
|
return () => clearInterval(interval);
|
|
29061
29163
|
}, [iframeHeight, loadingMessages]);
|
|
29062
|
-
const executeScripts =
|
|
29164
|
+
const executeScripts = useCallback35(() => {
|
|
29063
29165
|
if (isScriptExecuted.current) {
|
|
29064
29166
|
console.log("[StreamingHTMLRenderer] scripts is executed");
|
|
29065
29167
|
return;
|
|
@@ -29086,7 +29188,7 @@ var StreamingHTMLRenderer = ({
|
|
|
29086
29188
|
onError?.(streamingError);
|
|
29087
29189
|
}
|
|
29088
29190
|
}, [onError]);
|
|
29089
|
-
const sendChunk =
|
|
29191
|
+
const sendChunk = useCallback35((chunk) => {
|
|
29090
29192
|
const iframe = iframeRef.current;
|
|
29091
29193
|
if (!iframe || !iframe.contentWindow) {
|
|
29092
29194
|
return;
|
|
@@ -29110,7 +29212,7 @@ var StreamingHTMLRenderer = ({
|
|
|
29110
29212
|
onError?.(streamingError);
|
|
29111
29213
|
}
|
|
29112
29214
|
}, [onError]);
|
|
29113
|
-
|
|
29215
|
+
useEffect48(() => {
|
|
29114
29216
|
const handleMessage = (event) => {
|
|
29115
29217
|
const iframe = iframeRef.current;
|
|
29116
29218
|
if (!iframe || event.source !== iframe.contentWindow) {
|
|
@@ -29163,7 +29265,7 @@ var StreamingHTMLRenderer = ({
|
|
|
29163
29265
|
window.removeEventListener("message", handleMessage);
|
|
29164
29266
|
};
|
|
29165
29267
|
}, [onError, onPrompt, sendChunk, executeScripts]);
|
|
29166
|
-
|
|
29268
|
+
useEffect48(() => {
|
|
29167
29269
|
if (html === prevHTMLRef.current) {
|
|
29168
29270
|
return;
|
|
29169
29271
|
}
|
|
@@ -29174,12 +29276,12 @@ var StreamingHTMLRenderer = ({
|
|
|
29174
29276
|
sendChunk(newChunk);
|
|
29175
29277
|
}
|
|
29176
29278
|
}, [html, sendChunk]);
|
|
29177
|
-
|
|
29279
|
+
useEffect48(() => {
|
|
29178
29280
|
if (isComplete && isReadyRef.current) {
|
|
29179
29281
|
executeScripts();
|
|
29180
29282
|
}
|
|
29181
29283
|
}, [isComplete, executeScripts]);
|
|
29182
|
-
|
|
29284
|
+
useEffect48(() => {
|
|
29183
29285
|
const container = containerRef.current;
|
|
29184
29286
|
if (!container) return;
|
|
29185
29287
|
const antBubble = container.closest(".ant-bubble");
|
|
@@ -29205,7 +29307,7 @@ var StreamingHTMLRenderer = ({
|
|
|
29205
29307
|
resizeObserverRef.current = null;
|
|
29206
29308
|
};
|
|
29207
29309
|
}, []);
|
|
29208
|
-
|
|
29310
|
+
useEffect48(() => {
|
|
29209
29311
|
return () => {
|
|
29210
29312
|
isReadyRef.current = false;
|
|
29211
29313
|
pendingChunksRef.current = [];
|
|
@@ -29308,14 +29410,14 @@ var ShowWidget = ({
|
|
|
29308
29410
|
console.warn("Failed to parse tool response:", e);
|
|
29309
29411
|
}
|
|
29310
29412
|
}
|
|
29311
|
-
const sendPrompt =
|
|
29413
|
+
const sendPrompt = useCallback36((text) => {
|
|
29312
29414
|
sendMessage({
|
|
29313
29415
|
input: {
|
|
29314
29416
|
message: text
|
|
29315
29417
|
}
|
|
29316
29418
|
});
|
|
29317
29419
|
}, [sendMessage]);
|
|
29318
|
-
const handleOpenInSideApp =
|
|
29420
|
+
const handleOpenInSideApp = useCallback36(() => {
|
|
29319
29421
|
openSideApp({
|
|
29320
29422
|
component_key: "show_widget",
|
|
29321
29423
|
data: {
|
|
@@ -29384,14 +29486,14 @@ var ShowWidget = ({
|
|
|
29384
29486
|
};
|
|
29385
29487
|
|
|
29386
29488
|
// src/components/GenUI/elements/ShowWidgetApp.tsx
|
|
29387
|
-
import { useCallback as
|
|
29489
|
+
import { useCallback as useCallback37 } from "react";
|
|
29388
29490
|
import { jsx as jsx112 } from "react/jsx-runtime";
|
|
29389
29491
|
var ShowWidgetApp = ({
|
|
29390
29492
|
data
|
|
29391
29493
|
}) => {
|
|
29392
29494
|
const { widget_code, title } = data || {};
|
|
29393
29495
|
const { sendMessage } = useAgentChat();
|
|
29394
|
-
const sendPrompt =
|
|
29496
|
+
const sendPrompt = useCallback37(
|
|
29395
29497
|
(text) => {
|
|
29396
29498
|
sendMessage({
|
|
29397
29499
|
input: {
|
|
@@ -29518,7 +29620,7 @@ var regsiterElement = (language, ElementMeta) => {
|
|
|
29518
29620
|
// src/components/Chat/SideAppViewBrowser.tsx
|
|
29519
29621
|
import { Dropdown as Dropdown3, Tooltip as Tooltip23 } from "antd";
|
|
29520
29622
|
import { createStyles as createStyles34 } from "antd-style";
|
|
29521
|
-
import { useEffect as
|
|
29623
|
+
import { useEffect as useEffect49, useState as useState74 } from "react";
|
|
29522
29624
|
import { Fragment as Fragment21, jsx as jsx113, jsxs as jsxs83 } from "react/jsx-runtime";
|
|
29523
29625
|
var useStyle17 = createStyles34(({ token, css }) => {
|
|
29524
29626
|
return {
|
|
@@ -29716,11 +29818,11 @@ var SideAppViewBrowser = ({ region = "side" }) => {
|
|
|
29716
29818
|
} = useChatUIContext();
|
|
29717
29819
|
const selectedCard = region === "side" ? sideAppSelectedCard : contextAppSelectedCard;
|
|
29718
29820
|
const closeApp = region === "side" ? closeSideApp : closeContentApp;
|
|
29719
|
-
const [activeKey, setActiveKey] =
|
|
29821
|
+
const [activeKey, setActiveKey] = useState74(
|
|
29720
29822
|
JSON.stringify(selectedCard)
|
|
29721
29823
|
);
|
|
29722
|
-
const [hoveredTab, setHoveredTab] =
|
|
29723
|
-
const [items, setItems] =
|
|
29824
|
+
const [hoveredTab, setHoveredTab] = useState74(null);
|
|
29825
|
+
const [items, setItems] = useState74([]);
|
|
29724
29826
|
const add = (key, label, children, componentKey) => {
|
|
29725
29827
|
const newPanes = [...items, { label, children, key, componentKey }];
|
|
29726
29828
|
setItems(newPanes);
|
|
@@ -29747,7 +29849,7 @@ var SideAppViewBrowser = ({ region = "side" }) => {
|
|
|
29747
29849
|
const switchTab = (key) => {
|
|
29748
29850
|
setActiveKey(key);
|
|
29749
29851
|
};
|
|
29750
|
-
|
|
29852
|
+
useEffect49(() => {
|
|
29751
29853
|
if (!selectedCard) return;
|
|
29752
29854
|
const key = JSON.stringify(selectedCard);
|
|
29753
29855
|
if (items.find((item) => item.key === key)) {
|
|
@@ -29852,7 +29954,7 @@ var SideAppViewBrowser = ({ region = "side" }) => {
|
|
|
29852
29954
|
};
|
|
29853
29955
|
|
|
29854
29956
|
// src/components/Chat/ProjectSelector.tsx
|
|
29855
|
-
import { useState as
|
|
29957
|
+
import { useState as useState75, useCallback as useCallback38, useMemo as useMemo30, useRef as useRef26 } from "react";
|
|
29856
29958
|
import { Modal as Modal20, Input as Input15, Button as Button54, message as message18 } from "antd";
|
|
29857
29959
|
import { createStyles as createStyles35 } from "antd-style";
|
|
29858
29960
|
import { Folder, ChevronDown as ChevronDown6, Building2 as Building24 } from "lucide-react";
|
|
@@ -30088,34 +30190,34 @@ var ProjectSelector = ({
|
|
|
30088
30190
|
setProject,
|
|
30089
30191
|
createProject
|
|
30090
30192
|
} = useWorkspaceContext();
|
|
30091
|
-
const [isWorkspaceListOpen, setIsWorkspaceListOpen] =
|
|
30193
|
+
const [isWorkspaceListOpen, setIsWorkspaceListOpen] = useState75(false);
|
|
30092
30194
|
const workspaceDropdownRef = useRef26(null);
|
|
30093
|
-
const [isProjectListOpen, setIsProjectListOpen] =
|
|
30094
|
-
const [isModalOpen, setIsModalOpen] =
|
|
30095
|
-
const [projectName, setProjectName] =
|
|
30096
|
-
const [validationError, setValidationError] =
|
|
30097
|
-
const [isCreating, setIsCreating] =
|
|
30195
|
+
const [isProjectListOpen, setIsProjectListOpen] = useState75(false);
|
|
30196
|
+
const [isModalOpen, setIsModalOpen] = useState75(false);
|
|
30197
|
+
const [projectName, setProjectName] = useState75("");
|
|
30198
|
+
const [validationError, setValidationError] = useState75(null);
|
|
30199
|
+
const [isCreating, setIsCreating] = useState75(false);
|
|
30098
30200
|
const projectNameInputRef = useRef26(null);
|
|
30099
|
-
const currentProject =
|
|
30201
|
+
const currentProject = useMemo30(() => {
|
|
30100
30202
|
return projects.find((p) => p.id === projectId);
|
|
30101
30203
|
}, [projects, projectId]);
|
|
30102
|
-
const currentWorkspace =
|
|
30204
|
+
const currentWorkspace = useMemo30(() => {
|
|
30103
30205
|
return workspaces.find((w) => w.id === workspaceId);
|
|
30104
30206
|
}, [workspaces, workspaceId]);
|
|
30105
|
-
const handleSelectProject =
|
|
30207
|
+
const handleSelectProject = useCallback38((selectedProjectId) => {
|
|
30106
30208
|
setProject(selectedProjectId);
|
|
30107
30209
|
setIsProjectListOpen(false);
|
|
30108
30210
|
}, [setProject]);
|
|
30109
|
-
const handleWorkspaceClick =
|
|
30211
|
+
const handleWorkspaceClick = useCallback38(() => {
|
|
30110
30212
|
setProject(null);
|
|
30111
30213
|
}, [setProject]);
|
|
30112
|
-
const toggleProjectList =
|
|
30214
|
+
const toggleProjectList = useCallback38(() => {
|
|
30113
30215
|
setIsProjectListOpen((prev) => !prev);
|
|
30114
30216
|
}, []);
|
|
30115
|
-
const toggleWorkspaceList =
|
|
30217
|
+
const toggleWorkspaceList = useCallback38(() => {
|
|
30116
30218
|
setIsWorkspaceListOpen((prev) => !prev);
|
|
30117
30219
|
}, []);
|
|
30118
|
-
const validateProjectName =
|
|
30220
|
+
const validateProjectName = useCallback38((name) => {
|
|
30119
30221
|
const trimmed = name.trim();
|
|
30120
30222
|
if (!trimmed) return "Project name is required";
|
|
30121
30223
|
if (trimmed.length > PROJECT_NAME_MAX_LENGTH) {
|
|
@@ -30123,7 +30225,7 @@ var ProjectSelector = ({
|
|
|
30123
30225
|
}
|
|
30124
30226
|
return null;
|
|
30125
30227
|
}, []);
|
|
30126
|
-
const handleOpenModal =
|
|
30228
|
+
const handleOpenModal = useCallback38((e) => {
|
|
30127
30229
|
e.stopPropagation();
|
|
30128
30230
|
if (!workspaceId) {
|
|
30129
30231
|
message18.warning("Please select a workspace first");
|
|
@@ -30134,7 +30236,7 @@ var ProjectSelector = ({
|
|
|
30134
30236
|
setIsModalOpen(true);
|
|
30135
30237
|
setTimeout(() => projectNameInputRef.current?.input?.focus(), 100);
|
|
30136
30238
|
}, [workspaceId]);
|
|
30137
|
-
const handleCloseModal =
|
|
30239
|
+
const handleCloseModal = useCallback38(() => {
|
|
30138
30240
|
setIsModalOpen(false);
|
|
30139
30241
|
setProjectName("");
|
|
30140
30242
|
setValidationError(null);
|
|
@@ -30144,7 +30246,7 @@ var ProjectSelector = ({
|
|
|
30144
30246
|
setProjectName(value);
|
|
30145
30247
|
setValidationError(validateProjectName(value));
|
|
30146
30248
|
};
|
|
30147
|
-
const handleCreateProject =
|
|
30249
|
+
const handleCreateProject = useCallback38(async () => {
|
|
30148
30250
|
if (!workspaceId) return;
|
|
30149
30251
|
const trimmed = projectName.trim();
|
|
30150
30252
|
const error = validateProjectName(trimmed);
|
|
@@ -30263,12 +30365,12 @@ var ProjectSelector = ({
|
|
|
30263
30365
|
};
|
|
30264
30366
|
|
|
30265
30367
|
// src/components/Chat/ToolPanelFiles.tsx
|
|
30266
|
-
import { useCallback as
|
|
30368
|
+
import { useCallback as useCallback39, useEffect as useEffect50, useMemo as useMemo31, useState as useState76 } from "react";
|
|
30267
30369
|
import { message as message19 } from "antd";
|
|
30268
30370
|
|
|
30269
30371
|
// src/components/Chat/FileDirectoryPanel.tsx
|
|
30270
30372
|
import React66 from "react";
|
|
30271
|
-
import { Spin as
|
|
30373
|
+
import { Spin as Spin19 } from "antd";
|
|
30272
30374
|
import { ChevronRight as ChevronRight8, FolderOpen as FolderOpen3, Upload } from "lucide-react";
|
|
30273
30375
|
import { createStyles as createStyles36 } from "antd-style";
|
|
30274
30376
|
import { Fragment as Fragment23, jsx as jsx115, jsxs as jsxs85 } from "react/jsx-runtime";
|
|
@@ -30533,7 +30635,7 @@ var FileDirectoryPanel = ({
|
|
|
30533
30635
|
}
|
|
30534
30636
|
)
|
|
30535
30637
|
] }),
|
|
30536
|
-
isExpanded ? isLoading ? /* @__PURE__ */ jsx115("div", { className: styles.loading, children: /* @__PURE__ */ jsx115(
|
|
30638
|
+
isExpanded ? isLoading ? /* @__PURE__ */ jsx115("div", { className: styles.loading, children: /* @__PURE__ */ jsx115(Spin19, { size: "small" }) }) : children.length > 0 ? children.map((child) => renderEntry(child, depth + 1)) : /* @__PURE__ */ jsx115("div", { className: styles.emptyState, children: "No files in this folder" }) : null
|
|
30537
30639
|
] }, entry.path);
|
|
30538
30640
|
}
|
|
30539
30641
|
return /* @__PURE__ */ jsxs85("div", { className: styles.treeRow, children: [
|
|
@@ -30583,7 +30685,7 @@ var FileDirectoryPanel = ({
|
|
|
30583
30685
|
),
|
|
30584
30686
|
/* @__PURE__ */ jsx115("span", { className: styles.badge, children: itemCount })
|
|
30585
30687
|
] }),
|
|
30586
|
-
isLoading ? /* @__PURE__ */ jsx115("div", { className: styles.loading, children: /* @__PURE__ */ jsx115(
|
|
30688
|
+
isLoading ? /* @__PURE__ */ jsx115("div", { className: styles.loading, children: /* @__PURE__ */ jsx115(Spin19, { size: "small" }) }) : /* @__PURE__ */ jsxs85("div", { className: styles.assetList, children: [
|
|
30587
30689
|
entries.map((entry) => renderEntry(entry, 0)),
|
|
30588
30690
|
entries.length === 0 ? /* @__PURE__ */ jsx115("div", { className: styles.emptyState, children: "No files in this folder" }) : null,
|
|
30589
30691
|
folder.allowUpload ? /* @__PURE__ */ jsx115(
|
|
@@ -30594,7 +30696,7 @@ var FileDirectoryPanel = ({
|
|
|
30594
30696
|
onClick: () => void onUploadFolder(folder.name),
|
|
30595
30697
|
disabled: !workspaceId || !projectId || uploadingFolder === folder.name,
|
|
30596
30698
|
children: uploadingFolder === folder.name ? /* @__PURE__ */ jsxs85(Fragment23, { children: [
|
|
30597
|
-
/* @__PURE__ */ jsx115(
|
|
30699
|
+
/* @__PURE__ */ jsx115(Spin19, { size: "small" }),
|
|
30598
30700
|
/* @__PURE__ */ jsx115("span", { children: "Uploading..." })
|
|
30599
30701
|
] }) : /* @__PURE__ */ jsxs85(Fragment23, { children: [
|
|
30600
30702
|
/* @__PURE__ */ jsx115(Upload, { size: 14 }),
|
|
@@ -30622,16 +30724,16 @@ var ToolPanelFiles = () => {
|
|
|
30622
30724
|
uploadFileToFolder
|
|
30623
30725
|
} = useWorkspaceContext();
|
|
30624
30726
|
const { currentAssistant } = useAssistantContext();
|
|
30625
|
-
const [folderEntries, setFolderEntries] =
|
|
30626
|
-
const [folderLoading, setFolderLoading] =
|
|
30627
|
-
const [directoryChildren, setDirectoryChildren] =
|
|
30628
|
-
const [directoryLoading, setDirectoryLoading] =
|
|
30629
|
-
const [directoryExpanded, setDirectoryExpanded] =
|
|
30630
|
-
const [uploadingFolder, setUploadingFolder] =
|
|
30631
|
-
const resourceFolders =
|
|
30727
|
+
const [folderEntries, setFolderEntries] = useState76({});
|
|
30728
|
+
const [folderLoading, setFolderLoading] = useState76({});
|
|
30729
|
+
const [directoryChildren, setDirectoryChildren] = useState76({});
|
|
30730
|
+
const [directoryLoading, setDirectoryLoading] = useState76({});
|
|
30731
|
+
const [directoryExpanded, setDirectoryExpanded] = useState76({});
|
|
30732
|
+
const [uploadingFolder, setUploadingFolder] = useState76(null);
|
|
30733
|
+
const resourceFolders = useMemo31(() => {
|
|
30632
30734
|
return config.resourceFolders && config.resourceFolders.length > 0 ? config.resourceFolders : [{ name: "/", displayName: "Project Assets", allowUpload: true }];
|
|
30633
30735
|
}, [config.resourceFolders]);
|
|
30634
|
-
const loadAssetsForFolder =
|
|
30736
|
+
const loadAssetsForFolder = useCallback39(
|
|
30635
30737
|
async (folder, clearSubdirectoryCache = true) => {
|
|
30636
30738
|
if (!workspaceId || !projectId) {
|
|
30637
30739
|
setFolderEntries((prev) => ({ ...prev, [folder.name]: [] }));
|
|
@@ -30671,7 +30773,7 @@ var ToolPanelFiles = () => {
|
|
|
30671
30773
|
},
|
|
30672
30774
|
[workspaceId, projectId, listPathByFolder, currentAssistant?.id]
|
|
30673
30775
|
);
|
|
30674
|
-
const handleToggleDirectory =
|
|
30776
|
+
const handleToggleDirectory = useCallback39(async (path) => {
|
|
30675
30777
|
const isExpanded = directoryExpanded[path] || false;
|
|
30676
30778
|
if (isExpanded) {
|
|
30677
30779
|
setDirectoryExpanded((prev) => ({ ...prev, [path]: false }));
|
|
@@ -30689,12 +30791,12 @@ var ToolPanelFiles = () => {
|
|
|
30689
30791
|
setDirectoryLoading((prev) => ({ ...prev, [path]: false }));
|
|
30690
30792
|
}
|
|
30691
30793
|
}, [directoryExpanded, listPath, currentAssistant?.id]);
|
|
30692
|
-
|
|
30794
|
+
useEffect50(() => {
|
|
30693
30795
|
resourceFolders.forEach((folder) => {
|
|
30694
30796
|
void loadAssetsForFolder(folder, false);
|
|
30695
30797
|
});
|
|
30696
30798
|
}, [resourceFolders, loadAssetsForFolder]);
|
|
30697
|
-
const handleAssetClick =
|
|
30799
|
+
const handleAssetClick = useCallback39((asset) => {
|
|
30698
30800
|
const fileUrl = getFileViewUrl(asset.path, currentAssistant?.id);
|
|
30699
30801
|
if (!fileUrl) {
|
|
30700
30802
|
message19.warning("Please select a workspace and project first.");
|
|
@@ -30710,7 +30812,7 @@ var ToolPanelFiles = () => {
|
|
|
30710
30812
|
message: `Preview: ${asset.name || asset.path}`
|
|
30711
30813
|
});
|
|
30712
30814
|
}, [getFileViewUrl, openSideApp, currentAssistant?.id]);
|
|
30713
|
-
const handleUploadFolder =
|
|
30815
|
+
const handleUploadFolder = useCallback39(async (folderName) => {
|
|
30714
30816
|
if (!workspaceId || !projectId) {
|
|
30715
30817
|
message19.warning("Please select a workspace and project before uploading.");
|
|
30716
30818
|
return;
|
|
@@ -30890,7 +30992,7 @@ var LatticeChat = (props) => {
|
|
|
30890
30992
|
// src/components/Chat/AgentConversations.tsx
|
|
30891
30993
|
import { Conversations } from "@ant-design/x";
|
|
30892
30994
|
import { theme as theme16 } from "antd";
|
|
30893
|
-
import { useMemo as
|
|
30995
|
+
import { useMemo as useMemo32 } from "react";
|
|
30894
30996
|
import { jsx as jsx119 } from "react/jsx-runtime";
|
|
30895
30997
|
var AgentConversations = ({
|
|
30896
30998
|
enableThreadCreation = true,
|
|
@@ -30911,7 +31013,7 @@ var AgentConversations = ({
|
|
|
30911
31013
|
background: "transparent",
|
|
30912
31014
|
borderRadius: token.borderRadius
|
|
30913
31015
|
};
|
|
30914
|
-
const threadItems =
|
|
31016
|
+
const threadItems = useMemo32(() => {
|
|
30915
31017
|
return threads || [];
|
|
30916
31018
|
}, [threads]);
|
|
30917
31019
|
const items = threadItems.map((thread2) => ({
|
|
@@ -30949,7 +31051,7 @@ var AgentConversations = ({
|
|
|
30949
31051
|
import { useContext as useContext11 } from "react";
|
|
30950
31052
|
|
|
30951
31053
|
// src/components/Chat/ChatSidebar.tsx
|
|
30952
|
-
import { useState as
|
|
31054
|
+
import { useState as useState77, useMemo as useMemo33, useCallback as useCallback41 } from "react";
|
|
30953
31055
|
import { Drawer as Drawer3, Avatar as Avatar14, Popover as Popover3, Button as Button56 } from "antd";
|
|
30954
31056
|
import {
|
|
30955
31057
|
History as History2,
|
|
@@ -30960,7 +31062,7 @@ import {
|
|
|
30960
31062
|
} from "lucide-react";
|
|
30961
31063
|
|
|
30962
31064
|
// src/components/Chat/ThreadHistoryMenuContent.tsx
|
|
30963
|
-
import React69, { useCallback as
|
|
31065
|
+
import React69, { useCallback as useCallback40 } from "react";
|
|
30964
31066
|
import { createStyles as createStyles39 } from "antd-style";
|
|
30965
31067
|
import { MessageSquare as MessageSquare3, Trash2 as Trash28 } from "lucide-react";
|
|
30966
31068
|
import { message as message20, Modal as Modal21 } from "antd";
|
|
@@ -31074,7 +31176,7 @@ var ThreadHistoryMenuContent = () => {
|
|
|
31074
31176
|
deleteThread,
|
|
31075
31177
|
isLoading
|
|
31076
31178
|
} = useConversationContext();
|
|
31077
|
-
const handleDeleteThread =
|
|
31179
|
+
const handleDeleteThread = useCallback40(
|
|
31078
31180
|
async (e, threadIdToDelete) => {
|
|
31079
31181
|
e.stopPropagation();
|
|
31080
31182
|
Modal21.confirm({
|
|
@@ -31187,8 +31289,8 @@ var ChatSidebar = ({
|
|
|
31187
31289
|
const { sideAppVisible, menuCollapsed, setMenuCollapsed } = useChatUIContext();
|
|
31188
31290
|
const { user, logout } = useAuth();
|
|
31189
31291
|
const { createThread } = useConversationContext();
|
|
31190
|
-
const [drawerStates, setDrawerStates] =
|
|
31191
|
-
const [changePasswordOpen, setChangePasswordOpen] =
|
|
31292
|
+
const [drawerStates, setDrawerStates] = useState77({});
|
|
31293
|
+
const [changePasswordOpen, setChangePasswordOpen] = useState77(false);
|
|
31192
31294
|
const {
|
|
31193
31295
|
sidebarMode,
|
|
31194
31296
|
sidebarShowToggle,
|
|
@@ -31197,11 +31299,11 @@ var ChatSidebar = ({
|
|
|
31197
31299
|
sidebarLogoIcon
|
|
31198
31300
|
} = config;
|
|
31199
31301
|
const isExpandedMode = sidebarMode === "expanded";
|
|
31200
|
-
const menuItems =
|
|
31302
|
+
const menuItems = useMemo33(() => {
|
|
31201
31303
|
const items = customMenuItems.length > 0 ? [...customMenuItems] : [...DEFAULT_MENU_ITEMS];
|
|
31202
31304
|
return items.sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
|
|
31203
31305
|
}, [customMenuItems]);
|
|
31204
|
-
const handleMenuClick =
|
|
31306
|
+
const handleMenuClick = useCallback41(async (item) => {
|
|
31205
31307
|
if (item.builtin === "settings") {
|
|
31206
31308
|
setSettingsModalOpen(true);
|
|
31207
31309
|
onSettingsClick?.();
|
|
@@ -31224,17 +31326,17 @@ var ChatSidebar = ({
|
|
|
31224
31326
|
}
|
|
31225
31327
|
}
|
|
31226
31328
|
}, [onSettingsClick, setSettingsModalOpen, createThread, logout]);
|
|
31227
|
-
const handleCloseDrawer =
|
|
31329
|
+
const handleCloseDrawer = useCallback41((itemId) => {
|
|
31228
31330
|
setDrawerStates((prev) => ({ ...prev, [itemId]: false }));
|
|
31229
31331
|
}, []);
|
|
31230
|
-
const handleNewAnalysis =
|
|
31332
|
+
const handleNewAnalysis = useCallback41(async () => {
|
|
31231
31333
|
try {
|
|
31232
31334
|
await createThread("New Analysis");
|
|
31233
31335
|
} catch (error) {
|
|
31234
31336
|
console.error("Failed to create new thread:", error);
|
|
31235
31337
|
}
|
|
31236
31338
|
}, [createThread]);
|
|
31237
|
-
const renderDrawerContent =
|
|
31339
|
+
const renderDrawerContent = useCallback41((item) => {
|
|
31238
31340
|
switch (item.builtin) {
|
|
31239
31341
|
case "thread-history":
|
|
31240
31342
|
return /* @__PURE__ */ jsx121(ThreadHistoryMenuContent, {});
|
|
@@ -31447,7 +31549,7 @@ var LatticeChatView = (props) => {
|
|
|
31447
31549
|
};
|
|
31448
31550
|
|
|
31449
31551
|
// src/components/Chat/SettingsModal.tsx
|
|
31450
|
-
import { useState as
|
|
31552
|
+
import { useState as useState78, useEffect as useEffect51, useRef as useRef27 } from "react";
|
|
31451
31553
|
import {
|
|
31452
31554
|
Modal as Modal22,
|
|
31453
31555
|
Input as Input16,
|
|
@@ -31457,14 +31559,14 @@ import {
|
|
|
31457
31559
|
Typography as Typography57,
|
|
31458
31560
|
Alert as Alert9,
|
|
31459
31561
|
Select as Select8,
|
|
31460
|
-
Switch as
|
|
31562
|
+
Switch as Switch4,
|
|
31461
31563
|
Space as Space39,
|
|
31462
31564
|
Tabs as Tabs3
|
|
31463
31565
|
} from "antd";
|
|
31464
31566
|
import {
|
|
31465
31567
|
SaveOutlined as SaveOutlined2,
|
|
31466
31568
|
EnvironmentOutlined,
|
|
31467
|
-
ReloadOutlined as
|
|
31569
|
+
ReloadOutlined as ReloadOutlined6,
|
|
31468
31570
|
CheckCircleOutlined as CheckCircleOutlined9,
|
|
31469
31571
|
ApiOutlined,
|
|
31470
31572
|
LinkOutlined as LinkOutlined2,
|
|
@@ -31836,7 +31938,7 @@ var SettingsModal = ({
|
|
|
31836
31938
|
}) => {
|
|
31837
31939
|
const { styles } = useStyles23();
|
|
31838
31940
|
const { config: shellConfig, updateConfigValue } = useLatticeChatShellContext();
|
|
31839
|
-
const [connections, setConnections] =
|
|
31941
|
+
const [connections, setConnections] = useState78(() => {
|
|
31840
31942
|
if (typeof window !== "undefined") {
|
|
31841
31943
|
try {
|
|
31842
31944
|
const stored = localStorage.getItem("lattice_server_connections");
|
|
@@ -31859,21 +31961,21 @@ var SettingsModal = ({
|
|
|
31859
31961
|
}
|
|
31860
31962
|
return [];
|
|
31861
31963
|
});
|
|
31862
|
-
const [serverConfigs, setServerConfigs] =
|
|
31964
|
+
const [serverConfigs, setServerConfigs] = useState78({});
|
|
31863
31965
|
const connectionsRef = useRef27(connections);
|
|
31864
|
-
|
|
31966
|
+
useEffect51(() => {
|
|
31865
31967
|
connectionsRef.current = connections;
|
|
31866
31968
|
}, [connections]);
|
|
31867
|
-
const [activeTabKey, setActiveTabKey] =
|
|
31969
|
+
const [activeTabKey, setActiveTabKey] = useState78(
|
|
31868
31970
|
connections.length > 0 ? connections[0].id : ""
|
|
31869
31971
|
);
|
|
31870
|
-
const [activeMenu, setActiveMenu] =
|
|
31871
|
-
const [loading, setLoading] =
|
|
31872
|
-
const [showAddServerModal, setShowAddServerModal] =
|
|
31873
|
-
const [newServerUrl, setNewServerUrl] =
|
|
31874
|
-
const [newServerName, setNewServerName] =
|
|
31875
|
-
const [newServerApiKey, setNewServerApiKey] =
|
|
31876
|
-
const [addingServer, setAddingServer] =
|
|
31972
|
+
const [activeMenu, setActiveMenu] = useState78("environment");
|
|
31973
|
+
const [loading, setLoading] = useState78(false);
|
|
31974
|
+
const [showAddServerModal, setShowAddServerModal] = useState78(false);
|
|
31975
|
+
const [newServerUrl, setNewServerUrl] = useState78("");
|
|
31976
|
+
const [newServerName, setNewServerName] = useState78("");
|
|
31977
|
+
const [newServerApiKey, setNewServerApiKey] = useState78("");
|
|
31978
|
+
const [addingServer, setAddingServer] = useState78(false);
|
|
31877
31979
|
const saveConnections = (newConnections) => {
|
|
31878
31980
|
setConnections(newConnections);
|
|
31879
31981
|
if (typeof window !== "undefined") {
|
|
@@ -32063,7 +32165,7 @@ var SettingsModal = ({
|
|
|
32063
32165
|
console.error("Failed to load models configuration:", error);
|
|
32064
32166
|
}
|
|
32065
32167
|
};
|
|
32066
|
-
|
|
32168
|
+
useEffect51(() => {
|
|
32067
32169
|
if (open && activeTabKey) {
|
|
32068
32170
|
initializeServerConfig(activeTabKey);
|
|
32069
32171
|
const connection = connections.find((c) => c.id === activeTabKey);
|
|
@@ -32072,7 +32174,7 @@ var SettingsModal = ({
|
|
|
32072
32174
|
}
|
|
32073
32175
|
}
|
|
32074
32176
|
}, [open, activeTabKey]);
|
|
32075
|
-
|
|
32177
|
+
useEffect51(() => {
|
|
32076
32178
|
if (open && activeTabKey) {
|
|
32077
32179
|
const connection = connections.find((c) => c.id === activeTabKey);
|
|
32078
32180
|
if (connection?.connected) {
|
|
@@ -32300,7 +32402,7 @@ var SettingsModal = ({
|
|
|
32300
32402
|
" QUEUE_SERVICE_TYPE, REDIS_URL, REDIS_PASSWORD, QUEUE_NAME"
|
|
32301
32403
|
] }),
|
|
32302
32404
|
/* @__PURE__ */ jsxs89("div", { children: [
|
|
32303
|
-
/* @__PURE__ */ jsx123(
|
|
32405
|
+
/* @__PURE__ */ jsx123(ReloadOutlined6, { style: { color: "#faad14", marginRight: 8 } }),
|
|
32304
32406
|
/* @__PURE__ */ jsx123("strong", { children: "Requires restart:" }),
|
|
32305
32407
|
" PORT (server must be restarted to change port)"
|
|
32306
32408
|
] })
|
|
@@ -32510,7 +32612,7 @@ QUEUE_NAME=tasks`,
|
|
|
32510
32612
|
] }),
|
|
32511
32613
|
/* @__PURE__ */ jsx123("div", { children: /* @__PURE__ */ jsxs89(Space39, { children: [
|
|
32512
32614
|
/* @__PURE__ */ jsx123(
|
|
32513
|
-
|
|
32615
|
+
Switch4,
|
|
32514
32616
|
{
|
|
32515
32617
|
checked: model.streaming,
|
|
32516
32618
|
onChange: (checked) => handleModelChange(index, "streaming", checked)
|
|
@@ -32852,15 +32954,15 @@ var LatticeChatShell = (props) => {
|
|
|
32852
32954
|
};
|
|
32853
32955
|
|
|
32854
32956
|
// src/components/Chat/ChannelInstallationsDrawerContent.tsx
|
|
32855
|
-
import { useEffect as
|
|
32957
|
+
import { useEffect as useEffect52, useState as useState79 } from "react";
|
|
32856
32958
|
import {
|
|
32857
32959
|
Button as Button58,
|
|
32858
32960
|
Card as Card30,
|
|
32859
32961
|
Form as Form9,
|
|
32860
32962
|
Input as Input17,
|
|
32861
32963
|
Modal as Modal23,
|
|
32862
|
-
Popconfirm as
|
|
32863
|
-
Spin as
|
|
32964
|
+
Popconfirm as Popconfirm12,
|
|
32965
|
+
Spin as Spin20,
|
|
32864
32966
|
Tag as Tag29,
|
|
32865
32967
|
Typography as Typography58,
|
|
32866
32968
|
message as message22
|
|
@@ -32870,10 +32972,10 @@ import { jsx as jsx126, jsxs as jsxs91 } from "react/jsx-runtime";
|
|
|
32870
32972
|
var { Text: Text47, Title: Title17 } = Typography58;
|
|
32871
32973
|
var ChannelInstallationsDrawerContent = () => {
|
|
32872
32974
|
const { get, post, put, del } = useApi();
|
|
32873
|
-
const [installations, setInstallations] =
|
|
32874
|
-
const [loading, setLoading] =
|
|
32875
|
-
const [formModalOpen, setFormModalOpen] =
|
|
32876
|
-
const [editingInstallation, setEditingInstallation] =
|
|
32975
|
+
const [installations, setInstallations] = useState79([]);
|
|
32976
|
+
const [loading, setLoading] = useState79(false);
|
|
32977
|
+
const [formModalOpen, setFormModalOpen] = useState79(false);
|
|
32978
|
+
const [editingInstallation, setEditingInstallation] = useState79(null);
|
|
32877
32979
|
const loadInstallations = async () => {
|
|
32878
32980
|
setLoading(true);
|
|
32879
32981
|
try {
|
|
@@ -32894,7 +32996,7 @@ var ChannelInstallationsDrawerContent = () => {
|
|
|
32894
32996
|
setLoading(false);
|
|
32895
32997
|
}
|
|
32896
32998
|
};
|
|
32897
|
-
|
|
32999
|
+
useEffect52(() => {
|
|
32898
33000
|
loadInstallations();
|
|
32899
33001
|
}, []);
|
|
32900
33002
|
const handleDelete = async (installation) => {
|
|
@@ -32941,7 +33043,7 @@ var ChannelInstallationsDrawerContent = () => {
|
|
|
32941
33043
|
]
|
|
32942
33044
|
}
|
|
32943
33045
|
) }),
|
|
32944
|
-
/* @__PURE__ */ jsx126("div", { style: { flex: 1, overflowY: "auto", padding: 16 }, children: loading ? /* @__PURE__ */ jsx126("div", { style: { display: "flex", justifyContent: "center", padding: 32 }, children: /* @__PURE__ */ jsx126(
|
|
33046
|
+
/* @__PURE__ */ jsx126("div", { style: { flex: 1, overflowY: "auto", padding: 16 }, children: loading ? /* @__PURE__ */ jsx126("div", { style: { display: "flex", justifyContent: "center", padding: 32 }, children: /* @__PURE__ */ jsx126(Spin20, {}) }) : installations.length === 0 ? /* @__PURE__ */ jsxs91(
|
|
32945
33047
|
"div",
|
|
32946
33048
|
{
|
|
32947
33049
|
style: {
|
|
@@ -33006,7 +33108,7 @@ var ChannelInstallationsDrawerContent = () => {
|
|
|
33006
33108
|
}
|
|
33007
33109
|
),
|
|
33008
33110
|
/* @__PURE__ */ jsx126(
|
|
33009
|
-
|
|
33111
|
+
Popconfirm12,
|
|
33010
33112
|
{
|
|
33011
33113
|
title: "Delete Channel Installation",
|
|
33012
33114
|
description: `Are you sure you want to delete "${installation.name || installation.id}"?`,
|
|
@@ -33042,7 +33144,7 @@ var ChannelInstallationsDrawerContent = () => {
|
|
|
33042
33144
|
};
|
|
33043
33145
|
var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCancel, onSave }) => {
|
|
33044
33146
|
const [form] = Form9.useForm();
|
|
33045
|
-
|
|
33147
|
+
useEffect52(() => {
|
|
33046
33148
|
if (installation) {
|
|
33047
33149
|
const config = installation.config;
|
|
33048
33150
|
form.setFieldsValue({
|