@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.
Files changed (39) hide show
  1. package/dist/es/Dialog/AgentChat/index.mjs +442 -435
  2. package/dist/es/Dialog/SessionList/index.mjs +117 -115
  3. package/dist/es/Dialog/index.mjs +35 -34
  4. package/dist/es/constant.mjs +2 -0
  5. package/dist/es/index.mjs +30 -29
  6. package/dist/es/packages/agent-cli-ui/package.json.mjs +3 -3
  7. package/dist/es/packages/react-components/dist/es/index.mjs +1 -1
  8. package/dist/es/src/style11.css +1 -1
  9. package/dist/es/src/style12.css +1 -1
  10. package/dist/es/src/style14.css +1 -1
  11. package/dist/es/src/style15.css +1 -1
  12. package/dist/es/src/style16.css +1 -1
  13. package/dist/es/src/style17.css +1 -1
  14. package/dist/es/src/style18.css +1 -1
  15. package/dist/es/src/style22.css +1 -1
  16. package/dist/es/src/style23.css +1 -1
  17. package/dist/es/src/style25.css +1 -1
  18. package/dist/es/src/style27.css +1 -1
  19. package/dist/es/src/style28.css +1 -1
  20. package/dist/es/src/style30.css +1 -1
  21. package/dist/es/src/style31.css +1 -1
  22. package/dist/es/src/style32.css +1 -1
  23. package/dist/es/src/style33.css +1 -1
  24. package/dist/es/src/style5.css +1 -1
  25. package/dist/es/src/style6.css +1 -1
  26. package/dist/es/src/style7.css +1 -1
  27. package/dist/es/src/style9.css +1 -1
  28. package/dist/lib/index.css +1 -1
  29. package/dist/lib/index.js +55 -55
  30. package/dist/src/Dialog/AgentChat/HistoryItem/FileItem/index.d.ts +1 -1
  31. package/dist/src/Dialog/AgentChat/HistoryItem/SessionAction/index.d.ts +1 -1
  32. package/dist/src/Dialog/AgentChat/HistoryItem/index.d.ts +1 -1
  33. package/dist/src/Dialog/AgentChat/PromptSetting/index.d.ts +2 -2
  34. package/dist/src/Dialog/AgentChat/Tools/SessionHistoryDrawer/index.d.ts +2 -2
  35. package/dist/src/Dialog/AgentChat/index.d.ts +2 -2
  36. package/dist/src/Dialog/SessionList/index.d.ts +3 -2
  37. package/dist/src/components/KnowledgeList/index.d.ts +1 -1
  38. package/dist/src/types.d.ts +1 -0
  39. package/package.json +3 -3
@@ -1,90 +1,92 @@
1
- var dt = Object.defineProperty;
2
- var R = Object.getOwnPropertySymbols;
3
- var ot = Object.prototype.hasOwnProperty, it = Object.prototype.propertyIsEnumerable;
4
- var U = (k, r, e) => r in k ? dt(k, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : k[r] = e, G = (k, r) => {
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
- ot.call(r, e) && U(k, e, r[e]);
7
- if (R)
8
- for (var e of R(r))
9
- it.call(r, e) && U(k, e, r[e]);
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 g = (m) => {
13
+ var w = (m) => {
14
14
  try {
15
15
  E(e.next(m));
16
- } catch (w) {
17
- O(w);
16
+ } catch (u) {
17
+ O(u);
18
18
  }
19
- }, D = (m) => {
19
+ }, T = (m) => {
20
20
  try {
21
21
  E(e.throw(m));
22
- } catch (w) {
23
- O(w);
22
+ } catch (u) {
23
+ O(u);
24
24
  }
25
- }, E = (m) => m.done ? i(m.value) : Promise.resolve(m.value).then(g, D);
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 l, jsxs as A } from "react/jsx-runtime";
29
- import { forwardRef as nt, useState as $, useContext as lt, useEffect as P, useImperativeHandle as ct, useMemo as st } from "react";
30
- import { Button as rt, Popconfirm as q, Input as mt, Space as pt } from "antd";
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 ht from "classnames";
33
- import J from "../../components/Iconfont/index.mjs";
34
- import ft from "../../context.mjs";
35
- /* empty css */import { useMemoizedFn as Q } from "ahooks";
36
- import { NET_OPEN_STATUS as W } from "../../constant.mjs";
37
- const yt = nt((k, r) => {
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: g,
43
- networkStatus: D,
42
+ application: w,
43
+ networkStatus: T,
44
44
  isShowHeader: E = !0,
45
45
  sessions: m,
46
46
  // 👈 从外部接收
47
- setSessions: w,
47
+ setSessions: u,
48
48
  // 👈 从外部接收
49
- afterSessionClick: Y
50
- } = k, [L, T] = $(), {
49
+ afterSessionClick: Y,
50
+ sessionId: L
51
+ } = k, [V, H] = C(), {
51
52
  agentClient: v,
52
- mode: X,
53
+ mode: Z,
53
54
  features: a
54
- } = lt(ft), [H, _] = $(O), K = Q((t) => {
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 = G({}, t)), o;
60
+ return ((c = o.data) == null ? void 0 : c.id) === t.id && (o.data = q({}, t)), o;
60
61
  });
61
- w([...d]);
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 (w([...t]), !((d = e == null ? void 0 : e.data) != null && d.id) && (t != null && t.length) && X === "inlay") {
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
- _(d);
77
+ K(d);
76
78
  return;
77
79
  }
78
- _(O);
80
+ K(O);
79
81
  }, [O]), P(() => {
80
- e == null || e.addEventListener("data:updated", K);
81
- }, [e]), ct(r, () => ({
82
+ e == null || e.addEventListener("data:updated", z);
83
+ }, [e]), st(r, () => ({
82
84
  create(t) {
83
- return z(t).then((d) => (i == null || i(d), d));
85
+ return B(t).then((d) => (i == null || i(d), d));
84
86
  },
85
87
  list: () => Promise.resolve(m)
86
88
  }));
87
- const z = (t) => {
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: (g == null ? void 0 : g.type) === 0 ? t != null && t.netOpen ? t.netOpen : d ? W.OPEN : W.CLOSE : void 0,
97
- knowledges: (p = e == null ? void 0 : e.data) != null && p.id ? t == null ? void 0 : t.knowledges : H,
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
- w([s, ...m]), o(s);
103
+ u([s, ...m]), o(s);
102
104
  }));
