@glodon-aiot/agent-cli-ui 3.4.1-beta.1 β 3.4.1
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 +17 -23
- package/dist/es/Dialog/AgentChat/index.mjs +120 -122
- 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/style14.css +1 -1
- package/dist/es/src/style15.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/style23.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/style31.css +1 -1
- package/dist/es/src/style32.css +1 -1
- package/dist/es/src/style33.css +1 -1
- package/dist/es/src/style7.css +1 -1
- package/dist/es/src/style9.css +1 -1
- package/dist/lib/index.js +36 -36
- package/dist/src/Dialog/AgentChat/Tools/SessionHistoryDrawer/index.d.ts +0 -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,26 +1,22 @@
|
|
|
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
8
|
currentSession: e,
|
|
9
|
-
disabled:
|
|
9
|
+
disabled: y = !1,
|
|
10
10
|
application: m,
|
|
11
11
|
networkStatus: d,
|
|
12
12
|
setCurrentSession: f,
|
|
13
|
-
|
|
14
|
-
// π ζ°ε’
|
|
15
|
-
setSessions: p,
|
|
16
|
-
// π ζ°ε’
|
|
17
|
-
isSessionHistoryVisible: w,
|
|
13
|
+
isSessionHistoryVisible: S,
|
|
18
14
|
setIsSessionHistoryVisible: o,
|
|
19
|
-
onSessionChange:
|
|
15
|
+
onSessionChange: t
|
|
20
16
|
} = l, {
|
|
21
|
-
popupContainer:
|
|
22
|
-
} =
|
|
23
|
-
return /* @__PURE__ */
|
|
17
|
+
popupContainer: s
|
|
18
|
+
} = p(u);
|
|
19
|
+
return /* @__PURE__ */ n(c, {
|
|
24
20
|
title: "δΌθ―εε²",
|
|
25
21
|
open: !0,
|
|
26
22
|
placement: "bottom",
|
|
@@ -29,26 +25,24 @@ const z = (l) => {
|
|
|
29
25
|
},
|
|
30
26
|
className: "session-history-drawer",
|
|
31
27
|
size: "large",
|
|
32
|
-
getContainer: () => (
|
|
28
|
+
getContainer: () => (s == null ? void 0 : s.current) || document.body,
|
|
33
29
|
destroyOnClose: !0,
|
|
34
30
|
style: {
|
|
35
31
|
position: "absolute"
|
|
36
32
|
},
|
|
37
|
-
children: /* @__PURE__ */
|
|
33
|
+
children: /* @__PURE__ */ n(C, {
|
|
38
34
|
isShowHeader: !1,
|
|
39
35
|
application: m,
|
|
40
36
|
networkStatus: d,
|
|
41
37
|
currentSession: e,
|
|
42
38
|
setCurrentSession: f,
|
|
43
|
-
sessions: c,
|
|
44
|
-
setSessions: p,
|
|
45
39
|
afterSessionClick: (r) => {
|
|
46
|
-
var i,
|
|
47
|
-
((i = r.data) == null ? void 0 : i.id) !== ((
|
|
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));
|
|
48
42
|
}
|
|
49
43
|
})
|
|
50
44
|
});
|
|
51
45
|
};
|
|
52
46
|
export {
|
|
53
|
-
|
|
47
|
+
V as default
|
|
54
48
|
};
|