@glodon-aiot/agent-cli-ui 3.19.0-alpha.19 → 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/style17.css +1 -1
- package/dist/es/src/style18.css +1 -1
- package/dist/es/src/style19.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/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/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,130 +1,119 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var g = (L, d, s) => new Promise((y, e) => {
|
|
2
|
+
var a = (n) => {
|
|
3
3
|
try {
|
|
4
|
-
|
|
5
|
-
} catch (
|
|
6
|
-
e(
|
|
4
|
+
c(s.next(n));
|
|
5
|
+
} catch (m) {
|
|
6
|
+
e(m);
|
|
7
7
|
}
|
|
8
|
-
}, h = (
|
|
8
|
+
}, h = (n) => {
|
|
9
9
|
try {
|
|
10
|
-
|
|
11
|
-
} catch (
|
|
12
|
-
e(
|
|
10
|
+
c(s.throw(n));
|
|
11
|
+
} catch (m) {
|
|
12
|
+
e(m);
|
|
13
13
|
}
|
|
14
|
-
},
|
|
15
|
-
|
|
14
|
+
}, c = (n) => n.done ? y(n.value) : Promise.resolve(n.value).then(a, h);
|
|
15
|
+
c((s = s.apply(L, d)).next());
|
|
16
16
|
});
|
|
17
|
-
import { jsx as
|
|
18
|
-
import { useContext as
|
|
19
|
-
import { Drawer as
|
|
20
|
-
/* empty css */import { LoadingOutlined as
|
|
17
|
+
import { jsx as I } from "react/jsx-runtime";
|
|
18
|
+
import { useContext as O, useState as E, useRef as R, useEffect as b } from "react";
|
|
19
|
+
import { Drawer as j, Spin as v, message as w } from "antd";
|
|
20
|
+
/* empty css */import { LoadingOutlined as A } from "@ant-design/icons";
|
|
21
21
|
import B from "./SessionItem.mjs";
|
|
22
22
|
import H from "../../../../../context.mjs";
|
|
23
|
-
|
|
23
|
+
import { withAgentCliMessage as x } from "../../../../../utils/scopedMessage.mjs";
|
|
24
|
+
const Q = (L) => {
|
|
24
25
|
const {
|
|
25
|
-
currentSessionId:
|
|
26
|
-
onSessionChange:
|
|
27
|
-
onClose:
|
|
28
|
-
} =
|
|
26
|
+
currentSessionId: d,
|
|
27
|
+
onSessionChange: s,
|
|
28
|
+
onClose: y
|
|
29
|
+
} = L, {
|
|
29
30
|
agentClient: e,
|
|
30
|
-
popupContainer:
|
|
31
|
-
} =
|
|
32
|
-
|
|
33
|
-
o.current = [], l(o.current),
|
|
34
|
-
|
|
31
|
+
popupContainer: a
|
|
32
|
+
} = O(H), [h, c] = E(!1), [n, m] = E(!1), [C, T] = E(""), [f, l] = E([]), o = R(f);
|
|
33
|
+
b(() => {
|
|
34
|
+
o.current = [], l(o.current), c(!0), e == null || e.getSessions().then((t) => g(void 0, null, function* () {
|
|
35
|
+
c(!1), o.current = [...t], l(o.current);
|
|
35
36
|
}));
|
|
36
|
-
}, []),
|
|
37
|
-
|
|
37
|
+
}, []), b(() => {
|
|
38
|
+
f.length && d && setTimeout(() => {
|
|
38
39
|
var t;
|
|
39
|
-
(t = document.getElementById(
|
|
40
|
+
(t = document.getElementById(d)) == null || t.scrollIntoView(!0);
|
|
40
41
|
}, 100);
|
|
41
|
-
}, [
|
|
42
|
-
const
|
|
43
|
-
e == null || e.removeSession(t, !0).then(() =>
|
|
44
|
-
const
|
|
45
|
-
var
|
|
46
|
-
return ((
|
|
42
|
+
}, [f]);
|
|
43
|
+
const _ = (t, r) => {
|
|
44
|
+
e == null || e.removeSession(t, !0).then(() => g(void 0, null, function* () {
|
|
45
|
+
const i = f.filter((u) => {
|
|
46
|
+
var p, S;
|
|
47
|
+
return ((p = u.data) == null ? void 0 : p.id) !== ((S = t.data) == null ? void 0 : S.id);
|
|
47
48
|
});
|
|
48
|
-
t.data.id ===
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
})), s == null || s.stopPropagation();
|
|
56
|
-
}, T = (t) => {
|
|
57
|
-
t && (n && n(t.sessionId, t), x());
|
|
58
|
-
}, _ = (t, s) => b(void 0, null, function* () {
|
|
49
|
+
t.data.id === d && s && s("", null), x(a, () => {
|
|
50
|
+
w.success("删除成功");
|
|
51
|
+
}), o.current = [...i], l(o.current);
|
|
52
|
+
})), r == null || r.stopPropagation();
|
|
53
|
+
}, $ = (t) => {
|
|
54
|
+
t && (s && s(t.sessionId, t), y());
|
|
55
|
+
}, z = (t, r) => g(void 0, null, function* () {
|
|
59
56
|
try {
|
|
60
|
-
yield e == null ? void 0 : e.setTop(t.data.id,
|
|
61
|
-
|
|
62
|
-
prefixCls: "gbot-message"
|
|
63
|
-
}), d.success(`${s ? "" : "取消"}置顶成功`), d.config({
|
|
64
|
-
getContainer: void 0,
|
|
65
|
-
prefixCls: "gbot-message"
|
|
57
|
+
yield e == null ? void 0 : e.setTop(t.data.id, r), x(a, () => {
|
|
58
|
+
w.success(`${r ? "" : "取消"}置顶成功`);
|
|
66
59
|
});
|
|
67
|
-
} catch (
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
prefixCls: "gbot-message"
|
|
71
|
-
}), d.error(`${s ? "" : "取消"}置顶失败`), d.config({
|
|
72
|
-
getContainer: void 0,
|
|
73
|
-
prefixCls: "gbot-message"
|
|
60
|
+
} catch (i) {
|
|
61
|
+
x(a, () => {
|
|
62
|
+
w.error(`${r ? "" : "取消"}置顶失败`);
|
|
74
63
|
});
|
|
75
64
|
}
|
|
76
65
|
e == null || e.getSessions({
|
|
77
66
|
order: "top_time desc, sort_status desc, updated_at desc"
|
|
78
|
-
}).then((
|
|
79
|
-
o.current = [...
|
|
67
|
+
}).then((i) => g(void 0, null, function* () {
|
|
68
|
+
o.current = [...i], l(o.current);
|
|
80
69
|
}));
|
|
81
|
-
}),
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
var
|
|
85
|
-
return ((
|
|
70
|
+
}), D = (t, r) => {
|
|
71
|
+
r && (t.rename(r), t == null || t.addEventListener("data:updated", () => {
|
|
72
|
+
const i = o.current.map((u) => {
|
|
73
|
+
var p, S;
|
|
74
|
+
return ((p = u.data) == null ? void 0 : p.id) === ((S = u.data) == null ? void 0 : S.id), u;
|
|
86
75
|
});
|
|
87
|
-
o.current = [...
|
|
76
|
+
o.current = [...i], l(o.current);
|
|
88
77
|
}));
|
|
89
|
-
},
|
|
90
|
-
|
|
78
|
+
}, N = (t, r) => {
|
|
79
|
+
m(r), T(t);
|
|
91
80
|
};
|
|
92
|
-
return /* @__PURE__ */
|
|
81
|
+
return /* @__PURE__ */ I(j, {
|
|
93
82
|
title: "会话历史记录",
|
|
94
83
|
open: !0,
|
|
95
84
|
placement: "bottom",
|
|
96
|
-
onClose:
|
|
85
|
+
onClose: y,
|
|
97
86
|
className: `session-list-drawer ${h ? "loading-panel" : ""}`,
|
|
98
87
|
size: "large",
|
|
99
|
-
getContainer: () => (
|
|
88
|
+
getContainer: () => (a == null ? void 0 : a.current) || document.body,
|
|
100
89
|
destroyOnClose: !0,
|
|
101
90
|
style: {
|
|
102
91
|
position: "absolute"
|
|
103
92
|
},
|
|
104
|
-
children: h ? /* @__PURE__ */
|
|
105
|
-
indicator: /* @__PURE__ */
|
|
93
|
+
children: h ? /* @__PURE__ */ I(v, {
|
|
94
|
+
indicator: /* @__PURE__ */ I(A, {
|
|
106
95
|
style: {
|
|
107
96
|
fontSize: 24
|
|
108
97
|
},
|
|
109
98
|
spin: !0
|
|
110
99
|
})
|
|
111
|
-
}) :
|
|
112
|
-
var
|
|
113
|
-
return /* @__PURE__ */
|
|
100
|
+
}) : f.map((t, r) => {
|
|
101
|
+
var i;
|
|
102
|
+
return /* @__PURE__ */ I(B, {
|
|
114
103
|
session: t,
|
|
115
|
-
index:
|
|
116
|
-
currentSessionId:
|
|
117
|
-
onChangeSession:
|
|
118
|
-
onDelSession:
|
|
119
|
-
onTopSession:
|
|
120
|
-
onEditNameConfirm:
|
|
121
|
-
editSessionId:
|
|
122
|
-
isEdit:
|
|
123
|
-
onChangeEditStatus:
|
|
124
|
-
}, (
|
|
104
|
+
index: r,
|
|
105
|
+
currentSessionId: d,
|
|
106
|
+
onChangeSession: $,
|
|
107
|
+
onDelSession: _,
|
|
108
|
+
onTopSession: z,
|
|
109
|
+
onEditNameConfirm: D,
|
|
110
|
+
editSessionId: C,
|
|
111
|
+
isEdit: n,
|
|
112
|
+
onChangeEditStatus: N
|
|
113
|
+
}, (i = t.data) == null ? void 0 : i.id);
|
|
125
114
|
})
|
|
126
115
|
});
|
|
127
116
|
};
|
|
128
117
|
export {
|
|
129
|
-
|
|
118
|
+
Q as default
|
|
130
119
|
};
|