@glodon-aiot/agent-cli-ui 3.3.2 → 3.3.4-beta.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 +121 -109
- package/dist/es/Dialog/AgentChat/HistoryItem/index.mjs +156 -142
- package/dist/es/Dialog/AgentChat/PromptSetting/index.mjs +83 -98
- package/dist/es/Dialog/AgentChat/index.mjs +330 -313
- package/dist/es/Dialog/SessionList/index.mjs +35 -34
- package/dist/es/Dialog/index.mjs +101 -94
- package/dist/es/ReactTextGenerationUI/components/TextSiders/index.mjs +394 -0
- package/dist/es/ReactTextGenerationUI/components/fetchEventSource/fetch.mjs +112 -0
- package/dist/es/ReactTextGenerationUI/components/fetchEventSource/parse.mjs +97 -0
- package/dist/es/ReactTextGenerationUI/index.mjs +81 -0
- package/dist/es/components/FilePreview/index.mjs +26 -25
- package/dist/es/index.mjs +402 -217
- package/dist/es/node_modules/moment/dist/moment.mjs +2301 -0
- package/dist/es/packages/agent-cli-ui/package.json.mjs +162 -0
- package/dist/es/packages/react-components/dist/es/components/Markdown/ATag/index.mjs +27 -25
- package/dist/es/packages/react-components/dist/es/components/Markdown/Image/index.mjs +29 -27
- package/dist/es/packages/react-components/dist/es/components/Markdown/index.mjs +58 -48
- package/dist/es/packages/react-components/dist/es/index.mjs +1 -1
- package/dist/es/src/style.css +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/style2.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/style23.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/style28.css +1 -1
- package/dist/es/src/style29.css +1 -1
- package/dist/es/src/style3.css +1 -1
- package/dist/es/src/style30.css +1 -0
- package/dist/es/src/style31.css +1 -0
- package/dist/es/src/style4.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/es/src/style9.css +1 -1
- package/dist/lib/index.css +1 -1
- package/dist/lib/index.js +69 -58
- package/dist/src/AgentClientUI.d.ts +10 -2
- package/dist/src/Dialog/AgentChat/HistoryItem/index.d.ts +2 -0
- package/dist/src/Dialog/SessionList/index.d.ts +1 -0
- package/dist/src/Dialog/index.d.ts +9 -1
- package/dist/src/index.d.ts +11 -2
- package/dist/src/types.d.ts +8 -3
- package/package.json +3 -3
|
@@ -1,143 +1,155 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var
|
|
10
|
-
|
|
1
|
+
var z = Object.defineProperty, ee = Object.defineProperties;
|
|
2
|
+
var te = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var y = Object.getOwnPropertySymbols;
|
|
4
|
+
var oe = Object.prototype.hasOwnProperty, ne = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var I = (n, t, e) => t in n ? z(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, f = (n, t) => {
|
|
6
|
+
for (var e in t || (t = {}))
|
|
7
|
+
oe.call(t, e) && I(n, e, t[e]);
|
|
8
|
+
if (y)
|
|
9
|
+
for (var e of y(t))
|
|
10
|
+
ne.call(t, e) && I(n, e, t[e]);
|
|
11
11
|
return n;
|
|
12
|
-
},
|
|
12
|
+
}, h = (n, t) => ee(n, te(t));
|
|
13
13
|
import { jsx as s, jsxs as x } from "react/jsx-runtime";
|
|
14
|
-
import { useRef as
|
|
15
|
-
/* empty css */import { AgentClientProvider as
|
|
16
|
-
import { Resizable as
|
|
17
|
-
import
|
|
18
|
-
import { configure as
|
|
19
|
-
import { JWT as
|
|
20
|
-
import { ConfigProvider as
|
|
21
|
-
import
|
|
22
|
-
const
|
|
14
|
+
import { forwardRef as ie, useRef as k, useState as d, useEffect as A, useImperativeHandle as se } from "react";
|
|
15
|
+
/* empty css */import { AgentClientProvider as le } from "./context.mjs";
|
|
16
|
+
import { Resizable as ae } from "react-resizable";
|
|
17
|
+
import re from "./Dialog/index.mjs";
|
|
18
|
+
import { configure as de, BotClient as me } from "@glodon-aiot/bot-client-sdk";
|
|
19
|
+
import { JWT as ce } from "./utils/index.mjs";
|
|
20
|
+
import { ConfigProvider as L, Spin as fe, Button as U } from "antd";
|
|
21
|
+
import he from "antd/es/locale/zh_CN";
|
|
22
|
+
const ke = ie((n, t) => {
|
|
23
23
|
const {
|
|
24
24
|
className: e,
|
|
25
|
-
triggerButton:
|
|
26
|
-
size:
|
|
27
|
-
theme:
|
|
28
|
-
icon:
|
|
29
|
-
docViewerUrl:
|
|
30
|
-
token:
|
|
31
|
-
debug:
|
|
32
|
-
env:
|
|
33
|
-
plugins:
|
|
34
|
-
mcp:
|
|
35
|
-
footer:
|
|
36
|
-
defaultInput:
|
|
37
|
-
onComment:
|
|
38
|
-
onSessionLoad:
|
|
39
|
-
onSessionUnload:
|
|
40
|
-
onMessage:
|
|
41
|
-
beforeMessageSend:
|
|
42
|
-
bodyStyle:
|
|
43
|
-
apiUrl:
|
|
44
|
-
sessionId:
|
|
45
|
-
disabled:
|
|
46
|
-
transform:
|
|
47
|
-
features:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
25
|
+
triggerButton: l,
|
|
26
|
+
size: o,
|
|
27
|
+
theme: $,
|
|
28
|
+
icon: g,
|
|
29
|
+
docViewerUrl: H,
|
|
30
|
+
token: m,
|
|
31
|
+
debug: W,
|
|
32
|
+
env: j,
|
|
33
|
+
plugins: M,
|
|
34
|
+
mcp: P,
|
|
35
|
+
footer: S,
|
|
36
|
+
defaultInput: T,
|
|
37
|
+
onComment: D,
|
|
38
|
+
onSessionLoad: E,
|
|
39
|
+
onSessionUnload: J,
|
|
40
|
+
onMessage: O,
|
|
41
|
+
beforeMessageSend: V,
|
|
42
|
+
bodyStyle: p,
|
|
43
|
+
apiUrl: q,
|
|
44
|
+
sessionId: F,
|
|
45
|
+
disabled: G,
|
|
46
|
+
transform: K,
|
|
47
|
+
features: Q,
|
|
48
|
+
stream: X
|
|
49
|
+
} = n, u = k(null), [Y, ge] = d(!1), [C, Z] = d(), [b, _] = d(), [i, w] = d(o), [v, N] = d(n.open), c = k(null);
|
|
50
|
+
A(() => {
|
|
51
|
+
if (!m)
|
|
51
52
|
return;
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
debug:
|
|
55
|
-
env:
|
|
56
|
-
apiRoot:
|
|
53
|
+
const a = ce(m);
|
|
54
|
+
Z(a.rid), de({
|
|
55
|
+
debug: W,
|
|
56
|
+
env: j,
|
|
57
|
+
apiRoot: q
|
|
57
58
|
});
|
|
58
|
-
const
|
|
59
|
-
plugins:
|
|
60
|
-
mcp:
|
|
59
|
+
const r = new me(m, {
|
|
60
|
+
plugins: M,
|
|
61
|
+
mcp: P,
|
|
62
|
+
stream: X
|
|
61
63
|
});
|
|
62
|
-
|
|
63
|
-
}, [
|
|
64
|
-
theme:
|
|
65
|
-
}),
|
|
66
|
-
|
|
67
|
-
}, [
|
|
68
|
-
const
|
|
69
|
-
element:
|
|
70
|
-
size:
|
|
64
|
+
_(r);
|
|
65
|
+
}, [m]), L.config({
|
|
66
|
+
theme: $
|
|
67
|
+
}), A(() => {
|
|
68
|
+
o && w(o);
|
|
69
|
+
}, [o]);
|
|
70
|
+
const B = (a, {
|
|
71
|
+
element: r,
|
|
72
|
+
size: R
|
|
71
73
|
}) => {
|
|
72
|
-
|
|
73
|
-
width: Number(
|
|
74
|
-
height:
|
|
74
|
+
w({
|
|
75
|
+
width: Number(R.width),
|
|
76
|
+
height: R.height
|
|
75
77
|
});
|
|
76
78
|
};
|
|
77
|
-
return
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
79
|
+
return se(t, () => ({
|
|
80
|
+
sessionCreate: (a) => {
|
|
81
|
+
var r;
|
|
82
|
+
return (r = c.current) == null ? void 0 : r.sessionCreate(a);
|
|
83
|
+
},
|
|
84
|
+
getSessionList: () => {
|
|
85
|
+
var a;
|
|
86
|
+
return (a = c.current) == null ? void 0 : a.getSessionList();
|
|
87
|
+
}
|
|
88
|
+
})), /* @__PURE__ */ s(L, {
|
|
89
|
+
locale: he,
|
|
90
|
+
children: /* @__PURE__ */ x(le, {
|
|
91
|
+
value: h(f({}, n), {
|
|
92
|
+
popupContainer: u,
|
|
93
|
+
agentClient: b,
|
|
94
|
+
footer: S,
|
|
95
|
+
defaultInput: T,
|
|
96
|
+
onComment: D,
|
|
97
|
+
onSessionLoad: E,
|
|
98
|
+
onSessionUnload: J,
|
|
99
|
+
onMessage: O,
|
|
100
|
+
beforeMessageSend: V,
|
|
101
|
+
bodyStyle: p,
|
|
102
|
+
disabled: G,
|
|
103
|
+
transform: K,
|
|
104
|
+
features: Q
|
|
94
105
|
}),
|
|
95
|
-
children: [/* @__PURE__ */ s(
|
|
96
|
-
height: i == null ? void 0 : i.height,
|
|
97
|
-
width: i == null ? void 0 : i.width,
|
|
106
|
+
children: [/* @__PURE__ */ s(ae, {
|
|
107
|
+
height: (i == null ? void 0 : i.height) || "100%",
|
|
108
|
+
width: (i == null ? void 0 : i.width) || "100%",
|
|
98
109
|
maxConstraints: [document.body.clientWidth - 45],
|
|
99
|
-
minConstraints: [Number(
|
|
100
|
-
onResize:
|
|
110
|
+
minConstraints: [Number(o == null ? void 0 : o.minWidth)],
|
|
111
|
+
onResize: B,
|
|
101
112
|
handle: /* @__PURE__ */ s("span", {
|
|
102
113
|
className: "resize-handle-ew"
|
|
103
114
|
}),
|
|
104
115
|
resizeHandles: e == "float" ? ["w"] : [],
|
|
105
116
|
children: /* @__PURE__ */ x("div", {
|
|
106
117
|
id: "dialog-modal",
|
|
107
|
-
className: `gbot-dialog-modal ${e} ${
|
|
108
|
-
style:
|
|
109
|
-
width: e == "float" ? i == null ? void 0 : i.width :
|
|
110
|
-
height: e === "float" ? i == null ? void 0 : i.height :
|
|
118
|
+
className: `gbot-dialog-modal ${e} ${v ? "opened" : "closed"}`,
|
|
119
|
+
style: h(f({}, o), {
|
|
120
|
+
width: e == "float" ? i == null ? void 0 : i.width : o == null ? void 0 : o.width,
|
|
121
|
+
height: e === "float" ? i == null ? void 0 : i.height : o == null ? void 0 : o.height,
|
|
111
122
|
maxHeight: "100vh"
|
|
112
123
|
}),
|
|
113
|
-
ref:
|
|
114
|
-
children: [
|
|
124
|
+
ref: u,
|
|
125
|
+
children: [Y ? /* @__PURE__ */ s("div", {
|
|
115
126
|
className: "loading",
|
|
116
|
-
children: /* @__PURE__ */ s(
|
|
117
|
-
}) :
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
127
|
+
children: /* @__PURE__ */ s(fe, {})
|
|
128
|
+
}) : C && b ? /* @__PURE__ */ s(re, {
|
|
129
|
+
ref: c,
|
|
130
|
+
appId: C,
|
|
131
|
+
docViewerUrl: H,
|
|
132
|
+
bodyStyle: p,
|
|
133
|
+
sessionId: F
|
|
134
|
+
}) : null, (l == null ? void 0 : l.visible) && /* @__PURE__ */ s(U, {
|
|
123
135
|
className: "trigger-btn close-btn",
|
|
124
136
|
icon: /* @__PURE__ */ s("img", {
|
|
125
|
-
src:
|
|
137
|
+
src: g
|
|
126
138
|
}),
|
|
127
|
-
onClick: () =>
|
|
139
|
+
onClick: () => N(!1)
|
|
128
140
|
})]
|
|
129
141
|
})
|
|
130
|
-
}), (
|
|
142
|
+
}), (l == null ? void 0 : l.visible) && !v && /* @__PURE__ */ s(U, {
|
|
131
143
|
className: `${e}-trigger-btn open-btn`,
|
|
132
|
-
style:
|
|
144
|
+
style: l.style,
|
|
133
145
|
icon: /* @__PURE__ */ s("img", {
|
|
134
|
-
src:
|
|
146
|
+
src: g
|
|
135
147
|
}),
|
|
136
|
-
onClick: () =>
|
|
148
|
+
onClick: () => N(!0)
|
|
137
149
|
})]
|
|
138
150
|
})
|
|
139
151
|
});
|
|
140
|
-
};
|
|
152
|
+
});
|
|
141
153
|
export {
|
|
142
|
-
|
|
154
|
+
ke as default
|
|
143
155
|
};
|