@glodon-aiot/agent-cli-ui 3.3.2-beta.11 → 3.3.2-beta.12
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/AgentClientUI.mjs +2 -2
- package/dist/es/ReactTextGenerationUI/components/TextSiders/index.mjs +68 -68
- package/dist/es/ReactTextGenerationUI/index.mjs +44 -55
- package/dist/es/index.mjs +0 -115
- 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/style10.css +1 -1
- package/dist/es/src/style11.css +1 -1
- package/dist/es/src/style12.css +1 -1
- package/dist/es/src/style16.css +1 -1
- package/dist/es/src/style17.css +1 -1
- package/dist/es/src/style19.css +1 -1
- package/dist/es/src/style20.css +1 -1
- package/dist/es/src/style24.css +1 -1
- package/dist/es/src/style25.css +1 -1
- package/dist/es/src/style26.css +1 -1
- package/dist/es/src/style27.css +1 -1
- package/dist/es/src/style5.css +1 -1
- package/dist/es/src/style6.css +1 -1
- package/dist/es/src/style7.css +1 -1
- package/dist/es/src/style8.css +1 -1
- package/dist/es/src/style9.css +1 -1
- package/dist/lib/index.js +17 -17
- package/package.json +3 -3
|
@@ -95,8 +95,8 @@ const ye = (n) => {
|
|
|
95
95
|
features: G
|
|
96
96
|
}),
|
|
97
97
|
children: [/* @__PURE__ */ s(ne, {
|
|
98
|
-
height: i == null ? void 0 : i.height,
|
|
99
|
-
width: i == null ? void 0 : i.width,
|
|
98
|
+
height: (i == null ? void 0 : i.height) || "100%",
|
|
99
|
+
width: (i == null ? void 0 : i.width) || "100%",
|
|
100
100
|
maxConstraints: [document.body.clientWidth - 45],
|
|
101
101
|
minConstraints: [Number(t == null ? void 0 : t.minWidth)],
|
|
102
102
|
onResize: Y,
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
var me = Object.defineProperty,
|
|
2
|
-
var
|
|
1
|
+
var me = Object.defineProperty, ue = Object.defineProperties;
|
|
2
|
+
var ge = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var j = Object.getOwnPropertySymbols;
|
|
4
4
|
var fe = Object.prototype.hasOwnProperty, he = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var z = (r, l, s) => l in r ? me(r, l, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[l] = s,
|
|
5
|
+
var z = (r, l, s) => l in r ? me(r, l, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[l] = s, L = (r, l) => {
|
|
6
6
|
for (var s in l || (l = {}))
|
|
7
7
|
fe.call(l, s) && z(r, s, l[s]);
|
|
8
8
|
if (j)
|
|
9
9
|
for (var s of j(l))
|
|
10
10
|
he.call(l, s) && z(r, s, l[s]);
|
|
11
11
|
return r;
|
|
12
|
-
}, E = (r, l) =>
|
|
13
|
-
var
|
|
14
|
-
var
|
|
12
|
+
}, E = (r, l) => ue(r, ge(l));
|
|
13
|
+
var R = (r, l, s) => new Promise((C, N) => {
|
|
14
|
+
var x = (u) => {
|
|
15
15
|
try {
|
|
16
|
-
h(s.next(
|
|
16
|
+
h(s.next(u));
|
|
17
17
|
} catch (I) {
|
|
18
|
-
|
|
18
|
+
N(I);
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, w = (u) => {
|
|
21
21
|
try {
|
|
22
|
-
h(s.throw(
|
|
22
|
+
h(s.throw(u));
|
|
23
23
|
} catch (I) {
|
|
24
|
-
|
|
24
|
+
N(I);
|
|
25
25
|
}
|
|
26
|
-
}, h = (
|
|
26
|
+
}, h = (u) => u.done ? C(u.value) : Promise.resolve(u.value).then(x, w);
|
|
27
27
|
h((s = s.apply(r, l)).next());
|
|
28
28
|
});
|
|
29
|
-
import { jsxs as
|
|
30
|
-
import { useState as m, useRef as Ie, useContext as ke, useEffect as
|
|
31
|
-
import { Form as
|
|
32
|
-
import { v4 as
|
|
29
|
+
import { jsxs as v, jsx as o, Fragment as ye } from "react/jsx-runtime";
|
|
30
|
+
import { useState as m, useRef as Ie, useContext as ke, useEffect as b } from "react";
|
|
31
|
+
import { Form as q, Space as ve, Button as K, Input as J, message as F, notification as xe } from "antd";
|
|
32
|
+
import { v4 as Ce } from "uuid";
|
|
33
33
|
import Se from "../../../context.mjs";
|
|
34
34
|
import U from "../../../components/Iconfont/index.mjs";
|
|
35
35
|
import be from "../../../components/KnowledgeList/KnowledgeSelect/index.mjs";
|
|
@@ -37,22 +37,22 @@ import "../../../packages/react-components/dist/es/index.mjs";
|
|
|
37
37
|
import Ne from "../../../Dialog/AgentChat/HistoryItem/SessionRefer/index.mjs";
|
|
38
38
|
import we from "../../../node_modules/moment/dist/moment.mjs";
|
|
39
39
|
/* empty css */import { fetchEventSource as pe } from "../fetchEventSource/fetch.mjs";
|
|
40
|
-
import { Markdown as
|
|
40
|
+
import { Markdown as Me } from "../../../packages/react-components/dist/es/components/Markdown/index.mjs";
|
|
41
41
|
const Ee = ({
|
|
42
42
|
application: r,
|
|
43
43
|
sessionId: l
|
|
44
44
|
}) => {
|
|
45
|
-
const s = r.id, [C,
|
|
45
|
+
const s = r.id, [C, N] = m(""), [x, w] = m(""), [h, u] = m(), [I, S] = m(!1), B = Ie(null), [D, W] = m([]), [p, H] = m([]), [G, O] = m(0), [Q, Y] = m(), [c, M] = m(), [$] = q.useForm(), [T, X] = m(!1), [A, Z] = m({}), [_, ee] = m(0), {
|
|
46
46
|
service: y,
|
|
47
|
-
agentClient:
|
|
48
|
-
beforeMessageSend:
|
|
47
|
+
agentClient: k,
|
|
48
|
+
beforeMessageSend: Te,
|
|
49
49
|
popupContainer: P,
|
|
50
50
|
icon: Ae,
|
|
51
51
|
token: ne,
|
|
52
52
|
apiUrl: te
|
|
53
53
|
} = ke(Se), se = (n, a, i, e) => {
|
|
54
54
|
const t = {
|
|
55
|
-
messageId:
|
|
55
|
+
messageId: Ce(),
|
|
56
56
|
content: "",
|
|
57
57
|
role: 1,
|
|
58
58
|
sessionId: "",
|
|
@@ -60,7 +60,7 @@ const Ee = ({
|
|
|
60
60
|
messageTime: "",
|
|
61
61
|
llmModel: "",
|
|
62
62
|
searchReference: []
|
|
63
|
-
},
|
|
63
|
+
}, g = E(L({}, i), {
|
|
64
64
|
stream: !0
|
|
65
65
|
});
|
|
66
66
|
pe(`${te}/chat/v2/chat?applicationId=${n}&sessionId=${a}`, {
|
|
@@ -69,7 +69,7 @@ const Ee = ({
|
|
|
69
69
|
Authorization: `Bearer ${ne}`,
|
|
70
70
|
"Content-Type": "application/json"
|
|
71
71
|
},
|
|
72
|
-
body: JSON.stringify(
|
|
72
|
+
body: JSON.stringify(g),
|
|
73
73
|
openWhenHidden: !0,
|
|
74
74
|
onopen(d) {
|
|
75
75
|
return console.log("onopen"), d.ok && e != null && e.onopen && e.onopen(), Promise.resolve();
|
|
@@ -104,7 +104,7 @@ const Ee = ({
|
|
|
104
104
|
};
|
|
105
105
|
e != null && e.onmessage && e.onmessage(V);
|
|
106
106
|
} else
|
|
107
|
-
return
|
|
107
|
+
return xe.error({
|
|
108
108
|
message: f.message
|
|
109
109
|
});
|
|
110
110
|
},
|
|
@@ -130,7 +130,7 @@ const Ee = ({
|
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
132
|
};
|
|
133
|
-
|
|
133
|
+
b(() => {
|
|
134
134
|
if (!(r != null && r.id))
|
|
135
135
|
return;
|
|
136
136
|
const n = r.arrange;
|
|
@@ -140,13 +140,13 @@ const Ee = ({
|
|
|
140
140
|
W(i), O(i.length);
|
|
141
141
|
const e = i.map((t) => t.id);
|
|
142
142
|
H(e);
|
|
143
|
-
}, [r]),
|
|
144
|
-
if (!(r != null && r.id) || !
|
|
143
|
+
}, [r]), b(() => {
|
|
144
|
+
if (!(r != null && r.id) || !k)
|
|
145
145
|
return;
|
|
146
|
-
const n =
|
|
146
|
+
const n = k.questionContextMaxLength || 4e3;
|
|
147
147
|
ee(n), re();
|
|
148
|
-
}, [r,
|
|
149
|
-
const re = () =>
|
|
148
|
+
}, [r, k]);
|
|
149
|
+
const re = () => R(void 0, null, function* () {
|
|
150
150
|
if (!y || !s)
|
|
151
151
|
return;
|
|
152
152
|
const n = yield y.postApplicationIdSession({
|
|
@@ -156,7 +156,7 @@ const Ee = ({
|
|
|
156
156
|
debugger;
|
|
157
157
|
Y(n);
|
|
158
158
|
});
|
|
159
|
-
|
|
159
|
+
b(() => {
|
|
160
160
|
s && (y == null || y.getApplicationIdPromptVariables(s, {
|
|
161
161
|
status: 1
|
|
162
162
|
}).then((n) => {
|
|
@@ -166,26 +166,26 @@ const Ee = ({
|
|
|
166
166
|
name: e.name,
|
|
167
167
|
value: ""
|
|
168
168
|
}));
|
|
169
|
-
|
|
169
|
+
M(i);
|
|
170
170
|
}));
|
|
171
|
-
}, [y]),
|
|
171
|
+
}, [y]), b(() => {
|
|
172
172
|
if (!c)
|
|
173
173
|
return;
|
|
174
174
|
const n = {};
|
|
175
175
|
c == null || c.map((a) => {
|
|
176
176
|
a.key && (n[a.key] = a.value);
|
|
177
|
-
}), $.setFieldsValue(
|
|
177
|
+
}), $.setFieldsValue(L({}, n)), Z(n);
|
|
178
178
|
}, [c]);
|
|
179
179
|
const oe = (n, a) => {
|
|
180
180
|
}, ae = (n) => {
|
|
181
|
-
|
|
182
|
-
}, ce = () =>
|
|
183
|
-
if (
|
|
181
|
+
N(n.target.value);
|
|
182
|
+
}, ce = () => R(void 0, null, function* () {
|
|
183
|
+
if (S(!0), !s || !y || !k)
|
|
184
184
|
return;
|
|
185
185
|
for (const e in A)
|
|
186
|
-
A[e] || (
|
|
186
|
+
A[e] || (S(!1), F.config({
|
|
187
187
|
getContainer: () => (P == null ? void 0 : P.current) || document.body
|
|
188
|
-
}),
|
|
188
|
+
}), F.error("变量值不能为空"), F.config({
|
|
189
189
|
getContainer: void 0
|
|
190
190
|
}));
|
|
191
191
|
const n = yield y.postApplicationIdSession({
|
|
@@ -194,7 +194,7 @@ const Ee = ({
|
|
|
194
194
|
});
|
|
195
195
|
debugger;
|
|
196
196
|
Y(n);
|
|
197
|
-
const a =
|
|
197
|
+
const a = p == null ? void 0 : p.map((e) => e.toString()), i = {
|
|
198
198
|
content: C,
|
|
199
199
|
chatMode: 1,
|
|
200
200
|
knowledges: a,
|
|
@@ -202,51 +202,51 @@ const Ee = ({
|
|
|
202
202
|
};
|
|
203
203
|
se(s, n.id, i, {
|
|
204
204
|
onmessage: (e) => {
|
|
205
|
-
|
|
205
|
+
S(!0), u(void 0), w(e.content);
|
|
206
206
|
},
|
|
207
207
|
onclose: (e) => {
|
|
208
|
-
|
|
208
|
+
S(!1), e.code == 200 && (w(e.content), u(e));
|
|
209
209
|
},
|
|
210
210
|
onerror: () => {
|
|
211
|
-
|
|
211
|
+
S(!1);
|
|
212
212
|
}
|
|
213
213
|
}), c && y.getApplicationIdSessionIdPromptVariables(s, n.id).then((e) => {
|
|
214
|
-
const t = e.filter((
|
|
215
|
-
const d = c.filter((f) => f.key ===
|
|
216
|
-
return
|
|
214
|
+
const t = e.filter((g) => g.key !== "query").map((g) => {
|
|
215
|
+
const d = c.filter((f) => f.key === g.key);
|
|
216
|
+
return g.value = d[0].value, g;
|
|
217
217
|
});
|
|
218
|
-
Promise.all(t.map((
|
|
219
|
-
oe(
|
|
220
|
-
})),
|
|
218
|
+
Promise.all(t.map((g) => {
|
|
219
|
+
oe(g.id, g.value);
|
|
220
|
+
})), M(t);
|
|
221
221
|
});
|
|
222
222
|
});
|
|
223
|
-
|
|
224
|
-
if (!
|
|
223
|
+
b(() => {
|
|
224
|
+
if (!x)
|
|
225
225
|
return;
|
|
226
226
|
const n = B.current;
|
|
227
227
|
n && (n.scrollTop = n.scrollHeight);
|
|
228
|
-
}, [
|
|
228
|
+
}, [x]);
|
|
229
229
|
const le = (n) => {
|
|
230
230
|
H(n), O(n.length);
|
|
231
231
|
}, de = (n, a) => {
|
|
232
232
|
c && (c.map((i) => {
|
|
233
233
|
i.id === n && (i.value = a.target.value);
|
|
234
|
-
}),
|
|
234
|
+
}), M([...c]));
|
|
235
235
|
}, ie = () => {
|
|
236
|
-
X(!
|
|
236
|
+
X(!T);
|
|
237
237
|
};
|
|
238
|
-
return /* @__PURE__ */
|
|
238
|
+
return /* @__PURE__ */ v("div", {
|
|
239
239
|
className: "text-main",
|
|
240
|
-
children: [/* @__PURE__ */
|
|
240
|
+
children: [/* @__PURE__ */ v("div", {
|
|
241
241
|
className: "text-left-sider",
|
|
242
|
-
children: [/* @__PURE__ */
|
|
242
|
+
children: [/* @__PURE__ */ v("div", {
|
|
243
243
|
className: "text-prompts",
|
|
244
244
|
children: [/* @__PURE__ */ o("div", {
|
|
245
245
|
className: "prompts-header",
|
|
246
|
-
children: /* @__PURE__ */
|
|
246
|
+
children: /* @__PURE__ */ v(ve, {
|
|
247
247
|
children: [/* @__PURE__ */ o(K, {
|
|
248
248
|
className: "prompts-btn",
|
|
249
|
-
icon:
|
|
249
|
+
icon: T ? /* @__PURE__ */ o(U, {
|
|
250
250
|
type: "icon-biaoge-shouqi"
|
|
251
251
|
}) : /* @__PURE__ */ o(U, {
|
|
252
252
|
type: "icon-biaoge-zhankai"
|
|
@@ -258,7 +258,7 @@ const Ee = ({
|
|
|
258
258
|
children: "文本生成设置"
|
|
259
259
|
})]
|
|
260
260
|
})
|
|
261
|
-
}), !
|
|
261
|
+
}), !T && (c != null && c.length ? /* @__PURE__ */ o(q, {
|
|
262
262
|
autoComplete: "off",
|
|
263
263
|
form: $,
|
|
264
264
|
labelWrap: !0,
|
|
@@ -269,7 +269,7 @@ const Ee = ({
|
|
|
269
269
|
}
|
|
270
270
|
},
|
|
271
271
|
className: "prompts-form",
|
|
272
|
-
children: c == null ? void 0 : c.map((n) => /* @__PURE__ */ o(
|
|
272
|
+
children: c == null ? void 0 : c.map((n) => /* @__PURE__ */ o(q.Item, {
|
|
273
273
|
label: n.name,
|
|
274
274
|
name: n.key,
|
|
275
275
|
style: {
|
|
@@ -281,18 +281,18 @@ const Ee = ({
|
|
|
281
281
|
}],
|
|
282
282
|
children: /* @__PURE__ */ o(J, {
|
|
283
283
|
placeholder: "请输入",
|
|
284
|
-
maxLength:
|
|
284
|
+
maxLength: k == null ? void 0 : k.questionContextMaxLength,
|
|
285
285
|
onBlur: (a) => de(n.id, a)
|
|
286
286
|
})
|
|
287
287
|
}, n.key))
|
|
288
288
|
}) : null)]
|
|
289
|
-
}), /* @__PURE__ */
|
|
289
|
+
}), /* @__PURE__ */ v("div", {
|
|
290
290
|
className: "sider-header",
|
|
291
291
|
children: [/* @__PURE__ */ o("span", {
|
|
292
292
|
className: "header-title",
|
|
293
293
|
children: "文本生成输入"
|
|
294
294
|
}), D.length !== 0 && /* @__PURE__ */ o(be, {
|
|
295
|
-
checkedValues:
|
|
295
|
+
checkedValues: p,
|
|
296
296
|
currKnowledgeList: D,
|
|
297
297
|
selectCount: G,
|
|
298
298
|
onSelectChange: le,
|
|
@@ -300,7 +300,7 @@ const Ee = ({
|
|
|
300
300
|
})]
|
|
301
301
|
}), /* @__PURE__ */ o("div", {
|
|
302
302
|
className: "sider-main",
|
|
303
|
-
children: /* @__PURE__ */
|
|
303
|
+
children: /* @__PURE__ */ v("div", {
|
|
304
304
|
className: "sider-text",
|
|
305
305
|
children: [/* @__PURE__ */ o(J.TextArea, {
|
|
306
306
|
style: {
|
|
@@ -331,9 +331,9 @@ const Ee = ({
|
|
|
331
331
|
children: /* @__PURE__ */ o("div", {
|
|
332
332
|
className: "sider-text",
|
|
333
333
|
ref: B,
|
|
334
|
-
children:
|
|
335
|
-
children: [/* @__PURE__ */ o(
|
|
336
|
-
children:
|
|
334
|
+
children: x ? /* @__PURE__ */ v(ye, {
|
|
335
|
+
children: [/* @__PURE__ */ o(Me, {
|
|
336
|
+
children: x
|
|
337
337
|
}), h && (h == null ? void 0 : h.reference.length) !== 0 && /* @__PURE__ */ o(Ne, {
|
|
338
338
|
history: h,
|
|
339
339
|
docViewerUrl: ""
|
|
@@ -1,76 +1,65 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var A = Object.defineProperty, L = Object.defineProperties;
|
|
2
|
+
var M = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var i = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var s = (o, e, t) => e in o ?
|
|
4
|
+
var P = Object.prototype.hasOwnProperty, U = Object.prototype.propertyIsEnumerable;
|
|
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
|
-
|
|
10
|
+
U.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
|
|
15
|
-
/* empty css */import { ConfigProvider as
|
|
16
|
-
import
|
|
14
|
+
import { useRef as j, useState as l, useEffect as z } from "react";
|
|
15
|
+
/* empty css */import { ConfigProvider as f } from "antd";
|
|
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
|
|
20
|
-
const
|
|
19
|
+
import { AgentClientProvider as W } from "../context.mjs";
|
|
20
|
+
const Y = (o) => {
|
|
21
21
|
const {
|
|
22
22
|
application: e,
|
|
23
|
-
|
|
24
|
-
triggerButton: W,
|
|
25
|
-
size: q,
|
|
26
|
-
theme: c,
|
|
27
|
-
icon: D,
|
|
28
|
-
docViewerUrl: F,
|
|
23
|
+
theme: t,
|
|
29
24
|
token: r,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
onComment: u,
|
|
37
|
-
onSessionLoad: g,
|
|
38
|
-
onSessionUnload: h,
|
|
39
|
-
onMessage: v,
|
|
25
|
+
footer: m,
|
|
26
|
+
defaultInput: c,
|
|
27
|
+
onComment: p,
|
|
28
|
+
onSessionLoad: u,
|
|
29
|
+
onSessionUnload: g,
|
|
30
|
+
onMessage: h,
|
|
40
31
|
beforeMessageSend: C,
|
|
41
32
|
bodyStyle: S,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
} = o, R = P(null), [T, Y] = d(!1), [Z, k] = d();
|
|
50
|
-
return j(() => {
|
|
33
|
+
sessionId: v,
|
|
34
|
+
disabled: x,
|
|
35
|
+
transform: I,
|
|
36
|
+
features: b,
|
|
37
|
+
agentClient: N
|
|
38
|
+
} = o, R = j(null), [T, q] = l(!1), [w, k] = l();
|
|
39
|
+
return z(() => {
|
|
51
40
|
if (!r)
|
|
52
41
|
return;
|
|
53
42
|
const y = J(r);
|
|
54
43
|
k(y.rid);
|
|
55
|
-
}, [r]),
|
|
56
|
-
theme:
|
|
57
|
-
}), /* @__PURE__ */ n(
|
|
58
|
-
locale:
|
|
59
|
-
children: /* @__PURE__ */ n(
|
|
60
|
-
value:
|
|
44
|
+
}, [r]), f.config({
|
|
45
|
+
theme: t
|
|
46
|
+
}), /* @__PURE__ */ n(f, {
|
|
47
|
+
locale: B,
|
|
48
|
+
children: /* @__PURE__ */ n(W, {
|
|
49
|
+
value: d(a({}, o), {
|
|
61
50
|
popupContainer: R,
|
|
62
|
-
agentClient:
|
|
63
|
-
footer:
|
|
64
|
-
defaultInput:
|
|
65
|
-
onComment:
|
|
66
|
-
onSessionLoad:
|
|
67
|
-
onSessionUnload:
|
|
68
|
-
onMessage:
|
|
51
|
+
agentClient: N,
|
|
52
|
+
footer: m,
|
|
53
|
+
defaultInput: c,
|
|
54
|
+
onComment: p,
|
|
55
|
+
onSessionLoad: u,
|
|
56
|
+
onSessionUnload: g,
|
|
57
|
+
onMessage: h,
|
|
69
58
|
beforeMessageSend: C,
|
|
70
59
|
bodyStyle: S,
|
|
71
|
-
disabled:
|
|
72
|
-
transform:
|
|
73
|
-
features:
|
|
60
|
+
disabled: x,
|
|
61
|
+
transform: I,
|
|
62
|
+
features: b
|
|
74
63
|
}),
|
|
75
64
|
children: !T && /* @__PURE__ */ n("div", {
|
|
76
65
|
className: "chat-text",
|
|
@@ -78,7 +67,7 @@ const ae = (o) => {
|
|
|
78
67
|
className: "text-pannel",
|
|
79
68
|
children: /* @__PURE__ */ n(E, {
|
|
80
69
|
application: e,
|
|
81
|
-
sessionId:
|
|
70
|
+
sessionId: v
|
|
82
71
|
})
|
|
83
72
|
})
|
|
84
73
|
})
|
|
@@ -86,5 +75,5 @@ const ae = (o) => {
|
|
|
86
75
|
});
|
|
87
76
|
};
|
|
88
77
|
export {
|
|
89
|
-
|
|
78
|
+
Y as default
|
|
90
79
|
};
|
package/dist/es/index.mjs
CHANGED
|
@@ -264,121 +264,6 @@ class Ei {
|
|
|
264
264
|
enable() {
|
|
265
265
|
this._inputDisabled = !1, this.render();
|
|
266
266
|
}
|
|
267
|
-
// render() {
|
|
268
|
-
// let containerParentH = this.wrapper.getBoundingClientRect().height;
|
|
269
|
-
// this.wrapper.style.height = `${containerParentH}px`;
|
|
270
|
-
// ReactDOM.render(
|
|
271
|
-
// <AgentCliUIComponent
|
|
272
|
-
// rId={this.rId}
|
|
273
|
-
// sessionId={this._defatulSessionId}
|
|
274
|
-
// showHeader={this.uiConfig.showHeader}
|
|
275
|
-
// apiUrl={this.apiUrl}
|
|
276
|
-
// env={this.uiConfig.env}
|
|
277
|
-
// debug={this.uiConfig.debug}
|
|
278
|
-
// mode={this.mode}
|
|
279
|
-
// token={this.token}
|
|
280
|
-
// className={this.mode}
|
|
281
|
-
// open={this.uiConfig.open}
|
|
282
|
-
// theme={this.uiConfig.theme}
|
|
283
|
-
// logo={this.uiConfig.logo}
|
|
284
|
-
// icon={this.uiConfig.icon}
|
|
285
|
-
// greeting={this.uiConfig.greeting}
|
|
286
|
-
// size={this.uiConfig.size}
|
|
287
|
-
// triggerButton={{ visible: true, ...this.uiConfig.triggerButton }}
|
|
288
|
-
// history={this.uiConfig.history}
|
|
289
|
-
// service={this.service}
|
|
290
|
-
// docViewerUrl={this.docViewerUrl}
|
|
291
|
-
// plugins={this.uiConfig.plugins}
|
|
292
|
-
// mcp={this.uiConfig.mcp}
|
|
293
|
-
// transform={{
|
|
294
|
-
// ...this.uiConfig.transform,
|
|
295
|
-
// knowledges:
|
|
296
|
-
// this.uiConfig.features?.knowledges === true ||
|
|
297
|
-
// (typeof this.uiConfig.features?.knowledges === 'object' &&
|
|
298
|
-
// this.uiConfig.features?.knowledges?.visible !== false)
|
|
299
|
-
// ? true
|
|
300
|
-
// : false,
|
|
301
|
-
// }}
|
|
302
|
-
// features={this.uiConfig.features}
|
|
303
|
-
// disabled={this._inputDisabled}
|
|
304
|
-
// sider={this.uiConfig.sider}
|
|
305
|
-
// footer={this.uiConfig.footer}
|
|
306
|
-
// onComment={(payload) => {
|
|
307
|
-
// try {
|
|
308
|
-
// this.uiConfig.eventListeners?.comment?.(payload);
|
|
309
|
-
// } catch (error) {
|
|
310
|
-
// console.error(error);
|
|
311
|
-
// }
|
|
312
|
-
// }}
|
|
313
|
-
// //TODO 流式响应
|
|
314
|
-
// // onStreamMessage={(payload) => {
|
|
315
|
-
// // try {
|
|
316
|
-
// // this.uiConfig.eventListeners?.message?.(payload);
|
|
317
|
-
// // } catch (error) {
|
|
318
|
-
// // console.error(error);
|
|
319
|
-
// // }
|
|
320
|
-
// // }}
|
|
321
|
-
// onMessage={(payload) => {
|
|
322
|
-
// if (!payload.message.messageId) return;
|
|
323
|
-
// try {
|
|
324
|
-
// this.uiConfig.eventListeners?.message?.(payload);
|
|
325
|
-
// } catch (error) {
|
|
326
|
-
// console.error(error);
|
|
327
|
-
// }
|
|
328
|
-
// }}
|
|
329
|
-
// beforeMessageSend={(payload) => {
|
|
330
|
-
// if (!this.uiConfig.eventListeners?.beforemessagesend) return true;
|
|
331
|
-
// try {
|
|
332
|
-
// return (
|
|
333
|
-
// this.uiConfig.eventListeners?.beforemessagesend?.(payload) ||
|
|
334
|
-
// false
|
|
335
|
-
// );
|
|
336
|
-
// } catch (error) {
|
|
337
|
-
// console.error(error);
|
|
338
|
-
// return false;
|
|
339
|
-
// }
|
|
340
|
-
// }}
|
|
341
|
-
// onSessionUnload={(payload) => {
|
|
342
|
-
// this._activeSession = null;
|
|
343
|
-
// try {
|
|
344
|
-
// this.uiConfig.eventListeners?.sessionunload?.(payload);
|
|
345
|
-
// } catch (error) {
|
|
346
|
-
// console.error(error);
|
|
347
|
-
// }
|
|
348
|
-
// }}
|
|
349
|
-
// onSessionLoad={(payload) => {
|
|
350
|
-
// if (this._activeSession?.id === payload.sessionId) {
|
|
351
|
-
// this._activeSession = payload.session;
|
|
352
|
-
// } else {
|
|
353
|
-
// this._activeSession = payload.session;
|
|
354
|
-
// try {
|
|
355
|
-
// this.uiConfig.eventListeners?.sessionload?.(payload);
|
|
356
|
-
// } catch (error) {
|
|
357
|
-
// console.error(error);
|
|
358
|
-
// }
|
|
359
|
-
// }
|
|
360
|
-
// }}
|
|
361
|
-
// onHistoryLoad={(payload) => {
|
|
362
|
-
// if (this._activeSession?.id === payload.sessionId) {
|
|
363
|
-
// try {
|
|
364
|
-
// this.uiConfig.eventListeners?.historyload?.(payload);
|
|
365
|
-
// } catch (error) {
|
|
366
|
-
// console.error(error);
|
|
367
|
-
// }
|
|
368
|
-
// }
|
|
369
|
-
// }}
|
|
370
|
-
// defaultInput={
|
|
371
|
-
// this._defaultInputText !== undefined
|
|
372
|
-
// ? { text: this._defaultInputText }
|
|
373
|
-
// : undefined
|
|
374
|
-
// }
|
|
375
|
-
// bodyStyle={this.uiConfig.bodyStyle}
|
|
376
|
-
// stream={this.stream}
|
|
377
|
-
// />,
|
|
378
|
-
// this.wrapper
|
|
379
|
-
// );
|
|
380
|
-
// this._defaultInputText = '';
|
|
381
|
-
// }
|
|
382
267
|
createBotClientSDK() {
|
|
383
268
|
return I(this, null, function* () {
|
|
384
269
|
return new Promise((e, r) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e = "@glodon-aiot/agent-cli-ui", t = "3.3.2-beta.
|
|
1
|
+
const e = "@glodon-aiot/agent-cli-ui", t = "3.3.2-beta.12", 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.2-beta.11", s = "./dist/es/index
|
|
|
22
22
|
webpack: "*"
|
|
23
23
|
}, p = {
|
|
24
24
|
"@ant-design/icons": "^5.3.4",
|
|
25
|
-
"@glodon-aiot/apis": "^3.3.2-beta.
|
|
26
|
-
"@glodon-aiot/bot-client-sdk": "^3.3.2-beta.
|
|
25
|
+
"@glodon-aiot/apis": "^3.3.2-beta.12",
|
|
26
|
+
"@glodon-aiot/bot-client-sdk": "^3.3.2-beta.12",
|
|
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",
|