@glodon-aiot/agent-cli-ui 3.4.0 β 3.4.1-beta.2
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 +41 -38
- package/dist/es/Dialog/AgentChat/Tools/SessionHistoryDrawer/index.mjs +28 -33
- package/dist/es/Dialog/AgentChat/index.mjs +185 -180
- package/dist/es/Dialog/SessionList/index.mjs +94 -94
- package/dist/es/Dialog/index.mjs +107 -102
- package/dist/es/context/SessionContext.mjs +26 -0
- package/dist/es/hooks/useSessionState.mjs +6 -0
- 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/style15.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/style21.css +1 -1
- package/dist/es/src/style24.css +1 -1
- package/dist/es/src/style25.css +1 -1
- package/dist/es/src/style30.css +1 -1
- package/dist/es/src/style32.css +1 -1
- package/dist/es/src/style4.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 +56 -56
- package/dist/src/Dialog/AgentChat/Tools/SessionHistoryDrawer/index.d.ts +1 -2
- package/dist/src/Dialog/AgentChat/index.d.ts +0 -2
- package/dist/src/Dialog/SessionList/index.d.ts +0 -2
- package/dist/src/context/SessionContext.d.ts +15 -0
- package/dist/src/hooks/useSessionState.d.ts +7 -0
- package/package.json +3 -3
|
@@ -11,47 +11,48 @@ var y = (o, t, e) => t in o ? K(o, t, { enumerable: !0, configurable: !0, writab
|
|
|
11
11
|
return o;
|
|
12
12
|
}, g = (o, t) => Q(o, X(t));
|
|
13
13
|
import { jsx as s, jsxs as R } from "react/jsx-runtime";
|
|
14
|
-
import { forwardRef as _, useRef as
|
|
14
|
+
import { forwardRef as _, useRef as S, useState as m, useEffect as U, 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
|
-
import {
|
|
19
|
-
import oe from "antd
|
|
20
|
-
|
|
18
|
+
import { SessionProvider as ne } from "./context/SessionContext.mjs";
|
|
19
|
+
import { ConfigProvider as k, Spin as oe, Button as A } from "antd";
|
|
20
|
+
import ie from "antd/es/locale/zh_CN";
|
|
21
|
+
const xe = _((o, t) => {
|
|
21
22
|
const {
|
|
22
23
|
className: e,
|
|
23
|
-
triggerButton:
|
|
24
|
+
triggerButton: r,
|
|
24
25
|
size: n,
|
|
25
|
-
theme:
|
|
26
|
+
theme: L,
|
|
26
27
|
icon: p,
|
|
27
28
|
docViewerUrl: $,
|
|
28
|
-
token:
|
|
29
|
-
debug:
|
|
30
|
-
env:
|
|
29
|
+
token: se,
|
|
30
|
+
debug: le,
|
|
31
|
+
env: re,
|
|
31
32
|
plugins: ae,
|
|
32
|
-
mcp:
|
|
33
|
+
mcp: de,
|
|
33
34
|
footer: H,
|
|
34
|
-
defaultInput:
|
|
35
|
-
onComment:
|
|
36
|
-
onSessionLoad:
|
|
35
|
+
defaultInput: P,
|
|
36
|
+
onComment: j,
|
|
37
|
+
onSessionLoad: M,
|
|
37
38
|
onSessionUnload: T,
|
|
38
39
|
onMessage: W,
|
|
39
40
|
beforeMessageSend: D,
|
|
40
41
|
bodyStyle: u,
|
|
41
|
-
apiUrl:
|
|
42
|
+
apiUrl: me,
|
|
42
43
|
sessionId: E,
|
|
43
44
|
disabled: O,
|
|
44
45
|
transform: V,
|
|
45
46
|
features: q,
|
|
46
|
-
stream:
|
|
47
|
+
stream: ce,
|
|
47
48
|
agentClient: c,
|
|
48
|
-
application:
|
|
49
|
-
} = o, b =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}, [
|
|
53
|
-
theme:
|
|
54
|
-
}),
|
|
49
|
+
application: a
|
|
50
|
+
} = o, b = S(null), [F, he] = m(!1), [C, G] = m(), [i, v] = m(n), [w, I] = m(o.open), d = S(null);
|
|
51
|
+
U(() => {
|
|
52
|
+
a && (console.log("[AgentClientUI] token", c, a), G(a.id));
|
|
53
|
+
}, [a]), k.config({
|
|
54
|
+
theme: L
|
|
55
|
+
}), U(() => {
|
|
55
56
|
n && v(n);
|
|
56
57
|
}, [n]);
|
|
57
58
|
const J = (l, {
|
|
@@ -77,16 +78,16 @@ const Ie = _((o, t) => {
|
|
|
77
78
|
var l;
|
|
78
79
|
return (l = d.current) == null ? void 0 : l.getCurrentInputText();
|
|
79
80
|
}
|
|
80
|
-
})), /* @__PURE__ */ s(
|
|
81
|
-
locale:
|
|
81
|
+
})), /* @__PURE__ */ s(k, {
|
|
82
|
+
locale: ie,
|
|
82
83
|
children: /* @__PURE__ */ R(z, {
|
|
83
84
|
value: g(f({}, o), {
|
|
84
85
|
popupContainer: b,
|
|
85
86
|
agentClient: c,
|
|
86
87
|
footer: H,
|
|
87
|
-
defaultInput:
|
|
88
|
-
onComment:
|
|
89
|
-
onSessionLoad:
|
|
88
|
+
defaultInput: P,
|
|
89
|
+
onComment: j,
|
|
90
|
+
onSessionLoad: M,
|
|
90
91
|
onSessionUnload: T,
|
|
91
92
|
onMessage: W,
|
|
92
93
|
beforeMessageSend: D,
|
|
@@ -116,14 +117,16 @@ const Ie = _((o, t) => {
|
|
|
116
117
|
ref: b,
|
|
117
118
|
children: [F ? /* @__PURE__ */ s("div", {
|
|
118
119
|
className: "loading",
|
|
119
|
-
children: /* @__PURE__ */ s(
|
|
120
|
-
}) : C && c ? /* @__PURE__ */ s(
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
120
|
+
children: /* @__PURE__ */ s(oe, {})
|
|
121
|
+
}) : C && c ? /* @__PURE__ */ s(ne, {
|
|
122
|
+
children: /* @__PURE__ */ s(te, {
|
|
123
|
+
ref: d,
|
|
124
|
+
appId: C,
|
|
125
|
+
docViewerUrl: $,
|
|
126
|
+
bodyStyle: u,
|
|
127
|
+
sessionId: E
|
|
128
|
+
})
|
|
129
|
+
}) : null, (r == null ? void 0 : r.visible) && /* @__PURE__ */ s(A, {
|
|
127
130
|
className: "trigger-btn close-btn",
|
|
128
131
|
icon: /* @__PURE__ */ s("img", {
|
|
129
132
|
src: p
|
|
@@ -131,9 +134,9 @@ const Ie = _((o, t) => {
|
|
|
131
134
|
onClick: () => I(!1)
|
|
132
135
|
})]
|
|
133
136
|
})
|
|
134
|
-
}), (
|
|
137
|
+
}), (r == null ? void 0 : r.visible) && !w && /* @__PURE__ */ s(A, {
|
|
135
138
|
className: `${e}-trigger-btn open-btn`,
|
|
136
|
-
style:
|
|
139
|
+
style: r.style,
|
|
137
140
|
icon: /* @__PURE__ */ s("img", {
|
|
138
141
|
src: p
|
|
139
142
|
}),
|
|
@@ -143,5 +146,5 @@ const Ie = _((o, t) => {
|
|
|
143
146
|
});
|
|
144
147
|
});
|
|
145
148
|
export {
|
|
146
|
-
|
|
149
|
+
xe as default
|
|
147
150
|
};
|
|
@@ -1,53 +1,48 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Drawer as
|
|
3
|
-
import { useContext as
|
|
4
|
-
/* empty css */import
|
|
5
|
-
import
|
|
6
|
-
const
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { Drawer as c } from "antd";
|
|
3
|
+
import { useContext as p } from "react";
|
|
4
|
+
/* empty css */import u from "../../../../context.mjs";
|
|
5
|
+
import C from "../../../../components/Sider/index.mjs";
|
|
6
|
+
const V = (l) => {
|
|
7
7
|
const {
|
|
8
|
-
currentSession:
|
|
8
|
+
currentSession: e,
|
|
9
9
|
disabled: y = !1,
|
|
10
|
-
application:
|
|
11
|
-
networkStatus:
|
|
12
|
-
setCurrentSession:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
popupContainer: e
|
|
21
|
-
} = u(C);
|
|
22
|
-
return /* @__PURE__ */ r(p, {
|
|
10
|
+
application: m,
|
|
11
|
+
networkStatus: d,
|
|
12
|
+
setCurrentSession: f,
|
|
13
|
+
isSessionHistoryVisible: S,
|
|
14
|
+
setIsSessionHistoryVisible: o,
|
|
15
|
+
onSessionChange: t
|
|
16
|
+
} = l, {
|
|
17
|
+
popupContainer: s
|
|
18
|
+
} = p(u);
|
|
19
|
+
return /* @__PURE__ */ n(c, {
|
|
23
20
|
title: "δΌθ―εε²",
|
|
24
21
|
open: !0,
|
|
25
22
|
placement: "bottom",
|
|
26
23
|
onClose: () => {
|
|
27
|
-
|
|
24
|
+
o(!1);
|
|
28
25
|
},
|
|
29
26
|
className: "session-history-drawer",
|
|
30
27
|
size: "large",
|
|
31
|
-
getContainer: () => (
|
|
28
|
+
getContainer: () => (s == null ? void 0 : s.current) || document.body,
|
|
32
29
|
destroyOnClose: !0,
|
|
33
30
|
style: {
|
|
34
31
|
position: "absolute"
|
|
35
32
|
},
|
|
36
|
-
children: /* @__PURE__ */
|
|
33
|
+
children: /* @__PURE__ */ n(C, {
|
|
37
34
|
isShowHeader: !1,
|
|
38
|
-
application:
|
|
39
|
-
networkStatus:
|
|
40
|
-
currentSession:
|
|
41
|
-
setCurrentSession:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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);
|
|
35
|
+
application: m,
|
|
36
|
+
networkStatus: d,
|
|
37
|
+
currentSession: e,
|
|
38
|
+
setCurrentSession: f,
|
|
39
|
+
afterSessionClick: (r) => {
|
|
40
|
+
var i, a;
|
|
41
|
+
((i = r.data) == null ? void 0 : i.id) !== ((a = e == null ? void 0 : e.data) == null ? void 0 : a.id) && (o(!1), t == null || t(r));
|
|
47
42
|
}
|
|
48
43
|
})
|
|
49
44
|
});
|
|
50
45
|
};
|
|
51
46
|
export {
|
|
52
|
-
|
|
47
|
+
V as default
|
|
53
48
|
};
|