@glodon-aiot/agent-cli-ui 2.4.7 → 3.0.5-beta.0

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 (151) 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/UploadingPrompt/index.mjs +10 -12
  18. package/dist/es/Dialog/index.mjs +125 -93
  19. package/dist/es/QuillEditor/index.mjs +88 -84
  20. package/dist/es/_virtual/index.mjs +2 -2
  21. package/dist/es/components/Markdown/Image/index.mjs +20 -20
  22. package/dist/es/components/Markdown/index.mjs +27 -22
  23. package/dist/es/constant.mjs +8 -5
  24. package/dist/es/index.mjs +178 -152
  25. package/dist/es/node_modules/classnames/index.mjs +1 -1
  26. package/dist/es/node_modules/comma-separated-tokens/index.mjs +13 -0
  27. package/dist/es/node_modules/devlop/lib/default.mjs +5 -0
  28. package/dist/es/node_modules/hast-util-from-dom/lib/index.mjs +93 -0
  29. package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/create-h.mjs +126 -0
  30. package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/index.mjs +8 -0
  31. package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/svg-case-sensitive-tag-names.mjs +4 -0
  32. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/index.mjs +12 -0
  33. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/aria.mjs +61 -0
  34. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/find.mjs +33 -0
  35. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/html.mjs +368 -0
  36. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/normalize.mjs +6 -0
  37. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/svg.mjs +566 -0
  38. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/case-insensitive-transform.mjs +7 -0
  39. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/case-sensitive-transform.mjs +6 -0
  40. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/create.mjs +14 -0
  41. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/defined-info.mjs +36 -0
  42. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/info.mjs +28 -0
  43. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/merge.mjs +10 -0
  44. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/schema.mjs +21 -0
  45. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/types.mjs +15 -0
  46. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xlink.mjs +19 -0
  47. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xml.mjs +15 -0
  48. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xmlns.mjs +16 -0
  49. package/dist/es/node_modules/hast-util-from-html-isomorphic/lib/browser.mjs +16 -0
  50. package/dist/es/node_modules/hast-util-is-element/lib/index.mjs +61 -0
  51. package/dist/es/node_modules/hast-util-parse-selector/lib/index.mjs +20 -0
  52. package/dist/es/node_modules/hast-util-to-text/lib/index.mjs +223 -0
  53. package/dist/es/node_modules/katex/dist/katex.min.css.mjs +4 -0
  54. package/dist/es/node_modules/katex/dist/katex.mjs +11700 -0
  55. package/dist/es/node_modules/longest-streak/index.mjs +12 -0
  56. package/dist/es/node_modules/mdast-util-math/lib/index.mjs +170 -0
  57. package/dist/es/node_modules/micromark-extension-math/lib/math-flow.mjs +76 -0
  58. package/dist/es/node_modules/micromark-extension-math/lib/math-text.mjs +48 -0
  59. package/dist/es/node_modules/micromark-extension-math/lib/syntax.mjs +15 -0
  60. package/dist/es/node_modules/micromark-factory-space/index.mjs +15 -0
  61. package/dist/es/node_modules/micromark-util-character/index.mjs +10 -0
  62. package/dist/es/node_modules/rehype-katex/lib/index.mjs +83 -0
  63. package/dist/es/node_modules/remark-math/lib/index.mjs +13 -0
  64. package/dist/es/node_modules/space-separated-tokens/index.mjs +7 -0
  65. package/dist/es/node_modules/unist-util-find-after/lib/index.mjs +32 -0
  66. package/dist/es/node_modules/unist-util-is/lib/index.mjs +81 -0
  67. package/dist/es/node_modules/unist-util-visit-parents/lib/color.mjs +6 -0
  68. package/dist/es/node_modules/unist-util-visit-parents/lib/index.mjs +56 -0
  69. package/dist/es/node_modules/web-namespaces/index.mjs +11 -0
  70. package/dist/es/utils/index.mjs +44 -27
  71. package/dist/lib/index.js +278 -138
  72. package/dist/src/Dialog/AgentChat/index.d.ts +4 -2
  73. package/dist/src/Dialog/ConnectToNetwork/index.d.ts +1 -0
  74. package/dist/src/Dialog/KnowledgeList/KnowledgeSelect/index.d.ts +1 -1
  75. package/dist/src/Dialog/KnowledgeList/index.d.ts +2 -3
  76. package/dist/src/Dialog/PromptSetting/index.d.ts +1 -0
  77. package/dist/src/Dialog/SessionAction/index.d.ts +2 -0
  78. package/dist/src/Dialog/SessionList/index.d.ts +5 -4
  79. package/dist/src/QuillEditor/index.d.ts +1 -0
  80. package/dist/src/components/Markdown/Text/index.d.ts +8 -0
  81. package/dist/src/components/MathJaxLoader/index.d.ts +7 -0
  82. package/dist/src/components/MathJaxRender/index.d.ts +6 -0
  83. package/dist/src/constant.d.ts +1 -1
  84. package/dist/src/contexts/MathJaxContext.d.ts +12 -0
  85. package/dist/src/index.d.ts +4 -1
  86. package/dist/src/types.d.ts +26 -6
  87. package/dist/src/utils/index.d.ts +15 -0
  88. package/package.json +18 -17
  89. package/dist/es/_virtual/index2.mjs +0 -4
  90. package/dist/es/_virtual/index3.mjs +0 -4
  91. package/dist/es/_virtual/index4.mjs +0 -4
  92. package/dist/es/_virtual/minio-zj.mjs +0 -4
  93. package/dist/es/node_modules/@glodon-aiot/minio/dist/minio-zj.mjs +0 -26485
  94. package/dist/es/node_modules/@socket.io/component-emitter/lib/esm/index.mjs +0 -54
  95. package/dist/es/node_modules/base64-js/index.mjs +0 -47
  96. package/dist/es/node_modules/buffer/index.mjs +0 -927
  97. package/dist/es/node_modules/engine.io-client/build/esm/contrib/has-cors.mjs +0 -9
  98. package/dist/es/node_modules/engine.io-client/build/esm/contrib/parseqs.mjs +0 -18
  99. package/dist/es/node_modules/engine.io-client/build/esm/contrib/parseuri.mjs +0 -24
  100. package/dist/es/node_modules/engine.io-client/build/esm/contrib/yeast.mjs +0 -19
  101. package/dist/es/node_modules/engine.io-client/build/esm/globalThis.browser.mjs +0 -4
  102. package/dist/es/node_modules/engine.io-client/build/esm/socket.mjs +0 -317
  103. package/dist/es/node_modules/engine.io-client/build/esm/transport.mjs +0 -113
  104. package/dist/es/node_modules/engine.io-client/build/esm/transports/index.mjs +0 -11
  105. package/dist/es/node_modules/engine.io-client/build/esm/transports/polling.mjs +0 -273
  106. package/dist/es/node_modules/engine.io-client/build/esm/transports/websocket-constructor.browser.mjs +0 -8
  107. package/dist/es/node_modules/engine.io-client/build/esm/transports/websocket.mjs +0 -87
  108. package/dist/es/node_modules/engine.io-client/build/esm/transports/webtransport.mjs +0 -52
  109. package/dist/es/node_modules/engine.io-client/build/esm/transports/xmlhttprequest.browser.mjs +0 -21
  110. package/dist/es/node_modules/engine.io-client/build/esm/util.mjs +0 -23
  111. package/dist/es/node_modules/engine.io-parser/build/esm/commons.mjs +0 -21
  112. package/dist/es/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.mjs +0 -14
  113. package/dist/es/node_modules/engine.io-parser/build/esm/decodePacket.browser.mjs +0 -39
  114. package/dist/es/node_modules/engine.io-parser/build/esm/encodePacket.browser.mjs +0 -28
  115. package/dist/es/node_modules/engine.io-parser/build/esm/index.mjs +0 -105
  116. package/dist/es/node_modules/ieee754/index.mjs +0 -28
  117. package/dist/es/node_modules/js-base64/base64.mjs +0 -31
  118. package/dist/es/node_modules/socket.io-client/build/esm/contrib/backo2.mjs +0 -26
  119. package/dist/es/node_modules/socket.io-client/build/esm/index.mjs +0 -25
  120. package/dist/es/node_modules/socket.io-client/build/esm/manager.mjs +0 -242
  121. package/dist/es/node_modules/socket.io-client/build/esm/on.mjs +0 -8
  122. package/dist/es/node_modules/socket.io-client/build/esm/socket.mjs +0 -608
  123. package/dist/es/node_modules/socket.io-client/build/esm/url.mjs +0 -19
  124. package/dist/es/node_modules/socket.io-parser/build/esm/binary.mjs +0 -52
  125. package/dist/es/node_modules/socket.io-parser/build/esm/index.mjs +0 -203
  126. package/dist/es/node_modules/socket.io-parser/build/esm/is-binary.mjs +0 -26
  127. package/dist/es/packages/agent-cli-sdk/src/AgentSession.mjs +0 -243
  128. package/dist/es/packages/agent-cli-sdk/src/BotClient.mjs +0 -242
  129. package/dist/es/packages/agent-cli-sdk/src/Config.mjs +0 -34
  130. package/dist/es/packages/agent-cli-sdk/src/DialogSession.mjs +0 -281
  131. package/dist/es/packages/agent-cli-sdk/src/EventBus.mjs +0 -64
  132. package/dist/es/packages/agent-cli-sdk/src/Logger.mjs +0 -31
  133. package/dist/es/packages/agent-cli-sdk/src/PayloadTypes.mjs +0 -4
  134. package/dist/es/packages/agent-cli-sdk/src/Session.mjs +0 -527
  135. package/dist/es/packages/agent-cli-sdk/src/api/fetchEventSource/fetch.mjs +0 -112
  136. package/dist/es/packages/agent-cli-sdk/src/api/fetchEventSource/parse.mjs +0 -97
  137. package/dist/es/packages/agent-cli-sdk/src/api/index.mjs +0 -48
  138. package/dist/es/packages/agent-cli-sdk/src/utils.mjs +0 -11
  139. package/dist/es/packages/apis/dist/es/aecpilot/cosntant.mjs +0 -5
  140. package/dist/es/packages/apis/dist/es/aecpilot/model.mjs +0 -9
  141. package/dist/es/packages/apis/dist/es/aecpilotui/index.mjs +0 -8
  142. package/dist/es/packages/apis/dist/es/agentcliui/index.mjs +0 -414
  143. package/dist/es/packages/apis/dist/es/base/index.mjs +0 -154
  144. package/dist/es/packages/apis/dist/es/cvforce/index.mjs +0 -431
  145. package/dist/es/packages/apis/dist/es/cvforce/model.mjs +0 -6
  146. package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/native.mjs +0 -6
  147. package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/rng.mjs +0 -10
  148. package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs +0 -9
  149. package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/v4.mjs +0 -19
  150. package/dist/es/packages/apis/dist/es/utils/fetchEventSource/fetch.mjs +0 -106
  151. package/dist/es/packages/apis/dist/es/utils/fetchEventSource/parse.mjs +0 -97
