@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.
Files changed (45) hide show
  1. package/dist/es/Dialog/AgentChat/index.mjs +418 -478
  2. package/dist/es/Dialog/HistoryItem/index.mjs +50 -52
  3. package/dist/es/Dialog/KnowledgeList/index.mjs +19 -19
  4. package/dist/es/Dialog/Recommend/RecommendItem.mjs +43 -52
  5. package/dist/es/Dialog/SearchReference/index.mjs +41 -68
  6. package/dist/es/Dialog/SessionAction/index.mjs +32 -34
  7. package/dist/es/Dialog/SessionListDrawer/HistorySessionList/index.mjs +69 -74
  8. package/dist/es/Dialog/UploadKnowledgeFiles/index.mjs +164 -198
  9. package/dist/es/Dialog/index.mjs +56 -56
  10. package/dist/es/FileItem/index.mjs +50 -63
  11. package/dist/es/Iconfont/index.mjs +2 -2
  12. package/dist/es/constant.mjs +2 -8
  13. package/dist/es/index.mjs +48 -49
  14. package/dist/es/src/style11.css +1 -1
  15. package/dist/es/src/style12.css +1 -1
  16. package/dist/es/src/style13.css +1 -1
  17. package/dist/es/src/style14.css +1 -1
  18. package/dist/es/src/style15.css +1 -1
  19. package/dist/es/src/style16.css +1 -1
  20. package/dist/es/src/style17.css +1 -1
  21. package/dist/es/src/style19.css +1 -1
  22. package/dist/es/src/style20.css +1 -1
  23. package/dist/es/src/style21.css +1 -0
  24. package/dist/es/src/style22.css +1 -1
  25. package/dist/es/src/style23.css +0 -1
  26. package/dist/es/src/style24.css +1 -1
  27. package/dist/es/src/style25.css +1 -1
  28. package/dist/es/src/style26.css +1 -1
  29. package/dist/es/src/style27.css +1 -1
  30. package/dist/es/src/style28.css +1 -1
  31. package/dist/es/src/style3.css +1 -1
  32. package/dist/es/src/style30.css +1 -1
  33. package/dist/es/src/style31.css +1 -1
  34. package/dist/es/src/style32.css +1 -1
  35. package/dist/es/src/style4.css +1 -1
  36. package/dist/es/src/style5.css +1 -1
  37. package/dist/es/src/style6.css +1 -1
  38. package/dist/es/src/style8.css +1 -1
  39. package/dist/es/src/style9.css +1 -1
  40. package/dist/lib/index.css +1 -1
  41. package/dist/lib/index.js +5 -5
  42. package/dist/src/Dialog/SearchReference/index.d.ts +1 -4
  43. package/dist/src/types.d.ts +1 -10
  44. package/package.json +3 -3
  45. package/dist/src/Iconfont/font_4108228_z72fskklg2.d.ts +0 -0
@@ -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, o, s) => o in t ? q(t, o, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[o] = s, j = (t, o) => {
6
- for (var s in o || (o = {}))
7
- F.call(o, s) && x(t, s, o[s]);
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(o))
10
- G.call(o, s) && x(t, s, o[s]);
9
+ for (var s of L(n))
10
+ G.call(n, s) && x(t, s, n[s]);
11
11
  return t;
12
- }, A = (t, o) => z(t, B(o));
13
- var v = (t, o, s) => new Promise((I, w) => {
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
- g(s.next(r));
17
- } catch (f) {
18
- w(f);
16
+ u(s.next(r));
17
+ } catch (h) {
18
+ N(h);
19
19
  }
20
20
  }, a = (r) => {
21
21
  try {
22
- g(s.throw(r));
23
- } catch (f) {
24
- w(f);
22
+ u(s.throw(r));
23
+ } catch (h) {
24
+ N(h);
25
25
  }
26
- }, g = (r) => r.done ? I(r.value) : Promise.resolve(r.value).then(e, a);
27
- g((s = s.apply(t, o)).next());
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 K } from "react/jsx-runtime";
30
- import { useState as p, useContext as J, useRef as M, useEffect as y } from "react";
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: o,
37
+ sessionId: n,
38
38
  appId: s,
39
39
  docViewerUrl: I,
40
- bodyStyle: w
41
- } = t, [e, a] = p(), {
42
- service: g,
40
+ bodyStyle: N
41
+ } = t, [e, a] = v(), {
42
+ service: u,
43
43
  mode: r,
44
- showHeader: f,
44
+ showHeader: h,
45
45
  token: X,
46
- agentClient: n,
47
- sider: R,
48
- onSessionLoad: m,
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), [h, H] = p(), S = M(null), [U, D] = p(""), [k, b] = p(), [E, N] = p(!1);
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
- N(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);
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 = () => v(void 0, null, function* () {
60
- const d = n == null ? void 0 : n.application;
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 u = d == null ? void 0 : d.arrange;
64
- if (!(u != null && u.length))
63
+ const g = d == null ? void 0 : d.arrange;
64
+ if (!(g != null && g.length))
65
65
  return;
66
- const V = u[0].embeddingService;
67
- D(V), H(d);
66
+ const V = g[0].embeddingService;
67
+ D(V), K(d);
68
68
  });
