@glodon-aiot/agent-cli-ui 3.3.4-beta.1 → 3.3.4-beta.3
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/Dialog/AgentChat/index.mjs +101 -101
- package/dist/es/ReactTextGenerationUI/components/TextSiders/index.mjs +13 -13
- 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/style11.css +1 -1
- package/dist/es/src/style13.css +1 -1
- package/dist/es/src/style14.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/style18.css +1 -1
- package/dist/es/src/style20.css +1 -1
- package/dist/es/src/style23.css +1 -1
- package/dist/es/src/style27.css +1 -1
- package/dist/lib/index.js +43 -43
- package/package.json +3 -3
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
var Wt = Object.defineProperty, Qt = Object.defineProperties;
|
|
2
2
|
var _t = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var
|
|
3
|
+
var ot = Object.getOwnPropertySymbols;
|
|
4
4
|
var Gt = Object.prototype.hasOwnProperty, Xt = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var Ie = (L, o, v) => o in L ? Wt(L, o, { enumerable: !0, configurable: !0, writable: !0, value: v }) : L[o] = v,
|
|
5
|
+
var Ie = (L, o, v) => o in L ? Wt(L, o, { enumerable: !0, configurable: !0, writable: !0, value: v }) : L[o] = v, st = (L, o) => {
|
|
6
6
|
for (var v in o || (o = {}))
|
|
7
7
|
Gt.call(o, v) && Ie(L, v, o[v]);
|
|
8
|
-
if (
|
|
9
|
-
for (var v of
|
|
8
|
+
if (ot)
|
|
9
|
+
for (var v of ot(o))
|
|
10
10
|
Xt.call(o, v) && Ie(L, v, o[v]);
|
|
11
11
|
return L;
|
|
12
|
-
},
|
|
12
|
+
}, rt = (L, o) => Qt(L, _t(o));
|
|
13
13
|
var D = (L, o, v) => (Ie(L, typeof o != "symbol" ? o + "" : o, v), v);
|
|
14
14
|
var z = (L, o, v) => new Promise((e, w) => {
|
|
15
15
|
var ue = (x) => {
|
|
@@ -31,10 +31,10 @@ import { jsx as c, jsxs as A } from "react/jsx-runtime";
|
|
|
31
31
|
import { memo as Zt, useState as m, useRef as B, useContext as Jt, useEffect as F, useMemo as St } from "react";
|
|
32
32
|
/* empty css */import { Divider as en, Spin as tn, Button as _, Space as de, Upload as nn, Tooltip as on, notification as ce, message as u } from "antd";
|
|
33
33
|
import fe from "../../components/Iconfont/index.mjs";
|
|
34
|
-
import { IHistoryRole as G, ChatMessageRole as
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import { v4 as
|
|
34
|
+
import { IHistoryRole as G, ChatMessageRole as at, PromptVariableType as ge } from "@glodon-aiot/apis";
|
|
35
|
+
import ct from "./HistoryItem/index.mjs";
|
|
36
|
+
import ft from "dayjs";
|
|
37
|
+
import { v4 as Ce } from "uuid";
|
|
38
38
|
import sn from "../../context.mjs";
|
|
39
39
|
import { configuration as rn } from "@glodon-aiot/bot-client-sdk";
|
|
40
40
|
import { MB as an } from "../../constant.mjs";
|
|
@@ -54,7 +54,7 @@ import kn from "react-infinite-scroll-component";
|
|
|
54
54
|
import wn from "./Tools/ConnectToNetwork/index.mjs";
|
|
55
55
|
import xn from "./Tools/PromptManager/index.mjs";
|
|
56
56
|
import In from "../../assets/icon.svg.mjs";
|
|
57
|
-
const Ln = Zt(
|
|
57
|
+
const Ln = Zt(ct), lt = {
|
|
58
58
|
icon: In,
|
|
59
59
|
text: "今天我能帮你什么?"
|
|
60
60
|
};
|
|
@@ -69,13 +69,13 @@ class S {
|
|
|
69
69
|
D(this, "isSensitive");
|
|
70
70
|
D(this, "isSuspend");
|
|
71
71
|
D(this, "comment");
|
|
72
|
-
this.content = o, this.sessionId = v, this.role = e, this.files = w, this.content = o, this.role = e, this.sessionId = v, this.files = w, this.messageTime =
|
|
72
|
+
this.content = o, this.sessionId = v, this.role = e, this.files = w, this.content = o, this.role = e, this.sessionId = v, this.files = w, this.messageTime = ft(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"), this.isWaiting = !1, this.messageId = Ce(), this.isContext = !1, this.actions = [], this.reference = [], this.isSensitive = !1, this.isSuspend = !1, this.comment = {
|
|
73
73
|
isAgree: 0
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
const
|
|
78
|
-
var
|
|
77
|
+
const dt = 10, ei = (L) => {
|
|
78
|
+
var Qe, _e, Ge, Xe, Ze, Je, Se, et, tt, nt, it;
|
|
79
79
|
const {
|
|
80
80
|
application: o,
|
|
81
81
|
docViewerUrl: v = "",
|
|
@@ -85,22 +85,22 @@ const at = 10, ei = (L) => {
|
|
|
85
85
|
setCurrentSession: k,
|
|
86
86
|
networkStatus: H,
|
|
87
87
|
setNetworkStatus: x
|
|
88
|
-
} = L, [h, C] = m([]), [
|
|
88
|
+
} = L, [h, C] = m([]), [gt, ee] = m(), [he, Ne] = m(), R = B(null), {
|
|
89
89
|
service: P,
|
|
90
90
|
agentClient: N,
|
|
91
|
-
depId:
|
|
92
|
-
footer:
|
|
91
|
+
depId: ut,
|
|
92
|
+
footer: ht,
|
|
93
93
|
transform: g,
|
|
94
94
|
defaultInput: me,
|
|
95
95
|
onMessage: te,
|
|
96
|
-
onHistoryLoad:
|
|
96
|
+
onHistoryLoad: Pe,
|
|
97
97
|
beforeMessageSend: j,
|
|
98
|
-
bodyStyle:
|
|
98
|
+
bodyStyle: mt,
|
|
99
99
|
disabled: M,
|
|
100
100
|
features: a,
|
|
101
101
|
popupContainer: f,
|
|
102
|
-
icon:
|
|
103
|
-
} = Jt(sn), [
|
|
102
|
+
icon: yt
|
|
103
|
+
} = Jt(sn), [Te, ye] = m(!1), y = B(h), Fe = B(), [pt, vt] = m(0), [X, q] = m(), [Y, ne] = m(""), [Ee, pe] = m(!1), ve = B(null), [Re, bt] = m([]), [De, K] = m(!1), [He, kt] = m(!1), [wt, xt] = m(""), [It, W] = m(), [ie, oe] = m({}), se = B(null), Me = B(null), be = B(null), [Oe, Lt] = m(!1), [Ct, Nt] = m([]), [Pt, re] = m(!0), [Tt, Ft] = m(!0), [Ue, O] = m(!1), [ke, V] = m(!1), [ze, Et] = m(!1), [E, ae] = m(typeof (a == null ? void 0 : a.promptVariables) == "object" ? a.promptVariables.default || [] : []), [Rt, Dt] = m(typeof (a == null ? void 0 : a.knowledges) == "object" && a.knowledges.default || void 0), [je, U] = m(!1), [Ve, Z] = m(!1), [Ht, Q] = m(typeof (a == null ? void 0 : a.connectNetwork) == "object" && typeof (a == null ? void 0 : a.connectNetwork.default) == "boolean" ? a.connectNetwork.default : !1), [$e, le] = m(!1);
|
|
104
104
|
F(() => {
|
|
105
105
|
var r, i;
|
|
106
106
|
e && (y.current = []), C([]);
|
|
@@ -115,7 +115,7 @@ const at = 10, ei = (L) => {
|
|
|
115
115
|
}
|
|
116
116
|
const n = (l) => {
|
|
117
117
|
var s;
|
|
118
|
-
(s = e == null ? void 0 : e.data) != null && s.id && (y.current = [...l].reverse(), C([...l].reverse()), !l || l.length < 10 ? Z(!1) : Z(!0),
|
|
118
|
+
(s = e == null ? void 0 : e.data) != null && s.id && (y.current = [...l].reverse(), C([...l].reverse()), !l || l.length < 10 ? Z(!1) : Z(!0), Pe && Pe({
|
|
119
119
|
applicationId: o.id,
|
|
120
120
|
sessionId: e.data.id,
|
|
121
121
|
histories: l
|
|
@@ -127,7 +127,7 @@ const at = 10, ei = (L) => {
|
|
|
127
127
|
}, [e]), F(() => {
|
|
128
128
|
const t = () => {
|
|
129
129
|
var n;
|
|
130
|
-
(n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables && ae(e.promptVariables.sort((r, i) => r.key.localeCompare(i.key))), e.knowledges &&
|
|
130
|
+
(n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables && ae(e.promptVariables.sort((r, i) => r.key.localeCompare(i.key))), e.knowledges && Dt(e.knowledges), x(e.netOpen));
|
|
131
131
|
};
|
|
132
132
|
return e == null || e.addEventListener("data:updated", t), () => {
|
|
133
133
|
e == null || e.removeEventListener("data:updated", t);
|
|
@@ -150,7 +150,7 @@ const at = 10, ei = (L) => {
|
|
|
150
150
|
e == null || e.removeEventListener("error", t);
|
|
151
151
|
};
|
|
152
152
|
}, [e]);
|
|
153
|
-
const
|
|
153
|
+
const Mt = () => {
|
|
154
154
|
var r;
|
|
155
155
|
if (!((r = e == null ? void 0 : e.data) != null && r.id) || !(o != null && o.id))
|
|
156
156
|
return;
|
|
@@ -170,10 +170,10 @@ const at = 10, ei = (L) => {
|
|
|
170
170
|
};
|
|
171
171
|
F(() => {
|
|
172
172
|
o != null && o.id && (P == null || P.getRecommendQues(o.id).then((t) => {
|
|
173
|
-
|
|
173
|
+
bt(t);
|
|
174
174
|
}));
|
|
175
|
-
}, [
|
|
176
|
-
const
|
|
175
|
+
}, [ut, o]);
|
|
176
|
+
const Ae = (t) => z(void 0, null, function* () {
|
|
177
177
|
var p, T;
|
|
178
178
|
if (M) {
|
|
179
179
|
u.config({
|
|
@@ -183,7 +183,7 @@ const at = 10, ei = (L) => {
|
|
|
183
183
|
});
|
|
184
184
|
return;
|
|
185
185
|
}
|
|
186
|
-
const n = t ||
|
|
186
|
+
const n = t || gt;
|
|
187
187
|
if (!(n != null && n.trim())) {
|
|
188
188
|
u.config({
|
|
189
189
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
@@ -210,7 +210,7 @@ const at = 10, ei = (L) => {
|
|
|
210
210
|
});
|
|
211
211
|
return;
|
|
212
212
|
}
|
|
213
|
-
if (
|
|
213
|
+
if (Te) {
|
|
214
214
|
u.config({
|
|
215
215
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
216
216
|
}), u.error("等待初始化"), u.config({
|
|
@@ -218,7 +218,7 @@ const at = 10, ei = (L) => {
|
|
|
218
218
|
});
|
|
219
219
|
return;
|
|
220
220
|
}
|
|
221
|
-
if (!
|
|
221
|
+
if (!Pt) {
|
|
222
222
|
u.config({
|
|
223
223
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
224
224
|
}), u.error("正在解析文件"), u.config({
|
|
@@ -226,7 +226,7 @@ const at = 10, ei = (L) => {
|
|
|
226
226
|
});
|
|
227
227
|
return;
|
|
228
228
|
}
|
|
229
|
-
if (
|
|
229
|
+
if (Ee) {
|
|
230
230
|
u.config({
|
|
231
231
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
232
232
|
}), u.error("正在上传图片"), u.config({
|
|
@@ -241,8 +241,8 @@ const at = 10, ei = (L) => {
|
|
|
241
241
|
netOpen: H ? 1 : 2
|
|
242
242
|
}).then((b) => {
|
|
243
243
|
var $, J;
|
|
244
|
-
U(!0), x(!!(($ = b.data) != null && $.netOpen)), Q(!!((J = b.data) != null && J.enableNetOpen)),
|
|
245
|
-
k == null || k(b), U(!1),
|
|
244
|
+
U(!0), x(!!(($ = b.data) != null && $.netOpen)), Q(!!((J = b.data) != null && J.enableNetOpen)), Be(b).then(() => {
|
|
245
|
+
k == null || k(b), U(!1), Ne(n);
|
|
246
246
|
});
|
|
247
247
|
});
|
|
248
248
|
return;
|
|
@@ -258,7 +258,7 @@ ${n}` : n;
|
|
|
258
258
|
message: {
|
|
259
259
|
content: l,
|
|
260
260
|
sessionId: i,
|
|
261
|
-
role:
|
|
261
|
+
role: at.User,
|
|
262
262
|
files: ie[i]
|
|
263
263
|
}
|
|
264
264
|
}) : s = !0;
|
|
@@ -269,7 +269,7 @@ ${n}` : n;
|
|
|
269
269
|
return;
|
|
270
270
|
let d = n;
|
|
271
271
|
typeof s == "object" && (d = s.content || n), (yield e.setPromptVariables(E)) && (((T = ie[i]) == null ? void 0 : T.length) > 0 ? Ot(d) : we(d));
|
|
272
|
-
}),
|
|
272
|
+
}), Be = (t) => new Promise((n, r) => z(void 0, null, function* () {
|
|
273
273
|
const s = (t == null ? void 0 : t.promptVariables).filter((d) => !(d.type === ge.User && d.key === "query") && !(d.type === ge.System && d.key === "datetime")).map((d) => {
|
|
274
274
|
var p;
|
|
275
275
|
const I = (p = E.find((T) => T.key === d.key && T.type === d.type)) == null ? void 0 : p.value;
|
|
@@ -315,14 +315,14 @@ ${t}` : t;
|
|
|
315
315
|
message: {
|
|
316
316
|
content: r,
|
|
317
317
|
sessionId: e.id,
|
|
318
|
-
role:
|
|
318
|
+
role: at.User,
|
|
319
319
|
files: ie[e.id]
|
|
320
320
|
}
|
|
321
321
|
}) : i = !0;
|
|
322
322
|
} catch (l) {
|
|
323
323
|
i = !1;
|
|
324
324
|
}
|
|
325
|
-
le(!1), i !== !1 && (we(t),
|
|
325
|
+
le(!1), i !== !1 && (we(t), Ne(void 0));
|
|
326
326
|
});
|
|
327
327
|
return e.ready ? n() : e.addEventListener("ready", n, !0), () => {
|
|
328
328
|
e == null || e.removeEventListener("ready", n);
|
|
@@ -352,7 +352,7 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
352
352
|
I.formatValues = b;
|
|
353
353
|
}
|
|
354
354
|
if (g != null && g.knowledges) {
|
|
355
|
-
const b =
|
|
355
|
+
const b = Rt;
|
|
356
356
|
I.knowledges = b;
|
|
357
357
|
}
|
|
358
358
|
yield e.send({
|
|
@@ -368,14 +368,14 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
368
368
|
if (!t)
|
|
369
369
|
return;
|
|
370
370
|
const n = (i) => {
|
|
371
|
-
if (!i.sessionId || i.sessionId && i.sessionId !==
|
|
371
|
+
if (!i.sessionId || i.sessionId && i.sessionId !== Fe.current || i.role === G.User)
|
|
372
372
|
return;
|
|
373
373
|
if (i.index === -1 && i.code !== 200 && i.code !== 11915 && (O(!1), V(!1), y.current = y.current.filter((d) => !d.isWaiting), C([...y.current]), y.current = [...y.current], i.content))
|
|
374
374
|
return ce.error({
|
|
375
375
|
message: i.content
|
|
376
376
|
});
|
|
377
377
|
const l = i.actions || [], s = new S(i.content, t, G.Robot);
|
|
378
|
-
s.messageId = i.messageId, s.reasoningContent = i.reasoningContent, s.searchReference = i.searchReference, s.thinkingSecs = i.thinkingSecs, s.thinkingStatus = i.thinkingStatus, s.actions = l, s.isLoading = !0, s.searchingStatus = i.searchingStatus, y.current = y.current.filter((d) => !d.isWaiting).filter((d) => !d.isReplying), i.index === void 0 && C([s, ...y.current]), i.code === 11915 && (O(!1), V(!1), s.isLoading = !1, s.content = "请您换个问题问我吧~", s.isSensitive = !0, C([s, ...y.current])), i.index === -2 && (O(!1), V(!1), s.isLoading = !1, s.content = "回答已中止~", s.isSuspend = !0, C([s, ...y.current])), i.index === -1 && (O(!1), V(!1), s.isLoading = !1, s.reference = i.reference, C([s, ...y.current]), o.id && te && te({
|
|
378
|
+
s.messageId = i.messageId || Ce(), s.reasoningContent = i.reasoningContent, s.searchReference = i.searchReference, s.thinkingSecs = i.thinkingSecs, s.thinkingStatus = i.thinkingStatus, s.actions = l, s.isLoading = !0, s.searchingStatus = i.searchingStatus, y.current = y.current.filter((d) => !d.isWaiting).filter((d) => !d.isReplying), i.index === void 0 && C([s, ...y.current]), i.code === 11915 && (O(!1), V(!1), s.isLoading = !1, s.content = "请您换个问题问我吧~", s.isSensitive = !0, C([s, ...y.current])), i.index === -2 && (O(!1), V(!1), s.isLoading = !1, s.content = "回答已中止~", s.isSuspend = !0, C([s, ...y.current])), i.index === -1 && (O(!1), V(!1), s.isLoading = !1, s.reference = i.reference, C([s, ...y.current]), o.id && te && te({
|
|
379
379
|
applicationId: o.id,
|
|
380
380
|
sessionId: t,
|
|
381
381
|
message: s
|
|
@@ -401,7 +401,7 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
401
401
|
if (!N)
|
|
402
402
|
return;
|
|
403
403
|
const t = N.questionContextMaxLength || 4e3;
|
|
404
|
-
|
|
404
|
+
vt(t);
|
|
405
405
|
}, [N, P]), F(() => {
|
|
406
406
|
me && W(me.text);
|
|
407
407
|
}, [me]);
|
|
@@ -418,20 +418,20 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
418
418
|
}), !1) : (q(t), !1);
|
|
419
419
|
}, zt = (t) => z(void 0, null, function* () {
|
|
420
420
|
var n;
|
|
421
|
-
return q(t), (n = e == null ? void 0 : e.data) != null && n.id ?
|
|
421
|
+
return q(t), (n = e == null ? void 0 : e.data) != null && n.id ? qe(e, t) : new Promise((r) => {
|
|
422
422
|
U(!0), w == null || w({
|
|
423
423
|
netOpen: H ? 1 : 2
|
|
424
424
|
}).then((i) => {
|
|
425
425
|
var l, s;
|
|
426
|
-
k == null || k(i), U(!1), x(!!((l = i.data) != null && l.netOpen)), Q(!!((s = i.data) != null && s.enableNetOpen)), r(
|
|
426
|
+
k == null || k(i), U(!1), x(!!((l = i.data) != null && l.netOpen)), Q(!!((s = i.data) != null && s.enableNetOpen)), r(qe(i, t));
|
|
427
427
|
});
|
|
428
428
|
});
|
|
429
|
-
}),
|
|
429
|
+
}), qe = (t, n) => {
|
|
430
430
|
const r = dn(n.name);
|
|
431
431
|
return new Promise((i) => {
|
|
432
432
|
var s;
|
|
433
433
|
const l = {
|
|
434
|
-
files: [`${
|
|
434
|
+
files: [`${Ce()}.${r}`],
|
|
435
435
|
isv: "minio",
|
|
436
436
|
knowledgeId: ((s = t.data) == null ? void 0 : s.id) || "",
|
|
437
437
|
type: 1
|
|
@@ -453,14 +453,14 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
453
453
|
};
|
|
454
454
|
F(() => {
|
|
455
455
|
const t = R.current;
|
|
456
|
-
t && !
|
|
456
|
+
t && !ze && t.scrollTo({
|
|
457
457
|
top: t.scrollHeight
|
|
458
458
|
});
|
|
459
459
|
}, [h]);
|
|
460
|
-
const
|
|
460
|
+
const Ye = (t, n) => new Promise((r) => {
|
|
461
461
|
if (!n.file.url || !(o != null && o.id))
|
|
462
462
|
return r();
|
|
463
|
-
const i =
|
|
463
|
+
const i = rt(st({}, n.file), {
|
|
464
464
|
type: 1
|
|
465
465
|
});
|
|
466
466
|
P == null || P.postApplicationIdSessionKnowledgeSessionFile(o == null ? void 0 : o.id, t, i).finally(() => {
|
|
@@ -482,12 +482,12 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
482
482
|
if (!R.current)
|
|
483
483
|
return;
|
|
484
484
|
const t = R.current.scrollTop <= -80;
|
|
485
|
-
|
|
485
|
+
Et(t);
|
|
486
486
|
}, At = Le((t) => {
|
|
487
487
|
var n, r;
|
|
488
488
|
(n = ve.current) == null || n.update(t), (r = ve.current) == null || r.focus();
|
|
489
489
|
}), Bt = Le((t) => {
|
|
490
|
-
|
|
490
|
+
Ae(t);
|
|
491
491
|
}), qt = Le(() => {
|
|
492
492
|
var n;
|
|
493
493
|
if (!((n = e == null ? void 0 : e.data) != null && n.id))
|
|
@@ -498,7 +498,7 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
498
498
|
});
|
|
499
499
|
F(() => {
|
|
500
500
|
var t, n;
|
|
501
|
-
|
|
501
|
+
Fe.current = (t = e == null ? void 0 : e.data) == null ? void 0 : t.id, !je && ((n = be.current) == null || n.clear());
|
|
502
502
|
}, [e]);
|
|
503
503
|
const Yt = () => {
|
|
504
504
|
var r;
|
|
@@ -507,7 +507,7 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
507
507
|
const n = h[h.length - 1].messageTime;
|
|
508
508
|
e.fetchMessages({
|
|
509
509
|
endTime: n,
|
|
510
|
-
pageSize:
|
|
510
|
+
pageSize: dt
|
|
511
511
|
}).then((i) => {
|
|
512
512
|
const l = i || [];
|
|
513
513
|
if (!l || !(l != null && l.length)) {
|
|
@@ -574,14 +574,14 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
574
574
|
N == null || N.removeEventListener("ready", t);
|
|
575
575
|
};
|
|
576
576
|
}, [e, N, a == null ? void 0 : a.promptVariables]);
|
|
577
|
-
const
|
|
577
|
+
const Ke = () => w == null ? void 0 : w({
|
|
578
578
|
netOpen: H ? 1 : 2
|
|
579
579
|
}).then((t) => {
|
|
580
580
|
var n, r;
|
|
581
|
-
return k == null || k(t), U(!1), x(!!((n = t.data) != null && n.netOpen)), Q(!!((r = t.data) != null && r.enableNetOpen)), t;
|
|
582
|
-
}),
|
|
581
|
+
return k == null || k(t), U(!1), x(!!((n = t.data) != null && n.netOpen)), Q(!!((r = t.data) != null && r.enableNetOpen)), Be(t), t;
|
|
582
|
+
}), We = St(() => {
|
|
583
583
|
var t;
|
|
584
|
-
return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ c(
|
|
584
|
+
return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ c(ct, {
|
|
585
585
|
application: o,
|
|
586
586
|
history: {
|
|
587
587
|
role: 1,
|
|
@@ -591,7 +591,7 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
591
591
|
sessionId: "",
|
|
592
592
|
reference: [],
|
|
593
593
|
searchReference: [],
|
|
594
|
-
messageTime:
|
|
594
|
+
messageTime: ft(Date.now()).format("YYYY-MM-DD HH:mm:ss"),
|
|
595
595
|
actions: [],
|
|
596
596
|
isLoading: !1
|
|
597
597
|
},
|
|
@@ -602,7 +602,7 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
602
602
|
return /* @__PURE__ */ A("div", {
|
|
603
603
|
className: "agent-chat",
|
|
604
604
|
children: [(g == null ? void 0 : g.promptVariables) && /* @__PURE__ */ c(vn, {
|
|
605
|
-
ref:
|
|
605
|
+
ref: Me,
|
|
606
606
|
appId: o.id,
|
|
607
607
|
currentSession: e,
|
|
608
608
|
promptVariables: E,
|
|
@@ -611,7 +611,7 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
611
611
|
}), /* @__PURE__ */ A("div", {
|
|
612
612
|
className: "chat-main",
|
|
613
613
|
id: "chat-main",
|
|
614
|
-
style:
|
|
614
|
+
style: mt,
|
|
615
615
|
children: [/* @__PURE__ */ c("div", {
|
|
616
616
|
className: "chat-main-wrapper",
|
|
617
617
|
id: "scrollableDiv",
|
|
@@ -623,7 +623,7 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
623
623
|
},
|
|
624
624
|
ref: R,
|
|
625
625
|
onScroll: $t,
|
|
626
|
-
children: (
|
|
626
|
+
children: (Qe = e == null ? void 0 : e.data) != null && Qe.id && (h != null && h.length) ? /* @__PURE__ */ A(kn, {
|
|
627
627
|
dataLength: h.length,
|
|
628
628
|
next: Yt,
|
|
629
629
|
style: {
|
|
@@ -632,12 +632,12 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
632
632
|
overflowX: "hidden"
|
|
633
633
|
},
|
|
634
634
|
inverse: !0,
|
|
635
|
-
endMessage: h.length >
|
|
636
|
-
((
|
|
635
|
+
endMessage: h.length > dt && // 少于一页不展示这个提示
|
|
636
|
+
((_e = R.current) != null && _e.scrollTop) && ((Ge = R.current) == null ? void 0 : Ge.scrollTop) < -10 ? /* @__PURE__ */ c(en, {
|
|
637
637
|
plain: !0,
|
|
638
638
|
children: "没有更多数据了"
|
|
639
639
|
}) : null,
|
|
640
|
-
hasMore:
|
|
640
|
+
hasMore: Ve,
|
|
641
641
|
loader: /* @__PURE__ */ c("div", {
|
|
642
642
|
style: {
|
|
643
643
|
height: "50px",
|
|
@@ -657,39 +657,39 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
657
657
|
onAgainClick: qt,
|
|
658
658
|
onEditClick: At,
|
|
659
659
|
markdown: a == null ? void 0 : a.markdown
|
|
660
|
-
}, t.messageId + n)), !
|
|
660
|
+
}, t.messageId + n)), !Ve && We]
|
|
661
661
|
}) : /* @__PURE__ */ A("div", {
|
|
662
662
|
className: "main-empty",
|
|
663
663
|
children: [(a == null ? void 0 : a.greeting) !== !1 && /* @__PURE__ */ c(gn, {
|
|
664
|
-
text: a === void 0 || a.greeting === !0 || ((
|
|
665
|
-
icon: a === void 0 || a.greeting === !0 || ((
|
|
666
|
-
children: !!
|
|
664
|
+
text: a === void 0 || a.greeting === !0 || ((Xe = a.greeting) == null ? void 0 : Xe.text) === void 0 ? lt.text : a.greeting.text,
|
|
665
|
+
icon: a === void 0 || a.greeting === !0 || ((Ze = a.greeting) == null ? void 0 : Ze.icon) === void 0 ? yt || lt.icon : a.greeting.icon,
|
|
666
|
+
children: !!Re.length && (((a == null ? void 0 : a.greeting) === void 0 || (a == null ? void 0 : a.greeting)) === !0 || typeof (a == null ? void 0 : a.greeting) == "object" && a.greeting.questions !== !1) && /* @__PURE__ */ c(fn, {
|
|
667
667
|
ref: be,
|
|
668
|
-
sid: (
|
|
669
|
-
isRecommendClearing:
|
|
670
|
-
data:
|
|
668
|
+
sid: (Je = e == null ? void 0 : e.data) == null ? void 0 : Je.id,
|
|
669
|
+
isRecommendClearing: De,
|
|
670
|
+
data: Re,
|
|
671
671
|
onItemClick: (t) => {
|
|
672
672
|
var r, i, l;
|
|
673
|
-
if (ee(t == null ? void 0 : t.question), W(t == null ? void 0 : t.question),
|
|
673
|
+
if (ee(t == null ? void 0 : t.question), W(t == null ? void 0 : t.question), De)
|
|
674
674
|
return;
|
|
675
675
|
t != null && t.id && K(!0);
|
|
676
676
|
const n = (r = e == null ? void 0 : e.data) == null ? void 0 : r.id;
|
|
677
677
|
g != null && g.fileUpload ? (l = (i = se.current) == null ? void 0 : i.clear()) == null || l.then(() => {
|
|
678
678
|
var s, d;
|
|
679
|
-
t != null && t.id && (n ? (s =
|
|
679
|
+
t != null && t.id && (n ? (s = Ye(n, t)) == null || s.finally(() => {
|
|
680
680
|
K(!1);
|
|
681
|
-
}) : (K(!1), U(!0), (d =
|
|
681
|
+
}) : (K(!1), U(!0), (d = Ke()) == null || d.then((I) => {
|
|
682
682
|
var p;
|
|
683
|
-
(p =
|
|
683
|
+
(p = Ye(I.id, t)) == null || p.finally(() => {
|
|
684
684
|
K(!1);
|
|
685
685
|
});
|
|
686
686
|
})));
|
|
687
|
-
}) : n ? K(!1) : (K(!1), U(!0),
|
|
687
|
+
}) : n ? K(!1) : (K(!1), U(!0), Ke());
|
|
688
688
|
}
|
|
689
689
|
})
|
|
690
|
-
}),
|
|
690
|
+
}), We]
|
|
691
691
|
})
|
|
692
|
-
}),
|
|
692
|
+
}), Ue && /* @__PURE__ */ c("div", {
|
|
693
693
|
className: "session-stop",
|
|
694
694
|
children: /* @__PURE__ */ c(_, {
|
|
695
695
|
type: "primary",
|
|
@@ -707,7 +707,7 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
707
707
|
onClick: () => jt(),
|
|
708
708
|
children: "停止回答"
|
|
709
709
|
})
|
|
710
|
-
}),
|
|
710
|
+
}), ze && (h == null ? void 0 : h.length) > 0 && /* @__PURE__ */ c("div", {
|
|
711
711
|
className: "back-bottom",
|
|
712
712
|
children: /* @__PURE__ */ c(_, {
|
|
713
713
|
size: "small",
|
|
@@ -791,7 +791,7 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
791
791
|
}), ue && (g != null && g.fileUpload) && (o != null && o.id) ? /* @__PURE__ */ c(yn, {
|
|
792
792
|
appId: o == null ? void 0 : o.id,
|
|
793
793
|
ref: se,
|
|
794
|
-
isFirstSession:
|
|
794
|
+
isFirstSession: je,
|
|
795
795
|
docViewerUrl: v,
|
|
796
796
|
onStatusChange: (t) => z(void 0, null, function* () {
|
|
797
797
|
t !== "process" ? (re(!0), xe()) : re(!1);
|
|
@@ -806,7 +806,7 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
806
806
|
t(r);
|
|
807
807
|
});
|
|
808
808
|
}),
|
|
809
|
-
sid: (
|
|
809
|
+
sid: (Se = e == null ? void 0 : e.data) == null ? void 0 : Se.id,
|
|
810
810
|
disabled: ke || M,
|
|
811
811
|
afterFileAdd: (t, n) => {
|
|
812
812
|
n && oe((r) => {
|
|
@@ -827,9 +827,9 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
827
827
|
});
|
|
828
828
|
},
|
|
829
829
|
onFileListChange: (t) => {
|
|
830
|
-
|
|
830
|
+
Nt(t);
|
|
831
831
|
},
|
|
832
|
-
shouldContinue:
|
|
832
|
+
shouldContinue: Tt,
|
|
833
833
|
afterFilesClear: () => {
|
|
834
834
|
var n;
|
|
835
835
|
const t = (n = e == null ? void 0 : e.data) == null ? void 0 : n.id;
|
|
@@ -840,23 +840,23 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
840
840
|
}) : null, (g == null ? void 0 : g.prompt) && (o == null ? void 0 : o.id) && /* @__PURE__ */ c(xn, {
|
|
841
841
|
appId: o.id,
|
|
842
842
|
list: [],
|
|
843
|
-
search:
|
|
843
|
+
search: He ? wt : "",
|
|
844
844
|
onPromptSelect: (t) => {
|
|
845
845
|
W(t.context), ee(t.context);
|
|
846
846
|
},
|
|
847
847
|
disabled: M
|
|
848
848
|
})]
|
|
849
849
|
}), /* @__PURE__ */ A(de, {
|
|
850
|
-
children: [(g == null ? void 0 : g.connectNetwork) && o.type === 0 && ((
|
|
851
|
-
sessionId: (
|
|
850
|
+
children: [(g == null ? void 0 : g.connectNetwork) && o.type === 0 && ((et = o.arrange) == null ? void 0 : et.length) && !!o.arrange[0].enableNetOpen && /* @__PURE__ */ c(wn, {
|
|
851
|
+
sessionId: (tt = e == null ? void 0 : e.data) == null ? void 0 : tt.id,
|
|
852
852
|
netStatus: H,
|
|
853
|
-
enable: typeof (a == null ? void 0 : a.connectNetwork) == "object" && typeof (a == null ? void 0 : a.connectNetwork.diabled) == "boolean" ? !(a != null && a.connectNetwork.diabled) :
|
|
853
|
+
enable: typeof (a == null ? void 0 : a.connectNetwork) == "object" && typeof (a == null ? void 0 : a.connectNetwork.diabled) == "boolean" ? !(a != null && a.connectNetwork.diabled) : Ht,
|
|
854
854
|
disabledTip: e ? void 0 : "网络访问已被禁用",
|
|
855
855
|
onNetStatusChange: (t) => {
|
|
856
856
|
Kt(t);
|
|
857
857
|
}
|
|
858
858
|
}), (g == null ? void 0 : g.sessionList) && /* @__PURE__ */ c(bn, {
|
|
859
|
-
currentSessionId: (
|
|
859
|
+
currentSessionId: (nt = e == null ? void 0 : e.data) == null ? void 0 : nt.id,
|
|
860
860
|
onSessionChange: (t, n) => {
|
|
861
861
|
W(void 0), k == null || k(n);
|
|
862
862
|
},
|
|
@@ -865,10 +865,10 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
865
865
|
icon: /* @__PURE__ */ c(mn, {}),
|
|
866
866
|
className: "add-btn",
|
|
867
867
|
type: "primary",
|
|
868
|
-
disabled:
|
|
868
|
+
disabled: Ue || !e || !h.length || M,
|
|
869
869
|
onClick: () => {
|
|
870
870
|
var t, n;
|
|
871
|
-
k == null || k(void 0), x(!1), (t =
|
|
871
|
+
k == null || k(void 0), x(!1), (t = Me.current) == null || t.clear(), (n = be.current) == null || n.clear();
|
|
872
872
|
},
|
|
873
873
|
children: "新会话"
|
|
874
874
|
})]
|
|
@@ -877,16 +877,16 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
877
877
|
className: "footer-textarea",
|
|
878
878
|
children: /* @__PURE__ */ c(cn, {
|
|
879
879
|
ref: ve,
|
|
880
|
-
maxLength:
|
|
881
|
-
text:
|
|
880
|
+
maxLength: pt,
|
|
881
|
+
text: It,
|
|
882
882
|
networkStatus: !1,
|
|
883
|
-
loading:
|
|
884
|
-
disabled:
|
|
885
|
-
onTextSend:
|
|
883
|
+
loading: $e,
|
|
884
|
+
disabled: Te || Ee || M || $e,
|
|
885
|
+
onTextSend: Ae,
|
|
886
886
|
onChange: (t, n) => {
|
|
887
887
|
W(t);
|
|
888
888
|
const r = n.getText().replace(/[\n\s]+$/, "");
|
|
889
|
-
ee(r),
|
|
889
|
+
ee(r), xt(r), He || kt(!0);
|
|
890
890
|
},
|
|
891
891
|
clearAction: /* @__PURE__ */ c(de, {
|
|
892
892
|
size: 0,
|
|
@@ -900,20 +900,20 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
900
900
|
},
|
|
901
901
|
type: "icon-qingchujiyi"
|
|
902
902
|
}),
|
|
903
|
-
onClick: () =>
|
|
903
|
+
onClick: () => Mt()
|
|
904
904
|
})
|
|
905
905
|
})
|
|
906
906
|
})
|
|
907
907
|
})]
|
|
908
908
|
})
|
|
909
909
|
}), /* @__PURE__ */ c(un, {
|
|
910
|
-
tips:
|
|
911
|
-
}),
|
|
912
|
-
isvisible:
|
|
913
|
-
files:
|
|
914
|
-
sessionId: (
|
|
910
|
+
tips: ht
|
|
911
|
+
}), Oe && /* @__PURE__ */ c(pn, {
|
|
912
|
+
isvisible: Oe,
|
|
913
|
+
files: Ct,
|
|
914
|
+
sessionId: (it = e == null ? void 0 : e.data) == null ? void 0 : it.id,
|
|
915
915
|
onClose: (t) => {
|
|
916
|
-
|
|
916
|
+
Lt(!1), Ft(!1);
|
|
917
917
|
}
|
|
918
918
|
})]
|
|
919
919
|
});
|