@glodon-aiot/agent-cli-ui 3.4.0-alpha.2 → 3.4.0-alpha.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/AgentClientUI.mjs +59 -54
- package/dist/es/Dialog/AgentChat/Tools/SessionHistoryDrawer/index.mjs +45 -66
- package/dist/es/Dialog/AgentChat/index.mjs +415 -382
- package/dist/es/Dialog/SessionList/index.mjs +144 -143
- package/dist/es/Dialog/index.mjs +99 -93
- package/dist/es/QuillEditor/index.mjs +19 -17
- package/dist/es/index.mjs +97 -97
- 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/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 +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/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/lib/index.css +1 -1
- package/dist/lib/index.js +56 -56
- package/dist/src/AgentClientUI.d.ts +1 -0
- package/dist/src/Dialog/AgentChat/Tools/SessionHistoryDrawer/index.d.ts +2 -0
- package/dist/src/Dialog/AgentChat/index.d.ts +4 -1
- package/dist/src/Dialog/index.d.ts +1 -0
- package/dist/src/QuillEditor/index.d.ts +1 -0
- package/package.json +3 -3
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
var
|
|
1
|
+
var K = Object.defineProperty, Q = Object.defineProperties;
|
|
2
2
|
var X = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var
|
|
3
|
+
var x = Object.getOwnPropertySymbols;
|
|
4
4
|
var Y = Object.prototype.hasOwnProperty, Z = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var
|
|
5
|
+
var y = (o, t, e) => t in o ? K(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e, f = (o, t) => {
|
|
6
6
|
for (var e in t || (t = {}))
|
|
7
|
-
Y.call(t, e) &&
|
|
8
|
-
if (
|
|
9
|
-
for (var e of
|
|
10
|
-
Z.call(t, e) &&
|
|
7
|
+
Y.call(t, e) && y(o, e, t[e]);
|
|
8
|
+
if (x)
|
|
9
|
+
for (var e of x(t))
|
|
10
|
+
Z.call(t, e) && y(o, e, t[e]);
|
|
11
11
|
return o;
|
|
12
|
-
}, g = (o, t) =>
|
|
13
|
-
import { jsx as s, jsxs as
|
|
14
|
-
import { forwardRef as _, useRef as U, useState as
|
|
12
|
+
}, g = (o, t) => Q(o, X(t));
|
|
13
|
+
import { jsx as s, jsxs as R } from "react/jsx-runtime";
|
|
14
|
+
import { forwardRef as _, useRef as U, useState as m, useEffect as k, useImperativeHandle as B } from "react";
|
|
15
15
|
/* empty css */import { AgentClientProvider as z } from "./context.mjs";
|
|
16
16
|
import { Resizable as ee } from "react-resizable";
|
|
17
17
|
import te from "./Dialog/index.mjs";
|
|
18
18
|
import { ConfigProvider as A, Spin as ne, Button as L } from "antd";
|
|
19
19
|
import oe from "antd/es/locale/zh_CN";
|
|
20
|
-
const
|
|
20
|
+
const Ie = _((o, t) => {
|
|
21
21
|
const {
|
|
22
22
|
className: e,
|
|
23
|
-
triggerButton:
|
|
23
|
+
triggerButton: a,
|
|
24
24
|
size: n,
|
|
25
25
|
theme: S,
|
|
26
26
|
icon: p,
|
|
@@ -29,78 +29,83 @@ const Ne = _((o, t) => {
|
|
|
29
29
|
debug: se,
|
|
30
30
|
env: le,
|
|
31
31
|
plugins: ae,
|
|
32
|
-
mcp:
|
|
32
|
+
mcp: re,
|
|
33
33
|
footer: H,
|
|
34
34
|
defaultInput: j,
|
|
35
35
|
onComment: M,
|
|
36
36
|
onSessionLoad: P,
|
|
37
|
-
onSessionUnload:
|
|
38
|
-
onMessage:
|
|
39
|
-
beforeMessageSend:
|
|
37
|
+
onSessionUnload: T,
|
|
38
|
+
onMessage: W,
|
|
39
|
+
beforeMessageSend: D,
|
|
40
40
|
bodyStyle: u,
|
|
41
|
-
apiUrl:
|
|
42
|
-
sessionId:
|
|
43
|
-
disabled:
|
|
44
|
-
transform:
|
|
45
|
-
features:
|
|
41
|
+
apiUrl: de,
|
|
42
|
+
sessionId: E,
|
|
43
|
+
disabled: O,
|
|
44
|
+
transform: V,
|
|
45
|
+
features: q,
|
|
46
46
|
stream: me,
|
|
47
|
-
agentClient:
|
|
48
|
-
application:
|
|
49
|
-
} = o, b = U(null), [
|
|
47
|
+
agentClient: c,
|
|
48
|
+
application: r
|
|
49
|
+
} = o, b = U(null), [F, ce] = m(!1), [C, G] = m(), [i, v] = m(n), [w, I] = m(o.open), d = U(null);
|
|
50
50
|
k(() => {
|
|
51
|
-
|
|
52
|
-
}, [
|
|
51
|
+
r && (console.log("[AgentClientUI] token", c, r), G(r.id));
|
|
52
|
+
}, [r]), A.config({
|
|
53
53
|
theme: S
|
|
54
54
|
}), k(() => {
|
|
55
55
|
n && v(n);
|
|
56
56
|
}, [n]);
|
|
57
|
-
const
|
|
57
|
+
const J = (l, {
|
|
58
58
|
element: h,
|
|
59
|
-
size:
|
|
59
|
+
size: N
|
|
60
60
|
}) => {
|
|
61
61
|
v({
|
|
62
|
-
width: Number(
|
|
63
|
-
height:
|
|
62
|
+
width: Number(N.width),
|
|
63
|
+
height: N.height
|
|
64
64
|
});
|
|
65
65
|
};
|
|
66
66
|
return B(t, () => ({
|
|
67
|
-
createSession: (
|
|
67
|
+
createSession: (l) => {
|
|
68
68
|
var h;
|
|
69
|
-
return (h =
|
|
69
|
+
return (h = d.current) == null ? void 0 : h.createSession(l);
|
|
70
70
|
},
|
|
71
71
|
getSessionList: () => {
|
|
72
|
-
var
|
|
73
|
-
return (
|
|
72
|
+
var l;
|
|
73
|
+
return (l = d.current) == null ? void 0 : l.getSessionList();
|
|
74
|
+
},
|
|
75
|
+
// 新增:获取当前输入框内容
|
|
76
|
+
getCurrentInputText: () => {
|
|
77
|
+
var l;
|
|
78
|
+
return (l = d.current) == null ? void 0 : l.getCurrentInputText();
|
|
74
79
|
}
|
|
75
80
|
})), /* @__PURE__ */ s(A, {
|
|
76
81
|
locale: oe,
|
|
77
|
-
children: /* @__PURE__ */
|
|
82
|
+
children: /* @__PURE__ */ R(z, {
|
|
78
83
|
value: g(f({}, o), {
|
|
79
84
|
popupContainer: b,
|
|
80
|
-
agentClient:
|
|
85
|
+
agentClient: c,
|
|
81
86
|
footer: H,
|
|
82
87
|
defaultInput: j,
|
|
83
88
|
onComment: M,
|
|
84
89
|
onSessionLoad: P,
|
|
85
|
-
onSessionUnload:
|
|
86
|
-
onMessage:
|
|
87
|
-
beforeMessageSend:
|
|
90
|
+
onSessionUnload: T,
|
|
91
|
+
onMessage: W,
|
|
92
|
+
beforeMessageSend: D,
|
|
88
93
|
bodyStyle: u,
|
|
89
|
-
disabled:
|
|
90
|
-
transform:
|
|
91
|
-
features:
|
|
94
|
+
disabled: O,
|
|
95
|
+
transform: V,
|
|
96
|
+
features: q
|
|
92
97
|
}),
|
|
93
98
|
children: [/* @__PURE__ */ s(ee, {
|
|
94
99
|
height: (i == null ? void 0 : i.height) || "100%",
|
|
95
100
|
width: (i == null ? void 0 : i.width) || "100%",
|
|
96
101
|
maxConstraints: [document.body.clientWidth - 45],
|
|
97
102
|
minConstraints: [Number(n == null ? void 0 : n.minWidth)],
|
|
98
|
-
onResize:
|
|
103
|
+
onResize: J,
|
|
99
104
|
handle: /* @__PURE__ */ s("span", {
|
|
100
105
|
className: "resize-handle-ew"
|
|
101
106
|
}),
|
|
102
107
|
resizeHandles: e == "float" ? ["w"] : [],
|
|
103
|
-
children: /* @__PURE__ */
|
|
108
|
+
children: /* @__PURE__ */ R("div", {
|
|
104
109
|
id: "dialog-modal",
|
|
105
110
|
className: `gbot-dialog-modal ${e} ${w ? "opened" : "closed"}`,
|
|
106
111
|
style: g(f({}, n), {
|
|
@@ -109,34 +114,34 @@ const Ne = _((o, t) => {
|
|
|
109
114
|
maxHeight: "100vh"
|
|
110
115
|
}),
|
|
111
116
|
ref: b,
|
|
112
|
-
children: [
|
|
117
|
+
children: [F ? /* @__PURE__ */ s("div", {
|
|
113
118
|
className: "loading",
|
|
114
119
|
children: /* @__PURE__ */ s(ne, {})
|
|
115
|
-
}) : C &&
|
|
116
|
-
ref:
|
|
120
|
+
}) : C && c ? /* @__PURE__ */ s(te, {
|
|
121
|
+
ref: d,
|
|
117
122
|
appId: C,
|
|
118
123
|
docViewerUrl: $,
|
|
119
124
|
bodyStyle: u,
|
|
120
|
-
sessionId:
|
|
121
|
-
}) : null, (
|
|
125
|
+
sessionId: E
|
|
126
|
+
}) : null, (a == null ? void 0 : a.visible) && /* @__PURE__ */ s(L, {
|
|
122
127
|
className: "trigger-btn close-btn",
|
|
123
128
|
icon: /* @__PURE__ */ s("img", {
|
|
124
129
|
src: p
|
|
125
130
|
}),
|
|
126
|
-
onClick: () =>
|
|
131
|
+
onClick: () => I(!1)
|
|
127
132
|
})]
|
|
128
133
|
})
|
|
129
|
-
}), (
|
|
134
|
+
}), (a == null ? void 0 : a.visible) && !w && /* @__PURE__ */ s(L, {
|
|
130
135
|
className: `${e}-trigger-btn open-btn`,
|
|
131
|
-
style:
|
|
136
|
+
style: a.style,
|
|
132
137
|
icon: /* @__PURE__ */ s("img", {
|
|
133
138
|
src: p
|
|
134
139
|
}),
|
|
135
|
-
onClick: () =>
|
|
140
|
+
onClick: () => I(!0)
|
|
136
141
|
})]
|
|
137
142
|
})
|
|
138
143
|
});
|
|
139
144
|
});
|
|
140
145
|
export {
|
|
141
|
-
|
|
146
|
+
Ie as default
|
|
142
147
|
};
|
|
@@ -1,74 +1,53 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
/* empty css */import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
const V = (a) => {
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Drawer as p } from "antd";
|
|
3
|
+
import { useContext as u } from "react";
|
|
4
|
+
/* empty css */import C from "../../../../context.mjs";
|
|
5
|
+
import S from "../../../../components/Sider/index.mjs";
|
|
6
|
+
const j = (n) => {
|
|
8
7
|
const {
|
|
9
8
|
currentSession: s,
|
|
10
|
-
disabled:
|
|
11
|
-
application:
|
|
12
|
-
networkStatus:
|
|
13
|
-
setCurrentSession:
|
|
14
|
-
sessions:
|
|
9
|
+
disabled: y = !1,
|
|
10
|
+
application: a,
|
|
11
|
+
networkStatus: l,
|
|
12
|
+
setCurrentSession: m,
|
|
13
|
+
sessions: d,
|
|
15
14
|
// 👈 新增
|
|
16
|
-
setSessions: f
|
|
15
|
+
setSessions: f,
|
|
17
16
|
// 👈 新增
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
size: "large",
|
|
51
|
-
getContainer: () => (o == null ? void 0 : o.current) || document.body,
|
|
52
|
-
destroyOnClose: !0,
|
|
53
|
-
style: {
|
|
54
|
-
position: "absolute"
|
|
55
|
-
},
|
|
56
|
-
children: /* @__PURE__ */ e(v, {
|
|
57
|
-
isShowHeader: !1,
|
|
58
|
-
application: c,
|
|
59
|
-
networkStatus: m,
|
|
60
|
-
currentSession: s,
|
|
61
|
-
setCurrentSession: d,
|
|
62
|
-
sessions: p,
|
|
63
|
-
setSessions: f,
|
|
64
|
-
afterSessionClick: (i) => {
|
|
65
|
-
var r, n;
|
|
66
|
-
((r = i.data) == null ? void 0 : r.id) !== ((n = s == null ? void 0 : s.data) == null ? void 0 : n.id) && t(!1);
|
|
67
|
-
}
|
|
68
|
-
})
|
|
69
|
-
})]
|
|
17
|
+
isSessionHistoryVisible: b,
|
|
18
|
+
setIsSessionHistoryVisible: t
|
|
19
|
+
} = n, {
|
|
20
|
+
popupContainer: e
|
|
21
|
+
} = u(C);
|
|
22
|
+
return /* @__PURE__ */ r(p, {
|
|
23
|
+
title: "会话历史",
|
|
24
|
+
open: !0,
|
|
25
|
+
placement: "bottom",
|
|
26
|
+
onClose: () => {
|
|
27
|
+
t(!1);
|
|
28
|
+
},
|
|
29
|
+
className: "session-history-drawer",
|
|
30
|
+
size: "large",
|
|
31
|
+
getContainer: () => (e == null ? void 0 : e.current) || document.body,
|
|
32
|
+
destroyOnClose: !0,
|
|
33
|
+
style: {
|
|
34
|
+
position: "absolute"
|
|
35
|
+
},
|
|
36
|
+
children: /* @__PURE__ */ r(S, {
|
|
37
|
+
isShowHeader: !1,
|
|
38
|
+
application: a,
|
|
39
|
+
networkStatus: l,
|
|
40
|
+
currentSession: s,
|
|
41
|
+
setCurrentSession: m,
|
|
42
|
+
sessions: d,
|
|
43
|
+
setSessions: f,
|
|
44
|
+
afterSessionClick: (c) => {
|
|
45
|
+
var o, i;
|
|
46
|
+
((o = c.data) == null ? void 0 : o.id) !== ((i = s == null ? void 0 : s.data) == null ? void 0 : i.id) && t(!1);
|
|
47
|
+
}
|
|
48
|
+
})
|
|
70
49
|
});
|
|
71
50
|
};
|
|
72
51
|
export {
|
|
73
|
-
|
|
52
|
+
j as default
|
|
74
53
|
};
|