@glodon-aiot/agent-cli-ui 3.19.0-alpha.20 → 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.
- package/dist/es/Dialog/AgentChat/HistoryItem/FileItem/index.mjs +52 -59
- package/dist/es/Dialog/AgentChat/HistoryItem/SessionAction/index.mjs +67 -70
- package/dist/es/Dialog/AgentChat/HistoryItem/index.mjs +100 -103
- package/dist/es/Dialog/AgentChat/Tools/SessionListDrawer/HistorySessionList/index.mjs +76 -87
- package/dist/es/Dialog/AgentChat/Tools/UploadKnowledgeFiles/index.mjs +121 -124
- package/dist/es/Dialog/AgentChat/index.mjs +199 -202
- package/dist/es/ReactTextGenerationUI/components/TextSiders/index.mjs +150 -157
- package/dist/es/components/Recommend/RecommendItem.mjs +33 -36
- package/dist/es/packages/agent-cli-ui/package.json.mjs +3 -3
- package/dist/es/packages/react-components/dist/es/index.mjs +1 -1
- package/dist/es/src/style12.css +1 -1
- package/dist/es/src/style13.css +1 -1
- package/dist/es/src/style14.css +1 -1
- package/dist/es/src/style15.css +1 -1
- package/dist/es/src/style16.css +1 -1
- package/dist/es/src/style20.css +1 -1
- package/dist/es/src/style21.css +1 -1
- package/dist/es/src/style26.css +1 -1
- package/dist/es/src/style27.css +1 -1
- package/dist/es/src/style31.css +1 -1
- package/dist/es/src/style32.css +1 -1
- package/dist/es/utils/scopedMessage.mjs +29 -0
- package/dist/lib/index.js +53 -53
- package/dist/src/utils/scopedMessage.d.ts +7 -0
- package/package.json +3 -3
|
@@ -1,59 +1,60 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var
|
|
10
|
-
xe.call(i,
|
|
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
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var
|
|
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(
|
|
17
|
-
} catch (
|
|
18
|
-
v
|
|
16
|
+
S(c.next(u));
|
|
17
|
+
} catch (v) {
|
|
18
|
+
k(v);
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, x = (u) => {
|
|
21
21
|
try {
|
|
22
|
-
S(
|
|
23
|
-
} catch (
|
|
24
|
-
v
|
|
22
|
+
S(c.throw(u));
|
|
23
|
+
} catch (v) {
|
|
24
|
+
k(v);
|
|
25
25
|
}
|
|
26
|
-
}, S = (
|
|
27
|
-
S((
|
|
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
|
|
30
|
-
import { useState as h, useRef as
|
|
31
|
-
import { Form as
|
|
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
|
|
34
|
-
import
|
|
35
|
-
import
|
|
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
|
|
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
|
|
40
|
-
import {
|
|
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
|
-
} =
|
|
43
|
+
Panel: ee
|
|
44
|
+
} = te, Je = ({
|
|
44
45
|
application: n,
|
|
45
46
|
sessionId: i,
|
|
46
|
-
docViewerUrl:
|
|
47
|
+
docViewerUrl: c
|
|
47
48
|
}) => {
|
|
48
|
-
const f = n.id, [
|
|
49
|
-
service:
|
|
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:
|
|
52
|
+
popupContainer: C,
|
|
52
53
|
token: ce,
|
|
53
|
-
apiUrl:
|
|
54
|
-
} =
|
|
54
|
+
apiUrl: ie
|
|
55
|
+
} = be(we), de = (e, a, d, t) => {
|
|
55
56
|
const s = {
|
|
56
|
-
messageId:
|
|
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 =
|
|
65
|
+
}, r = X(T({}, d), {
|
|
65
66
|
stream: !0
|
|
66
67
|
});
|
|
67
|
-
|
|
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
|
|
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(
|
|
93
|
+
return (t == null ? void 0 : t.onmessage) && t.onmessage(B);
|
|
93
94
|
}
|
|
94
|
-
const
|
|
95
|
-
if (s.reference =
|
|
96
|
-
const
|
|
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(
|
|
107
|
+
t != null && t.onmessage && t.onmessage(B);
|
|
107
108
|
} else {
|
|
108
|
-
|
|
109
|
-
getContainer: () => (
|
|
109
|
+
K.config({
|
|
110
|
+
getContainer: () => (C == null ? void 0 : C.current) || document.body,
|
|
110
111
|
prefixCls: "gbot-notification"
|
|
111
|
-
}),
|
|
112
|
-
message:
|
|
113
|
-
}),
|
|
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
|
-
|
|
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
|
-
|
|
150
|
+
se(d), O(d.length);
|
|
150
151
|
const t = d.map((s) => s.id);
|
|
151
|
-
|
|
152
|
-
}, [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
|
-
|
|
157
|
+
le(e), me();
|
|
157
158
|
}, [n, I]);
|
|
158
|
-
const
|
|
159
|
-
if (!
|
|
159
|
+
const me = () => b(void 0, null, function* () {
|
|
160
|
+
if (!g || !f)
|
|
160
161
|
return;
|
|
161
|
-
const e = yield
|
|
162
|
+
const e = yield g.postApplicationIdSession({
|
|
162
163
|
name: "AI 会话",
|
|
163
164
|
applicationId: f
|
|
164
165
|
});
|
|
165
|
-
|
|
166
|
+
j(e);
|
|
166
167
|
});
|
|
167
|
-
|
|
168
|
-
!f || !
|
|
168
|
+
w(() => {
|
|
169
|
+
!f || !g || Promise.all([g.getApplicationIdPromptVariables(f, {
|
|
169
170
|
type: y.User,
|
|
170
171
|
status: 1
|
|
171
|
-
}),
|
|
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
|
-
|
|
183
|
+
L(s);
|
|
183
184
|
});
|
|
184
|
-
}, [
|
|
185
|
-
if (!
|
|
185
|
+
}, [g, f]), w(() => {
|
|
186
|
+
if (!l)
|
|
186
187
|
return;
|
|
187
|
-
const e =
|
|
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
|
-
}),
|
|
195
|
+
}), E.setFieldsValue({
|
|
195
196
|
userPrompts: d,
|
|
196
197
|
systemPrompts: t
|
|
197
|
-
}),
|
|
198
|
-
}, [
|
|
199
|
-
const
|
|
200
|
-
!
|
|
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
|
-
}),
|
|
204
|
-
|
|
205
|
-
}, ge = () =>
|
|
206
|
-
if (!f || !
|
|
204
|
+
}), ue = (e) => {
|
|
205
|
+
M(e.target.value);
|
|
206
|
+
}, ge = () => b(void 0, null, function* () {
|
|
207
|
+
if (!f || !g || !I)
|
|
207
208
|
return;
|
|
208
|
-
|
|
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] || (
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
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
|
-
|
|
222
|
+
j(e);
|
|
230
223
|
const a = A == null ? void 0 : A.map((t) => t.toString());
|
|
231
|
-
yield
|
|
232
|
-
if (!
|
|
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 =
|
|
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) =>
|
|
231
|
+
yield Promise.all(s.map((r) => fe(r.id, r.value))), L(s);
|
|
239
232
|
})).catch((t) => {
|
|
240
|
-
console.log(t),
|
|
233
|
+
console.log(t), N(!1);
|
|
241
234
|
});
|
|
242
235
|
const d = {
|
|
243
|
-
content:
|
|
236
|
+
content: k,
|
|
244
237
|
chatMode: 1,
|
|
245
238
|
knowledges: a,
|
|
246
|
-
promptVariables:
|
|
247
|
-
systemPromptVariables:
|
|
239
|
+
promptVariables: R,
|
|
240
|
+
systemPromptVariables: U
|
|
248
241
|
};
|
|
249
|
-
|
|
242
|
+
de(f, e.id, d, {
|
|
250
243
|
onmessage: (t) => {
|
|
251
|
-
|
|
244
|
+
v(void 0), S(t.content);
|
|
252
245
|
},
|
|
253
|
-
onclose: (t) =>
|
|
254
|
-
if (
|
|
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) =>
|
|
257
|
-
t.reference = t.reference.map((r, m) =>
|
|
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
|
-
|
|
254
|
+
N(!1);
|
|
262
255
|
}
|
|
263
256
|
});
|
|
264
257
|
});
|
|
265
|
-
|
|
266
|
-
if (!
|
|
258
|
+
w(() => {
|
|
259
|
+
if (!x)
|
|
267
260
|
return;
|
|
268
|
-
const e =
|
|
261
|
+
const e = $.current;
|
|
269
262
|
e && (e.scrollTop = e.scrollHeight);
|
|
270
|
-
}, [
|
|
271
|
-
const
|
|
272
|
-
|
|
273
|
-
},
|
|
274
|
-
|
|
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
|
-
}),
|
|
277
|
-
},
|
|
278
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
273
|
+
children: [/* @__PURE__ */ P("div", {
|
|
281
274
|
className: "text-left-sider",
|
|
282
|
-
children: [!!(
|
|
275
|
+
children: [!!(l != null && l.length) && /* @__PURE__ */ o(V, {
|
|
283
276
|
autoComplete: "off",
|
|
284
|
-
form:
|
|
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__ */
|
|
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: [
|
|
291
|
+
children: [J.length && /* @__PURE__ */ o(ee, {
|
|
299
292
|
header: "角色设定变量",
|
|
300
|
-
children:
|
|
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(
|
|
303
|
+
children: /* @__PURE__ */ o(F, {
|
|
311
304
|
placeholder: "请输入",
|
|
312
305
|
maxLength: I == null ? void 0 : I.questionContextMaxLength,
|
|
313
|
-
onBlur: (a) =>
|
|
306
|
+
onBlur: (a) => z(e.id, a)
|
|
314
307
|
})
|
|
315
308
|
}, e.key))
|
|
316
|
-
}, y.System),
|
|
309
|
+
}, y.System), W.length && /* @__PURE__ */ o(ee, {
|
|
317
310
|
header: "用户指令变量",
|
|
318
|
-
children:
|
|
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(
|
|
321
|
+
children: /* @__PURE__ */ o(F, {
|
|
329
322
|
placeholder: "请输入",
|
|
330
323
|
maxLength: I == null ? void 0 : I.questionContextMaxLength,
|
|
331
|
-
onBlur: (a) =>
|
|
324
|
+
onBlur: (a) => z(e.id, a)
|
|
332
325
|
})
|
|
333
326
|
}, e.key))
|
|
334
327
|
}, y.User)]
|
|
335
328
|
})
|
|
336
|
-
}), /* @__PURE__ */
|
|
329
|
+
}), /* @__PURE__ */ P("div", {
|
|
337
330
|
className: "sider-header",
|
|
338
331
|
children: [/* @__PURE__ */ o("span", {
|
|
339
332
|
className: "header-title",
|
|
340
333
|
children: "文本生成输入"
|
|
341
|
-
}),
|
|
334
|
+
}), D.length !== 0 && /* @__PURE__ */ o(Ne, {
|
|
342
335
|
checkedValues: A,
|
|
343
|
-
currKnowledgeList:
|
|
344
|
-
selectCount:
|
|
345
|
-
onSelectChange:
|
|
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__ */
|
|
343
|
+
children: /* @__PURE__ */ P("div", {
|
|
351
344
|
className: "sider-text",
|
|
352
|
-
children: [/* @__PURE__ */ o(
|
|
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:
|
|
351
|
+
maxLength: oe,
|
|
359
352
|
showCount: !0,
|
|
360
353
|
bordered: !1,
|
|
361
|
-
onChange:
|
|
362
|
-
value:
|
|
354
|
+
onChange: ue,
|
|
355
|
+
value: k,
|
|
363
356
|
className: "left-input"
|
|
364
|
-
}), /* @__PURE__ */ o(
|
|
357
|
+
}), /* @__PURE__ */ o(Pe, {
|
|
365
358
|
type: "primary",
|
|
366
|
-
disabled: !
|
|
359
|
+
disabled: !k || q,
|
|
367
360
|
onClick: ge,
|
|
368
361
|
className: "sider-btn",
|
|
369
|
-
loading:
|
|
370
|
-
children:
|
|
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:
|
|
381
|
-
children:
|
|
382
|
-
children: [/* @__PURE__ */ o(
|
|
383
|
-
children:
|
|
384
|
-
}),
|
|
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(
|
|
389
|
-
history:
|
|
390
|
-
docViewerUrl:
|
|
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
|
-
|
|
398
|
+
Je as default
|
|
406
399
|
};
|
|
@@ -1,59 +1,56 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as h, useContext as
|
|
3
|
-
/* empty css */import { Space as N,
|
|
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 {
|
|
8
|
-
|
|
9
|
-
|
|
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:
|
|
13
|
+
isRecommendClearing: d,
|
|
13
14
|
isOnlyQuestion: i,
|
|
14
|
-
question:
|
|
15
|
-
setQuestion:
|
|
16
|
-
onItemClick:
|
|
17
|
-
} =
|
|
18
|
-
popupContainer:
|
|
19
|
-
} =
|
|
20
|
-
return
|
|
21
|
-
e && (!e.icon && !e.file.url && !e.name ?
|
|
22
|
-
}, [e]), /* @__PURE__ */
|
|
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": (
|
|
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 (
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
(
|
|
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__ */
|
|
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__ */
|
|
45
|
+
children: [!!(e != null && e.icon) && /* @__PURE__ */ t("div", {
|
|
49
46
|
className: "question-top-tip",
|
|
50
|
-
children: /* @__PURE__ */
|
|
47
|
+
children: /* @__PURE__ */ t("img", {
|
|
51
48
|
src: e.icon,
|
|
52
49
|
alt: ""
|
|
53
50
|
})
|
|
54
|
-
}), /* @__PURE__ */
|
|
51
|
+
}), /* @__PURE__ */ t("div", {
|
|
55
52
|
className: "question-top-title",
|
|
56
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
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: !!((
|
|
69
|
+
children: !!((m = e.file) != null && m.url) && /* @__PURE__ */ t("img", {
|
|
73
70
|
className: "file-icon",
|
|
74
|
-
src:
|
|
71
|
+
src: w[q(e.file.url) || ""]
|
|
75
72
|
})
|
|
76
73
|
})]
|
|
77
|
-
}), /* @__PURE__ */
|
|
74
|
+
}), /* @__PURE__ */ t("div", {
|
|
78
75
|
className: r({
|
|
79
76
|
"question-bottom": !0,
|
|
80
77
|
"multiline-question": !i && n
|
|
81
78
|
}),
|
|
82
|
-
children: /* @__PURE__ */
|
|
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
|
-
|
|
96
|
+
R as default
|
|
100
97
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e = "@glodon-aiot/agent-cli-ui", t = "3.19.0-alpha.
|
|
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.20", 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.
|
|
29
|
-
"@glodon-aiot/bot-client-sdk": "^3.19.0-alpha.
|
|
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",
|