@glodon-aiot/agent-cli-ui 2.4.7 → 3.0.4

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 (150) hide show
  1. package/dist/es/AgentClientUI.mjs +97 -110
  2. package/dist/es/Dialog/AgentChat/index.mjs +516 -467
  3. package/dist/es/Dialog/ConnectToNetwork/index.mjs +25 -24
  4. package/dist/es/Dialog/FileCard/index.mjs +48 -55
  5. package/dist/es/Dialog/FilePreview/index.mjs +35 -42
  6. package/dist/es/Dialog/HistoryItem/index.mjs +48 -53
  7. package/dist/es/Dialog/KnowledgeList/index.mjs +55 -48
  8. package/dist/es/Dialog/PromptManager/index.mjs +29 -36
  9. package/dist/es/Dialog/PromptSetting/index.mjs +53 -66
  10. package/dist/es/Dialog/SessionAction/index.mjs +92 -91
  11. package/dist/es/Dialog/SessionList/index.mjs +135 -121
  12. package/dist/es/Dialog/SessionListDrawer/index.mjs +8 -7
  13. package/dist/es/Dialog/SessionRefer/ReferItem/index.mjs +29 -36
  14. package/dist/es/Dialog/SessionRefer/index.mjs +29 -36
  15. package/dist/es/Dialog/SessionRelated/index.mjs +17 -14
  16. package/dist/es/Dialog/UploadKnowledgeFiles/index.mjs +125 -132
  17. package/dist/es/Dialog/index.mjs +125 -93
  18. package/dist/es/QuillEditor/index.mjs +91 -86
  19. package/dist/es/_virtual/index.mjs +2 -2
  20. package/dist/es/components/Markdown/Image/index.mjs +20 -20
  21. package/dist/es/components/Markdown/index.mjs +27 -22
  22. package/dist/es/constant.mjs +8 -5
  23. package/dist/es/index.mjs +178 -152
  24. package/dist/es/node_modules/classnames/index.mjs +1 -1
  25. package/dist/es/node_modules/comma-separated-tokens/index.mjs +13 -0
  26. package/dist/es/node_modules/devlop/lib/default.mjs +5 -0
  27. package/dist/es/node_modules/hast-util-from-dom/lib/index.mjs +93 -0
  28. package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/create-h.mjs +126 -0
  29. package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/index.mjs +8 -0
  30. package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/svg-case-sensitive-tag-names.mjs +4 -0
  31. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/index.mjs +12 -0
  32. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/aria.mjs +61 -0
  33. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/find.mjs +33 -0
  34. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/html.mjs +368 -0
  35. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/normalize.mjs +6 -0
  36. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/svg.mjs +566 -0
  37. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/case-insensitive-transform.mjs +7 -0
  38. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/case-sensitive-transform.mjs +6 -0
  39. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/create.mjs +14 -0
  40. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/defined-info.mjs +36 -0
  41. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/info.mjs +28 -0
  42. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/merge.mjs +10 -0
  43. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/schema.mjs +21 -0
  44. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/types.mjs +15 -0
  45. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xlink.mjs +19 -0
  46. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xml.mjs +15 -0
  47. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xmlns.mjs +16 -0
  48. package/dist/es/node_modules/hast-util-from-html-isomorphic/lib/browser.mjs +16 -0
  49. package/dist/es/node_modules/hast-util-is-element/lib/index.mjs +61 -0
  50. package/dist/es/node_modules/hast-util-parse-selector/lib/index.mjs +20 -0
  51. package/dist/es/node_modules/hast-util-to-text/lib/index.mjs +223 -0
  52. package/dist/es/node_modules/katex/dist/katex.min.css.mjs +4 -0
  53. package/dist/es/node_modules/katex/dist/katex.mjs +11700 -0
  54. package/dist/es/node_modules/longest-streak/index.mjs +12 -0
  55. package/dist/es/node_modules/mdast-util-math/lib/index.mjs +170 -0
  56. package/dist/es/node_modules/micromark-extension-math/lib/math-flow.mjs +76 -0
  57. package/dist/es/node_modules/micromark-extension-math/lib/math-text.mjs +48 -0
  58. package/dist/es/node_modules/micromark-extension-math/lib/syntax.mjs +15 -0
  59. package/dist/es/node_modules/micromark-factory-space/index.mjs +15 -0
  60. package/dist/es/node_modules/micromark-util-character/index.mjs +10 -0
  61. package/dist/es/node_modules/rehype-katex/lib/index.mjs +83 -0
  62. package/dist/es/node_modules/remark-math/lib/index.mjs +13 -0
  63. package/dist/es/node_modules/space-separated-tokens/index.mjs +7 -0
  64. package/dist/es/node_modules/unist-util-find-after/lib/index.mjs +32 -0
  65. package/dist/es/node_modules/unist-util-is/lib/index.mjs +81 -0
  66. package/dist/es/node_modules/unist-util-visit-parents/lib/color.mjs +6 -0
  67. package/dist/es/node_modules/unist-util-visit-parents/lib/index.mjs +56 -0
  68. package/dist/es/node_modules/web-namespaces/index.mjs +11 -0
  69. package/dist/es/utils/index.mjs +44 -27
  70. package/dist/lib/index.js +278 -138
  71. package/dist/src/Dialog/AgentChat/index.d.ts +4 -2
  72. package/dist/src/Dialog/ConnectToNetwork/index.d.ts +1 -0
  73. package/dist/src/Dialog/KnowledgeList/KnowledgeSelect/index.d.ts +1 -1
  74. package/dist/src/Dialog/KnowledgeList/index.d.ts +2 -3
  75. package/dist/src/Dialog/PromptSetting/index.d.ts +1 -0
  76. package/dist/src/Dialog/SessionAction/index.d.ts +2 -0
  77. package/dist/src/Dialog/SessionList/index.d.ts +5 -4
  78. package/dist/src/QuillEditor/index.d.ts +1 -0
  79. package/dist/src/components/Markdown/Text/index.d.ts +8 -0
  80. package/dist/src/components/MathJaxLoader/index.d.ts +7 -0
  81. package/dist/src/components/MathJaxRender/index.d.ts +6 -0
  82. package/dist/src/constant.d.ts +1 -1
  83. package/dist/src/contexts/MathJaxContext.d.ts +12 -0
  84. package/dist/src/index.d.ts +4 -1
  85. package/dist/src/types.d.ts +26 -6
  86. package/dist/src/utils/index.d.ts +15 -0
  87. package/package.json +18 -17
  88. package/dist/es/_virtual/index2.mjs +0 -4
  89. package/dist/es/_virtual/index3.mjs +0 -4
  90. package/dist/es/_virtual/index4.mjs +0 -4
  91. package/dist/es/_virtual/minio-zj.mjs +0 -4
  92. package/dist/es/node_modules/@glodon-aiot/minio/dist/minio-zj.mjs +0 -26485
  93. package/dist/es/node_modules/@socket.io/component-emitter/lib/esm/index.mjs +0 -54
  94. package/dist/es/node_modules/base64-js/index.mjs +0 -47
  95. package/dist/es/node_modules/buffer/index.mjs +0 -927
  96. package/dist/es/node_modules/engine.io-client/build/esm/contrib/has-cors.mjs +0 -9
  97. package/dist/es/node_modules/engine.io-client/build/esm/contrib/parseqs.mjs +0 -18
  98. package/dist/es/node_modules/engine.io-client/build/esm/contrib/parseuri.mjs +0 -24
  99. package/dist/es/node_modules/engine.io-client/build/esm/contrib/yeast.mjs +0 -19
  100. package/dist/es/node_modules/engine.io-client/build/esm/globalThis.browser.mjs +0 -4
  101. package/dist/es/node_modules/engine.io-client/build/esm/socket.mjs +0 -317
  102. package/dist/es/node_modules/engine.io-client/build/esm/transport.mjs +0 -113
  103. package/dist/es/node_modules/engine.io-client/build/esm/transports/index.mjs +0 -11
  104. package/dist/es/node_modules/engine.io-client/build/esm/transports/polling.mjs +0 -273
  105. package/dist/es/node_modules/engine.io-client/build/esm/transports/websocket-constructor.browser.mjs +0 -8
  106. package/dist/es/node_modules/engine.io-client/build/esm/transports/websocket.mjs +0 -87
  107. package/dist/es/node_modules/engine.io-client/build/esm/transports/webtransport.mjs +0 -52
  108. package/dist/es/node_modules/engine.io-client/build/esm/transports/xmlhttprequest.browser.mjs +0 -21
  109. package/dist/es/node_modules/engine.io-client/build/esm/util.mjs +0 -23
  110. package/dist/es/node_modules/engine.io-parser/build/esm/commons.mjs +0 -21
  111. package/dist/es/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.mjs +0 -14
  112. package/dist/es/node_modules/engine.io-parser/build/esm/decodePacket.browser.mjs +0 -39
  113. package/dist/es/node_modules/engine.io-parser/build/esm/encodePacket.browser.mjs +0 -28
  114. package/dist/es/node_modules/engine.io-parser/build/esm/index.mjs +0 -105
  115. package/dist/es/node_modules/ieee754/index.mjs +0 -28
  116. package/dist/es/node_modules/js-base64/base64.mjs +0 -31
  117. package/dist/es/node_modules/socket.io-client/build/esm/contrib/backo2.mjs +0 -26
  118. package/dist/es/node_modules/socket.io-client/build/esm/index.mjs +0 -25
  119. package/dist/es/node_modules/socket.io-client/build/esm/manager.mjs +0 -242
  120. package/dist/es/node_modules/socket.io-client/build/esm/on.mjs +0 -8
  121. package/dist/es/node_modules/socket.io-client/build/esm/socket.mjs +0 -608
  122. package/dist/es/node_modules/socket.io-client/build/esm/url.mjs +0 -19
  123. package/dist/es/node_modules/socket.io-parser/build/esm/binary.mjs +0 -52
  124. package/dist/es/node_modules/socket.io-parser/build/esm/index.mjs +0 -203
  125. package/dist/es/node_modules/socket.io-parser/build/esm/is-binary.mjs +0 -26
  126. package/dist/es/packages/agent-cli-sdk/src/AgentSession.mjs +0 -243
  127. package/dist/es/packages/agent-cli-sdk/src/BotClient.mjs +0 -242
  128. package/dist/es/packages/agent-cli-sdk/src/Config.mjs +0 -34
  129. package/dist/es/packages/agent-cli-sdk/src/DialogSession.mjs +0 -281
  130. package/dist/es/packages/agent-cli-sdk/src/EventBus.mjs +0 -64
  131. package/dist/es/packages/agent-cli-sdk/src/Logger.mjs +0 -31
  132. package/dist/es/packages/agent-cli-sdk/src/PayloadTypes.mjs +0 -4
  133. package/dist/es/packages/agent-cli-sdk/src/Session.mjs +0 -527
  134. package/dist/es/packages/agent-cli-sdk/src/api/fetchEventSource/fetch.mjs +0 -112
  135. package/dist/es/packages/agent-cli-sdk/src/api/fetchEventSource/parse.mjs +0 -97
  136. package/dist/es/packages/agent-cli-sdk/src/api/index.mjs +0 -48
  137. package/dist/es/packages/agent-cli-sdk/src/utils.mjs +0 -11
  138. package/dist/es/packages/apis/dist/es/aecpilot/cosntant.mjs +0 -5
  139. package/dist/es/packages/apis/dist/es/aecpilot/model.mjs +0 -9
  140. package/dist/es/packages/apis/dist/es/aecpilotui/index.mjs +0 -8
  141. package/dist/es/packages/apis/dist/es/agentcliui/index.mjs +0 -414
  142. package/dist/es/packages/apis/dist/es/base/index.mjs +0 -154
  143. package/dist/es/packages/apis/dist/es/cvforce/index.mjs +0 -431
  144. package/dist/es/packages/apis/dist/es/cvforce/model.mjs +0 -6
  145. package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/native.mjs +0 -6
  146. package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/rng.mjs +0 -10
  147. package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs +0 -9
  148. package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/v4.mjs +0 -19
  149. package/dist/es/packages/apis/dist/es/utils/fetchEventSource/fetch.mjs +0 -106
  150. package/dist/es/packages/apis/dist/es/utils/fetchEventSource/parse.mjs +0 -97
