@glodon-aiot/agent-cli-ui 3.11.1-shapshot.1765331458 → 3.13.0-alpha.27
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 +12 -12
- package/dist/es/Dialog/AgentChat/HistoryItem/SessionRefer/ReferItem/index.mjs +28 -28
- package/dist/es/Dialog/AgentChat/HistoryItem/SessionRefer/index.mjs +1 -1
- package/dist/es/Dialog/AgentChat/Tools/UploadKnowledgeFiles/index.mjs +1 -1
- package/dist/es/Dialog/AgentChat/index.mjs +84 -84
- package/dist/es/constant.mjs +4 -4
- package/dist/es/packages/agent-cli-ui/package.json.mjs +15 -15
- package/dist/es/packages/react-components/dist/es/components/Markdown/Code/index.mjs +7 -7
- package/dist/es/packages/react-components/dist/es/index.mjs +1 -1
- package/dist/es/src/style11.css +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/style19.css +1 -1
- package/dist/es/src/style20.css +1 -1
- package/dist/es/src/style21.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/style28.css +1 -1
- package/dist/es/src/style29.css +1 -1
- package/dist/es/src/style30.css +1 -1
- package/dist/es/src/style31.css +1 -1
- package/dist/es/src/style32.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 +37 -37
- package/dist/src/constant.d.ts +2 -2
- package/package.json +3 -3
- package/dist/src/ReactTextGenerationUI/components/fetchEventSourcea/fetch.d.ts +0 -44
- package/dist/src/ReactTextGenerationUI/components/fetchEventSourcea/index.d.ts +0 -1
- package/dist/src/ReactTextGenerationUI/components/fetchEventSourcea/parse.d.ts +0 -36
- package/dist/src/utils/reactCompatibility.d.ts +0 -27
- package/dist/src/utils/testAntdPrefix.d.ts +0 -3
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
var wn = Object.defineProperty, kn = Object.defineProperties;
|
|
2
2
|
var In = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var Nt = Object.getOwnPropertySymbols;
|
|
4
|
-
var Nn = Object.prototype.hasOwnProperty,
|
|
4
|
+
var Nn = Object.prototype.hasOwnProperty, Ln = Object.prototype.propertyIsEnumerable;
|
|
5
5
|
var Ue = (w, h, o) => h in w ? wn(w, h, { enumerable: !0, configurable: !0, writable: !0, value: o }) : w[h] = o, Ae = (w, h) => {
|
|
6
6
|
for (var o in h || (h = {}))
|
|
7
7
|
Nn.call(h, o) && Ue(w, o, h[o]);
|
|
8
8
|
if (Nt)
|
|
9
9
|
for (var o of Nt(h))
|
|
10
|
-
|
|
10
|
+
Ln.call(h, o) && Ue(w, o, h[o]);
|
|
11
11
|
return w;
|
|
12
12
|
}, Fe = (w, h) => kn(w, In(h));
|
|
13
13
|
var U = (w, h, o) => (Ue(w, typeof h != "symbol" ? h + "" : h, o), o);
|
|
14
14
|
var A = (w, h, o) => new Promise((M, e) => {
|
|
15
|
-
var x = (
|
|
15
|
+
var x = (E) => {
|
|
16
16
|
try {
|
|
17
|
-
p(o.next(
|
|
17
|
+
p(o.next(E));
|
|
18
18
|
} catch (P) {
|
|
19
19
|
e(P);
|
|
20
20
|
}
|
|
21
|
-
}, $ = (
|
|
21
|
+
}, $ = (E) => {
|
|
22
22
|
try {
|
|
23
|
-
p(o.throw(
|
|
23
|
+
p(o.throw(E));
|
|
24
24
|
} catch (P) {
|
|
25
25
|
e(P);
|
|
26
26
|
}
|
|
27
|
-
}, p = (
|
|
27
|
+
}, p = (E) => E.done ? M(E.value) : Promise.resolve(E.value).then(x, $);
|
|
28
28
|
p((o = o.apply(w, h)).next());
|
|
29
29
|
});
|
|
30
|
-
import { jsx as d, jsxs as V, Fragment as
|
|
30
|
+
import { jsx as d, jsxs as V, Fragment as En } from "react/jsx-runtime";
|
|
31
31
|
import { memo as Pn, forwardRef as Tn, useState as m, useRef as Y, useContext as On, useEffect as k, useMemo as Rn, useImperativeHandle as Dn } from "react";
|
|
32
|
-
/* empty css */import { Spin as
|
|
32
|
+
/* empty css */import { Spin as Lt, Divider as Hn, Button as X, Space as Ie, Upload as Un, Tooltip as An, Popover as Fn, notification as ie, message as u } from "antd";
|
|
33
33
|
import oe from "../../components/Iconfont/index.mjs";
|
|
34
|
-
import { IHistoryRole as se, ApplicationTypes as re, ChatMessageRole as
|
|
34
|
+
import { IHistoryRole as se, ApplicationTypes as re, ChatMessageRole as Et, PromptVariableType as Ne } from "@glodon-aiot/apis";
|
|
35
35
|
import Rt from "./HistoryItem/index.mjs";
|
|
36
36
|
import Dt from "dayjs";
|
|
37
37
|
import { v4 as ze } from "uuid";
|
|
@@ -78,7 +78,7 @@ class ge {
|
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
const Ot = 10,
|
|
81
|
+
const Ot = 10, Le = 5, je = (w, h, o, M) => {
|
|
82
82
|
let e = w;
|
|
83
83
|
if (M === re.Agent) {
|
|
84
84
|
if (o && o.length > 0) {
|
|
@@ -104,9 +104,9 @@ ${e}` : e;
|
|
|
104
104
|
onCreateSession: x,
|
|
105
105
|
embeddingService: $,
|
|
106
106
|
setCurrentSession: p,
|
|
107
|
-
networkStatus:
|
|
107
|
+
networkStatus: E,
|
|
108
108
|
setNetworkStatus: P
|
|
109
|
-
} = w, [v, I] = m([]), [Ht, fe] = m(), [
|
|
109
|
+
} = w, [v, I] = m([]), [Ht, fe] = m(), [Ee, Ve] = m(), O = Y(null), {
|
|
110
110
|
service: R,
|
|
111
111
|
agentClient: N,
|
|
112
112
|
depId: Ut,
|
|
@@ -118,7 +118,7 @@ ${e}` : e;
|
|
|
118
118
|
beforeMessageSend: B,
|
|
119
119
|
bodyStyle: Ft,
|
|
120
120
|
disabled: F,
|
|
121
|
-
features:
|
|
121
|
+
features: l,
|
|
122
122
|
popupContainer: g,
|
|
123
123
|
icon: Mt,
|
|
124
124
|
sider: jt,
|
|
@@ -127,8 +127,8 @@ ${e}` : e;
|
|
|
127
127
|
k(() => {
|
|
128
128
|
Bt(qe > 0);
|
|
129
129
|
}, [qe]);
|
|
130
|
-
const pe = Y(null), [Ye, _t] = m([]), [Qe, J] = m(!1), [Ge, qt] = m(!1), [Wt, Kt] = m(""), [Yt, S] = m(), [ee, ae] = m({}), ve = Y(null), Xe = Y(null), Oe = Y(null), [Ze, Qt] = m(!1), [Gt, Xt] = m([]), [Zt, be] = m(!0), [Jt, St] = m(!0), [Je, j] = m(!1), [Re, _] = m(!1), [Se, en] = m(!1), [D, le] = m(typeof (
|
|
131
|
-
const t = typeof (
|
|
130
|
+
const pe = Y(null), [Ye, _t] = m([]), [Qe, J] = m(!1), [Ge, qt] = m(!1), [Wt, Kt] = m(""), [Yt, S] = m(), [ee, ae] = m({}), ve = Y(null), Xe = Y(null), Oe = Y(null), [Ze, Qt] = m(!1), [Gt, Xt] = m([]), [Zt, be] = m(!0), [Jt, St] = m(!0), [Je, j] = m(!1), [Re, _] = m(!1), [Se, en] = m(!1), [D, le] = m(typeof (l == null ? void 0 : l.promptVariables) == "object" ? l.promptVariables.default || [] : []), [tn, nn] = m(() => {
|
|
131
|
+
const t = typeof (l == null ? void 0 : l.knowledges) == "object" && l.knowledges.default || void 0;
|
|
132
132
|
if (t) {
|
|
133
133
|
if (Array.isArray(t) && t.some((r) => Array.isArray(r.fileIds) && r.fileIds.length === 0))
|
|
134
134
|
throw Error("fileIds cannot be an empty array");
|
|
@@ -136,7 +136,7 @@ ${e}` : e;
|
|
|
136
136
|
throw Error(`knowledges and fileIds total count cannot exceed ${Pt}`);
|
|
137
137
|
}
|
|
138
138
|
return t;
|
|
139
|
-
}), [et, z] = m(!1), [tt, de] = m(!1), [on, te] = m(typeof (
|
|
139
|
+
}), [et, z] = m(!1), [tt, de] = m(!1), [on, te] = m(typeof (l == null ? void 0 : l.connectNetwork) == "object" && typeof (l == null ? void 0 : l.connectNetwork.default) == "boolean" ? l.connectNetwork.default : !1), [nt, xe] = m(!1), [sn, q] = m(!1), [rn, an] = m(null), [Ce, G] = m(!1), [it, ot] = m(!1), {
|
|
140
140
|
isSwitchingToExistingSession: st,
|
|
141
141
|
setIsSwitchingToExistingSession: we
|
|
142
142
|
} = ni(), ne = Y(null);
|
|
@@ -165,7 +165,7 @@ ${e}` : e;
|
|
|
165
165
|
}), !((s = e == null ? void 0 : e.data) != null && s.id))
|
|
166
166
|
return;
|
|
167
167
|
if (_(!1), j(!1), (r = e.messages) != null && r.length) {
|
|
168
|
-
const c = [...e.messages.filter((
|
|
168
|
+
const c = [...e.messages.filter((a) => a == null ? void 0 : a.messageId)].reverse();
|
|
169
169
|
y.current = [...c], I([...c]), q(!1);
|
|
170
170
|
}
|
|
171
171
|
const n = (i) => {
|
|
@@ -313,7 +313,7 @@ ${e}` : e;
|
|
|
313
313
|
if (Ce)
|
|
314
314
|
return;
|
|
315
315
|
G(!0), x == null || x({
|
|
316
|
-
netOpen:
|
|
316
|
+
netOpen: E ? Q.OPEN : Q.CLOSE
|
|
317
317
|
}).then((C) => {
|
|
318
318
|
var T, ce;
|
|
319
319
|
z(!0), P(!!((T = C.data) != null && T.netOpen)), te(!!((ce = C.data) != null && ce.enableNetOpen)), ke(C).then(() => {
|
|
@@ -336,7 +336,7 @@ ${e}` : e;
|
|
|
336
336
|
message: {
|
|
337
337
|
content: i,
|
|
338
338
|
sessionId: r,
|
|
339
|
-
role:
|
|
339
|
+
role: Et.User,
|
|
340
340
|
files: ee[r]
|
|
341
341
|
}
|
|
342
342
|
}) : c = !0;
|
|
@@ -347,45 +347,45 @@ ${e}` : e;
|
|
|
347
347
|
G(!1);
|
|
348
348
|
return;
|
|
349
349
|
}
|
|
350
|
-
let
|
|
351
|
-
typeof c == "object" && (
|
|
352
|
-
const
|
|
350
|
+
let a = n;
|
|
351
|
+
typeof c == "object" && (a = c.content || n);
|
|
352
|
+
const L = yield (() => new Promise((C) => {
|
|
353
353
|
le((T) => (C(T), T));
|
|
354
354
|
}))();
|
|
355
|
-
if (!(yield e.setPromptVariables(
|
|
355
|
+
if (!(yield e.setPromptVariables(L))) {
|
|
356
356
|
G(!1);
|
|
357
357
|
return;
|
|
358
358
|
}
|
|
359
|
-
((K = ee[r]) == null ? void 0 : K.length) > 0 ? dn(
|
|
359
|
+
((K = ee[r]) == null ? void 0 : K.length) > 0 ? dn(a) : De(a);
|
|
360
360
|
}), ke = (t) => new Promise((n, s) => A(void 0, null, function* () {
|
|
361
|
-
const c = (t == null ? void 0 : t.promptVariables).filter((
|
|
362
|
-
var
|
|
363
|
-
const b = (
|
|
364
|
-
return
|
|
361
|
+
const c = (t == null ? void 0 : t.promptVariables).filter((a) => a.type ? !((a.type === Ne.User || a.type === void 0) && a.key === "query") && !((a.type === Ne.System || a.type === void 0) && a.key === "datetime") : a.key !== "query").map((a) => {
|
|
362
|
+
var L;
|
|
363
|
+
const b = (L = D.find((H) => H.key === a.key && H.type === a.type)) == null ? void 0 : L.value;
|
|
364
|
+
return a.value = b || "", a;
|
|
365
365
|
});
|
|
366
|
-
le(c.sort((
|
|
367
|
-
console.error(
|
|
366
|
+
le(c.sort((a, b) => a.key.localeCompare(b.key))), yield t == null ? void 0 : t.setPromptVariables(c).catch((a) => {
|
|
367
|
+
console.error(a), u.config({
|
|
368
368
|
getContainer: () => (g == null ? void 0 : g.current) || document.body,
|
|
369
369
|
prefixCls: "gbot-message"
|
|
370
|
-
}), u.error(
|
|
370
|
+
}), u.error(a.message), u.config({
|
|
371
371
|
getContainer: void 0,
|
|
372
372
|
prefixCls: "gbot-message"
|
|
373
373
|
});
|
|
374
374
|
}), n();
|
|
375
375
|
})), dn = (t) => {
|
|
376
|
-
var i, c,
|
|
376
|
+
var i, c, a;
|
|
377
377
|
if (be(!1), !((i = e == null ? void 0 : e.data) != null && i.id) || !(o != null && o.id))
|
|
378
378
|
return;
|
|
379
379
|
const n = ((c = e.data) == null ? void 0 : c.id) || "";
|
|
380
380
|
let s = [], r = /* @__PURE__ */ new Set();
|
|
381
|
-
(
|
|
381
|
+
(a = ee[n]) == null || a.forEach((b) => {
|
|
382
382
|
r.has(b.id) || (s.push(b), r.add(b.id));
|
|
383
383
|
}), be(!0), De(t, s);
|
|
384
384
|
};
|
|
385
385
|
k(() => {
|
|
386
|
-
if (!
|
|
386
|
+
if (!Ee || !e)
|
|
387
387
|
return;
|
|
388
|
-
const t =
|
|
388
|
+
const t = Ee, n = () => A(void 0, null, function* () {
|
|
389
389
|
xe(!0);
|
|
390
390
|
const s = je(t, Z, ee[e.id], (o == null ? void 0 : o.type) || 0);
|
|
391
391
|
let r;
|
|
@@ -396,7 +396,7 @@ ${e}` : e;
|
|
|
396
396
|
message: {
|
|
397
397
|
content: s,
|
|
398
398
|
sessionId: e.id,
|
|
399
|
-
role:
|
|
399
|
+
role: Et.User,
|
|
400
400
|
files: ee[e.id]
|
|
401
401
|
}
|
|
402
402
|
}) : r = !0;
|
|
@@ -412,7 +412,7 @@ ${e}` : e;
|
|
|
412
412
|
return e.ready ? n() : e.addEventListener("ready", n, !0), () => {
|
|
413
413
|
e == null || e.removeEventListener("ready", n);
|
|
414
414
|
};
|
|
415
|
-
}, [
|
|
415
|
+
}, [Ee, e]);
|
|
416
416
|
const De = (t, n) => A(void 0, null, function* () {
|
|
417
417
|
var W, K, C;
|
|
418
418
|
const s = (W = e == null ? void 0 : e.data) == null ? void 0 : W.id;
|
|
@@ -441,26 +441,26 @@ ${e}` : e;
|
|
|
441
441
|
sessionId: s,
|
|
442
442
|
message: c
|
|
443
443
|
});
|
|
444
|
-
const
|
|
445
|
-
|
|
446
|
-
const b = (n == null ? void 0 : n.map((T) => T.id)) || [],
|
|
444
|
+
const a = new ge("", s, se.System);
|
|
445
|
+
a.isWaiting = !0, y.current = [a, ...y.current], I(y.current);
|
|
446
|
+
const b = (n == null ? void 0 : n.map((T) => T.id)) || [], L = {
|
|
447
447
|
stream: jn.stream,
|
|
448
448
|
referenceFirst: !1
|
|
449
449
|
};
|
|
450
450
|
if (f != null && f.promptVariables) {
|
|
451
451
|
const T = D == null ? void 0 : D.reduce((ce, It) => (ce[It.key] = It.value, ce), {});
|
|
452
|
-
|
|
452
|
+
L.formatValues = T;
|
|
453
453
|
}
|
|
454
454
|
if (f != null && f.knowledges) {
|
|
455
455
|
const T = tn;
|
|
456
|
-
|
|
456
|
+
L.knowledges = T;
|
|
457
457
|
}
|
|
458
458
|
const H = {
|
|
459
459
|
text: r,
|
|
460
460
|
fileIds: b,
|
|
461
461
|
files: n
|
|
462
462
|
};
|
|
463
|
-
i && i.length > 0 && (H.imageContent = i), yield e.send(H,
|
|
463
|
+
i && i.length > 0 && (H.imageContent = i), yield e.send(H, L), ae({
|
|
464
464
|
[s]: []
|
|
465
465
|
}), (C = ve.current) == null || C.update(), he([]), ye([]), G(!1);
|
|
466
466
|
});
|
|
@@ -484,12 +484,12 @@ ${e}` : e;
|
|
|
484
484
|
});
|
|
485
485
|
return;
|
|
486
486
|
}
|
|
487
|
-
const c = i.actions || [],
|
|
488
|
-
|
|
487
|
+
const c = i.actions || [], a = new ge(i.content, t, se.Robot);
|
|
488
|
+
a.messageId = i.messageId || ze(), a.reasoningContent = i.reasoningContent, a.searchReference = i.searchReference, a.thinkingSecs = i.thinkingSecs, a.thinkingStatus = i.thinkingStatus, a.actions = c, a.isLoading = !0, a.searchingStatus = i.searchingStatus, y.current = y.current.filter((b) => !b.isWaiting).filter((b) => !b.isReplying), i.index === void 0 && I([a, ...y.current]), i.code === 11915 && (j(!1), _(!1), a.isLoading = !1, a.content = "请您换个问题问我吧~", a.isSensitive = !0, I([a, ...y.current])), i.index === -2 && (j(!1), _(!1), a.isLoading = !1, a.content = "回答已中止~", a.isSuspend = !0, I([a, ...y.current])), i.index === -1 && (j(!1), _(!1), a.isLoading = !1, a.reference = i.reference, I([a, ...y.current]), o.id && ue && ue({
|
|
489
489
|
applicationId: o.id,
|
|
490
490
|
sessionId: t,
|
|
491
|
-
message:
|
|
492
|
-
})), i.index === -3 && (j(!1), _(!1),
|
|
491
|
+
message: a
|
|
492
|
+
})), i.index === -3 && (j(!1), _(!1), a.isLoading = !1, a.reference = i.reference, a.relatedQuesion = i.relatedQuesion, I([a, ...y.current]));
|
|
493
493
|
}, s = () => {
|
|
494
494
|
e.addEventListener("message:updated", n);
|
|
495
495
|
};
|
|
@@ -529,12 +529,12 @@ ${e}` : e;
|
|
|
529
529
|
}), u.error("图片须小于20M"), u.config({
|
|
530
530
|
getContainer: void 0,
|
|
531
531
|
prefixCls: "gbot-message"
|
|
532
|
-
}), !1) : (he((s) => s.length >=
|
|
532
|
+
}), !1) : (he((s) => s.length >= Le ? s : [...s, t]), !1);
|
|
533
533
|
}, gn = () => A(void 0, null, function* () {
|
|
534
534
|
var t;
|
|
535
535
|
return (t = e == null ? void 0 : e.data) != null && t.id ? e : (ne.current || (ne.current = new Promise((n, s) => {
|
|
536
536
|
z(!0), x == null || x({
|
|
537
|
-
netOpen:
|
|
537
|
+
netOpen: E ? Q.OPEN : Q.CLOSE
|
|
538
538
|
}).then((r) => {
|
|
539
539
|
var i, c;
|
|
540
540
|
p == null || p(r), z(!1), P(!!((i = r.data) != null && i.netOpen)), te(!!((c = r.data) != null && c.enableNetOpen)), ke(r), n(r);
|
|
@@ -555,11 +555,11 @@ ${e}` : e;
|
|
|
555
555
|
knowledgeId: ((c = t.data) == null ? void 0 : c.id) || "",
|
|
556
556
|
type: 1
|
|
557
557
|
};
|
|
558
|
-
R == null || R.postTicket(i).then((
|
|
559
|
-
R.uploadMinioFile(
|
|
558
|
+
R == null || R.postTicket(i).then((a) => {
|
|
559
|
+
R.uploadMinioFile(a.minio, n).then(() => {
|
|
560
560
|
var W, K;
|
|
561
|
-
const b = (W =
|
|
562
|
-
r(`${location.protocol}//${b}/${
|
|
561
|
+
const b = (W = a.minio.endpoints) == null ? void 0 : W[0], L = a.minio.bucket, H = (K = a.minio.fileKeys) == null ? void 0 : K[0];
|
|
562
|
+
r(`${a.minio.useSSL ? "https:" : location.protocol}//${b}/${L}/${H}`);
|
|
563
563
|
}).catch(() => {
|
|
564
564
|
});
|
|
565
565
|
}).catch(() => {
|
|
@@ -644,7 +644,7 @@ ${e}` : e;
|
|
|
644
644
|
e ? e.fetchData().then((t) => {
|
|
645
645
|
var n;
|
|
646
646
|
(n = e == null ? void 0 : e.data) != null && n.id && (P(t.netOpen), te(t.enableNetOpen));
|
|
647
|
-
}) : (P(typeof (
|
|
647
|
+
}) : (P(typeof (l == null ? void 0 : l.connectNetwork) == "object" && typeof (l == null ? void 0 : l.connectNetwork.default) == "boolean" ? l.connectNetwork.default : !1), te(o.arrange[0].enableNetOpen));
|
|
648
648
|
});
|
|
649
649
|
k(() => {
|
|
650
650
|
He();
|
|
@@ -655,8 +655,8 @@ ${e}` : e;
|
|
|
655
655
|
const r = document.getElementById("chat-main"), i = (n = O.current) == null ? void 0 : n.querySelector(".infinite-scroll-component__outerdiv"), c = (s = O.current) == null ? void 0 : s.querySelector(".infinite-scroll-component");
|
|
656
656
|
if (!i || !c || !r)
|
|
657
657
|
return;
|
|
658
|
-
const
|
|
659
|
-
if (c.offsetHeight <=
|
|
658
|
+
const a = r.offsetHeight;
|
|
659
|
+
if (c.offsetHeight <= a) {
|
|
660
660
|
if (i.style.height === "100%")
|
|
661
661
|
return;
|
|
662
662
|
i.style.height = "100%";
|
|
@@ -672,13 +672,13 @@ ${e}` : e;
|
|
|
672
672
|
return;
|
|
673
673
|
const t = () => {
|
|
674
674
|
const r = ((N == null ? void 0 : N.promptVariables) || []).filter((i) => i.type ? !(i.type === Ne.User && i.key === "query") && !(i.type === Ne.System && i.key === "datetime") && i.status === 1 : i.key !== "query" && i.status === 1).map((i, c) => {
|
|
675
|
-
var b,
|
|
676
|
-
let
|
|
677
|
-
return typeof (
|
|
675
|
+
var b, L;
|
|
676
|
+
let a = "";
|
|
677
|
+
return typeof (l == null ? void 0 : l.promptVariables) == "object" && (a = ((L = (b = l.promptVariables.default) == null ? void 0 : b.find((H) => H.key === i.key && H.type === i.type)) == null ? void 0 : L.value) || ""), {
|
|
678
678
|
id: c + "",
|
|
679
679
|
key: i.key,
|
|
680
680
|
name: i.name,
|
|
681
|
-
value:
|
|
681
|
+
value: a,
|
|
682
682
|
type: i.type
|
|
683
683
|
};
|
|
684
684
|
});
|
|
@@ -687,9 +687,9 @@ ${e}` : e;
|
|
|
687
687
|
return N != null && N.ready ? t() : N == null || N.addEventListener("ready", t), () => {
|
|
688
688
|
N == null || N.removeEventListener("ready", t);
|
|
689
689
|
};
|
|
690
|
-
}, [e, N,
|
|
690
|
+
}, [e, N, l == null ? void 0 : l.promptVariables]);
|
|
691
691
|
const lt = () => x == null ? void 0 : x({
|
|
692
|
-
netOpen:
|
|
692
|
+
netOpen: E ? Q.OPEN : Q.CLOSE
|
|
693
693
|
}).then((t) => {
|
|
694
694
|
var n, s;
|
|
695
695
|
return p == null || p(t), z(!1), P(!!((n = t.data) != null && n.netOpen)), te(!!((s = t.data) != null && s.enableNetOpen)), ke(t), t;
|
|
@@ -710,7 +710,7 @@ ${e}` : e;
|
|
|
710
710
|
isLoading: !1
|
|
711
711
|
},
|
|
712
712
|
actions: !!v.length,
|
|
713
|
-
markdown:
|
|
713
|
+
markdown: l == null ? void 0 : l.markdown
|
|
714
714
|
}) : null;
|
|
715
715
|
}, [o == null ? void 0 : o.arrange, v]);
|
|
716
716
|
return Dn(h, () => ({
|
|
@@ -728,8 +728,8 @@ ${e}` : e;
|
|
|
728
728
|
className: "agent-chat",
|
|
729
729
|
children: [sn ? /* @__PURE__ */ d("div", {
|
|
730
730
|
className: "session-loading",
|
|
731
|
-
children: /* @__PURE__ */ d(
|
|
732
|
-
}) : /* @__PURE__ */ V(
|
|
731
|
+
children: /* @__PURE__ */ d(Lt, {})
|
|
732
|
+
}) : /* @__PURE__ */ V(En, {
|
|
733
733
|
children: [(f == null ? void 0 : f.promptVariables) && /* @__PURE__ */ d(Xn, {
|
|
734
734
|
ref: Xe,
|
|
735
735
|
appId: o.id,
|
|
@@ -773,7 +773,7 @@ ${e}` : e;
|
|
|
773
773
|
textAlign: "center",
|
|
774
774
|
overflow: "hidden"
|
|
775
775
|
},
|
|
776
|
-
children: /* @__PURE__ */ d(
|
|
776
|
+
children: /* @__PURE__ */ d(Lt, {})
|
|
777
777
|
}),
|
|
778
778
|
scrollableTarget: "scrollableDiv",
|
|
779
779
|
children: [v.map((t, n) => /* @__PURE__ */ d(oi, {
|
|
@@ -785,14 +785,14 @@ ${e}` : e;
|
|
|
785
785
|
onRelatedClick: vn,
|
|
786
786
|
onAgainClick: bn,
|
|
787
787
|
onEditClick: pn,
|
|
788
|
-
markdown:
|
|
788
|
+
markdown: l == null ? void 0 : l.markdown
|
|
789
789
|
}, t.messageId + n)), !tt && dt]
|
|
790
790
|
}) : /* @__PURE__ */ V("div", {
|
|
791
791
|
className: "main-empty",
|
|
792
|
-
children: [(
|
|
792
|
+
children: [(l == null ? void 0 : l.greeting) !== !1 && /* @__PURE__ */ d(Wn, {
|
|
793
793
|
text: (
|
|
794
794
|
// 第一优先级:features配置
|
|
795
|
-
|
|
795
|
+
l != null && l.greeting && typeof l.greeting == "object" && l.greeting.text !== void 0 ? l.greeting.text : (
|
|
796
796
|
// 第二优先级:application.arrange[0].greetings
|
|
797
797
|
(mt = o.arrange) != null && mt.length && ((ht = o.arrange[0]) != null && ht.greetings) ? o.arrange[0].greetings : (
|
|
798
798
|
// 第三优先级:默认文本
|
|
@@ -800,13 +800,13 @@ ${e}` : e;
|
|
|
800
800
|
)
|
|
801
801
|
)
|
|
802
802
|
),
|
|
803
|
-
icon:
|
|
804
|
-
children: !!Ye.length && (((
|
|
803
|
+
icon: l === void 0 || l.greeting === !0 || ((yt = l.greeting) == null ? void 0 : yt.icon) === void 0 ? Mt || Tt.icon : l.greeting.icon,
|
|
804
|
+
children: !!Ye.length && (((l == null ? void 0 : l.greeting) === void 0 || (l == null ? void 0 : l.greeting)) === !0 || typeof (l == null ? void 0 : l.greeting) == "object" && l.greeting.questions !== !1) && /* @__PURE__ */ d(qn, {
|
|
805
805
|
ref: Oe,
|
|
806
806
|
sid: (pt = e == null ? void 0 : e.data) == null ? void 0 : pt.id,
|
|
807
807
|
isRecommendClearing: Qe,
|
|
808
808
|
data: Ye,
|
|
809
|
-
layoutBreakpoints: typeof (
|
|
809
|
+
layoutBreakpoints: typeof (l == null ? void 0 : l.greeting) == "object" ? l.greeting.layoutBreakpoints : void 0,
|
|
810
810
|
onItemClick: (t) => {
|
|
811
811
|
var s, r, i;
|
|
812
812
|
if (fe(t == null ? void 0 : t.question), S(t == null ? void 0 : t.question), Qe)
|
|
@@ -814,12 +814,12 @@ ${e}` : e;
|
|
|
814
814
|
t != null && t.id && J(!0);
|
|
815
815
|
const n = (s = e == null ? void 0 : e.data) == null ? void 0 : s.id;
|
|
816
816
|
f != null && f.fileUpload ? (i = (r = ve.current) == null ? void 0 : r.clear()) == null || i.then(() => {
|
|
817
|
-
var c,
|
|
817
|
+
var c, a;
|
|
818
818
|
t != null && t.id && (n ? (c = at(n, t)) == null || c.finally(() => {
|
|
819
819
|
J(!1);
|
|
820
|
-
}) : (J(!1), z(!0), (
|
|
821
|
-
var
|
|
822
|
-
(
|
|
820
|
+
}) : (J(!1), z(!0), (a = lt()) == null || a.then((b) => {
|
|
821
|
+
var L;
|
|
822
|
+
(L = at(b.id, t)) == null || L.finally(() => {
|
|
823
823
|
J(!1);
|
|
824
824
|
});
|
|
825
825
|
})));
|
|
@@ -897,18 +897,18 @@ ${e}` : e;
|
|
|
897
897
|
children: [/* @__PURE__ */ V(Ie, {
|
|
898
898
|
children: [(o.type === re.Agent && (f == null ? void 0 : f.imageUpload) || o.type === re.Dialog && ((vt = o.arrange) == null ? void 0 : vt.length) && !!o.arrange[0].visionOpen && (f == null ? void 0 : f.imageUpload)) && /* @__PURE__ */ d(Un, {
|
|
899
899
|
multiple: !0,
|
|
900
|
-
disabled: me.length >=
|
|
900
|
+
disabled: me.length >= Le || F,
|
|
901
901
|
accept: ".jpg, .png, .jpeg,.bmp",
|
|
902
902
|
listType: "picture-card",
|
|
903
903
|
beforeUpload: cn,
|
|
904
904
|
className: "footer-upload-picture",
|
|
905
905
|
showUploadList: !1,
|
|
906
|
-
children: me.length <
|
|
906
|
+
children: me.length < Le ? /* @__PURE__ */ d(An, {
|
|
907
907
|
placement: "topLeft",
|
|
908
908
|
overlayClassName: "footer-upload-tooltip",
|
|
909
909
|
title: /* @__PURE__ */ d("div", {
|
|
910
910
|
children: `支持上传.jpg .png .jpeg
|
|
911
|
-
.bmp格式的图片数据,单文件最大20M,最多${
|
|
911
|
+
.bmp格式的图片数据,单文件最大20M,最多${Le}张`
|
|
912
912
|
}),
|
|
913
913
|
children: /* @__PURE__ */ d(X, {
|
|
914
914
|
type: "text",
|
|
@@ -953,7 +953,7 @@ ${e}` : e;
|
|
|
953
953
|
}),
|
|
954
954
|
createSession: () => new Promise((t) => {
|
|
955
955
|
z(!0), x == null || x({
|
|
956
|
-
netOpen:
|
|
956
|
+
netOpen: E ? Q.OPEN : Q.CLOSE
|
|
957
957
|
}).then((n) => {
|
|
958
958
|
var r, i, c;
|
|
959
959
|
p == null || p(n), z(!1), P(!!((r = n.data) != null && r.netOpen)), te(!!((i = n.data) != null && i.enableNetOpen)), ke(n);
|
|
@@ -1004,8 +1004,8 @@ ${e}` : e;
|
|
|
1004
1004
|
}), /* @__PURE__ */ V(Ie, {
|
|
1005
1005
|
children: [(f == null ? void 0 : f.connectNetwork) && o.type === re.Dialog && ((xt = o.arrange) == null ? void 0 : xt.length) && !!o.arrange[0].enableNetOpen && /* @__PURE__ */ d(ei, {
|
|
1006
1006
|
sessionId: (Ct = e == null ? void 0 : e.data) == null ? void 0 : Ct.id,
|
|
1007
|
-
netStatus:
|
|
1008
|
-
enable: typeof (
|
|
1007
|
+
netStatus: E,
|
|
1008
|
+
enable: typeof (l == null ? void 0 : l.connectNetwork) == "object" && typeof (l == null ? void 0 : l.connectNetwork.diabled) == "boolean" ? !(l != null && l.connectNetwork.diabled) : on,
|
|
1009
1009
|
disabledTip: e ? void 0 : "网络访问已被禁用",
|
|
1010
1010
|
onNetStatusChange: (t) => {
|
|
1011
1011
|
Cn(t);
|
|
@@ -1098,7 +1098,7 @@ ${e}` : e;
|
|
|
1098
1098
|
}), it && /* @__PURE__ */ d(Jn, {
|
|
1099
1099
|
currentSession: e,
|
|
1100
1100
|
application: o,
|
|
1101
|
-
networkStatus:
|
|
1101
|
+
networkStatus: E,
|
|
1102
1102
|
setCurrentSession: p,
|
|
1103
1103
|
disabled: F,
|
|
1104
1104
|
isSessionHistoryVisible: it,
|
package/dist/es/constant.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import t from "./assets/brand.svg.mjs";
|
|
|
3
3
|
import o from "./assets/doc-icons/pdf.svg.mjs";
|
|
4
4
|
import r from "./assets/doc-icons/doc.svg.mjs";
|
|
5
5
|
import s from "./assets/doc-icons/docx.svg.mjs";
|
|
6
|
-
const
|
|
6
|
+
const u = {
|
|
7
7
|
triggerButton: {
|
|
8
8
|
visible: !0
|
|
9
9
|
},
|
|
@@ -101,7 +101,7 @@ const l = {
|
|
|
101
101
|
defaultInput: {
|
|
102
102
|
text: ""
|
|
103
103
|
}
|
|
104
|
-
},
|
|
104
|
+
}, c = "https://copilot.glodon.com/api/cvforcepd", f = "https://copilot.glodon.com/portal/_/aecpilot/fe/", m = 1024, d = 1024 * 1024, g = 1024 * 1024 * 1024, h = {
|
|
105
105
|
doc: r,
|
|
106
106
|
docx: s,
|
|
107
107
|
pdf: o
|
|
@@ -117,8 +117,8 @@ export {
|
|
|
117
117
|
d as MB,
|
|
118
118
|
N as NET_OPEN_STATUS,
|
|
119
119
|
t as brand,
|
|
120
|
-
|
|
120
|
+
c as defaultApiUrl,
|
|
121
121
|
f as defaultDovViewerUrl,
|
|
122
|
-
|
|
122
|
+
u as defaultUIConfig,
|
|
123
123
|
e as icon
|
|
124
124
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const e = "@glodon-aiot/agent-cli-ui", t = "3.
|
|
1
|
+
const e = "@glodon-aiot/agent-cli-ui", t = "3.13.0-alpha.27", 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"
|
|
5
|
-
},
|
|
5
|
+
}, l = [
|
|
6
6
|
"dist"
|
|
7
|
-
],
|
|
7
|
+
], r = "module", c = "dist/src/index.d.ts", d = {
|
|
8
8
|
dev: "vite",
|
|
9
9
|
start: "vite",
|
|
10
10
|
build: "tsc && node --max-old-space-size=4096 ./node_modules/vite/bin/vite.js build --mode prod && yarn build:cdn",
|
|
@@ -25,8 +25,8 @@ const e = "@glodon-aiot/agent-cli-ui", t = "3.11.1-shapshot.1765331458", s = "./
|
|
|
25
25
|
webpack: "*"
|
|
26
26
|
}, p = {
|
|
27
27
|
"@ant-design/icons": "^5.3.4",
|
|
28
|
-
"@glodon-aiot/apis": "^3.
|
|
29
|
-
"@glodon-aiot/bot-client-sdk": "^3.
|
|
28
|
+
"@glodon-aiot/apis": "^3.13.0-alpha.27",
|
|
29
|
+
"@glodon-aiot/bot-client-sdk": "^3.13.0-alpha.27",
|
|
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",
|
|
@@ -122,12 +122,12 @@ const e = "@glodon-aiot/agent-cli-ui", t = "3.11.1-shapshot.1765331458", s = "./
|
|
|
122
122
|
name: e,
|
|
123
123
|
version: t,
|
|
124
124
|
module: s,
|
|
125
|
-
main:
|
|
126
|
-
typings:
|
|
125
|
+
main: i,
|
|
126
|
+
typings: o,
|
|
127
127
|
exports: n,
|
|
128
|
-
files:
|
|
129
|
-
type:
|
|
130
|
-
types:
|
|
128
|
+
files: l,
|
|
129
|
+
type: r,
|
|
130
|
+
types: c,
|
|
131
131
|
scripts: d,
|
|
132
132
|
peerDependencies: a,
|
|
133
133
|
dependencies: p,
|
|
@@ -148,17 +148,17 @@ export {
|
|
|
148
148
|
u as devDependencies,
|
|
149
149
|
b as development,
|
|
150
150
|
n as exports,
|
|
151
|
-
|
|
151
|
+
l as files,
|
|
152
152
|
v as husky,
|
|
153
|
-
|
|
153
|
+
i as main,
|
|
154
154
|
s as module,
|
|
155
155
|
e as name,
|
|
156
156
|
a as peerDependencies,
|
|
157
157
|
m as production,
|
|
158
158
|
y as publishConfig,
|
|
159
159
|
d as scripts,
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
r as type,
|
|
161
|
+
c as types,
|
|
162
|
+
o as typings,
|
|
163
163
|
t as version
|
|
164
164
|
};
|
|
@@ -2,20 +2,20 @@ import { jsxs as m, jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import { Copy as w } from "../../Copy/index.mjs";
|
|
3
3
|
import { Space as g } from "antd";
|
|
4
4
|
import h from "../../../../../../../node_modules/react-syntax-highlighter/dist/esm/prism.mjs";
|
|
5
|
-
var O = Object.defineProperty, x = Object.defineProperties, y = Object.getOwnPropertyDescriptors, l = Object.getOwnPropertySymbols,
|
|
5
|
+
var O = Object.defineProperty, x = Object.defineProperties, y = Object.getOwnPropertyDescriptors, l = Object.getOwnPropertySymbols, u = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable, p = (e, r, a) => r in e ? O(e, r, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[r] = a, f = (e, r) => {
|
|
6
6
|
for (var a in r || (r = {}))
|
|
7
|
-
|
|
7
|
+
u.call(r, a) && p(e, a, r[a]);
|
|
8
8
|
if (l)
|
|
9
9
|
for (var a of l(r))
|
|
10
|
-
|
|
10
|
+
b.call(r, a) && p(e, a, r[a]);
|
|
11
11
|
return e;
|
|
12
12
|
}, v = (e, r) => x(e, y(r)), N = (e, r) => {
|
|
13
13
|
var a = {};
|
|
14
14
|
for (var n in e)
|
|
15
|
-
|
|
15
|
+
u.call(e, n) && r.indexOf(n) < 0 && (a[n] = e[n]);
|
|
16
16
|
if (e != null && l)
|
|
17
17
|
for (var n of l(e))
|
|
18
|
-
r.indexOf(n) < 0 &&
|
|
18
|
+
r.indexOf(n) < 0 && b.call(e, n) && (a[n] = e[n]);
|
|
19
19
|
return a;
|
|
20
20
|
};
|
|
21
21
|
const j = (e) => {
|
|
@@ -58,7 +58,7 @@ const j = (e) => {
|
|
|
58
58
|
}, s), {
|
|
59
59
|
children: c
|
|
60
60
|
}));
|
|
61
|
-
},
|
|
61
|
+
}, C = j;
|
|
62
62
|
export {
|
|
63
|
-
|
|
63
|
+
C as default
|
|
64
64
|
};
|