@glodon-aiot/agent-cli-ui 2.4.7

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 (406) hide show
  1. package/README.git.md +73 -0
  2. package/README.lib.md +135 -0
  3. package/dist/es/AgentClientUI.mjs +155 -0
  4. package/dist/es/Dialog/AgentChat/index.mjs +757 -0
  5. package/dist/es/Dialog/AgentChat/style.less.mjs +4 -0
  6. package/dist/es/Dialog/ConnectToNetwork/index.mjs +92 -0
  7. package/dist/es/Dialog/ConnectToNetwork/style.less.mjs +4 -0
  8. package/dist/es/Dialog/FileCard/doc-icons/doc.svg.mjs +4 -0
  9. package/dist/es/Dialog/FileCard/doc-icons/docx.svg.mjs +4 -0
  10. package/dist/es/Dialog/FileCard/doc-icons/pdf.svg.mjs +4 -0
  11. package/dist/es/Dialog/FileCard/index.mjs +142 -0
  12. package/dist/es/Dialog/FileCard/style.less.mjs +4 -0
  13. package/dist/es/Dialog/FilePreview/index.mjs +90 -0
  14. package/dist/es/Dialog/FilePreview/style.less.mjs +4 -0
  15. package/dist/es/Dialog/Greeting/index.mjs +31 -0
  16. package/dist/es/Dialog/Greeting/style.less.mjs +4 -0
  17. package/dist/es/Dialog/HistoryContent/index.mjs +14 -0
  18. package/dist/es/Dialog/HistoryContent/style.less.mjs +4 -0
  19. package/dist/es/Dialog/HistoryItem/index.mjs +355 -0
  20. package/dist/es/Dialog/HistoryItem/style.less.mjs +4 -0
  21. package/dist/es/Dialog/HistoryItem/think.svg.mjs +4 -0
  22. package/dist/es/Dialog/KnowledgeDoc/index.mjs +46 -0
  23. package/dist/es/Dialog/KnowledgeDoc/style.less.mjs +4 -0
  24. package/dist/es/Dialog/KnowledgeList/KnowledgeSelect/index.mjs +68 -0
  25. package/dist/es/Dialog/KnowledgeList/KnowledgeSelect/style.less.mjs +4 -0
  26. package/dist/es/Dialog/KnowledgeList/index.mjs +69 -0
  27. package/dist/es/Dialog/KnowledgeList/style.less.mjs +4 -0
  28. package/dist/es/Dialog/PromptManager/PromptList/PromptListItem.mjs +89 -0
  29. package/dist/es/Dialog/PromptManager/PromptList/PublicPromptList.mjs +48 -0
  30. package/dist/es/Dialog/PromptManager/PromptList/access/empty.svg.mjs +4 -0
  31. package/dist/es/Dialog/PromptManager/PromptList/style.less.mjs +4 -0
  32. package/dist/es/Dialog/PromptManager/index.mjs +128 -0
  33. package/dist/es/Dialog/PromptManager/style.less.mjs +4 -0
  34. package/dist/es/Dialog/PromptSetting/index.mjs +130 -0
  35. package/dist/es/Dialog/PromptSetting/style.less.mjs +4 -0
  36. package/dist/es/Dialog/Recommend/RecommendItem.mjs +96 -0
  37. package/dist/es/Dialog/Recommend/index.mjs +60 -0
  38. package/dist/es/Dialog/Recommend/style.less.mjs +4 -0
  39. package/dist/es/Dialog/Recommend/tip.svg.mjs +4 -0
  40. package/dist/es/Dialog/ReferCollapse/index.mjs +65 -0
  41. package/dist/es/Dialog/ReferCollapse/style.less.mjs +4 -0
  42. package/dist/es/Dialog/SearchReference/index.mjs +64 -0
  43. package/dist/es/Dialog/SearchReference/style.less.mjs +4 -0
  44. package/dist/es/Dialog/SessionAction/index.mjs +232 -0
  45. package/dist/es/Dialog/SessionAction/style.less.mjs +4 -0
  46. package/dist/es/Dialog/SessionList/index.mjs +197 -0
  47. package/dist/es/Dialog/SessionList/style.less.mjs +4 -0
  48. package/dist/es/Dialog/SessionListDrawer/HistorySessionList/NameEditPanel.mjs +48 -0
  49. package/dist/es/Dialog/SessionListDrawer/HistorySessionList/SessionItem.mjs +142 -0
  50. package/dist/es/Dialog/SessionListDrawer/HistorySessionList/doc-icons/doc.svg.mjs +4 -0
  51. package/dist/es/Dialog/SessionListDrawer/HistorySessionList/doc-icons/docx.svg.mjs +4 -0
  52. package/dist/es/Dialog/SessionListDrawer/HistorySessionList/doc-icons/pdf.svg.mjs +4 -0
  53. package/dist/es/Dialog/SessionListDrawer/HistorySessionList/index.mjs +120 -0
  54. package/dist/es/Dialog/SessionListDrawer/HistorySessionList/style.less.mjs +4 -0
  55. package/dist/es/Dialog/SessionListDrawer/index.mjs +44 -0
  56. package/dist/es/Dialog/SessionListDrawer/style.less.mjs +4 -0
  57. package/dist/es/Dialog/SessionRefer/ReferItem/index.mjs +94 -0
  58. package/dist/es/Dialog/SessionRefer/ReferItem/style.less.mjs +4 -0
  59. package/dist/es/Dialog/SessionRefer/index.mjs +86 -0
  60. package/dist/es/Dialog/SessionRefer/style.less.mjs +4 -0
  61. package/dist/es/Dialog/SessionRelated/index.mjs +43 -0
  62. package/dist/es/Dialog/SessionRelated/style.less.mjs +4 -0
  63. package/dist/es/Dialog/UploadKnowledgeFiles/ClearModal/index.mjs +51 -0
  64. package/dist/es/Dialog/UploadKnowledgeFiles/ClearModal/style.less.mjs +4 -0
  65. package/dist/es/Dialog/UploadKnowledgeFiles/index.mjs +368 -0
  66. package/dist/es/Dialog/UploadKnowledgeFiles/style.less.mjs +4 -0
  67. package/dist/es/Dialog/UploadingPrompt/index.mjs +67 -0
  68. package/dist/es/Dialog/UploadingPrompt/style.less.mjs +4 -0
  69. package/dist/es/Dialog/index.mjs +128 -0
  70. package/dist/es/Dialog/style.less.mjs +4 -0
  71. package/dist/es/FileCard/doc-icons/doc.svg.mjs +4 -0
  72. package/dist/es/FileCard/doc-icons/docx.svg.mjs +4 -0
  73. package/dist/es/FileCard/doc-icons/pdf.svg.mjs +4 -0
  74. package/dist/es/FileItem/index.mjs +85 -0
  75. package/dist/es/FileItem/style.less.mjs +4 -0
  76. package/dist/es/Footer/FooterWarning.mjs +25 -0
  77. package/dist/es/Footer/index.mjs +18 -0
  78. package/dist/es/Footer/style.less.mjs +4 -0
  79. package/dist/es/Iconfont/index.mjs +12 -0
  80. package/dist/es/InputProgress/index.mjs +39 -0
  81. package/dist/es/InputProgress/style.less.mjs +4 -0
  82. package/dist/es/QuillEditor/index.mjs +219 -0
  83. package/dist/es/QuillEditor/style.less.mjs +4 -0
  84. package/dist/es/_virtual/_cloneBuffer.mjs +4 -0
  85. package/dist/es/_virtual/_commonjsHelpers.mjs +8 -0
  86. package/dist/es/_virtual/_nodeUtil.mjs +4 -0
  87. package/dist/es/_virtual/index.mjs +4 -0
  88. package/dist/es/_virtual/index2.mjs +4 -0
  89. package/dist/es/_virtual/index3.mjs +4 -0
  90. package/dist/es/_virtual/index4.mjs +4 -0
  91. package/dist/es/_virtual/isBuffer.mjs +4 -0
  92. package/dist/es/_virtual/jsx-runtime.mjs +7 -0
  93. package/dist/es/_virtual/jsx-runtime2.mjs +4 -0
  94. package/dist/es/_virtual/minio-zj.mjs +4 -0
  95. package/dist/es/_virtual/react-jsx-runtime.production.min.mjs +4 -0
  96. package/dist/es/assets/brand.svg.mjs +4 -0
  97. package/dist/es/assets/icon.svg.mjs +4 -0
  98. package/dist/es/components/Copy/index.mjs +44 -0
  99. package/dist/es/components/Copy/style.less.mjs +4 -0
  100. package/dist/es/components/JsonDisplay/index.mjs +16 -0
  101. package/dist/es/components/JsonDisplay/style.less.mjs +4 -0
  102. package/dist/es/components/Markdown/Code/index.mjs +69 -0
  103. package/dist/es/components/Markdown/Image/index.mjs +26 -0
  104. package/dist/es/components/Markdown/index.mjs +48 -0
  105. package/dist/es/components/Markdown/style.less.mjs +4 -0
  106. package/dist/es/components/WebLink/index.mjs +26 -0
  107. package/dist/es/constant.mjs +96 -0
  108. package/dist/es/context.mjs +7 -0
  109. package/dist/es/favicon.ico +0 -0
  110. package/dist/es/favicon2.ico +0 -0
  111. package/dist/es/font/font_4108228_4w5nlhafpte.js +1 -0
  112. package/dist/es/font/font_4439177_0sppkcnqiqgs.js +1 -0
  113. package/dist/es/font/gos-font.js +64 -0
  114. package/dist/es/images/empty.svg +40 -0
  115. package/dist/es/images/loading.gif +0 -0
  116. package/dist/es/images/logo.png +0 -0
  117. package/dist/es/images/map-example.png +0 -0
  118. package/dist/es/images/sketch.png +0 -0
  119. package/dist/es/index.html +43 -0
  120. package/dist/es/index.mjs +325 -0
  121. package/dist/es/logo192.png +0 -0
  122. package/dist/es/logo512.png +0 -0
  123. package/dist/es/manifest.json +25 -0
  124. package/dist/es/node_modules/@babel/runtime/helpers/esm/extends.mjs +13 -0
  125. package/dist/es/node_modules/@glodon-aiot/minio/dist/minio-zj.mjs +26485 -0
  126. package/dist/es/node_modules/@socket.io/component-emitter/lib/esm/index.mjs +54 -0
  127. package/dist/es/node_modules/ahooks/es/useKeyPress/index.mjs +221 -0
  128. package/dist/es/node_modules/ahooks/es/useLatest/index.mjs +8 -0
  129. package/dist/es/node_modules/ahooks/es/useMemoizedFn/index.mjs +19 -0
  130. package/dist/es/node_modules/ahooks/es/useUnmount/index.mjs +17 -0
  131. package/dist/es/node_modules/ahooks/es/utils/createEffectWithTarget.mjs +27 -0
  132. package/dist/es/node_modules/ahooks/es/utils/depsAreSame.mjs +11 -0
  133. package/dist/es/node_modules/ahooks/es/utils/depsEqual.mjs +7 -0
  134. package/dist/es/node_modules/ahooks/es/utils/domTarget.mjs +13 -0
  135. package/dist/es/node_modules/ahooks/es/utils/index.mjs +12 -0
  136. package/dist/es/node_modules/ahooks/es/utils/isAppleDevice.mjs +5 -0
  137. package/dist/es/node_modules/ahooks/es/utils/isBrowser.mjs +5 -0
  138. package/dist/es/node_modules/ahooks/es/utils/isDev.mjs +5 -0
  139. package/dist/es/node_modules/ahooks/es/utils/useDeepCompareWithTarget.mjs +11 -0
  140. package/dist/es/node_modules/ahooks/es/utils/useEffectWithTarget.mjs +7 -0
  141. package/dist/es/node_modules/antd/es/calendar/locale/zh_CN.mjs +4 -0
  142. package/dist/es/node_modules/antd/es/date-picker/locale/zh_CN.mjs +23 -0
  143. package/dist/es/node_modules/antd/es/locale/zh_CN.mjs +132 -0
  144. package/dist/es/node_modules/antd/es/time-picker/locale/zh_CN.mjs +8 -0
  145. package/dist/es/node_modules/base64-js/index.mjs +47 -0
  146. package/dist/es/node_modules/buffer/index.mjs +927 -0
  147. package/dist/es/node_modules/classnames/index.mjs +42 -0
  148. package/dist/es/node_modules/copy-to-clipboard/index.mjs +46 -0
  149. package/dist/es/node_modules/engine.io-client/build/esm/contrib/has-cors.mjs +9 -0
  150. package/dist/es/node_modules/engine.io-client/build/esm/contrib/parseqs.mjs +18 -0
  151. package/dist/es/node_modules/engine.io-client/build/esm/contrib/parseuri.mjs +24 -0
  152. package/dist/es/node_modules/engine.io-client/build/esm/contrib/yeast.mjs +19 -0
  153. package/dist/es/node_modules/engine.io-client/build/esm/globalThis.browser.mjs +4 -0
  154. package/dist/es/node_modules/engine.io-client/build/esm/socket.mjs +317 -0
  155. package/dist/es/node_modules/engine.io-client/build/esm/transport.mjs +113 -0
  156. package/dist/es/node_modules/engine.io-client/build/esm/transports/index.mjs +11 -0
  157. package/dist/es/node_modules/engine.io-client/build/esm/transports/polling.mjs +273 -0
  158. package/dist/es/node_modules/engine.io-client/build/esm/transports/websocket-constructor.browser.mjs +8 -0
  159. package/dist/es/node_modules/engine.io-client/build/esm/transports/websocket.mjs +87 -0
  160. package/dist/es/node_modules/engine.io-client/build/esm/transports/webtransport.mjs +52 -0
  161. package/dist/es/node_modules/engine.io-client/build/esm/transports/xmlhttprequest.browser.mjs +21 -0
  162. package/dist/es/node_modules/engine.io-client/build/esm/util.mjs +23 -0
  163. package/dist/es/node_modules/engine.io-parser/build/esm/commons.mjs +21 -0
  164. package/dist/es/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.mjs +14 -0
  165. package/dist/es/node_modules/engine.io-parser/build/esm/decodePacket.browser.mjs +39 -0
  166. package/dist/es/node_modules/engine.io-parser/build/esm/encodePacket.browser.mjs +28 -0
  167. package/dist/es/node_modules/engine.io-parser/build/esm/index.mjs +105 -0
  168. package/dist/es/node_modules/ieee754/index.mjs +28 -0
  169. package/dist/es/node_modules/js-base64/base64.mjs +31 -0
  170. package/dist/es/node_modules/lodash/_Hash.mjs +22 -0
  171. package/dist/es/node_modules/lodash/_ListCache.mjs +22 -0
  172. package/dist/es/node_modules/lodash/_Map.mjs +6 -0
  173. package/dist/es/node_modules/lodash/_MapCache.mjs +22 -0
  174. package/dist/es/node_modules/lodash/_Stack.mjs +20 -0
  175. package/dist/es/node_modules/lodash/_Symbol.mjs +5 -0
  176. package/dist/es/node_modules/lodash/_Uint8Array.mjs +5 -0
  177. package/dist/es/node_modules/lodash/_apply.mjs +17 -0
  178. package/dist/es/node_modules/lodash/_arrayLikeKeys.mjs +21 -0
  179. package/dist/es/node_modules/lodash/_assignMergeValue.mjs +10 -0
  180. package/dist/es/node_modules/lodash/_assignValue.mjs +11 -0
  181. package/dist/es/node_modules/lodash/_assocIndexOf.mjs +12 -0
  182. package/dist/es/node_modules/lodash/_baseAssignValue.mjs +14 -0
  183. package/dist/es/node_modules/lodash/_baseCreate.mjs +17 -0
  184. package/dist/es/node_modules/lodash/_baseFor.mjs +5 -0
  185. package/dist/es/node_modules/lodash/_baseGetTag.mjs +11 -0
  186. package/dist/es/node_modules/lodash/_baseIsArguments.mjs +10 -0
  187. package/dist/es/node_modules/lodash/_baseIsNative.mjs +15 -0
  188. package/dist/es/node_modules/lodash/_baseIsTypedArray.mjs +13 -0
  189. package/dist/es/node_modules/lodash/_baseKeysIn.mjs +16 -0
  190. package/dist/es/node_modules/lodash/_baseMerge.mjs +22 -0
  191. package/dist/es/node_modules/lodash/_baseMergeDeep.mjs +33 -0
  192. package/dist/es/node_modules/lodash/_baseRest.mjs +11 -0
  193. package/dist/es/node_modules/lodash/_baseSetToString.mjs +14 -0
  194. package/dist/es/node_modules/lodash/_baseTimes.mjs +9 -0
  195. package/dist/es/node_modules/lodash/_baseTrim.mjs +9 -0
  196. package/dist/es/node_modules/lodash/_baseUnary.mjs +9 -0
  197. package/dist/es/node_modules/lodash/_cloneArrayBuffer.mjs +10 -0
  198. package/dist/es/node_modules/lodash/_cloneBuffer.mjs +17 -0
  199. package/dist/es/node_modules/lodash/_cloneTypedArray.mjs +10 -0
  200. package/dist/es/node_modules/lodash/_copyArray.mjs +10 -0
  201. package/dist/es/node_modules/lodash/_copyObject.mjs +16 -0
  202. package/dist/es/node_modules/lodash/_coreJsData.mjs +5 -0
  203. package/dist/es/node_modules/lodash/_createAssigner.mjs +17 -0
  204. package/dist/es/node_modules/lodash/_createBaseFor.mjs +14 -0
  205. package/dist/es/node_modules/lodash/_defineProperty.mjs +11 -0
  206. package/dist/es/node_modules/lodash/_freeGlobal.mjs +5 -0
  207. package/dist/es/node_modules/lodash/_getMapData.mjs +10 -0
  208. package/dist/es/node_modules/lodash/_getNative.mjs +11 -0
  209. package/dist/es/node_modules/lodash/_getPrototype.mjs +5 -0
  210. package/dist/es/node_modules/lodash/_getRawTag.mjs +16 -0
  211. package/dist/es/node_modules/lodash/_getValue.mjs +7 -0
  212. package/dist/es/node_modules/lodash/_hashClear.mjs +9 -0
  213. package/dist/es/node_modules/lodash/_hashDelete.mjs +8 -0
  214. package/dist/es/node_modules/lodash/_hashGet.mjs +14 -0
  215. package/dist/es/node_modules/lodash/_hashHas.mjs +10 -0
  216. package/dist/es/node_modules/lodash/_hashSet.mjs +10 -0
  217. package/dist/es/node_modules/lodash/_initCloneObject.mjs +11 -0
  218. package/dist/es/node_modules/lodash/_isIndex.mjs +9 -0
  219. package/dist/es/node_modules/lodash/_isIterateeCall.mjs +15 -0
  220. package/dist/es/node_modules/lodash/_isKeyable.mjs +8 -0
  221. package/dist/es/node_modules/lodash/_isMasked.mjs +12 -0
  222. package/dist/es/node_modules/lodash/_isPrototype.mjs +9 -0
  223. package/dist/es/node_modules/lodash/_listCacheClear.mjs +7 -0
  224. package/dist/es/node_modules/lodash/_listCacheDelete.mjs +13 -0
  225. package/dist/es/node_modules/lodash/_listCacheGet.mjs +10 -0
  226. package/dist/es/node_modules/lodash/_listCacheHas.mjs +9 -0
  227. package/dist/es/node_modules/lodash/_listCacheSet.mjs +10 -0
  228. package/dist/es/node_modules/lodash/_mapCacheClear.mjs +15 -0
  229. package/dist/es/node_modules/lodash/_mapCacheDelete.mjs +10 -0
  230. package/dist/es/node_modules/lodash/_mapCacheGet.mjs +9 -0
  231. package/dist/es/node_modules/lodash/_mapCacheHas.mjs +9 -0
  232. package/dist/es/node_modules/lodash/_mapCacheSet.mjs +10 -0
  233. package/dist/es/node_modules/lodash/_nativeCreate.mjs +5 -0
  234. package/dist/es/node_modules/lodash/_nativeKeysIn.mjs +11 -0
  235. package/dist/es/node_modules/lodash/_nodeUtil.mjs +17 -0
  236. package/dist/es/node_modules/lodash/_objectToString.mjs +8 -0
  237. package/dist/es/node_modules/lodash/_overArg.mjs +9 -0
  238. package/dist/es/node_modules/lodash/_overRest.mjs +16 -0
  239. package/dist/es/node_modules/lodash/_root.mjs +5 -0
  240. package/dist/es/node_modules/lodash/_safeGet.mjs +8 -0
  241. package/dist/es/node_modules/lodash/_setToString.mjs +6 -0
  242. package/dist/es/node_modules/lodash/_shortOut.mjs +17 -0
  243. package/dist/es/node_modules/lodash/_stackClear.mjs +9 -0
  244. package/dist/es/node_modules/lodash/_stackDelete.mjs +8 -0
  245. package/dist/es/node_modules/lodash/_stackGet.mjs +7 -0
  246. package/dist/es/node_modules/lodash/_stackHas.mjs +7 -0
  247. package/dist/es/node_modules/lodash/_stackSet.mjs +18 -0
  248. package/dist/es/node_modules/lodash/_toSource.mjs +18 -0
  249. package/dist/es/node_modules/lodash/_trimmedEndIndex.mjs +10 -0
  250. package/dist/es/node_modules/lodash/constant.mjs +9 -0
  251. package/dist/es/node_modules/lodash/debounce.mjs +57 -0
  252. package/dist/es/node_modules/lodash/eq.mjs +7 -0
  253. package/dist/es/node_modules/lodash/identity.mjs +7 -0
  254. package/dist/es/node_modules/lodash/isArguments.mjs +10 -0
  255. package/dist/es/node_modules/lodash/isArray.mjs +4 -0
  256. package/dist/es/node_modules/lodash/isArrayLike.mjs +10 -0
  257. package/dist/es/node_modules/lodash/isArrayLikeObject.mjs +10 -0
  258. package/dist/es/node_modules/lodash/isBuffer.mjs +12 -0
  259. package/dist/es/node_modules/lodash/isFunction.mjs +13 -0
  260. package/dist/es/node_modules/lodash/isLength.mjs +8 -0
  261. package/dist/es/node_modules/lodash/isObject.mjs +8 -0
  262. package/dist/es/node_modules/lodash/isObjectLike.mjs +7 -0
  263. package/dist/es/node_modules/lodash/isPlainObject.mjs +17 -0
  264. package/dist/es/node_modules/lodash/isSymbol.mjs +10 -0
  265. package/dist/es/node_modules/lodash/isTypedArray.mjs +7 -0
  266. package/dist/es/node_modules/lodash/keysIn.mjs +11 -0
  267. package/dist/es/node_modules/lodash/merge.mjs +10 -0
  268. package/dist/es/node_modules/lodash/now.mjs +7 -0
  269. package/dist/es/node_modules/lodash/stubFalse.mjs +7 -0
  270. package/dist/es/node_modules/lodash/toNumber.mjs +23 -0
  271. package/dist/es/node_modules/lodash/toPlainObject.mjs +10 -0
  272. package/dist/es/node_modules/object-assign/index.mjs +34 -0
  273. package/dist/es/node_modules/rc-pagination/es/locale/zh_CN.mjs +18 -0
  274. package/dist/es/node_modules/rc-picker/es/locale/zh_CN.mjs +31 -0
  275. package/dist/es/node_modules/react/cjs/react-jsx-runtime.production.min.mjs +45 -0
  276. package/dist/es/node_modules/react/jsx-runtime.mjs +8 -0
  277. package/dist/es/node_modules/react-fast-compare/index.mjs +78 -0
  278. package/dist/es/node_modules/react-infinite-scroll-component/dist/index.es.mjs +188 -0
  279. package/dist/es/node_modules/react-quill/dist/quill.snow.css.mjs +4 -0
  280. package/dist/es/node_modules/socket.io-client/build/esm/contrib/backo2.mjs +26 -0
  281. package/dist/es/node_modules/socket.io-client/build/esm/index.mjs +25 -0
  282. package/dist/es/node_modules/socket.io-client/build/esm/manager.mjs +242 -0
  283. package/dist/es/node_modules/socket.io-client/build/esm/on.mjs +8 -0
  284. package/dist/es/node_modules/socket.io-client/build/esm/socket.mjs +608 -0
  285. package/dist/es/node_modules/socket.io-client/build/esm/url.mjs +19 -0
  286. package/dist/es/node_modules/socket.io-parser/build/esm/binary.mjs +52 -0
  287. package/dist/es/node_modules/socket.io-parser/build/esm/index.mjs +203 -0
  288. package/dist/es/node_modules/socket.io-parser/build/esm/is-binary.mjs +26 -0
  289. package/dist/es/node_modules/toggle-selection/index.mjs +25 -0
  290. package/dist/es/node_modules/tslib/tslib.es6.mjs +15 -0
  291. package/dist/es/node_modules/uuid/dist/esm-browser/native.mjs +6 -0
  292. package/dist/es/node_modules/uuid/dist/esm-browser/rng.mjs +10 -0
  293. package/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs +9 -0
  294. package/dist/es/node_modules/uuid/dist/esm-browser/v4.mjs +19 -0
  295. package/dist/es/packages/agent-cli-sdk/src/AgentSession.mjs +243 -0
  296. package/dist/es/packages/agent-cli-sdk/src/BotClient.mjs +242 -0
  297. package/dist/es/packages/agent-cli-sdk/src/Config.mjs +34 -0
  298. package/dist/es/packages/agent-cli-sdk/src/DialogSession.mjs +281 -0
  299. package/dist/es/packages/agent-cli-sdk/src/EventBus.mjs +64 -0
  300. package/dist/es/packages/agent-cli-sdk/src/Logger.mjs +31 -0
  301. package/dist/es/packages/agent-cli-sdk/src/PayloadTypes.mjs +4 -0
  302. package/dist/es/packages/agent-cli-sdk/src/Session.mjs +527 -0
  303. package/dist/es/packages/agent-cli-sdk/src/api/fetchEventSource/fetch.mjs +112 -0
  304. package/dist/es/packages/agent-cli-sdk/src/api/fetchEventSource/parse.mjs +97 -0
  305. package/dist/es/packages/agent-cli-sdk/src/api/index.mjs +48 -0
  306. package/dist/es/packages/agent-cli-sdk/src/utils.mjs +11 -0
  307. package/dist/es/packages/apis/dist/es/aecpilot/cosntant.mjs +5 -0
  308. package/dist/es/packages/apis/dist/es/aecpilot/model.mjs +9 -0
  309. package/dist/es/packages/apis/dist/es/aecpilotui/index.mjs +8 -0
  310. package/dist/es/packages/apis/dist/es/agentcliui/index.mjs +414 -0
  311. package/dist/es/packages/apis/dist/es/base/index.mjs +154 -0
  312. package/dist/es/packages/apis/dist/es/cvforce/index.mjs +431 -0
  313. package/dist/es/packages/apis/dist/es/cvforce/model.mjs +6 -0
  314. package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/native.mjs +6 -0
  315. package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/rng.mjs +10 -0
  316. package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs +9 -0
  317. package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/v4.mjs +19 -0
  318. package/dist/es/packages/apis/dist/es/utils/fetchEventSource/fetch.mjs +106 -0
  319. package/dist/es/packages/apis/dist/es/utils/fetchEventSource/parse.mjs +97 -0
  320. package/dist/es/robots.txt +3 -0
  321. package/dist/es/style.less.mjs +4 -0
  322. package/dist/es/types.mjs +4 -0
  323. package/dist/es/utils/clipboard.mjs +38 -0
  324. package/dist/es/utils/index.mjs +33 -0
  325. package/dist/lib/favicon.ico +0 -0
  326. package/dist/lib/favicon2.ico +0 -0
  327. package/dist/lib/font/font_4108228_4w5nlhafpte.js +1 -0
  328. package/dist/lib/font/font_4439177_0sppkcnqiqgs.js +1 -0
  329. package/dist/lib/font/gos-font.js +64 -0
  330. package/dist/lib/images/empty.svg +40 -0
  331. package/dist/lib/images/loading.gif +0 -0
  332. package/dist/lib/images/logo.png +0 -0
  333. package/dist/lib/images/map-example.png +0 -0
  334. package/dist/lib/images/sketch.png +0 -0
  335. package/dist/lib/index.html +43 -0
  336. package/dist/lib/index.js +169 -0
  337. package/dist/lib/logo192.png +0 -0
  338. package/dist/lib/logo512.png +0 -0
  339. package/dist/lib/manifest.json +25 -0
  340. package/dist/lib/robots.txt +3 -0
  341. package/dist/src/AgentClientUI.d.ts +4 -0
  342. package/dist/src/ConnectToNetwork/index.d.ts +13 -0
  343. package/dist/src/Dialog/AgentChat/index.d.ts +17 -0
  344. package/dist/src/Dialog/ChatEmptyView/index.d.ts +6 -0
  345. package/dist/src/Dialog/ConnectToNetwork/index.d.ts +13 -0
  346. package/dist/src/Dialog/FileCard/index.d.ts +22 -0
  347. package/dist/src/Dialog/FilePreview/index.d.ts +20 -0
  348. package/dist/src/Dialog/Greeting/index.d.ts +7 -0
  349. package/dist/src/Dialog/HistoryContent/index.d.ts +5 -0
  350. package/dist/src/Dialog/HistoryItem/index.d.ts +17 -0
  351. package/dist/src/Dialog/KnowledgeDoc/index.d.ts +9 -0
  352. package/dist/src/Dialog/KnowledgeList/KnowledgeSelect/index.d.ts +12 -0
  353. package/dist/src/Dialog/KnowledgeList/index.d.ts +13 -0
  354. package/dist/src/Dialog/PromptManager/PromptList/EditPromptModal/index.d.ts +11 -0
  355. package/dist/src/Dialog/PromptManager/PromptList/PrivatePromptList.d.ts +12 -0
  356. package/dist/src/Dialog/PromptManager/PromptList/PromptListItem.d.ts +13 -0
  357. package/dist/src/Dialog/PromptManager/PromptList/PublicPromptList.d.ts +12 -0
  358. package/dist/src/Dialog/PromptManager/index.d.ts +13 -0
  359. package/dist/src/Dialog/PromptSetting/index.d.ts +14 -0
  360. package/dist/src/Dialog/Recommend/RecommendItem.d.ts +12 -0
  361. package/dist/src/Dialog/Recommend/index.d.ts +14 -0
  362. package/dist/src/Dialog/ReferCollapse/index.d.ts +8 -0
  363. package/dist/src/Dialog/SearchReference/index.d.ts +7 -0
  364. package/dist/src/Dialog/SessionAction/index.d.ts +11 -0
  365. package/dist/src/Dialog/SessionList/index.d.ts +20 -0
  366. package/dist/src/Dialog/SessionListDrawer/HistorySessionList/NameEditPanel.d.ts +9 -0
  367. package/dist/src/Dialog/SessionListDrawer/HistorySessionList/SessionItem.d.ts +16 -0
  368. package/dist/src/Dialog/SessionListDrawer/HistorySessionList/index.d.ts +9 -0
  369. package/dist/src/Dialog/SessionListDrawer/index.d.ts +9 -0
  370. package/dist/src/Dialog/SessionRefer/ReferItem/index.d.ts +9 -0
  371. package/dist/src/Dialog/SessionRefer/index.d.ts +8 -0
  372. package/dist/src/Dialog/SessionRelated/index.d.ts +9 -0
  373. package/dist/src/Dialog/UploadFiles/ClearModal/index.d.ts +7 -0
  374. package/dist/src/Dialog/UploadFiles/index.d.ts +21 -0
  375. package/dist/src/Dialog/UploadKnowledgeFiles/ClearModal/index.d.ts +7 -0
  376. package/dist/src/Dialog/UploadKnowledgeFiles/index.d.ts +22 -0
  377. package/dist/src/Dialog/UploadingPrompt/index.d.ts +9 -0
  378. package/dist/src/Dialog/index.d.ts +9 -0
  379. package/dist/src/FileCard/index.d.ts +21 -0
  380. package/dist/src/FileItem/index.d.ts +11 -0
  381. package/dist/src/Footer/FooterWarning.d.ts +8 -0
  382. package/dist/src/Footer/index.d.ts +7 -0
  383. package/dist/src/Greeting/index.d.ts +7 -0
  384. package/dist/src/Iconfont/font_4108228_8te6zfkclqu.d.ts +0 -0
  385. package/dist/src/Iconfont/font_4439177_7rytwlvbmjj.d.ts +0 -0
  386. package/dist/src/Iconfont/index.d.ts +3 -0
  387. package/dist/src/InputProgress/index.d.ts +7 -0
  388. package/dist/src/QuillEditor/index.d.ts +19 -0
  389. package/dist/src/components/Copy/index.d.ts +5 -0
  390. package/dist/src/components/Header/index.d.ts +6 -0
  391. package/dist/src/components/JsonDisplay/index.d.ts +6 -0
  392. package/dist/src/components/Markdown/Code/index.d.ts +3 -0
  393. package/dist/src/components/Markdown/Image/index.d.ts +3 -0
  394. package/dist/src/components/Markdown/index.d.ts +6 -0
  395. package/dist/src/components/PDFViewer/index.d.ts +7 -0
  396. package/dist/src/components/WebLink/index.d.ts +7 -0
  397. package/dist/src/constant.d.ts +11 -0
  398. package/dist/src/context.d.ts +5 -0
  399. package/dist/src/index.d.ts +33 -0
  400. package/dist/src/types.d.ts +183 -0
  401. package/dist/src/utils/clipboard.d.ts +11 -0
  402. package/dist/src/utils/fetchEventSource/fetch.d.ts +44 -0
  403. package/dist/src/utils/fetchEventSource/index.d.ts +1 -0
  404. package/dist/src/utils/fetchEventSource/parse.d.ts +36 -0
  405. package/dist/src/utils/index.d.ts +17 -0
  406. package/package.json +138 -0
