@touchvue/chat 1.0.0-beta.5 → 1.0.0-beta.50

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 (443) hide show
  1. package/README.md +25 -25
  2. package/es/_virtual/_plugin-vue_export-helper.mjs +10 -0
  3. package/es/_virtual/_plugin-vue_export-helper.mjs.map +1 -0
  4. package/es/index.mjs.map +1 -1
  5. package/es/node_modules/.pnpm/@touchvue_a2ui@1.0.0-beta.46/node_modules/@touchvue/a2ui/dist/index.mjs +4816 -0
  6. package/es/node_modules/.pnpm/@touchvue_a2ui@1.0.0-beta.46/node_modules/@touchvue/a2ui/dist/index.mjs.map +1 -0
  7. package/es/node_modules/.pnpm/dompurify@3.3.0/node_modules/dompurify/dist/purify.es.mjs +1380 -0
  8. package/es/node_modules/.pnpm/dompurify@3.3.0/node_modules/dompurify/dist/purify.es.mjs.map +1 -0
  9. package/es/node_modules/.pnpm/html2canvas@1.4.1/node_modules/html2canvas/dist/html2canvas.esm.mjs +7824 -0
  10. package/es/node_modules/.pnpm/html2canvas@1.4.1/node_modules/html2canvas/dist/html2canvas.esm.mjs.map +1 -0
  11. package/es/package.json.css +1 -1
  12. package/es/package.json.mjs +2 -2
  13. package/es/packages/components/index.mjs +1 -1
  14. package/es/packages/components/resolver.mjs.map +1 -1
  15. package/es/packages/components/touchchat/component/AiRobot/HelloChat.vue.mjs +3 -2
  16. package/es/packages/components/touchchat/component/AiRobot/HelloChat.vue.mjs.map +1 -1
  17. package/es/packages/components/touchchat/component/AiRobot/HelloChat.vue2.mjs +219 -159
  18. package/es/packages/components/touchchat/component/AiRobot/HelloChat.vue2.mjs.map +1 -1
  19. package/es/packages/components/touchchat/component/AiRobot/face.vue.mjs +3 -2
  20. package/es/packages/components/touchchat/component/AiRobot/face.vue.mjs.map +1 -1
  21. package/es/packages/components/touchchat/component/AiRobot/face.vue2.mjs +27 -13
  22. package/es/packages/components/touchchat/component/AiRobot/face.vue2.mjs.map +1 -1
  23. package/es/packages/components/touchchat/component/AiRobot/letter.vue.mjs +3 -2
  24. package/es/packages/components/touchchat/component/AiRobot/letter.vue.mjs.map +1 -1
  25. package/es/packages/components/touchchat/component/AiRobot/letter.vue2.mjs +182 -41
  26. package/es/packages/components/touchchat/component/AiRobot/letter.vue2.mjs.map +1 -1
  27. package/es/packages/components/touchchat/component/AiRobot/meterialPrepare.vue.mjs +3 -2
  28. package/es/packages/components/touchchat/component/AiRobot/meterialPrepare.vue.mjs.map +1 -1
  29. package/es/packages/components/touchchat/component/AiRobot/meterialPrepare.vue2.mjs +15 -10
  30. package/es/packages/components/touchchat/component/AiRobot/meterialPrepare.vue2.mjs.map +1 -1
  31. package/es/packages/components/touchchat/component/AiRobot/start.vue.mjs +3 -2
  32. package/es/packages/components/touchchat/component/AiRobot/start.vue.mjs.map +1 -1
  33. package/es/packages/components/touchchat/component/AiRobot/start.vue2.mjs +18 -11
  34. package/es/packages/components/touchchat/component/AiRobot/start.vue2.mjs.map +1 -1
  35. package/es/packages/components/touchchat/component/CardView.vue.mjs +3 -2
  36. package/es/packages/components/touchchat/component/CardView.vue.mjs.map +1 -1
  37. package/es/packages/components/touchchat/component/CardView.vue2.mjs +66 -42
  38. package/es/packages/components/touchchat/component/CardView.vue2.mjs.map +1 -1
  39. package/es/packages/components/touchchat/component/FileContent.vue.mjs +7 -0
  40. package/es/packages/components/touchchat/component/FileContent.vue.mjs.map +1 -0
  41. package/es/packages/components/touchchat/component/FileContent.vue2.mjs +206 -0
  42. package/es/packages/components/touchchat/component/FileContent.vue2.mjs.map +1 -0
  43. package/es/packages/components/touchchat/component/FileView.vue.mjs +3 -2
  44. package/es/packages/components/touchchat/component/FileView.vue.mjs.map +1 -1
  45. package/es/packages/components/touchchat/component/FileView.vue2.mjs +17 -4
  46. package/es/packages/components/touchchat/component/FileView.vue2.mjs.map +1 -1
  47. package/es/packages/components/touchchat/component/HelloChat.vue.mjs +3 -2
  48. package/es/packages/components/touchchat/component/HelloChat.vue.mjs.map +1 -1
  49. package/es/packages/components/touchchat/component/HelloChat.vue2.mjs +26 -14
  50. package/es/packages/components/touchchat/component/HelloChat.vue2.mjs.map +1 -1
  51. package/es/packages/components/touchchat/component/ImageFile.vue.mjs +7 -0
  52. package/es/packages/components/touchchat/component/ImageFile.vue.mjs.map +1 -0
  53. package/es/packages/components/touchchat/component/ImageFile.vue2.mjs +162 -0
  54. package/es/packages/components/touchchat/component/ImageFile.vue2.mjs.map +1 -0
  55. package/es/packages/components/touchchat/component/ImageView.vue.mjs +3 -2
  56. package/es/packages/components/touchchat/component/ImageView.vue.mjs.map +1 -1
  57. package/es/packages/components/touchchat/component/ImageView.vue2.mjs +1 -1
  58. package/es/packages/components/touchchat/component/ImageView.vue2.mjs.map +1 -1
  59. package/es/packages/components/touchchat/component/LinkView.vue.mjs +3 -2
  60. package/es/packages/components/touchchat/component/LinkView.vue.mjs.map +1 -1
  61. package/es/packages/components/touchchat/component/LinkView.vue2.mjs +19 -5
  62. package/es/packages/components/touchchat/component/LinkView.vue2.mjs.map +1 -1
  63. package/es/packages/components/touchchat/component/MarkLayer.vue.mjs +7 -0
  64. package/es/packages/components/touchchat/component/MarkLayer.vue.mjs.map +1 -0
  65. package/es/packages/components/touchchat/component/MarkLayer.vue2.mjs +56 -0
  66. package/es/packages/components/touchchat/component/MarkLayer.vue2.mjs.map +1 -0
  67. package/es/packages/components/touchchat/component/ModuleSelect.vue.mjs +7 -0
  68. package/es/packages/components/touchchat/component/ModuleSelect.vue.mjs.map +1 -0
  69. package/es/packages/components/touchchat/component/ModuleSelect.vue2.mjs +121 -0
  70. package/es/packages/components/touchchat/component/ModuleSelect.vue2.mjs.map +1 -0
  71. package/es/packages/components/touchchat/component/PDFFile.vue.mjs +7 -0
  72. package/es/packages/components/touchchat/component/PDFFile.vue.mjs.map +1 -0
  73. package/es/packages/components/touchchat/component/PDFFile.vue2.mjs +211 -0
  74. package/es/packages/components/touchchat/component/PDFFile.vue2.mjs.map +1 -0
  75. package/es/packages/components/touchchat/component/QuoteContent.vue.mjs +7 -0
  76. package/es/packages/components/touchchat/component/QuoteContent.vue.mjs.map +1 -0
  77. package/es/packages/components/touchchat/component/QuoteContent.vue2.mjs +40 -0
  78. package/es/packages/components/touchchat/component/QuoteContent.vue2.mjs.map +1 -0
  79. package/es/packages/components/touchchat/component/RealtimeVoice.vue.mjs +7 -0
  80. package/es/packages/components/touchchat/component/RealtimeVoice.vue.mjs.map +1 -0
  81. package/es/packages/components/touchchat/component/RealtimeVoice.vue2.mjs +160 -0
  82. package/es/packages/components/touchchat/component/RealtimeVoice.vue2.mjs.map +1 -0
  83. package/es/packages/components/touchchat/component/Screenshot.vue.mjs +7 -0
  84. package/es/packages/components/touchchat/component/Screenshot.vue.mjs.map +1 -0
  85. package/es/packages/components/touchchat/component/Screenshot.vue2.mjs +208 -0
  86. package/es/packages/components/touchchat/component/Screenshot.vue2.mjs.map +1 -0
  87. package/es/packages/components/touchchat/component/ThoughtChain.vue.mjs +7 -0
  88. package/es/packages/components/touchchat/component/ThoughtChain.vue.mjs.map +1 -0
  89. package/es/packages/components/touchchat/component/ThoughtChain.vue2.mjs +69 -0
  90. package/es/packages/components/touchchat/component/ThoughtChain.vue2.mjs.map +1 -0
  91. package/es/packages/components/touchchat/component/UploadView.vue.mjs +7 -0
  92. package/es/packages/components/touchchat/component/UploadView.vue.mjs.map +1 -0
  93. package/es/packages/components/touchchat/component/UploadView.vue2.mjs +186 -0
  94. package/es/packages/components/touchchat/component/UploadView.vue2.mjs.map +1 -0
  95. package/es/packages/components/touchchat/component/UploadView_api.vue.mjs +7 -0
  96. package/es/packages/components/touchchat/component/UploadView_api.vue.mjs.map +1 -0
  97. package/es/packages/components/touchchat/component/UploadView_api.vue2.mjs +166 -0
  98. package/es/packages/components/touchchat/component/UploadView_api.vue2.mjs.map +1 -0
  99. package/es/packages/components/touchchat/component/VideoFile.vue.mjs +7 -0
  100. package/es/packages/components/touchchat/component/VideoFile.vue.mjs.map +1 -0
  101. package/es/packages/components/touchchat/component/VideoFile.vue2.mjs +33 -0
  102. package/es/packages/components/touchchat/component/VideoFile.vue2.mjs.map +1 -0
  103. package/es/packages/components/touchchat/component/VoiceView.vue.mjs +7 -0
  104. package/es/packages/components/touchchat/component/VoiceView.vue.mjs.map +1 -0
  105. package/es/packages/components/touchchat/component/VoiceView.vue2.mjs +165 -0
  106. package/es/packages/components/touchchat/component/VoiceView.vue2.mjs.map +1 -0
  107. package/es/packages/components/touchchat/img/file/doc.png.mjs +4 -0
  108. package/es/packages/components/touchchat/img/file/doc.png.mjs.map +1 -0
  109. package/es/packages/components/touchchat/img/file/docx.png.mjs +4 -0
  110. package/es/packages/components/touchchat/img/file/docx.png.mjs.map +1 -0
  111. package/es/packages/components/touchchat/img/file/gif.png.mjs +4 -0
  112. package/es/packages/components/touchchat/img/file/gif.png.mjs.map +1 -0
  113. package/es/packages/components/touchchat/img/file/html.png.mjs +4 -0
  114. package/es/packages/components/touchchat/img/file/html.png.mjs.map +1 -0
  115. package/es/packages/components/touchchat/img/file/jpg.png.mjs +4 -0
  116. package/es/packages/components/touchchat/img/file/jpg.png.mjs.map +1 -0
  117. package/es/packages/components/touchchat/img/file/mp3.png.mjs +4 -0
  118. package/es/packages/components/touchchat/img/file/mp3.png.mjs.map +1 -0
  119. package/es/packages/components/touchchat/img/file/mp4.png.mjs +4 -0
  120. package/es/packages/components/touchchat/img/file/mp4.png.mjs.map +1 -0
  121. package/es/packages/components/touchchat/img/file/music.png.mjs +4 -0
  122. package/es/packages/components/touchchat/img/file/music.png.mjs.map +1 -0
  123. package/es/packages/components/touchchat/img/file/pdf.png.mjs +4 -0
  124. package/es/packages/components/touchchat/img/file/pdf.png.mjs.map +1 -0
  125. package/es/packages/components/touchchat/img/file/png.png.mjs +4 -0
  126. package/es/packages/components/touchchat/img/file/png.png.mjs.map +1 -0
  127. package/es/packages/components/touchchat/img/file/ppt.png.mjs +4 -0
  128. package/es/packages/components/touchchat/img/file/ppt.png.mjs.map +1 -0
  129. package/es/packages/components/touchchat/img/file/pptx.png.mjs +4 -0
  130. package/es/packages/components/touchchat/img/file/pptx.png.mjs.map +1 -0
  131. package/es/packages/components/touchchat/img/file/txt.png.mjs +4 -0
  132. package/es/packages/components/touchchat/img/file/txt.png.mjs.map +1 -0
  133. package/es/packages/components/touchchat/img/file/xls.png.mjs +4 -0
  134. package/es/packages/components/touchchat/img/file/xls.png.mjs.map +1 -0
  135. package/es/packages/components/touchchat/img/file/xlsx.png.mjs +4 -0
  136. package/es/packages/components/touchchat/img/file/xlsx.png.mjs.map +1 -0
  137. package/es/packages/components/touchchat/img/svg/reset.svg.mjs +4 -0
  138. package/es/packages/components/touchchat/img/svg/reset.svg.mjs.map +1 -0
  139. package/es/packages/components/touchchat/index.mjs +5 -5
  140. package/es/packages/components/touchchat/index.mjs.map +1 -1
  141. package/es/packages/components/touchchat/src/AiChat/AgentsView.vue.mjs +7 -0
  142. package/es/packages/components/touchchat/src/AiChat/AgentsView.vue.mjs.map +1 -0
  143. package/es/packages/components/touchchat/src/AiChat/AgentsView.vue2.mjs +59 -0
  144. package/es/packages/components/touchchat/src/AiChat/AgentsView.vue2.mjs.map +1 -0
  145. package/es/packages/components/touchchat/src/AiChat/AiMessage.vue.mjs +3 -2
  146. package/es/packages/components/touchchat/src/AiChat/AiMessage.vue.mjs.map +1 -1
  147. package/es/packages/components/touchchat/src/AiChat/AiMessage.vue2.mjs +322 -139
  148. package/es/packages/components/touchchat/src/AiChat/AiMessage.vue2.mjs.map +1 -1
  149. package/es/packages/components/touchchat/src/AiChat/Chat/TouchChat.mjs +18 -0
  150. package/es/packages/components/touchchat/src/AiChat/Chat/TouchChat.mjs.map +1 -0
  151. package/es/packages/components/touchchat/src/AiChat/Chat/scriptMatcher.mjs +145 -0
  152. package/es/packages/components/touchchat/src/AiChat/Chat/scriptMatcher.mjs.map +1 -0
  153. package/es/packages/components/touchchat/src/AiChat/Chat/types.mjs +19 -0
  154. package/es/packages/components/touchchat/src/AiChat/Chat/types.mjs.map +1 -0
  155. package/es/packages/components/touchchat/src/AiChat/Chat/useChat.mjs +693 -0
  156. package/es/packages/components/touchchat/src/AiChat/Chat/useChat.mjs.map +1 -0
  157. package/es/packages/components/touchchat/src/AiChat/Chat/useCopy.mjs +55 -0
  158. package/es/packages/components/touchchat/src/AiChat/Chat/useCopy.mjs.map +1 -0
  159. package/es/packages/components/touchchat/src/AiChat/Chat/useMessageRender.mjs +155 -0
  160. package/es/packages/components/touchchat/src/AiChat/Chat/useMessageRender.mjs.map +1 -0
  161. package/es/packages/components/touchchat/src/AiChat/Chat/useSSE.mjs +345 -0
  162. package/es/packages/components/touchchat/src/AiChat/Chat/useSSE.mjs.map +1 -0
  163. package/es/packages/components/touchchat/src/AiChat/Chat/useScroll.mjs +74 -0
  164. package/es/packages/components/touchchat/src/AiChat/Chat/useScroll.mjs.map +1 -0
  165. package/es/packages/components/touchchat/src/AiChat/ChatInput.vue.mjs +3 -2
  166. package/es/packages/components/touchchat/src/AiChat/ChatInput.vue.mjs.map +1 -1
  167. package/es/packages/components/touchchat/src/AiChat/ChatInput.vue2.mjs +472 -44
  168. package/es/packages/components/touchchat/src/AiChat/ChatInput.vue2.mjs.map +1 -1
  169. package/es/packages/components/touchchat/src/AiChat/HistoryList.vue.mjs +3 -2
  170. package/es/packages/components/touchchat/src/AiChat/HistoryList.vue.mjs.map +1 -1
  171. package/es/packages/components/touchchat/src/AiChat/HistoryList.vue2.mjs +180 -98
  172. package/es/packages/components/touchchat/src/AiChat/HistoryList.vue2.mjs.map +1 -1
  173. package/es/packages/components/touchchat/src/AiChat/HistorySidebar.vue.mjs +3 -2
  174. package/es/packages/components/touchchat/src/AiChat/HistorySidebar.vue.mjs.map +1 -1
  175. package/es/packages/components/touchchat/src/AiChat/HistorySidebar.vue2.mjs +29 -12
  176. package/es/packages/components/touchchat/src/AiChat/HistorySidebar.vue2.mjs.map +1 -1
  177. package/es/packages/components/touchchat/src/AiChat/MessageActions.vue.mjs +3 -2
  178. package/es/packages/components/touchchat/src/AiChat/MessageActions.vue.mjs.map +1 -1
  179. package/es/packages/components/touchchat/src/AiChat/MessageActions.vue2.mjs +175 -62
  180. package/es/packages/components/touchchat/src/AiChat/MessageActions.vue2.mjs.map +1 -1
  181. package/es/packages/components/touchchat/src/AiChat/SiderBarView.vue.mjs +3 -2
  182. package/es/packages/components/touchchat/src/AiChat/SiderBarView.vue.mjs.map +1 -1
  183. package/es/packages/components/touchchat/src/AiChat/SiderBarView.vue2.mjs +14 -8
  184. package/es/packages/components/touchchat/src/AiChat/SiderBarView.vue2.mjs.map +1 -1
  185. package/es/packages/components/touchchat/src/AiChat/TouchAgent.vue.mjs +7 -0
  186. package/es/packages/components/touchchat/src/AiChat/TouchAgent.vue.mjs.map +1 -0
  187. package/es/packages/components/touchchat/src/AiChat/TouchAgent.vue2.mjs +1034 -0
  188. package/es/packages/components/touchchat/src/AiChat/TouchAgent.vue2.mjs.map +1 -0
  189. package/es/packages/components/touchchat/src/AiChat/TouchChat.vue.mjs +3 -2
  190. package/es/packages/components/touchchat/src/AiChat/TouchChat.vue.mjs.map +1 -1
  191. package/es/packages/components/touchchat/src/AiChat/TouchChat.vue2.mjs +276 -1004
  192. package/es/packages/components/touchchat/src/AiChat/TouchChat.vue2.mjs.map +1 -1
  193. package/es/packages/components/touchchat/src/AiChat/TouchHistory.vue.mjs +3 -2
  194. package/es/packages/components/touchchat/src/AiChat/TouchHistory.vue.mjs.map +1 -1
  195. package/es/packages/components/touchchat/src/AiChat/TouchHistory.vue2.mjs +346 -122
  196. package/es/packages/components/touchchat/src/AiChat/TouchHistory.vue2.mjs.map +1 -1
  197. package/es/packages/components/touchchat/src/AiChat/UserMessage.vue.mjs +3 -2
  198. package/es/packages/components/touchchat/src/AiChat/UserMessage.vue.mjs.map +1 -1
  199. package/es/packages/components/touchchat/src/AiChat/UserMessage.vue2.mjs +143 -64
  200. package/es/packages/components/touchchat/src/AiChat/UserMessage.vue2.mjs.map +1 -1
  201. package/es/packages/components/touchchat/src/index.vue.mjs +3 -2
  202. package/es/packages/components/touchchat/src/index.vue.mjs.map +1 -1
  203. package/es/packages/components/touchchat/src/index.vue2.mjs +252 -143
  204. package/es/packages/components/touchchat/src/index.vue2.mjs.map +1 -1
  205. package/es/packages/components/touchchat/src/types/a2a.mjs +11 -0
  206. package/es/packages/components/touchchat/src/types/a2a.mjs.map +1 -0
  207. package/es/packages/components/touchchat/utils/a2aService.mjs +316 -0
  208. package/es/packages/components/touchchat/utils/a2aService.mjs.map +1 -0
  209. package/es/packages/components/touchchat/utils/fetchStream.mjs +8 -2
  210. package/es/packages/components/touchchat/utils/fetchStream.mjs.map +1 -1
  211. package/es/packages/components/touchchat/utils/markdown.mjs +31 -13
  212. package/es/packages/components/touchchat/utils/markdown.mjs.map +1 -1
  213. package/es/packages/utils/config.mjs.map +1 -1
  214. package/es/packages/utils/types.mjs.map +1 -1
  215. package/global.d.ts +2 -2
  216. package/lib/_virtual/_plugin-vue_export-helper.js +14 -0
  217. package/lib/_virtual/_plugin-vue_export-helper.js.map +1 -0
  218. package/lib/index.js.map +1 -1
  219. package/lib/node_modules/.pnpm/@touchvue_a2ui@1.0.0-beta.46/node_modules/@touchvue/a2ui/dist/index.js +4819 -0
  220. package/lib/node_modules/.pnpm/@touchvue_a2ui@1.0.0-beta.46/node_modules/@touchvue/a2ui/dist/index.js.map +1 -0
  221. package/lib/node_modules/.pnpm/dompurify@3.3.0/node_modules/dompurify/dist/purify.es.js +1384 -0
  222. package/lib/node_modules/.pnpm/dompurify@3.3.0/node_modules/dompurify/dist/purify.es.js.map +1 -0
  223. package/lib/node_modules/.pnpm/html2canvas@1.4.1/node_modules/html2canvas/dist/html2canvas.esm.js +7828 -0
  224. package/lib/node_modules/.pnpm/html2canvas@1.4.1/node_modules/html2canvas/dist/html2canvas.esm.js.map +1 -0
  225. package/lib/package.json.css +1 -1
  226. package/lib/package.json.js +2 -2
  227. package/lib/packages/components/index.js +2 -2
  228. package/lib/packages/components/resolver.js.map +1 -1
  229. package/lib/packages/components/touchchat/component/AiRobot/HelloChat.vue.js +3 -2
  230. package/lib/packages/components/touchchat/component/AiRobot/HelloChat.vue.js.map +1 -1
  231. package/lib/packages/components/touchchat/component/AiRobot/HelloChat.vue2.js +219 -159
  232. package/lib/packages/components/touchchat/component/AiRobot/HelloChat.vue2.js.map +1 -1
  233. package/lib/packages/components/touchchat/component/AiRobot/face.vue.js +3 -2
  234. package/lib/packages/components/touchchat/component/AiRobot/face.vue.js.map +1 -1
  235. package/lib/packages/components/touchchat/component/AiRobot/face.vue2.js +26 -12
  236. package/lib/packages/components/touchchat/component/AiRobot/face.vue2.js.map +1 -1
  237. package/lib/packages/components/touchchat/component/AiRobot/letter.vue.js +3 -2
  238. package/lib/packages/components/touchchat/component/AiRobot/letter.vue.js.map +1 -1
  239. package/lib/packages/components/touchchat/component/AiRobot/letter.vue2.js +181 -40
  240. package/lib/packages/components/touchchat/component/AiRobot/letter.vue2.js.map +1 -1
  241. package/lib/packages/components/touchchat/component/AiRobot/meterialPrepare.vue.js +3 -2
  242. package/lib/packages/components/touchchat/component/AiRobot/meterialPrepare.vue.js.map +1 -1
  243. package/lib/packages/components/touchchat/component/AiRobot/meterialPrepare.vue2.js +15 -10
  244. package/lib/packages/components/touchchat/component/AiRobot/meterialPrepare.vue2.js.map +1 -1
  245. package/lib/packages/components/touchchat/component/AiRobot/start.vue.js +3 -2
  246. package/lib/packages/components/touchchat/component/AiRobot/start.vue.js.map +1 -1
  247. package/lib/packages/components/touchchat/component/AiRobot/start.vue2.js +17 -10
  248. package/lib/packages/components/touchchat/component/AiRobot/start.vue2.js.map +1 -1
  249. package/lib/packages/components/touchchat/component/CardView.vue.js +3 -2
  250. package/lib/packages/components/touchchat/component/CardView.vue.js.map +1 -1
  251. package/lib/packages/components/touchchat/component/CardView.vue2.js +66 -42
  252. package/lib/packages/components/touchchat/component/CardView.vue2.js.map +1 -1
  253. package/lib/packages/components/touchchat/component/FileContent.vue.js +11 -0
  254. package/lib/packages/components/touchchat/component/FileContent.vue.js.map +1 -0
  255. package/lib/packages/components/touchchat/component/FileContent.vue2.js +210 -0
  256. package/lib/packages/components/touchchat/component/FileContent.vue2.js.map +1 -0
  257. package/lib/packages/components/touchchat/component/FileView.vue.js +3 -2
  258. package/lib/packages/components/touchchat/component/FileView.vue.js.map +1 -1
  259. package/lib/packages/components/touchchat/component/FileView.vue2.js +16 -3
  260. package/lib/packages/components/touchchat/component/FileView.vue2.js.map +1 -1
  261. package/lib/packages/components/touchchat/component/HelloChat.vue.js +3 -2
  262. package/lib/packages/components/touchchat/component/HelloChat.vue.js.map +1 -1
  263. package/lib/packages/components/touchchat/component/HelloChat.vue2.js +26 -14
  264. package/lib/packages/components/touchchat/component/HelloChat.vue2.js.map +1 -1
  265. package/lib/packages/components/touchchat/component/ImageFile.vue.js +11 -0
  266. package/lib/packages/components/touchchat/component/ImageFile.vue.js.map +1 -0
  267. package/lib/packages/components/touchchat/component/ImageFile.vue2.js +166 -0
  268. package/lib/packages/components/touchchat/component/ImageFile.vue2.js.map +1 -0
  269. package/lib/packages/components/touchchat/component/ImageView.vue.js +3 -2
  270. package/lib/packages/components/touchchat/component/ImageView.vue.js.map +1 -1
  271. package/lib/packages/components/touchchat/component/ImageView.vue2.js +1 -1
  272. package/lib/packages/components/touchchat/component/ImageView.vue2.js.map +1 -1
  273. package/lib/packages/components/touchchat/component/LinkView.vue.js +3 -2
  274. package/lib/packages/components/touchchat/component/LinkView.vue.js.map +1 -1
  275. package/lib/packages/components/touchchat/component/LinkView.vue2.js +18 -4
  276. package/lib/packages/components/touchchat/component/LinkView.vue2.js.map +1 -1
  277. package/lib/packages/components/touchchat/component/MarkLayer.vue.js +11 -0
  278. package/lib/packages/components/touchchat/component/MarkLayer.vue.js.map +1 -0
  279. package/lib/packages/components/touchchat/component/MarkLayer.vue2.js +60 -0
  280. package/lib/packages/components/touchchat/component/MarkLayer.vue2.js.map +1 -0
  281. package/lib/packages/components/touchchat/component/ModuleSelect.vue.js +11 -0
  282. package/lib/packages/components/touchchat/component/ModuleSelect.vue.js.map +1 -0
  283. package/lib/packages/components/touchchat/component/ModuleSelect.vue2.js +125 -0
  284. package/lib/packages/components/touchchat/component/ModuleSelect.vue2.js.map +1 -0
  285. package/lib/packages/components/touchchat/component/PDFFile.vue.js +11 -0
  286. package/lib/packages/components/touchchat/component/PDFFile.vue.js.map +1 -0
  287. package/lib/packages/components/touchchat/component/PDFFile.vue2.js +215 -0
  288. package/lib/packages/components/touchchat/component/PDFFile.vue2.js.map +1 -0
  289. package/lib/packages/components/touchchat/component/QuoteContent.vue.js +11 -0
  290. package/lib/packages/components/touchchat/component/QuoteContent.vue.js.map +1 -0
  291. package/lib/packages/components/touchchat/component/QuoteContent.vue2.js +44 -0
  292. package/lib/packages/components/touchchat/component/QuoteContent.vue2.js.map +1 -0
  293. package/lib/packages/components/touchchat/component/RealtimeVoice.vue.js +11 -0
  294. package/lib/packages/components/touchchat/component/RealtimeVoice.vue.js.map +1 -0
  295. package/lib/packages/components/touchchat/component/RealtimeVoice.vue2.js +164 -0
  296. package/lib/packages/components/touchchat/component/RealtimeVoice.vue2.js.map +1 -0
  297. package/lib/packages/components/touchchat/component/Screenshot.vue.js +11 -0
  298. package/lib/packages/components/touchchat/component/Screenshot.vue.js.map +1 -0
  299. package/lib/packages/components/touchchat/component/Screenshot.vue2.js +212 -0
  300. package/lib/packages/components/touchchat/component/Screenshot.vue2.js.map +1 -0
  301. package/lib/packages/components/touchchat/component/ThoughtChain.vue.js +11 -0
  302. package/lib/packages/components/touchchat/component/ThoughtChain.vue.js.map +1 -0
  303. package/lib/packages/components/touchchat/component/ThoughtChain.vue2.js +73 -0
  304. package/lib/packages/components/touchchat/component/ThoughtChain.vue2.js.map +1 -0
  305. package/lib/packages/components/touchchat/component/UploadView.vue.js +11 -0
  306. package/lib/packages/components/touchchat/component/UploadView.vue.js.map +1 -0
  307. package/lib/packages/components/touchchat/component/UploadView.vue2.js +190 -0
  308. package/lib/packages/components/touchchat/component/UploadView.vue2.js.map +1 -0
  309. package/lib/packages/components/touchchat/component/UploadView_api.vue.js +11 -0
  310. package/lib/packages/components/touchchat/component/UploadView_api.vue.js.map +1 -0
  311. package/lib/packages/components/touchchat/component/UploadView_api.vue2.js +170 -0
  312. package/lib/packages/components/touchchat/component/UploadView_api.vue2.js.map +1 -0
  313. package/lib/packages/components/touchchat/component/VideoFile.vue.js +11 -0
  314. package/lib/packages/components/touchchat/component/VideoFile.vue.js.map +1 -0
  315. package/lib/packages/components/touchchat/component/VideoFile.vue2.js +37 -0
  316. package/lib/packages/components/touchchat/component/VideoFile.vue2.js.map +1 -0
  317. package/lib/packages/components/touchchat/component/VoiceView.vue.js +11 -0
  318. package/lib/packages/components/touchchat/component/VoiceView.vue.js.map +1 -0
  319. package/lib/packages/components/touchchat/component/VoiceView.vue2.js +169 -0
  320. package/lib/packages/components/touchchat/component/VoiceView.vue2.js.map +1 -0
  321. package/lib/packages/components/touchchat/img/file/doc.png.js +8 -0
  322. package/lib/packages/components/touchchat/img/file/doc.png.js.map +1 -0
  323. package/lib/packages/components/touchchat/img/file/docx.png.js +8 -0
  324. package/lib/packages/components/touchchat/img/file/docx.png.js.map +1 -0
  325. package/lib/packages/components/touchchat/img/file/gif.png.js +8 -0
  326. package/lib/packages/components/touchchat/img/file/gif.png.js.map +1 -0
  327. package/lib/packages/components/touchchat/img/file/html.png.js +8 -0
  328. package/lib/packages/components/touchchat/img/file/html.png.js.map +1 -0
  329. package/lib/packages/components/touchchat/img/file/jpg.png.js +8 -0
  330. package/lib/packages/components/touchchat/img/file/jpg.png.js.map +1 -0
  331. package/lib/packages/components/touchchat/img/file/mp3.png.js +8 -0
  332. package/lib/packages/components/touchchat/img/file/mp3.png.js.map +1 -0
  333. package/lib/packages/components/touchchat/img/file/mp4.png.js +8 -0
  334. package/lib/packages/components/touchchat/img/file/mp4.png.js.map +1 -0
  335. package/lib/packages/components/touchchat/img/file/music.png.js +8 -0
  336. package/lib/packages/components/touchchat/img/file/music.png.js.map +1 -0
  337. package/lib/packages/components/touchchat/img/file/pdf.png.js +8 -0
  338. package/lib/packages/components/touchchat/img/file/pdf.png.js.map +1 -0
  339. package/lib/packages/components/touchchat/img/file/png.png.js +8 -0
  340. package/lib/packages/components/touchchat/img/file/png.png.js.map +1 -0
  341. package/lib/packages/components/touchchat/img/file/ppt.png.js +8 -0
  342. package/lib/packages/components/touchchat/img/file/ppt.png.js.map +1 -0
  343. package/lib/packages/components/touchchat/img/file/pptx.png.js +8 -0
  344. package/lib/packages/components/touchchat/img/file/pptx.png.js.map +1 -0
  345. package/lib/packages/components/touchchat/img/file/txt.png.js +8 -0
  346. package/lib/packages/components/touchchat/img/file/txt.png.js.map +1 -0
  347. package/lib/packages/components/touchchat/img/file/xls.png.js +8 -0
  348. package/lib/packages/components/touchchat/img/file/xls.png.js.map +1 -0
  349. package/lib/packages/components/touchchat/img/file/xlsx.png.js +8 -0
  350. package/lib/packages/components/touchchat/img/file/xlsx.png.js.map +1 -0
  351. package/lib/packages/components/touchchat/img/svg/reset.svg.js +8 -0
  352. package/lib/packages/components/touchchat/img/svg/reset.svg.js.map +1 -0
  353. package/lib/packages/components/touchchat/index.js +6 -6
  354. package/lib/packages/components/touchchat/index.js.map +1 -1
  355. package/lib/packages/components/touchchat/src/AiChat/AgentsView.vue.js +11 -0
  356. package/lib/packages/components/touchchat/src/AiChat/AgentsView.vue.js.map +1 -0
  357. package/lib/packages/components/touchchat/src/AiChat/AgentsView.vue2.js +63 -0
  358. package/lib/packages/components/touchchat/src/AiChat/AgentsView.vue2.js.map +1 -0
  359. package/lib/packages/components/touchchat/src/AiChat/AiMessage.vue.js +3 -2
  360. package/lib/packages/components/touchchat/src/AiChat/AiMessage.vue.js.map +1 -1
  361. package/lib/packages/components/touchchat/src/AiChat/AiMessage.vue2.js +321 -138
  362. package/lib/packages/components/touchchat/src/AiChat/AiMessage.vue2.js.map +1 -1
  363. package/lib/packages/components/touchchat/src/AiChat/Chat/TouchChat.js +21 -0
  364. package/lib/packages/components/touchchat/src/AiChat/Chat/TouchChat.js.map +1 -0
  365. package/lib/packages/components/touchchat/src/AiChat/Chat/scriptMatcher.js +147 -0
  366. package/lib/packages/components/touchchat/src/AiChat/Chat/scriptMatcher.js.map +1 -0
  367. package/lib/packages/components/touchchat/src/AiChat/Chat/types.js +22 -0
  368. package/lib/packages/components/touchchat/src/AiChat/Chat/types.js.map +1 -0
  369. package/lib/packages/components/touchchat/src/AiChat/Chat/useChat.js +695 -0
  370. package/lib/packages/components/touchchat/src/AiChat/Chat/useChat.js.map +1 -0
  371. package/lib/packages/components/touchchat/src/AiChat/Chat/useCopy.js +57 -0
  372. package/lib/packages/components/touchchat/src/AiChat/Chat/useCopy.js.map +1 -0
  373. package/lib/packages/components/touchchat/src/AiChat/Chat/useMessageRender.js +157 -0
  374. package/lib/packages/components/touchchat/src/AiChat/Chat/useMessageRender.js.map +1 -0
  375. package/lib/packages/components/touchchat/src/AiChat/Chat/useSSE.js +347 -0
  376. package/lib/packages/components/touchchat/src/AiChat/Chat/useSSE.js.map +1 -0
  377. package/lib/packages/components/touchchat/src/AiChat/Chat/useScroll.js +76 -0
  378. package/lib/packages/components/touchchat/src/AiChat/Chat/useScroll.js.map +1 -0
  379. package/lib/packages/components/touchchat/src/AiChat/ChatInput.vue.js +3 -2
  380. package/lib/packages/components/touchchat/src/AiChat/ChatInput.vue.js.map +1 -1
  381. package/lib/packages/components/touchchat/src/AiChat/ChatInput.vue2.js +471 -43
  382. package/lib/packages/components/touchchat/src/AiChat/ChatInput.vue2.js.map +1 -1
  383. package/lib/packages/components/touchchat/src/AiChat/HistoryList.vue.js +3 -2
  384. package/lib/packages/components/touchchat/src/AiChat/HistoryList.vue.js.map +1 -1
  385. package/lib/packages/components/touchchat/src/AiChat/HistoryList.vue2.js +179 -97
  386. package/lib/packages/components/touchchat/src/AiChat/HistoryList.vue2.js.map +1 -1
  387. package/lib/packages/components/touchchat/src/AiChat/HistorySidebar.vue.js +3 -2
  388. package/lib/packages/components/touchchat/src/AiChat/HistorySidebar.vue.js.map +1 -1
  389. package/lib/packages/components/touchchat/src/AiChat/HistorySidebar.vue2.js +28 -11
  390. package/lib/packages/components/touchchat/src/AiChat/HistorySidebar.vue2.js.map +1 -1
  391. package/lib/packages/components/touchchat/src/AiChat/MessageActions.vue.js +3 -2
  392. package/lib/packages/components/touchchat/src/AiChat/MessageActions.vue.js.map +1 -1
  393. package/lib/packages/components/touchchat/src/AiChat/MessageActions.vue2.js +174 -61
  394. package/lib/packages/components/touchchat/src/AiChat/MessageActions.vue2.js.map +1 -1
  395. package/lib/packages/components/touchchat/src/AiChat/SiderBarView.vue.js +3 -2
  396. package/lib/packages/components/touchchat/src/AiChat/SiderBarView.vue.js.map +1 -1
  397. package/lib/packages/components/touchchat/src/AiChat/SiderBarView.vue2.js +14 -8
  398. package/lib/packages/components/touchchat/src/AiChat/SiderBarView.vue2.js.map +1 -1
  399. package/lib/packages/components/touchchat/src/AiChat/TouchAgent.vue.js +11 -0
  400. package/lib/packages/components/touchchat/src/AiChat/TouchAgent.vue.js.map +1 -0
  401. package/lib/packages/components/touchchat/src/AiChat/TouchAgent.vue2.js +1038 -0
  402. package/lib/packages/components/touchchat/src/AiChat/TouchAgent.vue2.js.map +1 -0
  403. package/lib/packages/components/touchchat/src/AiChat/TouchChat.vue.js +3 -2
  404. package/lib/packages/components/touchchat/src/AiChat/TouchChat.vue.js.map +1 -1
  405. package/lib/packages/components/touchchat/src/AiChat/TouchChat.vue2.js +275 -1003
  406. package/lib/packages/components/touchchat/src/AiChat/TouchChat.vue2.js.map +1 -1
  407. package/lib/packages/components/touchchat/src/AiChat/TouchHistory.vue.js +3 -2
  408. package/lib/packages/components/touchchat/src/AiChat/TouchHistory.vue.js.map +1 -1
  409. package/lib/packages/components/touchchat/src/AiChat/TouchHistory.vue2.js +345 -121
  410. package/lib/packages/components/touchchat/src/AiChat/TouchHistory.vue2.js.map +1 -1
  411. package/lib/packages/components/touchchat/src/AiChat/UserMessage.vue.js +3 -2
  412. package/lib/packages/components/touchchat/src/AiChat/UserMessage.vue.js.map +1 -1
  413. package/lib/packages/components/touchchat/src/AiChat/UserMessage.vue2.js +142 -63
  414. package/lib/packages/components/touchchat/src/AiChat/UserMessage.vue2.js.map +1 -1
  415. package/lib/packages/components/touchchat/src/index.vue.js +3 -2
  416. package/lib/packages/components/touchchat/src/index.vue.js.map +1 -1
  417. package/lib/packages/components/touchchat/src/index.vue2.js +251 -142
  418. package/lib/packages/components/touchchat/src/index.vue2.js.map +1 -1
  419. package/lib/packages/components/touchchat/src/types/a2a.js +13 -0
  420. package/lib/packages/components/touchchat/src/types/a2a.js.map +1 -0
  421. package/lib/packages/components/touchchat/utils/a2aService.js +319 -0
  422. package/lib/packages/components/touchchat/utils/a2aService.js.map +1 -0
  423. package/lib/packages/components/touchchat/utils/fetchStream.js +8 -2
  424. package/lib/packages/components/touchchat/utils/fetchStream.js.map +1 -1
  425. package/lib/packages/components/touchchat/utils/markdown.js +31 -13
  426. package/lib/packages/components/touchchat/utils/markdown.js.map +1 -1
  427. package/lib/packages/utils/config.js.map +1 -1
  428. package/lib/packages/utils/types.js.map +1 -1
  429. package/package.json +83 -83
  430. package/theme/components/index.css +969 -43
  431. package/theme/font/iconfont.woff +0 -0
  432. package/theme/font/iconfont.woff2 +0 -0
  433. package/theme/index.css +969 -43
  434. package/theme/skin/default.css +969 -43
  435. package/types/global.d.ts +2 -2
  436. package/es/packages/components/touchchat/src/AiChat/Scene.vue.mjs +0 -6
  437. package/es/packages/components/touchchat/src/AiChat/Scene.vue.mjs.map +0 -1
  438. package/es/packages/components/touchchat/src/AiChat/Scene.vue2.mjs +0 -42
  439. package/es/packages/components/touchchat/src/AiChat/Scene.vue2.mjs.map +0 -1
  440. package/lib/packages/components/touchchat/src/AiChat/Scene.vue.js +0 -10
  441. package/lib/packages/components/touchchat/src/AiChat/Scene.vue.js.map +0 -1
  442. package/lib/packages/components/touchchat/src/AiChat/Scene.vue2.js +0 -46
  443. package/lib/packages/components/touchchat/src/AiChat/Scene.vue2.js.map +0 -1
