@glodon-aiot/agent-cli-ui 3.19.0-alpha.19 → 3.19.0-alpha.21

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 (30) hide show
  1. package/dist/es/Dialog/AgentChat/HistoryItem/FileItem/index.mjs +52 -59
  2. package/dist/es/Dialog/AgentChat/HistoryItem/SessionAction/index.mjs +67 -70
  3. package/dist/es/Dialog/AgentChat/HistoryItem/index.mjs +100 -103
  4. package/dist/es/Dialog/AgentChat/Tools/SessionListDrawer/HistorySessionList/index.mjs +76 -87
  5. package/dist/es/Dialog/AgentChat/Tools/UploadKnowledgeFiles/index.mjs +121 -124
  6. package/dist/es/Dialog/AgentChat/index.mjs +199 -202
  7. package/dist/es/ReactTextGenerationUI/components/TextSiders/index.mjs +150 -157
  8. package/dist/es/components/Recommend/RecommendItem.mjs +33 -36
  9. package/dist/es/packages/agent-cli-ui/package.json.mjs +3 -3
  10. package/dist/es/packages/react-components/dist/es/index.mjs +1 -1
  11. package/dist/es/src/style12.css +1 -1
  12. package/dist/es/src/style13.css +1 -1
  13. package/dist/es/src/style14.css +1 -1
  14. package/dist/es/src/style15.css +1 -1
  15. package/dist/es/src/style16.css +1 -1
  16. package/dist/es/src/style17.css +1 -1
  17. package/dist/es/src/style18.css +1 -1
  18. package/dist/es/src/style19.css +1 -1
  19. package/dist/es/src/style24.css +1 -1
  20. package/dist/es/src/style25.css +1 -1
  21. package/dist/es/src/style26.css +1 -1
  22. package/dist/es/src/style27.css +1 -1
  23. package/dist/es/src/style29.css +1 -1
  24. package/dist/es/src/style30.css +1 -1
  25. package/dist/es/src/style31.css +1 -1
  26. package/dist/es/src/style32.css +1 -1
  27. package/dist/es/utils/scopedMessage.mjs +29 -0
  28. package/dist/lib/index.js +53 -53
  29. package/dist/src/utils/scopedMessage.d.ts +7 -0
  30. package/package.json +3 -3
