@glodon-aiot/agent-cli-ui 3.3.5-alpha.23 → 3.3.5-alpha.25
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 +117 -117
- 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/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/style19.css +1 -1
- package/dist/es/src/style20.css +1 -1
- package/dist/es/src/style21.css +1 -1
- package/dist/es/src/style5.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 +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 it = 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, ot = (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 (it)
|
|
9
|
+
for (var v of it(o))
|
|
10
10
|
Xt.call(o, v) && Ie(L, v, o[v]);
|
|
11
11
|
return L;
|
|
12
|
-
},
|
|
12
|
+
}, st = (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 rt, PromptVariableType as ge } from "@glodon-aiot/apis";
|
|
35
|
+
import dt from "./HistoryItem/index.mjs";
|
|
36
|
+
import ct from "dayjs";
|
|
37
|
+
import { v4 as ft } 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(dt), at = {
|
|
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 = ct(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"), this.isWaiting = !1, this.messageId = ft(), 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 lt = 10, ei = (L) => {
|
|
78
|
+
var We, Qe, _e, Ge, Xe, Ze, Je, Se, et, tt, nt;
|
|
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, Ce] = 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
96
|
onHistoryLoad: Ne,
|
|
97
97
|
beforeMessageSend: j,
|
|
98
|
-
bodyStyle:
|
|
98
|
+
bodyStyle: mt,
|
|
99
99
|
disabled: M,
|
|
100
|
-
features:
|
|
100
|
+
features: l,
|
|
101
101
|
popupContainer: f,
|
|
102
|
-
icon:
|
|
103
|
-
} = Jt(sn), [Pe, ye] = m(!1), y = B(h), Te = B(), [
|
|
102
|
+
icon: yt
|
|
103
|
+
} = Jt(sn), [Pe, ye] = m(!1), y = B(h), Te = B(), [pt, vt] = m(0), [X, q] = m(), [Y, ne] = m(""), [Fe, pe] = m(!1), ve = B(null), [Ee, bt] = m([]), [Re, K] = m(!1), [De, kt] = m(!1), [wt, xt] = m(""), [It, W] = m(), [ie, oe] = m({}), se = B(null), He = B(null), be = B(null), [Me, Lt] = m(!1), [Ct, Nt] = m([]), [Pt, re] = m(!0), [Tt, Ft] = m(!0), [Oe, O] = m(!1), [ke, V] = m(!1), [Ue, Et] = m(!1), [E, ae] = m(typeof (l == null ? void 0 : l.promptVariables) == "object" ? l.promptVariables.default || [] : []), [Rt, Dt] = m(typeof (l == null ? void 0 : l.knowledges) == "object" && l.knowledges.default || void 0), [ze, U] = m(!1), [je, Z] = m(!1), [Ht, Q] = m(typeof (l == null ? void 0 : l.connectNetwork) == "object" && typeof (l == null ? void 0 : l.connectNetwork.default) == "boolean" ? l.connectNetwork.default : !1), [Ve, le] = m(!1);
|
|
104
104
|
F(() => {
|
|
105
105
|
var r, i;
|
|
106
106
|
e && (y.current = []), C([]);
|
|
@@ -113,12 +113,12 @@ const at = 10, ei = (L) => {
|
|
|
113
113
|
const s = [...e.messages.filter((d) => d == null ? void 0 : d.messageId)].reverse();
|
|
114
114
|
y.current = [...s], C([...s]);
|
|
115
115
|
}
|
|
116
|
-
const n = (
|
|
116
|
+
const n = (a) => {
|
|
117
117
|
var s;
|
|
118
|
-
(s = e == null ? void 0 : e.data) != null && s.id && (y.current = [...
|
|
118
|
+
(s = e == null ? void 0 : e.data) != null && s.id && (y.current = [...a].reverse(), C([...a].reverse()), !a || a.length < 10 ? Z(!1) : Z(!0), Ne && Ne({
|
|
119
119
|
applicationId: o.id,
|
|
120
120
|
sessionId: e.data.id,
|
|
121
|
-
histories:
|
|
121
|
+
histories: a
|
|
122
122
|
}));
|
|
123
123
|
};
|
|
124
124
|
return e.addEventListener("history:loaded", n), () => {
|
|
@@ -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,9 +170,9 @@ 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
|
-
}, [
|
|
175
|
+
}, [ut, o]);
|
|
176
176
|
const $e = (t) => z(void 0, null, function* () {
|
|
177
177
|
var p, T;
|
|
178
178
|
if (M) {
|
|
@@ -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
|
|
@@ -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({
|
|
@@ -241,14 +241,14 @@ 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)),
|
|
244
|
+
U(!0), x(!!(($ = b.data) != null && $.netOpen)), Q(!!((J = b.data) != null && J.enableNetOpen)), Ae(b).then(() => {
|
|
245
245
|
k == null || k(b), U(!1), Ce(n);
|
|
246
246
|
});
|
|
247
247
|
});
|
|
248
248
|
return;
|
|
249
249
|
}
|
|
250
250
|
le(!0);
|
|
251
|
-
const
|
|
251
|
+
const a = Y ? `
|
|
252
252
|
${n}` : n;
|
|
253
253
|
let s;
|
|
254
254
|
try {
|
|
@@ -256,9 +256,9 @@ ${n}` : n;
|
|
|
256
256
|
applicationId: o.id,
|
|
257
257
|
sessionId: i,
|
|
258
258
|
message: {
|
|
259
|
-
content:
|
|
259
|
+
content: a,
|
|
260
260
|
sessionId: i,
|
|
261
|
-
role:
|
|
261
|
+
role: rt.User,
|
|
262
262
|
files: ie[i]
|
|
263
263
|
}
|
|
264
264
|
}) : s = !0;
|
|
@@ -269,8 +269,8 @@ ${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
|
-
}),
|
|
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) => {
|
|
272
|
+
}), Ae = (t) => new Promise((n, r) => z(void 0, null, function* () {
|
|
273
|
+
const s = (t == null ? void 0 : t.promptVariables).filter((d) => !((d.type === ge.User || d.type === void 0) && d.key === "query") && !((d.type === ge.System || d.type === void 0) && 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;
|
|
276
276
|
return d.value = I || "", d;
|
|
@@ -287,9 +287,9 @@ ${n}` : n;
|
|
|
287
287
|
if (re(!1), !((s = e == null ? void 0 : e.data) != null && s.id) || !(o != null && o.id))
|
|
288
288
|
return;
|
|
289
289
|
const n = ((d = e.data) == null ? void 0 : d.id) || "", r = [];
|
|
290
|
-
let i = [],
|
|
290
|
+
let i = [], a = /* @__PURE__ */ new Set();
|
|
291
291
|
(I = ie[n]) == null || I.forEach((p) => {
|
|
292
|
-
|
|
292
|
+
a.has(p.id) || (i.push(p), a.add(p.id));
|
|
293
293
|
}), Promise.all(i.map((p) => P == null ? void 0 : P.patchApplicationIdKnowledgeIdFileId(o == null ? void 0 : o.id, n, p.id, {
|
|
294
294
|
enabled: 1
|
|
295
295
|
}).then((T) => {
|
|
@@ -315,11 +315,11 @@ ${t}` : t;
|
|
|
315
315
|
message: {
|
|
316
316
|
content: r,
|
|
317
317
|
sessionId: e.id,
|
|
318
|
-
role:
|
|
318
|
+
role: rt.User,
|
|
319
319
|
files: ie[e.id]
|
|
320
320
|
}
|
|
321
321
|
}) : i = !0;
|
|
322
|
-
} catch (
|
|
322
|
+
} catch (a) {
|
|
323
323
|
i = !1;
|
|
324
324
|
}
|
|
325
325
|
le(!1), i !== !1 && (we(t), Ce(void 0));
|
|
@@ -335,11 +335,11 @@ ${t}` : t;
|
|
|
335
335
|
return;
|
|
336
336
|
V(!0), O(!0);
|
|
337
337
|
const i = Y ? `
|
|
338
|
-
${t}` : t,
|
|
339
|
-
ee(void 0), W(void 0), y.current = [
|
|
338
|
+
${t}` : t, a = new S(i, r, G.User, n);
|
|
339
|
+
ee(void 0), W(void 0), y.current = [a, ...h], C(y.current), o.id && te && te({
|
|
340
340
|
applicationId: o.id,
|
|
341
341
|
sessionId: r,
|
|
342
|
-
message:
|
|
342
|
+
message: a
|
|
343
343
|
});
|
|
344
344
|
const s = new S("", r, G.System);
|
|
345
345
|
s.isWaiting = !0, y.current = [s, ...y.current], C(y.current);
|
|
@@ -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({
|
|
@@ -374,8 +374,8 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
374
374
|
return ce.error({
|
|
375
375
|
message: i.content
|
|
376
376
|
});
|
|
377
|
-
const
|
|
378
|
-
s.messageId = i.messageId, s.reasoningContent = i.reasoningContent, s.searchReference = i.searchReference, s.thinkingSecs = i.thinkingSecs, s.thinkingStatus = i.thinkingStatus, s.actions =
|
|
377
|
+
const a = 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 = a, 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,25 +418,25 @@ ${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 ? Be(e, t) : new Promise((r) => {
|
|
422
422
|
U(!0), w == null || w({
|
|
423
423
|
netOpen: H ? 1 : 2
|
|
424
424
|
}).then((i) => {
|
|
425
|
-
var
|
|
426
|
-
k == null || k(i), U(!1), x(!!((
|
|
425
|
+
var a, s;
|
|
426
|
+
k == null || k(i), U(!1), x(!!((a = i.data) != null && a.netOpen)), Q(!!((s = i.data) != null && s.enableNetOpen)), r(Be(i, t));
|
|
427
427
|
});
|
|
428
428
|
});
|
|
429
|
-
}),
|
|
429
|
+
}), Be = (t, n) => {
|
|
430
430
|
const r = dn(n.name);
|
|
431
431
|
return new Promise((i) => {
|
|
432
432
|
var s;
|
|
433
|
-
const
|
|
434
|
-
files: [`${
|
|
433
|
+
const a = {
|
|
434
|
+
files: [`${ft()}.${r}`],
|
|
435
435
|
isv: "minio",
|
|
436
436
|
knowledgeId: ((s = t.data) == null ? void 0 : s.id) || "",
|
|
437
437
|
type: 1
|
|
438
438
|
};
|
|
439
|
-
pe(!0), P == null || P.postTicket(
|
|
439
|
+
pe(!0), P == null || P.postTicket(a).then((d) => {
|
|
440
440
|
P.uploadMinioFile(d.minio, n).then(() => {
|
|
441
441
|
var b, $;
|
|
442
442
|
const I = (b = d.minio.endpoints) == null ? void 0 : b[0], p = d.minio.bucket, T = ($ = d.minio.fileKeys) == null ? void 0 : $[0];
|
|
@@ -457,15 +457,15 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
457
457
|
top: t.scrollHeight
|
|
458
458
|
});
|
|
459
459
|
}, [h]);
|
|
460
|
-
const
|
|
460
|
+
const qe = (t, n) => new Promise((r) => {
|
|
461
461
|
if (!n.file.url || !(o != null && o.id))
|
|
462
462
|
return r();
|
|
463
|
-
const i = ot(
|
|
463
|
+
const i = st(ot({}, n.file), {
|
|
464
464
|
type: 1
|
|
465
465
|
});
|
|
466
466
|
P == null || P.postApplicationIdSessionKnowledgeSessionFile(o == null ? void 0 : o.id, t, i).finally(() => {
|
|
467
|
-
var
|
|
468
|
-
(
|
|
467
|
+
var a;
|
|
468
|
+
(a = se.current) == null || a.update().finally(r);
|
|
469
469
|
});
|
|
470
470
|
}), jt = () => {
|
|
471
471
|
var t;
|
|
@@ -482,7 +482,7 @@ ${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();
|
|
@@ -507,14 +507,14 @@ ${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: lt
|
|
511
511
|
}).then((i) => {
|
|
512
|
-
const
|
|
513
|
-
if (!
|
|
512
|
+
const a = i || [];
|
|
513
|
+
if (!a || !(a != null && a.length)) {
|
|
514
514
|
Z(!1);
|
|
515
515
|
return;
|
|
516
516
|
}
|
|
517
|
-
|
|
517
|
+
a.length < 10 ? Z(!1) : Z(!0), C([...h, ...a.reverse()]);
|
|
518
518
|
});
|
|
519
519
|
}, Kt = (t) => z(void 0, null, function* () {
|
|
520
520
|
var n, r;
|
|
@@ -536,11 +536,11 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
536
536
|
}, [e]), F(() => {
|
|
537
537
|
var t, n;
|
|
538
538
|
if (R.current) {
|
|
539
|
-
const r = document.getElementById("chat-main"), i = (t = R.current) == null ? void 0 : t.querySelector(".infinite-scroll-component__outerdiv"),
|
|
540
|
-
if (!i || !
|
|
539
|
+
const r = document.getElementById("chat-main"), i = (t = R.current) == null ? void 0 : t.querySelector(".infinite-scroll-component__outerdiv"), a = (n = R.current) == null ? void 0 : n.querySelector(".infinite-scroll-component");
|
|
540
|
+
if (!i || !a || !r)
|
|
541
541
|
return;
|
|
542
542
|
const s = r.offsetHeight;
|
|
543
|
-
if (
|
|
543
|
+
if (a.offsetHeight <= s) {
|
|
544
544
|
if (i.style.height === "100%")
|
|
545
545
|
return;
|
|
546
546
|
i.style.height = "100%";
|
|
@@ -555,33 +555,33 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
555
555
|
return;
|
|
556
556
|
const t = () => {
|
|
557
557
|
const i = ((N == null ? void 0 : N.promptVariables) || []).filter(
|
|
558
|
-
(
|
|
558
|
+
(a) => !((a.type === ge.User || a.type === void 0) && a.key === "query") && !((a.type === ge.System || a.type === void 0) && a.key === "datetime") && a.status === 1
|
|
559
559
|
// 只要求输入被引用的变量
|
|
560
|
-
).map((
|
|
560
|
+
).map((a, s) => {
|
|
561
561
|
var I, p;
|
|
562
562
|
let d = "";
|
|
563
|
-
return typeof (
|
|
563
|
+
return typeof (l == null ? void 0 : l.promptVariables) == "object" && (d = ((p = (I = l.promptVariables.default) == null ? void 0 : I.find((T) => T.key === a.key && T.type === a.type)) == null ? void 0 : p.value) || ""), {
|
|
564
564
|
id: s + "",
|
|
565
|
-
key:
|
|
566
|
-
name:
|
|
565
|
+
key: a.key,
|
|
566
|
+
name: a.name,
|
|
567
567
|
value: d,
|
|
568
|
-
type:
|
|
568
|
+
type: a.type
|
|
569
569
|
};
|
|
570
570
|
});
|
|
571
|
-
ae([...i].sort((
|
|
571
|
+
ae([...i].sort((a, s) => a.key.localeCompare(s.key)));
|
|
572
572
|
};
|
|
573
573
|
return N != null && N.ready ? t() : N == null || N.addEventListener("ready", t), () => {
|
|
574
574
|
N == null || N.removeEventListener("ready", t);
|
|
575
575
|
};
|
|
576
|
-
}, [e, N,
|
|
577
|
-
const
|
|
576
|
+
}, [e, N, l == null ? void 0 : l.promptVariables]);
|
|
577
|
+
const Ye = () => 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)), Ae(t), t;
|
|
582
|
+
}), Ke = 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(dt, {
|
|
585
585
|
application: o,
|
|
586
586
|
history: {
|
|
587
587
|
role: 1,
|
|
@@ -591,12 +591,12 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
591
591
|
sessionId: "",
|
|
592
592
|
reference: [],
|
|
593
593
|
searchReference: [],
|
|
594
|
-
messageTime:
|
|
594
|
+
messageTime: ct(Date.now()).format("YYYY-MM-DD HH:mm:ss"),
|
|
595
595
|
actions: [],
|
|
596
596
|
isLoading: !1
|
|
597
597
|
},
|
|
598
598
|
actions: !!h.length,
|
|
599
|
-
markdown:
|
|
599
|
+
markdown: l == null ? void 0 : l.markdown
|
|
600
600
|
}) : null;
|
|
601
601
|
}, [o == null ? void 0 : o.arrange, h]);
|
|
602
602
|
return /* @__PURE__ */ A("div", {
|
|
@@ -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: (We = e == null ? void 0 : e.data) != null && We.id && (h != null && h.length) ? /* @__PURE__ */ A(kn, {
|
|
627
627
|
dataLength: h.length,
|
|
628
628
|
next: Yt,
|
|
629
629
|
style: {
|
|
@@ -632,8 +632,8 @@ ${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 > lt && // 少于一页不展示这个提示
|
|
636
|
+
((Qe = R.current) != null && Qe.scrollTop) && ((_e = R.current) == null ? void 0 : _e.scrollTop) < -10 ? /* @__PURE__ */ c(en, {
|
|
637
637
|
plain: !0,
|
|
638
638
|
children: "没有更多数据了"
|
|
639
639
|
}) : null,
|
|
@@ -656,38 +656,38 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
656
656
|
onRelatedClick: Bt,
|
|
657
657
|
onAgainClick: qt,
|
|
658
658
|
onEditClick: At,
|
|
659
|
-
markdown:
|
|
660
|
-
}, t.messageId + n)), !je &&
|
|
659
|
+
markdown: l == null ? void 0 : l.markdown
|
|
660
|
+
}, t.messageId + n)), !je && Ke]
|
|
661
661
|
}) : /* @__PURE__ */ A("div", {
|
|
662
662
|
className: "main-empty",
|
|
663
|
-
children: [(
|
|
664
|
-
text:
|
|
665
|
-
icon:
|
|
666
|
-
children: !!Ee.length && (((
|
|
663
|
+
children: [(l == null ? void 0 : l.greeting) !== !1 && /* @__PURE__ */ c(gn, {
|
|
664
|
+
text: l === void 0 || l.greeting === !0 || ((Ge = l.greeting) == null ? void 0 : Ge.text) === void 0 ? at.text : l.greeting.text,
|
|
665
|
+
icon: l === void 0 || l.greeting === !0 || ((Xe = l.greeting) == null ? void 0 : Xe.icon) === void 0 ? yt || at.icon : l.greeting.icon,
|
|
666
|
+
children: !!Ee.length && (((l == null ? void 0 : l.greeting) === void 0 || (l == null ? void 0 : l.greeting)) === !0 || typeof (l == null ? void 0 : l.greeting) == "object" && l.greeting.questions !== !1) && /* @__PURE__ */ c(fn, {
|
|
667
667
|
ref: be,
|
|
668
|
-
sid: (
|
|
668
|
+
sid: (Ze = e == null ? void 0 : e.data) == null ? void 0 : Ze.id,
|
|
669
669
|
isRecommendClearing: Re,
|
|
670
670
|
data: Ee,
|
|
671
671
|
onItemClick: (t) => {
|
|
672
|
-
var r, i,
|
|
672
|
+
var r, i, a;
|
|
673
673
|
if (ee(t == null ? void 0 : t.question), W(t == null ? void 0 : t.question), Re)
|
|
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
|
-
g != null && g.fileUpload ? (
|
|
677
|
+
g != null && g.fileUpload ? (a = (i = se.current) == null ? void 0 : i.clear()) == null || a.then(() => {
|
|
678
678
|
var s, d;
|
|
679
|
-
t != null && t.id && (n ? (s =
|
|
679
|
+
t != null && t.id && (n ? (s = qe(n, t)) == null || s.finally(() => {
|
|
680
680
|
K(!1);
|
|
681
|
-
}) : (K(!1), U(!0), (d =
|
|
681
|
+
}) : (K(!1), U(!0), (d = Ye()) == null || d.then((I) => {
|
|
682
682
|
var p;
|
|
683
|
-
(p =
|
|
683
|
+
(p = qe(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), Ye());
|
|
688
688
|
}
|
|
689
689
|
})
|
|
690
|
-
}),
|
|
690
|
+
}), Ke]
|
|
691
691
|
})
|
|
692
692
|
}), Oe && /* @__PURE__ */ c("div", {
|
|
693
693
|
className: "session-stop",
|
|
@@ -800,13 +800,13 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
800
800
|
U(!0), w == null || w({
|
|
801
801
|
netOpen: H ? 1 : 2
|
|
802
802
|
}).then((n) => {
|
|
803
|
-
var i,
|
|
804
|
-
k == null || k(n), U(!1), x(!!((i = n.data) != null && i.netOpen)), Q(!!((
|
|
803
|
+
var i, a, s;
|
|
804
|
+
k == null || k(n), U(!1), x(!!((i = n.data) != null && i.netOpen)), Q(!!((a = n.data) != null && a.enableNetOpen));
|
|
805
805
|
const r = ((s = n.data) == null ? void 0 : s.id) || "";
|
|
806
806
|
t(r);
|
|
807
807
|
});
|
|
808
808
|
}),
|
|
809
|
-
sid: (
|
|
809
|
+
sid: (Je = e == null ? void 0 : e.data) == null ? void 0 : Je.id,
|
|
810
810
|
disabled: ke || M,
|
|
811
811
|
afterFileAdd: (t, n) => {
|
|
812
812
|
n && oe((r) => {
|
|
@@ -820,16 +820,16 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
820
820
|
var r;
|
|
821
821
|
const n = (r = e == null ? void 0 : e.data) == null ? void 0 : r.id;
|
|
822
822
|
n && oe((i) => {
|
|
823
|
-
const
|
|
823
|
+
const a = i[n] || [];
|
|
824
824
|
return {
|
|
825
|
-
[n]:
|
|
825
|
+
[n]: a.filter((s) => s.id !== t)
|
|
826
826
|
};
|
|
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: De ?
|
|
843
|
+
search: De ? 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 && ((Se = o.arrange) == null ? void 0 : Se.length) && !!o.arrange[0].enableNetOpen && /* @__PURE__ */ c(wn, {
|
|
851
|
+
sessionId: (et = e == null ? void 0 : e.data) == null ? void 0 : et.id,
|
|
852
852
|
netStatus: H,
|
|
853
|
-
enable: typeof (
|
|
853
|
+
enable: typeof (l == null ? void 0 : l.connectNetwork) == "object" && typeof (l == null ? void 0 : l.connectNetwork.diabled) == "boolean" ? !(l != null && l.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: (tt = e == null ? void 0 : e.data) == null ? void 0 : tt.id,
|
|
860
860
|
onSessionChange: (t, n) => {
|
|
861
861
|
W(void 0), k == null || k(n);
|
|
862
862
|
},
|
|
@@ -877,8 +877,8 @@ ${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
883
|
loading: Ve,
|
|
884
884
|
disabled: Pe || Fe || M || Ve,
|
|
@@ -886,7 +886,7 @@ ${t}` : t, l = new S(i, r, G.User, n);
|
|
|
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), De || 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:
|
|
910
|
+
tips: ht
|
|
911
911
|
}), Me && /* @__PURE__ */ c(pn, {
|
|
912
912
|
isvisible: Me,
|
|
913
|
-
files:
|
|
914
|
-
sessionId: (
|
|
913
|
+
files: Ct,
|
|
914
|
+
sessionId: (nt = e == null ? void 0 : e.data) == null ? void 0 : nt.id,
|
|
915
915
|
onClose: (t) => {
|
|
916
|
-
|
|
916
|
+
Lt(!1), Ft(!1);
|
|
917
917
|
}
|
|
918
918
|
})]
|
|
919
919
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e = "@glodon-aiot/agent-cli-ui", t = "3.3.5-alpha.
|
|
1
|
+
const e = "@glodon-aiot/agent-cli-ui", t = "3.3.5-alpha.25", s = "./dist/es/index.mjs", i = "./dist/lib/index.js", o = "./dist/src/index.d.ts", n = {
|
|
2
2
|
import: "./dist/es/index.mjs",
|
|
3
3
|
require: "./dist/lib/index.js",
|
|
4
4
|
types: "./dist/src/index.d.ts"
|
|
@@ -22,8 +22,8 @@ const e = "@glodon-aiot/agent-cli-ui", t = "3.3.5-alpha.23", s = "./dist/es/inde
|
|
|
22
22
|
webpack: "*"
|
|
23
23
|
}, p = {
|
|
24
24
|
"@ant-design/icons": "^5.3.4",
|
|
25
|
-
"@glodon-aiot/apis": "^3.3.5-alpha.
|
|
26
|
-
"@glodon-aiot/bot-client-sdk": "^3.3.5-alpha.
|
|
25
|
+
"@glodon-aiot/apis": "^3.3.5-alpha.25",
|
|
26
|
+
"@glodon-aiot/bot-client-sdk": "^3.3.5-alpha.25",
|
|
27
27
|
"@matejmazur/react-mathjax": "^0.1.10",
|
|
28
28
|
"@react-pdf-viewer/core": "^3.12.0",
|
|
29
29
|
"@react-pdf-viewer/default-layout": "^3.12.0",
|