@glodon-aiot/agent-cli-ui 3.9.0-beta.9 → 3.9.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 (88) hide show
  1. package/dist/es/Dialog/AgentChat/HistoryItem/SessionRefer/index.mjs +8 -8
  2. package/dist/es/Dialog/AgentChat/HistoryItem/index.mjs +4 -4
  3. package/dist/es/Dialog/AgentChat/index.mjs +84 -84
  4. package/dist/es/ReactTextGenerationUI/components/TextSiders/index.mjs +51 -51
  5. package/dist/es/packages/agent-cli-ui/package.json.mjs +3 -3
  6. package/dist/es/packages/react-components/dist/es/components/Markdown/index.mjs +22 -23
  7. package/dist/es/packages/react-components/dist/es/index.mjs +1 -1
  8. package/dist/es/src/style15.css +1 -1
  9. package/dist/es/src/style16.css +1 -1
  10. package/dist/es/src/style17.css +1 -1
  11. package/dist/es/src/style18.css +1 -1
  12. package/dist/es/src/style19.css +1 -1
  13. package/dist/es/src/style20.css +1 -1
  14. package/dist/es/src/style21.css +1 -1
  15. package/dist/es/src/style24.css +1 -1
  16. package/dist/es/src/style25.css +1 -1
  17. package/dist/es/src/style27.css +1 -1
  18. package/dist/es/src/style29.css +1 -1
  19. package/dist/es/src/style30.css +1 -1
  20. package/dist/es/src/style31.css +1 -1
  21. package/dist/es/src/style32.css +1 -1
  22. package/dist/es/src/style5.css +1 -1
  23. package/dist/es/src/style6.css +1 -1
  24. package/dist/es/src/style7.css +1 -1
  25. package/dist/es/src/style8.css +1 -1
  26. package/dist/es/src/style9.css +1 -1
  27. package/dist/lib/index.js +69 -70
  28. package/package.json +3 -3
  29. package/dist/es/node_modules/hast-util-from-parse5/lib/index.mjs +0 -162
  30. package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/index.mjs +0 -12
  31. package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/aria.mjs +0 -61
  32. package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/find.mjs +0 -33
  33. package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/html.mjs +0 -368
  34. package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/normalize.mjs +0 -6
  35. package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/svg.mjs +0 -566
  36. package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/util/case-insensitive-transform.mjs +0 -7
  37. package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/util/case-sensitive-transform.mjs +0 -6
  38. package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/util/create.mjs +0 -14
  39. package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/util/defined-info.mjs +0 -36
  40. package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/util/info.mjs +0 -28
  41. package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/util/merge.mjs +0 -10
  42. package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/util/schema.mjs +0 -21
  43. package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/util/types.mjs +0 -15
  44. package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/xlink.mjs +0 -19
  45. package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/xml.mjs +0 -15
  46. package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/xmlns.mjs +0 -16
  47. package/dist/es/node_modules/hast-util-from-parse5/node_modules/vfile-location/lib/index.mjs +0 -47
  48. package/dist/es/node_modules/hast-util-from-parse5/node_modules/web-namespaces/index.mjs +0 -11
  49. package/dist/es/node_modules/rehype-raw/lib/index.mjs +0 -26
  50. package/dist/es/node_modules/rehype-raw/node_modules/entities/dist/esm/decode-codepoint.mjs +0 -38
  51. package/dist/es/node_modules/rehype-raw/node_modules/entities/dist/esm/decode.mjs +0 -251
  52. package/dist/es/node_modules/rehype-raw/node_modules/entities/dist/esm/generated/decode-data-html.mjs +0 -7
  53. package/dist/es/node_modules/rehype-raw/node_modules/hast-util-raw/lib/index.mjs +0 -249
  54. package/dist/es/node_modules/rehype-raw/node_modules/hast-util-to-parse5/lib/index.mjs +0 -125
  55. package/dist/es/node_modules/rehype-raw/node_modules/html-void-elements/index.mjs +0 -4
  56. package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/common/doctype.mjs +0 -34
  57. package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/common/error-codes.mjs +0 -7
  58. package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/common/foreign-content.mjs +0 -103
  59. package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/common/html.mjs +0 -44
  60. package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/common/token.mjs +0 -14
  61. package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/common/unicode.mjs +0 -38
  62. package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/parser/formatting-element-list.mjs +0 -91
  63. package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/parser/index.mjs +0 -2308
  64. package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/parser/open-element-stack.mjs +0 -220
  65. package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/serializer/index.mjs +0 -2
  66. package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/tokenizer/index.mjs +0 -1948
  67. package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/tokenizer/preprocessor.mjs +0 -92
  68. package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/tree-adapters/default.mjs +0 -173
  69. package/dist/es/node_modules/rehype-raw/node_modules/property-information/index.mjs +0 -12
  70. package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/aria.mjs +0 -61
  71. package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/find.mjs +0 -33
  72. package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/html.mjs +0 -368
  73. package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/normalize.mjs +0 -6
  74. package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/svg.mjs +0 -566
  75. package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/util/case-insensitive-transform.mjs +0 -7
  76. package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/util/case-sensitive-transform.mjs +0 -6
  77. package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/util/create.mjs +0 -17
  78. package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/util/defined-info.mjs +0 -27
  79. package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/util/info.mjs +0 -23
  80. package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/util/merge.mjs +0 -11
  81. package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/util/schema.mjs +0 -17
  82. package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/util/types.mjs +0 -15
  83. package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/xlink.mjs +0 -19
  84. package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/xml.mjs +0 -15
  85. package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/xmlns.mjs +0 -16
  86. package/dist/es/node_modules/rehype-raw/node_modules/unist-util-visit/lib/index.mjs +0 -16
  87. package/dist/es/node_modules/rehype-raw/node_modules/web-namespaces/index.mjs +0 -11
  88. package/dist/es/node_modules/zwitch/index.mjs +0 -18
