@glodon-aiot/agent-cli-ui 3.4.0 → 3.4.1-beta.2
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/es/AgentClientUI.mjs +41 -38
- package/dist/es/Dialog/AgentChat/Tools/SessionHistoryDrawer/index.mjs +28 -33
- package/dist/es/Dialog/AgentChat/index.mjs +185 -180
- package/dist/es/Dialog/SessionList/index.mjs +94 -94
- package/dist/es/Dialog/index.mjs +107 -102
- package/dist/es/context/SessionContext.mjs +26 -0
- package/dist/es/hooks/useSessionState.mjs +6 -0
- package/dist/es/packages/agent-cli-ui/package.json.mjs +3 -3
- package/dist/es/packages/react-components/dist/es/index.mjs +1 -1
- package/dist/es/src/style10.css +1 -1
- package/dist/es/src/style11.css +1 -1
- package/dist/es/src/style12.css +1 -1
- package/dist/es/src/style13.css +1 -1
- package/dist/es/src/style15.css +1 -1
- package/dist/es/src/style16.css +1 -1
- package/dist/es/src/style17.css +1 -1
- package/dist/es/src/style19.css +1 -1
- package/dist/es/src/style20.css +1 -1
- package/dist/es/src/style21.css +1 -1
- package/dist/es/src/style24.css +1 -1
- package/dist/es/src/style25.css +1 -1
- package/dist/es/src/style30.css +1 -1
- package/dist/es/src/style32.css +1 -1
- package/dist/es/src/style4.css +1 -1
- package/dist/es/src/style6.css +1 -1
- package/dist/es/src/style7.css +1 -1
- package/dist/es/src/style8.css +1 -1
- package/dist/es/src/style9.css +1 -1
- package/dist/lib/index.js +56 -56
- package/dist/src/Dialog/AgentChat/Tools/SessionHistoryDrawer/index.d.ts +1 -2
- package/dist/src/Dialog/AgentChat/index.d.ts +0 -2
- package/dist/src/Dialog/SessionList/index.d.ts +0 -2
- package/dist/src/context/SessionContext.d.ts +15 -0
- package/dist/src/hooks/useSessionState.d.ts +7 -0
- package/package.json +3 -3
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
var rn = Object.defineProperty, an = Object.defineProperties;
|
|
2
2
|
var ln = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var
|
|
3
|
+
var ct = Object.getOwnPropertySymbols;
|
|
4
4
|
var dn = Object.prototype.hasOwnProperty, cn = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var
|
|
5
|
+
var Ee = (x, k, o) => k in x ? rn(x, k, { enumerable: !0, configurable: !0, writable: !0, value: o }) : x[k] = o, ft = (x, k) => {
|
|
6
6
|
for (var o in k || (k = {}))
|
|
7
|
-
dn.call(k, o) &&
|
|
8
|
-
if (
|
|
9
|
-
for (var o of
|
|
10
|
-
cn.call(k, o) &&
|
|
7
|
+
dn.call(k, o) && Ee(x, o, k[o]);
|
|
8
|
+
if (ct)
|
|
9
|
+
for (var o of ct(k))
|
|
10
|
+
cn.call(k, o) && Ee(x, o, k[o]);
|
|
11
11
|
return x;
|
|
12
|
-
},
|
|
13
|
-
var D = (x, k, o) => (
|
|
14
|
-
var j = (x, k, o) => new Promise((
|
|
12
|
+
}, gt = (x, k) => an(x, ln(k));
|
|
13
|
+
var D = (x, k, o) => (Ee(x, typeof k != "symbol" ? k + "" : k, o), o);
|
|
14
|
+
var j = (x, k, o) => new Promise((Y, e) => {
|
|
15
15
|
var L = (E) => {
|
|
16
16
|
try {
|
|
17
17
|
p(o.next(E));
|
|
@@ -24,20 +24,20 @@ var j = (x, k, o) => new Promise(($, e) => {
|
|
|
24
24
|
} catch (P) {
|
|
25
25
|
e(P);
|
|
26
26
|
}
|
|
27
|
-
}, p = (E) => E.done ?
|
|
27
|
+
}, p = (E) => E.done ? Y(E.value) : Promise.resolve(E.value).then(L, pe);
|
|
28
28
|
p((o = o.apply(x, k)).next());
|
|
29
29
|
});
|
|
30
30
|
import { jsx as c, jsxs as z, Fragment as fn } from "react/jsx-runtime";
|
|
31
31
|
import { memo as gn, forwardRef as un, useState as h, useRef as K, useContext as hn, useEffect as C, useMemo as mn, useImperativeHandle as yn } from "react";
|
|
32
|
-
/* empty css */import { Spin as
|
|
32
|
+
/* empty css */import { Spin as ut, Divider as pn, Button as W, Space as he, Upload as vn, Tooltip as kn, Popover as wn, notification as me, message as u } from "antd";
|
|
33
33
|
import ne from "../../components/Iconfont/index.mjs";
|
|
34
|
-
import { IHistoryRole as J, ChatMessageRole as
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import { v4 as
|
|
38
|
-
import
|
|
34
|
+
import { IHistoryRole as J, ChatMessageRole as ht, PromptVariableType as ye } from "@glodon-aiot/apis";
|
|
35
|
+
import pt from "./HistoryItem/index.mjs";
|
|
36
|
+
import vt from "dayjs";
|
|
37
|
+
import { v4 as Te } from "uuid";
|
|
38
|
+
import bn from "../../context.mjs";
|
|
39
39
|
import { configuration as xn } from "@glodon-aiot/bot-client-sdk";
|
|
40
|
-
import { NET_OPEN_STATUS as
|
|
40
|
+
import { NET_OPEN_STATUS as $, MB as In } from "../../constant.mjs";
|
|
41
41
|
import Nn from "../../components/FilePreview/index.mjs";
|
|
42
42
|
import { getImageExtension as Cn } from "../../utils/index.mjs";
|
|
43
43
|
import Ln from "../../QuillEditor/index.mjs";
|
|
@@ -48,19 +48,20 @@ import { CameraOutlined as Fn, PlusOutlined as On } from "@ant-design/icons";
|
|
|
48
48
|
import Hn from "./Tools/UploadKnowledgeFiles/index.mjs";
|
|
49
49
|
import Rn from "../UploadingPrompt/index.mjs";
|
|
50
50
|
import Dn from "./PromptSetting/index.mjs";
|
|
51
|
-
import { useMemoizedFn as
|
|
51
|
+
import { useMemoizedFn as Pe } from "ahooks";
|
|
52
52
|
import Un from "./Tools/SessionListDrawer/index.mjs";
|
|
53
53
|
import Mn from "./Tools/SessionHistoryDrawer/index.mjs";
|
|
54
54
|
import jn from "react-infinite-scroll-component";
|
|
55
55
|
import zn from "./Tools/ConnectToNetwork/index.mjs";
|
|
56
56
|
import Vn from "./Tools/PromptManager/index.mjs";
|
|
57
|
-
import An from "../../
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
import { useSessionState as An } from "../../hooks/useSessionState.mjs";
|
|
58
|
+
import qn from "../../assets/icon.svg.mjs";
|
|
59
|
+
const Bn = gn(pt), mt = {
|
|
60
|
+
icon: qn,
|
|
60
61
|
text: "今天我能帮你什么?"
|
|
61
62
|
};
|
|
62
63
|
class ie {
|
|
63
|
-
constructor(k, o,
|
|
64
|
+
constructor(k, o, Y, e) {
|
|
64
65
|
D(this, "messageTime");
|
|
65
66
|
D(this, "isWaiting");
|
|
66
67
|
D(this, "messageId");
|
|
@@ -70,55 +71,58 @@ class ie {
|
|
|
70
71
|
D(this, "isSensitive");
|
|
71
72
|
D(this, "isSuspend");
|
|
72
73
|
D(this, "comment");
|
|
73
|
-
this.content = k, this.sessionId = o, this.role =
|
|
74
|
+
this.content = k, this.sessionId = o, this.role = Y, this.files = e, this.content = k, this.role = Y, this.sessionId = o, this.files = e, this.messageTime = vt(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"), this.isWaiting = !1, this.messageId = Te(), this.isContext = !1, this.actions = [], this.reference = [], this.isSensitive = !1, this.isSuspend = !1, this.comment = {
|
|
74
75
|
isAgree: 0
|
|
75
76
|
};
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
|
-
const
|
|
79
|
-
var
|
|
79
|
+
const yt = 10, wi = un((x, k) => {
|
|
80
|
+
var Se, et, tt, nt, it, ot, st, rt, at, lt, dt;
|
|
80
81
|
const {
|
|
81
82
|
application: o,
|
|
82
|
-
docViewerUrl:
|
|
83
|
+
docViewerUrl: Y = "",
|
|
83
84
|
currentSession: e,
|
|
84
85
|
onCreateSession: L,
|
|
85
86
|
embeddingService: pe,
|
|
86
87
|
setCurrentSession: p,
|
|
87
88
|
networkStatus: E,
|
|
88
|
-
setNetworkStatus: P
|
|
89
|
-
|
|
90
|
-
// 👈 新增
|
|
91
|
-
setSessions: kt
|
|
92
|
-
// 👈 新增
|
|
93
|
-
} = x, [v, I] = h([]), [bt, oe] = h(), [ve, Te] = h(), H = K(null), {
|
|
89
|
+
setNetworkStatus: P
|
|
90
|
+
} = x, [v, I] = h([]), [kt, oe] = h(), [ve, Fe] = h(), H = K(null), {
|
|
94
91
|
service: T,
|
|
95
92
|
agentClient: N,
|
|
96
93
|
depId: wt,
|
|
97
|
-
footer:
|
|
94
|
+
footer: bt,
|
|
98
95
|
transform: g,
|
|
99
96
|
defaultInput: ke,
|
|
100
97
|
onMessage: se,
|
|
101
|
-
onHistoryLoad:
|
|
98
|
+
onHistoryLoad: Oe,
|
|
102
99
|
beforeMessageSend: V,
|
|
103
|
-
bodyStyle:
|
|
100
|
+
bodyStyle: xt,
|
|
104
101
|
disabled: R,
|
|
105
102
|
features: s,
|
|
106
103
|
popupContainer: f,
|
|
107
|
-
icon:
|
|
108
|
-
sider:
|
|
109
|
-
mode:
|
|
110
|
-
} = hn(
|
|
104
|
+
icon: It,
|
|
105
|
+
sider: Nt,
|
|
106
|
+
mode: Ct
|
|
107
|
+
} = hn(bn), [He, we] = h(!1), m = K(v), Re = K(void 0), [Lt, Et] = h(0), [S, Q] = h(), [_, re] = h(""), [De, be] = h(!1), ae = K(null), [Ue, Pt] = h([]), [Me, G] = h(!1), [je, Tt] = h(!1), [Ft, Ot] = h(""), [Ht, X] = h(), [le, de] = h({}), ce = K(null), ze = K(null), xe = K(null), [Ve, Rt] = h(!1), [Dt, Ut] = h([]), [Mt, fe] = h(!0), [jt, zt] = h(!0), [Ae, U] = h(!1), [Ie, A] = h(!1), [qe, Vt] = h(!1), [O, ge] = h(typeof (s == null ? void 0 : s.promptVariables) == "object" ? s.promptVariables.default || [] : []), [At, qt] = h(typeof (s == null ? void 0 : s.knowledges) == "object" && s.knowledges.default || void 0), [Be, M] = h(!1), [$e, ee] = h(!1), [Bt, Z] = h(typeof (s == null ? void 0 : s.connectNetwork) == "object" && typeof (s == null ? void 0 : s.connectNetwork.default) == "boolean" ? s.connectNetwork.default : !1), [Ye, ue] = h(!1), [$t, q] = h(!1), [Yt, Kt] = h(null), [Ke, We] = h(!1), {
|
|
108
|
+
isSwitchingToExistingSession: Wt,
|
|
109
|
+
setIsSwitchingToExistingSession: Ne
|
|
110
|
+
} = An();
|
|
111
111
|
C(() => {
|
|
112
|
-
if (
|
|
113
|
-
|
|
112
|
+
if (Kt(e), e === null)
|
|
113
|
+
q(!1);
|
|
114
114
|
else if (e === void 0)
|
|
115
|
-
|
|
115
|
+
q(!0);
|
|
116
116
|
else {
|
|
117
|
-
if (
|
|
118
|
-
|
|
117
|
+
if (Yt === null) {
|
|
118
|
+
if (Wt) {
|
|
119
|
+
q(!0), Ne(!1);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
q(!1);
|
|
119
123
|
return;
|
|
120
124
|
}
|
|
121
|
-
e.ready ?
|
|
125
|
+
e.ready ? q(!1) : q(!0);
|
|
122
126
|
}
|
|
123
127
|
}, [e, e == null ? void 0 : e.ready]), C(() => {
|
|
124
128
|
var a, i;
|
|
@@ -130,11 +134,11 @@ const mt = 10, vi = un((x, k) => {
|
|
|
130
134
|
return;
|
|
131
135
|
if (A(!1), U(!1), (i = e.messages) != null && i.length) {
|
|
132
136
|
const r = [...e.messages.filter((d) => d == null ? void 0 : d.messageId)].reverse();
|
|
133
|
-
m.current = [...r], I([...r]),
|
|
137
|
+
m.current = [...r], I([...r]), q(!1);
|
|
134
138
|
}
|
|
135
139
|
const n = (l) => {
|
|
136
140
|
var r;
|
|
137
|
-
(r = e == null ? void 0 : e.data) != null && r.id && (m.current = [...l].reverse(), I([...l].reverse()), !l || l.length < 10 ? ee(!1) : ee(!0),
|
|
141
|
+
(r = e == null ? void 0 : e.data) != null && r.id && (m.current = [...l].reverse(), I([...l].reverse()), !l || l.length < 10 ? ee(!1) : ee(!0), q(!1), Oe && Oe({
|
|
138
142
|
applicationId: o.id,
|
|
139
143
|
sessionId: e.data.id,
|
|
140
144
|
histories: l
|
|
@@ -146,7 +150,7 @@ const mt = 10, vi = un((x, k) => {
|
|
|
146
150
|
}, [e]), C(() => {
|
|
147
151
|
const t = () => {
|
|
148
152
|
var n;
|
|
149
|
-
(n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables && ge(e.promptVariables.sort((a, i) => a.key.localeCompare(i.key))), e.knowledges &&
|
|
153
|
+
(n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables && ge(e.promptVariables.sort((a, i) => a.key.localeCompare(i.key))), e.knowledges && qt(e.knowledges), P(e.netOpen));
|
|
150
154
|
};
|
|
151
155
|
return e == null || e.addEventListener("data:updated", t), () => {
|
|
152
156
|
e == null || e.removeEventListener("data:updated", t);
|
|
@@ -189,10 +193,10 @@ const mt = 10, vi = un((x, k) => {
|
|
|
189
193
|
};
|
|
190
194
|
C(() => {
|
|
191
195
|
o != null && o.id && (T == null || T.getRecommendQues(o.id).then((t) => {
|
|
192
|
-
|
|
196
|
+
Pt(t);
|
|
193
197
|
}));
|
|
194
198
|
}, [wt, o]);
|
|
195
|
-
const
|
|
199
|
+
const Qe = (t) => j(void 0, null, function* () {
|
|
196
200
|
var y, F;
|
|
197
201
|
if (R) {
|
|
198
202
|
u.config({
|
|
@@ -202,7 +206,7 @@ const mt = 10, vi = un((x, k) => {
|
|
|
202
206
|
});
|
|
203
207
|
return;
|
|
204
208
|
}
|
|
205
|
-
const n = t ||
|
|
209
|
+
const n = t || kt;
|
|
206
210
|
if (!(n != null && n.trim())) {
|
|
207
211
|
u.config({
|
|
208
212
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
@@ -211,7 +215,7 @@ const mt = 10, vi = un((x, k) => {
|
|
|
211
215
|
});
|
|
212
216
|
return;
|
|
213
217
|
}
|
|
214
|
-
if (!(O == null ? void 0 : O.every((
|
|
218
|
+
if (!(O == null ? void 0 : O.every((w) => !!(w != null && w.value))))
|
|
215
219
|
if (g != null && g.promptVariables) {
|
|
216
220
|
u.config({
|
|
217
221
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
@@ -220,7 +224,7 @@ const mt = 10, vi = un((x, k) => {
|
|
|
220
224
|
});
|
|
221
225
|
return;
|
|
222
226
|
} else
|
|
223
|
-
console.error("变量值不能为空", O == null ? void 0 : O.map((
|
|
227
|
+
console.error("变量值不能为空", O == null ? void 0 : O.map((w) => !!(w != null && w.value)));
|
|
224
228
|
if (Ie) {
|
|
225
229
|
u.config({
|
|
226
230
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
@@ -229,7 +233,7 @@ const mt = 10, vi = un((x, k) => {
|
|
|
229
233
|
});
|
|
230
234
|
return;
|
|
231
235
|
}
|
|
232
|
-
if (
|
|
236
|
+
if (He) {
|
|
233
237
|
u.config({
|
|
234
238
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
235
239
|
}), u.error("等待初始化"), u.config({
|
|
@@ -237,7 +241,7 @@ const mt = 10, vi = un((x, k) => {
|
|
|
237
241
|
});
|
|
238
242
|
return;
|
|
239
243
|
}
|
|
240
|
-
if (!
|
|
244
|
+
if (!Mt) {
|
|
241
245
|
u.config({
|
|
242
246
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
243
247
|
}), u.error("正在解析文件"), u.config({
|
|
@@ -245,7 +249,7 @@ const mt = 10, vi = un((x, k) => {
|
|
|
245
249
|
});
|
|
246
250
|
return;
|
|
247
251
|
}
|
|
248
|
-
if (
|
|
252
|
+
if (De) {
|
|
249
253
|
u.config({
|
|
250
254
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
251
255
|
}), u.error("正在上传图片"), u.config({
|
|
@@ -257,11 +261,11 @@ const mt = 10, vi = un((x, k) => {
|
|
|
257
261
|
const i = (y = e == null ? void 0 : e.data) == null ? void 0 : y.id;
|
|
258
262
|
if (!i) {
|
|
259
263
|
L == null || L({
|
|
260
|
-
netOpen: E ?
|
|
261
|
-
}).then((
|
|
262
|
-
var
|
|
263
|
-
M(!0), P(!!((
|
|
264
|
-
p == null || p(
|
|
264
|
+
netOpen: E ? $.OPEN : $.CLOSE
|
|
265
|
+
}).then((w) => {
|
|
266
|
+
var B, te;
|
|
267
|
+
M(!0), P(!!((B = w.data) != null && B.netOpen)), Z(!!((te = w.data) != null && te.enableNetOpen)), _e(w).then(() => {
|
|
268
|
+
p == null || p(w), M(!1), Fe(n);
|
|
265
269
|
});
|
|
266
270
|
});
|
|
267
271
|
return;
|
|
@@ -277,24 +281,24 @@ ${n}` : n;
|
|
|
277
281
|
message: {
|
|
278
282
|
content: l,
|
|
279
283
|
sessionId: i,
|
|
280
|
-
role:
|
|
284
|
+
role: ht.User,
|
|
281
285
|
files: le[i]
|
|
282
286
|
}
|
|
283
287
|
}) : r = !0;
|
|
284
|
-
} catch (
|
|
288
|
+
} catch (w) {
|
|
285
289
|
r = !1;
|
|
286
290
|
}
|
|
287
291
|
if (ue(!1), r === !1)
|
|
288
292
|
return;
|
|
289
293
|
let d = n;
|
|
290
|
-
typeof r == "object" && (d = r.content || n), (yield e.setPromptVariables(O)) && (((F = le[i]) == null ? void 0 : F.length) > 0 ? _t(d) :
|
|
291
|
-
}),
|
|
294
|
+
typeof r == "object" && (d = r.content || n), (yield e.setPromptVariables(O)) && (((F = le[i]) == null ? void 0 : F.length) > 0 ? _t(d) : Ce(d));
|
|
295
|
+
}), _e = (t) => new Promise((n, a) => j(void 0, null, function* () {
|
|
292
296
|
const r = (t == null ? void 0 : t.promptVariables).filter((d) => d.type ? !((d.type === ye.User || d.type === void 0) && d.key === "query") && !((d.type === ye.System || d.type === void 0) && d.key === "datetime") : d.key !== "query").map((d) => {
|
|
293
297
|
var y;
|
|
294
|
-
const
|
|
295
|
-
return d.value =
|
|
298
|
+
const b = (y = O.find((F) => F.key === d.key && F.type === d.type)) == null ? void 0 : y.value;
|
|
299
|
+
return d.value = b || "", d;
|
|
296
300
|
});
|
|
297
|
-
ge(r.sort((d,
|
|
301
|
+
ge(r.sort((d, b) => d.key.localeCompare(b.key))), yield t == null ? void 0 : t.setPromptVariables(r).catch((d) => {
|
|
298
302
|
console.error(d), u.config({
|
|
299
303
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
300
304
|
}), u.error(d.message), u.config({
|
|
@@ -302,19 +306,19 @@ ${n}` : n;
|
|
|
302
306
|
});
|
|
303
307
|
}), n();
|
|
304
308
|
})), _t = (t) => {
|
|
305
|
-
var r, d,
|
|
309
|
+
var r, d, b;
|
|
306
310
|
if (fe(!1), !((r = e == null ? void 0 : e.data) != null && r.id) || !(o != null && o.id))
|
|
307
311
|
return;
|
|
308
312
|
const n = ((d = e.data) == null ? void 0 : d.id) || "", a = [];
|
|
309
313
|
let i = [], l = /* @__PURE__ */ new Set();
|
|
310
|
-
(
|
|
314
|
+
(b = le[n]) == null || b.forEach((y) => {
|
|
311
315
|
l.has(y.id) || (i.push(y), l.add(y.id));
|
|
312
316
|
}), Promise.all(i.map((y) => T == null ? void 0 : T.patchApplicationIdKnowledgeIdFileId(o == null ? void 0 : o.id, n, y.id, {
|
|
313
317
|
enabled: 1
|
|
314
318
|
}).then((F) => {
|
|
315
319
|
a.push(y);
|
|
316
320
|
}))).then((y) => {
|
|
317
|
-
fe(!0),
|
|
321
|
+
fe(!0), Ce(t, a);
|
|
318
322
|
}).catch((y) => {
|
|
319
323
|
throw Error(y);
|
|
320
324
|
});
|
|
@@ -334,20 +338,20 @@ ${t}` : t;
|
|
|
334
338
|
message: {
|
|
335
339
|
content: a,
|
|
336
340
|
sessionId: e.id,
|
|
337
|
-
role:
|
|
341
|
+
role: ht.User,
|
|
338
342
|
files: le[e.id]
|
|
339
343
|
}
|
|
340
344
|
}) : i = !0;
|
|
341
345
|
} catch (l) {
|
|
342
346
|
i = !1;
|
|
343
347
|
}
|
|
344
|
-
ue(!1), i !== !1 && (
|
|
348
|
+
ue(!1), i !== !1 && (Ce(t), Fe(void 0));
|
|
345
349
|
});
|
|
346
350
|
return e.ready ? n() : e.addEventListener("ready", n, !0), () => {
|
|
347
351
|
e == null || e.removeEventListener("ready", n);
|
|
348
352
|
};
|
|
349
353
|
}, [ve, e]);
|
|
350
|
-
const
|
|
354
|
+
const Ce = (t, n) => j(void 0, null, function* () {
|
|
351
355
|
var y, F;
|
|
352
356
|
const a = (y = e == null ? void 0 : e.data) == null ? void 0 : y.id;
|
|
353
357
|
if (!a)
|
|
@@ -362,23 +366,23 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
362
366
|
});
|
|
363
367
|
const r = new ie("", a, J.System);
|
|
364
368
|
r.isWaiting = !0, m.current = [r, ...m.current], I(m.current);
|
|
365
|
-
const d = (n == null ? void 0 : n.map((
|
|
369
|
+
const d = (n == null ? void 0 : n.map((w) => w.id)) || [], b = {
|
|
366
370
|
stream: xn.stream,
|
|
367
371
|
referenceFirst: !1
|
|
368
372
|
};
|
|
369
373
|
if (g != null && g.promptVariables) {
|
|
370
|
-
const
|
|
371
|
-
|
|
374
|
+
const w = O == null ? void 0 : O.reduce((B, te) => (B[te.key] = te.value, B), {});
|
|
375
|
+
b.formatValues = w;
|
|
372
376
|
}
|
|
373
377
|
if (g != null && g.knowledges) {
|
|
374
|
-
const
|
|
375
|
-
|
|
378
|
+
const w = At;
|
|
379
|
+
b.knowledges = w;
|
|
376
380
|
}
|
|
377
381
|
yield e.send({
|
|
378
382
|
text: i,
|
|
379
383
|
fileIds: d,
|
|
380
384
|
files: n
|
|
381
|
-
},
|
|
385
|
+
}, b), de({
|
|
382
386
|
[a]: []
|
|
383
387
|
}), (F = ce.current) == null || F.update();
|
|
384
388
|
});
|
|
@@ -388,14 +392,14 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
388
392
|
if (!t)
|
|
389
393
|
return;
|
|
390
394
|
const n = (i) => {
|
|
391
|
-
if (!i.sessionId || i.sessionId && i.sessionId !==
|
|
395
|
+
if (!i.sessionId || i.sessionId && i.sessionId !== Re.current || i.role === J.User)
|
|
392
396
|
return;
|
|
393
397
|
if (i.index === -1 && i.code !== 200 && i.code !== 11915 && (U(!1), A(!1), m.current = m.current.filter((d) => !d.isWaiting), I([...m.current]), m.current = [...m.current], i.content))
|
|
394
398
|
return me.error({
|
|
395
399
|
message: i.content
|
|
396
400
|
});
|
|
397
401
|
const l = i.actions || [], r = new ie(i.content, t, J.Robot);
|
|
398
|
-
r.messageId = i.messageId ||
|
|
402
|
+
r.messageId = i.messageId || Te(), r.reasoningContent = i.reasoningContent, r.searchReference = i.searchReference, r.thinkingSecs = i.thinkingSecs, r.thinkingStatus = i.thinkingStatus, r.actions = l, r.isLoading = !0, r.searchingStatus = i.searchingStatus, m.current = m.current.filter((d) => !d.isWaiting).filter((d) => !d.isReplying), i.index === void 0 && I([r, ...m.current]), i.code === 11915 && (U(!1), A(!1), r.isLoading = !1, r.content = "请您换个问题问我吧~", r.isSensitive = !0, I([r, ...m.current])), i.index === -2 && (U(!1), A(!1), r.isLoading = !1, r.content = "回答已中止~", r.isSuspend = !0, I([r, ...m.current])), i.index === -1 && (U(!1), A(!1), r.isLoading = !1, r.reference = i.reference, I([r, ...m.current]), o.id && se && se({
|
|
399
403
|
applicationId: o.id,
|
|
400
404
|
sessionId: t,
|
|
401
405
|
message: r
|
|
@@ -408,20 +412,20 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
408
412
|
};
|
|
409
413
|
}, [e]), C(() => {
|
|
410
414
|
if (!e) {
|
|
411
|
-
|
|
415
|
+
we(!1);
|
|
412
416
|
return;
|
|
413
417
|
}
|
|
414
418
|
const t = (n) => {
|
|
415
|
-
|
|
419
|
+
we(n);
|
|
416
420
|
};
|
|
417
|
-
return
|
|
421
|
+
return we(e.frozen), e.addEventListener("frozen", t), () => {
|
|
418
422
|
e == null || e.removeEventListener("frozen", t);
|
|
419
423
|
};
|
|
420
424
|
}, [e]), C(() => {
|
|
421
425
|
if (!N)
|
|
422
426
|
return;
|
|
423
427
|
const t = N.questionContextMaxLength || 4e3;
|
|
424
|
-
|
|
428
|
+
Et(t);
|
|
425
429
|
}, [N, T]), C(() => {
|
|
426
430
|
ke && X(ke.text);
|
|
427
431
|
}, [ke]);
|
|
@@ -438,49 +442,49 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
438
442
|
}), !1) : (Q(t), !1);
|
|
439
443
|
}, Xt = (t) => j(void 0, null, function* () {
|
|
440
444
|
var n;
|
|
441
|
-
return Q(t), (n = e == null ? void 0 : e.data) != null && n.id ?
|
|
445
|
+
return Q(t), (n = e == null ? void 0 : e.data) != null && n.id ? Ge(e, t) : new Promise((a) => {
|
|
442
446
|
M(!0), L == null || L({
|
|
443
|
-
netOpen: E ?
|
|
447
|
+
netOpen: E ? $.OPEN : $.CLOSE
|
|
444
448
|
}).then((i) => {
|
|
445
449
|
var l, r;
|
|
446
|
-
p == null || p(i), M(!1), P(!!((l = i.data) != null && l.netOpen)), Z(!!((r = i.data) != null && r.enableNetOpen)), a(
|
|
450
|
+
p == null || p(i), M(!1), P(!!((l = i.data) != null && l.netOpen)), Z(!!((r = i.data) != null && r.enableNetOpen)), a(Ge(i, t));
|
|
447
451
|
});
|
|
448
452
|
});
|
|
449
|
-
}),
|
|
453
|
+
}), Ge = (t, n) => {
|
|
450
454
|
const a = Cn(n.name);
|
|
451
455
|
return new Promise((i) => {
|
|
452
456
|
var r;
|
|
453
457
|
const l = {
|
|
454
|
-
files: [`${
|
|
458
|
+
files: [`${Te()}.${a}`],
|
|
455
459
|
isv: "minio",
|
|
456
460
|
knowledgeId: ((r = t.data) == null ? void 0 : r.id) || "",
|
|
457
461
|
type: 1
|
|
458
462
|
};
|
|
459
|
-
|
|
463
|
+
be(!0), T == null || T.postTicket(l).then((d) => {
|
|
460
464
|
T.uploadMinioFile(d.minio, n).then(() => {
|
|
461
|
-
var
|
|
462
|
-
const
|
|
463
|
-
i(`${location.protocol}//${
|
|
465
|
+
var w, B;
|
|
466
|
+
const b = (w = d.minio.endpoints) == null ? void 0 : w[0], y = d.minio.bucket, F = (B = d.minio.fileKeys) == null ? void 0 : B[0];
|
|
467
|
+
i(`${location.protocol}//${b}/${y}/${F}`);
|
|
464
468
|
}).catch(() => {
|
|
465
469
|
re(""), Q(void 0);
|
|
466
470
|
}).finally(() => {
|
|
467
|
-
|
|
471
|
+
be(!1);
|
|
468
472
|
});
|
|
469
473
|
}).catch(() => {
|
|
470
|
-
re(""), Q(void 0),
|
|
474
|
+
re(""), Q(void 0), be(!1);
|
|
471
475
|
});
|
|
472
476
|
});
|
|
473
477
|
};
|
|
474
478
|
C(() => {
|
|
475
479
|
const t = H.current;
|
|
476
|
-
t && !
|
|
480
|
+
t && !qe && t.scrollTo({
|
|
477
481
|
top: t.scrollHeight
|
|
478
482
|
});
|
|
479
483
|
}, [v]);
|
|
480
|
-
const
|
|
484
|
+
const Xe = (t, n) => new Promise((a) => {
|
|
481
485
|
if (!n.file.url || !(o != null && o.id))
|
|
482
486
|
return a();
|
|
483
|
-
const i = ft(
|
|
487
|
+
const i = gt(ft({}, n.file), {
|
|
484
488
|
type: 1
|
|
485
489
|
});
|
|
486
490
|
T == null || T.postApplicationIdSessionKnowledgeSessionFile(o == null ? void 0 : o.id, t, i).finally(() => {
|
|
@@ -502,13 +506,13 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
502
506
|
if (!H.current)
|
|
503
507
|
return;
|
|
504
508
|
const t = H.current.scrollTop <= -80;
|
|
505
|
-
|
|
506
|
-
}, en =
|
|
509
|
+
Vt(t);
|
|
510
|
+
}, en = Pe((t) => {
|
|
507
511
|
var n, a;
|
|
508
512
|
(n = ae.current) == null || n.update(t), (a = ae.current) == null || a.focus();
|
|
509
|
-
}), tn =
|
|
510
|
-
|
|
511
|
-
}), nn =
|
|
513
|
+
}), tn = Pe((t) => {
|
|
514
|
+
Qe(t);
|
|
515
|
+
}), nn = Pe(() => {
|
|
512
516
|
var n;
|
|
513
517
|
if (!((n = e == null ? void 0 : e.data) != null && n.id))
|
|
514
518
|
return;
|
|
@@ -518,7 +522,7 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
518
522
|
});
|
|
519
523
|
C(() => {
|
|
520
524
|
var t, n;
|
|
521
|
-
|
|
525
|
+
Re.current = (t = e == null ? void 0 : e.data) == null ? void 0 : t.id, !Be && ((n = xe.current) == null || n.clear());
|
|
522
526
|
}, [e]);
|
|
523
527
|
const on = () => {
|
|
524
528
|
var a;
|
|
@@ -527,7 +531,7 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
527
531
|
const n = v[v.length - 1].messageTime;
|
|
528
532
|
e.fetchMessages({
|
|
529
533
|
endTime: n,
|
|
530
|
-
pageSize:
|
|
534
|
+
pageSize: yt
|
|
531
535
|
}).then((i) => {
|
|
532
536
|
const l = i || [];
|
|
533
537
|
if (!l || !(l != null && l.length)) {
|
|
@@ -545,14 +549,14 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
545
549
|
return;
|
|
546
550
|
P(t);
|
|
547
551
|
}
|
|
548
|
-
}),
|
|
552
|
+
}), Le = () => j(void 0, null, function* () {
|
|
549
553
|
e ? e.fetchData().then((t) => {
|
|
550
554
|
var n;
|
|
551
555
|
(n = e == null ? void 0 : e.data) != null && n.id && (P(t.netOpen), Z(t.enableNetOpen));
|
|
552
556
|
}) : (P(typeof (s == null ? void 0 : s.connectNetwork) == "object" && typeof (s == null ? void 0 : s.connectNetwork.default) == "boolean" ? s.connectNetwork.default : !1), Z(o.arrange[0].enableNetOpen));
|
|
553
557
|
});
|
|
554
558
|
C(() => {
|
|
555
|
-
|
|
559
|
+
Le();
|
|
556
560
|
}, [e]), C(() => {
|
|
557
561
|
requestAnimationFrame(() => {
|
|
558
562
|
var n, a;
|
|
@@ -577,9 +581,9 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
577
581
|
return;
|
|
578
582
|
const t = () => {
|
|
579
583
|
const i = ((N == null ? void 0 : N.promptVariables) || []).filter((l) => l.type ? !(l.type === ye.User && l.key === "query") && !(l.type === ye.System && l.key === "datetime") && l.status === 1 : l.key !== "query" && l.status === 1).map((l, r) => {
|
|
580
|
-
var
|
|
584
|
+
var b, y;
|
|
581
585
|
let d = "";
|
|
582
|
-
return typeof (s == null ? void 0 : s.promptVariables) == "object" && (d = ((y = (
|
|
586
|
+
return typeof (s == null ? void 0 : s.promptVariables) == "object" && (d = ((y = (b = s.promptVariables.default) == null ? void 0 : b.find((F) => F.key === l.key && F.type === l.type)) == null ? void 0 : y.value) || ""), {
|
|
583
587
|
id: r + "",
|
|
584
588
|
key: l.key,
|
|
585
589
|
name: l.name,
|
|
@@ -593,14 +597,14 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
593
597
|
N == null || N.removeEventListener("ready", t);
|
|
594
598
|
};
|
|
595
599
|
}, [e, N, s == null ? void 0 : s.promptVariables]);
|
|
596
|
-
const
|
|
597
|
-
netOpen: E ?
|
|
600
|
+
const Ze = () => L == null ? void 0 : L({
|
|
601
|
+
netOpen: E ? $.OPEN : $.CLOSE
|
|
598
602
|
}).then((t) => {
|
|
599
603
|
var n, a;
|
|
600
|
-
return p == null || p(t), M(!1), P(!!((n = t.data) != null && n.netOpen)), Z(!!((a = t.data) != null && a.enableNetOpen)),
|
|
601
|
-
}),
|
|
604
|
+
return p == null || p(t), M(!1), P(!!((n = t.data) != null && n.netOpen)), Z(!!((a = t.data) != null && a.enableNetOpen)), _e(t), t;
|
|
605
|
+
}), Je = mn(() => {
|
|
602
606
|
var t;
|
|
603
|
-
return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ c(
|
|
607
|
+
return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ c(pt, {
|
|
604
608
|
application: o,
|
|
605
609
|
history: {
|
|
606
610
|
role: 1,
|
|
@@ -610,7 +614,7 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
610
614
|
sessionId: "",
|
|
611
615
|
reference: [],
|
|
612
616
|
searchReference: [],
|
|
613
|
-
messageTime:
|
|
617
|
+
messageTime: vt(Date.now()).format("YYYY-MM-DD HH:mm:ss"),
|
|
614
618
|
actions: [],
|
|
615
619
|
isLoading: !1
|
|
616
620
|
},
|
|
@@ -625,12 +629,12 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
625
629
|
}
|
|
626
630
|
})), /* @__PURE__ */ z("div", {
|
|
627
631
|
className: "agent-chat",
|
|
628
|
-
children: [
|
|
632
|
+
children: [$t ? /* @__PURE__ */ c("div", {
|
|
629
633
|
className: "session-loading",
|
|
630
|
-
children: /* @__PURE__ */ c(
|
|
634
|
+
children: /* @__PURE__ */ c(ut, {})
|
|
631
635
|
}) : /* @__PURE__ */ z(fn, {
|
|
632
636
|
children: [(g == null ? void 0 : g.promptVariables) && /* @__PURE__ */ c(Dn, {
|
|
633
|
-
ref:
|
|
637
|
+
ref: ze,
|
|
634
638
|
appId: o.id,
|
|
635
639
|
currentSession: e,
|
|
636
640
|
promptVariables: O,
|
|
@@ -639,7 +643,7 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
639
643
|
}), /* @__PURE__ */ z("div", {
|
|
640
644
|
className: "chat-main",
|
|
641
645
|
id: "chat-main",
|
|
642
|
-
style:
|
|
646
|
+
style: xt,
|
|
643
647
|
children: [/* @__PURE__ */ c("div", {
|
|
644
648
|
className: "chat-main-wrapper",
|
|
645
649
|
id: "scrollableDiv",
|
|
@@ -651,7 +655,7 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
651
655
|
},
|
|
652
656
|
ref: H,
|
|
653
657
|
onScroll: St,
|
|
654
|
-
children: (
|
|
658
|
+
children: (Se = e == null ? void 0 : e.data) != null && Se.id && (v != null && v.length) ? /* @__PURE__ */ z(jn, {
|
|
655
659
|
dataLength: v.length,
|
|
656
660
|
next: on,
|
|
657
661
|
style: {
|
|
@@ -660,65 +664,65 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
660
664
|
overflowX: "hidden"
|
|
661
665
|
},
|
|
662
666
|
inverse: !0,
|
|
663
|
-
endMessage: v.length >
|
|
664
|
-
((
|
|
667
|
+
endMessage: v.length > yt && // 少于一页不展示这个提示
|
|
668
|
+
((et = H.current) != null && et.scrollTop) && ((tt = H.current) == null ? void 0 : tt.scrollTop) < -10 ? /* @__PURE__ */ c(pn, {
|
|
665
669
|
plain: !0,
|
|
666
670
|
children: "没有更多数据了"
|
|
667
671
|
}) : null,
|
|
668
|
-
hasMore:
|
|
672
|
+
hasMore: $e,
|
|
669
673
|
loader: /* @__PURE__ */ c("div", {
|
|
670
674
|
style: {
|
|
671
675
|
height: "50px",
|
|
672
676
|
textAlign: "center",
|
|
673
677
|
overflow: "hidden"
|
|
674
678
|
},
|
|
675
|
-
children: /* @__PURE__ */ c(
|
|
679
|
+
children: /* @__PURE__ */ c(ut, {})
|
|
676
680
|
}),
|
|
677
681
|
scrollableTarget: "scrollableDiv",
|
|
678
|
-
children: [v.map((t, n) => /* @__PURE__ */ c(
|
|
682
|
+
children: [v.map((t, n) => /* @__PURE__ */ c(Bn, {
|
|
679
683
|
application: o,
|
|
680
684
|
currentSession: e,
|
|
681
685
|
history: t,
|
|
682
|
-
docViewerUrl:
|
|
686
|
+
docViewerUrl: Y,
|
|
683
687
|
isLastHistory: n === 0,
|
|
684
688
|
onRelatedClick: tn,
|
|
685
689
|
onAgainClick: nn,
|
|
686
690
|
onEditClick: en,
|
|
687
691
|
markdown: s == null ? void 0 : s.markdown
|
|
688
|
-
}, t.messageId + n)),
|
|
692
|
+
}, t.messageId + n)), !$e && Je]
|
|
689
693
|
}) : /* @__PURE__ */ z("div", {
|
|
690
694
|
className: "main-empty",
|
|
691
695
|
children: [(s == null ? void 0 : s.greeting) !== !1 && /* @__PURE__ */ c(Pn, {
|
|
692
|
-
text: s === void 0 || s.greeting === !0 || ((
|
|
693
|
-
icon: s === void 0 || s.greeting === !0 || ((
|
|
694
|
-
children: !!
|
|
696
|
+
text: s === void 0 || s.greeting === !0 || ((nt = s.greeting) == null ? void 0 : nt.text) === void 0 ? mt.text : s.greeting.text,
|
|
697
|
+
icon: s === void 0 || s.greeting === !0 || ((it = s.greeting) == null ? void 0 : it.icon) === void 0 ? It || mt.icon : s.greeting.icon,
|
|
698
|
+
children: !!Ue.length && (((s == null ? void 0 : s.greeting) === void 0 || (s == null ? void 0 : s.greeting)) === !0 || typeof (s == null ? void 0 : s.greeting) == "object" && s.greeting.questions !== !1) && /* @__PURE__ */ c(En, {
|
|
695
699
|
ref: xe,
|
|
696
|
-
sid: (
|
|
697
|
-
isRecommendClearing:
|
|
698
|
-
data:
|
|
700
|
+
sid: (ot = e == null ? void 0 : e.data) == null ? void 0 : ot.id,
|
|
701
|
+
isRecommendClearing: Me,
|
|
702
|
+
data: Ue,
|
|
699
703
|
layoutBreakpoints: typeof (s == null ? void 0 : s.greeting) == "object" ? s.greeting.layoutBreakpoints : void 0,
|
|
700
704
|
onItemClick: (t) => {
|
|
701
705
|
var a, i, l;
|
|
702
|
-
if (oe(t == null ? void 0 : t.question), X(t == null ? void 0 : t.question),
|
|
706
|
+
if (oe(t == null ? void 0 : t.question), X(t == null ? void 0 : t.question), Me)
|
|
703
707
|
return;
|
|
704
708
|
t != null && t.id && G(!0);
|
|
705
709
|
const n = (a = e == null ? void 0 : e.data) == null ? void 0 : a.id;
|
|
706
710
|
g != null && g.fileUpload ? (l = (i = ce.current) == null ? void 0 : i.clear()) == null || l.then(() => {
|
|
707
711
|
var r, d;
|
|
708
|
-
t != null && t.id && (n ? (r =
|
|
712
|
+
t != null && t.id && (n ? (r = Xe(n, t)) == null || r.finally(() => {
|
|
709
713
|
G(!1);
|
|
710
|
-
}) : (G(!1), M(!0), (d =
|
|
714
|
+
}) : (G(!1), M(!0), (d = Ze()) == null || d.then((b) => {
|
|
711
715
|
var y;
|
|
712
|
-
(y =
|
|
716
|
+
(y = Xe(b.id, t)) == null || y.finally(() => {
|
|
713
717
|
G(!1);
|
|
714
718
|
});
|
|
715
719
|
})));
|
|
716
|
-
}) : n ? G(!1) : (G(!1), M(!0),
|
|
720
|
+
}) : n ? G(!1) : (G(!1), M(!0), Ze());
|
|
717
721
|
}
|
|
718
722
|
})
|
|
719
|
-
}),
|
|
723
|
+
}), Je]
|
|
720
724
|
})
|
|
721
|
-
}),
|
|
725
|
+
}), Ae && /* @__PURE__ */ c("div", {
|
|
722
726
|
className: "session-stop",
|
|
723
727
|
children: /* @__PURE__ */ c(W, {
|
|
724
728
|
type: "primary",
|
|
@@ -736,7 +740,7 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
736
740
|
onClick: () => Zt(),
|
|
737
741
|
children: "停止回答"
|
|
738
742
|
})
|
|
739
|
-
}),
|
|
743
|
+
}), qe && (v == null ? void 0 : v.length) > 0 && /* @__PURE__ */ c("div", {
|
|
740
744
|
className: "back-bottom",
|
|
741
745
|
children: /* @__PURE__ */ c(W, {
|
|
742
746
|
size: "small",
|
|
@@ -820,14 +824,14 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
820
824
|
}), pe && (g != null && g.fileUpload) && (o != null && o.id) ? /* @__PURE__ */ c(Hn, {
|
|
821
825
|
appId: o == null ? void 0 : o.id,
|
|
822
826
|
ref: ce,
|
|
823
|
-
isFirstSession:
|
|
824
|
-
docViewerUrl:
|
|
827
|
+
isFirstSession: Be,
|
|
828
|
+
docViewerUrl: Y,
|
|
825
829
|
onStatusChange: (t) => j(void 0, null, function* () {
|
|
826
|
-
t !== "process" ? (fe(!0),
|
|
830
|
+
t !== "process" ? (fe(!0), Le()) : fe(!1);
|
|
827
831
|
}),
|
|
828
832
|
createSession: () => new Promise((t) => {
|
|
829
833
|
M(!0), L == null || L({
|
|
830
|
-
netOpen: E ?
|
|
834
|
+
netOpen: E ? $.OPEN : $.CLOSE
|
|
831
835
|
}).then((n) => {
|
|
832
836
|
var i, l, r;
|
|
833
837
|
p == null || p(n), M(!1), P(!!((i = n.data) != null && i.netOpen)), Z(!!((l = n.data) != null && l.enableNetOpen));
|
|
@@ -835,7 +839,7 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
835
839
|
t(a);
|
|
836
840
|
});
|
|
837
841
|
}),
|
|
838
|
-
sid: (
|
|
842
|
+
sid: (st = e == null ? void 0 : e.data) == null ? void 0 : st.id,
|
|
839
843
|
disabled: Ie || R,
|
|
840
844
|
afterFileAdd: (t, n) => {
|
|
841
845
|
n && de((a) => {
|
|
@@ -856,43 +860,43 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
856
860
|
});
|
|
857
861
|
},
|
|
858
862
|
onFileListChange: (t) => {
|
|
859
|
-
|
|
863
|
+
Ut(t);
|
|
860
864
|
},
|
|
861
|
-
shouldContinue:
|
|
865
|
+
shouldContinue: jt,
|
|
862
866
|
afterFilesClear: () => {
|
|
863
867
|
var n;
|
|
864
868
|
const t = (n = e == null ? void 0 : e.data) == null ? void 0 : n.id;
|
|
865
869
|
t && (de({
|
|
866
870
|
[t]: []
|
|
867
|
-
}),
|
|
871
|
+
}), Le());
|
|
868
872
|
}
|
|
869
873
|
}) : null, (g == null ? void 0 : g.prompt) && (o == null ? void 0 : o.id) && /* @__PURE__ */ c(Vn, {
|
|
870
874
|
appId: o.id,
|
|
871
875
|
list: [],
|
|
872
|
-
search:
|
|
876
|
+
search: je ? Ft : "",
|
|
873
877
|
onPromptSelect: (t) => {
|
|
874
878
|
X(t.context), oe(t.context);
|
|
875
879
|
},
|
|
876
880
|
disabled: R
|
|
877
881
|
})]
|
|
878
882
|
}), /* @__PURE__ */ z(he, {
|
|
879
|
-
children: [(g == null ? void 0 : g.connectNetwork) && o.type === 0 && ((
|
|
880
|
-
sessionId: (
|
|
883
|
+
children: [(g == null ? void 0 : g.connectNetwork) && o.type === 0 && ((rt = o.arrange) == null ? void 0 : rt.length) && !!o.arrange[0].enableNetOpen && /* @__PURE__ */ c(zn, {
|
|
884
|
+
sessionId: (at = e == null ? void 0 : e.data) == null ? void 0 : at.id,
|
|
881
885
|
netStatus: E,
|
|
882
|
-
enable: typeof (s == null ? void 0 : s.connectNetwork) == "object" && typeof (s == null ? void 0 : s.connectNetwork.diabled) == "boolean" ? !(s != null && s.connectNetwork.diabled) :
|
|
886
|
+
enable: typeof (s == null ? void 0 : s.connectNetwork) == "object" && typeof (s == null ? void 0 : s.connectNetwork.diabled) == "boolean" ? !(s != null && s.connectNetwork.diabled) : Bt,
|
|
883
887
|
disabledTip: e ? void 0 : "网络访问已被禁用",
|
|
884
888
|
onNetStatusChange: (t) => {
|
|
885
889
|
sn(t);
|
|
886
890
|
}
|
|
887
891
|
}), (g == null ? void 0 : g.sessionList) && /* @__PURE__ */ c(Un, {
|
|
888
|
-
currentSessionId: (
|
|
892
|
+
currentSessionId: (lt = e == null ? void 0 : e.data) == null ? void 0 : lt.id,
|
|
889
893
|
onSessionChange: (t, n) => {
|
|
890
|
-
X(void 0), p == null || p(n);
|
|
894
|
+
X(void 0), Ne(!0), p == null || p(n);
|
|
891
895
|
},
|
|
892
896
|
disabled: R
|
|
893
|
-
}),
|
|
897
|
+
}), Nt && Ct === "float" && /* @__PURE__ */ c("div", {
|
|
894
898
|
className: "session-history-drawer-component",
|
|
895
|
-
children: /* @__PURE__ */ c(
|
|
899
|
+
children: /* @__PURE__ */ c(wn, {
|
|
896
900
|
placement: "topRight",
|
|
897
901
|
showArrow: !1,
|
|
898
902
|
overlayClassName: "session-history-overlay",
|
|
@@ -911,17 +915,17 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
911
915
|
fontSize: 24
|
|
912
916
|
}
|
|
913
917
|
}),
|
|
914
|
-
onClick: () =>
|
|
918
|
+
onClick: () => We(!0)
|
|
915
919
|
})
|
|
916
920
|
})
|
|
917
921
|
}), (g == null ? void 0 : g.sessionOpen) && /* @__PURE__ */ c(W, {
|
|
918
922
|
icon: /* @__PURE__ */ c(On, {}),
|
|
919
923
|
className: "add-btn",
|
|
920
924
|
type: "primary",
|
|
921
|
-
disabled:
|
|
925
|
+
disabled: Ae || !e || !v.length || R,
|
|
922
926
|
onClick: () => {
|
|
923
927
|
var t, n;
|
|
924
|
-
p == null || p(null), P(!1), (t =
|
|
928
|
+
p == null || p(null), P(!1), (t = ze.current) == null || t.clear(), (n = xe.current) == null || n.clear();
|
|
925
929
|
},
|
|
926
930
|
children: "新会话"
|
|
927
931
|
})]
|
|
@@ -930,16 +934,16 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
930
934
|
className: "footer-textarea",
|
|
931
935
|
children: /* @__PURE__ */ c(Ln, {
|
|
932
936
|
ref: ae,
|
|
933
|
-
maxLength:
|
|
934
|
-
text:
|
|
937
|
+
maxLength: Lt,
|
|
938
|
+
text: Ht,
|
|
935
939
|
networkStatus: !1,
|
|
936
|
-
loading:
|
|
937
|
-
disabled:
|
|
938
|
-
onTextSend:
|
|
940
|
+
loading: Ye,
|
|
941
|
+
disabled: He || De || R || Ye,
|
|
942
|
+
onTextSend: Qe,
|
|
939
943
|
onChange: (t, n) => {
|
|
940
944
|
X(t);
|
|
941
945
|
const a = n.getText().replace(/[\n\s]+$/, "");
|
|
942
|
-
oe(a),
|
|
946
|
+
oe(a), Ot(a), je || Tt(!0);
|
|
943
947
|
},
|
|
944
948
|
clearAction: /* @__PURE__ */ c(he, {
|
|
945
949
|
size: 0,
|
|
@@ -960,28 +964,29 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
960
964
|
})]
|
|
961
965
|
})
|
|
962
966
|
}), /* @__PURE__ */ c(Tn, {
|
|
963
|
-
tips:
|
|
964
|
-
}),
|
|
965
|
-
isvisible:
|
|
966
|
-
files:
|
|
967
|
-
sessionId: (
|
|
967
|
+
tips: bt
|
|
968
|
+
}), Ve && /* @__PURE__ */ c(Rn, {
|
|
969
|
+
isvisible: Ve,
|
|
970
|
+
files: Dt,
|
|
971
|
+
sessionId: (dt = e == null ? void 0 : e.data) == null ? void 0 : dt.id,
|
|
968
972
|
onClose: (t) => {
|
|
969
|
-
|
|
973
|
+
Rt(!1), zt(!1);
|
|
970
974
|
}
|
|
971
975
|
})]
|
|
972
|
-
}),
|
|
976
|
+
}), Ke && /* @__PURE__ */ c(Mn, {
|
|
973
977
|
currentSession: e,
|
|
974
978
|
application: o,
|
|
975
979
|
networkStatus: E,
|
|
976
980
|
setCurrentSession: p,
|
|
977
|
-
sessions: vt,
|
|
978
|
-
setSessions: kt,
|
|
979
981
|
disabled: R,
|
|
980
|
-
isSessionHistoryVisible:
|
|
981
|
-
setIsSessionHistoryVisible:
|
|
982
|
+
isSessionHistoryVisible: Ke,
|
|
983
|
+
setIsSessionHistoryVisible: We,
|
|
984
|
+
onSessionChange: (t) => {
|
|
985
|
+
Ne(!0);
|
|
986
|
+
}
|
|
982
987
|
})]
|
|
983
988
|
});
|
|
984
989
|
});
|
|
985
990
|
export {
|
|
986
|
-
|
|
991
|
+
wi as default
|
|
987
992
|
};
|