@glodon-aiot/agent-cli-ui 3.4.2-beta.1 → 3.4.2-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/Dialog/AgentChat/index.mjs +104 -92
- 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/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/style21.css +1 -1
- package/dist/es/src/style22.css +1 -1
- package/dist/es/src/style24.css +1 -1
- package/dist/es/src/style25.css +1 -1
- package/dist/es/src/style27.css +1 -1
- package/dist/es/src/style28.css +1 -1
- package/dist/es/src/style30.css +1 -1
- package/dist/es/src/style31.css +1 -1
- package/dist/es/src/style32.css +1 -1
- package/dist/es/src/style4.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 +33 -33
- package/package.json +3 -3
|
@@ -18,20 +18,20 @@ var j = (x, k, o) => new Promise((Y, e) => {
|
|
|
18
18
|
} catch (P) {
|
|
19
19
|
e(P);
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, ke = (E) => {
|
|
22
22
|
try {
|
|
23
23
|
p(o.throw(E));
|
|
24
24
|
} catch (P) {
|
|
25
25
|
e(P);
|
|
26
26
|
}
|
|
27
|
-
}, p = (E) => E.done ? Y(E.value) : Promise.resolve(E.value).then(L,
|
|
27
|
+
}, p = (E) => E.done ? Y(E.value) : Promise.resolve(E.value).then(L, ke);
|
|
28
28
|
p((o = o.apply(x, k)).next());
|
|
29
29
|
});
|
|
30
30
|
import { jsx as c, jsxs as z, Fragment as un } from "react/jsx-runtime";
|
|
31
|
-
import { memo as hn, forwardRef as mn, useState as h, useRef as
|
|
32
|
-
/* empty css */import { Spin as mt, Divider as kn, Button as
|
|
31
|
+
import { memo as hn, forwardRef as mn, useState as h, useRef as W, useContext as yn, useEffect as C, useMemo as pn, useImperativeHandle as vn } from "react";
|
|
32
|
+
/* empty css */import { Spin as mt, Divider as kn, Button as Q, Space as ye, Upload as wn, Tooltip as bn, Popover as xn, notification as pe, message as u } from "antd";
|
|
33
33
|
import ie from "../../components/Iconfont/index.mjs";
|
|
34
|
-
import { IHistoryRole as
|
|
34
|
+
import { IHistoryRole as S, ChatMessageRole as yt, PromptVariableType as ve } from "@glodon-aiot/apis";
|
|
35
35
|
import kt from "./HistoryItem/index.mjs";
|
|
36
36
|
import wt from "dayjs";
|
|
37
37
|
import { v4 as Oe } from "uuid";
|
|
@@ -83,17 +83,17 @@ const vt = 10, xi = mn((x, k) => {
|
|
|
83
83
|
docViewerUrl: Y = "",
|
|
84
84
|
currentSession: e,
|
|
85
85
|
onCreateSession: L,
|
|
86
|
-
embeddingService:
|
|
86
|
+
embeddingService: ke,
|
|
87
87
|
setCurrentSession: p,
|
|
88
88
|
networkStatus: E,
|
|
89
89
|
setNetworkStatus: P
|
|
90
|
-
} = x, [v, I] = h([]), [bt, se] = h(), [
|
|
90
|
+
} = x, [v, I] = h([]), [bt, se] = h(), [we, He] = h(), H = W(null), {
|
|
91
91
|
service: T,
|
|
92
92
|
agentClient: N,
|
|
93
93
|
depId: xt,
|
|
94
94
|
footer: It,
|
|
95
95
|
transform: g,
|
|
96
|
-
defaultInput:
|
|
96
|
+
defaultInput: be,
|
|
97
97
|
onMessage: re,
|
|
98
98
|
onHistoryLoad: Re,
|
|
99
99
|
beforeMessageSend: V,
|
|
@@ -104,7 +104,7 @@ const vt = 10, xi = mn((x, k) => {
|
|
|
104
104
|
icon: Ct,
|
|
105
105
|
sider: Lt,
|
|
106
106
|
mode: Et
|
|
107
|
-
} = yn(In), [De,
|
|
107
|
+
} = yn(In), [De, xe] = h(!1), m = W(v), Ue = W(void 0), [Pt, Tt] = h(0), [ee, _] = h(), [G, ae] = h(""), [Me, Ie] = h(!1), le = W(null), [je, Ft] = h([]), [ze, X] = h(!1), [Ve, Ot] = h(!1), [Ht, Rt] = h(""), [Dt, Z] = h(), [de, ce] = h({}), fe = W(null), Ae = W(null), Ne = W(null), [qe, Ut] = h(!1), [Mt, jt] = h([]), [zt, ge] = h(!0), [Vt, At] = h(!0), [Be, U] = h(!1), [Ce, A] = h(!1), [$e, qt] = h(!1), [O, ue] = h(typeof (s == null ? void 0 : s.promptVariables) == "object" ? s.promptVariables.default || [] : []), [Bt, $t] = h(typeof (s == null ? void 0 : s.knowledges) == "object" && s.knowledges.default || void 0), [Ye, M] = h(!1), [Ke, te] = h(!1), [Yt, J] = h(typeof (s == null ? void 0 : s.connectNetwork) == "object" && typeof (s == null ? void 0 : s.connectNetwork.default) == "boolean" ? s.connectNetwork.default : !1), [We, he] = h(!1), [Kt, q] = h(!1), [Wt, Qt] = h(null), [me, K] = h(!1), [Qe, _e] = h(!1), {
|
|
108
108
|
isSwitchingToExistingSession: _t,
|
|
109
109
|
setIsSwitchingToExistingSession: Le
|
|
110
110
|
} = Bn();
|
|
@@ -138,7 +138,7 @@ const vt = 10, xi = mn((x, k) => {
|
|
|
138
138
|
}
|
|
139
139
|
const n = (l) => {
|
|
140
140
|
var r;
|
|
141
|
-
(r = e == null ? void 0 : e.data) != null && r.id && (m.current = [...l].reverse(), I([...l].reverse()), !l || l.length < 10 ?
|
|
141
|
+
(r = e == null ? void 0 : e.data) != null && r.id && (m.current = [...l].reverse(), I([...l].reverse()), !l || l.length < 10 ? te(!1) : te(!0), q(!1), Re && Re({
|
|
142
142
|
applicationId: o.id,
|
|
143
143
|
sessionId: e.data.id,
|
|
144
144
|
histories: l
|
|
@@ -161,11 +161,11 @@ const vt = 10, xi = mn((x, k) => {
|
|
|
161
161
|
return;
|
|
162
162
|
const t = (a) => {
|
|
163
163
|
var i;
|
|
164
|
-
console.error(a.message, a.cause, "e.case"),
|
|
164
|
+
console.error(a.message, a.cause, "e.case"), pe.config({
|
|
165
165
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
166
|
-
}),
|
|
166
|
+
}), pe.error({
|
|
167
167
|
message: ((i = a.cause) == null ? void 0 : i.message) || a.message
|
|
168
|
-
}),
|
|
168
|
+
}), pe.config({
|
|
169
169
|
getContainer: void 0
|
|
170
170
|
});
|
|
171
171
|
};
|
|
@@ -187,7 +187,7 @@ const vt = 10, xi = mn((x, k) => {
|
|
|
187
187
|
return;
|
|
188
188
|
} else
|
|
189
189
|
e.clear().then(() => {
|
|
190
|
-
const i = new oe("", t,
|
|
190
|
+
const i = new oe("", t, S.System);
|
|
191
191
|
i.isContext = !0, I([i, ...v]);
|
|
192
192
|
});
|
|
193
193
|
};
|
|
@@ -225,7 +225,7 @@ const vt = 10, xi = mn((x, k) => {
|
|
|
225
225
|
return;
|
|
226
226
|
} else
|
|
227
227
|
console.error("变量值不能为空", O == null ? void 0 : O.map((w) => !!(w != null && w.value)));
|
|
228
|
-
if (
|
|
228
|
+
if (Ce) {
|
|
229
229
|
u.config({
|
|
230
230
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
231
231
|
}), u.error("正在回复中"), u.config({
|
|
@@ -257,25 +257,27 @@ const vt = 10, xi = mn((x, k) => {
|
|
|
257
257
|
});
|
|
258
258
|
return;
|
|
259
259
|
}
|
|
260
|
-
|
|
260
|
+
_(void 0), ae("");
|
|
261
261
|
const i = (y = e == null ? void 0 : e.data) == null ? void 0 : y.id;
|
|
262
262
|
if (!i) {
|
|
263
|
-
if (
|
|
263
|
+
if (me)
|
|
264
264
|
return;
|
|
265
|
-
|
|
265
|
+
K(!0), L == null || L({
|
|
266
266
|
netOpen: E ? $.OPEN : $.CLOSE
|
|
267
267
|
}).then((w) => {
|
|
268
268
|
var B, ne;
|
|
269
|
-
M(!0), P(!!((B = w.data) != null && B.netOpen)),
|
|
270
|
-
p == null || p(w), M(!1), He(n)
|
|
269
|
+
M(!0), P(!!((B = w.data) != null && B.netOpen)), J(!!((ne = w.data) != null && ne.enableNetOpen)), Xe(w).then(() => {
|
|
270
|
+
p == null || p(w), M(!1), He(n);
|
|
271
271
|
});
|
|
272
272
|
}).catch((w) => {
|
|
273
|
-
|
|
273
|
+
K(!1);
|
|
274
274
|
});
|
|
275
275
|
return;
|
|
276
276
|
}
|
|
277
|
-
|
|
278
|
-
|
|
277
|
+
if (me)
|
|
278
|
+
return;
|
|
279
|
+
K(!0), he(!0);
|
|
280
|
+
const l = G ? `
|
|
279
281
|
${n}` : n;
|
|
280
282
|
let r;
|
|
281
283
|
try {
|
|
@@ -292,12 +294,18 @@ ${n}` : n;
|
|
|
292
294
|
} catch (w) {
|
|
293
295
|
r = !1;
|
|
294
296
|
}
|
|
295
|
-
if (he(!1), r === !1)
|
|
297
|
+
if (he(!1), r === !1) {
|
|
298
|
+
K(!1);
|
|
296
299
|
return;
|
|
300
|
+
}
|
|
297
301
|
let d = n;
|
|
298
|
-
typeof r == "object" && (d = r.content || n), (yield e.setPromptVariables(O))
|
|
302
|
+
if (typeof r == "object" && (d = r.content || n), !(yield e.setPromptVariables(O))) {
|
|
303
|
+
K(!1);
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
((F = de[i]) == null ? void 0 : F.length) > 0 ? Xt(d) : Ee(d);
|
|
299
307
|
}), Xe = (t) => new Promise((n, a) => j(void 0, null, function* () {
|
|
300
|
-
const r = (t == null ? void 0 : t.promptVariables).filter((d) => d.type ? !((d.type ===
|
|
308
|
+
const r = (t == null ? void 0 : t.promptVariables).filter((d) => d.type ? !((d.type === ve.User || d.type === void 0) && d.key === "query") && !((d.type === ve.System || d.type === void 0) && d.key === "datetime") : d.key !== "query").map((d) => {
|
|
301
309
|
var y;
|
|
302
310
|
const b = (y = O.find((F) => F.key === d.key && F.type === d.type)) == null ? void 0 : y.value;
|
|
303
311
|
return d.value = b || "", d;
|
|
@@ -328,11 +336,11 @@ ${n}` : n;
|
|
|
328
336
|
});
|
|
329
337
|
};
|
|
330
338
|
C(() => {
|
|
331
|
-
if (!
|
|
339
|
+
if (!we || !e)
|
|
332
340
|
return;
|
|
333
|
-
const t =
|
|
341
|
+
const t = we, n = () => j(void 0, null, function* () {
|
|
334
342
|
he(!0);
|
|
335
|
-
const a =
|
|
343
|
+
const a = G ? `
|
|
336
344
|
${t}` : t;
|
|
337
345
|
let i;
|
|
338
346
|
try {
|
|
@@ -349,26 +357,30 @@ ${t}` : t;
|
|
|
349
357
|
} catch (l) {
|
|
350
358
|
i = !1;
|
|
351
359
|
}
|
|
352
|
-
he(!1), i
|
|
360
|
+
if (he(!1), i === !1) {
|
|
361
|
+
K(!1);
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
364
|
+
Ee(t), He(void 0);
|
|
353
365
|
});
|
|
354
366
|
return e.ready ? n() : e.addEventListener("ready", n, !0), () => {
|
|
355
367
|
e == null || e.removeEventListener("ready", n);
|
|
356
368
|
};
|
|
357
|
-
}, [
|
|
369
|
+
}, [we, e]);
|
|
358
370
|
const Ee = (t, n) => j(void 0, null, function* () {
|
|
359
371
|
var y, F;
|
|
360
372
|
const a = (y = e == null ? void 0 : e.data) == null ? void 0 : y.id;
|
|
361
373
|
if (!a)
|
|
362
374
|
return;
|
|
363
375
|
A(!0), U(!0);
|
|
364
|
-
const i =
|
|
365
|
-
${t}` : t, l = new oe(i, a,
|
|
366
|
-
se(void 0),
|
|
376
|
+
const i = G ? `
|
|
377
|
+
${t}` : t, l = new oe(i, a, S.User, n);
|
|
378
|
+
se(void 0), Z(void 0), m.current = [l, ...v], I(m.current), o.id && re && re({
|
|
367
379
|
applicationId: o.id,
|
|
368
380
|
sessionId: a,
|
|
369
381
|
message: l
|
|
370
382
|
});
|
|
371
|
-
const r = new oe("", a,
|
|
383
|
+
const r = new oe("", a, S.System);
|
|
372
384
|
r.isWaiting = !0, m.current = [r, ...m.current], I(m.current);
|
|
373
385
|
const d = (n == null ? void 0 : n.map((w) => w.id)) || [], b = {
|
|
374
386
|
stream: Nn.stream,
|
|
@@ -388,7 +400,7 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
388
400
|
files: n
|
|
389
401
|
}, b), ce({
|
|
390
402
|
[a]: []
|
|
391
|
-
}), (F = fe.current) == null || F.update();
|
|
403
|
+
}), (F = fe.current) == null || F.update(), K(!1);
|
|
392
404
|
});
|
|
393
405
|
C(() => {
|
|
394
406
|
var a;
|
|
@@ -396,13 +408,13 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
396
408
|
if (!t)
|
|
397
409
|
return;
|
|
398
410
|
const n = (i) => {
|
|
399
|
-
if (!i.sessionId || i.sessionId && i.sessionId !== Ue.current || i.role ===
|
|
411
|
+
if (!i.sessionId || i.sessionId && i.sessionId !== Ue.current || i.role === S.User)
|
|
400
412
|
return;
|
|
401
413
|
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))
|
|
402
|
-
return
|
|
414
|
+
return pe.error({
|
|
403
415
|
message: i.content
|
|
404
416
|
});
|
|
405
|
-
const l = i.actions || [], r = new oe(i.content, t,
|
|
417
|
+
const l = i.actions || [], r = new oe(i.content, t, S.Robot);
|
|
406
418
|
r.messageId = i.messageId || Oe(), 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 && re && re({
|
|
407
419
|
applicationId: o.id,
|
|
408
420
|
sessionId: t,
|
|
@@ -416,13 +428,13 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
416
428
|
};
|
|
417
429
|
}, [e]), C(() => {
|
|
418
430
|
if (!e) {
|
|
419
|
-
|
|
431
|
+
xe(!1);
|
|
420
432
|
return;
|
|
421
433
|
}
|
|
422
434
|
const t = (n) => {
|
|
423
|
-
|
|
435
|
+
xe(n);
|
|
424
436
|
};
|
|
425
|
-
return
|
|
437
|
+
return xe(e.frozen), e.addEventListener("frozen", t), () => {
|
|
426
438
|
e == null || e.removeEventListener("frozen", t);
|
|
427
439
|
};
|
|
428
440
|
}, [e]), C(() => {
|
|
@@ -431,8 +443,8 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
431
443
|
const t = N.questionContextMaxLength || 4e3;
|
|
432
444
|
Tt(t);
|
|
433
445
|
}, [N, T]), C(() => {
|
|
434
|
-
|
|
435
|
-
}, [
|
|
446
|
+
be && Z(be.text);
|
|
447
|
+
}, [be]);
|
|
436
448
|
const Zt = (t) => {
|
|
437
449
|
const n = t.size;
|
|
438
450
|
return n <= 0 ? (u.config({
|
|
@@ -443,15 +455,15 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
443
455
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
444
456
|
}), u.error("图片须小于20M"), u.config({
|
|
445
457
|
getContainer: void 0
|
|
446
|
-
}), !1) : (
|
|
458
|
+
}), !1) : (_(t), !1);
|
|
447
459
|
}, Jt = (t) => j(void 0, null, function* () {
|
|
448
460
|
var n;
|
|
449
|
-
return
|
|
461
|
+
return _(t), (n = e == null ? void 0 : e.data) != null && n.id ? Ze(e, t) : new Promise((a) => {
|
|
450
462
|
M(!0), L == null || L({
|
|
451
463
|
netOpen: E ? $.OPEN : $.CLOSE
|
|
452
464
|
}).then((i) => {
|
|
453
465
|
var l, r;
|
|
454
|
-
p == null || p(i), M(!1), P(!!((l = i.data) != null && l.netOpen)),
|
|
466
|
+
p == null || p(i), M(!1), P(!!((l = i.data) != null && l.netOpen)), J(!!((r = i.data) != null && r.enableNetOpen)), a(Ze(i, t));
|
|
455
467
|
});
|
|
456
468
|
});
|
|
457
469
|
}), Ze = (t, n) => {
|
|
@@ -464,18 +476,18 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
464
476
|
knowledgeId: ((r = t.data) == null ? void 0 : r.id) || "",
|
|
465
477
|
type: 1
|
|
466
478
|
};
|
|
467
|
-
|
|
479
|
+
Ie(!0), T == null || T.postTicket(l).then((d) => {
|
|
468
480
|
T.uploadMinioFile(d.minio, n).then(() => {
|
|
469
481
|
var w, B;
|
|
470
482
|
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];
|
|
471
483
|
i(`${location.protocol}//${b}/${y}/${F}`);
|
|
472
484
|
}).catch(() => {
|
|
473
|
-
ae(""),
|
|
485
|
+
ae(""), _(void 0);
|
|
474
486
|
}).finally(() => {
|
|
475
|
-
|
|
487
|
+
Ie(!1);
|
|
476
488
|
});
|
|
477
489
|
}).catch(() => {
|
|
478
|
-
ae(""),
|
|
490
|
+
ae(""), _(void 0), Ie(!1);
|
|
479
491
|
});
|
|
480
492
|
});
|
|
481
493
|
};
|
|
@@ -521,12 +533,12 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
521
533
|
if (!((n = e == null ? void 0 : e.data) != null && n.id))
|
|
522
534
|
return;
|
|
523
535
|
m.current = [...v.slice(1, v.length)], I(m.current);
|
|
524
|
-
const t = new oe("", e.data.id,
|
|
536
|
+
const t = new oe("", e.data.id, S.System);
|
|
525
537
|
t.isWaiting = !0, m.current = [t, ...m.current], I(m.current), A(!0), U(!0), e.answerAgain();
|
|
526
538
|
});
|
|
527
539
|
C(() => {
|
|
528
540
|
var t, n;
|
|
529
|
-
Ue.current = (t = e == null ? void 0 : e.data) == null ? void 0 : t.id, !Ye && ((n =
|
|
541
|
+
Ue.current = (t = e == null ? void 0 : e.data) == null ? void 0 : t.id, !Ye && ((n = Ne.current) == null || n.clear());
|
|
530
542
|
}, [e]);
|
|
531
543
|
const rn = () => {
|
|
532
544
|
var a;
|
|
@@ -539,10 +551,10 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
539
551
|
}).then((i) => {
|
|
540
552
|
const l = i || [];
|
|
541
553
|
if (!l || !(l != null && l.length)) {
|
|
542
|
-
|
|
554
|
+
te(!1);
|
|
543
555
|
return;
|
|
544
556
|
}
|
|
545
|
-
l.length < 10 ?
|
|
557
|
+
l.length < 10 ? te(!1) : te(!0), I([...v, ...l.reverse()]);
|
|
546
558
|
});
|
|
547
559
|
}, an = (t) => j(void 0, null, function* () {
|
|
548
560
|
var n, a;
|
|
@@ -556,8 +568,8 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
556
568
|
}), Pe = () => j(void 0, null, function* () {
|
|
557
569
|
e ? e.fetchData().then((t) => {
|
|
558
570
|
var n;
|
|
559
|
-
(n = e == null ? void 0 : e.data) != null && n.id && (P(t.netOpen),
|
|
560
|
-
}) : (P(typeof (s == null ? void 0 : s.connectNetwork) == "object" && typeof (s == null ? void 0 : s.connectNetwork.default) == "boolean" ? s.connectNetwork.default : !1),
|
|
571
|
+
(n = e == null ? void 0 : e.data) != null && n.id && (P(t.netOpen), J(t.enableNetOpen));
|
|
572
|
+
}) : (P(typeof (s == null ? void 0 : s.connectNetwork) == "object" && typeof (s == null ? void 0 : s.connectNetwork.default) == "boolean" ? s.connectNetwork.default : !1), J(o.arrange[0].enableNetOpen));
|
|
561
573
|
});
|
|
562
574
|
C(() => {
|
|
563
575
|
Pe();
|
|
@@ -584,7 +596,7 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
584
596
|
if (e)
|
|
585
597
|
return;
|
|
586
598
|
const t = () => {
|
|
587
|
-
const i = ((N == null ? void 0 : N.promptVariables) || []).filter((l) => l.type ? !(l.type ===
|
|
599
|
+
const i = ((N == null ? void 0 : N.promptVariables) || []).filter((l) => l.type ? !(l.type === ve.User && l.key === "query") && !(l.type === ve.System && l.key === "datetime") && l.status === 1 : l.key !== "query" && l.status === 1).map((l, r) => {
|
|
588
600
|
var b, y;
|
|
589
601
|
let d = "";
|
|
590
602
|
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) || ""), {
|
|
@@ -605,7 +617,7 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
605
617
|
netOpen: E ? $.OPEN : $.CLOSE
|
|
606
618
|
}).then((t) => {
|
|
607
619
|
var n, a;
|
|
608
|
-
return p == null || p(t), M(!1), P(!!((n = t.data) != null && n.netOpen)),
|
|
620
|
+
return p == null || p(t), M(!1), P(!!((n = t.data) != null && n.netOpen)), J(!!((a = t.data) != null && a.enableNetOpen)), Xe(t), t;
|
|
609
621
|
}), et = pn(() => {
|
|
610
622
|
var t;
|
|
611
623
|
return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ c(kt, {
|
|
@@ -700,35 +712,35 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
700
712
|
text: s === void 0 || s.greeting === !0 || ((ot = s.greeting) == null ? void 0 : ot.text) === void 0 ? pt.text : s.greeting.text,
|
|
701
713
|
icon: s === void 0 || s.greeting === !0 || ((st = s.greeting) == null ? void 0 : st.icon) === void 0 ? Ct || pt.icon : s.greeting.icon,
|
|
702
714
|
children: !!je.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(Tn, {
|
|
703
|
-
ref:
|
|
715
|
+
ref: Ne,
|
|
704
716
|
sid: (rt = e == null ? void 0 : e.data) == null ? void 0 : rt.id,
|
|
705
717
|
isRecommendClearing: ze,
|
|
706
718
|
data: je,
|
|
707
719
|
layoutBreakpoints: typeof (s == null ? void 0 : s.greeting) == "object" ? s.greeting.layoutBreakpoints : void 0,
|
|
708
720
|
onItemClick: (t) => {
|
|
709
721
|
var a, i, l;
|
|
710
|
-
if (se(t == null ? void 0 : t.question),
|
|
722
|
+
if (se(t == null ? void 0 : t.question), Z(t == null ? void 0 : t.question), ze)
|
|
711
723
|
return;
|
|
712
|
-
t != null && t.id &&
|
|
724
|
+
t != null && t.id && X(!0);
|
|
713
725
|
const n = (a = e == null ? void 0 : e.data) == null ? void 0 : a.id;
|
|
714
726
|
g != null && g.fileUpload ? (l = (i = fe.current) == null ? void 0 : i.clear()) == null || l.then(() => {
|
|
715
727
|
var r, d;
|
|
716
728
|
t != null && t.id && (n ? (r = Je(n, t)) == null || r.finally(() => {
|
|
717
|
-
|
|
718
|
-
}) : (
|
|
729
|
+
X(!1);
|
|
730
|
+
}) : (X(!1), M(!0), (d = Se()) == null || d.then((b) => {
|
|
719
731
|
var y;
|
|
720
732
|
(y = Je(b.id, t)) == null || y.finally(() => {
|
|
721
|
-
|
|
733
|
+
X(!1);
|
|
722
734
|
});
|
|
723
735
|
})));
|
|
724
|
-
}) : n ?
|
|
736
|
+
}) : n ? X(!1) : (X(!1), M(!0), Se());
|
|
725
737
|
}
|
|
726
738
|
})
|
|
727
739
|
}), et]
|
|
728
740
|
})
|
|
729
741
|
}), Be && /* @__PURE__ */ c("div", {
|
|
730
742
|
className: "session-stop",
|
|
731
|
-
children: /* @__PURE__ */ c(
|
|
743
|
+
children: /* @__PURE__ */ c(Q, {
|
|
732
744
|
type: "primary",
|
|
733
745
|
style: {
|
|
734
746
|
background: "white"
|
|
@@ -746,7 +758,7 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
746
758
|
})
|
|
747
759
|
}), $e && (v == null ? void 0 : v.length) > 0 && /* @__PURE__ */ c("div", {
|
|
748
760
|
className: "back-bottom",
|
|
749
|
-
children: /* @__PURE__ */ c(
|
|
761
|
+
children: /* @__PURE__ */ c(Q, {
|
|
750
762
|
size: "small",
|
|
751
763
|
onClick: () => en({
|
|
752
764
|
behavior: "smooth"
|
|
@@ -764,30 +776,30 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
764
776
|
className: "chat-footer",
|
|
765
777
|
children: /* @__PURE__ */ z("div", {
|
|
766
778
|
className: "chat-footer-input",
|
|
767
|
-
children: [
|
|
779
|
+
children: [ee && /* @__PURE__ */ c("div", {
|
|
768
780
|
className: "input-files",
|
|
769
781
|
children: /* @__PURE__ */ c(Ln, {
|
|
770
|
-
file:
|
|
782
|
+
file: ee,
|
|
771
783
|
actions: {
|
|
772
784
|
upload: Jt,
|
|
773
785
|
remove: () => {
|
|
774
|
-
|
|
786
|
+
_(void 0);
|
|
775
787
|
}
|
|
776
788
|
},
|
|
777
789
|
onUrlChange: (t) => ae(t)
|
|
778
790
|
})
|
|
779
|
-
}), /* @__PURE__ */ z(
|
|
791
|
+
}), /* @__PURE__ */ z(ye, {
|
|
780
792
|
className: "footer-upload-action",
|
|
781
793
|
onClick: (t) => t.preventDefault(),
|
|
782
|
-
children: [/* @__PURE__ */ z(
|
|
794
|
+
children: [/* @__PURE__ */ z(ye, {
|
|
783
795
|
children: [o.type === 2 && (g == null ? void 0 : g.imageUpload) && /* @__PURE__ */ c(wn, {
|
|
784
|
-
disabled: !!
|
|
796
|
+
disabled: !!ee || R,
|
|
785
797
|
accept: ".jpg, .png, .jpeg,.bmp",
|
|
786
798
|
listType: "picture-card",
|
|
787
799
|
beforeUpload: Zt,
|
|
788
800
|
className: "footer-upload-picture",
|
|
789
801
|
showUploadList: !1,
|
|
790
|
-
children:
|
|
802
|
+
children: ee ? /* @__PURE__ */ c(Q, {
|
|
791
803
|
type: "text",
|
|
792
804
|
className: "camera-out-btn",
|
|
793
805
|
style: {
|
|
@@ -795,7 +807,7 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
795
807
|
position: "relative",
|
|
796
808
|
bottom: "-2px"
|
|
797
809
|
},
|
|
798
|
-
disabled: !!
|
|
810
|
+
disabled: !!ee || R,
|
|
799
811
|
icon: /* @__PURE__ */ c(Hn, {
|
|
800
812
|
className: "icon-tianjia",
|
|
801
813
|
style: {
|
|
@@ -808,7 +820,7 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
808
820
|
title: /* @__PURE__ */ c("div", {
|
|
809
821
|
children: "支持上传.jpg .png .jpeg .bmp格式的图片数据,最大20M,单次仅可上传1个"
|
|
810
822
|
}),
|
|
811
|
-
children: /* @__PURE__ */ c(
|
|
823
|
+
children: /* @__PURE__ */ c(Q, {
|
|
812
824
|
type: "text",
|
|
813
825
|
className: "camera-out-btn",
|
|
814
826
|
style: {
|
|
@@ -825,7 +837,7 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
825
837
|
})
|
|
826
838
|
})
|
|
827
839
|
})
|
|
828
|
-
}),
|
|
840
|
+
}), ke && (g != null && g.fileUpload) && (o != null && o.id) ? /* @__PURE__ */ c(Dn, {
|
|
829
841
|
appId: o == null ? void 0 : o.id,
|
|
830
842
|
ref: fe,
|
|
831
843
|
isFirstSession: Ye,
|
|
@@ -838,13 +850,13 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
838
850
|
netOpen: E ? $.OPEN : $.CLOSE
|
|
839
851
|
}).then((n) => {
|
|
840
852
|
var i, l, r;
|
|
841
|
-
p == null || p(n), M(!1), P(!!((i = n.data) != null && i.netOpen)),
|
|
853
|
+
p == null || p(n), M(!1), P(!!((i = n.data) != null && i.netOpen)), J(!!((l = n.data) != null && l.enableNetOpen));
|
|
842
854
|
const a = ((r = n.data) == null ? void 0 : r.id) || "";
|
|
843
855
|
t(a);
|
|
844
856
|
});
|
|
845
857
|
}),
|
|
846
858
|
sid: (at = e == null ? void 0 : e.data) == null ? void 0 : at.id,
|
|
847
|
-
disabled:
|
|
859
|
+
disabled: Ce || R,
|
|
848
860
|
afterFileAdd: (t, n) => {
|
|
849
861
|
n && ce((a) => {
|
|
850
862
|
const i = a[n] || [];
|
|
@@ -879,11 +891,11 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
879
891
|
list: [],
|
|
880
892
|
search: Ve ? Ht : "",
|
|
881
893
|
onPromptSelect: (t) => {
|
|
882
|
-
|
|
894
|
+
Z(t.context), se(t.context);
|
|
883
895
|
},
|
|
884
896
|
disabled: R
|
|
885
897
|
})]
|
|
886
|
-
}), /* @__PURE__ */ z(
|
|
898
|
+
}), /* @__PURE__ */ z(ye, {
|
|
887
899
|
children: [(g == null ? void 0 : g.connectNetwork) && o.type === 0 && ((lt = o.arrange) == null ? void 0 : lt.length) && !!o.arrange[0].enableNetOpen && /* @__PURE__ */ c(An, {
|
|
888
900
|
sessionId: (dt = e == null ? void 0 : e.data) == null ? void 0 : dt.id,
|
|
889
901
|
netStatus: E,
|
|
@@ -895,7 +907,7 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
895
907
|
}), (g == null ? void 0 : g.sessionList) && /* @__PURE__ */ c(jn, {
|
|
896
908
|
currentSessionId: (ct = e == null ? void 0 : e.data) == null ? void 0 : ct.id,
|
|
897
909
|
onSessionChange: (t, n) => {
|
|
898
|
-
|
|
910
|
+
Z(void 0), Le(!0), p == null || p(n);
|
|
899
911
|
},
|
|
900
912
|
disabled: R
|
|
901
913
|
}), Lt && Et === "float" && /* @__PURE__ */ c("div", {
|
|
@@ -909,7 +921,7 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
909
921
|
},
|
|
910
922
|
getPopupContainer: (t) => t.parentNode,
|
|
911
923
|
content: "会话历史记录",
|
|
912
|
-
children: /* @__PURE__ */ c(
|
|
924
|
+
children: /* @__PURE__ */ c(Q, {
|
|
913
925
|
className: "history-overlay-action",
|
|
914
926
|
disabled: R,
|
|
915
927
|
type: "text",
|
|
@@ -922,14 +934,14 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
922
934
|
onClick: () => _e(!0)
|
|
923
935
|
})
|
|
924
936
|
})
|
|
925
|
-
}), (g == null ? void 0 : g.sessionOpen) && /* @__PURE__ */ c(
|
|
937
|
+
}), (g == null ? void 0 : g.sessionOpen) && /* @__PURE__ */ c(Q, {
|
|
926
938
|
icon: /* @__PURE__ */ c(Rn, {}),
|
|
927
939
|
className: "add-btn",
|
|
928
940
|
type: "primary",
|
|
929
941
|
disabled: Be || !e || !v.length || R,
|
|
930
942
|
onClick: () => {
|
|
931
943
|
var t, n;
|
|
932
|
-
p == null || p(null), P(!1), (t = Ae.current) == null || t.clear(), (n =
|
|
944
|
+
p == null || p(null), P(!1), (t = Ae.current) == null || t.clear(), (n = Ne.current) == null || n.clear();
|
|
933
945
|
},
|
|
934
946
|
children: "新会话"
|
|
935
947
|
})]
|
|
@@ -941,19 +953,19 @@ ${t}` : t, l = new oe(i, a, J.User, n);
|
|
|
941
953
|
maxLength: Pt,
|
|
942
954
|
text: Dt,
|
|
943
955
|
networkStatus: !1,
|
|
944
|
-
loading: We ||
|
|
945
|
-
disabled: De || Me || R || We ||
|
|
956
|
+
loading: We || me,
|
|
957
|
+
disabled: De || Me || R || We || me,
|
|
946
958
|
onTextSend: Ge,
|
|
947
959
|
onChange: (t, n) => {
|
|
948
|
-
|
|
960
|
+
Z(t);
|
|
949
961
|
const a = n.getText().replace(/[\n\s]+$/, "");
|
|
950
962
|
se(a), Rt(a), Ve || Ot(!0);
|
|
951
963
|
},
|
|
952
|
-
clearAction: /* @__PURE__ */ c(
|
|
964
|
+
clearAction: /* @__PURE__ */ c(ye, {
|
|
953
965
|
size: 0,
|
|
954
|
-
children: /* @__PURE__ */ c(
|
|
966
|
+
children: /* @__PURE__ */ c(Q, {
|
|
955
967
|
type: "link",
|
|
956
|
-
disabled:
|
|
968
|
+
disabled: Ce || R,
|
|
957
969
|
ghost: !0,
|
|
958
970
|
icon: /* @__PURE__ */ c(ie, {
|
|
959
971
|
style: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e = "@glodon-aiot/agent-cli-ui", t = "3.4.2-beta.
|
|
1
|
+
const e = "@glodon-aiot/agent-cli-ui", t = "3.4.2-beta.2", 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.4.2-beta.1", s = "./dist/es/index.
|
|
|
25
25
|
webpack: "*"
|
|
26
26
|
}, p = {
|
|
27
27
|
"@ant-design/icons": "^5.3.4",
|
|
28
|
-
"@glodon-aiot/apis": "^3.4.2-beta.
|
|
29
|
-
"@glodon-aiot/bot-client-sdk": "^3.4.2-beta.
|
|
28
|
+
"@glodon-aiot/apis": "^3.4.2-beta.2",
|
|
29
|
+
"@glodon-aiot/bot-client-sdk": "^3.4.2-beta.2",
|
|
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",
|