@glodon-aiot/agent-cli-ui 3.2.10-beta.12 → 3.2.10-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/Dialog/AgentChat/index.mjs +418 -478
- package/dist/es/Dialog/HistoryItem/index.mjs +50 -52
- package/dist/es/Dialog/KnowledgeList/index.mjs +19 -19
- package/dist/es/Dialog/Recommend/RecommendItem.mjs +43 -52
- package/dist/es/Dialog/SearchReference/index.mjs +41 -68
- package/dist/es/Dialog/SessionAction/index.mjs +32 -34
- package/dist/es/Dialog/SessionListDrawer/HistorySessionList/index.mjs +69 -74
- package/dist/es/Dialog/UploadKnowledgeFiles/index.mjs +164 -198
- package/dist/es/Dialog/index.mjs +56 -56
- package/dist/es/FileItem/index.mjs +50 -63
- package/dist/es/Iconfont/index.mjs +2 -2
- package/dist/es/constant.mjs +2 -8
- package/dist/es/index.mjs +48 -49
- 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/style19.css +1 -1
- package/dist/es/src/style20.css +1 -1
- package/dist/es/src/style21.css +1 -0
- package/dist/es/src/style22.css +1 -1
- package/dist/es/src/style23.css +0 -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/style3.css +1 -1
- package/dist/es/src/style30.css +1 -1
- package/dist/es/src/style31.css +1 -1
- package/dist/es/src/style32.css +1 -1
- 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/style8.css +1 -1
- package/dist/es/src/style9.css +1 -1
- package/dist/lib/index.css +1 -1
- package/dist/lib/index.js +5 -5
- package/dist/src/Dialog/SearchReference/index.d.ts +1 -4
- package/dist/src/types.d.ts +1 -10
- package/package.json +3 -3
- package/dist/src/Iconfont/font_4108228_z72fskklg2.d.ts +0 -0
package/dist/es/Dialog/index.mjs
CHANGED
|
@@ -2,84 +2,84 @@ var q = Object.defineProperty, z = Object.defineProperties;
|
|
|
2
2
|
var B = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var L = Object.getOwnPropertySymbols;
|
|
4
4
|
var F = Object.prototype.hasOwnProperty, G = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var x = (t,
|
|
6
|
-
for (var s in
|
|
7
|
-
F.call(
|
|
5
|
+
var x = (t, n, s) => n in t ? q(t, n, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[n] = s, j = (t, n) => {
|
|
6
|
+
for (var s in n || (n = {}))
|
|
7
|
+
F.call(n, s) && x(t, s, n[s]);
|
|
8
8
|
if (L)
|
|
9
|
-
for (var s of L(
|
|
10
|
-
G.call(
|
|
9
|
+
for (var s of L(n))
|
|
10
|
+
G.call(n, s) && x(t, s, n[s]);
|
|
11
11
|
return t;
|
|
12
|
-
}, A = (t,
|
|
13
|
-
var
|
|
12
|
+
}, A = (t, n) => z(t, B(n));
|
|
13
|
+
var p = (t, n, s) => new Promise((I, N) => {
|
|
14
14
|
var e = (r) => {
|
|
15
15
|
try {
|
|
16
|
-
|
|
17
|
-
} catch (
|
|
18
|
-
|
|
16
|
+
u(s.next(r));
|
|
17
|
+
} catch (h) {
|
|
18
|
+
N(h);
|
|
19
19
|
}
|
|
20
20
|
}, a = (r) => {
|
|
21
21
|
try {
|
|
22
|
-
|
|
23
|
-
} catch (
|
|
24
|
-
|
|
22
|
+
u(s.throw(r));
|
|
23
|
+
} catch (h) {
|
|
24
|
+
N(h);
|
|
25
25
|
}
|
|
26
|
-
},
|
|
27
|
-
|
|
26
|
+
}, u = (r) => r.done ? I(r.value) : Promise.resolve(r.value).then(e, a);
|
|
27
|
+
u((s = s.apply(t, n)).next());
|
|
28
28
|
});
|
|
29
|
-
import { jsx as c, jsxs as
|
|
30
|
-
import { useState as
|
|
29
|
+
import { jsx as c, jsxs as R } from "react/jsx-runtime";
|
|
30
|
+
import { useState as v, useContext as J, useRef as M, useEffect as y } from "react";
|
|
31
31
|
import P from "../context.mjs";
|
|
32
32
|
import Q from "./AgentChat/index.mjs";
|
|
33
33
|
import T from "./KnowledgeList/index.mjs";
|
|
34
34
|
import W from "./SessionList/index.mjs";
|
|
35
35
|
/* empty css */const re = (t) => {
|
|
36
36
|
const {
|
|
37
|
-
sessionId:
|
|
37
|
+
sessionId: n,
|
|
38
38
|
appId: s,
|
|
39
39
|
docViewerUrl: I,
|
|
40
|
-
bodyStyle:
|
|
41
|
-
} = t, [e, a] =
|
|
42
|
-
service:
|
|
40
|
+
bodyStyle: N
|
|
41
|
+
} = t, [e, a] = v(), {
|
|
42
|
+
service: u,
|
|
43
43
|
mode: r,
|
|
44
|
-
showHeader:
|
|
44
|
+
showHeader: h,
|
|
45
45
|
token: X,
|
|
46
|
-
agentClient:
|
|
47
|
-
sider:
|
|
48
|
-
onSessionLoad:
|
|
46
|
+
agentClient: o,
|
|
47
|
+
sider: H,
|
|
48
|
+
onSessionLoad: f,
|
|
49
49
|
onSessionUnload: Y,
|
|
50
50
|
footer: Z,
|
|
51
51
|
transform: _,
|
|
52
52
|
depId: $,
|
|
53
53
|
features: l
|
|
54
|
-
} = J(P), [
|
|
54
|
+
} = J(P), [m, K] = v(), w = M(null), [U, D] = v(""), [k, b] = v(), [E, S] = v(!1);
|
|
55
55
|
y(() => {
|
|
56
56
|
var i;
|
|
57
|
-
|
|
57
|
+
S(e ? !!((i = e.data) != null && i.netOpen) : typeof (l == null ? void 0 : l.connectNetwork) == "object" && typeof (l == null ? void 0 : l.connectNetwork.default) == "boolean" ? l.connectNetwork.default : !1);
|
|
58
58
|
}, [e]), y(() => {
|
|
59
|
-
const i = () =>
|
|
60
|
-
const d =
|
|
59
|
+
const i = () => p(void 0, null, function* () {
|
|
60
|
+
const d = o == null ? void 0 : o.application;
|
|
61
61
|
if (!(d != null && d.id))
|
|
62
62
|
return;
|
|
63
|
-
const
|
|
64
|
-
if (!(
|
|
63
|
+
const g = d == null ? void 0 : d.arrange;
|
|
64
|
+
if (!(g != null && g.length))
|
|
65
65
|
return;
|
|
66
|
-
const V =
|
|
67
|
-
D(V),
|
|
66
|
+
const V = g[0].embeddingService;
|
|
67
|
+
D(V), K(d);
|
|
68
68
|
});
|
|
69
|
-
return
|
|
70
|
-
|
|
69
|
+
return o == null || o.addEventListener("ready", () => i()), () => {
|
|
70
|
+
o == null || o.removeEventListener("ready", i);
|
|
71
71
|
};
|
|
72
72
|
}, []), y(() => {
|
|
73
|
-
|
|
74
|
-
a == null || a(i.find((d) => d.id ===
|
|
75
|
-
})) :
|
|
76
|
-
|
|
77
|
-
a == null || a(i.find((d) => d.id ===
|
|
73
|
+
o && n && (o.ready ? o == null || o.getSessions().then((i) => p(void 0, null, function* () {
|
|
74
|
+
a == null || a(i.find((d) => d.id === n));
|
|
75
|
+
})) : o.addEventListener("ready", () => p(void 0, null, function* () {
|
|
76
|
+
o == null || o.getSessions().then((i) => p(void 0, null, function* () {
|
|
77
|
+
a == null || a(i.find((d) => d.id === n));
|
|
78
78
|
}));
|
|
79
79
|
}), !0));
|
|
80
|
-
}, [
|
|
80
|
+
}, [o, n]), y(() => {
|
|
81
81
|
if (!e) {
|
|
82
|
-
|
|
82
|
+
f && f({
|
|
83
83
|
applicationId: s,
|
|
84
84
|
sessionId: "",
|
|
85
85
|
session: null,
|
|
@@ -87,13 +87,13 @@ import W from "./SessionList/index.mjs";
|
|
|
87
87
|
});
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
90
|
-
e.data &&
|
|
90
|
+
e.data && f && f({
|
|
91
91
|
applicationId: s,
|
|
92
92
|
sessionId: e.data.id,
|
|
93
93
|
session: e.data,
|
|
94
94
|
sessionInstance: e
|
|
95
95
|
}), e.addEventListener("data:loaded", () => {
|
|
96
|
-
e != null && e.data &&
|
|
96
|
+
e != null && e.data && f && f({
|
|
97
97
|
applicationId: s,
|
|
98
98
|
sessionId: e.data.id,
|
|
99
99
|
session: e.data,
|
|
@@ -103,45 +103,45 @@ import W from "./SessionList/index.mjs";
|
|
|
103
103
|
}, [e]);
|
|
104
104
|
const O = (i) => {
|
|
105
105
|
var d;
|
|
106
|
-
return (d =
|
|
106
|
+
return (d = w.current) == null ? void 0 : d.create(A(j({}, i), {
|
|
107
107
|
knowledges: k
|
|
108
108
|
}));
|
|
109
109
|
};
|
|
110
110
|
return /* @__PURE__ */ c("div", {
|
|
111
111
|
className: "dialog",
|
|
112
|
-
children: /* @__PURE__ */
|
|
112
|
+
children: /* @__PURE__ */ R("div", {
|
|
113
113
|
className: "dialog-pannel",
|
|
114
114
|
children: [/* @__PURE__ */ c("div", {
|
|
115
115
|
className: "dialog-sider",
|
|
116
116
|
children: /* @__PURE__ */ c(W, {
|
|
117
|
-
ref:
|
|
118
|
-
sider:
|
|
117
|
+
ref: w,
|
|
118
|
+
sider: H,
|
|
119
119
|
appId: s,
|
|
120
120
|
networkStatus: E,
|
|
121
121
|
currentSession: e,
|
|
122
|
-
application:
|
|
122
|
+
application: m,
|
|
123
123
|
setCurrentSession: a,
|
|
124
124
|
checkKnowledges: k,
|
|
125
|
-
setCheckKnowledges:
|
|
125
|
+
setCheckKnowledges: b
|
|
126
126
|
})
|
|
127
127
|
}), /* @__PURE__ */ c("div", {
|
|
128
128
|
className: "dialog-content",
|
|
129
|
-
children: /* @__PURE__ */
|
|
129
|
+
children: /* @__PURE__ */ R("div", {
|
|
130
130
|
className: "dialog-chat",
|
|
131
|
-
children: [
|
|
131
|
+
children: [h && /* @__PURE__ */ c("div", {
|
|
132
132
|
className: "dialog-chat-header",
|
|
133
133
|
children: /* @__PURE__ */ c(T, {
|
|
134
134
|
setCheckKnowledges: b,
|
|
135
|
-
application:
|
|
135
|
+
application: m,
|
|
136
136
|
currentSession: e,
|
|
137
137
|
setCurrentSession: a
|
|
138
138
|
})
|
|
139
139
|
}), /* @__PURE__ */ c("div", {
|
|
140
140
|
className: "dialog-chat-content",
|
|
141
|
-
children: (
|
|
142
|
-
setNetworkStatus:
|
|
141
|
+
children: (m == null ? void 0 : m.id) && /* @__PURE__ */ c(Q, {
|
|
142
|
+
setNetworkStatus: S,
|
|
143
143
|
networkStatus: E,
|
|
144
|
-
application:
|
|
144
|
+
application: m,
|
|
145
145
|
currentSession: e,
|
|
146
146
|
onCreateSession: O,
|
|
147
147
|
docViewerUrl: I,
|
|
@@ -1,97 +1,84 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useContext as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
/* empty css */import { Typography as
|
|
7
|
-
import { getFileExtension as x, formatFileSize as
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as w, useState as h, useEffect as N } from "react";
|
|
3
|
+
import f from "../FileCard/doc-icons/pdf.svg.mjs";
|
|
4
|
+
import v from "../FileCard/doc-icons/doc.svg.mjs";
|
|
5
|
+
import y from "../FileCard/doc-icons/docx.svg.mjs";
|
|
6
|
+
/* empty css */import { Typography as U, message as u } from "antd";
|
|
7
|
+
import { getFileExtension as x, formatFileSize as E, isValidImageUrlWithAnyExtension as j } from "../utils/index.mjs";
|
|
8
8
|
import k from "../context.mjs";
|
|
9
9
|
const z = {
|
|
10
|
-
doc:
|
|
11
|
-
docx:
|
|
12
|
-
pdf:
|
|
13
|
-
},
|
|
10
|
+
doc: v,
|
|
11
|
+
docx: y,
|
|
12
|
+
pdf: f
|
|
13
|
+
}, b = (g) => {
|
|
14
14
|
const {
|
|
15
|
-
currentSession:
|
|
16
|
-
fileId:
|
|
17
|
-
file:
|
|
15
|
+
currentSession: i,
|
|
16
|
+
fileId: p,
|
|
17
|
+
file: r,
|
|
18
18
|
docViewerUrl: C
|
|
19
|
-
} =
|
|
20
|
-
service:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
p(s);
|
|
19
|
+
} = g, {
|
|
20
|
+
service: m
|
|
21
|
+
} = w(k), [o, t] = h(), [c, d] = h("");
|
|
22
|
+
N(() => {
|
|
23
|
+
var n;
|
|
24
|
+
if (r != null && r.id) {
|
|
25
|
+
t(r);
|
|
26
|
+
const s = x(r == null ? void 0 : r.name) || "";
|
|
27
|
+
d(s);
|
|
29
28
|
} else {
|
|
30
|
-
if (!
|
|
29
|
+
if (!p || !((n = i == null ? void 0 : i.data) != null && n.id))
|
|
31
30
|
return;
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
m == null || m.getSessionKnowledgeFile(i.data.id, p).then((s) => {
|
|
32
|
+
t(s);
|
|
34
33
|
const I = x(s == null ? void 0 : s.name) || "";
|
|
35
|
-
|
|
34
|
+
d(I);
|
|
36
35
|
});
|
|
37
36
|
}
|
|
38
37
|
}, []);
|
|
39
|
-
const F = (
|
|
40
|
-
if (!(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
});
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
if (!j(o.url)) {
|
|
49
|
-
c.config({
|
|
50
|
-
getContainer: () => (i == null ? void 0 : i.current) || document.body
|
|
51
|
-
}), c.error("链接格式不正确"), c.config({
|
|
52
|
-
getContainer: void 0
|
|
53
|
-
});
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
window.open(`${C}#/doc?url=${encodeURIComponent(o == null ? void 0 : o.url)}`);
|
|
38
|
+
const F = (n) => {
|
|
39
|
+
if (!(n != null && n.url))
|
|
40
|
+
return u.error("链接不存在");
|
|
41
|
+
if (!j(n.url))
|
|
42
|
+
return u.error("链接格式不正确");
|
|
43
|
+
window.open(`${C}#/doc?url=${encodeURIComponent(n == null ? void 0 : n.url)}`);
|
|
57
44
|
};
|
|
58
|
-
return /* @__PURE__ */
|
|
45
|
+
return /* @__PURE__ */ l("div", {
|
|
59
46
|
className: "file-item",
|
|
60
|
-
onClick: () => F(
|
|
61
|
-
children: [/* @__PURE__ */
|
|
47
|
+
onClick: () => F(o),
|
|
48
|
+
children: [/* @__PURE__ */ e("div", {
|
|
62
49
|
className: "item-left",
|
|
63
|
-
children: /* @__PURE__ */
|
|
50
|
+
children: /* @__PURE__ */ e("img", {
|
|
64
51
|
className: "file-icon",
|
|
65
|
-
src: z[
|
|
52
|
+
src: z[c]
|
|
66
53
|
})
|
|
67
|
-
}), /* @__PURE__ */
|
|
54
|
+
}), /* @__PURE__ */ l("div", {
|
|
68
55
|
className: "item-main",
|
|
69
|
-
children: [/* @__PURE__ */
|
|
56
|
+
children: [/* @__PURE__ */ e("div", {
|
|
70
57
|
className: "file-name",
|
|
71
|
-
children: /* @__PURE__ */
|
|
58
|
+
children: /* @__PURE__ */ e(U.Paragraph, {
|
|
72
59
|
style: {
|
|
73
60
|
margin: 0,
|
|
74
61
|
width: "100%"
|
|
75
62
|
},
|
|
76
63
|
ellipsis: {
|
|
77
64
|
rows: 1,
|
|
78
|
-
tooltip:
|
|
65
|
+
tooltip: o == null ? void 0 : o.name
|
|
79
66
|
},
|
|
80
|
-
children:
|
|
67
|
+
children: o == null ? void 0 : o.name
|
|
81
68
|
})
|
|
82
|
-
}), /* @__PURE__ */
|
|
69
|
+
}), /* @__PURE__ */ l("div", {
|
|
83
70
|
className: "file-desc",
|
|
84
|
-
children: [/* @__PURE__ */
|
|
85
|
-
children:
|
|
86
|
-
}), /* @__PURE__ */
|
|
71
|
+
children: [/* @__PURE__ */ e("span", {
|
|
72
|
+
children: c == null ? void 0 : c.toUpperCase()
|
|
73
|
+
}), /* @__PURE__ */ e("span", {
|
|
87
74
|
children: ","
|
|
88
|
-
}), /* @__PURE__ */
|
|
89
|
-
children:
|
|
75
|
+
}), /* @__PURE__ */ e("span", {
|
|
76
|
+
children: E((o == null ? void 0 : o.size) || 0)
|
|
90
77
|
})]
|
|
91
78
|
})]
|
|
92
79
|
})]
|
|
93
80
|
});
|
|
94
81
|
};
|
|
95
82
|
export {
|
|
96
|
-
|
|
83
|
+
b as default
|
|
97
84
|
};
|