103
105
  }));
104
- }, Z = () => {
105
- z({
106
- knowledges: H
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, b;
115
- return ((p = s.data) == null ? void 0 : p.id) !== ((b = t.data) == null ? void 0 : b.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)), w([...d]);
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
- L && (t.rename(L), t == null || t.addEventListener("data:updated", K));
124
- }, et = (t) => x(void 0, null, function* () {
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
- }), at = (t) => {
127
- T(t.target.value);
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 B = Q((t) => {
137
- const d = N().endOf("day"), o = d.subtract(1, "day"), c = d.subtract(7, "day"), s = d.subtract(30, "day"), p = [], b = [], M = [], j = [], u = {};
138
- return t.forEach((n) => {
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 = n.data) == null ? void 0 : y.createdAt);
142
+ const h = N((y = l.data) == null ? void 0 : y.createdAt);
141
143
  if (h.isAfter(o))
142
- b.push(n);
144
+ g.push(l);
143
145
  else if (h.isAfter(c))
144
- M.push(n);
146
+ M.push(l);
145
147
  else if (h.isAfter(s))
146
- j.push(n);
148
+ j.push(l);
147
149
  else {
148
150
  const f = h.format("YYYY-MM");
149
- u[f] || (u[f] = []), u[f].push(n);
151
+ b[f] || (b[f] = []), b[f].push(l);
150
152
  }
151
- }), b.length > 0 && p.push({
153
+ }), g.length > 0 && p.push({
152
154
  title: "今天",
153
- sessions: b.sort((n, h) => {
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 = n.data) == null ? void 0 : f.createdAt).valueOf();
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((n, h) => {
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 = n.data) == null ? void 0 : f.createdAt).valueOf();
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((n, h) => {
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 = n.data) == null ? void 0 : f.createdAt).valueOf();
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(u).sort((n, h) => h.localeCompare(n)).forEach((n) => {
173
- const h = u[n].sort((y, f) => {
174
- var C, F;
175
- return N((C = f.data) == null ? void 0 : C.createdAt).valueOf() - N((F = y.data) == null ? void 0 : F.createdAt).valueOf();
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(n).format("YYYY年MM月"),
180
+ title: N(l).format("YYYY年MM月"),
179
181
  sessions: h,
180
- key: `month-${n}`
182
+ key: `month-${l}`
181
183
  });
182
184
  }), p;
183
- }), V = st(() => B(m), [m, B]);
184
- return /* @__PURE__ */ l("div", {
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__ */ l("div", {
190
+ children: [E && (a == null ? void 0 : a.siderTitle) && /* @__PURE__ */ n("div", {
189
191
  className: "sessions-header",
190
- children: /* @__PURE__ */ l("div", {
192
+ children: /* @__PURE__ */ n("div", {
191
193
  className: "session-header-title",
192
- children: (g == null ? void 0 : g.name) || "-"
194
+ children: (w == null ? void 0 : w.name) || "-"
193
195
  })
194
196
  }), /* @__PURE__ */ A("div", {
195
197
  className: "sessions-main",
196
- children: [E && /* @__PURE__ */ l("div", {
198
+ children: [E && /* @__PURE__ */ n("div", {
197
199
  className: "session-header-btn-wrapper",
198
- children: /* @__PURE__ */ l(rt, {
200
+ children: /* @__PURE__ */ n(mt, {
199
201
  className: "session-header-btn",
200
- onClick: Z,
202
+ onClick: I,
201
203
  type: "primary",
202
204
  children: "+ 新会话"
203
205
  })
204
- }), V == null ? void 0 : V.map((t) => {
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__ */ l("div", {
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, b, M, j;
216
- return /* @__PURE__ */ l("div", {
217
- className: ht({
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: () => et(o),
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__ */ l("span", {
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: (u) => u.stopPropagation(),
232
- children: [/* @__PURE__ */ l(q, {
233
- getPopupContainer: (u) => u.parentNode,
233
+ onClick: (b) => b.stopPropagation(),
234
+ children: [/* @__PURE__ */ n(J, {
235
+ getPopupContainer: (b) => b.parentNode,
234
236
  icon: !1,
235
- title: /* @__PURE__ */ l(mt, {
237
+ title: /* @__PURE__ */ n(pt, {
236
238
  placeholder: "请输入内容",
237
239
  autoComplete: "off",
238
240
  showCount: !0,
239
- value: L,
240
- onChange: at,
241
+ value: V,
242
+ onChange: dt,
241
243
  maxLength: 15
242
244
  }),
243
- onConfirm: () => tt(o),
244
- children: /* @__PURE__ */ l(J, {
245
+ onConfirm: () => et(o),
246
+ children: /* @__PURE__ */ n(Q, {
245
247
  type: "icon-bianji2",
246
- onClick: () => I(o),
248
+ onClick: () => tt(o),
247
249
  className: "icon-action",
248
250
  style: {
249
251
  marginRight: "8px"
250
252
  }
251
253
  })
252
- }), /* @__PURE__ */ l(q, {
253
- getPopupContainer: (u) => u.parentNode,
254
+ }), /* @__PURE__ */ n(J, {
255
+ getPopupContainer: (b) => b.parentNode,
254
256
  icon: !1,
255
- title: /* @__PURE__ */ A(pt, {
257
+ title: /* @__PURE__ */ A(ht, {
256
258
  direction: "vertical",
257
- children: [/* @__PURE__ */ l("div", {
259
+ children: [/* @__PURE__ */ n("div", {
258
260
  children: "删除确认?"
259
- }), /* @__PURE__ */ l("div", {
261
+ }), /* @__PURE__ */ n("div", {
260
262
  children: "会话删除后不可恢复,请确认是否删除!"
261
263
  })]
262
264
  }),
263
265
  onConfirm: () => S(o),
264
- children: /* @__PURE__ */ l(J, {
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__ */ l("span", {
277
+ children: [/* @__PURE__ */ n("span", {
276
278
  className: "item-bottom-desc",
277
- children: ((b = o.data) == null ? void 0 : b.finialMessage) || "-"
278
- }), /* @__PURE__ */ l("span", {
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
- yt.displayName = "SessionList";
294
+ vt.displayName = "SessionList";
293
295
  export {
294
- yt as default
296
+ vt as default
295
297
  };
@@ -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, n) => t in i ? q(i, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[t] = n, A = (i, t) => {
6
- for (var n in t || (t = {}))
7
- F.call(t, n) && j(i, n, t[n]);
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 n of R(t))
10
- G.call(t, n) && j(i, n, t[n]);
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, n) => new Promise((l, y) => {
14
- var s = (e) => {
13
+ var p = (i, t, s) => new Promise((l, y) => {
14
+ var n = (e) => {
15
15
  try {
16
- f(n.next(e));
16
+ f(s.next(e));
17
17
  } catch (v) {
18
18
  y(v);
19
19
  }
20
20
  }, a = (e) => {
21
21
  try {
22
- f(n.throw(e));
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(s, a);
27
- f((n = n.apply(i, t)).next());
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: n,
37
+ sessionId: s,
38
38
  appId: l,
39
39
  docViewerUrl: y
40
- } = i, [s, a] = u(), {
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(s ? !!((d = s.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
- }, [s]), w(() => {
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 && n && (e.ready ? e == null || e.getSessions().then((d) => p(void 0, null, function* () {
71
- a == null || a(d.find((o) => o.id === n));
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 === n));
74
+ a == null || a(d.find((o) => o.id === s));
75
75
  }));
76
76
  }), !0));
77
- }, [e, n]), w(() => {
78
- if (!s) {
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
- s.data && m && m({
87
+ n.data && m && m({
88
88
  applicationId: l,
89
- sessionId: s.data.id,
90
- session: s.data,
91
- sessionInstance: s
92
- }), s.addEventListener("data:loaded", () => {
93
- s != null && s.data && m && m({
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: s.data.id,
96
- session: s.data,
97
- sessionInstance: s
95
+ sessionId: n.data.id,
96
+ session: n.data,
97
+ sessionInstance: n
98
98
  });
99
99
  }, !0);
100
- }, [s]);
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: s,
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: s
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: s,
153
+ currentSession: n,
153
154
  onCreateSession: x,
154
155
  docViewerUrl: y,
155
156
  embeddingService: P,
@@ -58,6 +58,8 @@ const u = {
58
58
  // 默认临界值
59
59
  },
60
60
  sessionList: !0,
61
+ siderTitle: !1,
62
+ //默认不展示应用名称
61
63
  newSession: !0,
62
64
  fileUpload: !0,
63
65
  //dialog only