@@ -1,59 +1,60 @@
1
- var he = Object.defineProperty, ye = Object.defineProperties;
2
- var Ie = Object.getOwnPropertyDescriptors;
3
- var Q = Object.getOwnPropertySymbols;
4
- var be = Object.prototype.hasOwnProperty, xe = Object.prototype.propertyIsEnumerable;
5
- var X = (n, i, l) => i in n ? he(n, i, { enumerable: !0, configurable: !0, writable: !0, value: l }) : n[i] = l, V = (n, i) => {
6
- for (var l in i || (i = {}))
7
- be.call(i, l) && X(n, l, i[l]);
8
- if (Q)
9
- for (var l of Q(i))
10
- xe.call(i, l) && X(n, l, i[l]);
1
+ var ye = Object.defineProperty, Ie = Object.defineProperties;
2
+ var pe = Object.getOwnPropertyDescriptors;
3
+ var G = Object.getOwnPropertySymbols;
4
+ var ke = Object.prototype.hasOwnProperty, xe = Object.prototype.propertyIsEnumerable;
5
+ var Q = (n, i, c) => i in n ? ye(n, i, { enumerable: !0, configurable: !0, writable: !0, value: c }) : n[i] = c, T = (n, i) => {
6
+ for (var c in i || (i = {}))
7
+ ke.call(i, c) && Q(n, c, i[c]);
8
+ if (G)
9
+ for (var c of G(i))
10
+ xe.call(i, c) && Q(n, c, i[c]);
11
11
  return n;
12
- }, Z = (n, i) => ye(n, Ie(i));
13
- var P = (n, i, l) => new Promise((f, v) => {
14
- var q = (g) => {
12
+ }, X = (n, i) => Ie(n, pe(i));
13
+ var b = (n, i, c) => new Promise((f, k) => {
14
+ var M = (u) => {
15
15
  try {
16
- S(l.next(g));
17
- } catch (C) {
18
- v(C);
16
+ S(c.next(u));
17
+ } catch (v) {
18
+ k(v);
19
19
  }
20
- }, k = (g) => {
20
+ }, x = (u) => {
21
21
  try {
22
- S(l.throw(g));
23
- } catch (C) {
24
- v(C);
22
+ S(c.throw(u));
23
+ } catch (v) {
24
+ k(v);
25
25
  }
26
- }, S = (g) => g.done ? f(g.value) : Promise.resolve(g.value).then(q, k);
27
- S((l = l.apply(n, i)).next());
26
+ }, S = (u) => u.done ? f(u.value) : Promise.resolve(u.value).then(M, x);
27
+ S((c = c.apply(n, i)).next());
28
28
  });
29
- import { jsxs as p, jsx as o, Fragment as ve } from "react/jsx-runtime";
30
- import { useState as h, useRef as ke, useContext as Se, useEffect as N } from "react";
31
- import { Form as M, Collapse as ee, Input as K, Button as Ce, message as w, notification as $ } from "antd";
29
+ import { jsxs as P, jsx as o, Fragment as Se } from "react/jsx-runtime";
30
+ import { useState as h, useRef as ve, useContext as be, useEffect as w } from "react";
31
+ import { Form as V, Collapse as te, Input as F, Button as Pe, message as Z, notification as K } from "antd";
32
32
  import { PromptVariableType as y } from "@glodon-aiot/apis";
33
- import { v4 as Pe } from "uuid";
34
- import pe from "../../../context.mjs";
35
- import we from "../../../components/KnowledgeList/KnowledgeSelect/index.mjs";
33
+ import { v4 as Ce } from "uuid";
34
+ import we from "../../../context.mjs";
35
+ import Ne from "../../../components/KnowledgeList/KnowledgeSelect/index.mjs";
36
36
  import "../../../packages/react-components/dist/es/index.mjs";
37
- import Ne from "../../../Dialog/AgentChat/HistoryItem/SessionRefer/index.mjs";
37
+ import Ae from "../../../Dialog/AgentChat/HistoryItem/SessionRefer/index.mjs";
38
38
  import Te from "../../../node_modules/moment/dist/moment.mjs";
39
- /* empty css */import { fetchEventSource as Ae } from "../fetchEventSource/fetch.mjs";
40
- import { Markdown as Ve } from "../../../packages/react-components/dist/es/components/Markdown/index.mjs";
39
+ /* empty css */import { fetchEventSource as Ve } from "../fetchEventSource/fetch.mjs";
40
+ import { withAgentCliMessage as _ } from "../../../utils/scopedMessage.mjs";
41
+ import { Markdown as Me } from "../../../packages/react-components/dist/es/components/Markdown/index.mjs";
41
42
  const {
42
- Panel: _
43
- } = ee, Ee = ({
43
+ Panel: ee
44
+ } = te, Je = ({
44
45
  application: n,
45
46
  sessionId: i,
46
- docViewerUrl: l
47
+ docViewerUrl: c
47
48
  }) => {
48
- const f = n.id, [v, q] = h(""), [k, S] = h(""), [g, C] = h(), [L, T] = h(!1), D = ke(null), [H, te] = h([]), [A, O] = h([]), [se, Y] = h(0), [j, E] = h(), [c, R] = h(), [z] = M.useForm(), [U, re] = h({}), [B, ne] = h({}), [ae, oe] = h(0), {
49
- service: u,
49
+ const f = n.id, [k, M] = h(""), [x, S] = h(""), [u, v] = h(), [q, N] = h(!1), $ = ve(null), [D, se] = h([]), [A, H] = h([]), [re, O] = h(0), [Y, j] = h(), [l, L] = h(), [E] = V.useForm(), [R, ne] = h({}), [U, ae] = h({}), [oe, le] = h(0), {
50
+ service: g,
50
51
  agentClient: I,
51
- popupContainer: x,
52
+ popupContainer: C,
52
53
  token: ce,
53
- apiUrl: le
54
- } = Se(pe), ie = (e, a, d, t) => {
54
+ apiUrl: ie
55
+ } = be(we), de = (e, a, d, t) => {
55
56
  const s = {
56
- messageId: Pe(),
57
+ messageId: Ce(),
57
58
  content: "",
58
59
  role: 1,
59
60
  sessionId: "",
@@ -61,10 +62,10 @@ const {
61
62
  messageTime: "",
62
63
  llmModel: "",
63
64
  searchReference: []
64
- }, r = Z(V({}, d), {
65
+ }, r = X(T({}, d), {
65
66
  stream: !0
66
67
  });
67
- Ae(`${le}/chat/v2/chat?applicationId=${e}&sessionId=${a}`, {
68
+ Ve(`${ie}/chat/v2/chat?applicationId=${e}&sessionId=${a}`, {
68
69
  method: "POST",
69
70
  headers: {
70
71
  Authorization: `Bearer ${ce}`,
@@ -80,7 +81,7 @@ const {
80
81
  return;
81
82
  if (!m.data.includes('{"code": ')) {
82
83
  s.content = s.content + m.data;
83
- const F = {
84
+ const B = {
84
85
  content: s.content,
85
86
  role: 1,
86
87
  reference: s.reference,
@@ -89,11 +90,11 @@ const {
89
90
  messageTime: Te(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"),
90
91
  searchReference: []
91
92
  };
92
- return (t == null ? void 0 : t.onmessage) && t.onmessage(F);
93
+ return (t == null ? void 0 : t.onmessage) && t.onmessage(B);
93
94
  }
94
- const b = JSON.parse(m.data);
95
- if (s.reference = b.data.reference, s.messageTime = b.data.messageTime, s.messageId = b.data.messageId, s.llmModel = b.data.llmModel, s.content = b.data.content, s.code = b.code, b.code === 200) {
96
- const F = {
95
+ const p = JSON.parse(m.data);
96
+ if (s.reference = p.data.reference, s.messageTime = p.data.messageTime, s.messageId = p.data.messageId, s.llmModel = p.data.llmModel, s.content = p.data.content, s.code = p.code, p.code === 200) {
97
+ const B = {
97
98
  code: s.code,
98
99
  content: s.content,
99
100
  role: 1,
@@ -103,14 +104,14 @@ const {
103
104
  messageTime: s.messageTime,
104
105
  searchReference: []
105
106
  };
106
- t != null && t.onmessage && t.onmessage(F);
107
+ t != null && t.onmessage && t.onmessage(B);
107
108
  } else {
108
- $.config({
109
- getContainer: () => (x == null ? void 0 : x.current) || document.body,
109
+ K.config({
110
+ getContainer: () => (C == null ? void 0 : C.current) || document.body,
110
111
  prefixCls: "gbot-notification"
111
- }), $.error({
112
- message: b.message
113
- }), $.config({
112
+ }), K.error({
113
+ message: p.message
114
+ }), K.config({
114
115
  getContainer: void 0,
115
116
  prefixCls: "gbot-notification"
116
117
  });
@@ -139,36 +140,36 @@ const {
139
140
  }
140
141
  });
141
142
  };
142
- N(() => {
143
+ w(() => {
143
144
  if (!(n != null && n.id))
144
145
  return;
145
146
  const e = n.arrange;
146
147
  if (!(e != null && e.length))
147
148
  return;
148
149
  const d = e[0].knowledges || [];
149
- te(d), Y(d.length);
150
+ se(d), O(d.length);
150
151
  const t = d.map((s) => s.id);
151
- O(t);
152
- }, [n]), N(() => {
152
+ H(t);
153
+ }, [n]), w(() => {
153
154
  if (!(n != null && n.id) || !I)
154
155
  return;
155
156
  const e = I.questionContextMaxLength || 4e3;
156
- oe(e), de();
157
+ le(e), me();
157
158
  }, [n, I]);
158
- const de = () => P(void 0, null, function* () {
159
- if (!u || !f)
159
+ const me = () => b(void 0, null, function* () {
160
+ if (!g || !f)
160
161
  return;
161
- const e = yield u.postApplicationIdSession({
162
+ const e = yield g.postApplicationIdSession({
162
163
  name: "AI 会话",
163
164
  applicationId: f
164
165
  });
165
- E(e);
166
+ j(e);
166
167
  });
167
- N(() => {
168
- !f || !u || Promise.all([u.getApplicationIdPromptVariables(f, {
168
+ w(() => {
169
+ !f || !g || Promise.all([g.getApplicationIdPromptVariables(f, {
169
170
  type: y.User,
170
171
  status: 1
171
- }), u.getApplicationIdPromptVariables(f, {
172
+ }), g.getApplicationIdPromptVariables(f, {
172
173
  type: y.System,
173
174
  status: 1
174
175
  })]).then(([e, a]) => {
@@ -179,109 +180,101 @@ const {
179
180
  value: "",
180
181
  type: r.type
181
182
  }));
182
- R(s);
183
+ L(s);
183
184
  });
184
- }, [u, f]), N(() => {
185
- if (!c)
185
+ }, [g, f]), w(() => {
186
+ if (!l)
186
187
  return;
187
- const e = c.filter((s) => s.type === y.User), a = c.filter((s) => s.type === y.System), d = {};
188
+ const e = l.filter((s) => s.type === y.User), a = l.filter((s) => s.type === y.System), d = {};
188
189
  e == null || e.map((s) => {
189
190
  s.key && (d[s.key] = s.value);
190
191
  });
191
192
  const t = {};
192
193
  a == null || a.map((s) => {
193
194
  s.key && (t[s.key] = s.value);
194
- }), z.setFieldsValue({
195
+ }), E.setFieldsValue({
195
196
  userPrompts: d,
196
197
  systemPrompts: t
197
- }), re(d), ne(t);
198
- }, [c]);
199
- const me = (e, a) => P(void 0, null, function* () {
200
- !j || !f || !u || (yield u.patchApplicationIdSessionpromptVariablesId(f, j.id, e, {
198
+ }), ne(d), ae(t);
199
+ }, [l]);
200
+ const fe = (e, a) => b(void 0, null, function* () {
201
+ !Y || !f || !g || (yield g.patchApplicationIdSessionpromptVariablesId(f, Y.id, e, {
201
202
  value: a
202
203
  }));
203
- }), fe = (e) => {
204
- q(e.target.value);
205
- }, ge = () => P(void 0, null, function* () {
206
- if (!f || !u || !I)
204
+ }), ue = (e) => {
205
+ M(e.target.value);
206
+ }, ge = () => b(void 0, null, function* () {
207
+ if (!f || !g || !I)
207
208
  return;
208
- T(!0);
209
+ N(!0);
210
+ for (const t in R)
211
+ R[t] || _(C, () => {
212
+ Z.error("变量值不能为空");
213
+ });
209
214
  for (const t in U)
210
- U[t] || (w.config({
211
- getContainer: () => (x == null ? void 0 : x.current) || document.body,
212
- prefixCls: "gbot-message"
213
- }), w.error("变量值不能为空"), w.config({
214
- getContainer: void 0,
215
- prefixCls: "gbot-message"
216
- }));
217
- for (const t in B)
218
- B[t] || (w.config({
219
- getContainer: () => (x == null ? void 0 : x.current) || document.body,
220
- prefixCls: "gbot-message"
221
- }), w.error("变量值不能为空"), w.config({
222
- getContainer: void 0,
223
- prefixCls: "gbot-message"
224
- }));
225
- const e = yield u.postApplicationIdSession({
215
+ U[t] || _(C, () => {
216
+ Z.error("变量值不能为空");
217
+ });
218
+ const e = yield g.postApplicationIdSession({
226
219
  name: "AI 会话",
227
220
  applicationId: f
228
221
  });
229
- E(e);
222
+ j(e);
230
223
  const a = A == null ? void 0 : A.map((t) => t.toString());
231
- yield u.getApplicationIdSessionIdPromptVariables(f, e.id).then((t) => P(void 0, null, function* () {
232
- if (!c)
224
+ yield g.getApplicationIdSessionIdPromptVariables(f, e.id).then((t) => b(void 0, null, function* () {
225
+ if (!l)
233
226
  return;
234
227
  const s = t.filter((r) => r.key !== "query").map((r) => {
235
- const m = c.filter((b) => b.key === r.key);
228
+ const m = l.filter((p) => p.key === r.key);
236
229
  return r.value = m[0].value, r;
237
230
  });
238
- yield Promise.all(s.map((r) => me(r.id, r.value))), R(s);
231
+ yield Promise.all(s.map((r) => fe(r.id, r.value))), L(s);
239
232
  })).catch((t) => {
240
- console.log(t), T(!1);
233
+ console.log(t), N(!1);
241
234
  });
242
235
  const d = {
243
- content: v,
236
+ content: k,
244
237
  chatMode: 1,
245
238
  knowledges: a,
246
- promptVariables: U,
247
- systemPromptVariables: B
239
+ promptVariables: R,
240
+ systemPromptVariables: U
248
241
  };
249
- ie(f, e.id, d, {
242
+ de(f, e.id, d, {
250
243
  onmessage: (t) => {
251
- C(void 0), S(t.content);
244
+ v(void 0), S(t.content);
252
245
  },
253
- onclose: (t) => P(void 0, null, function* () {
254
- if (T(!1), t.code == 200) {
246
+ onclose: (t) => b(void 0, null, function* () {
247
+ if (N(!1), t.code == 200) {
255
248
  S(t.content);
256
- const s = yield Promise.all(t.reference.map((r) => u.getKnowledgeIdFileId(r.knowledgeId, r.docId)));
257
- t.reference = t.reference.map((r, m) => V(V({}, r), s[m])), C(t);
249
+ const s = yield Promise.all(t.reference.map((r) => g.getKnowledgeIdFileId(r.knowledgeId, r.docId)));
250
+ t.reference = t.reference.map((r, m) => T(T({}, r), s[m])), v(t);
258
251
  }
259
252
  }),
260
253
  onerror: () => {
261
- T(!1);
254
+ N(!1);
262
255
  }
263
256
  });
264
257
  });
265
- N(() => {
266
- if (!k)
258
+ w(() => {
259
+ if (!x)
267
260
  return;
268
- const e = D.current;
261
+ const e = $.current;
269
262
  e && (e.scrollTop = e.scrollHeight);
270
- }, [k]);
271
- const ue = (e) => {
272
- O(e), Y(e.length);
273
- }, J = (e, a) => {
274
- c && (c.map((d) => {
263
+ }, [x]);
264
+ const he = (e) => {
265
+ H(e), O(e.length);
266
+ }, z = (e, a) => {
267
+ l && (l.map((d) => {
275
268
  d.id === e && (d.value = a.target.value);
276
- }), R([...c]));
277
- }, W = (c == null ? void 0 : c.filter((e) => e.type === y.System)) || [], G = (c == null ? void 0 : c.filter((e) => e.type === y.User)) || [];
278
- return /* @__PURE__ */ p("div", {
269
+ }), L([...l]));
270
+ }, J = (l == null ? void 0 : l.filter((e) => e.type === y.System)) || [], W = (l == null ? void 0 : l.filter((e) => e.type === y.User)) || [];
271
+ return /* @__PURE__ */ P("div", {
279
272
  className: "text-main",
280
- children: [/* @__PURE__ */ p("div", {
273
+ children: [/* @__PURE__ */ P("div", {
281
274
  className: "text-left-sider",
282
- children: [!!(c != null && c.length) && /* @__PURE__ */ o(M, {
275
+ children: [!!(l != null && l.length) && /* @__PURE__ */ o(V, {
283
276
  autoComplete: "off",
284
- form: z,
277
+ form: E,
285
278
  labelWrap: !0,
286
279
  labelAlign: "left",
287
280
  labelCol: {
@@ -290,14 +283,14 @@ const {
290
283
  }
291
284
  },
292
285
  className: "prompt-form",
293
- children: /* @__PURE__ */ p(ee, {
286
+ children: /* @__PURE__ */ P(te, {
294
287
  bordered: !1,
295
288
  ghost: !0,
296
289
  className: "prompt-variables-collapse",
297
290
  defaultActiveKey: [y.System, y.User],
298
- children: [W.length && /* @__PURE__ */ o(_, {
291
+ children: [J.length && /* @__PURE__ */ o(ee, {
299
292
  header: "角色设定变量",
300
- children: W.map((e) => /* @__PURE__ */ o(M.Item, {
293
+ children: J.map((e) => /* @__PURE__ */ o(V.Item, {
301
294
  label: e.name,
302
295
  name: ["systemPrompts", e.key],
303
296
  style: {
@@ -307,15 +300,15 @@ const {
307
300
  required: !0,
308
301
  message: "请输入"
309
302
  }],
310
- children: /* @__PURE__ */ o(K, {
303
+ children: /* @__PURE__ */ o(F, {
311
304
  placeholder: "请输入",
312
305
  maxLength: I == null ? void 0 : I.questionContextMaxLength,
313
- onBlur: (a) => J(e.id, a)
306
+ onBlur: (a) => z(e.id, a)
314
307
  })
315
308
  }, e.key))
316
- }, y.System), G.length && /* @__PURE__ */ o(_, {
309
+ }, y.System), W.length && /* @__PURE__ */ o(ee, {
317
310
  header: "用户指令变量",
318
- children: G.map((e) => /* @__PURE__ */ o(M.Item, {
311
+ children: W.map((e) => /* @__PURE__ */ o(V.Item, {
319
312
  label: e.name,
320
313
  name: ["userPrompts", e.key],
321
314
  style: {
@@ -325,49 +318,49 @@ const {
325
318
  required: !0,
326
319
  message: "请输入"
327
320
  }],
328
- children: /* @__PURE__ */ o(K, {
321
+ children: /* @__PURE__ */ o(F, {
329
322
  placeholder: "请输入",
330
323
  maxLength: I == null ? void 0 : I.questionContextMaxLength,
331
- onBlur: (a) => J(e.id, a)
324
+ onBlur: (a) => z(e.id, a)
332
325
  })
333
326
  }, e.key))
334
327
  }, y.User)]
335
328
  })
336
- }), /* @__PURE__ */ p("div", {
329
+ }), /* @__PURE__ */ P("div", {
337
330
  className: "sider-header",
338
331
  children: [/* @__PURE__ */ o("span", {
339
332
  className: "header-title",
340
333
  children: "文本生成输入"
341
- }), H.length !== 0 && /* @__PURE__ */ o(we, {
334
+ }), D.length !== 0 && /* @__PURE__ */ o(Ne, {
342
335
  checkedValues: A,
343
- currKnowledgeList: H,
344
- selectCount: se,
345
- onSelectChange: ue,
336
+ currKnowledgeList: D,
337
+ selectCount: re,
338
+ onSelectChange: he,
346
339
  disabled: !1
347
340
  })]
348
341
  }), /* @__PURE__ */ o("div", {
349
342
  className: "sider-main",
350
- children: /* @__PURE__ */ p("div", {
343
+ children: /* @__PURE__ */ P("div", {
351
344
  className: "sider-text",
352
- children: [/* @__PURE__ */ o(K.TextArea, {
345
+ children: [/* @__PURE__ */ o(F.TextArea, {
353
346
  style: {
354
347
  height: "100%",
355
348
  resize: "none"
356
349
  },
357
350
  placeholder: "请输入你的问题,通过shift+enter换行",
358
- maxLength: ae,
351
+ maxLength: oe,
359
352
  showCount: !0,
360
353
  bordered: !1,
361
- onChange: fe,
362
- value: v,
354
+ onChange: ue,
355
+ value: k,
363
356
  className: "left-input"
364
- }), /* @__PURE__ */ o(Ce, {
357
+ }), /* @__PURE__ */ o(Pe, {
365
358
  type: "primary",
366
- disabled: !v || L,
359
+ disabled: !k || q,
367
360
  onClick: ge,
368
361
  className: "sider-btn",
369
- loading: L,
370
- children: L ? "生成中" : "确认生成"
362
+ loading: q,
363
+ children: q ? "生成中" : "确认生成"
371
364
  })]
372
365
  })
373
366
  })]
@@ -377,17 +370,17 @@ const {
377
370
  className: "sider-main",
378
371
  children: /* @__PURE__ */ o("div", {
379
372
  className: "sider-text",
380
- ref: D,
381
- children: k ? /* @__PURE__ */ p(ve, {
382
- children: [/* @__PURE__ */ o(Ve, {
383
- children: k
384
- }), g && (g == null ? void 0 : g.reference.length) !== 0 && /* @__PURE__ */ o("div", {
373
+ ref: $,
374
+ children: x ? /* @__PURE__ */ P(Se, {
375
+ children: [/* @__PURE__ */ o(Me, {
376
+ children: x
377
+ }), u && (u == null ? void 0 : u.reference.length) !== 0 && /* @__PURE__ */ o("div", {
385
378
  style: {
386
379
  marginTop: 16
387
380
  },
388
- children: /* @__PURE__ */ o(Ne, {
389
- history: g,
390
- docViewerUrl: l
381
+ children: /* @__PURE__ */ o(Ae, {
382
+ history: u,
383
+ docViewerUrl: c
391
384
  })
392
385
  })]
393
386
  }) : /* @__PURE__ */ o("div", {
@@ -402,5 +395,5 @@ const {
402
395
  });
403
396
  };
404
397
  export {
405
- Ee as default
398
+ Je as default
406
399
  };
@@ -1,59 +1,56 @@
1
- import { jsxs as d, jsx as s } from "react/jsx-runtime";
2
- import { useState as h, useContext as v, useEffect as y } from "react";
3
- /* empty css */import { Space as N, message as a, Typography as p } from "antd";
1
+ import { jsxs as p, jsx as t } from "react/jsx-runtime";
2
+ import { useState as h, useContext as g, useEffect as v } from "react";
3
+ /* empty css */import { Space as N, Typography as c, message as y } from "antd";
4
4
  import r from "classnames";
5
5
  import { getFileExtension as q } from "../../utils/index.mjs";
6
6
  import x from "../../context.mjs";
7
- import { FILE_ICONS as C } from "../../constant.mjs";
8
- const j = (f) => {
9
- var u;
7
+ import { withAgentCliMessage as C } from "../../utils/scopedMessage.mjs";
8
+ import { FILE_ICONS as w } from "../../constant.mjs";
9
+ const R = (u) => {
10
+ var m;
10
11
  const {
11
12
  item: e,
12
- isRecommendClearing: g,
13
+ isRecommendClearing: d,
13
14
  isOnlyQuestion: i,
14
- question: t,
15
- setQuestion: m,
16
- onItemClick: o
17
- } = f, [n, c] = h(!1), {
18
- popupContainer: l
19
- } = v(x);
20
- return y(() => {
21
- e && (!e.icon && !e.file.url && !e.name ? c(!0) : c(!1));
22
- }, [e]), /* @__PURE__ */ d(N, {
15
+ question: o,
16
+ setQuestion: l,
17
+ onItemClick: s
18
+ } = u, [n, a] = h(!1), {
19
+ popupContainer: f
20
+ } = g(x);
21
+ return v(() => {
22
+ e && (!e.icon && !e.file.url && !e.name ? a(!0) : a(!1));
23
+ }, [e]), /* @__PURE__ */ p(N, {
23
24
  direction: "vertical",
24
25
  size: i || !i && n ? 0 : 4,
25
26
  className: r({
26
27
  "question-pannel": !0,
27
- "question-pannel__active": (t == null ? void 0 : t.id) === e.id,
28
+ "question-pannel__active": (o == null ? void 0 : o.id) === e.id,
28
29
  "multiline-question-pannel": !i && n
29
30
  }),
30
31
  onClick: () => {
31
- if (g) {
32
- a.config({
33
- getContainer: () => (l == null ? void 0 : l.current) || document.body,
34
- prefixCls: "gbot-message"
35
- }), a.error("请稍后"), a.config({
36
- getContainer: void 0,
37
- prefixCls: "gbot-message"
32
+ if (d) {
33
+ C(f, () => {
34
+ y.error("请稍后");
38
35
  });
39
36
  return;
40
37
  }
41
- (t == null ? void 0 : t.id) === e.id ? (m(void 0), o == null || o(void 0)) : (m(e), o == null || o(e));
38
+ (o == null ? void 0 : o.id) === e.id ? (l(void 0), s == null || s(void 0)) : (l(e), s == null || s(e));
42
39
  },
43
- children: [/* @__PURE__ */ d("div", {
40
+ children: [/* @__PURE__ */ p("div", {
44
41
  className: r({
45
42
  "question-top": !0,
46
43
  "not-have-top": i || !i && n
47
44
  }),
48
- children: [!!(e != null && e.icon) && /* @__PURE__ */ s("div", {
45
+ children: [!!(e != null && e.icon) && /* @__PURE__ */ t("div", {
49
46
  className: "question-top-tip",
50
- children: /* @__PURE__ */ s("img", {
47
+ children: /* @__PURE__ */ t("img", {
51
48
  src: e.icon,
52
49
  alt: ""
53
50
  })
54
- }), /* @__PURE__ */ s("div", {
51
+ }), /* @__PURE__ */ t("div", {
55
52
  className: "question-top-title",
56
- children: /* @__PURE__ */ s(p.Paragraph, {
53
+ children: /* @__PURE__ */ t(c.Paragraph, {
57
54
  style: {
58
55
  margin: 0,
59
56
  width: "100%"
@@ -64,22 +61,22 @@ const j = (f) => {
64
61
  },
65
62
  children: e.name
66
63
  })
67
- }), /* @__PURE__ */ s("div", {
64
+ }), /* @__PURE__ */ t("div", {
68
65
  className: r({
69
66
  "question-top-type": !0,
70
67
  "question-only-plus-file": !i && !e.icon && !e.name
71
68
  }),
72
- children: !!((u = e.file) != null && u.url) && /* @__PURE__ */ s("img", {
69
+ children: !!((m = e.file) != null && m.url) && /* @__PURE__ */ t("img", {
73
70
  className: "file-icon",
74
- src: C[q(e.file.url) || ""]
71
+ src: w[q(e.file.url) || ""]
75
72
  })
76
73
  })]
77
- }), /* @__PURE__ */ s("div", {
74
+ }), /* @__PURE__ */ t("div", {
78
75
  className: r({
79
76
  "question-bottom": !0,
80
77
  "multiline-question": !i && n
81
78
  }),
82
- children: /* @__PURE__ */ s(p.Paragraph, {
79
+ children: /* @__PURE__ */ t(c.Paragraph, {
83
80
  style: {
84
81
  margin: 0,
85
82
  width: "100%"
@@ -96,5 +93,5 @@ const j = (f) => {
96
93
  });
97
94
  };
98
95
  export {
99
- j as default
96
+ R as default
100
97
  };
@@ -1,4 +1,4 @@
1
- const e = "@glodon-aiot/agent-cli-ui", t = "3.19.0-alpha.19", 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.19.0-alpha.21", 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"
@@ -25,8 +25,8 @@ const e = "@glodon-aiot/agent-cli-ui", t = "3.19.0-alpha.19", s = "./dist/es/ind
25
25
  webpack: "*"
26
26
  }, p = {
27
27
  "@ant-design/icons": "^5.3.4",
28
- "@glodon-aiot/apis": "^3.19.0-alpha.19",
29
- "@glodon-aiot/bot-client-sdk": "^3.19.0-alpha.19",
28
+ "@glodon-aiot/apis": "^3.19.0-alpha.21",
29
+ "@glodon-aiot/bot-client-sdk": "^3.19.0-alpha.21",
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",