@@ -0,0 +1,97 @@
1
+ var b = (s, t, e) => new Promise((a, c) => {
2
+ var f = (r) => {
3
+ try {
4
+ i(e.next(r));
5
+ } catch (n) {
6
+ c(n);
7
+ }
8
+ }, l = (r) => {
9
+ try {
10
+ i(e.throw(r));
11
+ } catch (n) {
12
+ c(n);
13
+ }
14
+ }, i = (r) => r.done ? a(r.value) : Promise.resolve(r.value).then(f, l);
15
+ i((e = e.apply(s, t)).next());
16
+ });
17
+ function w(s, t) {
18
+ return b(this, null, function* () {
19
+ const e = s.getReader();
20
+ let a;
21
+ for (; !(a = yield e.read()).done; )
22
+ t(a.value);
23
+ });
24
+ }
25
+ function g(s) {
26
+ let t, e, a, c = !1, f;
27
+ return function(i) {
28
+ t === void 0 ? (t = i, e = 0, a = -1, f = !1) : t = h(t, i);
29
+ const r = t.length;
30
+ let n = 0;
31
+ for (; e < r; ) {
32
+ c && (t[e] === 10 && (n = ++e), c = !1);
33
+ let o = -1;
34
+ for (; e < r && o === -1; ++e)
35
+ switch (t[e]) {
36
+ case 58:
37
+ a === -1 && (a = e - n);
38
+ break;
39
+ case 13:
40
+ c = !1, e + 4 < r && t[e + 1] === 10 && t[e + 2] !== 13 && t[e - 1] !== 10 && t[e - 2] !== 13 && (f = !0);
41
+ case 10:
42
+ o = e;
43
+ break;
44
+ }
45
+ if (o === -1)
46
+ break;
47
+ s(t.subarray(n, o), a, f), n = e, a = -1, f = !1;
48
+ }
49
+ n === r ? t = void 0 : n !== 0 && (t = t.subarray(n), e -= n);
50
+ };
51
+ }
52
+ function k(s, t, e) {
53
+ let a = y();
54
+ const c = new TextDecoder();
55
+ return function(l, i, r) {
56
+ if (l.length === 0)
57
+ e == null || e(a), a = y();
58
+ else if (i > 0) {
59
+ const n = c.decode(l.subarray(0, i)), o = i + (l[i + 1] === 32 ? 2 : 1);
60
+ let d = c.decode(l.subarray(o));
61
+ switch (r && (d += `
62
+ `), n) {
63
+ case "data":
64
+ a.data = a.data ? a.data + `
65
+ ` + d : d;
66
+ break;
67
+ case "event":
68
+ a.event = d;
69
+ break;
70
+ case "id":
71
+ s(a.id = d);
72
+ break;
73
+ case "retry":
74
+ const u = parseInt(d, 10);
75
+ isNaN(u) || t(a.retry = u);
76
+ break;
77
+ }
78
+ }
79
+ };
80
+ }
81
+ function h(s, t) {
82
+ const e = new Uint8Array(s.length + t.length);
83
+ return e.set(s), e.set(t, s.length), e;
84
+ }
85
+ function y() {
86
+ return {
87
+ data: "",
88
+ event: "",
89
+ id: "",
90
+ retry: void 0
91
+ };
92
+ }
93
+ export {
94
+ w as getBytes,
95
+ g as getLines,
96
+ k as getMessages
97
+ };
@@ -0,0 +1,48 @@
1
+ var d = Object.defineProperty, h = Object.defineProperties;
2
+ var S = Object.getOwnPropertyDescriptors;
3
+ var s = Object.getOwnPropertySymbols;
4
+ var x = Object.prototype.hasOwnProperty, C = Object.prototype.propertyIsEnumerable;
5
+ var a = (t, e, r) => e in t ? d(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, p = (t, e) => {
6
+ for (var r in e || (e = {}))
7
+ x.call(e, r) && a(t, r, e[r]);
8
+ if (s)
9
+ for (var r of s(e))
10
+ C.call(e, r) && a(t, r, e[r]);
11
+ return t;
12
+ }, m = (t, e) => h(t, S(e));
13
+ import E from "axios";
14
+ import { isExpired as F } from "../utils.mjs";
15
+ import "../../../../node_modules/@glodon-aiot/minio/dist/minio-zj.mjs";
16
+ import "dayjs";
17
+ import "../../../apis/dist/es/node_modules/uuid/dist/esm-browser/native.mjs";
18
+ import "../../../apis/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs";
19
+ import "../../../apis/dist/es/agentcliui/index.mjs";
20
+ import "../../../apis/dist/es/aecpilotui/index.mjs";
21
+ import { CVForceApi as I } from "../../../apis/dist/es/cvforce/index.mjs";
22
+ function j(t, e, r) {
23
+ console.log("getCVForceService apiBase", t);
24
+ const f = (o) => {
25
+ var i;
26
+ return e && (F(e) && r(403, "aiotToken is timeout"), o.headers = (i = o.headers) != null ? i : {}, o.headers = m(p({}, o.headers), {
27
+ Authorization: e ? `Bearer ${e}` : ""
28
+ })), o;
29
+ };
30
+ function g(o, i = !0) {
31
+ const n = `${t}${o}`, c = E.create({
32
+ baseURL: n
33
+ });
34
+ return i && c.interceptors.request.use(f), c;
35
+ }
36
+ const u = (o, i) => {
37
+ o === 401 && r(o, "aiotToken is invalid");
38
+ }, v = (o, i) => {
39
+ o !== 10001 && o !== 10215 && r(o, i);
40
+ }, A = g("/data/v1");
41
+ return new I(A, {
42
+ onHttpStatusError: u,
43
+ onAppStatusError: v
44
+ });
45
+ }
46
+ export {
47
+ j as getCVForceService
48
+ };
@@ -0,0 +1,11 @@
1
+ import { fromBase64 as n } from "../../../node_modules/js-base64/base64.mjs";
2
+ const o = (e) => JSON.parse(n(e.split(".")[1])), s = (e) => {
3
+ const r = o(e).exp;
4
+ return (/* @__PURE__ */ new Date()).valueOf() / 1e3 >= r;
5
+ }, t = (e) => e == null ? void 0 : e.replace(/[\r\n]+/gm, ""), i = (e) => e.replace(/\\|\\/g, "");
6
+ export {
7
+ s as isExpired,
8
+ o as parseJWT,
9
+ i as removeLeadingAndTrailingBackslashes,
10
+ t as removeNewlines
11
+ };
@@ -0,0 +1,5 @@
1
+ const T = 128, _ = 20;
2
+ export {
3
+ T as PROMPT_SEARCH_MAX_LENGTH,
4
+ _ as PROMPT_TITLE_MAX_LENGTH
5
+ };
@@ -0,0 +1,9 @@
1
+ var t = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.SourceFile = 1] = "SourceFile", e[e.WebLink = 2] = "WebLink", e))(t || {}), o = /* @__PURE__ */ ((e) => (e.Unprotected = "不受著作权保护", e.ProtectAuthorize = "受著作权保护,已获得授权", e.ProtectUnauthorize = "受著作权保护,未获得授权", e))(o || {}), s = /* @__PURE__ */ ((e) => (e[e.Robot = 1] = "Robot", e[e.User = 2] = "User", e[e.System = 3] = "System", e))(s || {}), i = /* @__PURE__ */ ((e) => (e.Start = "start", e.End = "end", e))(i || {}), n = /* @__PURE__ */ ((e) => (e[e.Processing = 1] = "Processing", e[e.Success = 2] = "Success", e[e.Failed = 3] = "Failed", e))(n || {}), a = /* @__PURE__ */ ((e) => (e.AECPILOT = "aecpilot", e))(a || {});
2
+ export {
3
+ n as AecKnowledgeFileStatus,
4
+ a as IFileOrigin,
5
+ s as IHistoryRole,
6
+ t as ISourceType,
7
+ i as IThinkingStatus,
8
+ o as IversionInfo
9
+ };
@@ -0,0 +1,8 @@
1
+ import "axios";
2
+ import "../../../../../node_modules/@glodon-aiot/minio/dist/minio-zj.mjs";
3
+ import "dayjs";
4
+ import "../../../../../node_modules/buffer/index.mjs";
5
+ import "../node_modules/uuid/dist/esm-browser/native.mjs";
6
+ import "../node_modules/uuid/dist/esm-browser/stringify.mjs";
7
+ import { __exports as r } from "../../../../../_virtual/index.mjs";
8
+ globalThis.Buffer = r.Buffer;
@@ -0,0 +1,414 @@
1
+ import $ from "axios";
2
+ import { BaseApi as w } from "../base/index.mjs";
3
+ import { m } from "../../../../../node_modules/@glodon-aiot/minio/dist/minio-zj.mjs";
4
+ import { IHistoryRole as S, AecKnowledgeFileStatus as f } from "../aecpilot/model.mjs";
5
+ import { fetchEventSource as y } from "../utils/fetchEventSource/fetch.mjs";
6
+ import A from "dayjs";
7
+ import "../../../../../node_modules/buffer/index.mjs";
8
+ import { PROMPT_SEARCH_MAX_LENGTH as b } from "../aecpilot/cosntant.mjs";
9
+ import P from "../node_modules/uuid/dist/esm-browser/v4.mjs";
10
+ import { __exports as R } from "../../../../../_virtual/index.mjs";
11
+ var F = Object.defineProperty, T = Object.defineProperties, K = Object.getOwnPropertyDescriptors, g = Object.getOwnPropertySymbols, k = Object.prototype.hasOwnProperty, O = Object.prototype.propertyIsEnumerable, v = (u, e, t) => e in u ? F(u, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[e] = t, M = (u, e) => {
12
+ for (var t in e || (e = {}))
13
+ k.call(e, t) && v(u, t, e[t]);
14
+ if (g)
15
+ for (var t of g(e))
16
+ O.call(e, t) && v(u, t, e[t]);
17
+ return u;
18
+ }, x = (u, e) => T(u, K(e)), n = (u, e, t) => new Promise((s, r) => {
19
+ var o = (l) => {
20
+ try {
21
+ i(t.next(l));
22
+ } catch (p) {
23
+ r(p);
24
+ }
25
+ }, d = (l) => {
26
+ try {
27
+ i(t.throw(l));
28
+ } catch (p) {
29
+ r(p);
30
+ }
31
+ }, i = (l) => l.done ? s(l.value) : Promise.resolve(l.value).then(o, d);
32
+ i((t = t.apply(u, e)).next());
33
+ });
34
+ window.Buffer = R.Buffer;
35
+ class L extends w {
36
+ constructor(e, t, s) {
37
+ super(e != null ? e : $.create(), s), this.axiosInstance = e, this.getToken = t;
38
+ }
39
+ getApplicationIdSessions(e) {
40
+ return n(this, null, function* () {
41
+ return this.get(`/data/v1/application/${e}/session`);
42
+ });
43
+ }
44
+ getApplicationId(e) {
45
+ return n(this, null, function* () {
46
+ return this.get(`/data/v1/applications/${e}`);
47
+ });
48
+ }
49
+ postApplicationIdSession(e) {
50
+ return n(this, null, function* () {
51
+ return this.post(`/data/v1/application/${e.applicationId}/sessions`, e);
52
+ });
53
+ }
54
+ getApplicationIdSessionsId(e, t) {
55
+ return n(this, null, function* () {
56
+ return this.get(`/data/v1/application/${e}/sessions/${t}`);
57
+ });
58
+ }
59
+ patchApplicationIdSessionsId(e, t, s) {
60
+ return n(this, null, function* () {
61
+ return this.patch(`/data/v1/application/${e}/sessions/${t}`, s);
62
+ });
63
+ }
64
+ patchApplicationIdSessionsIdContext(e, t) {
65
+ return n(this, null, function* () {
66
+ return this.patch(`/data/v1/application/${e}/sessions/${t}/context`, {});
67
+ });
68
+ }
69
+ delApplicationIdSessionsId(e, t) {
70
+ return n(this, null, function* () {
71
+ return this.delete(`/data/v1/application/${e}/sessions/${t}`);
72
+ });
73
+ }
74
+ postComments(e, t, s) {
75
+ return n(this, null, function* () {
76
+ return this.post(`/data/v1/application/${e}/sessions/${t}/comments`, s);
77
+ });
78
+ }
79
+ getChatHistorySessionId(e, t) {
80
+ return n(this, null, function* () {
81
+ return this.get(`/data/v1/application/${e}/chatHistory/${t}`);
82
+ });
83
+ }
84
+ postChatV2EventSource(e, t, s, r, o, d) {
85
+ return n(this, null, function* () {
86
+ const i = {
87
+ code: 0,
88
+ messageId: P(),
89
+ content: "",
90
+ role: S.Robot,
91
+ sessionId: "",
92
+ reference: [],
93
+ searchReference: [],
94
+ messageTime: "",
95
+ llmModel: "",
96
+ comment: {
97
+ isAgree: 0
98
+ },
99
+ isReplying: !1
100
+ }, l = yield this.getToken(), p = x(M({}, s), {
101
+ stream: !0
102
+ });
103
+ y(`https://aiot-dev.glodon.com/api/cvforcepd/chat/v2/chat?applicationId=${e}&sessionId=${t}`, {
104
+ method: "POST",
105
+ headers: {
106
+ Authorization: `Bearer ${l}`,
107
+ "Content-Type": "application/json"
108
+ },
109
+ body: JSON.stringify(p),
110
+ openWhenHidden: !0,
111
+ signal: r,
112
+ onopen(c) {
113
+ return console.log("onopen"), c.ok && o != null && o.onopen && o.onopen(), Promise.resolve();
114
+ },
115
+ onmessage(c) {
116
+ if (!c.data.includes('{"code": ')) {
117
+ let h = {};
118
+ try {
119
+ h = JSON.parse(c.data);
120
+ } catch (E) {
121
+ }
122
+ (h == null ? void 0 : h.mtype) === "search" ? i.searchReference.push(h) : i.content = i.content + c.data;
123
+ const I = {
124
+ content: i.content,
125
+ role: 1,
126
+ reference: i.reference,
127
+ searchReference: i.searchReference,
128
+ messageId: i.messageId,
129
+ sessionId: t,
130
+ messageTime: A(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"),
131
+ comment: {
132
+ isAgree: 0
133
+ },
134
+ isReplying: !0
135
+ };
136
+ return (o == null ? void 0 : o.onmessage) && o.onmessage(I);
137
+ }
138
+ const a = JSON.parse(c.data);
139
+ if (i.reference = a.data.reference, i.searchReference = a.data.searchReference, i.messageTime = a.data.messageTime, i.messageId = a.data.messageId, i.llmModel = a.data.llmModel, i.content = a.data.content, i.code = a.code, a.code === 200) {
140
+ const h = {
141
+ code: i.code,
142
+ content: i.content,
143
+ role: 1,
144
+ reference: i.reference,
145
+ searchReference: i.searchReference,
146
+ messageId: i.messageId,
147
+ sessionId: t,
148
+ messageTime: i.messageTime,
149
+ isReplying: !0
150
+ };
151
+ o != null && o.onmessage && o.onmessage(h);
152
+ } else
153
+ return d && d({
154
+ code: a.code,
155
+ message: a.message
156
+ });
157
+ },
158
+ onerror() {
159
+ o != null && o.onerror && o.onerror();
160
+ },
161
+ onclose() {
162
+ const c = {
163
+ code: i.code,
164
+ content: i.content,
165
+ role: 1,
166
+ reference: i.reference,
167
+ searchReference: i.searchReference,
168
+ messageId: i.messageId,
169
+ sessionId: t,
170
+ messageTime: i.messageTime,
171
+ comment: {
172
+ isAgree: 0
173
+ },
174
+ isReplying: !1
175
+ };
176
+ o != null && o.onclose && o.onclose(c);
177
+ }
178
+ });
179
+ });
180
+ }
181
+ getKnowledgeIdFileIdData(e, t, s) {
182
+ return n(this, null, function* () {
183
+ return this.get(`/data/v1/knowledge/${e}/file/${t}/data/${s}`);
184
+ });
185
+ }
186
+ getKnowledgeIdFileId(e, t) {
187
+ return n(this, null, function* () {
188
+ return this.get(`/data/v1/knowledge/${e}/file/${t}`);
189
+ });
190
+ }
191
+ getKnowledgeId(e) {
192
+ return n(this, null, function* () {
193
+ return this.get(`/data/v1/knowledge/${e}`);
194
+ });
195
+ }
196
+ getSessionKnowledgeFile(e, t) {
197
+ return n(this, null, function* () {
198
+ return this.get(`/data/v1/chatSession/${e}/file/${t}`);
199
+ });
200
+ }
201
+ sleep(e) {
202
+ return n(this, null, function* () {
203
+ return new Promise((t) => {
204
+ setTimeout(() => {
205
+ t("");
206
+ }, e);
207
+ });
208
+ });
209
+ }
210
+ getBaseModelInfo(e) {
211
+ return n(this, null, function* () {
212
+ return this.get("/data/v1/baseModelInfo", {
213
+ serviceId: e
214
+ });
215
+ });
216
+ }
217
+ uploadFiles(e, t) {
218
+ return n(this, null, function* () {
219
+ const s = {
220
+ files: t.map((r) => r.name),
221
+ isv: "minio",
222
+ knowledgeId: e
223
+ };
224
+ return this.postTicket(s).then((r) => Promise.all(t.map((o) => this.uploadMinioFile(r.minio, o)))).catch((r) => {
225
+ throw Error(r);
226
+ });
227
+ });
228
+ }
229
+ postFile(e, t, s) {
230
+ return n(this, null, function* () {
231
+ const r = {
232
+ files: [t.name],
233
+ isv: "minio",
234
+ knowledgeId: e,
235
+ type: s
236
+ };
237
+ return this.postTicket(r).then((o) => this.uploadMinioFile(o.minio, t)).catch((o) => {
238
+ throw Error(o);
239
+ });
240
+ });
241
+ }
242
+ postTicket(e) {
243
+ return n(this, null, function* () {
244
+ return this.post("/data/v1/ticket", e);
245
+ });
246
+ }
247
+ uploadFile(e, t) {
248
+ return n(this, null, function* () {
249
+ const s = {
250
+ files: [t.name],
251
+ isv: "minio",
252
+ knowledgeId: e
253
+ };
254
+ return this.postTicket(s).then((r) => this.uploadMinioFile(r.minio, t)).catch((r) => {
255
+ throw Error(r);
256
+ });
257
+ });
258
+ }
259
+ // async postUploadTicket(params: IUploadParam) {
260
+ // return this.post<IUploadTicket>(`/data/v1/upload/ticket`, params);
261
+ // }
262
+ uploadMinioFile(e, t) {
263
+ return n(this, null, function* () {
264
+ return new Promise((s, r) => {
265
+ const o = new FileReader();
266
+ o.readAsArrayBuffer(t), o.onload = (d) => {
267
+ m.initMinio({
268
+ endPoint: e.endpoints[0],
269
+ useSSL: e.useSSL,
270
+ accessKey: e.accessKey,
271
+ secretKey: e.secretKey
272
+ });
273
+ const i = Buffer.from(d.target.result), l = {
274
+ "Content-Type": "application/octet-stream"
275
+ };
276
+ m.putObjectBuffer(e.bucket, e.fileKeys[0], i, l, (p) => {
277
+ if (p)
278
+ throw console.error(p), Error(p);
279
+ s(e.fileKeys[0]);
280
+ });
281
+ };
282
+ });
283
+ });
284
+ }
285
+ getRecommendQues(e) {
286
+ return n(this, null, function* () {
287
+ return this.get(`/data/v1/application/${e}/recommendQues`);
288
+ });
289
+ }
290
+ //常用提示词
291
+ postPrompts(e, t) {
292
+ return n(this, null, function* () {
293
+ return this.post(`/data/v1/application/${e}/prompts`, t);
294
+ });
295
+ }
296
+ listPrompt(e, t) {
297
+ return n(this, null, function* () {
298
+ return t != null && t.title && t.title.length > b ? [] : this.get(`/data/v1/application/${e}/prompts`, t);
299
+ });
300
+ }
301
+ getPrompt(e, t) {
302
+ return n(this, null, function* () {
303
+ return this.get(`/data/v1/application/${e}/prompts/${t}`);
304
+ });
305
+ }
306
+ updatePrompt(e, t, s) {
307
+ return n(this, null, function* () {
308
+ return this.put(`/data/v1/application/${e}/prompts/${t}`, s);
309
+ });
310
+ }
311
+ deletePrompt(e, t) {
312
+ return n(this, null, function* () {
313
+ return this.delete(`/data/v1/application/${e}/prompts/${t}`);
314
+ });
315
+ }
316
+ postGeneques(e, t) {
317
+ return n(this, null, function* () {
318
+ return this.post("/data/v1/geneques", e, {}, t);
319
+ });
320
+ }
321
+ getApplicationIdSessionKnowledgeFiles(e, t, s) {
322
+ return n(this, null, function* () {
323
+ return this.get(`/data/v1/application/${e}/session/${t}/file`, s);
324
+ });
325
+ }
326
+ checkFileReady(e, t, s, r = () => !0, o = 1e4, d) {
327
+ return n(this, null, function* () {
328
+ return new Promise((i, l) => {
329
+ const p = () => {
330
+ if (!r()) {
331
+ clearInterval(c);
332
+ return;
333
+ }
334
+ s ? this.getApplicationIdSessionKnowledgeFileId(e, t, s, {}, !0).then((a) => {
335
+ if (d == null || d(a), a.status === f.Success && (clearInterval(c), i(a)), a.status === f.Failed) {
336
+ clearInterval(c);
337
+ const h = "该文件无法读取,请上传可编辑pdf,doc,docx文档";
338
+ l(Error(h, {
339
+ cause: {
340
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
341
+ // @ts-ignore
342
+ code: -101,
343
+ message: h,
344
+ data: a
345
+ }
346
+ }));
347
+ }
348
+ }).catch((a) => {
349
+ clearInterval(c), l(a);
350
+ }) : i(null);
351
+ }, c = setInterval(p, o);
352
+ p();
353
+ });
354
+ });
355
+ }
356
+ getApplicationIdSessionKnowledgeFileId(e, t, s, r, o) {
357
+ return n(this, null, function* () {
358
+ return this.get(`/data/v1/application/${e}/session/${t}/file/${s}`, r, o);
359
+ });
360
+ }
361
+ delApplicationIdSessionKnowledgeFileId(e, t, s) {
362
+ return n(this, null, function* () {
363
+ return this.delete(`/data/v1/application/${e}/session/${t}/file/${s}`);
364
+ });
365
+ }
366
+ postApplicationIdSessionKnowledgeSessionFile(e, t, s, r, o) {
367
+ return n(this, null, function* () {
368
+ return this.post(`/data/v1/application/${e}/session/${t}/sessionfile`, s, r, o);
369
+ });
370
+ }
371
+ delApplicationIdSessionKnowledgeFile(e, t, s) {
372
+ return n(this, null, function* () {
373
+ return this.delete(`/data/v1/application/${e}/session/${t}/file`, s);
374
+ });
375
+ }
376
+ deleteSessionKnowledgeFiles(e, t) {
377
+ return n(this, null, function* () {
378
+ return this.delete(`/data/v1/chatSession/${e}/file`, t);
379
+ });
380
+ }
381
+ patchApplicationIdKnowledgeIdFileId(e, t, s, r) {
382
+ return n(this, null, function* () {
383
+ return this.patch(`/data/v1/application/${e}/session/${t}/file/${s}`, r);
384
+ });
385
+ }
386
+ getApplicationIdSessionIdPromptVariables(e, t) {
387
+ return n(this, null, function* () {
388
+ return this.get(`/data/v1/application/${e}/session/${t}/promptVariables`);
389
+ });
390
+ }
391
+ getApplicationIdPromptVariables(e, t) {
392
+ return n(this, null, function* () {
393
+ return this.get(`/data/v1/application/${e}/promptVariables`, t);
394
+ });
395
+ }
396
+ patchApplicationIdSessionpromptVariablesId(e, t, s, r) {
397
+ return n(this, null, function* () {
398
+ return this.patch(`/data/v1/application/${e}/session/${t}/promptVariables/${s}`, r);
399
+ });
400
+ }
401
+ updateSession(e, t, s) {
402
+ return n(this, null, function* () {
403
+ return this.patch(`/data/v1/application/${e}/sessions/${t}`, s);
404
+ });
405
+ }
406
+ getSession(e, t) {
407
+ return n(this, null, function* () {
408
+ return this.get(`/data/v1/application/${e}/sessions/${t}`);
409
+ });
410
+ }
411
+ }
412
+ export {
413
+ L as AgentClientUIApi
414
+ };