diff --git a/electron.vite.config.ts b/electron.vite.config.ts index 2d81d04582..5af6104b59 100644 --- a/electron.vite.config.ts +++ b/electron.vite.config.ts @@ -1,4 +1,5 @@ -import react from '@vitejs/plugin-react' +import { sentryVitePlugin } from '@sentry/vite-plugin' +import react from '@vitejs/plugin-react-swc' import { defineConfig, externalizeDepsPlugin } from 'electron-vite' import { resolve } from 'path' import { visualizer } from 'rollup-plugin-visualizer' @@ -52,19 +53,20 @@ export default defineConfig({ renderer: { plugins: [ react({ - babel: { - plugins: [ - [ - 'styled-components', - { - displayName: true, // 开发环境下启用组件名称 - fileName: false, // 不在类名中包含文件名 - pure: true, // 优化性能 - ssr: false // 不需要服务端渲染 - } - ] + plugins: [ + [ + '@swc/plugin-styled-components', + { + displayName: true, // 开发环境下启用组件名称 + fileName: false, // 不在类名中包含文件名 + pure: true, // 优化性能 + ssr: false // 不需要服务端渲染 + } ] - } + ] + }), + sentryVitePlugin({ + authToken: process.env.SENTRY_AUTH_TOKEN }), ...visualizerPlugin('renderer') ], diff --git a/package.json b/package.json index 542cf4df5a..b588ec3025 100644 --- a/package.json +++ b/package.json @@ -170,6 +170,8 @@ "@modelcontextprotocol/sdk": "^1.10.1", "@notionhq/client": "^2.2.15", "@reduxjs/toolkit": "^2.2.5", + "@sentry/vite-plugin": "^3.3.1", + "@swc/plugin-styled-components": "^7.1.3", "@tavily/core": "patch:@tavily/core@npm%3A0.3.1#~/.yarn/patches/@tavily-core-npm-0.3.1-fe69bf2bea.patch", "@tryfabric/martian": "^1.2.4", "@types/adm-zip": "^0.5.7", @@ -190,7 +192,7 @@ "@types/react-virtualized": "^9.22.2", "@types/react-window": "^1", "@types/tinycolor2": "^1", - "@vitejs/plugin-react": "^4.3.4", + "@vitejs/plugin-react-swc": "^3.9.0", "@vitest/coverage-v8": "^3.1.1", "@vitest/ui": "^3.1.1", "analytics": "^0.8.16", diff --git a/src/main/services/MCPService.ts b/src/main/services/MCPService.ts index 14aecc7017..f9bafde24b 100644 --- a/src/main/services/MCPService.ts +++ b/src/main/services/MCPService.ts @@ -162,6 +162,9 @@ class McpService { return new StreamableHTTPClientTransport(new URL(server.baseUrl!), options) } else if (server.type === 'sse') { const options: SSEClientTransportOptions = { + eventSourceInit: { + fetch: (url, init) => fetch(url, { ...init, headers: server.headers || {} }), + }, requestInit: { headers: server.headers || {} }, diff --git a/src/renderer/src/assets/styles/animation.scss b/src/renderer/src/assets/styles/animation.scss index eb6cb3592a..bd3a96e495 100644 --- a/src/renderer/src/assets/styles/animation.scss +++ b/src/renderer/src/assets/styles/animation.scss @@ -16,3 +16,40 @@ --pulse-size: 8px; animation: animation-pulse 1.5s infinite; } + +// Modal动画 +@keyframes animation-move-down-in { + 0% { + transform: translate3d(0, 100%, 0); + transform-origin: 0 0; + opacity: 0; + } + 100% { + transform: translate3d(0, 0, 0); + transform-origin: 0 0; + opacity: 1; + } +} +@keyframes animation-move-down-out { + 0% { + transform: translate3d(0, 0, 0); + transform-origin: 0 0; + opacity: 1; + } + 100% { + transform: translate3d(0, 100%, 0); + transform-origin: 0 0; + opacity: 0; + } +} +.animation-move-down-enter, +.animation-move-down-appear { + animation-name: animation-move-down-in; + animation-fill-mode: both; + animation-duration: 0.25s; +} +.animation-move-down-leave { + animation-name: animation-move-down-out; + animation-fill-mode: both; + animation-duration: 0.25s; +} diff --git a/src/renderer/src/components/Popups/NutsorePathPopup.tsx b/src/renderer/src/components/Popups/NutsorePathPopup.tsx index 1ae06a22de..a0fed77238 100644 --- a/src/renderer/src/components/Popups/NutsorePathPopup.tsx +++ b/src/renderer/src/components/Popups/NutsorePathPopup.tsx @@ -26,7 +26,7 @@ const PopupContainer: React.FC = ({ resolve, fs }) => { = ({ resolve }) => { afterClose={onClose} title={null} width="920px" - transitionName="ant-move-down" + transitionName="animation-move-down" styles={{ content: { padding: 0, diff --git a/src/renderer/src/components/Popups/SelectModelPopup.tsx b/src/renderer/src/components/Popups/SelectModelPopup.tsx index dae30881d6..5ea4d8cb4a 100644 --- a/src/renderer/src/components/Popups/SelectModelPopup.tsx +++ b/src/renderer/src/components/Popups/SelectModelPopup.tsx @@ -176,7 +176,7 @@ const PopupContainer: React.FC = ({ model: activeModel, res open={open} onCancel={onCancel} afterClose={onClose} - transitionName="" + transitionName="animation-move-down" styles={{ content: { borderRadius: 15, // Adjusted border radius diff --git a/src/renderer/src/components/Popups/TemplatePopup.tsx b/src/renderer/src/components/Popups/TemplatePopup.tsx index 5c7189b087..67dc50febf 100644 --- a/src/renderer/src/components/Popups/TemplatePopup.tsx +++ b/src/renderer/src/components/Popups/TemplatePopup.tsx @@ -35,7 +35,7 @@ const PopupContainer: React.FC = ({ title, resolve }) => { onOk={onOk} onCancel={onCancel} afterClose={onClose} - transitionName="ant-move-down" + transitionName="animation-move-down" centered> Name diff --git a/src/renderer/src/components/Popups/TextEditPopup.tsx b/src/renderer/src/components/Popups/TextEditPopup.tsx index dfdd52ac7e..ff19c2554a 100644 --- a/src/renderer/src/components/Popups/TextEditPopup.tsx +++ b/src/renderer/src/components/Popups/TextEditPopup.tsx @@ -69,7 +69,7 @@ const PopupContainer: React.FC = ({ text, textareaProps, modalProps, reso title={t('common.edit')} width="60vw" style={{ maxHeight: '70vh' }} - transitionName="ant-move-down" + transitionName="animation-move-down" okText={t('common.save')} {...modalProps} open={open} diff --git a/src/renderer/src/components/Popups/UserPopup.tsx b/src/renderer/src/components/Popups/UserPopup.tsx index 9bc0d6167f..9d7569effa 100644 --- a/src/renderer/src/components/Popups/UserPopup.tsx +++ b/src/renderer/src/components/Popups/UserPopup.tsx @@ -127,7 +127,7 @@ const PopupContainer: React.FC = ({ resolve }) => { onOk={onOk} onCancel={onCancel} afterClose={onClose} - transitionName="ant-move-down" + transitionName="animation-move-down" centered>
diff --git a/src/renderer/src/pages/knowledge/components/KnowledgeSearchPopup.tsx b/src/renderer/src/pages/knowledge/components/KnowledgeSearchPopup.tsx index fb86130ea3..a2a74c3bab 100644 --- a/src/renderer/src/pages/knowledge/components/KnowledgeSearchPopup.tsx +++ b/src/renderer/src/pages/knowledge/components/KnowledgeSearchPopup.tsx @@ -104,7 +104,7 @@ const PopupContainer: React.FC = ({ base, resolve }) => { width={800} footer={null} centered - transitionName="ant-move-down"> + transitionName="animation-move-down"> = ({ resolve, tab, ...prop afterClose={afterClose} footer={null} title={assistant.name} - transitionName="ant-move-down" + transitionName="animation-move-down" styles={{ content: { padding: 0, diff --git a/src/renderer/src/pages/settings/MCPSettings/EditMcpJsonPopup.tsx b/src/renderer/src/pages/settings/MCPSettings/EditMcpJsonPopup.tsx index 635d3b20ec..426c624c1d 100644 --- a/src/renderer/src/pages/settings/MCPSettings/EditMcpJsonPopup.tsx +++ b/src/renderer/src/pages/settings/MCPSettings/EditMcpJsonPopup.tsx @@ -115,7 +115,7 @@ const PopupContainer: React.FC = ({ resolve }) => { width={800} height="80vh" loading={jsonSaving} - transitionName="ant-move-down" + transitionName="animation-move-down" centered>
diff --git a/src/renderer/src/pages/settings/ModelSettings/TopicNamingModalPopup.tsx b/src/renderer/src/pages/settings/ModelSettings/TopicNamingModalPopup.tsx index 052da6699d..56799bca43 100644 --- a/src/renderer/src/pages/settings/ModelSettings/TopicNamingModalPopup.tsx +++ b/src/renderer/src/pages/settings/ModelSettings/TopicNamingModalPopup.tsx @@ -43,7 +43,7 @@ const PopupContainer: React.FC = ({ resolve }) => { onOk={onOk} onCancel={onCancel} afterClose={onClose} - transitionName="ant-move-down" + transitionName="animation-move-down" footer={null} centered> diff --git a/src/renderer/src/pages/settings/ProviderSettings/ProviderSettingsPopup.tsx b/src/renderer/src/pages/settings/ProviderSettings/ProviderSettingsPopup.tsx index 892ad24ad5..a4a12a6c34 100644 --- a/src/renderer/src/pages/settings/ProviderSettings/ProviderSettingsPopup.tsx +++ b/src/renderer/src/pages/settings/ProviderSettings/ProviderSettingsPopup.tsx @@ -42,7 +42,7 @@ const PopupContainer: React.FC = ({ resolve, ...props }) => { onOk={onOk} onCancel={onCancel} afterClose={onClose} - transitionName="ant-move-down" + transitionName="animation-move-down" centered> = ({ provider, resolve, reject }) => { onOk={onOk} onCancel={onCancel} afterClose={onClose} - transitionName="ant-move-down" + transitionName="animation-move-down" width={300} centered>