@glodon-aiot/agent-cli-ui 3.3.6-alpha.1 → 3.4.0-alpha.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 +442 -435
- package/dist/es/Dialog/SessionList/index.mjs +117 -115
- package/dist/es/Dialog/index.mjs +35 -34
- package/dist/es/constant.mjs +2 -0
- package/dist/es/index.mjs +30 -29
- 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/style11.css +1 -1
- package/dist/es/src/style12.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/style23.css +1 -1
- package/dist/es/src/style25.css +1 -1
- package/dist/es/src/style27.css +1 -1
- package/dist/es/src/style28.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/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/style9.css +1 -1
- package/dist/lib/index.css +1 -1
- package/dist/lib/index.js +55 -55
- package/dist/src/Dialog/AgentChat/HistoryItem/FileItem/index.d.ts +1 -1
- package/dist/src/Dialog/AgentChat/HistoryItem/SessionAction/index.d.ts +1 -1
- package/dist/src/Dialog/AgentChat/HistoryItem/index.d.ts +1 -1
- package/dist/src/Dialog/AgentChat/PromptSetting/index.d.ts +2 -2
- package/dist/src/Dialog/AgentChat/Tools/SessionHistoryDrawer/index.d.ts +2 -2
- package/dist/src/Dialog/AgentChat/index.d.ts +2 -2
- package/dist/src/Dialog/SessionList/index.d.ts +3 -2
- package/dist/src/components/KnowledgeList/index.d.ts +1 -1
- package/dist/src/types.d.ts +1 -0
- package/package.json +3 -3
|
@@ -1,90 +1,92 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
1
|
+
var ot = Object.defineProperty;
|
|
2
|
+
var G = Object.getOwnPropertySymbols;
|
|
3
|
+
var it = Object.prototype.hasOwnProperty, lt = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var $ = (k, r, e) => r in k ? ot(k, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : k[r] = e, q = (k, r) => {
|
|
5
5
|
for (var e in r || (r = {}))
|
|
6
|
-
|
|
7
|
-
if (
|
|
8
|
-
for (var e of
|
|
9
|
-
|
|
6
|
+
it.call(r, e) && $(k, e, r[e]);
|
|
7
|
+
if (G)
|
|
8
|
+
for (var e of G(r))
|
|
9
|
+
lt.call(r, e) && $(k, e, r[e]);
|
|
10
10
|
return k;
|
|
11
11
|
};
|
|
12
12
|
var x = (k, r, e) => new Promise((i, O) => {
|
|
13
|
-
var
|
|
13
|
+
var w = (m) => {
|
|
14
14
|
try {
|
|
15
15
|
E(e.next(m));
|
|
16
|
-
} catch (
|
|
17
|
-
O(
|
|
16
|
+
} catch (u) {
|
|
17
|
+
O(u);
|
|
18
18
|
}
|
|
19
|
-
},
|
|
19
|
+
}, T = (m) => {
|
|
20
20
|
try {
|
|
21
21
|
E(e.throw(m));
|
|
22
|
-
} catch (
|
|
23
|
-
O(
|
|
22
|
+
} catch (u) {
|
|
23
|
+
O(u);
|
|
24
24
|
}
|
|
25
|
-
}, E = (m) => m.done ? i(m.value) : Promise.resolve(m.value).then(
|
|
25
|
+
}, E = (m) => m.done ? i(m.value) : Promise.resolve(m.value).then(w, T);
|
|
26
26
|
E((e = e.apply(k, r)).next());
|
|
27
27
|
});
|
|
28
|
-
import { jsx as
|
|
29
|
-
import { forwardRef as nt, useState as
|
|
30
|
-
import { Button as
|
|
28
|
+
import { jsx as n, jsxs as A } from "react/jsx-runtime";
|
|
29
|
+
import { forwardRef as nt, useState as C, useContext as ct, useEffect as P, useImperativeHandle as st, useMemo as rt } from "react";
|
|
30
|
+
import { Button as mt, Popconfirm as J, Input as pt, Space as ht } from "antd";
|
|
31
31
|
import N from "dayjs";
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
/* empty css */import { useMemoizedFn as
|
|
36
|
-
import { NET_OPEN_STATUS as
|
|
37
|
-
const
|
|
32
|
+
import ft from "classnames";
|
|
33
|
+
import Q from "../../components/Iconfont/index.mjs";
|
|
34
|
+
import yt from "../../context.mjs";
|
|
35
|
+
/* empty css */import { useMemoizedFn as W } from "ahooks";
|
|
36
|
+
import { NET_OPEN_STATUS as X } from "../../constant.mjs";
|
|
37
|
+
const vt = nt((k, r) => {
|
|
38
38
|
const {
|
|
39
39
|
currentSession: e,
|
|
40
40
|
setCurrentSession: i,
|
|
41
41
|
checkKnowledges: O,
|
|
42
|
-
application:
|
|
43
|
-
networkStatus:
|
|
42
|
+
application: w,
|
|
43
|
+
networkStatus: T,
|
|
44
44
|
isShowHeader: E = !0,
|
|
45
45
|
sessions: m,
|
|
46
46
|
// 👈 从外部接收
|
|
47
|
-
setSessions:
|
|
47
|
+
setSessions: u,
|
|
48
48
|
// 👈 从外部接收
|
|
49
|
-
afterSessionClick: Y
|
|
50
|
-
|
|
49
|
+
afterSessionClick: Y,
|
|
50
|
+
sessionId: L
|
|
51
|
+
} = k, [V, H] = C(), {
|
|
51
52
|
agentClient: v,
|
|
52
|
-
mode:
|
|
53
|
+
mode: Z,
|
|
53
54
|
features: a
|
|
54
|
-
} =
|
|
55
|
+
} = ct(yt), [_, K] = C(O), z = W((t) => {
|
|
55
56
|
if (!t.id)
|
|
56
57
|
return;
|
|
57
58
|
const d = m.map((o) => {
|
|
58
59
|
var c;
|
|
59
|
-
return ((c = o.data) == null ? void 0 : c.id) === t.id && (o.data =
|
|
60
|
+
return ((c = o.data) == null ? void 0 : c.id) === t.id && (o.data = q({}, t)), o;
|
|
60
61
|
});
|
|
61
|
-
|
|
62
|
+
u([...d]);
|
|
62
63
|
});
|
|
63
64
|
P(() => {
|
|
64
65
|
v == null || v.getSessions().then((t) => x(void 0, null, function* () {
|
|
65
66
|
var d;
|
|
66
|
-
if (
|
|
67
|
+
if (u([...t]), !((d = e == null ? void 0 : e.data) != null && d.id) && (t != null && t.length) && Z === "inlay") {
|
|
67
68
|
const o = t[0];
|
|
68
|
-
i == null || i(o);
|
|
69
|
-
}
|
|
69
|
+
L || i == null || i(o);
|
|
70
|
+
} else
|
|
71
|
+
e === void 0 && (L || i == null || i(null));
|
|
70
72
|
}));
|
|
71
|
-
}, []), P(() => {
|
|
73
|
+
}, [L]), P(() => {
|
|
72
74
|
var t;
|
|
73
75
|
if (!((t = e == null ? void 0 : e.data) != null && t.id) && O === void 0) {
|
|
74
76
|
const d = typeof (a == null ? void 0 : a.knowledges) == "object" && a.knowledges.default || void 0;
|
|
75
|
-
|
|
77
|
+
K(d);
|
|
76
78
|
return;
|
|
77
79
|
}
|
|
78
|
-
|
|
80
|
+
K(O);
|
|
79
81
|
}, [O]), P(() => {
|
|
80
|
-
e == null || e.addEventListener("data:updated",
|
|
81
|
-
}, [e]),
|
|
82
|
+
e == null || e.addEventListener("data:updated", z);
|
|
83
|
+
}, [e]), st(r, () => ({
|
|
82
84
|
create(t) {
|
|
83
|
-
return
|
|
85
|
+
return B(t).then((d) => (i == null || i(d), d));
|
|
84
86
|
},
|
|
85
87
|
list: () => Promise.resolve(m)
|
|
86
88
|
}));
|
|
87
|
-
const
|
|
89
|
+
const B = (t) => {
|
|
88
90
|
const d = typeof (a == null ? void 0 : a.connectNetwork) == "object" && typeof (a == null ? void 0 : a.connectNetwork.default) == "boolean" ? a.connectNetwork.default : !1;
|
|
89
91
|
return new Promise((o) => x(void 0, null, function* () {
|
|
90
92
|
var p;
|
|
@@ -93,17 +95,17 @@ const yt = nt((k, r) => {
|
|
|
93
95
|
// @ts-ignore netOpen入参是number 响应是boolen
|
|
94
96
|
// 只有对话有联网 其它没有
|
|
95
97
|
// 不传netOpen会默认取defaultNetOpen
|
|
96
|
-
netOpen: (
|
|
97
|
-
knowledges: (p = e == null ? void 0 : e.data) != null && p.id ? t == null ? void 0 : t.knowledges :
|
|
98
|
+
netOpen: (w == null ? void 0 : w.type) === 0 ? t != null && t.netOpen ? t.netOpen : d ? X.OPEN : X.CLOSE : void 0,
|
|
99
|
+
knowledges: (p = e == null ? void 0 : e.data) != null && p.id ? t == null ? void 0 : t.knowledges : _,
|
|
98
100
|
promptVariables: c
|
|
99
101
|
});
|
|
100
102
|
s == null || s.addEventListener("data:created", () => x(void 0, null, function* () {
|
|
101
|
-
|
|
103
|
+
u([s, ...m]), o(s);
|
|
102
104
|
}));
|
|
103
105
|
}));
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
knowledges:
|
|
106
|
+
}, I = () => {
|
|
107
|
+
B({
|
|
108
|
+
knowledges: _
|
|
107
109
|
}).then((t) => {
|
|
108
110
|
i == null || i(t);
|
|
109
111
|
});
|
|
@@ -111,20 +113,20 @@ const yt = nt((k, r) => {
|
|
|
111
113
|
v == null || v.removeSession(t, !0).then(() => x(void 0, null, function* () {
|
|
112
114
|
var o, c;
|
|
113
115
|
const d = m.filter((s) => {
|
|
114
|
-
var p,
|
|
115
|
-
return ((p = s.data) == null ? void 0 : p.id) !== ((
|
|
116
|
+
var p, g;
|
|
117
|
+
return ((p = s.data) == null ? void 0 : p.id) !== ((g = t.data) == null ? void 0 : g.id);
|
|
116
118
|
});
|
|
117
|
-
((o = t.data) == null ? void 0 : o.id) === ((c = e == null ? void 0 : e.data) == null ? void 0 : c.id) && (d != null && d.length ? i == null || i(d[0]) : i == null || i(void 0)),
|
|
119
|
+
((o = t.data) == null ? void 0 : o.id) === ((c = e == null ? void 0 : e.data) == null ? void 0 : c.id) && (d != null && d.length ? i == null || i(d[0]) : i == null || i(void 0)), u([...d]);
|
|
118
120
|
}));
|
|
119
|
-
}, I = (t) => {
|
|
120
|
-
var d;
|
|
121
|
-
T((d = t.data) == null ? void 0 : d.name);
|
|
122
121
|
}, tt = (t) => {
|
|
123
|
-
|
|
124
|
-
|
|
122
|
+
var d;
|
|
123
|
+
H((d = t.data) == null ? void 0 : d.name);
|
|
124
|
+
}, et = (t) => {
|
|
125
|
+
V && (t.rename(V), t == null || t.addEventListener("data:updated", z));
|
|
126
|
+
}, at = (t) => x(void 0, null, function* () {
|
|
125
127
|
i == null || i(t), Y == null || Y(t);
|
|
126
|
-
}),
|
|
127
|
-
|
|
128
|
+
}), dt = (t) => {
|
|
129
|
+
H(t.target.value);
|
|
128
130
|
};
|
|
129
131
|
P(() => {
|
|
130
132
|
var d, o, c, s;
|
|
@@ -133,135 +135,135 @@ const yt = nt((k, r) => {
|
|
|
133
135
|
const t = {};
|
|
134
136
|
typeof (a == null ? void 0 : a.knowledges) == "object" && ((d = a == null ? void 0 : a.knowledges) != null && d.default) && (t.knowledges = (o = a == null ? void 0 : a.knowledges) == null ? void 0 : o.default), typeof (a == null ? void 0 : a.promptVariables) == "object" && ((c = a == null ? void 0 : a.promptVariables) != null && c.default) && (t.promptVariables = (s = a == null ? void 0 : a.promptVariables) == null ? void 0 : s.default), v == null || v.loadSession(e.id, t);
|
|
135
137
|
}, [e]);
|
|
136
|
-
const
|
|
137
|
-
const d = N().endOf("day"), o = d.subtract(1, "day"), c = d.subtract(7, "day"), s = d.subtract(30, "day"), p = [],
|
|
138
|
-
return t.forEach((
|
|
138
|
+
const F = W((t) => {
|
|
139
|
+
const d = N().endOf("day"), o = d.subtract(1, "day"), c = d.subtract(7, "day"), s = d.subtract(30, "day"), p = [], g = [], M = [], j = [], b = {};
|
|
140
|
+
return t.forEach((l) => {
|
|
139
141
|
var y;
|
|
140
|
-
const h = N((y =
|
|
142
|
+
const h = N((y = l.data) == null ? void 0 : y.createdAt);
|
|
141
143
|
if (h.isAfter(o))
|
|
142
|
-
|
|
144
|
+
g.push(l);
|
|
143
145
|
else if (h.isAfter(c))
|
|
144
|
-
M.push(
|
|
146
|
+
M.push(l);
|
|
145
147
|
else if (h.isAfter(s))
|
|
146
|
-
j.push(
|
|
148
|
+
j.push(l);
|
|
147
149
|
else {
|
|
148
150
|
const f = h.format("YYYY-MM");
|
|
149
|
-
|
|
151
|
+
b[f] || (b[f] = []), b[f].push(l);
|
|
150
152
|
}
|
|
151
|
-
}),
|
|
153
|
+
}), g.length > 0 && p.push({
|
|
152
154
|
title: "今天",
|
|
153
|
-
sessions:
|
|
155
|
+
sessions: g.sort((l, h) => {
|
|
154
156
|
var y, f;
|
|
155
|
-
return N((y = h.data) == null ? void 0 : y.createdAt).valueOf() - N((f =
|
|
157
|
+
return N((y = h.data) == null ? void 0 : y.createdAt).valueOf() - N((f = l.data) == null ? void 0 : f.createdAt).valueOf();
|
|
156
158
|
}),
|
|
157
159
|
key: "today"
|
|
158
160
|
}), M.length > 0 && p.push({
|
|
159
161
|
title: "7天内",
|
|
160
|
-
sessions: M.sort((
|
|
162
|
+
sessions: M.sort((l, h) => {
|
|
161
163
|
var y, f;
|
|
162
|
-
return N((y = h.data) == null ? void 0 : y.createdAt).valueOf() - N((f =
|
|
164
|
+
return N((y = h.data) == null ? void 0 : y.createdAt).valueOf() - N((f = l.data) == null ? void 0 : f.createdAt).valueOf();
|
|
163
165
|
}),
|
|
164
166
|
key: "seven-days"
|
|
165
167
|
}), j.length > 0 && p.push({
|
|
166
168
|
title: "30天内",
|
|
167
|
-
sessions: j.sort((
|
|
169
|
+
sessions: j.sort((l, h) => {
|
|
168
170
|
var y, f;
|
|
169
|
-
return N((y = h.data) == null ? void 0 : y.createdAt).valueOf() - N((f =
|
|
171
|
+
return N((y = h.data) == null ? void 0 : y.createdAt).valueOf() - N((f = l.data) == null ? void 0 : f.createdAt).valueOf();
|
|
170
172
|
}),
|
|
171
173
|
key: "thirty-days"
|
|
172
|
-
}), Object.keys(
|
|
173
|
-
const h =
|
|
174
|
-
var
|
|
175
|
-
return N((
|
|
174
|
+
}), Object.keys(b).sort((l, h) => h.localeCompare(l)).forEach((l) => {
|
|
175
|
+
const h = b[l].sort((y, f) => {
|
|
176
|
+
var R, U;
|
|
177
|
+
return N((R = f.data) == null ? void 0 : R.createdAt).valueOf() - N((U = y.data) == null ? void 0 : U.createdAt).valueOf();
|
|
176
178
|
});
|
|
177
179
|
p.push({
|
|
178
|
-
title: N(
|
|
180
|
+
title: N(l).format("YYYY年MM月"),
|
|
179
181
|
sessions: h,
|
|
180
|
-
key: `month-${
|
|
182
|
+
key: `month-${l}`
|
|
181
183
|
});
|
|
182
184
|
}), p;
|
|
183
|
-
}),
|
|
184
|
-
return /* @__PURE__ */
|
|
185
|
+
}), D = rt(() => F(m), [m, F]);
|
|
186
|
+
return /* @__PURE__ */ n("div", {
|
|
185
187
|
className: "bot-session-container",
|
|
186
188
|
children: /* @__PURE__ */ A("div", {
|
|
187
189
|
className: "agent-sessions",
|
|
188
|
-
children: [E && /* @__PURE__ */
|
|
190
|
+
children: [E && (a == null ? void 0 : a.siderTitle) && /* @__PURE__ */ n("div", {
|
|
189
191
|
className: "sessions-header",
|
|
190
|
-
children: /* @__PURE__ */
|
|
192
|
+
children: /* @__PURE__ */ n("div", {
|
|
191
193
|
className: "session-header-title",
|
|
192
|
-
children: (
|
|
194
|
+
children: (w == null ? void 0 : w.name) || "-"
|
|
193
195
|
})
|
|
194
196
|
}), /* @__PURE__ */ A("div", {
|
|
195
197
|
className: "sessions-main",
|
|
196
|
-
children: [E && /* @__PURE__ */
|
|
198
|
+
children: [E && /* @__PURE__ */ n("div", {
|
|
197
199
|
className: "session-header-btn-wrapper",
|
|
198
|
-
children: /* @__PURE__ */
|
|
200
|
+
children: /* @__PURE__ */ n(mt, {
|
|
199
201
|
className: "session-header-btn",
|
|
200
|
-
onClick:
|
|
202
|
+
onClick: I,
|
|
201
203
|
type: "primary",
|
|
202
204
|
children: "+ 新会话"
|
|
203
205
|
})
|
|
204
|
-
}),
|
|
206
|
+
}), D == null ? void 0 : D.map((t) => {
|
|
205
207
|
var d;
|
|
206
208
|
return /* @__PURE__ */ A("div", {
|
|
207
209
|
className: "session-group",
|
|
208
|
-
children: [/* @__PURE__ */
|
|
210
|
+
children: [/* @__PURE__ */ n("div", {
|
|
209
211
|
className: "group-header",
|
|
210
212
|
style: {
|
|
211
213
|
top: E ? 48 : 0
|
|
212
214
|
},
|
|
213
215
|
children: t.title
|
|
214
216
|
}), (d = t.sessions) == null ? void 0 : d.map((o) => {
|
|
215
|
-
var c, s, p,
|
|
216
|
-
return /* @__PURE__ */
|
|
217
|
-
className:
|
|
217
|
+
var c, s, p, g, M, j;
|
|
218
|
+
return /* @__PURE__ */ n("div", {
|
|
219
|
+
className: ft({
|
|
218
220
|
"session-item": !0,
|
|
219
221
|
"session-item__active": ((c = o.data) == null ? void 0 : c.id) === ((s = e == null ? void 0 : e.data) == null ? void 0 : s.id)
|
|
220
222
|
}),
|
|
221
|
-
onClick: () =>
|
|
223
|
+
onClick: () => at(o),
|
|
222
224
|
children: /* @__PURE__ */ A("div", {
|
|
223
225
|
className: "session-item-wrapper",
|
|
224
226
|
children: [/* @__PURE__ */ A("div", {
|
|
225
227
|
className: "session-item-top",
|
|
226
|
-
children: [/* @__PURE__ */
|
|
228
|
+
children: [/* @__PURE__ */ n("span", {
|
|
227
229
|
className: "item-top-title",
|
|
228
230
|
children: ((p = o.data) == null ? void 0 : p.name) || "-"
|
|
229
231
|
}), /* @__PURE__ */ A("div", {
|
|
230
232
|
className: "item-top-action",
|
|
231
|
-
onClick: (
|
|
232
|
-
children: [/* @__PURE__ */
|
|
233
|
-
getPopupContainer: (
|
|
233
|
+
onClick: (b) => b.stopPropagation(),
|
|
234
|
+
children: [/* @__PURE__ */ n(J, {
|
|
235
|
+
getPopupContainer: (b) => b.parentNode,
|
|
234
236
|
icon: !1,
|
|
235
|
-
title: /* @__PURE__ */
|
|
237
|
+
title: /* @__PURE__ */ n(pt, {
|
|
236
238
|
placeholder: "请输入内容",
|
|
237
239
|
autoComplete: "off",
|
|
238
240
|
showCount: !0,
|
|
239
|
-
value:
|
|
240
|
-
onChange:
|
|
241
|
+
value: V,
|
|
242
|
+
onChange: dt,
|
|
241
243
|
maxLength: 15
|
|
242
244
|
}),
|
|
243
|
-
onConfirm: () =>
|
|
244
|
-
children: /* @__PURE__ */
|
|
245
|
+
onConfirm: () => et(o),
|
|
246
|
+
children: /* @__PURE__ */ n(Q, {
|
|
245
247
|
type: "icon-bianji2",
|
|
246
|
-
onClick: () =>
|
|
248
|
+
onClick: () => tt(o),
|
|
247
249
|
className: "icon-action",
|
|
248
250
|
style: {
|
|
249
251
|
marginRight: "8px"
|
|
250
252
|
}
|
|
251
253
|
})
|
|
252
|
-
}), /* @__PURE__ */
|
|
253
|
-
getPopupContainer: (
|
|
254
|
+
}), /* @__PURE__ */ n(J, {
|
|
255
|
+
getPopupContainer: (b) => b.parentNode,
|
|
254
256
|
icon: !1,
|
|
255
|
-
title: /* @__PURE__ */ A(
|
|
257
|
+
title: /* @__PURE__ */ A(ht, {
|
|
256
258
|
direction: "vertical",
|
|
257
|
-
children: [/* @__PURE__ */
|
|
259
|
+
children: [/* @__PURE__ */ n("div", {
|
|
258
260
|
children: "删除确认?"
|
|
259
|
-
}), /* @__PURE__ */
|
|
261
|
+
}), /* @__PURE__ */ n("div", {
|
|
260
262
|
children: "会话删除后不可恢复,请确认是否删除!"
|
|
261
263
|
})]
|
|
262
264
|
}),
|
|
263
265
|
onConfirm: () => S(o),
|
|
264
|
-
children: /* @__PURE__ */
|
|
266
|
+
children: /* @__PURE__ */ n(Q, {
|
|
265
267
|
style: {
|
|
266
268
|
fontSize: "18px"
|
|
267
269
|
},
|
|
@@ -272,10 +274,10 @@ const yt = nt((k, r) => {
|
|
|
272
274
|
})]
|
|
273
275
|
}), /* @__PURE__ */ A("div", {
|
|
274
276
|
className: "session-item-bottom",
|
|
275
|
-
children: [/* @__PURE__ */
|
|
277
|
+
children: [/* @__PURE__ */ n("span", {
|
|
276
278
|
className: "item-bottom-desc",
|
|
277
|
-
children: ((
|
|
278
|
-
}), /* @__PURE__ */
|
|
279
|
+
children: ((g = o.data) == null ? void 0 : g.finialMessage) || "-"
|
|
280
|
+
}), /* @__PURE__ */ n("span", {
|
|
279
281
|
className: "item-bottom-time",
|
|
280
282
|
children: N((M = o.data) == null ? void 0 : M.createdAt).format("MM/DD HH:mm:ss")
|
|
281
283
|
})]
|
|
@@ -289,7 +291,7 @@ const yt = nt((k, r) => {
|
|
|
289
291
|
})
|
|
290
292
|
});
|
|
291
293
|
});
|
|
292
|
-
|
|
294
|
+
vt.displayName = "SessionList";
|
|
293
295
|
export {
|
|
294
|
-
|
|
296
|
+
vt as default
|
|
295
297
|
};
|
package/dist/es/Dialog/index.mjs
CHANGED
|
@@ -2,29 +2,29 @@ var q = Object.defineProperty, z = Object.defineProperties;
|
|
|
2
2
|
var B = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var R = Object.getOwnPropertySymbols;
|
|
4
4
|
var F = Object.prototype.hasOwnProperty, G = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var j = (i, t,
|
|
6
|
-
for (var
|
|
7
|
-
F.call(t,
|
|
5
|
+
var j = (i, t, s) => t in i ? q(i, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : i[t] = s, A = (i, t) => {
|
|
6
|
+
for (var s in t || (t = {}))
|
|
7
|
+
F.call(t, s) && j(i, s, t[s]);
|
|
8
8
|
if (R)
|
|
9
|
-
for (var
|
|
10
|
-
G.call(t,
|
|
9
|
+
for (var s of R(t))
|
|
10
|
+
G.call(t, s) && j(i, s, t[s]);
|
|
11
11
|
return i;
|
|
12
12
|
}, H = (i, t) => z(i, B(t));
|
|
13
|
-
var p = (i, t,
|
|
14
|
-
var
|
|
13
|
+
var p = (i, t, s) => new Promise((l, y) => {
|
|
14
|
+
var n = (e) => {
|
|
15
15
|
try {
|
|
16
|
-
f(
|
|
16
|
+
f(s.next(e));
|
|
17
17
|
} catch (v) {
|
|
18
18
|
y(v);
|
|
19
19
|
}
|
|
20
20
|
}, a = (e) => {
|
|
21
21
|
try {
|
|
22
|
-
f(
|
|
22
|
+
f(s.throw(e));
|
|
23
23
|
} catch (v) {
|
|
24
24
|
y(v);
|
|
25
25
|
}
|
|
26
|
-
}, f = (e) => e.done ? l(e.value) : Promise.resolve(e.value).then(
|
|
27
|
-
f((
|
|
26
|
+
}, f = (e) => e.done ? l(e.value) : Promise.resolve(e.value).then(n, a);
|
|
27
|
+
f((s = s.apply(i, t)).next());
|
|
28
28
|
});
|
|
29
29
|
import { jsx as r, jsxs as K } from "react/jsx-runtime";
|
|
30
30
|
import { forwardRef as J, useState as u, useContext as M, useRef as Q, useEffect as w, useImperativeHandle as T } from "react";
|
|
@@ -34,10 +34,10 @@ import Y from "../components/KnowledgeList/index.mjs";
|
|
|
34
34
|
import Z from "../components/Sider/index.mjs";
|
|
35
35
|
/* empty css */const ie = J((i, t) => {
|
|
36
36
|
const {
|
|
37
|
-
sessionId:
|
|
37
|
+
sessionId: s,
|
|
38
38
|
appId: l,
|
|
39
39
|
docViewerUrl: y
|
|
40
|
-
} = i, [
|
|
40
|
+
} = i, [n, a] = u(), {
|
|
41
41
|
showHeader: f,
|
|
42
42
|
agentClient: e,
|
|
43
43
|
sider: v,
|
|
@@ -47,8 +47,8 @@ import Z from "../components/Sider/index.mjs";
|
|
|
47
47
|
} = M(W), [h, O] = u(), I = Q(null), [P, U] = u(""), [N, k] = u(), [b, S] = u(!1), [E, L] = u([]);
|
|
48
48
|
w(() => {
|
|
49
49
|
var d;
|
|
50
|
-
S(
|
|
51
|
-
}, [
|
|
50
|
+
S(n ? !!((d = n.data) != null && d.netOpen) : typeof (c == null ? void 0 : c.connectNetwork) == "object" && typeof (c == null ? void 0 : c.connectNetwork.default) == "boolean" ? c.connectNetwork.default : !1);
|
|
51
|
+
}, [n]), w(() => {
|
|
52
52
|
const d = () => p(void 0, null, function* () {
|
|
53
53
|
const o = e == null ? void 0 : e.application;
|
|
54
54
|
if (!(o != null && o.id))
|
|
@@ -67,15 +67,15 @@ import Z from "../components/Sider/index.mjs";
|
|
|
67
67
|
e == null || e.removeEventListener("ready", d);
|
|
68
68
|
};
|
|
69
69
|
}, [e]), w(() => {
|
|
70
|
-
e &&
|
|
71
|
-
a == null || a(d.find((o) => o.id ===
|
|
70
|
+
e && s && (e.ready ? e == null || e.getSessions().then((d) => p(void 0, null, function* () {
|
|
71
|
+
a == null || a(d.find((o) => o.id === s));
|
|
72
72
|
})) : e.addEventListener("ready", () => p(void 0, null, function* () {
|
|
73
73
|
e == null || e.getSessions().then((d) => p(void 0, null, function* () {
|
|
74
|
-
a == null || a(d.find((o) => o.id ===
|
|
74
|
+
a == null || a(d.find((o) => o.id === s));
|
|
75
75
|
}));
|
|
76
76
|
}), !0));
|
|
77
|
-
}, [e,
|
|
78
|
-
if (!
|
|
77
|
+
}, [e, s]), w(() => {
|
|
78
|
+
if (!n) {
|
|
79
79
|
m && m({
|
|
80
80
|
applicationId: l,
|
|
81
81
|
sessionId: "",
|
|
@@ -84,20 +84,20 @@ import Z from "../components/Sider/index.mjs";
|
|
|
84
84
|
});
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
|
-
|
|
87
|
+
n.data && m && m({
|
|
88
88
|
applicationId: l,
|
|
89
|
-
sessionId:
|
|
90
|
-
session:
|
|
91
|
-
sessionInstance:
|
|
92
|
-
}),
|
|
93
|
-
|
|
89
|
+
sessionId: n.data.id,
|
|
90
|
+
session: n.data,
|
|
91
|
+
sessionInstance: n
|
|
92
|
+
}), n.addEventListener("data:loaded", () => {
|
|
93
|
+
n != null && n.data && m && m({
|
|
94
94
|
applicationId: l,
|
|
95
|
-
sessionId:
|
|
96
|
-
session:
|
|
97
|
-
sessionInstance:
|
|
95
|
+
sessionId: n.data.id,
|
|
96
|
+
session: n.data,
|
|
97
|
+
sessionInstance: n
|
|
98
98
|
});
|
|
99
99
|
}, !0);
|
|
100
|
-
}, [
|
|
100
|
+
}, [n]);
|
|
101
101
|
const x = (d) => {
|
|
102
102
|
var o;
|
|
103
103
|
return (o = I.current) == null ? void 0 : o.create(H(A({}, d), {
|
|
@@ -124,13 +124,14 @@ import Z from "../components/Sider/index.mjs";
|
|
|
124
124
|
ref: I,
|
|
125
125
|
appId: l,
|
|
126
126
|
networkStatus: b,
|
|
127
|
-
currentSession:
|
|
127
|
+
currentSession: n,
|
|
128
128
|
application: h,
|
|
129
129
|
setCurrentSession: a,
|
|
130
130
|
checkKnowledges: N,
|
|
131
131
|
setCheckKnowledges: f ? k : void 0,
|
|
132
132
|
sessions: E,
|
|
133
|
-
setSessions: L
|
|
133
|
+
setSessions: L,
|
|
134
|
+
sessionId: s
|
|
134
135
|
})
|
|
135
136
|
}), /* @__PURE__ */ r("div", {
|
|
136
137
|
className: "dialog-content",
|
|
@@ -141,7 +142,7 @@ import Z from "../components/Sider/index.mjs";
|
|
|
141
142
|
children: /* @__PURE__ */ r(Y, {
|
|
142
143
|
setCheckKnowledges: k,
|
|
143
144
|
application: h,
|
|
144
|
-
currentSession:
|
|
145
|
+
currentSession: n
|
|
145
146
|
})
|
|
146
147
|
}), /* @__PURE__ */ r("div", {
|
|
147
148
|
className: "dialog-chat-content",
|
|
@@ -149,7 +150,7 @@ import Z from "../components/Sider/index.mjs";
|
|
|
149
150
|
setNetworkStatus: S,
|
|
150
151
|
networkStatus: b,
|
|
151
152
|
application: h,
|
|
152
|
-
currentSession:
|
|
153
|
+
currentSession: n,
|
|
153
154
|
onCreateSession: x,
|
|
154
155
|
docViewerUrl: y,
|
|
155
156
|
embeddingService: P,
|