@glodon-aiot/agent-cli-ui 3.5.0 → 3.5.1-beta.0
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 +115 -115
- 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/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/style24.css +1 -1
- package/dist/es/src/style25.css +1 -1
- package/dist/es/src/style26.css +1 -1
- package/dist/es/src/style28.css +1 -1
- package/dist/es/src/style29.css +1 -1
- package/dist/es/src/style30.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/lib/index.js +41 -41
- package/package.json +3 -3
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var fn = Object.defineProperty, gn = Object.defineProperties;
|
|
2
2
|
var un = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var
|
|
3
|
+
var pt = Object.getOwnPropertySymbols;
|
|
4
4
|
var mn = Object.prototype.hasOwnProperty, hn = Object.prototype.propertyIsEnumerable;
|
|
5
5
|
var Te = (k, h, o) => h in k ? fn(k, h, { enumerable: !0, configurable: !0, writable: !0, value: o }) : k[h] = o, Oe = (k, h) => {
|
|
6
6
|
for (var o in h || (h = {}))
|
|
7
7
|
mn.call(h, o) && Te(k, o, h[o]);
|
|
8
|
-
if (
|
|
9
|
-
for (var o of
|
|
8
|
+
if (pt)
|
|
9
|
+
for (var o of pt(h))
|
|
10
10
|
hn.call(h, o) && Te(k, o, h[o]);
|
|
11
11
|
return k;
|
|
12
12
|
}, He = (k, h) => gn(k, un(h));
|
|
@@ -29,11 +29,11 @@ var z = (k, h, o) => new Promise((j, e) => {
|
|
|
29
29
|
});
|
|
30
30
|
import { jsx as d, jsxs as V, Fragment as yn } from "react/jsx-runtime";
|
|
31
31
|
import { memo as pn, forwardRef as vn, useState as m, useRef as K, useContext as bn, useEffect as L, useMemo as xn, useImperativeHandle as kn } from "react";
|
|
32
|
-
/* empty css */import { Spin as
|
|
32
|
+
/* empty css */import { Spin as vt, Divider as wn, Button as Q, Space as ve, Upload as Cn, Tooltip as In, Popover as Nn, notification as ee, message as u } from "antd";
|
|
33
33
|
import re from "../../components/Iconfont/index.mjs";
|
|
34
|
-
import { IHistoryRole as te, ApplicationTypes as
|
|
35
|
-
import
|
|
36
|
-
import
|
|
34
|
+
import { IHistoryRole as te, ApplicationTypes as wt, ChatMessageRole as bt, PromptVariableType as be } from "@glodon-aiot/apis";
|
|
35
|
+
import Ct from "./HistoryItem/index.mjs";
|
|
36
|
+
import It from "dayjs";
|
|
37
37
|
import { v4 as Fe } from "uuid";
|
|
38
38
|
import Ln from "../../context.mjs";
|
|
39
39
|
import { configuration as En } from "@glodon-aiot/bot-client-sdk";
|
|
@@ -56,7 +56,7 @@ import Bn from "./Tools/ConnectToNetwork/index.mjs";
|
|
|
56
56
|
import Wn from "./Tools/PromptManager/index.mjs";
|
|
57
57
|
import { useSessionState as Yn } from "../../hooks/useSessionState.mjs";
|
|
58
58
|
import Kn from "../../assets/icon.svg.mjs";
|
|
59
|
-
const Qn = pn(
|
|
59
|
+
const Qn = pn(Ct), xt = {
|
|
60
60
|
icon: Kn,
|
|
61
61
|
text: "今天我能帮你什么?"
|
|
62
62
|
};
|
|
@@ -71,14 +71,14 @@ class ae {
|
|
|
71
71
|
F(this, "isSensitive");
|
|
72
72
|
F(this, "isSuspend");
|
|
73
73
|
F(this, "comment");
|
|
74
|
-
this.content = h, this.sessionId = o, this.role = j, this.files = e, this.content = h, this.role = j, this.sessionId = o, this.files = e, this.messageTime =
|
|
74
|
+
this.content = h, this.sessionId = o, this.role = j, this.files = e, this.content = h, this.role = j, this.sessionId = o, this.files = e, this.messageTime = It(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"), this.isWaiting = !1, this.messageId = Fe(), this.isContext = !1, this.actions = [], this.reference = [], this.isSensitive = !1, this.isSuspend = !1, this.comment = {
|
|
75
75
|
isAgree: 0
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
const
|
|
79
|
+
const kt = 10, De = (k, h, o, j) => {
|
|
80
80
|
let e = k;
|
|
81
|
-
if (j ===
|
|
81
|
+
if (j === wt.Agent && o && o.length > 0) {
|
|
82
82
|
const w = o.map((_) => `[${_.name.replace(/\.[^/.]+$/, "")}](${_.url})`).join(`
|
|
83
83
|
`);
|
|
84
84
|
e = w ? `${w}
|
|
@@ -87,7 +87,7 @@ ${e}` : e;
|
|
|
87
87
|
return h && (e = `
|
|
88
88
|
${e}`), e;
|
|
89
89
|
}, Ni = vn((k, h) => {
|
|
90
|
-
var
|
|
90
|
+
var st, rt, at, lt, dt, ct, ft, gt, ut, mt, ht, yt;
|
|
91
91
|
const {
|
|
92
92
|
application: o,
|
|
93
93
|
docViewerUrl: j = "",
|
|
@@ -97,36 +97,36 @@ ${e}`), e;
|
|
|
97
97
|
setCurrentSession: v,
|
|
98
98
|
networkStatus: E,
|
|
99
99
|
setNetworkStatus: P
|
|
100
|
-
} = k, [b, C] = m([]), [
|
|
100
|
+
} = k, [b, C] = m([]), [Nt, le] = m(), [xe, je] = m(), H = K(null), {
|
|
101
101
|
service: R,
|
|
102
102
|
agentClient: I,
|
|
103
|
-
depId:
|
|
104
|
-
footer:
|
|
103
|
+
depId: Lt,
|
|
104
|
+
footer: Et,
|
|
105
105
|
transform: g,
|
|
106
|
-
defaultInput:
|
|
106
|
+
defaultInput: ke,
|
|
107
107
|
onMessage: de,
|
|
108
108
|
onHistoryLoad: Me,
|
|
109
109
|
beforeMessageSend: A,
|
|
110
|
-
bodyStyle:
|
|
110
|
+
bodyStyle: Pt,
|
|
111
111
|
disabled: D,
|
|
112
112
|
features: r,
|
|
113
113
|
popupContainer: f,
|
|
114
|
-
icon:
|
|
115
|
-
sider:
|
|
116
|
-
mode:
|
|
117
|
-
} = bn(Ln), [Ue,
|
|
118
|
-
isSwitchingToExistingSession:
|
|
119
|
-
setIsSwitchingToExistingSession:
|
|
114
|
+
icon: Tt,
|
|
115
|
+
sider: Ot,
|
|
116
|
+
mode: Ht
|
|
117
|
+
} = bn(Ln), [Ue, we] = m(!1), y = K(b), ze = K(void 0), [Rt, Dt] = m(0), [ne, G] = m(), [Ce, ce] = m(""), [Ve, Ie] = m(!1), fe = K(null), [Ae, Ft] = m([]), [$e, X] = m(!1), [qe, jt] = m(!1), [Mt, Ut] = m(""), [zt, Z] = m(), [J, ie] = m({}), ge = K(null), Be = K(null), Ne = K(null), [We, Vt] = m(!1), [At, $t] = m([]), [qt, ue] = m(!0), [Bt, Wt] = m(!0), [Ye, M] = m(!1), [Le, $] = m(!1), [Ke, Yt] = m(!1), [O, me] = m(typeof (r == null ? void 0 : r.promptVariables) == "object" ? r.promptVariables.default || [] : []), [Kt, Qt] = m(typeof (r == null ? void 0 : r.knowledges) == "object" && r.knowledges.default || void 0), [Qe, U] = m(!1), [_e, oe] = m(!1), [_t, S] = m(typeof (r == null ? void 0 : r.connectNetwork) == "object" && typeof (r == null ? void 0 : r.connectNetwork.default) == "boolean" ? r.connectNetwork.default : !1), [Ge, he] = m(!1), [Gt, q] = m(!1), [Xt, Zt] = m(null), [ye, Y] = m(!1), [Xe, Ze] = m(!1), {
|
|
118
|
+
isSwitchingToExistingSession: Je,
|
|
119
|
+
setIsSwitchingToExistingSession: pe
|
|
120
120
|
} = Yn();
|
|
121
121
|
L(() => {
|
|
122
|
-
if (
|
|
122
|
+
if (Zt(e), e === null)
|
|
123
123
|
q(!1);
|
|
124
124
|
else if (e === void 0)
|
|
125
125
|
q(!0);
|
|
126
126
|
else {
|
|
127
|
-
if (
|
|
128
|
-
if (
|
|
129
|
-
q(!0),
|
|
127
|
+
if (Xt === null) {
|
|
128
|
+
if (Je) {
|
|
129
|
+
q(!0), pe(!1);
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
132
|
q(!1);
|
|
@@ -134,7 +134,7 @@ ${e}`), e;
|
|
|
134
134
|
}
|
|
135
135
|
e.ready ? q(!1) : q(!0);
|
|
136
136
|
}
|
|
137
|
-
}, [e, e == null ? void 0 : e.ready]), L(() => {
|
|
137
|
+
}, [e, e == null ? void 0 : e.ready, Je]), L(() => {
|
|
138
138
|
var a, l;
|
|
139
139
|
e && (y.current = []), C([]);
|
|
140
140
|
const t = H.current;
|
|
@@ -160,7 +160,7 @@ ${e}`), e;
|
|
|
160
160
|
}, [e]), L(() => {
|
|
161
161
|
const t = () => {
|
|
162
162
|
var n;
|
|
163
|
-
(n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables && me(e.promptVariables.sort((a, l) => a.key.localeCompare(l.key))), e.knowledges &&
|
|
163
|
+
(n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables && me(e.promptVariables.sort((a, l) => a.key.localeCompare(l.key))), e.knowledges && Qt(e.knowledges), P(e.netOpen));
|
|
164
164
|
};
|
|
165
165
|
return e == null || e.addEventListener("data:updated", t), () => {
|
|
166
166
|
e == null || e.removeEventListener("data:updated", t);
|
|
@@ -207,10 +207,10 @@ ${e}`), e;
|
|
|
207
207
|
};
|
|
208
208
|
L(() => {
|
|
209
209
|
o != null && o.id && (R == null || R.getRecommendQues(o.id).then((t) => {
|
|
210
|
-
|
|
210
|
+
Ft(t);
|
|
211
211
|
}));
|
|
212
|
-
}, [
|
|
213
|
-
const
|
|
212
|
+
}, [Lt, o]);
|
|
213
|
+
const Se = (t) => z(void 0, null, function* () {
|
|
214
214
|
var N, T;
|
|
215
215
|
if (D) {
|
|
216
216
|
u.config({
|
|
@@ -222,7 +222,7 @@ ${e}`), e;
|
|
|
222
222
|
});
|
|
223
223
|
return;
|
|
224
224
|
}
|
|
225
|
-
const n = t ||
|
|
225
|
+
const n = t || Nt;
|
|
226
226
|
if (!(n != null && n.trim())) {
|
|
227
227
|
u.config({
|
|
228
228
|
getContainer: () => (f == null ? void 0 : f.current) || document.body,
|
|
@@ -245,7 +245,7 @@ ${e}`), e;
|
|
|
245
245
|
return;
|
|
246
246
|
} else
|
|
247
247
|
console.error("变量值不能为空", O == null ? void 0 : O.map((x) => !!(x != null && x.value)));
|
|
248
|
-
if (
|
|
248
|
+
if (Le) {
|
|
249
249
|
u.config({
|
|
250
250
|
getContainer: () => (f == null ? void 0 : f.current) || document.body,
|
|
251
251
|
prefixCls: "gbot-message"
|
|
@@ -265,7 +265,7 @@ ${e}`), e;
|
|
|
265
265
|
});
|
|
266
266
|
return;
|
|
267
267
|
}
|
|
268
|
-
if (
|
|
268
|
+
if (!qt) {
|
|
269
269
|
u.config({
|
|
270
270
|
getContainer: () => (f == null ? void 0 : f.current) || document.body,
|
|
271
271
|
prefixCls: "gbot-message"
|
|
@@ -294,7 +294,7 @@ ${e}`), e;
|
|
|
294
294
|
netOpen: E ? W.OPEN : W.CLOSE
|
|
295
295
|
}).then((x) => {
|
|
296
296
|
var B, se;
|
|
297
|
-
U(!0), P(!!((B = x.data) != null && B.netOpen)), S(!!((se = x.data) != null && se.enableNetOpen)),
|
|
297
|
+
U(!0), P(!!((B = x.data) != null && B.netOpen)), S(!!((se = x.data) != null && se.enableNetOpen)), et(x).then(() => {
|
|
298
298
|
v == null || v(x), U(!1), je(n);
|
|
299
299
|
});
|
|
300
300
|
}).catch((x) => {
|
|
@@ -305,7 +305,7 @@ ${e}`), e;
|
|
|
305
305
|
if (ye)
|
|
306
306
|
return;
|
|
307
307
|
Y(!0), he(!0);
|
|
308
|
-
const i = De(n,
|
|
308
|
+
const i = De(n, Ce, J[l], (o == null ? void 0 : o.type) || 0);
|
|
309
309
|
let c;
|
|
310
310
|
try {
|
|
311
311
|
A ? c = yield A == null ? void 0 : A({
|
|
@@ -314,7 +314,7 @@ ${e}`), e;
|
|
|
314
314
|
message: {
|
|
315
315
|
content: i,
|
|
316
316
|
sessionId: l,
|
|
317
|
-
role:
|
|
317
|
+
role: bt.User,
|
|
318
318
|
files: J[l]
|
|
319
319
|
}
|
|
320
320
|
}) : c = !0;
|
|
@@ -331,8 +331,8 @@ ${e}`), e;
|
|
|
331
331
|
return;
|
|
332
332
|
}
|
|
333
333
|
((T = J[l]) == null ? void 0 : T.length) > 0 ? St(s) : Ee(s);
|
|
334
|
-
}),
|
|
335
|
-
const c = (t == null ? void 0 : t.promptVariables).filter((s) => s.type ? !((s.type ===
|
|
334
|
+
}), et = (t) => new Promise((n, a) => z(void 0, null, function* () {
|
|
335
|
+
const c = (t == null ? void 0 : t.promptVariables).filter((s) => s.type ? !((s.type === be.User || s.type === void 0) && s.key === "query") && !((s.type === be.System || s.type === void 0) && s.key === "datetime") : s.key !== "query").map((s) => {
|
|
336
336
|
var N;
|
|
337
337
|
const p = (N = O.find((T) => T.key === s.key && T.type === s.type)) == null ? void 0 : N.value;
|
|
338
338
|
return s.value = p || "", s;
|
|
@@ -357,11 +357,11 @@ ${e}`), e;
|
|
|
357
357
|
}), ue(!0), Ee(t, a);
|
|
358
358
|
};
|
|
359
359
|
L(() => {
|
|
360
|
-
if (!
|
|
360
|
+
if (!xe || !e)
|
|
361
361
|
return;
|
|
362
|
-
const t =
|
|
362
|
+
const t = xe, n = () => z(void 0, null, function* () {
|
|
363
363
|
he(!0);
|
|
364
|
-
const a = De(t,
|
|
364
|
+
const a = De(t, Ce, J[e.id], (o == null ? void 0 : o.type) || 0);
|
|
365
365
|
let l;
|
|
366
366
|
try {
|
|
367
367
|
A ? l = yield A == null ? void 0 : A({
|
|
@@ -370,7 +370,7 @@ ${e}`), e;
|
|
|
370
370
|
message: {
|
|
371
371
|
content: a,
|
|
372
372
|
sessionId: e.id,
|
|
373
|
-
role:
|
|
373
|
+
role: bt.User,
|
|
374
374
|
files: J[e.id]
|
|
375
375
|
}
|
|
376
376
|
}) : l = !0;
|
|
@@ -386,14 +386,14 @@ ${e}`), e;
|
|
|
386
386
|
return e.ready ? n() : e.addEventListener("ready", n, !0), () => {
|
|
387
387
|
e == null || e.removeEventListener("ready", n);
|
|
388
388
|
};
|
|
389
|
-
}, [
|
|
389
|
+
}, [xe, e]);
|
|
390
390
|
const Ee = (t, n) => z(void 0, null, function* () {
|
|
391
391
|
var N, T;
|
|
392
392
|
const a = (N = e == null ? void 0 : e.data) == null ? void 0 : N.id;
|
|
393
393
|
if (!a)
|
|
394
394
|
return;
|
|
395
395
|
$(!0), M(!0);
|
|
396
|
-
const l = De(t,
|
|
396
|
+
const l = De(t, Ce, n, (o == null ? void 0 : o.type) || 0), i = new ae(l, a, te.User, n);
|
|
397
397
|
le(void 0), Z(void 0), y.current = [i, ...b], C(y.current), o.id && de && de({
|
|
398
398
|
applicationId: o.id,
|
|
399
399
|
sessionId: a,
|
|
@@ -410,7 +410,7 @@ ${e}`), e;
|
|
|
410
410
|
p.formatValues = x;
|
|
411
411
|
}
|
|
412
412
|
if (g != null && g.knowledges) {
|
|
413
|
-
const x =
|
|
413
|
+
const x = Kt;
|
|
414
414
|
p.knowledges = x;
|
|
415
415
|
}
|
|
416
416
|
yield e.send({
|
|
@@ -455,23 +455,23 @@ ${e}`), e;
|
|
|
455
455
|
};
|
|
456
456
|
}, [e]), L(() => {
|
|
457
457
|
if (!e) {
|
|
458
|
-
|
|
458
|
+
we(!1);
|
|
459
459
|
return;
|
|
460
460
|
}
|
|
461
461
|
const t = (n) => {
|
|
462
|
-
|
|
462
|
+
we(n);
|
|
463
463
|
};
|
|
464
|
-
return
|
|
464
|
+
return we(e.frozen), e.addEventListener("frozen", t), () => {
|
|
465
465
|
e == null || e.removeEventListener("frozen", t);
|
|
466
466
|
};
|
|
467
467
|
}, [e]), L(() => {
|
|
468
468
|
if (!I)
|
|
469
469
|
return;
|
|
470
470
|
const t = I.questionContextMaxLength || 4e3;
|
|
471
|
-
|
|
471
|
+
Dt(t);
|
|
472
472
|
}, [I, R]), L(() => {
|
|
473
|
-
|
|
474
|
-
}, [
|
|
473
|
+
ke && Z(ke.text);
|
|
474
|
+
}, [ke]);
|
|
475
475
|
const en = (t) => {
|
|
476
476
|
const n = t.size;
|
|
477
477
|
return n <= 0 ? (u.config({
|
|
@@ -489,15 +489,15 @@ ${e}`), e;
|
|
|
489
489
|
}), !1) : (G(t), !1);
|
|
490
490
|
}, tn = (t) => z(void 0, null, function* () {
|
|
491
491
|
var n;
|
|
492
|
-
return G(t), (n = e == null ? void 0 : e.data) != null && n.id ?
|
|
492
|
+
return G(t), (n = e == null ? void 0 : e.data) != null && n.id ? tt(e, t) : new Promise((a) => {
|
|
493
493
|
U(!0), w == null || w({
|
|
494
494
|
netOpen: E ? W.OPEN : W.CLOSE
|
|
495
495
|
}).then((l) => {
|
|
496
496
|
var i, c;
|
|
497
|
-
v == null || v(l), U(!1), P(!!((i = l.data) != null && i.netOpen)), S(!!((c = l.data) != null && c.enableNetOpen)), a(
|
|
497
|
+
v == null || v(l), U(!1), P(!!((i = l.data) != null && i.netOpen)), S(!!((c = l.data) != null && c.enableNetOpen)), a(tt(l, t));
|
|
498
498
|
});
|
|
499
499
|
});
|
|
500
|
-
}),
|
|
500
|
+
}), tt = (t, n) => {
|
|
501
501
|
const a = On(n.name);
|
|
502
502
|
return new Promise((l) => {
|
|
503
503
|
var c;
|
|
@@ -507,7 +507,7 @@ ${e}`), e;
|
|
|
507
507
|
knowledgeId: ((c = t.data) == null ? void 0 : c.id) || "",
|
|
508
508
|
type: 1
|
|
509
509
|
};
|
|
510
|
-
|
|
510
|
+
Ie(!0), R == null || R.postTicket(i).then((s) => {
|
|
511
511
|
R.uploadMinioFile(s.minio, n).then(() => {
|
|
512
512
|
var x, B;
|
|
513
513
|
const p = (x = s.minio.endpoints) == null ? void 0 : x[0], N = s.minio.bucket, T = (B = s.minio.fileKeys) == null ? void 0 : B[0];
|
|
@@ -515,10 +515,10 @@ ${e}`), e;
|
|
|
515
515
|
}).catch(() => {
|
|
516
516
|
ce(""), G(void 0);
|
|
517
517
|
}).finally(() => {
|
|
518
|
-
|
|
518
|
+
Ie(!1);
|
|
519
519
|
});
|
|
520
520
|
}).catch(() => {
|
|
521
|
-
ce(""), G(void 0),
|
|
521
|
+
ce(""), G(void 0), Ie(!1);
|
|
522
522
|
});
|
|
523
523
|
});
|
|
524
524
|
};
|
|
@@ -528,7 +528,7 @@ ${e}`), e;
|
|
|
528
528
|
top: t.scrollHeight
|
|
529
529
|
});
|
|
530
530
|
}, [b]);
|
|
531
|
-
const
|
|
531
|
+
const nt = (t, n) => new Promise((a) => {
|
|
532
532
|
if (!n.file.url || !(o != null && o.id))
|
|
533
533
|
return a();
|
|
534
534
|
const l = He(Oe({}, n.file), {
|
|
@@ -553,12 +553,12 @@ ${e}`), e;
|
|
|
553
553
|
if (!H.current)
|
|
554
554
|
return;
|
|
555
555
|
const t = H.current.scrollTop <= -80;
|
|
556
|
-
|
|
556
|
+
Yt(t);
|
|
557
557
|
}, rn = Re((t) => {
|
|
558
558
|
var n, a;
|
|
559
559
|
(n = fe.current) == null || n.update(t), (a = fe.current) == null || a.focus();
|
|
560
560
|
}), an = Re((t) => {
|
|
561
|
-
|
|
561
|
+
Se(t);
|
|
562
562
|
}), ln = Re(() => {
|
|
563
563
|
var n;
|
|
564
564
|
if (!((n = e == null ? void 0 : e.data) != null && n.id))
|
|
@@ -569,7 +569,7 @@ ${e}`), e;
|
|
|
569
569
|
});
|
|
570
570
|
L(() => {
|
|
571
571
|
var t, n;
|
|
572
|
-
ze.current = (t = e == null ? void 0 : e.data) == null ? void 0 : t.id, !Qe && ((n =
|
|
572
|
+
ze.current = (t = e == null ? void 0 : e.data) == null ? void 0 : t.id, !Qe && ((n = Ne.current) == null || n.clear());
|
|
573
573
|
}, [e]);
|
|
574
574
|
const dn = () => {
|
|
575
575
|
var a;
|
|
@@ -578,7 +578,7 @@ ${e}`), e;
|
|
|
578
578
|
const n = b[b.length - 1].messageTime;
|
|
579
579
|
e.fetchMessages({
|
|
580
580
|
endTime: n,
|
|
581
|
-
pageSize:
|
|
581
|
+
pageSize: kt
|
|
582
582
|
}).then((l) => {
|
|
583
583
|
const i = l || [];
|
|
584
584
|
if (!i || !(i != null && i.length)) {
|
|
@@ -627,7 +627,7 @@ ${e}`), e;
|
|
|
627
627
|
if (e)
|
|
628
628
|
return;
|
|
629
629
|
const t = () => {
|
|
630
|
-
const l = ((I == null ? void 0 : I.promptVariables) || []).filter((i) => i.type ? !(i.type ===
|
|
630
|
+
const l = ((I == null ? void 0 : I.promptVariables) || []).filter((i) => i.type ? !(i.type === be.User && i.key === "query") && !(i.type === be.System && i.key === "datetime") && i.status === 1 : i.key !== "query" && i.status === 1).map((i, c) => {
|
|
631
631
|
var p, N;
|
|
632
632
|
let s = "";
|
|
633
633
|
return typeof (r == null ? void 0 : r.promptVariables) == "object" && (s = ((N = (p = r.promptVariables.default) == null ? void 0 : p.find((T) => T.key === i.key && T.type === i.type)) == null ? void 0 : N.value) || ""), {
|
|
@@ -644,14 +644,14 @@ ${e}`), e;
|
|
|
644
644
|
I == null || I.removeEventListener("ready", t);
|
|
645
645
|
};
|
|
646
646
|
}, [e, I, r == null ? void 0 : r.promptVariables]);
|
|
647
|
-
const
|
|
647
|
+
const it = () => w == null ? void 0 : w({
|
|
648
648
|
netOpen: E ? W.OPEN : W.CLOSE
|
|
649
649
|
}).then((t) => {
|
|
650
650
|
var n, a;
|
|
651
|
-
return v == null || v(t), U(!1), P(!!((n = t.data) != null && n.netOpen)), S(!!((a = t.data) != null && a.enableNetOpen)),
|
|
652
|
-
}),
|
|
651
|
+
return v == null || v(t), U(!1), P(!!((n = t.data) != null && n.netOpen)), S(!!((a = t.data) != null && a.enableNetOpen)), et(t), t;
|
|
652
|
+
}), ot = xn(() => {
|
|
653
653
|
var t;
|
|
654
|
-
return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ d(
|
|
654
|
+
return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ d(Ct, {
|
|
655
655
|
application: o,
|
|
656
656
|
history: {
|
|
657
657
|
role: 1,
|
|
@@ -661,7 +661,7 @@ ${e}`), e;
|
|
|
661
661
|
sessionId: "",
|
|
662
662
|
reference: [],
|
|
663
663
|
searchReference: [],
|
|
664
|
-
messageTime:
|
|
664
|
+
messageTime: It(Date.now()).format("YYYY-MM-DD HH:mm:ss"),
|
|
665
665
|
actions: [],
|
|
666
666
|
isLoading: !1
|
|
667
667
|
},
|
|
@@ -680,11 +680,11 @@ ${e}`), e;
|
|
|
680
680
|
t && ie((a) => He(Oe({}, a), {
|
|
681
681
|
[t]: []
|
|
682
682
|
}));
|
|
683
|
-
}, [(
|
|
683
|
+
}, [(st = e == null ? void 0 : e.data) == null ? void 0 : st.id]), /* @__PURE__ */ V("div", {
|
|
684
684
|
className: "agent-chat",
|
|
685
|
-
children: [
|
|
685
|
+
children: [Gt ? /* @__PURE__ */ d("div", {
|
|
686
686
|
className: "session-loading",
|
|
687
|
-
children: /* @__PURE__ */ d(
|
|
687
|
+
children: /* @__PURE__ */ d(vt, {})
|
|
688
688
|
}) : /* @__PURE__ */ V(yn, {
|
|
689
689
|
children: [(g == null ? void 0 : g.promptVariables) && /* @__PURE__ */ d(Vn, {
|
|
690
690
|
ref: Be,
|
|
@@ -696,7 +696,7 @@ ${e}`), e;
|
|
|
696
696
|
}), /* @__PURE__ */ V("div", {
|
|
697
697
|
className: "chat-main",
|
|
698
698
|
id: "chat-main",
|
|
699
|
-
style:
|
|
699
|
+
style: Pt,
|
|
700
700
|
children: [/* @__PURE__ */ d("div", {
|
|
701
701
|
className: "chat-main-wrapper",
|
|
702
702
|
id: "scrollableDiv",
|
|
@@ -708,7 +708,7 @@ ${e}`), e;
|
|
|
708
708
|
},
|
|
709
709
|
ref: H,
|
|
710
710
|
onScroll: sn,
|
|
711
|
-
children: (
|
|
711
|
+
children: (rt = e == null ? void 0 : e.data) != null && rt.id && (b != null && b.length) ? /* @__PURE__ */ V(qn, {
|
|
712
712
|
dataLength: b.length,
|
|
713
713
|
next: dn,
|
|
714
714
|
style: {
|
|
@@ -717,8 +717,8 @@ ${e}`), e;
|
|
|
717
717
|
overflowX: "hidden"
|
|
718
718
|
},
|
|
719
719
|
inverse: !0,
|
|
720
|
-
endMessage: b.length >
|
|
721
|
-
((
|
|
720
|
+
endMessage: b.length > kt && // 少于一页不展示这个提示
|
|
721
|
+
((at = H.current) != null && at.scrollTop) && ((lt = H.current) == null ? void 0 : lt.scrollTop) < -10 ? /* @__PURE__ */ d(wn, {
|
|
722
722
|
plain: !0,
|
|
723
723
|
children: "没有更多数据了"
|
|
724
724
|
}) : null,
|
|
@@ -729,7 +729,7 @@ ${e}`), e;
|
|
|
729
729
|
textAlign: "center",
|
|
730
730
|
overflow: "hidden"
|
|
731
731
|
},
|
|
732
|
-
children: /* @__PURE__ */ d(
|
|
732
|
+
children: /* @__PURE__ */ d(vt, {})
|
|
733
733
|
}),
|
|
734
734
|
scrollableTarget: "scrollableDiv",
|
|
735
735
|
children: [b.map((t, n) => /* @__PURE__ */ d(Qn, {
|
|
@@ -742,15 +742,15 @@ ${e}`), e;
|
|
|
742
742
|
onAgainClick: ln,
|
|
743
743
|
onEditClick: rn,
|
|
744
744
|
markdown: r == null ? void 0 : r.markdown
|
|
745
|
-
}, t.messageId + n)), !_e &&
|
|
745
|
+
}, t.messageId + n)), !_e && ot]
|
|
746
746
|
}) : /* @__PURE__ */ V("div", {
|
|
747
747
|
className: "main-empty",
|
|
748
748
|
children: [(r == null ? void 0 : r.greeting) !== !1 && /* @__PURE__ */ d(Dn, {
|
|
749
|
-
text: r === void 0 || r.greeting === !0 || ((
|
|
750
|
-
icon: r === void 0 || r.greeting === !0 || ((
|
|
749
|
+
text: r === void 0 || r.greeting === !0 || ((dt = r.greeting) == null ? void 0 : dt.text) === void 0 ? xt.text : r.greeting.text,
|
|
750
|
+
icon: r === void 0 || r.greeting === !0 || ((ct = r.greeting) == null ? void 0 : ct.icon) === void 0 ? Tt || xt.icon : r.greeting.icon,
|
|
751
751
|
children: !!Ae.length && (((r == null ? void 0 : r.greeting) === void 0 || (r == null ? void 0 : r.greeting)) === !0 || typeof (r == null ? void 0 : r.greeting) == "object" && r.greeting.questions !== !1) && /* @__PURE__ */ d(Rn, {
|
|
752
|
-
ref:
|
|
753
|
-
sid: (
|
|
752
|
+
ref: Ne,
|
|
753
|
+
sid: (ft = e == null ? void 0 : e.data) == null ? void 0 : ft.id,
|
|
754
754
|
isRecommendClearing: $e,
|
|
755
755
|
data: Ae,
|
|
756
756
|
layoutBreakpoints: typeof (r == null ? void 0 : r.greeting) == "object" ? r.greeting.layoutBreakpoints : void 0,
|
|
@@ -762,18 +762,18 @@ ${e}`), e;
|
|
|
762
762
|
const n = (a = e == null ? void 0 : e.data) == null ? void 0 : a.id;
|
|
763
763
|
g != null && g.fileUpload ? (i = (l = ge.current) == null ? void 0 : l.clear()) == null || i.then(() => {
|
|
764
764
|
var c, s;
|
|
765
|
-
t != null && t.id && (n ? (c =
|
|
765
|
+
t != null && t.id && (n ? (c = nt(n, t)) == null || c.finally(() => {
|
|
766
766
|
X(!1);
|
|
767
|
-
}) : (X(!1), U(!0), (s =
|
|
767
|
+
}) : (X(!1), U(!0), (s = it()) == null || s.then((p) => {
|
|
768
768
|
var N;
|
|
769
|
-
(N =
|
|
769
|
+
(N = nt(p.id, t)) == null || N.finally(() => {
|
|
770
770
|
X(!1);
|
|
771
771
|
});
|
|
772
772
|
})));
|
|
773
|
-
}) : n ? X(!1) : (X(!1), U(!0),
|
|
773
|
+
}) : n ? X(!1) : (X(!1), U(!0), it());
|
|
774
774
|
}
|
|
775
775
|
})
|
|
776
|
-
}),
|
|
776
|
+
}), ot]
|
|
777
777
|
})
|
|
778
778
|
}), Ye && /* @__PURE__ */ d("div", {
|
|
779
779
|
className: "session-stop",
|
|
@@ -825,11 +825,11 @@ ${e}`), e;
|
|
|
825
825
|
},
|
|
826
826
|
onUrlChange: (t) => ce(t)
|
|
827
827
|
})
|
|
828
|
-
}), /* @__PURE__ */ V(
|
|
828
|
+
}), /* @__PURE__ */ V(ve, {
|
|
829
829
|
className: "footer-upload-action",
|
|
830
830
|
onClick: (t) => t.preventDefault(),
|
|
831
|
-
children: [/* @__PURE__ */ V(
|
|
832
|
-
children: [o.type ===
|
|
831
|
+
children: [/* @__PURE__ */ V(ve, {
|
|
832
|
+
children: [o.type === wt.Agent && (g == null ? void 0 : g.imageUpload) && /* @__PURE__ */ d(Cn, {
|
|
833
833
|
disabled: !!ne || D,
|
|
834
834
|
accept: ".jpg, .png, .jpeg,.bmp",
|
|
835
835
|
listType: "picture-card",
|
|
@@ -892,8 +892,8 @@ ${e}`), e;
|
|
|
892
892
|
t(a);
|
|
893
893
|
});
|
|
894
894
|
}),
|
|
895
|
-
sid: (
|
|
896
|
-
disabled:
|
|
895
|
+
sid: (gt = e == null ? void 0 : e.data) == null ? void 0 : gt.id,
|
|
896
|
+
disabled: Le || D,
|
|
897
897
|
afterFileAdd: (t, n) => {
|
|
898
898
|
n && ie((a) => {
|
|
899
899
|
const l = a[n] || [];
|
|
@@ -913,9 +913,9 @@ ${e}`), e;
|
|
|
913
913
|
});
|
|
914
914
|
},
|
|
915
915
|
onFileListChange: (t) => {
|
|
916
|
-
|
|
916
|
+
$t(t);
|
|
917
917
|
},
|
|
918
|
-
shouldContinue:
|
|
918
|
+
shouldContinue: Bt,
|
|
919
919
|
afterFilesClear: () => {
|
|
920
920
|
var n;
|
|
921
921
|
const t = (n = e == null ? void 0 : e.data) == null ? void 0 : n.id;
|
|
@@ -926,28 +926,28 @@ ${e}`), e;
|
|
|
926
926
|
}) : null, (g == null ? void 0 : g.prompt) && (o == null ? void 0 : o.id) && /* @__PURE__ */ d(Wn, {
|
|
927
927
|
appId: o.id,
|
|
928
928
|
list: [],
|
|
929
|
-
search: qe ?
|
|
929
|
+
search: qe ? Mt : "",
|
|
930
930
|
onPromptSelect: (t) => {
|
|
931
931
|
Z(t.context), le(t.context);
|
|
932
932
|
},
|
|
933
933
|
disabled: D
|
|
934
934
|
})]
|
|
935
|
-
}), /* @__PURE__ */ V(
|
|
936
|
-
children: [(g == null ? void 0 : g.connectNetwork) && o.type === 0 && ((
|
|
937
|
-
sessionId: (
|
|
935
|
+
}), /* @__PURE__ */ V(ve, {
|
|
936
|
+
children: [(g == null ? void 0 : g.connectNetwork) && o.type === 0 && ((ut = o.arrange) == null ? void 0 : ut.length) && !!o.arrange[0].enableNetOpen && /* @__PURE__ */ d(Bn, {
|
|
937
|
+
sessionId: (mt = e == null ? void 0 : e.data) == null ? void 0 : mt.id,
|
|
938
938
|
netStatus: E,
|
|
939
|
-
enable: typeof (r == null ? void 0 : r.connectNetwork) == "object" && typeof (r == null ? void 0 : r.connectNetwork.diabled) == "boolean" ? !(r != null && r.connectNetwork.diabled) :
|
|
939
|
+
enable: typeof (r == null ? void 0 : r.connectNetwork) == "object" && typeof (r == null ? void 0 : r.connectNetwork.diabled) == "boolean" ? !(r != null && r.connectNetwork.diabled) : _t,
|
|
940
940
|
disabledTip: e ? void 0 : "网络访问已被禁用",
|
|
941
941
|
onNetStatusChange: (t) => {
|
|
942
942
|
cn(t);
|
|
943
943
|
}
|
|
944
944
|
}), (g == null ? void 0 : g.sessionList) && /* @__PURE__ */ d(An, {
|
|
945
|
-
currentSessionId: (
|
|
945
|
+
currentSessionId: (ht = e == null ? void 0 : e.data) == null ? void 0 : ht.id,
|
|
946
946
|
onSessionChange: (t, n) => {
|
|
947
|
-
Z(void 0),
|
|
947
|
+
Z(void 0), pe(!0), v == null || v(n);
|
|
948
948
|
},
|
|
949
949
|
disabled: D
|
|
950
|
-
}),
|
|
950
|
+
}), Ot && Ht === "float" && /* @__PURE__ */ d("div", {
|
|
951
951
|
className: "session-history-drawer-component",
|
|
952
952
|
children: /* @__PURE__ */ d(Nn, {
|
|
953
953
|
placement: "topRight",
|
|
@@ -978,7 +978,7 @@ ${e}`), e;
|
|
|
978
978
|
disabled: Ye || !e || !b.length || D,
|
|
979
979
|
onClick: () => {
|
|
980
980
|
var t, n;
|
|
981
|
-
v == null || v(null), P(!1), (t = Be.current) == null || t.clear(), (n =
|
|
981
|
+
pe(!1), v == null || v(null), P(!1), (t = Be.current) == null || t.clear(), (n = Ne.current) == null || n.clear();
|
|
982
982
|
},
|
|
983
983
|
children: "新会话"
|
|
984
984
|
})]
|
|
@@ -987,22 +987,22 @@ ${e}`), e;
|
|
|
987
987
|
className: "footer-textarea",
|
|
988
988
|
children: /* @__PURE__ */ d(Hn, {
|
|
989
989
|
ref: fe,
|
|
990
|
-
maxLength:
|
|
991
|
-
text:
|
|
990
|
+
maxLength: Rt,
|
|
991
|
+
text: zt,
|
|
992
992
|
networkStatus: !1,
|
|
993
993
|
loading: Ge || ye,
|
|
994
994
|
disabled: Ue || Ve || D || Ge || ye,
|
|
995
|
-
onTextSend:
|
|
995
|
+
onTextSend: Se,
|
|
996
996
|
onChange: (t, n) => {
|
|
997
997
|
Z(t);
|
|
998
998
|
const a = n.getText().replace(/[\n\s]+$/, "");
|
|
999
|
-
le(a),
|
|
999
|
+
le(a), Ut(a), qe || jt(!0);
|
|
1000
1000
|
},
|
|
1001
|
-
clearAction: /* @__PURE__ */ d(
|
|
1001
|
+
clearAction: /* @__PURE__ */ d(ve, {
|
|
1002
1002
|
size: 0,
|
|
1003
1003
|
children: /* @__PURE__ */ d(Q, {
|
|
1004
1004
|
type: "link",
|
|
1005
|
-
disabled:
|
|
1005
|
+
disabled: Le || D,
|
|
1006
1006
|
ghost: !0,
|
|
1007
1007
|
icon: /* @__PURE__ */ d(re, {
|
|
1008
1008
|
style: {
|
|
@@ -1017,13 +1017,13 @@ ${e}`), e;
|
|
|
1017
1017
|
})]
|
|
1018
1018
|
})
|
|
1019
1019
|
}), /* @__PURE__ */ d(Fn, {
|
|
1020
|
-
tips:
|
|
1020
|
+
tips: Et
|
|
1021
1021
|
}), We && /* @__PURE__ */ d(zn, {
|
|
1022
1022
|
isvisible: We,
|
|
1023
|
-
files:
|
|
1024
|
-
sessionId: (
|
|
1023
|
+
files: At,
|
|
1024
|
+
sessionId: (yt = e == null ? void 0 : e.data) == null ? void 0 : yt.id,
|
|
1025
1025
|
onClose: (t) => {
|
|
1026
|
-
|
|
1026
|
+
Vt(!1), Wt(!1);
|
|
1027
1027
|
}
|
|
1028
1028
|
})]
|
|
1029
1029
|
}), Xe && /* @__PURE__ */ d($n, {
|
|
@@ -1035,7 +1035,7 @@ ${e}`), e;
|
|
|
1035
1035
|
isSessionHistoryVisible: Xe,
|
|
1036
1036
|
setIsSessionHistoryVisible: Ze,
|
|
1037
1037
|
onSessionChange: (t) => {
|
|
1038
|
-
|
|
1038
|
+
pe(!0);
|
|
1039
1039
|
}
|
|
1040
1040
|
})]
|
|
1041
1041
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e = "@glodon-aiot/agent-cli-ui", t = "3.5.0", s = "./dist/es/index.mjs", o = "./dist/lib/index.js", i = "./dist/src/index.d.ts", n = {
|
|
1
|
+
const e = "@glodon-aiot/agent-cli-ui", t = "3.5.1-beta.0", s = "./dist/es/index.mjs", o = "./dist/lib/index.js", i = "./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"
|
|
@@ -25,8 +25,8 @@ const e = "@glodon-aiot/agent-cli-ui", t = "3.5.0", s = "./dist/es/index.mjs", o
|
|
|
25
25
|
webpack: "*"
|
|
26
26
|
}, p = {
|
|
27
27
|
"@ant-design/icons": "^5.3.4",
|
|
28
|
-
"@glodon-aiot/apis": "^3.5.0",
|
|
29
|
-
"@glodon-aiot/bot-client-sdk": "^3.5.0",
|
|
28
|
+
"@glodon-aiot/apis": "^3.5.1-beta.0",
|
|
29
|
+
"@glodon-aiot/bot-client-sdk": "^3.5.1-beta.0",
|
|
30
30
|
"@matejmazur/react-mathjax": "^0.1.10",
|
|
31
31
|
"@react-pdf-viewer/core": "^3.12.0",
|
|
32
32
|
"@react-pdf-viewer/default-layout": "^3.12.0",
|