@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.
@@ -1,15 +1,15 @@
1
1
  var Wt = Object.defineProperty, Qt = Object.defineProperties;
2
2
  var _t = Object.getOwnPropertyDescriptors;
3
- var nt = Object.getOwnPropertySymbols;
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, it = (L, o) => {
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 (nt)
9
- for (var v of nt(o))
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
- }, ot = (L, o) => Qt(L, _t(o));
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 st, PromptVariableType as ge } from "@glodon-aiot/apis";
35
- import lt from "./HistoryItem/index.mjs";
36
- import dt from "dayjs";
37
- import { v4 as ct } from "uuid";
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(lt), rt = {
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 = dt(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"), this.isWaiting = !1, this.messageId = ct(), this.isContext = !1, this.actions = [], this.reference = [], this.isSensitive = !1, this.isSuspend = !1, 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 = 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 at = 10, ei = (L) => {
78
- var Ke, We, Qe, _e, Ge, Xe, Ze, Je, Se, et, tt;
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([]), [ft, ee] = m(), [he, Ce] = m(), R = B(null), {
88
+ } = L, [h, C] = m([]), [gt, ee] = m(), [he, Ce] = m(), R = B(null), {
89
89
  service: P,
90
90
  agentClient: N,
91
- depId: gt,
92
- footer: ut,
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: ht,
98
+ bodyStyle: mt,
99
99
  disabled: M,
100
- features: a,
100
+ features: l,
101
101
  popupContainer: f,
102
- icon: mt
103
- } = Jt(sn), [Pe, ye] = m(!1), y = B(h), Te = B(), [yt, pt] = m(0), [X, q] = m(), [Y, ne] = m(""), [Fe, pe] = m(!1), ve = B(null), [Ee, vt] = m([]), [Re, K] = m(!1), [De, bt] = m(!1), [kt, wt] = m(""), [xt, W] = m(), [ie, oe] = m({}), se = B(null), He = B(null), be = B(null), [Me, It] = m(!1), [Lt, Ct] = m([]), [Nt, re] = m(!0), [Pt, Tt] = m(!0), [Oe, O] = m(!1), [ke, V] = m(!1), [Ue, Ft] = m(!1), [E, ae] = m(typeof (a == null ? void 0 : a.promptVariables) == "object" ? a.promptVariables.default || [] : []), [Et, Rt] = m(typeof (a == null ? void 0 : a.knowledges) == "object" && a.knowledges.default || void 0), [ze, U] = m(!1), [je, Z] = m(!1), [Dt, Q] = m(typeof (a == null ? void 0 : a.connectNetwork) == "object" && typeof (a == null ? void 0 : a.connectNetwork.default) == "boolean" ? a.connectNetwork.default : !1), [Ve, le] = m(!1);
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 = (l) => {
116
+ const n = (a) => {
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), Ne && Ne({
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: l
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 && Rt(e.knowledges), x(e.netOpen));
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 Ht = () => {
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
- vt(t);
173
+ bt(t);
174
174
  }));
175
- }, [gt, o]);
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 || ft;
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 (!Nt) {
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)), Mt(b).then(() => {
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 l = Y ? `![](${Y})
251
+ const a = Y ? `![](${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: l,
259
+ content: a,
260
260
  sessionId: i,
261
- role: st.User,
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
- }), Mt = (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.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 = [], l = /* @__PURE__ */ new Set();
290
+ let i = [], a = /* @__PURE__ */ new Set();
291
291
  (I = ie[n]) == null || I.forEach((p) => {
292
- l.has(p.id) || (i.push(p), l.add(p.id));
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: st.User,
318
+ role: rt.User,
319
319
  files: ie[e.id]
320
320
  }
321
321
  }) : i = !0;
322
- } catch (l) {
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 ? `![](${Y})
338
- ${t}` : t, l = new S(i, r, G.User, n);
339
- ee(void 0), W(void 0), y.current = [l, ...h], C(y.current), o.id && te && te({
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: l
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 = Et;
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 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({
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
- pt(t);
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 ? Ae(e, t) : new Promise((r) => {
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 l, s;
426
- k == null || k(i), U(!1), x(!!((l = i.data) != null && l.netOpen)), Q(!!((s = i.data) != null && s.enableNetOpen)), r(Ae(i, t));
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
- }), Ae = (t, n) => {
429
+ }), Be = (t, n) => {
430
430
  const r = dn(n.name);
431
431
  return new Promise((i) => {
432
432
  var s;
433
- const l = {
434
- files: [`${ct()}.${r}`],
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(l).then((d) => {
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 Be = (t, n) => new Promise((r) => {
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(it({}, n.file), {
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 l;
468
- (l = se.current) == null || l.update().finally(r);
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
- Ft(t);
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: at
510
+ pageSize: lt
511
511
  }).then((i) => {
512
- const l = i || [];
513
- if (!l || !(l != null && l.length)) {
512
+ const a = i || [];
513
+ if (!a || !(a != null && a.length)) {
514
514
  Z(!1);
515
515
  return;
516
516
  }
517
- l.length < 10 ? Z(!1) : Z(!0), C([...h, ...l.reverse()]);
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"), l = (n = R.current) == null ? void 0 : n.querySelector(".infinite-scroll-component");
540
- if (!i || !l || !r)
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 (l.offsetHeight <= s) {
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
- (l) => !(l.type === ge.User && l.key === "query") && !(l.type === ge.System && l.key === "datetime") && l.status === 1
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((l, s) => {
560
+ ).map((a, s) => {
561
561
  var I, p;
562
562
  let d = "";
563
- return typeof (a == null ? void 0 : a.promptVariables) == "object" && (d = ((p = (I = a.promptVariables.default) == null ? void 0 : I.find((T) => T.key === l.key && T.type === l.type)) == null ? void 0 : p.value) || ""), {
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: l.key,
566
- name: l.name,
565
+ key: a.key,
566
+ name: a.name,
567
567
  value: d,
568
- type: l.type
568
+ type: a.type
569
569
  };
570
570
  });
571
- ae([...i].sort((l, s) => l.key.localeCompare(s.key)));
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, a == null ? void 0 : a.promptVariables]);
577
- const qe = () => w == null ? void 0 : w({
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
- }), Ye = St(() => {
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(lt, {
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: dt(Date.now()).format("YYYY-MM-DD HH:mm:ss"),
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: a == null ? void 0 : a.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: ht,
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: (Ke = e == null ? void 0 : e.data) != null && Ke.id && (h != null && h.length) ? /* @__PURE__ */ A(kn, {
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 > at && // 少于一页不展示这个提示
636
- ((We = R.current) != null && We.scrollTop) && ((Qe = R.current) == null ? void 0 : Qe.scrollTop) < -10 ? /* @__PURE__ */ c(en, {
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: a == null ? void 0 : a.markdown
660
- }, t.messageId + n)), !je && Ye]
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: [(a == null ? void 0 : a.greeting) !== !1 && /* @__PURE__ */ c(gn, {
664
- text: a === void 0 || a.greeting === !0 || ((_e = a.greeting) == null ? void 0 : _e.text) === void 0 ? rt.text : a.greeting.text,
665
- icon: a === void 0 || a.greeting === !0 || ((Ge = a.greeting) == null ? void 0 : Ge.icon) === void 0 ? mt || rt.icon : a.greeting.icon,
666
- children: !!Ee.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, {
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: (Xe = e == null ? void 0 : e.data) == null ? void 0 : Xe.id,
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, l;
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 ? (l = (i = se.current) == null ? void 0 : i.clear()) == null || l.then(() => {
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 = Be(n, t)) == null || s.finally(() => {
679
+ t != null && t.id && (n ? (s = qe(n, t)) == null || s.finally(() => {
680
680
  K(!1);
681
- }) : (K(!1), U(!0), (d = qe()) == null || d.then((I) => {
681
+ }) : (K(!1), U(!0), (d = Ye()) == null || d.then((I) => {
682
682
  var p;
683
- (p = Be(I.id, t)) == null || p.finally(() => {
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), qe());
687
+ }) : n ? K(!1) : (K(!1), U(!0), Ye());
688
688
  }
689
689
  })
690
- }), Ye]
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, l, s;
804
- k == null || k(n), U(!1), x(!!((i = n.data) != null && i.netOpen)), Q(!!((l = n.data) != null && l.enableNetOpen));
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: (Ze = e == null ? void 0 : e.data) == null ? void 0 : Ze.id,
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 l = i[n] || [];
823
+ const a = i[n] || [];
824
824
  return {
825
- [n]: l.filter((s) => s.id !== t)
825
+ [n]: a.filter((s) => s.id !== t)
826
826
  };
827
827
  });
828
828
  },
829
829
  onFileListChange: (t) => {
830
- Ct(t);
830
+ Nt(t);
831
831
  },
832
- shouldContinue: Pt,
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 ? kt : "",
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 && ((Je = o.arrange) == null ? void 0 : Je.length) && !!o.arrange[0].enableNetOpen && /* @__PURE__ */ c(wn, {
851
- sessionId: (Se = e == null ? void 0 : e.data) == null ? void 0 : Se.id,
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 (a == null ? void 0 : a.connectNetwork) == "object" && typeof (a == null ? void 0 : a.connectNetwork.diabled) == "boolean" ? !(a != null && a.connectNetwork.diabled) : Dt,
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: (et = e == null ? void 0 : e.data) == null ? void 0 : et.id,
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: yt,
881
- text: xt,
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), wt(r), De || bt(!0);
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: () => Ht()
903
+ onClick: () => Mt()
904
904
  })
905
905
  })
906
906
  })
907
907
  })]
908
908
  })
909
909
  }), /* @__PURE__ */ c(un, {
910
- tips: ut
910
+ tips: ht
911
911
  }), Me && /* @__PURE__ */ c(pn, {
912
912
  isvisible: Me,
913
- files: Lt,
914
- sessionId: (tt = e == null ? void 0 : e.data) == null ? void 0 : tt.id,
913
+ files: Ct,
914
+ sessionId: (nt = e == null ? void 0 : e.data) == null ? void 0 : nt.id,
915
915
  onClose: (t) => {
916
- It(!1), Tt(!1);
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.23", s = "./dist/es/index.mjs", i = "./dist/lib/index.js", o = "./dist/src/index.d.ts", n = {
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.23",
26
- "@glodon-aiot/bot-client-sdk": "^3.3.5-alpha.23",
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",