@glodon-aiot/agent-cli-ui 3.5.0-alpha.3 → 3.5.0-beta.1

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.
Files changed (48) hide show
  1. package/dist/es/Dialog/AgentChat/HistoryItem/FileItem/index.mjs +52 -48
  2. package/dist/es/Dialog/AgentChat/HistoryItem/SessionAction/index.mjs +112 -94
  3. package/dist/es/Dialog/AgentChat/HistoryItem/index.mjs +26 -24
  4. package/dist/es/Dialog/AgentChat/Tools/SessionListDrawer/HistorySessionList/index.mjs +65 -59
  5. package/dist/es/Dialog/AgentChat/Tools/UploadKnowledgeFiles/index.mjs +179 -161
  6. package/dist/es/Dialog/AgentChat/index.mjs +520 -465
  7. package/dist/es/QuillEditor/index.mjs +72 -65
  8. package/dist/es/ReactTextGenerationUI/components/TextSiders/index.mjs +182 -170
  9. package/dist/es/components/Recommend/RecommendItem.mjs +20 -18
  10. package/dist/es/index.mjs +223 -214
  11. package/dist/es/packages/agent-cli-ui/package.json.mjs +3 -3
  12. package/dist/es/packages/react-components/dist/es/index.mjs +1 -1
  13. package/dist/es/src/style.css +1 -1
  14. package/dist/es/src/style10.css +1 -1
  15. package/dist/es/src/style11.css +1 -1
  16. package/dist/es/src/style12.css +1 -1
  17. package/dist/es/src/style13.css +1 -1
  18. package/dist/es/src/style14.css +1 -1
  19. package/dist/es/src/style15.css +1 -1
  20. package/dist/es/src/style16.css +1 -1
  21. package/dist/es/src/style17.css +1 -1
  22. package/dist/es/src/style18.css +1 -1
  23. package/dist/es/src/style19.css +1 -1
  24. package/dist/es/src/style20.css +1 -1
  25. package/dist/es/src/style21.css +1 -1
  26. package/dist/es/src/style23.css +1 -1
  27. package/dist/es/src/style24.css +1 -1
  28. package/dist/es/src/style25.css +1 -1
  29. package/dist/es/src/style26.css +1 -1
  30. package/dist/es/src/style27.css +1 -1
  31. package/dist/es/src/style28.css +1 -1
  32. package/dist/es/src/style3.css +1 -1
  33. package/dist/es/src/style30.css +1 -1
  34. package/dist/es/src/style31.css +1 -1
  35. package/dist/es/src/style32.css +1 -1
  36. package/dist/es/src/style33.css +1 -1
  37. package/dist/es/src/style4.css +1 -1
  38. package/dist/es/src/style5.css +1 -1
  39. package/dist/es/src/style6.css +1 -1
  40. package/dist/es/src/style7.css +1 -1
  41. package/dist/es/src/style8.css +1 -1
  42. package/dist/es/src/style9.css +1 -1
  43. package/dist/es/utils/antdConfig.mjs +15 -0
  44. package/dist/lib/index.css +1 -1
  45. package/dist/lib/index.js +57 -57
  46. package/dist/src/utils/antdConfig.d.ts +7 -0
  47. package/dist/src/utils/testAntdPrefix.d.ts +3 -0
  48. package/package.json +3 -3
package/dist/es/index.mjs CHANGED
@@ -1,16 +1,16 @@
1
- var D = Object.defineProperty, j = Object.defineProperties;
1
+ var P = Object.defineProperty, j = Object.defineProperties;
2
2
  var F = Object.getOwnPropertyDescriptors;
3
3
  var V = Object.getOwnPropertySymbols;
