@glodon-aiot/agent-cli-ui 3.3.5-alpha.26 → 3.3.5-alpha.28

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.
@@ -18,17 +18,17 @@ var z = (L, o, v) => new Promise((e, w) => {
18
18
  } catch (h) {
19
19
  w(h);
20
20
  }
21
- }, k = (x) => {
21
+ }, b = (x) => {
22
22
  try {
23
23
  H(v.throw(x));
24
24
  } catch (h) {
25
25
  w(h);
26
26
  }
27
- }, H = (x) => x.done ? e(x.value) : Promise.resolve(x.value).then(ue, k);
27
+ }, H = (x) => x.done ? e(x.value) : Promise.resolve(x.value).then(ue, b);
28
28
  H((v = v.apply(L, o)).next());
29
29
  });
30
- import { jsx as c, jsxs as A } from "react/jsx-runtime";
31
- import { memo as Zt, useState as m, useRef as B, useContext as Jt, useEffect as F, useMemo as St } from "react";
30
+ import { jsx as c, jsxs as q } from "react/jsx-runtime";
31
+ import { memo as Zt, useState as m, useRef as A, 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
34
  import { IHistoryRole as G, ChatMessageRole as rt, PromptVariableType as ge } from "@glodon-aiot/apis";
@@ -49,8 +49,8 @@ import yn from "./Tools/UploadKnowledgeFiles/index.mjs";
49
49
  import pn from "../UploadingPrompt/index.mjs";
50
50
  import vn from "./PromptSetting/index.mjs";
51
51
  import { useMemoizedFn as Le } from "ahooks";
52
- import bn from "./Tools/SessionListDrawer/index.mjs";
53
- import kn from "react-infinite-scroll-component";
52
+ import kn from "./Tools/SessionListDrawer/index.mjs";
53
+ import bn 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";
@@ -82,10 +82,10 @@ const lt = 10, ei = (L) => {
82
82
  currentSession: e,
83
83
  onCreateSession: w,
84
84
  embeddingService: ue,
85
- setCurrentSession: k,
85
+ setCurrentSession: b,
86
86
  networkStatus: H,
87
87
  setNetworkStatus: x
88
- } = L, [h, C] = m([]), [gt, ee] = m(), [he, Ce] = m(), R = B(null), {
88
+ } = L, [h, C] = m([]), [gt, ee] = m(), [he, Ce] = m(), R = A(null), {
89
89
  service: P,
90
90
  agentClient: N,
91
91
  depId: ut,
@@ -100,7 +100,7 @@ const lt = 10, ei = (L) => {
100
100
  features: l,
101
101
  popupContainer: f,
102
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);
103
+ } = Jt(sn), [Pe, ye] = m(!1), y = A(h), Te = A(void 0), [pt, vt] = m(0), [X, B] = m(), [Y, ne] = m(""), [Fe, pe] = m(!1), ve = A(null), [Ee, kt] = m([]), [Re, K] = m(!1), [De, bt] = m(!1), [wt, xt] = m(""), [It, W] = m(), [ie, oe] = m({}), se = A(null), He = A(null), ke = A(null), [Me, Lt] = m(!1), [Ct, Nt] = m([]), [Pt, re] = m(!0), [Tt, Ft] = m(!0), [Oe, O] = m(!1), [be, 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([]);
@@ -170,7 +170,7 @@ const lt = 10, ei = (L) => {
170
170
  };
171
171
  F(() => {
172
172
  o != null && o.id && (P == null || P.getRecommendQues(o.id).then((t) => {
173
- bt(t);
173
+ kt(t);
174
174
  }));
175
175
  }, [ut, o]);
176
176
  const $e = (t) => z(void 0, null, function* () {
@@ -192,7 +192,7 @@ const lt = 10, ei = (L) => {
192
192
  });
193
193
  return;
194
194
  }
195
- if (!(E == null ? void 0 : E.every((b) => !!(b != null && b.value))))
195
+ if (!(E == null ? void 0 : E.every((k) => !!(k != null && k.value))))
196
196
  if (g != null && g.promptVariables) {
197
197
  u.config({
198
198
  getContainer: () => (f == null ? void 0 : f.current) || document.body
@@ -201,8 +201,8 @@ const lt = 10, ei = (L) => {
201
201
  });
202
202
  return;
203
203
  } else
204
- console.error("变量值不能为空", E == null ? void 0 : E.map((b) => !!(b != null && b.value)));
205
- if (ke) {
204
+ console.error("变量值不能为空", E == null ? void 0 : E.map((k) => !!(k != null && k.value)));
205
+ if (be) {
206
206
  u.config({
207
207
  getContainer: () => (f == null ? void 0 : f.current) || document.body
208
208
  }), u.error("正在回复中"), u.config({
@@ -234,15 +234,15 @@ const lt = 10, ei = (L) => {
234
234
  });
235
235
  return;
236
236
  }
237
- q(void 0), ne("");
237
+ B(void 0), ne("");
238
238
  const i = (p = e == null ? void 0 : e.data) == null ? void 0 : p.id;
239
239
  if (!i) {
240
240
  w == null || w({
241
241
  netOpen: H ? 1 : 2
242
- }).then((b) => {
242
+ }).then((k) => {
243
243
  var $, J;
244
- U(!0), x(!!(($ = b.data) != null && $.netOpen)), Q(!!((J = b.data) != null && J.enableNetOpen)), Ae(b).then(() => {
245
- k == null || k(b), U(!1), Ce(n);
244
+ U(!0), x(!!(($ = k.data) != null && $.netOpen)), Q(!!((J = k.data) != null && J.enableNetOpen)), qe(k).then(() => {
245
+ b == null || b(k), U(!1), Ce(n);
246
246
  });
247
247
  });
248
248
  return;
@@ -262,15 +262,15 @@ ${n}` : n;
262
262
  files: ie[i]
263
263
  }
264
264
  }) : s = !0;
265
- } catch (b) {
265
+ } catch (k) {
266
266
  s = !1;
267
267
  }
268
268
  if (le(!1), s === !1)
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
- }), 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) => {
272
+ }), qe = (t) => new Promise((n, r) => z(void 0, null, function* () {
273
+ const s = (t == null ? void 0 : t.promptVariables).filter((d) => d.type ? !((d.type === ge.User || d.type === void 0) && d.key === "query") && !((d.type === ge.System || d.type === void 0) && d.key === "datetime") : d.key !== "query").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;
@@ -343,17 +343,17 @@ ${t}` : t, a = new S(i, r, G.User, n);
343
343
  });
344
344
  const s = new S("", r, G.System);
345
345
  s.isWaiting = !0, y.current = [s, ...y.current], C(y.current);
346
- const d = (n == null ? void 0 : n.map((b) => b.id)) || [], I = {
346
+ const d = (n == null ? void 0 : n.map((k) => k.id)) || [], I = {
347
347
  stream: rn.stream,
348
348
  referenceFirst: !1
349
349
  };
350
350
  if (g != null && g.promptVariables) {
351
- const b = E == null ? void 0 : E.reduce(($, J) => ($[J.key] = J.value, $), {});
352
- I.formatValues = b;
351
+ const k = E == null ? void 0 : E.reduce(($, J) => ($[J.key] = J.value, $), {});
352
+ I.formatValues = k;
353
353
  }
354
354
  if (g != null && g.knowledges) {
355
- const b = Rt;
356
- I.knowledges = b;
355
+ const k = Rt;
356
+ I.knowledges = k;
357
357
  }
358
358
  yield e.send({
359
359
  text: i,
@@ -415,18 +415,18 @@ ${t}` : t, a = new S(i, r, G.User, n);
415
415
  getContainer: () => (f == null ? void 0 : f.current) || document.body
416
416
  }), u.error("图片须小于20M"), u.config({
417
417
  getContainer: void 0
418
- }), !1) : (q(t), !1);
418
+ }), !1) : (B(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 ? Be(e, t) : new Promise((r) => {
421
+ return B(t), (n = e == null ? void 0 : e.data) != null && n.id ? Ae(e, t) : new Promise((r) => {
422
422
  U(!0), w == null || w({
423
423
  netOpen: H ? 1 : 2
424
424
  }).then((i) => {
425
425
  var 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));
426
+ b == null || b(i), U(!1), x(!!((a = i.data) != null && a.netOpen)), Q(!!((s = i.data) != null && s.enableNetOpen)), r(Ae(i, t));
427
427
  });
428
428
  });
429
- }), Be = (t, n) => {
429
+ }), Ae = (t, n) => {
430
430
  const r = dn(n.name);
431
431
  return new Promise((i) => {
432
432
  var s;
@@ -438,16 +438,16 @@ ${t}` : t, a = new S(i, r, G.User, n);
438
438
  };
439
439
  pe(!0), P == null || P.postTicket(a).then((d) => {
440
440
  P.uploadMinioFile(d.minio, n).then(() => {
441
- var b, $;
442
- const I = (b = d.minio.endpoints) == null ? void 0 : b[0], p = d.minio.bucket, T = ($ = d.minio.fileKeys) == null ? void 0 : $[0];
441
+ var k, $;
442
+ const I = (k = d.minio.endpoints) == null ? void 0 : k[0], p = d.minio.bucket, T = ($ = d.minio.fileKeys) == null ? void 0 : $[0];
443
443
  i(`${location.protocol}//${I}/${p}/${T}`);
444
444
  }).catch(() => {
445
- ne(""), q(void 0);
445
+ ne(""), B(void 0);
446
446
  }).finally(() => {
447
447
  pe(!1);
448
448
  });
449
449
  }).catch(() => {
450
- ne(""), q(void 0), pe(!1);
450
+ ne(""), B(void 0), pe(!1);
451
451
  });
452
452
  });
453
453
  };
@@ -457,7 +457,7 @@ ${t}` : t, a = new S(i, r, G.User, n);
457
457
  top: t.scrollHeight
458
458
  });
459
459
  }, [h]);
460
- const qe = (t, n) => new Promise((r) => {
460
+ const Be = (t, n) => new Promise((r) => {
461
461
  if (!n.file.url || !(o != null && o.id))
462
462
  return r();
463
463
  const i = st(ot({}, n.file), {
@@ -483,12 +483,12 @@ ${t}` : t, a = new S(i, r, G.User, n);
483
483
  return;
484
484
  const t = R.current.scrollTop <= -80;
485
485
  Et(t);
486
- }, At = Le((t) => {
486
+ }, qt = Le((t) => {
487
487
  var n, r;
488
488
  (n = ve.current) == null || n.update(t), (r = ve.current) == null || r.focus();
489
- }), Bt = Le((t) => {
489
+ }), At = Le((t) => {
490
490
  $e(t);
491
- }), qt = Le(() => {
491
+ }), Bt = Le(() => {
492
492
  var n;
493
493
  if (!((n = e == null ? void 0 : e.data) != null && n.id))
494
494
  return;
@@ -498,7 +498,7 @@ ${t}` : t, a = new S(i, r, G.User, n);
498
498
  });
499
499
  F(() => {
500
500
  var t, n;
501
- Te.current = (t = e == null ? void 0 : e.data) == null ? void 0 : t.id, !ze && ((n = be.current) == null || n.clear());
501
+ Te.current = (t = e == null ? void 0 : e.data) == null ? void 0 : t.id, !ze && ((n = ke.current) == null || n.clear());
502
502
  }, [e]);
503
503
  const Yt = () => {
504
504
  var r;
@@ -554,10 +554,7 @@ ${t}` : t, a = new S(i, r, G.User, n);
554
554
  if (e)
555
555
  return;
556
556
  const t = () => {
557
- const i = ((N == null ? void 0 : N.promptVariables) || []).filter(
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
- // 只要求输入被引用的变量
560
- ).map((a, s) => {
557
+ const i = ((N == null ? void 0 : N.promptVariables) || []).filter((a) => a.type ? !(a.type === ge.User && a.key === "query") && !(a.type === ge.System && a.key === "datetime") && a.status === 1 : a.key !== "query" && a.status === 1).map((a, s) => {
561
558
  var I, p;
562
559
  let d = "";
563
560
  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) || ""), {
@@ -578,7 +575,7 @@ ${t}` : t, a = new S(i, r, G.User, n);
578
575
  netOpen: H ? 1 : 2
579
576
  }).then((t) => {
580
577
  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)), Ae(t), t;
578
+ return b == null || b(t), U(!1), x(!!((n = t.data) != null && n.netOpen)), Q(!!((r = t.data) != null && r.enableNetOpen)), qe(t), t;
582
579
  }), Ke = St(() => {
583
580
  var t;
584
581
  return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ c(dt, {
@@ -599,7 +596,7 @@ ${t}` : t, a = new S(i, r, G.User, n);
599
596
  markdown: l == null ? void 0 : l.markdown
600
597
  }) : null;
601
598
  }, [o == null ? void 0 : o.arrange, h]);
602
- return /* @__PURE__ */ A("div", {
599
+ return /* @__PURE__ */ q("div", {
603
600
  className: "agent-chat",
604
601
  children: [(g == null ? void 0 : g.promptVariables) && /* @__PURE__ */ c(vn, {
605
602
  ref: He,
@@ -607,8 +604,8 @@ ${t}` : t, a = new S(i, r, G.User, n);
607
604
  currentSession: e,
608
605
  promptVariables: E,
609
606
  setPromptVariables: ae,
610
- setCurrentSession: k
611
- }), /* @__PURE__ */ A("div", {
607
+ setCurrentSession: b
608
+ }), /* @__PURE__ */ q("div", {
612
609
  className: "chat-main",
613
610
  id: "chat-main",
614
611
  style: mt,
@@ -623,7 +620,7 @@ ${t}` : t, a = new S(i, r, G.User, n);
623
620
  },
624
621
  ref: R,
625
622
  onScroll: $t,
626
- children: (We = e == null ? void 0 : e.data) != null && We.id && (h != null && h.length) ? /* @__PURE__ */ A(kn, {
623
+ children: (We = e == null ? void 0 : e.data) != null && We.id && (h != null && h.length) ? /* @__PURE__ */ q(bn, {
627
624
  dataLength: h.length,
628
625
  next: Yt,
629
626
  style: {
@@ -653,18 +650,18 @@ ${t}` : t, a = new S(i, r, G.User, n);
653
650
  history: t,
654
651
  docViewerUrl: v,
655
652
  isLastHistory: n === 0,
656
- onRelatedClick: Bt,
657
- onAgainClick: qt,
658
- onEditClick: At,
653
+ onRelatedClick: At,
654
+ onAgainClick: Bt,
655
+ onEditClick: qt,
659
656
  markdown: l == null ? void 0 : l.markdown
660
657
  }, t.messageId + n)), !je && Ke]
661
- }) : /* @__PURE__ */ A("div", {
658
+ }) : /* @__PURE__ */ q("div", {
662
659
  className: "main-empty",
663
660
  children: [(l == null ? void 0 : l.greeting) !== !1 && /* @__PURE__ */ c(gn, {
664
661
  text: l === void 0 || l.greeting === !0 || ((Ge = l.greeting) == null ? void 0 : Ge.text) === void 0 ? at.text : l.greeting.text,
665
662
  icon: l === void 0 || l.greeting === !0 || ((Xe = l.greeting) == null ? void 0 : Xe.icon) === void 0 ? yt || at.icon : l.greeting.icon,
666
663
  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
- ref: be,
664
+ ref: ke,
668
665
  sid: (Ze = e == null ? void 0 : e.data) == null ? void 0 : Ze.id,
669
666
  isRecommendClearing: Re,
670
667
  data: Ee,
@@ -676,11 +673,11 @@ ${t}` : t, a = new S(i, r, G.User, n);
676
673
  const n = (r = e == null ? void 0 : e.data) == null ? void 0 : r.id;
677
674
  g != null && g.fileUpload ? (a = (i = se.current) == null ? void 0 : i.clear()) == null || a.then(() => {
678
675
  var s, d;
679
- t != null && t.id && (n ? (s = qe(n, t)) == null || s.finally(() => {
676
+ t != null && t.id && (n ? (s = Be(n, t)) == null || s.finally(() => {
680
677
  K(!1);
681
678
  }) : (K(!1), U(!0), (d = Ye()) == null || d.then((I) => {
682
679
  var p;
683
- (p = qe(I.id, t)) == null || p.finally(() => {
680
+ (p = Be(I.id, t)) == null || p.finally(() => {
684
681
  K(!1);
685
682
  });
686
683
  })));
@@ -725,7 +722,7 @@ ${t}` : t, a = new S(i, r, G.User, n);
725
722
  })]
726
723
  }), /* @__PURE__ */ c("div", {
727
724
  className: "chat-footer",
728
- children: /* @__PURE__ */ A("div", {
725
+ children: /* @__PURE__ */ q("div", {
729
726
  className: "chat-footer-input",
730
727
  children: [X && /* @__PURE__ */ c("div", {
731
728
  className: "input-files",
@@ -734,15 +731,15 @@ ${t}` : t, a = new S(i, r, G.User, n);
734
731
  actions: {
735
732
  upload: zt,
736
733
  remove: () => {
737
- q(void 0);
734
+ B(void 0);
738
735
  }
739
736
  },
740
737
  onUrlChange: (t) => ne(t)
741
738
  })
742
- }), /* @__PURE__ */ A(de, {
739
+ }), /* @__PURE__ */ q(de, {
743
740
  className: "footer-upload-action",
744
741
  onClick: (t) => t.preventDefault(),
745
- children: [/* @__PURE__ */ A(de, {
742
+ children: [/* @__PURE__ */ q(de, {
746
743
  children: [o.type === 2 && (g == null ? void 0 : g.imageUpload) && /* @__PURE__ */ c(nn, {
747
744
  disabled: !!X || M,
748
745
  accept: ".jpg, .png, .jpeg,.bmp",
@@ -801,13 +798,13 @@ ${t}` : t, a = new S(i, r, G.User, n);
801
798
  netOpen: H ? 1 : 2
802
799
  }).then((n) => {
803
800
  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));
801
+ b == null || b(n), U(!1), x(!!((i = n.data) != null && i.netOpen)), Q(!!((a = n.data) != null && a.enableNetOpen));
805
802
  const r = ((s = n.data) == null ? void 0 : s.id) || "";
806
803
  t(r);
807
804
  });
808
805
  }),
809
806
  sid: (Je = e == null ? void 0 : e.data) == null ? void 0 : Je.id,
810
- disabled: ke || M,
807
+ disabled: be || M,
811
808
  afterFileAdd: (t, n) => {
812
809
  n && oe((r) => {
813
810
  const i = r[n] || [];
@@ -846,7 +843,7 @@ ${t}` : t, a = new S(i, r, G.User, n);
846
843
  },
847
844
  disabled: M
848
845
  })]
849
- }), /* @__PURE__ */ A(de, {
846
+ }), /* @__PURE__ */ q(de, {
850
847
  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
848
  sessionId: (et = e == null ? void 0 : e.data) == null ? void 0 : et.id,
852
849
  netStatus: H,
@@ -855,10 +852,10 @@ ${t}` : t, a = new S(i, r, G.User, n);
855
852
  onNetStatusChange: (t) => {
856
853
  Kt(t);
857
854
  }
858
- }), (g == null ? void 0 : g.sessionList) && /* @__PURE__ */ c(bn, {
855
+ }), (g == null ? void 0 : g.sessionList) && /* @__PURE__ */ c(kn, {
859
856
  currentSessionId: (tt = e == null ? void 0 : e.data) == null ? void 0 : tt.id,
860
857
  onSessionChange: (t, n) => {
861
- W(void 0), k == null || k(n);
858
+ W(void 0), b == null || b(n);
862
859
  },
863
860
  disabled: M
864
861
  }), (g == null ? void 0 : g.sessionOpen) && /* @__PURE__ */ c(_, {
@@ -868,7 +865,7 @@ ${t}` : t, a = new S(i, r, G.User, n);
868
865
  disabled: Oe || !e || !h.length || M,
869
866
  onClick: () => {
870
867
  var t, n;
871
- k == null || k(void 0), x(!1), (t = He.current) == null || t.clear(), (n = be.current) == null || n.clear();
868
+ b == null || b(void 0), x(!1), (t = He.current) == null || t.clear(), (n = ke.current) == null || n.clear();
872
869
  },
873
870
  children: "新会话"
874
871
  })]
@@ -886,13 +883,13 @@ ${t}` : t, a = new S(i, r, G.User, n);
886
883
  onChange: (t, n) => {
887
884
  W(t);
888
885
  const r = n.getText().replace(/[\n\s]+$/, "");
889
- ee(r), xt(r), De || kt(!0);
886
+ ee(r), xt(r), De || bt(!0);
890
887
  },
891
888
  clearAction: /* @__PURE__ */ c(de, {
892
889
  size: 0,
893
890
  children: /* @__PURE__ */ c(_, {
894
891
  type: "link",
895
- disabled: ke || M,
892
+ disabled: be || M,
896
893
  ghost: !0,
897
894
  icon: /* @__PURE__ */ c(fe, {
898
895
  style: {
@@ -104,7 +104,7 @@ import W from "./SessionList/index.mjs";
104
104
  }));
105
105
  };
106
106
  return J(o, () => ({
107
- sessionCreate: (d) => L(d),
107
+ createSession: (d) => L(d),
108
108
  getSessionList: () => {
109
109
  var t;
110
110
  const d = ((t = I.current) == null ? void 0 : t.list()) || [];
package/dist/es/index.mjs CHANGED
@@ -264,10 +264,10 @@ class we {
264
264
  });
265
265
  }) : Promise.reject(new Error("client is not loaded"));
266
266
  }
267
- sessionCreate(s) {
267
+ createSession(s) {
268
268
  return this._agentClientRef.current ? new Promise((e, d) => {
269
269
  var f, g;
270
- (g = (f = this._agentClientRef.current) == null ? void 0 : f.sessionCreate(h({
270
+ (g = (f = this._agentClientRef.current) == null ? void 0 : f.createSession(h({
271
271
  name: "新建会话"
272
272
  }, s))) == null || g.then((u) => {
273
273
  e(u);
@@ -1,10 +1,10 @@
1
- const e = "@glodon-aiot/agent-cli-ui", t = "3.3.5-alpha.26", 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.28", 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"
5
5
  }, r = [
6
6
  "dist"
7
- ], c = "module", l = "dist/src/index.d.ts", a = {
7
+ ], c = "module", l = "dist/src/index.d.ts", d = {
8
8
  dev: "vite",
9
9
  start: "vite",
10
10
  build: "tsc && node --max-old-space-size=4096 ./node_modules/vite/bin/vite.js build --mode prod && yarn build:cdn",
@@ -18,32 +18,31 @@ const e = "@glodon-aiot/agent-cli-ui", t = "3.3.5-alpha.26", s = "./dist/es/inde
18
18
  "build-storybook": "build-storybook -s public",
19
19
  docs: "start-storybook -p 6006",
20
20
  commit: "cz"
21
- }, d = {
21
+ }, a = {
22
+ antd: ">=4.0.0",
23
+ react: ">=16.9.0",
24
+ "react-dom": ">=16.9.0",
22
25
  webpack: "*"
23
26
  }, p = {
24
27
  "@ant-design/icons": "^5.3.4",
25
- "@glodon-aiot/apis": "^3.3.5-alpha.26",
26
- "@glodon-aiot/bot-client-sdk": "^3.3.5-alpha.26",
28
+ "@glodon-aiot/apis": "^3.3.5-alpha.28",
29
+ "@glodon-aiot/bot-client-sdk": "^3.3.5-alpha.28",
27
30
  "@matejmazur/react-mathjax": "^0.1.10",
28
31
  "@react-pdf-viewer/core": "^3.12.0",
29
32
  "@react-pdf-viewer/default-layout": "^3.12.0",
30
33
  "@react-pdf-viewer/locales": "^1.0.0",
31
34
  "@react-pdf-viewer/toolbar": "^3.12.0",
32
35
  ahooks: "^3.8.5",
33
- antd: "4.x",
34
36
  axios: "0.24.0",
35
37
  classnames: "^2.5.1",
36
38
  "copy-to-clipboard": "^3.3.3",
37
39
  dayjs: "^1.11.13",
38
40
  lodash: "^4.17.21",
39
- react: "^17.0.2",
40
- "react-dom": "^17.0.2",
41
41
  "react-infinite-scroll-component": "^6.1.0",
42
- "react-mathjax": "^1.0.1",
43
42
  "react-quill": "^2.0.0",
44
43
  "react-resizable": "^3.0.5",
45
44
  uuid: "^11.1.0"
46
- }, m = {
45
+ }, u = {
47
46
  "@babel/core": "^7.20.12",
48
47
  "@commitlint/cli": "^17.0.3",
49
48
  "@commitlint/config-conventional": "^17.0.3",
@@ -60,12 +59,12 @@ const e = "@glodon-aiot/agent-cli-ui", t = "3.3.5-alpha.26", s = "./dist/es/inde
60
59
  "@storybook/react": "6.4.9",
61
60
  "@storybook/testing-library": "^0.0.13",
62
61
  "@types/lodash": "^4",
63
- "@types/react": "^17.0.44",
64
- "@types/react-dom": "^17.0.17",
65
- "@types/react-mathjax": "^1",
62
+ "@types/react": "^16.9.0 || ^17.0.0 || ^18.0.0",
63
+ "@types/react-dom": "^16.9.0 || ^17.0.0 || ^18.0.0",
66
64
  "@typescript-eslint/eslint-plugin": "^5.35.1",
67
65
  "@typescript-eslint/parser": "^5.35.1",
68
66
  "@vitejs/plugin-react": "^3.1.0",
67
+ antd: "^4.24.0",
69
68
  "babel-loader": "^8.3.0",
70
69
  "babel-plugin-import": "^1.13.8",
71
70
  commitizen: "^4.3.0",
@@ -86,6 +85,8 @@ const e = "@glodon-aiot/agent-cli-ui", t = "3.3.5-alpha.26", s = "./dist/es/inde
86
85
  "lint-staged": ">=10",
87
86
  "postcss-loader": "^7.2.4",
88
87
  prettier: "2.7.1",
88
+ react: "^17.0.2",
89
+ "react-dom": "^17.0.2",
89
90
  "require-from-string": "^2.0.2",
90
91
  "rollup-plugin-visualizer": "^6.0.1",
91
92
  "storybook-less-loader": "^0.1.0",
@@ -94,7 +95,7 @@ const e = "@glodon-aiot/agent-cli-ui", t = "3.3.5-alpha.26", s = "./dist/es/inde
94
95
  "vite-plugin-css-injected-by-js": "^3.5.0",
95
96
  "vite-plugin-dts": "^4.3.0",
96
97
  "vite-plugin-externalize-deps": "^0.9.0"
97
- }, u = [
98
+ }, m = [
98
99
  ">0.2%",
99
100
  "not dead",
100
101
  "not op_mini all"
@@ -120,20 +121,20 @@ const e = "@glodon-aiot/agent-cli-ui", t = "3.3.5-alpha.26", s = "./dist/es/inde
120
121
  name: e,
121
122
  version: t,
122
123
  module: s,
123
- main: i,
124
- typings: o,
124
+ main: o,
125
+ typings: i,
125
126
  exports: n,
126
127
  files: r,
127
128
  type: c,
128
129
  types: l,
129
- scripts: a,
130
- peerDependencies: d,
130
+ scripts: d,
131
+ peerDependencies: a,
131
132
  dependencies: p,
132
- devDependencies: m,
133
+ devDependencies: u,
133
134
  "lint-staged": {
134
135
  "*.{js,css,md,jsx,less,ts,tsx,json}": "prettier --write"
135
136
  },
136
- production: u,
137
+ production: m,
137
138
  development: b,
138
139
  config: g,
139
140
  publishConfig: y,
@@ -143,20 +144,20 @@ export {
143
144
  g as config,
144
145
  k as default,
145
146
  p as dependencies,
146
- m as devDependencies,
147
+ u as devDependencies,
147
148
  b as development,
148
149
  n as exports,
149
150
  r as files,
150
151
  v as husky,
151
- i as main,
152
+ o as main,
152
153
  s as module,
153
154
  e as name,
154
- d as peerDependencies,
155
- u as production,
155
+ a as peerDependencies,
156
+ m as production,
156
157
  y as publishConfig,
157
- a as scripts,
158
+ d as scripts,
158
159
  c as type,
159
160
  l as types,
160
- o as typings,
161
+ i as typings,
161
162
  t as version
162
163
  };