@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.js
CHANGED
|
@@ -4267,7 +4267,7 @@ var AttachmentsCard = ({
|
|
|
4267
4267
|
const { config } = useLatticeChatShellContext();
|
|
4268
4268
|
const baseURL = config.baseURL;
|
|
4269
4269
|
const fileBaseURL = `${baseURL}/api/assistants/${assistantId}/threads/${threadId}/sandbox/downloadfile?path=`;
|
|
4270
|
-
const { Text:
|
|
4270
|
+
const { Text: Text23 } = import_antd10.Typography;
|
|
4271
4271
|
const [showAll, setShowAll] = (0, import_react18.useState)(false);
|
|
4272
4272
|
const { openSideApp } = useChatUIContext();
|
|
4273
4273
|
const getStyles = () => {
|
|
@@ -4342,7 +4342,7 @@ var AttachmentsCard = ({
|
|
|
4342
4342
|
);
|
|
4343
4343
|
};
|
|
4344
4344
|
const renderFileDescription = (item) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_antd10.Space, { direction: "vertical", size: size === "small" ? 2 : 4, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_antd10.Space, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4345
|
-
|
|
4345
|
+
Text23,
|
|
4346
4346
|
{
|
|
4347
4347
|
type: "secondary",
|
|
4348
4348
|
style: {
|
|
@@ -4416,7 +4416,7 @@ var AttachmentsCard = ({
|
|
|
4416
4416
|
}
|
|
4417
4417
|
),
|
|
4418
4418
|
item.files && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { paddingLeft: "12px" }, children: [
|
|
4419
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
4419
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text23, { type: "secondary", style: { fontSize: "12px" }, children: [
|
|
4420
4420
|
"\u5305\u542B\u6587\u4EF6(",
|
|
4421
4421
|
item.files.length,
|
|
4422
4422
|
")"
|
|
@@ -7329,17 +7329,17 @@ var AgentConversations = ({
|
|
|
7329
7329
|
};
|
|
7330
7330
|
|
|
7331
7331
|
// src/components/Chat/LatticeChatView.tsx
|
|
7332
|
-
var
|
|
7332
|
+
var import_react43 = require("react");
|
|
7333
7333
|
|
|
7334
7334
|
// src/components/Chat/ChatSidebar.tsx
|
|
7335
|
-
var
|
|
7336
|
-
var
|
|
7335
|
+
var import_react42 = require("react");
|
|
7336
|
+
var import_antd42 = require("antd");
|
|
7337
7337
|
var import_lucide_react = require("lucide-react");
|
|
7338
7338
|
var import_antd_style13 = require("antd-style");
|
|
7339
7339
|
|
|
7340
7340
|
// src/components/Chat/AssistantFlow.tsx
|
|
7341
|
-
var
|
|
7342
|
-
var
|
|
7341
|
+
var import_react34 = require("react");
|
|
7342
|
+
var import_react35 = require("@xyflow/react");
|
|
7343
7343
|
var import_style = require("@xyflow/react/dist/style.css");
|
|
7344
7344
|
|
|
7345
7345
|
// src/components/Chat/AssistantNode.tsx
|
|
@@ -7376,11 +7376,9 @@ var getBadgeColor = (id) => {
|
|
|
7376
7376
|
};
|
|
7377
7377
|
var AssistantNode = ({
|
|
7378
7378
|
data,
|
|
7379
|
-
selected
|
|
7380
|
-
id
|
|
7379
|
+
selected
|
|
7381
7380
|
}) => {
|
|
7382
7381
|
const { token } = import_antd31.theme.useToken();
|
|
7383
|
-
const { setNodes, fitView, getNodes } = (0, import_react30.useReactFlow)();
|
|
7384
7382
|
if (!data) {
|
|
7385
7383
|
return null;
|
|
7386
7384
|
}
|
|
@@ -7422,8 +7420,8 @@ var AssistantNode = ({
|
|
|
7422
7420
|
const getAgentTypeLabel = (type) => {
|
|
7423
7421
|
if (!type) return "";
|
|
7424
7422
|
const typeMap = {
|
|
7425
|
-
react: "
|
|
7426
|
-
deep_agent: "
|
|
7423
|
+
react: "Executor",
|
|
7424
|
+
deep_agent: "Orchestrator",
|
|
7427
7425
|
plan_execute: "PLAN EXECUTE",
|
|
7428
7426
|
sequential: "SEQUENTIAL"
|
|
7429
7427
|
};
|
|
@@ -7820,62 +7818,6 @@ var AssistantNode = ({
|
|
|
7820
7818
|
e.currentTarget.style.boxShadow = `0 1px 4px rgba(0, 0, 0, 0.08)`;
|
|
7821
7819
|
},
|
|
7822
7820
|
children: [
|
|
7823
|
-
onConfigure && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7824
|
-
"div",
|
|
7825
|
-
{
|
|
7826
|
-
onClick: (e) => {
|
|
7827
|
-
e.stopPropagation();
|
|
7828
|
-
setNodes(
|
|
7829
|
-
(nodes) => nodes.map((node) => ({
|
|
7830
|
-
...node,
|
|
7831
|
-
selected: node.id === id
|
|
7832
|
-
}))
|
|
7833
|
-
);
|
|
7834
|
-
const currentNode = getNodes().find((n) => n.id === id);
|
|
7835
|
-
if (currentNode) {
|
|
7836
|
-
fitView({
|
|
7837
|
-
nodes: [currentNode],
|
|
7838
|
-
duration: 400,
|
|
7839
|
-
minZoom: 0.5,
|
|
7840
|
-
maxZoom: 1.5
|
|
7841
|
-
});
|
|
7842
|
-
}
|
|
7843
|
-
onConfigure?.(assistant);
|
|
7844
|
-
},
|
|
7845
|
-
style: {
|
|
7846
|
-
position: "absolute",
|
|
7847
|
-
top: 8,
|
|
7848
|
-
right: 8,
|
|
7849
|
-
zIndex: 10,
|
|
7850
|
-
cursor: "pointer",
|
|
7851
|
-
padding: 6,
|
|
7852
|
-
borderRadius: 6,
|
|
7853
|
-
background: token.colorBgContainer,
|
|
7854
|
-
display: "flex",
|
|
7855
|
-
alignItems: "center",
|
|
7856
|
-
justifyContent: "center",
|
|
7857
|
-
transition: "all 0.2s ease",
|
|
7858
|
-
border: `1px solid ${token.colorBorderSecondary}`
|
|
7859
|
-
},
|
|
7860
|
-
onMouseEnter: (e) => {
|
|
7861
|
-
e.currentTarget.style.background = token.colorPrimaryBg;
|
|
7862
|
-
e.currentTarget.style.borderColor = token.colorPrimary;
|
|
7863
|
-
},
|
|
7864
|
-
onMouseLeave: (e) => {
|
|
7865
|
-
e.currentTarget.style.background = token.colorBgContainer;
|
|
7866
|
-
e.currentTarget.style.borderColor = token.colorBorderSecondary;
|
|
7867
|
-
},
|
|
7868
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7869
|
-
import_icons18.EditOutlined,
|
|
7870
|
-
{
|
|
7871
|
-
style: {
|
|
7872
|
-
fontSize: 14,
|
|
7873
|
-
color: token.colorPrimary
|
|
7874
|
-
}
|
|
7875
|
-
}
|
|
7876
|
-
)
|
|
7877
|
-
}
|
|
7878
|
-
),
|
|
7879
7821
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
7880
7822
|
"div",
|
|
7881
7823
|
{
|
|
@@ -8136,14 +8078,11 @@ var AssistantNode = ({
|
|
|
8136
8078
|
onChat && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
8137
8079
|
"div",
|
|
8138
8080
|
{
|
|
8081
|
+
onMouseDown: (e) => {
|
|
8082
|
+
e.stopPropagation();
|
|
8083
|
+
},
|
|
8139
8084
|
onClick: (e) => {
|
|
8140
8085
|
e.stopPropagation();
|
|
8141
|
-
setNodes(
|
|
8142
|
-
(nodes) => nodes.map((node) => ({
|
|
8143
|
-
...node,
|
|
8144
|
-
selected: node.id === id
|
|
8145
|
-
}))
|
|
8146
|
-
);
|
|
8147
8086
|
onChat(assistant);
|
|
8148
8087
|
},
|
|
8149
8088
|
style: {
|
|
@@ -8998,8 +8937,8 @@ var AgentConfigPanel = ({
|
|
|
8998
8937
|
value: agentType,
|
|
8999
8938
|
onChange: (value) => setAgentType(value),
|
|
9000
8939
|
options: [
|
|
9001
|
-
{ value: "react", label: "
|
|
9002
|
-
{ value: "deep_agent", label: "
|
|
8940
|
+
{ value: "react", label: "Executor" },
|
|
8941
|
+
{ value: "deep_agent", label: "Orchestrator" }
|
|
9003
8942
|
],
|
|
9004
8943
|
block: true
|
|
9005
8944
|
}
|
|
@@ -9009,7 +8948,7 @@ var AgentConfigPanel = ({
|
|
|
9009
8948
|
{
|
|
9010
8949
|
type: "secondary",
|
|
9011
8950
|
style: { fontSize: 11, marginTop: 6, display: "block", lineHeight: 1.4 },
|
|
9012
|
-
children: agentType === "react" ? "
|
|
8951
|
+
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."
|
|
9013
8952
|
}
|
|
9014
8953
|
)
|
|
9015
8954
|
]
|
|
@@ -9344,47 +9283,328 @@ var AgentConfigPanel = ({
|
|
|
9344
9283
|
var AgentConfigPanel_default = AgentConfigPanel;
|
|
9345
9284
|
|
|
9346
9285
|
// src/components/Chat/CreateAssistantModal.tsx
|
|
9286
|
+
var import_react33 = require("react");
|
|
9287
|
+
var import_antd35 = require("antd");
|
|
9288
|
+
var import_icons21 = require("@ant-design/icons");
|
|
9289
|
+
|
|
9290
|
+
// src/components/Chat/ParentAgentSelector.tsx
|
|
9347
9291
|
var import_react32 = require("react");
|
|
9348
9292
|
var import_antd33 = require("antd");
|
|
9349
|
-
var import_icons20 = require("@ant-design/icons");
|
|
9350
9293
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
9351
|
-
var { TextArea: TextArea2 } = import_antd33.Input;
|
|
9352
9294
|
var { Text: Text17 } = import_antd33.Typography;
|
|
9295
|
+
var ParentAgentSelector = ({
|
|
9296
|
+
onSelect,
|
|
9297
|
+
value,
|
|
9298
|
+
placeholder = "Select a parent agent to extend..."
|
|
9299
|
+
}) => {
|
|
9300
|
+
const { config } = useLatticeChatShellContext();
|
|
9301
|
+
const [assistants, setAssistants] = (0, import_react32.useState)([]);
|
|
9302
|
+
const [loading, setLoading] = (0, import_react32.useState)(false);
|
|
9303
|
+
(0, import_react32.useEffect)(() => {
|
|
9304
|
+
const fetchAssistants = async () => {
|
|
9305
|
+
setLoading(true);
|
|
9306
|
+
try {
|
|
9307
|
+
const headers = {
|
|
9308
|
+
"Content-Type": "application/json"
|
|
9309
|
+
};
|
|
9310
|
+
if (config.apiKey) {
|
|
9311
|
+
headers["Authorization"] = `Bearer ${config.apiKey}`;
|
|
9312
|
+
}
|
|
9313
|
+
const response = await fetch(`${config.baseURL}/api/assistants`, {
|
|
9314
|
+
method: "GET",
|
|
9315
|
+
headers
|
|
9316
|
+
});
|
|
9317
|
+
const data = await response.json();
|
|
9318
|
+
if (response.ok && data.success) {
|
|
9319
|
+
setAssistants(data.data.records || []);
|
|
9320
|
+
}
|
|
9321
|
+
} catch (error) {
|
|
9322
|
+
console.error("Failed to fetch assistants:", error);
|
|
9323
|
+
} finally {
|
|
9324
|
+
setLoading(false);
|
|
9325
|
+
}
|
|
9326
|
+
};
|
|
9327
|
+
fetchAssistants();
|
|
9328
|
+
}, [config.baseURL, config.apiKey]);
|
|
9329
|
+
const handleChange = (selectedId) => {
|
|
9330
|
+
if (!selectedId) {
|
|
9331
|
+
onSelect(null);
|
|
9332
|
+
return;
|
|
9333
|
+
}
|
|
9334
|
+
const selected = assistants.find((a) => a.id === selectedId);
|
|
9335
|
+
onSelect(selected || null);
|
|
9336
|
+
};
|
|
9337
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9338
|
+
import_antd33.Select,
|
|
9339
|
+
{
|
|
9340
|
+
showSearch: true,
|
|
9341
|
+
allowClear: true,
|
|
9342
|
+
value,
|
|
9343
|
+
placeholder,
|
|
9344
|
+
loading,
|
|
9345
|
+
onChange: handleChange,
|
|
9346
|
+
optionFilterProp: "label",
|
|
9347
|
+
style: { width: "100%" },
|
|
9348
|
+
options: assistants.map((assistant) => ({
|
|
9349
|
+
value: assistant.id,
|
|
9350
|
+
label: assistant.name || assistant.id,
|
|
9351
|
+
description: assistant.description
|
|
9352
|
+
})),
|
|
9353
|
+
optionRender: (option) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { children: [
|
|
9354
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { children: option.label }),
|
|
9355
|
+
option.data.description && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Text17, { type: "secondary", style: { fontSize: 12 }, children: option.data.description })
|
|
9356
|
+
] })
|
|
9357
|
+
}
|
|
9358
|
+
);
|
|
9359
|
+
};
|
|
9360
|
+
|
|
9361
|
+
// src/components/Chat/SubAgentInheritList.tsx
|
|
9362
|
+
var import_antd34 = require("antd");
|
|
9363
|
+
var import_icons20 = require("@ant-design/icons");
|
|
9364
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
9365
|
+
var { Text: Text18 } = import_antd34.Typography;
|
|
9366
|
+
var SubAgentInheritList = ({
|
|
9367
|
+
subAgentKeys,
|
|
9368
|
+
decisions,
|
|
9369
|
+
onChange
|
|
9370
|
+
}) => {
|
|
9371
|
+
const { token } = import_antd34.theme.useToken();
|
|
9372
|
+
const handleToggle = (key, clone) => {
|
|
9373
|
+
const updated = decisions.map(
|
|
9374
|
+
(d) => d.originalKey === key ? { ...d, clone, cloneKey: clone ? `${key}_clone` : void 0 } : d
|
|
9375
|
+
);
|
|
9376
|
+
onChange(updated);
|
|
9377
|
+
};
|
|
9378
|
+
const handleCloneKeyChange = (originalKey, cloneKey) => {
|
|
9379
|
+
const updated = decisions.map(
|
|
9380
|
+
(d) => d.originalKey === originalKey ? { ...d, cloneKey } : d
|
|
9381
|
+
);
|
|
9382
|
+
onChange(updated);
|
|
9383
|
+
};
|
|
9384
|
+
if (subAgentKeys.length === 0) {
|
|
9385
|
+
return null;
|
|
9386
|
+
}
|
|
9387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { children: [
|
|
9388
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Text18, { type: "secondary", style: { display: "block", marginBottom: 8 }, children: "Choose how to handle each sub-agent from the parent:" }),
|
|
9389
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
9390
|
+
import_antd34.List,
|
|
9391
|
+
{
|
|
9392
|
+
size: "small",
|
|
9393
|
+
bordered: true,
|
|
9394
|
+
dataSource: decisions,
|
|
9395
|
+
style: { borderRadius: token.borderRadius },
|
|
9396
|
+
renderItem: (decision) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
9397
|
+
import_antd34.List.Item,
|
|
9398
|
+
{
|
|
9399
|
+
style: {
|
|
9400
|
+
display: "flex",
|
|
9401
|
+
flexDirection: "column",
|
|
9402
|
+
alignItems: "stretch",
|
|
9403
|
+
gap: 8,
|
|
9404
|
+
padding: "8px 16px"
|
|
9405
|
+
},
|
|
9406
|
+
children: [
|
|
9407
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
9408
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
9409
|
+
decision.clone ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_icons20.ForkOutlined, { style: { color: token.colorPrimary } }) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_icons20.LinkOutlined, { style: { color: token.colorTextSecondary } }),
|
|
9410
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Text18, { style: { fontFamily: "monospace" }, children: decision.originalKey })
|
|
9411
|
+
] }),
|
|
9412
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
9413
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_antd34.Tag, { color: decision.clone ? "blue" : "default", children: decision.clone ? "Clone as new" : "Reuse" }),
|
|
9414
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
9415
|
+
import_antd34.Switch,
|
|
9416
|
+
{
|
|
9417
|
+
size: "small",
|
|
9418
|
+
checked: decision.clone,
|
|
9419
|
+
onChange: (checked) => handleToggle(decision.originalKey, checked)
|
|
9420
|
+
}
|
|
9421
|
+
)
|
|
9422
|
+
] })
|
|
9423
|
+
] }),
|
|
9424
|
+
decision.clone && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
9425
|
+
import_antd34.Input,
|
|
9426
|
+
{
|
|
9427
|
+
size: "small",
|
|
9428
|
+
placeholder: "Enter key for the cloned agent",
|
|
9429
|
+
value: decision.cloneKey,
|
|
9430
|
+
onChange: (e) => handleCloneKeyChange(decision.originalKey, e.target.value),
|
|
9431
|
+
style: { fontFamily: "monospace", fontSize: 12 },
|
|
9432
|
+
addonBefore: "Key"
|
|
9433
|
+
}
|
|
9434
|
+
)
|
|
9435
|
+
]
|
|
9436
|
+
}
|
|
9437
|
+
)
|
|
9438
|
+
}
|
|
9439
|
+
)
|
|
9440
|
+
] });
|
|
9441
|
+
};
|
|
9442
|
+
|
|
9443
|
+
// src/components/Chat/CreateAssistantModal.tsx
|
|
9444
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
9445
|
+
var { TextArea: TextArea2 } = import_antd35.Input;
|
|
9446
|
+
var { Text: Text19 } = import_antd35.Typography;
|
|
9353
9447
|
var CreateAssistantModal = ({
|
|
9354
9448
|
open,
|
|
9355
9449
|
onCancel,
|
|
9356
9450
|
onSuccess
|
|
9357
9451
|
}) => {
|
|
9358
|
-
const [form] =
|
|
9359
|
-
const [loading, setLoading] = (0,
|
|
9452
|
+
const [form] = import_antd35.Form.useForm();
|
|
9453
|
+
const [loading, setLoading] = (0, import_react33.useState)(false);
|
|
9454
|
+
const [creationMode, setCreationMode] = (0, import_react33.useState)("scratch");
|
|
9455
|
+
const [parentAssistant, setParentAssistant] = (0, import_react33.useState)(null);
|
|
9456
|
+
const [subAgentDecisions, setSubAgentDecisions] = (0, import_react33.useState)([]);
|
|
9360
9457
|
const { config } = useLatticeChatShellContext();
|
|
9361
|
-
const { token } =
|
|
9458
|
+
const { token } = import_antd35.theme.useToken();
|
|
9459
|
+
const getHeaders = (0, import_react33.useCallback)(() => {
|
|
9460
|
+
const headers = { "Content-Type": "application/json" };
|
|
9461
|
+
if (config.apiKey) {
|
|
9462
|
+
headers["Authorization"] = `Bearer ${config.apiKey}`;
|
|
9463
|
+
}
|
|
9464
|
+
return headers;
|
|
9465
|
+
}, [config.apiKey]);
|
|
9466
|
+
const resetExtendState = (0, import_react33.useCallback)(() => {
|
|
9467
|
+
setParentAssistant(null);
|
|
9468
|
+
setSubAgentDecisions([]);
|
|
9469
|
+
}, []);
|
|
9470
|
+
const handleParentSelect = (0, import_react33.useCallback)(
|
|
9471
|
+
(assistant) => {
|
|
9472
|
+
setParentAssistant(assistant);
|
|
9473
|
+
if (!assistant) {
|
|
9474
|
+
form.resetFields(["key", "name", "description", "type", "prompt"]);
|
|
9475
|
+
setSubAgentDecisions([]);
|
|
9476
|
+
return;
|
|
9477
|
+
}
|
|
9478
|
+
const graphDef = typeof assistant.graphDefinition === "object" && assistant.graphDefinition !== null ? assistant.graphDefinition : {};
|
|
9479
|
+
const parentKey = graphDef.key || assistant.id;
|
|
9480
|
+
const parentName = assistant.name || graphDef.name || "";
|
|
9481
|
+
form.setFieldsValue({
|
|
9482
|
+
key: `${parentKey}_ext`,
|
|
9483
|
+
name: parentName ? `${parentName} (Extended)` : "",
|
|
9484
|
+
description: assistant.description || graphDef.description || "",
|
|
9485
|
+
type: graphDef.type || "react",
|
|
9486
|
+
prompt: graphDef.prompt || ""
|
|
9487
|
+
});
|
|
9488
|
+
const parentSubAgents2 = graphDef.subAgents || [];
|
|
9489
|
+
setSubAgentDecisions(
|
|
9490
|
+
parentSubAgents2.map((key) => ({ originalKey: key, clone: false }))
|
|
9491
|
+
);
|
|
9492
|
+
},
|
|
9493
|
+
[form]
|
|
9494
|
+
);
|
|
9495
|
+
const handleModeChange = (0, import_react33.useCallback)(
|
|
9496
|
+
(mode) => {
|
|
9497
|
+
setCreationMode(mode);
|
|
9498
|
+
if (mode === "scratch") {
|
|
9499
|
+
resetExtendState();
|
|
9500
|
+
form.resetFields();
|
|
9501
|
+
}
|
|
9502
|
+
},
|
|
9503
|
+
[form, resetExtendState]
|
|
9504
|
+
);
|
|
9505
|
+
const cloneSubAgent = async (originalKey, newKey, headers) => {
|
|
9506
|
+
const getResponse = await fetch(
|
|
9507
|
+
`${config.baseURL}/api/assistants/${originalKey}`,
|
|
9508
|
+
{ method: "GET", headers }
|
|
9509
|
+
);
|
|
9510
|
+
const getData = await getResponse.json();
|
|
9511
|
+
if (!getResponse.ok || !getData.success) {
|
|
9512
|
+
throw new Error(`Failed to fetch sub-agent "${originalKey}" for cloning`);
|
|
9513
|
+
}
|
|
9514
|
+
const originalAssistant = getData.data;
|
|
9515
|
+
const originalGraphDef = typeof originalAssistant.graphDefinition === "object" ? originalAssistant.graphDefinition : {};
|
|
9516
|
+
const cloneBody = {
|
|
9517
|
+
id: newKey,
|
|
9518
|
+
name: `${originalAssistant.name} (Clone)`,
|
|
9519
|
+
description: originalAssistant.description || "",
|
|
9520
|
+
graphDefinition: {
|
|
9521
|
+
...originalGraphDef,
|
|
9522
|
+
key: newKey,
|
|
9523
|
+
name: `${originalAssistant.name} (Clone)`
|
|
9524
|
+
}
|
|
9525
|
+
};
|
|
9526
|
+
const createResponse = await fetch(`${config.baseURL}/api/assistants`, {
|
|
9527
|
+
method: "POST",
|
|
9528
|
+
headers,
|
|
9529
|
+
body: JSON.stringify(cloneBody)
|
|
9530
|
+
});
|
|
9531
|
+
const createData = await createResponse.json();
|
|
9532
|
+
if (!createResponse.ok || !createData.success) {
|
|
9533
|
+
throw new Error(`Failed to clone sub-agent "${originalKey}"`);
|
|
9534
|
+
}
|
|
9535
|
+
return createData.data;
|
|
9536
|
+
};
|
|
9537
|
+
const buildScratchBody = (values) => ({
|
|
9538
|
+
id: values.key,
|
|
9539
|
+
name: values.name,
|
|
9540
|
+
description: values.description || "",
|
|
9541
|
+
graphDefinition: {
|
|
9542
|
+
key: values.key,
|
|
9543
|
+
name: values.name,
|
|
9544
|
+
description: values.description || "",
|
|
9545
|
+
type: values.type,
|
|
9546
|
+
prompt: values.prompt || "",
|
|
9547
|
+
tools: [],
|
|
9548
|
+
skills: [],
|
|
9549
|
+
subAgents: values.type === "deep_agent" ? [] : void 0,
|
|
9550
|
+
middleware: []
|
|
9551
|
+
}
|
|
9552
|
+
});
|
|
9553
|
+
const buildExtendBody = async (values, headers, createdAssistants) => {
|
|
9554
|
+
if (!parentAssistant) {
|
|
9555
|
+
throw new Error("No parent agent selected");
|
|
9556
|
+
}
|
|
9557
|
+
const cloneDecisions = subAgentDecisions.filter((d) => d.clone);
|
|
9558
|
+
for (const decision of cloneDecisions) {
|
|
9559
|
+
if (!decision.cloneKey || !decision.cloneKey.trim()) {
|
|
9560
|
+
throw new Error(
|
|
9561
|
+
`Please provide a key for the cloned sub-agent "${decision.originalKey}"`
|
|
9562
|
+
);
|
|
9563
|
+
}
|
|
9564
|
+
if (!/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(decision.cloneKey)) {
|
|
9565
|
+
throw new Error(
|
|
9566
|
+
`Invalid key "${decision.cloneKey}" for cloned sub-agent "${decision.originalKey}". Key must start with a letter and contain only letters, numbers, underscores, or hyphens.`
|
|
9567
|
+
);
|
|
9568
|
+
}
|
|
9569
|
+
}
|
|
9570
|
+
const resolvedSubAgents = [];
|
|
9571
|
+
for (const decision of subAgentDecisions) {
|
|
9572
|
+
if (decision.clone) {
|
|
9573
|
+
const clonedAssistant = await cloneSubAgent(decision.originalKey, decision.cloneKey, headers);
|
|
9574
|
+
createdAssistants.push(clonedAssistant);
|
|
9575
|
+
resolvedSubAgents.push(decision.cloneKey);
|
|
9576
|
+
} else {
|
|
9577
|
+
resolvedSubAgents.push(decision.originalKey);
|
|
9578
|
+
}
|
|
9579
|
+
}
|
|
9580
|
+
const parentGraphDef = typeof parentAssistant.graphDefinition === "object" ? parentAssistant.graphDefinition : {};
|
|
9581
|
+
const graphDefinition = {
|
|
9582
|
+
key: values.key,
|
|
9583
|
+
name: values.name,
|
|
9584
|
+
description: values.description || "",
|
|
9585
|
+
extendsAgent: parentAssistant.id,
|
|
9586
|
+
type: values.type || parentGraphDef.type
|
|
9587
|
+
};
|
|
9588
|
+
if (values.prompt && values.prompt !== parentGraphDef.prompt) {
|
|
9589
|
+
graphDefinition.prompt = values.prompt;
|
|
9590
|
+
}
|
|
9591
|
+
if (resolvedSubAgents.length > 0 || parentGraphDef.subAgents && parentGraphDef.subAgents.length > 0) {
|
|
9592
|
+
graphDefinition.subAgents = resolvedSubAgents;
|
|
9593
|
+
}
|
|
9594
|
+
return {
|
|
9595
|
+
id: values.key,
|
|
9596
|
+
name: values.name,
|
|
9597
|
+
description: values.description || "",
|
|
9598
|
+
graphDefinition
|
|
9599
|
+
};
|
|
9600
|
+
};
|
|
9362
9601
|
const handleSubmit = async () => {
|
|
9363
9602
|
try {
|
|
9364
9603
|
const values = await form.validateFields();
|
|
9365
9604
|
setLoading(true);
|
|
9366
|
-
const headers =
|
|
9367
|
-
|
|
9368
|
-
|
|
9369
|
-
if (config.apiKey) {
|
|
9370
|
-
headers["Authorization"] = `Bearer ${config.apiKey}`;
|
|
9371
|
-
}
|
|
9372
|
-
const requestBody = {
|
|
9373
|
-
id: values.key,
|
|
9374
|
-
name: values.name,
|
|
9375
|
-
description: values.description || "",
|
|
9376
|
-
graphDefinition: {
|
|
9377
|
-
key: values.key,
|
|
9378
|
-
name: values.name,
|
|
9379
|
-
description: values.description || "",
|
|
9380
|
-
type: values.type,
|
|
9381
|
-
prompt: values.prompt || "",
|
|
9382
|
-
tools: [],
|
|
9383
|
-
skills: [],
|
|
9384
|
-
subAgents: values.type === "deep_agent" ? [] : void 0,
|
|
9385
|
-
middleware: []
|
|
9386
|
-
}
|
|
9387
|
-
};
|
|
9605
|
+
const headers = getHeaders();
|
|
9606
|
+
const createdAssistants = [];
|
|
9607
|
+
const requestBody = creationMode === "scratch" ? buildScratchBody(values) : await buildExtendBody(values, headers, createdAssistants);
|
|
9388
9608
|
const response = await fetch(`${config.baseURL}/api/assistants`, {
|
|
9389
9609
|
method: "POST",
|
|
9390
9610
|
headers,
|
|
@@ -9392,170 +9612,284 @@ var CreateAssistantModal = ({
|
|
|
9392
9612
|
});
|
|
9393
9613
|
const data = await response.json();
|
|
9394
9614
|
if (response.ok && data.success) {
|
|
9395
|
-
|
|
9615
|
+
import_antd35.notification.success({
|
|
9396
9616
|
message: "Created",
|
|
9397
|
-
description: "Assistant created successfully"
|
|
9617
|
+
description: creationMode === "extend" ? `Assistant created by extending "${parentAssistant?.name}"` : "Assistant created successfully"
|
|
9398
9618
|
});
|
|
9399
9619
|
form.resetFields();
|
|
9620
|
+
resetExtendState();
|
|
9621
|
+
setCreationMode("scratch");
|
|
9622
|
+
for (const clonedAssistant of createdAssistants) {
|
|
9623
|
+
onSuccess?.(clonedAssistant);
|
|
9624
|
+
}
|
|
9400
9625
|
onSuccess?.(data.data);
|
|
9401
9626
|
onCancel();
|
|
9402
9627
|
} else {
|
|
9403
|
-
|
|
9628
|
+
import_antd35.message.error(data.message || "Failed to create assistant");
|
|
9404
9629
|
}
|
|
9405
9630
|
} catch (error) {
|
|
9406
9631
|
if (error.errorFields) {
|
|
9407
9632
|
return;
|
|
9408
9633
|
}
|
|
9409
|
-
|
|
9634
|
+
import_antd35.message.error(
|
|
9635
|
+
error.message || "An error occurred while creating the assistant"
|
|
9636
|
+
);
|
|
9410
9637
|
} finally {
|
|
9411
9638
|
setLoading(false);
|
|
9412
9639
|
}
|
|
9413
9640
|
};
|
|
9414
|
-
|
|
9415
|
-
|
|
9641
|
+
const parentSubAgents = parentAssistant?.graphDefinition?.subAgents || [];
|
|
9642
|
+
const showSubAgentList = creationMode === "extend" && parentAssistant && parentSubAgents.length > 0;
|
|
9643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
9644
|
+
import_antd35.Modal,
|
|
9416
9645
|
{
|
|
9417
9646
|
title: "Create New Assistant",
|
|
9418
9647
|
open,
|
|
9419
|
-
onCancel
|
|
9648
|
+
onCancel: () => {
|
|
9649
|
+
resetExtendState();
|
|
9650
|
+
setCreationMode("scratch");
|
|
9651
|
+
onCancel();
|
|
9652
|
+
},
|
|
9420
9653
|
footer: [
|
|
9421
|
-
/* @__PURE__ */ (0,
|
|
9422
|
-
|
|
9423
|
-
|
|
9654
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
9655
|
+
import_antd35.Button,
|
|
9656
|
+
{
|
|
9657
|
+
onClick: () => {
|
|
9658
|
+
resetExtendState();
|
|
9659
|
+
setCreationMode("scratch");
|
|
9660
|
+
onCancel();
|
|
9661
|
+
},
|
|
9662
|
+
children: "Cancel"
|
|
9663
|
+
},
|
|
9664
|
+
"cancel"
|
|
9665
|
+
),
|
|
9666
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
9667
|
+
import_antd35.Button,
|
|
9424
9668
|
{
|
|
9425
9669
|
type: "primary",
|
|
9426
|
-
icon: /* @__PURE__ */ (0,
|
|
9670
|
+
icon: creationMode === "extend" ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_icons21.ForkOutlined, {}) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_icons21.PlusOutlined, {}),
|
|
9427
9671
|
loading,
|
|
9428
9672
|
onClick: handleSubmit,
|
|
9429
|
-
children: "Create"
|
|
9673
|
+
children: creationMode === "extend" ? "Create (Extend)" : "Create"
|
|
9430
9674
|
},
|
|
9431
9675
|
"submit"
|
|
9432
9676
|
)
|
|
9433
9677
|
],
|
|
9434
9678
|
width: 600,
|
|
9435
|
-
children:
|
|
9436
|
-
|
|
9437
|
-
|
|
9438
|
-
|
|
9439
|
-
|
|
9440
|
-
|
|
9441
|
-
|
|
9442
|
-
|
|
9443
|
-
|
|
9444
|
-
|
|
9445
|
-
|
|
9446
|
-
|
|
9447
|
-
|
|
9448
|
-
|
|
9449
|
-
|
|
9450
|
-
|
|
9451
|
-
|
|
9452
|
-
|
|
9453
|
-
|
|
9454
|
-
|
|
9455
|
-
|
|
9456
|
-
|
|
9457
|
-
|
|
9458
|
-
|
|
9459
|
-
|
|
9460
|
-
|
|
9461
|
-
|
|
9462
|
-
|
|
9463
|
-
|
|
9464
|
-
|
|
9465
|
-
|
|
9466
|
-
|
|
9467
|
-
|
|
9468
|
-
|
|
9469
|
-
|
|
9470
|
-
|
|
9471
|
-
|
|
9472
|
-
|
|
9473
|
-
|
|
9474
|
-
|
|
9475
|
-
|
|
9476
|
-
|
|
9477
|
-
|
|
9478
|
-
|
|
9479
|
-
|
|
9480
|
-
|
|
9481
|
-
|
|
9482
|
-
|
|
9483
|
-
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
-
|
|
9487
|
-
|
|
9488
|
-
|
|
9489
|
-
|
|
9490
|
-
|
|
9491
|
-
|
|
9492
|
-
|
|
9493
|
-
|
|
9494
|
-
|
|
9495
|
-
|
|
9496
|
-
|
|
9497
|
-
|
|
9498
|
-
|
|
9499
|
-
|
|
9500
|
-
|
|
9501
|
-
|
|
9502
|
-
import_antd33.Form.Item,
|
|
9503
|
-
{
|
|
9504
|
-
name: "prompt",
|
|
9505
|
-
label: "System Prompt",
|
|
9506
|
-
rules: [{ required: true, message: "Please enter a system prompt" }],
|
|
9507
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9508
|
-
TextArea2,
|
|
9509
|
-
{
|
|
9510
|
-
placeholder: "Enter the system prompt for this agent...",
|
|
9511
|
-
autoSize: { minRows: 4, maxRows: 8 },
|
|
9512
|
-
style: {
|
|
9513
|
-
fontFamily: "monospace",
|
|
9514
|
-
fontSize: 13,
|
|
9515
|
-
lineHeight: 1.6
|
|
9679
|
+
children: [
|
|
9680
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { style: { marginBottom: 20 }, children: [
|
|
9681
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
9682
|
+
Text19,
|
|
9683
|
+
{
|
|
9684
|
+
type: "secondary",
|
|
9685
|
+
style: { display: "block", marginBottom: 8 },
|
|
9686
|
+
children: "Creation Mode"
|
|
9687
|
+
}
|
|
9688
|
+
),
|
|
9689
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
9690
|
+
import_antd35.Segmented,
|
|
9691
|
+
{
|
|
9692
|
+
value: creationMode,
|
|
9693
|
+
onChange: handleModeChange,
|
|
9694
|
+
options: [
|
|
9695
|
+
{ value: "scratch", label: "From Scratch" },
|
|
9696
|
+
{ value: "extend", label: "Extend Existing Agent" }
|
|
9697
|
+
],
|
|
9698
|
+
block: true
|
|
9699
|
+
}
|
|
9700
|
+
)
|
|
9701
|
+
] }),
|
|
9702
|
+
creationMode === "extend" && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { style: { marginBottom: 20 }, children: [
|
|
9703
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
9704
|
+
Text19,
|
|
9705
|
+
{
|
|
9706
|
+
type: "secondary",
|
|
9707
|
+
style: { display: "block", marginBottom: 8 },
|
|
9708
|
+
children: "Parent Agent"
|
|
9709
|
+
}
|
|
9710
|
+
),
|
|
9711
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
9712
|
+
ParentAgentSelector,
|
|
9713
|
+
{
|
|
9714
|
+
value: parentAssistant?.id,
|
|
9715
|
+
onSelect: handleParentSelect
|
|
9716
|
+
}
|
|
9717
|
+
),
|
|
9718
|
+
parentAssistant && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
9719
|
+
Text19,
|
|
9720
|
+
{
|
|
9721
|
+
type: "secondary",
|
|
9722
|
+
style: { display: "block", marginTop: 4, fontSize: 12 },
|
|
9723
|
+
children: "Fields left unchanged will be inherited from the parent agent."
|
|
9724
|
+
}
|
|
9725
|
+
)
|
|
9726
|
+
] }),
|
|
9727
|
+
creationMode === "extend" && parentAssistant && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_antd35.Divider, { style: { margin: "12px 0" } }),
|
|
9728
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
9729
|
+
import_antd35.Form,
|
|
9730
|
+
{
|
|
9731
|
+
form,
|
|
9732
|
+
layout: "vertical",
|
|
9733
|
+
autoComplete: "off",
|
|
9734
|
+
initialValues: { type: "react" },
|
|
9735
|
+
children: [
|
|
9736
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
9737
|
+
import_antd35.Form.Item,
|
|
9738
|
+
{
|
|
9739
|
+
name: "key",
|
|
9740
|
+
label: "Key (ID)",
|
|
9741
|
+
rules: [
|
|
9742
|
+
{ required: true, message: "Please enter a unique key" },
|
|
9743
|
+
{
|
|
9744
|
+
pattern: /^[a-zA-Z][a-zA-Z0-9_-]*$/,
|
|
9745
|
+
message: "Key must start with a letter and contain only letters, numbers, underscores, or hyphens"
|
|
9516
9746
|
}
|
|
9517
|
-
|
|
9518
|
-
|
|
9519
|
-
|
|
9520
|
-
|
|
9521
|
-
|
|
9522
|
-
|
|
9523
|
-
|
|
9747
|
+
],
|
|
9748
|
+
style: { marginBottom: 16 },
|
|
9749
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_antd35.Input, { placeholder: "e.g., my_assistant" })
|
|
9750
|
+
}
|
|
9751
|
+
),
|
|
9752
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
9753
|
+
import_antd35.Form.Item,
|
|
9754
|
+
{
|
|
9755
|
+
name: "name",
|
|
9756
|
+
label: "Name",
|
|
9757
|
+
rules: [{ required: true, message: "Please enter a name" }],
|
|
9758
|
+
style: { marginBottom: 16 },
|
|
9759
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_antd35.Input, { placeholder: "e.g., My Assistant" })
|
|
9760
|
+
}
|
|
9761
|
+
),
|
|
9762
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
9763
|
+
import_antd35.Form.Item,
|
|
9764
|
+
{
|
|
9765
|
+
name: "description",
|
|
9766
|
+
label: "Description",
|
|
9767
|
+
rules: [
|
|
9768
|
+
{ required: true, message: "Please enter a description" }
|
|
9769
|
+
],
|
|
9770
|
+
style: { marginBottom: 16 },
|
|
9771
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
9772
|
+
TextArea2,
|
|
9773
|
+
{
|
|
9774
|
+
placeholder: "Enter a description for this assistant...",
|
|
9775
|
+
autoSize: { minRows: 2, maxRows: 4 }
|
|
9776
|
+
}
|
|
9777
|
+
)
|
|
9778
|
+
}
|
|
9779
|
+
),
|
|
9780
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
9781
|
+
import_antd35.Form.Item,
|
|
9782
|
+
{
|
|
9783
|
+
name: "type",
|
|
9784
|
+
label: "Agent Type",
|
|
9785
|
+
rules: [{ required: true }],
|
|
9786
|
+
style: { marginBottom: 16 },
|
|
9787
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
9788
|
+
import_antd35.Segmented,
|
|
9789
|
+
{
|
|
9790
|
+
options: [
|
|
9791
|
+
{ value: "react", label: "Executor" },
|
|
9792
|
+
{ value: "deep_agent", label: "Orchestrator" }
|
|
9793
|
+
],
|
|
9794
|
+
block: true
|
|
9795
|
+
}
|
|
9796
|
+
)
|
|
9797
|
+
}
|
|
9798
|
+
),
|
|
9799
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_antd35.Form.Item, { noStyle: true, shouldUpdate: (prev, cur) => prev.type !== cur.type, children: () => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
9800
|
+
Text19,
|
|
9801
|
+
{
|
|
9802
|
+
type: "secondary",
|
|
9803
|
+
style: { fontSize: 12, display: "block", marginTop: -12, marginBottom: 16, lineHeight: 1.5 },
|
|
9804
|
+
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."
|
|
9805
|
+
}
|
|
9806
|
+
) }),
|
|
9807
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
9808
|
+
import_antd35.Form.Item,
|
|
9809
|
+
{
|
|
9810
|
+
name: "prompt",
|
|
9811
|
+
label: creationMode === "extend" && parentAssistant ? "System Prompt (leave unchanged to inherit from parent)" : "System Prompt",
|
|
9812
|
+
rules: creationMode === "scratch" ? [{ required: true, message: "Please enter a system prompt" }] : [],
|
|
9813
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
9814
|
+
TextArea2,
|
|
9815
|
+
{
|
|
9816
|
+
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...",
|
|
9817
|
+
autoSize: { minRows: 4, maxRows: 8 },
|
|
9818
|
+
style: {
|
|
9819
|
+
fontFamily: "monospace",
|
|
9820
|
+
fontSize: 13,
|
|
9821
|
+
lineHeight: 1.6
|
|
9822
|
+
}
|
|
9823
|
+
}
|
|
9824
|
+
)
|
|
9825
|
+
}
|
|
9826
|
+
)
|
|
9827
|
+
]
|
|
9828
|
+
}
|
|
9829
|
+
),
|
|
9830
|
+
showSubAgentList && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
9831
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_antd35.Divider, { style: { margin: "12px 0" } }),
|
|
9832
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Text19, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Sub-Agents" }),
|
|
9833
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
9834
|
+
SubAgentInheritList,
|
|
9835
|
+
{
|
|
9836
|
+
subAgentKeys: parentSubAgents,
|
|
9837
|
+
decisions: subAgentDecisions,
|
|
9838
|
+
onChange: setSubAgentDecisions
|
|
9839
|
+
}
|
|
9840
|
+
)
|
|
9841
|
+
] })
|
|
9842
|
+
]
|
|
9524
9843
|
}
|
|
9525
9844
|
);
|
|
9526
9845
|
};
|
|
9527
9846
|
var CreateAssistantModal_default = CreateAssistantModal;
|
|
9528
9847
|
|
|
9529
9848
|
// src/components/Chat/AssistantFlow.tsx
|
|
9530
|
-
var
|
|
9531
|
-
var
|
|
9532
|
-
var
|
|
9849
|
+
var import_antd36 = require("antd");
|
|
9850
|
+
var import_icons22 = require("@ant-design/icons");
|
|
9851
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
9533
9852
|
var AssistantFlowInner = ({ onChat }) => {
|
|
9534
|
-
const { setCenter, fitView } = (0,
|
|
9535
|
-
const [nodes, setNodes, onNodesChange] = (0,
|
|
9536
|
-
const [edges, setEdges, onEdgesChange] = (0,
|
|
9537
|
-
const [assistants, setAssistants] = (0,
|
|
9538
|
-
const [assistantsLoading, setAssistantsLoading] = (0,
|
|
9539
|
-
const [configPanelVisible, setConfigPanelVisible] = (0,
|
|
9540
|
-
const [selectedAssistant, setSelectedAssistant] = (0,
|
|
9541
|
-
const [isCreateModalOpen, setIsCreateModalOpen] = (0,
|
|
9853
|
+
const { setCenter, fitView } = (0, import_react35.useReactFlow)();
|
|
9854
|
+
const [nodes, setNodes, onNodesChange] = (0, import_react35.useNodesState)([]);
|
|
9855
|
+
const [edges, setEdges, onEdgesChange] = (0, import_react35.useEdgesState)([]);
|
|
9856
|
+
const [assistants, setAssistants] = (0, import_react34.useState)([]);
|
|
9857
|
+
const [assistantsLoading, setAssistantsLoading] = (0, import_react34.useState)(false);
|
|
9858
|
+
const [configPanelVisible, setConfigPanelVisible] = (0, import_react34.useState)(false);
|
|
9859
|
+
const [selectedAssistant, setSelectedAssistant] = (0, import_react34.useState)(null);
|
|
9860
|
+
const [isCreateModalOpen, setIsCreateModalOpen] = (0, import_react34.useState)(false);
|
|
9542
9861
|
const { config } = useLatticeChatShellContext();
|
|
9543
|
-
const { token } =
|
|
9862
|
+
const { token } = import_antd36.theme.useToken();
|
|
9544
9863
|
const { enableAssistantCreation = true, enableAssistantEditing = true } = config;
|
|
9545
|
-
const nodeTypes = (0,
|
|
9864
|
+
const nodeTypes = (0, import_react34.useMemo)(
|
|
9546
9865
|
() => ({
|
|
9547
9866
|
assistant: AssistantNode_default
|
|
9548
9867
|
}),
|
|
9549
9868
|
[]
|
|
9550
9869
|
);
|
|
9551
|
-
const handleConfigure = (0,
|
|
9870
|
+
const handleConfigure = (0, import_react34.useCallback)((assistant) => {
|
|
9552
9871
|
setSelectedAssistant(assistant);
|
|
9553
9872
|
setConfigPanelVisible(true);
|
|
9554
9873
|
}, []);
|
|
9555
|
-
const handleClosePanel = (0,
|
|
9874
|
+
const handleClosePanel = (0, import_react34.useCallback)(() => {
|
|
9556
9875
|
setConfigPanelVisible(false);
|
|
9557
9876
|
setSelectedAssistant(null);
|
|
9558
9877
|
}, []);
|
|
9878
|
+
const handleSelectionChange = (0, import_react34.useCallback)(
|
|
9879
|
+
({ nodes: selectedNodes }) => {
|
|
9880
|
+
if (selectedNodes.length === 1 && enableAssistantEditing) {
|
|
9881
|
+
const nodeData = selectedNodes[0].data;
|
|
9882
|
+
if (nodeData?.assistant) {
|
|
9883
|
+
setSelectedAssistant(nodeData.assistant);
|
|
9884
|
+
setConfigPanelVisible(true);
|
|
9885
|
+
}
|
|
9886
|
+
} else if (selectedNodes.length === 0) {
|
|
9887
|
+
setConfigPanelVisible(false);
|
|
9888
|
+
setSelectedAssistant(null);
|
|
9889
|
+
}
|
|
9890
|
+
},
|
|
9891
|
+
[enableAssistantEditing]
|
|
9892
|
+
);
|
|
9559
9893
|
const fetchAssistants = async () => {
|
|
9560
9894
|
setAssistantsLoading(true);
|
|
9561
9895
|
try {
|
|
@@ -9579,10 +9913,10 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
9579
9913
|
setAssistantsLoading(false);
|
|
9580
9914
|
}
|
|
9581
9915
|
};
|
|
9582
|
-
(0,
|
|
9916
|
+
(0, import_react34.useEffect)(() => {
|
|
9583
9917
|
fetchAssistants();
|
|
9584
9918
|
}, []);
|
|
9585
|
-
(0,
|
|
9919
|
+
(0, import_react34.useEffect)(() => {
|
|
9586
9920
|
if (!assistants || assistants.length === 0) {
|
|
9587
9921
|
setNodes([]);
|
|
9588
9922
|
setEdges([]);
|
|
@@ -9810,17 +10144,17 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
9810
10144
|
} : a
|
|
9811
10145
|
)
|
|
9812
10146
|
);
|
|
9813
|
-
|
|
10147
|
+
import_antd36.notification.success({
|
|
9814
10148
|
message: "Saved",
|
|
9815
10149
|
description: data.message || "Agent configuration saved successfully"
|
|
9816
10150
|
});
|
|
9817
10151
|
} else {
|
|
9818
|
-
|
|
10152
|
+
import_antd36.message.error(data.message || "Failed to save agent configuration");
|
|
9819
10153
|
throw new Error(data.message || "Failed to save agent configuration");
|
|
9820
10154
|
}
|
|
9821
10155
|
} catch (error) {
|
|
9822
10156
|
console.error("Failed to save agent configuration:", error);
|
|
9823
|
-
|
|
10157
|
+
import_antd36.message.error(error instanceof Error ? error.message : "Failed to save agent configuration");
|
|
9824
10158
|
throw error;
|
|
9825
10159
|
}
|
|
9826
10160
|
};
|
|
@@ -9845,17 +10179,17 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
9845
10179
|
setSelectedAssistant(null);
|
|
9846
10180
|
setConfigPanelVisible(false);
|
|
9847
10181
|
}
|
|
9848
|
-
|
|
10182
|
+
import_antd36.notification.success({
|
|
9849
10183
|
message: "Deleted",
|
|
9850
10184
|
description: "Assistant deleted successfully"
|
|
9851
10185
|
});
|
|
9852
10186
|
} else {
|
|
9853
|
-
|
|
10187
|
+
import_antd36.message.error(data.message || "Failed to delete assistant");
|
|
9854
10188
|
throw new Error(data.message || "Failed to delete assistant");
|
|
9855
10189
|
}
|
|
9856
10190
|
} catch (error) {
|
|
9857
10191
|
console.error("Failed to delete assistant:", error);
|
|
9858
|
-
|
|
10192
|
+
import_antd36.message.error(error instanceof Error ? error.message : "Failed to delete assistant");
|
|
9859
10193
|
throw error;
|
|
9860
10194
|
}
|
|
9861
10195
|
};
|
|
@@ -9869,7 +10203,7 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
9869
10203
|
});
|
|
9870
10204
|
lastCreatedAssistantRef.current = createdAssistant;
|
|
9871
10205
|
};
|
|
9872
|
-
(0,
|
|
10206
|
+
(0, import_react34.useEffect)(() => {
|
|
9873
10207
|
if (selectedAssistant) {
|
|
9874
10208
|
const node = nodes.find((n) => n.id === selectedAssistant.id);
|
|
9875
10209
|
if (node) {
|
|
@@ -9877,7 +10211,7 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
9877
10211
|
}
|
|
9878
10212
|
}
|
|
9879
10213
|
}, [selectedAssistant, nodes, setCenter]);
|
|
9880
|
-
(0,
|
|
10214
|
+
(0, import_react34.useEffect)(() => {
|
|
9881
10215
|
if (assistants.length > 0 && selectedAssistant) {
|
|
9882
10216
|
const assistant = assistants.find((a) => a.id === selectedAssistant.id);
|
|
9883
10217
|
if (assistant && !configPanelVisible) {
|
|
@@ -9885,8 +10219,8 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
9885
10219
|
}
|
|
9886
10220
|
}
|
|
9887
10221
|
}, [assistants, selectedAssistant, configPanelVisible]);
|
|
9888
|
-
const lastCreatedAssistantRef = (0,
|
|
9889
|
-
(0,
|
|
10222
|
+
const lastCreatedAssistantRef = (0, import_react34.useRef)(null);
|
|
10223
|
+
(0, import_react34.useEffect)(() => {
|
|
9890
10224
|
if (lastCreatedAssistantRef.current && !assistants.find((a) => a.id === lastCreatedAssistantRef.current?.id)) {
|
|
9891
10225
|
lastCreatedAssistantRef.current = null;
|
|
9892
10226
|
}
|
|
@@ -9901,7 +10235,7 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
9901
10235
|
}
|
|
9902
10236
|
}, [nodes, setCenter]);
|
|
9903
10237
|
if (assistantsLoading) {
|
|
9904
|
-
return /* @__PURE__ */ (0,
|
|
10238
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
9905
10239
|
"div",
|
|
9906
10240
|
{
|
|
9907
10241
|
style: {
|
|
@@ -9916,8 +10250,8 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
9916
10250
|
}
|
|
9917
10251
|
);
|
|
9918
10252
|
}
|
|
9919
|
-
return /* @__PURE__ */ (0,
|
|
9920
|
-
/* @__PURE__ */ (0,
|
|
10253
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { style: { width: "100%", height: "100%", display: "flex" }, children: [
|
|
10254
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
9921
10255
|
"div",
|
|
9922
10256
|
{
|
|
9923
10257
|
style: {
|
|
@@ -9927,22 +10261,23 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
9927
10261
|
position: "relative"
|
|
9928
10262
|
},
|
|
9929
10263
|
children: [
|
|
9930
|
-
/* @__PURE__ */ (0,
|
|
9931
|
-
|
|
10264
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
10265
|
+
import_react35.ReactFlow,
|
|
9932
10266
|
{
|
|
9933
10267
|
nodes,
|
|
9934
10268
|
edges,
|
|
9935
10269
|
onNodesChange,
|
|
9936
10270
|
onEdgesChange,
|
|
10271
|
+
onSelectionChange: handleSelectionChange,
|
|
9937
10272
|
nodeTypes,
|
|
9938
10273
|
fitView: true,
|
|
9939
10274
|
children: [
|
|
9940
|
-
/* @__PURE__ */ (0,
|
|
9941
|
-
/* @__PURE__ */ (0,
|
|
10275
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react35.Background, { color: "#eee", gap: 20 }),
|
|
10276
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react35.Controls, {})
|
|
9942
10277
|
]
|
|
9943
10278
|
}
|
|
9944
10279
|
),
|
|
9945
|
-
enableAssistantCreation && /* @__PURE__ */ (0,
|
|
10280
|
+
enableAssistantCreation && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
9946
10281
|
"div",
|
|
9947
10282
|
{
|
|
9948
10283
|
style: {
|
|
@@ -9951,12 +10286,12 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
9951
10286
|
right: 20,
|
|
9952
10287
|
zIndex: 10
|
|
9953
10288
|
},
|
|
9954
|
-
children: /* @__PURE__ */ (0,
|
|
9955
|
-
|
|
10289
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
10290
|
+
import_antd36.Button,
|
|
9956
10291
|
{
|
|
9957
10292
|
type: "primary",
|
|
9958
10293
|
size: "large",
|
|
9959
|
-
icon: /* @__PURE__ */ (0,
|
|
10294
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_icons22.PlusOutlined, {}),
|
|
9960
10295
|
onClick: () => setIsCreateModalOpen(true),
|
|
9961
10296
|
style: {
|
|
9962
10297
|
height: 48,
|
|
@@ -9975,7 +10310,7 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
9975
10310
|
]
|
|
9976
10311
|
}
|
|
9977
10312
|
),
|
|
9978
|
-
/* @__PURE__ */ (0,
|
|
10313
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
9979
10314
|
AgentConfigPanel_default,
|
|
9980
10315
|
{
|
|
9981
10316
|
visible: configPanelVisible,
|
|
@@ -9986,7 +10321,7 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
9986
10321
|
onDelete: handleDeleteAssistant
|
|
9987
10322
|
}
|
|
9988
10323
|
),
|
|
9989
|
-
/* @__PURE__ */ (0,
|
|
10324
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
9990
10325
|
CreateAssistantModal_default,
|
|
9991
10326
|
{
|
|
9992
10327
|
open: isCreateModalOpen,
|
|
@@ -9996,25 +10331,25 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
9996
10331
|
)
|
|
9997
10332
|
] });
|
|
9998
10333
|
};
|
|
9999
|
-
var AssistantFlow = (props) => /* @__PURE__ */ (0,
|
|
10334
|
+
var AssistantFlow = (props) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react35.ReactFlowProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(AssistantFlowInner, { ...props }) });
|
|
10000
10335
|
var AssistantFlow_default = AssistantFlow;
|
|
10001
10336
|
|
|
10002
10337
|
// src/components/Chat/SkillFlow.tsx
|
|
10003
|
-
var
|
|
10004
|
-
var
|
|
10338
|
+
var import_react39 = require("react");
|
|
10339
|
+
var import_react40 = require("@xyflow/react");
|
|
10005
10340
|
var import_style2 = require("@xyflow/react/dist/style.css");
|
|
10006
|
-
var
|
|
10007
|
-
var
|
|
10341
|
+
var import_antd40 = require("antd");
|
|
10342
|
+
var import_icons25 = require("@ant-design/icons");
|
|
10008
10343
|
|
|
10009
10344
|
// src/components/Chat/SkillNode.tsx
|
|
10010
|
-
var
|
|
10011
|
-
var
|
|
10012
|
-
var
|
|
10013
|
-
var
|
|
10345
|
+
var import_react36 = require("react");
|
|
10346
|
+
var import_react37 = require("@xyflow/react");
|
|
10347
|
+
var import_antd37 = require("antd");
|
|
10348
|
+
var import_icons23 = require("@ant-design/icons");
|
|
10014
10349
|
var import_client_sdk8 = require("@axiom-lattice/client-sdk");
|
|
10015
|
-
var
|
|
10016
|
-
var { Text:
|
|
10017
|
-
var { TextArea: TextArea3 } =
|
|
10350
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
10351
|
+
var { Text: Text20 } = import_antd37.Typography;
|
|
10352
|
+
var { TextArea: TextArea3 } = import_antd37.Input;
|
|
10018
10353
|
var getBadgeColor2 = (name) => {
|
|
10019
10354
|
const colors = [
|
|
10020
10355
|
"#1890ff",
|
|
@@ -10041,9 +10376,9 @@ var getBadgeColor2 = (name) => {
|
|
|
10041
10376
|
return colors[Math.abs(hash) % colors.length];
|
|
10042
10377
|
};
|
|
10043
10378
|
var SkillNode = ({ data }) => {
|
|
10044
|
-
const { token } =
|
|
10379
|
+
const { token } = import_antd37.theme.useToken();
|
|
10045
10380
|
const { config } = useLatticeChatShellContext();
|
|
10046
|
-
const client = (0,
|
|
10381
|
+
const client = (0, import_react36.useMemo)(
|
|
10047
10382
|
() => new import_client_sdk8.Client({
|
|
10048
10383
|
baseURL: config.baseURL,
|
|
10049
10384
|
apiKey: config.apiKey || "",
|
|
@@ -10060,12 +10395,12 @@ var SkillNode = ({ data }) => {
|
|
|
10060
10395
|
if (!skill) {
|
|
10061
10396
|
return null;
|
|
10062
10397
|
}
|
|
10063
|
-
const [currentSkill, setCurrentSkill] = (0,
|
|
10398
|
+
const [currentSkill, setCurrentSkill] = (0, import_react36.useState)(skill);
|
|
10064
10399
|
const badgeColor = getBadgeColor2(currentSkill.name);
|
|
10065
10400
|
const initials = currentSkill.name?.split("-").map((n) => n.charAt(0)).join("").toUpperCase().slice(0, 2) || "SK";
|
|
10066
10401
|
const hasSubSkills = currentSkill.subSkills && currentSkill.subSkills.length > 0;
|
|
10067
10402
|
const category = currentSkill.metadata && currentSkill.metadata.category || "global";
|
|
10068
|
-
const metadataEntries = (0,
|
|
10403
|
+
const metadataEntries = (0, import_react36.useMemo)(
|
|
10069
10404
|
() => currentSkill.metadata ? Object.entries(
|
|
10070
10405
|
currentSkill.metadata
|
|
10071
10406
|
).filter(
|
|
@@ -10082,20 +10417,20 @@ var SkillNode = ({ data }) => {
|
|
|
10082
10417
|
const handleCopy = (text) => {
|
|
10083
10418
|
navigator.clipboard.writeText(text);
|
|
10084
10419
|
};
|
|
10085
|
-
const [isEditing, setIsEditing] = (0,
|
|
10086
|
-
const [draftSkill, setDraftSkill] = (0,
|
|
10420
|
+
const [isEditing, setIsEditing] = (0, import_react36.useState)(false);
|
|
10421
|
+
const [draftSkill, setDraftSkill] = (0, import_react36.useState)({
|
|
10087
10422
|
...skill,
|
|
10088
10423
|
id: skill.name
|
|
10089
10424
|
});
|
|
10090
|
-
const [metadataRows, setMetadataRows] = (0,
|
|
10425
|
+
const [metadataRows, setMetadataRows] = (0, import_react36.useState)(
|
|
10091
10426
|
metadataEntries.map(([key, value]) => ({
|
|
10092
10427
|
key,
|
|
10093
10428
|
value
|
|
10094
10429
|
}))
|
|
10095
10430
|
);
|
|
10096
|
-
const [isModalOpen, setIsModalOpen] = (0,
|
|
10097
|
-
const [saving, setSaving] = (0,
|
|
10098
|
-
(0,
|
|
10431
|
+
const [isModalOpen, setIsModalOpen] = (0, import_react36.useState)(false);
|
|
10432
|
+
const [saving, setSaving] = (0, import_react36.useState)(false);
|
|
10433
|
+
(0, import_react36.useEffect)(() => {
|
|
10099
10434
|
setIsEditing(false);
|
|
10100
10435
|
setCurrentSkill(skill);
|
|
10101
10436
|
setDraftSkill({ ...skill, id: skill.name });
|
|
@@ -10126,11 +10461,11 @@ var SkillNode = ({ data }) => {
|
|
|
10126
10461
|
try {
|
|
10127
10462
|
const skillId = currentSkill.id || currentSkill.name;
|
|
10128
10463
|
if (!skillId) {
|
|
10129
|
-
|
|
10464
|
+
import_antd37.message.error("Skill ID is missing");
|
|
10130
10465
|
return;
|
|
10131
10466
|
}
|
|
10132
10467
|
await client.skills.delete(skillId);
|
|
10133
|
-
|
|
10468
|
+
import_antd37.notification.success({
|
|
10134
10469
|
message: "Deleted",
|
|
10135
10470
|
description: "Skill deleted successfully"
|
|
10136
10471
|
});
|
|
@@ -10139,7 +10474,7 @@ var SkillNode = ({ data }) => {
|
|
|
10139
10474
|
await onDelete();
|
|
10140
10475
|
}
|
|
10141
10476
|
} catch (error) {
|
|
10142
|
-
|
|
10477
|
+
import_antd37.message.error(
|
|
10143
10478
|
error?.message || "An error occurred while deleting the skill"
|
|
10144
10479
|
);
|
|
10145
10480
|
}
|
|
@@ -10196,7 +10531,7 @@ var SkillNode = ({ data }) => {
|
|
|
10196
10531
|
);
|
|
10197
10532
|
const data2 = await response.json();
|
|
10198
10533
|
if (response.ok && data2.success) {
|
|
10199
|
-
|
|
10534
|
+
import_antd37.notification.success({
|
|
10200
10535
|
message: "Saved",
|
|
10201
10536
|
description: "Skill updated successfully"
|
|
10202
10537
|
});
|
|
@@ -10211,17 +10546,17 @@ var SkillNode = ({ data }) => {
|
|
|
10211
10546
|
setIsEditing(false);
|
|
10212
10547
|
onClick?.(updatedSkill);
|
|
10213
10548
|
} else {
|
|
10214
|
-
|
|
10549
|
+
import_antd37.message.error(data2.message || "Failed to update skill");
|
|
10215
10550
|
}
|
|
10216
10551
|
} catch (error) {
|
|
10217
|
-
|
|
10552
|
+
import_antd37.message.error(
|
|
10218
10553
|
error.message || "An error occurred while updating the skill"
|
|
10219
10554
|
);
|
|
10220
10555
|
} finally {
|
|
10221
10556
|
setSaving(false);
|
|
10222
10557
|
}
|
|
10223
10558
|
};
|
|
10224
|
-
const editingView = /* @__PURE__ */ (0,
|
|
10559
|
+
const editingView = /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
10225
10560
|
"div",
|
|
10226
10561
|
{
|
|
10227
10562
|
style: {
|
|
@@ -10230,9 +10565,9 @@ var SkillNode = ({ data }) => {
|
|
|
10230
10565
|
gap: 12
|
|
10231
10566
|
},
|
|
10232
10567
|
children: [
|
|
10233
|
-
/* @__PURE__ */ (0,
|
|
10234
|
-
/* @__PURE__ */ (0,
|
|
10235
|
-
/* @__PURE__ */ (0,
|
|
10568
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
10569
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Text20, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Description" }),
|
|
10570
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10236
10571
|
TextArea3,
|
|
10237
10572
|
{
|
|
10238
10573
|
value: draftSkill.description,
|
|
@@ -10242,10 +10577,10 @@ var SkillNode = ({ data }) => {
|
|
|
10242
10577
|
}
|
|
10243
10578
|
)
|
|
10244
10579
|
] }),
|
|
10245
|
-
/* @__PURE__ */ (0,
|
|
10246
|
-
/* @__PURE__ */ (0,
|
|
10247
|
-
/* @__PURE__ */ (0,
|
|
10248
|
-
|
|
10580
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
10581
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Text20, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "License" }),
|
|
10582
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10583
|
+
import_antd37.Input,
|
|
10249
10584
|
{
|
|
10250
10585
|
value: draftSkill.license,
|
|
10251
10586
|
onChange: (e) => handleFieldChange("license", e.target.value),
|
|
@@ -10253,10 +10588,10 @@ var SkillNode = ({ data }) => {
|
|
|
10253
10588
|
}
|
|
10254
10589
|
)
|
|
10255
10590
|
] }),
|
|
10256
|
-
/* @__PURE__ */ (0,
|
|
10257
|
-
/* @__PURE__ */ (0,
|
|
10258
|
-
/* @__PURE__ */ (0,
|
|
10259
|
-
|
|
10591
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
10592
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Text20, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Compatibility" }),
|
|
10593
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10594
|
+
import_antd37.Input,
|
|
10260
10595
|
{
|
|
10261
10596
|
value: draftSkill.compatibility,
|
|
10262
10597
|
onChange: (e) => handleFieldChange("compatibility", e.target.value),
|
|
@@ -10264,7 +10599,7 @@ var SkillNode = ({ data }) => {
|
|
|
10264
10599
|
}
|
|
10265
10600
|
)
|
|
10266
10601
|
] }),
|
|
10267
|
-
/* @__PURE__ */ (0,
|
|
10602
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
10268
10603
|
"div",
|
|
10269
10604
|
{
|
|
10270
10605
|
style: {
|
|
@@ -10274,8 +10609,8 @@ var SkillNode = ({ data }) => {
|
|
|
10274
10609
|
gap: 8
|
|
10275
10610
|
},
|
|
10276
10611
|
children: [
|
|
10277
|
-
/* @__PURE__ */ (0,
|
|
10278
|
-
|
|
10612
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10613
|
+
Text20,
|
|
10279
10614
|
{
|
|
10280
10615
|
style: {
|
|
10281
10616
|
fontSize: 12,
|
|
@@ -10285,11 +10620,11 @@ var SkillNode = ({ data }) => {
|
|
|
10285
10620
|
children: "Metadata"
|
|
10286
10621
|
}
|
|
10287
10622
|
),
|
|
10288
|
-
/* @__PURE__ */ (0,
|
|
10289
|
-
|
|
10623
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10624
|
+
import_antd37.Button,
|
|
10290
10625
|
{
|
|
10291
10626
|
size: "small",
|
|
10292
|
-
icon: /* @__PURE__ */ (0,
|
|
10627
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_icons23.PlusOutlined, {}),
|
|
10293
10628
|
onClick: handleAddMetadataRow,
|
|
10294
10629
|
children: "Add"
|
|
10295
10630
|
}
|
|
@@ -10297,9 +10632,9 @@ var SkillNode = ({ data }) => {
|
|
|
10297
10632
|
]
|
|
10298
10633
|
}
|
|
10299
10634
|
),
|
|
10300
|
-
/* @__PURE__ */ (0,
|
|
10301
|
-
metadataRows.length === 0 && /* @__PURE__ */ (0,
|
|
10302
|
-
|
|
10635
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_antd37.Space, { direction: "vertical", size: 8, style: { width: "100%" }, children: [
|
|
10636
|
+
metadataRows.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10637
|
+
Text20,
|
|
10303
10638
|
{
|
|
10304
10639
|
style: {
|
|
10305
10640
|
fontSize: 11,
|
|
@@ -10308,7 +10643,7 @@ var SkillNode = ({ data }) => {
|
|
|
10308
10643
|
children: "No metadata yet. Use Add to create one."
|
|
10309
10644
|
}
|
|
10310
10645
|
),
|
|
10311
|
-
metadataRows.map((row, index) => /* @__PURE__ */ (0,
|
|
10646
|
+
metadataRows.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
10312
10647
|
"div",
|
|
10313
10648
|
{
|
|
10314
10649
|
style: {
|
|
@@ -10318,13 +10653,13 @@ var SkillNode = ({ data }) => {
|
|
|
10318
10653
|
width: "100%"
|
|
10319
10654
|
},
|
|
10320
10655
|
children: [
|
|
10321
|
-
/* @__PURE__ */ (0,
|
|
10656
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Text20, { style: { fontSize: 11, color: token.colorTextSecondary }, children: [
|
|
10322
10657
|
"Meta ",
|
|
10323
10658
|
index + 1
|
|
10324
10659
|
] }),
|
|
10325
|
-
/* @__PURE__ */ (0,
|
|
10326
|
-
/* @__PURE__ */ (0,
|
|
10327
|
-
|
|
10660
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_antd37.Space, { style: { width: "100%" }, size: 8, wrap: true, children: [
|
|
10661
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10662
|
+
import_antd37.Input,
|
|
10328
10663
|
{
|
|
10329
10664
|
value: row.key,
|
|
10330
10665
|
placeholder: "Key",
|
|
@@ -10332,8 +10667,8 @@ var SkillNode = ({ data }) => {
|
|
|
10332
10667
|
onChange: (e) => handleMetadataChange(index, "key", e.target.value)
|
|
10333
10668
|
}
|
|
10334
10669
|
),
|
|
10335
|
-
/* @__PURE__ */ (0,
|
|
10336
|
-
|
|
10670
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10671
|
+
import_antd37.Input,
|
|
10337
10672
|
{
|
|
10338
10673
|
value: row.value,
|
|
10339
10674
|
placeholder: "Value",
|
|
@@ -10347,9 +10682,9 @@ var SkillNode = ({ data }) => {
|
|
|
10347
10682
|
index
|
|
10348
10683
|
))
|
|
10349
10684
|
] }),
|
|
10350
|
-
/* @__PURE__ */ (0,
|
|
10351
|
-
/* @__PURE__ */ (0,
|
|
10352
|
-
/* @__PURE__ */ (0,
|
|
10685
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
10686
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Text20, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Content" }),
|
|
10687
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10353
10688
|
TextArea3,
|
|
10354
10689
|
{
|
|
10355
10690
|
value: draftSkill.content,
|
|
@@ -10362,7 +10697,7 @@ var SkillNode = ({ data }) => {
|
|
|
10362
10697
|
]
|
|
10363
10698
|
}
|
|
10364
10699
|
);
|
|
10365
|
-
const detailCardContent = /* @__PURE__ */ (0,
|
|
10700
|
+
const detailCardContent = /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
10366
10701
|
"div",
|
|
10367
10702
|
{
|
|
10368
10703
|
style: {
|
|
@@ -10372,7 +10707,7 @@ var SkillNode = ({ data }) => {
|
|
|
10372
10707
|
padding: 16
|
|
10373
10708
|
},
|
|
10374
10709
|
children: [
|
|
10375
|
-
/* @__PURE__ */ (0,
|
|
10710
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10376
10711
|
"div",
|
|
10377
10712
|
{
|
|
10378
10713
|
style: {
|
|
@@ -10381,8 +10716,8 @@ var SkillNode = ({ data }) => {
|
|
|
10381
10716
|
justifyContent: "space-between",
|
|
10382
10717
|
marginBottom: 16
|
|
10383
10718
|
},
|
|
10384
|
-
children: /* @__PURE__ */ (0,
|
|
10385
|
-
/* @__PURE__ */ (0,
|
|
10719
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { style: { flex: 1 }, children: [
|
|
10720
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
10386
10721
|
"div",
|
|
10387
10722
|
{
|
|
10388
10723
|
style: {
|
|
@@ -10392,8 +10727,8 @@ var SkillNode = ({ data }) => {
|
|
|
10392
10727
|
marginBottom: 8
|
|
10393
10728
|
},
|
|
10394
10729
|
children: [
|
|
10395
|
-
/* @__PURE__ */ (0,
|
|
10396
|
-
|
|
10730
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10731
|
+
Text20,
|
|
10397
10732
|
{
|
|
10398
10733
|
strong: true,
|
|
10399
10734
|
style: {
|
|
@@ -10404,8 +10739,8 @@ var SkillNode = ({ data }) => {
|
|
|
10404
10739
|
children: currentSkill.name
|
|
10405
10740
|
}
|
|
10406
10741
|
),
|
|
10407
|
-
/* @__PURE__ */ (0,
|
|
10408
|
-
|
|
10742
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10743
|
+
import_antd37.Tag,
|
|
10409
10744
|
{
|
|
10410
10745
|
style: {
|
|
10411
10746
|
margin: 0,
|
|
@@ -10420,7 +10755,7 @@ var SkillNode = ({ data }) => {
|
|
|
10420
10755
|
]
|
|
10421
10756
|
}
|
|
10422
10757
|
),
|
|
10423
|
-
/* @__PURE__ */ (0,
|
|
10758
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10424
10759
|
"div",
|
|
10425
10760
|
{
|
|
10426
10761
|
style: {
|
|
@@ -10428,8 +10763,8 @@ var SkillNode = ({ data }) => {
|
|
|
10428
10763
|
alignItems: "center",
|
|
10429
10764
|
gap: 6
|
|
10430
10765
|
},
|
|
10431
|
-
children: /* @__PURE__ */ (0,
|
|
10432
|
-
|
|
10766
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10767
|
+
Text20,
|
|
10433
10768
|
{
|
|
10434
10769
|
style: {
|
|
10435
10770
|
fontSize: 11,
|
|
@@ -10444,9 +10779,9 @@ var SkillNode = ({ data }) => {
|
|
|
10444
10779
|
] })
|
|
10445
10780
|
}
|
|
10446
10781
|
),
|
|
10447
|
-
isEditing ? editingView : /* @__PURE__ */ (0,
|
|
10448
|
-
currentSkill.description && /* @__PURE__ */ (0,
|
|
10449
|
-
|
|
10782
|
+
isEditing ? editingView : /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
|
|
10783
|
+
currentSkill.description && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
10784
|
+
Text20,
|
|
10450
10785
|
{
|
|
10451
10786
|
style: {
|
|
10452
10787
|
fontSize: 12,
|
|
@@ -10461,8 +10796,8 @@ var SkillNode = ({ data }) => {
|
|
|
10461
10796
|
]
|
|
10462
10797
|
}
|
|
10463
10798
|
) }),
|
|
10464
|
-
metadataEntries.length > 0 && /* @__PURE__ */ (0,
|
|
10465
|
-
/* @__PURE__ */ (0,
|
|
10799
|
+
metadataEntries.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { style: { marginBottom: 16 }, children: [
|
|
10800
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
10466
10801
|
"div",
|
|
10467
10802
|
{
|
|
10468
10803
|
style: {
|
|
@@ -10472,8 +10807,8 @@ var SkillNode = ({ data }) => {
|
|
|
10472
10807
|
marginBottom: 8
|
|
10473
10808
|
},
|
|
10474
10809
|
children: [
|
|
10475
|
-
/* @__PURE__ */ (0,
|
|
10476
|
-
|
|
10810
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10811
|
+
import_icons23.InfoCircleOutlined,
|
|
10477
10812
|
{
|
|
10478
10813
|
style: {
|
|
10479
10814
|
fontSize: 14,
|
|
@@ -10481,8 +10816,8 @@ var SkillNode = ({ data }) => {
|
|
|
10481
10816
|
}
|
|
10482
10817
|
}
|
|
10483
10818
|
),
|
|
10484
|
-
/* @__PURE__ */ (0,
|
|
10485
|
-
|
|
10819
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
10820
|
+
Text20,
|
|
10486
10821
|
{
|
|
10487
10822
|
style: {
|
|
10488
10823
|
fontSize: 12,
|
|
@@ -10499,7 +10834,7 @@ var SkillNode = ({ data }) => {
|
|
|
10499
10834
|
]
|
|
10500
10835
|
}
|
|
10501
10836
|
),
|
|
10502
|
-
/* @__PURE__ */ (0,
|
|
10837
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10503
10838
|
"div",
|
|
10504
10839
|
{
|
|
10505
10840
|
style: {
|
|
@@ -10507,7 +10842,7 @@ var SkillNode = ({ data }) => {
|
|
|
10507
10842
|
borderRadius: 6,
|
|
10508
10843
|
overflow: "hidden"
|
|
10509
10844
|
},
|
|
10510
|
-
children: metadataEntries.map(([key, value], index) => /* @__PURE__ */ (0,
|
|
10845
|
+
children: metadataEntries.map(([key, value], index) => /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
10511
10846
|
"div",
|
|
10512
10847
|
{
|
|
10513
10848
|
style: {
|
|
@@ -10516,7 +10851,7 @@ var SkillNode = ({ data }) => {
|
|
|
10516
10851
|
borderBottom: index === metadataEntries.length - 1 ? "none" : `1px solid ${token.colorBorderSecondary}`
|
|
10517
10852
|
},
|
|
10518
10853
|
children: [
|
|
10519
|
-
/* @__PURE__ */ (0,
|
|
10854
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10520
10855
|
"div",
|
|
10521
10856
|
{
|
|
10522
10857
|
style: {
|
|
@@ -10532,7 +10867,7 @@ var SkillNode = ({ data }) => {
|
|
|
10532
10867
|
children: key
|
|
10533
10868
|
}
|
|
10534
10869
|
),
|
|
10535
|
-
/* @__PURE__ */ (0,
|
|
10870
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10536
10871
|
"div",
|
|
10537
10872
|
{
|
|
10538
10873
|
style: {
|
|
@@ -10552,8 +10887,8 @@ var SkillNode = ({ data }) => {
|
|
|
10552
10887
|
}
|
|
10553
10888
|
)
|
|
10554
10889
|
] }),
|
|
10555
|
-
hasSubSkills && /* @__PURE__ */ (0,
|
|
10556
|
-
/* @__PURE__ */ (0,
|
|
10890
|
+
hasSubSkills && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { style: { marginBottom: 16 }, children: [
|
|
10891
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
10557
10892
|
"div",
|
|
10558
10893
|
{
|
|
10559
10894
|
style: {
|
|
@@ -10563,8 +10898,8 @@ var SkillNode = ({ data }) => {
|
|
|
10563
10898
|
marginBottom: 8
|
|
10564
10899
|
},
|
|
10565
10900
|
children: [
|
|
10566
|
-
/* @__PURE__ */ (0,
|
|
10567
|
-
|
|
10901
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10902
|
+
import_icons23.BranchesOutlined,
|
|
10568
10903
|
{
|
|
10569
10904
|
style: {
|
|
10570
10905
|
fontSize: 14,
|
|
@@ -10572,8 +10907,8 @@ var SkillNode = ({ data }) => {
|
|
|
10572
10907
|
}
|
|
10573
10908
|
}
|
|
10574
10909
|
),
|
|
10575
|
-
/* @__PURE__ */ (0,
|
|
10576
|
-
|
|
10910
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
10911
|
+
Text20,
|
|
10577
10912
|
{
|
|
10578
10913
|
style: {
|
|
10579
10914
|
fontSize: 12,
|
|
@@ -10590,9 +10925,9 @@ var SkillNode = ({ data }) => {
|
|
|
10590
10925
|
]
|
|
10591
10926
|
}
|
|
10592
10927
|
),
|
|
10593
|
-
/* @__PURE__ */ (0,
|
|
10594
|
-
(subSkill, index) => /* @__PURE__ */ (0,
|
|
10595
|
-
|
|
10928
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_antd37.Space, { size: [8, 8], wrap: true, children: currentSkill.subSkills.map(
|
|
10929
|
+
(subSkill, index) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10930
|
+
import_antd37.Tag,
|
|
10596
10931
|
{
|
|
10597
10932
|
style: {
|
|
10598
10933
|
fontSize: 11,
|
|
@@ -10607,11 +10942,11 @@ var SkillNode = ({ data }) => {
|
|
|
10607
10942
|
)
|
|
10608
10943
|
) })
|
|
10609
10944
|
] }),
|
|
10610
|
-
(currentSkill.license || currentSkill.compatibility) && /* @__PURE__ */ (0,
|
|
10611
|
-
currentSkill.license && /* @__PURE__ */ (0,
|
|
10612
|
-
|
|
10945
|
+
(currentSkill.license || currentSkill.compatibility) && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_antd37.Space, { size: [8, 8], wrap: true, children: [
|
|
10946
|
+
currentSkill.license && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10947
|
+
import_antd37.Tag,
|
|
10613
10948
|
{
|
|
10614
|
-
icon: /* @__PURE__ */ (0,
|
|
10949
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_icons23.CopyrightOutlined, {}),
|
|
10615
10950
|
style: {
|
|
10616
10951
|
margin: 0,
|
|
10617
10952
|
fontSize: 11,
|
|
@@ -10626,8 +10961,8 @@ var SkillNode = ({ data }) => {
|
|
|
10626
10961
|
children: currentSkill.license
|
|
10627
10962
|
}
|
|
10628
10963
|
),
|
|
10629
|
-
currentSkill.compatibility && /* @__PURE__ */ (0,
|
|
10630
|
-
|
|
10964
|
+
currentSkill.compatibility && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10965
|
+
import_antd37.Tag,
|
|
10631
10966
|
{
|
|
10632
10967
|
style: {
|
|
10633
10968
|
margin: 0,
|
|
@@ -10647,9 +10982,9 @@ var SkillNode = ({ data }) => {
|
|
|
10647
10982
|
}
|
|
10648
10983
|
)
|
|
10649
10984
|
] }) }),
|
|
10650
|
-
(currentSkill.createdAt || currentSkill.updatedAt) && /* @__PURE__ */ (0,
|
|
10651
|
-
currentSkill.createdAt && /* @__PURE__ */ (0,
|
|
10652
|
-
|
|
10985
|
+
(currentSkill.createdAt || currentSkill.updatedAt) && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_antd37.Space, { direction: "vertical", size: 4, children: [
|
|
10986
|
+
currentSkill.createdAt && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
10987
|
+
Text20,
|
|
10653
10988
|
{
|
|
10654
10989
|
style: {
|
|
10655
10990
|
fontSize: 11,
|
|
@@ -10662,8 +10997,8 @@ var SkillNode = ({ data }) => {
|
|
|
10662
10997
|
]
|
|
10663
10998
|
}
|
|
10664
10999
|
),
|
|
10665
|
-
currentSkill.updatedAt && /* @__PURE__ */ (0,
|
|
10666
|
-
|
|
11000
|
+
currentSkill.updatedAt && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
11001
|
+
Text20,
|
|
10667
11002
|
{
|
|
10668
11003
|
style: {
|
|
10669
11004
|
fontSize: 11,
|
|
@@ -10677,8 +11012,8 @@ var SkillNode = ({ data }) => {
|
|
|
10677
11012
|
}
|
|
10678
11013
|
)
|
|
10679
11014
|
] }) }),
|
|
10680
|
-
currentSkill.content && /* @__PURE__ */ (0,
|
|
10681
|
-
/* @__PURE__ */ (0,
|
|
11015
|
+
currentSkill.content && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { style: { marginBottom: 0 }, children: [
|
|
11016
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
10682
11017
|
"div",
|
|
10683
11018
|
{
|
|
10684
11019
|
style: {
|
|
@@ -10688,8 +11023,8 @@ var SkillNode = ({ data }) => {
|
|
|
10688
11023
|
marginBottom: 8
|
|
10689
11024
|
},
|
|
10690
11025
|
children: [
|
|
10691
|
-
/* @__PURE__ */ (0,
|
|
10692
|
-
|
|
11026
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
11027
|
+
import_icons23.FileTextOutlined,
|
|
10693
11028
|
{
|
|
10694
11029
|
style: {
|
|
10695
11030
|
fontSize: 14,
|
|
@@ -10697,8 +11032,8 @@ var SkillNode = ({ data }) => {
|
|
|
10697
11032
|
}
|
|
10698
11033
|
}
|
|
10699
11034
|
),
|
|
10700
|
-
/* @__PURE__ */ (0,
|
|
10701
|
-
|
|
11035
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
11036
|
+
Text20,
|
|
10702
11037
|
{
|
|
10703
11038
|
style: {
|
|
10704
11039
|
fontSize: 12,
|
|
@@ -10712,7 +11047,7 @@ var SkillNode = ({ data }) => {
|
|
|
10712
11047
|
]
|
|
10713
11048
|
}
|
|
10714
11049
|
),
|
|
10715
|
-
/* @__PURE__ */ (0,
|
|
11050
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10716
11051
|
"div",
|
|
10717
11052
|
{
|
|
10718
11053
|
style: {
|
|
@@ -10723,8 +11058,8 @@ var SkillNode = ({ data }) => {
|
|
|
10723
11058
|
maxHeight: 200,
|
|
10724
11059
|
overflowY: "auto"
|
|
10725
11060
|
},
|
|
10726
|
-
children: /* @__PURE__ */ (0,
|
|
10727
|
-
|
|
11061
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
11062
|
+
Text20,
|
|
10728
11063
|
{
|
|
10729
11064
|
style: {
|
|
10730
11065
|
fontSize: 11,
|
|
@@ -10739,8 +11074,8 @@ var SkillNode = ({ data }) => {
|
|
|
10739
11074
|
)
|
|
10740
11075
|
] })
|
|
10741
11076
|
] }),
|
|
10742
|
-
/* @__PURE__ */ (0,
|
|
10743
|
-
/* @__PURE__ */ (0,
|
|
11077
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_antd37.Divider, { style: { margin: "16px 0" } }),
|
|
11078
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10744
11079
|
"div",
|
|
10745
11080
|
{
|
|
10746
11081
|
style: {
|
|
@@ -10749,9 +11084,9 @@ var SkillNode = ({ data }) => {
|
|
|
10749
11084
|
justifyContent: "space-between",
|
|
10750
11085
|
gap: 8
|
|
10751
11086
|
},
|
|
10752
|
-
children: isEditing ? /* @__PURE__ */ (0,
|
|
10753
|
-
/* @__PURE__ */ (0,
|
|
10754
|
-
|
|
11087
|
+
children: isEditing ? /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
|
|
11088
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
11089
|
+
import_antd37.Button,
|
|
10755
11090
|
{
|
|
10756
11091
|
block: true,
|
|
10757
11092
|
onClick: () => {
|
|
@@ -10764,8 +11099,8 @@ var SkillNode = ({ data }) => {
|
|
|
10764
11099
|
children: "Cancel"
|
|
10765
11100
|
}
|
|
10766
11101
|
),
|
|
10767
|
-
/* @__PURE__ */ (0,
|
|
10768
|
-
|
|
11102
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
11103
|
+
import_antd37.Button,
|
|
10769
11104
|
{
|
|
10770
11105
|
type: "primary",
|
|
10771
11106
|
block: true,
|
|
@@ -10777,9 +11112,9 @@ var SkillNode = ({ data }) => {
|
|
|
10777
11112
|
children: "Save"
|
|
10778
11113
|
}
|
|
10779
11114
|
)
|
|
10780
|
-
] }) : /* @__PURE__ */ (0,
|
|
10781
|
-
/* @__PURE__ */ (0,
|
|
10782
|
-
|
|
11115
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
|
|
11116
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
11117
|
+
import_antd37.Button,
|
|
10783
11118
|
{
|
|
10784
11119
|
type: "primary",
|
|
10785
11120
|
block: true,
|
|
@@ -10790,8 +11125,8 @@ var SkillNode = ({ data }) => {
|
|
|
10790
11125
|
children: "Edit Skill"
|
|
10791
11126
|
}
|
|
10792
11127
|
),
|
|
10793
|
-
/* @__PURE__ */ (0,
|
|
10794
|
-
|
|
11128
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
11129
|
+
import_antd37.Button,
|
|
10795
11130
|
{
|
|
10796
11131
|
danger: true,
|
|
10797
11132
|
onClick: (e) => {
|
|
@@ -10801,10 +11136,10 @@ var SkillNode = ({ data }) => {
|
|
|
10801
11136
|
children: "Delete"
|
|
10802
11137
|
}
|
|
10803
11138
|
),
|
|
10804
|
-
/* @__PURE__ */ (0,
|
|
10805
|
-
|
|
11139
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
11140
|
+
import_antd37.Button,
|
|
10806
11141
|
{
|
|
10807
|
-
icon: /* @__PURE__ */ (0,
|
|
11142
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_icons23.CopyOutlined, {}),
|
|
10808
11143
|
onClick: () => handleCopy(currentSkill.id),
|
|
10809
11144
|
title: "Copy ID"
|
|
10810
11145
|
}
|
|
@@ -10823,23 +11158,23 @@ var SkillNode = ({ data }) => {
|
|
|
10823
11158
|
height: 0,
|
|
10824
11159
|
pointerEvents: "none"
|
|
10825
11160
|
};
|
|
10826
|
-
return /* @__PURE__ */ (0,
|
|
11161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
10827
11162
|
"div",
|
|
10828
11163
|
{
|
|
10829
11164
|
style: {
|
|
10830
11165
|
padding: 4
|
|
10831
11166
|
},
|
|
10832
11167
|
children: [
|
|
10833
|
-
/* @__PURE__ */ (0,
|
|
10834
|
-
|
|
11168
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
11169
|
+
import_react37.Handle,
|
|
10835
11170
|
{
|
|
10836
11171
|
type: "target",
|
|
10837
|
-
position:
|
|
11172
|
+
position: import_react37.Position.Top,
|
|
10838
11173
|
style: hiddenHandleStyle,
|
|
10839
11174
|
isConnectable: false
|
|
10840
11175
|
}
|
|
10841
11176
|
),
|
|
10842
|
-
/* @__PURE__ */ (0,
|
|
11177
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10843
11178
|
"div",
|
|
10844
11179
|
{
|
|
10845
11180
|
onClick: () => {
|
|
@@ -10869,7 +11204,7 @@ var SkillNode = ({ data }) => {
|
|
|
10869
11204
|
e.currentTarget.style.transform = "translateY(0)";
|
|
10870
11205
|
e.currentTarget.style.boxShadow = `0 1px 4px rgba(0, 0, 0, 0.08)`;
|
|
10871
11206
|
},
|
|
10872
|
-
children: /* @__PURE__ */ (0,
|
|
11207
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
10873
11208
|
"div",
|
|
10874
11209
|
{
|
|
10875
11210
|
style: {
|
|
@@ -10879,7 +11214,7 @@ var SkillNode = ({ data }) => {
|
|
|
10879
11214
|
gap: 10
|
|
10880
11215
|
},
|
|
10881
11216
|
children: [
|
|
10882
|
-
/* @__PURE__ */ (0,
|
|
11217
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
10883
11218
|
"div",
|
|
10884
11219
|
{
|
|
10885
11220
|
style: {
|
|
@@ -10888,7 +11223,7 @@ var SkillNode = ({ data }) => {
|
|
|
10888
11223
|
gap: 10
|
|
10889
11224
|
},
|
|
10890
11225
|
children: [
|
|
10891
|
-
/* @__PURE__ */ (0,
|
|
11226
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
10892
11227
|
"div",
|
|
10893
11228
|
{
|
|
10894
11229
|
style: {
|
|
@@ -10896,11 +11231,11 @@ var SkillNode = ({ data }) => {
|
|
|
10896
11231
|
flexShrink: 0
|
|
10897
11232
|
},
|
|
10898
11233
|
children: [
|
|
10899
|
-
/* @__PURE__ */ (0,
|
|
10900
|
-
|
|
11234
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
11235
|
+
import_antd37.Avatar,
|
|
10901
11236
|
{
|
|
10902
11237
|
size: 44,
|
|
10903
|
-
icon: /* @__PURE__ */ (0,
|
|
11238
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_icons23.BookOutlined, {}),
|
|
10904
11239
|
style: {
|
|
10905
11240
|
backgroundColor: badgeColor,
|
|
10906
11241
|
color: "#fff",
|
|
@@ -10910,7 +11245,7 @@ var SkillNode = ({ data }) => {
|
|
|
10910
11245
|
children: initials
|
|
10911
11246
|
}
|
|
10912
11247
|
),
|
|
10913
|
-
hasSubSkills && /* @__PURE__ */ (0,
|
|
11248
|
+
hasSubSkills && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10914
11249
|
"div",
|
|
10915
11250
|
{
|
|
10916
11251
|
style: {
|
|
@@ -10926,8 +11261,8 @@ var SkillNode = ({ data }) => {
|
|
|
10926
11261
|
alignItems: "center",
|
|
10927
11262
|
justifyContent: "center"
|
|
10928
11263
|
},
|
|
10929
|
-
children: /* @__PURE__ */ (0,
|
|
10930
|
-
|
|
11264
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
11265
|
+
import_icons23.BranchesOutlined,
|
|
10931
11266
|
{
|
|
10932
11267
|
style: {
|
|
10933
11268
|
fontSize: 10,
|
|
@@ -10940,7 +11275,7 @@ var SkillNode = ({ data }) => {
|
|
|
10940
11275
|
]
|
|
10941
11276
|
}
|
|
10942
11277
|
),
|
|
10943
|
-
/* @__PURE__ */ (0,
|
|
11278
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
10944
11279
|
"div",
|
|
10945
11280
|
{
|
|
10946
11281
|
style: {
|
|
@@ -10948,8 +11283,8 @@ var SkillNode = ({ data }) => {
|
|
|
10948
11283
|
minWidth: 0
|
|
10949
11284
|
},
|
|
10950
11285
|
children: [
|
|
10951
|
-
/* @__PURE__ */ (0,
|
|
10952
|
-
|
|
11286
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
11287
|
+
Text20,
|
|
10953
11288
|
{
|
|
10954
11289
|
strong: true,
|
|
10955
11290
|
style: {
|
|
@@ -10964,7 +11299,7 @@ var SkillNode = ({ data }) => {
|
|
|
10964
11299
|
children: currentSkill.name
|
|
10965
11300
|
}
|
|
10966
11301
|
),
|
|
10967
|
-
/* @__PURE__ */ (0,
|
|
11302
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
10968
11303
|
"div",
|
|
10969
11304
|
{
|
|
10970
11305
|
style: {
|
|
@@ -10973,8 +11308,8 @@ var SkillNode = ({ data }) => {
|
|
|
10973
11308
|
gap: 4
|
|
10974
11309
|
},
|
|
10975
11310
|
children: [
|
|
10976
|
-
/* @__PURE__ */ (0,
|
|
10977
|
-
|
|
11311
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
11312
|
+
import_icons23.FileTextOutlined,
|
|
10978
11313
|
{
|
|
10979
11314
|
style: {
|
|
10980
11315
|
fontSize: 9,
|
|
@@ -10982,8 +11317,8 @@ var SkillNode = ({ data }) => {
|
|
|
10982
11317
|
}
|
|
10983
11318
|
}
|
|
10984
11319
|
),
|
|
10985
|
-
/* @__PURE__ */ (0,
|
|
10986
|
-
|
|
11320
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
11321
|
+
Text20,
|
|
10987
11322
|
{
|
|
10988
11323
|
style: {
|
|
10989
11324
|
fontSize: 9,
|
|
@@ -11002,7 +11337,7 @@ var SkillNode = ({ data }) => {
|
|
|
11002
11337
|
]
|
|
11003
11338
|
}
|
|
11004
11339
|
),
|
|
11005
|
-
currentSkill.description && /* @__PURE__ */ (0,
|
|
11340
|
+
currentSkill.description && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
11006
11341
|
"div",
|
|
11007
11342
|
{
|
|
11008
11343
|
style: {
|
|
@@ -11012,12 +11347,12 @@ var SkillNode = ({ data }) => {
|
|
|
11012
11347
|
borderRadius: 4,
|
|
11013
11348
|
borderLeft: `2px solid ${badgeColor}`
|
|
11014
11349
|
},
|
|
11015
|
-
children: /* @__PURE__ */ (0,
|
|
11016
|
-
|
|
11350
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
11351
|
+
import_antd37.Tooltip,
|
|
11017
11352
|
{
|
|
11018
11353
|
title: currentSkill.description.length > 150 ? currentSkill.description : void 0,
|
|
11019
11354
|
placement: "top",
|
|
11020
|
-
children: /* @__PURE__ */ (0,
|
|
11355
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
11021
11356
|
"div",
|
|
11022
11357
|
{
|
|
11023
11358
|
style: {
|
|
@@ -11043,7 +11378,7 @@ var SkillNode = ({ data }) => {
|
|
|
11043
11378
|
)
|
|
11044
11379
|
}
|
|
11045
11380
|
),
|
|
11046
|
-
/* @__PURE__ */ (0,
|
|
11381
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
11047
11382
|
"div",
|
|
11048
11383
|
{
|
|
11049
11384
|
style: {
|
|
@@ -11054,8 +11389,8 @@ var SkillNode = ({ data }) => {
|
|
|
11054
11389
|
marginTop: "auto"
|
|
11055
11390
|
},
|
|
11056
11391
|
children: [
|
|
11057
|
-
/* @__PURE__ */ (0,
|
|
11058
|
-
|
|
11392
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
11393
|
+
import_antd37.Tag,
|
|
11059
11394
|
{
|
|
11060
11395
|
style: {
|
|
11061
11396
|
margin: 0,
|
|
@@ -11072,8 +11407,8 @@ var SkillNode = ({ data }) => {
|
|
|
11072
11407
|
children: category.toUpperCase()
|
|
11073
11408
|
}
|
|
11074
11409
|
),
|
|
11075
|
-
hasSubSkills && /* @__PURE__ */ (0,
|
|
11076
|
-
|
|
11410
|
+
hasSubSkills && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
11411
|
+
import_antd37.Tag,
|
|
11077
11412
|
{
|
|
11078
11413
|
style: {
|
|
11079
11414
|
margin: 0,
|
|
@@ -11095,8 +11430,8 @@ var SkillNode = ({ data }) => {
|
|
|
11095
11430
|
]
|
|
11096
11431
|
}
|
|
11097
11432
|
),
|
|
11098
|
-
currentSkill.license && /* @__PURE__ */ (0,
|
|
11099
|
-
|
|
11433
|
+
currentSkill.license && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
11434
|
+
import_antd37.Tag,
|
|
11100
11435
|
{
|
|
11101
11436
|
style: {
|
|
11102
11437
|
margin: 0,
|
|
@@ -11109,12 +11444,12 @@ var SkillNode = ({ data }) => {
|
|
|
11109
11444
|
fontWeight: 500,
|
|
11110
11445
|
lineHeight: "14px"
|
|
11111
11446
|
},
|
|
11112
|
-
icon: /* @__PURE__ */ (0,
|
|
11447
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_icons23.CopyrightOutlined, {}),
|
|
11113
11448
|
children: currentSkill.license
|
|
11114
11449
|
}
|
|
11115
11450
|
),
|
|
11116
|
-
currentSkill.compatibility && /* @__PURE__ */ (0,
|
|
11117
|
-
|
|
11451
|
+
currentSkill.compatibility && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
11452
|
+
import_antd37.Tag,
|
|
11118
11453
|
{
|
|
11119
11454
|
style: {
|
|
11120
11455
|
margin: 0,
|
|
@@ -11127,7 +11462,7 @@ var SkillNode = ({ data }) => {
|
|
|
11127
11462
|
fontWeight: 500,
|
|
11128
11463
|
lineHeight: "14px"
|
|
11129
11464
|
},
|
|
11130
|
-
icon: /* @__PURE__ */ (0,
|
|
11465
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_icons23.InfoCircleOutlined, {}),
|
|
11131
11466
|
children: currentSkill.compatibility
|
|
11132
11467
|
}
|
|
11133
11468
|
)
|
|
@@ -11139,8 +11474,8 @@ var SkillNode = ({ data }) => {
|
|
|
11139
11474
|
)
|
|
11140
11475
|
}
|
|
11141
11476
|
),
|
|
11142
|
-
/* @__PURE__ */ (0,
|
|
11143
|
-
|
|
11477
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
11478
|
+
import_antd37.Modal,
|
|
11144
11479
|
{
|
|
11145
11480
|
open: isModalOpen,
|
|
11146
11481
|
onCancel: () => {
|
|
@@ -11158,11 +11493,11 @@ var SkillNode = ({ data }) => {
|
|
|
11158
11493
|
children: detailCardContent
|
|
11159
11494
|
}
|
|
11160
11495
|
),
|
|
11161
|
-
/* @__PURE__ */ (0,
|
|
11162
|
-
|
|
11496
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
11497
|
+
import_react37.Handle,
|
|
11163
11498
|
{
|
|
11164
11499
|
type: "source",
|
|
11165
|
-
position:
|
|
11500
|
+
position: import_react37.Position.Bottom,
|
|
11166
11501
|
style: hiddenHandleStyle,
|
|
11167
11502
|
isConnectable: false
|
|
11168
11503
|
}
|
|
@@ -11174,24 +11509,24 @@ var SkillNode = ({ data }) => {
|
|
|
11174
11509
|
var SkillNode_default = SkillNode;
|
|
11175
11510
|
|
|
11176
11511
|
// src/components/Chat/CreateSkillModal.tsx
|
|
11177
|
-
var
|
|
11178
|
-
var
|
|
11179
|
-
var
|
|
11180
|
-
var
|
|
11181
|
-
var
|
|
11182
|
-
var { TextArea: TextArea4 } =
|
|
11183
|
-
var { Text:
|
|
11512
|
+
var import_react38 = require("react");
|
|
11513
|
+
var import_antd38 = require("antd");
|
|
11514
|
+
var import_icons24 = require("@ant-design/icons");
|
|
11515
|
+
var import_antd39 = require("antd");
|
|
11516
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
11517
|
+
var { TextArea: TextArea4 } = import_antd38.Input;
|
|
11518
|
+
var { Text: Text21 } = import_antd38.Typography;
|
|
11184
11519
|
var CreateSkillModal = ({
|
|
11185
11520
|
open,
|
|
11186
11521
|
onCancel,
|
|
11187
11522
|
onSuccess
|
|
11188
11523
|
}) => {
|
|
11189
|
-
const [form] =
|
|
11190
|
-
const [loading, setLoading] = (0,
|
|
11524
|
+
const [form] = import_antd38.Form.useForm();
|
|
11525
|
+
const [loading, setLoading] = (0, import_react38.useState)(false);
|
|
11191
11526
|
const { config } = useLatticeChatShellContext();
|
|
11192
|
-
const { token } =
|
|
11527
|
+
const { token } = import_antd39.theme.useToken();
|
|
11193
11528
|
const defaultMetadataRows = [{ key: "category", value: "global" }];
|
|
11194
|
-
const [metadataRows, setMetadataRows] = (0,
|
|
11529
|
+
const [metadataRows, setMetadataRows] = (0, import_react38.useState)(defaultMetadataRows);
|
|
11195
11530
|
const handleSubmit = async () => {
|
|
11196
11531
|
try {
|
|
11197
11532
|
const values = await form.validateFields();
|
|
@@ -11227,7 +11562,7 @@ var CreateSkillModal = ({
|
|
|
11227
11562
|
});
|
|
11228
11563
|
const data = await response.json();
|
|
11229
11564
|
if (response.ok && data.success) {
|
|
11230
|
-
|
|
11565
|
+
import_antd38.notification.success({
|
|
11231
11566
|
message: "Created",
|
|
11232
11567
|
description: "Skill created successfully"
|
|
11233
11568
|
});
|
|
@@ -11236,13 +11571,13 @@ var CreateSkillModal = ({
|
|
|
11236
11571
|
onSuccess?.();
|
|
11237
11572
|
onCancel();
|
|
11238
11573
|
} else {
|
|
11239
|
-
|
|
11574
|
+
import_antd38.message.error(data.message || "Failed to create skill");
|
|
11240
11575
|
}
|
|
11241
11576
|
} catch (error) {
|
|
11242
11577
|
if (error.errorFields) {
|
|
11243
11578
|
return;
|
|
11244
11579
|
}
|
|
11245
|
-
|
|
11580
|
+
import_antd38.message.error(
|
|
11246
11581
|
error.message || "An error occurred while creating the skill"
|
|
11247
11582
|
);
|
|
11248
11583
|
} finally {
|
|
@@ -11265,8 +11600,8 @@ var CreateSkillModal = ({
|
|
|
11265
11600
|
const handleAddMetadataRow = () => {
|
|
11266
11601
|
setMetadataRows([...metadataRows, { key: "", value: "" }]);
|
|
11267
11602
|
};
|
|
11268
|
-
return /* @__PURE__ */ (0,
|
|
11269
|
-
|
|
11603
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
11604
|
+
import_antd38.Modal,
|
|
11270
11605
|
{
|
|
11271
11606
|
title: "Create New Skill",
|
|
11272
11607
|
open,
|
|
@@ -11277,14 +11612,14 @@ var CreateSkillModal = ({
|
|
|
11277
11612
|
styles: {
|
|
11278
11613
|
body: { padding: 16 }
|
|
11279
11614
|
},
|
|
11280
|
-
children: /* @__PURE__ */ (0,
|
|
11281
|
-
|
|
11615
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
11616
|
+
import_antd38.Form,
|
|
11282
11617
|
{
|
|
11283
11618
|
form,
|
|
11284
11619
|
layout: "vertical",
|
|
11285
11620
|
onFinish: handleSubmit,
|
|
11286
11621
|
autoComplete: "off",
|
|
11287
|
-
children: /* @__PURE__ */ (0,
|
|
11622
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
11288
11623
|
"div",
|
|
11289
11624
|
{
|
|
11290
11625
|
style: {
|
|
@@ -11293,10 +11628,10 @@ var CreateSkillModal = ({
|
|
|
11293
11628
|
gap: 12
|
|
11294
11629
|
},
|
|
11295
11630
|
children: [
|
|
11296
|
-
/* @__PURE__ */ (0,
|
|
11297
|
-
/* @__PURE__ */ (0,
|
|
11298
|
-
/* @__PURE__ */ (0,
|
|
11299
|
-
|
|
11631
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
11632
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Text21, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Name" }),
|
|
11633
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
11634
|
+
import_antd38.Form.Item,
|
|
11300
11635
|
{
|
|
11301
11636
|
name: "name",
|
|
11302
11637
|
rules: [
|
|
@@ -11308,21 +11643,21 @@ var CreateSkillModal = ({
|
|
|
11308
11643
|
{ min: 1, max: 64, message: "Name must be 1-64 characters" }
|
|
11309
11644
|
],
|
|
11310
11645
|
style: { marginBottom: 0 },
|
|
11311
|
-
children: /* @__PURE__ */ (0,
|
|
11646
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_antd38.Input, { placeholder: "e.g., data-analysis" })
|
|
11312
11647
|
}
|
|
11313
11648
|
)
|
|
11314
11649
|
] }),
|
|
11315
|
-
/* @__PURE__ */ (0,
|
|
11316
|
-
/* @__PURE__ */ (0,
|
|
11317
|
-
/* @__PURE__ */ (0,
|
|
11318
|
-
|
|
11650
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
11651
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Text21, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Description" }),
|
|
11652
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
11653
|
+
import_antd38.Form.Item,
|
|
11319
11654
|
{
|
|
11320
11655
|
name: "description",
|
|
11321
11656
|
rules: [
|
|
11322
11657
|
{ required: true, message: "Please enter skill description" }
|
|
11323
11658
|
],
|
|
11324
11659
|
style: { marginBottom: 0 },
|
|
11325
|
-
children: /* @__PURE__ */ (0,
|
|
11660
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
11326
11661
|
TextArea4,
|
|
11327
11662
|
{
|
|
11328
11663
|
placeholder: "Description",
|
|
@@ -11332,16 +11667,16 @@ var CreateSkillModal = ({
|
|
|
11332
11667
|
}
|
|
11333
11668
|
)
|
|
11334
11669
|
] }),
|
|
11335
|
-
/* @__PURE__ */ (0,
|
|
11336
|
-
/* @__PURE__ */ (0,
|
|
11337
|
-
/* @__PURE__ */ (0,
|
|
11670
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
11671
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Text21, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "License" }),
|
|
11672
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_antd38.Form.Item, { name: "license", style: { marginBottom: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_antd38.Input, { placeholder: "License" }) })
|
|
11338
11673
|
] }),
|
|
11339
|
-
/* @__PURE__ */ (0,
|
|
11340
|
-
/* @__PURE__ */ (0,
|
|
11341
|
-
/* @__PURE__ */ (0,
|
|
11674
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
11675
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Text21, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Compatibility" }),
|
|
11676
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_antd38.Form.Item, { name: "compatibility", style: { marginBottom: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_antd38.Input, { placeholder: "Compatibility" }) })
|
|
11342
11677
|
] }),
|
|
11343
|
-
/* @__PURE__ */ (0,
|
|
11344
|
-
/* @__PURE__ */ (0,
|
|
11678
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
11679
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
11345
11680
|
"div",
|
|
11346
11681
|
{
|
|
11347
11682
|
style: {
|
|
@@ -11351,8 +11686,8 @@ var CreateSkillModal = ({
|
|
|
11351
11686
|
gap: 8
|
|
11352
11687
|
},
|
|
11353
11688
|
children: [
|
|
11354
|
-
/* @__PURE__ */ (0,
|
|
11355
|
-
|
|
11689
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
11690
|
+
Text21,
|
|
11356
11691
|
{
|
|
11357
11692
|
style: {
|
|
11358
11693
|
fontSize: 12,
|
|
@@ -11362,11 +11697,11 @@ var CreateSkillModal = ({
|
|
|
11362
11697
|
children: "Metadata"
|
|
11363
11698
|
}
|
|
11364
11699
|
),
|
|
11365
|
-
/* @__PURE__ */ (0,
|
|
11366
|
-
|
|
11700
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
11701
|
+
import_antd38.Button,
|
|
11367
11702
|
{
|
|
11368
11703
|
size: "small",
|
|
11369
|
-
icon: /* @__PURE__ */ (0,
|
|
11704
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_icons24.PlusOutlined, {}),
|
|
11370
11705
|
onClick: handleAddMetadataRow,
|
|
11371
11706
|
children: "Add"
|
|
11372
11707
|
}
|
|
@@ -11374,9 +11709,9 @@ var CreateSkillModal = ({
|
|
|
11374
11709
|
]
|
|
11375
11710
|
}
|
|
11376
11711
|
),
|
|
11377
|
-
/* @__PURE__ */ (0,
|
|
11378
|
-
metadataRows.length === 0 && /* @__PURE__ */ (0,
|
|
11379
|
-
|
|
11712
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_antd38.Space, { direction: "vertical", size: 8, style: { width: "100%" }, children: [
|
|
11713
|
+
metadataRows.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
11714
|
+
Text21,
|
|
11380
11715
|
{
|
|
11381
11716
|
style: {
|
|
11382
11717
|
fontSize: 11,
|
|
@@ -11385,7 +11720,7 @@ var CreateSkillModal = ({
|
|
|
11385
11720
|
children: "No metadata yet. Use Add to create one."
|
|
11386
11721
|
}
|
|
11387
11722
|
),
|
|
11388
|
-
metadataRows.map((row, index) => /* @__PURE__ */ (0,
|
|
11723
|
+
metadataRows.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
11389
11724
|
"div",
|
|
11390
11725
|
{
|
|
11391
11726
|
style: {
|
|
@@ -11395,8 +11730,8 @@ var CreateSkillModal = ({
|
|
|
11395
11730
|
width: "100%"
|
|
11396
11731
|
},
|
|
11397
11732
|
children: [
|
|
11398
|
-
/* @__PURE__ */ (0,
|
|
11399
|
-
|
|
11733
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
11734
|
+
Text21,
|
|
11400
11735
|
{
|
|
11401
11736
|
style: { fontSize: 11, color: token.colorTextSecondary },
|
|
11402
11737
|
children: [
|
|
@@ -11405,9 +11740,9 @@ var CreateSkillModal = ({
|
|
|
11405
11740
|
]
|
|
11406
11741
|
}
|
|
11407
11742
|
),
|
|
11408
|
-
/* @__PURE__ */ (0,
|
|
11409
|
-
/* @__PURE__ */ (0,
|
|
11410
|
-
|
|
11743
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_antd38.Space, { style: { width: "100%" }, size: 8, wrap: true, children: [
|
|
11744
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
11745
|
+
import_antd38.Input,
|
|
11411
11746
|
{
|
|
11412
11747
|
value: row.key,
|
|
11413
11748
|
placeholder: "Key",
|
|
@@ -11415,8 +11750,8 @@ var CreateSkillModal = ({
|
|
|
11415
11750
|
onChange: (e) => handleMetadataChange(index, "key", e.target.value)
|
|
11416
11751
|
}
|
|
11417
11752
|
),
|
|
11418
|
-
/* @__PURE__ */ (0,
|
|
11419
|
-
|
|
11753
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
11754
|
+
import_antd38.Input,
|
|
11420
11755
|
{
|
|
11421
11756
|
value: row.value,
|
|
11422
11757
|
placeholder: "Value",
|
|
@@ -11431,9 +11766,9 @@ var CreateSkillModal = ({
|
|
|
11431
11766
|
))
|
|
11432
11767
|
] })
|
|
11433
11768
|
] }),
|
|
11434
|
-
/* @__PURE__ */ (0,
|
|
11435
|
-
/* @__PURE__ */ (0,
|
|
11436
|
-
/* @__PURE__ */ (0,
|
|
11769
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
11770
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Text21, { style: { fontSize: 12, color: token.colorTextSecondary }, children: "Content" }),
|
|
11771
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_antd38.Form.Item, { name: "content", style: { marginBottom: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
11437
11772
|
TextArea4,
|
|
11438
11773
|
{
|
|
11439
11774
|
placeholder: "Content",
|
|
@@ -11441,7 +11776,7 @@ var CreateSkillModal = ({
|
|
|
11441
11776
|
}
|
|
11442
11777
|
) })
|
|
11443
11778
|
] }),
|
|
11444
|
-
/* @__PURE__ */ (0,
|
|
11779
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
11445
11780
|
"div",
|
|
11446
11781
|
{
|
|
11447
11782
|
style: {
|
|
@@ -11452,8 +11787,8 @@ var CreateSkillModal = ({
|
|
|
11452
11787
|
marginTop: 8
|
|
11453
11788
|
},
|
|
11454
11789
|
children: [
|
|
11455
|
-
/* @__PURE__ */ (0,
|
|
11456
|
-
/* @__PURE__ */ (0,
|
|
11790
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_antd38.Button, { onClick: handleCancel, children: "Cancel" }),
|
|
11791
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_antd38.Button, { type: "primary", htmlType: "submit", loading, children: "Create Skill" })
|
|
11457
11792
|
]
|
|
11458
11793
|
}
|
|
11459
11794
|
)
|
|
@@ -11468,16 +11803,16 @@ var CreateSkillModal = ({
|
|
|
11468
11803
|
var CreateSkillModal_default = CreateSkillModal;
|
|
11469
11804
|
|
|
11470
11805
|
// src/components/Chat/SkillFlow.tsx
|
|
11471
|
-
var
|
|
11806
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
11472
11807
|
var SkillFlowInner = ({ onNodeClick }) => {
|
|
11473
|
-
const [nodes, setNodes, onNodesChange] = (0,
|
|
11474
|
-
const [edges, setEdges, onEdgesChange] = (0,
|
|
11475
|
-
const [isCreateModalOpen, setIsCreateModalOpen] = (0,
|
|
11476
|
-
const [skills, setSkills] = (0,
|
|
11477
|
-
const [skillsLoading, setSkillsLoading] = (0,
|
|
11478
|
-
const { token } =
|
|
11808
|
+
const [nodes, setNodes, onNodesChange] = (0, import_react40.useNodesState)([]);
|
|
11809
|
+
const [edges, setEdges, onEdgesChange] = (0, import_react40.useEdgesState)([]);
|
|
11810
|
+
const [isCreateModalOpen, setIsCreateModalOpen] = (0, import_react39.useState)(false);
|
|
11811
|
+
const [skills, setSkills] = (0, import_react39.useState)([]);
|
|
11812
|
+
const [skillsLoading, setSkillsLoading] = (0, import_react39.useState)(false);
|
|
11813
|
+
const { token } = import_antd40.theme.useToken();
|
|
11479
11814
|
const { config } = useLatticeChatShellContext();
|
|
11480
|
-
const nodeTypes = (0,
|
|
11815
|
+
const nodeTypes = (0, import_react39.useMemo)(
|
|
11481
11816
|
() => ({
|
|
11482
11817
|
skill: SkillNode_default
|
|
11483
11818
|
}),
|
|
@@ -11506,10 +11841,10 @@ var SkillFlowInner = ({ onNodeClick }) => {
|
|
|
11506
11841
|
setSkillsLoading(false);
|
|
11507
11842
|
}
|
|
11508
11843
|
};
|
|
11509
|
-
(0,
|
|
11844
|
+
(0, import_react39.useEffect)(() => {
|
|
11510
11845
|
fetchSkills();
|
|
11511
11846
|
}, []);
|
|
11512
|
-
(0,
|
|
11847
|
+
(0, import_react39.useEffect)(() => {
|
|
11513
11848
|
if (!skills || skills.length === 0) {
|
|
11514
11849
|
setNodes([]);
|
|
11515
11850
|
setEdges([]);
|
|
@@ -11641,7 +11976,7 @@ var SkillFlowInner = ({ onNodeClick }) => {
|
|
|
11641
11976
|
await fetchSkills();
|
|
11642
11977
|
};
|
|
11643
11978
|
if (skillsLoading) {
|
|
11644
|
-
return /* @__PURE__ */ (0,
|
|
11979
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
11645
11980
|
"div",
|
|
11646
11981
|
{
|
|
11647
11982
|
style: {
|
|
@@ -11656,9 +11991,9 @@ var SkillFlowInner = ({ onNodeClick }) => {
|
|
|
11656
11991
|
}
|
|
11657
11992
|
);
|
|
11658
11993
|
}
|
|
11659
|
-
return /* @__PURE__ */ (0,
|
|
11660
|
-
/* @__PURE__ */ (0,
|
|
11661
|
-
|
|
11994
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { style: { width: "100%", height: "100%", background: "#fafafa", position: "relative" }, children: [
|
|
11995
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
11996
|
+
import_react40.ReactFlow,
|
|
11662
11997
|
{
|
|
11663
11998
|
nodes,
|
|
11664
11999
|
edges,
|
|
@@ -11667,12 +12002,12 @@ var SkillFlowInner = ({ onNodeClick }) => {
|
|
|
11667
12002
|
nodeTypes,
|
|
11668
12003
|
fitView: true,
|
|
11669
12004
|
children: [
|
|
11670
|
-
/* @__PURE__ */ (0,
|
|
11671
|
-
/* @__PURE__ */ (0,
|
|
12005
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react40.Background, { color: "#eee", gap: 20 }),
|
|
12006
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react40.Controls, {})
|
|
11672
12007
|
]
|
|
11673
12008
|
}
|
|
11674
12009
|
),
|
|
11675
|
-
/* @__PURE__ */ (0,
|
|
12010
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
11676
12011
|
"div",
|
|
11677
12012
|
{
|
|
11678
12013
|
style: {
|
|
@@ -11681,12 +12016,12 @@ var SkillFlowInner = ({ onNodeClick }) => {
|
|
|
11681
12016
|
right: 20,
|
|
11682
12017
|
zIndex: 10
|
|
11683
12018
|
},
|
|
11684
|
-
children: /* @__PURE__ */ (0,
|
|
11685
|
-
|
|
12019
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
12020
|
+
import_antd40.Button,
|
|
11686
12021
|
{
|
|
11687
12022
|
type: "primary",
|
|
11688
12023
|
size: "large",
|
|
11689
|
-
icon: /* @__PURE__ */ (0,
|
|
12024
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_icons25.PlusOutlined, {}),
|
|
11690
12025
|
onClick: () => setIsCreateModalOpen(true),
|
|
11691
12026
|
style: {
|
|
11692
12027
|
height: 48,
|
|
@@ -11702,7 +12037,7 @@ var SkillFlowInner = ({ onNodeClick }) => {
|
|
|
11702
12037
|
)
|
|
11703
12038
|
}
|
|
11704
12039
|
),
|
|
11705
|
-
/* @__PURE__ */ (0,
|
|
12040
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
11706
12041
|
CreateSkillModal_default,
|
|
11707
12042
|
{
|
|
11708
12043
|
open: isCreateModalOpen,
|
|
@@ -11712,27 +12047,27 @@ var SkillFlowInner = ({ onNodeClick }) => {
|
|
|
11712
12047
|
)
|
|
11713
12048
|
] });
|
|
11714
12049
|
};
|
|
11715
|
-
var SkillFlow = (props) => /* @__PURE__ */ (0,
|
|
12050
|
+
var SkillFlow = (props) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react40.ReactFlowProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SkillFlowInner, { ...props }) });
|
|
11716
12051
|
var SkillFlow_default = SkillFlow;
|
|
11717
12052
|
|
|
11718
12053
|
// src/components/Chat/ToolsList.tsx
|
|
11719
|
-
var
|
|
11720
|
-
var
|
|
11721
|
-
var
|
|
11722
|
-
var
|
|
12054
|
+
var import_antd41 = require("antd");
|
|
12055
|
+
var import_icons26 = require("@ant-design/icons");
|
|
12056
|
+
var import_react41 = require("react");
|
|
12057
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
11723
12058
|
var ToolsList = ({
|
|
11724
12059
|
onToolSelect,
|
|
11725
12060
|
autoLoad = true
|
|
11726
12061
|
}) => {
|
|
11727
|
-
const { token } =
|
|
12062
|
+
const { token } = import_antd41.theme.useToken();
|
|
11728
12063
|
const { config } = useLatticeChatShellContext();
|
|
11729
|
-
const [state, setState] = (0,
|
|
12064
|
+
const [state, setState] = (0, import_react41.useState)({
|
|
11730
12065
|
tools: [],
|
|
11731
12066
|
isLoading: false,
|
|
11732
12067
|
error: null
|
|
11733
12068
|
});
|
|
11734
|
-
const [selectedToolId, setSelectedToolId] = (0,
|
|
11735
|
-
const fetchTools = (0,
|
|
12069
|
+
const [selectedToolId, setSelectedToolId] = (0, import_react41.useState)(null);
|
|
12070
|
+
const fetchTools = (0, import_react41.useCallback)(async () => {
|
|
11736
12071
|
setState((prev) => ({ ...prev, isLoading: true, error: null }));
|
|
11737
12072
|
try {
|
|
11738
12073
|
const headers = {};
|
|
@@ -11765,17 +12100,17 @@ var ToolsList = ({
|
|
|
11765
12100
|
}));
|
|
11766
12101
|
}
|
|
11767
12102
|
}, [config]);
|
|
11768
|
-
const handleToolSelect = (0,
|
|
12103
|
+
const handleToolSelect = (0, import_react41.useCallback)(
|
|
11769
12104
|
(tool) => {
|
|
11770
12105
|
setSelectedToolId(tool.id);
|
|
11771
12106
|
onToolSelect?.(tool);
|
|
11772
12107
|
},
|
|
11773
12108
|
[onToolSelect]
|
|
11774
12109
|
);
|
|
11775
|
-
const handleRefresh = (0,
|
|
12110
|
+
const handleRefresh = (0, import_react41.useCallback)(() => {
|
|
11776
12111
|
fetchTools();
|
|
11777
12112
|
}, [fetchTools]);
|
|
11778
|
-
(0,
|
|
12113
|
+
(0, import_react41.useEffect)(() => {
|
|
11779
12114
|
if (autoLoad) {
|
|
11780
12115
|
fetchTools();
|
|
11781
12116
|
}
|
|
@@ -11788,18 +12123,18 @@ var ToolsList = ({
|
|
|
11788
12123
|
padding: token.paddingSM
|
|
11789
12124
|
};
|
|
11790
12125
|
if (state.error) {
|
|
11791
|
-
return /* @__PURE__ */ (0,
|
|
11792
|
-
|
|
12126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { style, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
12127
|
+
import_antd41.Alert,
|
|
11793
12128
|
{
|
|
11794
12129
|
message: "Error Loading Tools",
|
|
11795
12130
|
description: state.error.message,
|
|
11796
12131
|
type: "error",
|
|
11797
12132
|
showIcon: true,
|
|
11798
|
-
action: /* @__PURE__ */ (0,
|
|
11799
|
-
|
|
12133
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
12134
|
+
import_antd41.Button,
|
|
11800
12135
|
{
|
|
11801
12136
|
size: "small",
|
|
11802
|
-
icon: /* @__PURE__ */ (0,
|
|
12137
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons26.ReloadOutlined, {}),
|
|
11803
12138
|
onClick: handleRefresh,
|
|
11804
12139
|
children: "Retry"
|
|
11805
12140
|
}
|
|
@@ -11807,8 +12142,8 @@ var ToolsList = ({
|
|
|
11807
12142
|
}
|
|
11808
12143
|
) });
|
|
11809
12144
|
}
|
|
11810
|
-
return /* @__PURE__ */ (0,
|
|
11811
|
-
/* @__PURE__ */ (0,
|
|
12145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { style: { position: "relative", width: "100%", height: "100%" }, children: [
|
|
12146
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
11812
12147
|
"div",
|
|
11813
12148
|
{
|
|
11814
12149
|
style: {
|
|
@@ -11817,12 +12152,12 @@ var ToolsList = ({
|
|
|
11817
12152
|
right: token.paddingSM,
|
|
11818
12153
|
zIndex: 1
|
|
11819
12154
|
},
|
|
11820
|
-
children: /* @__PURE__ */ (0,
|
|
11821
|
-
|
|
12155
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
12156
|
+
import_antd41.Button,
|
|
11822
12157
|
{
|
|
11823
12158
|
type: "text",
|
|
11824
12159
|
size: "small",
|
|
11825
|
-
icon: /* @__PURE__ */ (0,
|
|
12160
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons26.ReloadOutlined, {}),
|
|
11826
12161
|
onClick: handleRefresh,
|
|
11827
12162
|
title: "Refresh tools",
|
|
11828
12163
|
style: {
|
|
@@ -11832,7 +12167,7 @@ var ToolsList = ({
|
|
|
11832
12167
|
)
|
|
11833
12168
|
}
|
|
11834
12169
|
),
|
|
11835
|
-
/* @__PURE__ */ (0,
|
|
12170
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
11836
12171
|
"div",
|
|
11837
12172
|
{
|
|
11838
12173
|
style: {
|
|
@@ -11842,13 +12177,13 @@ var ToolsList = ({
|
|
|
11842
12177
|
overflowX: "hidden",
|
|
11843
12178
|
paddingTop: token.paddingLG
|
|
11844
12179
|
},
|
|
11845
|
-
children: /* @__PURE__ */ (0,
|
|
11846
|
-
|
|
12180
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
12181
|
+
import_antd41.List,
|
|
11847
12182
|
{
|
|
11848
12183
|
dataSource: state.tools,
|
|
11849
12184
|
loading: state.isLoading,
|
|
11850
12185
|
locale: {
|
|
11851
|
-
emptyText: /* @__PURE__ */ (0,
|
|
12186
|
+
emptyText: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
11852
12187
|
"div",
|
|
11853
12188
|
{
|
|
11854
12189
|
style: {
|
|
@@ -11859,11 +12194,11 @@ var ToolsList = ({
|
|
|
11859
12194
|
padding: token.paddingLG
|
|
11860
12195
|
},
|
|
11861
12196
|
children: [
|
|
11862
|
-
/* @__PURE__ */ (0,
|
|
11863
|
-
/* @__PURE__ */ (0,
|
|
11864
|
-
|
|
12197
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { style: { color: token.colorTextSecondary }, children: "No tools available" }),
|
|
12198
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
12199
|
+
import_antd41.Button,
|
|
11865
12200
|
{
|
|
11866
|
-
icon: /* @__PURE__ */ (0,
|
|
12201
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons26.ReloadOutlined, {}),
|
|
11867
12202
|
onClick: handleRefresh,
|
|
11868
12203
|
type: "dashed",
|
|
11869
12204
|
size: "small",
|
|
@@ -11878,8 +12213,8 @@ var ToolsList = ({
|
|
|
11878
12213
|
...style,
|
|
11879
12214
|
paddingTop: 0
|
|
11880
12215
|
},
|
|
11881
|
-
renderItem: (tool) => /* @__PURE__ */ (0,
|
|
11882
|
-
|
|
12216
|
+
renderItem: (tool) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
12217
|
+
import_antd41.List.Item,
|
|
11883
12218
|
{
|
|
11884
12219
|
onClick: () => handleToolSelect(tool),
|
|
11885
12220
|
style: {
|
|
@@ -11899,11 +12234,11 @@ var ToolsList = ({
|
|
|
11899
12234
|
e.currentTarget.style.backgroundColor = "transparent";
|
|
11900
12235
|
}
|
|
11901
12236
|
},
|
|
11902
|
-
children: /* @__PURE__ */ (0,
|
|
11903
|
-
|
|
12237
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
12238
|
+
import_antd41.List.Item.Meta,
|
|
11904
12239
|
{
|
|
11905
|
-
avatar: /* @__PURE__ */ (0,
|
|
11906
|
-
|
|
12240
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
12241
|
+
import_antd41.Avatar,
|
|
11907
12242
|
{
|
|
11908
12243
|
size: "small",
|
|
11909
12244
|
style: {
|
|
@@ -11913,7 +12248,7 @@ var ToolsList = ({
|
|
|
11913
12248
|
children: tool.name.charAt(0).toUpperCase()
|
|
11914
12249
|
}
|
|
11915
12250
|
),
|
|
11916
|
-
title: /* @__PURE__ */ (0,
|
|
12251
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
11917
12252
|
"div",
|
|
11918
12253
|
{
|
|
11919
12254
|
style: {
|
|
@@ -11922,9 +12257,9 @@ var ToolsList = ({
|
|
|
11922
12257
|
gap: token.marginXS
|
|
11923
12258
|
},
|
|
11924
12259
|
children: [
|
|
11925
|
-
/* @__PURE__ */ (0,
|
|
11926
|
-
tool.needUserApprove && /* @__PURE__ */ (0,
|
|
11927
|
-
|
|
12260
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { children: tool.name }),
|
|
12261
|
+
tool.needUserApprove && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
12262
|
+
import_antd41.Tag,
|
|
11928
12263
|
{
|
|
11929
12264
|
color: "warning",
|
|
11930
12265
|
style: {
|
|
@@ -11939,7 +12274,7 @@ var ToolsList = ({
|
|
|
11939
12274
|
]
|
|
11940
12275
|
}
|
|
11941
12276
|
),
|
|
11942
|
-
description: /* @__PURE__ */ (0,
|
|
12277
|
+
description: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
11943
12278
|
"div",
|
|
11944
12279
|
{
|
|
11945
12280
|
style: {
|
|
@@ -11965,7 +12300,7 @@ var ToolsList = ({
|
|
|
11965
12300
|
};
|
|
11966
12301
|
|
|
11967
12302
|
// src/components/Chat/ChatSidebar.tsx
|
|
11968
|
-
var
|
|
12303
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
11969
12304
|
var useStyles4 = (0, import_antd_style13.createStyles)(({ token, css }) => ({
|
|
11970
12305
|
sidebar: css`
|
|
11971
12306
|
display: flex;
|
|
@@ -12021,9 +12356,9 @@ var ChatSidebar = ({
|
|
|
12021
12356
|
const { styles } = useStyles4();
|
|
12022
12357
|
const { setSettingsModalOpen } = useLatticeChatShellContext();
|
|
12023
12358
|
const { selectAssistant } = useAssistantContext();
|
|
12024
|
-
const [isFlowModalOpen, setIsFlowModalOpen] = (0,
|
|
12025
|
-
const [isSkillFlowModalOpen, setIsSkillFlowModalOpen] = (0,
|
|
12026
|
-
const [isToolsModalOpen, setIsToolsModalOpen] = (0,
|
|
12359
|
+
const [isFlowModalOpen, setIsFlowModalOpen] = (0, import_react42.useState)(false);
|
|
12360
|
+
const [isSkillFlowModalOpen, setIsSkillFlowModalOpen] = (0, import_react42.useState)(false);
|
|
12361
|
+
const [isToolsModalOpen, setIsToolsModalOpen] = (0, import_react42.useState)(false);
|
|
12027
12362
|
const handleSettingsClick = () => {
|
|
12028
12363
|
setSettingsModalOpen(true);
|
|
12029
12364
|
onSettingsClick?.();
|
|
@@ -12037,51 +12372,51 @@ var ChatSidebar = ({
|
|
|
12037
12372
|
const handleToolsClick = () => {
|
|
12038
12373
|
setIsToolsModalOpen(true);
|
|
12039
12374
|
};
|
|
12040
|
-
return /* @__PURE__ */ (0,
|
|
12041
|
-
/* @__PURE__ */ (0,
|
|
12042
|
-
/* @__PURE__ */ (0,
|
|
12375
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
12376
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: styles.sidebar, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: styles.buttonContainer, children: [
|
|
12377
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
12043
12378
|
"button",
|
|
12044
12379
|
{
|
|
12045
12380
|
className: styles.actionButton,
|
|
12046
12381
|
onClick: handleAssistantFlowClick,
|
|
12047
12382
|
title: "Assistant Flow Canvas",
|
|
12048
12383
|
"aria-label": "Assistant Flow Canvas",
|
|
12049
|
-
children: /* @__PURE__ */ (0,
|
|
12384
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react.Bot, {})
|
|
12050
12385
|
}
|
|
12051
12386
|
),
|
|
12052
|
-
/* @__PURE__ */ (0,
|
|
12387
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
12053
12388
|
"button",
|
|
12054
12389
|
{
|
|
12055
12390
|
className: styles.actionButton,
|
|
12056
12391
|
onClick: handleSkillFlowClick,
|
|
12057
12392
|
title: "Skill Flow Canvas",
|
|
12058
12393
|
"aria-label": "Skill Flow Canvas",
|
|
12059
|
-
children: /* @__PURE__ */ (0,
|
|
12394
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react.BrainCircuit, {})
|
|
12060
12395
|
}
|
|
12061
12396
|
),
|
|
12062
|
-
/* @__PURE__ */ (0,
|
|
12397
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
12063
12398
|
"button",
|
|
12064
12399
|
{
|
|
12065
12400
|
className: styles.actionButton,
|
|
12066
12401
|
onClick: handleToolsClick,
|
|
12067
12402
|
title: "Tools List",
|
|
12068
12403
|
"aria-label": "Tools List",
|
|
12069
|
-
children: /* @__PURE__ */ (0,
|
|
12404
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react.Wrench, {})
|
|
12070
12405
|
}
|
|
12071
12406
|
),
|
|
12072
|
-
/* @__PURE__ */ (0,
|
|
12407
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
12073
12408
|
"button",
|
|
12074
12409
|
{
|
|
12075
12410
|
className: styles.actionButton,
|
|
12076
12411
|
onClick: handleSettingsClick,
|
|
12077
12412
|
title: "Settings",
|
|
12078
12413
|
"aria-label": "Settings",
|
|
12079
|
-
children: /* @__PURE__ */ (0,
|
|
12414
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react.Settings, {})
|
|
12080
12415
|
}
|
|
12081
12416
|
)
|
|
12082
12417
|
] }) }),
|
|
12083
|
-
/* @__PURE__ */ (0,
|
|
12084
|
-
|
|
12418
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
12419
|
+
import_antd42.Modal,
|
|
12085
12420
|
{
|
|
12086
12421
|
destroyOnHidden: true,
|
|
12087
12422
|
title: "Assistant Overview",
|
|
@@ -12094,7 +12429,7 @@ var ChatSidebar = ({
|
|
|
12094
12429
|
height: "calc(100vh - 120px)",
|
|
12095
12430
|
padding: 0
|
|
12096
12431
|
},
|
|
12097
|
-
children: /* @__PURE__ */ (0,
|
|
12432
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
12098
12433
|
AssistantFlow_default,
|
|
12099
12434
|
{
|
|
12100
12435
|
onChat: (assistant) => {
|
|
@@ -12105,8 +12440,8 @@ var ChatSidebar = ({
|
|
|
12105
12440
|
) })
|
|
12106
12441
|
}
|
|
12107
12442
|
),
|
|
12108
|
-
/* @__PURE__ */ (0,
|
|
12109
|
-
|
|
12443
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
12444
|
+
import_antd42.Modal,
|
|
12110
12445
|
{
|
|
12111
12446
|
destroyOnHidden: true,
|
|
12112
12447
|
title: "Skill Overview",
|
|
@@ -12119,7 +12454,7 @@ var ChatSidebar = ({
|
|
|
12119
12454
|
height: "calc(100vh - 120px)",
|
|
12120
12455
|
padding: 0
|
|
12121
12456
|
},
|
|
12122
|
-
children: /* @__PURE__ */ (0,
|
|
12457
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
12123
12458
|
SkillFlow_default,
|
|
12124
12459
|
{
|
|
12125
12460
|
onNodeClick: (skill) => {
|
|
@@ -12129,8 +12464,8 @@ var ChatSidebar = ({
|
|
|
12129
12464
|
) })
|
|
12130
12465
|
}
|
|
12131
12466
|
),
|
|
12132
|
-
/* @__PURE__ */ (0,
|
|
12133
|
-
|
|
12467
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
12468
|
+
import_antd42.Modal,
|
|
12134
12469
|
{
|
|
12135
12470
|
destroyOnHidden: true,
|
|
12136
12471
|
title: "Tools Overview",
|
|
@@ -12143,7 +12478,7 @@ var ChatSidebar = ({
|
|
|
12143
12478
|
height: "calc(100vh - 120px)",
|
|
12144
12479
|
padding: 0
|
|
12145
12480
|
},
|
|
12146
|
-
children: /* @__PURE__ */ (0,
|
|
12481
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
12147
12482
|
ToolsList,
|
|
12148
12483
|
{
|
|
12149
12484
|
onToolSelect: (tool) => {
|
|
@@ -12157,16 +12492,16 @@ var ChatSidebar = ({
|
|
|
12157
12492
|
};
|
|
12158
12493
|
|
|
12159
12494
|
// src/components/Chat/LatticeChatView.tsx
|
|
12160
|
-
var
|
|
12495
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
12161
12496
|
var LatticeChatView = (props) => {
|
|
12162
|
-
const shellContext = (0,
|
|
12497
|
+
const shellContext = (0, import_react43.useContext)(LatticeChatShellContext);
|
|
12163
12498
|
const { showSideMenu } = shellContext.config;
|
|
12164
12499
|
const { assistantId, thread } = useConversationContext();
|
|
12165
12500
|
const { currentAssistant } = useAssistantContext();
|
|
12166
12501
|
const {
|
|
12167
12502
|
config: { baseURL }
|
|
12168
12503
|
} = useLatticeChatShellContext();
|
|
12169
|
-
return assistantId && thread ? /* @__PURE__ */ (0,
|
|
12504
|
+
return assistantId && thread ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
12170
12505
|
AxiomLatticeProvider,
|
|
12171
12506
|
{
|
|
12172
12507
|
config: {
|
|
@@ -12175,14 +12510,14 @@ var LatticeChatView = (props) => {
|
|
|
12175
12510
|
assistantId,
|
|
12176
12511
|
transport: "sse"
|
|
12177
12512
|
},
|
|
12178
|
-
children: /* @__PURE__ */ (0,
|
|
12513
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
12179
12514
|
LatticeChat,
|
|
12180
12515
|
{
|
|
12181
12516
|
thread_id: thread?.id,
|
|
12182
12517
|
assistant_id: assistantId,
|
|
12183
12518
|
name: currentAssistant?.name,
|
|
12184
12519
|
description: currentAssistant?.description,
|
|
12185
|
-
menu: showSideMenu ? /* @__PURE__ */ (0,
|
|
12520
|
+
menu: showSideMenu ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(ChatSidebar, {}) : void 0
|
|
12186
12521
|
}
|
|
12187
12522
|
)
|
|
12188
12523
|
}
|
|
@@ -12190,13 +12525,13 @@ var LatticeChatView = (props) => {
|
|
|
12190
12525
|
};
|
|
12191
12526
|
|
|
12192
12527
|
// src/components/Chat/SettingsModal.tsx
|
|
12193
|
-
var
|
|
12194
|
-
var
|
|
12195
|
-
var
|
|
12528
|
+
var import_react44 = require("react");
|
|
12529
|
+
var import_antd43 = require("antd");
|
|
12530
|
+
var import_icons27 = require("@ant-design/icons");
|
|
12196
12531
|
var import_antd_style14 = require("antd-style");
|
|
12197
|
-
var
|
|
12198
|
-
var { Text:
|
|
12199
|
-
var { TextArea: TextArea5 } =
|
|
12532
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
12533
|
+
var { Text: Text22, Title: Title4 } = import_antd43.Typography;
|
|
12534
|
+
var { TextArea: TextArea5 } = import_antd43.Input;
|
|
12200
12535
|
var useStyles5 = (0, import_antd_style14.createStyles)(({ token, css }) => ({
|
|
12201
12536
|
// settingsModal: css`
|
|
12202
12537
|
// .ant-modal {
|
|
@@ -12543,12 +12878,12 @@ var SETTINGS_MENU_ITEMS = [
|
|
|
12543
12878
|
{
|
|
12544
12879
|
key: "environment",
|
|
12545
12880
|
label: "Environment Variables",
|
|
12546
|
-
icon: /* @__PURE__ */ (0,
|
|
12881
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons27.EnvironmentOutlined, {})
|
|
12547
12882
|
},
|
|
12548
12883
|
{
|
|
12549
12884
|
key: "models",
|
|
12550
12885
|
label: "Model Configuration",
|
|
12551
|
-
icon: /* @__PURE__ */ (0,
|
|
12886
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons27.ApiOutlined, {})
|
|
12552
12887
|
}
|
|
12553
12888
|
];
|
|
12554
12889
|
var SettingsModal = ({
|
|
@@ -12557,7 +12892,7 @@ var SettingsModal = ({
|
|
|
12557
12892
|
}) => {
|
|
12558
12893
|
const { styles } = useStyles5();
|
|
12559
12894
|
const { config: shellConfig, updateConfigValue } = useLatticeChatShellContext();
|
|
12560
|
-
const [connections, setConnections] = (0,
|
|
12895
|
+
const [connections, setConnections] = (0, import_react44.useState)(() => {
|
|
12561
12896
|
if (typeof window !== "undefined") {
|
|
12562
12897
|
try {
|
|
12563
12898
|
const stored = localStorage.getItem("lattice_server_connections");
|
|
@@ -12580,21 +12915,21 @@ var SettingsModal = ({
|
|
|
12580
12915
|
}
|
|
12581
12916
|
return [];
|
|
12582
12917
|
});
|
|
12583
|
-
const [serverConfigs, setServerConfigs] = (0,
|
|
12584
|
-
const connectionsRef = (0,
|
|
12585
|
-
(0,
|
|
12918
|
+
const [serverConfigs, setServerConfigs] = (0, import_react44.useState)({});
|
|
12919
|
+
const connectionsRef = (0, import_react44.useRef)(connections);
|
|
12920
|
+
(0, import_react44.useEffect)(() => {
|
|
12586
12921
|
connectionsRef.current = connections;
|
|
12587
12922
|
}, [connections]);
|
|
12588
|
-
const [activeTabKey, setActiveTabKey] = (0,
|
|
12923
|
+
const [activeTabKey, setActiveTabKey] = (0, import_react44.useState)(
|
|
12589
12924
|
connections.length > 0 ? connections[0].id : ""
|
|
12590
12925
|
);
|
|
12591
|
-
const [activeMenu, setActiveMenu] = (0,
|
|
12592
|
-
const [loading, setLoading] = (0,
|
|
12593
|
-
const [showAddServerModal, setShowAddServerModal] = (0,
|
|
12594
|
-
const [newServerUrl, setNewServerUrl] = (0,
|
|
12595
|
-
const [newServerName, setNewServerName] = (0,
|
|
12596
|
-
const [newServerApiKey, setNewServerApiKey] = (0,
|
|
12597
|
-
const [addingServer, setAddingServer] = (0,
|
|
12926
|
+
const [activeMenu, setActiveMenu] = (0, import_react44.useState)("environment");
|
|
12927
|
+
const [loading, setLoading] = (0, import_react44.useState)(false);
|
|
12928
|
+
const [showAddServerModal, setShowAddServerModal] = (0, import_react44.useState)(false);
|
|
12929
|
+
const [newServerUrl, setNewServerUrl] = (0, import_react44.useState)("");
|
|
12930
|
+
const [newServerName, setNewServerName] = (0, import_react44.useState)("");
|
|
12931
|
+
const [newServerApiKey, setNewServerApiKey] = (0, import_react44.useState)("");
|
|
12932
|
+
const [addingServer, setAddingServer] = (0, import_react44.useState)(false);
|
|
12598
12933
|
const saveConnections = (newConnections) => {
|
|
12599
12934
|
setConnections(newConnections);
|
|
12600
12935
|
if (typeof window !== "undefined") {
|
|
@@ -12733,7 +13068,7 @@ var SettingsModal = ({
|
|
|
12733
13068
|
}
|
|
12734
13069
|
} catch (error) {
|
|
12735
13070
|
console.error("Failed to load configuration:", error);
|
|
12736
|
-
|
|
13071
|
+
import_antd43.message.error("Failed to load current configuration");
|
|
12737
13072
|
}
|
|
12738
13073
|
};
|
|
12739
13074
|
const loadModelsConfig = async (serverId) => {
|
|
@@ -12784,7 +13119,7 @@ var SettingsModal = ({
|
|
|
12784
13119
|
console.error("Failed to load models configuration:", error);
|
|
12785
13120
|
}
|
|
12786
13121
|
};
|
|
12787
|
-
(0,
|
|
13122
|
+
(0, import_react44.useEffect)(() => {
|
|
12788
13123
|
if (open && activeTabKey) {
|
|
12789
13124
|
initializeServerConfig(activeTabKey);
|
|
12790
13125
|
const connection = connections.find((c) => c.id === activeTabKey);
|
|
@@ -12793,7 +13128,7 @@ var SettingsModal = ({
|
|
|
12793
13128
|
}
|
|
12794
13129
|
}
|
|
12795
13130
|
}, [open, activeTabKey]);
|
|
12796
|
-
(0,
|
|
13131
|
+
(0, import_react44.useEffect)(() => {
|
|
12797
13132
|
if (open && activeTabKey) {
|
|
12798
13133
|
const connection = connections.find((c) => c.id === activeTabKey);
|
|
12799
13134
|
if (connection?.connected) {
|
|
@@ -12807,7 +13142,7 @@ var SettingsModal = ({
|
|
|
12807
13142
|
}, [open, activeTabKey, activeMenu]);
|
|
12808
13143
|
const handleAddServer = async () => {
|
|
12809
13144
|
if (!newServerUrl.trim()) {
|
|
12810
|
-
|
|
13145
|
+
import_antd43.message.error("Please enter a server URL");
|
|
12811
13146
|
return;
|
|
12812
13147
|
}
|
|
12813
13148
|
let normalizedUrl = newServerUrl.trim();
|
|
@@ -12833,7 +13168,7 @@ var SettingsModal = ({
|
|
|
12833
13168
|
setNewServerUrl("");
|
|
12834
13169
|
setNewServerName("");
|
|
12835
13170
|
setNewServerApiKey("");
|
|
12836
|
-
|
|
13171
|
+
import_antd43.notification.success({
|
|
12837
13172
|
message: "Added",
|
|
12838
13173
|
description: "Server added successfully"
|
|
12839
13174
|
});
|
|
@@ -12853,7 +13188,7 @@ var SettingsModal = ({
|
|
|
12853
13188
|
setActiveTabKey("");
|
|
12854
13189
|
}
|
|
12855
13190
|
}
|
|
12856
|
-
|
|
13191
|
+
import_antd43.notification.success({
|
|
12857
13192
|
message: "Deleted",
|
|
12858
13193
|
description: "Server deleted"
|
|
12859
13194
|
});
|
|
@@ -12870,12 +13205,12 @@ var SettingsModal = ({
|
|
|
12870
13205
|
const handleSave = async () => {
|
|
12871
13206
|
const connection = connections.find((c) => c.id === activeTabKey);
|
|
12872
13207
|
if (!connection || !connection.connected) {
|
|
12873
|
-
|
|
13208
|
+
import_antd43.message.error("Please connect to a server first");
|
|
12874
13209
|
return;
|
|
12875
13210
|
}
|
|
12876
13211
|
const url = connection.url;
|
|
12877
13212
|
if (!url) {
|
|
12878
|
-
|
|
13213
|
+
import_antd43.message.error("Please connect to a server first");
|
|
12879
13214
|
return;
|
|
12880
13215
|
}
|
|
12881
13216
|
try {
|
|
@@ -12939,26 +13274,26 @@ var SettingsModal = ({
|
|
|
12939
13274
|
const data = await response.json();
|
|
12940
13275
|
if (response.ok && data.success) {
|
|
12941
13276
|
if (data.requiresRestart && data.requiresRestart.length > 0) {
|
|
12942
|
-
|
|
13277
|
+
import_antd43.message.warning(
|
|
12943
13278
|
`Configuration saved. Please restart the server for ${data.requiresRestart.join(
|
|
12944
13279
|
", "
|
|
12945
13280
|
)} to take effect.`,
|
|
12946
13281
|
5
|
|
12947
13282
|
);
|
|
12948
13283
|
} else {
|
|
12949
|
-
|
|
13284
|
+
import_antd43.notification.success({
|
|
12950
13285
|
message: "Saved",
|
|
12951
13286
|
description: "Configuration saved and applied successfully"
|
|
12952
13287
|
});
|
|
12953
13288
|
}
|
|
12954
13289
|
if (data.warnings && data.warnings.length > 0) {
|
|
12955
13290
|
data.warnings.forEach((warning) => {
|
|
12956
|
-
|
|
13291
|
+
import_antd43.message.warning(warning, 5);
|
|
12957
13292
|
});
|
|
12958
13293
|
}
|
|
12959
13294
|
onClose();
|
|
12960
13295
|
} else {
|
|
12961
|
-
|
|
13296
|
+
import_antd43.message.error(data.error || "Failed to save configuration");
|
|
12962
13297
|
}
|
|
12963
13298
|
} else if (activeMenu === "models") {
|
|
12964
13299
|
const validModels = config.models.filter(
|
|
@@ -12977,18 +13312,18 @@ var SettingsModal = ({
|
|
|
12977
13312
|
});
|
|
12978
13313
|
const data = await response.json();
|
|
12979
13314
|
if (response.ok && data.success) {
|
|
12980
|
-
|
|
13315
|
+
import_antd43.notification.success({
|
|
12981
13316
|
message: "Saved",
|
|
12982
13317
|
description: "Model configuration saved and registered successfully"
|
|
12983
13318
|
});
|
|
12984
13319
|
onClose();
|
|
12985
13320
|
} else {
|
|
12986
|
-
|
|
13321
|
+
import_antd43.message.error(data.error || "Failed to save model configuration");
|
|
12987
13322
|
}
|
|
12988
13323
|
}
|
|
12989
13324
|
} catch (error) {
|
|
12990
13325
|
console.error("Failed to save configuration:", error);
|
|
12991
|
-
|
|
13326
|
+
import_antd43.message.error(error.message || "Failed to save configuration");
|
|
12992
13327
|
} finally {
|
|
12993
13328
|
setLoading(false);
|
|
12994
13329
|
}
|
|
@@ -13004,25 +13339,25 @@ var SettingsModal = ({
|
|
|
13004
13339
|
}
|
|
13005
13340
|
}));
|
|
13006
13341
|
};
|
|
13007
|
-
return /* @__PURE__ */ (0,
|
|
13008
|
-
/* @__PURE__ */ (0,
|
|
13009
|
-
|
|
13342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: styles.formContainer, children: [
|
|
13343
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13344
|
+
import_antd43.Alert,
|
|
13010
13345
|
{
|
|
13011
13346
|
message: "Configuration Effect",
|
|
13012
|
-
description: /* @__PURE__ */ (0,
|
|
13013
|
-
/* @__PURE__ */ (0,
|
|
13014
|
-
/* @__PURE__ */ (0,
|
|
13015
|
-
|
|
13347
|
+
description: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { children: [
|
|
13348
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { style: { marginBottom: 8 }, children: [
|
|
13349
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13350
|
+
import_icons27.CheckCircleOutlined,
|
|
13016
13351
|
{
|
|
13017
13352
|
style: { color: "#52c41a", marginRight: 8 }
|
|
13018
13353
|
}
|
|
13019
13354
|
),
|
|
13020
|
-
/* @__PURE__ */ (0,
|
|
13355
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("strong", { children: "Immediately effective:" }),
|
|
13021
13356
|
" QUEUE_SERVICE_TYPE, REDIS_URL, REDIS_PASSWORD, QUEUE_NAME"
|
|
13022
13357
|
] }),
|
|
13023
|
-
/* @__PURE__ */ (0,
|
|
13024
|
-
/* @__PURE__ */ (0,
|
|
13025
|
-
/* @__PURE__ */ (0,
|
|
13358
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { children: [
|
|
13359
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons27.ReloadOutlined, { style: { color: "#faad14", marginRight: 8 } }),
|
|
13360
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("strong", { children: "Requires restart:" }),
|
|
13026
13361
|
" PORT (server must be restarted to change port)"
|
|
13027
13362
|
] })
|
|
13028
13363
|
] }),
|
|
@@ -13031,8 +13366,8 @@ var SettingsModal = ({
|
|
|
13031
13366
|
className: styles.alertCard
|
|
13032
13367
|
}
|
|
13033
13368
|
),
|
|
13034
|
-
/* @__PURE__ */ (0,
|
|
13035
|
-
/* @__PURE__ */ (0,
|
|
13369
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { style: { marginBottom: 24 }, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(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." }) }),
|
|
13370
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13036
13371
|
TextArea5,
|
|
13037
13372
|
{
|
|
13038
13373
|
value: config.envText,
|
|
@@ -13109,10 +13444,10 @@ QUEUE_NAME=tasks`,
|
|
|
13109
13444
|
}));
|
|
13110
13445
|
}
|
|
13111
13446
|
};
|
|
13112
|
-
return /* @__PURE__ */ (0,
|
|
13113
|
-
/* @__PURE__ */ (0,
|
|
13114
|
-
config.models.map((model, index) => /* @__PURE__ */ (0,
|
|
13115
|
-
/* @__PURE__ */ (0,
|
|
13447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: styles.formContainer, children: [
|
|
13448
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { style: { marginBottom: 32 }, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(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." }) }),
|
|
13449
|
+
config.models.map((model, index) => /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: styles.card, children: [
|
|
13450
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
13116
13451
|
"div",
|
|
13117
13452
|
{
|
|
13118
13453
|
style: {
|
|
@@ -13124,13 +13459,13 @@ QUEUE_NAME=tasks`,
|
|
|
13124
13459
|
borderBottom: "1px solid rgba(0, 0, 0, 0.06)"
|
|
13125
13460
|
},
|
|
13126
13461
|
children: [
|
|
13127
|
-
/* @__PURE__ */ (0,
|
|
13128
|
-
/* @__PURE__ */ (0,
|
|
13462
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { children: [
|
|
13463
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Text22, { strong: true, style: { fontSize: 16 }, children: [
|
|
13129
13464
|
"Model ",
|
|
13130
13465
|
index + 1
|
|
13131
13466
|
] }),
|
|
13132
|
-
model.key && /* @__PURE__ */ (0,
|
|
13133
|
-
|
|
13467
|
+
model.key && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
13468
|
+
Text22,
|
|
13134
13469
|
{
|
|
13135
13470
|
type: "secondary",
|
|
13136
13471
|
style: { marginLeft: 8, fontSize: 12 },
|
|
@@ -13142,8 +13477,8 @@ QUEUE_NAME=tasks`,
|
|
|
13142
13477
|
}
|
|
13143
13478
|
)
|
|
13144
13479
|
] }),
|
|
13145
|
-
config.models.length > 1 && /* @__PURE__ */ (0,
|
|
13146
|
-
|
|
13480
|
+
config.models.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13481
|
+
import_antd43.Button,
|
|
13147
13482
|
{
|
|
13148
13483
|
type: "text",
|
|
13149
13484
|
danger: true,
|
|
@@ -13159,11 +13494,11 @@ QUEUE_NAME=tasks`,
|
|
|
13159
13494
|
]
|
|
13160
13495
|
}
|
|
13161
13496
|
),
|
|
13162
|
-
/* @__PURE__ */ (0,
|
|
13163
|
-
/* @__PURE__ */ (0,
|
|
13164
|
-
/* @__PURE__ */ (0,
|
|
13165
|
-
/* @__PURE__ */ (0,
|
|
13166
|
-
|
|
13497
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_antd43.Space, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
|
|
13498
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { children: [
|
|
13499
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Text22, { className: styles.formLabel, children: "Key *" }),
|
|
13500
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13501
|
+
import_antd43.Input,
|
|
13167
13502
|
{
|
|
13168
13503
|
placeholder: "e.g., default, gpt-4, claude",
|
|
13169
13504
|
value: model.key,
|
|
@@ -13171,12 +13506,12 @@ QUEUE_NAME=tasks`,
|
|
|
13171
13506
|
style: { height: 40 }
|
|
13172
13507
|
}
|
|
13173
13508
|
),
|
|
13174
|
-
/* @__PURE__ */ (0,
|
|
13509
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Text22, { className: styles.formDescription, children: "Unique identifier for this model" })
|
|
13175
13510
|
] }),
|
|
13176
|
-
/* @__PURE__ */ (0,
|
|
13177
|
-
/* @__PURE__ */ (0,
|
|
13178
|
-
/* @__PURE__ */ (0,
|
|
13179
|
-
|
|
13511
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { children: [
|
|
13512
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Text22, { className: styles.formLabel, children: "Provider *" }),
|
|
13513
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13514
|
+
import_antd43.Select,
|
|
13180
13515
|
{
|
|
13181
13516
|
style: { width: "100%", height: 40 },
|
|
13182
13517
|
value: model.provider,
|
|
@@ -13191,10 +13526,10 @@ QUEUE_NAME=tasks`,
|
|
|
13191
13526
|
}
|
|
13192
13527
|
)
|
|
13193
13528
|
] }),
|
|
13194
|
-
/* @__PURE__ */ (0,
|
|
13195
|
-
/* @__PURE__ */ (0,
|
|
13196
|
-
/* @__PURE__ */ (0,
|
|
13197
|
-
|
|
13529
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { children: [
|
|
13530
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Text22, { className: styles.formLabel, children: "Model Name *" }),
|
|
13531
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13532
|
+
import_antd43.Input,
|
|
13198
13533
|
{
|
|
13199
13534
|
placeholder: "e.g., gpt-4, claude-3-opus, kimi-k2-250905",
|
|
13200
13535
|
value: model.model,
|
|
@@ -13203,10 +13538,10 @@ QUEUE_NAME=tasks`,
|
|
|
13203
13538
|
}
|
|
13204
13539
|
)
|
|
13205
13540
|
] }),
|
|
13206
|
-
/* @__PURE__ */ (0,
|
|
13207
|
-
/* @__PURE__ */ (0,
|
|
13208
|
-
/* @__PURE__ */ (0,
|
|
13209
|
-
|
|
13541
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { children: [
|
|
13542
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Text22, { className: styles.formLabel, children: "API Key" }),
|
|
13543
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13544
|
+
import_antd43.Input.Password,
|
|
13210
13545
|
{
|
|
13211
13546
|
placeholder: "Enter your API key",
|
|
13212
13547
|
value: model.apiKey,
|
|
@@ -13214,12 +13549,12 @@ QUEUE_NAME=tasks`,
|
|
|
13214
13549
|
style: { height: 40 }
|
|
13215
13550
|
}
|
|
13216
13551
|
),
|
|
13217
|
-
/* @__PURE__ */ (0,
|
|
13552
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Text22, { className: styles.formDescription, children: "API key for the model provider. Leave empty to use environment variable." })
|
|
13218
13553
|
] }),
|
|
13219
|
-
/* @__PURE__ */ (0,
|
|
13220
|
-
/* @__PURE__ */ (0,
|
|
13221
|
-
/* @__PURE__ */ (0,
|
|
13222
|
-
|
|
13554
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { children: [
|
|
13555
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Text22, { className: styles.formLabel, children: "Base URL" }),
|
|
13556
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13557
|
+
import_antd43.Input,
|
|
13223
13558
|
{
|
|
13224
13559
|
placeholder: "e.g., https://api.openai.com/v1",
|
|
13225
13560
|
value: model.baseURL,
|
|
@@ -13227,23 +13562,23 @@ QUEUE_NAME=tasks`,
|
|
|
13227
13562
|
style: { height: 40 }
|
|
13228
13563
|
}
|
|
13229
13564
|
),
|
|
13230
|
-
/* @__PURE__ */ (0,
|
|
13565
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Text22, { className: styles.formDescription, children: "Optional custom base URL for the API" })
|
|
13231
13566
|
] }),
|
|
13232
|
-
/* @__PURE__ */ (0,
|
|
13233
|
-
/* @__PURE__ */ (0,
|
|
13234
|
-
|
|
13567
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_antd43.Space, { children: [
|
|
13568
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13569
|
+
import_antd43.Switch,
|
|
13235
13570
|
{
|
|
13236
13571
|
checked: model.streaming,
|
|
13237
13572
|
onChange: (checked) => handleModelChange(index, "streaming", checked)
|
|
13238
13573
|
}
|
|
13239
13574
|
),
|
|
13240
|
-
/* @__PURE__ */ (0,
|
|
13575
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Text22, { children: "Enable Streaming" })
|
|
13241
13576
|
] }) }),
|
|
13242
|
-
/* @__PURE__ */ (0,
|
|
13243
|
-
/* @__PURE__ */ (0,
|
|
13244
|
-
/* @__PURE__ */ (0,
|
|
13245
|
-
/* @__PURE__ */ (0,
|
|
13246
|
-
|
|
13577
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { style: { display: "flex", gap: 20 }, children: [
|
|
13578
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { style: { flex: 1 }, children: [
|
|
13579
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Text22, { className: styles.formLabel, children: "Max Tokens" }),
|
|
13580
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13581
|
+
import_antd43.Input,
|
|
13247
13582
|
{
|
|
13248
13583
|
type: "number",
|
|
13249
13584
|
placeholder: "e.g., 4096",
|
|
@@ -13257,10 +13592,10 @@ QUEUE_NAME=tasks`,
|
|
|
13257
13592
|
}
|
|
13258
13593
|
)
|
|
13259
13594
|
] }),
|
|
13260
|
-
/* @__PURE__ */ (0,
|
|
13261
|
-
/* @__PURE__ */ (0,
|
|
13262
|
-
/* @__PURE__ */ (0,
|
|
13263
|
-
|
|
13595
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { style: { flex: 1 }, children: [
|
|
13596
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Text22, { className: styles.formLabel, children: "Temperature" }),
|
|
13597
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13598
|
+
import_antd43.Input,
|
|
13264
13599
|
{
|
|
13265
13600
|
type: "number",
|
|
13266
13601
|
step: "0.1",
|
|
@@ -13278,8 +13613,8 @@ QUEUE_NAME=tasks`,
|
|
|
13278
13613
|
] })
|
|
13279
13614
|
] })
|
|
13280
13615
|
] }, index)),
|
|
13281
|
-
/* @__PURE__ */ (0,
|
|
13282
|
-
|
|
13616
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13617
|
+
import_antd43.Button,
|
|
13283
13618
|
{
|
|
13284
13619
|
type: "dashed",
|
|
13285
13620
|
onClick: handleAddModel,
|
|
@@ -13306,9 +13641,9 @@ QUEUE_NAME=tasks`,
|
|
|
13306
13641
|
);
|
|
13307
13642
|
const currentConnection = connections.find((c) => c.id === activeTabKey);
|
|
13308
13643
|
const renderTabLabel = (connection) => {
|
|
13309
|
-
return /* @__PURE__ */ (0,
|
|
13310
|
-
/* @__PURE__ */ (0,
|
|
13311
|
-
|
|
13644
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { style: { display: "flex", alignItems: "center" }, children: [
|
|
13645
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13646
|
+
import_icons27.CloudServerOutlined,
|
|
13312
13647
|
{
|
|
13313
13648
|
style: {
|
|
13314
13649
|
marginRight: 8,
|
|
@@ -13316,15 +13651,15 @@ QUEUE_NAME=tasks`,
|
|
|
13316
13651
|
}
|
|
13317
13652
|
}
|
|
13318
13653
|
),
|
|
13319
|
-
/* @__PURE__ */ (0,
|
|
13320
|
-
connection.connected && /* @__PURE__ */ (0,
|
|
13321
|
-
|
|
13654
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { children: connection.name }),
|
|
13655
|
+
connection.connected && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13656
|
+
import_icons27.CheckCircleFilled,
|
|
13322
13657
|
{
|
|
13323
13658
|
style: { color: "#52c41a", fontSize: 12, marginLeft: 8 }
|
|
13324
13659
|
}
|
|
13325
13660
|
),
|
|
13326
|
-
connection.error && !connection.connecting && /* @__PURE__ */ (0,
|
|
13327
|
-
|
|
13661
|
+
connection.error && !connection.connecting && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13662
|
+
import_icons27.CloseCircleFilled,
|
|
13328
13663
|
{
|
|
13329
13664
|
style: { color: "#ff4d4f", fontSize: 12, marginLeft: 8 }
|
|
13330
13665
|
}
|
|
@@ -13334,35 +13669,35 @@ QUEUE_NAME=tasks`,
|
|
|
13334
13669
|
const tabItems = connections.map((connection) => ({
|
|
13335
13670
|
key: connection.id,
|
|
13336
13671
|
label: renderTabLabel(connection),
|
|
13337
|
-
children: /* @__PURE__ */ (0,
|
|
13338
|
-
/* @__PURE__ */ (0,
|
|
13672
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: styles.tabContent, children: connection.connected ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_jsx_runtime59.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { style: { display: "flex", height: "100%" }, children: [
|
|
13673
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: styles.sidebar, children: SETTINGS_MENU_ITEMS.map((item) => /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
13339
13674
|
"div",
|
|
13340
13675
|
{
|
|
13341
13676
|
className: `${styles.menuItem} ${activeMenu === item.key ? "active" : ""}`,
|
|
13342
13677
|
onClick: () => setActiveMenu(item.key),
|
|
13343
13678
|
children: [
|
|
13344
|
-
/* @__PURE__ */ (0,
|
|
13345
|
-
/* @__PURE__ */ (0,
|
|
13679
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: styles.menuItemIcon, children: item.icon }),
|
|
13680
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: styles.menuItemText, children: item.label })
|
|
13346
13681
|
]
|
|
13347
13682
|
},
|
|
13348
13683
|
item.key
|
|
13349
13684
|
)) }),
|
|
13350
|
-
/* @__PURE__ */ (0,
|
|
13351
|
-
/* @__PURE__ */ (0,
|
|
13352
|
-
/* @__PURE__ */ (0,
|
|
13353
|
-
/* @__PURE__ */ (0,
|
|
13354
|
-
/* @__PURE__ */ (0,
|
|
13685
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: styles.content, children: [
|
|
13686
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: styles.contentHeader, children: [
|
|
13687
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: styles.contentHeaderLeft, children: [
|
|
13688
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Title4, { level: 3, className: styles.contentTitle, children: activeMenuItem?.label }),
|
|
13689
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Text22, { className: styles.contentDescription, children: [
|
|
13355
13690
|
activeMenu === "environment" && "Manage environment variables for the gateway server",
|
|
13356
13691
|
activeMenu === "models" && "Configure and register model lattices for use by agents"
|
|
13357
13692
|
] })
|
|
13358
13693
|
] }),
|
|
13359
|
-
/* @__PURE__ */ (0,
|
|
13360
|
-
/* @__PURE__ */ (0,
|
|
13361
|
-
/* @__PURE__ */ (0,
|
|
13362
|
-
|
|
13694
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: styles.contentHeaderRight, children: [
|
|
13695
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_antd43.Button, { onClick: onClose, children: "Cancel" }),
|
|
13696
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13697
|
+
import_antd43.Button,
|
|
13363
13698
|
{
|
|
13364
13699
|
type: "primary",
|
|
13365
|
-
icon: /* @__PURE__ */ (0,
|
|
13700
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons27.SaveOutlined, {}),
|
|
13366
13701
|
onClick: handleSave,
|
|
13367
13702
|
loading,
|
|
13368
13703
|
children: "Save Configuration"
|
|
@@ -13370,9 +13705,9 @@ QUEUE_NAME=tasks`,
|
|
|
13370
13705
|
)
|
|
13371
13706
|
] })
|
|
13372
13707
|
] }),
|
|
13373
|
-
/* @__PURE__ */ (0,
|
|
13708
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: styles.contentBody, children: renderContent(connection.id) })
|
|
13374
13709
|
] })
|
|
13375
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
13710
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13376
13711
|
"div",
|
|
13377
13712
|
{
|
|
13378
13713
|
style: {
|
|
@@ -13384,29 +13719,29 @@ QUEUE_NAME=tasks`,
|
|
|
13384
13719
|
gap: 16,
|
|
13385
13720
|
padding: 48
|
|
13386
13721
|
},
|
|
13387
|
-
children: connection.connecting ? /* @__PURE__ */ (0,
|
|
13388
|
-
/* @__PURE__ */ (0,
|
|
13389
|
-
/* @__PURE__ */ (0,
|
|
13390
|
-
/* @__PURE__ */ (0,
|
|
13722
|
+
children: connection.connecting ? /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_jsx_runtime59.Fragment, { children: [
|
|
13723
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons27.LinkOutlined, { style: { fontSize: 64, color: "#1890ff" }, spin: true }),
|
|
13724
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Title4, { level: 4, children: "Connecting..." }),
|
|
13725
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Text22, { type: "secondary", style: { textAlign: "center" }, children: [
|
|
13391
13726
|
"Connecting to ",
|
|
13392
13727
|
connection.url
|
|
13393
13728
|
] })
|
|
13394
|
-
] }) : /* @__PURE__ */ (0,
|
|
13395
|
-
/* @__PURE__ */ (0,
|
|
13396
|
-
/* @__PURE__ */ (0,
|
|
13397
|
-
/* @__PURE__ */ (0,
|
|
13398
|
-
|
|
13729
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_jsx_runtime59.Fragment, { children: [
|
|
13730
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons27.LinkOutlined, { style: { fontSize: 64, color: "#d9d9d9" } }),
|
|
13731
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Title4, { level: 4, type: "secondary", children: connection.error || "Not Connected" }),
|
|
13732
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13733
|
+
Text22,
|
|
13399
13734
|
{
|
|
13400
13735
|
type: "secondary",
|
|
13401
13736
|
style: { textAlign: "center", maxWidth: 400 },
|
|
13402
13737
|
children: connection.error ? `Failed to connect to ${connection.url}. Please check the server URL and try again.` : `Click "Reconnect" to connect to ${connection.url}`
|
|
13403
13738
|
}
|
|
13404
13739
|
),
|
|
13405
|
-
/* @__PURE__ */ (0,
|
|
13406
|
-
|
|
13740
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13741
|
+
import_antd43.Button,
|
|
13407
13742
|
{
|
|
13408
13743
|
type: "primary",
|
|
13409
|
-
icon: /* @__PURE__ */ (0,
|
|
13744
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons27.LinkOutlined, {}),
|
|
13410
13745
|
onClick: () => checkConnection(connection.id),
|
|
13411
13746
|
loading: connection.connecting,
|
|
13412
13747
|
style: { marginTop: 16 },
|
|
@@ -13418,9 +13753,9 @@ QUEUE_NAME=tasks`,
|
|
|
13418
13753
|
) }),
|
|
13419
13754
|
closable: connections.length > 1
|
|
13420
13755
|
}));
|
|
13421
|
-
return /* @__PURE__ */ (0,
|
|
13422
|
-
/* @__PURE__ */ (0,
|
|
13423
|
-
|
|
13756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_jsx_runtime59.Fragment, { children: [
|
|
13757
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13758
|
+
import_antd43.Modal,
|
|
13424
13759
|
{
|
|
13425
13760
|
open,
|
|
13426
13761
|
onCancel: onClose,
|
|
@@ -13428,8 +13763,8 @@ QUEUE_NAME=tasks`,
|
|
|
13428
13763
|
width: "80%",
|
|
13429
13764
|
footer: null,
|
|
13430
13765
|
title: "Settings",
|
|
13431
|
-
children: /* @__PURE__ */ (0,
|
|
13432
|
-
|
|
13766
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13767
|
+
import_antd43.Tabs,
|
|
13433
13768
|
{
|
|
13434
13769
|
activeKey: activeTabKey,
|
|
13435
13770
|
onChange: handleTabChange,
|
|
@@ -13442,7 +13777,7 @@ QUEUE_NAME=tasks`,
|
|
|
13442
13777
|
}
|
|
13443
13778
|
},
|
|
13444
13779
|
items: tabItems,
|
|
13445
|
-
addIcon: /* @__PURE__ */ (0,
|
|
13780
|
+
addIcon: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
13446
13781
|
"div",
|
|
13447
13782
|
{
|
|
13448
13783
|
style: {
|
|
@@ -13452,8 +13787,8 @@ QUEUE_NAME=tasks`,
|
|
|
13452
13787
|
padding: "4px 8px"
|
|
13453
13788
|
},
|
|
13454
13789
|
children: [
|
|
13455
|
-
/* @__PURE__ */ (0,
|
|
13456
|
-
/* @__PURE__ */ (0,
|
|
13790
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons27.PlusOutlined, {}),
|
|
13791
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { children: "Add Server" })
|
|
13457
13792
|
]
|
|
13458
13793
|
}
|
|
13459
13794
|
)
|
|
@@ -13461,8 +13796,8 @@ QUEUE_NAME=tasks`,
|
|
|
13461
13796
|
) })
|
|
13462
13797
|
}
|
|
13463
13798
|
),
|
|
13464
|
-
/* @__PURE__ */ (0,
|
|
13465
|
-
|
|
13799
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13800
|
+
import_antd43.Modal,
|
|
13466
13801
|
{
|
|
13467
13802
|
title: "Add New Server",
|
|
13468
13803
|
open: showAddServerModal,
|
|
@@ -13475,11 +13810,11 @@ QUEUE_NAME=tasks`,
|
|
|
13475
13810
|
},
|
|
13476
13811
|
confirmLoading: addingServer,
|
|
13477
13812
|
className: styles.addServerModal,
|
|
13478
|
-
children: /* @__PURE__ */ (0,
|
|
13479
|
-
/* @__PURE__ */ (0,
|
|
13480
|
-
/* @__PURE__ */ (0,
|
|
13481
|
-
/* @__PURE__ */ (0,
|
|
13482
|
-
|
|
13813
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_antd43.Space, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
|
|
13814
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { children: [
|
|
13815
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Text22, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server Name" }),
|
|
13816
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13817
|
+
import_antd43.Input,
|
|
13483
13818
|
{
|
|
13484
13819
|
placeholder: "e.g., Production Server",
|
|
13485
13820
|
value: newServerName,
|
|
@@ -13487,12 +13822,12 @@ QUEUE_NAME=tasks`,
|
|
|
13487
13822
|
onPressEnter: handleAddServer
|
|
13488
13823
|
}
|
|
13489
13824
|
),
|
|
13490
|
-
/* @__PURE__ */ (0,
|
|
13825
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Text22, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: Leave empty to use URL as name" })
|
|
13491
13826
|
] }),
|
|
13492
|
-
/* @__PURE__ */ (0,
|
|
13493
|
-
/* @__PURE__ */ (0,
|
|
13494
|
-
/* @__PURE__ */ (0,
|
|
13495
|
-
|
|
13827
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { children: [
|
|
13828
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Text22, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server URL *" }),
|
|
13829
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13830
|
+
import_antd43.Input,
|
|
13496
13831
|
{
|
|
13497
13832
|
placeholder: "e.g., http://localhost:4001",
|
|
13498
13833
|
value: newServerUrl,
|
|
@@ -13500,12 +13835,12 @@ QUEUE_NAME=tasks`,
|
|
|
13500
13835
|
onPressEnter: handleAddServer
|
|
13501
13836
|
}
|
|
13502
13837
|
),
|
|
13503
|
-
/* @__PURE__ */ (0,
|
|
13838
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Text22, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Enter the full URL of the gateway server" })
|
|
13504
13839
|
] }),
|
|
13505
|
-
/* @__PURE__ */ (0,
|
|
13506
|
-
/* @__PURE__ */ (0,
|
|
13507
|
-
/* @__PURE__ */ (0,
|
|
13508
|
-
|
|
13840
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { children: [
|
|
13841
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Text22, { strong: true, style: { display: "block", marginBottom: 8 }, children: "API Key" }),
|
|
13842
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13843
|
+
import_antd43.Input.Password,
|
|
13509
13844
|
{
|
|
13510
13845
|
placeholder: "Optional: Enter API key for authentication",
|
|
13511
13846
|
value: newServerApiKey,
|
|
@@ -13513,7 +13848,7 @@ QUEUE_NAME=tasks`,
|
|
|
13513
13848
|
onPressEnter: handleAddServer
|
|
13514
13849
|
}
|
|
13515
13850
|
),
|
|
13516
|
-
/* @__PURE__ */ (0,
|
|
13851
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Text22, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: API key for server authentication" })
|
|
13517
13852
|
] })
|
|
13518
13853
|
] })
|
|
13519
13854
|
}
|
|
@@ -13522,10 +13857,10 @@ QUEUE_NAME=tasks`,
|
|
|
13522
13857
|
};
|
|
13523
13858
|
|
|
13524
13859
|
// src/components/Chat/AgentServerSetting.tsx
|
|
13525
|
-
var
|
|
13860
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
13526
13861
|
var AgentServerSetting = () => {
|
|
13527
13862
|
const { settingsModalOpen, setSettingsModalOpen } = useLatticeChatShellContext();
|
|
13528
|
-
return /* @__PURE__ */ (0,
|
|
13863
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
13529
13864
|
SettingsModal,
|
|
13530
13865
|
{
|
|
13531
13866
|
open: settingsModalOpen,
|
|
@@ -13535,10 +13870,10 @@ var AgentServerSetting = () => {
|
|
|
13535
13870
|
};
|
|
13536
13871
|
|
|
13537
13872
|
// src/components/Chat/LatticeChatShell.tsx
|
|
13538
|
-
var
|
|
13873
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
13539
13874
|
var LatticeChatShell = (props) => {
|
|
13540
13875
|
const { enableAssistantCreation, enableAssistantEditing, ...restProps } = props;
|
|
13541
|
-
return /* @__PURE__ */ (0,
|
|
13876
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
13542
13877
|
LatticeChatShellContextProvider,
|
|
13543
13878
|
{
|
|
13544
13879
|
initialConfig: {
|
|
@@ -13547,8 +13882,8 @@ var LatticeChatShell = (props) => {
|
|
|
13547
13882
|
...restProps.initialConfig
|
|
13548
13883
|
},
|
|
13549
13884
|
children: [
|
|
13550
|
-
/* @__PURE__ */ (0,
|
|
13551
|
-
/* @__PURE__ */ (0,
|
|
13885
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(AssistantContextProvider, { autoLoad: true, initialAssistantId: restProps.initialConfig?.assistantId, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ConversationContextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(LatticeChatView, {}) }) }),
|
|
13886
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(AgentServerSetting, {})
|
|
13552
13887
|
]
|
|
13553
13888
|
}
|
|
13554
13889
|
);
|