4
- var P = Object.prototype.hasOwnProperty, W = Object.prototype.propertyIsEnumerable;
5
- var L = (m, s, n) => s in m ? D(m, s, { enumerable: !0, configurable: !0, writable: !0, value: n }) : m[s] = n, a = (m, s) => {
4
+ var W = Object.prototype.hasOwnProperty, O = Object.prototype.propertyIsEnumerable;
5
+ var T = (m, s, n) => s in m ? P(m, s, { enumerable: !0, configurable: !0, writable: !0, value: n }) : m[s] = n, a = (m, s) => {
6
6
  for (var n in s || (s = {}))
7
- P.call(s, n) && L(m, n, s[n]);
7
+ W.call(s, n) && T(m, n, s[n]);
8
8
  if (V)
9
9
  for (var n of V(s))
10
- W.call(s, n) && L(m, n, s[n]);
10
+ O.call(s, n) && T(m, n, s[n]);
11
11
  return m;
12
12
  }, C = (m, s) => j(m, F(s));
13
- var c = (m, s, n) => (L(m, typeof s != "symbol" ? s + "" : s, n), n);
13
+ var c = (m, s, n) => (T(m, typeof s != "symbol" ? s + "" : s, n), n);
14
14
  var B = (m, s, n) => new Promise((e, u) => {
15
15
  var l = (h) => {
16
16
  try {
@@ -27,23 +27,24 @@ var B = (m, s, n) => new Promise((e, u) => {
27
27
  }, d = (h) => h.done ? e(h.value) : Promise.resolve(h.value).then(l, g);
28
28
  d((n = n.apply(m, s)).next());
29
29
  });
30
- import { jsx as z } from "react/jsx-runtime";
31
- import O from "react";
30
+ import { jsx as L } from "react/jsx-runtime";
31
+ import $ from "react";
32
32
  import v from "lodash/merge";
33
- import H from "react-dom";
34
- import $ from "./AgentClientUI.mjs";
35
- import { notification as T } from "antd";
36
- import K from "axios";
37
- import { v4 as J } from "uuid";
38
- import Q from "./packages/agent-cli-ui/package.json.mjs";
39
- import { defaultUIConfig as A, defaultApiUrl as G, defaultDovViewerUrl as X } from "./constant.mjs";
40
- import { ApiUrl as Y } from "./types.mjs";
41
- /* empty css */import { BotClientApi as Z, ApplicationTypes as N } from "@glodon-aiot/apis";
42
- import { JWT as q, isExpired as ee } from "./utils/index.mjs";
43
- import { configuration as ie, configure as R, BotClient as te } from "@glodon-aiot/bot-client-sdk";
44
- import se from "./ReactTextGenerationUI/index.mjs";
33
+ import A from "react-dom";
34
+ import K from "./AgentClientUI.mjs";
35
+ import { notification as H } from "antd";
36
+ import J from "axios";
37
+ import { v4 as Q } from "uuid";
38
+ import G from "./packages/agent-cli-ui/package.json.mjs";
39
+ import { defaultUIConfig as z, defaultApiUrl as X, defaultDovViewerUrl as Y } from "./constant.mjs";
40
+ import { ApiUrl as Z } from "./types.mjs";
41
+ /* empty css */import { BotClientApi as q, ApplicationTypes as N } from "@glodon-aiot/apis";
42
+ import { JWT as ee, isExpired as ie } from "./utils/index.mjs";
43
+ import { configuration as te, configure as R, BotClient as se } from "@glodon-aiot/bot-client-sdk";
44
+ import oe from "./ReactTextGenerationUI/index.mjs";
45
+ import { AntdConfigWrapper as D } from "./utils/antdConfig.mjs";
45
46
  const E = {};
46
- class we {
47
+ class ye {
47
48
  constructor(s) {
48
49
  c(this, "_token");
49
50
  c(this, "_activeSession", null);
@@ -51,22 +52,22 @@ class we {
51
52
  c(this, "_defaultInputText", "");
52
53
  c(this, "_inputDisabled", !1);
53
54
  c(this, "_defatulSessionId", "");
54
- c(this, "_agentClientRef", O.createRef());
55
+ c(this, "_agentClientRef", $.createRef());
55
56
  c(this, "_config");
56
57
  c(this, "_uuid", "");
57
58
  c(this, "apiUrl");
58
59
  c(this, "docViewerUrl");
59
60
  c(this, "env", "prod");
60
- c(this, "stream", ie.stream);
61
+ c(this, "stream", te.stream);
61
62
  c(this, "service");
62
63
  c(this, "rId", 0);
63
64
  c(this, "_mode", "float");
64
- c(this, "uiConfig", A);
65
+ c(this, "uiConfig", z);
65
66
  c(this, "errorHandlers", {});
66
67
  c(this, "wrapper", document.createElement("div"));
67
68
  c(this, "botClient", null);
68
69
  var _, w, I, y, S;
69
- this._uuid = J();
70
+ this._uuid = Q();
70
71
  const {
71
72
  env: n,
72
73
  token: e,
@@ -96,7 +97,7 @@ class we {
96
97
  };
97
98
  this.updateUIConfig(k, b), this.env = n || "prod", this.stream = p, R({
98
99
  stream: this.stream
99
- }), this._applicationId = q(e).rid, this.apiUrl = d || Y[this.env] || G, this.docViewerUrl = h || X, this.service = this.setService(), this._initWrapper(), this.createBotClientSDK().then(() => {
100
+ }), this._applicationId = ee(e).rid, this.apiUrl = d || Z[this.env] || X, this.docViewerUrl = h || Y, this.service = this.setService(), this._initWrapper(), this.createBotClientSDK().then(() => {
100
101
  this.mode = u;
101
102
  });
102
103
  }
@@ -174,7 +175,7 @@ class we {
174
175
  this.updateUIConfig(d, e);
175
176
  } else {
176
177
  const d = {
177
- size: a(a(a({}, this.uiConfig.size), A.size), this._config.size),
178
+ size: a(a(a({}, this.uiConfig.size), z.size), this._config.size),
178
179
  theme: v(this.uiConfig.theme, E)
179
180
  };
180
181
  this.updateUIConfig(d, e);
@@ -193,7 +194,7 @@ class we {
193
194
  const f = this.token;
194
195
  if (!f)
195
196
  return h;
196
- if (ee(f)) {
197
+ if (ie(f)) {
197
198
  const i = "token is timeout";
198
199
  this.errorHandlers.token ? typeof this.errorHandlers.token == "function" ? this.errorHandlers.token(
199
200
  // @ts-ignore
@@ -210,7 +211,7 @@ class we {
210
211
  }), h;
211
212
  };
212
213
  function e(h, f = !0) {
213
- const t = `${s}${h}`, i = K.create({
214
+ const t = `${s}${h}`, i = J.create({
214
215
  baseURL: t
215
216
  });
216
217
  return f && i.interceptors.request.use(n), i;
@@ -229,15 +230,17 @@ class we {
229
230
  ) : console.error("errorHandlers.token is not a function") : console.error(t);
230
231
  }
231
232
  }, l = (h, f, t) => {
232
- h !== 10001 && h !== 10215 && (t || (T.config({
233
- getContainer: this.uiConfig.getContainer
234
- }), T.error({
233
+ h !== 10001 && h !== 10215 && (t || (H.config({
234
+ getContainer: this.uiConfig.getContainer,
235
+ prefixCls: "gbot-notification"
236
+ }), H.error({
235
237
  message: f
236
- }), T.config({
237
- getContainer: void 0
238
+ }), H.config({
239
+ getContainer: void 0,
240
+ prefixCls: "gbot-notification"
238
241
  })));
239
242
  }, g = e("");
240
- return new Z(g, () => this.token, {
243
+ return new q(g, () => this.token, {
241
244
  onHttpStatusError: u,
242
245
  onAppStatusError: l
243
246
  });
@@ -293,7 +296,7 @@ class we {
293
296
  debug: this.uiConfig.debug,
294
297
  env: this.uiConfig.env,
295
298
  apiRoot: this.apiUrl
296
- }), this.botClient = new te(this.token, {
299
+ }), this.botClient = new se(this.token, {
297
300
  plugins: this.uiConfig.plugins,
298
301
  mcp: this.uiConfig.mcp,
299
302
  stream: this.uiConfig.stream
@@ -304,7 +307,7 @@ class we {
304
307
  // 这里记录应用的名称和版本,以便后期数据分析
305
308
  ui: {
306
309
  name: "bot-client-ui",
307
- version: Q.version
310
+ version: G.version
308
311
  }
309
312
  }), this.botClient.ready ? s(this.botClient) : this.botClient.addEventListener("ready", () => B(this, null, function* () {
310
313
  var e;
@@ -320,206 +323,212 @@ class we {
320
323
  var s, n, e, u, l, g, d, h, f;
321
324
  if (this.wrapper.style.height = "100%", !((s = this.botClient) != null && s.application))
322
325
  throw Error("application is required");
323
- this.botClient.application.type === N.Text ? H.render(/* @__PURE__ */ z(se, {
324
- rId: this.rId,
325
- application: this.botClient.application,
326
- sessionId: this._defatulSessionId,
327
- showHeader: this.uiConfig.showHeader,
328
- apiUrl: this.apiUrl,
329
- env: this.uiConfig.env,
330
- debug: this.uiConfig.debug,
331
- mode: this.mode,
332
- token: this.token,
333
- className: this.mode,
334
- open: this.uiConfig.open,
335
- logo: this.uiConfig.logo,
336
- icon: this.uiConfig.icon,
337
- theme: this.uiConfig.theme,
338
- greeting: this.uiConfig.greeting,
339
- size: this.uiConfig.size,
340
- triggerButton: a({
341
- visible: !0
342
- }, this.uiConfig.triggerButton),
343
- history: this.uiConfig.history,
344
- service: this.service,
345
- docViewerUrl: this.docViewerUrl,
346
- plugins: this.uiConfig.plugins,
347
- mcp: this.uiConfig.mcp,
348
- transform: C(a({}, this.uiConfig.transform), {
349
- knowledges: ((n = this.uiConfig.features) == null ? void 0 : n.knowledges) === !0 || typeof ((e = this.uiConfig.features) == null ? void 0 : e.knowledges) == "object" && ((l = (u = this.uiConfig.features) == null ? void 0 : u.knowledges) == null ? void 0 : l.visible) !== !1
350
- }),
351
- features: this.uiConfig.features,
352
- disabled: this._inputDisabled,
353
- sider: this.uiConfig.sider,
354
- footer: this.uiConfig.footer,
355
- onComment: (t) => {
356
- var i, o;
357
- try {
358
- (o = (i = this.uiConfig.eventListeners) == null ? void 0 : i.comment) == null || o.call(i, t);
359
- } catch (r) {
360
- console.error(r);
361
- }
362
- },
363
- agentClient: this.botClient,
364
- onMessage: (t) => {
365
- var i, o;
366
- if (t.message.messageId)
326
+ this.botClient.application.type === N.Text ? A.render(/* @__PURE__ */ L(D, {
327
+ getPopupContainer: () => this.uiConfig.getContainer(),
328
+ children: /* @__PURE__ */ L(oe, {
329
+ rId: this.rId,
330
+ application: this.botClient.application,
331
+ sessionId: this._defatulSessionId,
332
+ showHeader: this.uiConfig.showHeader,
333
+ apiUrl: this.apiUrl,
334
+ env: this.uiConfig.env,
335
+ debug: this.uiConfig.debug,
336
+ mode: this.mode,
337
+ token: this.token,
338
+ className: this.mode,
339
+ open: this.uiConfig.open,
340
+ logo: this.uiConfig.logo,
341
+ icon: this.uiConfig.icon,
342
+ theme: this.uiConfig.theme,
343
+ greeting: this.uiConfig.greeting,
344
+ size: this.uiConfig.size,
345
+ triggerButton: a({
346
+ visible: !0
347
+ }, this.uiConfig.triggerButton),
348
+ history: this.uiConfig.history,
349
+ service: this.service,
350
+ docViewerUrl: this.docViewerUrl,
351
+ plugins: this.uiConfig.plugins,
352
+ mcp: this.uiConfig.mcp,
353
+ transform: C(a({}, this.uiConfig.transform), {
354
+ knowledges: ((n = this.uiConfig.features) == null ? void 0 : n.knowledges) === !0 || typeof ((e = this.uiConfig.features) == null ? void 0 : e.knowledges) == "object" && ((l = (u = this.uiConfig.features) == null ? void 0 : u.knowledges) == null ? void 0 : l.visible) !== !1
355
+ }),
356
+ features: this.uiConfig.features,
357
+ disabled: this._inputDisabled,
358
+ sider: this.uiConfig.sider,
359
+ footer: this.uiConfig.footer,
360
+ onComment: (t) => {
361
+ var i, o;
367
362
  try {
368
- (o = (i = this.uiConfig.eventListeners) == null ? void 0 : i.message) == null || o.call(i, t);
363
+ (o = (i = this.uiConfig.eventListeners) == null ? void 0 : i.comment) == null || o.call(i, t);
369
364
  } catch (r) {
370
365
  console.error(r);
371
366
  }
372
- },
373
- beforeMessageSend: (t) => {
374
- var i, o, r;
375
- if (!((i = this.uiConfig.eventListeners) != null && i.beforemessagesend))
376
- return !0;
377
- try {
378
- return ((r = (o = this.uiConfig.eventListeners) == null ? void 0 : o.beforemessagesend) == null ? void 0 : r.call(o, t)) || !1;
379
- } catch (p) {
380
- return console.error(p), !1;
381
- }
382
- },
383
- onSessionUnload: (t) => {
384
- var i, o;
385
- this._activeSession = null;
386
- try {
387
- (o = (i = this.uiConfig.eventListeners) == null ? void 0 : i.sessionunload) == null || o.call(i, t);
388
- } catch (r) {
389
- console.error(r);
390
- }
391
- },
392
- onSessionLoad: (t) => {
393
- var i, o, r;
394
- if (((i = this._activeSession) == null ? void 0 : i.id) === t.sessionId)
395
- this._activeSession = t.session;
396
- else {
397
- this._activeSession = t.session;
367
+ },
368
+ agentClient: this.botClient,
369
+ onMessage: (t) => {
370
+ var i, o;
371
+ if (t.message.messageId)
372
+ try {
373
+ (o = (i = this.uiConfig.eventListeners) == null ? void 0 : i.message) == null || o.call(i, t);
374
+ } catch (r) {
375
+ console.error(r);
376
+ }
377
+ },
378
+ beforeMessageSend: (t) => {
379
+ var i, o, r;
380
+ if (!((i = this.uiConfig.eventListeners) != null && i.beforemessagesend))
381
+ return !0;
398
382
  try {
399
- (r = (o = this.uiConfig.eventListeners) == null ? void 0 : o.sessionload) == null || r.call(o, t);
383
+ return ((r = (o = this.uiConfig.eventListeners) == null ? void 0 : o.beforemessagesend) == null ? void 0 : r.call(o, t)) || !1;
400
384
  } catch (p) {
401
- console.error(p);
385
+ return console.error(p), !1;
402
386
  }
403
- }
404
- },
405
- onHistoryLoad: (t) => {
406
- var i, o, r;
407
- if (((i = this._activeSession) == null ? void 0 : i.id) === t.sessionId)
387
+ },
388
+ onSessionUnload: (t) => {
389
+ var i, o;
390
+ this._activeSession = null;
408
391
  try {
409
- (r = (o = this.uiConfig.eventListeners) == null ? void 0 : o.historyload) == null || r.call(o, t);
410
- } catch (p) {
411
- console.error(p);
392
+ (o = (i = this.uiConfig.eventListeners) == null ? void 0 : i.sessionunload) == null || o.call(i, t);
393
+ } catch (r) {
394
+ console.error(r);
412
395
  }
413
- },
414
- defaultInput: this._defaultInputText !== void 0 ? {
415
- text: this._defaultInputText
416
- } : void 0,
417
- bodyStyle: this.uiConfig.bodyStyle,
418
- stream: this.stream
419
- }), this.wrapper) : H.render(/* @__PURE__ */ z($, {
420
- ref: this._agentClientRef,
421
- rId: this.rId,
422
- application: this.botClient.application,
423
- agentClient: this.botClient,
424
- sessionId: this._defatulSessionId,
425
- showHeader: this.uiConfig.showHeader,
426
- apiUrl: this.apiUrl,
427
- env: this.uiConfig.env,
428
- debug: this.uiConfig.debug,
429
- mode: this.mode,
430
- token: this.token,
431
- className: this.mode,
432
- open: this.uiConfig.open,
433
- logo: this.uiConfig.logo,
434
- icon: this.uiConfig.icon,
435
- theme: this.uiConfig.theme,
436
- greeting: this.uiConfig.greeting,
437
- size: this.uiConfig.size,
438
- triggerButton: a({
439
- visible: !0
440
- }, this.uiConfig.triggerButton),
441
- history: this.uiConfig.history,
442
- service: this.service,
443
- docViewerUrl: this.docViewerUrl,
444
- plugins: this.uiConfig.plugins,
445
- mcp: this.uiConfig.mcp,
446
- transform: C(a({}, this.uiConfig.transform), {
447
- knowledges: ((g = this.uiConfig.features) == null ? void 0 : g.knowledges) === !0 || typeof ((d = this.uiConfig.features) == null ? void 0 : d.knowledges) == "object" && ((f = (h = this.uiConfig.features) == null ? void 0 : h.knowledges) == null ? void 0 : f.visible) !== !1
448
- }),
449
- features: this.uiConfig.features,
450
- disabled: this._inputDisabled,
451
- sider: this.uiConfig.sider,
452
- footer: this.uiConfig.footer,
453
- onComment: (t) => {
454
- var i, o;
455
- try {
456
- (o = (i = this.uiConfig.eventListeners) == null ? void 0 : i.comment) == null || o.call(i, t);
457
- } catch (r) {
458
- console.error(r);
459
- }
460
- },
461
- onMessage: (t) => {
462
- var i, o;
463
- if (t.message.messageId)
396
+ },
397
+ onSessionLoad: (t) => {
398
+ var i, o, r;
399
+ if (((i = this._activeSession) == null ? void 0 : i.id) === t.sessionId)
400
+ this._activeSession = t.session;
401
+ else {
402
+ this._activeSession = t.session;
403
+ try {
404
+ (r = (o = this.uiConfig.eventListeners) == null ? void 0 : o.sessionload) == null || r.call(o, t);
405
+ } catch (p) {
406
+ console.error(p);
407
+ }
408
+ }
409
+ },
410
+ onHistoryLoad: (t) => {
411
+ var i, o, r;
412
+ if (((i = this._activeSession) == null ? void 0 : i.id) === t.sessionId)
413
+ try {
414
+ (r = (o = this.uiConfig.eventListeners) == null ? void 0 : o.historyload) == null || r.call(o, t);
415
+ } catch (p) {
416
+ console.error(p);
417
+ }
418
+ },
419
+ defaultInput: this._defaultInputText !== void 0 ? {
420
+ text: this._defaultInputText
421
+ } : void 0,
422
+ bodyStyle: this.uiConfig.bodyStyle,
423
+ stream: this.stream
424
+ })
425
+ }), this.wrapper) : A.render(/* @__PURE__ */ L(D, {
426
+ getPopupContainer: () => this.uiConfig.getContainer(),
427
+ children: /* @__PURE__ */ L(K, {
428
+ ref: this._agentClientRef,
429
+ rId: this.rId,
430
+ application: this.botClient.application,
431
+ agentClient: this.botClient,
432
+ sessionId: this._defatulSessionId,
433
+ showHeader: this.uiConfig.showHeader,
434
+ apiUrl: this.apiUrl,
435
+ env: this.uiConfig.env,
436
+ debug: this.uiConfig.debug,
437
+ mode: this.mode,
438
+ token: this.token,
439
+ className: this.mode,
440
+ open: this.uiConfig.open,
441
+ logo: this.uiConfig.logo,
442
+ icon: this.uiConfig.icon,
443
+ theme: this.uiConfig.theme,
444
+ greeting: this.uiConfig.greeting,
445
+ size: this.uiConfig.size,
446
+ triggerButton: a({
447
+ visible: !0
448
+ }, this.uiConfig.triggerButton),
449
+ history: this.uiConfig.history,
450
+ service: this.service,
451
+ docViewerUrl: this.docViewerUrl,
452
+ plugins: this.uiConfig.plugins,
453
+ mcp: this.uiConfig.mcp,
454
+ transform: C(a({}, this.uiConfig.transform), {
455
+ knowledges: ((g = this.uiConfig.features) == null ? void 0 : g.knowledges) === !0 || typeof ((d = this.uiConfig.features) == null ? void 0 : d.knowledges) == "object" && ((f = (h = this.uiConfig.features) == null ? void 0 : h.knowledges) == null ? void 0 : f.visible) !== !1
456
+ }),
457
+ features: this.uiConfig.features,
458
+ disabled: this._inputDisabled,
459
+ sider: this.uiConfig.sider,
460
+ footer: this.uiConfig.footer,
461
+ onComment: (t) => {
462
+ var i, o;
464
463
  try {
465
- (o = (i = this.uiConfig.eventListeners) == null ? void 0 : i.message) == null || o.call(i, t);
464
+ (o = (i = this.uiConfig.eventListeners) == null ? void 0 : i.comment) == null || o.call(i, t);
466
465
  } catch (r) {
467
466
  console.error(r);
468
467
  }
469
- },
470
- beforeMessageSend: (t) => {
471
- var i, o, r;
472
- if (!((i = this.uiConfig.eventListeners) != null && i.beforemessagesend))
473
- return !0;
474
- try {
475
- return ((r = (o = this.uiConfig.eventListeners) == null ? void 0 : o.beforemessagesend) == null ? void 0 : r.call(o, t)) || !1;
476
- } catch (p) {
477
- return console.error(p), !1;
478
- }
479
- },
480
- onSessionUnload: (t) => {
481
- var i, o;
482
- this._activeSession = null;
483
- try {
484
- (o = (i = this.uiConfig.eventListeners) == null ? void 0 : i.sessionunload) == null || o.call(i, t);
485
- } catch (r) {
486
- console.error(r);
487
- }
488
- },
489
- onSessionLoad: (t) => {
490
- var i, o, r;
491
- if (((i = this._activeSession) == null ? void 0 : i.id) === t.sessionId)
492
- this._activeSession = t.session;
493
- else {
494
- this._activeSession = t.session;
468
+ },
469
+ onMessage: (t) => {
470
+ var i, o;
471
+ if (t.message.messageId)
472
+ try {
473
+ (o = (i = this.uiConfig.eventListeners) == null ? void 0 : i.message) == null || o.call(i, t);
474
+ } catch (r) {
475
+ console.error(r);
476
+ }
477
+ },
478
+ beforeMessageSend: (t) => {
479
+ var i, o, r;
480
+ if (!((i = this.uiConfig.eventListeners) != null && i.beforemessagesend))
481
+ return !0;
495
482
  try {
496
- (r = (o = this.uiConfig.eventListeners) == null ? void 0 : o.sessionload) == null || r.call(o, t);
483
+ return ((r = (o = this.uiConfig.eventListeners) == null ? void 0 : o.beforemessagesend) == null ? void 0 : r.call(o, t)) || !1;
497
484
  } catch (p) {
498
- console.error(p);
485
+ return console.error(p), !1;
499
486
  }
500
- }
501
- },
502
- onHistoryLoad: (t) => {
503
- var i, o, r;
504
- if (((i = this._activeSession) == null ? void 0 : i.id) === t.sessionId)
487
+ },
488
+ onSessionUnload: (t) => {
489
+ var i, o;
490
+ this._activeSession = null;
505
491
  try {
506
- (r = (o = this.uiConfig.eventListeners) == null ? void 0 : o.historyload) == null || r.call(o, t);
507
- } catch (p) {
508
- console.error(p);
492
+ (o = (i = this.uiConfig.eventListeners) == null ? void 0 : i.sessionunload) == null || o.call(i, t);
493
+ } catch (r) {
494
+ console.error(r);
495
+ }
496
+ },
497
+ onSessionLoad: (t) => {
498
+ var i, o, r;
499
+ if (((i = this._activeSession) == null ? void 0 : i.id) === t.sessionId)
500
+ this._activeSession = t.session;
501
+ else {
502
+ this._activeSession = t.session;
503
+ try {
504
+ (r = (o = this.uiConfig.eventListeners) == null ? void 0 : o.sessionload) == null || r.call(o, t);
505
+ } catch (p) {
506
+ console.error(p);
507
+ }
509
508
  }
510
- },
511
- defaultInput: this._defaultInputText !== void 0 ? {
512
- text: this._defaultInputText
513
- } : void 0,
514
- bodyStyle: this.uiConfig.bodyStyle,
515
- stream: this.stream
509
+ },
510
+ onHistoryLoad: (t) => {
511
+ var i, o, r;
512
+ if (((i = this._activeSession) == null ? void 0 : i.id) === t.sessionId)
513
+ try {
514
+ (r = (o = this.uiConfig.eventListeners) == null ? void 0 : o.historyload) == null || r.call(o, t);
515
+ } catch (p) {
516
+ console.error(p);
517
+ }
518
+ },
519
+ defaultInput: this._defaultInputText !== void 0 ? {
520
+ text: this._defaultInputText
521
+ } : void 0,
522
+ bodyStyle: this.uiConfig.bodyStyle,
523
+ stream: this.stream
524
+ })
516
525
  }), this.wrapper), this._defaultInputText = "";
517
526
  });
518
527
  }
519
528
  destroy(s) {
520
- H.unmountComponentAtNode(this.wrapper), this.wrapper && this.wrapper.remove(), s == null || s();
529
+ H.destroy(), A.unmountComponentAtNode(this.wrapper), this.wrapper && this.wrapper.remove(), s == null || s();
521
530
  }
522
531
  }
523
532
  export {
524
- we as default
533
+ ye as default
525
534
  };
@@ -1,4 +1,4 @@
1
- const e = "@glodon-aiot/agent-cli-ui", t = "3.5.0-alpha.3", 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.0-beta.1", 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-alpha.3", s = "./dist/es/index
25
25
  webpack: "*"
26
26
  }, p = {
27
27
  "@ant-design/icons": "^5.3.4",
28
- "@glodon-aiot/apis": "^3.5.0-alpha.3",
29
- "@glodon-aiot/bot-client-sdk": "^3.5.0-alpha.3",
28
+ "@glodon-aiot/apis": "^3.5.0-beta.1",
29
+ "@glodon-aiot/bot-client-sdk": "^3.5.0-beta.1",
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",