@glodon-aiot/agent-cli-ui 3.2.10-beta.3 → 3.2.10-beta.4
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/index.mjs +137 -136
- package/dist/es/Dialog/KnowledgeList/index.mjs +19 -19
- package/dist/es/Dialog/SearchReference/index.mjs +68 -41
- package/dist/es/Iconfont/index.mjs +2 -2
- package/dist/es/constant.mjs +8 -2
- package/dist/es/index.mjs +49 -48
- 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/style17.css +1 -1
- package/dist/es/src/style18.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/style22.css +0 -1
- package/dist/es/src/style23.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/style28.css +1 -0
- package/dist/es/src/style29.css +1 -1
- package/dist/es/src/style7.css +1 -1
- package/dist/es/src/style8.css +1 -1
- package/dist/lib/index.css +1 -1
- package/dist/lib/index.js +5 -5
- package/dist/src/Dialog/SearchReference/index.d.ts +4 -1
- package/dist/src/types.d.ts +10 -1
- package/package.json +3 -3
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
import { jsxs as x, jsx as A } from "react/jsx-runtime";
|
|
2
|
-
import { useContext as H, useState as i, useEffect as
|
|
2
|
+
import { useContext as H, useState as i, useEffect as v } from "react";
|
|
3
3
|
/* empty css */import K from "../../context.mjs";
|
|
4
4
|
import { Space as q } from "antd";
|
|
5
5
|
import z from "./KnowledgeSelect/index.mjs";
|
|
6
|
-
const P = (
|
|
6
|
+
const P = (y) => {
|
|
7
7
|
var j, u;
|
|
8
8
|
const {
|
|
9
9
|
currentSession: t,
|
|
10
|
-
application:
|
|
10
|
+
application: o,
|
|
11
11
|
setCurrentSession: B,
|
|
12
12
|
reload: D,
|
|
13
13
|
setCheckKnowledges: g
|
|
14
|
-
} =
|
|
14
|
+
} = y, {
|
|
15
15
|
mode: C,
|
|
16
16
|
transform: w,
|
|
17
|
-
features:
|
|
18
|
-
} = H(K), [d, k] = i([]), [r,
|
|
19
|
-
|
|
20
|
-
if (!(
|
|
17
|
+
features: n
|
|
18
|
+
} = H(K), [d, k] = i([]), [r, p] = i(typeof (n == null ? void 0 : n.knowledges) == "object" ? ((j = n.knowledges.default) == null ? void 0 : j.map((e) => e.id)) || [] : []), [E, c] = i(0), [h, b] = i(!1);
|
|
19
|
+
v(() => {
|
|
20
|
+
if (!(o != null && o.id))
|
|
21
21
|
return;
|
|
22
|
-
const e =
|
|
22
|
+
const e = o.arrange;
|
|
23
23
|
if (!(e != null && e.length))
|
|
24
24
|
return;
|
|
25
25
|
const s = e[0].knowledges || [];
|
|
26
26
|
k(s);
|
|
27
|
-
const l = typeof (
|
|
27
|
+
const l = typeof (n == null ? void 0 : n.knowledges) == "object" && n.knowledges.default || s;
|
|
28
28
|
if (!t) {
|
|
29
|
-
|
|
29
|
+
p(l.map((f) => f.id)), c(l.length), g == null || g(l);
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
32
|
const a = () => {
|
|
33
33
|
const f = t.knowledges || l;
|
|
34
|
-
|
|
34
|
+
c(f.length);
|
|
35
35
|
const F = f.map((N) => N.id);
|
|
36
|
-
|
|
36
|
+
p(F);
|
|
37
37
|
};
|
|
38
38
|
return a(), t.addEventListener("data:updated", a), () => {
|
|
39
39
|
t == null || t.removeEventListener("data:updated", a);
|
|
40
40
|
};
|
|
41
|
-
}, [
|
|
41
|
+
}, [o, t]), v(() => {
|
|
42
42
|
var m;
|
|
43
|
-
if (!h || (b(!1), !(
|
|
43
|
+
if (!h || (b(!1), !(o != null && o.id)))
|
|
44
44
|
return;
|
|
45
45
|
const e = [];
|
|
46
46
|
r == null || r.map((s) => {
|
|
@@ -49,20 +49,20 @@ const P = (v) => {
|
|
|
49
49
|
}), (m = t == null ? void 0 : t.data) != null && m.id && t.setKnowledges(e);
|
|
50
50
|
}, [h]);
|
|
51
51
|
const S = (e) => {
|
|
52
|
-
b(!0),
|
|
52
|
+
b(!0), p(e);
|
|
53
53
|
const m = [];
|
|
54
54
|
e == null || e.map((s) => {
|
|
55
55
|
const l = d == null ? void 0 : d.find((a) => a.id === s);
|
|
56
56
|
m.push(l);
|
|
57
|
-
}), g == null || g(m),
|
|
57
|
+
}), g == null || g(m), c(e.length);
|
|
58
58
|
};
|
|
59
59
|
return /* @__PURE__ */ x("div", {
|
|
60
60
|
className: "chat-header",
|
|
61
61
|
children: [/* @__PURE__ */ x(q, {
|
|
62
62
|
className: "header-title",
|
|
63
|
-
children: [C === "inlay" && ((u = t == null ? void 0 : t.data) == null ? void 0 : u.name), C === "float" && (
|
|
63
|
+
children: [C === "inlay" && ((u = t == null ? void 0 : t.data) == null ? void 0 : u.name), C === "float" && (o == null ? void 0 : o.name)]
|
|
64
64
|
}), (w == null ? void 0 : w.knowledges) && d.length !== 0 && /* @__PURE__ */ A(z, {
|
|
65
|
-
disabled: (n == null ? void 0 : n.
|
|
65
|
+
disabled: typeof (n == null ? void 0 : n.knowledges) == "object" && (n == null ? void 0 : n.knowledges.diabled) || !1,
|
|
66
66
|
checkedValues: r,
|
|
67
67
|
currKnowledgeList: d,
|
|
68
68
|
selectCount: E,
|
|
@@ -1,68 +1,95 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
/* empty css */import { CheckOutlined as
|
|
5
|
-
import { Collapse as
|
|
1
|
+
import { jsx as e, jsxs as n, Fragment as k } from "react/jsx-runtime";
|
|
2
|
+
import { useState as S } from "react";
|
|
3
|
+
import w from "../../assets/think.svg.mjs";
|
|
4
|
+
/* empty css */import { CheckOutlined as x, CloseOutlined as C } from "@ant-design/icons";
|
|
5
|
+
import { Collapse as g, Space as i } from "antd";
|
|
6
|
+
import I from "dayjs";
|
|
6
7
|
const {
|
|
7
|
-
Panel:
|
|
8
|
-
} =
|
|
9
|
-
var
|
|
8
|
+
Panel: v
|
|
9
|
+
} = g, M = (u) => {
|
|
10
|
+
var r, h, o, d, m, p;
|
|
10
11
|
const {
|
|
11
|
-
history:
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
history: a,
|
|
13
|
+
openTarget: N = "_blank",
|
|
14
|
+
container: l,
|
|
15
|
+
onShowList: c
|
|
16
|
+
} = u, [f, R] = S(!1), t = a.searchingStatus ? a.searchingStatus : (r = a.searchReference) != null && r.length ? "end" : "";
|
|
17
|
+
return t ? /* @__PURE__ */ e("div", {
|
|
14
18
|
className: "search-reference",
|
|
15
|
-
children: /* @__PURE__ */
|
|
19
|
+
children: /* @__PURE__ */ n("div", {
|
|
16
20
|
className: "item-bot-plugin",
|
|
17
21
|
onClick: () => {
|
|
18
|
-
|
|
22
|
+
R(!f);
|
|
19
23
|
},
|
|
20
|
-
children: [
|
|
24
|
+
children: [t === "start" && /* @__PURE__ */ n(k, {
|
|
21
25
|
children: [/* @__PURE__ */ e("img", {
|
|
22
|
-
src:
|
|
26
|
+
src: w,
|
|
23
27
|
alt: ""
|
|
24
28
|
}), /* @__PURE__ */ e("span", {
|
|
25
29
|
children: "正在搜索…"
|
|
26
30
|
})]
|
|
27
|
-
}),
|
|
31
|
+
}), t === "end" && /* @__PURE__ */ e(g, {
|
|
28
32
|
ghost: !0,
|
|
29
33
|
expandIconPosition: "right",
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
onChange: c && (() => {
|
|
35
|
+
t === "end" && c(a.searchReference, a.messageId);
|
|
36
|
+
}),
|
|
37
|
+
children: /* @__PURE__ */ e(v, {
|
|
38
|
+
collapsible: l ? "disabled" : "icon",
|
|
39
|
+
showArrow: !!(t === "end" && ((h = a.searchReference) != null && h.length)),
|
|
40
|
+
header: /* @__PURE__ */ n(i, {
|
|
34
41
|
size: 8,
|
|
35
42
|
style: {
|
|
36
43
|
width: "100%"
|
|
37
44
|
},
|
|
38
|
-
children: [/* @__PURE__ */
|
|
45
|
+
children: [/* @__PURE__ */ n("span", {
|
|
39
46
|
className: "bot-plugin-status",
|
|
40
|
-
children: [
|
|
47
|
+
children: [t === "end" && ((o = a.searchReference) == null ? void 0 : o.length) > 0 && /* @__PURE__ */ e("span", {
|
|
41
48
|
className: "plugin-status-success",
|
|
42
|
-
children: /* @__PURE__ */ e(k, {})
|
|
43
|
-
}), s === "end" && !((l = n.searchReference) != null && l.length) && /* @__PURE__ */ e("span", {
|
|
44
|
-
className: "plugin-status-error",
|
|
45
49
|
children: /* @__PURE__ */ e(x, {})
|
|
50
|
+
}), t === "end" && !((d = a.searchReference) != null && d.length) && /* @__PURE__ */ e("span", {
|
|
51
|
+
className: "plugin-status-error",
|
|
52
|
+
children: /* @__PURE__ */ e(C, {})
|
|
46
53
|
})]
|
|
47
|
-
}),
|
|
54
|
+
}), t === "end" && /* @__PURE__ */ e("span", {
|
|
48
55
|
className: "bot-plugin-title",
|
|
49
|
-
children: (
|
|
56
|
+
children: (m = a.searchReference) != null && m.length ? `已搜索到${a.searchReference.length}个网页` : "未找到搜索内容,请检查搜索服务"
|
|
50
57
|
})]
|
|
51
58
|
}),
|
|
52
|
-
children: /* @__PURE__ */ e("div", {
|
|
53
|
-
className: "
|
|
54
|
-
children: (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
children:
|
|
59
|
+
children: !l && /* @__PURE__ */ e("div", {
|
|
60
|
+
className: "search-reference-list",
|
|
61
|
+
children: (p = a.searchReference) == null ? void 0 : p.map((s, b) => /* @__PURE__ */ n(i, {
|
|
62
|
+
direction: "vertical",
|
|
63
|
+
className: "search-reference-list-item",
|
|
64
|
+
onClick: () => {
|
|
65
|
+
window.open(s.link, N);
|
|
66
|
+
},
|
|
67
|
+
size: 12,
|
|
68
|
+
children: [/* @__PURE__ */ n("span", {
|
|
69
|
+
className: "search-reference-list-item-title",
|
|
70
|
+
children: [/* @__PURE__ */ n("span", {
|
|
71
|
+
className: "number",
|
|
72
|
+
children: [b + 1, "."]
|
|
73
|
+
}), s.title]
|
|
74
|
+
}), s.snippet && /* @__PURE__ */ e("span", {
|
|
75
|
+
className: "search-reference-list-item-content",
|
|
76
|
+
children: s.snippet
|
|
77
|
+
}), /* @__PURE__ */ n("div", {
|
|
78
|
+
className: "search-reference-list-item-footer",
|
|
79
|
+
children: [/* @__PURE__ */ n(i, {
|
|
80
|
+
children: [(s == null ? void 0 : s.siteIcon) && /* @__PURE__ */ e("img", {
|
|
81
|
+
className: "logo",
|
|
82
|
+
src: s == null ? void 0 : s.siteIcon
|
|
83
|
+
}), /* @__PURE__ */ e("span", {
|
|
84
|
+
className: "name",
|
|
85
|
+
children: s.siteName
|
|
86
|
+
})]
|
|
87
|
+
}), /* @__PURE__ */ e("span", {
|
|
88
|
+
className: "time",
|
|
89
|
+
children: I(s.ts || s.datePublished).format("YYYY-MM-DD")
|
|
90
|
+
})]
|
|
64
91
|
})]
|
|
65
|
-
},
|
|
92
|
+
}, s.link))
|
|
66
93
|
})
|
|
67
94
|
}, "")
|
|
68
95
|
})]
|
|
@@ -70,5 +97,5 @@ const {
|
|
|
70
97
|
}) : null;
|
|
71
98
|
};
|
|
72
99
|
export {
|
|
73
|
-
|
|
100
|
+
M as default
|
|
74
101
|
};
|