@axiom-lattice/react-sdk 2.1.32 → 2.1.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1063 -728
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +977 -642
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -4266,7 +4266,7 @@ var AttachmentsCard = ({
|
|
|
4266
4266
|
const { config } = useLatticeChatShellContext();
|
|
4267
4267
|
const baseURL = config.baseURL;
|
|
4268
4268
|
const fileBaseURL = `${baseURL}/api/assistants/${assistantId}/threads/${threadId}/sandbox/downloadfile?path=`;
|
|
4269
|
-
const { Text:
|
|
4269
|
+
const { Text: Text23 } = Typography7;
|
|
4270
4270
|
const [showAll, setShowAll] = useState16(false);
|
|
4271
4271
|
const { openSideApp } = useChatUIContext();
|
|
4272
4272
|
const getStyles = () => {
|
|
@@ -4341,7 +4341,7 @@ var AttachmentsCard = ({
|
|
|
4341
4341
|
);
|
|
4342
4342
|
};
|
|
4343
4343
|
const renderFileDescription = (item) => /* @__PURE__ */ jsx24(Space7, { direction: "vertical", size: size === "small" ? 2 : 4, children: /* @__PURE__ */ jsx24(Space7, { children: /* @__PURE__ */ jsx24(
|
|
4344
|
-
|
|
4344
|
+
Text23,
|
|
4345
4345
|
{
|
|
4346
4346
|
type: "secondary",
|
|
4347
4347
|
style: {
|
|
@@ -4415,7 +4415,7 @@ var AttachmentsCard = ({
|
|
|
4415
4415
|
}
|
|
4416
4416
|
),
|
|
4417
4417
|
item.files && /* @__PURE__ */ jsxs10("div", { style: { paddingLeft: "12px" }, children: [
|
|
4418
|
-
/* @__PURE__ */ jsxs10(
|
|
4418
|
+
/* @__PURE__ */ jsxs10(Text23, { type: "secondary", style: { fontSize: "12px" }, children: [
|
|
4419
4419
|
"\u5305\u542B\u6587\u4EF6(",
|
|
4420
4420
|
item.files.length,
|
|
4421
4421
|
")"
|
|
@@ -7391,7 +7391,7 @@ var AgentConversations = ({
|
|
|
7391
7391
|
import { useContext as useContext8 } from "react";
|
|
7392
7392
|
|
|
7393
7393
|
// src/components/Chat/ChatSidebar.tsx
|
|
7394
|
-
import { useState as
|
|
7394
|
+
import { useState as useState32 } from "react";
|
|
7395
7395
|
import { Modal as Modal5 } from "antd";
|
|
7396
7396
|
import {
|
|
7397
7397
|
Bot,
|
|
@@ -7402,7 +7402,7 @@ import {
|
|
|
7402
7402
|
import { createStyles as createStyles13 } from "antd-style";
|
|
7403
7403
|
|
|
7404
7404
|
// src/components/Chat/AssistantFlow.tsx
|
|
7405
|
-
import { useMemo as useMemo12, useEffect as
|
|
7405
|
+
import { useMemo as useMemo12, useEffect as useEffect19, useState as useState27, useCallback as useCallback17, useRef as useRef14 } from "react";
|
|
7406
7406
|
import {
|
|
7407
7407
|
ReactFlow,
|
|
7408
7408
|
Background,
|
|
@@ -7410,13 +7410,13 @@ import {
|
|
|
7410
7410
|
useNodesState,
|
|
7411
7411
|
useEdgesState,
|
|
7412
7412
|
ReactFlowProvider,
|
|
7413
|
-
useReactFlow
|
|
7413
|
+
useReactFlow
|
|
7414
7414
|
} from "@xyflow/react";
|
|
7415
7415
|
import "@xyflow/react/dist/style.css";
|
|
7416
7416
|
|
|
7417
7417
|
// src/components/Chat/AssistantNode.tsx
|
|
7418
7418
|
import { useMemo as useMemo10 } from "react";
|
|
7419
|
-
import { Handle, Position
|
|
7419
|
+
import { Handle, Position } from "@xyflow/react";
|
|
7420
7420
|
import { Avatar as Avatar4, Typography as Typography17, theme as theme2, Tag as Tag6, Tooltip as Tooltip9, Space as Space17 } from "antd";
|
|
7421
7421
|
import {
|
|
7422
7422
|
UserOutlined as UserOutlined3,
|
|
@@ -7425,7 +7425,6 @@ import {
|
|
|
7425
7425
|
IdcardOutlined,
|
|
7426
7426
|
BranchesOutlined,
|
|
7427
7427
|
CodeOutlined as CodeOutlined4,
|
|
7428
|
-
EditOutlined,
|
|
7429
7428
|
MessageOutlined
|
|
7430
7429
|
} from "@ant-design/icons";
|
|
7431
7430
|
import { jsx as jsx47, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
@@ -7457,11 +7456,9 @@ var getBadgeColor = (id) => {
|
|
|
7457
7456
|
};
|
|
7458
7457
|
var AssistantNode = ({
|
|
7459
7458
|
data,
|
|
7460
|
-
selected
|
|
7461
|
-
id
|
|
7459
|
+
selected
|
|
7462
7460
|
}) => {
|
|
7463
7461
|
const { token } = theme2.useToken();
|
|
7464
|
-
const { setNodes, fitView, getNodes } = useReactFlow();
|
|
7465
7462
|
if (!data) {
|
|
7466
7463
|
return null;
|
|
7467
7464
|
}
|
|
@@ -7503,8 +7500,8 @@ var AssistantNode = ({
|
|
|
7503
7500
|
const getAgentTypeLabel = (type) => {
|
|
7504
7501
|
if (!type) return "";
|
|
7505
7502
|
const typeMap = {
|
|
7506
|
-
react: "
|
|
7507
|
-
deep_agent: "
|
|
7503
|
+
react: "Executor",
|
|
7504
|
+
deep_agent: "Orchestrator",
|
|
7508
7505
|
plan_execute: "PLAN EXECUTE",
|
|
7509
7506
|
sequential: "SEQUENTIAL"
|
|
7510
7507
|
};
|
|
@@ -7901,62 +7898,6 @@ var AssistantNode = ({
|
|
|
7901
7898
|
e.currentTarget.style.boxShadow = `0 1px 4px rgba(0, 0, 0, 0.08)`;
|
|
7902
7899
|
},
|
|
7903
7900
|
children: [
|
|
7904
|
-
onConfigure && /* @__PURE__ */ jsx47(
|
|
7905
|
-
"div",
|
|
7906
|
-
{
|
|
7907
|
-
onClick: (e) => {
|
|
7908
|
-
e.stopPropagation();
|
|
7909
|
-
setNodes(
|
|
7910
|
-
(nodes) => nodes.map((node) => ({
|
|
7911
|
-
...node,
|
|
7912
|
-
selected: node.id === id
|
|
7913
|
-
}))
|
|
7914
|
-
);
|
|
7915
|
-
const currentNode = getNodes().find((n) => n.id === id);
|
|
7916
|
-
if (currentNode) {
|
|
7917
|
-
fitView({
|
|
7918
|
-
nodes: [currentNode],
|
|
7919
|
-
duration: 400,
|
|
7920
|
-
minZoom: 0.5,
|
|
7921
|
-
maxZoom: 1.5
|
|
7922
|
-
});
|
|
7923
|
-
}
|
|
7924
|
-
onConfigure?.(assistant);
|
|
7925
|
-
},
|
|
7926
|
-
style: {
|
|
7927
|
-
position: "absolute",
|
|
7928
|
-
top: 8,
|
|
7929
|
-
right: 8,
|
|
7930
|
-
zIndex: 10,
|
|
7931
|
-
cursor: "pointer",
|
|
7932
|
-
padding: 6,
|
|
7933
|
-
borderRadius: 6,
|
|
7934
|
-
background: token.colorBgContainer,
|
|
7935
|
-
display: "flex",
|
|
7936
|
-
alignItems: "center",
|
|
7937
|
-
justifyContent: "center",
|
|
7938
|
-
transition: "all 0.2s ease",
|
|
7939
|
-
border: `1px solid ${token.colorBorderSecondary}`
|
|
7940
|
-
},
|
|
7941
|
-
onMouseEnter: (e) => {
|
|
7942
|
-
e.currentTarget.style.background = token.colorPrimaryBg;
|
|
7943
|
-
e.currentTarget.style.borderColor = token.colorPrimary;
|
|
7944
|
-
},
|
|
7945
|
-
onMouseLeave: (e) => {
|
|
7946
|
-
e.currentTarget.style.background = token.colorBgContainer;
|
|
7947
|
-
e.currentTarget.style.borderColor = token.colorBorderSecondary;
|
|
7948
|
-
},
|
|
7949
|
-
children: /* @__PURE__ */ jsx47(
|
|
7950
|
-
EditOutlined,
|
|
7951
|
-
{
|
|
7952
|
-
style: {
|
|
7953
|
-
fontSize: 14,
|
|
7954
|
-
color: token.colorPrimary
|
|
7955
|
-
}
|
|
7956
|
-
}
|
|
7957
|
-
)
|
|
7958
|
-
}
|
|
7959
|
-
),
|
|
7960
7901
|
/* @__PURE__ */ jsxs26(
|
|
7961
7902
|
"div",
|
|
7962
7903
|
{
|
|
@@ -8217,14 +8158,11 @@ var AssistantNode = ({
|
|
|
8217
8158
|
onChat && /* @__PURE__ */ jsxs26(
|
|
8218
8159
|
"div",
|
|
8219
8160
|
{
|
|
8161
|
+
onMouseDown: (e) => {
|
|
8162
|
+
e.stopPropagation();
|
|
8163
|
+
},
|
|
8220
8164
|
onClick: (e) => {
|
|
8221
8165
|
e.stopPropagation();
|
|
8222
|
-
setNodes(
|
|
8223
|
-
(nodes) => nodes.map((node) => ({
|
|
8224
|
-
...node,
|
|
8225
|
-
selected: node.id === id
|
|
8226
|
-
}))
|
|
8227
|
-
);
|
|
8228
8166
|
onChat(assistant);
|
|
8229
8167
|
},
|
|
8230
8168
|
style: {
|
|
@@ -9114,8 +9052,8 @@ var AgentConfigPanel = ({
|
|
|
9114
9052
|
value: agentType,
|
|
9115
9053
|
onChange: (value) => setAgentType(value),
|
|
9116
9054
|
options: [
|
|
9117
|
-
{ value: "react", label: "
|
|
9118
|
-
{ value: "deep_agent", label: "
|
|
9055
|
+
{ value: "react", label: "Executor" },
|
|
9056
|
+
{ value: "deep_agent", label: "Orchestrator" }
|
|
9119
9057
|
],
|
|
9120
9058
|
block: true
|
|
9121
9059
|
}
|
|
@@ -9125,7 +9063,7 @@ var AgentConfigPanel = ({
|
|
|
9125
9063
|
{
|
|
9126
9064
|
type: "secondary",
|
|
9127
9065
|
style: { fontSize: 11, marginTop: 6, display: "block", lineHeight: 1.4 },
|
|
9128
|
-
children: agentType === "react" ? "
|
|
9066
|
+
children: agentType === "react" ? "Executor: Directly executes tasks using tools. Best for single-step operations like search, code execution, and data retrieval." : "Orchestrator: Coordinates multiple sub-agents to accomplish complex workflows. Best for multi-step tasks that require planning, delegation, and synthesis."
|
|
9129
9067
|
}
|
|
9130
9068
|
)
|
|
9131
9069
|
]
|
|
@@ -9460,57 +9398,339 @@ var AgentConfigPanel = ({
|
|
|
9460
9398
|
var AgentConfigPanel_default = AgentConfigPanel;
|
|
9461
9399
|
|
|
9462
9400
|
// src/components/Chat/CreateAssistantModal.tsx
|
|
9463
|
-
import { useState as
|
|
9401
|
+
import { useState as useState26, useCallback as useCallback16 } from "react";
|
|
9464
9402
|
import {
|
|
9465
9403
|
Modal as Modal2,
|
|
9466
9404
|
Form as Form2,
|
|
9467
|
-
Input as
|
|
9405
|
+
Input as Input3,
|
|
9468
9406
|
Button as Button20,
|
|
9469
9407
|
message as message6,
|
|
9470
9408
|
notification,
|
|
9471
|
-
Typography as
|
|
9409
|
+
Typography as Typography21,
|
|
9472
9410
|
Segmented as Segmented2,
|
|
9473
|
-
|
|
9411
|
+
Divider as Divider3,
|
|
9412
|
+
theme as theme5
|
|
9474
9413
|
} from "antd";
|
|
9475
|
-
import { PlusOutlined as PlusOutlined2 } from "@ant-design/icons";
|
|
9414
|
+
import { PlusOutlined as PlusOutlined2, ForkOutlined as ForkOutlined2 } from "@ant-design/icons";
|
|
9415
|
+
|
|
9416
|
+
// src/components/Chat/ParentAgentSelector.tsx
|
|
9417
|
+
import { useEffect as useEffect18, useState as useState25 } from "react";
|
|
9418
|
+
import { Select as Select2, Typography as Typography19 } from "antd";
|
|
9476
9419
|
import { jsx as jsx49, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
9477
|
-
var { TextArea: TextArea2 } = Input2;
|
|
9478
9420
|
var { Text: Text17 } = Typography19;
|
|
9421
|
+
var ParentAgentSelector = ({
|
|
9422
|
+
onSelect,
|
|
9423
|
+
value,
|
|
9424
|
+
placeholder = "Select a parent agent to extend..."
|
|
9425
|
+
}) => {
|
|
9426
|
+
const { config } = useLatticeChatShellContext();
|
|
9427
|
+
const [assistants, setAssistants] = useState25([]);
|
|
9428
|
+
const [loading, setLoading] = useState25(false);
|
|
9429
|
+
useEffect18(() => {
|
|
9430
|
+
const fetchAssistants = async () => {
|
|
9431
|
+
setLoading(true);
|
|
9432
|
+
try {
|
|
9433
|
+
const headers = {
|
|
9434
|
+
"Content-Type": "application/json"
|
|
9435
|
+
};
|
|
9436
|
+
if (config.apiKey) {
|
|
9437
|
+
headers["Authorization"] = `Bearer ${config.apiKey}`;
|
|
9438
|
+
}
|
|
9439
|
+
const response = await fetch(`${config.baseURL}/api/assistants`, {
|
|
9440
|
+
method: "GET",
|
|
9441
|
+
headers
|
|
9442
|
+
});
|
|
9443
|
+
const data = await response.json();
|
|
9444
|
+
if (response.ok && data.success) {
|
|
9445
|
+
setAssistants(data.data.records || []);
|
|
9446
|
+
}
|
|
9447
|
+
} catch (error) {
|
|
9448
|
+
console.error("Failed to fetch assistants:", error);
|
|
9449
|
+
} finally {
|
|
9450
|
+
setLoading(false);
|
|
9451
|
+
}
|
|
9452
|
+
};
|
|
9453
|
+
fetchAssistants();
|
|
9454
|
+
}, [config.baseURL, config.apiKey]);
|
|
9455
|
+
const handleChange = (selectedId) => {
|
|
9456
|
+
if (!selectedId) {
|
|
9457
|
+
onSelect(null);
|
|
9458
|
+
return;
|
|
9459
|
+
}
|
|
9460
|
+
const selected = assistants.find((a) => a.id === selectedId);
|
|
9461
|
+
onSelect(selected || null);
|
|
9462
|
+
};
|
|
9463
|
+
return /* @__PURE__ */ jsx49(
|
|
9464
|
+
Select2,
|
|
9465
|
+
{
|
|
9466
|
+
showSearch: true,
|
|
9467
|
+
allowClear: true,
|
|
9468
|
+
value,
|
|
9469
|
+
placeholder,
|
|
9470
|
+
loading,
|
|
9471
|
+
onChange: handleChange,
|
|
9472
|
+
optionFilterProp: "label",
|
|
9473
|
+
style: { width: "100%" },
|
|
9474
|
+
options: assistants.map((assistant) => ({
|
|
9475
|
+
value: assistant.id,
|
|
9476
|
+
label: assistant.name || assistant.id,
|
|
9477
|
+
description: assistant.description
|
|
9478
|
+
})),
|
|
9479
|
+
optionRender: (option) => /* @__PURE__ */ jsxs28("div", { children: [
|
|
9480
|
+
/* @__PURE__ */ jsx49("div", { children: option.label }),
|
|
9481
|
+
option.data.description && /* @__PURE__ */ jsx49(Text17, { type: "secondary", style: { fontSize: 12 }, children: option.data.description })
|
|
9482
|
+
] })
|
|
9483
|
+
}
|
|
9484
|
+
);
|
|
9485
|
+
};
|
|
9486
|
+
|
|
9487
|
+
// src/components/Chat/SubAgentInheritList.tsx
|
|
9488
|
+
import { List as List5, Switch as Switch2, Input as Input2, Typography as Typography20, Tag as Tag8, theme as theme4 } from "antd";
|
|
9489
|
+
import { ForkOutlined, LinkOutlined } from "@ant-design/icons";
|
|
9490
|
+
import { jsx as jsx50, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
9491
|
+
var { Text: Text18 } = Typography20;
|
|
9492
|
+
var SubAgentInheritList = ({
|
|
9493
|
+
subAgentKeys,
|
|
9494
|
+
decisions,
|
|
9495
|
+
onChange
|
|
9496
|
+
}) => {
|
|
9497
|
+
const { token } = theme4.useToken();
|
|
9498
|
+
const handleToggle = (key, clone) => {
|
|
9499
|
+
const updated = decisions.map(
|
|
9500
|
+
(d) => d.originalKey === key ? { ...d, clone, cloneKey: clone ? `${key}_clone` : void 0 } : d
|
|
9501
|
+
);
|
|
9502
|
+
onChange(updated);
|
|
9503
|
+
};
|
|
9504
|
+
const handleCloneKeyChange = (originalKey, cloneKey) => {
|
|
9505
|
+
const updated = decisions.map(
|
|
9506
|
+
(d) => d.originalKey === originalKey ? { ...d, cloneKey } : d
|
|
9507
|
+
);
|
|
9508
|
+
onChange(updated);
|
|
9509
|
+
};
|
|
9510
|
+
if (subAgentKeys.length === 0) {
|
|
9511
|
+
return null;
|
|
9512
|
+
}
|
|
9513
|
+
return /* @__PURE__ */ jsxs29("div", { children: [
|
|
9514
|
+
/* @__PURE__ */ jsx50(Text18, { type: "secondary", style: { display: "block", marginBottom: 8 }, children: "Choose how to handle each sub-agent from the parent:" }),
|
|
9515
|
+
/* @__PURE__ */ jsx50(
|
|
9516
|
+
List5,
|
|
9517
|
+
{
|
|
9518
|
+
size: "small",
|
|
9519
|
+
bordered: true,
|
|
9520
|
+
dataSource: decisions,
|
|
9521
|
+
style: { borderRadius: token.borderRadius },
|
|
9522
|
+
renderItem: (decision) => /* @__PURE__ */ jsxs29(
|
|
9523
|
+
List5.Item,
|
|
9524
|
+
{
|
|
9525
|
+
style: {
|
|
9526
|
+
display: "flex",
|
|
9527
|
+
flexDirection: "column",
|
|
9528
|
+
alignItems: "stretch",
|
|
9529
|
+
gap: 8,
|
|
9530
|
+
padding: "8px 16px"
|
|
9531
|
+
},
|
|
9532
|
+
children: [
|
|
9533
|
+
/* @__PURE__ */ jsxs29("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
9534
|
+
/* @__PURE__ */ jsxs29("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
9535
|
+
decision.clone ? /* @__PURE__ */ jsx50(ForkOutlined, { style: { color: token.colorPrimary } }) : /* @__PURE__ */ jsx50(LinkOutlined, { style: { color: token.colorTextSecondary } }),
|
|
9536
|
+
/* @__PURE__ */ jsx50(Text18, { style: { fontFamily: "monospace" }, children: decision.originalKey })
|
|
9537
|
+
] }),
|
|
9538
|
+
/* @__PURE__ */ jsxs29("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
9539
|
+
/* @__PURE__ */ jsx50(Tag8, { color: decision.clone ? "blue" : "default", children: decision.clone ? "Clone as new" : "Reuse" }),
|
|
9540
|
+
/* @__PURE__ */ jsx50(
|
|
9541
|
+
Switch2,
|
|
9542
|
+
{
|
|
9543
|
+
size: "small",
|
|
9544
|
+
checked: decision.clone,
|
|
9545
|
+
onChange: (checked) => handleToggle(decision.originalKey, checked)
|
|
9546
|
+
}
|
|
9547
|
+
)
|
|
9548
|
+
] })
|
|
9549
|
+
] }),
|
|
9550
|
+
decision.clone && /* @__PURE__ */ jsx50(
|
|
9551
|
+
Input2,
|
|
9552
|
+
{
|
|
9553
|
+
size: "small",
|
|
9554
|
+
placeholder: "Enter key for the cloned agent",
|
|
9555
|
+
value: decision.cloneKey,
|
|
9556
|
+
onChange: (e) => handleCloneKeyChange(decision.originalKey, e.target.value),
|
|
9557
|
+
style: { fontFamily: "monospace", fontSize: 12 },
|
|
9558
|
+
addonBefore: "Key"
|
|
9559
|
+
}
|
|
9560
|
+
)
|
|
9561
|
+
]
|
|
9562
|
+
}
|
|
9563
|
+
)
|
|
9564
|
+
}
|
|
9565
|
+
)
|
|
9566
|
+
] });
|
|
9567
|
+
};
|
|
9568
|
+
|
|
9569
|
+
// src/components/Chat/CreateAssistantModal.tsx
|
|
9570
|
+
import { Fragment as Fragment8, jsx as jsx51, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
9571
|
+
var { TextArea: TextArea2 } = Input3;
|
|
9572
|
+
var { Text: Text19 } = Typography21;
|
|
9479
9573
|
var CreateAssistantModal = ({
|
|
9480
9574
|
open,
|
|
9481
9575
|
onCancel,
|
|
9482
9576
|
onSuccess
|
|
9483
9577
|
}) => {
|
|
9484
9578
|
const [form] = Form2.useForm();
|
|
9485
|
-
const [loading, setLoading] =
|
|
9579
|
+
const [loading, setLoading] = useState26(false);
|
|
9580
|
+
const [creationMode, setCreationMode] = useState26("scratch");
|
|
9581
|
+
const [parentAssistant, setParentAssistant] = useState26(null);
|
|
9582
|
+
const [subAgentDecisions, setSubAgentDecisions] = useState26([]);
|
|
9486
9583
|
const { config } = useLatticeChatShellContext();
|
|
9487
|
-
const { token } =
|
|
9584
|
+
const { token } = theme5.useToken();
|
|
9585
|
+
const getHeaders = useCallback16(() => {
|
|
9586
|
+
const headers = { "Content-Type": "application/json" };
|
|
9587
|
+
if (config.apiKey) {
|
|
9588
|
+
headers["Authorization"] = `Bearer ${config.apiKey}`;
|
|
9589
|
+
}
|
|
9590
|
+
return headers;
|
|
9591
|
+
}, [config.apiKey]);
|
|
9592
|
+
const resetExtendState = useCallback16(() => {
|
|
9593
|
+
setParentAssistant(null);
|
|
9594
|
+
setSubAgentDecisions([]);
|
|
9595
|
+
}, []);
|
|
9596
|
+
const handleParentSelect = useCallback16(
|
|
9597
|
+
(assistant) => {
|
|
9598
|
+
setParentAssistant(assistant);
|
|
9599
|
+
if (!assistant) {
|
|
9600
|
+
form.resetFields(["key", "name", "description", "type", "prompt"]);
|
|
9601
|
+
setSubAgentDecisions([]);
|
|
9602
|
+
return;
|
|
9603
|
+
}
|
|
9604
|
+
const graphDef = typeof assistant.graphDefinition === "object" && assistant.graphDefinition !== null ? assistant.graphDefinition : {};
|
|
9605
|
+
const parentKey = graphDef.key || assistant.id;
|
|
9606
|
+
const parentName = assistant.name || graphDef.name || "";
|
|
9607
|
+
form.setFieldsValue({
|
|
9608
|
+
key: `${parentKey}_ext`,
|
|
9609
|
+
name: parentName ? `${parentName} (Extended)` : "",
|
|
9610
|
+
description: assistant.description || graphDef.description || "",
|
|
9611
|
+
type: graphDef.type || "react",
|
|
9612
|
+
prompt: graphDef.prompt || ""
|
|
9613
|
+
});
|
|
9614
|
+
const parentSubAgents2 = graphDef.subAgents || [];
|
|
9615
|
+
setSubAgentDecisions(
|
|
9616
|
+
parentSubAgents2.map((key) => ({ originalKey: key, clone: false }))
|
|
9617
|
+
);
|
|
9618
|
+
},
|
|
9619
|
+
[form]
|
|
9620
|
+
);
|
|
9621
|
+
const handleModeChange = useCallback16(
|
|
9622
|
+
(mode) => {
|
|
9623
|
+
setCreationMode(mode);
|
|
9624
|
+
if (mode === "scratch") {
|
|
9625
|
+
resetExtendState();
|
|
9626
|
+
form.resetFields();
|
|
9627
|
+
}
|
|
9628
|
+
},
|
|
9629
|
+
[form, resetExtendState]
|
|
9630
|
+
);
|
|
9631
|
+
const cloneSubAgent = async (originalKey, newKey, headers) => {
|
|
9632
|
+
const getResponse = await fetch(
|
|
9633
|
+
`${config.baseURL}/api/assistants/${originalKey}`,
|
|
9634
|
+
{ method: "GET", headers }
|
|
9635
|
+
);
|
|
9636
|
+
const getData = await getResponse.json();
|
|
9637
|
+
if (!getResponse.ok || !getData.success) {
|
|
9638
|
+
throw new Error(`Failed to fetch sub-agent "${originalKey}" for cloning`);
|
|
9639
|
+
}
|
|
9640
|
+
const originalAssistant = getData.data;
|
|
9641
|
+
const originalGraphDef = typeof originalAssistant.graphDefinition === "object" ? originalAssistant.graphDefinition : {};
|
|
9642
|
+
const cloneBody = {
|
|
9643
|
+
id: newKey,
|
|
9644
|
+
name: `${originalAssistant.name} (Clone)`,
|
|
9645
|
+
description: originalAssistant.description || "",
|
|
9646
|
+
graphDefinition: {
|
|
9647
|
+
...originalGraphDef,
|
|
9648
|
+
key: newKey,
|
|
9649
|
+
name: `${originalAssistant.name} (Clone)`
|
|
9650
|
+
}
|
|
9651
|
+
};
|
|
9652
|
+
const createResponse = await fetch(`${config.baseURL}/api/assistants`, {
|
|
9653
|
+
method: "POST",
|
|
9654
|
+
headers,
|
|
9655
|
+
body: JSON.stringify(cloneBody)
|
|
9656
|
+
});
|
|
9657
|
+
const createData = await createResponse.json();
|
|
9658
|
+
if (!createResponse.ok || !createData.success) {
|
|
9659
|
+
throw new Error(`Failed to clone sub-agent "${originalKey}"`);
|
|
9660
|
+
}
|
|
9661
|
+
return createData.data;
|
|
9662
|
+
};
|
|
9663
|
+
const buildScratchBody = (values) => ({
|
|
9664
|
+
id: values.key,
|
|
9665
|
+
name: values.name,
|
|
9666
|
+
description: values.description || "",
|
|
9667
|
+
graphDefinition: {
|
|
9668
|
+
key: values.key,
|
|
9669
|
+
name: values.name,
|
|
9670
|
+
description: values.description || "",
|
|
9671
|
+
type: values.type,
|
|
9672
|
+
prompt: values.prompt || "",
|
|
9673
|
+
tools: [],
|
|
9674
|
+
skills: [],
|
|
9675
|
+
subAgents: values.type === "deep_agent" ? [] : void 0,
|
|
9676
|
+
middleware: []
|
|
9677
|
+
}
|
|
9678
|
+
});
|
|
9679
|
+
const buildExtendBody = async (values, headers, createdAssistants) => {
|
|
9680
|
+
if (!parentAssistant) {
|
|
9681
|
+
throw new Error("No parent agent selected");
|
|
9682
|
+
}
|
|
9683
|
+
const cloneDecisions = subAgentDecisions.filter((d) => d.clone);
|
|
9684
|
+
for (const decision of cloneDecisions) {
|
|
9685
|
+
if (!decision.cloneKey || !decision.cloneKey.trim()) {
|
|
9686
|
+
throw new Error(
|
|
9687
|
+
`Please provide a key for the cloned sub-agent "${decision.originalKey}"`
|
|
9688
|
+
);
|
|
9689
|
+
}
|
|
9690
|
+
if (!/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(decision.cloneKey)) {
|
|
9691
|
+
throw new Error(
|
|
9692
|
+
`Invalid key "${decision.cloneKey}" for cloned sub-agent "${decision.originalKey}". Key must start with a letter and contain only letters, numbers, underscores, or hyphens.`
|
|
9693
|
+
);
|
|
9694
|
+
}
|
|
9695
|
+
}
|
|
9696
|
+
const resolvedSubAgents = [];
|
|
9697
|
+
for (const decision of subAgentDecisions) {
|
|
9698
|
+
if (decision.clone) {
|
|
9699
|
+
const clonedAssistant = await cloneSubAgent(decision.originalKey, decision.cloneKey, headers);
|
|
9700
|
+
createdAssistants.push(clonedAssistant);
|
|
9701
|
+
resolvedSubAgents.push(decision.cloneKey);
|
|
9702
|
+
} else {
|
|
9703
|
+
resolvedSubAgents.push(decision.originalKey);
|
|
9704
|
+
}
|
|
9705
|
+
}
|
|
9706
|
+
const parentGraphDef = typeof parentAssistant.graphDefinition === "object" ? parentAssistant.graphDefinition : {};
|
|
9707
|
+
const graphDefinition = {
|
|
9708
|
+
key: values.key,
|
|
9709
|
+
name: values.name,
|
|
9710
|
+
description: values.description || "",
|
|
9711
|
+
extendsAgent: parentAssistant.id,
|
|
9712
|
+
type: values.type || parentGraphDef.type
|
|
9713
|
+
};
|
|
9714
|
+
if (values.prompt && values.prompt !== parentGraphDef.prompt) {
|
|
9715
|
+
graphDefinition.prompt = values.prompt;
|
|
9716
|
+
}
|
|
9717
|
+
if (resolvedSubAgents.length > 0 || parentGraphDef.subAgents && parentGraphDef.subAgents.length > 0) {
|
|
9718
|
+
graphDefinition.subAgents = resolvedSubAgents;
|
|
9719
|
+
}
|
|
9720
|
+
return {
|
|
9721
|
+
id: values.key,
|
|
9722
|
+
name: values.name,
|
|
9723
|
+
description: values.description || "",
|
|
9724
|
+
graphDefinition
|
|
9725
|
+
};
|
|
9726
|
+
};
|
|
9488
9727
|
const handleSubmit = async () => {
|
|
9489
9728
|
try {
|
|
9490
9729
|
const values = await form.validateFields();
|
|
9491
9730
|
setLoading(true);
|
|
9492
|
-
const headers =
|
|
9493
|
-
|
|
9494
|
-
|
|
9495
|
-
if (config.apiKey) {
|
|
9496
|
-
headers["Authorization"] = `Bearer ${config.apiKey}`;
|
|
9497
|
-
}
|
|
9498
|
-
const requestBody = {
|
|
9499
|
-
id: values.key,
|
|
9500
|
-
name: values.name,
|
|
9501
|
-
description: values.description || "",
|
|
9502
|
-
graphDefinition: {
|
|
9503
|
-
key: values.key,
|
|
9504
|
-
name: values.name,
|
|
9505
|
-
description: values.description || "",
|
|
9506
|
-
type: values.type,
|
|
9507
|
-
prompt: values.prompt || "",
|
|
9508
|
-
tools: [],
|
|
9509
|
-
skills: [],
|
|
9510
|
-
subAgents: values.type === "deep_agent" ? [] : void 0,
|
|
9511
|
-
middleware: []
|
|
9512
|
-
}
|
|
9513
|
-
};
|
|
9731
|
+
const headers = getHeaders();
|
|
9732
|
+
const createdAssistants = [];
|
|
9733
|
+
const requestBody = creationMode === "scratch" ? buildScratchBody(values) : await buildExtendBody(values, headers, createdAssistants);
|
|
9514
9734
|
const response = await fetch(`${config.baseURL}/api/assistants`, {
|
|
9515
9735
|
method: "POST",
|
|
9516
9736
|
headers,
|
|
@@ -9520,9 +9740,14 @@ var CreateAssistantModal = ({
|
|
|
9520
9740
|
if (response.ok && data.success) {
|
|
9521
9741
|
notification.success({
|
|
9522
9742
|
message: "Created",
|
|
9523
|
-
description: "Assistant created successfully"
|
|
9743
|
+
description: creationMode === "extend" ? `Assistant created by extending "${parentAssistant?.name}"` : "Assistant created successfully"
|
|
9524
9744
|
});
|
|
9525
9745
|
form.resetFields();
|
|
9746
|
+
resetExtendState();
|
|
9747
|
+
setCreationMode("scratch");
|
|
9748
|
+
for (const clonedAssistant of createdAssistants) {
|
|
9749
|
+
onSuccess?.(clonedAssistant);
|
|
9750
|
+
}
|
|
9526
9751
|
onSuccess?.(data.data);
|
|
9527
9752
|
onCancel();
|
|
9528
9753
|
} else {
|
|
@@ -9532,141 +9757,235 @@ var CreateAssistantModal = ({
|
|
|
9532
9757
|
if (error.errorFields) {
|
|
9533
9758
|
return;
|
|
9534
9759
|
}
|
|
9535
|
-
message6.error(
|
|
9760
|
+
message6.error(
|
|
9761
|
+
error.message || "An error occurred while creating the assistant"
|
|
9762
|
+
);
|
|
9536
9763
|
} finally {
|
|
9537
9764
|
setLoading(false);
|
|
9538
9765
|
}
|
|
9539
9766
|
};
|
|
9540
|
-
|
|
9767
|
+
const parentSubAgents = parentAssistant?.graphDefinition?.subAgents || [];
|
|
9768
|
+
const showSubAgentList = creationMode === "extend" && parentAssistant && parentSubAgents.length > 0;
|
|
9769
|
+
return /* @__PURE__ */ jsxs30(
|
|
9541
9770
|
Modal2,
|
|
9542
9771
|
{
|
|
9543
9772
|
title: "Create New Assistant",
|
|
9544
9773
|
open,
|
|
9545
|
-
onCancel
|
|
9774
|
+
onCancel: () => {
|
|
9775
|
+
resetExtendState();
|
|
9776
|
+
setCreationMode("scratch");
|
|
9777
|
+
onCancel();
|
|
9778
|
+
},
|
|
9546
9779
|
footer: [
|
|
9547
|
-
/* @__PURE__ */
|
|
9548
|
-
|
|
9780
|
+
/* @__PURE__ */ jsx51(
|
|
9781
|
+
Button20,
|
|
9782
|
+
{
|
|
9783
|
+
onClick: () => {
|
|
9784
|
+
resetExtendState();
|
|
9785
|
+
setCreationMode("scratch");
|
|
9786
|
+
onCancel();
|
|
9787
|
+
},
|
|
9788
|
+
children: "Cancel"
|
|
9789
|
+
},
|
|
9790
|
+
"cancel"
|
|
9791
|
+
),
|
|
9792
|
+
/* @__PURE__ */ jsx51(
|
|
9549
9793
|
Button20,
|
|
9550
9794
|
{
|
|
9551
9795
|
type: "primary",
|
|
9552
|
-
icon: /* @__PURE__ */
|
|
9796
|
+
icon: creationMode === "extend" ? /* @__PURE__ */ jsx51(ForkOutlined2, {}) : /* @__PURE__ */ jsx51(PlusOutlined2, {}),
|
|
9553
9797
|
loading,
|
|
9554
9798
|
onClick: handleSubmit,
|
|
9555
|
-
children: "Create"
|
|
9799
|
+
children: creationMode === "extend" ? "Create (Extend)" : "Create"
|
|
9556
9800
|
},
|
|
9557
9801
|
"submit"
|
|
9558
9802
|
)
|
|
9559
9803
|
],
|
|
9560
9804
|
width: 600,
|
|
9561
|
-
children:
|
|
9562
|
-
|
|
9563
|
-
|
|
9564
|
-
|
|
9565
|
-
|
|
9566
|
-
|
|
9567
|
-
|
|
9568
|
-
|
|
9569
|
-
|
|
9570
|
-
|
|
9571
|
-
|
|
9572
|
-
|
|
9573
|
-
|
|
9574
|
-
|
|
9575
|
-
|
|
9576
|
-
|
|
9577
|
-
|
|
9578
|
-
|
|
9579
|
-
|
|
9580
|
-
|
|
9581
|
-
|
|
9582
|
-
|
|
9583
|
-
|
|
9584
|
-
|
|
9585
|
-
|
|
9586
|
-
|
|
9587
|
-
|
|
9588
|
-
|
|
9589
|
-
|
|
9590
|
-
|
|
9591
|
-
|
|
9592
|
-
|
|
9593
|
-
|
|
9594
|
-
|
|
9595
|
-
|
|
9596
|
-
|
|
9597
|
-
|
|
9598
|
-
|
|
9599
|
-
|
|
9600
|
-
|
|
9601
|
-
|
|
9602
|
-
|
|
9603
|
-
|
|
9604
|
-
|
|
9605
|
-
|
|
9606
|
-
|
|
9607
|
-
|
|
9608
|
-
|
|
9609
|
-
|
|
9610
|
-
|
|
9611
|
-
|
|
9612
|
-
|
|
9613
|
-
|
|
9614
|
-
|
|
9615
|
-
|
|
9616
|
-
|
|
9617
|
-
|
|
9618
|
-
|
|
9619
|
-
|
|
9620
|
-
|
|
9621
|
-
|
|
9622
|
-
|
|
9623
|
-
|
|
9624
|
-
|
|
9625
|
-
|
|
9626
|
-
|
|
9627
|
-
|
|
9628
|
-
Form2.Item,
|
|
9629
|
-
{
|
|
9630
|
-
name: "prompt",
|
|
9631
|
-
label: "System Prompt",
|
|
9632
|
-
rules: [{ required: true, message: "Please enter a system prompt" }],
|
|
9633
|
-
children: /* @__PURE__ */ jsx49(
|
|
9634
|
-
TextArea2,
|
|
9635
|
-
{
|
|
9636
|
-
placeholder: "Enter the system prompt for this agent...",
|
|
9637
|
-
autoSize: { minRows: 4, maxRows: 8 },
|
|
9638
|
-
style: {
|
|
9639
|
-
fontFamily: "monospace",
|
|
9640
|
-
fontSize: 13,
|
|
9641
|
-
lineHeight: 1.6
|
|
9805
|
+
children: [
|
|
9806
|
+
/* @__PURE__ */ jsxs30("div", { style: { marginBottom: 20 }, children: [
|
|
9807
|
+
/* @__PURE__ */ jsx51(
|
|
9808
|
+
Text19,
|
|
9809
|
+
{
|
|
9810
|
+
type: "secondary",
|
|
9811
|
+
style: { display: "block", marginBottom: 8 },
|
|
9812
|
+
children: "Creation Mode"
|
|
9813
|
+
}
|
|
9814
|
+
),
|
|
9815
|
+
/* @__PURE__ */ jsx51(
|
|
9816
|
+
Segmented2,
|
|
9817
|
+
{
|
|
9818
|
+
value: creationMode,
|
|
9819
|
+
onChange: handleModeChange,
|
|
9820
|
+
options: [
|
|
9821
|
+
{ value: "scratch", label: "From Scratch" },
|
|
9822
|
+
{ value: "extend", label: "Extend Existing Agent" }
|
|
9823
|
+
],
|
|
9824
|
+
block: true
|
|
9825
|
+
}
|
|
9826
|
+
)
|
|
9827
|
+
] }),
|
|
9828
|
+
creationMode === "extend" && /* @__PURE__ */ jsxs30("div", { style: { marginBottom: 20 }, children: [
|
|
9829
|
+
/* @__PURE__ */ jsx51(
|
|
9830
|
+
Text19,
|
|
9831
|
+
{
|
|
9832
|
+
type: "secondary",
|
|
9833
|
+
style: { display: "block", marginBottom: 8 },
|
|
9834
|
+
children: "Parent Agent"
|
|
9835
|
+
}
|
|
9836
|
+
),
|
|
9837
|
+
/* @__PURE__ */ jsx51(
|
|
9838
|
+
ParentAgentSelector,
|
|
9839
|
+
{
|
|
9840
|
+
value: parentAssistant?.id,
|
|
9841
|
+
onSelect: handleParentSelect
|
|
9842
|
+
}
|
|
9843
|
+
),
|
|
9844
|
+
parentAssistant && /* @__PURE__ */ jsx51(
|
|
9845
|
+
Text19,
|
|
9846
|
+
{
|
|
9847
|
+
type: "secondary",
|
|
9848
|
+
style: { display: "block", marginTop: 4, fontSize: 12 },
|
|
9849
|
+
children: "Fields left unchanged will be inherited from the parent agent."
|
|
9850
|
+
}
|
|
9851
|
+
)
|
|
9852
|
+
] }),
|
|
9853
|
+
creationMode === "extend" && parentAssistant && /* @__PURE__ */ jsx51(Divider3, { style: { margin: "12px 0" } }),
|
|
9854
|
+
/* @__PURE__ */ jsxs30(
|
|
9855
|
+
Form2,
|
|
9856
|
+
{
|
|
9857
|
+
form,
|
|
9858
|
+
layout: "vertical",
|
|
9859
|
+
autoComplete: "off",
|
|
9860
|
+
initialValues: { type: "react" },
|
|
9861
|
+
children: [
|
|
9862
|
+
/* @__PURE__ */ jsx51(
|
|
9863
|
+
Form2.Item,
|
|
9864
|
+
{
|
|
9865
|
+
name: "key",
|
|
9866
|
+
label: "Key (ID)",
|
|
9867
|
+
rules: [
|
|
9868
|
+
{ required: true, message: "Please enter a unique key" },
|
|
9869
|
+
{
|
|
9870
|
+
pattern: /^[a-zA-Z][a-zA-Z0-9_-]*$/,
|
|
9871
|
+
message: "Key must start with a letter and contain only letters, numbers, underscores, or hyphens"
|
|
9642
9872
|
}
|
|
9643
|
-
|
|
9644
|
-
|
|
9645
|
-
|
|
9646
|
-
|
|
9647
|
-
|
|
9648
|
-
|
|
9649
|
-
|
|
9873
|
+
],
|
|
9874
|
+
style: { marginBottom: 16 },
|
|
9875
|
+
children: /* @__PURE__ */ jsx51(Input3, { placeholder: "e.g., my_assistant" })
|
|
9876
|
+
}
|
|
9877
|
+
),
|
|
9878
|
+
/* @__PURE__ */ jsx51(
|
|
9879
|
+
Form2.Item,
|
|
9880
|
+
{
|
|
9881
|
+
name: "name",
|
|
9882
|
+
label: "Name",
|
|
9883
|
+
rules: [{ required: true, message: "Please enter a name" }],
|
|
9884
|
+
style: { marginBottom: 16 },
|
|
9885
|
+
children: /* @__PURE__ */ jsx51(Input3, { placeholder: "e.g., My Assistant" })
|
|
9886
|
+
}
|
|
9887
|
+
),
|
|
9888
|
+
/* @__PURE__ */ jsx51(
|
|
9889
|
+
Form2.Item,
|
|
9890
|
+
{
|
|
9891
|
+
name: "description",
|
|
9892
|
+
label: "Description",
|
|
9893
|
+
rules: [
|
|
9894
|
+
{ required: true, message: "Please enter a description" }
|
|
9895
|
+
],
|
|
9896
|
+
style: { marginBottom: 16 },
|
|
9897
|
+
children: /* @__PURE__ */ jsx51(
|
|
9898
|
+
TextArea2,
|
|
9899
|
+
{
|
|
9900
|
+
placeholder: "Enter a description for this assistant...",
|
|
9901
|
+
autoSize: { minRows: 2, maxRows: 4 }
|
|
9902
|
+
}
|
|
9903
|
+
)
|
|
9904
|
+
}
|
|
9905
|
+
),
|
|
9906
|
+
/* @__PURE__ */ jsx51(
|
|
9907
|
+
Form2.Item,
|
|
9908
|
+
{
|
|
9909
|
+
name: "type",
|
|
9910
|
+
label: "Agent Type",
|
|
9911
|
+
rules: [{ required: true }],
|
|
9912
|
+
style: { marginBottom: 16 },
|
|
9913
|
+
children: /* @__PURE__ */ jsx51(
|
|
9914
|
+
Segmented2,
|
|
9915
|
+
{
|
|
9916
|
+
options: [
|
|
9917
|
+
{ value: "react", label: "Executor" },
|
|
9918
|
+
{ value: "deep_agent", label: "Orchestrator" }
|
|
9919
|
+
],
|
|
9920
|
+
block: true
|
|
9921
|
+
}
|
|
9922
|
+
)
|
|
9923
|
+
}
|
|
9924
|
+
),
|
|
9925
|
+
/* @__PURE__ */ jsx51(Form2.Item, { noStyle: true, shouldUpdate: (prev, cur) => prev.type !== cur.type, children: () => /* @__PURE__ */ jsx51(
|
|
9926
|
+
Text19,
|
|
9927
|
+
{
|
|
9928
|
+
type: "secondary",
|
|
9929
|
+
style: { fontSize: 12, display: "block", marginTop: -12, marginBottom: 16, lineHeight: 1.5 },
|
|
9930
|
+
children: form.getFieldValue("type") === "deep_agent" ? "Orchestrator: Coordinates multiple sub-agents to accomplish complex workflows. Best for multi-step tasks that require planning, delegation, and synthesis." : "Executor: Directly executes tasks using tools. Best for single-step operations like search, code execution, and data retrieval."
|
|
9931
|
+
}
|
|
9932
|
+
) }),
|
|
9933
|
+
/* @__PURE__ */ jsx51(
|
|
9934
|
+
Form2.Item,
|
|
9935
|
+
{
|
|
9936
|
+
name: "prompt",
|
|
9937
|
+
label: creationMode === "extend" && parentAssistant ? "System Prompt (leave unchanged to inherit from parent)" : "System Prompt",
|
|
9938
|
+
rules: creationMode === "scratch" ? [{ required: true, message: "Please enter a system prompt" }] : [],
|
|
9939
|
+
children: /* @__PURE__ */ jsx51(
|
|
9940
|
+
TextArea2,
|
|
9941
|
+
{
|
|
9942
|
+
placeholder: creationMode === "extend" && parentAssistant ? "Leave empty to inherit parent's prompt, or enter a new prompt to override..." : "Enter the system prompt for this agent...",
|
|
9943
|
+
autoSize: { minRows: 4, maxRows: 8 },
|
|
9944
|
+
style: {
|
|
9945
|
+
fontFamily: "monospace",
|
|
9946
|
+
fontSize: 13,
|
|
9947
|
+
lineHeight: 1.6
|
|
9948
|
+
}
|
|
9949
|
+
}
|
|
9950
|
+
)
|
|
9951
|
+
}
|
|
9952
|
+
)
|
|
9953
|
+
]
|
|
9954
|
+
}
|
|
9955
|
+
),
|
|
9956
|
+
showSubAgentList && /* @__PURE__ */ jsxs30(Fragment8, { children: [
|
|
9957
|
+
/* @__PURE__ */ jsx51(Divider3, { style: { margin: "12px 0" } }),
|
|
9958
|
+
/* @__PURE__ */ jsx51(Text19, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Sub-Agents" }),
|
|
9959
|
+
/* @__PURE__ */ jsx51(
|
|
9960
|
+
SubAgentInheritList,
|
|
9961
|
+
{
|
|
9962
|
+
subAgentKeys: parentSubAgents,
|
|
9963
|
+
decisions: subAgentDecisions,
|
|
9964
|
+
onChange: setSubAgentDecisions
|
|
9965
|
+
}
|
|
9966
|
+
)
|
|
9967
|
+
] })
|
|
9968
|
+
]
|
|
9650
9969
|
}
|
|
9651
9970
|
);
|
|
9652
9971
|
};
|
|
9653
9972
|
var CreateAssistantModal_default = CreateAssistantModal;
|
|
9654
9973
|
|
|
9655
9974
|
// src/components/Chat/AssistantFlow.tsx
|
|
9656
|
-
import { Button as Button21, message as message7, notification as notification2, theme as
|
|
9975
|
+
import { Button as Button21, message as message7, notification as notification2, theme as theme6 } from "antd";
|
|
9657
9976
|
import { PlusOutlined as PlusOutlined3 } from "@ant-design/icons";
|
|
9658
|
-
import { jsx as
|
|
9977
|
+
import { jsx as jsx52, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
9659
9978
|
var AssistantFlowInner = ({ onChat }) => {
|
|
9660
|
-
const { setCenter, fitView } =
|
|
9979
|
+
const { setCenter, fitView } = useReactFlow();
|
|
9661
9980
|
const [nodes, setNodes, onNodesChange] = useNodesState([]);
|
|
9662
9981
|
const [edges, setEdges, onEdgesChange] = useEdgesState([]);
|
|
9663
|
-
const [assistants, setAssistants] =
|
|
9664
|
-
const [assistantsLoading, setAssistantsLoading] =
|
|
9665
|
-
const [configPanelVisible, setConfigPanelVisible] =
|
|
9666
|
-
const [selectedAssistant, setSelectedAssistant] =
|
|
9667
|
-
const [isCreateModalOpen, setIsCreateModalOpen] =
|
|
9982
|
+
const [assistants, setAssistants] = useState27([]);
|
|
9983
|
+
const [assistantsLoading, setAssistantsLoading] = useState27(false);
|
|
9984
|
+
const [configPanelVisible, setConfigPanelVisible] = useState27(false);
|
|
9985
|
+
const [selectedAssistant, setSelectedAssistant] = useState27(null);
|
|
9986
|
+
const [isCreateModalOpen, setIsCreateModalOpen] = useState27(false);
|
|
9668
9987
|
const { config } = useLatticeChatShellContext();
|
|
9669
|
-
const { token } =
|
|
9988
|
+
const { token } = theme6.useToken();
|
|
9670
9989
|
const { enableAssistantCreation = true, enableAssistantEditing = true } = config;
|
|
9671
9990
|
const nodeTypes = useMemo12(
|
|
9672
9991
|
() => ({
|
|
@@ -9674,14 +9993,29 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
9674
9993
|
}),
|
|
9675
9994
|
[]
|
|
9676
9995
|
);
|
|
9677
|
-
const handleConfigure =
|
|
9996
|
+
const handleConfigure = useCallback17((assistant) => {
|
|
9678
9997
|
setSelectedAssistant(assistant);
|
|
9679
9998
|
setConfigPanelVisible(true);
|
|
9680
9999
|
}, []);
|
|
9681
|
-
const handleClosePanel =
|
|
10000
|
+
const handleClosePanel = useCallback17(() => {
|
|
9682
10001
|
setConfigPanelVisible(false);
|
|
9683
10002
|
setSelectedAssistant(null);
|
|
9684
10003
|
}, []);
|
|
10004
|
+
const handleSelectionChange = useCallback17(
|
|
10005
|
+
({ nodes: selectedNodes }) => {
|
|
10006
|
+
if (selectedNodes.length === 1 && enableAssistantEditing) {
|
|
10007
|
+
const nodeData = selectedNodes[0].data;
|
|
10008
|
+
if (nodeData?.assistant) {
|
|
10009
|
+
setSelectedAssistant(nodeData.assistant);
|
|
10010
|
+
setConfigPanelVisible(true);
|
|
10011
|
+
}
|
|
10012
|
+
} else if (selectedNodes.length === 0) {
|
|
10013
|
+
setConfigPanelVisible(false);
|
|
10014
|
+
setSelectedAssistant(null);
|
|
10015
|
+
}
|
|
10016
|
+
},
|
|
10017
|
+
[enableAssistantEditing]
|
|
10018
|
+
);
|
|
9685
10019
|
const fetchAssistants = async () => {
|
|
9686
10020
|
setAssistantsLoading(true);
|
|
9687
10021
|
try {
|
|
@@ -9705,10 +10039,10 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
9705
10039
|
setAssistantsLoading(false);
|
|
9706
10040
|
}
|
|
9707
10041
|
};
|
|
9708
|
-
|
|
10042
|
+
useEffect19(() => {
|
|
9709
10043
|
fetchAssistants();
|
|
9710
10044
|
}, []);
|
|
9711
|
-
|
|
10045
|
+
useEffect19(() => {
|
|
9712
10046
|
if (!assistants || assistants.length === 0) {
|
|
9713
10047
|
setNodes([]);
|
|
9714
10048
|
setEdges([]);
|
|
@@ -9995,7 +10329,7 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
9995
10329
|
});
|
|
9996
10330
|
lastCreatedAssistantRef.current = createdAssistant;
|
|
9997
10331
|
};
|
|
9998
|
-
|
|
10332
|
+
useEffect19(() => {
|
|
9999
10333
|
if (selectedAssistant) {
|
|
10000
10334
|
const node = nodes.find((n) => n.id === selectedAssistant.id);
|
|
10001
10335
|
if (node) {
|
|
@@ -10003,7 +10337,7 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
10003
10337
|
}
|
|
10004
10338
|
}
|
|
10005
10339
|
}, [selectedAssistant, nodes, setCenter]);
|
|
10006
|
-
|
|
10340
|
+
useEffect19(() => {
|
|
10007
10341
|
if (assistants.length > 0 && selectedAssistant) {
|
|
10008
10342
|
const assistant = assistants.find((a) => a.id === selectedAssistant.id);
|
|
10009
10343
|
if (assistant && !configPanelVisible) {
|
|
@@ -10012,7 +10346,7 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
10012
10346
|
}
|
|
10013
10347
|
}, [assistants, selectedAssistant, configPanelVisible]);
|
|
10014
10348
|
const lastCreatedAssistantRef = useRef14(null);
|
|
10015
|
-
|
|
10349
|
+
useEffect19(() => {
|
|
10016
10350
|
if (lastCreatedAssistantRef.current && !assistants.find((a) => a.id === lastCreatedAssistantRef.current?.id)) {
|
|
10017
10351
|
lastCreatedAssistantRef.current = null;
|
|
10018
10352
|
}
|
|
@@ -10027,7 +10361,7 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
10027
10361
|
}
|
|
10028
10362
|
}, [nodes, setCenter]);
|
|
10029
10363
|
if (assistantsLoading) {
|
|
10030
|
-
return /* @__PURE__ */
|
|
10364
|
+
return /* @__PURE__ */ jsx52(
|
|
10031
10365
|
"div",
|
|
10032
10366
|
{
|
|
10033
10367
|
style: {
|
|
@@ -10042,8 +10376,8 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
10042
10376
|
}
|
|
10043
10377
|
);
|
|
10044
10378
|
}
|
|
10045
|
-
return /* @__PURE__ */
|
|
10046
|
-
/* @__PURE__ */
|
|
10379
|
+
return /* @__PURE__ */ jsxs31("div", { style: { width: "100%", height: "100%", display: "flex" }, children: [
|
|
10380
|
+
/* @__PURE__ */ jsxs31(
|
|
10047
10381
|
"div",
|
|
10048
10382
|
{
|
|
10049
10383
|
style: {
|
|
@@ -10053,22 +10387,23 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
10053
10387
|
position: "relative"
|
|
10054
10388
|
},
|
|
10055
10389
|
children: [
|
|
10056
|
-
/* @__PURE__ */
|
|
10390
|
+
/* @__PURE__ */ jsxs31(
|
|
10057
10391
|
ReactFlow,
|
|
10058
10392
|
{
|
|
10059
10393
|
nodes,
|
|
10060
10394
|
edges,
|
|
10061
10395
|
onNodesChange,
|
|
10062
10396
|
onEdgesChange,
|
|
10397
|
+
onSelectionChange: handleSelectionChange,
|
|
10063
10398
|
nodeTypes,
|
|
10064
10399
|
fitView: true,
|
|
10065
10400
|
children: [
|
|
10066
|
-
/* @__PURE__ */
|
|
10067
|
-
/* @__PURE__ */
|
|
10401
|
+
/* @__PURE__ */ jsx52(Background, { color: "#eee", gap: 20 }),
|
|
10402
|
+
/* @__PURE__ */ jsx52(Controls, {})
|
|
10068
10403
|
]
|
|
10069
10404
|
}
|
|
10070
10405
|
),
|
|
10071
|
-
enableAssistantCreation && /* @__PURE__ */
|
|
10406
|
+
enableAssistantCreation && /* @__PURE__ */ jsx52(
|
|
10072
10407
|
"div",
|
|
10073
10408
|
{
|
|
10074
10409
|
style: {
|
|
@@ -10077,12 +10412,12 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
10077
10412
|
right: 20,
|
|
10078
10413
|
zIndex: 10
|
|
10079
10414
|
},
|
|
10080
|
-
children: /* @__PURE__ */
|
|
10415
|
+
children: /* @__PURE__ */ jsx52(
|
|
10081
10416
|
Button21,
|
|
10082
10417
|
{
|
|
10083
10418
|
type: "primary",
|
|
10084
10419
|
size: "large",
|
|
10085
|
-
icon: /* @__PURE__ */
|
|
10420
|
+
icon: /* @__PURE__ */ jsx52(PlusOutlined3, {}),
|
|
10086
10421
|
onClick: () => setIsCreateModalOpen(true),
|
|
10087
10422
|
style: {
|
|
10088
10423
|
height: 48,
|
|
@@ -10101,7 +10436,7 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
10101
10436
|
]
|
|
10102
10437
|
}
|
|
10103
10438
|
),
|
|
10104
|
-
/* @__PURE__ */
|
|
10439
|
+
/* @__PURE__ */ jsx52(
|
|
10105
10440
|
AgentConfigPanel_default,
|
|
10106
10441
|
{
|
|
10107
10442
|
visible: configPanelVisible,
|
|
@@ -10112,7 +10447,7 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
10112
10447
|
onDelete: handleDeleteAssistant
|
|
10113
10448
|
}
|
|
10114
10449
|
),
|
|
10115
|
-
/* @__PURE__ */
|
|
10450
|
+
/* @__PURE__ */ jsx52(
|
|
10116
10451
|
CreateAssistantModal_default,
|
|
10117
10452
|
{
|
|
10118
10453
|
open: isCreateModalOpen,
|
|
@@ -10122,11 +10457,11 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
10122
10457
|
)
|
|
10123
10458
|
] });
|
|
10124
10459
|
};
|
|
10125
|
-
var AssistantFlow = (props) => /* @__PURE__ */
|
|
10460
|
+
var AssistantFlow = (props) => /* @__PURE__ */ jsx52(ReactFlowProvider, { children: /* @__PURE__ */ jsx52(AssistantFlowInner, { ...props }) });
|
|
10126
10461
|
var AssistantFlow_default = AssistantFlow;
|
|
10127
10462
|
|
|
10128
10463
|
// src/components/Chat/SkillFlow.tsx
|
|
10129
|
-
import { useMemo as useMemo14, useEffect as
|
|
10464
|
+
import { useMemo as useMemo14, useEffect as useEffect21, useState as useState30 } from "react";
|
|
10130
10465
|
import {
|
|
10131
10466
|
ReactFlow as ReactFlow2,
|
|
10132
10467
|
Background as Background2,
|
|
@@ -10136,22 +10471,22 @@ import {
|
|
|
10136
10471
|
ReactFlowProvider as ReactFlowProvider2
|
|
10137
10472
|
} from "@xyflow/react";
|
|
10138
10473
|
import "@xyflow/react/dist/style.css";
|
|
10139
|
-
import { Button as Button24, theme as
|
|
10474
|
+
import { Button as Button24, theme as theme9 } from "antd";
|
|
10140
10475
|
import { PlusOutlined as PlusOutlined6 } from "@ant-design/icons";
|
|
10141
10476
|
|
|
10142
10477
|
// src/components/Chat/SkillNode.tsx
|
|
10143
|
-
import { useEffect as
|
|
10478
|
+
import { useEffect as useEffect20, useMemo as useMemo13, useState as useState28 } from "react";
|
|
10144
10479
|
import { Handle as Handle2, Position as Position2 } from "@xyflow/react";
|
|
10145
10480
|
import {
|
|
10146
10481
|
Avatar as Avatar6,
|
|
10147
|
-
Typography as
|
|
10148
|
-
theme as
|
|
10149
|
-
Tag as
|
|
10482
|
+
Typography as Typography22,
|
|
10483
|
+
theme as theme7,
|
|
10484
|
+
Tag as Tag9,
|
|
10150
10485
|
Tooltip as Tooltip11,
|
|
10151
|
-
Space as
|
|
10486
|
+
Space as Space19,
|
|
10152
10487
|
Button as Button22,
|
|
10153
|
-
Divider as
|
|
10154
|
-
Input as
|
|
10488
|
+
Divider as Divider4,
|
|
10489
|
+
Input as Input4,
|
|
10155
10490
|
Modal as Modal3,
|
|
10156
10491
|
message as message8,
|
|
10157
10492
|
notification as notification3
|
|
@@ -10166,9 +10501,9 @@ import {
|
|
|
10166
10501
|
PlusOutlined as PlusOutlined4
|
|
10167
10502
|
} from "@ant-design/icons";
|
|
10168
10503
|
import { Client as Client4 } from "@axiom-lattice/client-sdk";
|
|
10169
|
-
import { Fragment as
|
|
10170
|
-
var { Text:
|
|
10171
|
-
var { TextArea: TextArea3 } =
|
|
10504
|
+
import { Fragment as Fragment9, jsx as jsx53, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
10505
|
+
var { Text: Text20 } = Typography22;
|
|
10506
|
+
var { TextArea: TextArea3 } = Input4;
|
|
10172
10507
|
var getBadgeColor2 = (name) => {
|
|
10173
10508
|
const colors = [
|
|
10174
10509
|
"#1890ff",
|
|
@@ -10195,7 +10530,7 @@ var getBadgeColor2 = (name) => {
|
|
|
10195
10530
|
return colors[Math.abs(hash) % colors.length];
|
|
10196
10531
|
};
|
|
10197
10532
|
var SkillNode = ({ data }) => {
|
|
10198
|
-
const { token } =
|
|
10533
|
+
const { token } = theme7.useToken();
|
|
10199
10534
|
const { config } = useLatticeChatShellContext();
|
|
10200
10535
|
const client = useMemo13(
|
|
10201
10536
|
() => new Client4({
|
|
@@ -10214,7 +10549,7 @@ var SkillNode = ({ data }) => {
|
|
|
10214
10549
|
if (!skill) {
|
|
10215
10550
|
return null;
|
|
10216
10551
|
}
|
|
10217
|
-
const [currentSkill, setCurrentSkill] =
|
|
10552
|
+
const [currentSkill, setCurrentSkill] = useState28(skill);
|
|
10218
10553
|
const badgeColor = getBadgeColor2(currentSkill.name);
|
|
10219
10554
|
const initials = currentSkill.name?.split("-").map((n) => n.charAt(0)).join("").toUpperCase().slice(0, 2) || "SK";
|
|
10220
10555
|
const hasSubSkills = currentSkill.subSkills && currentSkill.subSkills.length > 0;
|
|
@@ -10236,20 +10571,20 @@ var SkillNode = ({ data }) => {
|
|
|
10236
10571
|
const handleCopy = (text) => {
|
|
10237
10572
|
navigator.clipboard.writeText(text);
|
|
10238
10573
|
};
|
|
10239
|
-
const [isEditing, setIsEditing] =
|
|
10240
|
-
const [draftSkill, setDraftSkill] =
|
|
10574
|
+
const [isEditing, setIsEditing] = useState28(false);
|
|
10575
|
+
const [draftSkill, setDraftSkill] = useState28({
|
|
10241
10576
|
...skill,
|
|
10242
10577
|
id: skill.name
|
|
10243
10578
|
});
|
|
10244
|
-
const [metadataRows, setMetadataRows] =
|
|
10579
|
+
const [metadataRows, setMetadataRows] = useState28(
|
|
10245
10580
|
metadataEntries.map(([key, value]) => ({
|
|
10246
10581
|
key,
|
|
10247
10582
|
value
|
|
10248
10583
|
}))
|
|
10249
10584
|
);
|
|
10250
|
-
const [isModalOpen, setIsModalOpen] =
|
|
10251
|
-
const [saving, setSaving] =
|
|
10252
|
-
|
|
10585
|
+
const [isModalOpen, setIsModalOpen] = useState28(false);
|
|
10586
|
+
const [saving, setSaving] = useState28(false);
|
|
10587
|
+
useEffect20(() => {
|
|
10253
10588
|
setIsEditing(false);
|
|
10254
10589
|
setCurrentSkill(skill);
|
|
10255
10590
|
setDraftSkill({ ...skill, id: skill.name });
|
|
@@ -10375,7 +10710,7 @@ var SkillNode = ({ data }) => {
|
|
|
10375
10710
|
setSaving(false);
|
|
10376
10711
|
}
|
|
10377
10712
|
};
|
|
10378
|
-
const editingView = /* @__PURE__ */
|
|
10713
|
+
const editingView = /* @__PURE__ */ jsxs32(
|
|
10379
10714
|
"div",
|
|
10380
10715
|
{
|
|
10381
10716
|
style: {
|
|
@@ -10384,9 +10719,9 @@ var SkillNode = ({ data }) => {
|
|
|
10384
10719
|
gap: 12
|
|
10385
10720
|
},
|
|
10386
10721
|
children: [
|
|
10387
|
-
/* @__PURE__ */
|
|
10388
|
-
/* @__PURE__ */
|
|
10389
|
-
/* @__PURE__ */
|
|
10722
|
+
/* @__PURE__ */ jsxs32("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
10723
|
+
/* @__PURE__ */ jsx53(Text20, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Description" }),
|
|
10724
|
+
/* @__PURE__ */ jsx53(
|
|
10390
10725
|
TextArea3,
|
|
10391
10726
|
{
|
|
10392
10727
|
value: draftSkill.description,
|
|
@@ -10396,10 +10731,10 @@ var SkillNode = ({ data }) => {
|
|
|
10396
10731
|
}
|
|
10397
10732
|
)
|
|
10398
10733
|
] }),
|
|
10399
|
-
/* @__PURE__ */
|
|
10400
|
-
/* @__PURE__ */
|
|
10401
|
-
/* @__PURE__ */
|
|
10402
|
-
|
|
10734
|
+
/* @__PURE__ */ jsxs32("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
10735
|
+
/* @__PURE__ */ jsx53(Text20, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "License" }),
|
|
10736
|
+
/* @__PURE__ */ jsx53(
|
|
10737
|
+
Input4,
|
|
10403
10738
|
{
|
|
10404
10739
|
value: draftSkill.license,
|
|
10405
10740
|
onChange: (e) => handleFieldChange("license", e.target.value),
|
|
@@ -10407,10 +10742,10 @@ var SkillNode = ({ data }) => {
|
|
|
10407
10742
|
}
|
|
10408
10743
|
)
|
|
10409
10744
|
] }),
|
|
10410
|
-
/* @__PURE__ */
|
|
10411
|
-
/* @__PURE__ */
|
|
10412
|
-
/* @__PURE__ */
|
|
10413
|
-
|
|
10745
|
+
/* @__PURE__ */ jsxs32("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
10746
|
+
/* @__PURE__ */ jsx53(Text20, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Compatibility" }),
|
|
10747
|
+
/* @__PURE__ */ jsx53(
|
|
10748
|
+
Input4,
|
|
10414
10749
|
{
|
|
10415
10750
|
value: draftSkill.compatibility,
|
|
10416
10751
|
onChange: (e) => handleFieldChange("compatibility", e.target.value),
|
|
@@ -10418,7 +10753,7 @@ var SkillNode = ({ data }) => {
|
|
|
10418
10753
|
}
|
|
10419
10754
|
)
|
|
10420
10755
|
] }),
|
|
10421
|
-
/* @__PURE__ */
|
|
10756
|
+
/* @__PURE__ */ jsxs32(
|
|
10422
10757
|
"div",
|
|
10423
10758
|
{
|
|
10424
10759
|
style: {
|
|
@@ -10428,8 +10763,8 @@ var SkillNode = ({ data }) => {
|
|
|
10428
10763
|
gap: 8
|
|
10429
10764
|
},
|
|
10430
10765
|
children: [
|
|
10431
|
-
/* @__PURE__ */
|
|
10432
|
-
|
|
10766
|
+
/* @__PURE__ */ jsx53(
|
|
10767
|
+
Text20,
|
|
10433
10768
|
{
|
|
10434
10769
|
style: {
|
|
10435
10770
|
fontSize: 12,
|
|
@@ -10439,11 +10774,11 @@ var SkillNode = ({ data }) => {
|
|
|
10439
10774
|
children: "Metadata"
|
|
10440
10775
|
}
|
|
10441
10776
|
),
|
|
10442
|
-
/* @__PURE__ */
|
|
10777
|
+
/* @__PURE__ */ jsx53(
|
|
10443
10778
|
Button22,
|
|
10444
10779
|
{
|
|
10445
10780
|
size: "small",
|
|
10446
|
-
icon: /* @__PURE__ */
|
|
10781
|
+
icon: /* @__PURE__ */ jsx53(PlusOutlined4, {}),
|
|
10447
10782
|
onClick: handleAddMetadataRow,
|
|
10448
10783
|
children: "Add"
|
|
10449
10784
|
}
|
|
@@ -10451,9 +10786,9 @@ var SkillNode = ({ data }) => {
|
|
|
10451
10786
|
]
|
|
10452
10787
|
}
|
|
10453
10788
|
),
|
|
10454
|
-
/* @__PURE__ */
|
|
10455
|
-
metadataRows.length === 0 && /* @__PURE__ */
|
|
10456
|
-
|
|
10789
|
+
/* @__PURE__ */ jsxs32(Space19, { direction: "vertical", size: 8, style: { width: "100%" }, children: [
|
|
10790
|
+
metadataRows.length === 0 && /* @__PURE__ */ jsx53(
|
|
10791
|
+
Text20,
|
|
10457
10792
|
{
|
|
10458
10793
|
style: {
|
|
10459
10794
|
fontSize: 11,
|
|
@@ -10462,7 +10797,7 @@ var SkillNode = ({ data }) => {
|
|
|
10462
10797
|
children: "No metadata yet. Use Add to create one."
|
|
10463
10798
|
}
|
|
10464
10799
|
),
|
|
10465
|
-
metadataRows.map((row, index) => /* @__PURE__ */
|
|
10800
|
+
metadataRows.map((row, index) => /* @__PURE__ */ jsxs32(
|
|
10466
10801
|
"div",
|
|
10467
10802
|
{
|
|
10468
10803
|
style: {
|
|
@@ -10472,13 +10807,13 @@ var SkillNode = ({ data }) => {
|
|
|
10472
10807
|
width: "100%"
|
|
10473
10808
|
},
|
|
10474
10809
|
children: [
|
|
10475
|
-
/* @__PURE__ */
|
|
10810
|
+
/* @__PURE__ */ jsxs32(Text20, { style: { fontSize: 11, color: token.colorTextSecondary }, children: [
|
|
10476
10811
|
"Meta ",
|
|
10477
10812
|
index + 1
|
|
10478
10813
|
] }),
|
|
10479
|
-
/* @__PURE__ */
|
|
10480
|
-
/* @__PURE__ */
|
|
10481
|
-
|
|
10814
|
+
/* @__PURE__ */ jsxs32(Space19, { style: { width: "100%" }, size: 8, wrap: true, children: [
|
|
10815
|
+
/* @__PURE__ */ jsx53(
|
|
10816
|
+
Input4,
|
|
10482
10817
|
{
|
|
10483
10818
|
value: row.key,
|
|
10484
10819
|
placeholder: "Key",
|
|
@@ -10486,8 +10821,8 @@ var SkillNode = ({ data }) => {
|
|
|
10486
10821
|
onChange: (e) => handleMetadataChange(index, "key", e.target.value)
|
|
10487
10822
|
}
|
|
10488
10823
|
),
|
|
10489
|
-
/* @__PURE__ */
|
|
10490
|
-
|
|
10824
|
+
/* @__PURE__ */ jsx53(
|
|
10825
|
+
Input4,
|
|
10491
10826
|
{
|
|
10492
10827
|
value: row.value,
|
|
10493
10828
|
placeholder: "Value",
|
|
@@ -10501,9 +10836,9 @@ var SkillNode = ({ data }) => {
|
|
|
10501
10836
|
index
|
|
10502
10837
|
))
|
|
10503
10838
|
] }),
|
|
10504
|
-
/* @__PURE__ */
|
|
10505
|
-
/* @__PURE__ */
|
|
10506
|
-
/* @__PURE__ */
|
|
10839
|
+
/* @__PURE__ */ jsxs32("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
10840
|
+
/* @__PURE__ */ jsx53(Text20, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Content" }),
|
|
10841
|
+
/* @__PURE__ */ jsx53(
|
|
10507
10842
|
TextArea3,
|
|
10508
10843
|
{
|
|
10509
10844
|
value: draftSkill.content,
|
|
@@ -10516,7 +10851,7 @@ var SkillNode = ({ data }) => {
|
|
|
10516
10851
|
]
|
|
10517
10852
|
}
|
|
10518
10853
|
);
|
|
10519
|
-
const detailCardContent = /* @__PURE__ */
|
|
10854
|
+
const detailCardContent = /* @__PURE__ */ jsxs32(
|
|
10520
10855
|
"div",
|
|
10521
10856
|
{
|
|
10522
10857
|
style: {
|
|
@@ -10526,7 +10861,7 @@ var SkillNode = ({ data }) => {
|
|
|
10526
10861
|
padding: 16
|
|
10527
10862
|
},
|
|
10528
10863
|
children: [
|
|
10529
|
-
/* @__PURE__ */
|
|
10864
|
+
/* @__PURE__ */ jsx53(
|
|
10530
10865
|
"div",
|
|
10531
10866
|
{
|
|
10532
10867
|
style: {
|
|
@@ -10535,8 +10870,8 @@ var SkillNode = ({ data }) => {
|
|
|
10535
10870
|
justifyContent: "space-between",
|
|
10536
10871
|
marginBottom: 16
|
|
10537
10872
|
},
|
|
10538
|
-
children: /* @__PURE__ */
|
|
10539
|
-
/* @__PURE__ */
|
|
10873
|
+
children: /* @__PURE__ */ jsxs32("div", { style: { flex: 1 }, children: [
|
|
10874
|
+
/* @__PURE__ */ jsxs32(
|
|
10540
10875
|
"div",
|
|
10541
10876
|
{
|
|
10542
10877
|
style: {
|
|
@@ -10546,8 +10881,8 @@ var SkillNode = ({ data }) => {
|
|
|
10546
10881
|
marginBottom: 8
|
|
10547
10882
|
},
|
|
10548
10883
|
children: [
|
|
10549
|
-
/* @__PURE__ */
|
|
10550
|
-
|
|
10884
|
+
/* @__PURE__ */ jsx53(
|
|
10885
|
+
Text20,
|
|
10551
10886
|
{
|
|
10552
10887
|
strong: true,
|
|
10553
10888
|
style: {
|
|
@@ -10558,8 +10893,8 @@ var SkillNode = ({ data }) => {
|
|
|
10558
10893
|
children: currentSkill.name
|
|
10559
10894
|
}
|
|
10560
10895
|
),
|
|
10561
|
-
/* @__PURE__ */
|
|
10562
|
-
|
|
10896
|
+
/* @__PURE__ */ jsx53(
|
|
10897
|
+
Tag9,
|
|
10563
10898
|
{
|
|
10564
10899
|
style: {
|
|
10565
10900
|
margin: 0,
|
|
@@ -10574,7 +10909,7 @@ var SkillNode = ({ data }) => {
|
|
|
10574
10909
|
]
|
|
10575
10910
|
}
|
|
10576
10911
|
),
|
|
10577
|
-
/* @__PURE__ */
|
|
10912
|
+
/* @__PURE__ */ jsx53(
|
|
10578
10913
|
"div",
|
|
10579
10914
|
{
|
|
10580
10915
|
style: {
|
|
@@ -10582,8 +10917,8 @@ var SkillNode = ({ data }) => {
|
|
|
10582
10917
|
alignItems: "center",
|
|
10583
10918
|
gap: 6
|
|
10584
10919
|
},
|
|
10585
|
-
children: /* @__PURE__ */
|
|
10586
|
-
|
|
10920
|
+
children: /* @__PURE__ */ jsx53(
|
|
10921
|
+
Text20,
|
|
10587
10922
|
{
|
|
10588
10923
|
style: {
|
|
10589
10924
|
fontSize: 11,
|
|
@@ -10598,9 +10933,9 @@ var SkillNode = ({ data }) => {
|
|
|
10598
10933
|
] })
|
|
10599
10934
|
}
|
|
10600
10935
|
),
|
|
10601
|
-
isEditing ? editingView : /* @__PURE__ */
|
|
10602
|
-
currentSkill.description && /* @__PURE__ */
|
|
10603
|
-
|
|
10936
|
+
isEditing ? editingView : /* @__PURE__ */ jsxs32(Fragment9, { children: [
|
|
10937
|
+
currentSkill.description && /* @__PURE__ */ jsx53("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ jsxs32(
|
|
10938
|
+
Text20,
|
|
10604
10939
|
{
|
|
10605
10940
|
style: {
|
|
10606
10941
|
fontSize: 12,
|
|
@@ -10615,8 +10950,8 @@ var SkillNode = ({ data }) => {
|
|
|
10615
10950
|
]
|
|
10616
10951
|
}
|
|
10617
10952
|
) }),
|
|
10618
|
-
metadataEntries.length > 0 && /* @__PURE__ */
|
|
10619
|
-
/* @__PURE__ */
|
|
10953
|
+
metadataEntries.length > 0 && /* @__PURE__ */ jsxs32("div", { style: { marginBottom: 16 }, children: [
|
|
10954
|
+
/* @__PURE__ */ jsxs32(
|
|
10620
10955
|
"div",
|
|
10621
10956
|
{
|
|
10622
10957
|
style: {
|
|
@@ -10626,7 +10961,7 @@ var SkillNode = ({ data }) => {
|
|
|
10626
10961
|
marginBottom: 8
|
|
10627
10962
|
},
|
|
10628
10963
|
children: [
|
|
10629
|
-
/* @__PURE__ */
|
|
10964
|
+
/* @__PURE__ */ jsx53(
|
|
10630
10965
|
InfoCircleOutlined5,
|
|
10631
10966
|
{
|
|
10632
10967
|
style: {
|
|
@@ -10635,8 +10970,8 @@ var SkillNode = ({ data }) => {
|
|
|
10635
10970
|
}
|
|
10636
10971
|
}
|
|
10637
10972
|
),
|
|
10638
|
-
/* @__PURE__ */
|
|
10639
|
-
|
|
10973
|
+
/* @__PURE__ */ jsxs32(
|
|
10974
|
+
Text20,
|
|
10640
10975
|
{
|
|
10641
10976
|
style: {
|
|
10642
10977
|
fontSize: 12,
|
|
@@ -10653,7 +10988,7 @@ var SkillNode = ({ data }) => {
|
|
|
10653
10988
|
]
|
|
10654
10989
|
}
|
|
10655
10990
|
),
|
|
10656
|
-
/* @__PURE__ */
|
|
10991
|
+
/* @__PURE__ */ jsx53(
|
|
10657
10992
|
"div",
|
|
10658
10993
|
{
|
|
10659
10994
|
style: {
|
|
@@ -10661,7 +10996,7 @@ var SkillNode = ({ data }) => {
|
|
|
10661
10996
|
borderRadius: 6,
|
|
10662
10997
|
overflow: "hidden"
|
|
10663
10998
|
},
|
|
10664
|
-
children: metadataEntries.map(([key, value], index) => /* @__PURE__ */
|
|
10999
|
+
children: metadataEntries.map(([key, value], index) => /* @__PURE__ */ jsxs32(
|
|
10665
11000
|
"div",
|
|
10666
11001
|
{
|
|
10667
11002
|
style: {
|
|
@@ -10670,7 +11005,7 @@ var SkillNode = ({ data }) => {
|
|
|
10670
11005
|
borderBottom: index === metadataEntries.length - 1 ? "none" : `1px solid ${token.colorBorderSecondary}`
|
|
10671
11006
|
},
|
|
10672
11007
|
children: [
|
|
10673
|
-
/* @__PURE__ */
|
|
11008
|
+
/* @__PURE__ */ jsx53(
|
|
10674
11009
|
"div",
|
|
10675
11010
|
{
|
|
10676
11011
|
style: {
|
|
@@ -10686,7 +11021,7 @@ var SkillNode = ({ data }) => {
|
|
|
10686
11021
|
children: key
|
|
10687
11022
|
}
|
|
10688
11023
|
),
|
|
10689
|
-
/* @__PURE__ */
|
|
11024
|
+
/* @__PURE__ */ jsx53(
|
|
10690
11025
|
"div",
|
|
10691
11026
|
{
|
|
10692
11027
|
style: {
|
|
@@ -10706,8 +11041,8 @@ var SkillNode = ({ data }) => {
|
|
|
10706
11041
|
}
|
|
10707
11042
|
)
|
|
10708
11043
|
] }),
|
|
10709
|
-
hasSubSkills && /* @__PURE__ */
|
|
10710
|
-
/* @__PURE__ */
|
|
11044
|
+
hasSubSkills && /* @__PURE__ */ jsxs32("div", { style: { marginBottom: 16 }, children: [
|
|
11045
|
+
/* @__PURE__ */ jsxs32(
|
|
10711
11046
|
"div",
|
|
10712
11047
|
{
|
|
10713
11048
|
style: {
|
|
@@ -10717,7 +11052,7 @@ var SkillNode = ({ data }) => {
|
|
|
10717
11052
|
marginBottom: 8
|
|
10718
11053
|
},
|
|
10719
11054
|
children: [
|
|
10720
|
-
/* @__PURE__ */
|
|
11055
|
+
/* @__PURE__ */ jsx53(
|
|
10721
11056
|
BranchesOutlined2,
|
|
10722
11057
|
{
|
|
10723
11058
|
style: {
|
|
@@ -10726,8 +11061,8 @@ var SkillNode = ({ data }) => {
|
|
|
10726
11061
|
}
|
|
10727
11062
|
}
|
|
10728
11063
|
),
|
|
10729
|
-
/* @__PURE__ */
|
|
10730
|
-
|
|
11064
|
+
/* @__PURE__ */ jsxs32(
|
|
11065
|
+
Text20,
|
|
10731
11066
|
{
|
|
10732
11067
|
style: {
|
|
10733
11068
|
fontSize: 12,
|
|
@@ -10744,9 +11079,9 @@ var SkillNode = ({ data }) => {
|
|
|
10744
11079
|
]
|
|
10745
11080
|
}
|
|
10746
11081
|
),
|
|
10747
|
-
/* @__PURE__ */
|
|
10748
|
-
(subSkill, index) => /* @__PURE__ */
|
|
10749
|
-
|
|
11082
|
+
/* @__PURE__ */ jsx53(Space19, { size: [8, 8], wrap: true, children: currentSkill.subSkills.map(
|
|
11083
|
+
(subSkill, index) => /* @__PURE__ */ jsx53(
|
|
11084
|
+
Tag9,
|
|
10750
11085
|
{
|
|
10751
11086
|
style: {
|
|
10752
11087
|
fontSize: 11,
|
|
@@ -10761,11 +11096,11 @@ var SkillNode = ({ data }) => {
|
|
|
10761
11096
|
)
|
|
10762
11097
|
) })
|
|
10763
11098
|
] }),
|
|
10764
|
-
(currentSkill.license || currentSkill.compatibility) && /* @__PURE__ */
|
|
10765
|
-
currentSkill.license && /* @__PURE__ */
|
|
10766
|
-
|
|
11099
|
+
(currentSkill.license || currentSkill.compatibility) && /* @__PURE__ */ jsx53("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ jsxs32(Space19, { size: [8, 8], wrap: true, children: [
|
|
11100
|
+
currentSkill.license && /* @__PURE__ */ jsx53(
|
|
11101
|
+
Tag9,
|
|
10767
11102
|
{
|
|
10768
|
-
icon: /* @__PURE__ */
|
|
11103
|
+
icon: /* @__PURE__ */ jsx53(CopyrightOutlined, {}),
|
|
10769
11104
|
style: {
|
|
10770
11105
|
margin: 0,
|
|
10771
11106
|
fontSize: 11,
|
|
@@ -10780,8 +11115,8 @@ var SkillNode = ({ data }) => {
|
|
|
10780
11115
|
children: currentSkill.license
|
|
10781
11116
|
}
|
|
10782
11117
|
),
|
|
10783
|
-
currentSkill.compatibility && /* @__PURE__ */
|
|
10784
|
-
|
|
11118
|
+
currentSkill.compatibility && /* @__PURE__ */ jsx53(
|
|
11119
|
+
Tag9,
|
|
10785
11120
|
{
|
|
10786
11121
|
style: {
|
|
10787
11122
|
margin: 0,
|
|
@@ -10801,9 +11136,9 @@ var SkillNode = ({ data }) => {
|
|
|
10801
11136
|
}
|
|
10802
11137
|
)
|
|
10803
11138
|
] }) }),
|
|
10804
|
-
(currentSkill.createdAt || currentSkill.updatedAt) && /* @__PURE__ */
|
|
10805
|
-
currentSkill.createdAt && /* @__PURE__ */
|
|
10806
|
-
|
|
11139
|
+
(currentSkill.createdAt || currentSkill.updatedAt) && /* @__PURE__ */ jsx53("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ jsxs32(Space19, { direction: "vertical", size: 4, children: [
|
|
11140
|
+
currentSkill.createdAt && /* @__PURE__ */ jsxs32(
|
|
11141
|
+
Text20,
|
|
10807
11142
|
{
|
|
10808
11143
|
style: {
|
|
10809
11144
|
fontSize: 11,
|
|
@@ -10816,8 +11151,8 @@ var SkillNode = ({ data }) => {
|
|
|
10816
11151
|
]
|
|
10817
11152
|
}
|
|
10818
11153
|
),
|
|
10819
|
-
currentSkill.updatedAt && /* @__PURE__ */
|
|
10820
|
-
|
|
11154
|
+
currentSkill.updatedAt && /* @__PURE__ */ jsxs32(
|
|
11155
|
+
Text20,
|
|
10821
11156
|
{
|
|
10822
11157
|
style: {
|
|
10823
11158
|
fontSize: 11,
|
|
@@ -10831,8 +11166,8 @@ var SkillNode = ({ data }) => {
|
|
|
10831
11166
|
}
|
|
10832
11167
|
)
|
|
10833
11168
|
] }) }),
|
|
10834
|
-
currentSkill.content && /* @__PURE__ */
|
|
10835
|
-
/* @__PURE__ */
|
|
11169
|
+
currentSkill.content && /* @__PURE__ */ jsxs32("div", { style: { marginBottom: 0 }, children: [
|
|
11170
|
+
/* @__PURE__ */ jsxs32(
|
|
10836
11171
|
"div",
|
|
10837
11172
|
{
|
|
10838
11173
|
style: {
|
|
@@ -10842,7 +11177,7 @@ var SkillNode = ({ data }) => {
|
|
|
10842
11177
|
marginBottom: 8
|
|
10843
11178
|
},
|
|
10844
11179
|
children: [
|
|
10845
|
-
/* @__PURE__ */
|
|
11180
|
+
/* @__PURE__ */ jsx53(
|
|
10846
11181
|
FileTextOutlined6,
|
|
10847
11182
|
{
|
|
10848
11183
|
style: {
|
|
@@ -10851,8 +11186,8 @@ var SkillNode = ({ data }) => {
|
|
|
10851
11186
|
}
|
|
10852
11187
|
}
|
|
10853
11188
|
),
|
|
10854
|
-
/* @__PURE__ */
|
|
10855
|
-
|
|
11189
|
+
/* @__PURE__ */ jsx53(
|
|
11190
|
+
Text20,
|
|
10856
11191
|
{
|
|
10857
11192
|
style: {
|
|
10858
11193
|
fontSize: 12,
|
|
@@ -10866,7 +11201,7 @@ var SkillNode = ({ data }) => {
|
|
|
10866
11201
|
]
|
|
10867
11202
|
}
|
|
10868
11203
|
),
|
|
10869
|
-
/* @__PURE__ */
|
|
11204
|
+
/* @__PURE__ */ jsx53(
|
|
10870
11205
|
"div",
|
|
10871
11206
|
{
|
|
10872
11207
|
style: {
|
|
@@ -10877,8 +11212,8 @@ var SkillNode = ({ data }) => {
|
|
|
10877
11212
|
maxHeight: 200,
|
|
10878
11213
|
overflowY: "auto"
|
|
10879
11214
|
},
|
|
10880
|
-
children: /* @__PURE__ */
|
|
10881
|
-
|
|
11215
|
+
children: /* @__PURE__ */ jsx53(
|
|
11216
|
+
Text20,
|
|
10882
11217
|
{
|
|
10883
11218
|
style: {
|
|
10884
11219
|
fontSize: 11,
|
|
@@ -10893,8 +11228,8 @@ var SkillNode = ({ data }) => {
|
|
|
10893
11228
|
)
|
|
10894
11229
|
] })
|
|
10895
11230
|
] }),
|
|
10896
|
-
/* @__PURE__ */
|
|
10897
|
-
/* @__PURE__ */
|
|
11231
|
+
/* @__PURE__ */ jsx53(Divider4, { style: { margin: "16px 0" } }),
|
|
11232
|
+
/* @__PURE__ */ jsx53(
|
|
10898
11233
|
"div",
|
|
10899
11234
|
{
|
|
10900
11235
|
style: {
|
|
@@ -10903,8 +11238,8 @@ var SkillNode = ({ data }) => {
|
|
|
10903
11238
|
justifyContent: "space-between",
|
|
10904
11239
|
gap: 8
|
|
10905
11240
|
},
|
|
10906
|
-
children: isEditing ? /* @__PURE__ */
|
|
10907
|
-
/* @__PURE__ */
|
|
11241
|
+
children: isEditing ? /* @__PURE__ */ jsxs32(Fragment9, { children: [
|
|
11242
|
+
/* @__PURE__ */ jsx53(
|
|
10908
11243
|
Button22,
|
|
10909
11244
|
{
|
|
10910
11245
|
block: true,
|
|
@@ -10918,7 +11253,7 @@ var SkillNode = ({ data }) => {
|
|
|
10918
11253
|
children: "Cancel"
|
|
10919
11254
|
}
|
|
10920
11255
|
),
|
|
10921
|
-
/* @__PURE__ */
|
|
11256
|
+
/* @__PURE__ */ jsx53(
|
|
10922
11257
|
Button22,
|
|
10923
11258
|
{
|
|
10924
11259
|
type: "primary",
|
|
@@ -10931,8 +11266,8 @@ var SkillNode = ({ data }) => {
|
|
|
10931
11266
|
children: "Save"
|
|
10932
11267
|
}
|
|
10933
11268
|
)
|
|
10934
|
-
] }) : /* @__PURE__ */
|
|
10935
|
-
/* @__PURE__ */
|
|
11269
|
+
] }) : /* @__PURE__ */ jsxs32(Fragment9, { children: [
|
|
11270
|
+
/* @__PURE__ */ jsx53(
|
|
10936
11271
|
Button22,
|
|
10937
11272
|
{
|
|
10938
11273
|
type: "primary",
|
|
@@ -10944,7 +11279,7 @@ var SkillNode = ({ data }) => {
|
|
|
10944
11279
|
children: "Edit Skill"
|
|
10945
11280
|
}
|
|
10946
11281
|
),
|
|
10947
|
-
/* @__PURE__ */
|
|
11282
|
+
/* @__PURE__ */ jsx53(
|
|
10948
11283
|
Button22,
|
|
10949
11284
|
{
|
|
10950
11285
|
danger: true,
|
|
@@ -10955,10 +11290,10 @@ var SkillNode = ({ data }) => {
|
|
|
10955
11290
|
children: "Delete"
|
|
10956
11291
|
}
|
|
10957
11292
|
),
|
|
10958
|
-
/* @__PURE__ */
|
|
11293
|
+
/* @__PURE__ */ jsx53(
|
|
10959
11294
|
Button22,
|
|
10960
11295
|
{
|
|
10961
|
-
icon: /* @__PURE__ */
|
|
11296
|
+
icon: /* @__PURE__ */ jsx53(CopyOutlined2, {}),
|
|
10962
11297
|
onClick: () => handleCopy(currentSkill.id),
|
|
10963
11298
|
title: "Copy ID"
|
|
10964
11299
|
}
|
|
@@ -10977,14 +11312,14 @@ var SkillNode = ({ data }) => {
|
|
|
10977
11312
|
height: 0,
|
|
10978
11313
|
pointerEvents: "none"
|
|
10979
11314
|
};
|
|
10980
|
-
return /* @__PURE__ */
|
|
11315
|
+
return /* @__PURE__ */ jsxs32(
|
|
10981
11316
|
"div",
|
|
10982
11317
|
{
|
|
10983
11318
|
style: {
|
|
10984
11319
|
padding: 4
|
|
10985
11320
|
},
|
|
10986
11321
|
children: [
|
|
10987
|
-
/* @__PURE__ */
|
|
11322
|
+
/* @__PURE__ */ jsx53(
|
|
10988
11323
|
Handle2,
|
|
10989
11324
|
{
|
|
10990
11325
|
type: "target",
|
|
@@ -10993,7 +11328,7 @@ var SkillNode = ({ data }) => {
|
|
|
10993
11328
|
isConnectable: false
|
|
10994
11329
|
}
|
|
10995
11330
|
),
|
|
10996
|
-
/* @__PURE__ */
|
|
11331
|
+
/* @__PURE__ */ jsx53(
|
|
10997
11332
|
"div",
|
|
10998
11333
|
{
|
|
10999
11334
|
onClick: () => {
|
|
@@ -11023,7 +11358,7 @@ var SkillNode = ({ data }) => {
|
|
|
11023
11358
|
e.currentTarget.style.transform = "translateY(0)";
|
|
11024
11359
|
e.currentTarget.style.boxShadow = `0 1px 4px rgba(0, 0, 0, 0.08)`;
|
|
11025
11360
|
},
|
|
11026
|
-
children: /* @__PURE__ */
|
|
11361
|
+
children: /* @__PURE__ */ jsxs32(
|
|
11027
11362
|
"div",
|
|
11028
11363
|
{
|
|
11029
11364
|
style: {
|
|
@@ -11033,7 +11368,7 @@ var SkillNode = ({ data }) => {
|
|
|
11033
11368
|
gap: 10
|
|
11034
11369
|
},
|
|
11035
11370
|
children: [
|
|
11036
|
-
/* @__PURE__ */
|
|
11371
|
+
/* @__PURE__ */ jsxs32(
|
|
11037
11372
|
"div",
|
|
11038
11373
|
{
|
|
11039
11374
|
style: {
|
|
@@ -11042,7 +11377,7 @@ var SkillNode = ({ data }) => {
|
|
|
11042
11377
|
gap: 10
|
|
11043
11378
|
},
|
|
11044
11379
|
children: [
|
|
11045
|
-
/* @__PURE__ */
|
|
11380
|
+
/* @__PURE__ */ jsxs32(
|
|
11046
11381
|
"div",
|
|
11047
11382
|
{
|
|
11048
11383
|
style: {
|
|
@@ -11050,11 +11385,11 @@ var SkillNode = ({ data }) => {
|
|
|
11050
11385
|
flexShrink: 0
|
|
11051
11386
|
},
|
|
11052
11387
|
children: [
|
|
11053
|
-
/* @__PURE__ */
|
|
11388
|
+
/* @__PURE__ */ jsx53(
|
|
11054
11389
|
Avatar6,
|
|
11055
11390
|
{
|
|
11056
11391
|
size: 44,
|
|
11057
|
-
icon: /* @__PURE__ */
|
|
11392
|
+
icon: /* @__PURE__ */ jsx53(BookOutlined, {}),
|
|
11058
11393
|
style: {
|
|
11059
11394
|
backgroundColor: badgeColor,
|
|
11060
11395
|
color: "#fff",
|
|
@@ -11064,7 +11399,7 @@ var SkillNode = ({ data }) => {
|
|
|
11064
11399
|
children: initials
|
|
11065
11400
|
}
|
|
11066
11401
|
),
|
|
11067
|
-
hasSubSkills && /* @__PURE__ */
|
|
11402
|
+
hasSubSkills && /* @__PURE__ */ jsx53(
|
|
11068
11403
|
"div",
|
|
11069
11404
|
{
|
|
11070
11405
|
style: {
|
|
@@ -11080,7 +11415,7 @@ var SkillNode = ({ data }) => {
|
|
|
11080
11415
|
alignItems: "center",
|
|
11081
11416
|
justifyContent: "center"
|
|
11082
11417
|
},
|
|
11083
|
-
children: /* @__PURE__ */
|
|
11418
|
+
children: /* @__PURE__ */ jsx53(
|
|
11084
11419
|
BranchesOutlined2,
|
|
11085
11420
|
{
|
|
11086
11421
|
style: {
|
|
@@ -11094,7 +11429,7 @@ var SkillNode = ({ data }) => {
|
|
|
11094
11429
|
]
|
|
11095
11430
|
}
|
|
11096
11431
|
),
|
|
11097
|
-
/* @__PURE__ */
|
|
11432
|
+
/* @__PURE__ */ jsxs32(
|
|
11098
11433
|
"div",
|
|
11099
11434
|
{
|
|
11100
11435
|
style: {
|
|
@@ -11102,8 +11437,8 @@ var SkillNode = ({ data }) => {
|
|
|
11102
11437
|
minWidth: 0
|
|
11103
11438
|
},
|
|
11104
11439
|
children: [
|
|
11105
|
-
/* @__PURE__ */
|
|
11106
|
-
|
|
11440
|
+
/* @__PURE__ */ jsx53(
|
|
11441
|
+
Text20,
|
|
11107
11442
|
{
|
|
11108
11443
|
strong: true,
|
|
11109
11444
|
style: {
|
|
@@ -11118,7 +11453,7 @@ var SkillNode = ({ data }) => {
|
|
|
11118
11453
|
children: currentSkill.name
|
|
11119
11454
|
}
|
|
11120
11455
|
),
|
|
11121
|
-
/* @__PURE__ */
|
|
11456
|
+
/* @__PURE__ */ jsxs32(
|
|
11122
11457
|
"div",
|
|
11123
11458
|
{
|
|
11124
11459
|
style: {
|
|
@@ -11127,7 +11462,7 @@ var SkillNode = ({ data }) => {
|
|
|
11127
11462
|
gap: 4
|
|
11128
11463
|
},
|
|
11129
11464
|
children: [
|
|
11130
|
-
/* @__PURE__ */
|
|
11465
|
+
/* @__PURE__ */ jsx53(
|
|
11131
11466
|
FileTextOutlined6,
|
|
11132
11467
|
{
|
|
11133
11468
|
style: {
|
|
@@ -11136,8 +11471,8 @@ var SkillNode = ({ data }) => {
|
|
|
11136
11471
|
}
|
|
11137
11472
|
}
|
|
11138
11473
|
),
|
|
11139
|
-
/* @__PURE__ */
|
|
11140
|
-
|
|
11474
|
+
/* @__PURE__ */ jsx53(
|
|
11475
|
+
Text20,
|
|
11141
11476
|
{
|
|
11142
11477
|
style: {
|
|
11143
11478
|
fontSize: 9,
|
|
@@ -11156,7 +11491,7 @@ var SkillNode = ({ data }) => {
|
|
|
11156
11491
|
]
|
|
11157
11492
|
}
|
|
11158
11493
|
),
|
|
11159
|
-
currentSkill.description && /* @__PURE__ */
|
|
11494
|
+
currentSkill.description && /* @__PURE__ */ jsx53(
|
|
11160
11495
|
"div",
|
|
11161
11496
|
{
|
|
11162
11497
|
style: {
|
|
@@ -11166,12 +11501,12 @@ var SkillNode = ({ data }) => {
|
|
|
11166
11501
|
borderRadius: 4,
|
|
11167
11502
|
borderLeft: `2px solid ${badgeColor}`
|
|
11168
11503
|
},
|
|
11169
|
-
children: /* @__PURE__ */
|
|
11504
|
+
children: /* @__PURE__ */ jsx53(
|
|
11170
11505
|
Tooltip11,
|
|
11171
11506
|
{
|
|
11172
11507
|
title: currentSkill.description.length > 150 ? currentSkill.description : void 0,
|
|
11173
11508
|
placement: "top",
|
|
11174
|
-
children: /* @__PURE__ */
|
|
11509
|
+
children: /* @__PURE__ */ jsxs32(
|
|
11175
11510
|
"div",
|
|
11176
11511
|
{
|
|
11177
11512
|
style: {
|
|
@@ -11197,7 +11532,7 @@ var SkillNode = ({ data }) => {
|
|
|
11197
11532
|
)
|
|
11198
11533
|
}
|
|
11199
11534
|
),
|
|
11200
|
-
/* @__PURE__ */
|
|
11535
|
+
/* @__PURE__ */ jsxs32(
|
|
11201
11536
|
"div",
|
|
11202
11537
|
{
|
|
11203
11538
|
style: {
|
|
@@ -11208,8 +11543,8 @@ var SkillNode = ({ data }) => {
|
|
|
11208
11543
|
marginTop: "auto"
|
|
11209
11544
|
},
|
|
11210
11545
|
children: [
|
|
11211
|
-
/* @__PURE__ */
|
|
11212
|
-
|
|
11546
|
+
/* @__PURE__ */ jsx53(
|
|
11547
|
+
Tag9,
|
|
11213
11548
|
{
|
|
11214
11549
|
style: {
|
|
11215
11550
|
margin: 0,
|
|
@@ -11226,8 +11561,8 @@ var SkillNode = ({ data }) => {
|
|
|
11226
11561
|
children: category.toUpperCase()
|
|
11227
11562
|
}
|
|
11228
11563
|
),
|
|
11229
|
-
hasSubSkills && /* @__PURE__ */
|
|
11230
|
-
|
|
11564
|
+
hasSubSkills && /* @__PURE__ */ jsxs32(
|
|
11565
|
+
Tag9,
|
|
11231
11566
|
{
|
|
11232
11567
|
style: {
|
|
11233
11568
|
margin: 0,
|
|
@@ -11249,8 +11584,8 @@ var SkillNode = ({ data }) => {
|
|
|
11249
11584
|
]
|
|
11250
11585
|
}
|
|
11251
11586
|
),
|
|
11252
|
-
currentSkill.license && /* @__PURE__ */
|
|
11253
|
-
|
|
11587
|
+
currentSkill.license && /* @__PURE__ */ jsx53(
|
|
11588
|
+
Tag9,
|
|
11254
11589
|
{
|
|
11255
11590
|
style: {
|
|
11256
11591
|
margin: 0,
|
|
@@ -11263,12 +11598,12 @@ var SkillNode = ({ data }) => {
|
|
|
11263
11598
|
fontWeight: 500,
|
|
11264
11599
|
lineHeight: "14px"
|
|
11265
11600
|
},
|
|
11266
|
-
icon: /* @__PURE__ */
|
|
11601
|
+
icon: /* @__PURE__ */ jsx53(CopyrightOutlined, {}),
|
|
11267
11602
|
children: currentSkill.license
|
|
11268
11603
|
}
|
|
11269
11604
|
),
|
|
11270
|
-
currentSkill.compatibility && /* @__PURE__ */
|
|
11271
|
-
|
|
11605
|
+
currentSkill.compatibility && /* @__PURE__ */ jsx53(
|
|
11606
|
+
Tag9,
|
|
11272
11607
|
{
|
|
11273
11608
|
style: {
|
|
11274
11609
|
margin: 0,
|
|
@@ -11281,7 +11616,7 @@ var SkillNode = ({ data }) => {
|
|
|
11281
11616
|
fontWeight: 500,
|
|
11282
11617
|
lineHeight: "14px"
|
|
11283
11618
|
},
|
|
11284
|
-
icon: /* @__PURE__ */
|
|
11619
|
+
icon: /* @__PURE__ */ jsx53(InfoCircleOutlined5, {}),
|
|
11285
11620
|
children: currentSkill.compatibility
|
|
11286
11621
|
}
|
|
11287
11622
|
)
|
|
@@ -11293,7 +11628,7 @@ var SkillNode = ({ data }) => {
|
|
|
11293
11628
|
)
|
|
11294
11629
|
}
|
|
11295
11630
|
),
|
|
11296
|
-
/* @__PURE__ */
|
|
11631
|
+
/* @__PURE__ */ jsx53(
|
|
11297
11632
|
Modal3,
|
|
11298
11633
|
{
|
|
11299
11634
|
open: isModalOpen,
|
|
@@ -11312,7 +11647,7 @@ var SkillNode = ({ data }) => {
|
|
|
11312
11647
|
children: detailCardContent
|
|
11313
11648
|
}
|
|
11314
11649
|
),
|
|
11315
|
-
/* @__PURE__ */
|
|
11650
|
+
/* @__PURE__ */ jsx53(
|
|
11316
11651
|
Handle2,
|
|
11317
11652
|
{
|
|
11318
11653
|
type: "source",
|
|
@@ -11328,33 +11663,33 @@ var SkillNode = ({ data }) => {
|
|
|
11328
11663
|
var SkillNode_default = SkillNode;
|
|
11329
11664
|
|
|
11330
11665
|
// src/components/Chat/CreateSkillModal.tsx
|
|
11331
|
-
import { useState as
|
|
11666
|
+
import { useState as useState29 } from "react";
|
|
11332
11667
|
import {
|
|
11333
11668
|
Modal as Modal4,
|
|
11334
11669
|
Form as Form3,
|
|
11335
|
-
Input as
|
|
11670
|
+
Input as Input5,
|
|
11336
11671
|
Button as Button23,
|
|
11337
11672
|
message as message9,
|
|
11338
11673
|
notification as notification4,
|
|
11339
|
-
Space as
|
|
11340
|
-
Typography as
|
|
11674
|
+
Space as Space20,
|
|
11675
|
+
Typography as Typography23
|
|
11341
11676
|
} from "antd";
|
|
11342
11677
|
import { PlusOutlined as PlusOutlined5 } from "@ant-design/icons";
|
|
11343
|
-
import { theme as
|
|
11344
|
-
import { jsx as
|
|
11345
|
-
var { TextArea: TextArea4 } =
|
|
11346
|
-
var { Text:
|
|
11678
|
+
import { theme as theme8 } from "antd";
|
|
11679
|
+
import { jsx as jsx54, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
11680
|
+
var { TextArea: TextArea4 } = Input5;
|
|
11681
|
+
var { Text: Text21 } = Typography23;
|
|
11347
11682
|
var CreateSkillModal = ({
|
|
11348
11683
|
open,
|
|
11349
11684
|
onCancel,
|
|
11350
11685
|
onSuccess
|
|
11351
11686
|
}) => {
|
|
11352
11687
|
const [form] = Form3.useForm();
|
|
11353
|
-
const [loading, setLoading] =
|
|
11688
|
+
const [loading, setLoading] = useState29(false);
|
|
11354
11689
|
const { config } = useLatticeChatShellContext();
|
|
11355
|
-
const { token } =
|
|
11690
|
+
const { token } = theme8.useToken();
|
|
11356
11691
|
const defaultMetadataRows = [{ key: "category", value: "global" }];
|
|
11357
|
-
const [metadataRows, setMetadataRows] =
|
|
11692
|
+
const [metadataRows, setMetadataRows] = useState29(defaultMetadataRows);
|
|
11358
11693
|
const handleSubmit = async () => {
|
|
11359
11694
|
try {
|
|
11360
11695
|
const values = await form.validateFields();
|
|
@@ -11428,7 +11763,7 @@ var CreateSkillModal = ({
|
|
|
11428
11763
|
const handleAddMetadataRow = () => {
|
|
11429
11764
|
setMetadataRows([...metadataRows, { key: "", value: "" }]);
|
|
11430
11765
|
};
|
|
11431
|
-
return /* @__PURE__ */
|
|
11766
|
+
return /* @__PURE__ */ jsx54(
|
|
11432
11767
|
Modal4,
|
|
11433
11768
|
{
|
|
11434
11769
|
title: "Create New Skill",
|
|
@@ -11440,14 +11775,14 @@ var CreateSkillModal = ({
|
|
|
11440
11775
|
styles: {
|
|
11441
11776
|
body: { padding: 16 }
|
|
11442
11777
|
},
|
|
11443
|
-
children: /* @__PURE__ */
|
|
11778
|
+
children: /* @__PURE__ */ jsx54(
|
|
11444
11779
|
Form3,
|
|
11445
11780
|
{
|
|
11446
11781
|
form,
|
|
11447
11782
|
layout: "vertical",
|
|
11448
11783
|
onFinish: handleSubmit,
|
|
11449
11784
|
autoComplete: "off",
|
|
11450
|
-
children: /* @__PURE__ */
|
|
11785
|
+
children: /* @__PURE__ */ jsxs33(
|
|
11451
11786
|
"div",
|
|
11452
11787
|
{
|
|
11453
11788
|
style: {
|
|
@@ -11456,9 +11791,9 @@ var CreateSkillModal = ({
|
|
|
11456
11791
|
gap: 12
|
|
11457
11792
|
},
|
|
11458
11793
|
children: [
|
|
11459
|
-
/* @__PURE__ */
|
|
11460
|
-
/* @__PURE__ */
|
|
11461
|
-
/* @__PURE__ */
|
|
11794
|
+
/* @__PURE__ */ jsxs33("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
11795
|
+
/* @__PURE__ */ jsx54(Text21, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Name" }),
|
|
11796
|
+
/* @__PURE__ */ jsx54(
|
|
11462
11797
|
Form3.Item,
|
|
11463
11798
|
{
|
|
11464
11799
|
name: "name",
|
|
@@ -11471,13 +11806,13 @@ var CreateSkillModal = ({
|
|
|
11471
11806
|
{ min: 1, max: 64, message: "Name must be 1-64 characters" }
|
|
11472
11807
|
],
|
|
11473
11808
|
style: { marginBottom: 0 },
|
|
11474
|
-
children: /* @__PURE__ */
|
|
11809
|
+
children: /* @__PURE__ */ jsx54(Input5, { placeholder: "e.g., data-analysis" })
|
|
11475
11810
|
}
|
|
11476
11811
|
)
|
|
11477
11812
|
] }),
|
|
11478
|
-
/* @__PURE__ */
|
|
11479
|
-
/* @__PURE__ */
|
|
11480
|
-
/* @__PURE__ */
|
|
11813
|
+
/* @__PURE__ */ jsxs33("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
11814
|
+
/* @__PURE__ */ jsx54(Text21, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Description" }),
|
|
11815
|
+
/* @__PURE__ */ jsx54(
|
|
11481
11816
|
Form3.Item,
|
|
11482
11817
|
{
|
|
11483
11818
|
name: "description",
|
|
@@ -11485,7 +11820,7 @@ var CreateSkillModal = ({
|
|
|
11485
11820
|
{ required: true, message: "Please enter skill description" }
|
|
11486
11821
|
],
|
|
11487
11822
|
style: { marginBottom: 0 },
|
|
11488
|
-
children: /* @__PURE__ */
|
|
11823
|
+
children: /* @__PURE__ */ jsx54(
|
|
11489
11824
|
TextArea4,
|
|
11490
11825
|
{
|
|
11491
11826
|
placeholder: "Description",
|
|
@@ -11495,16 +11830,16 @@ var CreateSkillModal = ({
|
|
|
11495
11830
|
}
|
|
11496
11831
|
)
|
|
11497
11832
|
] }),
|
|
11498
|
-
/* @__PURE__ */
|
|
11499
|
-
/* @__PURE__ */
|
|
11500
|
-
/* @__PURE__ */
|
|
11833
|
+
/* @__PURE__ */ jsxs33("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
11834
|
+
/* @__PURE__ */ jsx54(Text21, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "License" }),
|
|
11835
|
+
/* @__PURE__ */ jsx54(Form3.Item, { name: "license", style: { marginBottom: 0 }, children: /* @__PURE__ */ jsx54(Input5, { placeholder: "License" }) })
|
|
11501
11836
|
] }),
|
|
11502
|
-
/* @__PURE__ */
|
|
11503
|
-
/* @__PURE__ */
|
|
11504
|
-
/* @__PURE__ */
|
|
11837
|
+
/* @__PURE__ */ jsxs33("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
11838
|
+
/* @__PURE__ */ jsx54(Text21, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Compatibility" }),
|
|
11839
|
+
/* @__PURE__ */ jsx54(Form3.Item, { name: "compatibility", style: { marginBottom: 0 }, children: /* @__PURE__ */ jsx54(Input5, { placeholder: "Compatibility" }) })
|
|
11505
11840
|
] }),
|
|
11506
|
-
/* @__PURE__ */
|
|
11507
|
-
/* @__PURE__ */
|
|
11841
|
+
/* @__PURE__ */ jsxs33("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
11842
|
+
/* @__PURE__ */ jsxs33(
|
|
11508
11843
|
"div",
|
|
11509
11844
|
{
|
|
11510
11845
|
style: {
|
|
@@ -11514,8 +11849,8 @@ var CreateSkillModal = ({
|
|
|
11514
11849
|
gap: 8
|
|
11515
11850
|
},
|
|
11516
11851
|
children: [
|
|
11517
|
-
/* @__PURE__ */
|
|
11518
|
-
|
|
11852
|
+
/* @__PURE__ */ jsx54(
|
|
11853
|
+
Text21,
|
|
11519
11854
|
{
|
|
11520
11855
|
style: {
|
|
11521
11856
|
fontSize: 12,
|
|
@@ -11525,11 +11860,11 @@ var CreateSkillModal = ({
|
|
|
11525
11860
|
children: "Metadata"
|
|
11526
11861
|
}
|
|
11527
11862
|
),
|
|
11528
|
-
/* @__PURE__ */
|
|
11863
|
+
/* @__PURE__ */ jsx54(
|
|
11529
11864
|
Button23,
|
|
11530
11865
|
{
|
|
11531
11866
|
size: "small",
|
|
11532
|
-
icon: /* @__PURE__ */
|
|
11867
|
+
icon: /* @__PURE__ */ jsx54(PlusOutlined5, {}),
|
|
11533
11868
|
onClick: handleAddMetadataRow,
|
|
11534
11869
|
children: "Add"
|
|
11535
11870
|
}
|
|
@@ -11537,9 +11872,9 @@ var CreateSkillModal = ({
|
|
|
11537
11872
|
]
|
|
11538
11873
|
}
|
|
11539
11874
|
),
|
|
11540
|
-
/* @__PURE__ */
|
|
11541
|
-
metadataRows.length === 0 && /* @__PURE__ */
|
|
11542
|
-
|
|
11875
|
+
/* @__PURE__ */ jsxs33(Space20, { direction: "vertical", size: 8, style: { width: "100%" }, children: [
|
|
11876
|
+
metadataRows.length === 0 && /* @__PURE__ */ jsx54(
|
|
11877
|
+
Text21,
|
|
11543
11878
|
{
|
|
11544
11879
|
style: {
|
|
11545
11880
|
fontSize: 11,
|
|
@@ -11548,7 +11883,7 @@ var CreateSkillModal = ({
|
|
|
11548
11883
|
children: "No metadata yet. Use Add to create one."
|
|
11549
11884
|
}
|
|
11550
11885
|
),
|
|
11551
|
-
metadataRows.map((row, index) => /* @__PURE__ */
|
|
11886
|
+
metadataRows.map((row, index) => /* @__PURE__ */ jsxs33(
|
|
11552
11887
|
"div",
|
|
11553
11888
|
{
|
|
11554
11889
|
style: {
|
|
@@ -11558,8 +11893,8 @@ var CreateSkillModal = ({
|
|
|
11558
11893
|
width: "100%"
|
|
11559
11894
|
},
|
|
11560
11895
|
children: [
|
|
11561
|
-
/* @__PURE__ */
|
|
11562
|
-
|
|
11896
|
+
/* @__PURE__ */ jsxs33(
|
|
11897
|
+
Text21,
|
|
11563
11898
|
{
|
|
11564
11899
|
style: { fontSize: 11, color: token.colorTextSecondary },
|
|
11565
11900
|
children: [
|
|
@@ -11568,9 +11903,9 @@ var CreateSkillModal = ({
|
|
|
11568
11903
|
]
|
|
11569
11904
|
}
|
|
11570
11905
|
),
|
|
11571
|
-
/* @__PURE__ */
|
|
11572
|
-
/* @__PURE__ */
|
|
11573
|
-
|
|
11906
|
+
/* @__PURE__ */ jsxs33(Space20, { style: { width: "100%" }, size: 8, wrap: true, children: [
|
|
11907
|
+
/* @__PURE__ */ jsx54(
|
|
11908
|
+
Input5,
|
|
11574
11909
|
{
|
|
11575
11910
|
value: row.key,
|
|
11576
11911
|
placeholder: "Key",
|
|
@@ -11578,8 +11913,8 @@ var CreateSkillModal = ({
|
|
|
11578
11913
|
onChange: (e) => handleMetadataChange(index, "key", e.target.value)
|
|
11579
11914
|
}
|
|
11580
11915
|
),
|
|
11581
|
-
/* @__PURE__ */
|
|
11582
|
-
|
|
11916
|
+
/* @__PURE__ */ jsx54(
|
|
11917
|
+
Input5,
|
|
11583
11918
|
{
|
|
11584
11919
|
value: row.value,
|
|
11585
11920
|
placeholder: "Value",
|
|
@@ -11594,9 +11929,9 @@ var CreateSkillModal = ({
|
|
|
11594
11929
|
))
|
|
11595
11930
|
] })
|
|
11596
11931
|
] }),
|
|
11597
|
-
/* @__PURE__ */
|
|
11598
|
-
/* @__PURE__ */
|
|
11599
|
-
/* @__PURE__ */
|
|
11932
|
+
/* @__PURE__ */ jsxs33("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
11933
|
+
/* @__PURE__ */ jsx54(Text21, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Content" }),
|
|
11934
|
+
/* @__PURE__ */ jsx54(Form3.Item, { name: "content", style: { marginBottom: 0 }, children: /* @__PURE__ */ jsx54(
|
|
11600
11935
|
TextArea4,
|
|
11601
11936
|
{
|
|
11602
11937
|
placeholder: "Content",
|
|
@@ -11604,7 +11939,7 @@ var CreateSkillModal = ({
|
|
|
11604
11939
|
}
|
|
11605
11940
|
) })
|
|
11606
11941
|
] }),
|
|
11607
|
-
/* @__PURE__ */
|
|
11942
|
+
/* @__PURE__ */ jsxs33(
|
|
11608
11943
|
"div",
|
|
11609
11944
|
{
|
|
11610
11945
|
style: {
|
|
@@ -11615,8 +11950,8 @@ var CreateSkillModal = ({
|
|
|
11615
11950
|
marginTop: 8
|
|
11616
11951
|
},
|
|
11617
11952
|
children: [
|
|
11618
|
-
/* @__PURE__ */
|
|
11619
|
-
/* @__PURE__ */
|
|
11953
|
+
/* @__PURE__ */ jsx54(Button23, { onClick: handleCancel, children: "Cancel" }),
|
|
11954
|
+
/* @__PURE__ */ jsx54(Button23, { type: "primary", htmlType: "submit", loading, children: "Create Skill" })
|
|
11620
11955
|
]
|
|
11621
11956
|
}
|
|
11622
11957
|
)
|
|
@@ -11631,14 +11966,14 @@ var CreateSkillModal = ({
|
|
|
11631
11966
|
var CreateSkillModal_default = CreateSkillModal;
|
|
11632
11967
|
|
|
11633
11968
|
// src/components/Chat/SkillFlow.tsx
|
|
11634
|
-
import { jsx as
|
|
11969
|
+
import { jsx as jsx55, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
11635
11970
|
var SkillFlowInner = ({ onNodeClick }) => {
|
|
11636
11971
|
const [nodes, setNodes, onNodesChange] = useNodesState2([]);
|
|
11637
11972
|
const [edges, setEdges, onEdgesChange] = useEdgesState2([]);
|
|
11638
|
-
const [isCreateModalOpen, setIsCreateModalOpen] =
|
|
11639
|
-
const [skills, setSkills] =
|
|
11640
|
-
const [skillsLoading, setSkillsLoading] =
|
|
11641
|
-
const { token } =
|
|
11973
|
+
const [isCreateModalOpen, setIsCreateModalOpen] = useState30(false);
|
|
11974
|
+
const [skills, setSkills] = useState30([]);
|
|
11975
|
+
const [skillsLoading, setSkillsLoading] = useState30(false);
|
|
11976
|
+
const { token } = theme9.useToken();
|
|
11642
11977
|
const { config } = useLatticeChatShellContext();
|
|
11643
11978
|
const nodeTypes = useMemo14(
|
|
11644
11979
|
() => ({
|
|
@@ -11669,10 +12004,10 @@ var SkillFlowInner = ({ onNodeClick }) => {
|
|
|
11669
12004
|
setSkillsLoading(false);
|
|
11670
12005
|
}
|
|
11671
12006
|
};
|
|
11672
|
-
|
|
12007
|
+
useEffect21(() => {
|
|
11673
12008
|
fetchSkills();
|
|
11674
12009
|
}, []);
|
|
11675
|
-
|
|
12010
|
+
useEffect21(() => {
|
|
11676
12011
|
if (!skills || skills.length === 0) {
|
|
11677
12012
|
setNodes([]);
|
|
11678
12013
|
setEdges([]);
|
|
@@ -11804,7 +12139,7 @@ var SkillFlowInner = ({ onNodeClick }) => {
|
|
|
11804
12139
|
await fetchSkills();
|
|
11805
12140
|
};
|
|
11806
12141
|
if (skillsLoading) {
|
|
11807
|
-
return /* @__PURE__ */
|
|
12142
|
+
return /* @__PURE__ */ jsx55(
|
|
11808
12143
|
"div",
|
|
11809
12144
|
{
|
|
11810
12145
|
style: {
|
|
@@ -11819,8 +12154,8 @@ var SkillFlowInner = ({ onNodeClick }) => {
|
|
|
11819
12154
|
}
|
|
11820
12155
|
);
|
|
11821
12156
|
}
|
|
11822
|
-
return /* @__PURE__ */
|
|
11823
|
-
/* @__PURE__ */
|
|
12157
|
+
return /* @__PURE__ */ jsxs34("div", { style: { width: "100%", height: "100%", background: "#fafafa", position: "relative" }, children: [
|
|
12158
|
+
/* @__PURE__ */ jsxs34(
|
|
11824
12159
|
ReactFlow2,
|
|
11825
12160
|
{
|
|
11826
12161
|
nodes,
|
|
@@ -11830,12 +12165,12 @@ var SkillFlowInner = ({ onNodeClick }) => {
|
|
|
11830
12165
|
nodeTypes,
|
|
11831
12166
|
fitView: true,
|
|
11832
12167
|
children: [
|
|
11833
|
-
/* @__PURE__ */
|
|
11834
|
-
/* @__PURE__ */
|
|
12168
|
+
/* @__PURE__ */ jsx55(Background2, { color: "#eee", gap: 20 }),
|
|
12169
|
+
/* @__PURE__ */ jsx55(Controls2, {})
|
|
11835
12170
|
]
|
|
11836
12171
|
}
|
|
11837
12172
|
),
|
|
11838
|
-
/* @__PURE__ */
|
|
12173
|
+
/* @__PURE__ */ jsx55(
|
|
11839
12174
|
"div",
|
|
11840
12175
|
{
|
|
11841
12176
|
style: {
|
|
@@ -11844,12 +12179,12 @@ var SkillFlowInner = ({ onNodeClick }) => {
|
|
|
11844
12179
|
right: 20,
|
|
11845
12180
|
zIndex: 10
|
|
11846
12181
|
},
|
|
11847
|
-
children: /* @__PURE__ */
|
|
12182
|
+
children: /* @__PURE__ */ jsx55(
|
|
11848
12183
|
Button24,
|
|
11849
12184
|
{
|
|
11850
12185
|
type: "primary",
|
|
11851
12186
|
size: "large",
|
|
11852
|
-
icon: /* @__PURE__ */
|
|
12187
|
+
icon: /* @__PURE__ */ jsx55(PlusOutlined6, {}),
|
|
11853
12188
|
onClick: () => setIsCreateModalOpen(true),
|
|
11854
12189
|
style: {
|
|
11855
12190
|
height: 48,
|
|
@@ -11865,7 +12200,7 @@ var SkillFlowInner = ({ onNodeClick }) => {
|
|
|
11865
12200
|
)
|
|
11866
12201
|
}
|
|
11867
12202
|
),
|
|
11868
|
-
/* @__PURE__ */
|
|
12203
|
+
/* @__PURE__ */ jsx55(
|
|
11869
12204
|
CreateSkillModal_default,
|
|
11870
12205
|
{
|
|
11871
12206
|
open: isCreateModalOpen,
|
|
@@ -11875,27 +12210,27 @@ var SkillFlowInner = ({ onNodeClick }) => {
|
|
|
11875
12210
|
)
|
|
11876
12211
|
] });
|
|
11877
12212
|
};
|
|
11878
|
-
var SkillFlow = (props) => /* @__PURE__ */
|
|
12213
|
+
var SkillFlow = (props) => /* @__PURE__ */ jsx55(ReactFlowProvider2, { children: /* @__PURE__ */ jsx55(SkillFlowInner, { ...props }) });
|
|
11879
12214
|
var SkillFlow_default = SkillFlow;
|
|
11880
12215
|
|
|
11881
12216
|
// src/components/Chat/ToolsList.tsx
|
|
11882
|
-
import { List as
|
|
12217
|
+
import { List as List6, Avatar as Avatar7, theme as theme10, Alert as Alert4, Button as Button25, Tag as Tag10 } from "antd";
|
|
11883
12218
|
import { ReloadOutlined as ReloadOutlined3 } from "@ant-design/icons";
|
|
11884
|
-
import { useEffect as
|
|
11885
|
-
import { jsx as
|
|
12219
|
+
import { useEffect as useEffect22, useState as useState31, useCallback as useCallback18 } from "react";
|
|
12220
|
+
import { jsx as jsx56, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
11886
12221
|
var ToolsList = ({
|
|
11887
12222
|
onToolSelect,
|
|
11888
12223
|
autoLoad = true
|
|
11889
12224
|
}) => {
|
|
11890
|
-
const { token } =
|
|
12225
|
+
const { token } = theme10.useToken();
|
|
11891
12226
|
const { config } = useLatticeChatShellContext();
|
|
11892
|
-
const [state, setState] =
|
|
12227
|
+
const [state, setState] = useState31({
|
|
11893
12228
|
tools: [],
|
|
11894
12229
|
isLoading: false,
|
|
11895
12230
|
error: null
|
|
11896
12231
|
});
|
|
11897
|
-
const [selectedToolId, setSelectedToolId] =
|
|
11898
|
-
const fetchTools =
|
|
12232
|
+
const [selectedToolId, setSelectedToolId] = useState31(null);
|
|
12233
|
+
const fetchTools = useCallback18(async () => {
|
|
11899
12234
|
setState((prev) => ({ ...prev, isLoading: true, error: null }));
|
|
11900
12235
|
try {
|
|
11901
12236
|
const headers = {};
|
|
@@ -11928,17 +12263,17 @@ var ToolsList = ({
|
|
|
11928
12263
|
}));
|
|
11929
12264
|
}
|
|
11930
12265
|
}, [config]);
|
|
11931
|
-
const handleToolSelect =
|
|
12266
|
+
const handleToolSelect = useCallback18(
|
|
11932
12267
|
(tool) => {
|
|
11933
12268
|
setSelectedToolId(tool.id);
|
|
11934
12269
|
onToolSelect?.(tool);
|
|
11935
12270
|
},
|
|
11936
12271
|
[onToolSelect]
|
|
11937
12272
|
);
|
|
11938
|
-
const handleRefresh =
|
|
12273
|
+
const handleRefresh = useCallback18(() => {
|
|
11939
12274
|
fetchTools();
|
|
11940
12275
|
}, [fetchTools]);
|
|
11941
|
-
|
|
12276
|
+
useEffect22(() => {
|
|
11942
12277
|
if (autoLoad) {
|
|
11943
12278
|
fetchTools();
|
|
11944
12279
|
}
|
|
@@ -11951,18 +12286,18 @@ var ToolsList = ({
|
|
|
11951
12286
|
padding: token.paddingSM
|
|
11952
12287
|
};
|
|
11953
12288
|
if (state.error) {
|
|
11954
|
-
return /* @__PURE__ */
|
|
12289
|
+
return /* @__PURE__ */ jsx56("div", { style, children: /* @__PURE__ */ jsx56(
|
|
11955
12290
|
Alert4,
|
|
11956
12291
|
{
|
|
11957
12292
|
message: "Error Loading Tools",
|
|
11958
12293
|
description: state.error.message,
|
|
11959
12294
|
type: "error",
|
|
11960
12295
|
showIcon: true,
|
|
11961
|
-
action: /* @__PURE__ */
|
|
12296
|
+
action: /* @__PURE__ */ jsx56(
|
|
11962
12297
|
Button25,
|
|
11963
12298
|
{
|
|
11964
12299
|
size: "small",
|
|
11965
|
-
icon: /* @__PURE__ */
|
|
12300
|
+
icon: /* @__PURE__ */ jsx56(ReloadOutlined3, {}),
|
|
11966
12301
|
onClick: handleRefresh,
|
|
11967
12302
|
children: "Retry"
|
|
11968
12303
|
}
|
|
@@ -11970,8 +12305,8 @@ var ToolsList = ({
|
|
|
11970
12305
|
}
|
|
11971
12306
|
) });
|
|
11972
12307
|
}
|
|
11973
|
-
return /* @__PURE__ */
|
|
11974
|
-
/* @__PURE__ */
|
|
12308
|
+
return /* @__PURE__ */ jsxs35("div", { style: { position: "relative", width: "100%", height: "100%" }, children: [
|
|
12309
|
+
/* @__PURE__ */ jsx56(
|
|
11975
12310
|
"div",
|
|
11976
12311
|
{
|
|
11977
12312
|
style: {
|
|
@@ -11980,12 +12315,12 @@ var ToolsList = ({
|
|
|
11980
12315
|
right: token.paddingSM,
|
|
11981
12316
|
zIndex: 1
|
|
11982
12317
|
},
|
|
11983
|
-
children: /* @__PURE__ */
|
|
12318
|
+
children: /* @__PURE__ */ jsx56(
|
|
11984
12319
|
Button25,
|
|
11985
12320
|
{
|
|
11986
12321
|
type: "text",
|
|
11987
12322
|
size: "small",
|
|
11988
|
-
icon: /* @__PURE__ */
|
|
12323
|
+
icon: /* @__PURE__ */ jsx56(ReloadOutlined3, {}),
|
|
11989
12324
|
onClick: handleRefresh,
|
|
11990
12325
|
title: "Refresh tools",
|
|
11991
12326
|
style: {
|
|
@@ -11995,7 +12330,7 @@ var ToolsList = ({
|
|
|
11995
12330
|
)
|
|
11996
12331
|
}
|
|
11997
12332
|
),
|
|
11998
|
-
/* @__PURE__ */
|
|
12333
|
+
/* @__PURE__ */ jsx56(
|
|
11999
12334
|
"div",
|
|
12000
12335
|
{
|
|
12001
12336
|
style: {
|
|
@@ -12005,13 +12340,13 @@ var ToolsList = ({
|
|
|
12005
12340
|
overflowX: "hidden",
|
|
12006
12341
|
paddingTop: token.paddingLG
|
|
12007
12342
|
},
|
|
12008
|
-
children: /* @__PURE__ */
|
|
12009
|
-
|
|
12343
|
+
children: /* @__PURE__ */ jsx56(
|
|
12344
|
+
List6,
|
|
12010
12345
|
{
|
|
12011
12346
|
dataSource: state.tools,
|
|
12012
12347
|
loading: state.isLoading,
|
|
12013
12348
|
locale: {
|
|
12014
|
-
emptyText: /* @__PURE__ */
|
|
12349
|
+
emptyText: /* @__PURE__ */ jsxs35(
|
|
12015
12350
|
"div",
|
|
12016
12351
|
{
|
|
12017
12352
|
style: {
|
|
@@ -12022,11 +12357,11 @@ var ToolsList = ({
|
|
|
12022
12357
|
padding: token.paddingLG
|
|
12023
12358
|
},
|
|
12024
12359
|
children: [
|
|
12025
|
-
/* @__PURE__ */
|
|
12026
|
-
/* @__PURE__ */
|
|
12360
|
+
/* @__PURE__ */ jsx56("div", { style: { color: token.colorTextSecondary }, children: "No tools available" }),
|
|
12361
|
+
/* @__PURE__ */ jsx56(
|
|
12027
12362
|
Button25,
|
|
12028
12363
|
{
|
|
12029
|
-
icon: /* @__PURE__ */
|
|
12364
|
+
icon: /* @__PURE__ */ jsx56(ReloadOutlined3, {}),
|
|
12030
12365
|
onClick: handleRefresh,
|
|
12031
12366
|
type: "dashed",
|
|
12032
12367
|
size: "small",
|
|
@@ -12041,8 +12376,8 @@ var ToolsList = ({
|
|
|
12041
12376
|
...style,
|
|
12042
12377
|
paddingTop: 0
|
|
12043
12378
|
},
|
|
12044
|
-
renderItem: (tool) => /* @__PURE__ */
|
|
12045
|
-
|
|
12379
|
+
renderItem: (tool) => /* @__PURE__ */ jsx56(
|
|
12380
|
+
List6.Item,
|
|
12046
12381
|
{
|
|
12047
12382
|
onClick: () => handleToolSelect(tool),
|
|
12048
12383
|
style: {
|
|
@@ -12062,10 +12397,10 @@ var ToolsList = ({
|
|
|
12062
12397
|
e.currentTarget.style.backgroundColor = "transparent";
|
|
12063
12398
|
}
|
|
12064
12399
|
},
|
|
12065
|
-
children: /* @__PURE__ */
|
|
12066
|
-
|
|
12400
|
+
children: /* @__PURE__ */ jsx56(
|
|
12401
|
+
List6.Item.Meta,
|
|
12067
12402
|
{
|
|
12068
|
-
avatar: /* @__PURE__ */
|
|
12403
|
+
avatar: /* @__PURE__ */ jsx56(
|
|
12069
12404
|
Avatar7,
|
|
12070
12405
|
{
|
|
12071
12406
|
size: "small",
|
|
@@ -12076,7 +12411,7 @@ var ToolsList = ({
|
|
|
12076
12411
|
children: tool.name.charAt(0).toUpperCase()
|
|
12077
12412
|
}
|
|
12078
12413
|
),
|
|
12079
|
-
title: /* @__PURE__ */
|
|
12414
|
+
title: /* @__PURE__ */ jsxs35(
|
|
12080
12415
|
"div",
|
|
12081
12416
|
{
|
|
12082
12417
|
style: {
|
|
@@ -12085,9 +12420,9 @@ var ToolsList = ({
|
|
|
12085
12420
|
gap: token.marginXS
|
|
12086
12421
|
},
|
|
12087
12422
|
children: [
|
|
12088
|
-
/* @__PURE__ */
|
|
12089
|
-
tool.needUserApprove && /* @__PURE__ */
|
|
12090
|
-
|
|
12423
|
+
/* @__PURE__ */ jsx56("span", { children: tool.name }),
|
|
12424
|
+
tool.needUserApprove && /* @__PURE__ */ jsx56(
|
|
12425
|
+
Tag10,
|
|
12091
12426
|
{
|
|
12092
12427
|
color: "warning",
|
|
12093
12428
|
style: {
|
|
@@ -12102,7 +12437,7 @@ var ToolsList = ({
|
|
|
12102
12437
|
]
|
|
12103
12438
|
}
|
|
12104
12439
|
),
|
|
12105
|
-
description: /* @__PURE__ */
|
|
12440
|
+
description: /* @__PURE__ */ jsx56(
|
|
12106
12441
|
"div",
|
|
12107
12442
|
{
|
|
12108
12443
|
style: {
|
|
@@ -12128,7 +12463,7 @@ var ToolsList = ({
|
|
|
12128
12463
|
};
|
|
12129
12464
|
|
|
12130
12465
|
// src/components/Chat/ChatSidebar.tsx
|
|
12131
|
-
import { Fragment as
|
|
12466
|
+
import { Fragment as Fragment10, jsx as jsx57, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
12132
12467
|
var useStyles4 = createStyles13(({ token, css }) => ({
|
|
12133
12468
|
sidebar: css`
|
|
12134
12469
|
display: flex;
|
|
@@ -12184,9 +12519,9 @@ var ChatSidebar = ({
|
|
|
12184
12519
|
const { styles } = useStyles4();
|
|
12185
12520
|
const { setSettingsModalOpen } = useLatticeChatShellContext();
|
|
12186
12521
|
const { selectAssistant } = useAssistantContext();
|
|
12187
|
-
const [isFlowModalOpen, setIsFlowModalOpen] =
|
|
12188
|
-
const [isSkillFlowModalOpen, setIsSkillFlowModalOpen] =
|
|
12189
|
-
const [isToolsModalOpen, setIsToolsModalOpen] =
|
|
12522
|
+
const [isFlowModalOpen, setIsFlowModalOpen] = useState32(false);
|
|
12523
|
+
const [isSkillFlowModalOpen, setIsSkillFlowModalOpen] = useState32(false);
|
|
12524
|
+
const [isToolsModalOpen, setIsToolsModalOpen] = useState32(false);
|
|
12190
12525
|
const handleSettingsClick = () => {
|
|
12191
12526
|
setSettingsModalOpen(true);
|
|
12192
12527
|
onSettingsClick?.();
|
|
@@ -12200,50 +12535,50 @@ var ChatSidebar = ({
|
|
|
12200
12535
|
const handleToolsClick = () => {
|
|
12201
12536
|
setIsToolsModalOpen(true);
|
|
12202
12537
|
};
|
|
12203
|
-
return /* @__PURE__ */
|
|
12204
|
-
/* @__PURE__ */
|
|
12205
|
-
/* @__PURE__ */
|
|
12538
|
+
return /* @__PURE__ */ jsxs36(Fragment10, { children: [
|
|
12539
|
+
/* @__PURE__ */ jsx57("div", { className: styles.sidebar, children: /* @__PURE__ */ jsxs36("div", { className: styles.buttonContainer, children: [
|
|
12540
|
+
/* @__PURE__ */ jsx57(
|
|
12206
12541
|
"button",
|
|
12207
12542
|
{
|
|
12208
12543
|
className: styles.actionButton,
|
|
12209
12544
|
onClick: handleAssistantFlowClick,
|
|
12210
12545
|
title: "Assistant Flow Canvas",
|
|
12211
12546
|
"aria-label": "Assistant Flow Canvas",
|
|
12212
|
-
children: /* @__PURE__ */
|
|
12547
|
+
children: /* @__PURE__ */ jsx57(Bot, {})
|
|
12213
12548
|
}
|
|
12214
12549
|
),
|
|
12215
|
-
/* @__PURE__ */
|
|
12550
|
+
/* @__PURE__ */ jsx57(
|
|
12216
12551
|
"button",
|
|
12217
12552
|
{
|
|
12218
12553
|
className: styles.actionButton,
|
|
12219
12554
|
onClick: handleSkillFlowClick,
|
|
12220
12555
|
title: "Skill Flow Canvas",
|
|
12221
12556
|
"aria-label": "Skill Flow Canvas",
|
|
12222
|
-
children: /* @__PURE__ */
|
|
12557
|
+
children: /* @__PURE__ */ jsx57(BrainCircuit, {})
|
|
12223
12558
|
}
|
|
12224
12559
|
),
|
|
12225
|
-
/* @__PURE__ */
|
|
12560
|
+
/* @__PURE__ */ jsx57(
|
|
12226
12561
|
"button",
|
|
12227
12562
|
{
|
|
12228
12563
|
className: styles.actionButton,
|
|
12229
12564
|
onClick: handleToolsClick,
|
|
12230
12565
|
title: "Tools List",
|
|
12231
12566
|
"aria-label": "Tools List",
|
|
12232
|
-
children: /* @__PURE__ */
|
|
12567
|
+
children: /* @__PURE__ */ jsx57(Wrench, {})
|
|
12233
12568
|
}
|
|
12234
12569
|
),
|
|
12235
|
-
/* @__PURE__ */
|
|
12570
|
+
/* @__PURE__ */ jsx57(
|
|
12236
12571
|
"button",
|
|
12237
12572
|
{
|
|
12238
12573
|
className: styles.actionButton,
|
|
12239
12574
|
onClick: handleSettingsClick,
|
|
12240
12575
|
title: "Settings",
|
|
12241
12576
|
"aria-label": "Settings",
|
|
12242
|
-
children: /* @__PURE__ */
|
|
12577
|
+
children: /* @__PURE__ */ jsx57(Settings, {})
|
|
12243
12578
|
}
|
|
12244
12579
|
)
|
|
12245
12580
|
] }) }),
|
|
12246
|
-
/* @__PURE__ */
|
|
12581
|
+
/* @__PURE__ */ jsx57(
|
|
12247
12582
|
Modal5,
|
|
12248
12583
|
{
|
|
12249
12584
|
destroyOnHidden: true,
|
|
@@ -12257,7 +12592,7 @@ var ChatSidebar = ({
|
|
|
12257
12592
|
height: "calc(100vh - 120px)",
|
|
12258
12593
|
padding: 0
|
|
12259
12594
|
},
|
|
12260
|
-
children: /* @__PURE__ */
|
|
12595
|
+
children: /* @__PURE__ */ jsx57("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsx57(
|
|
12261
12596
|
AssistantFlow_default,
|
|
12262
12597
|
{
|
|
12263
12598
|
onChat: (assistant) => {
|
|
@@ -12268,7 +12603,7 @@ var ChatSidebar = ({
|
|
|
12268
12603
|
) })
|
|
12269
12604
|
}
|
|
12270
12605
|
),
|
|
12271
|
-
/* @__PURE__ */
|
|
12606
|
+
/* @__PURE__ */ jsx57(
|
|
12272
12607
|
Modal5,
|
|
12273
12608
|
{
|
|
12274
12609
|
destroyOnHidden: true,
|
|
@@ -12282,7 +12617,7 @@ var ChatSidebar = ({
|
|
|
12282
12617
|
height: "calc(100vh - 120px)",
|
|
12283
12618
|
padding: 0
|
|
12284
12619
|
},
|
|
12285
|
-
children: /* @__PURE__ */
|
|
12620
|
+
children: /* @__PURE__ */ jsx57("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsx57(
|
|
12286
12621
|
SkillFlow_default,
|
|
12287
12622
|
{
|
|
12288
12623
|
onNodeClick: (skill) => {
|
|
@@ -12292,7 +12627,7 @@ var ChatSidebar = ({
|
|
|
12292
12627
|
) })
|
|
12293
12628
|
}
|
|
12294
12629
|
),
|
|
12295
|
-
/* @__PURE__ */
|
|
12630
|
+
/* @__PURE__ */ jsx57(
|
|
12296
12631
|
Modal5,
|
|
12297
12632
|
{
|
|
12298
12633
|
destroyOnHidden: true,
|
|
@@ -12306,7 +12641,7 @@ var ChatSidebar = ({
|
|
|
12306
12641
|
height: "calc(100vh - 120px)",
|
|
12307
12642
|
padding: 0
|
|
12308
12643
|
},
|
|
12309
|
-
children: /* @__PURE__ */
|
|
12644
|
+
children: /* @__PURE__ */ jsx57("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsx57(
|
|
12310
12645
|
ToolsList,
|
|
12311
12646
|
{
|
|
12312
12647
|
onToolSelect: (tool) => {
|
|
@@ -12320,7 +12655,7 @@ var ChatSidebar = ({
|
|
|
12320
12655
|
};
|
|
12321
12656
|
|
|
12322
12657
|
// src/components/Chat/LatticeChatView.tsx
|
|
12323
|
-
import { jsx as
|
|
12658
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
12324
12659
|
var LatticeChatView = (props) => {
|
|
12325
12660
|
const shellContext = useContext8(LatticeChatShellContext);
|
|
12326
12661
|
const { showSideMenu } = shellContext.config;
|
|
@@ -12329,7 +12664,7 @@ var LatticeChatView = (props) => {
|
|
|
12329
12664
|
const {
|
|
12330
12665
|
config: { baseURL }
|
|
12331
12666
|
} = useLatticeChatShellContext();
|
|
12332
|
-
return assistantId && thread ? /* @__PURE__ */
|
|
12667
|
+
return assistantId && thread ? /* @__PURE__ */ jsx58(
|
|
12333
12668
|
AxiomLatticeProvider,
|
|
12334
12669
|
{
|
|
12335
12670
|
config: {
|
|
@@ -12338,14 +12673,14 @@ var LatticeChatView = (props) => {
|
|
|
12338
12673
|
assistantId,
|
|
12339
12674
|
transport: "sse"
|
|
12340
12675
|
},
|
|
12341
|
-
children: /* @__PURE__ */
|
|
12676
|
+
children: /* @__PURE__ */ jsx58(
|
|
12342
12677
|
LatticeChat,
|
|
12343
12678
|
{
|
|
12344
12679
|
thread_id: thread?.id,
|
|
12345
12680
|
assistant_id: assistantId,
|
|
12346
12681
|
name: currentAssistant?.name,
|
|
12347
12682
|
description: currentAssistant?.description,
|
|
12348
|
-
menu: showSideMenu ? /* @__PURE__ */
|
|
12683
|
+
menu: showSideMenu ? /* @__PURE__ */ jsx58(ChatSidebar, {}) : void 0
|
|
12349
12684
|
}
|
|
12350
12685
|
)
|
|
12351
12686
|
}
|
|
@@ -12353,18 +12688,18 @@ var LatticeChatView = (props) => {
|
|
|
12353
12688
|
};
|
|
12354
12689
|
|
|
12355
12690
|
// src/components/Chat/SettingsModal.tsx
|
|
12356
|
-
import { useState as
|
|
12691
|
+
import { useState as useState33, useEffect as useEffect23, useRef as useRef15 } from "react";
|
|
12357
12692
|
import {
|
|
12358
12693
|
Modal as Modal6,
|
|
12359
|
-
Input as
|
|
12694
|
+
Input as Input6,
|
|
12360
12695
|
Button as Button26,
|
|
12361
12696
|
message as message10,
|
|
12362
12697
|
notification as notification5,
|
|
12363
|
-
Typography as
|
|
12698
|
+
Typography as Typography24,
|
|
12364
12699
|
Alert as Alert5,
|
|
12365
12700
|
Select as Select3,
|
|
12366
|
-
Switch as
|
|
12367
|
-
Space as
|
|
12701
|
+
Switch as Switch3,
|
|
12702
|
+
Space as Space21,
|
|
12368
12703
|
Tabs
|
|
12369
12704
|
} from "antd";
|
|
12370
12705
|
import {
|
|
@@ -12373,16 +12708,16 @@ import {
|
|
|
12373
12708
|
ReloadOutlined as ReloadOutlined4,
|
|
12374
12709
|
CheckCircleOutlined as CheckCircleOutlined7,
|
|
12375
12710
|
ApiOutlined,
|
|
12376
|
-
LinkOutlined,
|
|
12711
|
+
LinkOutlined as LinkOutlined2,
|
|
12377
12712
|
CheckCircleFilled,
|
|
12378
12713
|
CloseCircleFilled,
|
|
12379
12714
|
PlusOutlined as PlusOutlined7,
|
|
12380
12715
|
CloudServerOutlined
|
|
12381
12716
|
} from "@ant-design/icons";
|
|
12382
12717
|
import { createStyles as createStyles14 } from "antd-style";
|
|
12383
|
-
import { Fragment as
|
|
12384
|
-
var { Text:
|
|
12385
|
-
var { TextArea: TextArea5 } =
|
|
12718
|
+
import { Fragment as Fragment11, jsx as jsx59, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
12719
|
+
var { Text: Text22, Title: Title4 } = Typography24;
|
|
12720
|
+
var { TextArea: TextArea5 } = Input6;
|
|
12386
12721
|
var useStyles5 = createStyles14(({ token, css }) => ({
|
|
12387
12722
|
// settingsModal: css`
|
|
12388
12723
|
// .ant-modal {
|
|
@@ -12729,12 +13064,12 @@ var SETTINGS_MENU_ITEMS = [
|
|
|
12729
13064
|
{
|
|
12730
13065
|
key: "environment",
|
|
12731
13066
|
label: "Environment Variables",
|
|
12732
|
-
icon: /* @__PURE__ */
|
|
13067
|
+
icon: /* @__PURE__ */ jsx59(EnvironmentOutlined, {})
|
|
12733
13068
|
},
|
|
12734
13069
|
{
|
|
12735
13070
|
key: "models",
|
|
12736
13071
|
label: "Model Configuration",
|
|
12737
|
-
icon: /* @__PURE__ */
|
|
13072
|
+
icon: /* @__PURE__ */ jsx59(ApiOutlined, {})
|
|
12738
13073
|
}
|
|
12739
13074
|
];
|
|
12740
13075
|
var SettingsModal = ({
|
|
@@ -12743,7 +13078,7 @@ var SettingsModal = ({
|
|
|
12743
13078
|
}) => {
|
|
12744
13079
|
const { styles } = useStyles5();
|
|
12745
13080
|
const { config: shellConfig, updateConfigValue } = useLatticeChatShellContext();
|
|
12746
|
-
const [connections, setConnections] =
|
|
13081
|
+
const [connections, setConnections] = useState33(() => {
|
|
12747
13082
|
if (typeof window !== "undefined") {
|
|
12748
13083
|
try {
|
|
12749
13084
|
const stored = localStorage.getItem("lattice_server_connections");
|
|
@@ -12766,21 +13101,21 @@ var SettingsModal = ({
|
|
|
12766
13101
|
}
|
|
12767
13102
|
return [];
|
|
12768
13103
|
});
|
|
12769
|
-
const [serverConfigs, setServerConfigs] =
|
|
13104
|
+
const [serverConfigs, setServerConfigs] = useState33({});
|
|
12770
13105
|
const connectionsRef = useRef15(connections);
|
|
12771
|
-
|
|
13106
|
+
useEffect23(() => {
|
|
12772
13107
|
connectionsRef.current = connections;
|
|
12773
13108
|
}, [connections]);
|
|
12774
|
-
const [activeTabKey, setActiveTabKey] =
|
|
13109
|
+
const [activeTabKey, setActiveTabKey] = useState33(
|
|
12775
13110
|
connections.length > 0 ? connections[0].id : ""
|
|
12776
13111
|
);
|
|
12777
|
-
const [activeMenu, setActiveMenu] =
|
|
12778
|
-
const [loading, setLoading] =
|
|
12779
|
-
const [showAddServerModal, setShowAddServerModal] =
|
|
12780
|
-
const [newServerUrl, setNewServerUrl] =
|
|
12781
|
-
const [newServerName, setNewServerName] =
|
|
12782
|
-
const [newServerApiKey, setNewServerApiKey] =
|
|
12783
|
-
const [addingServer, setAddingServer] =
|
|
13112
|
+
const [activeMenu, setActiveMenu] = useState33("environment");
|
|
13113
|
+
const [loading, setLoading] = useState33(false);
|
|
13114
|
+
const [showAddServerModal, setShowAddServerModal] = useState33(false);
|
|
13115
|
+
const [newServerUrl, setNewServerUrl] = useState33("");
|
|
13116
|
+
const [newServerName, setNewServerName] = useState33("");
|
|
13117
|
+
const [newServerApiKey, setNewServerApiKey] = useState33("");
|
|
13118
|
+
const [addingServer, setAddingServer] = useState33(false);
|
|
12784
13119
|
const saveConnections = (newConnections) => {
|
|
12785
13120
|
setConnections(newConnections);
|
|
12786
13121
|
if (typeof window !== "undefined") {
|
|
@@ -12970,7 +13305,7 @@ var SettingsModal = ({
|
|
|
12970
13305
|
console.error("Failed to load models configuration:", error);
|
|
12971
13306
|
}
|
|
12972
13307
|
};
|
|
12973
|
-
|
|
13308
|
+
useEffect23(() => {
|
|
12974
13309
|
if (open && activeTabKey) {
|
|
12975
13310
|
initializeServerConfig(activeTabKey);
|
|
12976
13311
|
const connection = connections.find((c) => c.id === activeTabKey);
|
|
@@ -12979,7 +13314,7 @@ var SettingsModal = ({
|
|
|
12979
13314
|
}
|
|
12980
13315
|
}
|
|
12981
13316
|
}, [open, activeTabKey]);
|
|
12982
|
-
|
|
13317
|
+
useEffect23(() => {
|
|
12983
13318
|
if (open && activeTabKey) {
|
|
12984
13319
|
const connection = connections.find((c) => c.id === activeTabKey);
|
|
12985
13320
|
if (connection?.connected) {
|
|
@@ -13190,25 +13525,25 @@ var SettingsModal = ({
|
|
|
13190
13525
|
}
|
|
13191
13526
|
}));
|
|
13192
13527
|
};
|
|
13193
|
-
return /* @__PURE__ */
|
|
13194
|
-
/* @__PURE__ */
|
|
13528
|
+
return /* @__PURE__ */ jsxs37("div", { className: styles.formContainer, children: [
|
|
13529
|
+
/* @__PURE__ */ jsx59(
|
|
13195
13530
|
Alert5,
|
|
13196
13531
|
{
|
|
13197
13532
|
message: "Configuration Effect",
|
|
13198
|
-
description: /* @__PURE__ */
|
|
13199
|
-
/* @__PURE__ */
|
|
13200
|
-
/* @__PURE__ */
|
|
13533
|
+
description: /* @__PURE__ */ jsxs37("div", { children: [
|
|
13534
|
+
/* @__PURE__ */ jsxs37("div", { style: { marginBottom: 8 }, children: [
|
|
13535
|
+
/* @__PURE__ */ jsx59(
|
|
13201
13536
|
CheckCircleOutlined7,
|
|
13202
13537
|
{
|
|
13203
13538
|
style: { color: "#52c41a", marginRight: 8 }
|
|
13204
13539
|
}
|
|
13205
13540
|
),
|
|
13206
|
-
/* @__PURE__ */
|
|
13541
|
+
/* @__PURE__ */ jsx59("strong", { children: "Immediately effective:" }),
|
|
13207
13542
|
" QUEUE_SERVICE_TYPE, REDIS_URL, REDIS_PASSWORD, QUEUE_NAME"
|
|
13208
13543
|
] }),
|
|
13209
|
-
/* @__PURE__ */
|
|
13210
|
-
/* @__PURE__ */
|
|
13211
|
-
/* @__PURE__ */
|
|
13544
|
+
/* @__PURE__ */ jsxs37("div", { children: [
|
|
13545
|
+
/* @__PURE__ */ jsx59(ReloadOutlined4, { style: { color: "#faad14", marginRight: 8 } }),
|
|
13546
|
+
/* @__PURE__ */ jsx59("strong", { children: "Requires restart:" }),
|
|
13212
13547
|
" PORT (server must be restarted to change port)"
|
|
13213
13548
|
] })
|
|
13214
13549
|
] }),
|
|
@@ -13217,8 +13552,8 @@ var SettingsModal = ({
|
|
|
13217
13552
|
className: styles.alertCard
|
|
13218
13553
|
}
|
|
13219
13554
|
),
|
|
13220
|
-
/* @__PURE__ */
|
|
13221
|
-
/* @__PURE__ */
|
|
13555
|
+
/* @__PURE__ */ jsx59("div", { style: { marginBottom: 24 }, children: /* @__PURE__ */ jsx59(Text22, { type: "secondary", style: { fontSize: 14, lineHeight: 1.6 }, children: "Configure environment variables in .env format (key=value). One variable per line. Leave password fields empty to keep current values." }) }),
|
|
13556
|
+
/* @__PURE__ */ jsx59(
|
|
13222
13557
|
TextArea5,
|
|
13223
13558
|
{
|
|
13224
13559
|
value: config.envText,
|
|
@@ -13295,10 +13630,10 @@ QUEUE_NAME=tasks`,
|
|
|
13295
13630
|
}));
|
|
13296
13631
|
}
|
|
13297
13632
|
};
|
|
13298
|
-
return /* @__PURE__ */
|
|
13299
|
-
/* @__PURE__ */
|
|
13300
|
-
config.models.map((model, index) => /* @__PURE__ */
|
|
13301
|
-
/* @__PURE__ */
|
|
13633
|
+
return /* @__PURE__ */ jsxs37("div", { className: styles.formContainer, children: [
|
|
13634
|
+
/* @__PURE__ */ jsx59("div", { style: { marginBottom: 32 }, children: /* @__PURE__ */ jsx59(Text22, { type: "secondary", style: { fontSize: 14, lineHeight: 1.6 }, children: "Configure model lattices. Each model will be registered with the provided key and can be used by agents." }) }),
|
|
13635
|
+
config.models.map((model, index) => /* @__PURE__ */ jsxs37("div", { className: styles.card, children: [
|
|
13636
|
+
/* @__PURE__ */ jsxs37(
|
|
13302
13637
|
"div",
|
|
13303
13638
|
{
|
|
13304
13639
|
style: {
|
|
@@ -13310,13 +13645,13 @@ QUEUE_NAME=tasks`,
|
|
|
13310
13645
|
borderBottom: "1px solid rgba(0, 0, 0, 0.06)"
|
|
13311
13646
|
},
|
|
13312
13647
|
children: [
|
|
13313
|
-
/* @__PURE__ */
|
|
13314
|
-
/* @__PURE__ */
|
|
13648
|
+
/* @__PURE__ */ jsxs37("div", { children: [
|
|
13649
|
+
/* @__PURE__ */ jsxs37(Text22, { strong: true, style: { fontSize: 16 }, children: [
|
|
13315
13650
|
"Model ",
|
|
13316
13651
|
index + 1
|
|
13317
13652
|
] }),
|
|
13318
|
-
model.key && /* @__PURE__ */
|
|
13319
|
-
|
|
13653
|
+
model.key && /* @__PURE__ */ jsxs37(
|
|
13654
|
+
Text22,
|
|
13320
13655
|
{
|
|
13321
13656
|
type: "secondary",
|
|
13322
13657
|
style: { marginLeft: 8, fontSize: 12 },
|
|
@@ -13328,7 +13663,7 @@ QUEUE_NAME=tasks`,
|
|
|
13328
13663
|
}
|
|
13329
13664
|
)
|
|
13330
13665
|
] }),
|
|
13331
|
-
config.models.length > 1 && /* @__PURE__ */
|
|
13666
|
+
config.models.length > 1 && /* @__PURE__ */ jsx59(
|
|
13332
13667
|
Button26,
|
|
13333
13668
|
{
|
|
13334
13669
|
type: "text",
|
|
@@ -13345,11 +13680,11 @@ QUEUE_NAME=tasks`,
|
|
|
13345
13680
|
]
|
|
13346
13681
|
}
|
|
13347
13682
|
),
|
|
13348
|
-
/* @__PURE__ */
|
|
13349
|
-
/* @__PURE__ */
|
|
13350
|
-
/* @__PURE__ */
|
|
13351
|
-
/* @__PURE__ */
|
|
13352
|
-
|
|
13683
|
+
/* @__PURE__ */ jsxs37(Space21, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
|
|
13684
|
+
/* @__PURE__ */ jsxs37("div", { children: [
|
|
13685
|
+
/* @__PURE__ */ jsx59(Text22, { className: styles.formLabel, children: "Key *" }),
|
|
13686
|
+
/* @__PURE__ */ jsx59(
|
|
13687
|
+
Input6,
|
|
13353
13688
|
{
|
|
13354
13689
|
placeholder: "e.g., default, gpt-4, claude",
|
|
13355
13690
|
value: model.key,
|
|
@@ -13357,11 +13692,11 @@ QUEUE_NAME=tasks`,
|
|
|
13357
13692
|
style: { height: 40 }
|
|
13358
13693
|
}
|
|
13359
13694
|
),
|
|
13360
|
-
/* @__PURE__ */
|
|
13695
|
+
/* @__PURE__ */ jsx59(Text22, { className: styles.formDescription, children: "Unique identifier for this model" })
|
|
13361
13696
|
] }),
|
|
13362
|
-
/* @__PURE__ */
|
|
13363
|
-
/* @__PURE__ */
|
|
13364
|
-
/* @__PURE__ */
|
|
13697
|
+
/* @__PURE__ */ jsxs37("div", { children: [
|
|
13698
|
+
/* @__PURE__ */ jsx59(Text22, { className: styles.formLabel, children: "Provider *" }),
|
|
13699
|
+
/* @__PURE__ */ jsx59(
|
|
13365
13700
|
Select3,
|
|
13366
13701
|
{
|
|
13367
13702
|
style: { width: "100%", height: 40 },
|
|
@@ -13377,10 +13712,10 @@ QUEUE_NAME=tasks`,
|
|
|
13377
13712
|
}
|
|
13378
13713
|
)
|
|
13379
13714
|
] }),
|
|
13380
|
-
/* @__PURE__ */
|
|
13381
|
-
/* @__PURE__ */
|
|
13382
|
-
/* @__PURE__ */
|
|
13383
|
-
|
|
13715
|
+
/* @__PURE__ */ jsxs37("div", { children: [
|
|
13716
|
+
/* @__PURE__ */ jsx59(Text22, { className: styles.formLabel, children: "Model Name *" }),
|
|
13717
|
+
/* @__PURE__ */ jsx59(
|
|
13718
|
+
Input6,
|
|
13384
13719
|
{
|
|
13385
13720
|
placeholder: "e.g., gpt-4, claude-3-opus, kimi-k2-250905",
|
|
13386
13721
|
value: model.model,
|
|
@@ -13389,10 +13724,10 @@ QUEUE_NAME=tasks`,
|
|
|
13389
13724
|
}
|
|
13390
13725
|
)
|
|
13391
13726
|
] }),
|
|
13392
|
-
/* @__PURE__ */
|
|
13393
|
-
/* @__PURE__ */
|
|
13394
|
-
/* @__PURE__ */
|
|
13395
|
-
|
|
13727
|
+
/* @__PURE__ */ jsxs37("div", { children: [
|
|
13728
|
+
/* @__PURE__ */ jsx59(Text22, { className: styles.formLabel, children: "API Key" }),
|
|
13729
|
+
/* @__PURE__ */ jsx59(
|
|
13730
|
+
Input6.Password,
|
|
13396
13731
|
{
|
|
13397
13732
|
placeholder: "Enter your API key",
|
|
13398
13733
|
value: model.apiKey,
|
|
@@ -13400,12 +13735,12 @@ QUEUE_NAME=tasks`,
|
|
|
13400
13735
|
style: { height: 40 }
|
|
13401
13736
|
}
|
|
13402
13737
|
),
|
|
13403
|
-
/* @__PURE__ */
|
|
13738
|
+
/* @__PURE__ */ jsx59(Text22, { className: styles.formDescription, children: "API key for the model provider. Leave empty to use environment variable." })
|
|
13404
13739
|
] }),
|
|
13405
|
-
/* @__PURE__ */
|
|
13406
|
-
/* @__PURE__ */
|
|
13407
|
-
/* @__PURE__ */
|
|
13408
|
-
|
|
13740
|
+
/* @__PURE__ */ jsxs37("div", { children: [
|
|
13741
|
+
/* @__PURE__ */ jsx59(Text22, { className: styles.formLabel, children: "Base URL" }),
|
|
13742
|
+
/* @__PURE__ */ jsx59(
|
|
13743
|
+
Input6,
|
|
13409
13744
|
{
|
|
13410
13745
|
placeholder: "e.g., https://api.openai.com/v1",
|
|
13411
13746
|
value: model.baseURL,
|
|
@@ -13413,23 +13748,23 @@ QUEUE_NAME=tasks`,
|
|
|
13413
13748
|
style: { height: 40 }
|
|
13414
13749
|
}
|
|
13415
13750
|
),
|
|
13416
|
-
/* @__PURE__ */
|
|
13751
|
+
/* @__PURE__ */ jsx59(Text22, { className: styles.formDescription, children: "Optional custom base URL for the API" })
|
|
13417
13752
|
] }),
|
|
13418
|
-
/* @__PURE__ */
|
|
13419
|
-
/* @__PURE__ */
|
|
13420
|
-
|
|
13753
|
+
/* @__PURE__ */ jsx59("div", { children: /* @__PURE__ */ jsxs37(Space21, { children: [
|
|
13754
|
+
/* @__PURE__ */ jsx59(
|
|
13755
|
+
Switch3,
|
|
13421
13756
|
{
|
|
13422
13757
|
checked: model.streaming,
|
|
13423
13758
|
onChange: (checked) => handleModelChange(index, "streaming", checked)
|
|
13424
13759
|
}
|
|
13425
13760
|
),
|
|
13426
|
-
/* @__PURE__ */
|
|
13761
|
+
/* @__PURE__ */ jsx59(Text22, { children: "Enable Streaming" })
|
|
13427
13762
|
] }) }),
|
|
13428
|
-
/* @__PURE__ */
|
|
13429
|
-
/* @__PURE__ */
|
|
13430
|
-
/* @__PURE__ */
|
|
13431
|
-
/* @__PURE__ */
|
|
13432
|
-
|
|
13763
|
+
/* @__PURE__ */ jsxs37("div", { style: { display: "flex", gap: 20 }, children: [
|
|
13764
|
+
/* @__PURE__ */ jsxs37("div", { style: { flex: 1 }, children: [
|
|
13765
|
+
/* @__PURE__ */ jsx59(Text22, { className: styles.formLabel, children: "Max Tokens" }),
|
|
13766
|
+
/* @__PURE__ */ jsx59(
|
|
13767
|
+
Input6,
|
|
13433
13768
|
{
|
|
13434
13769
|
type: "number",
|
|
13435
13770
|
placeholder: "e.g., 4096",
|
|
@@ -13443,10 +13778,10 @@ QUEUE_NAME=tasks`,
|
|
|
13443
13778
|
}
|
|
13444
13779
|
)
|
|
13445
13780
|
] }),
|
|
13446
|
-
/* @__PURE__ */
|
|
13447
|
-
/* @__PURE__ */
|
|
13448
|
-
/* @__PURE__ */
|
|
13449
|
-
|
|
13781
|
+
/* @__PURE__ */ jsxs37("div", { style: { flex: 1 }, children: [
|
|
13782
|
+
/* @__PURE__ */ jsx59(Text22, { className: styles.formLabel, children: "Temperature" }),
|
|
13783
|
+
/* @__PURE__ */ jsx59(
|
|
13784
|
+
Input6,
|
|
13450
13785
|
{
|
|
13451
13786
|
type: "number",
|
|
13452
13787
|
step: "0.1",
|
|
@@ -13464,7 +13799,7 @@ QUEUE_NAME=tasks`,
|
|
|
13464
13799
|
] })
|
|
13465
13800
|
] })
|
|
13466
13801
|
] }, index)),
|
|
13467
|
-
/* @__PURE__ */
|
|
13802
|
+
/* @__PURE__ */ jsx59(
|
|
13468
13803
|
Button26,
|
|
13469
13804
|
{
|
|
13470
13805
|
type: "dashed",
|
|
@@ -13492,8 +13827,8 @@ QUEUE_NAME=tasks`,
|
|
|
13492
13827
|
);
|
|
13493
13828
|
const currentConnection = connections.find((c) => c.id === activeTabKey);
|
|
13494
13829
|
const renderTabLabel = (connection) => {
|
|
13495
|
-
return /* @__PURE__ */
|
|
13496
|
-
/* @__PURE__ */
|
|
13830
|
+
return /* @__PURE__ */ jsxs37("div", { style: { display: "flex", alignItems: "center" }, children: [
|
|
13831
|
+
/* @__PURE__ */ jsx59(
|
|
13497
13832
|
CloudServerOutlined,
|
|
13498
13833
|
{
|
|
13499
13834
|
style: {
|
|
@@ -13502,14 +13837,14 @@ QUEUE_NAME=tasks`,
|
|
|
13502
13837
|
}
|
|
13503
13838
|
}
|
|
13504
13839
|
),
|
|
13505
|
-
/* @__PURE__ */
|
|
13506
|
-
connection.connected && /* @__PURE__ */
|
|
13840
|
+
/* @__PURE__ */ jsx59("span", { children: connection.name }),
|
|
13841
|
+
connection.connected && /* @__PURE__ */ jsx59(
|
|
13507
13842
|
CheckCircleFilled,
|
|
13508
13843
|
{
|
|
13509
13844
|
style: { color: "#52c41a", fontSize: 12, marginLeft: 8 }
|
|
13510
13845
|
}
|
|
13511
13846
|
),
|
|
13512
|
-
connection.error && !connection.connecting && /* @__PURE__ */
|
|
13847
|
+
connection.error && !connection.connecting && /* @__PURE__ */ jsx59(
|
|
13513
13848
|
CloseCircleFilled,
|
|
13514
13849
|
{
|
|
13515
13850
|
style: { color: "#ff4d4f", fontSize: 12, marginLeft: 8 }
|
|
@@ -13520,35 +13855,35 @@ QUEUE_NAME=tasks`,
|
|
|
13520
13855
|
const tabItems = connections.map((connection) => ({
|
|
13521
13856
|
key: connection.id,
|
|
13522
13857
|
label: renderTabLabel(connection),
|
|
13523
|
-
children: /* @__PURE__ */
|
|
13524
|
-
/* @__PURE__ */
|
|
13858
|
+
children: /* @__PURE__ */ jsx59("div", { className: styles.tabContent, children: connection.connected ? /* @__PURE__ */ jsx59(Fragment11, { children: /* @__PURE__ */ jsxs37("div", { style: { display: "flex", height: "100%" }, children: [
|
|
13859
|
+
/* @__PURE__ */ jsx59("div", { className: styles.sidebar, children: SETTINGS_MENU_ITEMS.map((item) => /* @__PURE__ */ jsxs37(
|
|
13525
13860
|
"div",
|
|
13526
13861
|
{
|
|
13527
13862
|
className: `${styles.menuItem} ${activeMenu === item.key ? "active" : ""}`,
|
|
13528
13863
|
onClick: () => setActiveMenu(item.key),
|
|
13529
13864
|
children: [
|
|
13530
|
-
/* @__PURE__ */
|
|
13531
|
-
/* @__PURE__ */
|
|
13865
|
+
/* @__PURE__ */ jsx59("span", { className: styles.menuItemIcon, children: item.icon }),
|
|
13866
|
+
/* @__PURE__ */ jsx59("span", { className: styles.menuItemText, children: item.label })
|
|
13532
13867
|
]
|
|
13533
13868
|
},
|
|
13534
13869
|
item.key
|
|
13535
13870
|
)) }),
|
|
13536
|
-
/* @__PURE__ */
|
|
13537
|
-
/* @__PURE__ */
|
|
13538
|
-
/* @__PURE__ */
|
|
13539
|
-
/* @__PURE__ */
|
|
13540
|
-
/* @__PURE__ */
|
|
13871
|
+
/* @__PURE__ */ jsxs37("div", { className: styles.content, children: [
|
|
13872
|
+
/* @__PURE__ */ jsxs37("div", { className: styles.contentHeader, children: [
|
|
13873
|
+
/* @__PURE__ */ jsxs37("div", { className: styles.contentHeaderLeft, children: [
|
|
13874
|
+
/* @__PURE__ */ jsx59(Title4, { level: 3, className: styles.contentTitle, children: activeMenuItem?.label }),
|
|
13875
|
+
/* @__PURE__ */ jsxs37(Text22, { className: styles.contentDescription, children: [
|
|
13541
13876
|
activeMenu === "environment" && "Manage environment variables for the gateway server",
|
|
13542
13877
|
activeMenu === "models" && "Configure and register model lattices for use by agents"
|
|
13543
13878
|
] })
|
|
13544
13879
|
] }),
|
|
13545
|
-
/* @__PURE__ */
|
|
13546
|
-
/* @__PURE__ */
|
|
13547
|
-
/* @__PURE__ */
|
|
13880
|
+
/* @__PURE__ */ jsxs37("div", { className: styles.contentHeaderRight, children: [
|
|
13881
|
+
/* @__PURE__ */ jsx59(Button26, { onClick: onClose, children: "Cancel" }),
|
|
13882
|
+
/* @__PURE__ */ jsx59(
|
|
13548
13883
|
Button26,
|
|
13549
13884
|
{
|
|
13550
13885
|
type: "primary",
|
|
13551
|
-
icon: /* @__PURE__ */
|
|
13886
|
+
icon: /* @__PURE__ */ jsx59(SaveOutlined2, {}),
|
|
13552
13887
|
onClick: handleSave,
|
|
13553
13888
|
loading,
|
|
13554
13889
|
children: "Save Configuration"
|
|
@@ -13556,9 +13891,9 @@ QUEUE_NAME=tasks`,
|
|
|
13556
13891
|
)
|
|
13557
13892
|
] })
|
|
13558
13893
|
] }),
|
|
13559
|
-
/* @__PURE__ */
|
|
13894
|
+
/* @__PURE__ */ jsx59("div", { className: styles.contentBody, children: renderContent(connection.id) })
|
|
13560
13895
|
] })
|
|
13561
|
-
] }) }) : /* @__PURE__ */
|
|
13896
|
+
] }) }) : /* @__PURE__ */ jsx59(
|
|
13562
13897
|
"div",
|
|
13563
13898
|
{
|
|
13564
13899
|
style: {
|
|
@@ -13570,29 +13905,29 @@ QUEUE_NAME=tasks`,
|
|
|
13570
13905
|
gap: 16,
|
|
13571
13906
|
padding: 48
|
|
13572
13907
|
},
|
|
13573
|
-
children: connection.connecting ? /* @__PURE__ */
|
|
13574
|
-
/* @__PURE__ */
|
|
13575
|
-
/* @__PURE__ */
|
|
13576
|
-
/* @__PURE__ */
|
|
13908
|
+
children: connection.connecting ? /* @__PURE__ */ jsxs37(Fragment11, { children: [
|
|
13909
|
+
/* @__PURE__ */ jsx59(LinkOutlined2, { style: { fontSize: 64, color: "#1890ff" }, spin: true }),
|
|
13910
|
+
/* @__PURE__ */ jsx59(Title4, { level: 4, children: "Connecting..." }),
|
|
13911
|
+
/* @__PURE__ */ jsxs37(Text22, { type: "secondary", style: { textAlign: "center" }, children: [
|
|
13577
13912
|
"Connecting to ",
|
|
13578
13913
|
connection.url
|
|
13579
13914
|
] })
|
|
13580
|
-
] }) : /* @__PURE__ */
|
|
13581
|
-
/* @__PURE__ */
|
|
13582
|
-
/* @__PURE__ */
|
|
13583
|
-
/* @__PURE__ */
|
|
13584
|
-
|
|
13915
|
+
] }) : /* @__PURE__ */ jsxs37(Fragment11, { children: [
|
|
13916
|
+
/* @__PURE__ */ jsx59(LinkOutlined2, { style: { fontSize: 64, color: "#d9d9d9" } }),
|
|
13917
|
+
/* @__PURE__ */ jsx59(Title4, { level: 4, type: "secondary", children: connection.error || "Not Connected" }),
|
|
13918
|
+
/* @__PURE__ */ jsx59(
|
|
13919
|
+
Text22,
|
|
13585
13920
|
{
|
|
13586
13921
|
type: "secondary",
|
|
13587
13922
|
style: { textAlign: "center", maxWidth: 400 },
|
|
13588
13923
|
children: connection.error ? `Failed to connect to ${connection.url}. Please check the server URL and try again.` : `Click "Reconnect" to connect to ${connection.url}`
|
|
13589
13924
|
}
|
|
13590
13925
|
),
|
|
13591
|
-
/* @__PURE__ */
|
|
13926
|
+
/* @__PURE__ */ jsx59(
|
|
13592
13927
|
Button26,
|
|
13593
13928
|
{
|
|
13594
13929
|
type: "primary",
|
|
13595
|
-
icon: /* @__PURE__ */
|
|
13930
|
+
icon: /* @__PURE__ */ jsx59(LinkOutlined2, {}),
|
|
13596
13931
|
onClick: () => checkConnection(connection.id),
|
|
13597
13932
|
loading: connection.connecting,
|
|
13598
13933
|
style: { marginTop: 16 },
|
|
@@ -13604,8 +13939,8 @@ QUEUE_NAME=tasks`,
|
|
|
13604
13939
|
) }),
|
|
13605
13940
|
closable: connections.length > 1
|
|
13606
13941
|
}));
|
|
13607
|
-
return /* @__PURE__ */
|
|
13608
|
-
/* @__PURE__ */
|
|
13942
|
+
return /* @__PURE__ */ jsxs37(Fragment11, { children: [
|
|
13943
|
+
/* @__PURE__ */ jsx59(
|
|
13609
13944
|
Modal6,
|
|
13610
13945
|
{
|
|
13611
13946
|
open,
|
|
@@ -13614,7 +13949,7 @@ QUEUE_NAME=tasks`,
|
|
|
13614
13949
|
width: "80%",
|
|
13615
13950
|
footer: null,
|
|
13616
13951
|
title: "Settings",
|
|
13617
|
-
children: /* @__PURE__ */
|
|
13952
|
+
children: /* @__PURE__ */ jsx59("div", { children: /* @__PURE__ */ jsx59(
|
|
13618
13953
|
Tabs,
|
|
13619
13954
|
{
|
|
13620
13955
|
activeKey: activeTabKey,
|
|
@@ -13628,7 +13963,7 @@ QUEUE_NAME=tasks`,
|
|
|
13628
13963
|
}
|
|
13629
13964
|
},
|
|
13630
13965
|
items: tabItems,
|
|
13631
|
-
addIcon: /* @__PURE__ */
|
|
13966
|
+
addIcon: /* @__PURE__ */ jsxs37(
|
|
13632
13967
|
"div",
|
|
13633
13968
|
{
|
|
13634
13969
|
style: {
|
|
@@ -13638,8 +13973,8 @@ QUEUE_NAME=tasks`,
|
|
|
13638
13973
|
padding: "4px 8px"
|
|
13639
13974
|
},
|
|
13640
13975
|
children: [
|
|
13641
|
-
/* @__PURE__ */
|
|
13642
|
-
/* @__PURE__ */
|
|
13976
|
+
/* @__PURE__ */ jsx59(PlusOutlined7, {}),
|
|
13977
|
+
/* @__PURE__ */ jsx59("span", { children: "Add Server" })
|
|
13643
13978
|
]
|
|
13644
13979
|
}
|
|
13645
13980
|
)
|
|
@@ -13647,7 +13982,7 @@ QUEUE_NAME=tasks`,
|
|
|
13647
13982
|
) })
|
|
13648
13983
|
}
|
|
13649
13984
|
),
|
|
13650
|
-
/* @__PURE__ */
|
|
13985
|
+
/* @__PURE__ */ jsx59(
|
|
13651
13986
|
Modal6,
|
|
13652
13987
|
{
|
|
13653
13988
|
title: "Add New Server",
|
|
@@ -13661,11 +13996,11 @@ QUEUE_NAME=tasks`,
|
|
|
13661
13996
|
},
|
|
13662
13997
|
confirmLoading: addingServer,
|
|
13663
13998
|
className: styles.addServerModal,
|
|
13664
|
-
children: /* @__PURE__ */
|
|
13665
|
-
/* @__PURE__ */
|
|
13666
|
-
/* @__PURE__ */
|
|
13667
|
-
/* @__PURE__ */
|
|
13668
|
-
|
|
13999
|
+
children: /* @__PURE__ */ jsxs37(Space21, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
|
|
14000
|
+
/* @__PURE__ */ jsxs37("div", { children: [
|
|
14001
|
+
/* @__PURE__ */ jsx59(Text22, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server Name" }),
|
|
14002
|
+
/* @__PURE__ */ jsx59(
|
|
14003
|
+
Input6,
|
|
13669
14004
|
{
|
|
13670
14005
|
placeholder: "e.g., Production Server",
|
|
13671
14006
|
value: newServerName,
|
|
@@ -13673,12 +14008,12 @@ QUEUE_NAME=tasks`,
|
|
|
13673
14008
|
onPressEnter: handleAddServer
|
|
13674
14009
|
}
|
|
13675
14010
|
),
|
|
13676
|
-
/* @__PURE__ */
|
|
14011
|
+
/* @__PURE__ */ jsx59(Text22, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: Leave empty to use URL as name" })
|
|
13677
14012
|
] }),
|
|
13678
|
-
/* @__PURE__ */
|
|
13679
|
-
/* @__PURE__ */
|
|
13680
|
-
/* @__PURE__ */
|
|
13681
|
-
|
|
14013
|
+
/* @__PURE__ */ jsxs37("div", { children: [
|
|
14014
|
+
/* @__PURE__ */ jsx59(Text22, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server URL *" }),
|
|
14015
|
+
/* @__PURE__ */ jsx59(
|
|
14016
|
+
Input6,
|
|
13682
14017
|
{
|
|
13683
14018
|
placeholder: "e.g., http://localhost:4001",
|
|
13684
14019
|
value: newServerUrl,
|
|
@@ -13686,12 +14021,12 @@ QUEUE_NAME=tasks`,
|
|
|
13686
14021
|
onPressEnter: handleAddServer
|
|
13687
14022
|
}
|
|
13688
14023
|
),
|
|
13689
|
-
/* @__PURE__ */
|
|
14024
|
+
/* @__PURE__ */ jsx59(Text22, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Enter the full URL of the gateway server" })
|
|
13690
14025
|
] }),
|
|
13691
|
-
/* @__PURE__ */
|
|
13692
|
-
/* @__PURE__ */
|
|
13693
|
-
/* @__PURE__ */
|
|
13694
|
-
|
|
14026
|
+
/* @__PURE__ */ jsxs37("div", { children: [
|
|
14027
|
+
/* @__PURE__ */ jsx59(Text22, { strong: true, style: { display: "block", marginBottom: 8 }, children: "API Key" }),
|
|
14028
|
+
/* @__PURE__ */ jsx59(
|
|
14029
|
+
Input6.Password,
|
|
13695
14030
|
{
|
|
13696
14031
|
placeholder: "Optional: Enter API key for authentication",
|
|
13697
14032
|
value: newServerApiKey,
|
|
@@ -13699,7 +14034,7 @@ QUEUE_NAME=tasks`,
|
|
|
13699
14034
|
onPressEnter: handleAddServer
|
|
13700
14035
|
}
|
|
13701
14036
|
),
|
|
13702
|
-
/* @__PURE__ */
|
|
14037
|
+
/* @__PURE__ */ jsx59(Text22, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: API key for server authentication" })
|
|
13703
14038
|
] })
|
|
13704
14039
|
] })
|
|
13705
14040
|
}
|
|
@@ -13708,10 +14043,10 @@ QUEUE_NAME=tasks`,
|
|
|
13708
14043
|
};
|
|
13709
14044
|
|
|
13710
14045
|
// src/components/Chat/AgentServerSetting.tsx
|
|
13711
|
-
import { jsx as
|
|
14046
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
13712
14047
|
var AgentServerSetting = () => {
|
|
13713
14048
|
const { settingsModalOpen, setSettingsModalOpen } = useLatticeChatShellContext();
|
|
13714
|
-
return /* @__PURE__ */
|
|
14049
|
+
return /* @__PURE__ */ jsx60(
|
|
13715
14050
|
SettingsModal,
|
|
13716
14051
|
{
|
|
13717
14052
|
open: settingsModalOpen,
|
|
@@ -13721,10 +14056,10 @@ var AgentServerSetting = () => {
|
|
|
13721
14056
|
};
|
|
13722
14057
|
|
|
13723
14058
|
// src/components/Chat/LatticeChatShell.tsx
|
|
13724
|
-
import { jsx as
|
|
14059
|
+
import { jsx as jsx61, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
13725
14060
|
var LatticeChatShell = (props) => {
|
|
13726
14061
|
const { enableAssistantCreation, enableAssistantEditing, ...restProps } = props;
|
|
13727
|
-
return /* @__PURE__ */
|
|
14062
|
+
return /* @__PURE__ */ jsxs38(
|
|
13728
14063
|
LatticeChatShellContextProvider,
|
|
13729
14064
|
{
|
|
13730
14065
|
initialConfig: {
|
|
@@ -13733,8 +14068,8 @@ var LatticeChatShell = (props) => {
|
|
|
13733
14068
|
...restProps.initialConfig
|
|
13734
14069
|
},
|
|
13735
14070
|
children: [
|
|
13736
|
-
/* @__PURE__ */
|
|
13737
|
-
/* @__PURE__ */
|
|
14071
|
+
/* @__PURE__ */ jsx61(AssistantContextProvider, { autoLoad: true, initialAssistantId: restProps.initialConfig?.assistantId, children: /* @__PURE__ */ jsx61(ConversationContextProvider, { children: /* @__PURE__ */ jsx61(LatticeChatView, {}) }) }),
|
|
14072
|
+
/* @__PURE__ */ jsx61(AgentServerSetting, {})
|
|
13738
14073
|
]
|
|
13739
14074
|
}
|
|
13740
14075
|
);
|