69
- return n == null || n.addEventListener("ready", () => i()), () => {
70
- n == null || n.removeEventListener("ready", i);
69
+ return o == null || o.addEventListener("ready", () => i()), () => {
70
+ o == null || o.removeEventListener("ready", i);
71
71
  };
72
72
  }, []), y(() => {
73
- n && o && (n.ready ? n == null || n.getSessions().then((i) => v(void 0, null, function* () {
74
- a == null || a(i.find((d) => d.id === o));
75
- })) : n.addEventListener("ready", () => v(void 0, null, function* () {
76
- n == null || n.getSessions().then((i) => v(void 0, null, function* () {
77
- a == null || a(i.find((d) => d.id === o));
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
- }, [n, o]), y(() => {
80
+ }, [o, n]), y(() => {
81
81
  if (!e) {
82
- m && m({
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 && m && m({
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 && m && m({
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 = S.current) == null ? void 0 : d.create(A(j({}, i), {
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__ */ K("div", {
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: S,
118
- sider: R,
117
+ ref: w,
118
+ sider: H,
119
119
  appId: s,
120
120
  networkStatus: E,
121
121
  currentSession: e,
122
- application: h,
122
+ application: m,
123
123
  setCurrentSession: a,
124
124
  checkKnowledges: k,
125
- setCheckKnowledges: f ? b : void 0
125
+ setCheckKnowledges: b
126
126
  })
127
127
  }), /* @__PURE__ */ c("div", {
128
128
  className: "dialog-content",
129
- children: /* @__PURE__ */ K("div", {
129
+ children: /* @__PURE__ */ R("div", {
130
130
  className: "dialog-chat",
131
- children: [f && /* @__PURE__ */ c("div", {
131
+ children: [h && /* @__PURE__ */ c("div", {
132
132
  className: "dialog-chat-header",
133
133
  children: /* @__PURE__ */ c(T, {
134
134
  setCheckKnowledges: b,
135
- application: h,
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: (h == null ? void 0 : h.id) && /* @__PURE__ */ c(Q, {
142
- setNetworkStatus: N,
141
+ children: (m == null ? void 0 : m.id) && /* @__PURE__ */ c(Q, {
142
+ setNetworkStatus: S,
143
143
  networkStatus: E,
144
- application: h,
144
+ application: m,
145
145
  currentSession: e,
146
146
  onCreateSession: O,
147
147
  docViewerUrl: I,
@@ -1,97 +1,84 @@
1
- import { jsxs as d, jsx as r } from "react/jsx-runtime";
2
- import { useContext as v, useState as u, useEffect as w } from "react";
3
- import y from "../FileCard/doc-icons/pdf.svg.mjs";
4
- import N from "../FileCard/doc-icons/doc.svg.mjs";
5
- import U from "../FileCard/doc-icons/docx.svg.mjs";
6
- /* empty css */import { Typography as E, message as c } from "antd";
7
- import { getFileExtension as x, formatFileSize as b, isValidImageUrlWithAnyExtension as j } from "../utils/index.mjs";
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: N,
11
- docx: U,
12
- pdf: y
13
- }, q = (f) => {
10
+ doc: v,
11
+ docx: y,
12
+ pdf: f
13
+ }, b = (g) => {
14
14
  const {
15
- currentSession: m,
16
- fileId: g,
17
- file: e,
15
+ currentSession: i,
16
+ fileId: p,
17
+ file: r,
18
18
  docViewerUrl: C
19
- } = f, {
20
- service: l,
21
- popupContainer: i
22
- } = v(k), [n, h] = u(), [t, p] = u("");
23
- w(() => {
24
- var o;
25
- if (e != null && e.id) {
26
- h(e);
27
- const s = x(e == null ? void 0 : e.name) || "";
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 (!g || !((o = m == null ? void 0 : m.data) != null && o.id))
29
+ if (!p || !((n = i == null ? void 0 : i.data) != null && n.id))
31
30
  return;
32
- l == null || l.getSessionKnowledgeFile(m.data.id, g).then((s) => {
33
- h(s);
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
- p(I);
34
+ d(I);
36
35
  });
37
36
  }
38
37
  }, []);
39
- const F = (o) => {
40
- if (!(o != null && o.url)) {
41
- c.config({
42
- getContainer: () => (i == null ? void 0 : i.current) || document.body
43
- }), c.error("链接不存在"), c.config({
44
- getContainer: void 0
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__ */ d("div", {
45
+ return /* @__PURE__ */ l("div", {
59
46
  className: "file-item",
60
- onClick: () => F(n),
61
- children: [/* @__PURE__ */ r("div", {
47
+ onClick: () => F(o),
48
+ children: [/* @__PURE__ */ e("div", {
62
49
  className: "item-left",
63
- children: /* @__PURE__ */ r("img", {
50
+ children: /* @__PURE__ */ e("img", {
64
51
  className: "file-icon",
65
- src: z[t]
52
+ src: z[c]
66
53
  })
67
- }), /* @__PURE__ */ d("div", {
54
+ }), /* @__PURE__ */ l("div", {
68
55
  className: "item-main",
69
- children: [/* @__PURE__ */ r("div", {
56
+ children: [/* @__PURE__ */ e("div", {
70
57
  className: "file-name",
71
- children: /* @__PURE__ */ r(E.Paragraph, {
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: n == null ? void 0 : n.name
65
+ tooltip: o == null ? void 0 : o.name
79
66
  },
80
- children: n == null ? void 0 : n.name
67
+ children: o == null ? void 0 : o.name
81
68
  })
82
- }), /* @__PURE__ */ d("div", {
69
+ }), /* @__PURE__ */ l("div", {
83
70
  className: "file-desc",
84
- children: [/* @__PURE__ */ r("span", {
85
- children: t == null ? void 0 : t.toUpperCase()
86
- }), /* @__PURE__ */ r("span", {
71
+ children: [/* @__PURE__ */ e("span", {
72
+ children: c == null ? void 0 : c.toUpperCase()
73
+ }), /* @__PURE__ */ e("span", {
87
74
  children: ","
88
- }), /* @__PURE__ */ r("span", {
89
- children: b((n == null ? void 0 : n.size) || 0)
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
- q as default
83
+ b as default
97
84
  };