@@ -1,171 +1,185 @@
1
- var v = (x, w, p) => new Promise((d, e) => {
2
- var b = (o) => {
1
+ var N = (V, E, f) => new Promise((a, i) => {
2
+ var v = (p) => {
3
3
  try {
4
- s(p.next(o));
5
- } catch (f) {
6
- e(f);
4
+ k(f.next(p));
5
+ } catch (s) {
6
+ i(s);
7
7
  }
8
- }, N = (o) => {
8
+ }, g = (p) => {
9
9
  try {
10
- s(p.throw(o));
11
- } catch (f) {
12
- e(f);
10
+ k(f.throw(p));
11
+ } catch (s) {
12
+ i(s);
13
13
  }
14
- }, s = (o) => o.done ? d(o.value) : Promise.resolve(o.value).then(b, N);
15
- s((p = p.apply(x, w)).next());
14
+ }, k = (p) => p.done ? a(p.value) : Promise.resolve(p.value).then(v, g);
15
+ k((f = f.apply(V, E)).next());
16
16
  });
17
- import { jsx as c, jsxs as h } from "../../_virtual/jsx-runtime.mjs";
18
- import { forwardRef as B, useState as C, useContext as K, useEffect as E, useImperativeHandle as U } from "react";
19
- import { Button as q, Popconfirm as D, Input as G, Space as J } from "antd";
20
- import Q from "dayjs";
21
- import T from "../../node_modules/classnames/index.mjs";
22
- import H from "../../Iconfont/index.mjs";
23
- import V from "../../context.mjs";
17
+ import { jsx as n, jsxs as r } from "../../_virtual/jsx-runtime.mjs";
18
+ import { forwardRef as U, useState as L, useContext as q, useEffect as x, useImperativeHandle as G } from "react";
19
+ import { Button as J, Popconfirm as H, Input as Q, Space as T } from "antd";
20
+ import W from "dayjs";
21
+ import X from "../../node_modules/classnames/index.mjs";
22
+ import O from "../../Iconfont/index.mjs";
23
+ import Y from "../../context.mjs";
24
24
  import "./style.less.mjs";
25
- import W from "../../node_modules/ahooks/es/useMemoizedFn/index.mjs";
26
- const X = B((x, w) => {
27
- var M;
25
+ import Z from "../../node_modules/ahooks/es/useMemoizedFn/index.mjs";
26
+ const $ = U((V, E) => {
28
27
  const {
29
- sider: p,
30
- currentSession: d,
31
- setCurrentSession: e,
32
- checkKnowledges: b,
33
- application: N,
34
- networkStatus: s
35
- } = x, [o, f] = C(), {
36
- agentClient: l,
37
- mode: L
38
- } = K(V), [m, u] = C([]), P = W(() => {
39
- var t;
40
- if (!((t = d == null ? void 0 : d.data) != null && t.id))
28
+ sider: f,
29
+ currentSession: a,
30
+ setCurrentSession: i,
31
+ checkKnowledges: v,
32
+ application: g,
33
+ networkStatus: k
34
+ } = V, [p, s] = L(), {
35
+ agentClient: m,
36
+ mode: P,
37
+ features: t
38
+ } = q(Y), [h, j] = L([]), [D, K] = L(v), M = Z(() => {
39
+ var e;
40
+ if (!((e = a == null ? void 0 : a.data) != null && e.id))
41
41
  return;
42
- const a = m.map((i) => {
43
- var n, r;
44
- return ((n = i.data) == null ? void 0 : n.id) === ((r = d.data) == null ? void 0 : r.id) ? d : i;
42
+ const d = h.map((l) => {
43
+ var o, c;
44
+ return ((o = l.data) == null ? void 0 : o.id) === ((c = a.data) == null ? void 0 : c.id) ? a : l;
45
45
  });
46
- u([...a]);
46
+ j([...d]);
47
47
  });
48
- E(() => {
49
- l == null || l.getSessions().then((a) => v(void 0, null, function* () {
50
- var t;
51
- if (u([...a]), !((t = d == null ? void 0 : d.data) != null && t.id) && (a != null && a.length) && L === "inlay") {
52
- const i = a[0];
53
- e == null || e(i);
48
+ x(() => {
49
+ m == null || m.getSessions().then((d) => N(void 0, null, function* () {
50
+ var e;
51
+ if (j([...d]), !((e = a == null ? void 0 : a.data) != null && e.id) && (d != null && d.length) && P === "inlay") {
52
+ const l = d[0];
53
+ i == null || i(l);
54
54
  }
55
55
  }));
56
- }, []), E(() => {
57
- d == null || d.addEventListener("data:updated", P);
58
- }, [(M = d == null ? void 0 : d.data) == null ? void 0 : M.id]), U(w, () => ({
59
- create(a) {
60
- return j(a);
56
+ }, []), x(() => {
57
+ var d;
58
+ if (!((d = a == null ? void 0 : a.data) != null && d.id) && v === void 0) {
59
+ const e = typeof (t == null ? void 0 : t.knowledges) == "object" && t.knowledges.default || void 0;
60
+ K(e);
61
+ return;
62
+ }
63
+ K(v);
64
+ }, [v]), x(() => {
65
+ a == null || a.addEventListener("data:updated", M);
66
+ }, [a]), G(E, () => ({
67
+ create(d) {
68
+ return C(d);
61
69
  }
62
70
  }));
63
- const j = (a) => new Promise((t) => v(void 0, null, function* () {
64
- var n;
65
- const i = yield l == null ? void 0 : l.loadSession("", {
66
- name: a == null ? void 0 : a.name,
71
+ const C = (d) => new Promise((e) => N(void 0, null, function* () {
72
+ var c;
73
+ const l = typeof (t == null ? void 0 : t.promptVariables) == "object" ? (t == null ? void 0 : t.promptVariables.default) || [] : void 0, o = yield m == null ? void 0 : m.loadSession("", {
74
+ name: d == null ? void 0 : d.name,
67
75
  // @ts-ignore netOpen入参是number 响应是boolen
68
76
  // 只有对话有联网 其它没有
69
- netOpen: (N == null ? void 0 : N.type) === 0 ? a == null ? void 0 : a.netOpen : void 0,
70
- knowledges: (n = d == null ? void 0 : d.data) != null && n.id ? void 0 : b
77
+ netOpen: (g == null ? void 0 : g.type) === 0 ? d == null ? void 0 : d.netOpen : void 0,
78
+ knowledges: (c = a == null ? void 0 : a.data) != null && c.id ? d == null ? void 0 : d.knowledges : D,
79
+ promptVariables: l
71
80
  });
72
- i == null || i.addEventListener("data:created", () => v(void 0, null, function* () {
73
- u([i, ...m]), t(i);
81
+ o == null || o.addEventListener("data:created", () => N(void 0, null, function* () {
82
+ j([o, ...h]), e(o);
74
83
  }));
75
- })), O = () => {
76
- j({
77
- netOpen: (m == null ? void 0 : m.length) > 0 ? 2 : s ? 1 : 2
78
- }).then((a) => {
79
- e == null || e(a);
84
+ })), z = () => {
85
+ C({
86
+ netOpen: (h == null ? void 0 : h.length) > 0 ? 2 : k ? 1 : 2,
87
+ knowledges: D
88
+ }).then((d) => {
89
+ i == null || i(d);
80
90
  });
81
- }, z = (a) => {
82
- l == null || l.removeSession(a, !0).then(() => v(void 0, null, function* () {
83
- var i, n;
84
- const t = m.filter((r) => {
85
- var y, k;
86
- return ((y = r.data) == null ? void 0 : y.id) !== ((k = a.data) == null ? void 0 : k.id);
91
+ }, A = (d) => {
92
+ m == null || m.removeSession(d, !0).then(() => N(void 0, null, function* () {
93
+ var l, o;
94
+ const e = h.filter((c) => {
95
+ var w, y;
96
+ return ((w = c.data) == null ? void 0 : w.id) !== ((y = d.data) == null ? void 0 : y.id);
87
97
  });
88
- ((i = a.data) == null ? void 0 : i.id) === ((n = d == null ? void 0 : d.data) == null ? void 0 : n.id) && (t != null && t.length ? e == null || e(t[0]) : e == null || e(void 0)), u([...t]);
98
+ ((l = d.data) == null ? void 0 : l.id) === ((o = a == null ? void 0 : a.data) == null ? void 0 : o.id) && (e != null && e.length ? i == null || i(e[0]) : i == null || i(void 0)), j([...e]);
89
99
  }));
90
- }, A = (a) => {
91
- var t;
92
- f((t = a.data) == null ? void 0 : t.name);
93
- }, F = (a) => {
94
- o && (a.rename(o), a == null || a.addEventListener("data:updated", P));
95
- }, R = (a) => v(void 0, null, function* () {
96
- e == null || e(a);
97
- }), _ = (a) => {
98
- f(a.target.value);
100
+ }, F = (d) => {
101
+ var e;
102
+ s((e = d.data) == null ? void 0 : e.name);
103
+ }, R = (d) => {
104
+ p && (d.rename(p), d == null || d.addEventListener("data:updated", M));
105
+ }, _ = (d) => N(void 0, null, function* () {
106
+ i == null || i(d);
107
+ }), B = (d) => {
108
+ s(d.target.value);
99
109
  };
100
- return E(() => {
101
- d != null && d.id && (l == null || l.loadSession(d.id));
102
- }, [d]), /* @__PURE__ */ c("div", {
110
+ return x(() => {
111
+ var e, l, o, c;
112
+ if (!(a != null && a.id))
113
+ return;
114
+ const d = {};
115
+ typeof (t == null ? void 0 : t.knowledges) == "object" && ((e = t == null ? void 0 : t.knowledges) != null && e.default) && (d.knowledges = (l = t == null ? void 0 : t.knowledges) == null ? void 0 : l.default), typeof (t == null ? void 0 : t.promptVariables) == "object" && ((o = t == null ? void 0 : t.promptVariables) != null && o.default) && (d.promptVariables = (c = t == null ? void 0 : t.promptVariables) == null ? void 0 : c.default), m == null || m.loadSession(a.id, d);
116
+ }, [a]), /* @__PURE__ */ n("div", {
103
117
  className: "bot-session-container",
104
- children: p && L === "inlay" && /* @__PURE__ */ h("div", {
118
+ children: f && P === "inlay" && /* @__PURE__ */ r("div", {
105
119
  className: "agent-sessions",
106
- children: [/* @__PURE__ */ h("div", {
120
+ children: [/* @__PURE__ */ r("div", {
107
121
  className: "sessions-header",
108
- children: [/* @__PURE__ */ c("span", {
122
+ children: [/* @__PURE__ */ n("span", {
109
123
  className: "session-header-title",
110
124
  children: "会话列表"
111
- }), /* @__PURE__ */ c(q, {
125
+ }), /* @__PURE__ */ n(J, {
112
126
  className: "session-header-btn",
113
- onClick: O,
127
+ onClick: z,
114
128
  children: "+ 新建会话"
115
129
  })]
116
- }), /* @__PURE__ */ c("div", {
130
+ }), /* @__PURE__ */ n("div", {
117
131
  className: "sessions-main",
118
- children: m == null ? void 0 : m.map((a) => {
119
- var t, i, n, r, y, k;
120
- return /* @__PURE__ */ c("div", {
121
- className: T({
132
+ children: h == null ? void 0 : h.map((d) => {
133
+ var e, l, o, c, w, y;
134
+ return /* @__PURE__ */ n("div", {
135
+ className: X({
122
136
  "session-item": !0,
123
- "session-item__active": ((t = a.data) == null ? void 0 : t.id) === ((i = d == null ? void 0 : d.data) == null ? void 0 : i.id)
137
+ "session-item__active": ((e = d.data) == null ? void 0 : e.id) === ((l = a == null ? void 0 : a.data) == null ? void 0 : l.id)
124
138
  }),
125
- onClick: () => R(a),
126
- children: /* @__PURE__ */ h("div", {
139
+ onClick: () => _(d),
140
+ children: /* @__PURE__ */ r("div", {
127
141
  className: "session-item-wrapper",
128
- children: [/* @__PURE__ */ h("div", {
142
+ children: [/* @__PURE__ */ r("div", {
129
143
  className: "session-item-top",
130
- children: [/* @__PURE__ */ c("span", {
144
+ children: [/* @__PURE__ */ n("span", {
131
145
  className: "item-top-title",
132
- children: ((n = a.data) == null ? void 0 : n.name) || "-"
133
- }), /* @__PURE__ */ h("div", {
146
+ children: ((o = d.data) == null ? void 0 : o.name) || "-"
147
+ }), /* @__PURE__ */ r("div", {
134
148
  className: "item-top-action",
135
- onClick: (g) => g.stopPropagation(),
136
- children: [/* @__PURE__ */ c(D, {
137
- getPopupContainer: (g) => g.parentNode,
149
+ onClick: (b) => b.stopPropagation(),
150
+ children: [/* @__PURE__ */ n(H, {
151
+ getPopupContainer: (b) => b.parentNode,
138
152
  icon: !1,
139
- title: /* @__PURE__ */ c(G, {
153
+ title: /* @__PURE__ */ n(Q, {
140
154
  placeholder: "请输入内容",
141
155
  autoComplete: "off",
142
156
  showCount: !0,
143
- value: o,
144
- onChange: _,
157
+ value: p,
158
+ onChange: B,
145
159
  maxLength: 15
146
160
  }),
147
- onConfirm: () => F(a),
148
- children: /* @__PURE__ */ c(H, {
161
+ onConfirm: () => R(d),
162
+ children: /* @__PURE__ */ n(O, {
149
163
  type: "icon-bianji2",
150
- onClick: () => A(a),
164
+ onClick: () => F(d),
151
165
  className: "icon-action",
152
166
  style: {
153
167
  marginRight: "8px"
154
168
  }
155
169
  })
156
- }), /* @__PURE__ */ c(D, {
157
- getPopupContainer: (g) => g.parentNode,
170
+ }), /* @__PURE__ */ n(H, {
171
+ getPopupContainer: (b) => b.parentNode,
158
172
  icon: !1,
159
- title: /* @__PURE__ */ h(J, {
173
+ title: /* @__PURE__ */ r(T, {
160
174
  direction: "vertical",
161
- children: [/* @__PURE__ */ c("div", {
175
+ children: [/* @__PURE__ */ n("div", {
162
176
  children: "删除确认?"
163
- }), /* @__PURE__ */ c("div", {
177
+ }), /* @__PURE__ */ n("div", {
164
178
  children: "会话删除后不可恢复,请确认是否删除!"
165
179
  })]
166
180
  }),
167
- onConfirm: () => z(a),
168
- children: /* @__PURE__ */ c(H, {
181
+ onConfirm: () => A(d),
182
+ children: /* @__PURE__ */ n(O, {
169
183
  style: {
170
184
  fontSize: "18px"
171
185
  },
@@ -174,24 +188,24 @@ const X = B((x, w) => {
174
188
  })
175
189
  })]
176
190
  })]
177
- }), /* @__PURE__ */ h("div", {
191
+ }), /* @__PURE__ */ r("div", {
178
192
  className: "session-item-bottom",
179
- children: [/* @__PURE__ */ c("span", {
193
+ children: [/* @__PURE__ */ n("span", {
180
194
  className: "item-bottom-desc",
181
- children: ((r = a.data) == null ? void 0 : r.finialMessage) || "-"
182
- }), /* @__PURE__ */ c("span", {
195
+ children: ((c = d.data) == null ? void 0 : c.finialMessage) || "-"
196
+ }), /* @__PURE__ */ n("span", {
183
197
  className: "item-bottom-time",
184
- children: Q((y = a.data) == null ? void 0 : y.createdAt).format("MM/DD HH:mm:ss")
198
+ children: W((w = d.data) == null ? void 0 : w.createdAt).format("MM/DD HH:mm:ss")
185
199
  })]
186
200
  })]
187
201
  })
188
- }, (k = a.data) == null ? void 0 : k.id);
202
+ }, (y = d.data) == null ? void 0 : y.id);
189
203
  })
190
204
  })]
191
205
  })
192
206
  });
193
207
  });
194
- X.displayName = "SessionList";
208
+ $.displayName = "SessionList";
195
209
  export {
196
- X as default
210
+ $ as default
197
211
  };
@@ -1,10 +1,10 @@
1
1
  import { jsxs as a, jsx as s } from "../../_virtual/jsx-runtime.mjs";
2
2
  import { Popover as p, Button as c } from "antd";
3
3
  import { useState as m } from "react";
4
- import d from "./HistorySessionList/index.mjs";
4
+ import f from "./HistorySessionList/index.mjs";
5
5
  import "./style.less.mjs";
6
- import f from "../../Iconfont/index.mjs";
7
- const h = (o) => {
6
+ import d from "../../Iconfont/index.mjs";
7
+ const C = (o) => {
8
8
  const {
9
9
  currentSessionId: t,
10
10
  disabled: i = !1,
@@ -13,7 +13,8 @@ const h = (o) => {
13
13
  return /* @__PURE__ */ a("div", {
14
14
  className: "session-list-component",
15
15
  children: [/* @__PURE__ */ s(p, {
16
- placement: "top",
16
+ placement: "topRight",
17
+ showArrow: !1,
17
18
  overlayClassName: "session-list-overlay",
18
19
  overlayStyle: {
19
20
  padding: "4px"
@@ -24,7 +25,7 @@ const h = (o) => {
24
25
  className: "list-overlay-action",
25
26
  disabled: i,
26
27
  type: "text",
27
- icon: /* @__PURE__ */ s(f, {
28
+ icon: /* @__PURE__ */ s(d, {
28
29
  type: "icon-lishijilu",
29
30
  style: {
30
31
  fontSize: 24
@@ -32,7 +33,7 @@ const h = (o) => {
32
33
  }),
33
34
  onClick: () => e(!0)
34
35
  })
35
- }), r && /* @__PURE__ */ s(d, {
36
+ }), r && /* @__PURE__ */ s(f, {
36
37
  currentSessionId: t || "",
37
38
  onSessionChange: n,
38
39
  onClose: () => e(!1)
@@ -40,5 +41,5 @@ const h = (o) => {
40
41
  });
41
42
  };
42
43
  export {
43
- h as default
44
+ C as default
44
45
  };
@@ -1,66 +1,59 @@
1
- var p = (a, e, t) => new Promise((l, i) => {
1
+ var a = (p, e, n) => new Promise((l, i) => {
2
2
  var m = (o) => {
3
3
  try {
4
- c(t.next(o));
5
- } catch (r) {
6
- i(r);
4
+ r(n.next(o));
5
+ } catch (c) {
6
+ i(c);
7
7
  }
8
8
  }, k = (o) => {
9
9
  try {
10
- c(t.throw(o));
11
- } catch (r) {
12
- i(r);
10
+ r(n.throw(o));
11
+ } catch (c) {
12
+ i(c);
13
13
  }
14
- }, c = (o) => o.done ? l(o.value) : Promise.resolve(o.value).then(m, k);
15
- c((t = t.apply(a, e)).next());
14
+ }, r = (o) => o.done ? l(o.value) : Promise.resolve(o.value).then(m, k);
15
+ r((n = n.apply(p, e)).next());
16
16
  });
17
- import { jsxs as g, jsx as n } from "../../../_virtual/jsx-runtime.mjs";
17
+ import { jsxs as g, jsx as t } from "../../../_virtual/jsx-runtime.mjs";
18
18
  import { useContext as w } from "react";
19
19
  import { Space as h, Tooltip as I, Button as y } from "antd";
20
- import "axios";
21
- import "../../../node_modules/@glodon-aiot/minio/dist/minio-zj.mjs";
22
- import { ISourceType as f, IversionInfo as b } from "../../../packages/apis/dist/es/aecpilot/model.mjs";
23
- import "dayjs";
24
- import "../../../packages/apis/dist/es/node_modules/uuid/dist/esm-browser/native.mjs";
25
- import "../../../packages/apis/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs";
26
- import "../../../packages/apis/dist/es/agentcliui/index.mjs";
27
- import "../../../packages/apis/dist/es/aecpilotui/index.mjs";
20
+ import { ISourceType as f, IversionInfo as b } from "@glodon-aiot/apis";
28
21
  import d from "../../../Iconfont/index.mjs";
29
22
  import "./style.less.mjs";
30
23
  import x from "../../../components/WebLink/index.mjs";
31
24
  import C from "../../../context.mjs";
32
- const D = (a) => {
33
- var o, r;
25
+ const F = (p) => {
26
+ var o, c;
34
27
  const {
35
28
  data: e,
36
- onClick: t,
29
+ onClick: n,
37
30
  loadPage: l
38
- } = a, {
31
+ } = p, {
39
32
  transform: i
40
- } = w(C), m = () => p(void 0, null, function* () {
33
+ } = w(C), m = () => a(void 0, null, function* () {
41
34
  return l ? yield l(e.knowledgeId, e.docId, e.textId) : 0;
42
- }), k = e.sourceType === f.WebLink && !!e.webLink, c = (
35
+ }), k = e.sourceType === f.WebLink && !!e.webLink, r = (
43
36
  // data?.origin === IFileOrigin.AECPILOT ||
44
37
  e.sourceType === f.SourceFile && !!e.sourceFileName && // data.sourceFileName 标识参考文件存在与否,不能使用其他字段判断
45
38
  (e == null ? void 0 : e.versionInfo) !== b.ProtectUnauthorize
46
39
  );
47
40
  return /* @__PURE__ */ g(h, {
48
41
  className: "session-refer-panel",
49
- children: [/* @__PURE__ */ n("span", {
42
+ children: [/* @__PURE__ */ t("span", {
50
43
  className: "refer-panel-item",
51
44
  children: (e.knowledgeSourceName || "") + (e.knowledgeTitleName || "") || "-"
52
- }), k && ((o = i == null ? void 0 : i.reference) == null ? void 0 : o.iconVisible) && /* @__PURE__ */ n(I, {
45
+ }), k && ((o = i == null ? void 0 : i.reference) == null ? void 0 : o.iconVisible) && /* @__PURE__ */ t(I, {
53
46
  overlayStyle: {
54
47
  maxWidth: "90vw"
55
48
  },
56
- title: /* @__PURE__ */ n(x, {
49
+ title: /* @__PURE__ */ t(x, {
57
50
  href: e.webLink,
58
51
  onClick: (s) => {
59
52
  s.stopPropagation();
60
53
  }
61
54
  }),
62
- children: /* @__PURE__ */ n(y, {
63
- icon: /* @__PURE__ */ n(d, {
55
+ children: /* @__PURE__ */ t(y, {
56
+ icon: /* @__PURE__ */ t(d, {
64
57
  type: e.sourceType === f.WebLink ? "icon-lianjie" : "icon-doc-link",
65
58
  style: {
66
59
  fontSize: 16
@@ -68,12 +61,12 @@ const D = (a) => {
68
61
  }),
69
62
  type: "link",
70
63
  size: "small",
71
- onClick: (s) => p(void 0, null, function* () {
72
- s.stopPropagation(), t(e);
64
+ onClick: (s) => a(void 0, null, function* () {
65
+ s.stopPropagation(), n(e);
73
66
  })
74
67
  })
75
- }), c && ((r = i == null ? void 0 : i.reference) == null ? void 0 : r.iconVisible) && /* @__PURE__ */ n(y, {
76
- icon: /* @__PURE__ */ n(d, {
68
+ }), r && ((c = i == null ? void 0 : i.reference) == null ? void 0 : c.iconVisible) && /* @__PURE__ */ t(y, {
69
+ icon: /* @__PURE__ */ t(d, {
77
70
  type: "icon-doc-link",
78
71
  style: {
79
72
  fontSize: 16
@@ -81,14 +74,14 @@ const D = (a) => {
81
74
  }),
82
75
  type: "link",
83
76
  size: "small",
84
- onClick: (s) => p(void 0, null, function* () {
77
+ onClick: (s) => a(void 0, null, function* () {
85
78
  s.stopPropagation();
86
79
  const u = (yield m()) || 0;
87
- t(e, u);
80
+ n(e, u);
88
81
  })
89
82
  })]
90
83
  });
91
84
  };
92
85
  export {
93
- D as default
86
+ F as default
94
87
  };
@@ -1,86 +1,79 @@
1
- import { jsxs as n, jsx as i } from "../../_virtual/jsx-runtime.mjs";
1
+ import { jsxs as s, jsx as n } from "../../_virtual/jsx-runtime.mjs";
2
2
  import { useContext as x } from "react";
3
3
  import { Space as p, Collapse as f } from "antd";
4
4
  import S from "../../Iconfont/index.mjs";
5
5
  import "./style.less.mjs";
6
- import "axios";
7
- import "../../node_modules/@glodon-aiot/minio/dist/minio-zj.mjs";
8
- import { ISourceType as u } from "../../packages/apis/dist/es/aecpilot/model.mjs";
9
- import "dayjs";
10
- import "../../packages/apis/dist/es/node_modules/uuid/dist/esm-browser/native.mjs";
11
- import "../../packages/apis/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs";
12
- import "../../packages/apis/dist/es/agentcliui/index.mjs";
13
- import "../../packages/apis/dist/es/aecpilotui/index.mjs";
6
+ import { ISourceType as u } from "@glodon-aiot/apis";
14
7
  import D from "../../components/Markdown/index.mjs";
15
8
  import y from "./ReferItem/index.mjs";
16
9
  import F from "../../context.mjs";
17
10
  const {
18
11
  Panel: R
19
- } = f, G = (h) => {
20
- var l, d, m, c;
12
+ } = f, E = (h) => {
13
+ var r, d, c, m;
21
14
  const {
22
15
  history: o,
23
16
  docViewerUrl: w
24
17
  } = h, {
25
- transform: r,
26
- service: s
27
- } = x(F), I = (e, t) => {
18
+ transform: i,
19
+ service: l
20
+ } = x(F), I = (e, a) => {
28
21
  if (!(!(e != null && e.knowledgeId) || !(e != null && e.docId))) {
29
22
  if (e.sourceType === u.WebLink) {
30
23
  window.open(e.webLink);
31
24
  return;
32
25
  }
33
- e.sourceType === u.SourceFile && window.open(`${w}#/doc?url=${encodeURIComponent(e.sourceFileUrl)}&page=${t || 0}`);
26
+ e.sourceType === u.SourceFile && window.open(`${w}#/doc?url=${encodeURIComponent(e.sourceFileUrl)}&page=${a || 0}`);
34
27
  }
35
28
  };
36
- return /* @__PURE__ */ n("div", {
29
+ return /* @__PURE__ */ s("div", {
37
30
  className: "session-refer",
38
- children: [/* @__PURE__ */ n(p, {
31
+ children: [/* @__PURE__ */ s(p, {
39
32
  className: "session-refer-header",
40
33
  size: 8,
41
- children: [/* @__PURE__ */ i(S, {
34
+ children: [/* @__PURE__ */ n(S, {
42
35
  type: "icon-cankaolaiyuan",
43
36
  style: {
44
37
  color: "#0A51D1",
45
38
  fontSize: 16
46
39
  }
47
- }), /* @__PURE__ */ i("span", {
40
+ }), /* @__PURE__ */ n("span", {
48
41
  className: "refer-header-title",
49
42
  children: "参考来源"
50
- }), /* @__PURE__ */ n("span", {
51
- children: ["(共 ", ((l = o == null ? void 0 : o.reference) == null ? void 0 : l.length) || 0, " 项)"]
43
+ }), /* @__PURE__ */ s("span", {
44
+ children: ["(共 ", ((r = o == null ? void 0 : o.reference) == null ? void 0 : r.length) || 0, " 项)"]
52
45
  })]
53
- }), /* @__PURE__ */ i("div", {
46
+ }), /* @__PURE__ */ n("div", {
54
47
  className: "session-refer-content",
55
- children: /* @__PURE__ */ i(f, {
48
+ children: /* @__PURE__ */ n(f, {
56
49
  ghost: !0,
57
- defaultActiveKey: (d = r == null ? void 0 : r.reference) != null && d.isExpand ? (m = o == null ? void 0 : o.reference) == null ? void 0 : m.map((e, t) => e.docId + t) : [],
58
- children: (c = o == null ? void 0 : o.reference) == null ? void 0 : c.map((e, t) => /* @__PURE__ */ i(R, {
59
- header: /* @__PURE__ */ n(p, {
50
+ defaultActiveKey: (d = i == null ? void 0 : i.reference) != null && d.isExpand ? (c = o == null ? void 0 : o.reference) == null ? void 0 : c.map((e, a) => e.docId + a) : [],
51
+ children: (m = o == null ? void 0 : o.reference) == null ? void 0 : m.map((e, a) => /* @__PURE__ */ n(R, {
52
+ header: /* @__PURE__ */ s(p, {
60
53
  className: "session-refer-panel",
61
- children: [/* @__PURE__ */ n("span", {
54
+ children: [/* @__PURE__ */ s("span", {
62
55
  className: "refer-panel-item",
63
- children: [t + 1, "."]
64
- }), s && /* @__PURE__ */ i(y, {
56
+ children: [a + 1, "."]
57
+ }), l && /* @__PURE__ */ n(y, {
65
58
  data: e,
66
- loadPage: (g, k, C) => s.getKnowledgeIdFileIdData(g, k, C).then((N) => {
67
- const a = (N || []).find((v) => v.key === "pages_from");
68
- return (a == null ? void 0 : a.value) || 0;
59
+ loadPage: (g, k, C) => l.getKnowledgeIdFileIdData(g, k, C).then((N) => {
60
+ const t = (N || []).find((v) => v.key === "pages_from");
61
+ return (t == null ? void 0 : t.value) || 0;
69
62
  }),
70
63
  onClick: I
71
64
  })]
72
65
  }),
73
- children: /* @__PURE__ */ i("div", {
66
+ children: /* @__PURE__ */ n("div", {
74
67
  className: "refer-markdown",
75
- children: /* @__PURE__ */ i(D, {
68
+ children: /* @__PURE__ */ n(D, {
76
69
  children: e.text || "-"
77
70
  })
78
71
  })
79
- }, e.docId + t))
72
+ }, e.docId + a))
80
73
  })
81
74
  })]
82
75
  });
83
76
  };
84
77
  export {
85
- G as default
78
+ E as default
86
79
  };