@axiom-lattice/react-sdk 2.1.83 → 2.1.85
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 +1037 -837
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +584 -384
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -4117,6 +4117,9 @@ var useChatUIContext = () => {
|
|
|
4117
4117
|
// src/components/Chat/LatticeChat.tsx
|
|
4118
4118
|
import { createStyles as createStyles38 } from "antd-style";
|
|
4119
4119
|
|
|
4120
|
+
// src/components/Chat/ColumnLayout.tsx
|
|
4121
|
+
import { PanelLeft, X } from "lucide-react";
|
|
4122
|
+
|
|
4120
4123
|
// src/components/Chat/useStyle.tsx
|
|
4121
4124
|
import { createStyles as createStyles2 } from "antd-style";
|
|
4122
4125
|
var useStyle = createStyles2(({ token, css }) => {
|
|
@@ -4137,6 +4140,11 @@ var useStyle = createStyles2(({ token, css }) => {
|
|
|
4137
4140
|
.ant-prompts {
|
|
4138
4141
|
color: ${token.colorText};
|
|
4139
4142
|
}
|
|
4143
|
+
|
|
4144
|
+
@media (max-width: 768px) {
|
|
4145
|
+
padding: 0;
|
|
4146
|
+
gap: 0;
|
|
4147
|
+
}
|
|
4140
4148
|
`,
|
|
4141
4149
|
header: css`
|
|
4142
4150
|
min-height: 40px;
|
|
@@ -4145,6 +4153,11 @@ var useStyle = createStyles2(({ token, css }) => {
|
|
|
4145
4153
|
padding: 0 ${token.padding}px;
|
|
4146
4154
|
box-sizing: border-box;
|
|
4147
4155
|
flex-shrink: 0;
|
|
4156
|
+
|
|
4157
|
+
@media (max-width: 768px) {
|
|
4158
|
+
padding: 0 8px;
|
|
4159
|
+
min-height: 36px;
|
|
4160
|
+
}
|
|
4148
4161
|
`,
|
|
4149
4162
|
contentArea: css`
|
|
4150
4163
|
flex: 1;
|
|
@@ -4152,12 +4165,20 @@ var useStyle = createStyles2(({ token, css }) => {
|
|
|
4152
4165
|
flex-direction: column;
|
|
4153
4166
|
overflow: hidden;
|
|
4154
4167
|
gap: 8px;
|
|
4168
|
+
|
|
4169
|
+
@media (max-width: 768px) {
|
|
4170
|
+
gap: 4px;
|
|
4171
|
+
}
|
|
4155
4172
|
`,
|
|
4156
4173
|
columns: css`
|
|
4157
4174
|
flex: 1;
|
|
4158
4175
|
display: flex;
|
|
4159
4176
|
gap: 8px;
|
|
4160
4177
|
overflow: hidden;
|
|
4178
|
+
|
|
4179
|
+
@media (max-width: 768px) {
|
|
4180
|
+
gap: 0;
|
|
4181
|
+
}
|
|
4161
4182
|
`,
|
|
4162
4183
|
menu: css`
|
|
4163
4184
|
// background: ${token.colorBgContainer}90;
|
|
@@ -4174,6 +4195,25 @@ var useStyle = createStyles2(({ token, css }) => {
|
|
|
4174
4195
|
&.expanded {
|
|
4175
4196
|
width: 240px;
|
|
4176
4197
|
}
|
|
4198
|
+
|
|
4199
|
+
@media (max-width: 768px) {
|
|
4200
|
+
position: fixed;
|
|
4201
|
+
left: 0;
|
|
4202
|
+
top: 0;
|
|
4203
|
+
bottom: 0;
|
|
4204
|
+
z-index: 100;
|
|
4205
|
+
background: ${token.colorBgLayout};
|
|
4206
|
+
box-shadow: ${token.boxShadow};
|
|
4207
|
+
width: 0;
|
|
4208
|
+
|
|
4209
|
+
&.expanded {
|
|
4210
|
+
width: 280px;
|
|
4211
|
+
border-right: 1px solid ${token.colorBorder};
|
|
4212
|
+
}
|
|
4213
|
+
}
|
|
4214
|
+
`,
|
|
4215
|
+
menuSnap: css`
|
|
4216
|
+
transition: none !important;
|
|
4177
4217
|
`,
|
|
4178
4218
|
menuToggle: css`
|
|
4179
4219
|
position: relative;
|
|
@@ -4245,6 +4285,53 @@ var useStyle = createStyles2(({ token, css }) => {
|
|
|
4245
4285
|
white-space: pre-wrap;
|
|
4246
4286
|
word-break: break-all;
|
|
4247
4287
|
}
|
|
4288
|
+
|
|
4289
|
+
@media (max-width: 768px) {
|
|
4290
|
+
min-width: 0;
|
|
4291
|
+
border-radius: 0;
|
|
4292
|
+
border: none;
|
|
4293
|
+
gap: 8px;
|
|
4294
|
+
}
|
|
4295
|
+
`,
|
|
4296
|
+
mobileMenuToggle: css`
|
|
4297
|
+
display: flex;
|
|
4298
|
+
align-items: center;
|
|
4299
|
+
justify-content: center;
|
|
4300
|
+
width: 32px;
|
|
4301
|
+
height: 32px;
|
|
4302
|
+
border-radius: ${token.borderRadius}px;
|
|
4303
|
+
border: 1px solid ${token.colorBorder};
|
|
4304
|
+
background: ${token.colorBgContainer};
|
|
4305
|
+
color: ${token.colorTextSecondary};
|
|
4306
|
+
cursor: pointer;
|
|
4307
|
+
transition: all 0.2s ease;
|
|
4308
|
+
|
|
4309
|
+
&:hover {
|
|
4310
|
+
background: ${token.colorPrimaryBg};
|
|
4311
|
+
color: ${token.colorPrimary};
|
|
4312
|
+
}
|
|
4313
|
+
`,
|
|
4314
|
+
mobilePanelClose: css`
|
|
4315
|
+
position: absolute;
|
|
4316
|
+
top: 12px;
|
|
4317
|
+
right: 12px;
|
|
4318
|
+
z-index: 5;
|
|
4319
|
+
display: flex;
|
|
4320
|
+
align-items: center;
|
|
4321
|
+
justify-content: center;
|
|
4322
|
+
width: 36px;
|
|
4323
|
+
height: 36px;
|
|
4324
|
+
border-radius: ${token.borderRadius}px;
|
|
4325
|
+
border: none;
|
|
4326
|
+
background: rgba(0, 0, 0, 0.06);
|
|
4327
|
+
color: ${token.colorTextSecondary};
|
|
4328
|
+
cursor: pointer;
|
|
4329
|
+
transition: all 0.2s ease;
|
|
4330
|
+
|
|
4331
|
+
&:hover {
|
|
4332
|
+
background: rgba(0, 0, 0, 0.12);
|
|
4333
|
+
color: ${token.colorText};
|
|
4334
|
+
}
|
|
4248
4335
|
`,
|
|
4249
4336
|
chat: css`
|
|
4250
4337
|
width: 100%;
|
|
@@ -4277,6 +4364,10 @@ var useStyle = createStyles2(({ token, css }) => {
|
|
|
4277
4364
|
background-repeat: no-repeat;
|
|
4278
4365
|
background-position: bottom;
|
|
4279
4366
|
}
|
|
4367
|
+
|
|
4368
|
+
@media (max-width: 768px) {
|
|
4369
|
+
padding: 4px;
|
|
4370
|
+
}
|
|
4280
4371
|
`,
|
|
4281
4372
|
detailPanel: css`
|
|
4282
4373
|
display: flex;
|
|
@@ -4314,6 +4405,29 @@ var useStyle = createStyles2(({ token, css }) => {
|
|
|
4314
4405
|
bottom: 16px;
|
|
4315
4406
|
top: 2px;
|
|
4316
4407
|
}
|
|
4408
|
+
|
|
4409
|
+
@media (max-width: 768px) {
|
|
4410
|
+
border-radius: 0;
|
|
4411
|
+
|
|
4412
|
+
&.open {
|
|
4413
|
+
position: fixed;
|
|
4414
|
+
top: 0;
|
|
4415
|
+
right: 0;
|
|
4416
|
+
bottom: 0;
|
|
4417
|
+
left: 0;
|
|
4418
|
+
width: 100vw !important;
|
|
4419
|
+
height: 100dvh;
|
|
4420
|
+
z-index: 50;
|
|
4421
|
+
border: none;
|
|
4422
|
+
}
|
|
4423
|
+
|
|
4424
|
+
&.small,
|
|
4425
|
+
&.middle,
|
|
4426
|
+
&.large,
|
|
4427
|
+
&.full {
|
|
4428
|
+
width: 100vw !important;
|
|
4429
|
+
}
|
|
4430
|
+
}
|
|
4317
4431
|
`,
|
|
4318
4432
|
toolPanel: css`
|
|
4319
4433
|
display: flex;
|
|
@@ -4331,6 +4445,22 @@ var useStyle = createStyles2(({ token, css }) => {
|
|
|
4331
4445
|
box-shadow: ${token.boxShadow};
|
|
4332
4446
|
border-color: ${token.colorBorder};
|
|
4333
4447
|
}
|
|
4448
|
+
|
|
4449
|
+
@media (max-width: 768px) {
|
|
4450
|
+
border-radius: 0;
|
|
4451
|
+
|
|
4452
|
+
&.open {
|
|
4453
|
+
position: fixed;
|
|
4454
|
+
top: 0;
|
|
4455
|
+
right: 0;
|
|
4456
|
+
bottom: 0;
|
|
4457
|
+
left: 0;
|
|
4458
|
+
width: 100vw !important;
|
|
4459
|
+
height: 100dvh;
|
|
4460
|
+
z-index: 50;
|
|
4461
|
+
border: none;
|
|
4462
|
+
}
|
|
4463
|
+
}
|
|
4334
4464
|
`,
|
|
4335
4465
|
detailContent: css`
|
|
4336
4466
|
// padding: 8px 8px;
|
|
@@ -4896,6 +5026,26 @@ var useStyle = createStyles2(({ token, css }) => {
|
|
|
4896
5026
|
};
|
|
4897
5027
|
});
|
|
4898
5028
|
|
|
5029
|
+
// src/hooks/useMediaQuery.ts
|
|
5030
|
+
import { useState as useState21, useEffect as useEffect14 } from "react";
|
|
5031
|
+
function useMediaQuery(query) {
|
|
5032
|
+
const [matches, setMatches] = useState21(() => {
|
|
5033
|
+
if (typeof window !== "undefined") {
|
|
5034
|
+
return window.matchMedia(query).matches;
|
|
5035
|
+
}
|
|
5036
|
+
return false;
|
|
5037
|
+
});
|
|
5038
|
+
useEffect14(() => {
|
|
5039
|
+
const mql = window.matchMedia(query);
|
|
5040
|
+
const handler = (event) => {
|
|
5041
|
+
setMatches(event.matches);
|
|
5042
|
+
};
|
|
5043
|
+
mql.addEventListener("change", handler);
|
|
5044
|
+
return () => mql.removeEventListener("change", handler);
|
|
5045
|
+
}, [query]);
|
|
5046
|
+
return matches;
|
|
5047
|
+
}
|
|
5048
|
+
|
|
4899
5049
|
// src/components/Chat/ColumnLayout.tsx
|
|
4900
5050
|
import { jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
4901
5051
|
var ColumnLayout = ({
|
|
@@ -4914,30 +5064,75 @@ var ColumnLayout = ({
|
|
|
4914
5064
|
toolsVisible,
|
|
4915
5065
|
toolSelectedCard,
|
|
4916
5066
|
contentAppSelectedCard,
|
|
4917
|
-
menuCollapsed
|
|
5067
|
+
menuCollapsed,
|
|
5068
|
+
setMenuCollapsed,
|
|
5069
|
+
closeDetail,
|
|
5070
|
+
closeTools
|
|
4918
5071
|
} = useChatUIContext();
|
|
4919
|
-
const
|
|
5072
|
+
const isMobile = useMediaQuery("(max-width: 768px)");
|
|
5073
|
+
const isMenuCollapsed = menuCollapsed ?? (isMobile || detailVisible);
|
|
5074
|
+
const isAutoCollapsed = detailVisible && !isMobile;
|
|
4920
5075
|
const menuStateClass = isMenuCollapsed ? "collapsed" : "expanded";
|
|
4921
5076
|
const hasSidePanelsOpen = detailVisible || toolsVisible;
|
|
4922
5077
|
const resolvedDetailSize = toolsVisible && (detailSize || "large") === "large" ? "middle" : detailSize || "large";
|
|
4923
5078
|
return /* @__PURE__ */ jsxs5("div", { className: `fina_chat ${styles.layout}`, children: [
|
|
4924
|
-
menu && /* @__PURE__ */ jsxs5("div", { className: `${styles.menu} ${menuStateClass}`, children: [
|
|
5079
|
+
menu && /* @__PURE__ */ jsxs5("div", { className: `${styles.menu} ${menuStateClass} ${isAutoCollapsed ? styles.menuSnap : ""}`, children: [
|
|
4925
5080
|
logo,
|
|
4926
5081
|
menu
|
|
4927
5082
|
] }),
|
|
4928
5083
|
/* @__PURE__ */ jsxs5("div", { className: styles.contentArea, children: [
|
|
4929
|
-
header && /* @__PURE__ */
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
/* @__PURE__ */ jsx12(
|
|
4933
|
-
"div",
|
|
5084
|
+
(header || isMobile) && /* @__PURE__ */ jsxs5("div", { className: styles.header, children: [
|
|
5085
|
+
isMobile && /* @__PURE__ */ jsx12(
|
|
5086
|
+
"button",
|
|
4934
5087
|
{
|
|
4935
|
-
className:
|
|
4936
|
-
|
|
5088
|
+
className: styles.mobileMenuToggle,
|
|
5089
|
+
onClick: () => setMenuCollapsed(!isMenuCollapsed),
|
|
5090
|
+
"aria-label": "Toggle menu",
|
|
5091
|
+
children: /* @__PURE__ */ jsx12(PanelLeft, { size: 18 })
|
|
4937
5092
|
}
|
|
4938
5093
|
),
|
|
4939
|
-
|
|
4940
|
-
] })
|
|
5094
|
+
header
|
|
5095
|
+
] }),
|
|
5096
|
+
/* @__PURE__ */ jsxs5(
|
|
5097
|
+
"div",
|
|
5098
|
+
{
|
|
5099
|
+
className: styles.columns,
|
|
5100
|
+
style: { gap: hasSidePanelsOpen ? void 0 : 0 },
|
|
5101
|
+
children: [
|
|
5102
|
+
/* @__PURE__ */ jsx12("div", { className: `${styles.mainContent} ${hasSidePanelsOpen ? "open" : ""}`, children: /* @__PURE__ */ jsx12("div", { className: `${styles.chat} ${contentAppSelectedCard ? "full_content_width" : ""}`, children: main }) }),
|
|
5103
|
+
/* @__PURE__ */ jsxs5(
|
|
5104
|
+
"div",
|
|
5105
|
+
{
|
|
5106
|
+
className: `${styles.detailPanel} ${detailVisible ? `open ${resolvedDetailSize}` : ""}`,
|
|
5107
|
+
children: [
|
|
5108
|
+
detailVisible && isMobile && /* @__PURE__ */ jsx12(
|
|
5109
|
+
"button",
|
|
5110
|
+
{
|
|
5111
|
+
className: styles.mobilePanelClose,
|
|
5112
|
+
onClick: closeDetail,
|
|
5113
|
+
"aria-label": "Close detail panel",
|
|
5114
|
+
children: /* @__PURE__ */ jsx12(X, { size: 20 })
|
|
5115
|
+
}
|
|
5116
|
+
),
|
|
5117
|
+
detailVisible && detailSelectedCard && detail ? /* @__PURE__ */ jsx12("div", { className: styles.detailContent, children: detail }) : null
|
|
5118
|
+
]
|
|
5119
|
+
}
|
|
5120
|
+
),
|
|
5121
|
+
/* @__PURE__ */ jsxs5("div", { className: `${styles.toolPanel} ${toolsVisible ? "open" : ""}`, children: [
|
|
5122
|
+
toolsVisible && isMobile && /* @__PURE__ */ jsx12(
|
|
5123
|
+
"button",
|
|
5124
|
+
{
|
|
5125
|
+
className: styles.mobilePanelClose,
|
|
5126
|
+
onClick: closeTools,
|
|
5127
|
+
"aria-label": "Close tool panel",
|
|
5128
|
+
children: /* @__PURE__ */ jsx12(X, { size: 20 })
|
|
5129
|
+
}
|
|
5130
|
+
),
|
|
5131
|
+
toolsVisible && tools ? /* @__PURE__ */ jsx12("div", { className: styles.detailContent, children: tools }) : null
|
|
5132
|
+
] })
|
|
5133
|
+
]
|
|
5134
|
+
}
|
|
5135
|
+
)
|
|
4941
5136
|
] })
|
|
4942
5137
|
] });
|
|
4943
5138
|
};
|
|
@@ -4951,11 +5146,11 @@ import {
|
|
|
4951
5146
|
|
|
4952
5147
|
// src/components/GenUI/elements/confirm_feedback.tsx
|
|
4953
5148
|
import { Button as Button9, Space as Space3, Typography as Typography4 } from "antd";
|
|
4954
|
-
import { useState as
|
|
5149
|
+
import { useState as useState27 } from "react";
|
|
4955
5150
|
|
|
4956
5151
|
// src/components/GenUI/MDResponse.tsx
|
|
4957
5152
|
import XMarkdown from "@ant-design/x-markdown";
|
|
4958
|
-
import React13, { useRef as useRef11, useState as
|
|
5153
|
+
import React13, { useRef as useRef11, useState as useState26, useMemo as useMemo7, useDeferredValue } from "react";
|
|
4959
5154
|
import { createStyles as createStyles6 } from "antd-style";
|
|
4960
5155
|
|
|
4961
5156
|
// src/components/GenUI/Code.tsx
|
|
@@ -4963,13 +5158,13 @@ import { CodeHighlighter, Mermaid } from "@ant-design/x";
|
|
|
4963
5158
|
|
|
4964
5159
|
// src/components/GenUI/ReactInfographic.tsx
|
|
4965
5160
|
import { Infographic } from "@antv/infographic";
|
|
4966
|
-
import { useRef as useRef8, useEffect as
|
|
5161
|
+
import { useRef as useRef8, useEffect as useEffect15 } from "react";
|
|
4967
5162
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
4968
5163
|
var ReactInfographic = (props) => {
|
|
4969
5164
|
const { children } = props;
|
|
4970
5165
|
const $container = useRef8(null);
|
|
4971
5166
|
let infographicInstance = useRef8(null);
|
|
4972
|
-
|
|
5167
|
+
useEffect15(() => {
|
|
4973
5168
|
if ($container.current) {
|
|
4974
5169
|
infographicInstance.current = new Infographic({
|
|
4975
5170
|
container: $container.current,
|
|
@@ -4984,7 +5179,7 @@ var ReactInfographic = (props) => {
|
|
|
4984
5179
|
infographicInstance.current?.destroy();
|
|
4985
5180
|
};
|
|
4986
5181
|
}, []);
|
|
4987
|
-
|
|
5182
|
+
useEffect15(() => {
|
|
4988
5183
|
const a = `infographic sequence-steps-simple
|
|
4989
5184
|
data
|
|
4990
5185
|
sequences
|
|
@@ -5000,14 +5195,14 @@ data
|
|
|
5000
5195
|
};
|
|
5001
5196
|
|
|
5002
5197
|
// src/components/GenUI/ReactChart.tsx
|
|
5003
|
-
import { useEffect as
|
|
5198
|
+
import { useEffect as useEffect16, useRef as useRef9, useState as useState23 } from "react";
|
|
5004
5199
|
import * as echarts from "echarts";
|
|
5005
5200
|
import { Card as Card5 } from "antd";
|
|
5006
5201
|
import { parse } from "best-effort-json-parser";
|
|
5007
5202
|
|
|
5008
5203
|
// src/components/GenUI/elements/generic_data_table.tsx
|
|
5009
5204
|
import { Table, Typography as Typography3, Button as Button5, Flex, Space as Space2 } from "antd";
|
|
5010
|
-
import { useState as
|
|
5205
|
+
import { useState as useState22 } from "react";
|
|
5011
5206
|
import { DownloadOutlined, ExpandAltOutlined } from "@ant-design/icons";
|
|
5012
5207
|
|
|
5013
5208
|
// src/components/Chat/SideAppBrowserContext.tsx
|
|
@@ -5027,7 +5222,7 @@ import { jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
|
5027
5222
|
var { Text: Text3 } = Typography3;
|
|
5028
5223
|
var GenericDataTable = ({ data, interactive = true, default_open_in_side_app = true }) => {
|
|
5029
5224
|
const { dataSource, message: message23 } = data ?? {};
|
|
5030
|
-
const [expandedRowKeys, setExpandedRowKeys] =
|
|
5225
|
+
const [expandedRowKeys, setExpandedRowKeys] = useState22([]);
|
|
5031
5226
|
const openSideApp = useSideAppOpener();
|
|
5032
5227
|
const processedData = dataSource?.map((item, index) => ({
|
|
5033
5228
|
...item,
|
|
@@ -5507,8 +5702,8 @@ var ReactChart = (props) => {
|
|
|
5507
5702
|
const chartRef = useRef9(null);
|
|
5508
5703
|
const chartInstance = useRef9(null);
|
|
5509
5704
|
const resizeObserverRef = useRef9(null);
|
|
5510
|
-
const [tableData, setTableData] =
|
|
5511
|
-
|
|
5705
|
+
const [tableData, setTableData] = useState23(null);
|
|
5706
|
+
useEffect16(() => {
|
|
5512
5707
|
if (!chartRef.current) {
|
|
5513
5708
|
return;
|
|
5514
5709
|
}
|
|
@@ -5581,7 +5776,7 @@ var ReactChart = (props) => {
|
|
|
5581
5776
|
window.removeEventListener("resize", handleResize);
|
|
5582
5777
|
};
|
|
5583
5778
|
}, [children]);
|
|
5584
|
-
|
|
5779
|
+
useEffect16(() => {
|
|
5585
5780
|
return () => {
|
|
5586
5781
|
if (resizeObserverRef.current) {
|
|
5587
5782
|
resizeObserverRef.current.disconnect();
|
|
@@ -5641,12 +5836,12 @@ import { Collapse } from "antd";
|
|
|
5641
5836
|
import { createStyles as createStyles5 } from "antd-style";
|
|
5642
5837
|
|
|
5643
5838
|
// src/components/GenUI/FileRenderer.tsx
|
|
5644
|
-
import { useEffect as
|
|
5839
|
+
import { useEffect as useEffect18, useState as useState25, useMemo as useMemo3 } from "react";
|
|
5645
5840
|
import { Spin as Spin2, Alert as Alert4, Button as Button7 } from "antd";
|
|
5646
5841
|
import { createStyles as createStyles4 } from "antd-style";
|
|
5647
5842
|
|
|
5648
5843
|
// src/components/GenUI/MarkdownViewer.tsx
|
|
5649
|
-
import React9, { useState as
|
|
5844
|
+
import React9, { useState as useState24, useEffect as useEffect17, useRef as useRef10 } from "react";
|
|
5650
5845
|
import { Button as Button6, Tooltip, message } from "antd";
|
|
5651
5846
|
import {
|
|
5652
5847
|
CopyOutlined,
|
|
@@ -5919,9 +6114,9 @@ var MarkdownViewer = ({
|
|
|
5919
6114
|
style
|
|
5920
6115
|
}) => {
|
|
5921
6116
|
const { styles, cx } = useStyles();
|
|
5922
|
-
const [copied, setCopied] =
|
|
6117
|
+
const [copied, setCopied] = useState24(false);
|
|
5923
6118
|
const contentRef = useRef10(null);
|
|
5924
|
-
|
|
6119
|
+
useEffect17(() => {
|
|
5925
6120
|
if (copied) {
|
|
5926
6121
|
const timer = setTimeout(() => setCopied(false), 2e3);
|
|
5927
6122
|
return () => clearTimeout(timer);
|
|
@@ -6174,11 +6369,11 @@ var FileRenderer = ({
|
|
|
6174
6369
|
showHeader = true
|
|
6175
6370
|
}) => {
|
|
6176
6371
|
const { styles } = useStyles2();
|
|
6177
|
-
const [content, setContent] =
|
|
6178
|
-
const [loading, setLoading] =
|
|
6179
|
-
const [error, setError] =
|
|
6372
|
+
const [content, setContent] = useState25("");
|
|
6373
|
+
const [loading, setLoading] = useState25(true);
|
|
6374
|
+
const [error, setError] = useState25(null);
|
|
6180
6375
|
const category = useMemo3(() => getFileCategory(fileName), [fileName]);
|
|
6181
|
-
|
|
6376
|
+
useEffect18(() => {
|
|
6182
6377
|
if (category === "markdown" || category === "text") {
|
|
6183
6378
|
setLoading(true);
|
|
6184
6379
|
setError(null);
|
|
@@ -6734,7 +6929,7 @@ var ConfirmFeedback = ({
|
|
|
6734
6929
|
}) => {
|
|
6735
6930
|
const { message: message23, type, config, feedback, options } = data ?? {};
|
|
6736
6931
|
const { sendMessage } = useAgentChat();
|
|
6737
|
-
const [clicked, setClicked] =
|
|
6932
|
+
const [clicked, setClicked] = useState27(false);
|
|
6738
6933
|
return /* @__PURE__ */ jsxs11(Space3, { direction: "vertical", style: { width: "100%" }, children: [
|
|
6739
6934
|
/* @__PURE__ */ jsx24(MDResponse, { content: message23 }),
|
|
6740
6935
|
options ? /* @__PURE__ */ jsx24(Space3, { style: { justifyContent: "flex-end", width: "100%" }, children: options?.map((option) => /* @__PURE__ */ jsx24(
|
|
@@ -6813,7 +7008,7 @@ var ConfirmFeedback = ({
|
|
|
6813
7008
|
|
|
6814
7009
|
// src/components/GenUI/elements/clarify_feedback.tsx
|
|
6815
7010
|
import { Button as Button10, Space as Space4, Typography as Typography5, List, Checkbox, Input as Input3 } from "antd";
|
|
6816
|
-
import { useState as
|
|
7011
|
+
import { useState as useState28 } from "react";
|
|
6817
7012
|
import { Fragment as Fragment3, jsx as jsx25, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
6818
7013
|
var { Text: Text5 } = Typography5;
|
|
6819
7014
|
var ClarifyFeedback = ({
|
|
@@ -6822,9 +7017,9 @@ var ClarifyFeedback = ({
|
|
|
6822
7017
|
}) => {
|
|
6823
7018
|
const { questions } = data ?? {};
|
|
6824
7019
|
const { sendMessage } = useAgentChat();
|
|
6825
|
-
const [currentStep, setCurrentStep] =
|
|
6826
|
-
const [answers, setAnswers] =
|
|
6827
|
-
const [submitted, setSubmitted] =
|
|
7020
|
+
const [currentStep, setCurrentStep] = useState28(0);
|
|
7021
|
+
const [answers, setAnswers] = useState28({});
|
|
7022
|
+
const [submitted, setSubmitted] = useState28(false);
|
|
6828
7023
|
const currentQuestion = questions?.[currentStep];
|
|
6829
7024
|
const totalQuestions = questions?.length || 0;
|
|
6830
7025
|
const handleOptionChange = (selected) => {
|
|
@@ -7337,7 +7532,7 @@ import {
|
|
|
7337
7532
|
DownOutlined,
|
|
7338
7533
|
UpOutlined
|
|
7339
7534
|
} from "@ant-design/icons";
|
|
7340
|
-
import { useState as
|
|
7535
|
+
import { useState as useState29, useEffect as useEffect20 } from "react";
|
|
7341
7536
|
import { jsx as jsx30, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
7342
7537
|
var { Text: Text7 } = Typography8;
|
|
7343
7538
|
var useStyle3 = createStyles8(({ token, css }) => ({
|
|
@@ -7382,10 +7577,10 @@ var Todo = ({
|
|
|
7382
7577
|
const allCompleted = data.every((item) => item.status === "completed");
|
|
7383
7578
|
return allPending || allCompleted;
|
|
7384
7579
|
};
|
|
7385
|
-
const [isExpanded, setIsExpanded] =
|
|
7580
|
+
const [isExpanded, setIsExpanded] = useState29(
|
|
7386
7581
|
() => smartCollapse ? getDefaultExpanded() : false
|
|
7387
7582
|
);
|
|
7388
|
-
|
|
7583
|
+
useEffect20(() => {
|
|
7389
7584
|
if (smartCollapse) {
|
|
7390
7585
|
setIsExpanded(getDefaultExpanded());
|
|
7391
7586
|
}
|
|
@@ -7576,7 +7771,7 @@ var WriteTodos = ({
|
|
|
7576
7771
|
};
|
|
7577
7772
|
|
|
7578
7773
|
// src/components/GenUI/FileExplorer.tsx
|
|
7579
|
-
import { useState as
|
|
7774
|
+
import { useState as useState30, useEffect as useEffect21, useMemo as useMemo8 } from "react";
|
|
7580
7775
|
import { Splitter, Tree, Empty } from "antd";
|
|
7581
7776
|
import {
|
|
7582
7777
|
FolderOutlined,
|
|
@@ -7860,10 +8055,10 @@ var FileExplorer = ({
|
|
|
7860
8055
|
}) => {
|
|
7861
8056
|
const { files } = data ?? {};
|
|
7862
8057
|
const { styles, cx } = useStyles5();
|
|
7863
|
-
const [fileList, setFileList] =
|
|
7864
|
-
const [selectedKey, setSelectedKey] =
|
|
7865
|
-
const [expandedKeys, setExpandedKeys] =
|
|
7866
|
-
|
|
8058
|
+
const [fileList, setFileList] = useState30([]);
|
|
8059
|
+
const [selectedKey, setSelectedKey] = useState30("");
|
|
8060
|
+
const [expandedKeys, setExpandedKeys] = useState30([]);
|
|
8061
|
+
useEffect21(() => {
|
|
7867
8062
|
let list = [];
|
|
7868
8063
|
if (Array.isArray(files)) {
|
|
7869
8064
|
list = files;
|
|
@@ -7883,7 +8078,7 @@ var FileExplorer = ({
|
|
|
7883
8078
|
() => buildTreeData(fileList, expandedKeys),
|
|
7884
8079
|
[fileList, expandedKeys]
|
|
7885
8080
|
);
|
|
7886
|
-
|
|
8081
|
+
useEffect21(() => {
|
|
7887
8082
|
if (treeData.length > 0 && expandedKeys.length === 0) {
|
|
7888
8083
|
const getAllKeys = (nodes) => {
|
|
7889
8084
|
let keys = [];
|
|
@@ -7977,7 +8172,7 @@ import {
|
|
|
7977
8172
|
Button as Button13
|
|
7978
8173
|
} from "antd";
|
|
7979
8174
|
import dayjs from "dayjs";
|
|
7980
|
-
import { useState as
|
|
8175
|
+
import { useState as useState31 } from "react";
|
|
7981
8176
|
import { jsx as jsx34, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
7982
8177
|
var AttachmentsCard = ({
|
|
7983
8178
|
data,
|
|
@@ -7991,7 +8186,7 @@ var AttachmentsCard = ({
|
|
|
7991
8186
|
const baseURL = config.baseURL;
|
|
7992
8187
|
const fileBaseURL = `${baseURL}/api/assistants/${assistantId}/threads/${threadId}/sandbox/downloadfile?path=`;
|
|
7993
8188
|
const { Text: Text48 } = Typography10;
|
|
7994
|
-
const [showAll, setShowAll] =
|
|
8189
|
+
const [showAll, setShowAll] = useState31(false);
|
|
7995
8190
|
const openSideApp = useSideAppOpener();
|
|
7996
8191
|
const getStyles = () => {
|
|
7997
8192
|
switch (size) {
|
|
@@ -8173,7 +8368,7 @@ var AttachmentsCard = ({
|
|
|
8173
8368
|
|
|
8174
8369
|
// src/components/GenUI/elements/attachments_viewer_side_app.tsx
|
|
8175
8370
|
import { Button as Button14, Empty as Empty2, Skeleton } from "antd";
|
|
8176
|
-
import { useEffect as
|
|
8371
|
+
import { useEffect as useEffect22, useState as useState32 } from "react";
|
|
8177
8372
|
|
|
8178
8373
|
// src/components/GenUI/RenderMDFromURL.tsx
|
|
8179
8374
|
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
@@ -8194,13 +8389,13 @@ function AttachmentsViewerSideApp({
|
|
|
8194
8389
|
data,
|
|
8195
8390
|
component_key
|
|
8196
8391
|
}) {
|
|
8197
|
-
const [loading, setLoading] =
|
|
8392
|
+
const [loading, setLoading] = useState32(false);
|
|
8198
8393
|
const { file_id, url, full_url } = data ?? {};
|
|
8199
|
-
const [fileUri, setFileUri] =
|
|
8394
|
+
const [fileUri, setFileUri] = useState32({
|
|
8200
8395
|
url: full_url || "",
|
|
8201
8396
|
fileName: extractFileName(file_id || "")
|
|
8202
8397
|
});
|
|
8203
|
-
|
|
8398
|
+
useEffect22(() => {
|
|
8204
8399
|
setFileUri({
|
|
8205
8400
|
url: full_url || "",
|
|
8206
8401
|
fileName: extractFileName(file_id || "")
|
|
@@ -8244,7 +8439,7 @@ function AttachmentsViewerSideApp({
|
|
|
8244
8439
|
import { Button as Button15, Space as Space10, Typography as Typography11 } from "antd";
|
|
8245
8440
|
|
|
8246
8441
|
// src/components/GenUI/elements/ContentPreviewCollapse.tsx
|
|
8247
|
-
import { useRef as useRef12, useState as
|
|
8442
|
+
import { useRef as useRef12, useState as useState33, useEffect as useEffect23, useCallback as useCallback20 } from "react";
|
|
8248
8443
|
import { Collapse as Collapse5 } from "antd";
|
|
8249
8444
|
import { createStyles as createStyles10 } from "antd-style";
|
|
8250
8445
|
import { DownOutlined as DownOutlined3, UpOutlined as UpOutlined2 } from "@ant-design/icons";
|
|
@@ -8314,8 +8509,8 @@ var ContentPreviewCollapse = ({
|
|
|
8314
8509
|
showAllText = "Show all content",
|
|
8315
8510
|
showLessText = "Show less"
|
|
8316
8511
|
}) => {
|
|
8317
|
-
const [showFullContent, setShowFullContent] =
|
|
8318
|
-
const [isOverflowing, setIsOverflowing] =
|
|
8512
|
+
const [showFullContent, setShowFullContent] = useState33(false);
|
|
8513
|
+
const [isOverflowing, setIsOverflowing] = useState33(false);
|
|
8319
8514
|
const contentRef = useRef12(null);
|
|
8320
8515
|
const showShadow = isOverflowing && !showFullContent;
|
|
8321
8516
|
const { styles, cx } = useStyle4({ showShadow });
|
|
@@ -8325,7 +8520,7 @@ var ContentPreviewCollapse = ({
|
|
|
8325
8520
|
setIsOverflowing(scrollHeight > collapsedMaxHeight);
|
|
8326
8521
|
}
|
|
8327
8522
|
}, [collapsedMaxHeight]);
|
|
8328
|
-
|
|
8523
|
+
useEffect23(() => {
|
|
8329
8524
|
const element = contentRef.current;
|
|
8330
8525
|
if (!element) return;
|
|
8331
8526
|
checkOverflow();
|
|
@@ -8819,10 +9014,10 @@ import ErrorBoundary from "antd/es/alert/ErrorBoundary";
|
|
|
8819
9014
|
import {
|
|
8820
9015
|
memo,
|
|
8821
9016
|
useCallback as useCallback21,
|
|
8822
|
-
useEffect as
|
|
9017
|
+
useEffect as useEffect24,
|
|
8823
9018
|
useMemo as useMemo9,
|
|
8824
9019
|
useRef as useRef13,
|
|
8825
|
-
useState as
|
|
9020
|
+
useState as useState34
|
|
8826
9021
|
} from "react";
|
|
8827
9022
|
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
8828
9023
|
var LazyBubble = ({
|
|
@@ -8831,9 +9026,9 @@ var LazyBubble = ({
|
|
|
8831
9026
|
autoLoadRightPanel
|
|
8832
9027
|
}) => {
|
|
8833
9028
|
const ref = useRef13(null);
|
|
8834
|
-
const [isVisible, setIsVisible] =
|
|
8835
|
-
const [wasEverVisible, setWasEverVisible] =
|
|
8836
|
-
|
|
9029
|
+
const [isVisible, setIsVisible] = useState34(false);
|
|
9030
|
+
const [wasEverVisible, setWasEverVisible] = useState34(false);
|
|
9031
|
+
useEffect24(() => {
|
|
8837
9032
|
const observer = new IntersectionObserver(
|
|
8838
9033
|
([entry]) => {
|
|
8839
9034
|
const visible = entry.isIntersecting;
|
|
@@ -8853,7 +9048,7 @@ var LazyBubble = ({
|
|
|
8853
9048
|
}
|
|
8854
9049
|
};
|
|
8855
9050
|
}, [wasEverVisible]);
|
|
8856
|
-
|
|
9051
|
+
useEffect24(() => {
|
|
8857
9052
|
autoLoadRightPanel?.();
|
|
8858
9053
|
}, []);
|
|
8859
9054
|
const getPlaceholder = () => {
|
|
@@ -8886,7 +9081,7 @@ var MessageList = ({
|
|
|
8886
9081
|
const { styles } = useStyle();
|
|
8887
9082
|
const openSideApp = useSideAppOpener();
|
|
8888
9083
|
const messageLengthRef = useRef13(messages?.length ?? 0);
|
|
8889
|
-
|
|
9084
|
+
useEffect24(() => {
|
|
8890
9085
|
if (messages?.length) {
|
|
8891
9086
|
messageLengthRef.current = messages?.length;
|
|
8892
9087
|
}
|
|
@@ -8996,7 +9191,7 @@ import {
|
|
|
8996
9191
|
Space as Space30,
|
|
8997
9192
|
Typography as Typography42
|
|
8998
9193
|
} from "antd";
|
|
8999
|
-
import React51, { useCallback as useCallback33, useContext as useContext11, useEffect as
|
|
9194
|
+
import React51, { useCallback as useCallback33, useContext as useContext11, useEffect as useEffect47, useRef as useRef23, useState as useState66 } from "react";
|
|
9000
9195
|
import { BrainCircuit as BrainCircuit3 } from "lucide-react";
|
|
9001
9196
|
|
|
9002
9197
|
// src/components/GenUI/HITLContainer.tsx
|
|
@@ -9070,7 +9265,7 @@ var HITLContainer = () => {
|
|
|
9070
9265
|
import { Typography as Typography15, Space as Space14, Button as Button18, message as message4 } from "antd";
|
|
9071
9266
|
import { createStyles as createStyles13 } from "antd-style";
|
|
9072
9267
|
import { ClockCircleOutlined as ClockCircleOutlined2, DownOutlined as DownOutlined4, RightOutlined as RightOutlined3, LoadingOutlined as LoadingOutlined3, DeleteOutlined } from "@ant-design/icons";
|
|
9073
|
-
import { useState as
|
|
9268
|
+
import { useState as useState35 } from "react";
|
|
9074
9269
|
import { jsx as jsx44, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
9075
9270
|
var useStyle7 = createStyles13(({ css, token }) => ({
|
|
9076
9271
|
container: css`
|
|
@@ -9160,9 +9355,9 @@ var useStyle7 = createStyles13(({ css, token }) => ({
|
|
|
9160
9355
|
var PendingMessagesContainer = () => {
|
|
9161
9356
|
const { styles } = useStyle7();
|
|
9162
9357
|
const { pendingMessages, sendMessage, removePendingMessage } = useAgentChat();
|
|
9163
|
-
const [expanded, setExpanded] =
|
|
9164
|
-
const [sendingId, setSendingId] =
|
|
9165
|
-
const [deletingId, setDeletingId] =
|
|
9358
|
+
const [expanded, setExpanded] = useState35(true);
|
|
9359
|
+
const [sendingId, setSendingId] = useState35(null);
|
|
9360
|
+
const [deletingId, setDeletingId] = useState35(null);
|
|
9166
9361
|
if (!pendingMessages || pendingMessages.length === 0) return null;
|
|
9167
9362
|
const handleSendMessage = async (msg) => {
|
|
9168
9363
|
if (sendingId || deletingId) return;
|
|
@@ -9617,7 +9812,7 @@ var FileExplorerButton = ({}) => {
|
|
|
9617
9812
|
};
|
|
9618
9813
|
|
|
9619
9814
|
// src/components/Chat/ScheduleButton.tsx
|
|
9620
|
-
import { useState as
|
|
9815
|
+
import { useState as useState36, useCallback as useCallback22, useEffect as useEffect25 } from "react";
|
|
9621
9816
|
import { Tooltip as Tooltip6, Button as Button20, Spin as Spin3 } from "antd";
|
|
9622
9817
|
import { CalendarOutlined } from "@ant-design/icons";
|
|
9623
9818
|
import { ScheduledTaskStatus } from "@axiom-lattice/client-sdk";
|
|
@@ -9628,9 +9823,9 @@ var ScheduleButton = ({
|
|
|
9628
9823
|
const { threadId, assistantId } = useAgentChat();
|
|
9629
9824
|
const { openSideApp } = useChatUIContext();
|
|
9630
9825
|
const client = useClient(assistantId || "");
|
|
9631
|
-
const [scheduledTasks, setScheduledTasks] =
|
|
9632
|
-
const [loading, setLoading] =
|
|
9633
|
-
const [taskCount, setTaskCount] =
|
|
9826
|
+
const [scheduledTasks, setScheduledTasks] = useState36([]);
|
|
9827
|
+
const [loading, setLoading] = useState36(false);
|
|
9828
|
+
const [taskCount, setTaskCount] = useState36(0);
|
|
9634
9829
|
const fetchScheduledTasks = useCallback22(async () => {
|
|
9635
9830
|
if (!threadId) return;
|
|
9636
9831
|
setLoading(true);
|
|
@@ -9649,7 +9844,7 @@ var ScheduleButton = ({
|
|
|
9649
9844
|
setLoading(false);
|
|
9650
9845
|
}
|
|
9651
9846
|
}, [client, threadId]);
|
|
9652
|
-
|
|
9847
|
+
useEffect25(() => {
|
|
9653
9848
|
fetchScheduledTasks();
|
|
9654
9849
|
}, [fetchScheduledTasks]);
|
|
9655
9850
|
if (!threadId) {
|
|
@@ -10057,19 +10252,19 @@ var ThreadManagementButtons = () => {
|
|
|
10057
10252
|
import React43, {
|
|
10058
10253
|
createContext as createContext9,
|
|
10059
10254
|
useContext as useContext10,
|
|
10060
|
-
useState as
|
|
10255
|
+
useState as useState58,
|
|
10061
10256
|
useCallback as useCallback31,
|
|
10062
|
-
useEffect as
|
|
10257
|
+
useEffect as useEffect42
|
|
10063
10258
|
} from "react";
|
|
10064
10259
|
import { WorkspaceClient, Client as Client2 } from "@axiom-lattice/client-sdk";
|
|
10065
10260
|
|
|
10066
10261
|
// src/components/Chat/WorkspaceResourceManager.tsx
|
|
10067
|
-
import { useMemo as useMemo20, useEffect as
|
|
10262
|
+
import { useMemo as useMemo20, useEffect as useEffect41, useRef as useRef17, useState as useState57 } from "react";
|
|
10068
10263
|
import { FolderOpen as FolderOpen2, Activity as Activity3, Database as Database4, Plug as Plug2, Bot as Bot2, Wrench, Zap, LogOut as LogOut3, Building2 as Building23, Key, Share2, History, Inbox, FlaskConical as FlaskConical3 } from "lucide-react";
|
|
10069
10264
|
import { Modal as Modal13, Avatar as Avatar8, Popover as Popover2, Button as Button41 } from "antd";
|
|
10070
10265
|
|
|
10071
10266
|
// src/components/Chat/Menu.tsx
|
|
10072
|
-
import React19, { useState as
|
|
10267
|
+
import React19, { useState as useState37, useEffect as useEffect26, useMemo as useMemo10, useCallback as useCallback24 } from "react";
|
|
10073
10268
|
import { Drawer } from "antd";
|
|
10074
10269
|
import { Plus, ChevronRight, ChevronDown, Cpu, PanelLeftClose } from "lucide-react";
|
|
10075
10270
|
import { createStyles as createStyles16 } from "antd-style";
|
|
@@ -10181,10 +10376,15 @@ var Menu = ({
|
|
|
10181
10376
|
const { styles: menuStyles } = useMenuStyles();
|
|
10182
10377
|
const { styles } = useStyle();
|
|
10183
10378
|
const isControlled = collapsed !== void 0;
|
|
10184
|
-
const [internalIsIconView, setInternalIsIconView] =
|
|
10379
|
+
const [internalIsIconView, setInternalIsIconView] = useState37(!defaultExpanded);
|
|
10185
10380
|
const isIconView = isControlled ? collapsed : internalIsIconView;
|
|
10186
|
-
|
|
10187
|
-
|
|
10381
|
+
useEffect26(() => {
|
|
10382
|
+
if (!isControlled) {
|
|
10383
|
+
onCollapsedChange?.(isIconView);
|
|
10384
|
+
}
|
|
10385
|
+
}, []);
|
|
10386
|
+
const [drawerStates, setDrawerStates] = useState37({});
|
|
10387
|
+
const [expandedInlineDrawers, setExpandedInlineDrawers] = useState37(
|
|
10188
10388
|
() => {
|
|
10189
10389
|
const defaultExpanded2 = /* @__PURE__ */ new Set();
|
|
10190
10390
|
items.forEach((item) => {
|
|
@@ -10384,13 +10584,13 @@ var Menu = ({
|
|
|
10384
10584
|
};
|
|
10385
10585
|
|
|
10386
10586
|
// src/components/Chat/ProjectCardList.tsx
|
|
10387
|
-
import { useState as
|
|
10587
|
+
import { useState as useState39 } from "react";
|
|
10388
10588
|
import { Button as Button24, Empty as Empty3, Spin as Spin4, Card as Card11, Typography as Typography16, theme as theme2 } from "antd";
|
|
10389
10589
|
import { createStyles as createStyles17 } from "antd-style";
|
|
10390
10590
|
import { Plus as Plus2, LayoutGrid, List as List3, FolderOpen } from "lucide-react";
|
|
10391
10591
|
|
|
10392
10592
|
// src/components/Chat/CreateProjectModal.tsx
|
|
10393
|
-
import { useState as
|
|
10593
|
+
import { useState as useState38 } from "react";
|
|
10394
10594
|
import { Modal as Modal2, Input as Input4, Form as Form3 } from "antd";
|
|
10395
10595
|
import { jsx as jsx57, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
10396
10596
|
var CreateProjectModal = ({
|
|
@@ -10399,7 +10599,7 @@ var CreateProjectModal = ({
|
|
|
10399
10599
|
onCreate
|
|
10400
10600
|
}) => {
|
|
10401
10601
|
const [form] = Form3.useForm();
|
|
10402
|
-
const [isSubmitting, setIsSubmitting] =
|
|
10602
|
+
const [isSubmitting, setIsSubmitting] = useState38(false);
|
|
10403
10603
|
const handleSubmit = async (values) => {
|
|
10404
10604
|
setIsSubmitting(true);
|
|
10405
10605
|
try {
|
|
@@ -10752,8 +10952,8 @@ var useStyle8 = createStyles17(({ css, token }) => ({
|
|
|
10752
10952
|
var ProjectCardList = () => {
|
|
10753
10953
|
const { styles } = useStyle8();
|
|
10754
10954
|
const { token } = theme2.useToken();
|
|
10755
|
-
const [viewMode, setViewMode] =
|
|
10756
|
-
const [isCreateModalOpen, setIsCreateModalOpen] =
|
|
10955
|
+
const [viewMode, setViewMode] = useState39("grid");
|
|
10956
|
+
const [isCreateModalOpen, setIsCreateModalOpen] = useState39(false);
|
|
10757
10957
|
const {
|
|
10758
10958
|
projects,
|
|
10759
10959
|
loading,
|
|
@@ -10896,7 +11096,7 @@ var ProjectCardList = () => {
|
|
|
10896
11096
|
};
|
|
10897
11097
|
|
|
10898
11098
|
// src/components/Chat/MetricsConfigDrawerContent.tsx
|
|
10899
|
-
import { useState as
|
|
11099
|
+
import { useState as useState40, useEffect as useEffect27 } from "react";
|
|
10900
11100
|
import { Activity, Plus as Plus3, Edit2, Trash2, TestTube2, Loader2, Database, Settings, ChevronRight as ChevronRight2, ChevronLeft as ChevronLeft2, Check as Check2 } from "lucide-react";
|
|
10901
11101
|
import { Card as Card12, Button as Button25, Space as Space16, Typography as Typography17, Tag as Tag6, Modal as Modal3, message as message5, Input as Input5, Select, Popconfirm, Steps, Checkbox as Checkbox2, Spin as Spin5, theme as theme3 } from "antd";
|
|
10902
11102
|
import { jsx as jsx59, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
@@ -10907,13 +11107,13 @@ var MetricsConfigDrawerContent = () => {
|
|
|
10907
11107
|
const { config } = useLatticeChatShellContext();
|
|
10908
11108
|
const { token } = useToken2();
|
|
10909
11109
|
const { get, post, put, del } = useApi();
|
|
10910
|
-
const [configs, setConfigs] =
|
|
10911
|
-
const [loading, setLoading] =
|
|
10912
|
-
const [testingId, setTestingId] =
|
|
10913
|
-
const [formModalOpen, setFormModalOpen] =
|
|
10914
|
-
const [editingConfig, setEditingConfig] =
|
|
11110
|
+
const [configs, setConfigs] = useState40([]);
|
|
11111
|
+
const [loading, setLoading] = useState40(false);
|
|
11112
|
+
const [testingId, setTestingId] = useState40(null);
|
|
11113
|
+
const [formModalOpen, setFormModalOpen] = useState40(false);
|
|
11114
|
+
const [editingConfig, setEditingConfig] = useState40(null);
|
|
10915
11115
|
const tenantId = config.headers?.["x-tenant-id"] || "default";
|
|
10916
|
-
|
|
11116
|
+
useEffect27(() => {
|
|
10917
11117
|
loadConfigs();
|
|
10918
11118
|
}, [tenantId]);
|
|
10919
11119
|
const loadConfigs = async () => {
|
|
@@ -11112,14 +11312,14 @@ var MetricsConfigFormModal = ({
|
|
|
11112
11312
|
const { token } = useToken2();
|
|
11113
11313
|
const { get, post, put } = useApi();
|
|
11114
11314
|
const tenantId = config.headers?.["x-tenant-id"] || "default";
|
|
11115
|
-
const [currentStep, setCurrentStep] =
|
|
11116
|
-
const [saving, setSaving] =
|
|
11117
|
-
const [fetchingDatasources, setFetchingDatasources] =
|
|
11118
|
-
const [availableDatasources, setAvailableDatasources] =
|
|
11119
|
-
const [selectedViewDatasource, setSelectedViewDatasource] =
|
|
11120
|
-
const [availableMetrics, setAvailableMetrics] =
|
|
11121
|
-
const [fetchingMetrics, setFetchingMetrics] =
|
|
11122
|
-
const [formData, setFormData] =
|
|
11315
|
+
const [currentStep, setCurrentStep] = useState40(0);
|
|
11316
|
+
const [saving, setSaving] = useState40(false);
|
|
11317
|
+
const [fetchingDatasources, setFetchingDatasources] = useState40(false);
|
|
11318
|
+
const [availableDatasources, setAvailableDatasources] = useState40([]);
|
|
11319
|
+
const [selectedViewDatasource, setSelectedViewDatasource] = useState40(null);
|
|
11320
|
+
const [availableMetrics, setAvailableMetrics] = useState40([]);
|
|
11321
|
+
const [fetchingMetrics, setFetchingMetrics] = useState40(false);
|
|
11322
|
+
const [formData, setFormData] = useState40({
|
|
11123
11323
|
key: editingConfig?.key || "",
|
|
11124
11324
|
name: editingConfig?.name || "",
|
|
11125
11325
|
description: editingConfig?.description || "",
|
|
@@ -11159,12 +11359,12 @@ var MetricsConfigFormModal = ({
|
|
|
11159
11359
|
selectedDataSources: editingConfig?.config?.selectedDataSources || []
|
|
11160
11360
|
});
|
|
11161
11361
|
};
|
|
11162
|
-
|
|
11362
|
+
useEffect27(() => {
|
|
11163
11363
|
if (open) {
|
|
11164
11364
|
resetForm();
|
|
11165
11365
|
}
|
|
11166
11366
|
}, [open, editingConfig]);
|
|
11167
|
-
|
|
11367
|
+
useEffect27(() => {
|
|
11168
11368
|
if (currentStep === 1 && availableDatasources.length === 0 && !fetchingDatasources) {
|
|
11169
11369
|
handleFetchDatasources();
|
|
11170
11370
|
}
|
|
@@ -11562,7 +11762,7 @@ var MetricsConfigFormModal = ({
|
|
|
11562
11762
|
};
|
|
11563
11763
|
|
|
11564
11764
|
// src/components/Chat/DatabaseConfigDrawerContent.tsx
|
|
11565
|
-
import { useState as
|
|
11765
|
+
import { useState as useState41, useEffect as useEffect28 } from "react";
|
|
11566
11766
|
import { createStyles as createStyles18 } from "antd-style";
|
|
11567
11767
|
import { Database as Database2, Plus as Plus4, Edit2 as Edit22, Trash2 as Trash22, TestTube2 as TestTube22, Loader2 as Loader22 } from "lucide-react";
|
|
11568
11768
|
import { Card as Card13, Button as Button26, Space as Space17, Typography as Typography18, Tag as Tag7, Modal as Modal4, message as message6, Input as Input6, Select as Select2, Popconfirm as Popconfirm2 } from "antd";
|
|
@@ -11636,12 +11836,12 @@ var DatabaseConfigDrawerContent = ({
|
|
|
11636
11836
|
const { styles } = useStyles7();
|
|
11637
11837
|
const { config } = useLatticeChatShellContext();
|
|
11638
11838
|
const { get, post, put, del } = useApi();
|
|
11639
|
-
const [configs, setConfigs] =
|
|
11640
|
-
const [loading, setLoading] =
|
|
11641
|
-
const [testingId, setTestingId] =
|
|
11642
|
-
const [formModalOpen, setFormModalOpen] =
|
|
11643
|
-
const [editingConfig, setEditingConfig] =
|
|
11644
|
-
|
|
11839
|
+
const [configs, setConfigs] = useState41([]);
|
|
11840
|
+
const [loading, setLoading] = useState41(false);
|
|
11841
|
+
const [testingId, setTestingId] = useState41(null);
|
|
11842
|
+
const [formModalOpen, setFormModalOpen] = useState41(false);
|
|
11843
|
+
const [editingConfig, setEditingConfig] = useState41(null);
|
|
11844
|
+
useEffect28(() => {
|
|
11645
11845
|
loadConfigs();
|
|
11646
11846
|
}, [tenantId]);
|
|
11647
11847
|
const loadConfigs = async () => {
|
|
@@ -11850,7 +12050,7 @@ var DatabaseConfigFormModal = ({
|
|
|
11850
12050
|
}) => {
|
|
11851
12051
|
const { config } = useLatticeChatShellContext();
|
|
11852
12052
|
const { post, put } = useApi();
|
|
11853
|
-
const [formData, setFormData] =
|
|
12053
|
+
const [formData, setFormData] = useState41({
|
|
11854
12054
|
key: editingConfig?.key || "",
|
|
11855
12055
|
name: editingConfig?.name || "",
|
|
11856
12056
|
description: editingConfig?.description || "",
|
|
@@ -11862,7 +12062,7 @@ var DatabaseConfigFormModal = ({
|
|
|
11862
12062
|
password: editingConfig?.config.password || "",
|
|
11863
12063
|
connectionString: editingConfig?.config.connectionString || ""
|
|
11864
12064
|
});
|
|
11865
|
-
const [saving, setSaving] =
|
|
12065
|
+
const [saving, setSaving] = useState41(false);
|
|
11866
12066
|
const handleSubmit = async () => {
|
|
11867
12067
|
setSaving(true);
|
|
11868
12068
|
try {
|
|
@@ -12074,7 +12274,7 @@ var DatabaseConfigFormModal = ({
|
|
|
12074
12274
|
};
|
|
12075
12275
|
|
|
12076
12276
|
// src/components/Chat/McpConfigDrawerContent.tsx
|
|
12077
|
-
import { useState as
|
|
12277
|
+
import { useState as useState42, useEffect as useEffect29 } from "react";
|
|
12078
12278
|
import { Plug, Plus as Plus5, Edit2 as Edit23, Trash2 as Trash23, TestTube2 as TestTube23, Loader2 as Loader23, Settings as Settings2, Database as Database3, ChevronRight as ChevronRight3, ChevronLeft as ChevronLeft3, Check as Check3, Terminal, Globe, Server } from "lucide-react";
|
|
12079
12279
|
import { Card as Card14, Button as Button27, Space as Space18, Typography as Typography19, Tag as Tag8, Modal as Modal5, message as message7, Input as Input7, Select as Select3, Popconfirm as Popconfirm3, Steps as Steps2, Checkbox as Checkbox3, Spin as Spin6, theme as theme4, Collapse as Collapse7 } from "antd";
|
|
12080
12280
|
import { Fragment as Fragment9, jsx as jsx61, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
@@ -12088,12 +12288,12 @@ var McpConfigDrawerContent = ({
|
|
|
12088
12288
|
const { config } = useLatticeChatShellContext();
|
|
12089
12289
|
const { token } = useToken3();
|
|
12090
12290
|
const { get, post, put, del } = useApi();
|
|
12091
|
-
const [configs, setConfigs] =
|
|
12092
|
-
const [loading, setLoading] =
|
|
12093
|
-
const [testingId, setTestingId] =
|
|
12094
|
-
const [formModalOpen, setFormModalOpen] =
|
|
12095
|
-
const [editingConfig, setEditingConfig] =
|
|
12096
|
-
|
|
12291
|
+
const [configs, setConfigs] = useState42([]);
|
|
12292
|
+
const [loading, setLoading] = useState42(false);
|
|
12293
|
+
const [testingId, setTestingId] = useState42(null);
|
|
12294
|
+
const [formModalOpen, setFormModalOpen] = useState42(false);
|
|
12295
|
+
const [editingConfig, setEditingConfig] = useState42(null);
|
|
12296
|
+
useEffect29(() => {
|
|
12097
12297
|
loadConfigs();
|
|
12098
12298
|
}, [tenantId]);
|
|
12099
12299
|
const loadConfigs = async () => {
|
|
@@ -12307,11 +12507,11 @@ var McpConfigFormModal = ({
|
|
|
12307
12507
|
const { config } = useLatticeChatShellContext();
|
|
12308
12508
|
const { token } = useToken3();
|
|
12309
12509
|
const { post, put } = useApi();
|
|
12310
|
-
const [currentStep, setCurrentStep] =
|
|
12311
|
-
const [saving, setSaving] =
|
|
12312
|
-
const [fetchingTools, setFetchingTools] =
|
|
12313
|
-
const [availableTools, setAvailableTools] =
|
|
12314
|
-
const [formData, setFormData] =
|
|
12510
|
+
const [currentStep, setCurrentStep] = useState42(0);
|
|
12511
|
+
const [saving, setSaving] = useState42(false);
|
|
12512
|
+
const [fetchingTools, setFetchingTools] = useState42(false);
|
|
12513
|
+
const [availableTools, setAvailableTools] = useState42([]);
|
|
12514
|
+
const [formData, setFormData] = useState42({
|
|
12315
12515
|
key: editingConfig?.key || "",
|
|
12316
12516
|
name: editingConfig?.name || "",
|
|
12317
12517
|
description: editingConfig?.description || "",
|
|
@@ -12351,12 +12551,12 @@ var McpConfigFormModal = ({
|
|
|
12351
12551
|
selectedTools: editingConfig?.selectedTools || []
|
|
12352
12552
|
});
|
|
12353
12553
|
};
|
|
12354
|
-
|
|
12554
|
+
useEffect29(() => {
|
|
12355
12555
|
if (open) {
|
|
12356
12556
|
resetForm();
|
|
12357
12557
|
}
|
|
12358
12558
|
}, [open, editingConfig]);
|
|
12359
|
-
|
|
12559
|
+
useEffect29(() => {
|
|
12360
12560
|
if (currentStep === 1 && availableTools.length === 0 && !fetchingTools) {
|
|
12361
12561
|
handleFetchTools();
|
|
12362
12562
|
}
|
|
@@ -12707,7 +12907,7 @@ var McpConfigFormModal = ({
|
|
|
12707
12907
|
};
|
|
12708
12908
|
|
|
12709
12909
|
// src/components/Chat/AssistantFlow.tsx
|
|
12710
|
-
import { useMemo as useMemo13, useEffect as
|
|
12910
|
+
import { useMemo as useMemo13, useEffect as useEffect32, useState as useState46, useCallback as useCallback27, useRef as useRef15 } from "react";
|
|
12711
12911
|
import {
|
|
12712
12912
|
ReactFlow,
|
|
12713
12913
|
Background,
|
|
@@ -13513,7 +13713,7 @@ var AssistantNode = ({
|
|
|
13513
13713
|
var AssistantNode_default = AssistantNode;
|
|
13514
13714
|
|
|
13515
13715
|
// src/components/Chat/AgentConfigPanel.tsx
|
|
13516
|
-
import { useState as
|
|
13716
|
+
import { useState as useState43, useEffect as useEffect30, useMemo as useMemo12, useCallback as useCallback25, useRef as useRef14 } from "react";
|
|
13517
13717
|
import {
|
|
13518
13718
|
Form as Form4,
|
|
13519
13719
|
Input as Input8,
|
|
@@ -13560,7 +13760,7 @@ var { TextArea: TextArea4 } = Input8;
|
|
|
13560
13760
|
var { Text: Text18, Title: Title4 } = Typography21;
|
|
13561
13761
|
var SectionCard = ({ title, icon, badge, children, defaultExpanded = true }) => {
|
|
13562
13762
|
const { token } = theme6.useToken();
|
|
13563
|
-
const [expanded, setExpanded] =
|
|
13763
|
+
const [expanded, setExpanded] = useState43(defaultExpanded);
|
|
13564
13764
|
return /* @__PURE__ */ jsxs38(
|
|
13565
13765
|
Card15,
|
|
13566
13766
|
{
|
|
@@ -13774,11 +13974,11 @@ var getMiddlewareTypeDefinition = (middlewareType, availableTypes) => {
|
|
|
13774
13974
|
return availableTypes?.find((t) => t.type === middlewareType);
|
|
13775
13975
|
};
|
|
13776
13976
|
var SkillListField = ({ propertyKey, label, value, onChange, token }) => {
|
|
13777
|
-
const [skills, setSkills] =
|
|
13778
|
-
const [loading, setLoading] =
|
|
13977
|
+
const [skills, setSkills] = useState43([]);
|
|
13978
|
+
const [loading, setLoading] = useState43(false);
|
|
13779
13979
|
const { get } = useApi();
|
|
13780
13980
|
const fetchedRef = useRef14(false);
|
|
13781
|
-
|
|
13981
|
+
useEffect30(() => {
|
|
13782
13982
|
if (fetchedRef.current) return;
|
|
13783
13983
|
fetchedRef.current = true;
|
|
13784
13984
|
const fetchSkills = async () => {
|
|
@@ -13885,11 +14085,11 @@ var SkillListField = ({ propertyKey, label, value, onChange, token }) => {
|
|
|
13885
14085
|
] }, propertyKey) });
|
|
13886
14086
|
};
|
|
13887
14087
|
var DatabaseListField = ({ propertyKey, label, value, onChange, token }) => {
|
|
13888
|
-
const [databases, setDatabases] =
|
|
13889
|
-
const [loading, setLoading] =
|
|
14088
|
+
const [databases, setDatabases] = useState43([]);
|
|
14089
|
+
const [loading, setLoading] = useState43(false);
|
|
13890
14090
|
const { get } = useApi();
|
|
13891
14091
|
const fetchedRef = useRef14(false);
|
|
13892
|
-
|
|
14092
|
+
useEffect30(() => {
|
|
13893
14093
|
if (fetchedRef.current) return;
|
|
13894
14094
|
fetchedRef.current = true;
|
|
13895
14095
|
const fetchDatabases = async () => {
|
|
@@ -14000,11 +14200,11 @@ var DatabaseListField = ({ propertyKey, label, value, onChange, token }) => {
|
|
|
14000
14200
|
] }, propertyKey) });
|
|
14001
14201
|
};
|
|
14002
14202
|
var MetricsListField = ({ propertyKey, label, value, onChange, token }) => {
|
|
14003
|
-
const [servers, setServers] =
|
|
14004
|
-
const [loading, setLoading] =
|
|
14203
|
+
const [servers, setServers] = useState43([]);
|
|
14204
|
+
const [loading, setLoading] = useState43(false);
|
|
14005
14205
|
const { get } = useApi();
|
|
14006
14206
|
const fetchedRef = useRef14(false);
|
|
14007
|
-
|
|
14207
|
+
useEffect30(() => {
|
|
14008
14208
|
if (fetchedRef.current) return;
|
|
14009
14209
|
fetchedRef.current = true;
|
|
14010
14210
|
const fetchMetricsServers = async () => {
|
|
@@ -14116,7 +14316,7 @@ var MetricsListField = ({ propertyKey, label, value, onChange, token }) => {
|
|
|
14116
14316
|
};
|
|
14117
14317
|
var TopologyEdgeField = ({ propertyKey, label, value, onChange, token }) => {
|
|
14118
14318
|
const edges = Array.isArray(value) ? value : [];
|
|
14119
|
-
const [newEdge, setNewEdge] =
|
|
14319
|
+
const [newEdge, setNewEdge] = useState43({ from: "", to: "", purpose: "" });
|
|
14120
14320
|
const handleAdd = () => {
|
|
14121
14321
|
if (!newEdge.from.trim() || !newEdge.to.trim() || !newEdge.purpose.trim()) return;
|
|
14122
14322
|
onChange([...edges, { ...newEdge }]);
|
|
@@ -14209,7 +14409,7 @@ var TopologyEdgeField = ({ propertyKey, label, value, onChange, token }) => {
|
|
|
14209
14409
|
] }, propertyKey) });
|
|
14210
14410
|
};
|
|
14211
14411
|
var MiddlewareSectionCard = ({ middleware, middlewareType, onToggle, onConfigChange, token }) => {
|
|
14212
|
-
const [expanded, setExpanded] =
|
|
14412
|
+
const [expanded, setExpanded] = useState43(middleware.enabled);
|
|
14213
14413
|
const getIcon = () => {
|
|
14214
14414
|
switch (middleware.type) {
|
|
14215
14415
|
case "browser":
|
|
@@ -14375,17 +14575,17 @@ var AgentConfigPanel = ({
|
|
|
14375
14575
|
const { token } = theme6.useToken();
|
|
14376
14576
|
const { config } = useLatticeChatShellContext();
|
|
14377
14577
|
const { get } = useApi();
|
|
14378
|
-
const [toolsLoading, setToolsLoading] =
|
|
14379
|
-
const [saving, setSaving] =
|
|
14380
|
-
const [deleting, setDeleting] =
|
|
14381
|
-
const [isDeleteModalOpen, setIsDeleteModalOpen] =
|
|
14382
|
-
const [tools, setTools] =
|
|
14383
|
-
const [selectedTools, setSelectedTools] =
|
|
14384
|
-
const [selectedSubAgents, setSelectedSubAgents] =
|
|
14385
|
-
const [agentPrompt, setAgentPrompt] =
|
|
14386
|
-
const [isPromptModalOpen, setIsPromptModalOpen] =
|
|
14387
|
-
const [agentType, setAgentType] =
|
|
14388
|
-
const [middleware, setMiddleware] =
|
|
14578
|
+
const [toolsLoading, setToolsLoading] = useState43(false);
|
|
14579
|
+
const [saving, setSaving] = useState43(false);
|
|
14580
|
+
const [deleting, setDeleting] = useState43(false);
|
|
14581
|
+
const [isDeleteModalOpen, setIsDeleteModalOpen] = useState43(false);
|
|
14582
|
+
const [tools, setTools] = useState43([]);
|
|
14583
|
+
const [selectedTools, setSelectedTools] = useState43([]);
|
|
14584
|
+
const [selectedSubAgents, setSelectedSubAgents] = useState43([]);
|
|
14585
|
+
const [agentPrompt, setAgentPrompt] = useState43("");
|
|
14586
|
+
const [isPromptModalOpen, setIsPromptModalOpen] = useState43(false);
|
|
14587
|
+
const [agentType, setAgentType] = useState43("react");
|
|
14588
|
+
const [middleware, setMiddleware] = useState43([]);
|
|
14389
14589
|
const parsedConfig = useMemo12(() => {
|
|
14390
14590
|
if (!assistant?.graphDefinition) {
|
|
14391
14591
|
return null;
|
|
@@ -14450,7 +14650,7 @@ var AgentConfigPanel = ({
|
|
|
14450
14650
|
setToolsLoading(false);
|
|
14451
14651
|
}
|
|
14452
14652
|
}, [get, visible]);
|
|
14453
|
-
|
|
14653
|
+
useEffect30(() => {
|
|
14454
14654
|
if (visible && assistant) {
|
|
14455
14655
|
fetchTools();
|
|
14456
14656
|
if (parsedConfig) {
|
|
@@ -15106,7 +15306,7 @@ var AgentConfigPanel = ({
|
|
|
15106
15306
|
var AgentConfigPanel_default = AgentConfigPanel;
|
|
15107
15307
|
|
|
15108
15308
|
// src/components/Chat/CreateAssistantModal.tsx
|
|
15109
|
-
import { useState as
|
|
15309
|
+
import { useState as useState45, useCallback as useCallback26 } from "react";
|
|
15110
15310
|
import {
|
|
15111
15311
|
Modal as Modal7,
|
|
15112
15312
|
Form as Form5,
|
|
@@ -15122,7 +15322,7 @@ import {
|
|
|
15122
15322
|
import { PlusOutlined as PlusOutlined3, ForkOutlined as ForkOutlined2 } from "@ant-design/icons";
|
|
15123
15323
|
|
|
15124
15324
|
// src/components/Chat/ParentAgentSelector.tsx
|
|
15125
|
-
import { useEffect as
|
|
15325
|
+
import { useEffect as useEffect31, useState as useState44 } from "react";
|
|
15126
15326
|
import { Select as Select5, Typography as Typography22 } from "antd";
|
|
15127
15327
|
import { jsx as jsx64, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
15128
15328
|
var { Text: Text19 } = Typography22;
|
|
@@ -15131,10 +15331,10 @@ var ParentAgentSelector = ({
|
|
|
15131
15331
|
value,
|
|
15132
15332
|
placeholder = "Select a parent agent to extend..."
|
|
15133
15333
|
}) => {
|
|
15134
|
-
const [assistants, setAssistants] =
|
|
15135
|
-
const [loading, setLoading] =
|
|
15334
|
+
const [assistants, setAssistants] = useState44([]);
|
|
15335
|
+
const [loading, setLoading] = useState44(false);
|
|
15136
15336
|
const { get } = useApi();
|
|
15137
|
-
|
|
15337
|
+
useEffect31(() => {
|
|
15138
15338
|
const fetchAssistants = async () => {
|
|
15139
15339
|
setLoading(true);
|
|
15140
15340
|
try {
|
|
@@ -15274,10 +15474,10 @@ var CreateAssistantModal = ({
|
|
|
15274
15474
|
onSuccess
|
|
15275
15475
|
}) => {
|
|
15276
15476
|
const [form] = Form5.useForm();
|
|
15277
|
-
const [loading, setLoading] =
|
|
15278
|
-
const [creationMode, setCreationMode] =
|
|
15279
|
-
const [parentAssistant, setParentAssistant] =
|
|
15280
|
-
const [subAgentDecisions, setSubAgentDecisions] =
|
|
15477
|
+
const [loading, setLoading] = useState45(false);
|
|
15478
|
+
const [creationMode, setCreationMode] = useState45("scratch");
|
|
15479
|
+
const [parentAssistant, setParentAssistant] = useState45(null);
|
|
15480
|
+
const [subAgentDecisions, setSubAgentDecisions] = useState45([]);
|
|
15281
15481
|
const { get, post } = useApi();
|
|
15282
15482
|
const { token } = theme8.useToken();
|
|
15283
15483
|
const resetExtendState = useCallback26(() => {
|
|
@@ -15666,11 +15866,11 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
15666
15866
|
const { setCenter, fitView } = useReactFlow();
|
|
15667
15867
|
const [nodes, setNodes, onNodesChange] = useNodesState([]);
|
|
15668
15868
|
const [edges, setEdges, onEdgesChange] = useEdgesState([]);
|
|
15669
|
-
const [assistants, setAssistants] =
|
|
15670
|
-
const [assistantsLoading, setAssistantsLoading] =
|
|
15671
|
-
const [configPanelVisible, setConfigPanelVisible] =
|
|
15672
|
-
const [selectedAssistant, setSelectedAssistant] =
|
|
15673
|
-
const [isCreateModalOpen, setIsCreateModalOpen] =
|
|
15869
|
+
const [assistants, setAssistants] = useState46([]);
|
|
15870
|
+
const [assistantsLoading, setAssistantsLoading] = useState46(false);
|
|
15871
|
+
const [configPanelVisible, setConfigPanelVisible] = useState46(false);
|
|
15872
|
+
const [selectedAssistant, setSelectedAssistant] = useState46(null);
|
|
15873
|
+
const [isCreateModalOpen, setIsCreateModalOpen] = useState46(false);
|
|
15674
15874
|
const { get, del, put } = useApi();
|
|
15675
15875
|
const { config } = useLatticeChatShellContext();
|
|
15676
15876
|
const { token } = theme9.useToken();
|
|
@@ -15718,10 +15918,10 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
15718
15918
|
setAssistantsLoading(false);
|
|
15719
15919
|
}
|
|
15720
15920
|
};
|
|
15721
|
-
|
|
15921
|
+
useEffect32(() => {
|
|
15722
15922
|
fetchAssistants();
|
|
15723
15923
|
}, []);
|
|
15724
|
-
|
|
15924
|
+
useEffect32(() => {
|
|
15725
15925
|
if (!assistants || assistants.length === 0) {
|
|
15726
15926
|
setNodes([]);
|
|
15727
15927
|
setEdges([]);
|
|
@@ -15985,7 +16185,7 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
15985
16185
|
});
|
|
15986
16186
|
lastCreatedAssistantRef.current = createdAssistant;
|
|
15987
16187
|
};
|
|
15988
|
-
|
|
16188
|
+
useEffect32(() => {
|
|
15989
16189
|
if (selectedAssistant) {
|
|
15990
16190
|
const node = nodes.find((n) => n.id === selectedAssistant.id);
|
|
15991
16191
|
if (node) {
|
|
@@ -15993,7 +16193,7 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
15993
16193
|
}
|
|
15994
16194
|
}
|
|
15995
16195
|
}, [selectedAssistant, nodes, setCenter]);
|
|
15996
|
-
|
|
16196
|
+
useEffect32(() => {
|
|
15997
16197
|
if (assistants.length > 0 && selectedAssistant) {
|
|
15998
16198
|
const assistant = assistants.find((a) => a.id === selectedAssistant.id);
|
|
15999
16199
|
if (assistant && !configPanelVisible) {
|
|
@@ -16002,7 +16202,7 @@ var AssistantFlowInner = ({ onChat }) => {
|
|
|
16002
16202
|
}
|
|
16003
16203
|
}, [assistants, selectedAssistant, configPanelVisible]);
|
|
16004
16204
|
const lastCreatedAssistantRef = useRef15(null);
|
|
16005
|
-
|
|
16205
|
+
useEffect32(() => {
|
|
16006
16206
|
if (lastCreatedAssistantRef.current && !assistants.find((a) => a.id === lastCreatedAssistantRef.current?.id)) {
|
|
16007
16207
|
lastCreatedAssistantRef.current = null;
|
|
16008
16208
|
}
|
|
@@ -16117,7 +16317,7 @@ var AssistantFlow = (props) => /* @__PURE__ */ jsx67(ReactFlowProvider, { childr
|
|
|
16117
16317
|
var AssistantFlow_default = AssistantFlow;
|
|
16118
16318
|
|
|
16119
16319
|
// src/components/Chat/SkillFlow.tsx
|
|
16120
|
-
import { useMemo as useMemo15, useEffect as
|
|
16320
|
+
import { useMemo as useMemo15, useEffect as useEffect34, useState as useState49 } from "react";
|
|
16121
16321
|
import {
|
|
16122
16322
|
ReactFlow as ReactFlow2,
|
|
16123
16323
|
Background as Background2,
|
|
@@ -16131,7 +16331,7 @@ import { Button as Button33, theme as theme12 } from "antd";
|
|
|
16131
16331
|
import { PlusOutlined as PlusOutlined7 } from "@ant-design/icons";
|
|
16132
16332
|
|
|
16133
16333
|
// src/components/Chat/SkillNode.tsx
|
|
16134
|
-
import { useEffect as
|
|
16334
|
+
import { useEffect as useEffect33, useMemo as useMemo14, useState as useState47 } from "react";
|
|
16135
16335
|
import { Handle as Handle2, Position as Position2 } from "@xyflow/react";
|
|
16136
16336
|
import {
|
|
16137
16337
|
Avatar as Avatar5,
|
|
@@ -16196,7 +16396,7 @@ var SkillNode = ({ data }) => {
|
|
|
16196
16396
|
if (!skill) {
|
|
16197
16397
|
return null;
|
|
16198
16398
|
}
|
|
16199
|
-
const [currentSkill, setCurrentSkill] =
|
|
16399
|
+
const [currentSkill, setCurrentSkill] = useState47(skill);
|
|
16200
16400
|
const badgeColor = getBadgeColor2(currentSkill.name);
|
|
16201
16401
|
const initials = currentSkill.name?.split("-").map((n) => n.charAt(0)).join("").toUpperCase().slice(0, 2) || "SK";
|
|
16202
16402
|
const hasSubSkills = currentSkill.subSkills && currentSkill.subSkills.length > 0;
|
|
@@ -16218,20 +16418,20 @@ var SkillNode = ({ data }) => {
|
|
|
16218
16418
|
const handleCopy = (text) => {
|
|
16219
16419
|
navigator.clipboard.writeText(text);
|
|
16220
16420
|
};
|
|
16221
|
-
const [isEditing, setIsEditing] =
|
|
16222
|
-
const [draftSkill, setDraftSkill] =
|
|
16421
|
+
const [isEditing, setIsEditing] = useState47(false);
|
|
16422
|
+
const [draftSkill, setDraftSkill] = useState47({
|
|
16223
16423
|
...skill,
|
|
16224
16424
|
id: skill.name
|
|
16225
16425
|
});
|
|
16226
|
-
const [metadataRows, setMetadataRows] =
|
|
16426
|
+
const [metadataRows, setMetadataRows] = useState47(
|
|
16227
16427
|
metadataEntries.map(([key, value]) => ({
|
|
16228
16428
|
key,
|
|
16229
16429
|
value
|
|
16230
16430
|
}))
|
|
16231
16431
|
);
|
|
16232
|
-
const [isModalOpen, setIsModalOpen] =
|
|
16233
|
-
const [saving, setSaving] =
|
|
16234
|
-
|
|
16432
|
+
const [isModalOpen, setIsModalOpen] = useState47(false);
|
|
16433
|
+
const [saving, setSaving] = useState47(false);
|
|
16434
|
+
useEffect33(() => {
|
|
16235
16435
|
setIsEditing(false);
|
|
16236
16436
|
setCurrentSkill(skill);
|
|
16237
16437
|
setDraftSkill({ ...skill, id: skill.name });
|
|
@@ -17334,7 +17534,7 @@ var SkillNode = ({ data }) => {
|
|
|
17334
17534
|
var SkillNode_default = SkillNode;
|
|
17335
17535
|
|
|
17336
17536
|
// src/components/Chat/CreateSkillModal.tsx
|
|
17337
|
-
import { useState as
|
|
17537
|
+
import { useState as useState48 } from "react";
|
|
17338
17538
|
import {
|
|
17339
17539
|
Modal as Modal9,
|
|
17340
17540
|
Form as Form6,
|
|
@@ -17356,11 +17556,11 @@ var CreateSkillModal = ({
|
|
|
17356
17556
|
onSuccess
|
|
17357
17557
|
}) => {
|
|
17358
17558
|
const [form] = Form6.useForm();
|
|
17359
|
-
const [loading, setLoading] =
|
|
17559
|
+
const [loading, setLoading] = useState48(false);
|
|
17360
17560
|
const { post } = useApi();
|
|
17361
17561
|
const { token } = theme11.useToken();
|
|
17362
17562
|
const defaultMetadataRows = [{ key: "category", value: "global" }];
|
|
17363
|
-
const [metadataRows, setMetadataRows] =
|
|
17563
|
+
const [metadataRows, setMetadataRows] = useState48(defaultMetadataRows);
|
|
17364
17564
|
const handleSubmit = async () => {
|
|
17365
17565
|
try {
|
|
17366
17566
|
const values = await form.validateFields();
|
|
@@ -17630,9 +17830,9 @@ import { jsx as jsx70, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
|
17630
17830
|
var SkillFlowInner = ({ onNodeClick }) => {
|
|
17631
17831
|
const [nodes, setNodes, onNodesChange] = useNodesState2([]);
|
|
17632
17832
|
const [edges, setEdges, onEdgesChange] = useEdgesState2([]);
|
|
17633
|
-
const [isCreateModalOpen, setIsCreateModalOpen] =
|
|
17634
|
-
const [skills, setSkills] =
|
|
17635
|
-
const [skillsLoading, setSkillsLoading] =
|
|
17833
|
+
const [isCreateModalOpen, setIsCreateModalOpen] = useState49(false);
|
|
17834
|
+
const [skills, setSkills] = useState49([]);
|
|
17835
|
+
const [skillsLoading, setSkillsLoading] = useState49(false);
|
|
17636
17836
|
const { token } = theme12.useToken();
|
|
17637
17837
|
const { get } = useApi();
|
|
17638
17838
|
const nodeTypes2 = useMemo15(
|
|
@@ -17655,10 +17855,10 @@ var SkillFlowInner = ({ onNodeClick }) => {
|
|
|
17655
17855
|
setSkillsLoading(false);
|
|
17656
17856
|
}
|
|
17657
17857
|
};
|
|
17658
|
-
|
|
17858
|
+
useEffect34(() => {
|
|
17659
17859
|
fetchSkills();
|
|
17660
17860
|
}, []);
|
|
17661
|
-
|
|
17861
|
+
useEffect34(() => {
|
|
17662
17862
|
if (!skills || skills.length === 0) {
|
|
17663
17863
|
setNodes([]);
|
|
17664
17864
|
setEdges([]);
|
|
@@ -17867,7 +18067,7 @@ var SkillFlow_default = SkillFlow;
|
|
|
17867
18067
|
// src/components/Chat/ToolsList.tsx
|
|
17868
18068
|
import { List as List6, Avatar as Avatar6, theme as theme13, Alert as Alert7, Button as Button34, Tag as Tag13 } from "antd";
|
|
17869
18069
|
import { ReloadOutlined } from "@ant-design/icons";
|
|
17870
|
-
import { useEffect as
|
|
18070
|
+
import { useEffect as useEffect35, useState as useState50, useCallback as useCallback28 } from "react";
|
|
17871
18071
|
import { jsx as jsx71, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
17872
18072
|
var ToolsList = ({
|
|
17873
18073
|
onToolSelect,
|
|
@@ -17875,12 +18075,12 @@ var ToolsList = ({
|
|
|
17875
18075
|
}) => {
|
|
17876
18076
|
const { token } = theme13.useToken();
|
|
17877
18077
|
const { get } = useApi();
|
|
17878
|
-
const [state, setState] =
|
|
18078
|
+
const [state, setState] = useState50({
|
|
17879
18079
|
tools: [],
|
|
17880
18080
|
isLoading: false,
|
|
17881
18081
|
error: null
|
|
17882
18082
|
});
|
|
17883
|
-
const [selectedToolId, setSelectedToolId] =
|
|
18083
|
+
const [selectedToolId, setSelectedToolId] = useState50(null);
|
|
17884
18084
|
const fetchTools = useCallback28(async () => {
|
|
17885
18085
|
setState((prev) => ({ ...prev, isLoading: true, error: null }));
|
|
17886
18086
|
try {
|
|
@@ -17913,7 +18113,7 @@ var ToolsList = ({
|
|
|
17913
18113
|
const handleRefresh = useCallback28(() => {
|
|
17914
18114
|
fetchTools();
|
|
17915
18115
|
}, [fetchTools]);
|
|
17916
|
-
|
|
18116
|
+
useEffect35(() => {
|
|
17917
18117
|
if (autoLoad) {
|
|
17918
18118
|
fetchTools();
|
|
17919
18119
|
}
|
|
@@ -18103,7 +18303,7 @@ var ToolsList = ({
|
|
|
18103
18303
|
};
|
|
18104
18304
|
|
|
18105
18305
|
// src/components/Chat/TopologyAutomationView.tsx
|
|
18106
|
-
import { useEffect as
|
|
18306
|
+
import { useEffect as useEffect37, useState as useState51, useCallback as useCallback29, useMemo as useMemo17 } from "react";
|
|
18107
18307
|
import {
|
|
18108
18308
|
ReactFlow as ReactFlow3,
|
|
18109
18309
|
Background as Background3,
|
|
@@ -18355,7 +18555,7 @@ var CopilotPanel = ({
|
|
|
18355
18555
|
};
|
|
18356
18556
|
|
|
18357
18557
|
// src/components/Chat/CreateWorkflowModal.tsx
|
|
18358
|
-
import { useEffect as
|
|
18558
|
+
import { useEffect as useEffect36 } from "react";
|
|
18359
18559
|
import { Modal as Modal10, Form as Form7, Input as Input13 } from "antd";
|
|
18360
18560
|
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
18361
18561
|
function extractName(purpose) {
|
|
@@ -18380,7 +18580,7 @@ var CreateWorkflowModal = ({
|
|
|
18380
18580
|
}) => {
|
|
18381
18581
|
const { post } = useApi();
|
|
18382
18582
|
const [form] = Form7.useForm();
|
|
18383
|
-
|
|
18583
|
+
useEffect36(() => {
|
|
18384
18584
|
if (open) {
|
|
18385
18585
|
form.resetFields();
|
|
18386
18586
|
}
|
|
@@ -18570,9 +18770,9 @@ function TopologyFlowInner({
|
|
|
18570
18770
|
}) {
|
|
18571
18771
|
const [nodes, setNodes, onNodesChange] = useNodesState3(initialNodes);
|
|
18572
18772
|
const [edges, setEdges, onEdgesChange] = useEdgesState3(initialEdges);
|
|
18573
|
-
const [specModalOpen, setSpecModalOpen] =
|
|
18773
|
+
const [specModalOpen, setSpecModalOpen] = useState51(false);
|
|
18574
18774
|
const nodeTypes2 = useMemo17(() => ({ topologyNode: TopologyNode_default }), []);
|
|
18575
|
-
|
|
18775
|
+
useEffect37(() => {
|
|
18576
18776
|
setNodes(initialNodes);
|
|
18577
18777
|
setEdges(initialEdges);
|
|
18578
18778
|
}, [initialNodes, initialEdges, setNodes, setEdges]);
|
|
@@ -18780,14 +18980,14 @@ function TopologyFlowInner({
|
|
|
18780
18980
|
}
|
|
18781
18981
|
var TopologyAutomationView = () => {
|
|
18782
18982
|
const { get, del } = useApi();
|
|
18783
|
-
const [agents, setAgents] =
|
|
18784
|
-
const [agentNameMap, setAgentNameMap] =
|
|
18785
|
-
const [selectedWorkflowId, setSelectedWorkflowId] =
|
|
18786
|
-
const [copilotOpen, setCopilotOpen] =
|
|
18787
|
-
const [initialLoading, setInitialLoading] =
|
|
18788
|
-
const [error, setError] =
|
|
18789
|
-
const [isCreateModalOpen, setIsCreateModalOpen] =
|
|
18790
|
-
const [initialMessage, setInitialMessage] =
|
|
18983
|
+
const [agents, setAgents] = useState51([]);
|
|
18984
|
+
const [agentNameMap, setAgentNameMap] = useState51(/* @__PURE__ */ new Map());
|
|
18985
|
+
const [selectedWorkflowId, setSelectedWorkflowId] = useState51(null);
|
|
18986
|
+
const [copilotOpen, setCopilotOpen] = useState51(true);
|
|
18987
|
+
const [initialLoading, setInitialLoading] = useState51(true);
|
|
18988
|
+
const [error, setError] = useState51(null);
|
|
18989
|
+
const [isCreateModalOpen, setIsCreateModalOpen] = useState51(false);
|
|
18990
|
+
const [initialMessage, setInitialMessage] = useState51(null);
|
|
18791
18991
|
const workflowTools = useMemo17(
|
|
18792
18992
|
() => [
|
|
18793
18993
|
"create_agent",
|
|
@@ -18822,7 +19022,7 @@ var TopologyAutomationView = () => {
|
|
|
18822
19022
|
}
|
|
18823
19023
|
setError(null);
|
|
18824
19024
|
}, [get]);
|
|
18825
|
-
|
|
19025
|
+
useEffect37(() => {
|
|
18826
19026
|
let cancelled = false;
|
|
18827
19027
|
const load = async () => {
|
|
18828
19028
|
try {
|
|
@@ -18991,7 +19191,7 @@ var TopologyAutomationView = () => {
|
|
|
18991
19191
|
};
|
|
18992
19192
|
|
|
18993
19193
|
// src/components/Chat/TopologyRuntimeView.tsx
|
|
18994
|
-
import { useEffect as
|
|
19194
|
+
import { useEffect as useEffect38, useState as useState52, useMemo as useMemo18, useCallback as useCallback30, useRef as useRef16 } from "react";
|
|
18995
19195
|
import {
|
|
18996
19196
|
Spin as Spin9,
|
|
18997
19197
|
Empty as Empty6,
|
|
@@ -19305,16 +19505,16 @@ function FlowCanvas({ steps }) {
|
|
|
19305
19505
|
const initialEdges = useEdgesFromSteps(steps);
|
|
19306
19506
|
const [nodes, setNodes, onNodesChange] = useNodesState4(initialNodes);
|
|
19307
19507
|
const [edges, setEdges, onEdgesChange] = useEdgesState4(initialEdges);
|
|
19308
|
-
const [selectedNodeId, setSelectedNodeId] =
|
|
19508
|
+
const [selectedNodeId, setSelectedNodeId] = useState52(null);
|
|
19309
19509
|
const selectedStep = useMemo18(
|
|
19310
19510
|
() => steps.find((s) => s.id === selectedNodeId) || null,
|
|
19311
19511
|
[steps, selectedNodeId]
|
|
19312
19512
|
);
|
|
19313
|
-
|
|
19513
|
+
useEffect38(() => {
|
|
19314
19514
|
setNodes(initialNodes);
|
|
19315
19515
|
setEdges(initialEdges);
|
|
19316
19516
|
}, [initialNodes, initialEdges, setNodes, setEdges]);
|
|
19317
|
-
|
|
19517
|
+
useEffect38(() => {
|
|
19318
19518
|
if (selectedNodeId) {
|
|
19319
19519
|
setNodes(
|
|
19320
19520
|
(nds) => nds.map((n) => ({
|
|
@@ -19509,8 +19709,8 @@ function RunSummaryBanner({ run, agentName }) {
|
|
|
19509
19709
|
}
|
|
19510
19710
|
var RunDetail = ({ run, agentName, open, onClose, onRunUpdate, autoRefresh, onAutoRefreshChange }) => {
|
|
19511
19711
|
const { get } = useApi();
|
|
19512
|
-
const [steps, setSteps] =
|
|
19513
|
-
const [loading, setLoading] =
|
|
19712
|
+
const [steps, setSteps] = useState52([]);
|
|
19713
|
+
const [loading, setLoading] = useState52(false);
|
|
19514
19714
|
const stepsPollTimeoutRef = useRef16(null);
|
|
19515
19715
|
const stepsPollSessionRef = useRef16(0);
|
|
19516
19716
|
const fetchSteps = useCallback30(async () => {
|
|
@@ -19531,12 +19731,12 @@ var RunDetail = ({ run, agentName, open, onClose, onRunUpdate, autoRefresh, onAu
|
|
|
19531
19731
|
} catch {
|
|
19532
19732
|
}
|
|
19533
19733
|
}, [get, run.id, onRunUpdate]);
|
|
19534
|
-
|
|
19734
|
+
useEffect38(() => {
|
|
19535
19735
|
if (!open) return;
|
|
19536
19736
|
setLoading(true);
|
|
19537
19737
|
fetchSteps().finally(() => setLoading(false));
|
|
19538
19738
|
}, [open, run.id, fetchSteps]);
|
|
19539
|
-
|
|
19739
|
+
useEffect38(() => {
|
|
19540
19740
|
if (stepsPollTimeoutRef.current) {
|
|
19541
19741
|
clearTimeout(stepsPollTimeoutRef.current);
|
|
19542
19742
|
stepsPollTimeoutRef.current = null;
|
|
@@ -19598,12 +19798,12 @@ var RunDetail = ({ run, agentName, open, onClose, onRunUpdate, autoRefresh, onAu
|
|
|
19598
19798
|
var POLLING_INTERVAL = 3e3;
|
|
19599
19799
|
var TopologyRuntimeView = () => {
|
|
19600
19800
|
const { get, del } = useApi();
|
|
19601
|
-
const [runs, setRuns] =
|
|
19602
|
-
const [agentNames, setAgentNames] =
|
|
19603
|
-
const [loading, setLoading] =
|
|
19604
|
-
const [error, setError] =
|
|
19605
|
-
const [selectedRun, setSelectedRun] =
|
|
19606
|
-
const [autoRefresh, setAutoRefresh] =
|
|
19801
|
+
const [runs, setRuns] = useState52([]);
|
|
19802
|
+
const [agentNames, setAgentNames] = useState52({});
|
|
19803
|
+
const [loading, setLoading] = useState52(true);
|
|
19804
|
+
const [error, setError] = useState52(null);
|
|
19805
|
+
const [selectedRun, setSelectedRun] = useState52(null);
|
|
19806
|
+
const [autoRefresh, setAutoRefresh] = useState52(true);
|
|
19607
19807
|
const pollingSessionRef = useRef16(0);
|
|
19608
19808
|
const handleRunUpdate = useCallback30((updated) => {
|
|
19609
19809
|
setRuns(
|
|
@@ -19650,7 +19850,7 @@ var TopologyRuntimeView = () => {
|
|
|
19650
19850
|
setLoading(false);
|
|
19651
19851
|
}
|
|
19652
19852
|
}, [get]);
|
|
19653
|
-
|
|
19853
|
+
useEffect38(() => {
|
|
19654
19854
|
let cancelled = false;
|
|
19655
19855
|
const init2 = async () => {
|
|
19656
19856
|
try {
|
|
@@ -19686,7 +19886,7 @@ var TopologyRuntimeView = () => {
|
|
|
19686
19886
|
cancelled = true;
|
|
19687
19887
|
};
|
|
19688
19888
|
}, [get]);
|
|
19689
|
-
|
|
19889
|
+
useEffect38(() => {
|
|
19690
19890
|
return () => {
|
|
19691
19891
|
pollingSessionRef.current = 0;
|
|
19692
19892
|
};
|
|
@@ -19794,15 +19994,15 @@ var TopologyRuntimeView = () => {
|
|
|
19794
19994
|
};
|
|
19795
19995
|
|
|
19796
19996
|
// src/components/Chat/TopologyInboxView.tsx
|
|
19797
|
-
import { useEffect as
|
|
19997
|
+
import { useEffect as useEffect39, useState as useState53 } from "react";
|
|
19798
19998
|
import { Card as Card18, Typography as Typography31, Spin as Spin10, Empty as Empty7, List as List8, Button as Button37, Space as Space24, Tag as Tag17 } from "antd";
|
|
19799
19999
|
import { InboxOutlined, ReloadOutlined as ReloadOutlined3 } from "@ant-design/icons";
|
|
19800
20000
|
import { jsx as jsx77, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
19801
20001
|
var { Text: Text28, Title: Title6 } = Typography31;
|
|
19802
20002
|
var TopologyInboxView = () => {
|
|
19803
20003
|
const { get } = useApi();
|
|
19804
|
-
const [items, setItems] =
|
|
19805
|
-
const [loading, setLoading] =
|
|
20004
|
+
const [items, setItems] = useState53([]);
|
|
20005
|
+
const [loading, setLoading] = useState53(true);
|
|
19806
20006
|
const fetchInbox = async () => {
|
|
19807
20007
|
setLoading(true);
|
|
19808
20008
|
try {
|
|
@@ -19829,7 +20029,7 @@ var TopologyInboxView = () => {
|
|
|
19829
20029
|
setLoading(false);
|
|
19830
20030
|
}
|
|
19831
20031
|
};
|
|
19832
|
-
|
|
20032
|
+
useEffect39(() => {
|
|
19833
20033
|
fetchInbox();
|
|
19834
20034
|
}, [get]);
|
|
19835
20035
|
return /* @__PURE__ */ jsxs51("div", { style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
|
|
@@ -19912,7 +20112,7 @@ var TopologyInboxView = () => {
|
|
|
19912
20112
|
};
|
|
19913
20113
|
|
|
19914
20114
|
// src/components/Eval/EvalPanel.tsx
|
|
19915
|
-
import React41, { useState as
|
|
20115
|
+
import React41, { useState as useState56, useMemo as useMemo19 } from "react";
|
|
19916
20116
|
import { createStyles as createStyles22 } from "antd-style";
|
|
19917
20117
|
import { Button as Button40, Card as Card22, Typography as Typography35, Row as Row3, Col as Col3, Tag as Tag20, theme as theme15, Dropdown as Dropdown2, Popconfirm as Popconfirm9, message as message14 } from "antd";
|
|
19918
20118
|
import { Play as Play2, FlaskConical as FlaskConical2, TestTube2 as TestTube26, TrendingUp, CheckCircle as CheckCircle2, XCircle as XCircle2, ArrowRight as ArrowRight2, ChevronDown as ChevronDown3, Trash2 as Trash27, Clock } from "lucide-react";
|
|
@@ -20029,7 +20229,7 @@ var EvalSuiteCardList = ({ projectId, onSelectSuite }) => {
|
|
|
20029
20229
|
};
|
|
20030
20230
|
|
|
20031
20231
|
// src/components/Eval/EvalSuiteDetail.tsx
|
|
20032
|
-
import { useState as
|
|
20232
|
+
import { useState as useState54 } from "react";
|
|
20033
20233
|
import { createStyles as createStyles20 } from "antd-style";
|
|
20034
20234
|
import { Button as Button38, Card as Card20, Typography as Typography33, Modal as Modal12, Form as Form8, Input as Input14, Select as Select6, Table as Table3, Popconfirm as Popconfirm7, Empty as Empty9 } from "antd";
|
|
20035
20235
|
import { Play, Plus as Plus6, Trash2 as Trash25, Bot, MessageSquare, FlaskConical } from "lucide-react";
|
|
@@ -20133,9 +20333,9 @@ var EvalSuiteDetail = ({ projectId, suiteId, onBack, onRun }) => {
|
|
|
20133
20333
|
const { suites } = useEvalSuites(projectId);
|
|
20134
20334
|
const { cases, create: createCase, remove: removeCase } = useEvalCases(projectId, suiteId);
|
|
20135
20335
|
const { start } = useEvalRuns(projectId);
|
|
20136
|
-
const [modalOpen, setModalOpen] =
|
|
20336
|
+
const [modalOpen, setModalOpen] = useState54(false);
|
|
20137
20337
|
const [form] = Form8.useForm();
|
|
20138
|
-
const [agents, setAgents] =
|
|
20338
|
+
const [agents, setAgents] = useState54([]);
|
|
20139
20339
|
const suite = suites.find((s) => s.id === suiteId) || {};
|
|
20140
20340
|
const loadAgents = async () => {
|
|
20141
20341
|
try {
|
|
@@ -20268,7 +20468,7 @@ var EvalSuiteDetail = ({ projectId, suiteId, onBack, onRun }) => {
|
|
|
20268
20468
|
};
|
|
20269
20469
|
|
|
20270
20470
|
// src/components/Eval/EvalRunResults.tsx
|
|
20271
|
-
import { useEffect as
|
|
20471
|
+
import { useEffect as useEffect40, useState as useState55 } from "react";
|
|
20272
20472
|
import { createStyles as createStyles21 } from "antd-style";
|
|
20273
20473
|
import { Button as Button39, Card as Card21, Typography as Typography34, Progress as Progress4, Tag as Tag19, Table as Table4, Empty as Empty10, Popconfirm as Popconfirm8, message as message13 } from "antd";
|
|
20274
20474
|
import { CheckCircle, XCircle, Trash2 as Trash26 } from "lucide-react";
|
|
@@ -20357,9 +20557,9 @@ var useStyle11 = createStyles21(({ token, css }) => ({
|
|
|
20357
20557
|
var EvalRunResults = ({ runId, onBack }) => {
|
|
20358
20558
|
const { styles } = useStyle11();
|
|
20359
20559
|
const client = useClient("__GLOBAL__");
|
|
20360
|
-
const [run, setRun] =
|
|
20560
|
+
const [run, setRun] = useState55(null);
|
|
20361
20561
|
const { status: streamingStatus, progress, connected } = useEvalRunStream(runId);
|
|
20362
|
-
|
|
20562
|
+
useEffect40(() => {
|
|
20363
20563
|
client.eval.runs.get(runId).then(setRun).catch(console.error);
|
|
20364
20564
|
}, [runId, client]);
|
|
20365
20565
|
if (!run) {
|
|
@@ -20710,10 +20910,10 @@ var EvalPanel = () => {
|
|
|
20710
20910
|
const { styles, cx } = useStyle12();
|
|
20711
20911
|
const { token } = theme15.useToken();
|
|
20712
20912
|
const { projects } = useEvalProjects();
|
|
20713
|
-
const [projectId, setProjectId] =
|
|
20714
|
-
const [page, setPage] =
|
|
20715
|
-
const [suiteId, setSuiteId] =
|
|
20716
|
-
const [runId, setRunId] =
|
|
20913
|
+
const [projectId, setProjectId] = useState56("");
|
|
20914
|
+
const [page, setPage] = useState56("dashboard");
|
|
20915
|
+
const [suiteId, setSuiteId] = useState56("");
|
|
20916
|
+
const [runId, setRunId] = useState56("");
|
|
20717
20917
|
React41.useEffect(() => {
|
|
20718
20918
|
if (!projectId && projects.length > 0) {
|
|
20719
20919
|
setProjectId(projects[0].id);
|
|
@@ -20901,8 +21101,8 @@ var EvalPanel = () => {
|
|
|
20901
21101
|
] });
|
|
20902
21102
|
}
|
|
20903
21103
|
const SuiteListPage = () => {
|
|
20904
|
-
const [showAdd, setShowAdd] =
|
|
20905
|
-
const [name, setName] =
|
|
21104
|
+
const [showAdd, setShowAdd] = useState56(false);
|
|
21105
|
+
const [name, setName] = useState56("");
|
|
20906
21106
|
const { create } = useEvalSuites(projectId);
|
|
20907
21107
|
const handleAdd = async () => {
|
|
20908
21108
|
if (!name.trim()) return;
|
|
@@ -21086,7 +21286,7 @@ var WorkspaceResourceManager = ({
|
|
|
21086
21286
|
const { openContentApp, menuCollapsed, setMenuCollapsed } = useChatUIContext();
|
|
21087
21287
|
const hasOpenedDefault = useRef17(false);
|
|
21088
21288
|
const hasRegistered = useRef17(false);
|
|
21089
|
-
|
|
21289
|
+
useEffect41(() => {
|
|
21090
21290
|
if (!hasRegistered.current) {
|
|
21091
21291
|
hasRegistered.current = true;
|
|
21092
21292
|
regsiterElement("workspace_projects", {
|
|
@@ -21145,8 +21345,8 @@ var WorkspaceResourceManager = ({
|
|
|
21145
21345
|
const { user, logout, tenants, currentTenant, selectTenant, isLoading } = useAuth();
|
|
21146
21346
|
const { setWorkspace, setProject } = useWorkspaceContext();
|
|
21147
21347
|
const { config } = useLatticeChatShellContext();
|
|
21148
|
-
const [tenantModalOpen, setTenantModalOpen] =
|
|
21149
|
-
const [changePasswordOpen, setChangePasswordOpen] =
|
|
21348
|
+
const [tenantModalOpen, setTenantModalOpen] = useState57(false);
|
|
21349
|
+
const [changePasswordOpen, setChangePasswordOpen] = useState57(false);
|
|
21150
21350
|
const menuItems = useMemo20(() => {
|
|
21151
21351
|
const items = config.workspaceMenuItems?.length ? [...config.workspaceMenuItems] : [...DEFAULT_WORKSPACE_MENU_ITEMS];
|
|
21152
21352
|
return items.sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
|
|
@@ -21178,7 +21378,7 @@ var WorkspaceResourceManager = ({
|
|
|
21178
21378
|
});
|
|
21179
21379
|
}
|
|
21180
21380
|
};
|
|
21181
|
-
|
|
21381
|
+
useEffect41(() => {
|
|
21182
21382
|
if (!hasOpenedDefault.current && menuItems.length > 0) {
|
|
21183
21383
|
hasOpenedDefault.current = true;
|
|
21184
21384
|
const firstRoute = menuItems.find((item) => item.type === "route");
|
|
@@ -21394,8 +21594,8 @@ var WorkspaceContextProvider = ({
|
|
|
21394
21594
|
}
|
|
21395
21595
|
return null;
|
|
21396
21596
|
};
|
|
21397
|
-
const [workspaceId, setWorkspaceId] =
|
|
21398
|
-
const [projectId, setProjectId] =
|
|
21597
|
+
const [workspaceId, setWorkspaceId] = useState58(getInitialWorkspaceId);
|
|
21598
|
+
const [projectId, setProjectId] = useState58(getInitialProjectId);
|
|
21399
21599
|
React43.useEffect(() => {
|
|
21400
21600
|
const wsId = getInitialWorkspaceId();
|
|
21401
21601
|
const pjId = getInitialProjectId();
|
|
@@ -21403,13 +21603,13 @@ var WorkspaceContextProvider = ({
|
|
|
21403
21603
|
Client2.setWorkspaceContext(wsId || void 0, pjId || void 0);
|
|
21404
21604
|
}
|
|
21405
21605
|
}, []);
|
|
21406
|
-
|
|
21606
|
+
useEffect42(() => {
|
|
21407
21607
|
Client2.setWorkspaceContext(workspaceId || void 0, projectId || void 0);
|
|
21408
21608
|
}, [workspaceId, projectId]);
|
|
21409
|
-
const [workspaces, setWorkspaces] =
|
|
21410
|
-
const [projects, setProjects] =
|
|
21411
|
-
const [loading, setLoading] =
|
|
21412
|
-
const [error, setError] =
|
|
21609
|
+
const [workspaces, setWorkspaces] = useState58([]);
|
|
21610
|
+
const [projects, setProjects] = useState58([]);
|
|
21611
|
+
const [loading, setLoading] = useState58(false);
|
|
21612
|
+
const [error, setError] = useState58(null);
|
|
21413
21613
|
const client = React43.useMemo(() => {
|
|
21414
21614
|
const authApiKey = isAuthenticated ? sessionStorage.getItem("lattice_token") || config.apiKey || "" : config.apiKey || "";
|
|
21415
21615
|
return new WorkspaceClient({
|
|
@@ -21430,7 +21630,7 @@ var WorkspaceContextProvider = ({
|
|
|
21430
21630
|
setWorkspaces([]);
|
|
21431
21631
|
resetSelectedWorkspace();
|
|
21432
21632
|
}, [resetSelectedWorkspace, setWorkspaces]);
|
|
21433
|
-
|
|
21633
|
+
useEffect42(() => {
|
|
21434
21634
|
resetWS();
|
|
21435
21635
|
refreshWorkspaces();
|
|
21436
21636
|
}, [tenantId]);
|
|
@@ -21463,28 +21663,28 @@ var WorkspaceContextProvider = ({
|
|
|
21463
21663
|
setLoading(false);
|
|
21464
21664
|
}
|
|
21465
21665
|
}, [client, workspaceId]);
|
|
21466
|
-
|
|
21666
|
+
useEffect42(() => {
|
|
21467
21667
|
if (workspaceId && typeof window !== "undefined") {
|
|
21468
21668
|
sessionStorage.setItem("workspaceId", workspaceId);
|
|
21469
21669
|
}
|
|
21470
21670
|
}, [workspaceId]);
|
|
21471
|
-
|
|
21671
|
+
useEffect42(() => {
|
|
21472
21672
|
if (projectId && typeof window !== "undefined") {
|
|
21473
21673
|
sessionStorage.setItem("projectId", projectId);
|
|
21474
21674
|
}
|
|
21475
21675
|
}, [projectId]);
|
|
21476
|
-
|
|
21676
|
+
useEffect42(() => {
|
|
21477
21677
|
refreshWorkspaces().catch((err) => {
|
|
21478
21678
|
console.warn("Failed to load workspaces:", err);
|
|
21479
21679
|
});
|
|
21480
21680
|
}, [refreshWorkspaces]);
|
|
21481
|
-
|
|
21681
|
+
useEffect42(() => {
|
|
21482
21682
|
if (workspaces.length > 0 && !workspaceId) {
|
|
21483
21683
|
const firstWorkspace = workspaces[0];
|
|
21484
21684
|
setWorkspaceId(firstWorkspace.id);
|
|
21485
21685
|
}
|
|
21486
21686
|
}, [workspaces, workspaceId]);
|
|
21487
|
-
|
|
21687
|
+
useEffect42(() => {
|
|
21488
21688
|
if (workspaceId) {
|
|
21489
21689
|
refreshProjects(workspaceId);
|
|
21490
21690
|
} else {
|
|
@@ -21700,15 +21900,15 @@ var WorkspaceContextProvider = ({
|
|
|
21700
21900
|
};
|
|
21701
21901
|
|
|
21702
21902
|
// src/components/Chat/DatabasePicker.tsx
|
|
21703
|
-
import { useRef as useRef18, useState as
|
|
21903
|
+
import { useRef as useRef18, useState as useState59 } from "react";
|
|
21704
21904
|
import { Modal as Modal14, List as List9, Checkbox as Checkbox5, Spin as Spin12, Empty as Empty11, Typography as Typography36, Button as Button42, Space as Space25, Tooltip as Tooltip14 } from "antd";
|
|
21705
21905
|
import { Database as Database5 } from "lucide-react";
|
|
21706
21906
|
import { Fragment as Fragment14, jsx as jsx84, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
21707
21907
|
var DatabasePicker = ({ senderRef, iconOnly }) => {
|
|
21708
|
-
const [modalOpen, setModalOpen] =
|
|
21709
|
-
const [databases, setDatabases] =
|
|
21710
|
-
const [loading, setLoading] =
|
|
21711
|
-
const [selectedDatabases, setSelectedDatabases] =
|
|
21908
|
+
const [modalOpen, setModalOpen] = useState59(false);
|
|
21909
|
+
const [databases, setDatabases] = useState59([]);
|
|
21910
|
+
const [loading, setLoading] = useState59(false);
|
|
21911
|
+
const [selectedDatabases, setSelectedDatabases] = useState59([]);
|
|
21712
21912
|
const { get } = useApi();
|
|
21713
21913
|
const fetchedRef = useRef18(false);
|
|
21714
21914
|
const loadDatabases = async () => {
|
|
@@ -21850,15 +22050,15 @@ var DatabasePicker = ({ senderRef, iconOnly }) => {
|
|
|
21850
22050
|
};
|
|
21851
22051
|
|
|
21852
22052
|
// src/components/Chat/SkillPicker.tsx
|
|
21853
|
-
import { useRef as useRef19, useState as
|
|
22053
|
+
import { useRef as useRef19, useState as useState60 } from "react";
|
|
21854
22054
|
import { Modal as Modal15, List as List10, Checkbox as Checkbox6, Spin as Spin13, Empty as Empty12, Typography as Typography37, Button as Button43, Space as Space26, Tooltip as Tooltip15 } from "antd";
|
|
21855
22055
|
import { BrainCircuit } from "lucide-react";
|
|
21856
22056
|
import { Fragment as Fragment15, jsx as jsx85, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
21857
22057
|
var SkillPicker = ({ senderRef, iconOnly }) => {
|
|
21858
|
-
const [modalOpen, setModalOpen] =
|
|
21859
|
-
const [skills, setSkills] =
|
|
21860
|
-
const [loading, setLoading] =
|
|
21861
|
-
const [selectedSkills, setSelectedSkills] =
|
|
22058
|
+
const [modalOpen, setModalOpen] = useState60(false);
|
|
22059
|
+
const [skills, setSkills] = useState60([]);
|
|
22060
|
+
const [loading, setLoading] = useState60(false);
|
|
22061
|
+
const [selectedSkills, setSelectedSkills] = useState60([]);
|
|
21862
22062
|
const { get } = useApi();
|
|
21863
22063
|
const fetchedRef = useRef19(false);
|
|
21864
22064
|
const loadSkills = async () => {
|
|
@@ -22000,14 +22200,14 @@ var SkillPicker = ({ senderRef, iconOnly }) => {
|
|
|
22000
22200
|
};
|
|
22001
22201
|
|
|
22002
22202
|
// src/components/Chat/AgentPicker.tsx
|
|
22003
|
-
import { useRef as useRef20, useState as
|
|
22203
|
+
import { useRef as useRef20, useState as useState61 } from "react";
|
|
22004
22204
|
import { Modal as Modal16, List as List11, Empty as Empty13, Typography as Typography38, Button as Button44, Tooltip as Tooltip16 } from "antd";
|
|
22005
22205
|
import { Bot as Bot3 } from "lucide-react";
|
|
22006
22206
|
import { Fragment as Fragment16, jsx as jsx86, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
22007
22207
|
var AgentPicker = ({ senderRef, iconOnly }) => {
|
|
22008
|
-
const [modalOpen, setModalOpen] =
|
|
22009
|
-
const [loading, setLoading] =
|
|
22010
|
-
const [selectedAgent, setSelectedAgent] =
|
|
22208
|
+
const [modalOpen, setModalOpen] = useState61(false);
|
|
22209
|
+
const [loading, setLoading] = useState61(false);
|
|
22210
|
+
const [selectedAgent, setSelectedAgent] = useState61(null);
|
|
22011
22211
|
const { assistants, currentAssistant, selectAssistant } = useAssistantContext();
|
|
22012
22212
|
const fetchedRef = useRef20(false);
|
|
22013
22213
|
const handleOpenModal = () => {
|
|
@@ -22116,7 +22316,7 @@ var AgentPicker = ({ senderRef, iconOnly }) => {
|
|
|
22116
22316
|
};
|
|
22117
22317
|
|
|
22118
22318
|
// src/components/Chat/MetricsDataSourcePicker.tsx
|
|
22119
|
-
import { useEffect as
|
|
22319
|
+
import { useEffect as useEffect44, useState as useState62, useRef as useRef21 } from "react";
|
|
22120
22320
|
import { Modal as Modal17, List as List12, Spin as Spin15, Empty as Empty14, Typography as Typography39, Button as Button45, Tag as Tag21, Tooltip as Tooltip17 } from "antd";
|
|
22121
22321
|
import { Database as Database6, Check as Check4, Server as Server3 } from "lucide-react";
|
|
22122
22322
|
import { Fragment as Fragment17, jsx as jsx87, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
@@ -22125,9 +22325,9 @@ var MetricsDataSourcePicker = ({
|
|
|
22125
22325
|
senderRef,
|
|
22126
22326
|
iconOnly
|
|
22127
22327
|
}) => {
|
|
22128
|
-
const [modalOpen, setModalOpen] =
|
|
22129
|
-
const [loading, setLoading] =
|
|
22130
|
-
const [dataSources, setDataSources] =
|
|
22328
|
+
const [modalOpen, setModalOpen] = useState62(false);
|
|
22329
|
+
const [loading, setLoading] = useState62(false);
|
|
22330
|
+
const [dataSources, setDataSources] = useState62([]);
|
|
22131
22331
|
const { config } = useLatticeChatShellContext();
|
|
22132
22332
|
const { customRunConfig, updateCustomRunConfig } = useConversationContext();
|
|
22133
22333
|
const { get } = useApi();
|
|
@@ -22205,7 +22405,7 @@ var MetricsDataSourcePicker = ({
|
|
|
22205
22405
|
console.error("Failed to save datasource to sessionStorage:", error);
|
|
22206
22406
|
}
|
|
22207
22407
|
};
|
|
22208
|
-
|
|
22408
|
+
useEffect44(() => {
|
|
22209
22409
|
if (hasInitializedRef.current) return;
|
|
22210
22410
|
hasInitializedRef.current = true;
|
|
22211
22411
|
loadDataSources().then(() => {
|
|
@@ -22456,7 +22656,7 @@ var MetricsDataSourcePicker = ({
|
|
|
22456
22656
|
};
|
|
22457
22657
|
|
|
22458
22658
|
// src/components/Chat/ModelSelector.tsx
|
|
22459
|
-
import { useState as
|
|
22659
|
+
import { useState as useState63, useEffect as useEffect45, useCallback as useCallback32, useRef as useRef22 } from "react";
|
|
22460
22660
|
import { Select as Select7 } from "antd";
|
|
22461
22661
|
import { jsx as jsx88 } from "react/jsx-runtime";
|
|
22462
22662
|
var ModelSelector = ({
|
|
@@ -22465,11 +22665,11 @@ var ModelSelector = ({
|
|
|
22465
22665
|
defaultModelKey = "default",
|
|
22466
22666
|
style
|
|
22467
22667
|
}) => {
|
|
22468
|
-
const [models, setModels] =
|
|
22469
|
-
const [isLoading, setIsLoading] =
|
|
22470
|
-
const [internalValue, setInternalValue] =
|
|
22471
|
-
const [dropdownOpen, setDropdownOpen] =
|
|
22472
|
-
const [isHovered, setIsHovered] =
|
|
22668
|
+
const [models, setModels] = useState63([]);
|
|
22669
|
+
const [isLoading, setIsLoading] = useState63(false);
|
|
22670
|
+
const [internalValue, setInternalValue] = useState63(null);
|
|
22671
|
+
const [dropdownOpen, setDropdownOpen] = useState63(false);
|
|
22672
|
+
const [isHovered, setIsHovered] = useState63(false);
|
|
22473
22673
|
const hasFetchedRef = useRef22(false);
|
|
22474
22674
|
const hasSetDefaultRef = useRef22(false);
|
|
22475
22675
|
const { get } = useApi();
|
|
@@ -22501,7 +22701,7 @@ var ModelSelector = ({
|
|
|
22501
22701
|
setIsLoading(false);
|
|
22502
22702
|
}
|
|
22503
22703
|
}, [get, defaultModelKey]);
|
|
22504
|
-
|
|
22704
|
+
useEffect45(() => {
|
|
22505
22705
|
fetchModels();
|
|
22506
22706
|
}, [fetchModels]);
|
|
22507
22707
|
const handleChange = (modelKey) => {
|
|
@@ -22564,7 +22764,7 @@ import {
|
|
|
22564
22764
|
} from "@ant-design/icons";
|
|
22565
22765
|
import { Prompts } from "@ant-design/x";
|
|
22566
22766
|
import { Space as Space28, Typography as Typography40, Spin as Spin16 } from "antd";
|
|
22567
|
-
import { useEffect as
|
|
22767
|
+
import { useEffect as useEffect46, useState as useState64, useMemo as useMemo21 } from "react";
|
|
22568
22768
|
import { BrainCircuit as BrainCircuit2 } from "lucide-react";
|
|
22569
22769
|
import { jsx as jsx89, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
22570
22770
|
var categoryConfig = {
|
|
@@ -22649,12 +22849,12 @@ var SkillCategoryPrompts = ({
|
|
|
22649
22849
|
senderRef,
|
|
22650
22850
|
visible = true
|
|
22651
22851
|
}) => {
|
|
22652
|
-
const [skills, setSkills] =
|
|
22653
|
-
const [loading, setLoading] =
|
|
22654
|
-
const [showAll, setShowAll] =
|
|
22852
|
+
const [skills, setSkills] = useState64([]);
|
|
22853
|
+
const [loading, setLoading] = useState64(false);
|
|
22854
|
+
const [showAll, setShowAll] = useState64(false);
|
|
22655
22855
|
const { get } = useApi();
|
|
22656
22856
|
const MAX_SIMPLE_ITEMS = 10;
|
|
22657
|
-
|
|
22857
|
+
useEffect46(() => {
|
|
22658
22858
|
const loadSkills = async () => {
|
|
22659
22859
|
setLoading(true);
|
|
22660
22860
|
try {
|
|
@@ -22833,7 +23033,7 @@ import {
|
|
|
22833
23033
|
} from "@ant-design/icons";
|
|
22834
23034
|
import { Prompts as Prompts2 } from "@ant-design/x";
|
|
22835
23035
|
import { Space as Space29, Tabs } from "antd";
|
|
22836
|
-
import { useState as
|
|
23036
|
+
import { useState as useState65, useMemo as useMemo22 } from "react";
|
|
22837
23037
|
import { jsx as jsx90, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
22838
23038
|
var defaultCategoryIcons = {
|
|
22839
23039
|
financial: /* @__PURE__ */ jsx90(DollarOutlined, {}),
|
|
@@ -23052,7 +23252,7 @@ var BusinessAnalysisPrompts = ({
|
|
|
23052
23252
|
simpleModeTitle = "Quick Analysis",
|
|
23053
23253
|
expandModeTitle = "Analysis Categories"
|
|
23054
23254
|
}) => {
|
|
23055
|
-
const [showAll, setShowAll] =
|
|
23255
|
+
const [showAll, setShowAll] = useState65(false);
|
|
23056
23256
|
const { config } = useLatticeChatShellContext();
|
|
23057
23257
|
const analysisData = useMemo22(() => {
|
|
23058
23258
|
const customData = config.quickPromptsData;
|
|
@@ -23225,10 +23425,10 @@ var Chating = ({
|
|
|
23225
23425
|
initialMessage,
|
|
23226
23426
|
onInitialMessageSent
|
|
23227
23427
|
}) => {
|
|
23228
|
-
const [content, setContent] =
|
|
23229
|
-
const [attachedFiles, setAttachedFiles] =
|
|
23428
|
+
const [content, setContent] = useState66("");
|
|
23429
|
+
const [attachedFiles, setAttachedFiles] = useState66([]);
|
|
23230
23430
|
const { styles } = useStyle();
|
|
23231
|
-
const [headerOpen, setHeaderOpen] =
|
|
23431
|
+
const [headerOpen, setHeaderOpen] = useState66(false);
|
|
23232
23432
|
const attachmentsRef = useRef23(null);
|
|
23233
23433
|
const senderRef = React51.useRef(null);
|
|
23234
23434
|
const {
|
|
@@ -23253,8 +23453,8 @@ var Chating = ({
|
|
|
23253
23453
|
const hasPendingMessages = pendingMessages?.length > 0;
|
|
23254
23454
|
const isInputDisabled = interrupts && interrupts.length > 0;
|
|
23255
23455
|
const typingFrames = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
23256
|
-
const [typingFrameIndex, setTypingFrameIndex] =
|
|
23257
|
-
|
|
23456
|
+
const [typingFrameIndex, setTypingFrameIndex] = useState66(0);
|
|
23457
|
+
useEffect47(() => {
|
|
23258
23458
|
if (!isStreaming) return;
|
|
23259
23459
|
const interval = setInterval(() => {
|
|
23260
23460
|
setTypingFrameIndex((prev) => (prev + 1) % typingFrames.length);
|
|
@@ -23265,13 +23465,13 @@ var Chating = ({
|
|
|
23265
23465
|
const systemContextSentRef = useRef23(false);
|
|
23266
23466
|
const initialMessageSentRef = useRef23(false);
|
|
23267
23467
|
const prevLoadingRef = useRef23(false);
|
|
23268
|
-
|
|
23468
|
+
useEffect47(() => {
|
|
23269
23469
|
systemContextSentRef.current = false;
|
|
23270
23470
|
}, [threadId]);
|
|
23271
|
-
|
|
23471
|
+
useEffect47(() => {
|
|
23272
23472
|
initialMessageSentRef.current = false;
|
|
23273
23473
|
}, [threadId]);
|
|
23274
|
-
|
|
23474
|
+
useEffect47(() => {
|
|
23275
23475
|
const wasLoading = prevLoadingRef.current;
|
|
23276
23476
|
prevLoadingRef.current = isLoading;
|
|
23277
23477
|
if (wasLoading && !isLoading && initialMessage && threadId && !initialMessageSentRef.current) {
|
|
@@ -23283,16 +23483,16 @@ var Chating = ({
|
|
|
23283
23483
|
onInitialMessageSent?.();
|
|
23284
23484
|
}
|
|
23285
23485
|
}, [isLoading, initialMessage, threadId, sendMessage, onInitialMessageSent]);
|
|
23286
|
-
const [modelConfig, setModelConfig] =
|
|
23486
|
+
const [modelConfig, setModelConfig] = useState66(null);
|
|
23287
23487
|
const handleModelChange = useCallback33((config2) => {
|
|
23288
23488
|
setModelConfig(config2);
|
|
23289
23489
|
if (config2) {
|
|
23290
23490
|
updateCustomRunConfig({ modelConfig: config2 });
|
|
23291
23491
|
}
|
|
23292
23492
|
}, [updateCustomRunConfig]);
|
|
23293
|
-
const [isEmptyState, setIsEmptyState] =
|
|
23294
|
-
const [isTransitioning, setIsTransitioning] =
|
|
23295
|
-
|
|
23493
|
+
const [isEmptyState, setIsEmptyState] = useState66(showEmptyState && messages.length === 0 && !pendingMessages?.length);
|
|
23494
|
+
const [isTransitioning, setIsTransitioning] = useState66(false);
|
|
23495
|
+
useEffect47(() => {
|
|
23296
23496
|
if (!showEmptyState) {
|
|
23297
23497
|
setIsEmptyState(false);
|
|
23298
23498
|
return;
|
|
@@ -23317,9 +23517,9 @@ var Chating = ({
|
|
|
23317
23517
|
const listPathByFolder = workspaceContext?.listPathByFolder ?? (async () => []);
|
|
23318
23518
|
const workspaceId = workspaceContext?.workspaceId ?? null;
|
|
23319
23519
|
const projectId = workspaceContext?.projectId ?? null;
|
|
23320
|
-
const [workspaceFiles, setWorkspaceFiles] =
|
|
23321
|
-
const [suggestionsLoading, setSuggestionsLoading] =
|
|
23322
|
-
const [suggestionsOpen, setSuggestionsOpen] =
|
|
23520
|
+
const [workspaceFiles, setWorkspaceFiles] = useState66([]);
|
|
23521
|
+
const [suggestionsLoading, setSuggestionsLoading] = useState66(false);
|
|
23522
|
+
const [suggestionsOpen, setSuggestionsOpen] = useState66(false);
|
|
23323
23523
|
const getFileIcon3 = (filename) => {
|
|
23324
23524
|
const ext = filename.split(".").pop()?.toLowerCase();
|
|
23325
23525
|
const iconStyle = { fontSize: 16 };
|
|
@@ -23379,7 +23579,7 @@ var Chating = ({
|
|
|
23379
23579
|
setSuggestionsLoading(false);
|
|
23380
23580
|
}
|
|
23381
23581
|
};
|
|
23382
|
-
|
|
23582
|
+
useEffect47(() => {
|
|
23383
23583
|
regsiterElement("action_show_attachments_uploader", {
|
|
23384
23584
|
card_view: () => null,
|
|
23385
23585
|
action: (data) => {
|
|
@@ -23577,8 +23777,8 @@ ${nextContent}`;
|
|
|
23577
23777
|
...showRefreshButton ? [refreshButton] : [],
|
|
23578
23778
|
/* @__PURE__ */ jsx91(ThreadManagementButtons, {}, "thread-buttons")
|
|
23579
23779
|
];
|
|
23580
|
-
const [skills, setSkills] =
|
|
23581
|
-
const [skillsLoading, setSkillsLoading] =
|
|
23780
|
+
const [skills, setSkills] = useState66([]);
|
|
23781
|
+
const [skillsLoading, setSkillsLoading] = useState66(false);
|
|
23582
23782
|
const { get: apiGet } = useApi();
|
|
23583
23783
|
const loadSkills = async () => {
|
|
23584
23784
|
if (skills.length > 0) return;
|
|
@@ -23602,7 +23802,7 @@ ${nextContent}`;
|
|
|
23602
23802
|
return isEmpty ? "Type / to see available skills, or @ to reference files" : void 0;
|
|
23603
23803
|
};
|
|
23604
23804
|
const renderSender = (isEmpty) => {
|
|
23605
|
-
const [suggestionMode, setSuggestionMode] =
|
|
23805
|
+
const [suggestionMode, setSuggestionMode] = useState66(null);
|
|
23606
23806
|
const suggestionItems = suggestionMode === "skills" ? skills.map((skill) => ({
|
|
23607
23807
|
value: skill.name,
|
|
23608
23808
|
icon: /* @__PURE__ */ jsx91(BrainCircuit3, { size: 14, style: { color: "#722ed1" } }),
|
|
@@ -23981,7 +24181,7 @@ var InternetSearchCard = ({
|
|
|
23981
24181
|
};
|
|
23982
24182
|
|
|
23983
24183
|
// src/components/GenUI/elements/schedule_viewer.tsx
|
|
23984
|
-
import { useState as
|
|
24184
|
+
import { useState as useState67, useEffect as useEffect48, useCallback as useCallback34 } from "react";
|
|
23985
24185
|
import {
|
|
23986
24186
|
Tag as Tag22,
|
|
23987
24187
|
Button as Button48,
|
|
@@ -24145,9 +24345,9 @@ var ScheduleViewer = ({ data }) => {
|
|
|
24145
24345
|
const { styles } = useStyles8();
|
|
24146
24346
|
const { threadId, assistantId, tasks: initialTasks, onRefresh } = data ?? {};
|
|
24147
24347
|
const client = useClient(assistantId || "");
|
|
24148
|
-
const [tasks, setTasks] =
|
|
24149
|
-
const [loading, setLoading] =
|
|
24150
|
-
const [actionLoading, setActionLoading] =
|
|
24348
|
+
const [tasks, setTasks] = useState67(initialTasks || []);
|
|
24349
|
+
const [loading, setLoading] = useState67(false);
|
|
24350
|
+
const [actionLoading, setActionLoading] = useState67(null);
|
|
24151
24351
|
const handleRefresh = useCallback34(async () => {
|
|
24152
24352
|
if (!threadId) return;
|
|
24153
24353
|
setLoading(true);
|
|
@@ -24210,12 +24410,12 @@ var ScheduleViewer = ({ data }) => {
|
|
|
24210
24410
|
},
|
|
24211
24411
|
[client, handleRefresh]
|
|
24212
24412
|
);
|
|
24213
|
-
|
|
24413
|
+
useEffect48(() => {
|
|
24214
24414
|
if (threadId && (!initialTasks || initialTasks.length === 0)) {
|
|
24215
24415
|
handleRefresh();
|
|
24216
24416
|
}
|
|
24217
24417
|
}, [threadId]);
|
|
24218
|
-
|
|
24418
|
+
useEffect48(() => {
|
|
24219
24419
|
if (initialTasks) {
|
|
24220
24420
|
setTasks(initialTasks);
|
|
24221
24421
|
}
|
|
@@ -24683,13 +24883,13 @@ var TeamGraph = ({ data }) => {
|
|
|
24683
24883
|
var TeamGraph_default = TeamGraph;
|
|
24684
24884
|
|
|
24685
24885
|
// src/components/GenUI/elements/TeamWorkspace/index.tsx
|
|
24686
|
-
import { useState as
|
|
24886
|
+
import { useState as useState72, useMemo as useMemo27 } from "react";
|
|
24687
24887
|
import { Layout, Spin as Spin18, Button as Button52 } from "antd";
|
|
24688
24888
|
import { RefreshCw } from "lucide-react";
|
|
24689
24889
|
import { createStyles as createStyles33 } from "antd-style";
|
|
24690
24890
|
|
|
24691
24891
|
// src/components/GenUI/elements/TeamWorkspace/TeamWorkspaceMenu.tsx
|
|
24692
|
-
import React53, { useState as
|
|
24892
|
+
import React53, { useState as useState68 } from "react";
|
|
24693
24893
|
import {
|
|
24694
24894
|
LayoutDashboard,
|
|
24695
24895
|
Inbox as Inbox2,
|
|
@@ -24883,7 +25083,7 @@ var TeamWorkspaceMenu = ({
|
|
|
24883
25083
|
onItemClick
|
|
24884
25084
|
}) => {
|
|
24885
25085
|
const { styles } = useStyles9();
|
|
24886
|
-
const [isExpanded, setIsExpanded] =
|
|
25086
|
+
const [isExpanded, setIsExpanded] = useState68(false);
|
|
24887
25087
|
const mainItems = items.filter((item) => !item.group);
|
|
24888
25088
|
const teammateItems = items.filter((item) => item.group === "Teammates");
|
|
24889
25089
|
const teamItems = items.filter((item) => item.group === "Team");
|
|
@@ -25360,7 +25560,7 @@ var TeamDashboard = ({
|
|
|
25360
25560
|
};
|
|
25361
25561
|
|
|
25362
25562
|
// src/components/GenUI/elements/TeamWorkspace/IssuesView.tsx
|
|
25363
|
-
import { useState as
|
|
25563
|
+
import { useState as useState70, useMemo as useMemo24 } from "react";
|
|
25364
25564
|
import { Typography as Typography51, Badge as Badge8, Empty as Empty17, Tooltip as Tooltip21 } from "antd";
|
|
25365
25565
|
import {
|
|
25366
25566
|
CheckCircle2 as CheckCircle24,
|
|
@@ -25375,7 +25575,7 @@ import {
|
|
|
25375
25575
|
import { createStyles as createStyles28 } from "antd-style";
|
|
25376
25576
|
|
|
25377
25577
|
// src/components/GenUI/elements/TeamWorkspace/TaskDetailModal.tsx
|
|
25378
|
-
import { useState as
|
|
25578
|
+
import { useState as useState69 } from "react";
|
|
25379
25579
|
import { Modal as Modal18, Typography as Typography50, Tag as Tag24, Divider as Divider7, Tabs as Tabs2, Timeline } from "antd";
|
|
25380
25580
|
import { createStyles as createStyles27 } from "antd-style";
|
|
25381
25581
|
import {
|
|
@@ -25800,7 +26000,7 @@ var TaskDetailModal = ({
|
|
|
25800
26000
|
onClose
|
|
25801
26001
|
}) => {
|
|
25802
26002
|
const { styles } = useStyles11();
|
|
25803
|
-
const [activeTab, setActiveTab] =
|
|
26003
|
+
const [activeTab, setActiveTab] = useState69("comments");
|
|
25804
26004
|
if (!task) return null;
|
|
25805
26005
|
const statusConfig2 = getStatusConfig2(task.status);
|
|
25806
26006
|
const tabItems = [
|
|
@@ -26226,7 +26426,7 @@ var formatDate2 = (timestamp) => {
|
|
|
26226
26426
|
});
|
|
26227
26427
|
};
|
|
26228
26428
|
var ListGroupComponent = ({ group, styles, defaultExpanded = true, onTaskClick }) => {
|
|
26229
|
-
const [isExpanded, setIsExpanded] =
|
|
26429
|
+
const [isExpanded, setIsExpanded] = useState70(defaultExpanded);
|
|
26230
26430
|
return /* @__PURE__ */ jsxs72("div", { className: styles.listGroup, children: [
|
|
26231
26431
|
/* @__PURE__ */ jsxs72(
|
|
26232
26432
|
"div",
|
|
@@ -26269,9 +26469,9 @@ var IssuesView = ({
|
|
|
26269
26469
|
teammates
|
|
26270
26470
|
}) => {
|
|
26271
26471
|
const { styles } = useStyles12();
|
|
26272
|
-
const [viewMode, setViewMode] =
|
|
26273
|
-
const [selectedTask, setSelectedTask] =
|
|
26274
|
-
const [modalVisible, setModalVisible] =
|
|
26472
|
+
const [viewMode, setViewMode] = useState70("list");
|
|
26473
|
+
const [selectedTask, setSelectedTask] = useState70(null);
|
|
26474
|
+
const [modalVisible, setModalVisible] = useState70(false);
|
|
26275
26475
|
const listGroups = useMemo24(() => {
|
|
26276
26476
|
const groups = [
|
|
26277
26477
|
{
|
|
@@ -26882,7 +27082,7 @@ var TeamMemberChat = ({
|
|
|
26882
27082
|
};
|
|
26883
27083
|
|
|
26884
27084
|
// src/components/GenUI/elements/MailboxPanel.tsx
|
|
26885
|
-
import { useState as
|
|
27085
|
+
import { useState as useState71, useMemo as useMemo26 } from "react";
|
|
26886
27086
|
import { Typography as Typography55, Empty as Empty18 } from "antd";
|
|
26887
27087
|
import { createStyles as createStyles32 } from "antd-style";
|
|
26888
27088
|
import {
|
|
@@ -27305,7 +27505,7 @@ var getMessagePreview = (content) => {
|
|
|
27305
27505
|
return firstLine.length > 80 ? firstLine.slice(0, 80) + "..." : firstLine;
|
|
27306
27506
|
};
|
|
27307
27507
|
var MessageGroupComponent = ({ group, styles, defaultExpanded = true, onMessageClick }) => {
|
|
27308
|
-
const [isExpanded, setIsExpanded] =
|
|
27508
|
+
const [isExpanded, setIsExpanded] = useState71(defaultExpanded);
|
|
27309
27509
|
return /* @__PURE__ */ jsxs76("div", { className: styles.listGroup, children: [
|
|
27310
27510
|
/* @__PURE__ */ jsxs76(
|
|
27311
27511
|
"div",
|
|
@@ -27360,8 +27560,8 @@ var MessageGroupComponent = ({ group, styles, defaultExpanded = true, onMessageC
|
|
|
27360
27560
|
};
|
|
27361
27561
|
var MailboxPanel = ({ data }) => {
|
|
27362
27562
|
const { styles } = useStyles16();
|
|
27363
|
-
const [selectedMessage, setSelectedMessage] =
|
|
27364
|
-
const [modalVisible, setModalVisible] =
|
|
27563
|
+
const [selectedMessage, setSelectedMessage] = useState71(null);
|
|
27564
|
+
const [modalVisible, setModalVisible] = useState71(false);
|
|
27365
27565
|
const { teamMailbox = [] } = data || {};
|
|
27366
27566
|
const messageGroups = useMemo26(() => {
|
|
27367
27567
|
const groupsMap = /* @__PURE__ */ new Map();
|
|
@@ -27491,7 +27691,7 @@ var TeamWorkspace = ({
|
|
|
27491
27691
|
isLoading,
|
|
27492
27692
|
refresh
|
|
27493
27693
|
} = useTeamWorkspaceData(parent_thread_id || null, assistantId);
|
|
27494
|
-
const [activeMenuId, setActiveMenuId] =
|
|
27694
|
+
const [activeMenuId, setActiveMenuId] = useState72("dashboard");
|
|
27495
27695
|
const menuItems = useMemo27(() => {
|
|
27496
27696
|
const items = [
|
|
27497
27697
|
{
|
|
@@ -27974,7 +28174,7 @@ var TaskBoard = ({
|
|
|
27974
28174
|
};
|
|
27975
28175
|
|
|
27976
28176
|
// src/components/GenUI/elements/Mailbox.tsx
|
|
27977
|
-
import { useState as
|
|
28177
|
+
import { useState as useState73, useMemo as useMemo29, useRef as useRef24, useEffect as useEffect49 } from "react";
|
|
27978
28178
|
import { jsx as jsx109, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
27979
28179
|
var useStyle16 = () => {
|
|
27980
28180
|
return {
|
|
@@ -28260,7 +28460,7 @@ var renderMessageWithMentions = (content, mentions, styles) => {
|
|
|
28260
28460
|
var TeamChat = ({ data }) => {
|
|
28261
28461
|
const styles = useStyle16();
|
|
28262
28462
|
const { teamName, currentUser, teammates, messages, onSendMessage } = data || {};
|
|
28263
|
-
const [inputValue, setInputValue] =
|
|
28463
|
+
const [inputValue, setInputValue] = useState73("");
|
|
28264
28464
|
const messagesEndRef = useRef24(null);
|
|
28265
28465
|
const sortedMessages = useMemo29(() => {
|
|
28266
28466
|
return [...messages || []].sort(
|
|
@@ -28270,7 +28470,7 @@ var TeamChat = ({ data }) => {
|
|
|
28270
28470
|
const mentions = useMemo29(() => {
|
|
28271
28471
|
return teammates?.map((t) => t.name) || [];
|
|
28272
28472
|
}, [teammates]);
|
|
28273
|
-
|
|
28473
|
+
useEffect49(() => {
|
|
28274
28474
|
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
28275
28475
|
}, [sortedMessages]);
|
|
28276
28476
|
const handleSend = () => {
|
|
@@ -28444,7 +28644,7 @@ import { Button as Button53, Typography as Typography56 } from "antd";
|
|
|
28444
28644
|
import { ExpandOutlined as ExpandOutlined2 } from "@ant-design/icons";
|
|
28445
28645
|
|
|
28446
28646
|
// src/streaming-html/StreamingHTMLRenderer.tsx
|
|
28447
|
-
import React61, { useEffect as
|
|
28647
|
+
import React61, { useEffect as useEffect50, useRef as useRef25, useCallback as useCallback35, useState as useState74 } from "react";
|
|
28448
28648
|
|
|
28449
28649
|
// src/streaming-html/show-widget-css-generator.ts
|
|
28450
28650
|
function generateShowWidgetCSS(tokens) {
|
|
@@ -29145,12 +29345,12 @@ var StreamingHTMLRenderer = ({
|
|
|
29145
29345
|
const isScriptExecuted = useRef25(false);
|
|
29146
29346
|
const [iframeHeight, setIframeHeight] = React61.useState(0);
|
|
29147
29347
|
const [iframeWidth, setIframeWidth] = React61.useState(void 0);
|
|
29148
|
-
const [currentMessageIndex, setCurrentMessageIndex] =
|
|
29149
|
-
const [showLoading, setShowLoading] =
|
|
29150
|
-
|
|
29348
|
+
const [currentMessageIndex, setCurrentMessageIndex] = useState74(0);
|
|
29349
|
+
const [showLoading, setShowLoading] = useState74(true);
|
|
29350
|
+
useEffect50(() => {
|
|
29151
29351
|
isCompleteRef.current = isComplete;
|
|
29152
29352
|
}, [isComplete]);
|
|
29153
|
-
|
|
29353
|
+
useEffect50(() => {
|
|
29154
29354
|
if (iframeHeight > 0) {
|
|
29155
29355
|
setShowLoading(false);
|
|
29156
29356
|
return;
|
|
@@ -29226,7 +29426,7 @@ var StreamingHTMLRenderer = ({
|
|
|
29226
29426
|
onError?.(streamingError);
|
|
29227
29427
|
}
|
|
29228
29428
|
}, [onError]);
|
|
29229
|
-
|
|
29429
|
+
useEffect50(() => {
|
|
29230
29430
|
const handleMessage = (event) => {
|
|
29231
29431
|
const iframe = iframeRef.current;
|
|
29232
29432
|
if (!iframe || event.source !== iframe.contentWindow) {
|
|
@@ -29279,7 +29479,7 @@ var StreamingHTMLRenderer = ({
|
|
|
29279
29479
|
window.removeEventListener("message", handleMessage);
|
|
29280
29480
|
};
|
|
29281
29481
|
}, [onError, onPrompt, sendChunk, executeScripts]);
|
|
29282
|
-
|
|
29482
|
+
useEffect50(() => {
|
|
29283
29483
|
if (html === prevHTMLRef.current) {
|
|
29284
29484
|
return;
|
|
29285
29485
|
}
|
|
@@ -29290,12 +29490,12 @@ var StreamingHTMLRenderer = ({
|
|
|
29290
29490
|
sendChunk(newChunk);
|
|
29291
29491
|
}
|
|
29292
29492
|
}, [html, sendChunk]);
|
|
29293
|
-
|
|
29493
|
+
useEffect50(() => {
|
|
29294
29494
|
if (isComplete && isReadyRef.current) {
|
|
29295
29495
|
executeScripts();
|
|
29296
29496
|
}
|
|
29297
29497
|
}, [isComplete, executeScripts]);
|
|
29298
|
-
|
|
29498
|
+
useEffect50(() => {
|
|
29299
29499
|
const container = containerRef.current;
|
|
29300
29500
|
if (!container) return;
|
|
29301
29501
|
const antBubble = container.closest(".ant-bubble");
|
|
@@ -29321,7 +29521,7 @@ var StreamingHTMLRenderer = ({
|
|
|
29321
29521
|
resizeObserverRef.current = null;
|
|
29322
29522
|
};
|
|
29323
29523
|
}, []);
|
|
29324
|
-
|
|
29524
|
+
useEffect50(() => {
|
|
29325
29525
|
return () => {
|
|
29326
29526
|
isReadyRef.current = false;
|
|
29327
29527
|
pendingChunksRef.current = [];
|
|
@@ -29634,7 +29834,7 @@ var regsiterElement = (language, ElementMeta) => {
|
|
|
29634
29834
|
// src/components/Chat/SideAppViewBrowser.tsx
|
|
29635
29835
|
import { Dropdown as Dropdown3, Tooltip as Tooltip23 } from "antd";
|
|
29636
29836
|
import { createStyles as createStyles34 } from "antd-style";
|
|
29637
|
-
import { useEffect as
|
|
29837
|
+
import { useEffect as useEffect51, useMemo as useMemo30, useState as useState75 } from "react";
|
|
29638
29838
|
import { Fragment as Fragment21, jsx as jsx113, jsxs as jsxs83 } from "react/jsx-runtime";
|
|
29639
29839
|
var useStyle17 = createStyles34(({ token, css }) => {
|
|
29640
29840
|
return {
|
|
@@ -29835,11 +30035,11 @@ var SideAppViewBrowser = ({ region = "side" }) => {
|
|
|
29835
30035
|
const selectedCard = region === "side" ? sideAppSelectedCard : contextAppSelectedCard;
|
|
29836
30036
|
const closeApp = region === "side" ? closeSideApp : closeContentApp;
|
|
29837
30037
|
const openApp = region === "side" ? openSideApp : openContentApp;
|
|
29838
|
-
const [activeKey, setActiveKey] =
|
|
30038
|
+
const [activeKey, setActiveKey] = useState75(
|
|
29839
30039
|
JSON.stringify(selectedCard)
|
|
29840
30040
|
);
|
|
29841
|
-
const [hoveredTab, setHoveredTab] =
|
|
29842
|
-
const [items, setItems] =
|
|
30041
|
+
const [hoveredTab, setHoveredTab] = useState75(null);
|
|
30042
|
+
const [items, setItems] = useState75([]);
|
|
29843
30043
|
const add = (key, label, children, componentKey) => {
|
|
29844
30044
|
const newPanes = [...items, { label, children, key, componentKey }];
|
|
29845
30045
|
setItems(newPanes);
|
|
@@ -29866,7 +30066,7 @@ var SideAppViewBrowser = ({ region = "side" }) => {
|
|
|
29866
30066
|
const switchTab = (key) => {
|
|
29867
30067
|
setActiveKey(key);
|
|
29868
30068
|
};
|
|
29869
|
-
|
|
30069
|
+
useEffect51(() => {
|
|
29870
30070
|
if (!selectedCard) return;
|
|
29871
30071
|
const key = JSON.stringify(selectedCard);
|
|
29872
30072
|
if (items.find((item) => item.key === key)) {
|
|
@@ -29975,7 +30175,7 @@ var SideAppViewBrowser = ({ region = "side" }) => {
|
|
|
29975
30175
|
};
|
|
29976
30176
|
|
|
29977
30177
|
// src/components/Chat/ProjectSelector.tsx
|
|
29978
|
-
import { useState as
|
|
30178
|
+
import { useState as useState76, useCallback as useCallback38, useMemo as useMemo31, useRef as useRef26 } from "react";
|
|
29979
30179
|
import { Modal as Modal20, Input as Input15, Button as Button54, message as message18 } from "antd";
|
|
29980
30180
|
import { createStyles as createStyles35 } from "antd-style";
|
|
29981
30181
|
import { Folder, ChevronDown as ChevronDown6, Building2 as Building24 } from "lucide-react";
|
|
@@ -30211,13 +30411,13 @@ var ProjectSelector = ({
|
|
|
30211
30411
|
setProject,
|
|
30212
30412
|
createProject
|
|
30213
30413
|
} = useWorkspaceContext();
|
|
30214
|
-
const [isWorkspaceListOpen, setIsWorkspaceListOpen] =
|
|
30414
|
+
const [isWorkspaceListOpen, setIsWorkspaceListOpen] = useState76(false);
|
|
30215
30415
|
const workspaceDropdownRef = useRef26(null);
|
|
30216
|
-
const [isProjectListOpen, setIsProjectListOpen] =
|
|
30217
|
-
const [isModalOpen, setIsModalOpen] =
|
|
30218
|
-
const [projectName, setProjectName] =
|
|
30219
|
-
const [validationError, setValidationError] =
|
|
30220
|
-
const [isCreating, setIsCreating] =
|
|
30416
|
+
const [isProjectListOpen, setIsProjectListOpen] = useState76(false);
|
|
30417
|
+
const [isModalOpen, setIsModalOpen] = useState76(false);
|
|
30418
|
+
const [projectName, setProjectName] = useState76("");
|
|
30419
|
+
const [validationError, setValidationError] = useState76(null);
|
|
30420
|
+
const [isCreating, setIsCreating] = useState76(false);
|
|
30221
30421
|
const projectNameInputRef = useRef26(null);
|
|
30222
30422
|
const currentProject = useMemo31(() => {
|
|
30223
30423
|
return projects.find((p) => p.id === projectId);
|
|
@@ -30386,7 +30586,7 @@ var ProjectSelector = ({
|
|
|
30386
30586
|
};
|
|
30387
30587
|
|
|
30388
30588
|
// src/components/Chat/ToolPanelFiles.tsx
|
|
30389
|
-
import { useCallback as useCallback39, useEffect as
|
|
30589
|
+
import { useCallback as useCallback39, useEffect as useEffect52, useMemo as useMemo32, useState as useState77 } from "react";
|
|
30390
30590
|
import { message as message19 } from "antd";
|
|
30391
30591
|
|
|
30392
30592
|
// src/components/Chat/FileDirectoryPanel.tsx
|
|
@@ -30745,12 +30945,12 @@ var ToolPanelFiles = () => {
|
|
|
30745
30945
|
uploadFileToFolder
|
|
30746
30946
|
} = useWorkspaceContext();
|
|
30747
30947
|
const { currentAssistant } = useAssistantContext();
|
|
30748
|
-
const [folderEntries, setFolderEntries] =
|
|
30749
|
-
const [folderLoading, setFolderLoading] =
|
|
30750
|
-
const [directoryChildren, setDirectoryChildren] =
|
|
30751
|
-
const [directoryLoading, setDirectoryLoading] =
|
|
30752
|
-
const [directoryExpanded, setDirectoryExpanded] =
|
|
30753
|
-
const [uploadingFolder, setUploadingFolder] =
|
|
30948
|
+
const [folderEntries, setFolderEntries] = useState77({});
|
|
30949
|
+
const [folderLoading, setFolderLoading] = useState77({});
|
|
30950
|
+
const [directoryChildren, setDirectoryChildren] = useState77({});
|
|
30951
|
+
const [directoryLoading, setDirectoryLoading] = useState77({});
|
|
30952
|
+
const [directoryExpanded, setDirectoryExpanded] = useState77({});
|
|
30953
|
+
const [uploadingFolder, setUploadingFolder] = useState77(null);
|
|
30754
30954
|
const resourceFolders = useMemo32(() => {
|
|
30755
30955
|
return config.resourceFolders && config.resourceFolders.length > 0 ? config.resourceFolders : [{ name: "/", displayName: "Project Assets", allowUpload: true }];
|
|
30756
30956
|
}, [config.resourceFolders]);
|
|
@@ -30812,7 +31012,7 @@ var ToolPanelFiles = () => {
|
|
|
30812
31012
|
setDirectoryLoading((prev) => ({ ...prev, [path]: false }));
|
|
30813
31013
|
}
|
|
30814
31014
|
}, [directoryExpanded, listPath, currentAssistant?.id]);
|
|
30815
|
-
|
|
31015
|
+
useEffect52(() => {
|
|
30816
31016
|
resourceFolders.forEach((folder) => {
|
|
30817
31017
|
void loadAssetsForFolder(folder, false);
|
|
30818
31018
|
});
|
|
@@ -31072,7 +31272,7 @@ var AgentConversations = ({
|
|
|
31072
31272
|
import { useContext as useContext12 } from "react";
|
|
31073
31273
|
|
|
31074
31274
|
// src/components/Chat/ChatSidebar.tsx
|
|
31075
|
-
import { useState as
|
|
31275
|
+
import { useState as useState78, useMemo as useMemo34, useCallback as useCallback41 } from "react";
|
|
31076
31276
|
import { Drawer as Drawer3, Avatar as Avatar14, Popover as Popover3, Button as Button56 } from "antd";
|
|
31077
31277
|
import {
|
|
31078
31278
|
History as History2,
|
|
@@ -31310,8 +31510,8 @@ var ChatSidebar = ({
|
|
|
31310
31510
|
const { sideAppVisible, menuCollapsed, setMenuCollapsed } = useChatUIContext();
|
|
31311
31511
|
const { user, logout } = useAuth();
|
|
31312
31512
|
const { createThread } = useConversationContext();
|
|
31313
|
-
const [drawerStates, setDrawerStates] =
|
|
31314
|
-
const [changePasswordOpen, setChangePasswordOpen] =
|
|
31513
|
+
const [drawerStates, setDrawerStates] = useState78({});
|
|
31514
|
+
const [changePasswordOpen, setChangePasswordOpen] = useState78(false);
|
|
31315
31515
|
const {
|
|
31316
31516
|
sidebarMode,
|
|
31317
31517
|
sidebarShowToggle,
|
|
@@ -31570,7 +31770,7 @@ var LatticeChatView = (props) => {
|
|
|
31570
31770
|
};
|
|
31571
31771
|
|
|
31572
31772
|
// src/components/Chat/SettingsModal.tsx
|
|
31573
|
-
import { useState as
|
|
31773
|
+
import { useState as useState79, useEffect as useEffect53, useRef as useRef27 } from "react";
|
|
31574
31774
|
import {
|
|
31575
31775
|
Modal as Modal22,
|
|
31576
31776
|
Input as Input16,
|
|
@@ -31959,7 +32159,7 @@ var SettingsModal = ({
|
|
|
31959
32159
|
}) => {
|
|
31960
32160
|
const { styles } = useStyles23();
|
|
31961
32161
|
const { config: shellConfig, updateConfigValue } = useLatticeChatShellContext();
|
|
31962
|
-
const [connections, setConnections] =
|
|
32162
|
+
const [connections, setConnections] = useState79(() => {
|
|
31963
32163
|
if (typeof window !== "undefined") {
|
|
31964
32164
|
try {
|
|
31965
32165
|
const stored = localStorage.getItem("lattice_server_connections");
|
|
@@ -31982,21 +32182,21 @@ var SettingsModal = ({
|
|
|
31982
32182
|
}
|
|
31983
32183
|
return [];
|
|
31984
32184
|
});
|
|
31985
|
-
const [serverConfigs, setServerConfigs] =
|
|
32185
|
+
const [serverConfigs, setServerConfigs] = useState79({});
|
|
31986
32186
|
const connectionsRef = useRef27(connections);
|
|
31987
|
-
|
|
32187
|
+
useEffect53(() => {
|
|
31988
32188
|
connectionsRef.current = connections;
|
|
31989
32189
|
}, [connections]);
|
|
31990
|
-
const [activeTabKey, setActiveTabKey] =
|
|
32190
|
+
const [activeTabKey, setActiveTabKey] = useState79(
|
|
31991
32191
|
connections.length > 0 ? connections[0].id : ""
|
|
31992
32192
|
);
|
|
31993
|
-
const [activeMenu, setActiveMenu] =
|
|
31994
|
-
const [loading, setLoading] =
|
|
31995
|
-
const [showAddServerModal, setShowAddServerModal] =
|
|
31996
|
-
const [newServerUrl, setNewServerUrl] =
|
|
31997
|
-
const [newServerName, setNewServerName] =
|
|
31998
|
-
const [newServerApiKey, setNewServerApiKey] =
|
|
31999
|
-
const [addingServer, setAddingServer] =
|
|
32193
|
+
const [activeMenu, setActiveMenu] = useState79("environment");
|
|
32194
|
+
const [loading, setLoading] = useState79(false);
|
|
32195
|
+
const [showAddServerModal, setShowAddServerModal] = useState79(false);
|
|
32196
|
+
const [newServerUrl, setNewServerUrl] = useState79("");
|
|
32197
|
+
const [newServerName, setNewServerName] = useState79("");
|
|
32198
|
+
const [newServerApiKey, setNewServerApiKey] = useState79("");
|
|
32199
|
+
const [addingServer, setAddingServer] = useState79(false);
|
|
32000
32200
|
const saveConnections = (newConnections) => {
|
|
32001
32201
|
setConnections(newConnections);
|
|
32002
32202
|
if (typeof window !== "undefined") {
|
|
@@ -32186,7 +32386,7 @@ var SettingsModal = ({
|
|
|
32186
32386
|
console.error("Failed to load models configuration:", error);
|
|
32187
32387
|
}
|
|
32188
32388
|
};
|
|
32189
|
-
|
|
32389
|
+
useEffect53(() => {
|
|
32190
32390
|
if (open && activeTabKey) {
|
|
32191
32391
|
initializeServerConfig(activeTabKey);
|
|
32192
32392
|
const connection = connections.find((c) => c.id === activeTabKey);
|
|
@@ -32195,7 +32395,7 @@ var SettingsModal = ({
|
|
|
32195
32395
|
}
|
|
32196
32396
|
}
|
|
32197
32397
|
}, [open, activeTabKey]);
|
|
32198
|
-
|
|
32398
|
+
useEffect53(() => {
|
|
32199
32399
|
if (open && activeTabKey) {
|
|
32200
32400
|
const connection = connections.find((c) => c.id === activeTabKey);
|
|
32201
32401
|
if (connection?.connected) {
|
|
@@ -32975,7 +33175,7 @@ var LatticeChatShell = (props) => {
|
|
|
32975
33175
|
};
|
|
32976
33176
|
|
|
32977
33177
|
// src/components/Chat/ChannelInstallationsDrawerContent.tsx
|
|
32978
|
-
import { useEffect as
|
|
33178
|
+
import { useEffect as useEffect54, useState as useState80 } from "react";
|
|
32979
33179
|
import {
|
|
32980
33180
|
Button as Button58,
|
|
32981
33181
|
Card as Card30,
|
|
@@ -32993,10 +33193,10 @@ import { jsx as jsx126, jsxs as jsxs91 } from "react/jsx-runtime";
|
|
|
32993
33193
|
var { Text: Text47, Title: Title17 } = Typography58;
|
|
32994
33194
|
var ChannelInstallationsDrawerContent = () => {
|
|
32995
33195
|
const { get, post, put, del } = useApi();
|
|
32996
|
-
const [installations, setInstallations] =
|
|
32997
|
-
const [loading, setLoading] =
|
|
32998
|
-
const [formModalOpen, setFormModalOpen] =
|
|
32999
|
-
const [editingInstallation, setEditingInstallation] =
|
|
33196
|
+
const [installations, setInstallations] = useState80([]);
|
|
33197
|
+
const [loading, setLoading] = useState80(false);
|
|
33198
|
+
const [formModalOpen, setFormModalOpen] = useState80(false);
|
|
33199
|
+
const [editingInstallation, setEditingInstallation] = useState80(null);
|
|
33000
33200
|
const loadInstallations = async () => {
|
|
33001
33201
|
setLoading(true);
|
|
33002
33202
|
try {
|
|
@@ -33017,7 +33217,7 @@ var ChannelInstallationsDrawerContent = () => {
|
|
|
33017
33217
|
setLoading(false);
|
|
33018
33218
|
}
|
|
33019
33219
|
};
|
|
33020
|
-
|
|
33220
|
+
useEffect54(() => {
|
|
33021
33221
|
loadInstallations();
|
|
33022
33222
|
}, []);
|
|
33023
33223
|
const handleDelete = async (installation) => {
|
|
@@ -33165,7 +33365,7 @@ var ChannelInstallationsDrawerContent = () => {
|
|
|
33165
33365
|
};
|
|
33166
33366
|
var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCancel, onSave }) => {
|
|
33167
33367
|
const [form] = Form9.useForm();
|
|
33168
|
-
|
|
33368
|
+
useEffect54(() => {
|
|
33169
33369
|
if (installation) {
|
|
33170
33370
|
const config = installation.config;
|
|
33171
33371
|
form.setFieldsValue({
|