@axiom-lattice/react-sdk 2.1.13 → 2.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +398 -371
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +356 -329
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4449,6 +4449,9 @@ var LatticeChatShellContext = createContext4({
|
|
|
4449
4449
|
updateConfigValue: () => {
|
|
4450
4450
|
},
|
|
4451
4451
|
resetConfig: () => {
|
|
4452
|
+
},
|
|
4453
|
+
settingsModalOpen: false,
|
|
4454
|
+
setSettingsModalOpen: () => {
|
|
4452
4455
|
}
|
|
4453
4456
|
});
|
|
4454
4457
|
var LatticeChatShellContextProvider = ({
|
|
@@ -4472,6 +4475,7 @@ var LatticeChatShellContextProvider = ({
|
|
|
4472
4475
|
return { ...DEFAULT_CONFIG, ...initialConfig };
|
|
4473
4476
|
}, [persistToLocalStorage, localStorageKey, initialConfig]);
|
|
4474
4477
|
const [config, setConfig] = useState17(loadInitialConfig);
|
|
4478
|
+
const [settingsModalOpen, setSettingsModalOpen] = useState17(false);
|
|
4475
4479
|
const saveToLocalStorage = useCallback8(
|
|
4476
4480
|
(newConfig) => {
|
|
4477
4481
|
if (persistToLocalStorage && typeof window !== "undefined") {
|
|
@@ -4516,7 +4520,9 @@ var LatticeChatShellContextProvider = ({
|
|
|
4516
4520
|
config,
|
|
4517
4521
|
updateConfig,
|
|
4518
4522
|
updateConfigValue,
|
|
4519
|
-
resetConfig
|
|
4523
|
+
resetConfig,
|
|
4524
|
+
settingsModalOpen,
|
|
4525
|
+
setSettingsModalOpen
|
|
4520
4526
|
},
|
|
4521
4527
|
children
|
|
4522
4528
|
}
|
|
@@ -4741,22 +4747,30 @@ var AssistantContextProvider = ({
|
|
|
4741
4747
|
}
|
|
4742
4748
|
}, [autoLoad, listAssistants]);
|
|
4743
4749
|
useEffect12(() => {
|
|
4744
|
-
if (state.assistants.length > 0
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
+
if (state.assistants.length > 0) {
|
|
4751
|
+
const isCurrentAssistantValid = state.currentAssistant && state.assistants.some((a) => a.id === state.currentAssistant?.id);
|
|
4752
|
+
if (!isCurrentAssistantValid) {
|
|
4753
|
+
if (initialAssistantId) {
|
|
4754
|
+
const assistant = state.assistants.find(
|
|
4755
|
+
(a) => a.id === initialAssistantId
|
|
4756
|
+
);
|
|
4757
|
+
if (assistant) {
|
|
4758
|
+
setState((prev) => ({
|
|
4759
|
+
...prev,
|
|
4760
|
+
currentAssistant: assistant
|
|
4761
|
+
}));
|
|
4762
|
+
} else {
|
|
4763
|
+
setState((prev) => ({
|
|
4764
|
+
...prev,
|
|
4765
|
+
currentAssistant: prev.assistants[0]
|
|
4766
|
+
}));
|
|
4767
|
+
}
|
|
4768
|
+
} else {
|
|
4750
4769
|
setState((prev) => ({
|
|
4751
4770
|
...prev,
|
|
4752
|
-
currentAssistant:
|
|
4771
|
+
currentAssistant: prev.assistants[0]
|
|
4753
4772
|
}));
|
|
4754
4773
|
}
|
|
4755
|
-
} else {
|
|
4756
|
-
setState((prev) => ({
|
|
4757
|
-
...prev,
|
|
4758
|
-
currentAssistant: prev.assistants[0]
|
|
4759
|
-
}));
|
|
4760
4774
|
}
|
|
4761
4775
|
}
|
|
4762
4776
|
}, [initialAssistantId, state.assistants, state.currentAssistant]);
|
|
@@ -5139,7 +5153,6 @@ var AgentConversations = () => {
|
|
|
5139
5153
|
};
|
|
5140
5154
|
|
|
5141
5155
|
// src/components/Chat/ChatSidebar.tsx
|
|
5142
|
-
import { useState as useState21 } from "react";
|
|
5143
5156
|
import { Divider as Divider2 } from "antd";
|
|
5144
5157
|
import {
|
|
5145
5158
|
MenuFoldOutlined,
|
|
@@ -5188,7 +5201,201 @@ var AssistantList = () => {
|
|
|
5188
5201
|
};
|
|
5189
5202
|
|
|
5190
5203
|
// src/components/Chat/ChatSidebar.tsx
|
|
5191
|
-
import { createStyles as
|
|
5204
|
+
import { createStyles as createStyles10 } from "antd-style";
|
|
5205
|
+
import { Fragment as Fragment5, jsx as jsx37, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
5206
|
+
var useStyles3 = createStyles10(({ token, css }) => ({
|
|
5207
|
+
sidebar: css`
|
|
5208
|
+
display: flex;
|
|
5209
|
+
flex-direction: column;
|
|
5210
|
+
height: 100%;
|
|
5211
|
+
width: 100%;
|
|
5212
|
+
position: relative;
|
|
5213
|
+
background: transparent;
|
|
5214
|
+
border-radius: ${token.borderRadiusLG}px;
|
|
5215
|
+
overflow: hidden;
|
|
5216
|
+
`,
|
|
5217
|
+
content: css`
|
|
5218
|
+
flex: 1;
|
|
5219
|
+
overflow-y: auto;
|
|
5220
|
+
overflow-x: hidden;
|
|
5221
|
+
padding: ${token.paddingMD}px ${token.paddingSM}px;
|
|
5222
|
+
padding-bottom: ${token.paddingLG}px;
|
|
5223
|
+
|
|
5224
|
+
/* Custom scrollbar styling */
|
|
5225
|
+
&::-webkit-scrollbar {
|
|
5226
|
+
width: 6px;
|
|
5227
|
+
}
|
|
5228
|
+
|
|
5229
|
+
&::-webkit-scrollbar-track {
|
|
5230
|
+
background: transparent;
|
|
5231
|
+
}
|
|
5232
|
+
|
|
5233
|
+
&::-webkit-scrollbar-thumb {
|
|
5234
|
+
background: ${token.colorBorder};
|
|
5235
|
+
border-radius: 3px;
|
|
5236
|
+
|
|
5237
|
+
&:hover {
|
|
5238
|
+
background: ${token.colorBorderSecondary};
|
|
5239
|
+
}
|
|
5240
|
+
}
|
|
5241
|
+
`,
|
|
5242
|
+
section: css`
|
|
5243
|
+
margin-bottom: ${token.marginLG}px;
|
|
5244
|
+
|
|
5245
|
+
&:last-child {
|
|
5246
|
+
margin-bottom: 0;
|
|
5247
|
+
}
|
|
5248
|
+
`,
|
|
5249
|
+
sectionTitle: css`
|
|
5250
|
+
font-size: ${token.fontSizeSM}px;
|
|
5251
|
+
font-weight: 600;
|
|
5252
|
+
color: ${token.colorTextSecondary};
|
|
5253
|
+
text-transform: uppercase;
|
|
5254
|
+
letter-spacing: 0.5px;
|
|
5255
|
+
padding: 0 ${token.paddingXS}px;
|
|
5256
|
+
margin-bottom: ${token.marginSM}px;
|
|
5257
|
+
`,
|
|
5258
|
+
footer: css`
|
|
5259
|
+
display: flex;
|
|
5260
|
+
justify-content: center;
|
|
5261
|
+
align-items: center;
|
|
5262
|
+
padding: ${token.paddingSM}px;
|
|
5263
|
+
background: transparent;
|
|
5264
|
+
border-top: 1px solid ${token.colorBorderSecondary};
|
|
5265
|
+
gap: ${token.marginXS}px;
|
|
5266
|
+
flex-shrink: 0;
|
|
5267
|
+
position: relative;
|
|
5268
|
+
|
|
5269
|
+
&::before {
|
|
5270
|
+
content: "";
|
|
5271
|
+
position: absolute;
|
|
5272
|
+
top: 0;
|
|
5273
|
+
left: 0;
|
|
5274
|
+
right: 0;
|
|
5275
|
+
height: 1px;
|
|
5276
|
+
background: linear-gradient(
|
|
5277
|
+
90deg,
|
|
5278
|
+
transparent,
|
|
5279
|
+
${token.colorBorder},
|
|
5280
|
+
transparent
|
|
5281
|
+
);
|
|
5282
|
+
}
|
|
5283
|
+
`,
|
|
5284
|
+
actionButton: css`
|
|
5285
|
+
display: flex;
|
|
5286
|
+
align-items: center;
|
|
5287
|
+
justify-content: center;
|
|
5288
|
+
width: 36px;
|
|
5289
|
+
height: 36px;
|
|
5290
|
+
border-radius: ${token.borderRadius}px;
|
|
5291
|
+
border: none;
|
|
5292
|
+
background: ${token.colorBgContainer};
|
|
5293
|
+
color: ${token.colorTextSecondary};
|
|
5294
|
+
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
5295
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
|
|
5296
|
+
|
|
5297
|
+
&:hover {
|
|
5298
|
+
background: ${token.colorPrimaryBg};
|
|
5299
|
+
color: ${token.colorPrimary};
|
|
5300
|
+
transform: translateY(-1px);
|
|
5301
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
|
|
5302
|
+
}
|
|
5303
|
+
|
|
5304
|
+
&:active {
|
|
5305
|
+
transform: translateY(0);
|
|
5306
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
|
|
5307
|
+
}
|
|
5308
|
+
|
|
5309
|
+
.anticon {
|
|
5310
|
+
font-size: 16px;
|
|
5311
|
+
}
|
|
5312
|
+
`,
|
|
5313
|
+
divider: css`
|
|
5314
|
+
margin: ${token.marginMD}px 0;
|
|
5315
|
+
border-color: ${token.colorBorderSecondary};
|
|
5316
|
+
`
|
|
5317
|
+
}));
|
|
5318
|
+
var ChatSidebar = ({
|
|
5319
|
+
onSettingsClick,
|
|
5320
|
+
defaultCollapsed = false
|
|
5321
|
+
}) => {
|
|
5322
|
+
const { styles } = useStyles3();
|
|
5323
|
+
const { setMenuCollapsed, menuCollapsed } = useChatUIContext();
|
|
5324
|
+
const { setSettingsModalOpen } = useLatticeChatShellContext();
|
|
5325
|
+
const handleToggleCollapse = () => {
|
|
5326
|
+
setMenuCollapsed(!menuCollapsed);
|
|
5327
|
+
};
|
|
5328
|
+
const handleSettingsClick = () => {
|
|
5329
|
+
setSettingsModalOpen(true);
|
|
5330
|
+
onSettingsClick?.();
|
|
5331
|
+
};
|
|
5332
|
+
return /* @__PURE__ */ jsx37(Fragment5, { children: /* @__PURE__ */ jsxs19("div", { className: styles.sidebar, children: [
|
|
5333
|
+
!menuCollapsed && /* @__PURE__ */ jsxs19("div", { className: styles.content, children: [
|
|
5334
|
+
/* @__PURE__ */ jsxs19("div", { className: styles.section, children: [
|
|
5335
|
+
/* @__PURE__ */ jsx37("div", { className: styles.sectionTitle, children: "Assistants" }),
|
|
5336
|
+
/* @__PURE__ */ jsx37(AssistantList, {})
|
|
5337
|
+
] }),
|
|
5338
|
+
/* @__PURE__ */ jsx37(Divider2, { className: styles.divider }),
|
|
5339
|
+
/* @__PURE__ */ jsxs19("div", { className: styles.section, children: [
|
|
5340
|
+
/* @__PURE__ */ jsx37("div", { className: styles.sectionTitle, children: "Threads" }),
|
|
5341
|
+
/* @__PURE__ */ jsx37(AgentConversations, {})
|
|
5342
|
+
] })
|
|
5343
|
+
] }),
|
|
5344
|
+
/* @__PURE__ */ jsxs19("div", { className: styles.footer, children: [
|
|
5345
|
+
/* @__PURE__ */ jsx37(
|
|
5346
|
+
"button",
|
|
5347
|
+
{
|
|
5348
|
+
className: styles.actionButton,
|
|
5349
|
+
onClick: handleToggleCollapse,
|
|
5350
|
+
title: menuCollapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
5351
|
+
"aria-label": menuCollapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
5352
|
+
children: menuCollapsed ? /* @__PURE__ */ jsx37(MenuUnfoldOutlined, {}) : /* @__PURE__ */ jsx37(MenuFoldOutlined, {})
|
|
5353
|
+
}
|
|
5354
|
+
),
|
|
5355
|
+
!menuCollapsed && /* @__PURE__ */ jsx37(
|
|
5356
|
+
"button",
|
|
5357
|
+
{
|
|
5358
|
+
className: styles.actionButton,
|
|
5359
|
+
onClick: handleSettingsClick,
|
|
5360
|
+
title: "Settings",
|
|
5361
|
+
"aria-label": "Settings",
|
|
5362
|
+
children: /* @__PURE__ */ jsx37(SettingOutlined, {})
|
|
5363
|
+
}
|
|
5364
|
+
)
|
|
5365
|
+
] })
|
|
5366
|
+
] }) });
|
|
5367
|
+
};
|
|
5368
|
+
|
|
5369
|
+
// src/components/Chat/LatticeChatView.tsx
|
|
5370
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
5371
|
+
var LatticeChatView = (props) => {
|
|
5372
|
+
const { assistantId, thread } = useConversationContext();
|
|
5373
|
+
const { currentAssistant } = useAssistantContext();
|
|
5374
|
+
const {
|
|
5375
|
+
config: { baseURL }
|
|
5376
|
+
} = useLatticeChatShellContext();
|
|
5377
|
+
return assistantId && thread ? /* @__PURE__ */ jsx38(
|
|
5378
|
+
AxiomLatticeProvider,
|
|
5379
|
+
{
|
|
5380
|
+
config: {
|
|
5381
|
+
baseURL,
|
|
5382
|
+
apiKey: "",
|
|
5383
|
+
assistantId,
|
|
5384
|
+
transport: "sse"
|
|
5385
|
+
},
|
|
5386
|
+
children: /* @__PURE__ */ jsx38(
|
|
5387
|
+
LatticeChat,
|
|
5388
|
+
{
|
|
5389
|
+
thread_id: thread?.id,
|
|
5390
|
+
assistant_id: assistantId,
|
|
5391
|
+
name: currentAssistant?.name,
|
|
5392
|
+
description: currentAssistant?.description,
|
|
5393
|
+
menu: /* @__PURE__ */ jsx38(ChatSidebar, {})
|
|
5394
|
+
}
|
|
5395
|
+
)
|
|
5396
|
+
}
|
|
5397
|
+
) : null;
|
|
5398
|
+
};
|
|
5192
5399
|
|
|
5193
5400
|
// src/components/Chat/SettingsModal.tsx
|
|
5194
5401
|
import { useState as useState20, useEffect as useEffect14, useRef as useRef11 } from "react";
|
|
@@ -5217,11 +5424,11 @@ import {
|
|
|
5217
5424
|
PlusOutlined,
|
|
5218
5425
|
CloudServerOutlined
|
|
5219
5426
|
} from "@ant-design/icons";
|
|
5220
|
-
import { createStyles as
|
|
5221
|
-
import { Fragment as
|
|
5427
|
+
import { createStyles as createStyles11 } from "antd-style";
|
|
5428
|
+
import { Fragment as Fragment6, jsx as jsx39, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
5222
5429
|
var { Text: Text11, Title: Title2 } = Typography13;
|
|
5223
5430
|
var { TextArea } = Input;
|
|
5224
|
-
var
|
|
5431
|
+
var useStyles4 = createStyles11(({ token, css }) => ({
|
|
5225
5432
|
// settingsModal: css`
|
|
5226
5433
|
// .ant-modal {
|
|
5227
5434
|
// max-width: 100vw !important;
|
|
@@ -5567,19 +5774,19 @@ var SETTINGS_MENU_ITEMS = [
|
|
|
5567
5774
|
{
|
|
5568
5775
|
key: "environment",
|
|
5569
5776
|
label: "Environment Variables",
|
|
5570
|
-
icon: /* @__PURE__ */
|
|
5777
|
+
icon: /* @__PURE__ */ jsx39(EnvironmentOutlined, {})
|
|
5571
5778
|
},
|
|
5572
5779
|
{
|
|
5573
5780
|
key: "models",
|
|
5574
5781
|
label: "Model Configuration",
|
|
5575
|
-
icon: /* @__PURE__ */
|
|
5782
|
+
icon: /* @__PURE__ */ jsx39(ApiOutlined, {})
|
|
5576
5783
|
}
|
|
5577
5784
|
];
|
|
5578
5785
|
var SettingsModal = ({
|
|
5579
5786
|
open,
|
|
5580
5787
|
onClose
|
|
5581
5788
|
}) => {
|
|
5582
|
-
const { styles } =
|
|
5789
|
+
const { styles } = useStyles4();
|
|
5583
5790
|
const { config: shellConfig, updateConfigValue } = useLatticeChatShellContext();
|
|
5584
5791
|
const [connections, setConnections] = useState20(() => {
|
|
5585
5792
|
if (typeof window !== "undefined") {
|
|
@@ -5675,11 +5882,11 @@ var SettingsModal = ({
|
|
|
5675
5882
|
});
|
|
5676
5883
|
clearTimeout(timeoutId);
|
|
5677
5884
|
if (response.ok) {
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5885
|
+
setConnections(
|
|
5886
|
+
(prev) => prev.map(
|
|
5887
|
+
(conn) => conn.id === serverId ? { ...conn, connected: true, connecting: false, error: "" } : { ...conn, connected: false, connecting: false }
|
|
5888
|
+
)
|
|
5889
|
+
);
|
|
5683
5890
|
if (url !== shellConfig.baseURL) {
|
|
5684
5891
|
updateConfigValue("baseURL", url);
|
|
5685
5892
|
}
|
|
@@ -5876,6 +6083,15 @@ var SettingsModal = ({
|
|
|
5876
6083
|
}
|
|
5877
6084
|
message4.success("Server deleted");
|
|
5878
6085
|
};
|
|
6086
|
+
const handleTabChange = (newTabKey) => {
|
|
6087
|
+
setConnections(
|
|
6088
|
+
(prev) => prev.map(
|
|
6089
|
+
(conn) => conn.id === newTabKey ? conn : { ...conn, connected: false, connecting: false }
|
|
6090
|
+
// Disconnect others
|
|
6091
|
+
)
|
|
6092
|
+
);
|
|
6093
|
+
setActiveTabKey(newTabKey);
|
|
6094
|
+
};
|
|
5879
6095
|
const handleSave = async () => {
|
|
5880
6096
|
const connection = connections.find((c) => c.id === activeTabKey);
|
|
5881
6097
|
if (!connection || !connection.connected) {
|
|
@@ -6009,25 +6225,25 @@ var SettingsModal = ({
|
|
|
6009
6225
|
}
|
|
6010
6226
|
}));
|
|
6011
6227
|
};
|
|
6012
|
-
return /* @__PURE__ */
|
|
6013
|
-
/* @__PURE__ */
|
|
6228
|
+
return /* @__PURE__ */ jsxs20("div", { className: styles.formContainer, children: [
|
|
6229
|
+
/* @__PURE__ */ jsx39(
|
|
6014
6230
|
Alert3,
|
|
6015
6231
|
{
|
|
6016
6232
|
message: "Configuration Effect",
|
|
6017
|
-
description: /* @__PURE__ */
|
|
6018
|
-
/* @__PURE__ */
|
|
6019
|
-
/* @__PURE__ */
|
|
6233
|
+
description: /* @__PURE__ */ jsxs20("div", { children: [
|
|
6234
|
+
/* @__PURE__ */ jsxs20("div", { style: { marginBottom: 8 }, children: [
|
|
6235
|
+
/* @__PURE__ */ jsx39(
|
|
6020
6236
|
CheckCircleOutlined4,
|
|
6021
6237
|
{
|
|
6022
6238
|
style: { color: "#52c41a", marginRight: 8 }
|
|
6023
6239
|
}
|
|
6024
6240
|
),
|
|
6025
|
-
/* @__PURE__ */
|
|
6241
|
+
/* @__PURE__ */ jsx39("strong", { children: "Immediately effective:" }),
|
|
6026
6242
|
" QUEUE_SERVICE_TYPE, REDIS_URL, REDIS_PASSWORD, QUEUE_NAME"
|
|
6027
6243
|
] }),
|
|
6028
|
-
/* @__PURE__ */
|
|
6029
|
-
/* @__PURE__ */
|
|
6030
|
-
/* @__PURE__ */
|
|
6244
|
+
/* @__PURE__ */ jsxs20("div", { children: [
|
|
6245
|
+
/* @__PURE__ */ jsx39(ReloadOutlined2, { style: { color: "#faad14", marginRight: 8 } }),
|
|
6246
|
+
/* @__PURE__ */ jsx39("strong", { children: "Requires restart:" }),
|
|
6031
6247
|
" PORT (server must be restarted to change port)"
|
|
6032
6248
|
] })
|
|
6033
6249
|
] }),
|
|
@@ -6036,8 +6252,8 @@ var SettingsModal = ({
|
|
|
6036
6252
|
className: styles.alertCard
|
|
6037
6253
|
}
|
|
6038
6254
|
),
|
|
6039
|
-
/* @__PURE__ */
|
|
6040
|
-
/* @__PURE__ */
|
|
6255
|
+
/* @__PURE__ */ jsx39("div", { style: { marginBottom: 24 }, children: /* @__PURE__ */ jsx39(Text11, { 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." }) }),
|
|
6256
|
+
/* @__PURE__ */ jsx39(
|
|
6041
6257
|
TextArea,
|
|
6042
6258
|
{
|
|
6043
6259
|
value: config.envText,
|
|
@@ -6114,10 +6330,10 @@ QUEUE_NAME=tasks`,
|
|
|
6114
6330
|
}));
|
|
6115
6331
|
}
|
|
6116
6332
|
};
|
|
6117
|
-
return /* @__PURE__ */
|
|
6118
|
-
/* @__PURE__ */
|
|
6119
|
-
config.models.map((model, index) => /* @__PURE__ */
|
|
6120
|
-
/* @__PURE__ */
|
|
6333
|
+
return /* @__PURE__ */ jsxs20("div", { className: styles.formContainer, children: [
|
|
6334
|
+
/* @__PURE__ */ jsx39("div", { style: { marginBottom: 32 }, children: /* @__PURE__ */ jsx39(Text11, { 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." }) }),
|
|
6335
|
+
config.models.map((model, index) => /* @__PURE__ */ jsxs20("div", { className: styles.card, children: [
|
|
6336
|
+
/* @__PURE__ */ jsxs20(
|
|
6121
6337
|
"div",
|
|
6122
6338
|
{
|
|
6123
6339
|
style: {
|
|
@@ -6129,12 +6345,12 @@ QUEUE_NAME=tasks`,
|
|
|
6129
6345
|
borderBottom: "1px solid rgba(0, 0, 0, 0.06)"
|
|
6130
6346
|
},
|
|
6131
6347
|
children: [
|
|
6132
|
-
/* @__PURE__ */
|
|
6133
|
-
/* @__PURE__ */
|
|
6348
|
+
/* @__PURE__ */ jsxs20("div", { children: [
|
|
6349
|
+
/* @__PURE__ */ jsxs20(Text11, { strong: true, style: { fontSize: 16 }, children: [
|
|
6134
6350
|
"Model ",
|
|
6135
6351
|
index + 1
|
|
6136
6352
|
] }),
|
|
6137
|
-
model.key && /* @__PURE__ */
|
|
6353
|
+
model.key && /* @__PURE__ */ jsxs20(
|
|
6138
6354
|
Text11,
|
|
6139
6355
|
{
|
|
6140
6356
|
type: "secondary",
|
|
@@ -6147,7 +6363,7 @@ QUEUE_NAME=tasks`,
|
|
|
6147
6363
|
}
|
|
6148
6364
|
)
|
|
6149
6365
|
] }),
|
|
6150
|
-
config.models.length > 1 && /* @__PURE__ */
|
|
6366
|
+
config.models.length > 1 && /* @__PURE__ */ jsx39(
|
|
6151
6367
|
Button12,
|
|
6152
6368
|
{
|
|
6153
6369
|
type: "text",
|
|
@@ -6164,10 +6380,10 @@ QUEUE_NAME=tasks`,
|
|
|
6164
6380
|
]
|
|
6165
6381
|
}
|
|
6166
6382
|
),
|
|
6167
|
-
/* @__PURE__ */
|
|
6168
|
-
/* @__PURE__ */
|
|
6169
|
-
/* @__PURE__ */
|
|
6170
|
-
/* @__PURE__ */
|
|
6383
|
+
/* @__PURE__ */ jsxs20(Space13, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
|
|
6384
|
+
/* @__PURE__ */ jsxs20("div", { children: [
|
|
6385
|
+
/* @__PURE__ */ jsx39(Text11, { className: styles.formLabel, children: "Key *" }),
|
|
6386
|
+
/* @__PURE__ */ jsx39(
|
|
6171
6387
|
Input,
|
|
6172
6388
|
{
|
|
6173
6389
|
placeholder: "e.g., default, gpt-4, claude",
|
|
@@ -6176,11 +6392,11 @@ QUEUE_NAME=tasks`,
|
|
|
6176
6392
|
style: { height: 40 }
|
|
6177
6393
|
}
|
|
6178
6394
|
),
|
|
6179
|
-
/* @__PURE__ */
|
|
6395
|
+
/* @__PURE__ */ jsx39(Text11, { className: styles.formDescription, children: "Unique identifier for this model" })
|
|
6180
6396
|
] }),
|
|
6181
|
-
/* @__PURE__ */
|
|
6182
|
-
/* @__PURE__ */
|
|
6183
|
-
/* @__PURE__ */
|
|
6397
|
+
/* @__PURE__ */ jsxs20("div", { children: [
|
|
6398
|
+
/* @__PURE__ */ jsx39(Text11, { className: styles.formLabel, children: "Provider *" }),
|
|
6399
|
+
/* @__PURE__ */ jsx39(
|
|
6184
6400
|
Select,
|
|
6185
6401
|
{
|
|
6186
6402
|
style: { width: "100%", height: 40 },
|
|
@@ -6196,9 +6412,9 @@ QUEUE_NAME=tasks`,
|
|
|
6196
6412
|
}
|
|
6197
6413
|
)
|
|
6198
6414
|
] }),
|
|
6199
|
-
/* @__PURE__ */
|
|
6200
|
-
/* @__PURE__ */
|
|
6201
|
-
/* @__PURE__ */
|
|
6415
|
+
/* @__PURE__ */ jsxs20("div", { children: [
|
|
6416
|
+
/* @__PURE__ */ jsx39(Text11, { className: styles.formLabel, children: "Model Name *" }),
|
|
6417
|
+
/* @__PURE__ */ jsx39(
|
|
6202
6418
|
Input,
|
|
6203
6419
|
{
|
|
6204
6420
|
placeholder: "e.g., gpt-4, claude-3-opus, kimi-k2-250905",
|
|
@@ -6208,9 +6424,9 @@ QUEUE_NAME=tasks`,
|
|
|
6208
6424
|
}
|
|
6209
6425
|
)
|
|
6210
6426
|
] }),
|
|
6211
|
-
/* @__PURE__ */
|
|
6212
|
-
/* @__PURE__ */
|
|
6213
|
-
/* @__PURE__ */
|
|
6427
|
+
/* @__PURE__ */ jsxs20("div", { children: [
|
|
6428
|
+
/* @__PURE__ */ jsx39(Text11, { className: styles.formLabel, children: "API Key" }),
|
|
6429
|
+
/* @__PURE__ */ jsx39(
|
|
6214
6430
|
Input.Password,
|
|
6215
6431
|
{
|
|
6216
6432
|
placeholder: "Enter your API key",
|
|
@@ -6219,11 +6435,11 @@ QUEUE_NAME=tasks`,
|
|
|
6219
6435
|
style: { height: 40 }
|
|
6220
6436
|
}
|
|
6221
6437
|
),
|
|
6222
|
-
/* @__PURE__ */
|
|
6438
|
+
/* @__PURE__ */ jsx39(Text11, { className: styles.formDescription, children: "API key for the model provider. Leave empty to use environment variable." })
|
|
6223
6439
|
] }),
|
|
6224
|
-
/* @__PURE__ */
|
|
6225
|
-
/* @__PURE__ */
|
|
6226
|
-
/* @__PURE__ */
|
|
6440
|
+
/* @__PURE__ */ jsxs20("div", { children: [
|
|
6441
|
+
/* @__PURE__ */ jsx39(Text11, { className: styles.formLabel, children: "Base URL" }),
|
|
6442
|
+
/* @__PURE__ */ jsx39(
|
|
6227
6443
|
Input,
|
|
6228
6444
|
{
|
|
6229
6445
|
placeholder: "e.g., https://api.openai.com/v1",
|
|
@@ -6232,22 +6448,22 @@ QUEUE_NAME=tasks`,
|
|
|
6232
6448
|
style: { height: 40 }
|
|
6233
6449
|
}
|
|
6234
6450
|
),
|
|
6235
|
-
/* @__PURE__ */
|
|
6451
|
+
/* @__PURE__ */ jsx39(Text11, { className: styles.formDescription, children: "Optional custom base URL for the API" })
|
|
6236
6452
|
] }),
|
|
6237
|
-
/* @__PURE__ */
|
|
6238
|
-
/* @__PURE__ */
|
|
6453
|
+
/* @__PURE__ */ jsx39("div", { children: /* @__PURE__ */ jsxs20(Space13, { children: [
|
|
6454
|
+
/* @__PURE__ */ jsx39(
|
|
6239
6455
|
Switch,
|
|
6240
6456
|
{
|
|
6241
6457
|
checked: model.streaming,
|
|
6242
6458
|
onChange: (checked) => handleModelChange(index, "streaming", checked)
|
|
6243
6459
|
}
|
|
6244
6460
|
),
|
|
6245
|
-
/* @__PURE__ */
|
|
6461
|
+
/* @__PURE__ */ jsx39(Text11, { children: "Enable Streaming" })
|
|
6246
6462
|
] }) }),
|
|
6247
|
-
/* @__PURE__ */
|
|
6248
|
-
/* @__PURE__ */
|
|
6249
|
-
/* @__PURE__ */
|
|
6250
|
-
/* @__PURE__ */
|
|
6463
|
+
/* @__PURE__ */ jsxs20("div", { style: { display: "flex", gap: 20 }, children: [
|
|
6464
|
+
/* @__PURE__ */ jsxs20("div", { style: { flex: 1 }, children: [
|
|
6465
|
+
/* @__PURE__ */ jsx39(Text11, { className: styles.formLabel, children: "Max Tokens" }),
|
|
6466
|
+
/* @__PURE__ */ jsx39(
|
|
6251
6467
|
Input,
|
|
6252
6468
|
{
|
|
6253
6469
|
type: "number",
|
|
@@ -6262,9 +6478,9 @@ QUEUE_NAME=tasks`,
|
|
|
6262
6478
|
}
|
|
6263
6479
|
)
|
|
6264
6480
|
] }),
|
|
6265
|
-
/* @__PURE__ */
|
|
6266
|
-
/* @__PURE__ */
|
|
6267
|
-
/* @__PURE__ */
|
|
6481
|
+
/* @__PURE__ */ jsxs20("div", { style: { flex: 1 }, children: [
|
|
6482
|
+
/* @__PURE__ */ jsx39(Text11, { className: styles.formLabel, children: "Temperature" }),
|
|
6483
|
+
/* @__PURE__ */ jsx39(
|
|
6268
6484
|
Input,
|
|
6269
6485
|
{
|
|
6270
6486
|
type: "number",
|
|
@@ -6283,7 +6499,7 @@ QUEUE_NAME=tasks`,
|
|
|
6283
6499
|
] })
|
|
6284
6500
|
] })
|
|
6285
6501
|
] }, index)),
|
|
6286
|
-
/* @__PURE__ */
|
|
6502
|
+
/* @__PURE__ */ jsx39(
|
|
6287
6503
|
Button12,
|
|
6288
6504
|
{
|
|
6289
6505
|
type: "dashed",
|
|
@@ -6311,8 +6527,8 @@ QUEUE_NAME=tasks`,
|
|
|
6311
6527
|
);
|
|
6312
6528
|
const currentConnection = connections.find((c) => c.id === activeTabKey);
|
|
6313
6529
|
const renderTabLabel = (connection) => {
|
|
6314
|
-
return /* @__PURE__ */
|
|
6315
|
-
/* @__PURE__ */
|
|
6530
|
+
return /* @__PURE__ */ jsxs20("div", { style: { display: "flex", alignItems: "center" }, children: [
|
|
6531
|
+
/* @__PURE__ */ jsx39(
|
|
6316
6532
|
CloudServerOutlined,
|
|
6317
6533
|
{
|
|
6318
6534
|
style: {
|
|
@@ -6321,14 +6537,14 @@ QUEUE_NAME=tasks`,
|
|
|
6321
6537
|
}
|
|
6322
6538
|
}
|
|
6323
6539
|
),
|
|
6324
|
-
/* @__PURE__ */
|
|
6325
|
-
connection.connected && /* @__PURE__ */
|
|
6540
|
+
/* @__PURE__ */ jsx39("span", { children: connection.name }),
|
|
6541
|
+
connection.connected && /* @__PURE__ */ jsx39(
|
|
6326
6542
|
CheckCircleFilled,
|
|
6327
6543
|
{
|
|
6328
6544
|
style: { color: "#52c41a", fontSize: 12, marginLeft: 8 }
|
|
6329
6545
|
}
|
|
6330
6546
|
),
|
|
6331
|
-
connection.error && !connection.connecting && /* @__PURE__ */
|
|
6547
|
+
connection.error && !connection.connecting && /* @__PURE__ */ jsx39(
|
|
6332
6548
|
CloseCircleFilled,
|
|
6333
6549
|
{
|
|
6334
6550
|
style: { color: "#ff4d4f", fontSize: 12, marginLeft: 8 }
|
|
@@ -6339,35 +6555,35 @@ QUEUE_NAME=tasks`,
|
|
|
6339
6555
|
const tabItems = connections.map((connection) => ({
|
|
6340
6556
|
key: connection.id,
|
|
6341
6557
|
label: renderTabLabel(connection),
|
|
6342
|
-
children: /* @__PURE__ */
|
|
6343
|
-
/* @__PURE__ */
|
|
6558
|
+
children: /* @__PURE__ */ jsx39("div", { className: styles.tabContent, children: connection.connected ? /* @__PURE__ */ jsx39(Fragment6, { children: /* @__PURE__ */ jsxs20("div", { style: { display: "flex", height: "100%" }, children: [
|
|
6559
|
+
/* @__PURE__ */ jsx39("div", { className: styles.sidebar, children: SETTINGS_MENU_ITEMS.map((item) => /* @__PURE__ */ jsxs20(
|
|
6344
6560
|
"div",
|
|
6345
6561
|
{
|
|
6346
6562
|
className: `${styles.menuItem} ${activeMenu === item.key ? "active" : ""}`,
|
|
6347
6563
|
onClick: () => setActiveMenu(item.key),
|
|
6348
6564
|
children: [
|
|
6349
|
-
/* @__PURE__ */
|
|
6350
|
-
/* @__PURE__ */
|
|
6565
|
+
/* @__PURE__ */ jsx39("span", { className: styles.menuItemIcon, children: item.icon }),
|
|
6566
|
+
/* @__PURE__ */ jsx39("span", { className: styles.menuItemText, children: item.label })
|
|
6351
6567
|
]
|
|
6352
6568
|
},
|
|
6353
6569
|
item.key
|
|
6354
6570
|
)) }),
|
|
6355
|
-
/* @__PURE__ */
|
|
6356
|
-
/* @__PURE__ */
|
|
6357
|
-
/* @__PURE__ */
|
|
6358
|
-
/* @__PURE__ */
|
|
6359
|
-
/* @__PURE__ */
|
|
6571
|
+
/* @__PURE__ */ jsxs20("div", { className: styles.content, children: [
|
|
6572
|
+
/* @__PURE__ */ jsxs20("div", { className: styles.contentHeader, children: [
|
|
6573
|
+
/* @__PURE__ */ jsxs20("div", { className: styles.contentHeaderLeft, children: [
|
|
6574
|
+
/* @__PURE__ */ jsx39(Title2, { level: 3, className: styles.contentTitle, children: activeMenuItem?.label }),
|
|
6575
|
+
/* @__PURE__ */ jsxs20(Text11, { className: styles.contentDescription, children: [
|
|
6360
6576
|
activeMenu === "environment" && "Manage environment variables for the gateway server",
|
|
6361
6577
|
activeMenu === "models" && "Configure and register model lattices for use by agents"
|
|
6362
6578
|
] })
|
|
6363
6579
|
] }),
|
|
6364
|
-
/* @__PURE__ */
|
|
6365
|
-
/* @__PURE__ */
|
|
6366
|
-
/* @__PURE__ */
|
|
6580
|
+
/* @__PURE__ */ jsxs20("div", { className: styles.contentHeaderRight, children: [
|
|
6581
|
+
/* @__PURE__ */ jsx39(Button12, { onClick: onClose, children: "Cancel" }),
|
|
6582
|
+
/* @__PURE__ */ jsx39(
|
|
6367
6583
|
Button12,
|
|
6368
6584
|
{
|
|
6369
6585
|
type: "primary",
|
|
6370
|
-
icon: /* @__PURE__ */
|
|
6586
|
+
icon: /* @__PURE__ */ jsx39(SaveOutlined, {}),
|
|
6371
6587
|
onClick: handleSave,
|
|
6372
6588
|
loading,
|
|
6373
6589
|
children: "Save Configuration"
|
|
@@ -6375,9 +6591,9 @@ QUEUE_NAME=tasks`,
|
|
|
6375
6591
|
)
|
|
6376
6592
|
] })
|
|
6377
6593
|
] }),
|
|
6378
|
-
/* @__PURE__ */
|
|
6594
|
+
/* @__PURE__ */ jsx39("div", { className: styles.contentBody, children: renderContent(connection.id) })
|
|
6379
6595
|
] })
|
|
6380
|
-
] }) }) : /* @__PURE__ */
|
|
6596
|
+
] }) }) : /* @__PURE__ */ jsx39(
|
|
6381
6597
|
"div",
|
|
6382
6598
|
{
|
|
6383
6599
|
style: {
|
|
@@ -6389,17 +6605,17 @@ QUEUE_NAME=tasks`,
|
|
|
6389
6605
|
gap: 16,
|
|
6390
6606
|
padding: 48
|
|
6391
6607
|
},
|
|
6392
|
-
children: connection.connecting ? /* @__PURE__ */
|
|
6393
|
-
/* @__PURE__ */
|
|
6394
|
-
/* @__PURE__ */
|
|
6395
|
-
/* @__PURE__ */
|
|
6608
|
+
children: connection.connecting ? /* @__PURE__ */ jsxs20(Fragment6, { children: [
|
|
6609
|
+
/* @__PURE__ */ jsx39(LinkOutlined, { style: { fontSize: 64, color: "#1890ff" }, spin: true }),
|
|
6610
|
+
/* @__PURE__ */ jsx39(Title2, { level: 4, children: "Connecting..." }),
|
|
6611
|
+
/* @__PURE__ */ jsxs20(Text11, { type: "secondary", style: { textAlign: "center" }, children: [
|
|
6396
6612
|
"Connecting to ",
|
|
6397
6613
|
connection.url
|
|
6398
6614
|
] })
|
|
6399
|
-
] }) : /* @__PURE__ */
|
|
6400
|
-
/* @__PURE__ */
|
|
6401
|
-
/* @__PURE__ */
|
|
6402
|
-
/* @__PURE__ */
|
|
6615
|
+
] }) : /* @__PURE__ */ jsxs20(Fragment6, { children: [
|
|
6616
|
+
/* @__PURE__ */ jsx39(LinkOutlined, { style: { fontSize: 64, color: "#d9d9d9" } }),
|
|
6617
|
+
/* @__PURE__ */ jsx39(Title2, { level: 4, type: "secondary", children: connection.error || "Not Connected" }),
|
|
6618
|
+
/* @__PURE__ */ jsx39(
|
|
6403
6619
|
Text11,
|
|
6404
6620
|
{
|
|
6405
6621
|
type: "secondary",
|
|
@@ -6407,11 +6623,11 @@ QUEUE_NAME=tasks`,
|
|
|
6407
6623
|
children: connection.error ? `Failed to connect to ${connection.url}. Please check the server URL and try again.` : `Click "Reconnect" to connect to ${connection.url}`
|
|
6408
6624
|
}
|
|
6409
6625
|
),
|
|
6410
|
-
/* @__PURE__ */
|
|
6626
|
+
/* @__PURE__ */ jsx39(
|
|
6411
6627
|
Button12,
|
|
6412
6628
|
{
|
|
6413
6629
|
type: "primary",
|
|
6414
|
-
icon: /* @__PURE__ */
|
|
6630
|
+
icon: /* @__PURE__ */ jsx39(LinkOutlined, {}),
|
|
6415
6631
|
onClick: () => checkConnection(connection.id),
|
|
6416
6632
|
loading: connection.connecting,
|
|
6417
6633
|
style: { marginTop: 16 },
|
|
@@ -6423,8 +6639,8 @@ QUEUE_NAME=tasks`,
|
|
|
6423
6639
|
) }),
|
|
6424
6640
|
closable: connections.length > 1
|
|
6425
6641
|
}));
|
|
6426
|
-
return /* @__PURE__ */
|
|
6427
|
-
/* @__PURE__ */
|
|
6642
|
+
return /* @__PURE__ */ jsxs20(Fragment6, { children: [
|
|
6643
|
+
/* @__PURE__ */ jsx39(
|
|
6428
6644
|
Drawer,
|
|
6429
6645
|
{
|
|
6430
6646
|
open,
|
|
@@ -6432,11 +6648,11 @@ QUEUE_NAME=tasks`,
|
|
|
6432
6648
|
footer: null,
|
|
6433
6649
|
width: "100%",
|
|
6434
6650
|
title: "Settings",
|
|
6435
|
-
children: /* @__PURE__ */
|
|
6651
|
+
children: /* @__PURE__ */ jsx39("div", { children: /* @__PURE__ */ jsx39(
|
|
6436
6652
|
Tabs2,
|
|
6437
6653
|
{
|
|
6438
6654
|
activeKey: activeTabKey,
|
|
6439
|
-
onChange:
|
|
6655
|
+
onChange: handleTabChange,
|
|
6440
6656
|
type: "editable-card",
|
|
6441
6657
|
onEdit: (targetKey, action) => {
|
|
6442
6658
|
if (action === "add") {
|
|
@@ -6446,7 +6662,7 @@ QUEUE_NAME=tasks`,
|
|
|
6446
6662
|
}
|
|
6447
6663
|
},
|
|
6448
6664
|
items: tabItems,
|
|
6449
|
-
addIcon: /* @__PURE__ */
|
|
6665
|
+
addIcon: /* @__PURE__ */ jsxs20(
|
|
6450
6666
|
"div",
|
|
6451
6667
|
{
|
|
6452
6668
|
style: {
|
|
@@ -6456,8 +6672,8 @@ QUEUE_NAME=tasks`,
|
|
|
6456
6672
|
padding: "4px 8px"
|
|
6457
6673
|
},
|
|
6458
6674
|
children: [
|
|
6459
|
-
/* @__PURE__ */
|
|
6460
|
-
/* @__PURE__ */
|
|
6675
|
+
/* @__PURE__ */ jsx39(PlusOutlined, {}),
|
|
6676
|
+
/* @__PURE__ */ jsx39("span", { children: "Add Server" })
|
|
6461
6677
|
]
|
|
6462
6678
|
}
|
|
6463
6679
|
)
|
|
@@ -6465,7 +6681,7 @@ QUEUE_NAME=tasks`,
|
|
|
6465
6681
|
) })
|
|
6466
6682
|
}
|
|
6467
6683
|
),
|
|
6468
|
-
/* @__PURE__ */
|
|
6684
|
+
/* @__PURE__ */ jsx39(
|
|
6469
6685
|
Modal,
|
|
6470
6686
|
{
|
|
6471
6687
|
title: "Add New Server",
|
|
@@ -6479,10 +6695,10 @@ QUEUE_NAME=tasks`,
|
|
|
6479
6695
|
},
|
|
6480
6696
|
confirmLoading: addingServer,
|
|
6481
6697
|
className: styles.addServerModal,
|
|
6482
|
-
children: /* @__PURE__ */
|
|
6483
|
-
/* @__PURE__ */
|
|
6484
|
-
/* @__PURE__ */
|
|
6485
|
-
/* @__PURE__ */
|
|
6698
|
+
children: /* @__PURE__ */ jsxs20(Space13, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
|
|
6699
|
+
/* @__PURE__ */ jsxs20("div", { children: [
|
|
6700
|
+
/* @__PURE__ */ jsx39(Text11, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server Name" }),
|
|
6701
|
+
/* @__PURE__ */ jsx39(
|
|
6486
6702
|
Input,
|
|
6487
6703
|
{
|
|
6488
6704
|
placeholder: "e.g., Production Server",
|
|
@@ -6491,11 +6707,11 @@ QUEUE_NAME=tasks`,
|
|
|
6491
6707
|
onPressEnter: handleAddServer
|
|
6492
6708
|
}
|
|
6493
6709
|
),
|
|
6494
|
-
/* @__PURE__ */
|
|
6710
|
+
/* @__PURE__ */ jsx39(Text11, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: Leave empty to use URL as name" })
|
|
6495
6711
|
] }),
|
|
6496
|
-
/* @__PURE__ */
|
|
6497
|
-
/* @__PURE__ */
|
|
6498
|
-
/* @__PURE__ */
|
|
6712
|
+
/* @__PURE__ */ jsxs20("div", { children: [
|
|
6713
|
+
/* @__PURE__ */ jsx39(Text11, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server URL *" }),
|
|
6714
|
+
/* @__PURE__ */ jsx39(
|
|
6499
6715
|
Input,
|
|
6500
6716
|
{
|
|
6501
6717
|
placeholder: "e.g., http://localhost:4001",
|
|
@@ -6504,11 +6720,11 @@ QUEUE_NAME=tasks`,
|
|
|
6504
6720
|
onPressEnter: handleAddServer
|
|
6505
6721
|
}
|
|
6506
6722
|
),
|
|
6507
|
-
/* @__PURE__ */
|
|
6723
|
+
/* @__PURE__ */ jsx39(Text11, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Enter the full URL of the gateway server" })
|
|
6508
6724
|
] }),
|
|
6509
|
-
/* @__PURE__ */
|
|
6510
|
-
/* @__PURE__ */
|
|
6511
|
-
/* @__PURE__ */
|
|
6725
|
+
/* @__PURE__ */ jsxs20("div", { children: [
|
|
6726
|
+
/* @__PURE__ */ jsx39(Text11, { strong: true, style: { display: "block", marginBottom: 8 }, children: "API Key" }),
|
|
6727
|
+
/* @__PURE__ */ jsx39(
|
|
6512
6728
|
Input.Password,
|
|
6513
6729
|
{
|
|
6514
6730
|
placeholder: "Optional: Enter API key for authentication",
|
|
@@ -6517,7 +6733,7 @@ QUEUE_NAME=tasks`,
|
|
|
6517
6733
|
onPressEnter: handleAddServer
|
|
6518
6734
|
}
|
|
6519
6735
|
),
|
|
6520
|
-
/* @__PURE__ */
|
|
6736
|
+
/* @__PURE__ */ jsx39(Text11, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: API key for server authentication" })
|
|
6521
6737
|
] })
|
|
6522
6738
|
] })
|
|
6523
6739
|
}
|
|
@@ -6525,215 +6741,26 @@ QUEUE_NAME=tasks`,
|
|
|
6525
6741
|
] });
|
|
6526
6742
|
};
|
|
6527
6743
|
|
|
6528
|
-
// src/components/Chat/
|
|
6529
|
-
import {
|
|
6530
|
-
var
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
height: 100%;
|
|
6535
|
-
width: 100%;
|
|
6536
|
-
position: relative;
|
|
6537
|
-
background: transparent;
|
|
6538
|
-
border-radius: ${token.borderRadiusLG}px;
|
|
6539
|
-
overflow: hidden;
|
|
6540
|
-
`,
|
|
6541
|
-
content: css`
|
|
6542
|
-
flex: 1;
|
|
6543
|
-
overflow-y: auto;
|
|
6544
|
-
overflow-x: hidden;
|
|
6545
|
-
padding: ${token.paddingMD}px ${token.paddingSM}px;
|
|
6546
|
-
padding-bottom: ${token.paddingLG}px;
|
|
6547
|
-
|
|
6548
|
-
/* Custom scrollbar styling */
|
|
6549
|
-
&::-webkit-scrollbar {
|
|
6550
|
-
width: 6px;
|
|
6551
|
-
}
|
|
6552
|
-
|
|
6553
|
-
&::-webkit-scrollbar-track {
|
|
6554
|
-
background: transparent;
|
|
6555
|
-
}
|
|
6556
|
-
|
|
6557
|
-
&::-webkit-scrollbar-thumb {
|
|
6558
|
-
background: ${token.colorBorder};
|
|
6559
|
-
border-radius: 3px;
|
|
6560
|
-
|
|
6561
|
-
&:hover {
|
|
6562
|
-
background: ${token.colorBorderSecondary};
|
|
6563
|
-
}
|
|
6564
|
-
}
|
|
6565
|
-
`,
|
|
6566
|
-
section: css`
|
|
6567
|
-
margin-bottom: ${token.marginLG}px;
|
|
6568
|
-
|
|
6569
|
-
&:last-child {
|
|
6570
|
-
margin-bottom: 0;
|
|
6571
|
-
}
|
|
6572
|
-
`,
|
|
6573
|
-
sectionTitle: css`
|
|
6574
|
-
font-size: ${token.fontSizeSM}px;
|
|
6575
|
-
font-weight: 600;
|
|
6576
|
-
color: ${token.colorTextSecondary};
|
|
6577
|
-
text-transform: uppercase;
|
|
6578
|
-
letter-spacing: 0.5px;
|
|
6579
|
-
padding: 0 ${token.paddingXS}px;
|
|
6580
|
-
margin-bottom: ${token.marginSM}px;
|
|
6581
|
-
`,
|
|
6582
|
-
footer: css`
|
|
6583
|
-
display: flex;
|
|
6584
|
-
justify-content: center;
|
|
6585
|
-
align-items: center;
|
|
6586
|
-
padding: ${token.paddingSM}px;
|
|
6587
|
-
background: transparent;
|
|
6588
|
-
border-top: 1px solid ${token.colorBorderSecondary};
|
|
6589
|
-
gap: ${token.marginXS}px;
|
|
6590
|
-
flex-shrink: 0;
|
|
6591
|
-
position: relative;
|
|
6592
|
-
|
|
6593
|
-
&::before {
|
|
6594
|
-
content: "";
|
|
6595
|
-
position: absolute;
|
|
6596
|
-
top: 0;
|
|
6597
|
-
left: 0;
|
|
6598
|
-
right: 0;
|
|
6599
|
-
height: 1px;
|
|
6600
|
-
background: linear-gradient(
|
|
6601
|
-
90deg,
|
|
6602
|
-
transparent,
|
|
6603
|
-
${token.colorBorder},
|
|
6604
|
-
transparent
|
|
6605
|
-
);
|
|
6606
|
-
}
|
|
6607
|
-
`,
|
|
6608
|
-
actionButton: css`
|
|
6609
|
-
display: flex;
|
|
6610
|
-
align-items: center;
|
|
6611
|
-
justify-content: center;
|
|
6612
|
-
width: 36px;
|
|
6613
|
-
height: 36px;
|
|
6614
|
-
border-radius: ${token.borderRadius}px;
|
|
6615
|
-
border: none;
|
|
6616
|
-
background: ${token.colorBgContainer};
|
|
6617
|
-
color: ${token.colorTextSecondary};
|
|
6618
|
-
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
6619
|
-
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
|
|
6620
|
-
|
|
6621
|
-
&:hover {
|
|
6622
|
-
background: ${token.colorPrimaryBg};
|
|
6623
|
-
color: ${token.colorPrimary};
|
|
6624
|
-
transform: translateY(-1px);
|
|
6625
|
-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
|
|
6626
|
-
}
|
|
6627
|
-
|
|
6628
|
-
&:active {
|
|
6629
|
-
transform: translateY(0);
|
|
6630
|
-
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
|
|
6631
|
-
}
|
|
6632
|
-
|
|
6633
|
-
.anticon {
|
|
6634
|
-
font-size: 16px;
|
|
6635
|
-
}
|
|
6636
|
-
`,
|
|
6637
|
-
divider: css`
|
|
6638
|
-
margin: ${token.marginMD}px 0;
|
|
6639
|
-
border-color: ${token.colorBorderSecondary};
|
|
6640
|
-
`
|
|
6641
|
-
}));
|
|
6642
|
-
var ChatSidebar = ({
|
|
6643
|
-
onSettingsClick,
|
|
6644
|
-
defaultCollapsed = false
|
|
6645
|
-
}) => {
|
|
6646
|
-
const { styles } = useStyles4();
|
|
6647
|
-
const { setMenuCollapsed, menuCollapsed } = useChatUIContext();
|
|
6648
|
-
const [settingsModalOpen, setSettingsModalOpen] = useState21(false);
|
|
6649
|
-
const handleToggleCollapse = () => {
|
|
6650
|
-
setMenuCollapsed(!menuCollapsed);
|
|
6651
|
-
};
|
|
6652
|
-
const handleSettingsClick = () => {
|
|
6653
|
-
setSettingsModalOpen(true);
|
|
6654
|
-
onSettingsClick?.();
|
|
6655
|
-
};
|
|
6656
|
-
return /* @__PURE__ */ jsxs20(Fragment6, { children: [
|
|
6657
|
-
/* @__PURE__ */ jsxs20("div", { className: styles.sidebar, children: [
|
|
6658
|
-
!menuCollapsed && /* @__PURE__ */ jsxs20("div", { className: styles.content, children: [
|
|
6659
|
-
/* @__PURE__ */ jsxs20("div", { className: styles.section, children: [
|
|
6660
|
-
/* @__PURE__ */ jsx38("div", { className: styles.sectionTitle, children: "Assistants" }),
|
|
6661
|
-
/* @__PURE__ */ jsx38(AssistantList, {})
|
|
6662
|
-
] }),
|
|
6663
|
-
/* @__PURE__ */ jsx38(Divider2, { className: styles.divider }),
|
|
6664
|
-
/* @__PURE__ */ jsxs20("div", { className: styles.section, children: [
|
|
6665
|
-
/* @__PURE__ */ jsx38("div", { className: styles.sectionTitle, children: "Threads" }),
|
|
6666
|
-
/* @__PURE__ */ jsx38(AgentConversations, {})
|
|
6667
|
-
] })
|
|
6668
|
-
] }),
|
|
6669
|
-
/* @__PURE__ */ jsxs20("div", { className: styles.footer, children: [
|
|
6670
|
-
/* @__PURE__ */ jsx38(
|
|
6671
|
-
"button",
|
|
6672
|
-
{
|
|
6673
|
-
className: styles.actionButton,
|
|
6674
|
-
onClick: handleToggleCollapse,
|
|
6675
|
-
title: menuCollapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
6676
|
-
"aria-label": menuCollapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
6677
|
-
children: menuCollapsed ? /* @__PURE__ */ jsx38(MenuUnfoldOutlined, {}) : /* @__PURE__ */ jsx38(MenuFoldOutlined, {})
|
|
6678
|
-
}
|
|
6679
|
-
),
|
|
6680
|
-
!menuCollapsed && /* @__PURE__ */ jsx38(
|
|
6681
|
-
"button",
|
|
6682
|
-
{
|
|
6683
|
-
className: styles.actionButton,
|
|
6684
|
-
onClick: handleSettingsClick,
|
|
6685
|
-
title: "Settings",
|
|
6686
|
-
"aria-label": "Settings",
|
|
6687
|
-
children: /* @__PURE__ */ jsx38(SettingOutlined, {})
|
|
6688
|
-
}
|
|
6689
|
-
)
|
|
6690
|
-
] })
|
|
6691
|
-
] }),
|
|
6692
|
-
/* @__PURE__ */ jsx38(
|
|
6693
|
-
SettingsModal,
|
|
6694
|
-
{
|
|
6695
|
-
open: settingsModalOpen,
|
|
6696
|
-
onClose: () => setSettingsModalOpen(false)
|
|
6697
|
-
}
|
|
6698
|
-
)
|
|
6699
|
-
] });
|
|
6700
|
-
};
|
|
6701
|
-
|
|
6702
|
-
// src/components/Chat/LatticeChatView.tsx
|
|
6703
|
-
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
6704
|
-
var LatticeChatView = (props) => {
|
|
6705
|
-
const { assistantId, thread } = useConversationContext();
|
|
6706
|
-
const { currentAssistant } = useAssistantContext();
|
|
6707
|
-
const {
|
|
6708
|
-
config: { baseURL }
|
|
6709
|
-
} = useLatticeChatShellContext();
|
|
6710
|
-
return assistantId && thread ? /* @__PURE__ */ jsx39(
|
|
6711
|
-
AxiomLatticeProvider,
|
|
6744
|
+
// src/components/Chat/AgentServerSetting.tsx
|
|
6745
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
6746
|
+
var AgentServerSetting = () => {
|
|
6747
|
+
const { settingsModalOpen, setSettingsModalOpen } = useLatticeChatShellContext();
|
|
6748
|
+
return /* @__PURE__ */ jsx40(
|
|
6749
|
+
SettingsModal,
|
|
6712
6750
|
{
|
|
6713
|
-
|
|
6714
|
-
|
|
6715
|
-
apiKey: "",
|
|
6716
|
-
assistantId,
|
|
6717
|
-
transport: "sse"
|
|
6718
|
-
},
|
|
6719
|
-
children: /* @__PURE__ */ jsx39(
|
|
6720
|
-
LatticeChat,
|
|
6721
|
-
{
|
|
6722
|
-
thread_id: thread?.id,
|
|
6723
|
-
assistant_id: assistantId,
|
|
6724
|
-
name: currentAssistant?.name,
|
|
6725
|
-
description: currentAssistant?.description,
|
|
6726
|
-
menu: /* @__PURE__ */ jsx39(ChatSidebar, {})
|
|
6727
|
-
}
|
|
6728
|
-
)
|
|
6751
|
+
open: settingsModalOpen,
|
|
6752
|
+
onClose: () => setSettingsModalOpen(false)
|
|
6729
6753
|
}
|
|
6730
|
-
)
|
|
6754
|
+
);
|
|
6731
6755
|
};
|
|
6732
6756
|
|
|
6733
6757
|
// src/components/Chat/LatticeChatShell.tsx
|
|
6734
|
-
import { jsx as
|
|
6758
|
+
import { jsx as jsx41, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
6735
6759
|
var LatticeChatShell = (props) => {
|
|
6736
|
-
return /* @__PURE__ */
|
|
6760
|
+
return /* @__PURE__ */ jsxs21(LatticeChatShellContextProvider, { ...props, children: [
|
|
6761
|
+
/* @__PURE__ */ jsx41(AssistantContextProvider, { autoLoad: true, children: /* @__PURE__ */ jsx41(ConversationContextProvider, { children: /* @__PURE__ */ jsx41(LatticeChatView, {}) }) }),
|
|
6762
|
+
/* @__PURE__ */ jsx41(AgentServerSetting, {})
|
|
6763
|
+
] });
|
|
6737
6764
|
};
|
|
6738
6765
|
export {
|
|
6739
6766
|
AgentConversations,
|