@glodon-aiot/agent-cli-ui 3.3.5-alpha.19 → 3.3.5-alpha.20

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