@glodon-aiot/agent-cli-ui 3.8.0-alpha.4 → 3.8.0-alpha.5

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.
@@ -1,253 +1,265 @@
1
- var ut = Object.defineProperty;
2
- var Z = Object.getOwnPropertySymbols;
3
- var Nt = Object.prototype.hasOwnProperty, wt = Object.prototype.propertyIsEnumerable;
4
- var tt = (u, m, e) => m in u ? ut(u, m, { enumerable: !0, configurable: !0, writable: !0, value: e }) : u[m] = e, et = (u, m) => {
5
- for (var e in m || (m = {}))
6
- Nt.call(m, e) && tt(u, e, m[e]);
7
- if (Z)
8
- for (var e of Z(m))
9
- wt.call(m, e) && tt(u, e, m[e]);
10
- return u;
1
+ var Et = Object.defineProperty;
2
+ var et = Object.getOwnPropertySymbols;
3
+ var wt = Object.prototype.hasOwnProperty, At = Object.prototype.propertyIsEnumerable;
4
+ var at = (E, f, e) => f in E ? Et(E, f, { enumerable: !0, configurable: !0, writable: !0, value: e }) : E[f] = e, ot = (E, f) => {
5
+ for (var e in f || (f = {}))
6
+ wt.call(f, e) && at(E, e, f[e]);
7
+ if (et)
8
+ for (var e of et(f))
9
+ At.call(f, e) && at(E, e, f[e]);
10
+ return E;
11
11
  };
12
- var _ = (u, m, e) => new Promise((l, b) => {
13
- var k = (N) => {
12
+ var x = (E, f, e) => new Promise((l, b) => {
13
+ var k = (w) => {
14
14
  try {
15
- O(e.next(N));
16
- } catch (L) {
17
- b(L);
15
+ O(e.next(w));
16
+ } catch (M) {
17
+ b(M);
18
18
  }
19
- }, H = (N) => {
19
+ }, B = (w) => {
20
20
  try {
21
- O(e.throw(N));
22
- } catch (L) {
23
- b(L);
21
+ O(e.throw(w));
22
+ } catch (M) {
23
+ b(M);
24
24
  }
25
- }, O = (N) => N.done ? l(N.value) : Promise.resolve(N.value).then(k, H);
26
- O((e = e.apply(u, m)).next());
25
+ }, O = (w) => w.done ? l(w.value) : Promise.resolve(w.value).then(k, B);
26
+ O((e = e.apply(E, f)).next());
27
27
  });
28
- import { jsx as r, jsxs as M } from "react/jsx-runtime";
29
- import { forwardRef as At, useState as x, useContext as Et, useEffect as C, useImperativeHandle as kt, useMemo as bt } from "react";
30
- import { Button as Ot, Typography as Mt, Space as at, Popconfirm as ot, Input as Lt } from "antd";
31
- import h from "dayjs";
28
+ import { jsx as c, jsxs as L } from "react/jsx-runtime";
29
+ import { forwardRef as kt, useState as _, useContext as bt, useEffect as T, useImperativeHandle as Ot, useMemo as Lt } from "react";
30
+ import { Button as Mt, Typography as xt, Space as dt, Popconfirm as nt, Input as Ct, notification as F } from "antd";
31
+ import y from "dayjs";
32
32
  import _t from "classnames";
33
- import dt from "../../components/Iconfont/index.mjs";
33
+ import it from "../../components/Iconfont/index.mjs";
34
34
  import jt from "../../context.mjs";
35
- /* empty css */import { useMemoizedFn as nt } from "ahooks";
36
- import { MAX_KNOWLEDGES_AND_FILES_COUNT as T, NET_OPEN_STATUS as it } from "../../constant.mjs";
37
- import { useSessionState as xt } from "../../hooks/useSessionState.mjs";
38
- import { calcKnowledgesLeafCount as lt } from "../../utils/index.mjs";
39
- const F = 15, Pt = At((u, m) => {
35
+ /* empty css */import { useMemoizedFn as lt } from "ahooks";
36
+ import { MAX_KNOWLEDGES_AND_FILES_COUNT as D, NET_OPEN_STATUS as rt } from "../../constant.mjs";
37
+ import { useSessionState as Pt } from "../../hooks/useSessionState.mjs";
38
+ import { calcKnowledgesLeafCount as st } from "../../utils/index.mjs";
39
+ const K = 15, Tt = kt((E, f) => {
40
40
  const {
41
41
  currentSession: e,
42
42
  setCurrentSession: l,
43
43
  checkKnowledges: b,
44
44
  application: k,
45
- networkStatus: H,
45
+ networkStatus: B,
46
46
  isShowHeader: O = !0,
47
- afterSessionClick: N,
48
- sessionId: L
49
- } = u, [D, Y] = x(), {
50
- agentClient: v,
51
- mode: st,
52
- features: o
53
- } = Et(jt), [K, B] = x(b), {
54
- sessions: j,
55
- setSessions: P
56
- } = xt(), [R, $] = x(0), [ct, S] = x(""), [rt, G] = x(null), U = nt((t) => {
57
- t.id && P((a) => [...a.map((n) => {
58
- var s;
59
- return ((s = n.data) == null ? void 0 : s.id) === t.id && (n.data = et({}, t)), n;
60
- })].sort((n, s) => {
61
- var E, w;
62
- const g = h((E = n.data) == null ? void 0 : E.createdAt).valueOf();
63
- return h((w = s.data) == null ? void 0 : w.createdAt).valueOf() - g;
47
+ afterSessionClick: w,
48
+ sessionId: M
49
+ } = E, [Y, $] = _(), {
50
+ agentClient: u,
51
+ mode: ct,
52
+ features: o,
53
+ popupContainer: V
54
+ } = bt(jt), [R, G] = _(b), {
55
+ sessions: C,
56
+ setSessions: j
57
+ } = Pt(), [U, H] = _(0), [mt, P] = _(""), [ft, z] = _(null), X = lt((t) => {
58
+ t.id && j((a) => [...a.map((d) => {
59
+ var r;
60
+ return ((r = d.data) == null ? void 0 : r.id) === t.id && (d.data = ot({}, t)), d;
61
+ })].sort((d, r) => {
62
+ var N, A;
63
+ const m = y((N = d.data) == null ? void 0 : N.createdAt).valueOf();
64
+ return y((A = r.data) == null ? void 0 : A.createdAt).valueOf() - m;
64
65
  }));
65
66
  });
66
- C(() => {
67
- v == null || v.getSessions().then((t) => _(void 0, null, function* () {
67
+ T(() => {
68
+ u == null || u.getSessions().then((t) => x(void 0, null, function* () {
68
69
  var a;
69
- if (P([...t]), !((a = e == null ? void 0 : e.data) != null && a.id) && (t != null && t.length) && st === "inlay") {
70
- const d = t[0];
71
- L || l == null || l(d);
70
+ if (j([...t]), !((a = e == null ? void 0 : e.data) != null && a.id) && (t != null && t.length) && ct === "inlay") {
71
+ const n = t[0];
72
+ M || l == null || l(n);
72
73
  } else
73
- e === void 0 && (L || l == null || l(null));
74
+ e === void 0 && (M || l == null || l(null));
74
75
  }));
75
- }, []), C(() => {
76
+ }, []), T(() => {
76
77
  var t;
77
78
  if (!((t = e == null ? void 0 : e.data) != null && t.id) && b === void 0) {
78
79
  const a = typeof (o == null ? void 0 : o.knowledges) == "object" && o.knowledges.default || void 0;
79
- if (Array.isArray(a) && a.some((n) => Array.isArray(n.fileIds) && n.fileIds.length === 0))
80
+ if (Array.isArray(a) && a.some((d) => Array.isArray(d.fileIds) && d.fileIds.length === 0))
80
81
  throw Error("fileIds cannot be an empty array");
81
- if (lt(a || []) > T)
82
- throw Error(`knowledges and fileIds total count cannot exceed ${T}`);
83
- B(a);
82
+ if (st(a || []) > D)
83
+ throw Error(`knowledges and fileIds total count cannot exceed ${D}`);
84
+ G(a);
84
85
  return;
85
86
  }
86
- B(b);
87
- }, [b]), C(() => {
88
- e == null || e.addEventListener("data:updated", U);
89
- }, [e]), kt(m, () => ({
87
+ G(b);
88
+ }, [b]), T(() => {
89
+ e == null || e.addEventListener("data:updated", X);
90
+ }, [e]), Ot(f, () => ({
90
91
  create(t) {
91
- return z(t).then((a) => (l == null || l(a), a));
92
+ return W(t).then((a) => (l == null || l(a), a));
92
93
  },
93
- list: () => Promise.resolve(j)
94
+ list: () => Promise.resolve(C)
94
95
  }));
95
- const z = (t) => {
96
+ const W = (t) => {
96
97
  const a = typeof (o == null ? void 0 : o.connectNetwork) == "object" && typeof (o == null ? void 0 : o.connectNetwork.default) == "boolean" ? o.connectNetwork.default : !1;
97
- return new Promise((d) => _(void 0, null, function* () {
98
- var s;
99
- const f = typeof (o == null ? void 0 : o.promptVariables) == "object" ? (o == null ? void 0 : o.promptVariables.default) || [] : void 0, n = yield v == null ? void 0 : v.loadSession("", {
98
+ return new Promise((n) => x(void 0, null, function* () {
99
+ var m;
100
+ const p = typeof (o == null ? void 0 : o.promptVariables) == "object" ? (o == null ? void 0 : o.promptVariables.default) || [] : void 0, d = yield u == null ? void 0 : u.loadSession("", {
100
101
  name: t == null ? void 0 : t.name,
101
102
  // @ts-ignore netOpen入参是number 响应是boolen
102
103
  // 只有对话有联网 其它没有
103
104
  // 不传netOpen会默认取defaultNetOpen
104
- netOpen: (k == null ? void 0 : k.type) === 0 ? t != null && t.netOpen ? t.netOpen : a ? it.OPEN : it.CLOSE : void 0,
105
- knowledges: (s = e == null ? void 0 : e.data) != null && s.id ? t == null ? void 0 : t.knowledges : K,
106
- promptVariables: f
107
- });
108
- n == null || n.addEventListener("data:created", () => _(void 0, null, function* () {
109
- P([n, ...j]), d(n);
105
+ netOpen: (k == null ? void 0 : k.type) === 0 ? t != null && t.netOpen ? t.netOpen : a ? rt.OPEN : rt.CLOSE : void 0,
106
+ knowledges: (m = e == null ? void 0 : e.data) != null && m.id ? t == null ? void 0 : t.knowledges : R,
107
+ promptVariables: p
108
+ }), r = (g) => {
109
+ var N;
110
+ F.config({
111
+ getContainer: () => (V == null ? void 0 : V.current) || document.body,
112
+ prefixCls: "gbot-notification"
113
+ }), F.error({
114
+ message: ((N = g.cause) == null ? void 0 : N.message) || g.message
115
+ }), F.config({
116
+ getContainer: void 0,
117
+ prefixCls: "gbot-notification"
118
+ });
119
+ };
120
+ d == null || d.addEventListener("error", r), d == null || d.addEventListener("data:created", () => x(void 0, null, function* () {
121
+ d == null || d.removeEventListener("error", r), j([d, ...C]), n(d);
110
122
  }));
111
123
  }));
112
- }, mt = () => {
113
- z({
114
- knowledges: K
124
+ }, pt = () => {
125
+ W({
126
+ knowledges: R
115
127
  }).then((t) => {
116
128
  l == null || l(t);
117
129
  });
118
- }, ft = (t) => {
119
- v == null || v.removeSession(t, !0).then(() => _(void 0, null, function* () {
120
- var d, f;
121
- const a = j.filter((n) => {
122
- var s, g;
123
- return ((s = n.data) == null ? void 0 : s.id) !== ((g = t.data) == null ? void 0 : g.id);
130
+ }, ht = (t) => {
131
+ u == null || u.removeSession(t, !0).then(() => x(void 0, null, function* () {
132
+ var n, p;
133
+ const a = C.filter((d) => {
134
+ var r, m;
135
+ return ((r = d.data) == null ? void 0 : r.id) !== ((m = t.data) == null ? void 0 : m.id);
124
136
  });
125
- ((d = t.data) == null ? void 0 : d.id) === ((f = e == null ? void 0 : e.data) == null ? void 0 : f.id) && (a != null && a.length ? l == null || l(a[0]) : l == null || l(null)), P([...a]);
137
+ ((n = t.data) == null ? void 0 : n.id) === ((p = e == null ? void 0 : e.data) == null ? void 0 : p.id) && (a != null && a.length ? l == null || l(a[0]) : l == null || l(null)), j([...a]);
126
138
  }));
127
- }, pt = (t) => {
128
- var a, d;
129
- Y((a = t.data) == null ? void 0 : a.name), S(""), G(((d = t.data) == null ? void 0 : d.id) || null);
130
- }, ht = (t) => {
131
- const a = W(D || "");
139
+ }, yt = (t) => {
140
+ var a, n;
141
+ $((a = t.data) == null ? void 0 : a.name), P(""), z(((n = t.data) == null ? void 0 : n.id) || null);
142
+ }, gt = (t) => {
143
+ const a = J(Y || "");
132
144
  if (a) {
133
- S(a);
145
+ P(a);
134
146
  return;
135
147
  }
136
- t.rename(D.trim()), t == null || t.addEventListener("data:updated", U), X();
137
- }, yt = () => {
138
- X();
139
- }, X = () => {
140
- G(null), Y(""), S(""), $((t) => t + 1);
141
- }, W = (t) => !t || t.trim().length === 0 ? "会话名称不能为空" : t.length > F ? `不能超过${F}个字符` : "", vt = (t) => _(void 0, null, function* () {
142
- l == null || l(t), N == null || N(t);
143
- }), gt = (t) => {
148
+ t.rename(Y.trim()), t == null || t.addEventListener("data:updated", X), q();
149
+ }, vt = () => {
150
+ q();
151
+ }, q = () => {
152
+ z(null), $(""), P(""), H((t) => t + 1);
153
+ }, J = (t) => !t || t.trim().length === 0 ? "会话名称不能为空" : t.length > K ? `不能超过${K}个字符` : "", ut = (t) => x(void 0, null, function* () {
154
+ l == null || l(t), w == null || w(t);
155
+ }), Nt = (t) => {
144
156
  const a = t.target.value;
145
- Y(a), S(W(a));
157
+ $(a), P(J(a));
146
158
  };
147
- C(() => {
148
- var a, d, f, n;
159
+ T(() => {
160
+ var a, n, p, d;
149
161
  if (!(e != null && e.id))
150
162
  return;
151
163
  const t = {};
152
164
  if (typeof (o == null ? void 0 : o.knowledges) == "object" && ((a = o == null ? void 0 : o.knowledges) != null && a.default)) {
153
- if (t.knowledges = (d = o == null ? void 0 : o.knowledges) == null ? void 0 : d.default, Array.isArray(t.knowledges) && t.knowledges.some((A) => Array.isArray(A.fileIds) && A.fileIds.length === 0))
165
+ if (t.knowledges = (n = o == null ? void 0 : o.knowledges) == null ? void 0 : n.default, Array.isArray(t.knowledges) && t.knowledges.some((g) => Array.isArray(g.fileIds) && g.fileIds.length === 0))
154
166
  throw Error("fileIds cannot be an empty array");
155
- if (lt(t.knowledges) > T)
156
- throw Error(`knowledges and fileIds total count cannot exceed ${T}`);
167
+ if (st(t.knowledges) > D)
168
+ throw Error(`knowledges and fileIds total count cannot exceed ${D}`);
157
169
  }
158
- typeof (o == null ? void 0 : o.promptVariables) == "object" && ((f = o == null ? void 0 : o.promptVariables) != null && f.default) && (t.promptVariables = (n = o == null ? void 0 : o.promptVariables) == null ? void 0 : n.default), v == null || v.loadSession(e.id, t);
170
+ typeof (o == null ? void 0 : o.promptVariables) == "object" && ((p = o == null ? void 0 : o.promptVariables) != null && p.default) && (t.promptVariables = (d = o == null ? void 0 : o.promptVariables) == null ? void 0 : d.default), u == null || u.loadSession(e.id, t);
159
171
  }, [e]);
160
- const q = nt((t) => {
161
- const a = h().endOf("day"), d = a.subtract(1, "day"), f = a.subtract(7, "day"), n = a.subtract(30, "day"), s = [], g = [], A = [], E = [], w = {};
162
- return t.forEach((c) => {
163
- var y;
164
- const i = h((y = c.data) == null ? void 0 : y.createdAt);
165
- if (i.isAfter(d))
166
- g.push(c);
167
- else if (i.isAfter(f))
168
- A.push(c);
169
- else if (i.isAfter(n))
170
- E.push(c);
172
+ const Q = lt((t) => {
173
+ const a = y().endOf("day"), n = a.subtract(1, "day"), p = a.subtract(7, "day"), d = a.subtract(30, "day"), r = [], m = [], g = [], N = [], A = {};
174
+ return t.forEach((s) => {
175
+ var v;
176
+ const i = y((v = s.data) == null ? void 0 : v.createdAt);
177
+ if (i.isAfter(n))
178
+ m.push(s);
179
+ else if (i.isAfter(p))
180
+ g.push(s);
181
+ else if (i.isAfter(d))
182
+ N.push(s);
171
183
  else {
172
- const p = i.format("YYYY-MM");
173
- w[p] || (w[p] = []), w[p].push(c);
184
+ const h = i.format("YYYY-MM");
185
+ A[h] || (A[h] = []), A[h].push(s);
174
186
  }
175
- }), g.length > 0 && s.push({
187
+ }), m.length > 0 && r.push({
176
188
  title: "今天",
177
- sessions: g.sort((c, i) => {
178
- var y, p;
179
- return h((y = i.data) == null ? void 0 : y.createdAt).valueOf() - h((p = c.data) == null ? void 0 : p.createdAt).valueOf();
189
+ sessions: m.sort((s, i) => {
190
+ var v, h;
191
+ return y((v = i.data) == null ? void 0 : v.createdAt).valueOf() - y((h = s.data) == null ? void 0 : h.createdAt).valueOf();
180
192
  }),
181
193
  key: "today"
182
- }), A.length > 0 && s.push({
194
+ }), g.length > 0 && r.push({
183
195
  title: "7天内",
184
- sessions: A.sort((c, i) => {
185
- var y, p;
186
- return h((y = i.data) == null ? void 0 : y.createdAt).valueOf() - h((p = c.data) == null ? void 0 : p.createdAt).valueOf();
196
+ sessions: g.sort((s, i) => {
197
+ var v, h;
198
+ return y((v = i.data) == null ? void 0 : v.createdAt).valueOf() - y((h = s.data) == null ? void 0 : h.createdAt).valueOf();
187
199
  }),
188
200
  key: "seven-days"
189
- }), E.length > 0 && s.push({
201
+ }), N.length > 0 && r.push({
190
202
  title: "30天内",
191
- sessions: E.sort((c, i) => {
192
- var y, p;
193
- return h((y = i.data) == null ? void 0 : y.createdAt).valueOf() - h((p = c.data) == null ? void 0 : p.createdAt).valueOf();
203
+ sessions: N.sort((s, i) => {
204
+ var v, h;
205
+ return y((v = i.data) == null ? void 0 : v.createdAt).valueOf() - y((h = s.data) == null ? void 0 : h.createdAt).valueOf();
194
206
  }),
195
207
  key: "thirty-days"
196
- }), Object.keys(w).sort((c, i) => i.localeCompare(c)).forEach((c) => {
197
- const i = w[c].sort((y, p) => {
198
- var J, Q;
199
- return h((J = p.data) == null ? void 0 : J.createdAt).valueOf() - h((Q = y.data) == null ? void 0 : Q.createdAt).valueOf();
208
+ }), Object.keys(A).sort((s, i) => i.localeCompare(s)).forEach((s) => {
209
+ const i = A[s].sort((v, h) => {
210
+ var Z, tt;
211
+ return y((Z = h.data) == null ? void 0 : Z.createdAt).valueOf() - y((tt = v.data) == null ? void 0 : tt.createdAt).valueOf();
200
212
  });
201
- s.push({
202
- title: h(c).format("YYYY年MM月"),
213
+ r.push({
214
+ title: y(s).format("YYYY年MM月"),
203
215
  sessions: i,
204
- key: `month-${c}`
216
+ key: `month-${s}`
205
217
  });
206
- }), s;
207
- }), V = bt(() => q(j), [j, q]);
208
- return /* @__PURE__ */ r("div", {
218
+ }), r;
219
+ }), I = Lt(() => Q(C), [C, Q]);
220
+ return /* @__PURE__ */ c("div", {
209
221
  className: "bot-session-container",
210
- children: /* @__PURE__ */ M("div", {
222
+ children: /* @__PURE__ */ L("div", {
211
223
  className: "agent-sessions",
212
- children: [O && (o == null ? void 0 : o.siderTitle) && /* @__PURE__ */ r("div", {
224
+ children: [O && (o == null ? void 0 : o.siderTitle) && /* @__PURE__ */ c("div", {
213
225
  className: "sessions-header",
214
- children: /* @__PURE__ */ r("div", {
226
+ children: /* @__PURE__ */ c("div", {
215
227
  className: "session-header-title",
216
228
  children: (k == null ? void 0 : k.name) || "-"
217
229
  })
218
- }), /* @__PURE__ */ M("div", {
230
+ }), /* @__PURE__ */ L("div", {
219
231
  className: "sessions-main",
220
- children: [O && /* @__PURE__ */ r("div", {
232
+ children: [O && /* @__PURE__ */ c("div", {
221
233
  className: "session-header-btn-wrapper",
222
- children: /* @__PURE__ */ r(Ot, {
234
+ children: /* @__PURE__ */ c(Mt, {
223
235
  className: "session-header-btn",
224
- onClick: mt,
236
+ onClick: pt,
225
237
  type: "primary",
226
238
  children: "+ 新会话"
227
239
  })
228
- }), V == null ? void 0 : V.map((t) => {
240
+ }), I == null ? void 0 : I.map((t) => {
229
241
  var a;
230
- return /* @__PURE__ */ M("div", {
242
+ return /* @__PURE__ */ L("div", {
231
243
  className: "session-group",
232
- children: [/* @__PURE__ */ r("div", {
244
+ children: [/* @__PURE__ */ c("div", {
233
245
  className: "group-header",
234
246
  style: {
235
247
  top: O ? 48 : 0
236
248
  },
237
249
  children: t.title
238
- }), (a = t.sessions) == null ? void 0 : a.map((d) => {
239
- var f, n, s, g, A, E, w, I, c;
240
- return /* @__PURE__ */ r("div", {
250
+ }), (a = t.sessions) == null ? void 0 : a.map((n) => {
251
+ var p, d, r, m, g, N, A, S, s;
252
+ return /* @__PURE__ */ c("div", {
241
253
  className: _t({
242
254
  "session-item": !0,
243
- "session-item__active": ((f = d.data) == null ? void 0 : f.id) === ((n = e == null ? void 0 : e.data) == null ? void 0 : n.id)
255
+ "session-item__active": ((p = n.data) == null ? void 0 : p.id) === ((d = e == null ? void 0 : e.data) == null ? void 0 : d.id)
244
256
  }),
245
- onClick: () => vt(d),
246
- children: /* @__PURE__ */ r("div", {
257
+ onClick: () => ut(n),
258
+ children: /* @__PURE__ */ c("div", {
247
259
  className: "session-item-wrapper",
248
- children: /* @__PURE__ */ M("div", {
260
+ children: /* @__PURE__ */ L("div", {
249
261
  className: "session-item-top",
250
- children: [/* @__PURE__ */ r(Mt.Paragraph, {
262
+ children: [/* @__PURE__ */ c(xt.Paragraph, {
251
263
  className: "item-top-title",
252
264
  style: {
253
265
  margin: 0,
@@ -256,71 +268,71 @@ const F = 15, Pt = At((u, m) => {
256
268
  ellipsis: {
257
269
  rows: 1,
258
270
  tooltip: {
259
- title: ((s = d.data) == null ? void 0 : s.name) || "-",
271
+ title: ((r = n.data) == null ? void 0 : r.name) || "-",
260
272
  placement: "topLeft"
261
273
  }
262
274
  },
263
- children: ((g = d.data) == null ? void 0 : g.name) || "-"
264
- }), /* @__PURE__ */ M(at, {
265
- children: [/* @__PURE__ */ r("span", {
275
+ children: ((m = n.data) == null ? void 0 : m.name) || "-"
276
+ }), /* @__PURE__ */ L(dt, {
277
+ children: [/* @__PURE__ */ c("span", {
266
278
  className: "item-top-time",
267
- children: h((A = d.data) == null ? void 0 : A.createdAt).format("MM/DD HH:mm:ss")
268
- }), /* @__PURE__ */ M("div", {
279
+ children: y((g = n.data) == null ? void 0 : g.createdAt).format("MM/DD HH:mm:ss")
280
+ }), /* @__PURE__ */ L("div", {
269
281
  className: "item-top-action",
270
282
  onClick: (i) => i.stopPropagation(),
271
- children: [/* @__PURE__ */ r(ot, {
272
- open: rt === ((E = d.data) == null ? void 0 : E.id),
283
+ children: [/* @__PURE__ */ c(nt, {
284
+ open: ft === ((N = n.data) == null ? void 0 : N.id),
273
285
  getPopupContainer: (i) => i.parentNode,
274
286
  icon: !1,
275
- title: /* @__PURE__ */ r(Lt, {
287
+ title: /* @__PURE__ */ c(Ct, {
276
288
  placeholder: "请输入内容",
277
289
  autoComplete: "off",
278
290
  showCount: !0,
279
- value: D,
280
- onChange: gt,
281
- maxLength: F,
282
- status: ct ? "error" : ""
291
+ value: Y,
292
+ onChange: Nt,
293
+ maxLength: K,
294
+ status: mt ? "error" : ""
283
295
  }),
284
- onConfirm: () => ht(d),
285
- onCancel: yt,
286
- children: /* @__PURE__ */ r(dt, {
296
+ onConfirm: () => gt(n),
297
+ onCancel: vt,
298
+ children: /* @__PURE__ */ c(it, {
287
299
  type: "icon-bianji2",
288
- onClick: () => pt(d),
300
+ onClick: () => yt(n),
289
301
  className: "icon-action",
290
302
  style: {
291
303
  marginRight: "8px"
292
304
  }
293
305
  })
294
- }, `edit-${(w = d.data) == null ? void 0 : w.id}-${R}`), /* @__PURE__ */ r(ot, {
306
+ }, `edit-${(A = n.data) == null ? void 0 : A.id}-${U}`), /* @__PURE__ */ c(nt, {
295
307
  getPopupContainer: (i) => i.parentNode,
296
308
  icon: !1,
297
- title: /* @__PURE__ */ M(at, {
309
+ title: /* @__PURE__ */ L(dt, {
298
310
  direction: "vertical",
299
- children: [/* @__PURE__ */ r("div", {
311
+ children: [/* @__PURE__ */ c("div", {
300
312
  children: "删除确认?"
301
- }), /* @__PURE__ */ r("div", {
313
+ }), /* @__PURE__ */ c("div", {
302
314
  children: "会话删除后不可恢复,请确认是否删除!"
303
315
  })]
304
316
  }),
305
317
  onConfirm: () => {
306
- ft(d), $((i) => i + 1);
318
+ ht(n), H((i) => i + 1);
307
319
  },
308
320
  onCancel: () => {
309
- $((i) => i + 1);
321
+ H((i) => i + 1);
310
322
  },
311
- children: /* @__PURE__ */ r(dt, {
323
+ children: /* @__PURE__ */ c(it, {
312
324
  style: {
313
325
  fontSize: "18px"
314
326
  },
315
327
  className: "icon-action",
316
328
  type: "icon-del"
317
329
  })
318
- }, `delete-${(I = d.data) == null ? void 0 : I.id}-${R}`)]
330
+ }, `delete-${(S = n.data) == null ? void 0 : S.id}-${U}`)]
319
331
  })]
320
332
  })]
321
333
  })
322
334
  })
323
- }, (c = d.data) == null ? void 0 : c.id);
335
+ }, (s = n.data) == null ? void 0 : s.id);
324
336
  })]
325
337
  }, t.key);
326
338
  })]
@@ -328,7 +340,7 @@ const F = 15, Pt = At((u, m) => {
328
340
  })
329
341
  });
330
342
  });
331
- Pt.displayName = "SessionList";
343
+ Tt.displayName = "SessionList";
332
344
  export {
333
- Pt as default
345
+ Tt as default
334
346
  };
@@ -1,4 +1,4 @@
1
- const e = "@glodon-aiot/agent-cli-ui", t = "3.8.0-alpha.4", s = "./dist/es/index.mjs", i = "./dist/lib/index.js", o = "./dist/src/index.d.ts", n = {
1
+ const e = "@glodon-aiot/agent-cli-ui", t = "3.8.0-alpha.5", s = "./dist/es/index.mjs", i = "./dist/lib/index.js", o = "./dist/src/index.d.ts", n = {
2
2
  import: "./dist/es/index.mjs",
3
3
  require: "./dist/lib/index.js",
4
4
  types: "./dist/src/index.d.ts"
@@ -25,8 +25,8 @@ const e = "@glodon-aiot/agent-cli-ui", t = "3.8.0-alpha.4", s = "./dist/es/index
25
25
  webpack: "*"
26
26
  }, p = {
27
27
  "@ant-design/icons": "^5.3.4",
28
- "@glodon-aiot/apis": "^3.8.0-alpha.4",
29
- "@glodon-aiot/bot-client-sdk": "^3.8.0-alpha.4",
28
+ "@glodon-aiot/apis": "^3.8.0-alpha.5",
29
+ "@glodon-aiot/bot-client-sdk": "^3.8.0-alpha.5",
30
30
  "@matejmazur/react-mathjax": "^0.1.10",
31
31
  "@react-pdf-viewer/core": "^3.12.0",
32
32
  "@react-pdf-viewer/default-layout": "^3.12.0",
@@ -1 +1 @@
1
- .gbot-dialog-modal .home-footer{background:#f5f5f5;width:100%;max-width:824px;margin:0 auto}.gbot-dialog-modal .home-footer .footer-warning{display:flex;justify-content:center;align-items:center;font-size:12px;font-weight:400;line-height:18px;text-align:left;color:#999}
1
+ .gbot-dialog-modal .session-refer{padding:12px 0;border-top:1px solid #e8e9eb}.gbot-dialog-modal .session-refer .session-refer-header{color:#070c14;margin-bottom:12px;height:18px;display:flex;align-items:center}.gbot-dialog-modal .session-refer .session-refer-header .refer-header-title{font-style:normal;font-weight:400;line-height:150%}.gbot-dialog-modal .session-refer .session-refer-content .refer-markdown p{color:#84868c;line-height:150%}.gbot-dialog-modal .session-refer .gbot-collapse-header{padding:4px 0!important}.gbot-dialog-modal .session-refer .gbot-collapse-content-box{padding:4px 10px 4px 24px!important}
@@ -1 +1 @@
1
- .gbot-dialog-modal .bot-session-container{height:100%}.gbot-dialog-modal .bot-session-container .agent-sessions{height:100%;width:310px;display:flex;flex-direction:column;overflow:hidden;background:white}.gbot-dialog-modal .bot-session-container .agent-sessions .sessions-header{height:56px;padding:0 16px;border-right:1px solid #e8e9eb;border-bottom:1px solid #e8e9eb;display:flex;justify-content:space-between;align-items:center}.gbot-dialog-modal .bot-session-container .agent-sessions .sessions-header .session-header-title{color:#151b26;font-size:18px;font-weight:700;line-height:24px}.gbot-dialog-modal .bot-session-container .agent-sessions .sessions-main{flex:1;border-right:1px solid #e8e9eb;overflow-y:auto}.gbot-dialog-modal .bot-session-container .agent-sessions .sessions-main .session-header-btn-wrapper{position:sticky;top:0;z-index:2;background-color:#fff;width:100%;height:48px}.gbot-dialog-modal .bot-session-container .agent-sessions .sessions-main .session-header-btn-wrapper .session-header-btn{width:70px;height:24px;padding:0;font-size:12px;border-radius:10px 10px 10px 2px;margin:16px 0 0 16px}.gbot-dialog-modal .bot-session-container .agent-sessions .sessions-main .session-group .group-header{padding:16px;font-size:14px;font-weight:700;background-color:#fff;position:sticky;z-index:1}.gbot-dialog-modal .bot-session-container .agent-sessions .sessions-main .session-item{width:100%;padding:8px 0;cursor:pointer;margin-bottom:4px}.gbot-dialog-modal .bot-session-container .agent-sessions .sessions-main .session-item .session-item-wrapper{width:100%;height:100%;padding:0 16px;height:26px;border-left:3px solid #f9f2ff}.gbot-dialog-modal .bot-session-container .agent-sessions .sessions-main .session-item .session-item-wrapper .session-item-top{font-size:14px;font-weight:700;line-height:22px;height:22px;width:100%;margin-bottom:4px;display:flex;justify-content:space-between}.gbot-dialog-modal .bot-session-container .agent-sessions .sessions-main .session-item .session-item-wrapper .session-item-top .item-top-title{max-width:calc(100% - 100px);margin-right:4px;color:#5c5f66}.gbot-dialog-modal .bot-session-container .agent-sessions .sessions-main .session-item .session-item-wrapper .session-item-top .item-top-time{display:flex;width:100px;color:#84868c;font-size:12px;line-height:22px;justify-content:flex-end}.gbot-dialog-modal .bot-session-container .agent-sessions .sessions-main .session-item .session-item-wrapper .session-item-top .item-top-action{display:none;font-size:12px;align-items:center}.gbot-dialog-modal .bot-session-container .agent-sessions .sessions-main .session-item .session-item-wrapper .session-item-top .item-top-action .icon-action{color:#9c24f2}.gbot-dialog-modal .bot-session-container .agent-sessions .sessions-main .session-item .session-item-wrapper .session-item-top .item-top-action .icon-action:hover{color:#b452ff}.gbot-dialog-modal .bot-session-container .agent-sessions .sessions-main .session-item__active{border-radius:4px;background:#f9f2ff}.gbot-dialog-modal .bot-session-container .agent-sessions .sessions-main .session-item__active .session-item-wrapper{border-left:3px solid #9c24f2}.gbot-dialog-modal .bot-session-container .agent-sessions .sessions-main .session-item:hover{border-radius:4px;background:#f9f2ff}.gbot-dialog-modal .bot-session-container .agent-sessions .sessions-main .session-item:hover .session-item-top .item-top-action{display:flex}
1
+ .gbot-dialog-modal .home-footer{background:#f5f5f5;width:100%;max-width:824px;margin:0 auto}.gbot-dialog-modal .home-footer .footer-warning{display:flex;justify-content:center;align-items:center;font-size:12px;font-weight:400;line-height:18px;text-align:left;color:#999}
@@ -1 +1 @@
1
- .gbot-dialog-modal .greeting{display:flex;flex-direction:column;align-items:center;flex:1;margin:0 auto;max-width:824px;width:100%;padding:16px 0}.gbot-dialog-modal .greeting-icon{width:74px;height:74px;border-radius:50%;box-shadow:0 6px 16px 2px #070c1414;padding:5px;margin-bottom:24px}.gbot-dialog-modal .greeting-icon img{width:64px;height:64px}.gbot-dialog-modal .greeting-word{font-weight:700;font-size:24px;line-height:30px;margin-bottom:24px}.gbot-dialog-modal .greeting-questions{width:100%;padding:0 12px}.gbot-dialog-modal.inlay .greeting{margin-top:40px}.gbot-dialog-modal.float .greeting{overflow-y:auto;flex:none}
1
+ .gbot-dialog-modal .file-preview{width:auto;border-radius:6px;border:1px solid #e8e9eb;background:#ffffff;position:relative;display:inline-block;max-height:80px}.gbot-dialog-modal .file-preview .file-icon{height:100%;width:48px}.gbot-dialog-modal .file-preview.small{height:30px;width:150px;padding:3px 6px 3px 3px}.gbot-dialog-modal .file-preview.small .file-icon{width:24px}.gbot-dialog-modal .file-preview .file-desc{flex:1;overflow:hidden}.gbot-dialog-modal .file-preview .file-desc .file-desc-name{color:#5c5f66;font-size:12px;font-style:normal;font-weight:700;line-height:150%;margin-bottom:4px}.gbot-dialog-modal .file-preview .file-action{position:absolute;right:-8px;top:-8px}.gbot-dialog-modal .file-preview .file-process{background-color:#f7f7f9;border-radius:8px;width:16px;height:16px;line-height:16px;text-align:center;display:inline-flex;align-items:center;justify-content:center}.gbot-dialog-modal .file-preview .file-remove{display:inline-block;border-radius:10px;width:20px;height:20px;line-height:20px;text-align:center;color:#84868c;border:1px solid #e8e9eb;display:inline-flex;align-items:center;justify-content:center;background-color:#f7f7f9}.gbot-dialog-modal .file-preview .file-remove:hover{background-color:#fff;color:#b452ff}.gbot-dialog-modal .file-remove-tooltip .gbot-tooltip-content .gbot-tooltip-inner{padding:12px}
@@ -1 +1 @@
1
- .gbot-dialog-modal .file-preview{width:auto;border-radius:6px;border:1px solid #e8e9eb;background:#ffffff;position:relative;display:inline-block;max-height:80px}.gbot-dialog-modal .file-preview .file-icon{height:100%;width:48px}.gbot-dialog-modal .file-preview.small{height:30px;width:150px;padding:3px 6px 3px 3px}.gbot-dialog-modal .file-preview.small .file-icon{width:24px}.gbot-dialog-modal .file-preview .file-desc{flex:1;overflow:hidden}.gbot-dialog-modal .file-preview .file-desc .file-desc-name{color:#5c5f66;font-size:12px;font-style:normal;font-weight:700;line-height:150%;margin-bottom:4px}.gbot-dialog-modal .file-preview .file-action{position:absolute;right:-8px;top:-8px}.gbot-dialog-modal .file-preview .file-process{background-color:#f7f7f9;border-radius:8px;width:16px;height:16px;line-height:16px;text-align:center;display:inline-flex;align-items:center;justify-content:center}.gbot-dialog-modal .file-preview .file-remove{display:inline-block;border-radius:10px;width:20px;height:20px;line-height:20px;text-align:center;color:#84868c;border:1px solid #e8e9eb;display:inline-flex;align-items:center;justify-content:center;background-color:#f7f7f9}.gbot-dialog-modal .file-preview .file-remove:hover{background-color:#fff;color:#b452ff}.gbot-dialog-modal .file-remove-tooltip .gbot-tooltip-content .gbot-tooltip-inner{padding:12px}
1
+ .gbot-dialog-modal .greeting{display:flex;flex-direction:column;align-items:center;flex:1;margin:0 auto;max-width:824px;width:100%;padding:16px 0}.gbot-dialog-modal .greeting-icon{width:74px;height:74px;border-radius:50%;box-shadow:0 6px 16px 2px #070c1414;padding:5px;margin-bottom:24px}.gbot-dialog-modal .greeting-icon img{width:64px;height:64px}.gbot-dialog-modal .greeting-word{font-weight:700;font-size:24px;line-height:30px;margin-bottom:24px}.gbot-dialog-modal .greeting-questions{width:100%;padding:0 12px}.gbot-dialog-modal.inlay .greeting{margin-top:40px}.gbot-dialog-modal.float .greeting{overflow-y:auto;flex:none}
@@ -1 +1 @@
1
- .gbot-dialog-modal.inlay .questions,.gbot-dialog-modal.float .questions{width:100%}.gbot-dialog-modal .questions .question-tip{display:flex;align-items:center;margin-bottom:10px;height:24px;color:#84868c}.gbot-dialog-modal .questions .question-tip img{width:24px;height:24px}.gbot-dialog-modal .questions .question-row{max-height:260px;overflow-y:auto}.gbot-dialog-modal .questions .question-pannel{background:white;padding:12px;border-radius:8px;width:100%;cursor:pointer;border:1px solid transparent}.gbot-dialog-modal .questions .question-pannel .question-top{font-size:16px;height:32px;color:#070c14;font-weight:700;display:flex;width:100%}.gbot-dialog-modal .questions .question-pannel .question-top .question-top-tip{flex:0 0 24px;margin-right:8px}.gbot-dialog-modal .questions .question-pannel .question-top .question-top-title{flex:0 0 1;overflow:hidden;display:flex;align-items:center}.gbot-dialog-modal .questions .question-pannel .question-top .question-top-type{margin-left:8px;flex:0 0 24px}.gbot-dialog-modal .questions .question-pannel .question-top .question-only-plus-file{margin-left:0}.gbot-dialog-modal .questions .question-pannel .question-top img{width:24px}.gbot-dialog-modal .questions .question-pannel .not-have-top{display:none}.gbot-dialog-modal .questions .question-pannel .question-bottom{font-size:14px;color:#070c14;line-height:21px}.gbot-dialog-modal .questions .question-pannel .multiline-question{height:56px;margin-top:-7px}.gbot-dialog-modal .questions .question-pannel__active{border:1px solid #b452ff;transition:all .25s}.gbot-dialog-modal .questions .multiline-question-pannel{padding:16px 12px}.gbot-dialog-modal .recommend-tooltip-overlay .gbot-tooltip-inner{max-width:400px;max-height:300px;overflow-y:auto}
1
+ .gbot-dialog-modal .history-item{margin-bottom:16px}.gbot-dialog-modal .history-item .history-item-user{width:100%}.gbot-dialog-modal .history-item .history-item-user .item-user-panel{display:flex;justify-content:flex-end}.gbot-dialog-modal .history-item .history-item-user .item-user-panel .user-panel-main{max-width:100%}.gbot-dialog-modal .history-item .history-item-user .item-user-panel .user-panel-main .item-user-content{background:#f9f2ff;padding:12px;border-radius:12px 2px 12px 12px;border:1px solid #9c24f2;display:inline-block;width:auto;max-width:100%;color:#070c14;word-wrap:break-word}.gbot-dialog-modal .history-item .history-item-user .item-user-file{display:flex-end;margin-top:10px}.gbot-dialog-modal .history-item .history-item-user .item-user-images{display:flex;justify-content:flex-end}.gbot-dialog-modal .history-item .history-item-user ::selection{background-color:#b1d7ffb3;color:#fff}.gbot-dialog-modal .history-item .history-item-bot{width:100%;border-radius:2px 12px 12px;background:white;padding:0 12px}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin{padding-top:12px}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin .bot-plugin-status .plugin-status-success{display:inline-block;width:14px;height:14px;color:#fff;background:#47d1cb;border-radius:50%;font-size:10px;display:flex;align-items:center;justify-content:center}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin .bot-plugin-status .plugin-status-error{display:inline-block;width:14px;height:14px;color:#fff;background:#f95b81;border-radius:50%;font-size:10px;display:flex;align-items:center;justify-content:center}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin .bot-plugin-status .plugin-status-loading{display:inline-block;width:14px;height:14px;color:#477bff;border-radius:50%;font-size:10px;display:flex;align-items:center;justify-content:center}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin .bot-plugin-title{font-weight:700;color:#000000a6}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin .bot-plugin-action{border:1px solid #00000026;border-radius:4px;color:#000000e0;padding:1px 8px}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin .gbot-collapse-header{padding:0;height:38px;display:flex;align-items:center}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin .gbot-collapse-content-box{padding:0}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin .bot-plugin-content{height:32px;line-height:32px;font-weight:700}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin .bot-plugin-json{background:white}.gbot-dialog-modal .history-item .history-item-bot .item-bot-net{padding-top:12px}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content{width:100%;border-radius:2px 12px 12px;background:white;padding:12px 0;word-wrap:break-word}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content .content-think{margin-bottom:12px}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content .content-think .think-top{font-size:14px;line-height:24px;color:#070c14;display:flex;align-items:center;margin-bottom:12px;cursor:pointer}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content .content-think .think-top img{width:24px;margin-right:4px}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content .content-think .think-top .think-action{margin-left:8px}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content .content-think .think-bottom{font-size:14px;line-height:150%;color:#999;position:relative}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content .content-think .think-bottom .bottom-left{background:#d9d9d9;width:1px;position:absolute;left:10px;top:4px;bottom:4px}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content .content-think .think-bottom .bottom-left .thinking{position:absolute;left:-5px;top:0;width:12px;height:12px;background:#b752ea;border-radius:50%}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content .content-think .think-bottom .bottom-left .thinked{position:absolute;z-index:100;left:-5px;top:0;width:12px;height:12px;background:#04d68d;border-radius:50%;color:#fff;display:flex;align-items:center;justify-content:center;font-size:8px}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content .content-think .think-bottom .bottom-right{padding-left:22px}.gbot-dialog-modal .history-item .gbot-collapse-item{border-radius:4px;background-color:#f5f5f5;margin-bottom:8px;padding:0 0 0 8px}.gbot-dialog-modal .history-item .gbot-collapse-item .gbot-collapse-content{padding-bottom:8px}.gbot-dialog-modal .history-item .gbot-collapse-item:last-child{margin-bottom:0}.gbot-dialog-modal .history-item .gbot-collapse-header-text{width:100%}.gbot-dialog-modal.inlay .history-item__user{display:flex;justify-content:flex-end}.gbot-dialog-modal.inlay .history-item-user,.gbot-dialog-modal.inlay .history-item-bot{max-width:calc(100% - 64px)}.gbot-dialog-modal .session-item-overlay-popover .gbot-popover-inner-content{padding:6px}.gbot-dialog-modal .session-item-overlay-popover .gbot-popover-arrow{display:none}