@glodon-aiot/agent-cli-ui 3.4.0-alpha.2 → 3.4.0-alpha.3
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/index.mjs +362 -355
- package/dist/es/Dialog/SessionList/index.mjs +1 -1
- 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/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/style18.css +1 -1
- package/dist/es/src/style19.css +1 -1
- package/dist/es/src/style21.css +1 -1
- package/dist/es/src/style22.css +1 -1
- package/dist/es/src/style23.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/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.js +56 -56
- package/dist/src/AgentClientUI.d.ts +1 -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
|
};
|