@@ -1,115 +1,101 @@
1
1
  var X = Object.defineProperty, Y = Object.defineProperties;
2
2
  var Z = Object.getOwnPropertyDescriptors;
3
- var R = Object.getOwnPropertySymbols;
3
+ var N = Object.getOwnPropertySymbols;
4
4
  var _ = Object.prototype.hasOwnProperty, B = Object.prototype.propertyIsEnumerable;
5
- var k = (t, i, e) => i in t ? X(t, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[i] = e, c = (t, i) => {
6
- for (var e in i || (i = {}))
7
- _.call(i, e) && k(t, e, i[e]);
8
- if (R)
9
- for (var e of R(i))
10
- B.call(i, e) && k(t, e, i[e]);
11
- return t;
12
- }, h = (t, i) => Y(t, Z(i));
5
+ var y = (n, e, o) => e in n ? X(n, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : n[e] = o, d = (n, e) => {
6
+ for (var o in e || (e = {}))
7
+ _.call(e, o) && y(n, o, e[o]);
8
+ if (N)
9
+ for (var o of N(e))
10
+ B.call(e, o) && y(n, o, e[o]);
11
+ return n;
12
+ }, r = (n, e) => Y(n, Z(e));
13
13
  import { jsx as s, jsxs as x } from "./_virtual/jsx-runtime.mjs";
14
14
  import z from "./node_modules/antd/es/locale/zh_CN.mjs";
15
- import { useRef as ee, useState as r, useEffect as f } from "react";
15
+ import { useRef as ee, useState as l, useEffect as I } from "react";
16
16
  import "./style.less.mjs";
17
17
  import { AgentClientProvider as oe } from "./context.mjs";
18
18
  import { Resizable as te } from "react-resizable";
19
- import ie from "./Dialog/index.mjs";
20
- import { configure as ne } from "./packages/agent-cli-sdk/src/Config.mjs";
21
- import se from "./packages/agent-cli-sdk/src/BotClient.mjs";
22
- import "axios";
23
- import "./node_modules/@glodon-aiot/minio/dist/minio-zj.mjs";
24
- import "dayjs";
25
- import "./packages/apis/dist/es/node_modules/uuid/dist/esm-browser/native.mjs";
26
- import "./packages/apis/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs";
27
- import "./packages/apis/dist/es/agentcliui/index.mjs";
28
- import "./packages/apis/dist/es/aecpilotui/index.mjs";
19
+ import ne from "./Dialog/index.mjs";
20
+ import { configure as ie, BotClient as se } from "@glodon-aiot/agent-cli-sdk";
29
21
  import { JWT as le } from "./utils/index.mjs";
30
- import { ConfigProvider as A, Spin as re, Button as U } from "antd";
31
- const Pe = (t) => {
22
+ import { ConfigProvider as R, Spin as ae, Button as k } from "antd";
23
+ const ve = (n) => {
32
24
  const {
33
- mode: i = "float",
34
25
  className: e,
35
- triggerButton: l,
36
- size: o,
37
- resizable: ae,
38
- theme: $,
39
- logo: de,
40
- icon: g,
41
- rId: u,
42
- greeting: me,
43
- // 历史会话列表是否可见
44
- history: pe,
45
- service: ce,
46
- docViewerUrl: W,
47
- token: d,
48
- debug: j,
49
- env: D,
50
- plugins: L,
51
- footer: P,
52
- defaultInput: T,
53
- onComment: E,
54
- onSessionLoad: H,
55
- onSessionUnload: J,
56
- onMessage: M,
57
- bodyStyle: b,
58
- features: he,
59
- apiUrl: O,
60
- sessionId: V
61
- } = t, C = ee(null), [q, fe] = r(!1), [w, F] = r(), [a, G] = r(), [n, v] = r(o), [N, I] = r(t.open), [K, Q] = r(0);
62
- f(() => {
63
- if (!d)
26
+ triggerButton: o,
27
+ size: t,
28
+ theme: A,
29
+ icon: m,
30
+ docViewerUrl: U,
31
+ token: a,
32
+ debug: $,
33
+ env: W,
34
+ plugins: j,
35
+ footer: H,
36
+ defaultInput: L,
37
+ onComment: M,
38
+ onSessionLoad: P,
39
+ onSessionUnload: T,
40
+ onMessage: D,
41
+ beforeMessageSend: E,
42
+ bodyStyle: h,
43
+ apiUrl: J,
44
+ sessionId: O,
45
+ disabled: V,
46
+ transform: q,
47
+ features: F
48
+ } = n, c = ee(null), [G, de] = l(!1), [f, K] = l(), [g, Q] = l(), [i, p] = l(t), [b, C] = l(n.open);
49
+ I(() => {
50
+ if (!a)
64
51
  return;
65
- const p = le(d);
66
- F(p.rid), ne({
67
- debug: j,
68
- env: D,
69
- apiRoot: O
52
+ const u = le(a);
53
+ K(u.rid), ie({
54
+ debug: $,
55
+ env: W,
56
+ apiRoot: J
70
57
  });
71
- const m = new se(d, {
72
- plugins: L
58
+ const w = new se(a, {
59
+ plugins: j
73
60
  });
74
- G(m);
75
- }, [d]), A.config({
76
- theme: $
77
- }), f(() => {
78
- u && (a == null || a.reloadSession().then((p) => {
79
- Q((m) => m + 1);
80
- }));
81
- }, [u]), f(() => {
82
- o && v(o);
83
- }, [o]);
84
- const S = (p, {
85
- element: m,
86
- size: y
61
+ Q(w);
62
+ }, [a]), R.config({
63
+ theme: A
64
+ }), I(() => {
65
+ t && p(t);
66
+ }, [t]);
67
+ const S = (u, {
68
+ element: w,
69
+ size: v
87
70
  }) => {
88
- v({
89
- width: Number(y.width),
90
- height: y.height
71
+ p({
72
+ width: Number(v.width),
73
+ height: v.height
91
74
  });
92
75
  };
93
- return /* @__PURE__ */ s(A, {
76
+ return /* @__PURE__ */ s(R, {
94
77
  locale: z,
95
78
  children: /* @__PURE__ */ x(oe, {
96
- value: h(c({}, t), {
97
- popupContainer: C,
98
- agentClient: a,
99
- depId: K,
100
- footer: P,
101
- defaultInput: T,
102
- onComment: E,
103
- onSessionLoad: H,
104
- onSessionUnload: J,
105
- onMessage: M,
106
- bodyStyle: b
79
+ value: r(d({}, n), {
80
+ popupContainer: c,
81
+ agentClient: g,
82
+ footer: H,
83
+ defaultInput: L,
84
+ onComment: M,
85
+ onSessionLoad: P,
86
+ onSessionUnload: T,
87
+ onMessage: D,
88
+ beforeMessageSend: E,
89
+ bodyStyle: h,
90
+ disabled: V,
91
+ transform: q,
92
+ features: F
107
93
  }),
108
94
  children: [/* @__PURE__ */ s(te, {
109
- height: n == null ? void 0 : n.height,
110
- width: n == null ? void 0 : n.width,
95
+ height: i == null ? void 0 : i.height,
96
+ width: i == null ? void 0 : i.width,
111
97
  maxConstraints: [document.body.clientWidth - 45],
112
- minConstraints: [Number(o == null ? void 0 : o.minWidth)],
98
+ minConstraints: [Number(t == null ? void 0 : t.minWidth)],
113
99
  onResize: S,
114
100
  handle: /* @__PURE__ */ s("span", {
115
101
  className: "resize-handle-ew"
@@ -117,39 +103,40 @@ const Pe = (t) => {
117
103
  resizeHandles: e == "float" ? ["w"] : [],
118
104
  children: /* @__PURE__ */ x("div", {
119
105
  id: "dialog-modal",
120
- className: `dialog-modal ${e} ${N ? "opened" : "closed"}`,
121
- style: h(c({}, o), {
122
- width: e == "float" ? n == null ? void 0 : n.width : o == null ? void 0 : o.width,
123
- height: e === "float" ? n == null ? void 0 : n.height : o == null ? void 0 : o.height
106
+ className: `gbot-dialog-modal ${e} ${b ? "opened" : "closed"}`,
107
+ style: r(d({}, t), {
108
+ width: e == "float" ? i == null ? void 0 : i.width : t == null ? void 0 : t.width,
109
+ height: e === "float" ? i == null ? void 0 : i.height : t == null ? void 0 : t.height,
110
+ maxHeight: "100vh"
124
111
  }),
125
- ref: C,
126
- children: [q ? /* @__PURE__ */ s("div", {
112
+ ref: c,
113
+ children: [G ? /* @__PURE__ */ s("div", {
127
114
  className: "loading",
128
- children: /* @__PURE__ */ s(re, {})
129
- }) : w && a ? /* @__PURE__ */ s(ie, {
130
- appId: w,
131
- docViewerUrl: W,
132
- bodyStyle: b,
133
- sessionId: V
134
- }) : null, (l == null ? void 0 : l.visible) && /* @__PURE__ */ s(U, {
115
+ children: /* @__PURE__ */ s(ae, {})
116
+ }) : f && g ? /* @__PURE__ */ s(ne, {
117
+ appId: f,
118
+ docViewerUrl: U,
119
+ bodyStyle: h,
120
+ sessionId: O
121
+ }) : null, (o == null ? void 0 : o.visible) && /* @__PURE__ */ s(k, {
135
122
  className: "trigger-btn close-btn",
136
123
  icon: /* @__PURE__ */ s("img", {
137
- src: g
124
+ src: m
138
125
  }),
139
- onClick: () => I(!1)
126
+ onClick: () => C(!1)
140
127
  })]
141
128
  })
142
- }), (l == null ? void 0 : l.visible) && !N && /* @__PURE__ */ s(U, {
129
+ }), (o == null ? void 0 : o.visible) && !b && /* @__PURE__ */ s(k, {
143
130
  className: `${e}-trigger-btn open-btn`,
144
- style: l.style,
131
+ style: o.style,
145
132
  icon: /* @__PURE__ */ s("img", {
146
- src: g
133
+ src: m
147
134
  }),
148
- onClick: () => I(!0)
135
+ onClick: () => C(!0)
149
136
  })]
150
137
  })
151
138
  });
152
139
  };
153
140
  export {
154
- Pe as default
141
+ ve as default
155
142
  };