From babd6d5bdec874ee3acd4841190bed608eb7b094 Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Wed, 11 Jun 2025 19:15:17 +0800 Subject: [PATCH] feat: chat --- node_modules/.package-lock.json | 19 + node_modules/recorder-core/README.md | 240 + node_modules/recorder-core/index.d.ts | 2 + node_modules/recorder-core/package.json | 32 + .../recorder-core/recorder.mp3.min.d.ts | 2 + .../recorder-core/recorder.mp3.min.js | 6 + .../recorder-core/recorder.wav.min.d.ts | 2 + .../recorder-core/recorder.wav.min.js | 6 + .../app-support/app-miniProgram-wx-support.js | 549 + .../src/app-support/app-native-support.js | 209 + .../recorder-core/src/app-support/app.d.ts | 2 + .../recorder-core/src/app-support/app.js | 450 + .../src/engine/beta-amr-engine.js | 15598 ++++++++ .../recorder-core/src/engine/beta-amr.js | 359 + .../src/engine/beta-ogg-engine.js | 30158 ++++++++++++++++ .../recorder-core/src/engine/beta-ogg.js | 367 + .../recorder-core/src/engine/beta-webm.js | 91 + .../recorder-core/src/engine/g711x.js | 236 + .../recorder-core/src/engine/mp3-engine.js | 11401 ++++++ node_modules/recorder-core/src/engine/mp3.js | 533 + node_modules/recorder-core/src/engine/pcm.js | 174 + node_modules/recorder-core/src/engine/wav.js | 122 + .../src/extensions/asr.aliyun.short.js | 910 + .../src/extensions/buffer_stream.player.js | 887 + .../src/extensions/create-audio.nmn2pcm.js | 372 + .../src/extensions/dtmf.decode.js | 268 + .../src/extensions/dtmf.encode.js | 196 + .../extensions/frequency.histogram.view.js | 377 + .../recorder-core/src/extensions/lib.fft.js | 118 + .../recorder-core/src/extensions/sonic.js | 1155 + .../src/extensions/wavesurfer.view.js | 278 + .../recorder-core/src/extensions/waveview.js | 229 + .../recorder-core/src/i18n/Template.js | 935 + node_modules/recorder-core/src/i18n/en-US.js | 782 + node_modules/recorder-core/src/i18n/es.js | 935 + node_modules/recorder-core/src/i18n/fr.js | 935 + node_modules/recorder-core/src/i18n/zh-CN.js | 41 + .../recorder-core/src/recorder-core.js | 2005 + node_modules/vue3-menus/.npmignore | 106 + node_modules/vue3-menus/LICENSE | 21 + node_modules/vue3-menus/README.md | 385 + node_modules/vue3-menus/index.d.ts | 49 + node_modules/vue3-menus/package.json | 58 + node_modules/vue3-menus/src/App.vue | 353 + node_modules/vue3-menus/src/main.ts | 7 + package-lock.json | 25 + package.json | 6 + ui/src/assets/chat/acoustic-color.svg | 29 + ui/src/assets/chat/acoustic.svg | 29 + ui/src/assets/workflow/icon_assigner.svg | 5 + ui/src/assets/workflow/icon_condition.svg | 3 + ui/src/assets/workflow/icon_docs.svg | 4 + ui/src/assets/workflow/icon_form.svg | 7 + ui/src/assets/workflow/icon_globe_color.svg | 1 + ui/src/assets/workflow/icon_hi.svg | 5 + ui/src/assets/workflow/icon_image.svg | 4 + ui/src/assets/workflow/icon_mcp.svg | 4 + ui/src/assets/workflow/icon_reply.svg | 3 + ui/src/assets/workflow/icon_reranker.svg | 21 + ui/src/assets/workflow/icon_robot.svg | 1 + ui/src/assets/workflow/icon_setting.svg | 3 + .../assets/workflow/icon_speech_to_text.svg | 11 + ui/src/assets/workflow/icon_start.svg | 4 + ui/src/assets/workflow/icon_text-image.svg | 5 + .../assets/workflow/icon_text_to_speech.svg | 11 + ui/src/assets/workflow/icon_tool_outlined.svg | 12 + .../ai-chat/ExecutionDetailDialog.vue | 760 + ui/src/components/ai-chat/KnowledgeSource.vue | 122 + .../ai-chat/ParagraphSourceDialog.vue | 79 + .../ai-chat/component/ParagraphCard.vue | 112 + .../component/answer-content/index.vue | 159 + .../chat-input-operate/TouchChat.vue | 170 + .../component/chat-input-operate/index.vue | 978 + .../ai-chat/component/control/index.vue | 112 + .../operation-button/ChatOperationButton.vue | 556 + .../operation-button/LogOperationButton.vue | 265 + .../component/operation-button/index.vue | 57 + .../component/prologue-content/index.vue | 74 + .../component/question-content/index.vue | 240 + .../component/transition-content/index.vue | 105 + .../ai-chat/component/user-form/index.vue | 399 + ui/src/components/ai-chat/index.scss | 49 + ui/src/components/ai-chat/index.vue | 658 + ui/src/components/app-icon/AppIcon.vue | 6 +- .../app-icon}/KnowledgeIcon.vue | 1 + ui/src/components/card-checkbox/index.vue | 1 - ui/src/components/index.ts | 4 + ui/src/enums/workflow.ts | 21 + ui/src/layout/components/breadcrumb/index.vue | 44 +- .../views/application/ApplicationSetting.vue | 35 +- .../chat-log/component/ChatRecordDrawer.vue | 8 +- .../chat-log/component/EditContentDialog.vue | 65 +- .../chat-log/component/EditMarkDialog.vue | 2 +- ui/src/views/chat-log/index.vue | 1 - ui/src/views/chat/embed/index.vue | 10 +- ui/src/views/chat/mobile/index.vue | 10 +- ui/src/views/chat/pc/index.vue | 8 +- .../component/SelectDatasetDialog.vue | 33 +- ui/src/views/knowledge/index.vue | 1 - .../component/SelectDocumentDialog.vue | 49 +- .../problem/component/DetailProblemDrawer.vue | 4 +- .../component/PermissionSetting.vue | 22 +- ui/src/workflow/icons/ai-chat-node-icon.vue | 2 +- .../workflow/icons/application-node-icon.vue | 9 +- ui/src/workflow/icons/base-node-icon.vue | 2 +- ui/src/workflow/icons/condition-node-icon.vue | 2 +- .../icons/document-extract-node-icon.vue | 2 +- ui/src/workflow/icons/form-node-icon.vue | 2 +- .../workflow/icons/function-lib-node-icon.vue | 2 +- ui/src/workflow/icons/function-node-icon.vue | 2 +- ui/src/workflow/icons/global-icon.vue | 2 +- .../icons/image-generate-node-icon.vue | 2 +- .../icons/image-understand-node-icon.vue | 2 +- ui/src/workflow/icons/mcp-node-icon.vue | 2 +- ui/src/workflow/icons/question-node-icon.vue | 2 +- ui/src/workflow/icons/reply-node-icon.vue | 2 +- ui/src/workflow/icons/reranker-node-icon.vue | 2 +- .../icons/search-dataset-node-icon.vue | 2 +- .../icons/speech-to-text-node-icon.vue | 2 +- ui/src/workflow/icons/start-node-icon.vue | 2 +- .../icons/text-to-speech-node-icon.vue | 2 +- .../icons/variable-assign-node-icon.vue | 2 +- .../workflow/nodes/application-node/index.vue | 4 +- .../nodes/document-extract-node/index.vue | 6 +- .../nodes/search-dataset-node/index.vue | 35 +- 125 files changed, 77179 insertions(+), 286 deletions(-) create mode 100644 node_modules/.package-lock.json create mode 100644 node_modules/recorder-core/README.md create mode 100644 node_modules/recorder-core/index.d.ts create mode 100644 node_modules/recorder-core/package.json create mode 100644 node_modules/recorder-core/recorder.mp3.min.d.ts create mode 100644 node_modules/recorder-core/recorder.mp3.min.js create mode 100644 node_modules/recorder-core/recorder.wav.min.d.ts create mode 100644 node_modules/recorder-core/recorder.wav.min.js create mode 100644 node_modules/recorder-core/src/app-support/app-miniProgram-wx-support.js create mode 100644 node_modules/recorder-core/src/app-support/app-native-support.js create mode 100644 node_modules/recorder-core/src/app-support/app.d.ts create mode 100644 node_modules/recorder-core/src/app-support/app.js create mode 100644 node_modules/recorder-core/src/engine/beta-amr-engine.js create mode 100644 node_modules/recorder-core/src/engine/beta-amr.js create mode 100644 node_modules/recorder-core/src/engine/beta-ogg-engine.js create mode 100644 node_modules/recorder-core/src/engine/beta-ogg.js create mode 100644 node_modules/recorder-core/src/engine/beta-webm.js create mode 100644 node_modules/recorder-core/src/engine/g711x.js create mode 100644 node_modules/recorder-core/src/engine/mp3-engine.js create mode 100644 node_modules/recorder-core/src/engine/mp3.js create mode 100644 node_modules/recorder-core/src/engine/pcm.js create mode 100644 node_modules/recorder-core/src/engine/wav.js create mode 100644 node_modules/recorder-core/src/extensions/asr.aliyun.short.js create mode 100644 node_modules/recorder-core/src/extensions/buffer_stream.player.js create mode 100644 node_modules/recorder-core/src/extensions/create-audio.nmn2pcm.js create mode 100644 node_modules/recorder-core/src/extensions/dtmf.decode.js create mode 100644 node_modules/recorder-core/src/extensions/dtmf.encode.js create mode 100644 node_modules/recorder-core/src/extensions/frequency.histogram.view.js create mode 100644 node_modules/recorder-core/src/extensions/lib.fft.js create mode 100644 node_modules/recorder-core/src/extensions/sonic.js create mode 100644 node_modules/recorder-core/src/extensions/wavesurfer.view.js create mode 100644 node_modules/recorder-core/src/extensions/waveview.js create mode 100644 node_modules/recorder-core/src/i18n/Template.js create mode 100644 node_modules/recorder-core/src/i18n/en-US.js create mode 100644 node_modules/recorder-core/src/i18n/es.js create mode 100644 node_modules/recorder-core/src/i18n/fr.js create mode 100644 node_modules/recorder-core/src/i18n/zh-CN.js create mode 100644 node_modules/recorder-core/src/recorder-core.js create mode 100644 node_modules/vue3-menus/.npmignore create mode 100644 node_modules/vue3-menus/LICENSE create mode 100644 node_modules/vue3-menus/README.md create mode 100644 node_modules/vue3-menus/index.d.ts create mode 100644 node_modules/vue3-menus/package.json create mode 100644 node_modules/vue3-menus/src/App.vue create mode 100644 node_modules/vue3-menus/src/main.ts create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 ui/src/assets/chat/acoustic-color.svg create mode 100644 ui/src/assets/chat/acoustic.svg create mode 100644 ui/src/assets/workflow/icon_assigner.svg create mode 100644 ui/src/assets/workflow/icon_condition.svg create mode 100644 ui/src/assets/workflow/icon_docs.svg create mode 100644 ui/src/assets/workflow/icon_form.svg create mode 100644 ui/src/assets/workflow/icon_globe_color.svg create mode 100644 ui/src/assets/workflow/icon_hi.svg create mode 100644 ui/src/assets/workflow/icon_image.svg create mode 100644 ui/src/assets/workflow/icon_mcp.svg create mode 100644 ui/src/assets/workflow/icon_reply.svg create mode 100644 ui/src/assets/workflow/icon_reranker.svg create mode 100644 ui/src/assets/workflow/icon_robot.svg create mode 100644 ui/src/assets/workflow/icon_setting.svg create mode 100644 ui/src/assets/workflow/icon_speech_to_text.svg create mode 100644 ui/src/assets/workflow/icon_start.svg create mode 100644 ui/src/assets/workflow/icon_text-image.svg create mode 100644 ui/src/assets/workflow/icon_text_to_speech.svg create mode 100644 ui/src/assets/workflow/icon_tool_outlined.svg create mode 100644 ui/src/components/ai-chat/ExecutionDetailDialog.vue create mode 100644 ui/src/components/ai-chat/KnowledgeSource.vue create mode 100644 ui/src/components/ai-chat/ParagraphSourceDialog.vue create mode 100644 ui/src/components/ai-chat/component/ParagraphCard.vue create mode 100644 ui/src/components/ai-chat/component/answer-content/index.vue create mode 100644 ui/src/components/ai-chat/component/chat-input-operate/TouchChat.vue create mode 100644 ui/src/components/ai-chat/component/chat-input-operate/index.vue create mode 100644 ui/src/components/ai-chat/component/control/index.vue create mode 100644 ui/src/components/ai-chat/component/operation-button/ChatOperationButton.vue create mode 100644 ui/src/components/ai-chat/component/operation-button/LogOperationButton.vue create mode 100644 ui/src/components/ai-chat/component/operation-button/index.vue create mode 100644 ui/src/components/ai-chat/component/prologue-content/index.vue create mode 100644 ui/src/components/ai-chat/component/question-content/index.vue create mode 100644 ui/src/components/ai-chat/component/transition-content/index.vue create mode 100644 ui/src/components/ai-chat/component/user-form/index.vue create mode 100644 ui/src/components/ai-chat/index.scss create mode 100644 ui/src/components/ai-chat/index.vue rename ui/src/{views/knowledge/component => components/app-icon}/KnowledgeIcon.vue (94%) create mode 100644 ui/src/enums/workflow.ts diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json new file mode 100644 index 000000000..a76aaa37e --- /dev/null +++ b/node_modules/.package-lock.json @@ -0,0 +1,19 @@ +{ + "name": "MaxKB", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/recorder-core": { + "version": "1.3.25011100", + "resolved": "https://registry.npmmirror.com/recorder-core/-/recorder-core-1.3.25011100.tgz", + "integrity": "sha512-trXsCH0zurhoizT4Z22C0OsM0SDOW+2OvtgRxeLQFwxoFeqFjDjYZsbZEZUiKMJLhBvamI4K7Ic+qZ2LBo74TA==", + "license": "MIT" + }, + "node_modules/vue3-menus": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/vue3-menus/-/vue3-menus-1.1.2.tgz", + "integrity": "sha512-MoX87TH25fbKmmE8PwC+c2kJOSGJheP4pBR2we0RkOrfUDQg7sK+akAZSmQU8o+7dF+xVF2NfKPhoVHOhlX9wQ==", + "license": "MIT" + } + } +} diff --git a/node_modules/recorder-core/README.md b/node_modules/recorder-core/README.md new file mode 100644 index 000000000..bc201a5ec --- /dev/null +++ b/node_modules/recorder-core/README.md @@ -0,0 +1,240 @@ +# Recorder:recorder-core 用于html5录音 + +GitHub: [https://github.com/xiangyuecn/Recorder](https://github.com/xiangyuecn/Recorder) + +Gitee: [https://gitee.com/xiangyuecn/Recorder](https://gitee.com/xiangyuecn/Recorder) + +文档和详细使用方法请参考上面两个Recorder仓库。npm recorder这个名字已被使用,因此在Recorder基础上增加后缀-core,就命名为recorder-core,和Recorder核心文件同名。 + + +# 如何使用 + +## 使用npm安装 +``` +npm install recorder-core +``` + +## 引入Recorder库 +可以使用`import`、`require`、`html script`等你适合的方式来引入js文件,下面的以import为主要参考,其他引入方式根据文件路径自行调整一下就可以了。 +``` javascript +//必须引入的Recorder核心(文件路径是 /src/recorder-core.js 下同),使用import、require都行;recorder-core会自动往window(浏览器环境)或Object(非浏览器环境)下挂载名称为Recorder对象,全局可调用Recorder +import Recorder from 'recorder-core' //注意如果未引用Recorder变量,可能编译时会被优化删除(如vue3 tree-shaking),请改成 import 'recorder-core',或随便调用一下 Recorder.a=1 保证强引用 +//import './你clone的目录/src/recorder-core.js' //clone源码可以按这个方式引入,下同 +//require('./你clone的目录/src/recorder-core.js') //clone源码可以按这个方式引入,下同 +// +``` + +```css +.div { + display: inline-block; + background-color: aqua; + margin: 0 20px; + line-height: 200px; + padding: 0 20px; + height: 200px; +} +``` + +### 指令方式使用 + +```html + + +``` + +### 方法方式使用 + +```html + + +``` + +### 组件方式使用 + +```html + + +``` + +## 参数说明 + +### 单个菜单项参数`MenusItemOptions` + +| 属性 | 描述 | 类型 | 是否必填 | 默认值 | +| :------: | :----------------------------------------------------------: | :--------------------: | :------: | :---------: | +| label | 菜单项名称 | `string` | `true` | — | +| style | 每一项菜单的自定义样式 | `object` | `false` | `{}` | +| icon | 图标参数,内部支持html字符串图标,传入组件时需要实现icon插槽 | `string` \| `其他类型` | `false` | `undefined` | +| disabled | 是否禁用菜单项 | `boolean` | `false` | `undefined` | +| divided | 是否显示分割线 | `boolean` | `false` | `undefined` | +| tip | 没项菜单后面的小提示 | `string` | `false` | `''` | +| hidden | 是否隐藏该项 | `boolean` | `false` | `undefined` | +| children | 子菜单列表信息 | `MenusItemOptions[]` | `false` | `undefined` | +| enter | 菜单项移入事件,返回`null`或`false`不展开子菜单 | `Function()` | `false` | `undefined` | +| click | 菜单项点击事件,返回`null`或`false`不关闭菜单 | `Function()` | `false` | `undefined` | + +### 指令与方法使用参数 + +| 属性 | 描述 | 类型 | 是否必填 | 默认值 | +| :-------: | :---------------------------------------------: | :-------------------: | :------: | :---------: | +| menus | 菜单列表信息 | `MenusItemOptions[]` | `true` | [] | +| menusClass | 菜单外层 `div` 的 `class` 名 | `string` | `false` | `null` | +| itemClass | 菜单每一项的`class`名 | `string` | `false` | `null` | +| minWidth | 菜单容器最小宽度 | `number` \| `string` | `false` | `none` | +| maxWidth | 菜单容器最打宽度 | `number` \| `string` | `false` | `none` | +| zIndex | 菜单层级 | `number` \| `string` | `false` | `3` | +| direction | 菜单打开方向 | `left` \| `right` | `false` | `right` | + +### 组件使用参数 + +| 属性 | 描述 | 类型 | 是否必填 | 默认值 | 插槽传入值 | +| :-------: | :---------------------------------------------: | :-------------------: | :------------------: | :---------: | :-----------------------------------------------: | +| menus | 菜单列表信息 | `MenusItemOptions[]` | `true` | [] | | +| event | 鼠标事件信息(指令使用时不传) | `Event` | 与`position`必填一项 | {} | | +| menusClass | 菜单外层 `div` 的 `class` 名 | `string` | `false` | `null` | | +| itemClass | 菜单每一项的`class`名 | `string` | `false` | `null` | | +| minWidth | 菜单容器最小宽度 | `number` \| `string` | `false` | `none` | | +| maxWidth | 菜单容器最打宽度 | `number` \| `string` | `false` | `none` | | +| zIndex | 菜单层级 | `number` \| `string` | `false` | `3` | | +| direction | 菜单打开方向 | `left` \| `right` | `false` | `right` | | +| open | 控制菜单组件显示 | `boolean` | `true` | `false` | | +| args | 附加参数 | `unknown` | `false` | `undefined` | | +| default | 默认插槽 | `Slot` | `false` | - | `activeIndex`: 当前选中索引, `menu`: 当前菜单项 `MenusItemOptions`, `index`: 当前菜单索引 | +| icon | 图标插槽 | `Slot` | `false` | - | `activeIndex`: 当前选中索引, `menu`: 当前菜单项 `MenusItemOptions`, `index`: 当前菜单索引 | +| label | 菜单标题插槽 | `Slot` | `false` | - | `activeIndex`: 当前选中索引, `menu`: 当前菜单项 `MenusItemOptions`, `index`: 当前菜单索引 | +| suffix | 菜单后缀插槽 | `Slot` | `false` | - | `activeIndex`: 当前选中索引, `menu`: 当前菜单项 `MenusItemOptions`, `index`: 当前菜单索引 | + +### 指令使用配置 + +> 配置参数与方法使用相同 + +| 指令使用方式 | 描述 | 参数类型 | 参数是否必填 | 默认值 | +| :-----------: | :------------------------: | :-----------: | :----------: | :----: | +| v-menus | 绑定元素右击打开菜单 | `MenuOptions` | `true` | - | +| v-menus:all | 绑定元素左右击均可打开菜单 | `MenuOptions` | `true` | - | +| v-menus:left | 绑定元素左击打开 | `MenuOptions` | `true` | - | +| v-menus:right | 绑定元素右击打开 | `MenuOptions` | `true` | - | diff --git a/node_modules/vue3-menus/index.d.ts b/node_modules/vue3-menus/index.d.ts new file mode 100644 index 000000000..b96caf248 --- /dev/null +++ b/node_modules/vue3-menus/index.d.ts @@ -0,0 +1,49 @@ +type menusItemType = { + label: string; + style?: { + [key: string]: string | number + } + icon?: string | unknown; + disabled?: boolean; + divided?: boolean; + enter?: (menu: menusItemType, args: unknown) => unknown; + click?: (menu: menusItemType, args: unknown) => unknown; + children?: Array; + tip?: string; + hidden?: boolean; +} + +type menusType = { + menus: Array; + menusClass?: string; + itemClass?: string; + minWidth?: number | string; + maxWidth?: number | string; + zIndex?: number | string; + direction?: "left" | "right"; +} + +type componentMenusType = menusType & { + event: MouseEvent; + open: boolean; + args?: unknown +} + +declare module 'vue3-menus' { + export const Vue3Menus: import('vue').DefineComponent; + + export const menusEvent: (event: MouseEvent, menus: menusType | Array, args: unknown) => void; + + export const directive: import('vue').Directive>; + + const install: (app: import('vue').App, options: { + name: string + }) => unknown; + export default install; +} + +export { + menusType, + menusItemType +} diff --git a/node_modules/vue3-menus/package.json b/node_modules/vue3-menus/package.json new file mode 100644 index 000000000..03938dc24 --- /dev/null +++ b/node_modules/vue3-menus/package.json @@ -0,0 +1,58 @@ +{ + "name": "vue3-menus", + "version": "1.1.2", + "author": "xufangyi", + "private": false, + "description": "Vue3.0 左右键菜单", + "keywords": [ + "vue", + "vue3", + "vue3-menus", + "contextmenu", + "vue-contextmenu", + "vue3-contextmenu" + ], + "main": "dist/vue3-menus.js", + "module": "dist/vue3-menus.es.js", + "types": "./index.d.ts", + "files": [ + "package.json", + "README.md", + ".gitignore", + "LICENSE", + "dist/vue3-menus.es.js", + "dist/vue3-menus.es.min.js", + "dist/vue3-menus.js", + "dist/vue3-menus.min.js", + "src", + "index.d.ts" + ], + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/xfy520/vue3-menus.git" + }, + "scripts": { + "build": "rollup -c", + "dev": "vite" + }, + "dependencies": {}, + "devDependencies": { + "@babel/core": "^7.15.5", + "@vitejs/plugin-vue": "^1.10.1", + "@vitejs/plugin-vue-jsx": "^1.3.0", + "@vue/compiler-sfc": "3.0.0", + "rollup": "^2.57.0", + "rollup-plugin-babel": "^4.4.0", + "rollup-plugin-clear": "^2.0.7", + "rollup-plugin-commonjs": "^10.1.0", + "rollup-plugin-json": "^4.0.0", + "rollup-plugin-node-resolve": "^5.2.0", + "rollup-plugin-postcss": "3.1.8", + "rollup-plugin-terser": "^7.0.2", + "rollup-plugin-uglify": "^6.0.4", + "rollup-plugin-vue": "^6.0.0", + "vite": "^2.7.0-beta.11", + "vue": "3.0.0" + } +} diff --git a/node_modules/vue3-menus/src/App.vue b/node_modules/vue3-menus/src/App.vue new file mode 100644 index 000000000..da6f6015a --- /dev/null +++ b/node_modules/vue3-menus/src/App.vue @@ -0,0 +1,353 @@ + + + + + diff --git a/node_modules/vue3-menus/src/main.ts b/node_modules/vue3-menus/src/main.ts new file mode 100644 index 000000000..6f9b1a61f --- /dev/null +++ b/node_modules/vue3-menus/src/main.ts @@ -0,0 +1,7 @@ +import { createApp } from 'vue'; +import App from './App.vue'; +import Vue3Menus from '../package/index' + +const app = createApp(App) +app.use(Vue3Menus) +app.mount('#app') diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 000000000..dfde5a34a --- /dev/null +++ b/package-lock.json @@ -0,0 +1,25 @@ +{ + "name": "MaxKB", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "recorder-core": "^1.3.25011100", + "vue3-menus": "^1.1.2" + } + }, + "node_modules/recorder-core": { + "version": "1.3.25011100", + "resolved": "https://registry.npmmirror.com/recorder-core/-/recorder-core-1.3.25011100.tgz", + "integrity": "sha512-trXsCH0zurhoizT4Z22C0OsM0SDOW+2OvtgRxeLQFwxoFeqFjDjYZsbZEZUiKMJLhBvamI4K7Ic+qZ2LBo74TA==", + "license": "MIT" + }, + "node_modules/vue3-menus": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/vue3-menus/-/vue3-menus-1.1.2.tgz", + "integrity": "sha512-MoX87TH25fbKmmE8PwC+c2kJOSGJheP4pBR2we0RkOrfUDQg7sK+akAZSmQU8o+7dF+xVF2NfKPhoVHOhlX9wQ==", + "license": "MIT" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 000000000..b50449e76 --- /dev/null +++ b/package.json @@ -0,0 +1,6 @@ +{ + "dependencies": { + "recorder-core": "^1.3.25011100", + "vue3-menus": "^1.1.2" + } +} diff --git a/ui/src/assets/chat/acoustic-color.svg b/ui/src/assets/chat/acoustic-color.svg new file mode 100644 index 000000000..d9cfa1498 --- /dev/null +++ b/ui/src/assets/chat/acoustic-color.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui/src/assets/chat/acoustic.svg b/ui/src/assets/chat/acoustic.svg new file mode 100644 index 000000000..a400eff9b --- /dev/null +++ b/ui/src/assets/chat/acoustic.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui/src/assets/workflow/icon_assigner.svg b/ui/src/assets/workflow/icon_assigner.svg new file mode 100644 index 000000000..269f075c3 --- /dev/null +++ b/ui/src/assets/workflow/icon_assigner.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/ui/src/assets/workflow/icon_condition.svg b/ui/src/assets/workflow/icon_condition.svg new file mode 100644 index 000000000..2bc80a212 --- /dev/null +++ b/ui/src/assets/workflow/icon_condition.svg @@ -0,0 +1,3 @@ + + + diff --git a/ui/src/assets/workflow/icon_docs.svg b/ui/src/assets/workflow/icon_docs.svg new file mode 100644 index 000000000..9bec0be4a --- /dev/null +++ b/ui/src/assets/workflow/icon_docs.svg @@ -0,0 +1,4 @@ + + + + diff --git a/ui/src/assets/workflow/icon_form.svg b/ui/src/assets/workflow/icon_form.svg new file mode 100644 index 000000000..22a10210d --- /dev/null +++ b/ui/src/assets/workflow/icon_form.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/ui/src/assets/workflow/icon_globe_color.svg b/ui/src/assets/workflow/icon_globe_color.svg new file mode 100644 index 000000000..7ede591d5 --- /dev/null +++ b/ui/src/assets/workflow/icon_globe_color.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ui/src/assets/workflow/icon_hi.svg b/ui/src/assets/workflow/icon_hi.svg new file mode 100644 index 000000000..84bb36ac2 --- /dev/null +++ b/ui/src/assets/workflow/icon_hi.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/ui/src/assets/workflow/icon_image.svg b/ui/src/assets/workflow/icon_image.svg new file mode 100644 index 000000000..f6ee5f551 --- /dev/null +++ b/ui/src/assets/workflow/icon_image.svg @@ -0,0 +1,4 @@ + + + + diff --git a/ui/src/assets/workflow/icon_mcp.svg b/ui/src/assets/workflow/icon_mcp.svg new file mode 100644 index 000000000..1544370a2 --- /dev/null +++ b/ui/src/assets/workflow/icon_mcp.svg @@ -0,0 +1,4 @@ + + + + diff --git a/ui/src/assets/workflow/icon_reply.svg b/ui/src/assets/workflow/icon_reply.svg new file mode 100644 index 000000000..430fc7fc1 --- /dev/null +++ b/ui/src/assets/workflow/icon_reply.svg @@ -0,0 +1,3 @@ + + + diff --git a/ui/src/assets/workflow/icon_reranker.svg b/ui/src/assets/workflow/icon_reranker.svg new file mode 100644 index 000000000..e56112278 --- /dev/null +++ b/ui/src/assets/workflow/icon_reranker.svg @@ -0,0 +1,21 @@ + + + + + + + + + \ No newline at end of file diff --git a/ui/src/assets/workflow/icon_robot.svg b/ui/src/assets/workflow/icon_robot.svg new file mode 100644 index 000000000..cca9ee604 --- /dev/null +++ b/ui/src/assets/workflow/icon_robot.svg @@ -0,0 +1 @@ +MaxKB \ No newline at end of file diff --git a/ui/src/assets/workflow/icon_setting.svg b/ui/src/assets/workflow/icon_setting.svg new file mode 100644 index 000000000..afa97360f --- /dev/null +++ b/ui/src/assets/workflow/icon_setting.svg @@ -0,0 +1,3 @@ + + + diff --git a/ui/src/assets/workflow/icon_speech_to_text.svg b/ui/src/assets/workflow/icon_speech_to_text.svg new file mode 100644 index 000000000..a81d0aac2 --- /dev/null +++ b/ui/src/assets/workflow/icon_speech_to_text.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/ui/src/assets/workflow/icon_start.svg b/ui/src/assets/workflow/icon_start.svg new file mode 100644 index 000000000..0b8d73064 --- /dev/null +++ b/ui/src/assets/workflow/icon_start.svg @@ -0,0 +1,4 @@ + + + + diff --git a/ui/src/assets/workflow/icon_text-image.svg b/ui/src/assets/workflow/icon_text-image.svg new file mode 100644 index 000000000..e59aa52c4 --- /dev/null +++ b/ui/src/assets/workflow/icon_text-image.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/ui/src/assets/workflow/icon_text_to_speech.svg b/ui/src/assets/workflow/icon_text_to_speech.svg new file mode 100644 index 000000000..6c0235744 --- /dev/null +++ b/ui/src/assets/workflow/icon_text_to_speech.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/ui/src/assets/workflow/icon_tool_outlined.svg b/ui/src/assets/workflow/icon_tool_outlined.svg new file mode 100644 index 000000000..dbdef4c24 --- /dev/null +++ b/ui/src/assets/workflow/icon_tool_outlined.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/ui/src/components/ai-chat/ExecutionDetailDialog.vue b/ui/src/components/ai-chat/ExecutionDetailDialog.vue new file mode 100644 index 000000000..98ec1e6fa --- /dev/null +++ b/ui/src/components/ai-chat/ExecutionDetailDialog.vue @@ -0,0 +1,760 @@ + + + diff --git a/ui/src/components/ai-chat/KnowledgeSource.vue b/ui/src/components/ai-chat/KnowledgeSource.vue new file mode 100644 index 000000000..729a6317b --- /dev/null +++ b/ui/src/components/ai-chat/KnowledgeSource.vue @@ -0,0 +1,122 @@ + + + diff --git a/ui/src/components/ai-chat/ParagraphSourceDialog.vue b/ui/src/components/ai-chat/ParagraphSourceDialog.vue new file mode 100644 index 000000000..32195a5c4 --- /dev/null +++ b/ui/src/components/ai-chat/ParagraphSourceDialog.vue @@ -0,0 +1,79 @@ + + + diff --git a/ui/src/components/ai-chat/component/ParagraphCard.vue b/ui/src/components/ai-chat/component/ParagraphCard.vue new file mode 100644 index 000000000..67d4df538 --- /dev/null +++ b/ui/src/components/ai-chat/component/ParagraphCard.vue @@ -0,0 +1,112 @@ + + + diff --git a/ui/src/components/ai-chat/component/answer-content/index.vue b/ui/src/components/ai-chat/component/answer-content/index.vue new file mode 100644 index 000000000..26cd8a0d0 --- /dev/null +++ b/ui/src/components/ai-chat/component/answer-content/index.vue @@ -0,0 +1,159 @@ + + + diff --git a/ui/src/components/ai-chat/component/chat-input-operate/TouchChat.vue b/ui/src/components/ai-chat/component/chat-input-operate/TouchChat.vue new file mode 100644 index 000000000..148baa1b3 --- /dev/null +++ b/ui/src/components/ai-chat/component/chat-input-operate/TouchChat.vue @@ -0,0 +1,170 @@ + + + + + diff --git a/ui/src/components/ai-chat/component/chat-input-operate/index.vue b/ui/src/components/ai-chat/component/chat-input-operate/index.vue new file mode 100644 index 000000000..99068159e --- /dev/null +++ b/ui/src/components/ai-chat/component/chat-input-operate/index.vue @@ -0,0 +1,978 @@ + + + diff --git a/ui/src/components/ai-chat/component/control/index.vue b/ui/src/components/ai-chat/component/control/index.vue new file mode 100644 index 000000000..4b4645b16 --- /dev/null +++ b/ui/src/components/ai-chat/component/control/index.vue @@ -0,0 +1,112 @@ + + + diff --git a/ui/src/components/ai-chat/component/operation-button/ChatOperationButton.vue b/ui/src/components/ai-chat/component/operation-button/ChatOperationButton.vue new file mode 100644 index 000000000..025679648 --- /dev/null +++ b/ui/src/components/ai-chat/component/operation-button/ChatOperationButton.vue @@ -0,0 +1,556 @@ + + + diff --git a/ui/src/components/ai-chat/component/operation-button/LogOperationButton.vue b/ui/src/components/ai-chat/component/operation-button/LogOperationButton.vue new file mode 100644 index 000000000..d1622f124 --- /dev/null +++ b/ui/src/components/ai-chat/component/operation-button/LogOperationButton.vue @@ -0,0 +1,265 @@ + + + diff --git a/ui/src/components/ai-chat/component/operation-button/index.vue b/ui/src/components/ai-chat/component/operation-button/index.vue new file mode 100644 index 000000000..b3c02295d --- /dev/null +++ b/ui/src/components/ai-chat/component/operation-button/index.vue @@ -0,0 +1,57 @@ + + + diff --git a/ui/src/components/ai-chat/component/prologue-content/index.vue b/ui/src/components/ai-chat/component/prologue-content/index.vue new file mode 100644 index 000000000..02ec0c0aa --- /dev/null +++ b/ui/src/components/ai-chat/component/prologue-content/index.vue @@ -0,0 +1,74 @@ + + + diff --git a/ui/src/components/ai-chat/component/question-content/index.vue b/ui/src/components/ai-chat/component/question-content/index.vue new file mode 100644 index 000000000..e422cda19 --- /dev/null +++ b/ui/src/components/ai-chat/component/question-content/index.vue @@ -0,0 +1,240 @@ + + + diff --git a/ui/src/components/ai-chat/component/transition-content/index.vue b/ui/src/components/ai-chat/component/transition-content/index.vue new file mode 100644 index 000000000..a019ee5c0 --- /dev/null +++ b/ui/src/components/ai-chat/component/transition-content/index.vue @@ -0,0 +1,105 @@ + + + diff --git a/ui/src/components/ai-chat/component/user-form/index.vue b/ui/src/components/ai-chat/component/user-form/index.vue new file mode 100644 index 000000000..6579a71fd --- /dev/null +++ b/ui/src/components/ai-chat/component/user-form/index.vue @@ -0,0 +1,399 @@ + + + diff --git a/ui/src/components/ai-chat/index.scss b/ui/src/components/ai-chat/index.scss new file mode 100644 index 000000000..e48f9a29a --- /dev/null +++ b/ui/src/components/ai-chat/index.scss @@ -0,0 +1,49 @@ +.ai-chat { + --padding-left: 36px; + height: 100%; + display: flex; + flex-direction: column; + box-sizing: border-box; + position: relative; + color: var(--app-text-color); + box-sizing: border-box; + &__content { + padding-top: 0; + box-sizing: border-box; + + .avatar { + float: left; + } + + .content { + // padding-left: var(--padding-left); + // padding-right: var(--padding-left); + + :deep(ol) { + margin-left: 16px !important; + } + } + } +} + +.chat-width { + max-width: 80%; + margin: 0 auto; +} +@media only screen and (max-width: 1000px) { + .chat-width { + max-width: 100% !important; + margin: 0 auto; + } +} + +@media only screen and (max-width: 768px) { + .ai-chat { + height: calc(100% - 106px) !important; + } +} +.chat-mobile { + .el-button.is-text:not(.is-disabled):hover { + background: none; + } +} diff --git a/ui/src/components/ai-chat/index.vue b/ui/src/components/ai-chat/index.vue new file mode 100644 index 000000000..e7efe3aa1 --- /dev/null +++ b/ui/src/components/ai-chat/index.vue @@ -0,0 +1,658 @@ + + + diff --git a/ui/src/components/app-icon/AppIcon.vue b/ui/src/components/app-icon/AppIcon.vue index ddf22d06e..37a386c31 100644 --- a/ui/src/components/app-icon/AppIcon.vue +++ b/ui/src/components/app-icon/AppIcon.vue @@ -14,16 +14,16 @@ diff --git a/ui/src/workflow/icons/application-node-icon.vue b/ui/src/workflow/icons/application-node-icon.vue index f78a456b8..fc86eca66 100644 --- a/ui/src/workflow/icons/application-node-icon.vue +++ b/ui/src/workflow/icons/application-node-icon.vue @@ -8,14 +8,7 @@ > - + diff --git a/ui/src/workflow/icons/condition-node-icon.vue b/ui/src/workflow/icons/condition-node-icon.vue index 0a5265308..98edaa561 100644 --- a/ui/src/workflow/icons/condition-node-icon.vue +++ b/ui/src/workflow/icons/condition-node-icon.vue @@ -1,6 +1,6 @@ diff --git a/ui/src/workflow/icons/document-extract-node-icon.vue b/ui/src/workflow/icons/document-extract-node-icon.vue index 92a5819f2..a081bb44f 100644 --- a/ui/src/workflow/icons/document-extract-node-icon.vue +++ b/ui/src/workflow/icons/document-extract-node-icon.vue @@ -1,6 +1,6 @@ diff --git a/ui/src/workflow/icons/form-node-icon.vue b/ui/src/workflow/icons/form-node-icon.vue index 0e469e237..099aef1a7 100644 --- a/ui/src/workflow/icons/form-node-icon.vue +++ b/ui/src/workflow/icons/form-node-icon.vue @@ -1,6 +1,6 @@ diff --git a/ui/src/workflow/icons/function-lib-node-icon.vue b/ui/src/workflow/icons/function-lib-node-icon.vue index 9eaf9064d..0a9d801ae 100644 --- a/ui/src/workflow/icons/function-lib-node-icon.vue +++ b/ui/src/workflow/icons/function-lib-node-icon.vue @@ -9,7 +9,7 @@ - + diff --git a/ui/src/workflow/icons/global-icon.vue b/ui/src/workflow/icons/global-icon.vue index 5d476dc74..0c8ac7432 100644 --- a/ui/src/workflow/icons/global-icon.vue +++ b/ui/src/workflow/icons/global-icon.vue @@ -1,4 +1,4 @@ diff --git a/ui/src/workflow/icons/image-generate-node-icon.vue b/ui/src/workflow/icons/image-generate-node-icon.vue index 0d5c07d53..aceb24856 100644 --- a/ui/src/workflow/icons/image-generate-node-icon.vue +++ b/ui/src/workflow/icons/image-generate-node-icon.vue @@ -1,6 +1,6 @@ diff --git a/ui/src/workflow/icons/image-understand-node-icon.vue b/ui/src/workflow/icons/image-understand-node-icon.vue index aa8880207..26d318f8a 100644 --- a/ui/src/workflow/icons/image-understand-node-icon.vue +++ b/ui/src/workflow/icons/image-understand-node-icon.vue @@ -1,6 +1,6 @@ diff --git a/ui/src/workflow/icons/mcp-node-icon.vue b/ui/src/workflow/icons/mcp-node-icon.vue index 19a373f91..587b4e753 100644 --- a/ui/src/workflow/icons/mcp-node-icon.vue +++ b/ui/src/workflow/icons/mcp-node-icon.vue @@ -1,6 +1,6 @@ diff --git a/ui/src/workflow/icons/question-node-icon.vue b/ui/src/workflow/icons/question-node-icon.vue index f2b67e68e..93982c9c5 100644 --- a/ui/src/workflow/icons/question-node-icon.vue +++ b/ui/src/workflow/icons/question-node-icon.vue @@ -1,6 +1,6 @@ diff --git a/ui/src/workflow/icons/reply-node-icon.vue b/ui/src/workflow/icons/reply-node-icon.vue index 9f3f1da04..f9f15d92f 100644 --- a/ui/src/workflow/icons/reply-node-icon.vue +++ b/ui/src/workflow/icons/reply-node-icon.vue @@ -1,6 +1,6 @@ diff --git a/ui/src/workflow/icons/reranker-node-icon.vue b/ui/src/workflow/icons/reranker-node-icon.vue index 4f2124964..daa68362b 100644 --- a/ui/src/workflow/icons/reranker-node-icon.vue +++ b/ui/src/workflow/icons/reranker-node-icon.vue @@ -1,6 +1,6 @@ diff --git a/ui/src/workflow/icons/search-dataset-node-icon.vue b/ui/src/workflow/icons/search-dataset-node-icon.vue index 3924d464a..6645647c5 100644 --- a/ui/src/workflow/icons/search-dataset-node-icon.vue +++ b/ui/src/workflow/icons/search-dataset-node-icon.vue @@ -1,6 +1,6 @@ diff --git a/ui/src/workflow/icons/speech-to-text-node-icon.vue b/ui/src/workflow/icons/speech-to-text-node-icon.vue index 0be65e7ef..dfaaad739 100644 --- a/ui/src/workflow/icons/speech-to-text-node-icon.vue +++ b/ui/src/workflow/icons/speech-to-text-node-icon.vue @@ -1,6 +1,6 @@ diff --git a/ui/src/workflow/icons/start-node-icon.vue b/ui/src/workflow/icons/start-node-icon.vue index 2c17f93f0..da762ada8 100644 --- a/ui/src/workflow/icons/start-node-icon.vue +++ b/ui/src/workflow/icons/start-node-icon.vue @@ -1,6 +1,6 @@ diff --git a/ui/src/workflow/icons/text-to-speech-node-icon.vue b/ui/src/workflow/icons/text-to-speech-node-icon.vue index 9eb01e3eb..d52c192d4 100644 --- a/ui/src/workflow/icons/text-to-speech-node-icon.vue +++ b/ui/src/workflow/icons/text-to-speech-node-icon.vue @@ -1,6 +1,6 @@ diff --git a/ui/src/workflow/icons/variable-assign-node-icon.vue b/ui/src/workflow/icons/variable-assign-node-icon.vue index 7c97c39cd..554a1022e 100644 --- a/ui/src/workflow/icons/variable-assign-node-icon.vue +++ b/ui/src/workflow/icons/variable-assign-node-icon.vue @@ -1,6 +1,6 @@ diff --git a/ui/src/workflow/nodes/application-node/index.vue b/ui/src/workflow/nodes/application-node/index.vue index f2a3eb7f1..15242f2ab 100644 --- a/ui/src/workflow/nodes/application-node/index.vue +++ b/ui/src/workflow/nodes/application-node/index.vue @@ -37,7 +37,7 @@ :label="$t('views.problem.relateParagraph.selectDocument')" prop="document_list" :rules="{ - message: $t('views.log.documentPlaceholder'), + message: $t('views.chatLog.documentPlaceholder'), trigger: 'blur', required: false }" @@ -46,7 +46,7 @@ ref="nodeCascaderRef" :nodeModel="nodeModel" class="w-full" - :placeholder="$t('views.log.documentPlaceholder')" + :placeholder="$t('views.chatLog.documentPlaceholder')" v-model="form_data.document_list" /> diff --git a/ui/src/workflow/nodes/document-extract-node/index.vue b/ui/src/workflow/nodes/document-extract-node/index.vue index 4e2047efa..c3ebc715c 100644 --- a/ui/src/workflow/nodes/document-extract-node/index.vue +++ b/ui/src/workflow/nodes/document-extract-node/index.vue @@ -13,7 +13,7 @@ @@ -21,7 +21,7 @@ ref="nodeCascaderRef" :nodeModel="nodeModel" class="w-full" - :placeholder="$t('views.log.documentPlaceholder')" + :placeholder="$t('views.chatLog.documentPlaceholder')" v-model="form_data.document_list" /> @@ -61,4 +61,4 @@ const form_data = computed({ \ No newline at end of file + diff --git a/ui/src/workflow/nodes/search-dataset-node/index.vue b/ui/src/workflow/nodes/search-dataset-node/index.vue index ae4779b61..c6c0a2f32 100644 --- a/ui/src/workflow/nodes/search-dataset-node/index.vue +++ b/ui/src/workflow/nodes/search-dataset-node/index.vue @@ -26,26 +26,7 @@