@@ -1,15 +1,15 @@
1
- var R = Object.defineProperty, T = Object.defineProperties;
2
- var U = Object.getOwnPropertyDescriptors;
1
+ var F = Object.defineProperty, R = Object.defineProperties;
2
+ var T = Object.getOwnPropertyDescriptors;
3
3
  var f = Object.getOwnPropertySymbols;
4
- var $ = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable;
5
- var h = (a, e, n) => e in a ? R(a, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : a[e] = n, w = (a, e) => {
4
+ var U = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable;
5
+ var h = (a, e, n) => e in a ? F(a, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : a[e] = n, w = (a, e) => {
6
6
  for (var n in e || (e = {}))
7
- $.call(e, n) && h(a, n, e[n]);
7
+ U.call(e, n) && h(a, n, e[n]);
8
8
  if (f)
9
9
  for (var n of f(e))
10
10
  b.call(e, n) && h(a, n, e[n]);
11
11
  return a;
12
- }, k = (a, e) => T(a, U(e));
12
+ }, k = (a, e) => R(a, T(e));
13
13
  import { jsxs as t, jsx as s } from "react/jsx-runtime";
14
14
  import { useContext as j } from "react";
15
15
  import { Space as I, Collapse as C } from "antd";
@@ -69,8 +69,8 @@ const {
69
69
  children: [i + 1, "."]
70
70
  }), d && /* @__PURE__ */ s(A, {
71
71
  data: o,
72
- loadPage: (x, S, D) => d.getKnowledgeIdFileIdData(x, S, D).then((y) => {
73
- const l = (y || []).find((F) => F.key === "pages_from");
72
+ loadPage: (x, S, D) => d.getKnowledgeIdFileIdData(x, S, D).then(($) => {
73
+ const l = ($ || []).find((y) => y.key === "pages_from");
74
74
  return (l == null ? void 0 : l.value) || 0;
75
75
  }),
76
76
  onClick: v
@@ -184,7 +184,7 @@ const Je = (s) => {
184
184
  ghost: !0,
185
185
  expandIconPosition: "right",
186
186
  children: (O = n.actions) == null ? void 0 : O.map((t, M) => {
187
- var J, P, Q, q, D, H, V, W, $, G, K, X;
187
+ var J, P, Q, q, D, H, $, V, W, G, K, X;
188
188
  return /* @__PURE__ */ o(Ne, {
189
189
  collapsible: S ? "header" : "icon",
190
190
  showArrow: S,
@@ -217,10 +217,10 @@ const Je = (s) => {
217
217
  }), (t[t.length - 1].type === "BEFORE_CALL" || t[t.length - 1].type === "FUNCTION_CALL") && /* @__PURE__ */ e("span", {
218
218
  className: "bot-plugin-result",
219
219
  children: "执行中"
220
- }), (t[t.length - 1].type === "RESULT" || t[t.length - 1].type === "AFTER_CALL") && g((V = t.find((a) => a.type === "RESULT")) == null ? void 0 : V.data.result) && /* @__PURE__ */ e("span", {
220
+ }), (t[t.length - 1].type === "RESULT" || t[t.length - 1].type === "AFTER_CALL") && g(($ = t.find((a) => a.type === "RESULT")) == null ? void 0 : $.data.result) && /* @__PURE__ */ e("span", {
221
221
  className: "bot-plugin-result",
222
222
  children: "执行成功"
223
- }), (t[t.length - 1].type === "RESULT" || t[t.length - 1].type === "AFTER_CALL") && !g((W = t.find((a) => a.type === "RESULT")) == null ? void 0 : W.data.result) && /* @__PURE__ */ e("span", {
223
+ }), (t[t.length - 1].type === "RESULT" || t[t.length - 1].type === "AFTER_CALL") && !g((V = t.find((a) => a.type === "RESULT")) == null ? void 0 : V.data.result) && /* @__PURE__ */ e("span", {
224
224
  className: "bot-plugin-result",
225
225
  children: "执行失败"
226
226
  }), t[t.length - 1].type === "ABORT" && /* @__PURE__ */ e("span", {
@@ -234,7 +234,7 @@ const Je = (s) => {
234
234
  }), /* @__PURE__ */ e("div", {
235
235
  className: "bot-plugin-json",
236
236
  children: /* @__PURE__ */ e(u, {
237
- josn: ($ = t.find((a) => a.type === "BEFORE_CALL")) == null ? void 0 : $.data.thought
237
+ josn: (W = t.find((a) => a.type === "BEFORE_CALL")) == null ? void 0 : W.data.thought
238
238
  })
239
239
  }), /* @__PURE__ */ e("div", {
240
240
  className: "bot-plugin-content",
@@ -1,37 +1,37 @@
1
1
  var wn = Object.defineProperty, kn = Object.defineProperties;
2
2
  var In = Object.getOwnPropertyDescriptors;
3
3
  var Nt = Object.getOwnPropertySymbols;
4
- var Nn = Object.prototype.hasOwnProperty, En = Object.prototype.propertyIsEnumerable;
4
+ var Nn = Object.prototype.hasOwnProperty, Ln = Object.prototype.propertyIsEnumerable;
5
5
  var Ue = (w, h, o) => h in w ? wn(w, h, { enumerable: !0, configurable: !0, writable: !0, value: o }) : w[h] = o, Ae = (w, h) => {
6
6
  for (var o in h || (h = {}))
7
7
  Nn.call(h, o) && Ue(w, o, h[o]);
8
8
  if (Nt)
9
9
  for (var o of Nt(h))
10
- En.call(h, o) && Ue(w, o, h[o]);
10
+ Ln.call(h, o) && Ue(w, o, h[o]);
11
11
  return w;
12
12
  }, Fe = (w, h) => kn(w, In(h));
13
13
  var U = (w, h, o) => (Ue(w, typeof h != "symbol" ? h + "" : h, o), o);
14
14
  var A = (w, h, o) => new Promise((M, e) => {
15
- var x = (L) => {
15
+ var x = (E) => {
16
16
  try {
17
- p(o.next(L));
17
+ p(o.next(E));
18
18
  } catch (P) {
19
19
  e(P);
20
20
  }
21
- }, $ = (L) => {
21
+ }, $ = (E) => {
22
22
  try {
23
- p(o.throw(L));
23
+ p(o.throw(E));
24
24
  } catch (P) {
25
25
  e(P);
26
26
  }
27
- }, p = (L) => L.done ? M(L.value) : Promise.resolve(L.value).then(x, $);
27
+ }, p = (E) => E.done ? M(E.value) : Promise.resolve(E.value).then(x, $);
28
28
  p((o = o.apply(w, h)).next());
29
29
  });
30
- import { jsx as d, jsxs as V, Fragment as Ln } from "react/jsx-runtime";
30
+ import { jsx as d, jsxs as V, Fragment as En } from "react/jsx-runtime";
31
31
  import { memo as Pn, forwardRef as Tn, useState as m, useRef as Y, useContext as On, useEffect as k, useMemo as Rn, useImperativeHandle as Dn } from "react";
32
- /* empty css */import { Spin as Et, Divider as Hn, Button as X, Space as Ie, Upload as Un, Tooltip as An, Popover as Fn, notification as ie, message as u } from "antd";
32
+ /* empty css */import { Spin as Lt, Divider as Hn, Button as X, Space as Ie, Upload as Un, Tooltip as An, Popover as Fn, notification as ie, message as u } from "antd";
33
33
  import oe from "../../components/Iconfont/index.mjs";
34
- import { IHistoryRole as se, ApplicationTypes as re, ChatMessageRole as Lt, PromptVariableType as Ne } from "@glodon-aiot/apis";
34
+ import { IHistoryRole as se, ApplicationTypes as re, ChatMessageRole as Et, PromptVariableType as Ne } from "@glodon-aiot/apis";
35
35
  import Rt from "./HistoryItem/index.mjs";
36
36
  import Dt from "dayjs";
37
37
  import { v4 as ze } from "uuid";
@@ -78,7 +78,7 @@ class ge {
78
78
  };
79
79
  }
80
80
  }
81
- const Ot = 10, Ee = 5, je = (w, h, o, M) => {
81
+ const Ot = 10, Le = 5, je = (w, h, o, M) => {
82
82
  let e = w;
83
83
  if (M === re.Agent) {
84
84
  if (o && o.length > 0) {
@@ -104,9 +104,9 @@ ${e}` : e;
104
104
  onCreateSession: x,
105
105
  embeddingService: $,
106
106
  setCurrentSession: p,
107
- networkStatus: L,
107
+ networkStatus: E,
108
108
  setNetworkStatus: P
109
- } = w, [v, I] = m([]), [Ht, fe] = m(), [Le, Ve] = m(), O = Y(null), {
109
+ } = w, [v, I] = m([]), [Ht, fe] = m(), [Ee, Ve] = m(), O = Y(null), {
110
110
  service: R,
111
111
  agentClient: N,
112
112
  depId: Ut,
@@ -118,7 +118,7 @@ ${e}` : e;
118
118
  beforeMessageSend: B,
119
119
  bodyStyle: Ft,
120
120
  disabled: F,
121
- features: a,
121
+ features: l,
122
122
  popupContainer: g,
123
123
  icon: Mt,
124
124
  sider: jt,
@@ -127,8 +127,8 @@ ${e}` : e;
127
127
  k(() => {
128
128
  Bt(qe > 0);
129
129
  }, [qe]);
130
- const pe = Y(null), [Ye, _t] = m([]), [Qe, J] = m(!1), [Ge, qt] = m(!1), [Wt, Kt] = m(""), [Yt, S] = m(), [ee, ae] = m({}), ve = Y(null), Xe = Y(null), Oe = Y(null), [Ze, Qt] = m(!1), [Gt, Xt] = m([]), [Zt, be] = m(!0), [Jt, St] = m(!0), [Je, j] = m(!1), [Re, _] = m(!1), [Se, en] = m(!1), [D, le] = m(typeof (a == null ? void 0 : a.promptVariables) == "object" ? a.promptVariables.default || [] : []), [tn, nn] = m(() => {
131
- const t = typeof (a == null ? void 0 : a.knowledges) == "object" && a.knowledges.default || void 0;
130
+ const pe = Y(null), [Ye, _t] = m([]), [Qe, J] = m(!1), [Ge, qt] = m(!1), [Wt, Kt] = m(""), [Yt, S] = m(), [ee, ae] = m({}), ve = Y(null), Xe = Y(null), Oe = Y(null), [Ze, Qt] = m(!1), [Gt, Xt] = m([]), [Zt, be] = m(!0), [Jt, St] = m(!0), [Je, j] = m(!1), [Re, _] = m(!1), [Se, en] = m(!1), [D, le] = m(typeof (l == null ? void 0 : l.promptVariables) == "object" ? l.promptVariables.default || [] : []), [tn, nn] = m(() => {
131
+ const t = typeof (l == null ? void 0 : l.knowledges) == "object" && l.knowledges.default || void 0;
132
132
  if (t) {
133
133
  if (Array.isArray(t) && t.some((r) => Array.isArray(r.fileIds) && r.fileIds.length === 0))
134
134
  throw Error("fileIds cannot be an empty array");
@@ -136,7 +136,7 @@ ${e}` : e;
136
136
  throw Error(`knowledges and fileIds total count cannot exceed ${Pt}`);
137
137
  }
138
138
  return t;
139
- }), [et, z] = m(!1), [tt, de] = m(!1), [on, te] = m(typeof (a == null ? void 0 : a.connectNetwork) == "object" && typeof (a == null ? void 0 : a.connectNetwork.default) == "boolean" ? a.connectNetwork.default : !1), [nt, xe] = m(!1), [sn, q] = m(!1), [rn, an] = m(null), [Ce, G] = m(!1), [it, ot] = m(!1), {
139
+ }), [et, z] = m(!1), [tt, de] = m(!1), [on, te] = m(typeof (l == null ? void 0 : l.connectNetwork) == "object" && typeof (l == null ? void 0 : l.connectNetwork.default) == "boolean" ? l.connectNetwork.default : !1), [nt, xe] = m(!1), [sn, q] = m(!1), [rn, an] = m(null), [Ce, G] = m(!1), [it, ot] = m(!1), {
140
140
  isSwitchingToExistingSession: st,
141
141
  setIsSwitchingToExistingSession: we
142
142
  } = ni(), ne = Y(null);
@@ -165,7 +165,7 @@ ${e}` : e;
165
165
  }), !((s = e == null ? void 0 : e.data) != null && s.id))
166
166
  return;
167
167
  if (_(!1), j(!1), (r = e.messages) != null && r.length) {
168
- const c = [...e.messages.filter((l) => l == null ? void 0 : l.messageId)].reverse();
168
+ const c = [...e.messages.filter((a) => a == null ? void 0 : a.messageId)].reverse();
169
169
  y.current = [...c], I([...c]), q(!1);
170
170
  }
171
171
  const n = (i) => {
@@ -313,7 +313,7 @@ ${e}` : e;
313
313
  if (Ce)
314
314
  return;
315
315
  G(!0), x == null || x({
316
- netOpen: L ? Q.OPEN : Q.CLOSE
316
+ netOpen: E ? Q.OPEN : Q.CLOSE
317
317
  }).then((C) => {
318
318
  var T, ce;
319
319
  z(!0), P(!!((T = C.data) != null && T.netOpen)), te(!!((ce = C.data) != null && ce.enableNetOpen)), ke(C).then(() => {
@@ -336,7 +336,7 @@ ${e}` : e;
336
336
  message: {
337
337
  content: i,
338
338
  sessionId: r,
339
- role: Lt.User,
339
+ role: Et.User,
340
340
  files: ee[r]
341
341
  }
342
342
  }) : c = !0;
@@ -347,45 +347,45 @@ ${e}` : e;
347
347
  G(!1);
348
348
  return;
349
349
  }
350
- let l = n;
351
- typeof c == "object" && (l = c.content || n);
352
- const E = yield (() => new Promise((C) => {
350
+ let a = n;
351
+ typeof c == "object" && (a = c.content || n);
352
+ const L = yield (() => new Promise((C) => {
353
353
  le((T) => (C(T), T));
354
354
  }))();
355
- if (!(yield e.setPromptVariables(E))) {
355
+ if (!(yield e.setPromptVariables(L))) {
356
356
  G(!1);
357
357
  return;
358
358
  }
359
- ((K = ee[r]) == null ? void 0 : K.length) > 0 ? dn(l) : De(l);
359
+ ((K = ee[r]) == null ? void 0 : K.length) > 0 ? dn(a) : De(a);
360
360
  }), ke = (t) => new Promise((n, s) => A(void 0, null, function* () {
361
- const c = (t == null ? void 0 : t.promptVariables).filter((l) => l.type ? !((l.type === Ne.User || l.type === void 0) && l.key === "query") && !((l.type === Ne.System || l.type === void 0) && l.key === "datetime") : l.key !== "query").map((l) => {
362
- var E;
363
- const b = (E = D.find((H) => H.key === l.key && H.type === l.type)) == null ? void 0 : E.value;
364
- return l.value = b || "", l;
361
+ const c = (t == null ? void 0 : t.promptVariables).filter((a) => a.type ? !((a.type === Ne.User || a.type === void 0) && a.key === "query") && !((a.type === Ne.System || a.type === void 0) && a.key === "datetime") : a.key !== "query").map((a) => {
362
+ var L;
363
+ const b = (L = D.find((H) => H.key === a.key && H.type === a.type)) == null ? void 0 : L.value;
364
+ return a.value = b || "", a;
365
365
  });
366
- le(c.sort((l, b) => l.key.localeCompare(b.key))), yield t == null ? void 0 : t.setPromptVariables(c).catch((l) => {
367
- console.error(l), u.config({
366
+ le(c.sort((a, b) => a.key.localeCompare(b.key))), yield t == null ? void 0 : t.setPromptVariables(c).catch((a) => {
367
+ console.error(a), u.config({
368
368
  getContainer: () => (g == null ? void 0 : g.current) || document.body,
369
369
  prefixCls: "gbot-message"
370
- }), u.error(l.message), u.config({
370
+ }), u.error(a.message), u.config({
371
371
  getContainer: void 0,
372
372
  prefixCls: "gbot-message"
373
373
  });
374
374
  }), n();
375
375
  })), dn = (t) => {
376
- var i, c, l;
376
+ var i, c, a;
377
377
  if (be(!1), !((i = e == null ? void 0 : e.data) != null && i.id) || !(o != null && o.id))
378
378
  return;
379
379
  const n = ((c = e.data) == null ? void 0 : c.id) || "";
380
380
  let s = [], r = /* @__PURE__ */ new Set();
381
- (l = ee[n]) == null || l.forEach((b) => {
381
+ (a = ee[n]) == null || a.forEach((b) => {
382
382
  r.has(b.id) || (s.push(b), r.add(b.id));
383
383
  }), be(!0), De(t, s);
384
384
  };
385
385
  k(() => {
386
- if (!Le || !e)
386
+ if (!Ee || !e)
387
387
  return;
388
- const t = Le, n = () => A(void 0, null, function* () {
388
+ const t = Ee, n = () => A(void 0, null, function* () {
389
389
  xe(!0);
390
390
  const s = je(t, Z, ee[e.id], (o == null ? void 0 : o.type) || 0);
391
391
  let r;
@@ -396,7 +396,7 @@ ${e}` : e;
396
396
  message: {
397
397
  content: s,
398
398
  sessionId: e.id,
399
- role: Lt.User,
399
+ role: Et.User,
400
400
  files: ee[e.id]
401
401
  }
402
402
  }) : r = !0;
@@ -412,7 +412,7 @@ ${e}` : e;
412
412
  return e.ready ? n() : e.addEventListener("ready", n, !0), () => {
413
413
  e == null || e.removeEventListener("ready", n);
414
414
  };
415
- }, [Le, e]);
415
+ }, [Ee, e]);
416
416
  const De = (t, n) => A(void 0, null, function* () {
417
417
  var W, K, C;
418
418
  const s = (W = e == null ? void 0 : e.data) == null ? void 0 : W.id;
@@ -441,26 +441,26 @@ ${e}` : e;
441
441
  sessionId: s,
442
442
  message: c
443
443
  });
444
- const l = new ge("", s, se.System);
445
- l.isWaiting = !0, y.current = [l, ...y.current], I(y.current);
446
- const b = (n == null ? void 0 : n.map((T) => T.id)) || [], E = {
444
+ const a = new ge("", s, se.System);
445
+ a.isWaiting = !0, y.current = [a, ...y.current], I(y.current);
446
+ const b = (n == null ? void 0 : n.map((T) => T.id)) || [], L = {
447
447
  stream: jn.stream,
448
448
  referenceFirst: !1
449
449
  };
450
450
  if (f != null && f.promptVariables) {
451
451
  const T = D == null ? void 0 : D.reduce((ce, It) => (ce[It.key] = It.value, ce), {});
452
- E.formatValues = T;
452
+ L.formatValues = T;
453
453
  }
454
454
  if (f != null && f.knowledges) {
455
455
  const T = tn;
456
- E.knowledges = T;
456
+ L.knowledges = T;
457
457
  }
458
458
  const H = {
459
459
  text: r,
460
460
  fileIds: b,
461
461
  files: n
462
462
  };
463
- i && i.length > 0 && (H.imageContent = i), yield e.send(H, E), ae({
463
+ i && i.length > 0 && (H.imageContent = i), yield e.send(H, L), ae({
464
464
  [s]: []
465
465
  }), (C = ve.current) == null || C.update(), he([]), ye([]), G(!1);
466
466
  });
@@ -484,12 +484,12 @@ ${e}` : e;
484
484
  });
485
485
  return;
486
486
  }
487
- const c = i.actions || [], l = new ge(i.content, t, se.Robot);
488
- l.messageId = i.messageId || ze(), l.reasoningContent = i.reasoningContent, l.searchReference = i.searchReference, l.thinkingSecs = i.thinkingSecs, l.thinkingStatus = i.thinkingStatus, l.actions = c, l.isLoading = !0, l.searchingStatus = i.searchingStatus, y.current = y.current.filter((b) => !b.isWaiting).filter((b) => !b.isReplying), i.index === void 0 && I([l, ...y.current]), i.code === 11915 && (j(!1), _(!1), l.isLoading = !1, l.content = "请您换个问题问我吧~", l.isSensitive = !0, I([l, ...y.current])), i.index === -2 && (j(!1), _(!1), l.isLoading = !1, l.content = "回答已中止~", l.isSuspend = !0, I([l, ...y.current])), i.index === -1 && (j(!1), _(!1), l.isLoading = !1, l.reference = i.reference, I([l, ...y.current]), o.id && ue && ue({
487
+ const c = i.actions || [], a = new ge(i.content, t, se.Robot);
488
+ a.messageId = i.messageId || ze(), a.reasoningContent = i.reasoningContent, a.searchReference = i.searchReference, a.thinkingSecs = i.thinkingSecs, a.thinkingStatus = i.thinkingStatus, a.actions = c, a.isLoading = !0, a.searchingStatus = i.searchingStatus, y.current = y.current.filter((b) => !b.isWaiting).filter((b) => !b.isReplying), i.index === void 0 && I([a, ...y.current]), i.code === 11915 && (j(!1), _(!1), a.isLoading = !1, a.content = "请您换个问题问我吧~", a.isSensitive = !0, I([a, ...y.current])), i.index === -2 && (j(!1), _(!1), a.isLoading = !1, a.content = "回答已中止~", a.isSuspend = !0, I([a, ...y.current])), i.index === -1 && (j(!1), _(!1), a.isLoading = !1, a.reference = i.reference, I([a, ...y.current]), o.id && ue && ue({
489
489
  applicationId: o.id,
490
490
  sessionId: t,
491
- message: l
492
- })), i.index === -3 && (j(!1), _(!1), l.isLoading = !1, l.reference = i.reference, l.relatedQuesion = i.relatedQuesion, I([l, ...y.current]));
491
+ message: a
492
+ })), i.index === -3 && (j(!1), _(!1), a.isLoading = !1, a.reference = i.reference, a.relatedQuesion = i.relatedQuesion, I([a, ...y.current]));
493
493
  }, s = () => {
494
494
  e.addEventListener("message:updated", n);
495
495
  };
@@ -529,12 +529,12 @@ ${e}` : e;
529
529
  }), u.error("图片须小于20M"), u.config({
530
530
  getContainer: void 0,
531
531
  prefixCls: "gbot-message"
532
- }), !1) : (he((s) => s.length >= Ee ? s : [...s, t]), !1);
532
+ }), !1) : (he((s) => s.length >= Le ? s : [...s, t]), !1);
533
533
  }, gn = () => A(void 0, null, function* () {
534
534
  var t;
535
535
  return (t = e == null ? void 0 : e.data) != null && t.id ? e : (ne.current || (ne.current = new Promise((n, s) => {
536
536
  z(!0), x == null || x({
537
- netOpen: L ? Q.OPEN : Q.CLOSE
537
+ netOpen: E ? Q.OPEN : Q.CLOSE
538
538
  }).then((r) => {
539
539
  var i, c;
540
540
  p == null || p(r), z(!1), P(!!((i = r.data) != null && i.netOpen)), te(!!((c = r.data) != null && c.enableNetOpen)), ke(r), n(r);
@@ -555,11 +555,11 @@ ${e}` : e;
555
555
  knowledgeId: ((c = t.data) == null ? void 0 : c.id) || "",
556
556
  type: 1
557
557
  };
558
- R == null || R.postTicket(i).then((l) => {
559
- R.uploadMinioFile(l.minio, n).then(() => {
558
+ R == null || R.postTicket(i).then((a) => {
559
+ R.uploadMinioFile(a.minio, n).then(() => {
560
560
  var W, K;
561
- const b = (W = l.minio.endpoints) == null ? void 0 : W[0], E = l.minio.bucket, H = (K = l.minio.fileKeys) == null ? void 0 : K[0];
562
- r(`${location.protocol}//${b}/${E}/${H}`);
561
+ const b = (W = a.minio.endpoints) == null ? void 0 : W[0], L = a.minio.bucket, H = (K = a.minio.fileKeys) == null ? void 0 : K[0];
562
+ r(`${a.minio.useSSL ? "https:" : location.protocol}//${b}/${L}/${H}`);
563
563
  }).catch(() => {
564
564
  });
565
565
  }).catch(() => {
@@ -644,7 +644,7 @@ ${e}` : e;
644
644
  e ? e.fetchData().then((t) => {
645
645
  var n;
646
646
  (n = e == null ? void 0 : e.data) != null && n.id && (P(t.netOpen), te(t.enableNetOpen));
647
- }) : (P(typeof (a == null ? void 0 : a.connectNetwork) == "object" && typeof (a == null ? void 0 : a.connectNetwork.default) == "boolean" ? a.connectNetwork.default : !1), te(o.arrange[0].enableNetOpen));
647
+ }) : (P(typeof (l == null ? void 0 : l.connectNetwork) == "object" && typeof (l == null ? void 0 : l.connectNetwork.default) == "boolean" ? l.connectNetwork.default : !1), te(o.arrange[0].enableNetOpen));
648
648
  });
649
649
  k(() => {
650
650
  He();
@@ -655,8 +655,8 @@ ${e}` : e;
655
655
  const r = document.getElementById("chat-main"), i = (n = O.current) == null ? void 0 : n.querySelector(".infinite-scroll-component__outerdiv"), c = (s = O.current) == null ? void 0 : s.querySelector(".infinite-scroll-component");
656
656
  if (!i || !c || !r)
657
657
  return;
658
- const l = r.offsetHeight;
659
- if (c.offsetHeight <= l) {
658
+ const a = r.offsetHeight;
659
+ if (c.offsetHeight <= a) {
660
660
  if (i.style.height === "100%")
661
661
  return;
662
662
  i.style.height = "100%";
@@ -672,13 +672,13 @@ ${e}` : e;
672
672
  return;
673
673
  const t = () => {
674
674
  const r = ((N == null ? void 0 : N.promptVariables) || []).filter((i) => i.type ? !(i.type === Ne.User && i.key === "query") && !(i.type === Ne.System && i.key === "datetime") && i.status === 1 : i.key !== "query" && i.status === 1).map((i, c) => {
675
- var b, E;
676
- let l = "";
677
- return typeof (a == null ? void 0 : a.promptVariables) == "object" && (l = ((E = (b = a.promptVariables.default) == null ? void 0 : b.find((H) => H.key === i.key && H.type === i.type)) == null ? void 0 : E.value) || ""), {
675
+ var b, L;
676
+ let a = "";
677
+ return typeof (l == null ? void 0 : l.promptVariables) == "object" && (a = ((L = (b = l.promptVariables.default) == null ? void 0 : b.find((H) => H.key === i.key && H.type === i.type)) == null ? void 0 : L.value) || ""), {
678
678
  id: c + "",
679
679
  key: i.key,
680
680
  name: i.name,
681
- value: l,
681
+ value: a,
682
682
  type: i.type
683
683
  };
684
684
  });
@@ -687,9 +687,9 @@ ${e}` : e;
687
687
  return N != null && N.ready ? t() : N == null || N.addEventListener("ready", t), () => {
688
688
  N == null || N.removeEventListener("ready", t);
689
689
  };
690
- }, [e, N, a == null ? void 0 : a.promptVariables]);
690
+ }, [e, N, l == null ? void 0 : l.promptVariables]);
691
691
  const lt = () => x == null ? void 0 : x({
692
- netOpen: L ? Q.OPEN : Q.CLOSE
692
+ netOpen: E ? Q.OPEN : Q.CLOSE
693
693
  }).then((t) => {
694
694
  var n, s;
695
695
  return p == null || p(t), z(!1), P(!!((n = t.data) != null && n.netOpen)), te(!!((s = t.data) != null && s.enableNetOpen)), ke(t), t;
@@ -710,7 +710,7 @@ ${e}` : e;
710
710
  isLoading: !1
711
711
  },
712
712
  actions: !!v.length,
713
- markdown: a == null ? void 0 : a.markdown
713
+ markdown: l == null ? void 0 : l.markdown
714
714
  }) : null;
715
715
  }, [o == null ? void 0 : o.arrange, v]);
716
716
  return Dn(h, () => ({
@@ -728,8 +728,8 @@ ${e}` : e;
728
728
  className: "agent-chat",
729
729
  children: [sn ? /* @__PURE__ */ d("div", {
730
730
  className: "session-loading",
731
- children: /* @__PURE__ */ d(Et, {})
732
- }) : /* @__PURE__ */ V(Ln, {
731
+ children: /* @__PURE__ */ d(Lt, {})
732
+ }) : /* @__PURE__ */ V(En, {
733
733
  children: [(f == null ? void 0 : f.promptVariables) && /* @__PURE__ */ d(Xn, {
734
734
  ref: Xe,
735
735
  appId: o.id,
@@ -773,7 +773,7 @@ ${e}` : e;
773
773
  textAlign: "center",
774
774
  overflow: "hidden"
775
775
  },
776
- children: /* @__PURE__ */ d(Et, {})
776
+ children: /* @__PURE__ */ d(Lt, {})
777
777
  }),
778
778
  scrollableTarget: "scrollableDiv",
779
779
  children: [v.map((t, n) => /* @__PURE__ */ d(oi, {
@@ -785,14 +785,14 @@ ${e}` : e;
785
785
  onRelatedClick: vn,
786
786
  onAgainClick: bn,
787
787
  onEditClick: pn,
788
- markdown: a == null ? void 0 : a.markdown
788
+ markdown: l == null ? void 0 : l.markdown
789
789
  }, t.messageId + n)), !tt && dt]
790
790
  }) : /* @__PURE__ */ V("div", {
791
791
  className: "main-empty",
792
- children: [(a == null ? void 0 : a.greeting) !== !1 && /* @__PURE__ */ d(Wn, {
792
+ children: [(l == null ? void 0 : l.greeting) !== !1 && /* @__PURE__ */ d(Wn, {
793
793
  text: (
794
794
  // 第一优先级:features配置
795
- a != null && a.greeting && typeof a.greeting == "object" && a.greeting.text !== void 0 ? a.greeting.text : (
795
+ l != null && l.greeting && typeof l.greeting == "object" && l.greeting.text !== void 0 ? l.greeting.text : (
796
796
  // 第二优先级:application.arrange[0].greetings
797
797
  (mt = o.arrange) != null && mt.length && ((ht = o.arrange[0]) != null && ht.greetings) ? o.arrange[0].greetings : (
798
798
  // 第三优先级:默认文本
@@ -800,13 +800,13 @@ ${e}` : e;
800
800
  )
801
801
  )
802
802
  ),
803
- icon: a === void 0 || a.greeting === !0 || ((yt = a.greeting) == null ? void 0 : yt.icon) === void 0 ? Mt || Tt.icon : a.greeting.icon,
804
- children: !!Ye.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__ */ d(qn, {
803
+ icon: l === void 0 || l.greeting === !0 || ((yt = l.greeting) == null ? void 0 : yt.icon) === void 0 ? Mt || Tt.icon : l.greeting.icon,
804
+ children: !!Ye.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__ */ d(qn, {
805
805
  ref: Oe,
806
806
  sid: (pt = e == null ? void 0 : e.data) == null ? void 0 : pt.id,
807
807
  isRecommendClearing: Qe,
808
808
  data: Ye,
809
- layoutBreakpoints: typeof (a == null ? void 0 : a.greeting) == "object" ? a.greeting.layoutBreakpoints : void 0,
809
+ layoutBreakpoints: typeof (l == null ? void 0 : l.greeting) == "object" ? l.greeting.layoutBreakpoints : void 0,
810
810
  onItemClick: (t) => {
811
811
  var s, r, i;
812
812
  if (fe(t == null ? void 0 : t.question), S(t == null ? void 0 : t.question), Qe)
@@ -814,12 +814,12 @@ ${e}` : e;
814
814
  t != null && t.id && J(!0);
815
815
  const n = (s = e == null ? void 0 : e.data) == null ? void 0 : s.id;
816
816
  f != null && f.fileUpload ? (i = (r = ve.current) == null ? void 0 : r.clear()) == null || i.then(() => {
817
- var c, l;
817
+ var c, a;
818
818
  t != null && t.id && (n ? (c = at(n, t)) == null || c.finally(() => {
819
819
  J(!1);
820
- }) : (J(!1), z(!0), (l = lt()) == null || l.then((b) => {
821
- var E;
822
- (E = at(b.id, t)) == null || E.finally(() => {
820
+ }) : (J(!1), z(!0), (a = lt()) == null || a.then((b) => {
821
+ var L;
822
+ (L = at(b.id, t)) == null || L.finally(() => {
823
823
  J(!1);
824
824
  });
825
825
  })));
@@ -897,18 +897,18 @@ ${e}` : e;
897
897
  children: [/* @__PURE__ */ V(Ie, {
898
898
  children: [(o.type === re.Agent && (f == null ? void 0 : f.imageUpload) || o.type === re.Dialog && ((vt = o.arrange) == null ? void 0 : vt.length) && !!o.arrange[0].visionOpen && (f == null ? void 0 : f.imageUpload)) && /* @__PURE__ */ d(Un, {
899
899
  multiple: !0,
900
- disabled: me.length >= Ee || F,
900
+ disabled: me.length >= Le || F,
901
901
  accept: ".jpg, .png, .jpeg,.bmp",
902
902
  listType: "picture-card",
903
903
  beforeUpload: cn,
904
904
  className: "footer-upload-picture",
905
905
  showUploadList: !1,
906
- children: me.length < Ee ? /* @__PURE__ */ d(An, {
906
+ children: me.length < Le ? /* @__PURE__ */ d(An, {
907
907
  placement: "topLeft",
908
908
  overlayClassName: "footer-upload-tooltip",
909
909
  title: /* @__PURE__ */ d("div", {
910
910
  children: `支持上传.jpg .png .jpeg
911
- .bmp格式的图片数据,单文件最大20M,最多${Ee}张`
911
+ .bmp格式的图片数据,单文件最大20M,最多${Le}张`
912
912
  }),
913
913
  children: /* @__PURE__ */ d(X, {
914
914
  type: "text",
@@ -953,7 +953,7 @@ ${e}` : e;
953
953
  }),
954
954
  createSession: () => new Promise((t) => {
955
955
  z(!0), x == null || x({
956
- netOpen: L ? Q.OPEN : Q.CLOSE
956
+ netOpen: E ? Q.OPEN : Q.CLOSE
957
957
  }).then((n) => {
958
958
  var r, i, c;
959
959
  p == null || p(n), z(!1), P(!!((r = n.data) != null && r.netOpen)), te(!!((i = n.data) != null && i.enableNetOpen)), ke(n);
@@ -1004,8 +1004,8 @@ ${e}` : e;
1004
1004
  }), /* @__PURE__ */ V(Ie, {
1005
1005
  children: [(f == null ? void 0 : f.connectNetwork) && o.type === re.Dialog && ((xt = o.arrange) == null ? void 0 : xt.length) && !!o.arrange[0].enableNetOpen && /* @__PURE__ */ d(ei, {
1006
1006
  sessionId: (Ct = e == null ? void 0 : e.data) == null ? void 0 : Ct.id,
1007
- netStatus: L,
1008
- enable: typeof (a == null ? void 0 : a.connectNetwork) == "object" && typeof (a == null ? void 0 : a.connectNetwork.diabled) == "boolean" ? !(a != null && a.connectNetwork.diabled) : on,
1007
+ netStatus: E,
1008
+ enable: typeof (l == null ? void 0 : l.connectNetwork) == "object" && typeof (l == null ? void 0 : l.connectNetwork.diabled) == "boolean" ? !(l != null && l.connectNetwork.diabled) : on,
1009
1009
  disabledTip: e ? void 0 : "网络访问已被禁用",
1010
1010
  onNetStatusChange: (t) => {
1011
1011
  Cn(t);
@@ -1098,7 +1098,7 @@ ${e}` : e;
1098
1098
  }), it && /* @__PURE__ */ d(Jn, {
1099
1099
  currentSession: e,
1100
1100
  application: o,
1101
- networkStatus: L,
1101
+ networkStatus: E,
1102
1102
  setCurrentSession: p,
1103
1103
  disabled: F,
1104
1104
  isSessionHistoryVisible: it,