@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,24 +1,17 @@
1
1
  import { jsxs as s, jsx as e } from "../../_virtual/jsx-runtime.mjs";
2
2
  import { memo as d, useContext as le, useState as se } from "react";
3
- import p from "../../InputProgress/index.mjs";
3
+ import c from "../../InputProgress/index.mjs";
4
4
  import re from "../SessionRefer/index.mjs";
5
- import oe from "../SessionAction/index.mjs";
6
- import "axios";
7
- import "../../node_modules/@glodon-aiot/minio/dist/minio-zj.mjs";
8
- import { IHistoryRole as J, IThinkingStatus as Q } 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";
14
- import ae from "../../FileItem/index.mjs";
15
- import { Popover as de, Space as q, Button as D, Row as pe, Col as ce, Collapse as V, Divider as me, message as W } from "antd";
5
+ import ae from "../SessionAction/index.mjs";
6
+ import { IHistoryRole as P, IThinkingStatus as Q } from "@glodon-aiot/apis";
7
+ import oe from "../../FileItem/index.mjs";
8
+ import { Popover as de, Space as q, Button as D, Row as ce, Col as pe, Collapse as V, Divider as me, message as W } from "antd";
16
9
  import ue from "../SearchReference/index.mjs";
17
10
  import "./style.less.mjs";
18
11
  import he from "../HistoryContent/index.mjs";
19
12
  import ge from "../../components/Markdown/index.mjs";
20
13
  import Ne from "../../node_modules/classnames/index.mjs";
21
- import c from "../../Iconfont/index.mjs";
14
+ import p from "../../Iconfont/index.mjs";
22
15
  import { CheckOutlined as $, CloseOutlined as G, LoadingOutlined as fe } from "@ant-design/icons";
23
16
  import m from "../../components/JsonDisplay/index.mjs";
24
17
  import ye from "../../context.mjs";
@@ -26,48 +19,49 @@ import Ce from "../SessionRelated/index.mjs";
26
19
  import Le from "../ReferCollapse/index.mjs";
27
20
  import ve from "../../node_modules/copy-to-clipboard/index.mjs";
28
21
  import Re from "./think.svg.mjs";
