@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.
- package/README.md +25 -25
- package/es/_virtual/_plugin-vue_export-helper.mjs +10 -0
- package/es/_virtual/_plugin-vue_export-helper.mjs.map +1 -0
- package/es/index.mjs.map +1 -1
- package/es/node_modules/.pnpm/@touchvue_a2ui@1.0.0-beta.46/node_modules/@touchvue/a2ui/dist/index.mjs +4816 -0
- package/es/node_modules/.pnpm/@touchvue_a2ui@1.0.0-beta.46/node_modules/@touchvue/a2ui/dist/index.mjs.map +1 -0
- package/es/node_modules/.pnpm/dompurify@3.3.0/node_modules/dompurify/dist/purify.es.mjs +1380 -0
- package/es/node_modules/.pnpm/dompurify@3.3.0/node_modules/dompurify/dist/purify.es.mjs.map +1 -0
- package/es/node_modules/.pnpm/html2canvas@1.4.1/node_modules/html2canvas/dist/html2canvas.esm.mjs +7824 -0
- package/es/node_modules/.pnpm/html2canvas@1.4.1/node_modules/html2canvas/dist/html2canvas.esm.mjs.map +1 -0
- package/es/package.json.css +1 -1
- package/es/package.json.mjs +2 -2
- package/es/packages/components/index.mjs +1 -1
- package/es/packages/components/resolver.mjs.map +1 -1
- package/es/packages/components/touchchat/component/AiRobot/HelloChat.vue.mjs +3 -2
- package/es/packages/components/touchchat/component/AiRobot/HelloChat.vue.mjs.map +1 -1
- package/es/packages/components/touchchat/component/AiRobot/HelloChat.vue2.mjs +219 -159
- package/es/packages/components/touchchat/component/AiRobot/HelloChat.vue2.mjs.map +1 -1
- package/es/packages/components/touchchat/component/AiRobot/face.vue.mjs +3 -2
- package/es/packages/components/touchchat/component/AiRobot/face.vue.mjs.map +1 -1
- package/es/packages/components/touchchat/component/AiRobot/face.vue2.mjs +27 -13
- package/es/packages/components/touchchat/component/AiRobot/face.vue2.mjs.map +1 -1
- package/es/packages/components/touchchat/component/AiRobot/letter.vue.mjs +3 -2
- package/es/packages/components/touchchat/component/AiRobot/letter.vue.mjs.map +1 -1
- package/es/packages/components/touchchat/component/AiRobot/letter.vue2.mjs +182 -41
- package/es/packages/components/touchchat/component/AiRobot/letter.vue2.mjs.map +1 -1
- package/es/packages/components/touchchat/component/AiRobot/meterialPrepare.vue.mjs +3 -2
- package/es/packages/components/touchchat/component/AiRobot/meterialPrepare.vue.mjs.map +1 -1
- package/es/packages/components/touchchat/component/AiRobot/meterialPrepare.vue2.mjs +15 -10
- package/es/packages/components/touchchat/component/AiRobot/meterialPrepare.vue2.mjs.map +1 -1
- package/es/packages/components/touchchat/component/AiRobot/start.vue.mjs +3 -2
- package/es/packages/components/touchchat/component/AiRobot/start.vue.mjs.map +1 -1
- package/es/packages/components/touchchat/component/AiRobot/start.vue2.mjs +18 -11
- package/es/packages/components/touchchat/component/AiRobot/start.vue2.mjs.map +1 -1
- package/es/packages/components/touchchat/component/CardView.vue.mjs +3 -2
- package/es/packages/components/touchchat/component/CardView.vue.mjs.map +1 -1
- package/es/packages/components/touchchat/component/CardView.vue2.mjs +66 -42
- package/es/packages/components/touchchat/component/CardView.vue2.mjs.map +1 -1
- package/es/packages/components/touchchat/component/FileContent.vue.mjs +7 -0
- package/es/packages/components/touchchat/component/FileContent.vue.mjs.map +1 -0
- package/es/packages/components/touchchat/component/FileContent.vue2.mjs +206 -0
- package/es/packages/components/touchchat/component/FileContent.vue2.mjs.map +1 -0
- package/es/packages/components/touchchat/component/FileView.vue.mjs +3 -2
- package/es/packages/components/touchchat/component/FileView.vue.mjs.map +1 -1
- package/es/packages/components/touchchat/component/FileView.vue2.mjs +17 -4
- package/es/packages/components/touchchat/component/FileView.vue2.mjs.map +1 -1
- package/es/packages/components/touchchat/component/HelloChat.vue.mjs +3 -2
- package/es/packages/components/touchchat/component/HelloChat.vue.mjs.map +1 -1
- package/es/packages/components/touchchat/component/HelloChat.vue2.mjs +26 -14
- package/es/packages/components/touchchat/component/HelloChat.vue2.mjs.map +1 -1
- package/es/packages/components/touchchat/component/ImageFile.vue.mjs +7 -0
- package/es/packages/components/touchchat/component/ImageFile.vue.mjs.map +1 -0
- package/es/packages/components/touchchat/component/ImageFile.vue2.mjs +162 -0
- package/es/packages/components/touchchat/component/ImageFile.vue2.mjs.map +1 -0
- package/es/packages/components/touchchat/component/ImageView.vue.mjs +3 -2
- package/es/packages/components/touchchat/component/ImageView.vue.mjs.map +1 -1
- package/es/packages/components/touchchat/component/ImageView.vue2.mjs +1 -1
- package/es/packages/components/touchchat/component/ImageView.vue2.mjs.map +1 -1
- package/es/packages/components/touchchat/component/LinkView.vue.mjs +3 -2
- package/es/packages/components/touchchat/component/LinkView.vue.mjs.map +1 -1
- package/es/packages/components/touchchat/component/LinkView.vue2.mjs +19 -5
- package/es/packages/components/touchchat/component/LinkView.vue2.mjs.map +1 -1
- package/es/packages/components/touchchat/component/MarkLayer.vue.mjs +7 -0
- package/es/packages/components/touchchat/component/MarkLayer.vue.mjs.map +1 -0
- package/es/packages/components/touchchat/component/MarkLayer.vue2.mjs +56 -0
- package/es/packages/components/touchchat/component/MarkLayer.vue2.mjs.map +1 -0
- package/es/packages/components/touchchat/component/ModuleSelect.vue.mjs +7 -0
- package/es/packages/components/touchchat/component/ModuleSelect.vue.mjs.map +1 -0
- package/es/packages/components/touchchat/component/ModuleSelect.vue2.mjs +121 -0
- package/es/packages/components/touchchat/component/ModuleSelect.vue2.mjs.map +1 -0
- package/es/packages/components/touchchat/component/PDFFile.vue.mjs +7 -0
- package/es/packages/components/touchchat/component/PDFFile.vue.mjs.map +1 -0
- package/es/packages/components/touchchat/component/PDFFile.vue2.mjs +211 -0
- package/es/packages/components/touchchat/component/PDFFile.vue2.mjs.map +1 -0
- package/es/packages/components/touchchat/component/QuoteContent.vue.mjs +7 -0
- package/es/packages/components/touchchat/component/QuoteContent.vue.mjs.map +1 -0
- package/es/packages/components/touchchat/component/QuoteContent.vue2.mjs +40 -0
- package/es/packages/components/touchchat/component/QuoteContent.vue2.mjs.map +1 -0
- package/es/packages/components/touchchat/component/RealtimeVoice.vue.mjs +7 -0
- package/es/packages/components/touchchat/component/RealtimeVoice.vue.mjs.map +1 -0
- package/es/packages/components/touchchat/component/RealtimeVoice.vue2.mjs +160 -0
- package/es/packages/components/touchchat/component/RealtimeVoice.vue2.mjs.map +1 -0
- package/es/packages/components/touchchat/component/Screenshot.vue.mjs +7 -0
- package/es/packages/components/touchchat/component/Screenshot.vue.mjs.map +1 -0
- package/es/packages/components/touchchat/component/Screenshot.vue2.mjs +208 -0
- package/es/packages/components/touchchat/component/Screenshot.vue2.mjs.map +1 -0
- package/es/packages/components/touchchat/component/ThoughtChain.vue.mjs +7 -0
- package/es/packages/components/touchchat/component/ThoughtChain.vue.mjs.map +1 -0
- package/es/packages/components/touchchat/component/ThoughtChain.vue2.mjs +69 -0
- package/es/packages/components/touchchat/component/ThoughtChain.vue2.mjs.map +1 -0
- package/es/packages/components/touchchat/component/UploadView.vue.mjs +7 -0
- package/es/packages/components/touchchat/component/UploadView.vue.mjs.map +1 -0
- package/es/packages/components/touchchat/component/UploadView.vue2.mjs +186 -0
- package/es/packages/components/touchchat/component/UploadView.vue2.mjs.map +1 -0
- package/es/packages/components/touchchat/component/UploadView_api.vue.mjs +7 -0
- package/es/packages/components/touchchat/component/UploadView_api.vue.mjs.map +1 -0
- package/es/packages/components/touchchat/component/UploadView_api.vue2.mjs +166 -0
- package/es/packages/components/touchchat/component/UploadView_api.vue2.mjs.map +1 -0
- package/es/packages/components/touchchat/component/VideoFile.vue.mjs +7 -0
- package/es/packages/components/touchchat/component/VideoFile.vue.mjs.map +1 -0
- package/es/packages/components/touchchat/component/VideoFile.vue2.mjs +33 -0
- package/es/packages/components/touchchat/component/VideoFile.vue2.mjs.map +1 -0
- package/es/packages/components/touchchat/component/VoiceView.vue.mjs +7 -0
- package/es/packages/components/touchchat/component/VoiceView.vue.mjs.map +1 -0
- package/es/packages/components/touchchat/component/VoiceView.vue2.mjs +165 -0
- package/es/packages/components/touchchat/component/VoiceView.vue2.mjs.map +1 -0
- package/es/packages/components/touchchat/img/file/doc.png.mjs +4 -0
- package/es/packages/components/touchchat/img/file/doc.png.mjs.map +1 -0
- package/es/packages/components/touchchat/img/file/docx.png.mjs +4 -0
- package/es/packages/components/touchchat/img/file/docx.png.mjs.map +1 -0
- package/es/packages/components/touchchat/img/file/gif.png.mjs +4 -0
- package/es/packages/components/touchchat/img/file/gif.png.mjs.map +1 -0
- package/es/packages/components/touchchat/img/file/html.png.mjs +4 -0
- package/es/packages/components/touchchat/img/file/html.png.mjs.map +1 -0
- package/es/packages/components/touchchat/img/file/jpg.png.mjs +4 -0
- package/es/packages/components/touchchat/img/file/jpg.png.mjs.map +1 -0
- package/es/packages/components/touchchat/img/file/mp3.png.mjs +4 -0
- package/es/packages/components/touchchat/img/file/mp3.png.mjs.map +1 -0
- package/es/packages/components/touchchat/img/file/mp4.png.mjs +4 -0
- package/es/packages/components/touchchat/img/file/mp4.png.mjs.map +1 -0
- package/es/packages/components/touchchat/img/file/music.png.mjs +4 -0
- package/es/packages/components/touchchat/img/file/music.png.mjs.map +1 -0
- package/es/packages/components/touchchat/img/file/pdf.png.mjs +4 -0
- package/es/packages/components/touchchat/img/file/pdf.png.mjs.map +1 -0
- package/es/packages/components/touchchat/img/file/png.png.mjs +4 -0
- package/es/packages/components/touchchat/img/file/png.png.mjs.map +1 -0
- package/es/packages/components/touchchat/img/file/ppt.png.mjs +4 -0
- package/es/packages/components/touchchat/img/file/ppt.png.mjs.map +1 -0
- package/es/packages/components/touchchat/img/file/pptx.png.mjs +4 -0
- package/es/packages/components/touchchat/img/file/pptx.png.mjs.map +1 -0
- package/es/packages/components/touchchat/img/file/txt.png.mjs +4 -0
- package/es/packages/components/touchchat/img/file/txt.png.mjs.map +1 -0
- package/es/packages/components/touchchat/img/file/xls.png.mjs +4 -0
- package/es/packages/components/touchchat/img/file/xls.png.mjs.map +1 -0
- package/es/packages/components/touchchat/img/file/xlsx.png.mjs +4 -0
- package/es/packages/components/touchchat/img/file/xlsx.png.mjs.map +1 -0
- package/es/packages/components/touchchat/img/svg/reset.svg.mjs +4 -0
- package/es/packages/components/touchchat/img/svg/reset.svg.mjs.map +1 -0
- package/es/packages/components/touchchat/index.mjs +5 -5
- package/es/packages/components/touchchat/index.mjs.map +1 -1
- package/es/packages/components/touchchat/src/AiChat/AgentsView.vue.mjs +7 -0
- package/es/packages/components/touchchat/src/AiChat/AgentsView.vue.mjs.map +1 -0
- package/es/packages/components/touchchat/src/AiChat/AgentsView.vue2.mjs +59 -0
- package/es/packages/components/touchchat/src/AiChat/AgentsView.vue2.mjs.map +1 -0
- package/es/packages/components/touchchat/src/AiChat/AiMessage.vue.mjs +3 -2
- package/es/packages/components/touchchat/src/AiChat/AiMessage.vue.mjs.map +1 -1
- package/es/packages/components/touchchat/src/AiChat/AiMessage.vue2.mjs +322 -139
- package/es/packages/components/touchchat/src/AiChat/AiMessage.vue2.mjs.map +1 -1
- package/es/packages/components/touchchat/src/AiChat/Chat/TouchChat.mjs +18 -0
- package/es/packages/components/touchchat/src/AiChat/Chat/TouchChat.mjs.map +1 -0
- package/es/packages/components/touchchat/src/AiChat/Chat/scriptMatcher.mjs +145 -0
- package/es/packages/components/touchchat/src/AiChat/Chat/scriptMatcher.mjs.map +1 -0
- package/es/packages/components/touchchat/src/AiChat/Chat/types.mjs +19 -0
- package/es/packages/components/touchchat/src/AiChat/Chat/types.mjs.map +1 -0
- package/es/packages/components/touchchat/src/AiChat/Chat/useChat.mjs +693 -0
- package/es/packages/components/touchchat/src/AiChat/Chat/useChat.mjs.map +1 -0
- package/es/packages/components/touchchat/src/AiChat/Chat/useCopy.mjs +55 -0
- package/es/packages/components/touchchat/src/AiChat/Chat/useCopy.mjs.map +1 -0
- package/es/packages/components/touchchat/src/AiChat/Chat/useMessageRender.mjs +155 -0
- package/es/packages/components/touchchat/src/AiChat/Chat/useMessageRender.mjs.map +1 -0
- package/es/packages/components/touchchat/src/AiChat/Chat/useSSE.mjs +345 -0
- package/es/packages/components/touchchat/src/AiChat/Chat/useSSE.mjs.map +1 -0
- package/es/packages/components/touchchat/src/AiChat/Chat/useScroll.mjs +74 -0
- package/es/packages/components/touchchat/src/AiChat/Chat/useScroll.mjs.map +1 -0
- package/es/packages/components/touchchat/src/AiChat/ChatInput.vue.mjs +3 -2
- package/es/packages/components/touchchat/src/AiChat/ChatInput.vue.mjs.map +1 -1
- package/es/packages/components/touchchat/src/AiChat/ChatInput.vue2.mjs +472 -44
- package/es/packages/components/touchchat/src/AiChat/ChatInput.vue2.mjs.map +1 -1
- package/es/packages/components/touchchat/src/AiChat/HistoryList.vue.mjs +3 -2
- package/es/packages/components/touchchat/src/AiChat/HistoryList.vue.mjs.map +1 -1
- package/es/packages/components/touchchat/src/AiChat/HistoryList.vue2.mjs +180 -98
- package/es/packages/components/touchchat/src/AiChat/HistoryList.vue2.mjs.map +1 -1
- package/es/packages/components/touchchat/src/AiChat/HistorySidebar.vue.mjs +3 -2
- package/es/packages/components/touchchat/src/AiChat/HistorySidebar.vue.mjs.map +1 -1
- package/es/packages/components/touchchat/src/AiChat/HistorySidebar.vue2.mjs +29 -12
- package/es/packages/components/touchchat/src/AiChat/HistorySidebar.vue2.mjs.map +1 -1
- package/es/packages/components/touchchat/src/AiChat/MessageActions.vue.mjs +3 -2
- package/es/packages/components/touchchat/src/AiChat/MessageActions.vue.mjs.map +1 -1
- package/es/packages/components/touchchat/src/AiChat/MessageActions.vue2.mjs +175 -62
- package/es/packages/components/touchchat/src/AiChat/MessageActions.vue2.mjs.map +1 -1
- package/es/packages/components/touchchat/src/AiChat/SiderBarView.vue.mjs +3 -2
- package/es/packages/components/touchchat/src/AiChat/SiderBarView.vue.mjs.map +1 -1
- package/es/packages/components/touchchat/src/AiChat/SiderBarView.vue2.mjs +14 -8
- package/es/packages/components/touchchat/src/AiChat/SiderBarView.vue2.mjs.map +1 -1
- package/es/packages/components/touchchat/src/AiChat/TouchAgent.vue.mjs +7 -0
- package/es/packages/components/touchchat/src/AiChat/TouchAgent.vue.mjs.map +1 -0
- package/es/packages/components/touchchat/src/AiChat/TouchAgent.vue2.mjs +1034 -0
- package/es/packages/components/touchchat/src/AiChat/TouchAgent.vue2.mjs.map +1 -0
- package/es/packages/components/touchchat/src/AiChat/TouchChat.vue.mjs +3 -2
- package/es/packages/components/touchchat/src/AiChat/TouchChat.vue.mjs.map +1 -1
- package/es/packages/components/touchchat/src/AiChat/TouchChat.vue2.mjs +276 -1004
- package/es/packages/components/touchchat/src/AiChat/TouchChat.vue2.mjs.map +1 -1
- package/es/packages/components/touchchat/src/AiChat/TouchHistory.vue.mjs +3 -2
- package/es/packages/components/touchchat/src/AiChat/TouchHistory.vue.mjs.map +1 -1
- package/es/packages/components/touchchat/src/AiChat/TouchHistory.vue2.mjs +346 -122
- package/es/packages/components/touchchat/src/AiChat/TouchHistory.vue2.mjs.map +1 -1
- package/es/packages/components/touchchat/src/AiChat/UserMessage.vue.mjs +3 -2
- package/es/packages/components/touchchat/src/AiChat/UserMessage.vue.mjs.map +1 -1
- package/es/packages/components/touchchat/src/AiChat/UserMessage.vue2.mjs +143 -64
- package/es/packages/components/touchchat/src/AiChat/UserMessage.vue2.mjs.map +1 -1
- package/es/packages/components/touchchat/src/index.vue.mjs +3 -2
- package/es/packages/components/touchchat/src/index.vue.mjs.map +1 -1
- package/es/packages/components/touchchat/src/index.vue2.mjs +252 -143
- package/es/packages/components/touchchat/src/index.vue2.mjs.map +1 -1
- package/es/packages/components/touchchat/src/types/a2a.mjs +11 -0
- package/es/packages/components/touchchat/src/types/a2a.mjs.map +1 -0
- package/es/packages/components/touchchat/utils/a2aService.mjs +316 -0
- package/es/packages/components/touchchat/utils/a2aService.mjs.map +1 -0
- package/es/packages/components/touchchat/utils/fetchStream.mjs +8 -2
- package/es/packages/components/touchchat/utils/fetchStream.mjs.map +1 -1
- package/es/packages/components/touchchat/utils/markdown.mjs +31 -13
- package/es/packages/components/touchchat/utils/markdown.mjs.map +1 -1
- package/es/packages/utils/config.mjs.map +1 -1
- package/es/packages/utils/types.mjs.map +1 -1
- package/global.d.ts +2 -2
- package/lib/_virtual/_plugin-vue_export-helper.js +14 -0
- package/lib/_virtual/_plugin-vue_export-helper.js.map +1 -0
- package/lib/index.js.map +1 -1
- package/lib/node_modules/.pnpm/@touchvue_a2ui@1.0.0-beta.46/node_modules/@touchvue/a2ui/dist/index.js +4819 -0
- package/lib/node_modules/.pnpm/@touchvue_a2ui@1.0.0-beta.46/node_modules/@touchvue/a2ui/dist/index.js.map +1 -0
- package/lib/node_modules/.pnpm/dompurify@3.3.0/node_modules/dompurify/dist/purify.es.js +1384 -0
- package/lib/node_modules/.pnpm/dompurify@3.3.0/node_modules/dompurify/dist/purify.es.js.map +1 -0
- package/lib/node_modules/.pnpm/html2canvas@1.4.1/node_modules/html2canvas/dist/html2canvas.esm.js +7828 -0
- package/lib/node_modules/.pnpm/html2canvas@1.4.1/node_modules/html2canvas/dist/html2canvas.esm.js.map +1 -0
- package/lib/package.json.css +1 -1
- package/lib/package.json.js +2 -2
- package/lib/packages/components/index.js +2 -2
- package/lib/packages/components/resolver.js.map +1 -1
- package/lib/packages/components/touchchat/component/AiRobot/HelloChat.vue.js +3 -2
- package/lib/packages/components/touchchat/component/AiRobot/HelloChat.vue.js.map +1 -1
- package/lib/packages/components/touchchat/component/AiRobot/HelloChat.vue2.js +219 -159
- package/lib/packages/components/touchchat/component/AiRobot/HelloChat.vue2.js.map +1 -1
- package/lib/packages/components/touchchat/component/AiRobot/face.vue.js +3 -2
- package/lib/packages/components/touchchat/component/AiRobot/face.vue.js.map +1 -1
- package/lib/packages/components/touchchat/component/AiRobot/face.vue2.js +26 -12
- package/lib/packages/components/touchchat/component/AiRobot/face.vue2.js.map +1 -1
- package/lib/packages/components/touchchat/component/AiRobot/letter.vue.js +3 -2
- package/lib/packages/components/touchchat/component/AiRobot/letter.vue.js.map +1 -1
- package/lib/packages/components/touchchat/component/AiRobot/letter.vue2.js +181 -40
- package/lib/packages/components/touchchat/component/AiRobot/letter.vue2.js.map +1 -1
- package/lib/packages/components/touchchat/component/AiRobot/meterialPrepare.vue.js +3 -2
- package/lib/packages/components/touchchat/component/AiRobot/meterialPrepare.vue.js.map +1 -1
- package/lib/packages/components/touchchat/component/AiRobot/meterialPrepare.vue2.js +15 -10
- package/lib/packages/components/touchchat/component/AiRobot/meterialPrepare.vue2.js.map +1 -1
- package/lib/packages/components/touchchat/component/AiRobot/start.vue.js +3 -2
- package/lib/packages/components/touchchat/component/AiRobot/start.vue.js.map +1 -1
- package/lib/packages/components/touchchat/component/AiRobot/start.vue2.js +17 -10
- package/lib/packages/components/touchchat/component/AiRobot/start.vue2.js.map +1 -1
- package/lib/packages/components/touchchat/component/CardView.vue.js +3 -2
- package/lib/packages/components/touchchat/component/CardView.vue.js.map +1 -1
- package/lib/packages/components/touchchat/component/CardView.vue2.js +66 -42
- package/lib/packages/components/touchchat/component/CardView.vue2.js.map +1 -1
- package/lib/packages/components/touchchat/component/FileContent.vue.js +11 -0
- package/lib/packages/components/touchchat/component/FileContent.vue.js.map +1 -0
- package/lib/packages/components/touchchat/component/FileContent.vue2.js +210 -0
- package/lib/packages/components/touchchat/component/FileContent.vue2.js.map +1 -0
- package/lib/packages/components/touchchat/component/FileView.vue.js +3 -2
- package/lib/packages/components/touchchat/component/FileView.vue.js.map +1 -1
- package/lib/packages/components/touchchat/component/FileView.vue2.js +16 -3
- package/lib/packages/components/touchchat/component/FileView.vue2.js.map +1 -1
- package/lib/packages/components/touchchat/component/HelloChat.vue.js +3 -2
- package/lib/packages/components/touchchat/component/HelloChat.vue.js.map +1 -1
- package/lib/packages/components/touchchat/component/HelloChat.vue2.js +26 -14
- package/lib/packages/components/touchchat/component/HelloChat.vue2.js.map +1 -1
- package/lib/packages/components/touchchat/component/ImageFile.vue.js +11 -0
- package/lib/packages/components/touchchat/component/ImageFile.vue.js.map +1 -0
- package/lib/packages/components/touchchat/component/ImageFile.vue2.js +166 -0
- package/lib/packages/components/touchchat/component/ImageFile.vue2.js.map +1 -0
- package/lib/packages/components/touchchat/component/ImageView.vue.js +3 -2
- package/lib/packages/components/touchchat/component/ImageView.vue.js.map +1 -1
- package/lib/packages/components/touchchat/component/ImageView.vue2.js +1 -1
- package/lib/packages/components/touchchat/component/ImageView.vue2.js.map +1 -1
- package/lib/packages/components/touchchat/component/LinkView.vue.js +3 -2
- package/lib/packages/components/touchchat/component/LinkView.vue.js.map +1 -1
- package/lib/packages/components/touchchat/component/LinkView.vue2.js +18 -4
- package/lib/packages/components/touchchat/component/LinkView.vue2.js.map +1 -1
- package/lib/packages/components/touchchat/component/MarkLayer.vue.js +11 -0
- package/lib/packages/components/touchchat/component/MarkLayer.vue.js.map +1 -0
- package/lib/packages/components/touchchat/component/MarkLayer.vue2.js +60 -0
- package/lib/packages/components/touchchat/component/MarkLayer.vue2.js.map +1 -0
- package/lib/packages/components/touchchat/component/ModuleSelect.vue.js +11 -0
- package/lib/packages/components/touchchat/component/ModuleSelect.vue.js.map +1 -0
- package/lib/packages/components/touchchat/component/ModuleSelect.vue2.js +125 -0
- package/lib/packages/components/touchchat/component/ModuleSelect.vue2.js.map +1 -0
- package/lib/packages/components/touchchat/component/PDFFile.vue.js +11 -0
- package/lib/packages/components/touchchat/component/PDFFile.vue.js.map +1 -0
- package/lib/packages/components/touchchat/component/PDFFile.vue2.js +215 -0
- package/lib/packages/components/touchchat/component/PDFFile.vue2.js.map +1 -0
- package/lib/packages/components/touchchat/component/QuoteContent.vue.js +11 -0
- package/lib/packages/components/touchchat/component/QuoteContent.vue.js.map +1 -0
- package/lib/packages/components/touchchat/component/QuoteContent.vue2.js +44 -0
- package/lib/packages/components/touchchat/component/QuoteContent.vue2.js.map +1 -0
- package/lib/packages/components/touchchat/component/RealtimeVoice.vue.js +11 -0
- package/lib/packages/components/touchchat/component/RealtimeVoice.vue.js.map +1 -0
- package/lib/packages/components/touchchat/component/RealtimeVoice.vue2.js +164 -0
- package/lib/packages/components/touchchat/component/RealtimeVoice.vue2.js.map +1 -0
- package/lib/packages/components/touchchat/component/Screenshot.vue.js +11 -0
- package/lib/packages/components/touchchat/component/Screenshot.vue.js.map +1 -0
- package/lib/packages/components/touchchat/component/Screenshot.vue2.js +212 -0
- package/lib/packages/components/touchchat/component/Screenshot.vue2.js.map +1 -0
- package/lib/packages/components/touchchat/component/ThoughtChain.vue.js +11 -0
- package/lib/packages/components/touchchat/component/ThoughtChain.vue.js.map +1 -0
- package/lib/packages/components/touchchat/component/ThoughtChain.vue2.js +73 -0
- package/lib/packages/components/touchchat/component/ThoughtChain.vue2.js.map +1 -0
- package/lib/packages/components/touchchat/component/UploadView.vue.js +11 -0
- package/lib/packages/components/touchchat/component/UploadView.vue.js.map +1 -0
- package/lib/packages/components/touchchat/component/UploadView.vue2.js +190 -0
- package/lib/packages/components/touchchat/component/UploadView.vue2.js.map +1 -0
- package/lib/packages/components/touchchat/component/UploadView_api.vue.js +11 -0
- package/lib/packages/components/touchchat/component/UploadView_api.vue.js.map +1 -0
- package/lib/packages/components/touchchat/component/UploadView_api.vue2.js +170 -0
- package/lib/packages/components/touchchat/component/UploadView_api.vue2.js.map +1 -0
- package/lib/packages/components/touchchat/component/VideoFile.vue.js +11 -0
- package/lib/packages/components/touchchat/component/VideoFile.vue.js.map +1 -0
- package/lib/packages/components/touchchat/component/VideoFile.vue2.js +37 -0
- package/lib/packages/components/touchchat/component/VideoFile.vue2.js.map +1 -0
- package/lib/packages/components/touchchat/component/VoiceView.vue.js +11 -0
- package/lib/packages/components/touchchat/component/VoiceView.vue.js.map +1 -0
- package/lib/packages/components/touchchat/component/VoiceView.vue2.js +169 -0
- package/lib/packages/components/touchchat/component/VoiceView.vue2.js.map +1 -0
- package/lib/packages/components/touchchat/img/file/doc.png.js +8 -0
- package/lib/packages/components/touchchat/img/file/doc.png.js.map +1 -0
- package/lib/packages/components/touchchat/img/file/docx.png.js +8 -0
- package/lib/packages/components/touchchat/img/file/docx.png.js.map +1 -0
- package/lib/packages/components/touchchat/img/file/gif.png.js +8 -0
- package/lib/packages/components/touchchat/img/file/gif.png.js.map +1 -0
- package/lib/packages/components/touchchat/img/file/html.png.js +8 -0
- package/lib/packages/components/touchchat/img/file/html.png.js.map +1 -0
- package/lib/packages/components/touchchat/img/file/jpg.png.js +8 -0
- package/lib/packages/components/touchchat/img/file/jpg.png.js.map +1 -0
- package/lib/packages/components/touchchat/img/file/mp3.png.js +8 -0
- package/lib/packages/components/touchchat/img/file/mp3.png.js.map +1 -0
- package/lib/packages/components/touchchat/img/file/mp4.png.js +8 -0
- package/lib/packages/components/touchchat/img/file/mp4.png.js.map +1 -0
- package/lib/packages/components/touchchat/img/file/music.png.js +8 -0
- package/lib/packages/components/touchchat/img/file/music.png.js.map +1 -0
- package/lib/packages/components/touchchat/img/file/pdf.png.js +8 -0
- package/lib/packages/components/touchchat/img/file/pdf.png.js.map +1 -0
- package/lib/packages/components/touchchat/img/file/png.png.js +8 -0
- package/lib/packages/components/touchchat/img/file/png.png.js.map +1 -0
- package/lib/packages/components/touchchat/img/file/ppt.png.js +8 -0
- package/lib/packages/components/touchchat/img/file/ppt.png.js.map +1 -0
- package/lib/packages/components/touchchat/img/file/pptx.png.js +8 -0
- package/lib/packages/components/touchchat/img/file/pptx.png.js.map +1 -0
- package/lib/packages/components/touchchat/img/file/txt.png.js +8 -0
- package/lib/packages/components/touchchat/img/file/txt.png.js.map +1 -0
- package/lib/packages/components/touchchat/img/file/xls.png.js +8 -0
- package/lib/packages/components/touchchat/img/file/xls.png.js.map +1 -0
- package/lib/packages/components/touchchat/img/file/xlsx.png.js +8 -0
- package/lib/packages/components/touchchat/img/file/xlsx.png.js.map +1 -0
- package/lib/packages/components/touchchat/img/svg/reset.svg.js +8 -0
- package/lib/packages/components/touchchat/img/svg/reset.svg.js.map +1 -0
- package/lib/packages/components/touchchat/index.js +6 -6
- package/lib/packages/components/touchchat/index.js.map +1 -1
- package/lib/packages/components/touchchat/src/AiChat/AgentsView.vue.js +11 -0
- package/lib/packages/components/touchchat/src/AiChat/AgentsView.vue.js.map +1 -0
- package/lib/packages/components/touchchat/src/AiChat/AgentsView.vue2.js +63 -0
- package/lib/packages/components/touchchat/src/AiChat/AgentsView.vue2.js.map +1 -0
- package/lib/packages/components/touchchat/src/AiChat/AiMessage.vue.js +3 -2
- package/lib/packages/components/touchchat/src/AiChat/AiMessage.vue.js.map +1 -1
- package/lib/packages/components/touchchat/src/AiChat/AiMessage.vue2.js +321 -138
- package/lib/packages/components/touchchat/src/AiChat/AiMessage.vue2.js.map +1 -1
- package/lib/packages/components/touchchat/src/AiChat/Chat/TouchChat.js +21 -0
- package/lib/packages/components/touchchat/src/AiChat/Chat/TouchChat.js.map +1 -0
- package/lib/packages/components/touchchat/src/AiChat/Chat/scriptMatcher.js +147 -0
- package/lib/packages/components/touchchat/src/AiChat/Chat/scriptMatcher.js.map +1 -0
- package/lib/packages/components/touchchat/src/AiChat/Chat/types.js +22 -0
- package/lib/packages/components/touchchat/src/AiChat/Chat/types.js.map +1 -0
- package/lib/packages/components/touchchat/src/AiChat/Chat/useChat.js +695 -0
- package/lib/packages/components/touchchat/src/AiChat/Chat/useChat.js.map +1 -0
- package/lib/packages/components/touchchat/src/AiChat/Chat/useCopy.js +57 -0
- package/lib/packages/components/touchchat/src/AiChat/Chat/useCopy.js.map +1 -0
- package/lib/packages/components/touchchat/src/AiChat/Chat/useMessageRender.js +157 -0
- package/lib/packages/components/touchchat/src/AiChat/Chat/useMessageRender.js.map +1 -0
- package/lib/packages/components/touchchat/src/AiChat/Chat/useSSE.js +347 -0
- package/lib/packages/components/touchchat/src/AiChat/Chat/useSSE.js.map +1 -0
- package/lib/packages/components/touchchat/src/AiChat/Chat/useScroll.js +76 -0
- package/lib/packages/components/touchchat/src/AiChat/Chat/useScroll.js.map +1 -0
- package/lib/packages/components/touchchat/src/AiChat/ChatInput.vue.js +3 -2
- package/lib/packages/components/touchchat/src/AiChat/ChatInput.vue.js.map +1 -1
- package/lib/packages/components/touchchat/src/AiChat/ChatInput.vue2.js +471 -43
- package/lib/packages/components/touchchat/src/AiChat/ChatInput.vue2.js.map +1 -1
- package/lib/packages/components/touchchat/src/AiChat/HistoryList.vue.js +3 -2
- package/lib/packages/components/touchchat/src/AiChat/HistoryList.vue.js.map +1 -1
- package/lib/packages/components/touchchat/src/AiChat/HistoryList.vue2.js +179 -97
- package/lib/packages/components/touchchat/src/AiChat/HistoryList.vue2.js.map +1 -1
- package/lib/packages/components/touchchat/src/AiChat/HistorySidebar.vue.js +3 -2
- package/lib/packages/components/touchchat/src/AiChat/HistorySidebar.vue.js.map +1 -1
- package/lib/packages/components/touchchat/src/AiChat/HistorySidebar.vue2.js +28 -11
- package/lib/packages/components/touchchat/src/AiChat/HistorySidebar.vue2.js.map +1 -1
- package/lib/packages/components/touchchat/src/AiChat/MessageActions.vue.js +3 -2
- package/lib/packages/components/touchchat/src/AiChat/MessageActions.vue.js.map +1 -1
- package/lib/packages/components/touchchat/src/AiChat/MessageActions.vue2.js +174 -61
- package/lib/packages/components/touchchat/src/AiChat/MessageActions.vue2.js.map +1 -1
- package/lib/packages/components/touchchat/src/AiChat/SiderBarView.vue.js +3 -2
- package/lib/packages/components/touchchat/src/AiChat/SiderBarView.vue.js.map +1 -1
- package/lib/packages/components/touchchat/src/AiChat/SiderBarView.vue2.js +14 -8
- package/lib/packages/components/touchchat/src/AiChat/SiderBarView.vue2.js.map +1 -1
- package/lib/packages/components/touchchat/src/AiChat/TouchAgent.vue.js +11 -0
- package/lib/packages/components/touchchat/src/AiChat/TouchAgent.vue.js.map +1 -0
- package/lib/packages/components/touchchat/src/AiChat/TouchAgent.vue2.js +1038 -0
- package/lib/packages/components/touchchat/src/AiChat/TouchAgent.vue2.js.map +1 -0
- package/lib/packages/components/touchchat/src/AiChat/TouchChat.vue.js +3 -2
- package/lib/packages/components/touchchat/src/AiChat/TouchChat.vue.js.map +1 -1
- package/lib/packages/components/touchchat/src/AiChat/TouchChat.vue2.js +275 -1003
- package/lib/packages/components/touchchat/src/AiChat/TouchChat.vue2.js.map +1 -1
- package/lib/packages/components/touchchat/src/AiChat/TouchHistory.vue.js +3 -2
- package/lib/packages/components/touchchat/src/AiChat/TouchHistory.vue.js.map +1 -1
- package/lib/packages/components/touchchat/src/AiChat/TouchHistory.vue2.js +345 -121
- package/lib/packages/components/touchchat/src/AiChat/TouchHistory.vue2.js.map +1 -1
- package/lib/packages/components/touchchat/src/AiChat/UserMessage.vue.js +3 -2
- package/lib/packages/components/touchchat/src/AiChat/UserMessage.vue.js.map +1 -1
- package/lib/packages/components/touchchat/src/AiChat/UserMessage.vue2.js +142 -63
- package/lib/packages/components/touchchat/src/AiChat/UserMessage.vue2.js.map +1 -1
- package/lib/packages/components/touchchat/src/index.vue.js +3 -2
- package/lib/packages/components/touchchat/src/index.vue.js.map +1 -1
- package/lib/packages/components/touchchat/src/index.vue2.js +251 -142
- package/lib/packages/components/touchchat/src/index.vue2.js.map +1 -1
- package/lib/packages/components/touchchat/src/types/a2a.js +13 -0
- package/lib/packages/components/touchchat/src/types/a2a.js.map +1 -0
- package/lib/packages/components/touchchat/utils/a2aService.js +319 -0
- package/lib/packages/components/touchchat/utils/a2aService.js.map +1 -0
- package/lib/packages/components/touchchat/utils/fetchStream.js +8 -2
- package/lib/packages/components/touchchat/utils/fetchStream.js.map +1 -1
- package/lib/packages/components/touchchat/utils/markdown.js +31 -13
- package/lib/packages/components/touchchat/utils/markdown.js.map +1 -1
- package/lib/packages/utils/config.js.map +1 -1
- package/lib/packages/utils/types.js.map +1 -1
- package/package.json +83 -83
- package/theme/components/index.css +969 -43
- package/theme/font/iconfont.woff +0 -0
- package/theme/font/iconfont.woff2 +0 -0
- package/theme/index.css +969 -43
- package/theme/skin/default.css +969 -43
- package/types/global.d.ts +2 -2
- package/es/packages/components/touchchat/src/AiChat/Scene.vue.mjs +0 -6
- package/es/packages/components/touchchat/src/AiChat/Scene.vue.mjs.map +0 -1
- package/es/packages/components/touchchat/src/AiChat/Scene.vue2.mjs +0 -42
- package/es/packages/components/touchchat/src/AiChat/Scene.vue2.mjs.map +0 -1
- package/lib/packages/components/touchchat/src/AiChat/Scene.vue.js +0 -10
- package/lib/packages/components/touchchat/src/AiChat/Scene.vue.js.map +0 -1
- package/lib/packages/components/touchchat/src/AiChat/Scene.vue2.js +0 -46
- package/lib/packages/components/touchchat/src/AiChat/Scene.vue2.js.map +0 -1
|
@@ -3,613 +3,100 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var vue = require('vue');
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var markdown = require('../../utils/markdown.js');
|
|
14
|
-
var tools = require('../../utils/tools.js');
|
|
6
|
+
var UserMessage = require('./UserMessage.vue.js');
|
|
7
|
+
var AiMessage = require('./AiMessage.vue.js');
|
|
8
|
+
var ChatInput = require('./ChatInput.vue.js');
|
|
9
|
+
var HelloChat = require('../../component/HelloChat.vue.js');
|
|
10
|
+
var types = require('./Chat/types.js');
|
|
11
|
+
var useChat = require('./Chat/useChat.js');
|
|
12
|
+
var useCopy = require('./Chat/useCopy.js');
|
|
15
13
|
|
|
16
14
|
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
17
15
|
__name: "TouchChat",
|
|
18
16
|
props: {
|
|
19
|
-
model: {
|
|
20
|
-
type: String,
|
|
21
|
-
default: "deepseek-v3"
|
|
22
|
-
},
|
|
23
17
|
value: {
|
|
24
18
|
type: Array,
|
|
25
19
|
default: () => []
|
|
26
|
-
},
|
|
27
|
-
placeholder: {
|
|
28
|
-
type: String,
|
|
29
|
-
default: "\u5FEB\u6765\u548C\u6211\u804A\u5929\u5427~"
|
|
30
|
-
},
|
|
31
|
-
components: {
|
|
32
|
-
type: Object,
|
|
33
|
-
default: () => ({})
|
|
34
|
-
},
|
|
35
|
-
openSSECallback: {
|
|
36
|
-
type: Function,
|
|
37
|
-
default: null
|
|
38
20
|
}
|
|
39
21
|
},
|
|
40
|
-
emits: ["sendMessage", "toggleSidebar", "beforeSendMessage"],
|
|
22
|
+
emits: ["sendMessage", "toggleSidebar", "beforeSendMessage", "openSideBar"],
|
|
41
23
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
42
24
|
const emit = __emit;
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
const connectionType = vue.inject("connectionType");
|
|
49
|
-
const isDeepSeek = vue.inject(
|
|
50
|
-
"isDeepSeek",
|
|
51
|
-
vue.computed(() => true)
|
|
52
|
-
);
|
|
53
|
-
const aiChatType = vue.inject("aiChatType", "Flow");
|
|
54
|
-
const scripts = vue.inject("scripts", []);
|
|
55
|
-
const robotUnmatched = vue.inject("robotUnmatched", "\u60A8\u7684\u6D88\u606F\u672A\u5339\u914D\u5230\u4EFB\u4F55\u5185\u5BB9");
|
|
56
|
-
const currentScriptIndex = vue.ref(0);
|
|
57
|
-
const selectedScriptName = vue.ref("");
|
|
58
|
-
const afterSendMessage = vue.inject("afterSendMessage", () => {
|
|
59
|
-
console.warn("\u672A\u63D0\u4F9BafterSendMessage\u51FD\u6570");
|
|
25
|
+
const scripts = vue.inject("scripts", vue.ref([]));
|
|
26
|
+
const unmatchText = vue.inject("unmatchText", "\u60A8\u7684\u6D88\u606F\u672A\u5339\u914D\u5230\u4EFB\u4F55\u5185\u5BB9");
|
|
27
|
+
const modules = vue.inject("modules", vue.ref([]));
|
|
28
|
+
const afterSend = vue.inject("afterSend", () => {
|
|
29
|
+
console.warn("\u672A\u63D0\u4F9BafterSend\u51FD\u6570");
|
|
60
30
|
});
|
|
61
|
-
const sendMessageInject = vue.inject("
|
|
31
|
+
const sendMessageInject = vue.inject("send", () => {
|
|
62
32
|
console.warn("\u672A\u63D0\u4F9BhandleSend\u51FD\u6570");
|
|
63
33
|
});
|
|
64
34
|
const beforeSend = vue.inject("beforeSend", () => ({
|
|
65
|
-
result: true
|
|
35
|
+
result: true,
|
|
36
|
+
componentName: ""
|
|
66
37
|
}));
|
|
38
|
+
const bottom = vue.inject("bottom", () => {
|
|
39
|
+
console.warn("\u672A\u63D0\u4F9Bbottom\u51FD\u6570");
|
|
40
|
+
});
|
|
41
|
+
const stop = vue.inject("stop", () => {
|
|
42
|
+
console.warn("\u672A\u63D0\u4F9Bstop\u51FD\u6570");
|
|
43
|
+
});
|
|
44
|
+
const isSelectMode = vue.inject(
|
|
45
|
+
"isSelectMode",
|
|
46
|
+
vue.computed(() => false)
|
|
47
|
+
);
|
|
48
|
+
const scriptsLength = vue.computed(() => {
|
|
49
|
+
var _a;
|
|
50
|
+
return ((_a = scripts.value) == null ? void 0 : _a.length) || 0;
|
|
51
|
+
});
|
|
67
52
|
const props = __props;
|
|
68
53
|
const chatContainer = vue.ref(null);
|
|
69
|
-
const
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
content: data.content || "",
|
|
116
|
-
isChating: (_a = data.isChating) != null ? _a : false,
|
|
117
|
-
thinkContent: data.thinkContent || "",
|
|
118
|
-
reasoningContent: data.reasoningContent || "",
|
|
119
|
-
isLiked: (_b = data.isLiked) != null ? _b : false,
|
|
120
|
-
isDisliked: (_c = data.isDisliked) != null ? _c : false,
|
|
121
|
-
isEditing: (_d = data.isEditing) != null ? _d : false,
|
|
122
|
-
editContent: (_e = data.editContent) != null ? _e : ""
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
const sceneClick = (script) => {
|
|
127
|
-
selectedScriptName.value = script.name;
|
|
128
|
-
const findAndSendFirstUserMessage = (dataSource) => {
|
|
129
|
-
var _a;
|
|
130
|
-
const targetScript = dataSource.find((item) => item.name === script.name);
|
|
131
|
-
if (targetScript && targetScript.content.length) {
|
|
132
|
-
const firstUserMessage = (_a = targetScript.content.find((citem) => citem.user === "i")) == null ? void 0 : _a.data;
|
|
133
|
-
if (firstUserMessage) {
|
|
134
|
-
sendMessage({
|
|
135
|
-
name: firstUserMessage
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
if (scripts.length) {
|
|
141
|
-
findAndSendFirstUserMessage(scripts);
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
console.log("sceneClick", sceneClick);
|
|
145
|
-
const completeRendered = () => {
|
|
146
|
-
console.log("completeRendered", "\u6E32\u67D3\u5B8C\u6210");
|
|
147
|
-
};
|
|
148
|
-
const toggleSidebarClick = (item, index) => {
|
|
149
|
-
emit("toggleSidebar", item, index);
|
|
150
|
-
};
|
|
151
|
-
const init = () => {
|
|
152
|
-
try {
|
|
153
|
-
if (Array.isArray(props.value) && props.value.length && isDeepSeek.value) {
|
|
154
|
-
chatList.value = props.value.map((item) => ({
|
|
155
|
-
...item,
|
|
156
|
-
content: item.thinkContent ? item.content || "" : item.content || "",
|
|
157
|
-
thinkContent: item.thinkContent || ""
|
|
158
|
-
}));
|
|
159
|
-
vue.nextTick(() => {
|
|
160
|
-
requestAnimationFrame(() => {
|
|
161
|
-
chatList.value.forEach((item, index) => {
|
|
162
|
-
currIndex.value = index;
|
|
163
|
-
if (item.thinkContent) {
|
|
164
|
-
renderContent(item.thinkContent, "thinking");
|
|
165
|
-
}
|
|
166
|
-
if (item.reasoningContent) {
|
|
167
|
-
renderContent(item.reasoningContent, "reasoning");
|
|
168
|
-
}
|
|
169
|
-
if (item.content) {
|
|
170
|
-
renderContent(item.content, "main");
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
});
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
if (connectionType === "Websocket" && isDeepSeek.value) {
|
|
177
|
-
openWebsocket();
|
|
178
|
-
}
|
|
179
|
-
} catch (error) {
|
|
180
|
-
console.error("\u521D\u59CB\u5316\u5931\u8D25:", error);
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
const findMatchingScriptContent = (userInput) => {
|
|
184
|
-
if (!scripts || scripts.length === 0)
|
|
185
|
-
return null;
|
|
186
|
-
let currentScript = scripts.find((item) => item.name === selectedScriptName.value);
|
|
187
|
-
if (!currentScript && scripts.length > 0) {
|
|
188
|
-
currentScript = scripts[0];
|
|
189
|
-
selectedScriptName.value = currentScript.name;
|
|
190
|
-
}
|
|
191
|
-
if (!currentScript)
|
|
192
|
-
return null;
|
|
193
|
-
const firstItem = currentScript.content[0];
|
|
194
|
-
if (firstItem.user === "i") {
|
|
195
|
-
const isDataMatch2 = firstItem.data && userInput.includes(firstItem.data);
|
|
196
|
-
let isSubDataMatch2 = false;
|
|
197
|
-
if (firstItem.subData) {
|
|
198
|
-
if (Array.isArray(firstItem.subData)) {
|
|
199
|
-
isSubDataMatch2 = firstItem.subData.some((item) => userInput.includes(item));
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
if (isDataMatch2 || isSubDataMatch2) {
|
|
203
|
-
currentScriptIndex.value = 0;
|
|
204
|
-
const responses = [];
|
|
205
|
-
let nextIndex = currentScript.content.length;
|
|
206
|
-
for (let i = 1; i < currentScript.content.length; i++) {
|
|
207
|
-
const item = currentScript.content[i];
|
|
208
|
-
if (item.user === "i") {
|
|
209
|
-
nextIndex = i;
|
|
210
|
-
break;
|
|
211
|
-
}
|
|
212
|
-
if (item.user === "ai") {
|
|
213
|
-
responses.push(item);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
return { responses, nextIndex };
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
const currentItem = currentScript.content[currentScriptIndex.value];
|
|
220
|
-
if (!currentItem || currentItem.user !== "i") {
|
|
221
|
-
return null;
|
|
222
|
-
}
|
|
223
|
-
const isDataMatch = currentItem.data && userInput.includes(currentItem.data);
|
|
224
|
-
let isSubDataMatch = false;
|
|
225
|
-
if (currentItem.subData) {
|
|
226
|
-
if (Array.isArray(currentItem.subData)) {
|
|
227
|
-
isSubDataMatch = currentItem.subData.some((item) => userInput.includes(item));
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
if (isDataMatch || isSubDataMatch) {
|
|
231
|
-
const responses = [];
|
|
232
|
-
let nextIndex = currentScript.content.length;
|
|
233
|
-
for (let i = currentScriptIndex.value + 1; i < currentScript.content.length; i++) {
|
|
234
|
-
const item = currentScript.content[i];
|
|
235
|
-
if (item.user === "i") {
|
|
236
|
-
nextIndex = i;
|
|
237
|
-
break;
|
|
238
|
-
}
|
|
239
|
-
if (item.user === "ai") {
|
|
240
|
-
responses.push(item);
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
return { responses, nextIndex };
|
|
244
|
-
}
|
|
245
|
-
return null;
|
|
246
|
-
};
|
|
247
|
-
vue.watch(
|
|
248
|
-
() => props.value,
|
|
249
|
-
(newVal, oldVal) => {
|
|
250
|
-
if (!Array.isArray(newVal))
|
|
251
|
-
return;
|
|
252
|
-
if (newVal.length && JSON.stringify(newVal) !== JSON.stringify(oldVal)) {
|
|
253
|
-
chatList.value = newVal.map((item) => ({
|
|
254
|
-
...item,
|
|
255
|
-
content: item.thinkContent ? item.content || "" : item.content || "",
|
|
256
|
-
thinkContent: item.thinkContent || ""
|
|
257
|
-
}));
|
|
258
|
-
vue.nextTick(() => {
|
|
259
|
-
requestAnimationFrame(() => {
|
|
260
|
-
chatList.value.forEach((item, index) => {
|
|
261
|
-
currIndex.value = index;
|
|
262
|
-
if (item.thinkContent) {
|
|
263
|
-
renderContent(item.thinkContent, "thinking");
|
|
264
|
-
}
|
|
265
|
-
if (item.reasoningContent) {
|
|
266
|
-
renderContent(item.reasoningContent, "reasoning");
|
|
267
|
-
}
|
|
268
|
-
if (item.content) {
|
|
269
|
-
renderContent(item.content, "main");
|
|
270
|
-
}
|
|
271
|
-
});
|
|
272
|
-
});
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
},
|
|
276
|
-
{ deep: true, immediate: true }
|
|
277
|
-
);
|
|
278
|
-
const openWebsocket = () => {
|
|
279
|
-
if (!wsUrl) {
|
|
280
|
-
throw new Error("wsUrl is required");
|
|
281
|
-
}
|
|
282
|
-
if (!token) {
|
|
283
|
-
throw new Error("token is required");
|
|
284
|
-
}
|
|
285
|
-
let config = {
|
|
286
|
-
token,
|
|
287
|
-
wsUrl
|
|
288
|
-
};
|
|
289
|
-
TouchChatRobot.value = new chatRobot.ChatRobot(config);
|
|
290
|
-
TouchChatRobot.value && TouchChatRobot.value.addListener("chatCrmSuccess", {
|
|
291
|
-
msgCallback: chatCrmSuccess,
|
|
292
|
-
statusCallback: () => {
|
|
293
|
-
}
|
|
294
|
-
});
|
|
295
|
-
TouchChatRobot.value && TouchChatRobot.value.addListener("onMessageError", {
|
|
296
|
-
msgCallback: () => {
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
TouchChatRobot.value && TouchChatRobot.value.addListener("chatCrmError", {
|
|
300
|
-
msgCallback: (data) => {
|
|
301
|
-
console.log("AI \u5BF9\u8BDD\u8FDE\u63A5\u9519\u8BEF\u56DE\u8C03", data);
|
|
302
|
-
}
|
|
303
|
-
});
|
|
304
|
-
TouchChatRobot.value.connect();
|
|
305
|
-
};
|
|
306
|
-
const chatCrmSuccess = (data) => {
|
|
307
|
-
if (data && data.chatType === "response") {
|
|
308
|
-
if (Array.isArray(data.chatInfo)) {
|
|
309
|
-
let msgContentList = data.chatInfo.map((item) => item.msgContent);
|
|
310
|
-
let msgContent = msgContentList.length ? msgContentList[0] : "";
|
|
311
|
-
chatList.value.push({
|
|
312
|
-
user: "u",
|
|
313
|
-
type: "text",
|
|
314
|
-
content: msgContent
|
|
315
|
-
});
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
};
|
|
319
|
-
const openSSE = (userContent, insertIndex, type) => {
|
|
320
|
-
try {
|
|
321
|
-
if (isUnmounting.value)
|
|
322
|
-
return;
|
|
323
|
-
isChating.value = true;
|
|
324
|
-
if (props.openSSECallback) {
|
|
325
|
-
props.openSSECallback(fetchStream.FetchStream);
|
|
326
|
-
return;
|
|
327
|
-
}
|
|
328
|
-
const currentAiMessage = chatList.value.find((item) => item.isChating);
|
|
329
|
-
if (currentAiMessage) {
|
|
330
|
-
currentAiMessage.isShowLike = true;
|
|
331
|
-
currentAiMessage.isShowCopy = true;
|
|
332
|
-
currentAiMessage.componentName = currentComponentName.value;
|
|
333
|
-
}
|
|
334
|
-
const chatId = (currentAiMessage == null ? void 0 : currentAiMessage.chatId) || "ai_" + crypto.randomUUID().replace(/-/gi, "");
|
|
335
|
-
let aiContent = (currentAiMessage == null ? void 0 : currentAiMessage.content) || "";
|
|
336
|
-
let reasoningContent = (currentAiMessage == null ? void 0 : currentAiMessage.reasoningContent) || "";
|
|
337
|
-
let allAiContent = "";
|
|
338
|
-
if (!currentAiMessage) {
|
|
339
|
-
const chatItem = {
|
|
340
|
-
chatId,
|
|
341
|
-
user: "ai",
|
|
342
|
-
type: "text",
|
|
343
|
-
isChating: true,
|
|
344
|
-
content: "",
|
|
345
|
-
thinkContent: "",
|
|
346
|
-
reasoningContent: "",
|
|
347
|
-
thinkStatus: "thinking" /* THINKING */,
|
|
348
|
-
thinkStartTime: Date.now(),
|
|
349
|
-
isShowLike: true,
|
|
350
|
-
isShowCopy: true,
|
|
351
|
-
componentName: currentComponentName.value
|
|
352
|
-
};
|
|
353
|
-
if (insertIndex !== void 0 && insertIndex <= chatList.value.length) {
|
|
354
|
-
chatList.value.splice(insertIndex, 0, chatItem);
|
|
355
|
-
} else {
|
|
356
|
-
chatList.value.push(chatItem);
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
currIndex.value = chatList.value.findIndex((ele) => ele.chatId === chatId);
|
|
360
|
-
fetchStream$1.value = new fetchStream.FetchStream({
|
|
361
|
-
url: action != null ? action : "https://api.apiyi.com/v1/chat/completions",
|
|
362
|
-
requestInit: {
|
|
363
|
-
headers: headers != null ? headers : {
|
|
364
|
-
"Content-Type": "application/json",
|
|
365
|
-
Authorization: "Bearer sk-fe9MtODvds8wpzz05f3417Fe3e9641C1926e6fC588425dEd"
|
|
366
|
-
},
|
|
367
|
-
body: !isDeepSeek ? JSON.stringify(body) : JSON.stringify({
|
|
368
|
-
model: enableDeepThinking.value ? "deepseek-reasoner" : "deepseek-v3",
|
|
369
|
-
messages: [
|
|
370
|
-
{
|
|
371
|
-
role: "user",
|
|
372
|
-
content: userContent
|
|
373
|
-
}
|
|
374
|
-
],
|
|
375
|
-
stream: true
|
|
376
|
-
})
|
|
377
|
-
},
|
|
378
|
-
onmessage: (line) => {
|
|
379
|
-
var _a, _b, _c, _d, _e, _f;
|
|
380
|
-
if (isUnmounting.value)
|
|
381
|
-
return;
|
|
382
|
-
let dataString = "";
|
|
383
|
-
if (line.length) {
|
|
384
|
-
if (line.includes("data:")) {
|
|
385
|
-
dataString = line.split("data:")[1];
|
|
386
|
-
} else if (line.startsWith("{") && line.endsWith("}")) {
|
|
387
|
-
dataString = line;
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
dataString = dataString.trim();
|
|
391
|
-
if (dataString && dataString.startsWith("{") && dataString.endsWith("}")) {
|
|
392
|
-
try {
|
|
393
|
-
const result = JSON.parse(dataString);
|
|
394
|
-
const newAiMessage = chatList.value[currIndex.value];
|
|
395
|
-
if (isDeepSeek) {
|
|
396
|
-
if ((_c = (_b = (_a = result == null ? void 0 : result.choices) == null ? void 0 : _a[0]) == null ? void 0 : _b.delta) == null ? void 0 : _c.content) {
|
|
397
|
-
aiContent += result.choices[0].delta.content;
|
|
398
|
-
if ((newAiMessage == null ? void 0 : newAiMessage.thinkStatus) === "thinking" /* THINKING */) {
|
|
399
|
-
newAiMessage.thinkStatus = "completed" /* COMPLETED */;
|
|
400
|
-
newAiMessage.thinkTime = Date.now() - (newAiMessage.thinkStartTime || Date.now());
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
if ((_f = (_e = (_d = result == null ? void 0 : result.choices) == null ? void 0 : _d[0]) == null ? void 0 : _e.delta) == null ? void 0 : _f.reasoning_content) {
|
|
404
|
-
reasoningContent += result.choices[0].delta.reasoning_content;
|
|
405
|
-
if (!(newAiMessage == null ? void 0 : newAiMessage.thinkStatus)) {
|
|
406
|
-
newAiMessage.thinkStatus = "thinking" /* THINKING */;
|
|
407
|
-
newAiMessage.thinkStartTime = Date.now();
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
} else {
|
|
411
|
-
if (aiChatType === "Flow") {
|
|
412
|
-
if ((result == null ? void 0 : result.message) && (result == null ? void 0 : result.category) === "answer") {
|
|
413
|
-
aiContent += result.message;
|
|
414
|
-
}
|
|
415
|
-
} else if (aiChatType === "Intelligent") {
|
|
416
|
-
if ((result == null ? void 0 : result.content) && (result == null ? void 0 : result.category) === "task_stream_content") {
|
|
417
|
-
aiContent += result.content;
|
|
418
|
-
}
|
|
419
|
-
if ((result == null ? void 0 : result.message) && (result == null ? void 0 : result.category) === "answer") {
|
|
420
|
-
allAiContent = result.message;
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
if (chatList.value.some((ele) => ele.chatId === chatId)) {
|
|
425
|
-
enqueueRender({
|
|
426
|
-
mainContent: aiContent,
|
|
427
|
-
thinkContent: "",
|
|
428
|
-
reasoningContent
|
|
429
|
-
});
|
|
430
|
-
}
|
|
431
|
-
if (type === 1) {
|
|
432
|
-
scrollToBottom();
|
|
433
|
-
}
|
|
434
|
-
} catch (error) {
|
|
435
|
-
console.error("\u89E3\u6790SSE\u6D88\u606F\u5931\u8D25:", error);
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
},
|
|
439
|
-
ondone: () => {
|
|
440
|
-
vue.nextTick(() => {
|
|
441
|
-
isChating.value = false;
|
|
442
|
-
if (isUnmounting.value || !isMounted.value)
|
|
443
|
-
return;
|
|
444
|
-
const index = chatList.value.findIndex((ele) => ele.chatId === chatId);
|
|
445
|
-
if (index !== -1 && chatList.value[index]) {
|
|
446
|
-
chatList.value[index].isChating = false;
|
|
447
|
-
chatList.value[index].componentName = currentComponentName.value;
|
|
448
|
-
if (aiChatType === "Intelligent" && allAiContent) {
|
|
449
|
-
afterSendMessage(allAiContent);
|
|
450
|
-
}
|
|
451
|
-
const waitForRenderComplete = () => {
|
|
452
|
-
if (renderQueue.value.length === 0 && !isRendering.value) {
|
|
453
|
-
if (chatList.value.length > 0 && isDeepSeek) {
|
|
454
|
-
emit("sendMessage", JSON.parse(JSON.stringify(chatList.value)));
|
|
455
|
-
}
|
|
456
|
-
} else {
|
|
457
|
-
requestAnimationFrame(waitForRenderComplete);
|
|
458
|
-
}
|
|
459
|
-
};
|
|
460
|
-
waitForRenderComplete();
|
|
461
|
-
}
|
|
462
|
-
});
|
|
463
|
-
},
|
|
464
|
-
onabort: () => {
|
|
465
|
-
handleAbort();
|
|
466
|
-
},
|
|
467
|
-
onerror: (response) => {
|
|
468
|
-
handleError(response);
|
|
469
|
-
}
|
|
470
|
-
});
|
|
471
|
-
} catch (error) {
|
|
472
|
-
console.error("OpenSSE\u9519\u8BEF:", error);
|
|
473
|
-
isChating.value = false;
|
|
474
|
-
tools.showToast("\u8BF7\u6C42\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5", "error", 3e3);
|
|
475
|
-
}
|
|
476
|
-
};
|
|
477
|
-
const handleAbort = () => {
|
|
478
|
-
isChating.value = false;
|
|
479
|
-
if (isUnmounting.value)
|
|
480
|
-
return;
|
|
481
|
-
const currentAiMessage = chatList.value[currIndex.value];
|
|
482
|
-
const hasContent = currentAiMessage && (currentAiMessage.content || currentAiMessage.thinkContent || currentAiMessage.reasoningContent);
|
|
483
|
-
if (currentAiMessage) {
|
|
484
|
-
if (currentAiMessage.thinkStatus === "thinking" /* THINKING */) {
|
|
485
|
-
currentAiMessage.thinkStatus = "stopped" /* STOPPED */;
|
|
486
|
-
currentAiMessage.thinkTime = Date.now() - (currentAiMessage.thinkStartTime || Date.now());
|
|
487
|
-
}
|
|
488
|
-
if (!hasContent) {
|
|
489
|
-
const userMessageIndex = currIndex.value - 1;
|
|
490
|
-
if (userMessageIndex >= 0 && chatList.value[userMessageIndex].user === "u") {
|
|
491
|
-
chatList.value.splice(currIndex.value, 1);
|
|
492
|
-
chatList.value.splice(userMessageIndex, 1);
|
|
493
|
-
} else {
|
|
494
|
-
chatList.value.splice(currIndex.value, 1);
|
|
495
|
-
}
|
|
496
|
-
} else {
|
|
497
|
-
const updatedAiMessage = {
|
|
498
|
-
...currentAiMessage,
|
|
499
|
-
isChating: false,
|
|
500
|
-
content: currentAiMessage.content ? currentAiMessage.content + "\u3002\u3002\u3002" : "",
|
|
501
|
-
thinkContent: currentAiMessage.thinkContent ? currentAiMessage.thinkContent + "\u3002\u3002\u3002" : void 0,
|
|
502
|
-
reasoningContent: currentAiMessage.reasoningContent ? currentAiMessage.reasoningContent + "\u3002\u3002\u3002" : void 0,
|
|
503
|
-
thinkStatus: currentAiMessage.thinkStatus
|
|
504
|
-
};
|
|
505
|
-
chatList.value.splice(currIndex.value, 1, updatedAiMessage);
|
|
506
|
-
vue.nextTick(() => {
|
|
507
|
-
renderContent(updatedAiMessage.thinkContent || "", "thinking");
|
|
508
|
-
renderContent(updatedAiMessage.reasoningContent || "", "reasoning");
|
|
509
|
-
renderContent(updatedAiMessage.content || "", "main");
|
|
510
|
-
emit("sendMessage", [...chatList.value]);
|
|
511
|
-
});
|
|
512
|
-
return;
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
if (chatList.value.length > 0) {
|
|
516
|
-
emit("sendMessage", [...chatList.value]);
|
|
517
|
-
}
|
|
518
|
-
};
|
|
519
|
-
const handleError = (response) => {
|
|
520
|
-
if (isUnmounting.value)
|
|
521
|
-
return;
|
|
522
|
-
isChating.value = false;
|
|
523
|
-
let errorMessage = "\u672A\u77E5\u9519\u8BEF";
|
|
524
|
-
if (response instanceof Error) {
|
|
525
|
-
console.error("API\u8BF7\u6C42\u9519\u8BEF:", response);
|
|
526
|
-
errorMessage = response.message;
|
|
527
|
-
} else if (response instanceof Response) {
|
|
528
|
-
console.error("API\u8BF7\u6C42\u9519\u8BEF, \u54CD\u5E94\u72B6\u6001:", response.status, response.statusText);
|
|
529
|
-
errorMessage = `\u8BF7\u6C42\u5931\u8D25: ${response.status} ${response.statusText}`;
|
|
530
|
-
}
|
|
531
|
-
const currentAiMessage = chatList.value[currIndex.value];
|
|
532
|
-
if (currentAiMessage) {
|
|
533
|
-
currentAiMessage.content = `<div style="color: red; display: flex; align-items: center;"><svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none">
|
|
534
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.5 15.5C11.6421 15.5 15 12.1421 15 8C15 3.85786 11.6421 0.5 7.5 0.5C3.35786 0.5 0 3.85786 0 8C0 12.1421 3.35786 15.5 7.5 15.5ZM9.7539 4.9506L10.5494 5.7461L8.2951 8.0001L10.5494 10.2539L9.7539 11.0494L7.5001 8.7951L5.2461 11.0494L4.4506 10.2539L6.7051 8.0001L4.4506 5.7461L5.2461 4.9506L7.5001 7.2051L9.7539 4.9506Z" fill="#F93920"/>
|
|
535
|
-
</svg>${errorMessage}</div>`;
|
|
536
|
-
currentAiMessage.isChating = false;
|
|
537
|
-
currentAiMessage.componentName = "";
|
|
538
|
-
currentAiMessage.isShowLike = false;
|
|
539
|
-
currentAiMessage.isShowCopy = false;
|
|
540
|
-
vue.nextTick(() => {
|
|
541
|
-
renderContent(currentAiMessage.content || "", "main");
|
|
542
|
-
emit("sendMessage", [...chatList.value]);
|
|
543
|
-
});
|
|
544
|
-
} else {
|
|
545
|
-
tools.showToast(errorMessage, "error", 3e3);
|
|
546
|
-
emit("sendMessage", [...chatList.value]);
|
|
547
|
-
}
|
|
548
|
-
};
|
|
549
|
-
const enqueueRender = (data) => {
|
|
550
|
-
if (isUnmounting.value || !isMounted.value)
|
|
551
|
-
return;
|
|
552
|
-
if (currIndex.value < 0 || currIndex.value >= chatList.value.length)
|
|
553
|
-
return;
|
|
554
|
-
renderQueue.value.push(data);
|
|
555
|
-
if (!isRendering.value) {
|
|
556
|
-
isRendering.value = true;
|
|
557
|
-
processRenderQueue();
|
|
558
|
-
}
|
|
559
|
-
};
|
|
560
|
-
const processRenderQueue = () => {
|
|
561
|
-
if (isUnmounting.value || !isMounted.value) {
|
|
562
|
-
renderQueue.value = [];
|
|
563
|
-
isRendering.value = false;
|
|
564
|
-
return;
|
|
565
|
-
}
|
|
566
|
-
if (renderQueue.value.length === 0) {
|
|
567
|
-
isRendering.value = false;
|
|
568
|
-
return;
|
|
569
|
-
}
|
|
570
|
-
requestAnimationFrame(() => {
|
|
571
|
-
const data = renderQueue.value.shift();
|
|
572
|
-
if (data) {
|
|
573
|
-
formatMarkdown(data);
|
|
574
|
-
}
|
|
575
|
-
processRenderQueue();
|
|
576
|
-
});
|
|
577
|
-
};
|
|
578
|
-
const formatMarkdown = (data) => {
|
|
579
|
-
if (!isMounted.value)
|
|
580
|
-
return;
|
|
581
|
-
if (currIndex.value < 0 || currIndex.value >= chatList.value.length)
|
|
582
|
-
return;
|
|
583
|
-
const currentItem = chatList.value[currIndex.value];
|
|
584
|
-
currentItem.thinkContent = data.thinkContent;
|
|
585
|
-
currentItem.content = data.mainContent;
|
|
586
|
-
currentItem.reasoningContent = data.reasoningContent;
|
|
587
|
-
vue.nextTick(() => {
|
|
588
|
-
const thinkingContainer = thinkingContentRef.value[currIndex.value];
|
|
589
|
-
if (thinkingContainer) {
|
|
590
|
-
if (data.thinkContent) {
|
|
591
|
-
renderContent(data.thinkContent, "thinking");
|
|
592
|
-
thinkingContainer.style.display = "block";
|
|
593
|
-
thinkingContainer.style.visibility = "visible";
|
|
594
|
-
} else {
|
|
595
|
-
thinkingContainer.style.display = "none";
|
|
596
|
-
thinkingContainer.style.visibility = "hidden";
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
const reasoningContainer = reasoningContentRef.value[currIndex.value];
|
|
600
|
-
if (reasoningContainer) {
|
|
601
|
-
if (data.reasoningContent) {
|
|
602
|
-
renderContent(data.reasoningContent, "reasoning");
|
|
603
|
-
reasoningContainer.style.display = "block";
|
|
604
|
-
reasoningContainer.style.visibility = "visible";
|
|
605
|
-
} else {
|
|
606
|
-
reasoningContainer.style.display = "none";
|
|
607
|
-
reasoningContainer.style.visibility = "hidden";
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
renderContent(data.mainContent, "main");
|
|
611
|
-
});
|
|
612
|
-
};
|
|
54
|
+
const ChatInputRef = vue.ref(null);
|
|
55
|
+
const {
|
|
56
|
+
chatList,
|
|
57
|
+
isChating,
|
|
58
|
+
inputValue,
|
|
59
|
+
enableDeepThinking,
|
|
60
|
+
activeAgentsName,
|
|
61
|
+
init,
|
|
62
|
+
sendMessage,
|
|
63
|
+
handleBeforeSend,
|
|
64
|
+
handleSend,
|
|
65
|
+
handleStop,
|
|
66
|
+
handleMessageAction,
|
|
67
|
+
saveEdit,
|
|
68
|
+
cancelEdit,
|
|
69
|
+
completeRendered,
|
|
70
|
+
handleAgentSelect,
|
|
71
|
+
update,
|
|
72
|
+
updateModule,
|
|
73
|
+
handleDragEnter,
|
|
74
|
+
handleDragLeave,
|
|
75
|
+
handleDrop,
|
|
76
|
+
handleScroll,
|
|
77
|
+
onMounted: chatOnMounted,
|
|
78
|
+
onBeforeUnmount: chatOnBeforeUnmount
|
|
79
|
+
} = useChat.useChat({
|
|
80
|
+
props,
|
|
81
|
+
emit,
|
|
82
|
+
scripts: scripts.value,
|
|
83
|
+
unmatchText,
|
|
84
|
+
modules: modules.value,
|
|
85
|
+
afterSend,
|
|
86
|
+
sendMessageInject,
|
|
87
|
+
beforeSend,
|
|
88
|
+
bottom,
|
|
89
|
+
stop,
|
|
90
|
+
chatContainer,
|
|
91
|
+
chatInputRef: ChatInputRef
|
|
92
|
+
});
|
|
93
|
+
const { copyWithFeedback } = useCopy.useCopy();
|
|
94
|
+
const modelChangeExternal = vue.inject("modelChange", () => {
|
|
95
|
+
});
|
|
96
|
+
vue.provide("modelChange", (item, index) => {
|
|
97
|
+
modelChangeExternal(item, index);
|
|
98
|
+
updateModule(item);
|
|
99
|
+
});
|
|
613
100
|
const attachCopyButtons = (container) => {
|
|
614
101
|
const codeBlocks = container.querySelectorAll("pre code");
|
|
615
102
|
codeBlocks.forEach((codeBlock) => {
|
|
@@ -619,462 +106,247 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
619
106
|
copyBtn.className = "touchchat-code-copy";
|
|
620
107
|
copyBtn.addEventListener("click", () => {
|
|
621
108
|
const code = codeBlock.textContent || "";
|
|
622
|
-
|
|
623
|
-
tools.showToast("\u590D\u5236\u6210\u529F", "info", 2e3);
|
|
624
|
-
copyBtn.textContent = "\u5DF2\u590D\u5236";
|
|
625
|
-
setTimeout(() => {
|
|
626
|
-
copyBtn.textContent = "";
|
|
627
|
-
}, 2e3);
|
|
628
|
-
}).catch((err) => {
|
|
629
|
-
console.error("\u590D\u5236\u5931\u8D25:", err);
|
|
630
|
-
tools.showToast("\u590D\u5236\u5931\u8D25", "error", 2e3);
|
|
631
|
-
});
|
|
109
|
+
copyWithFeedback(code, copyBtn, "", "\u5DF2\u590D\u5236", 2e3);
|
|
632
110
|
});
|
|
633
111
|
pre.style.position = "relative";
|
|
634
112
|
pre.appendChild(copyBtn);
|
|
635
113
|
}
|
|
636
114
|
});
|
|
637
115
|
};
|
|
638
|
-
const
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
main: htmlContentRef,
|
|
644
|
-
thinking: thinkingContentRef,
|
|
645
|
-
reasoning: reasoningContentRef
|
|
646
|
-
};
|
|
647
|
-
const processors = {
|
|
648
|
-
main: (content2) => {
|
|
649
|
-
var _a;
|
|
650
|
-
return ((_a = markdown.default) == null ? void 0 : _a.render(content2, { isReasoning: false })) || "";
|
|
651
|
-
},
|
|
652
|
-
thinking: (content2) => {
|
|
653
|
-
var _a;
|
|
654
|
-
return ((_a = markdown.default) == null ? void 0 : _a.render(content2, { isReasoning: false })) || "";
|
|
655
|
-
},
|
|
656
|
-
reasoning: (content2) => {
|
|
657
|
-
var _a;
|
|
658
|
-
return ((_a = markdown.default) == null ? void 0 : _a.render(content2, { isReasoning: false })) || "";
|
|
659
|
-
}
|
|
660
|
-
};
|
|
661
|
-
const container = refArrays[type].value[renderIndex];
|
|
662
|
-
if (!container)
|
|
663
|
-
return;
|
|
664
|
-
container.innerHTML = processors[type](content || "");
|
|
665
|
-
attachCopyButtons(container);
|
|
666
|
-
};
|
|
667
|
-
const sendMessage = (item) => {
|
|
668
|
-
inputValue.value = item.name || "";
|
|
669
|
-
handleBeforeSend();
|
|
116
|
+
const handleLikeSend = (value, idx) => {
|
|
117
|
+
handleSend(value);
|
|
118
|
+
vue.nextTick(() => {
|
|
119
|
+
chatList.value[idx].likeList = [];
|
|
120
|
+
});
|
|
670
121
|
};
|
|
671
|
-
const
|
|
672
|
-
if (
|
|
673
|
-
|
|
674
|
-
if (fn && typeof fn.then === "function") {
|
|
675
|
-
Promise.resolve(fn).then((res) => {
|
|
676
|
-
if (res.result) {
|
|
677
|
-
currentComponentName.value = res.componentName || "";
|
|
678
|
-
handleSend();
|
|
679
|
-
}
|
|
680
|
-
}).catch((error) => {
|
|
681
|
-
console.log(error);
|
|
682
|
-
});
|
|
683
|
-
} else {
|
|
684
|
-
if (fn.result) {
|
|
685
|
-
currentComponentName.value = fn.componentName || "";
|
|
686
|
-
handleSend();
|
|
687
|
-
}
|
|
688
|
-
}
|
|
122
|
+
const handleSelectChange = (idx) => {
|
|
123
|
+
if (isSelectMode.value) {
|
|
124
|
+
chatList.value[idx].selecting = !chatList.value[idx].selecting;
|
|
689
125
|
}
|
|
690
126
|
};
|
|
691
|
-
const
|
|
692
|
-
|
|
693
|
-
emit("beforeSendMessage");
|
|
694
|
-
if (!isDeepSeek.value && scripts && Array.isArray(scripts) && scripts.length > 0) {
|
|
695
|
-
const userInput = content != null ? content : inputValue.value.trim();
|
|
696
|
-
if (!userInput)
|
|
697
|
-
return;
|
|
698
|
-
const userChatId = `user_${Date.now()}`;
|
|
699
|
-
const userMessage = {
|
|
700
|
-
chatId: userChatId,
|
|
701
|
-
user: "u",
|
|
702
|
-
type: "text",
|
|
703
|
-
content: userInput,
|
|
704
|
-
isShowLike: false,
|
|
705
|
-
isShowCopy: true
|
|
706
|
-
};
|
|
707
|
-
chatList.value.push(userMessage);
|
|
708
|
-
emit("sendMessage", [...chatList.value]);
|
|
709
|
-
vue.nextTick(() => {
|
|
710
|
-
scrollToBottom();
|
|
711
|
-
renderContent(userMessage.content, "main", chatList.value.length - 1);
|
|
712
|
-
});
|
|
713
|
-
const result = findMatchingScriptContent(userInput);
|
|
714
|
-
if (result && result.responses.length > 0) {
|
|
715
|
-
currentScriptIndex.value = result.nextIndex;
|
|
716
|
-
const newAiMessages = [];
|
|
717
|
-
result.responses.forEach((response, idx) => {
|
|
718
|
-
const pauseMarker = Array.isArray(response.data) ? "\u200B".repeat(20) : "";
|
|
719
|
-
const content2 = Array.isArray(response.data) ? response.data.join(pauseMarker) : response.data;
|
|
720
|
-
const aiChatId = `ai_${Date.now()}_${idx}`;
|
|
721
|
-
const aiMessage = {
|
|
722
|
-
chatId: aiChatId,
|
|
723
|
-
user: "ai",
|
|
724
|
-
type: "text",
|
|
725
|
-
content: content2 || "",
|
|
726
|
-
componentName: response.type || "",
|
|
727
|
-
isShowLike: true,
|
|
728
|
-
isShowCopy: true
|
|
729
|
-
};
|
|
730
|
-
newAiMessages.push(aiMessage);
|
|
731
|
-
});
|
|
732
|
-
chatList.value.push(...newAiMessages);
|
|
733
|
-
emit("sendMessage", [...chatList.value]);
|
|
734
|
-
vue.nextTick(() => {
|
|
735
|
-
scrollToBottom();
|
|
736
|
-
newAiMessages.forEach((msg) => {
|
|
737
|
-
const msgIndex = chatList.value.findIndex((item) => item.chatId === msg.chatId);
|
|
738
|
-
if (msgIndex !== -1) {
|
|
739
|
-
renderContent(msg.content, "main", msgIndex);
|
|
740
|
-
}
|
|
741
|
-
});
|
|
742
|
-
});
|
|
743
|
-
} else {
|
|
744
|
-
const defaultAiChatId = `ai_${Date.now()}`;
|
|
745
|
-
const defaultAiMessage = {
|
|
746
|
-
chatId: defaultAiChatId,
|
|
747
|
-
user: "ai",
|
|
748
|
-
type: "text",
|
|
749
|
-
content: robotUnmatched,
|
|
750
|
-
isShowLike: true,
|
|
751
|
-
isShowCopy: true
|
|
752
|
-
};
|
|
753
|
-
chatList.value.push(defaultAiMessage);
|
|
754
|
-
emit("sendMessage", [...chatList.value]);
|
|
755
|
-
vue.nextTick(() => {
|
|
756
|
-
scrollToBottom();
|
|
757
|
-
const msgIndex = chatList.value.findIndex((item) => item.chatId === defaultAiChatId);
|
|
758
|
-
if (msgIndex !== -1) {
|
|
759
|
-
renderContent(defaultAiMessage.content, "main", msgIndex);
|
|
760
|
-
}
|
|
761
|
-
});
|
|
762
|
-
}
|
|
763
|
-
inputValue.value = "";
|
|
764
|
-
} else {
|
|
765
|
-
if (content) {
|
|
766
|
-
inputValue.value = content;
|
|
767
|
-
}
|
|
768
|
-
if (isChating.value || !inputValue.value.trim())
|
|
769
|
-
return;
|
|
770
|
-
const userChatId = "user_" + crypto.randomUUID().replace(/-/gi, "");
|
|
771
|
-
const userMessage = {
|
|
772
|
-
chatId: userChatId,
|
|
773
|
-
user: "u",
|
|
774
|
-
type: "text",
|
|
775
|
-
content: inputValue.value
|
|
776
|
-
};
|
|
777
|
-
sendMessageInject(inputValue.value);
|
|
778
|
-
chatList.value.push(userMessage);
|
|
779
|
-
const index = chatList.value.length - 1;
|
|
780
|
-
vue.nextTick(() => {
|
|
781
|
-
renderContent(userMessage.content, "main", index);
|
|
782
|
-
scrollToBottom();
|
|
783
|
-
});
|
|
784
|
-
if (connectionType === "SSE") {
|
|
785
|
-
openSSE(inputValue.value, index + 1, 1);
|
|
786
|
-
} else if (connectionType === "Websocket") {
|
|
787
|
-
let chatInfo = [
|
|
788
|
-
{
|
|
789
|
-
type: "text",
|
|
790
|
-
msgContent: inputValue.value
|
|
791
|
-
}
|
|
792
|
-
];
|
|
793
|
-
(_a = TouchChatRobot.value) == null ? void 0 : _a.send(chatInfo);
|
|
794
|
-
}
|
|
795
|
-
inputValue.value = "";
|
|
796
|
-
}
|
|
127
|
+
const toggleSidebarClick = (item, index) => {
|
|
128
|
+
emit("toggleSidebar", item, index);
|
|
797
129
|
};
|
|
798
|
-
const
|
|
799
|
-
|
|
800
|
-
(_a = fetchStream$1.value) == null ? void 0 : _a.abort();
|
|
801
|
-
const aiIndex = chatList.value.findIndex((item) => item.isChating);
|
|
802
|
-
if (aiIndex !== -1) {
|
|
803
|
-
const currentAiMessage = chatList.value[aiIndex];
|
|
804
|
-
if ((_b = currentAiMessage.content) == null ? void 0 : _b.trim()) {
|
|
805
|
-
vue.nextTick(() => {
|
|
806
|
-
chatList.value[aiIndex] = {
|
|
807
|
-
...currentAiMessage,
|
|
808
|
-
content: currentAiMessage.content + "...",
|
|
809
|
-
isChating: false
|
|
810
|
-
};
|
|
811
|
-
renderContent(chatList.value[aiIndex].content, "main", aiIndex);
|
|
812
|
-
emit("sendMessage", chatList.value);
|
|
813
|
-
});
|
|
814
|
-
} else {
|
|
815
|
-
if (aiIndex > 0) {
|
|
816
|
-
const userMessageIndex = aiIndex - 1;
|
|
817
|
-
if (chatList.value[userMessageIndex].user === "u") {
|
|
818
|
-
chatList.value.splice(userMessageIndex, 2);
|
|
819
|
-
} else {
|
|
820
|
-
chatList.value.splice(aiIndex, 1);
|
|
821
|
-
}
|
|
822
|
-
} else {
|
|
823
|
-
chatList.value.splice(aiIndex, 1);
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
} else {
|
|
827
|
-
const lastIndex = chatList.value.length - 1;
|
|
828
|
-
if (lastIndex >= 0 && chatList.value[lastIndex].user === "u") {
|
|
829
|
-
chatList.value.pop();
|
|
830
|
-
}
|
|
831
|
-
}
|
|
832
|
-
isChating.value = false;
|
|
130
|
+
const openSideBar = (item, index) => {
|
|
131
|
+
emit("openSideBar", item, index);
|
|
833
132
|
};
|
|
834
|
-
const
|
|
835
|
-
if (
|
|
836
|
-
|
|
837
|
-
const endEl = document.querySelector(".to-chat-item:last-child");
|
|
838
|
-
if (endEl == null ? void 0 : endEl.scrollIntoView) {
|
|
839
|
-
endEl.scrollIntoView({ behavior: "smooth", block: "end", inline: "nearest" });
|
|
840
|
-
}
|
|
841
|
-
});
|
|
842
|
-
const handleMessageAction = (action2, index) => {
|
|
843
|
-
const message = chatList.value[index];
|
|
844
|
-
if (!message)
|
|
845
|
-
return;
|
|
846
|
-
switch (action2) {
|
|
847
|
-
case "copy" /* COPY */:
|
|
848
|
-
navigator.clipboard.writeText(message.content).then(() => {
|
|
849
|
-
tools.showToast("\u590D\u5236\u6210\u529F", "info");
|
|
850
|
-
}).catch((err) => {
|
|
851
|
-
console.error("\u590D\u5236\u5931\u8D25:", err);
|
|
852
|
-
tools.showToast("\u590D\u5236\u5931\u8D25", "error");
|
|
853
|
-
});
|
|
854
|
-
break;
|
|
855
|
-
case "edit" /* EDIT */:
|
|
856
|
-
message.isEditing = true;
|
|
857
|
-
message.editContent = message.content;
|
|
858
|
-
break;
|
|
859
|
-
case "delete" /* DELETE */:
|
|
860
|
-
messageUtils.deleteMessageChain(index);
|
|
861
|
-
emit("sendMessage", chatList.value);
|
|
862
|
-
break;
|
|
863
|
-
case "retry" /* RETRY */: {
|
|
864
|
-
const aiMessage = chatList.value[index];
|
|
865
|
-
const userMessageIndex = index - 1;
|
|
866
|
-
const userMessage = chatList.value[userMessageIndex];
|
|
867
|
-
if (userMessage && userMessage.user === "u") {
|
|
868
|
-
const updatedAiMessage = {
|
|
869
|
-
...aiMessage,
|
|
870
|
-
content: "",
|
|
871
|
-
thinkContent: "",
|
|
872
|
-
reasoningContent: "",
|
|
873
|
-
isLiked: false,
|
|
874
|
-
isDisliked: false,
|
|
875
|
-
isChating: true,
|
|
876
|
-
chatId: aiMessage.chatId,
|
|
877
|
-
user: aiMessage.user,
|
|
878
|
-
type: aiMessage.type,
|
|
879
|
-
thinkStatus: "completed" /* COMPLETED */,
|
|
880
|
-
thinkStartTime: 0,
|
|
881
|
-
thinkEndTime: 0
|
|
882
|
-
};
|
|
883
|
-
chatList.value.splice(index, 1, updatedAiMessage);
|
|
884
|
-
vue.nextTick(() => {
|
|
885
|
-
if (htmlContentRef.value[index])
|
|
886
|
-
htmlContentRef.value[index].innerHTML = "";
|
|
887
|
-
if (thinkingContentRef.value[index])
|
|
888
|
-
thinkingContentRef.value[index].innerHTML = "";
|
|
889
|
-
if (reasoningContentRef.value[index])
|
|
890
|
-
reasoningContentRef.value[index].innerHTML = "";
|
|
891
|
-
setTimeout(() => {
|
|
892
|
-
openSSE(userMessage.content || "", index, 2);
|
|
893
|
-
}, 50);
|
|
894
|
-
});
|
|
895
|
-
}
|
|
896
|
-
break;
|
|
897
|
-
}
|
|
898
|
-
case "like" /* LIKE */:
|
|
899
|
-
messageUtils.updateMessage(index, {
|
|
900
|
-
isLiked: true,
|
|
901
|
-
isDisliked: false
|
|
902
|
-
});
|
|
903
|
-
break;
|
|
904
|
-
case "dislike" /* DISLIKE */:
|
|
905
|
-
messageUtils.updateMessage(index, {
|
|
906
|
-
isLiked: false,
|
|
907
|
-
isDisliked: true
|
|
908
|
-
});
|
|
909
|
-
break;
|
|
133
|
+
const handleMessageQuote = (item, index) => {
|
|
134
|
+
if (ChatInputRef.value) {
|
|
135
|
+
ChatInputRef.value.updateQuoteData(item, index);
|
|
910
136
|
}
|
|
911
137
|
};
|
|
912
|
-
const
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
return;
|
|
916
|
-
chatList.value[index] = {
|
|
917
|
-
...message,
|
|
918
|
-
content: newContent,
|
|
919
|
-
isEditing: false,
|
|
920
|
-
editContent: void 0
|
|
921
|
-
};
|
|
922
|
-
vue.nextTick(() => {
|
|
923
|
-
renderContent(message.content, "main", index);
|
|
924
|
-
});
|
|
925
|
-
if (index + 1 < chatList.value.length && chatList.value[index + 1].user === "ai") {
|
|
926
|
-
chatList.value.splice(index + 1, 1);
|
|
138
|
+
const itemUploadFile = (_item, index) => {
|
|
139
|
+
if (ChatInputRef.value) {
|
|
140
|
+
ChatInputRef.value.itemUploadFile(index, "drop");
|
|
927
141
|
}
|
|
928
|
-
openSSE(newContent, index + 1);
|
|
929
|
-
emit("sendMessage", chatList.value);
|
|
930
|
-
};
|
|
931
|
-
const cancelEdit = (index) => {
|
|
932
|
-
const message = chatList.value[index];
|
|
933
|
-
if (!message)
|
|
934
|
-
return;
|
|
935
|
-
message.isEditing = false;
|
|
936
|
-
message.editContent = "";
|
|
937
|
-
vue.nextTick(() => {
|
|
938
|
-
renderContent(message.content, "main", index);
|
|
939
|
-
});
|
|
940
142
|
};
|
|
941
|
-
vue.
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
init();
|
|
948
|
-
},
|
|
949
|
-
{ immediate: false }
|
|
950
|
-
);
|
|
143
|
+
const setInputValue = vue.inject("setInput");
|
|
144
|
+
vue.onMounted(() => {
|
|
145
|
+
setInputValue.value = (value) => {
|
|
146
|
+
inputValue.value = value;
|
|
147
|
+
};
|
|
148
|
+
chatOnMounted();
|
|
951
149
|
vue.watch(
|
|
952
150
|
() => scripts,
|
|
953
151
|
() => {
|
|
954
|
-
|
|
955
|
-
init();
|
|
956
|
-
}
|
|
152
|
+
init();
|
|
957
153
|
},
|
|
958
154
|
{ deep: true, immediate: false }
|
|
959
155
|
);
|
|
960
156
|
});
|
|
961
157
|
vue.onBeforeUnmount(() => {
|
|
962
|
-
|
|
963
|
-
isUnmounting.value = true;
|
|
964
|
-
if (fetchStream$1.value) {
|
|
965
|
-
fetchStream$1.value.abort();
|
|
966
|
-
fetchStream$1.value = null;
|
|
967
|
-
}
|
|
968
|
-
if (TouchChatRobot.value) {
|
|
969
|
-
TouchChatRobot.value.close();
|
|
970
|
-
TouchChatRobot.value = void 0;
|
|
971
|
-
}
|
|
972
|
-
isMounted.value = false;
|
|
973
|
-
renderQueue.value = [];
|
|
974
|
-
htmlContentRef.value = [];
|
|
975
|
-
thinkingContentRef.value = [];
|
|
976
|
-
reasoningContentRef.value = [];
|
|
977
|
-
}
|
|
158
|
+
chatOnBeforeUnmount();
|
|
978
159
|
});
|
|
979
|
-
vue.provide("
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
handleMessageAction
|
|
983
|
-
}
|
|
160
|
+
vue.provide("touchchat", {
|
|
161
|
+
send: sendMessage,
|
|
162
|
+
retry: handleMessageAction
|
|
984
163
|
});
|
|
985
164
|
__expose({
|
|
986
|
-
|
|
987
|
-
handleSend(value);
|
|
988
|
-
}
|
|
165
|
+
send: (value, fileList, auto, type) => {
|
|
166
|
+
handleSend(value, fileList, auto, type);
|
|
167
|
+
},
|
|
168
|
+
handleAgentSelect,
|
|
169
|
+
retry: (index) => {
|
|
170
|
+
handleMessageAction(types.MessageAction.RETRY, index);
|
|
171
|
+
},
|
|
172
|
+
update
|
|
989
173
|
});
|
|
990
174
|
return (_ctx, _cache) => {
|
|
991
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
175
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
176
|
+
class: "touchchat-main",
|
|
177
|
+
onDragover: vue.withModifiers(() => {
|
|
178
|
+
}, ["prevent"]),
|
|
179
|
+
onDragenter: vue.withModifiers(vue.unref(handleDragEnter), ["prevent"]),
|
|
180
|
+
onDragleave: vue.unref(handleDragLeave),
|
|
181
|
+
onDrop: vue.withModifiers(vue.unref(handleDrop), ["prevent"])
|
|
182
|
+
}, [
|
|
992
183
|
vue.createElementVNode("div", {
|
|
993
184
|
ref_key: "chatContainer",
|
|
994
185
|
ref: chatContainer,
|
|
995
|
-
class: "touchchat-dialog"
|
|
186
|
+
class: "touchchat-dialog",
|
|
187
|
+
onScroll: vue.unref(handleScroll)
|
|
996
188
|
}, [
|
|
997
|
-
vue.renderSlot(_ctx.$slots, "
|
|
998
|
-
chatList.
|
|
189
|
+
vue.renderSlot(_ctx.$slots, "top"),
|
|
190
|
+
vue.unref(chatList).length === 0 ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
999
191
|
key: 0,
|
|
1000
192
|
class: "touchchat-welcome"
|
|
1001
193
|
}, [
|
|
1002
194
|
vue.renderSlot(_ctx.$slots, "welcome", {}, () => [
|
|
1003
|
-
vue.createVNode(
|
|
195
|
+
vue.createVNode(HelloChat.default, { onSendMessage: vue.unref(sendMessage) }, null, 8, ["onSendMessage"])
|
|
1004
196
|
])
|
|
1005
|
-
])) : vue.createCommentVNode("", true),
|
|
197
|
+
])) : vue.createCommentVNode("v-if", true),
|
|
1006
198
|
vue.createElementVNode("div", { class: "touchchat-dialog-content" }, [
|
|
1007
|
-
(vue.openBlock(true), vue.createElementBlock(
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
key:
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
item,
|
|
1034
|
-
index,
|
|
1035
|
-
"enable-deep-thinking": enableDeepThinking.value,
|
|
1036
|
-
onCopy: ($event) => handleMessageAction("copy" /* COPY */, index),
|
|
1037
|
-
onRetry: ($event) => handleMessageAction("retry" /* RETRY */, index),
|
|
1038
|
-
onLike: ($event) => handleMessageAction("like" /* LIKE */, index),
|
|
1039
|
-
onDislike: ($event) => handleMessageAction("dislike" /* DISLIKE */, index),
|
|
1040
|
-
onContentRendered: attachCopyButtons,
|
|
1041
|
-
onCompleteRendered: completeRendered,
|
|
1042
|
-
onToggleSidebar: toggleSidebarClick
|
|
1043
|
-
}, {
|
|
1044
|
-
aiMessageContent: vue.withCtx(() => [
|
|
1045
|
-
vue.renderSlot(_ctx.$slots, "aiMessageContent", {
|
|
199
|
+
(vue.openBlock(true), vue.createElementBlock(
|
|
200
|
+
vue.Fragment,
|
|
201
|
+
null,
|
|
202
|
+
vue.renderList(vue.unref(chatList), (item, index) => {
|
|
203
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
204
|
+
key: item.chatId,
|
|
205
|
+
class: "touchchat-list-box"
|
|
206
|
+
}, [
|
|
207
|
+
vue.unref(isSelectMode) ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
208
|
+
key: 0,
|
|
209
|
+
class: "touchchat-list-check"
|
|
210
|
+
}, [
|
|
211
|
+
vue.withDirectives(vue.createElementVNode("input", {
|
|
212
|
+
"onUpdate:modelValue": ($event) => item.selecting = $event,
|
|
213
|
+
class: "input-check",
|
|
214
|
+
type: "checkbox"
|
|
215
|
+
}, null, 8, ["onUpdate:modelValue"]), [
|
|
216
|
+
[vue.vModelCheckbox, item.selecting]
|
|
217
|
+
])
|
|
218
|
+
])) : vue.createCommentVNode("v-if", true),
|
|
219
|
+
vue.createElementVNode("div", {
|
|
220
|
+
class: vue.normalizeClass(["touchchat-list-content", [item.selecting ? "status-select" : "", vue.unref(isSelectMode) ? "select-mode" : ""]]),
|
|
221
|
+
onClick: ($event) => handleSelectChange(index)
|
|
222
|
+
}, [
|
|
223
|
+
item.user === "u" ? (vue.openBlock(), vue.createBlock(UserMessage.default, {
|
|
224
|
+
key: 0,
|
|
1046
225
|
item,
|
|
1047
|
-
index
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
226
|
+
index,
|
|
227
|
+
onUserMessageFileList: itemUploadFile,
|
|
228
|
+
onCopy: ($event) => vue.unref(handleMessageAction)(vue.unref(types.MessageAction).COPY, index),
|
|
229
|
+
onEdit: ($event) => vue.unref(handleMessageAction)(vue.unref(types.MessageAction).EDIT, index),
|
|
230
|
+
onDelete: ($event) => vue.unref(handleMessageAction)(vue.unref(types.MessageAction).DELETE, index),
|
|
231
|
+
onSaveEdit: vue.unref(saveEdit),
|
|
232
|
+
onCancelEdit: ($event) => vue.unref(cancelEdit)(index),
|
|
233
|
+
onWithDraw: ($event) => vue.unref(handleMessageAction)(vue.unref(types.MessageAction).WITHDRAW, index)
|
|
234
|
+
}, {
|
|
235
|
+
userAvatar: vue.withCtx(() => [
|
|
236
|
+
vue.renderSlot(_ctx.$slots, "userAvatar")
|
|
237
|
+
]),
|
|
238
|
+
fn: vue.withCtx(() => [
|
|
239
|
+
vue.renderSlot(_ctx.$slots, "fn", {
|
|
240
|
+
item,
|
|
241
|
+
index
|
|
242
|
+
})
|
|
243
|
+
]),
|
|
244
|
+
_: 2
|
|
245
|
+
/* DYNAMIC */
|
|
246
|
+
}, 1032, ["item", "index", "onCopy", "onEdit", "onDelete", "onSaveEdit", "onCancelEdit", "onWithDraw"])) : vue.createCommentVNode("v-if", true),
|
|
247
|
+
item.user === "withDraw" ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
248
|
+
key: 1,
|
|
249
|
+
class: "touchchat-dialog-withDraw"
|
|
250
|
+
}, "\u4F60\u64A4\u56DE\u4E86\u4E00\u6761\u6D88\u606F")) : vue.createCommentVNode("v-if", true),
|
|
251
|
+
item.user === "ai" ? (vue.openBlock(), vue.createBlock(AiMessage.default, {
|
|
252
|
+
key: 2,
|
|
1055
253
|
item,
|
|
1056
|
-
index
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
254
|
+
index,
|
|
255
|
+
"enable-deep-thinking": vue.unref(enableDeepThinking),
|
|
256
|
+
"has-retry": vue.unref(activeAgentsName) || scriptsLength.value > 0 ? false : true,
|
|
257
|
+
onCopy: ($event) => vue.unref(handleMessageAction)(vue.unref(types.MessageAction).COPY, index),
|
|
258
|
+
onRetry: ($event) => vue.unref(handleMessageAction)(vue.unref(types.MessageAction).RETRY, index),
|
|
259
|
+
onLike: ($event) => vue.unref(handleMessageAction)(vue.unref(types.MessageAction).LIKE, index),
|
|
260
|
+
onQuote: handleMessageQuote,
|
|
261
|
+
onDislike: ($event) => vue.unref(handleMessageAction)(vue.unref(types.MessageAction).DISLIKE, index),
|
|
262
|
+
onContentRendered: attachCopyButtons,
|
|
263
|
+
onCompleteRendered: vue.unref(completeRendered),
|
|
264
|
+
onToggleSidebar: toggleSidebarClick,
|
|
265
|
+
onOpenSideBar: openSideBar,
|
|
266
|
+
onSend: (value) => handleLikeSend(value, index)
|
|
267
|
+
}, {
|
|
268
|
+
aimsg: vue.withCtx(() => [
|
|
269
|
+
vue.renderSlot(_ctx.$slots, "aimsg", {
|
|
270
|
+
item,
|
|
271
|
+
index
|
|
272
|
+
})
|
|
273
|
+
]),
|
|
274
|
+
msg: vue.withCtx(() => [
|
|
275
|
+
vue.renderSlot(_ctx.$slots, "msg", {
|
|
276
|
+
item,
|
|
277
|
+
index
|
|
278
|
+
})
|
|
279
|
+
]),
|
|
280
|
+
aiAvatar: vue.withCtx(() => [
|
|
281
|
+
vue.renderSlot(_ctx.$slots, "aiAvatar")
|
|
282
|
+
]),
|
|
283
|
+
fn: vue.withCtx(() => [
|
|
284
|
+
vue.renderSlot(_ctx.$slots, "fn", {
|
|
285
|
+
item,
|
|
286
|
+
index
|
|
287
|
+
})
|
|
288
|
+
]),
|
|
289
|
+
extendsFn: vue.withCtx(() => [
|
|
290
|
+
vue.renderSlot(_ctx.$slots, "extendsFn", {
|
|
291
|
+
item,
|
|
292
|
+
index
|
|
293
|
+
})
|
|
294
|
+
]),
|
|
295
|
+
mayLike: vue.withCtx(() => [
|
|
296
|
+
vue.renderSlot(_ctx.$slots, "mayLike", {
|
|
297
|
+
item,
|
|
298
|
+
index
|
|
299
|
+
})
|
|
300
|
+
]),
|
|
301
|
+
_: 2
|
|
302
|
+
/* DYNAMIC */
|
|
303
|
+
}, 1032, ["item", "index", "enable-deep-thinking", "has-retry", "onCopy", "onRetry", "onLike", "onDislike", "onCompleteRendered", "onSend"])) : vue.createCommentVNode("v-if", true)
|
|
304
|
+
], 10, ["onClick"])
|
|
305
|
+
]);
|
|
306
|
+
}),
|
|
307
|
+
128
|
|
308
|
+
/* KEYED_FRAGMENT */
|
|
309
|
+
))
|
|
1063
310
|
])
|
|
1064
|
-
],
|
|
1065
|
-
vue.
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
311
|
+
], 40, ["onScroll"]),
|
|
312
|
+
_ctx.$slots.shortcut ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
313
|
+
key: 0,
|
|
314
|
+
class: "touchchat-edit-shortcut"
|
|
315
|
+
}, [
|
|
316
|
+
vue.renderSlot(_ctx.$slots, "shortcut")
|
|
317
|
+
])) : vue.createCommentVNode("v-if", true),
|
|
318
|
+
vue.renderSlot(_ctx.$slots, "edit", {}, () => [
|
|
319
|
+
vue.createVNode(ChatInput.default, {
|
|
320
|
+
ref_key: "ChatInputRef",
|
|
321
|
+
ref: ChatInputRef,
|
|
322
|
+
"input-value": vue.unref(inputValue),
|
|
323
|
+
"onUpdate:inputValue": ($event) => vue.isRef(inputValue) ? inputValue.value = $event : null,
|
|
324
|
+
"enable-deep-thinking": vue.unref(enableDeepThinking),
|
|
325
|
+
"onUpdate:enableDeepThinking": ($event) => vue.isRef(enableDeepThinking) ? enableDeepThinking.value = $event : null,
|
|
326
|
+
"is-chating": vue.unref(isChating),
|
|
327
|
+
onSend: vue.unref(handleBeforeSend),
|
|
328
|
+
onStop: vue.unref(handleStop),
|
|
329
|
+
onToggleDeepThinking: (val) => enableDeepThinking.value = val,
|
|
330
|
+
onModuleInfo: (_info) => {
|
|
331
|
+
}
|
|
332
|
+
}, {
|
|
333
|
+
editTop: vue.withCtx(() => [
|
|
334
|
+
vue.renderSlot(_ctx.$slots, "editTop")
|
|
335
|
+
]),
|
|
336
|
+
editFn: vue.withCtx(() => [
|
|
337
|
+
vue.renderSlot(_ctx.$slots, "editFn")
|
|
338
|
+
]),
|
|
339
|
+
editSubmitRight: vue.withCtx(() => [
|
|
340
|
+
vue.renderSlot(_ctx.$slots, "editSubmitRight")
|
|
341
|
+
]),
|
|
342
|
+
editSubmitLeft: vue.withCtx(() => [
|
|
343
|
+
vue.renderSlot(_ctx.$slots, "editSubmitLeft")
|
|
344
|
+
]),
|
|
345
|
+
_: 3
|
|
346
|
+
/* FORWARDED */
|
|
347
|
+
}, 8, ["input-value", "onUpdate:inputValue", "enable-deep-thinking", "onUpdate:enableDeepThinking", "is-chating", "onSend", "onStop", "onToggleDeepThinking"])
|
|
1076
348
|
])
|
|
1077
|
-
]);
|
|
349
|
+
], 40, ["onDragover", "onDragenter", "onDragleave", "onDrop"]);
|
|
1078
350
|
};
|
|
1079
351
|
}
|
|
1080
352
|
});
|