@glodon-aiot/agent-cli-ui 3.3.7-beta.2 → 3.3.8
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 +107 -94
- package/dist/es/Dialog/AgentChat/HistoryItem/SessionRefer/index.mjs +46 -59
- package/dist/es/Dialog/AgentChat/HistoryItem/index.mjs +46 -47
- package/dist/es/Dialog/AgentChat/index.mjs +378 -376
- package/dist/es/Dialog/SessionList/index.mjs +115 -119
- package/dist/es/Dialog/index.mjs +26 -30
- package/dist/es/QuillEditor/index.mjs +59 -70
- package/dist/es/components/Recommend/index.mjs +34 -52
- package/dist/es/constant.mjs +3 -11
- package/dist/es/index.mjs +293 -285
- package/dist/es/packages/agent-cli-ui/package.json.mjs +17 -19
- 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/style22.css +1 -1
- package/dist/es/src/style24.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/style30.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 +54 -54
- package/dist/src/AgentClientUI.d.ts +1 -1
- package/dist/src/Dialog/AgentChat/HistoryItem/SessionRefer/index.d.ts +0 -2
- package/dist/src/Dialog/index.d.ts +1 -1
- package/dist/src/Footer/index.d.ts +1 -2
- package/dist/src/QuillEditor/index.d.ts +1 -1
- package/dist/src/components/Greeting/index.d.ts +1 -2
- package/dist/src/components/Header/index.d.ts +1 -2
- package/dist/src/components/Recommend/index.d.ts +0 -1
- package/dist/src/constant.d.ts +0 -4
- package/dist/src/index.d.ts +1 -5
- package/dist/src/types.d.ts +2 -3
- package/dist/src/utils/antdConfig.d.ts +7 -0
- package/dist/src/utils/testAntdPrefix.d.ts +3 -0
- package/package.json +11 -13
|
@@ -1,136 +1,149 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var z = Object.defineProperty, ee = Object.defineProperties;
|
|
2
|
+
var te = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var y = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var
|
|
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
6
|
for (var e in t || (t = {}))
|
|
7
|
-
|
|
7
|
+
oe.call(t, e) && I(n, e, t[e]);
|
|
8
8
|
if (y)
|
|
9
9
|
for (var e of y(t))
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
10
|
+
ne.call(t, e) && I(n, e, t[e]);
|
|
11
|
+
return n;
|
|
12
|
+
}, h = (n, t) => ee(n, te(t));
|
|
13
13
|
import { jsx as s, jsxs as x } from "react/jsx-runtime";
|
|
14
|
-
import { forwardRef as
|
|
15
|
-
/* empty css */import { AgentClientProvider as
|
|
16
|
-
import { Resizable as
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import
|
|
20
|
-
|
|
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) => {
|
|
21
23
|
const {
|
|
22
24
|
className: e,
|
|
23
25
|
triggerButton: l,
|
|
24
|
-
size:
|
|
25
|
-
theme:
|
|
26
|
-
icon:
|
|
27
|
-
docViewerUrl:
|
|
28
|
-
token:
|
|
29
|
-
debug:
|
|
30
|
-
env:
|
|
31
|
-
plugins:
|
|
32
|
-
mcp:
|
|
33
|
-
footer:
|
|
34
|
-
defaultInput:
|
|
35
|
-
onComment:
|
|
36
|
-
onSessionLoad:
|
|
37
|
-
onSessionUnload:
|
|
38
|
-
onMessage:
|
|
39
|
-
beforeMessageSend:
|
|
40
|
-
bodyStyle:
|
|
41
|
-
apiUrl:
|
|
42
|
-
sessionId:
|
|
43
|
-
disabled:
|
|
44
|
-
transform:
|
|
45
|
-
features:
|
|
46
|
-
stream:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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)
|
|
52
|
+
return;
|
|
53
|
+
const a = ce(m);
|
|
54
|
+
Z(a.rid), de({
|
|
55
|
+
debug: W,
|
|
56
|
+
env: j,
|
|
57
|
+
apiRoot: q
|
|
58
|
+
});
|
|
59
|
+
const r = new me(m, {
|
|
60
|
+
plugins: M,
|
|
61
|
+
mcp: P,
|
|
62
|
+
stream: X
|
|
63
|
+
});
|
|
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
|
|
60
73
|
}) => {
|
|
61
|
-
|
|
62
|
-
width: Number(
|
|
63
|
-
height:
|
|
74
|
+
w({
|
|
75
|
+
width: Number(R.width),
|
|
76
|
+
height: R.height
|
|
64
77
|
});
|
|
65
78
|
};
|
|
66
|
-
return
|
|
67
|
-
|
|
68
|
-
var
|
|
69
|
-
return (
|
|
79
|
+
return se(t, () => ({
|
|
80
|
+
sessionCreate: (a) => {
|
|
81
|
+
var r;
|
|
82
|
+
return (r = c.current) == null ? void 0 : r.sessionCreate(a);
|
|
70
83
|
},
|
|
71
84
|
getSessionList: () => {
|
|
72
85
|
var a;
|
|
73
86
|
return (a = c.current) == null ? void 0 : a.getSessionList();
|
|
74
87
|
}
|
|
75
|
-
})), /* @__PURE__ */ s(
|
|
76
|
-
locale:
|
|
77
|
-
children: /* @__PURE__ */ x(
|
|
78
|
-
value:
|
|
79
|
-
popupContainer:
|
|
80
|
-
agentClient:
|
|
81
|
-
footer:
|
|
82
|
-
defaultInput:
|
|
83
|
-
onComment:
|
|
84
|
-
onSessionLoad:
|
|
85
|
-
onSessionUnload:
|
|
86
|
-
onMessage:
|
|
87
|
-
beforeMessageSend:
|
|
88
|
-
bodyStyle:
|
|
89
|
-
disabled:
|
|
90
|
-
transform:
|
|
91
|
-
features:
|
|
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
|
|
92
105
|
}),
|
|
93
|
-
children: [/* @__PURE__ */ s(
|
|
106
|
+
children: [/* @__PURE__ */ s(ae, {
|
|
94
107
|
height: (i == null ? void 0 : i.height) || "100%",
|
|
95
108
|
width: (i == null ? void 0 : i.width) || "100%",
|
|
96
109
|
maxConstraints: [document.body.clientWidth - 45],
|
|
97
|
-
minConstraints: [Number(
|
|
98
|
-
onResize:
|
|
110
|
+
minConstraints: [Number(o == null ? void 0 : o.minWidth)],
|
|
111
|
+
onResize: B,
|
|
99
112
|
handle: /* @__PURE__ */ s("span", {
|
|
100
113
|
className: "resize-handle-ew"
|
|
101
114
|
}),
|
|
102
115
|
resizeHandles: e == "float" ? ["w"] : [],
|
|
103
116
|
children: /* @__PURE__ */ x("div", {
|
|
104
117
|
id: "dialog-modal",
|
|
105
|
-
className: `gbot-dialog-modal ${e} ${
|
|
106
|
-
style:
|
|
107
|
-
width: e == "float" ? i == null ? void 0 : i.width :
|
|
108
|
-
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,
|
|
109
122
|
maxHeight: "100vh"
|
|
110
123
|
}),
|
|
111
|
-
ref:
|
|
112
|
-
children: [
|
|
124
|
+
ref: u,
|
|
125
|
+
children: [Y ? /* @__PURE__ */ s("div", {
|
|
113
126
|
className: "loading",
|
|
114
|
-
children: /* @__PURE__ */ s(
|
|
115
|
-
}) : C &&
|
|
127
|
+
children: /* @__PURE__ */ s(fe, {})
|
|
128
|
+
}) : C && b ? /* @__PURE__ */ s(re, {
|
|
116
129
|
ref: c,
|
|
117
130
|
appId: C,
|
|
118
|
-
docViewerUrl:
|
|
119
|
-
bodyStyle:
|
|
120
|
-
sessionId:
|
|
121
|
-
}) : null, (l == null ? void 0 : l.visible) && /* @__PURE__ */ s(
|
|
131
|
+
docViewerUrl: H,
|
|
132
|
+
bodyStyle: p,
|
|
133
|
+
sessionId: F
|
|
134
|
+
}) : null, (l == null ? void 0 : l.visible) && /* @__PURE__ */ s(U, {
|
|
122
135
|
className: "trigger-btn close-btn",
|
|
123
136
|
icon: /* @__PURE__ */ s("img", {
|
|
124
|
-
src:
|
|
137
|
+
src: g
|
|
125
138
|
}),
|
|
126
139
|
onClick: () => N(!1)
|
|
127
140
|
})]
|
|
128
141
|
})
|
|
129
|
-
}), (l == null ? void 0 : l.visible) && !
|
|
142
|
+
}), (l == null ? void 0 : l.visible) && !v && /* @__PURE__ */ s(U, {
|
|
130
143
|
className: `${e}-trigger-btn open-btn`,
|
|
131
144
|
style: l.style,
|
|
132
145
|
icon: /* @__PURE__ */ s("img", {
|
|
133
|
-
src:
|
|
146
|
+
src: g
|
|
134
147
|
}),
|
|
135
148
|
onClick: () => N(!0)
|
|
136
149
|
})]
|
|
@@ -138,5 +151,5 @@ const Ne = _((o, t) => {
|
|
|
138
151
|
});
|
|
139
152
|
});
|
|
140
153
|
export {
|
|
141
|
-
|
|
154
|
+
ke as default
|
|
142
155
|
};
|
|
@@ -1,92 +1,79 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
for (var n in e || (e = {}))
|
|
7
|
-
$.call(e, n) && h(a, n, e[n]);
|
|
8
|
-
if (f)
|
|
9
|
-
for (var n of f(e))
|
|
10
|
-
b.call(e, n) && h(a, n, e[n]);
|
|
11
|
-
return a;
|
|
12
|
-
}, k = (a, e) => T(a, U(e));
|
|
13
|
-
import { jsxs as t, jsx as s } from "react/jsx-runtime";
|
|
14
|
-
import { useContext as j } from "react";
|
|
15
|
-
import { Space as I, Collapse as C } from "antd";
|
|
16
|
-
import z from "../../../../components/Iconfont/index.mjs";
|
|
17
|
-
/* empty css */import { ISourceType as g } from "@glodon-aiot/apis";
|
|
1
|
+
import { jsxs as s, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as x } from "react";
|
|
3
|
+
import { Space as p, Collapse as f } from "antd";
|
|
4
|
+
import S from "../../../../components/Iconfont/index.mjs";
|
|
5
|
+
/* empty css */import { ISourceType as u } from "@glodon-aiot/apis";
|
|
18
6
|
import "../../../../packages/react-components/dist/es/index.mjs";
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import { Markdown as
|
|
7
|
+
import D from "./ReferItem/index.mjs";
|
|
8
|
+
import y from "../../../../context.mjs";
|
|
9
|
+
import { Markdown as F } from "../../../../packages/react-components/dist/es/components/Markdown/index.mjs";
|
|
22
10
|
const {
|
|
23
|
-
Panel:
|
|
24
|
-
} =
|
|
25
|
-
var
|
|
11
|
+
Panel: R
|
|
12
|
+
} = f, M = (h) => {
|
|
13
|
+
var r, d, c, m;
|
|
26
14
|
const {
|
|
27
|
-
history:
|
|
28
|
-
docViewerUrl:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
window.open(o.webLink);
|
|
15
|
+
history: o,
|
|
16
|
+
docViewerUrl: w
|
|
17
|
+
} = h, {
|
|
18
|
+
transform: i,
|
|
19
|
+
service: l
|
|
20
|
+
} = x(y), I = (e, a) => {
|
|
21
|
+
if (!(!(e != null && e.knowledgeId) || !(e != null && e.docId))) {
|
|
22
|
+
if (e.sourceType === u.WebLink) {
|
|
23
|
+
window.open(e.webLink);
|
|
37
24
|
return;
|
|
38
25
|
}
|
|
39
|
-
|
|
26
|
+
e.sourceType === u.SourceFile && window.open(`${w}#/doc?url=${encodeURIComponent(e.sourceFileUrl)}&page=${a || 0}`);
|
|
40
27
|
}
|
|
41
28
|
};
|
|
42
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ s("div", {
|
|
43
30
|
className: "session-refer",
|
|
44
|
-
children: [/* @__PURE__ */
|
|
31
|
+
children: [/* @__PURE__ */ s(p, {
|
|
45
32
|
className: "session-refer-header",
|
|
46
33
|
size: 8,
|
|
47
|
-
children: [/* @__PURE__ */
|
|
34
|
+
children: [/* @__PURE__ */ n(S, {
|
|
48
35
|
type: "icon-cankaolaiyuan",
|
|
49
36
|
style: {
|
|
50
37
|
color: "#0A51D1",
|
|
51
38
|
fontSize: 16
|
|
52
39
|
}
|
|
53
|
-
}), /* @__PURE__ */
|
|
40
|
+
}), /* @__PURE__ */ n("span", {
|
|
54
41
|
className: "refer-header-title",
|
|
55
42
|
children: "参考来源"
|
|
56
|
-
}), /* @__PURE__ */
|
|
57
|
-
children: ["(共 ", ((
|
|
43
|
+
}), /* @__PURE__ */ s("span", {
|
|
44
|
+
children: ["(共 ", ((r = o == null ? void 0 : o.reference) == null ? void 0 : r.length) || 0, " 项)"]
|
|
58
45
|
})]
|
|
59
|
-
}), /* @__PURE__ */
|
|
46
|
+
}), /* @__PURE__ */ n("div", {
|
|
60
47
|
className: "session-refer-content",
|
|
61
|
-
children: /* @__PURE__ */
|
|
48
|
+
children: /* @__PURE__ */ n(f, {
|
|
62
49
|
ghost: !0,
|
|
63
|
-
defaultActiveKey: (
|
|
64
|
-
children: (
|
|
65
|
-
header: /* @__PURE__ */
|
|
50
|
+
defaultActiveKey: (d = i == null ? void 0 : i.reference) != null && d.isExpand ? (c = o == null ? void 0 : o.reference) == null ? void 0 : c.map((e, a) => e.docId + a) : [],
|
|
51
|
+
children: (m = o == null ? void 0 : o.reference) == null ? void 0 : m.map((e, a) => /* @__PURE__ */ n(R, {
|
|
52
|
+
header: /* @__PURE__ */ s(p, {
|
|
66
53
|
className: "session-refer-panel",
|
|
67
|
-
children: [/* @__PURE__ */
|
|
54
|
+
children: [/* @__PURE__ */ s("span", {
|
|
68
55
|
className: "refer-panel-item",
|
|
69
|
-
children: [
|
|
70
|
-
}),
|
|
71
|
-
data:
|
|
72
|
-
loadPage: (
|
|
73
|
-
const
|
|
74
|
-
return (
|
|
56
|
+
children: [a + 1, "."]
|
|
57
|
+
}), l && /* @__PURE__ */ n(D, {
|
|
58
|
+
data: e,
|
|
59
|
+
loadPage: (g, k, C) => l.getKnowledgeIdFileIdData(g, k, C).then((N) => {
|
|
60
|
+
const t = (N || []).find((v) => v.key === "pages_from");
|
|
61
|
+
return (t == null ? void 0 : t.value) || 0;
|
|
75
62
|
}),
|
|
76
|
-
onClick:
|
|
63
|
+
onClick: I
|
|
77
64
|
})]
|
|
78
65
|
}),
|
|
79
|
-
children: /* @__PURE__ */
|
|
66
|
+
children: /* @__PURE__ */ n("div", {
|
|
80
67
|
className: "refer-markdown",
|
|
81
|
-
children: /* @__PURE__ */
|
|
82
|
-
children:
|
|
83
|
-
})
|
|
68
|
+
children: /* @__PURE__ */ n(F, {
|
|
69
|
+
children: e.text || "-"
|
|
70
|
+
})
|
|
84
71
|
})
|
|
85
|
-
},
|
|
72
|
+
}, e.docId + a))
|
|
86
73
|
})
|
|
87
74
|
})]
|
|
88
75
|
});
|
|
89
76
|
};
|
|
90
77
|
export {
|
|
91
|
-
|
|
78
|
+
M as default
|
|
92
79
|
};
|