Commit Graph

253 Commits

Author SHA1 Message Date
suyao
bb5000c024 feat(Proxy): Implement proxy management system
- Add ProxyManager service to handle system, custom, and no proxy configurations
- Integrate proxy support for Gemini, Knowledge, and WebDav services
- Add fetch-socks and undici for advanced proxy handling
- Enhance proxy configuration with environment variable and session management
2025-03-11 09:56:40 +08:00
kangfenmao
0e74c71e41 chore: Update project metadata and repository details
- Change author email to support@cherry-ai.com
- Update homepage URL to reflect new GitHub organization
2025-03-10 10:38:02 +08:00
MyPrototypeWhat
1dfd7103e8 refactor: 重构message模块 (#2561)
* feat: Implement Redux-based message management with enhanced state handling

- Add new Redux slice for managing messages with advanced state control
- Introduce topic-specific message queues using p-queue for request management
- Refactor message sending, loading, and updating logic
- Improve error handling and state synchronization with database
- Add selectors for efficient message retrieval and state access

* feat: Implement streaming message handling in Redux store

- Add stream message support in messages slice
- Create MessageStream component for rendering streaming messages
- Update Inputbar and Suggestions components to use new Redux message sending logic
- Refactor message sending flow to use stream message management
- Improve error handling and message state management

* feat:添加StreamMessage,优化数据流展示,减少大面积rerender

* refactor: Simplify messages state management and initialization

- Refactor messages slice to use flat message array instead of separate user/assistant messages
- Add initializeMessagesState thunk to load messages from database on app startup
- Update message-related reducers to work with flat message array
- Modify MessageStream and related components to use new state structure
- Improve type safety and reduce complexity in messages state management

*  feat: add Model Context Protocol (MCP) support (#2809)

*  feat: add Model Context Protocol (MCP) server configuration (main)

- Added `@modelcontextprotocol/sdk` dependency for MCP integration.
- Introduced MCP server configuration UI in settings with add, edit, delete, and activation functionalities.
- Created `useMCPServers` hook to manage MCP server state and actions.
- Added i18n support for MCP settings with translation keys.
- Integrated MCP settings into the application's settings navigation and routing.
- Implemented Redux state management for MCP servers.
- Updated `yarn.lock` with new dependencies and their resolutions.

* 🌟 feat: implement mcp service and integrate with ipc handlers

- Added `MCPService` class to manage Model Context Protocol servers.
- Implemented various handlers in `ipc.ts` for managing MCP servers including listing, adding, updating, deleting, and activating/deactivating servers.
- Integrated MCP related types into existing type declarations for consistency across the application.
- Updated `preload` to expose new MCP related APIs to the renderer process.
- Enhanced `MCPSettings` component to interact directly with the new MCP service for adding, updating, deleting servers and setting their active states.
- Introduced selectors in the MCP Redux slice for fetching active and all servers from the store.
- Moved MCP types to a centralized location in `@renderer/types` for reuse across different parts of the application.

* feat: enhance MCPService initialization to prevent recursive calls and improve error handling

* feat: enhance MCP integration by adding MCPTool type and updating related methods

* feat: implement streaming support for tool calls in OpenAIProvider and enhance message processing

* refactor: Improve message handling and type safety in message components

- Update Message, MessageGroup, MessageStream, and MessageMenubar to require Topic prop
- Modify message sending and resending logic in MessageMenubar
- Remove commented-out code and simplify message state management
- Enhance type safety by explicitly defining prop types

* fix: finish_reason undefined

* refactor: Streamline message resending and state management

- Introduce `resendMessage` thunk for more robust message resending logic
- Update `sendMessage` to support resending existing messages
- Remove deprecated `onEditMessage` callback from MessageMenubar
- Simplify message state updates using Redux actions
- Improve type safety and reduce complexity in message handling

* refactor: Optimize message resending and event handling

- Remove deprecated `APPEND_MESSAGE` event and related callbacks
- Update `resendMessage` thunk to support mentioning new models
- Modify message state synchronization in database
- Simplify dependency arrays and remove unused event listeners
- Add migration step for initializing messages state

* refactor: Enhance message translation and suggestions handling

- Update MessageMenubar to use stream message actions for translation
- Modify Suggestions component to optimize suggestion fetching
- Remove deprecated event listeners and simplify component logic
- Memoize MessageMenubar and Suggestions components for performance
- Trigger AI auto-rename on message completion in messages slice

* refactor: Optimize message streaming with throttled updates

- Introduce throttled message update mechanism using lodash
- Improve performance by limiting Redux state updates during streaming
- Create a separate handler for response message updates
- Enhance message synchronization with database
- Prevent unnecessary re-renders and reduce computational overhead

* fix: Remove unnecessary await in message dispatch

Removes the `await` keyword from the message dispatch in Inputbar, which was causing an unnecessary async operation. Also adds a missing closing brace in the migration configuration file.

* fix: Update Redux persist configuration for messages slice

Modify store configuration to exclude 'messages' slice from persistence and remove unnecessary migration step for message state initialization

* feat: Enhance message streaming and multi-model support

- Refactor Redux messages slice to support multiple stream messages per topic
- Update MessageStream and messages slice to handle message streaming with message-specific IDs
- Implement support for multi-model message generation
- Modify queue concurrency to improve parallel message processing
- Update message selection and streaming logic to be more flexible and robust

* feat: Implement file upload handling in message sending

- Add FileManager service integration for file uploads in Inputbar
- Modify sendMessage action to use uploaded file references
- Update messages slice to conditionally dispatch messages during resend

*  feat(MCP): add support for enabling/disabling MCPServers per message (#2989)

*  feat: add MCP servers in chat input

- Introduce MCPToolsButton component for managing MCP servers
- Add new icon for MCP server tools in iconfont.css
- Update Inputbar to include MCP tools functionality
- Add toggle functionality for enabling/disabling MCP servers
- Implement styled dropdown menu for server selection
- Add necessary type imports and useState for MCP server management

*  feat: add support for enabling/disabling MCPServers per message (main)

- Added `enabledMCPs` property to the `Message` type to track enabled MCPServers.
- Modified `MCPToolsButton` to enable all active MCPServers by default using a new `enableAll` state.
- Introduced `filterMCPTools` utility to filter tools based on enabled MCPServers.
- Updated `AnthropicProvider`, `GeminiProvider`, and `OpenAIProvider` to filter tools using `filterMCPTools`.
- Enhanced `Inputbar` to include `enabledMCPs` in the message payload when set.

*  feat(MCP): add enabledMCPs parameter to sendMessage action

- Update sendMessage action type to include optional enabledMCPs parameter
- Import MCPServer type for type safety
- Modify action signature to support passing enabled MCP servers per message

---------

Co-authored-by: lizhixuan <zhixuan.li@banosuperapp.com>
Co-authored-by: lizhixuan <zhixuanli219643@sohu-inc.com>
Co-authored-by: LiuVaayne <10231735+vaayne@users.noreply.github.com>
Co-authored-by: kangfenmao <kangfenmao@qq.com>
2025-03-08 01:41:05 +08:00
Chen Tao
fa4f0424ab feat: support exa engine (#2870)
* feat: support exa engine

* chore
2025-03-06 22:44:43 +08:00
Chen Tao
a00e7df084 feat: refactor web search logic and support searxng (#2543)
* feat: support searxng model and refactor web search provider

* feat: basic refactor

* stash: web search settings page

* chore: refactor general setting and provider page

* feat: finish basic refactor and add searxng search

* feat: finish refactor

* chore(version): 1.0.2

* feat: change blacklist match pattern

* Merge branch 'main' into feat-websearch

* chore: add migrate

* chore: add old version migrate

* refactor UI

* chore(version): 1.0.5

* fix: update provider enabled: true, when check seach

* chore: fix migrate bug

---------

Co-authored-by: kangfenmao <kangfenmao@qq.com>
2025-03-06 16:17:26 +08:00
LiuVaayne
eda82fa23e feat: add Model Context Protocol (MCP) support (#2809)
*  feat: add Model Context Protocol (MCP) server configuration (main)

- Added `@modelcontextprotocol/sdk` dependency for MCP integration.
- Introduced MCP server configuration UI in settings with add, edit, delete, and activation functionalities.
- Created `useMCPServers` hook to manage MCP server state and actions.
- Added i18n support for MCP settings with translation keys.
- Integrated MCP settings into the application's settings navigation and routing.
- Implemented Redux state management for MCP servers.
- Updated `yarn.lock` with new dependencies and their resolutions.

* 🌟 feat: implement mcp service and integrate with ipc handlers

- Added `MCPService` class to manage Model Context Protocol servers.
- Implemented various handlers in `ipc.ts` for managing MCP servers including listing, adding, updating, deleting, and activating/deactivating servers.
- Integrated MCP related types into existing type declarations for consistency across the application.
- Updated `preload` to expose new MCP related APIs to the renderer process.
- Enhanced `MCPSettings` component to interact directly with the new MCP service for adding, updating, deleting servers and setting their active states.
- Introduced selectors in the MCP Redux slice for fetching active and all servers from the store.
- Moved MCP types to a centralized location in `@renderer/types` for reuse across different parts of the application.

* feat: enhance MCPService initialization to prevent recursive calls and improve error handling

* feat: enhance MCP integration by adding MCPTool type and updating related methods

* feat: implement streaming support for tool calls in OpenAIProvider and enhance message processing
2025-03-06 11:35:29 +08:00
ousugo
4a8307195b chore(version): 1.0.6 2025-03-05 21:54:39 +08:00
kangfenmao
59edb7eba5 chore(version): 1.0.5 2025-03-05 15:53:08 +08:00
kangfenmao
0624630e66 chore: Move html-to-image package to dev dependencies 2025-03-04 15:42:38 +08:00
SuYao
1edac8ebb5 refactor: Replace html2canvas with html-to-image for improved sup element (#2739)
* refactor: Replace html2canvas with html-to-image for improved screenshot capture

* refactor: Simplify scrollable div capture method

* refactor: Simplify captureScrollableDivAsBlob method

* fix: Specify PNG format in captureScrollableDivAsBlob method

* feat: Add error handling for large content dimensions in screenshot capture

* fix: Reorder error messages in en-us.json locale file
2025-03-04 15:37:29 +08:00
kangfenmao
61331e716b chore(version): 1.0.4 2025-03-02 21:35:49 +08:00
kangfenmao
dfc3ed672f chore(version): 1.0.3 2025-03-02 20:54:41 +08:00
lizhixuan
f524df4712 feat: Enhance Styled Components configuration and prop handling
- Add Babel plugin for styled-components with performance and naming optimizations
- Integrate @emotion/is-prop-valid for improved prop filtering in StyleSheetManager
- Update Antd Input components to use variant="borderless" instead of deprecated bordered prop
- Add new dependencies for styled-components configuration
2025-03-02 19:47:11 +08:00
kangfenmao
7a4be73dc0 revert: some proxy errors in main process (#2294) 2025-03-01 23:17:44 +08:00
SuYao
04ef027417 feat: Add reasoning effort control for Claude 3.7 (#2540)
* feat: Add reasoning effort control for Anthropic models with Anthropic Provider and OpenAI Provider

- Add reasoning effort settings with low/medium/high options
- Implement reasoning effort for Claude 3.7 Sonnet models
- Update localization tips for reasoning effort
- Enhance provider handling of reasoning effort parameters

* fix: Extract o1-mini and o1-preview

* fix: Add OpenAI o-series model to ReasoningModel

* fix: Improve OpenAI o-series model detection

* style: Reduce font size

* fix: Add default token handling using DEFAULT_MAX_TOKENS

* fix: Add beta parameter for Anthropic reasoning models
2025-03-01 21:22:12 +08:00
kangfenmao
0854b458bf chore(version): 1.0.2 2025-03-01 12:25:33 +08:00
SuYao
9d3ca4f1f0 fix: some proxy errors in main process (#2294)
* formatter proxy config type

* fix: some proxy errors in main process

* chore: Remove debug logging in ProxyManager
2025-02-27 16:46:05 +08:00
kangfenmao
e2fb619358 chore(version): 1.0.1 2025-02-26 17:28:08 +08:00
kangfenmao
157cb7b4c1 chore(version): 1.0.0 2025-02-23 15:10:24 +08:00
kangfenmao
966f843d26 chore: Update Tavily core package and remove js-tiktoken dependency 2025-02-23 11:01:30 +08:00
kangfenmao
7e6e6d21c1 feat: add web search 2025-02-23 11:01:29 +08:00
kangfenmao
1d9f471aca chore(version): 0.9.30 2025-02-23 07:02:00 +08:00
kangfenmao
4e3b12c531 chore(version): 0.9.29 2025-02-22 22:58:19 +08:00
kangfenmao
e3727c04ee chore(version): 0.9.28 2025-02-21 18:25:30 +08:00
kangfenmao
ffbfd87795 chore: Upgrade Yarn and TypeScript patch versions 2025-02-21 14:18:16 +08:00
Yrom
d73d92e795 feat: Add PlantUML diagram support (via PlantUML official online server) 2025-02-19 18:37:05 +08:00
kangfenmao
e960aac867 chore(version): 0.9.27 2025-02-19 10:21:12 +08:00
kangfenmao
e6f3663e9b chore(version): 0.9.26 2025-02-18 20:55:04 +08:00
kangfenmao
e5ace39a75 chore(version): 0.9.25 2025-02-18 10:41:44 +08:00
shniubobo
1043430568 fix: Rendering error with MathJax for Chinese text 2025-02-17 16:24:38 +08:00
bC2y5tal
7a7f51d5f3 feat: Add EPUB file support to document loader 2025-02-16 13:46:52 +08:00
kangfenmao
1f29aa0133 chore(version): 0.9.24 2025-02-14 15:04:59 +08:00
kangfenmao
2fb628aede chore(version): 0.9.23 2025-02-13 17:49:06 +08:00
kangfenmao
9b74e88884 feat: Enhance file processing and loader configuration
- Remove image loader from dependencies
- Update file loading to skip image, video, and audio files
- Add logging for knowledge base file processing
- Modify common file extensions list
- Add type ignore for LocalPathLoader to resolve TypeScript issues
2025-02-13 17:49:06 +08:00
kangfenmao
bfd25a8c8c chore(version): 0.9.22 2025-02-13 14:02:45 +08:00
kangfenmao
dc82b3b970 feat: Improve token limit settings and knowledge base URL handling
- Update OpenAI package to version 4.77.3
- Add confirmation modal for max tokens setting
- Modify max tokens input to use InputNumber instead of Slider
- Update localization strings for max tokens and URL input
- Enhance knowledge base URL input to support multiple URLs
- Improve error handling and input validation
2025-02-13 13:12:51 +08:00
kangfenmao
0d8b8cf7e7 style: code format 2025-02-13 11:40:55 +08:00
Chen Tao
65596a355d feat: knowledge base support more file types (#1300)
* feat: knowledge base support more file types

* chore: add common document types

* feat: finish basic odloader

* feat: finish open document loader

* feat: support more type from dictionary

* fix: 删除目录时仍能检索到信息

* chore
2025-02-13 11:36:33 +08:00
Chen Tao
dab6271101 feat: add i18n sync script (#1538)
* feat: add i18n sync script

* chore
2025-02-13 11:34:23 +08:00
kangfenmao
d8d97ff637 feat: Add image loader to embedjs configuration 2025-02-11 22:55:49 +08:00
kangfenmao
e06a510e9c chore: Update embedjs dependencies to version 0.1.28 2025-02-11 22:36:34 +08:00
Trey Dong
fa5522bbff feat: 增加导出话题至Notion的功能 (#1331)
* feat: 新增导出至Notion的选项

* fix:添加多语言支持

* fix:添加提示语的多语言支持,以及防止重复导入的状态

* fix:修复多语言错误及调整UI样式统一
2025-02-11 11:27:01 +08:00
kangfenmao
055173b2ef chore(version): 0.9.21 2025-02-09 10:20:03 +08:00
kangfenmao
9bca10774b chore(version): 0.9.20 2025-02-09 00:05:15 +08:00
kangfenmao
d906592431 feat: add baidu cloud provider 2025-02-07 16:47:29 +08:00
kangfenmao
c5fae17677 chore(version): 0.9.19 2025-02-05 21:34:55 +08:00
kangfenmao
909e88f8a3 chore(version): 0.9.18 2025-02-04 22:37:31 +08:00
kangfenmao
109d948680 chore(version): 0.9.17 2025-01-24 13:54:04 +08:00
kangfenmao
9ed7d1f657 chore(version): 0.9.16 2025-01-22 16:32:57 +08:00
kangfenmao
5c3afaa5ed chore(version): 0.9.15 2025-01-21 14:28:01 +08:00