29
- const be = (a) => {
30
- if (!a)
31
- return a;
22
+ import { escapeSlash as Se } from "../../utils/index.mjs";
23
+ const be = (o) => {
24
+ if (!o)
25
+ return o;
32
26
  try {
33
- return JSON.parse(a);
27
+ return JSON.parse(o);
34
28
  } catch (r) {
35
- return a;
29
+ return o;
36
30
  }
37
31
  }, Ee = d(ue), K = d(re), C = d(ge);
38
32
  d(he);
39
- const Se = d(ae);
33
+ const ke = d(oe);
40
34
  d(Le);
41
- const u = (a) => {
42
- if (!a)
35
+ const u = (o) => {
36
+ if (!o)
43
37
  return !1;
44
38
  try {
45
- const r = JSON.parse(a);
39
+ const r = JSON.parse(o);
46
40
  return !(r != null && r.code && (r.code < 200 || r.code > 300));
47
41
  } catch (r) {
48
42
  return !0;
49
43
  }
50
- }, X = (a) => {
44
+ }, X = (o) => {
51
45
  var t;
52
- const r = JSON.parse(JSON.stringify(a)) || [], o = (t = r == null ? void 0 : r.pop()) == null ? void 0 : t.pop();
53
- return o ? (o == null ? void 0 : o.type) === "BEFORE_CALL" || (o == null ? void 0 : o.type) === "FUNCTION_CALL" : !1;
54
- }, tt = (a) => {
55
- var b, E, S, k, T, A, O, x, F;
46
+ const r = JSON.parse(JSON.stringify(o)) || [], a = (t = r == null ? void 0 : r.pop()) == null ? void 0 : t.pop();
47
+ return a ? (a == null ? void 0 : a.type) === "BEFORE_CALL" || (a == null ? void 0 : a.type) === "FUNCTION_CALL" : !1;
48
+ }, Ke = (o) => {
49
+ var S, b, E, k, T, A, O, x, F;
56
50
  const {
57
51
  application: r,
58
- currentSession: o,
52
+ currentSession: a,
59
53
  history: t,
60
54
  isLastHistory: h,
61
55
  onRelatedClick: Y,
62
56
  onAgainClick: Z,
63
- isLoading: ke,
57
+ isLoading: Te,
64
58
  docViewerUrl: g,
65
59
  onEditClick: N
66
- } = a, {
60
+ } = o, {
67
61
  debug: L,
68
62
  transform: i,
69
63
  popupContainer: f
70
- } = le(ye), v = t.role === J.User, R = t.role === J.Robot, {
64
+ } = le(ye), v = t.role === P.User, R = t.role === P.Robot, {
71
65
  Panel: ee
72
66
  } = V, [y, te] = se(!0), ne = () => {
73
67
  W.config({
@@ -100,7 +94,7 @@ const u = (a) => {
100
94
  children: /* @__PURE__ */ e(D, {
101
95
  type: "link",
102
96
  size: "small",
103
- icon: /* @__PURE__ */ e(c, {
97
+ icon: /* @__PURE__ */ e(p, {
104
98
  type: "icon-bianji2"
105
99
  })
106
100
  })
@@ -110,7 +104,7 @@ const u = (a) => {
110
104
  children: /* @__PURE__ */ e(D, {
111
105
  type: "link",
112
106
  size: "small",
113
- icon: /* @__PURE__ */ e(c, {
107
+ icon: /* @__PURE__ */ e(p, {
114
108
  type: "icon-fuzhi",
115
109
  style: {
116
110
  fontSize: "16px"
@@ -124,22 +118,22 @@ const u = (a) => {
124
118
  children: /* @__PURE__ */ e("span", {
125
119
  className: "item-user-content",
126
120
  children: /* @__PURE__ */ e(C, {
127
- children: t.content
121
+ children: Se(t.content)
128
122
  })
129
123
  })
130
124
  })
131
125
  })
132
126
  }), /* @__PURE__ */ e("div", {
133
127
  className: "item-user-file",
134
- children: /* @__PURE__ */ e(pe, {
128
+ children: /* @__PURE__ */ e(ce, {
135
129
  gutter: [12, 12],
136
130
  justify: "end",
137
131
  wrap: !0,
138
- children: (b = t.files) == null ? void 0 : b.map((n) => /* @__PURE__ */ e(ce, {
132
+ children: (S = t.files) == null ? void 0 : S.map((n) => /* @__PURE__ */ e(pe, {
139
133
  className: "user-file-col",
140
- children: /* @__PURE__ */ e(Se, {
134
+ children: /* @__PURE__ */ e(ke, {
141
135
  docViewerUrl: g,
142
- currentSession: o,
136
+ currentSession: a,
143
137
  file: n
144
138
  })
145
139
  }, n.id))
@@ -154,8 +148,8 @@ const u = (a) => {
154
148
  children: [/* @__PURE__ */ e(V, {
155
149
  ghost: !0,
156
150
  expandIconPosition: "right",
157
- children: (E = t.actions) == null ? void 0 : E.map((n, ie) => {
158
- var _, I, U, z, j, B, w, M, P, H;
151
+ children: (b = t.actions) == null ? void 0 : b.map((n, ie) => {
152
+ var _, I, U, z, j, B, w, M, H, J;
159
153
  return /* @__PURE__ */ s(ee, {
160
154
  collapsible: L ? "header" : "icon",
161
155
  showArrow: L,
@@ -221,7 +215,7 @@ const u = (a) => {
221
215
  }), /* @__PURE__ */ e("div", {
222
216
  className: "bot-plugin-json",
223
217
  children: /* @__PURE__ */ e(m, {
224
- josn: (P = n.find((l) => l.type === "BEFORE_CALL")) == null ? void 0 : P.data.requestBody
218
+ josn: (H = n.find((l) => l.type === "BEFORE_CALL")) == null ? void 0 : H.data.requestBody
225
219
  })
226
220
  }), /* @__PURE__ */ e("div", {
227
221
  className: "bot-plugin-content",
@@ -229,7 +223,7 @@ const u = (a) => {
229
223
  }), /* @__PURE__ */ e("div", {
230
224
  className: "bot-plugin-json",
231
225
  children: /* @__PURE__ */ e(m, {
232
- josn: be((H = n.find((l) => l.type === "RESULT")) == null ? void 0 : H.data.result)
226
+ josn: be((J = n.find((l) => l.type === "RESULT")) == null ? void 0 : J.data.result)
233
227
  })
234
228
  })]
235
229
  }, ie);
@@ -239,7 +233,7 @@ const u = (a) => {
239
233
  style: {
240
234
  padding: "4px 0"
241
235
  },
242
- children: X(t.actions) ? null : /* @__PURE__ */ e(p, {
236
+ children: X(t.actions) ? null : /* @__PURE__ */ e(c, {
243
237
  size: 4,
244
238
  text: "思考中"
245
239
  })
@@ -249,7 +243,7 @@ const u = (a) => {
249
243
  children: /* @__PURE__ */ e(Ee, {
250
244
  history: t
251
245
  })
252
- }), (S = t == null ? void 0 : t.reference) != null && S.length && ((k = i == null ? void 0 : i.reference) != null && k.referenceFirst) ? /* @__PURE__ */ e(K, {
246
+ }), (E = t == null ? void 0 : t.reference) != null && E.length && ((k = i == null ? void 0 : i.reference) != null && k.referenceFirst) ? /* @__PURE__ */ e(K, {
253
247
  history: t,
254
248
  docViewerUrl: g
255
249
  }) : null, /* @__PURE__ */ s("div", {
@@ -270,12 +264,12 @@ const u = (a) => {
270
264
  children: ["已完成推理(用时 ", (t == null ? void 0 : t.thinkingSecs) || 0, " 秒)"]
271
265
  }), /* @__PURE__ */ e("span", {
272
266
  className: "think-action",
273
- children: y ? /* @__PURE__ */ e(c, {
267
+ children: y ? /* @__PURE__ */ e(p, {
274
268
  type: "icon-zhankai",
275
269
  style: {
276
270
  fontSize: 16
277
271
  }
278
- }) : /* @__PURE__ */ e(c, {
272
+ }) : /* @__PURE__ */ e(p, {
279
273
  type: "icon-shouqi",
280
274
  style: {
281
275
  fontSize: 16
@@ -309,7 +303,7 @@ const u = (a) => {
309
303
  style: {
310
304
  paddingBottom: 12
311
305
  },
312
- children: /* @__PURE__ */ e(p, {
306
+ children: /* @__PURE__ */ e(c, {
313
307
  size: 4
314
308
  })
315
309
  }) : null, t.isRelateLoading && /* @__PURE__ */ e("div", {
@@ -317,19 +311,20 @@ const u = (a) => {
317
311
  style: {
318
312
  padding: "4px 0"
319
313
  },
320
- children: X(t.actions) ? null : /* @__PURE__ */ e(p, {
314
+ children: X(t.actions) ? null : /* @__PURE__ */ e(c, {
321
315
  size: 4,
322
316
  text: "思考中"
323
317
  })
324
318
  }), (i == null ? void 0 : i.relate) && h && !!((x = t.relatedQuesion) != null && x.length) && /* @__PURE__ */ e(Ce, {
325
319
  relatedQuesion: t.relatedQuesion,
326
320
  onRelatedClick: Y
327
- }), !t.isSensitive && !!t.messageId && /* @__PURE__ */ e(oe, {
321
+ }), !t.isSensitive && !!t.messageId && /* @__PURE__ */ e(ae, {
328
322
  appId: r.id,
329
323
  history: t,
330
- sessionId: (F = o == null ? void 0 : o.data) == null ? void 0 : F.id,
324
+ sessionId: (F = a == null ? void 0 : a.data) == null ? void 0 : F.id,
331
325
  onAgainClick: Z,
332
- isLastHistory: h
326
+ isLastHistory: h,
327
+ currentSession: a
333
328
  })]
334
329
  })
335
330
  }), t.isContext && /* @__PURE__ */ s(me, {
@@ -342,7 +337,7 @@ const u = (a) => {
342
337
  }), " "]
343
338
  }), t.isWaiting && /* @__PURE__ */ e("div", {
344
339
  className: "history-input-progress",
345
- children: /* @__PURE__ */ e(p, {
340
+ children: /* @__PURE__ */ e(c, {
346
341
  size: 4,
347
342
  text: "思考中"
348
343
  })
@@ -350,6 +345,6 @@ const u = (a) => {
350
345
  });
351
346
  };
352
347
  export {
353
- tt as default,
348
+ Ke as default,
354
349
  u as isResultExec
355
350
  };
@@ -1,66 +1,73 @@
1
- import { jsxs as j, jsx as v } from "../../_virtual/jsx-runtime.mjs";
2
- import { useState as f, useContext as A, useEffect as y } from "react";
1
+ import { jsxs as x, jsx as A } from "../../_virtual/jsx-runtime.mjs";
2
+ import { useContext as H, useState as i, useEffect as y } from "react";
3
3
  import "./style.less.mjs";
4
- import E from "../../context.mjs";
5
- import { Space as H } from "antd";
6
- import q from "./KnowledgeSelect/index.mjs";
7
- const P = (F) => {
8
- var c;
4
+ import K from "../../context.mjs";
5
+ import { Space as q } from "antd";
6
+ import z from "./KnowledgeSelect/index.mjs";
7
+ const P = (v) => {
8
+ var j, u;
9
9
  const {
10
- currentSession: n,
11
- application: t,
12
- setCurrentSession: z,
13
- reload: B,
14
- setCheckKnowledges: d
15
- } = F, [o, N] = f([]), [l, g] = f([]), [b, i] = f(0), [u, x] = f(!1), {
16
- mode: w,
17
- transform: C
18
- } = A(E);
10
+ currentSession: t,
11
+ application: n,
12
+ setCurrentSession: B,
13
+ reload: D,
14
+ setCheckKnowledges: g
15
+ } = v, {
16
+ mode: C,
17
+ transform: w,
18
+ features: o
19
+ } = H(K), [d, k] = i([]), [r, c] = i(typeof (o == null ? void 0 : o.knowledges) == "object" ? ((j = o.knowledges.default) == null ? void 0 : j.map((e) => e.id)) || [] : []), [E, p] = i(0), [h, b] = i(!1);
19
20
  y(() => {
20
- var S;
21
- if (!(t != null && t.id))
21
+ if (!(n != null && n.id))
22
22
  return;
23
- const e = t.arrange;
23
+ const e = n.arrange;
24
24
  if (!(e != null && e.length))
25
25
  return;
26
26
  const s = e[0].knowledges || [];
27
- if (N(s), !((S = n == null ? void 0 : n.data) != null && S.id)) {
28
- g(s.map((h) => h.id)), i(s.length), d == null || d(s);
27
+ k(s);
28
+ const l = typeof (o == null ? void 0 : o.knowledges) == "object" && o.knowledges.default || s;
29
+ if (!t) {
30
+ c(l.map((f) => f.id)), p(l.length), g == null || g(l);
29
31
  return;
30
32
  }
31
- const m = n.knowledges || [];
32
- i(m.length);
33
- const a = m.map((h) => h.id);
34
- g(a);
35
- }, [t, n]), y(() => {
36
- var r;
37
- if (!u || (x(!1), !(t != null && t.id)))
33
+ const a = () => {
34
+ const f = t.knowledges || l;
35
+ p(f.length);
36
+ const F = f.map((N) => N.id);
37
+ c(F);
38
+ };
39
+ return a(), t.addEventListener("data:updated", a), () => {
40
+ t == null || t.removeEventListener("data:updated", a);
41
+ };
42
+ }, [n, t]), y(() => {
43
+ var m;
44
+ if (!h || (b(!1), !(n != null && n.id)))
38
45
  return;
39
46
  const e = [];
40
- l == null || l.map((s) => {
41
- const m = o == null ? void 0 : o.find((a) => a.id === s);
42
- e.push(m);
43
- }), (r = n == null ? void 0 : n.data) != null && r.id && n.setKnowledges(e);
44
- }, [u]);
45
- const p = (e) => {
46
- x(!0), g(e);
47
- const r = [];
47
+ r == null || r.map((s) => {
48
+ const l = d == null ? void 0 : d.find((a) => a.id === s);
49
+ e.push(l);
50
+ }), (m = t == null ? void 0 : t.data) != null && m.id && t.setKnowledges(e);
51
+ }, [h]);
52
+ const S = (e) => {
53
+ b(!0), c(e);
54
+ const m = [];
48
55
  e == null || e.map((s) => {
49
- const m = o == null ? void 0 : o.find((a) => a.id === s);
50
- r.push(m);
51
- }), d == null || d(r), i(e.length);
56
+ const l = d == null ? void 0 : d.find((a) => a.id === s);
57
+ m.push(l);
58
+ }), g == null || g(m), p(e.length);
52
59
  };
53
- return /* @__PURE__ */ j("div", {
60
+ return /* @__PURE__ */ x("div", {
54
61
  className: "chat-header",
55
- children: [/* @__PURE__ */ j(H, {
62
+ children: [/* @__PURE__ */ x(q, {
56
63
  className: "header-title",
57
- children: [w === "inlay" && ((c = n == null ? void 0 : n.data) == null ? void 0 : c.name), w === "float" && (t == null ? void 0 : t.name)]
58
- }), (C == null ? void 0 : C.knowledges) && o.length !== 0 && /* @__PURE__ */ v(q, {
59
- disabled: (t == null ? void 0 : t.type) === 2,
60
- checkedValues: l,
61
- currKnowledgeList: o,
62
- selectCount: b,
63
- onSelectChange: p
64
+ children: [C === "inlay" && ((u = t == null ? void 0 : t.data) == null ? void 0 : u.name), C === "float" && (n == null ? void 0 : n.name)]
65
+ }), (w == null ? void 0 : w.knowledges) && d.length !== 0 && /* @__PURE__ */ A(z, {
66
+ disabled: (n == null ? void 0 : n.type) === 2 || typeof (o == null ? void 0 : o.knowledges) == "object" && (o == null ? void 0 : o.knowledges.diabled) || !1,
67
+ checkedValues: r,
68
+ currKnowledgeList: d,
69
+ selectCount: E,
70
+ onSelectChange: S
64
71
  })]
65
72
  });
66
73
  };
@@ -1,23 +1,16 @@
1
- import { jsx as n, Fragment as V } from "../../_virtual/jsx-runtime.mjs";
2
- import { Popover as _, Tabs as C, Button as j } from "antd";
3
- import { useState as m, useContext as A, useEffect as a } from "react";
1
+ import { jsx as r, Fragment as V } from "../../_virtual/jsx-runtime.mjs";
2
+ import { Popover as j, Tabs as C, Button as A } from "antd";
3
+ import { useState as m, useContext as E, useEffect as a } from "react";
4
4
  import "./style.less.mjs";
5
- import E from "../../node_modules/classnames/index.mjs";
6
- import "axios";
7
- import "../../node_modules/@glodon-aiot/minio/dist/minio-zj.mjs";
8
- import "dayjs";
9
- import { PROMPT_TITLE_MAX_LENGTH as I } from "../../packages/apis/dist/es/aecpilot/cosntant.mjs";
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";
14
- import M from "./PromptList/PublicPromptList.mjs";
5
+ import M from "../../node_modules/classnames/index.mjs";
6
+ import { PROMPT_TITLE_MAX_LENGTH as I } from "@glodon-aiot/apis";
7
+ import _ from "./PromptList/PublicPromptList.mjs";
15
8
  import z from "../../Iconfont/index.mjs";
16
9
  import X from "../../context.mjs";
17
- const lt = (S) => {
10
+ const $ = (S) => {
18
11
  var x;
19
12
  const {
20
- appId: p,
13
+ appId: c,
21
14
  list: s,
22
15
  search: e,
23
16
  disabled: W = !1,
@@ -28,15 +21,15 @@ const lt = (S) => {
28
21
  service: i,
29
22
  popupContainer: o,
30
23
  mode: F
31
- } = A(X), [G, d] = m((s == null ? void 0 : s.filter((t) => t.type === "me")) || []), [k, h] = m((s == null ? void 0 : s.filter((t) => t.type === "system")) || []), [b, v] = m((s == null ? void 0 : s.filter((t) => t.type === "system")) || []), [w, N] = m("system"), [H, O] = m(!1);
24
+ } = E(X), [G, d] = m((s == null ? void 0 : s.filter((t) => t.type === "me")) || []), [k, h] = m((s == null ? void 0 : s.filter((t) => t.type === "system")) || []), [b, v] = m((s == null ? void 0 : s.filter((t) => t.type === "system")) || []), [w, N] = m("system"), [H, O] = m(!1);
32
25
  a(() => {
33
- f && i && (e && e.length > I ? (d([]), h([])) : (i.listPrompt(p, {
26
+ f && i && (e && e.length > I ? (d([]), h([])) : (i.listPrompt(c, {
34
27
  type: "system"
35
- }).then((t) => O(!!t.length)), i.listPrompt(p, e ? {
28
+ }).then((t) => O(!!t.length)), i.listPrompt(c, e ? {
36
29
  title: e
37
30
  } : void 0).then((t) => {
38
- const c = t.filter((l) => l.type === "me"), r = t.filter((l) => l.type === "system");
39
- d(c), h(r);
31
+ const p = t.filter((n) => n.type === "me"), l = t.filter((n) => n.type === "system");
32
+ d(p), h(l);
40
33
  })));
41
34
  }, [f]), a(() => {
42
35
  T();
@@ -46,9 +39,9 @@ const lt = (S) => {
46
39
  let t = o == null ? void 0 : o.current;
47
40
  t ? t.clientWidth > 900 ? P(520) : P(t.clientWidth - 80) : P(400);
48
41
  }, [(x = o == null ? void 0 : o.current) == null ? void 0 : x.clientWidth]), a(() => {
49
- i == null || i.listPrompt(p).then((t) => {
50
- const c = t.filter((r) => r.type === "system");
51
- v(c);
42
+ i == null || i.listPrompt(c).then((t) => {
43
+ const p = t.filter((l) => l.type === "system");
44
+ v(p);
52
45
  });
53
46
  }, [i]);
54
47
  const T = () => {
@@ -56,14 +49,14 @@ const lt = (S) => {
56
49
  d([]), h([]);
57
50
  return;
58
51
  }
59
- i == null || i.listPrompt(p, e ? {
52
+ i == null || i.listPrompt(c, e ? {
60
53
  title: e
61
54
  } : void 0).then((t) => {
62
- const c = t.filter((l) => l.type === "me"), r = t.filter((l) => l.type === "system");
63
- d(c), h(r), y(!!(r.length && (e != null && e.length))), e || v(r);
55
+ const p = t.filter((n) => n.type === "me"), l = t.filter((n) => n.type === "system");
56
+ d(p), h(l), y(!!(l.length && (e != null && e.length))), e || v(l);
64
57
  });
65
58
  };
66
- return /* @__PURE__ */ n(_, {
59
+ return /* @__PURE__ */ r(j, {
67
60
  title: null,
68
61
  placement: "topLeft",
69
62
  overlayClassName: "propmt-manage-popover",
@@ -81,8 +74,8 @@ const lt = (S) => {
81
74
  onOpenChange: (t) => {
82
75
  y(t), !t && g && g();
83
76
  },
84
- content: /* @__PURE__ */ n(V, {
85
- children: /* @__PURE__ */ n(C, {
77
+ content: /* @__PURE__ */ r(V, {
78
+ children: /* @__PURE__ */ r(C, {
86
79
  activeKey: w,
87
80
  style: {
88
81
  padding: "0 16px"
@@ -90,10 +83,10 @@ const lt = (S) => {
90
83
  onTabClick: (t) => {
91
84
  N(t);
92
85
  },
93
- children: /* @__PURE__ */ n(C.TabPane, {
86
+ children: /* @__PURE__ */ r(C.TabPane, {
94
87
  tab: "快捷指令",
95
- children: /* @__PURE__ */ n(M, {
96
- appId: p,
88
+ children: /* @__PURE__ */ r(_, {
89
+ appId: c,
97
90
  data: k,
98
91
  search: e,
99
92
  onItemClick: (t) => {
@@ -103,17 +96,17 @@ const lt = (S) => {
103
96
  }, "system")
104
97
  })
105
98
  }),
106
- children: b != null && b.length ? /* @__PURE__ */ n(j, {
99
+ children: b != null && b.length ? /* @__PURE__ */ r(A, {
107
100
  disabled: W,
108
101
  style: {
109
102
  width: "24px"
110
103
  },
111
- className: E({
104
+ className: M({
112
105
  "prompt-btn": !0,
113
106
  active: f
114
107
  }),
115
108
  type: "text",
116
- icon: /* @__PURE__ */ n(z, {
109
+ icon: /* @__PURE__ */ r(z, {
117
110
  type: "icon-tishiyu1",
118
111
  style: {
119
112
  fontSize: 24
@@ -124,5 +117,5 @@ const lt = (S) => {
124
117
  });
125
118
  };
126
119
  export {
127
- lt as default
120
+ $ as default
128
121
  };