@@ -0,0 +1,695 @@
1
+ 'use strict';
2
+
3
+ var vue = require('vue');
4
+ var types = require('./types.js');
5
+ var scriptMatcher = require('./scriptMatcher.js');
6
+ var useSSE = require('./useSSE.js');
7
+ var useScroll = require('./useScroll.js');
8
+ var useMessageRender = require('./useMessageRender.js');
9
+ var useCopy = require('./useCopy.js');
10
+
11
+ function useChat({ props, emit, scripts, unmatchText, modules, afterSend, sendMessageInject, beforeSend, bottom, stop, chatContainer, chatInputRef }) {
12
+ const isMounted = vue.ref(false);
13
+ const isChating = vue.ref(false);
14
+ const inputValue = vue.ref("");
15
+ const enableDeepThinking = vue.ref(false);
16
+ const chatList = vue.ref([]);
17
+ const currIndex = vue.ref(0);
18
+ const isUnmounting = vue.ref(false);
19
+ const currentComponentName = vue.ref("");
20
+ const fileData = vue.ref([]);
21
+ const activeAgentsName = vue.ref("");
22
+ const moduleInfo = vue.ref(modules[0] || { name: "deepseek-v3" });
23
+ const isDragging = vue.ref(false);
24
+ const typeFlag = vue.ref("");
25
+ const currentMessageProcessor = vue.ref(null);
26
+ const { htmlContentRef, thinkingContentRef, reasoningContentRef, markdownToHtml, renderContent, enqueueRender } = useMessageRender.useMessageRender({
27
+ chatList,
28
+ currIndex,
29
+ isMounted,
30
+ isUnmounting
31
+ });
32
+ const { scrollToBottom, handleScroll } = useScroll.useScroll({
33
+ chatContainer,
34
+ isMounted,
35
+ isUnmounting,
36
+ bottom
37
+ });
38
+ const { copyToClipboard } = useCopy.useCopy();
39
+ const scriptsRef = vue.ref(scripts);
40
+ const { activeScript, findMatchingScriptContent } = scriptMatcher.createScriptMatcher({
41
+ scripts: scriptsRef,
42
+ activeAgentsName,
43
+ fileData,
44
+ unmatchText
45
+ });
46
+ const { fetchStream, resultItem, openSSE, cleanupSSE } = useSSE.useSSE({
47
+ chatList,
48
+ currIndex,
49
+ isChating,
50
+ isMounted,
51
+ isUnmounting,
52
+ inputValue,
53
+ enableDeepThinking,
54
+ currentComponentName,
55
+ typeFlag,
56
+ moduleInfo,
57
+ emit,
58
+ fileData,
59
+ afterSend,
60
+ enqueueRender,
61
+ renderContent,
62
+ markdownToHtml,
63
+ scrollToBottom,
64
+ stop
65
+ });
66
+ vue.watch(
67
+ () => activeAgentsName,
68
+ (val) => {
69
+ if (!val) {
70
+ activeAgentsName.value = localStorage.getItem("activeAgentsName");
71
+ }
72
+ },
73
+ { immediate: true }
74
+ );
75
+ const messageUtils = {
76
+ updateMessage: (index, updates) => {
77
+ if (index < 0 || index >= chatList.value.length)
78
+ return;
79
+ chatList.value.splice(index, 1, { ...chatList.value[index], ...updates });
80
+ vue.nextTick(() => {
81
+ const message = chatList.value[index];
82
+ if (message) {
83
+ renderContent(message.content, "main", index);
84
+ if (message.thinkContent) {
85
+ renderContent(message.thinkContent, "thinking", index);
86
+ }
87
+ if (message.reasoningContent) {
88
+ renderContent(message.reasoningContent, "reasoning", index);
89
+ }
90
+ }
91
+ });
92
+ },
93
+ deleteMessageChain: (index) => {
94
+ if (index < 0 || index >= chatList.value.length)
95
+ return;
96
+ if (chatList.value[index].user === "u") {
97
+ let deleteCount = 1;
98
+ for (let i = index + 1; i < chatList.value.length; i++) {
99
+ if (chatList.value[i].user === "ai") {
100
+ deleteCount++;
101
+ } else {
102
+ break;
103
+ }
104
+ }
105
+ chatList.value.splice(index, deleteCount);
106
+ } else {
107
+ chatList.value.splice(index, 1);
108
+ }
109
+ },
110
+ createStandardMessage: (data) => {
111
+ var _a, _b, _c, _d, _e;
112
+ return {
113
+ chatId: data.chatId || "ai_" + Math.random().toString(36).slice(2).padEnd(10, "0").slice(0, 10),
114
+ user: data.user || "ai",
115
+ type: data.type || "text",
116
+ content: data.content || "",
117
+ isChating: (_a = data.isChating) != null ? _a : false,
118
+ thinkContent: data.thinkContent || "",
119
+ reasoningContent: data.reasoningContent || "",
120
+ isLiked: (_b = data.isLiked) != null ? _b : false,
121
+ isDisliked: (_c = data.isDisliked) != null ? _c : false,
122
+ isEditing: (_d = data.isEditing) != null ? _d : false,
123
+ editContent: (_e = data.editContent) != null ? _e : "",
124
+ msgList: []
125
+ };
126
+ }
127
+ };
128
+ const update = (index, message) => {
129
+ chatList.value[index] = { ...chatList.value[index], ...message };
130
+ };
131
+ const updateModule = (info) => {
132
+ moduleInfo.value = info;
133
+ };
134
+ const handleAgentSelect = (item) => {
135
+ localStorage.setItem("activeAgentsName", item.name);
136
+ const aiMessage = item.intro;
137
+ messageUtils.updateMessage(0, {
138
+ content: "",
139
+ isChating: false
140
+ });
141
+ simulateStreamOutput(0, aiMessage);
142
+ };
143
+ const completeRendered = (chatId) => {
144
+ if (currentMessageProcessor.value) {
145
+ currentMessageProcessor.value.handleMessageComplete(chatId);
146
+ }
147
+ };
148
+ const init = () => {
149
+ try {
150
+ if (Array.isArray(props.value) && props.value.length && !scripts.length) {
151
+ chatList.value = props.value.map((item) => ({
152
+ ...item,
153
+ content: item.thinkContent ? item.content || "" : item.content || "",
154
+ thinkContent: item.thinkContent || ""
155
+ }));
156
+ vue.nextTick(() => {
157
+ requestAnimationFrame(() => {
158
+ if (activeAgentsName.value && chatList.value.length > 0 && chatList.value[0].user === "ai") {
159
+ const aiMessage = chatList.value[0];
160
+ messageUtils.updateMessage(0, {
161
+ content: "",
162
+ isChating: true
163
+ });
164
+ simulateStreamOutput(0, aiMessage.content);
165
+ } else {
166
+ chatList.value.forEach((item) => {
167
+ if (item.thinkContent) {
168
+ renderContent(item.thinkContent, "thinking");
169
+ }
170
+ if (item.reasoningContent) {
171
+ renderContent(item.reasoningContent, "reasoning");
172
+ }
173
+ if (item.content) {
174
+ renderContent(item.content, "main");
175
+ }
176
+ });
177
+ vue.nextTick(() => {
178
+ scrollToBottom();
179
+ });
180
+ }
181
+ });
182
+ });
183
+ }
184
+ } catch (error) {
185
+ }
186
+ };
187
+ const simulateStreamOutput = (aiIndex, msg, callback) => {
188
+ const message = typeof msg === "string" ? msg : msg.content;
189
+ const componentName = typeof msg === "string" ? "" : msg.needSequenceProcessing ? msg.needSequenceType : "";
190
+ const isNeedSequenceProcessing = typeof msg === "string" ? false : msg.needSequenceProcessing;
191
+ const fn = () => {
192
+ clearInterval(interval);
193
+ emit("sendMessage", [...chatList.value]);
194
+ if (componentName) {
195
+ chatList.value[aiIndex].componentName = componentName;
196
+ }
197
+ messageUtils.updateMessage(aiIndex, {
198
+ isChating: false
199
+ });
200
+ vue.nextTick(() => {
201
+ renderContent(message, "main", aiIndex);
202
+ vue.nextTick(() => {
203
+ scrollToBottom();
204
+ if (!isNeedSequenceProcessing && callback) {
205
+ callback();
206
+ }
207
+ });
208
+ });
209
+ };
210
+ let index = 0;
211
+ const interval = setInterval(() => {
212
+ if (index < message.length) {
213
+ const newContent = message;
214
+ messageUtils.updateMessage(aiIndex, {
215
+ content: newContent
216
+ });
217
+ vue.nextTick(() => {
218
+ renderContent(newContent, "main", aiIndex);
219
+ vue.nextTick(() => {
220
+ scrollToBottom();
221
+ });
222
+ });
223
+ index++;
224
+ } else {
225
+ fn();
226
+ }
227
+ }, 50);
228
+ };
229
+ vue.watch(
230
+ () => props.value,
231
+ (newVal, oldVal) => {
232
+ if (!Array.isArray(newVal))
233
+ return;
234
+ if (newVal.length && JSON.stringify(newVal) !== JSON.stringify(oldVal)) {
235
+ chatList.value = newVal.map((item) => ({
236
+ ...item,
237
+ content: item.thinkContent ? item.content || "" : item.content || "",
238
+ thinkContent: item.thinkContent || ""
239
+ }));
240
+ vue.nextTick(() => {
241
+ requestAnimationFrame(() => {
242
+ chatList.value.forEach((item) => {
243
+ if (item.thinkContent) {
244
+ renderContent(item.thinkContent, "thinking");
245
+ }
246
+ if (item.reasoningContent) {
247
+ renderContent(item.reasoningContent, "reasoning");
248
+ }
249
+ if (item.content) {
250
+ renderContent(item.content, "main");
251
+ }
252
+ });
253
+ vue.nextTick(() => {
254
+ scrollToBottom();
255
+ });
256
+ });
257
+ });
258
+ }
259
+ },
260
+ { deep: true, immediate: true }
261
+ );
262
+ const sendMessage = (content, fileList, auto, type) => {
263
+ inputValue.value = content || "";
264
+ handleBeforeSend(content, fileList, auto, type);
265
+ };
266
+ const handleBeforeSend = (content, fileList, auto, type) => {
267
+ fileData.value = fileList || [];
268
+ if (beforeSend) {
269
+ const fn = beforeSend();
270
+ if (fn && typeof fn.then === "function") {
271
+ Promise.resolve(fn).then((res) => {
272
+ if (res.result) {
273
+ currentComponentName.value = res.componentName || "";
274
+ handleSend(content, fileList, auto, type);
275
+ }
276
+ }).catch((error) => {
277
+ console.log(error);
278
+ });
279
+ } else {
280
+ if (fn.result) {
281
+ currentComponentName.value = fn.componentName || "";
282
+ handleSend(content, fileList, auto, type);
283
+ }
284
+ }
285
+ }
286
+ };
287
+ const handleSend = (content, fileList, auto, type) => {
288
+ emit("beforeSendMessage");
289
+ sendMessageInject(inputValue.value, fileData.value);
290
+ typeFlag.value = type || "";
291
+ if (scripts && Array.isArray(scripts) && scripts.length > 0) {
292
+ const userInput = content ? content.replace(/\n/g, "") : inputValue.value.replace(/\n/g, "").trim();
293
+ if (!userInput && !(fileList == null ? void 0 : fileList.length) && auto)
294
+ return;
295
+ const userChatId = `user_${Date.now()}`;
296
+ const userMessage = {
297
+ chatId: userChatId,
298
+ user: "u",
299
+ type: "text",
300
+ content: userInput,
301
+ isShowLike: false,
302
+ isShowCopy: true,
303
+ isWithDraw: false,
304
+ isRead: false,
305
+ files: fileList || [],
306
+ typeFlag: type,
307
+ auto: auto || false,
308
+ msgList: [],
309
+ selecting: false
310
+ };
311
+ chatList.value.push(userMessage);
312
+ emit("sendMessage", [...chatList.value]);
313
+ vue.nextTick(() => {
314
+ renderContent(userMessage.content, "main", chatList.value.length - 1);
315
+ vue.nextTick(() => {
316
+ scrollToBottom();
317
+ });
318
+ });
319
+ const result = findMatchingScriptContent(userInput);
320
+ if (result && result.responses.length > 0) {
321
+ const newAiMessages = [];
322
+ result.responses.forEach((response, idx) => {
323
+ const pauseMarker = Array.isArray(response.data) ? "\u200B".repeat(20) : "";
324
+ const content2 = Array.isArray(response.data) ? response.data.join(pauseMarker) : response.data;
325
+ const aiChatId = `ai_${Date.now()}_${idx}`;
326
+ const aiMessage = {
327
+ chatId: aiChatId,
328
+ user: "ai",
329
+ type: "text",
330
+ content: content2 || "",
331
+ componentName: response.type || "",
332
+ isShowLike: true,
333
+ isShowCopy: true,
334
+ needSequenceType: response.type || "",
335
+ needSequenceProcessing: response.needSequenceProcessing || false,
336
+ typeFlag: type,
337
+ msgList: [],
338
+ likeList: response.likeList
339
+ };
340
+ newAiMessages.push(aiMessage);
341
+ });
342
+ const messageQueue = [...newAiMessages];
343
+ let isProcessing = false;
344
+ let currentMessage = null;
345
+ const processNextMessage = () => {
346
+ if (messageQueue.length > 0 && !isProcessing) {
347
+ isProcessing = true;
348
+ const nextMessage = messageQueue.shift();
349
+ if (nextMessage) {
350
+ currentMessage = nextMessage;
351
+ chatList.value.push(currentMessage);
352
+ emit("sendMessage", [...chatList.value]);
353
+ const msgIndex = chatList.value.length - 1;
354
+ vue.nextTick(() => {
355
+ renderContent((currentMessage == null ? void 0 : currentMessage.content) || "", "main", msgIndex);
356
+ vue.nextTick(() => {
357
+ scrollToBottom();
358
+ if (currentMessage) {
359
+ const messageToProcess = {
360
+ ...currentMessage,
361
+ needSequenceProcessing: true
362
+ };
363
+ simulateStreamOutput(msgIndex, messageToProcess);
364
+ }
365
+ });
366
+ });
367
+ }
368
+ }
369
+ };
370
+ const handleMessageComplete = (chatId) => {
371
+ if (currentMessage && currentMessage.chatId === chatId) {
372
+ currentMessage = null;
373
+ isProcessing = false;
374
+ processNextMessage();
375
+ }
376
+ };
377
+ const processorObj = {
378
+ messageQueue,
379
+ isProcessing,
380
+ currentMessage,
381
+ processNextMessage,
382
+ handleMessageComplete
383
+ };
384
+ currentMessageProcessor.value = processorObj;
385
+ processNextMessage();
386
+ } else {
387
+ const defaultAiChatId = `ai_${Date.now()}`;
388
+ const defaultAiMessage = {
389
+ chatId: defaultAiChatId,
390
+ user: "ai",
391
+ type: "text",
392
+ content: unmatchText,
393
+ isShowLike: true,
394
+ isShowCopy: true,
395
+ msgList: []
396
+ };
397
+ chatList.value.push(defaultAiMessage);
398
+ emit("sendMessage", [...chatList.value]);
399
+ vue.nextTick(() => {
400
+ const msgIndex = chatList.value.findIndex((item) => item.chatId === defaultAiChatId);
401
+ if (msgIndex !== -1) {
402
+ renderContent(defaultAiMessage.content, "main", msgIndex);
403
+ vue.nextTick(() => {
404
+ scrollToBottom();
405
+ });
406
+ }
407
+ });
408
+ }
409
+ inputValue.value = "";
410
+ } else {
411
+ console.log("content === useChat === 488", content);
412
+ if (content) {
413
+ inputValue.value = content;
414
+ }
415
+ if ((isChating.value || !inputValue.value.trim() && !(fileList == null ? void 0 : fileList.length)) && !auto)
416
+ return;
417
+ const userChatId = "user_" + Math.random().toString(36).slice(2).padEnd(10, "0").slice(0, 10);
418
+ const userMessage = {
419
+ chatId: userChatId,
420
+ user: "u",
421
+ type: "text",
422
+ content: inputValue.value,
423
+ files: fileList || [],
424
+ msgList: [],
425
+ isRead: false
426
+ };
427
+ chatList.value.push(userMessage);
428
+ const index = chatList.value.length - 1;
429
+ vue.nextTick(() => {
430
+ renderContent(userMessage.content, "main", index);
431
+ scrollToBottom();
432
+ });
433
+ console.log("openSSE === useChat === 511");
434
+ openSSE(inputValue.value, index + 1);
435
+ inputValue.value = "";
436
+ }
437
+ };
438
+ const handleStop = () => {
439
+ var _a;
440
+ cleanupSSE();
441
+ const aiIndex = chatList.value.findIndex((item) => item.isChating);
442
+ if (aiIndex !== -1) {
443
+ const currentAiMessage = chatList.value[aiIndex];
444
+ if ((_a = currentAiMessage.content) == null ? void 0 : _a.trim()) {
445
+ vue.nextTick(() => {
446
+ chatList.value[aiIndex] = {
447
+ ...currentAiMessage,
448
+ content: currentAiMessage.content + "...",
449
+ isChating: false
450
+ };
451
+ renderContent(chatList.value[aiIndex].content, "main", aiIndex);
452
+ emit("sendMessage", chatList.value);
453
+ });
454
+ } else {
455
+ if (aiIndex > 0) {
456
+ const userMessageIndex = aiIndex - 1;
457
+ if (chatList.value[userMessageIndex].user === "u") {
458
+ chatList.value.splice(userMessageIndex, 2);
459
+ } else {
460
+ chatList.value.splice(aiIndex, 1);
461
+ }
462
+ } else {
463
+ chatList.value.splice(aiIndex, 1);
464
+ }
465
+ }
466
+ } else {
467
+ const lastIndex = chatList.value.length - 1;
468
+ if (lastIndex >= 0 && chatList.value[lastIndex].user === "u") {
469
+ chatList.value.pop();
470
+ }
471
+ }
472
+ isChating.value = false;
473
+ };
474
+ const handleMessageAction = (action, index) => {
475
+ const message = chatList.value[index];
476
+ if (!message)
477
+ return;
478
+ switch (action) {
479
+ case types.MessageAction.COPY: {
480
+ copyToClipboard(message.content, "\u590D\u5236\u6210\u529F", "\u590D\u5236\u5931\u8D25");
481
+ break;
482
+ }
483
+ case types.MessageAction.EDIT:
484
+ message.isEditing = true;
485
+ message.editContent = message.content;
486
+ break;
487
+ case types.MessageAction.DELETE:
488
+ messageUtils.deleteMessageChain(index);
489
+ emit("sendMessage", chatList.value);
490
+ break;
491
+ case types.MessageAction.RETRY: {
492
+ const aiMessage = chatList.value[index];
493
+ const userMessageIndex = index - 1;
494
+ const userMessage = chatList.value[userMessageIndex];
495
+ if (userMessage && userMessage.user === "u") {
496
+ const updatedAiMessage = {
497
+ ...aiMessage,
498
+ content: "",
499
+ thinkContent: "",
500
+ reasoningContent: "",
501
+ isLiked: false,
502
+ isDisliked: false,
503
+ isChating: true,
504
+ isRead: false,
505
+ chatId: aiMessage.chatId,
506
+ user: aiMessage.user,
507
+ type: aiMessage.type,
508
+ thinkStatus: types.ThinkStatus.COMPLETED,
509
+ thinkStartTime: 0,
510
+ thinkEndTime: 0
511
+ };
512
+ chatList.value.splice(index, 1, updatedAiMessage);
513
+ vue.nextTick(() => {
514
+ if (htmlContentRef.value[index])
515
+ htmlContentRef.value[index].innerHTML = "";
516
+ if (thinkingContentRef.value[index])
517
+ thinkingContentRef.value[index].innerHTML = "";
518
+ if (reasoningContentRef.value[index])
519
+ reasoningContentRef.value[index].innerHTML = "";
520
+ setTimeout(() => {
521
+ openSSE(userMessage.content || "", index);
522
+ }, 50);
523
+ });
524
+ }
525
+ break;
526
+ }
527
+ case types.MessageAction.LIKE:
528
+ messageUtils.updateMessage(index, {
529
+ isLiked: true,
530
+ isDisliked: false
531
+ });
532
+ break;
533
+ case types.MessageAction.DISLIKE:
534
+ messageUtils.updateMessage(index, {
535
+ isLiked: false,
536
+ isDisliked: true
537
+ });
538
+ break;
539
+ case types.MessageAction.WITHDRAW:
540
+ console.log("withDraw");
541
+ messageUtils.updateMessage(index, {
542
+ isWithDraw: true,
543
+ user: "withDraw"
544
+ });
545
+ break;
546
+ }
547
+ };
548
+ const saveEdit = (index, newContent) => {
549
+ const message = chatList.value[index];
550
+ if (!message || !message.editContent)
551
+ return;
552
+ chatList.value[index] = {
553
+ ...message,
554
+ content: newContent,
555
+ isEditing: false,
556
+ editContent: void 0
557
+ };
558
+ vue.nextTick(() => {
559
+ renderContent(newContent, "main", index);
560
+ });
561
+ const hasDeletedAi = index + 1 < chatList.value.length && chatList.value[index + 1].user === "ai";
562
+ if (hasDeletedAi) {
563
+ chatList.value.splice(index + 1, 1);
564
+ }
565
+ const insertPosition = index + 1;
566
+ vue.nextTick(() => {
567
+ openSSE(newContent, insertPosition);
568
+ });
569
+ emit("sendMessage", chatList.value);
570
+ };
571
+ const cancelEdit = (index) => {
572
+ const message = chatList.value[index];
573
+ if (!message)
574
+ return;
575
+ message.isEditing = false;
576
+ message.editContent = "";
577
+ vue.nextTick(() => {
578
+ renderContent(message.content, "main", index);
579
+ });
580
+ };
581
+ const handleDragEnter = () => {
582
+ isDragging.value = true;
583
+ if (chatInputRef == null ? void 0 : chatInputRef.value) {
584
+ chatInputRef.value.openMarkLayer();
585
+ }
586
+ };
587
+ const handleDragLeave = (e) => {
588
+ const rect = e.target.getBoundingClientRect();
589
+ if (e.clientX < rect.left || e.clientX > rect.right || e.clientY < rect.top || e.clientY > rect.bottom) {
590
+ isDragging.value = false;
591
+ }
592
+ };
593
+ const handleDrop = async (e) => {
594
+ var _a;
595
+ isDragging.value = false;
596
+ const files = (_a = e.dataTransfer) == null ? void 0 : _a.files;
597
+ if (files && files.length > 0) {
598
+ const fileList = await Promise.all(
599
+ Array.from(files).map(async (file) => {
600
+ let base64 = "";
601
+ if (file.type.startsWith("image/")) {
602
+ base64 = await new Promise((resolve) => {
603
+ const reader = new FileReader();
604
+ reader.onload = (e2) => {
605
+ var _a2;
606
+ resolve((_a2 = e2.target) == null ? void 0 : _a2.result);
607
+ };
608
+ reader.readAsDataURL(file);
609
+ });
610
+ }
611
+ return {
612
+ id: Math.random().toString(36).slice(2).padEnd(10, "0").slice(0, 10),
613
+ file,
614
+ name: file.name,
615
+ fileType: file.type,
616
+ fileSize: file.size,
617
+ lastModified: file.lastModified,
618
+ preview: URL.createObjectURL(file),
619
+ base64
620
+ };
621
+ })
622
+ );
623
+ if (chatInputRef == null ? void 0 : chatInputRef.value) {
624
+ chatInputRef.value.handlePaste(fileList, "drop");
625
+ }
626
+ }
627
+ if (chatInputRef == null ? void 0 : chatInputRef.value) {
628
+ chatInputRef.value.colseMarkLayer();
629
+ }
630
+ };
631
+ const onMounted = () => {
632
+ if (!isMounted.value) {
633
+ init();
634
+ }
635
+ isMounted.value = true;
636
+ };
637
+ const onBeforeUnmount = () => {
638
+ if (!isUnmounting.value) {
639
+ isUnmounting.value = true;
640
+ cleanupSSE();
641
+ isMounted.value = false;
642
+ }
643
+ };
644
+ return {
645
+ // 状态
646
+ chatList,
647
+ isChating,
648
+ inputValue,
649
+ enableDeepThinking,
650
+ isMounted,
651
+ isUnmounting,
652
+ currentComponentName,
653
+ fileData,
654
+ activeAgentsName,
655
+ moduleInfo,
656
+ isDragging,
657
+ typeFlag,
658
+ currIndex,
659
+ fetchStream,
660
+ resultItem,
661
+ currentMessageProcessor,
662
+ activeScript,
663
+ htmlContentRef,
664
+ thinkingContentRef,
665
+ reasoningContentRef,
666
+ // 方法
667
+ init,
668
+ sendMessage,
669
+ handleBeforeSend,
670
+ handleSend,
671
+ handleStop,
672
+ handleMessageAction,
673
+ saveEdit,
674
+ cancelEdit,
675
+ completeRendered,
676
+ handleAgentSelect,
677
+ update,
678
+ updateModule,
679
+ messageUtils,
680
+ simulateStreamOutput,
681
+ handleDragEnter,
682
+ handleDragLeave,
683
+ handleDrop,
684
+ onMounted,
685
+ onBeforeUnmount,
686
+ cleanupSSE,
687
+ scrollToBottom,
688
+ handleScroll,
689
+ renderContent,
690
+ enqueueRender
691
+ };
692
+ }
693
+
694
+ exports.useChat = useChat;
695
+ //# sourceMappingURL=useChat.js.map