Compare commits

...

1279 Commits

Author SHA1 Message Date
eeee0717
6e44baf3b1 Merge branch 'feat/selection-assistant-mac-version' into feat/1.5.0-rc.2 2025-06-28 21:20:39 +08:00
fullex
2afc65bfc6 Merge branch 'CherryHQ:main' into feat/selection-assistant-mac-version 2025-06-28 21:18:03 +08:00
fullex
501c352d8b Merge pull request #1 from teojs/feat/selection-assistant-mac-version
feat(SelectionToolbar): enhance styling and layout of selection toolbar
2025-06-28 21:12:06 +08:00
kangfenmao
27d22e90d4 chore(version): 1.4.7 2025-06-28 20:38:53 +08:00
Teo
6e3079c1ae feat(SelectionToolbar): update button padding and add last button padding for improved layout 2025-06-28 20:28:37 +08:00
eeee0717
26b8f34634 Merge branch 'feat/selection-assistant-mac-version' into feat/1.5.0-rc.2 2025-06-28 20:14:07 +08:00
eeee0717
f7822bdd89 fix: remove compression to tool directory 2025-06-28 20:05:37 +08:00
Kingsword
101d73fc10 ♻️ refactor(ContentSearch): ContentSearch to use CSS highlights API (#7493) 2025-06-28 20:04:03 +08:00
fullex
b1c8811622 Merge branch 'main' of https://github.com/CherryHQ/cherry-studio into feat/selection-assistant-mac-version 2025-06-28 19:46:44 +08:00
fullex
d966c286ff feat(SelectionService): enhance toolbar window settings and refactor position calculation 2025-06-28 19:38:42 +08:00
eeee0717
98de63b0f3 chore: add i18n 2025-06-28 19:37:48 +08:00
eeee0717
8e34b024e2 Merge branch 'main' into feat/1.5.0-rc.2 2025-06-28 19:24:49 +08:00
one
8de6ae1772 fix(Menubar): icon for multi select (#7635) 2025-06-28 19:00:26 +08:00
beyondkmp
ece59cfacf fix(migrate): handle state return in migration process and add upgradechannel setting (#7634)
* fix(migrate): handle state return in migration process and add upgrade channel setting

* fix(migrate): move upgrade channel setting to the correct migration step
2025-06-28 17:52:36 +08:00
beyondkmp
780373d5f7 fix: 测试版本 (#7590)
* feat(AppUpdater): add support for pre-release versions and enhance feed URL logic

- Introduced a new FeedUrl for the lowest pre-release version.
- Updated AppUpdater to handle early access and upgrade channel settings more effectively.
- Enhanced IPC logging for early access and upgrade channel changes.
- Refactored feed URL setting logic to streamline update processes.

* fix(AppUpdater, ipc): enhance early access and upgrade channel handling

- Added checks to prevent unnecessary cancellation of downloads when early access and upgrade channel settings remain unchanged.
- Updated IPC handlers to ensure early access is enabled when switching upgrade channels if it was previously disabled.
- Improved logging for better traceability of changes in early access and upgrade channel settings.

* delete code

* delete logs

* refactor(AboutSettings): enhance upgrade channel management

- Introduced logic to determine the current upgrade channel based on version.
- Refactored available test channels to use a more structured approach with tooltips and labels.
- Updated the method for retrieving available test channels to improve clarity and maintainability.

* feat(IpcChannel, ConfigManager, AppUpdater): implement test plan and channel management

- Replaced early access features with test plan and test channel options in IpcChannel and ConfigManager.
- Updated IPC handlers to manage test plan and test channel settings, including logging enhancements.
- Refactored AppUpdater to support fetching pre-release versions based on the selected test channel.
- Modified settings and localization files to reflect the new test plan functionality.
- Adjusted AboutSettings and related components to integrate test plan management and improve user experience.

* format code

* refactor(AppUpdater, AboutSettings): improve test channel logic and localization updates

- Refactored the logic in AppUpdater to enhance the handling of test channels, ensuring correct channel retrieval based on the current version.
- Updated the AboutSettings component to include useEffect for managing test channel changes and displaying appropriate warnings.
- Modified localization files for multiple languages to clarify the behavior of test version switching, aligning with the new logic.
2025-06-28 17:17:47 +08:00
SuYao
dfcebe9767 fix(models): update regex patterns for Doubao models and enhance function checks (#7624)
- Adjusted regex for visionAllowedModels and DOUBAO_THINKING_MODEL_REGEX to allow for optional suffixes.
- Enhanced isFunctionCallingModel and isDoubaoThinkingAutoModel functions to check both model.id and model.name for better matching.
2025-06-28 16:58:17 +08:00
自由的世界人
daaf9c2b06 fix: move ContentSearch below Messages in Chat layout (#7628)
Reordered the ContentSearch component to render after the Messages component within the Chat page. This change likely improves the UI flow by displaying the search functionality below the chat messages.
2025-06-28 16:51:49 +08:00
happyZYM
83b95f9830 fix: restore strict no-think for Openrouter provider with latest api (#7620) 2025-06-28 16:45:54 +08:00
beyondkmp
cf87a840f7 fix(FileStorage): remove redundant WordExtractor import (#7625) 2025-06-28 16:45:02 +08:00
Wang Jiyuan
49653435c2 fix(models): Add inference model detection for qwen-plus and qwen-turbo (#7622)
feat(models): 添加对qwen-plus和qwen-turbo模型的推理模型判断
2025-06-28 14:10:55 +08:00
beyondkmp
14e31018f7 fix: support spell check for mini app (#7602)
* feat(IpcChannel): add Webview_SetSpellCheckEnabled channel and implement spell check handling for webviews

- Introduced a new IPC channel for enabling/disabling spell check in webviews.
- Updated the registerIpc function to handle spell check settings for all webviews.
- Enhanced WebviewContainer to set spell check state on DOM ready event.
- Refactored context menu setup to accommodate webview context menus.

* refactor(ContextMenu): update methods to use Electron.WebContents instead of BrowserWindow

- Changed method signatures to accept Electron.WebContents for better context handling.
- Updated internal calls to utilize the new WebContents reference for toggling dev tools and managing spell check functionality.

* refactor(WebviewContainer): clean up import order and remove unused code

- Adjusted the import order in WebviewContainer.tsx for better readability.
- Removed redundant import of useSettings to streamline the component.
2025-06-28 08:36:32 +08:00
Wang Jiyuan
2d3f5baf72 feat: Increase the upper limit of web search results (#7439)
* fix(WebSearchSettings): 将最大搜索结果限制从20增加到50

* fix(WebSearchSettings): 调整搜索结果滑块宽度并添加50的标记
2025-06-27 22:33:27 +08:00
one
c7c1cf2552 refactor: increase css editor height, fix EditMcpJsonPopup (#7535)
* refactor: increase css editor height

* fix: lint warnings

* refactor: use vh for height

* fix: editmcpjsonpopup editor unavailable after deleting all the code
2025-06-27 21:53:43 +08:00
Teo
c302a04c3e feat(SelectionToolbar): enhance styling and layout of selection toolbar components 2025-06-27 18:49:14 +08:00
Chen Tao
98b12fb800 fix: tei reranker (#7606)
fix(tei)
2025-06-27 18:07:17 +08:00
one
d463d6ea2e feat(WebSearch): support RAG for external websearch, improve feedback (#7446)
* feat(WebSearch, RAG): support RAG for external websearch

* refactor(WebSearch): handle content limit in service

* refactor: update migrate

* refactor: UI, constants, types

* refactor: migrate contentLimit to cutoffLimit

* refactor: update default rag document count

* refactor: add a helper function for merging references

* refactor: reference filtering

* feat: feedback for websearch phases

* feat: support cutoff by token

* refactor: add a warning and fix the bound of cutoff limit

* fix: not pass `dimensions` if it is not set by the user

* refactor: update i18n and error message

* refactor: improve UI

* fix: cutoff unit style
2025-06-27 18:04:42 +08:00
Wei Lin
1fe439bb51 docs: add 20 language links of README (#7611)
PR adds 20 languages link to the README and user can easily to access translated READEME, supports google/bing multiple languages SEO search.

Page demo https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=ja

> OpenAiTx is free and open-source : https://github.com/OpenAiTx/OpenAiTx

![Image](https://github.com/user-attachments/assets/41c79fad-5f63-4ed3-8d48-99f3b89879ba)
2025-06-27 18:02:37 +08:00
one
3726ceaf48 refactor: use useLayoutEffect for shiki renderer 2025-06-27 17:56:19 +08:00
one
639ddd5628 refactor: add ShikiTokensRendererProps 2025-06-27 17:56:19 +08:00
one
16772c1d37 refactor(CodePreview): line numbers as elements 2025-06-27 17:56:19 +08:00
one
766897e733 refactor: show error on missing mcp tool (#7587) 2025-06-27 16:09:06 +08:00
fullex
f4367f5589 feat(SelectionService): update toolbar window settings for macOS and Windows
- Set the toolbar window to be hidden in Mission Control and accept the first mouse click on macOS.
- Adjusted visibility settings for the toolbar window to ensure it appears correctly on all workspaces, including full-screen mode.
- Refactored the MacProcessTrustHintModal component to improve layout and styling of buttons in the modal footer.
2025-06-27 15:19:42 +08:00
one
e8e9a2d86f fix(Markdown, LaTeX): do not touch escaped brackets (#7582)
- Keep `\\[` as is
- Use a custom match algorithm rather than balanced match
2025-06-27 13:46:09 +08:00
Wang Jiyuan
a6b53457b0 fix(models): Resolve case sensitivity issue with model names (#7595)
* fix(models): 修复模型名称大小写敏感问题

确保在检查支持的禁用生成模型时,将模型名称统一转换为小写进行比较

* feat(utils): 添加获取小写基础模型名称的函数

新增 getLowerBaseModelName 函数,用于从模型ID中提取基础名称并转换为小写
替换多处直接调用 getBaseModelName().toLowerCase() 的代码,提高代码复用性
2025-06-27 13:45:15 +08:00
Teo
093d04c386 fix(Selector): Fix the issue with the Selector component being selected. (#7600)
* fix(Selector): update value comparison logic to use 'some' for selected values

* feat(ModelSettings): add ChevronDown icon as suffix for Select components
2025-06-27 12:15:39 +08:00
fullex
210586f2e9 Merge branch 'main' of https://github.com/CherryHQ/cherry-studio into feat/selection-assistant-mac-version 2025-06-26 18:33:44 +08:00
kangfenmao
46de46965f chore(version): 1.4.6 2025-06-26 18:19:27 +08:00
Teo
f5165e12f1 fix(Messages): Fix single model response style issue (#7560)
* fix(Messages): update multiModelMessageStyle condition to check message count

* style(Messages): update styles for MultiSelectionPopup and MessageGroup components
2025-06-26 17:05:48 +08:00
亢奋猫
0160655dba feat(FileStorage): enhance open dialog to handle large files by retur… (#7568)
feat(FileStorage): enhance open dialog to handle large files by returning size without reading content

- Updated the open method to return file size for files larger than 2GB without reading their content.
- Modified return type to include an optional content field and size property for better file handling.

修复恢复备份的时候选择超过 2GB 文件报错的问题
2025-06-26 16:48:56 +08:00
one
8723bbeaf8 fix(Markdown): falsely early return for display \[\n...\n\] (#7565) 2025-06-26 15:52:58 +08:00
beyondkmp
4c66b205bb feat: implement early access feature toggle and update related configurations (#7304)
* feat: implement early access feature toggle and update related configurations

- Replace FeedUrl with EnableEarlyAccess in IpcChannel and ConfigManager
- Update AppUpdater to handle early access updates from GitHub
- Modify settings and localization files to reflect early access functionality
- Ensure proper integration in the renderer and preload layers

* fix: enhance error handling in AppUpdater for GitHub release fetching

- Wrap the fetch call in a try-catch block to handle potential errors when retrieving the latest non-draft version from GitHub.
- Log an error message if the fetch fails and return a default feed URL.

* refactor: remove early access feature handling from AppUpdater

- Eliminate the early access feature toggle logic from the AppUpdater class.
- Adjust the feed URL setting to ensure it retrieves the latest non-draft version from GitHub when applicable.
- Clean up unnecessary user-agent header in the fetch request.

* feat(AppUpdater): enhance update feed URL logic and disable differential downloads

- Introduced a new private method to streamline feed URL setting based on early access and IP country.
- Disabled differential downloads for compatibility with GitHub and GitCode.
- Cleaned up the checkForUpdates method for better readability and maintainability.

* refactor(AppUpdater): simplify early access feed URL logic

- Consolidated the feed URL setting logic in setEnableEarlyAccess to a single line for improved readability.
- Removed redundant conditional checks while maintaining functionality for early access updates.

* refactor(AppUpdater): update feed URL structure and remove early access setting

- Modified the return structure of the latest release URL to include the channel type.
- Removed the early access setting from the IPC handler, streamlining the update process.
- Ensured the autoUpdater channel is set based on the latest release information.

* feat(UpgradeChannel): add upgrade channel management and IPC integration

- Introduced a new UpgradeChannel enum to manage different upgrade paths (latest, rc, beta).
- Updated IpcChannel to include App_SetUpgradeChannel for setting the upgrade channel.
- Enhanced ConfigManager to store and retrieve the selected upgrade channel.
- Modified AppUpdater to fetch pre-release versions based on the selected upgrade channel.
- Updated settings UI to allow users to select their preferred upgrade channel with tooltips for guidance.
- Localized new strings for upgrade channel options in multiple languages.

* refactor(AboutSettings): update version type detection and localize upgrade channel tooltips

- Changed version type detection to use the UpgradeChannel enum for better clarity.
- Localized success messages for switching upgrade channels to enhance user experience.

* chore: update version to 1.4.4-beta.1 and refactor upgrade channel handling in AboutSettings

- Updated package version to 1.4.4-beta.1.
- Renamed version type detection function to getVersionChannel for clarity.
- Refactored available version options to getAvailableTestChannels for better organization.
- Added logic to clear update info when switching upgrade channels and when toggling early access settings.

* chore: update version to 1.4.4 in package.json

* fix lint error

* feat(AppUpdater): enhance upgrade channel management and localization

- Added cancellation functionality for ongoing downloads in AppUpdater.
- Introduced a new upgrade channel option for the latest stable version.
- Updated IPC handlers to cancel downloads when changing early access settings or upgrade channels.
- Localized new strings for the latest version option in multiple languages.
- Refactored AboutSettings to include the latest version in the upgrade channel selection.

* refactor(AboutSettings): remove version channel detection logic

- Eliminated the getVersionChannel function to simplify version handling.
- Updated AboutSettings to streamline upgrade channel management.

* feat(AboutSettings): set default upgrade channel to latest

- Updated the AboutSettings component to set the default value of the upgrade channel to the latest option, enhancing user experience in channel selection.

* refactor(AboutSettings): simplify upgrade channel change handling

- Removed individual success messages for different upgrade channels in the handleUpgradeChannelChange function, streamlining the code and improving maintainability.

* refactor: file actions into FileAction service (#7413)

* refactor: file actions into FileAction service

Moved file sorting, deletion, and renaming logic from FilesPage to a new FileAction service for better modularity and reuse. Updated FileList and FilesPage to use the new service functions, and improved the delete button UI in FileList.

* fix: add tag collapse state management for assistants (#7436)

Add tag collapse state management for assistants

Introduces a collapsedTags state to manage the collapsed/expanded state of tag groups in the assistants list. Updates useTags and AssistantsTab to use this state, and adds actions to toggle and initialize tag collapse in the Redux store.

* fix(model): doubao thinking param (#7499)

* feat: Implement occupied directories handling during data copy (#7485)

* feat: Implement occupied directories handling during data copy

- Added `occupiedDirs` constant to manage directories that should not be copied.
- Enhanced the `copyOccupiedDirsInMainProcess` function to copy occupied directories to a new app data path in the main process.
- Updated IPC and preload APIs to support passing occupied directories during the copy operation.
- Modified the DataSettings component to utilize the new copy functionality with occupied directories.

* fix: Improve occupied directories handling during data copy

- Updated the filter logic in the `registerIpc` function to resolve directory paths correctly.
- Modified the `DataSettings` component to pass the correct occupied directories format during the copy operation.

* feat: add appcode (#7507)

Co-authored-by: zhaochenxue <zhaochenxue@bixin.cn>

* fix: non streamoutput sometimes (#7512)

* feat(migrate): add default settings for assistants during migration

- Introduced a new migration step to assign default settings for assistants that lack configuration.
- Default settings include temperature, context count, and other parameters to ensure consistent behavior across the application.

* chore(store): increment version number to 115 for persisted reducer

* Revert "feat: Update API Key Management Interface (#3444)"

This reverts commit 31b3ce1049.

* feat:  一些UI上的优化和重构 (#7479)

- 调整AntdProvider中主题配置,包括颜色、尺寸
- 重构聊天气泡模式的样式
- 重构多选模式的样式
- 添加Selector组件取代ant Select组件
- 重构消息搜索弹窗界面
- 重构知识库搜索弹窗界面
- 优化其他弹框UI

* fix: bailian reranker (#7518)

* feat: implement Python MCP server using existing Pyodide infrastructure (#7506)

* refactor: rename isWindows to isWin for consistency across main/renderer (#7530)

refactor: rename isWindows to isWin for consistency across components

* refactor: data migration modal logic in DataSettings (#7503)

* refactor: data migration modal logic in DataSettings

Moved showProgressModal and startMigration functions inside the useEffect hook and added t as a dependency. This improves encapsulation and ensures translation updates are handled correctly.

* remove trailing whitespace in DataSettings.tsx

Cleaned up a line by removing unnecessary trailing whitespace in the DataSettings component.

* fix: clear search cache on resending (#7510)

* fix: Resolve vllm bad request caused by always sending dimensions in embedding requests (#7525)

fix(知识库): 将dimensions字段改为可选并修复相关逻辑

* feat: Support custom registry address when configuring mcp for npm & fix lint error (#7531)

* feat: Support custom registry address when configuring mcp for npm

* fix: lint

* refactor(GeminiAPIClient): separate model and user message handling to adapt vertex (#7511)

- Introduced a new modelParts array to manage model-related messages separately from user messages.
- Updated the logic to push model messages to currentReqMessages only if they exist, improving clarity and structure.
- Adjusted the return order of messages in buildSdkMessages to ensure history is appended correctly.
- Enhanced McpToolChunkMiddleware to reset tool processing state output when output is present.

* feat: enhance WindowFooter with show/hide functionality for UI elements

- Added state management to control visibility of UI elements in the WindowFooter.
- Implemented a timer to automatically hide elements after a period of inactivity.
- Updated hotkey handlers to reset the visibility timer on user interaction.
- Modified styled component to reflect the new visibility logic.

* fix(SelectionAssistant): opacity slider too slow when sliding in settings page (#7537)

feat: enhance opacity control in Selection Assistant Settings

- Added state management for opacity value in SelectionAssistantSettings component.
- Updated Slider component to use the new opacity state instead of the previous actionWindowOpacity variable.
- Ensured onChangeComplete updates the actionWindowOpacity accordingly.

* feat(AihubmixAPIClient): add getBaseURL method to handle client base URL retrieval

* fix(migrate): restore upgradeChannel setting in migration logic

- Reintroduced the upgradeChannel setting to the state during the migration process, ensuring it defaults to LATEST when applicable.
- Adjusted the migration logic to maintain consistency in settings management.

---------

Co-authored-by: 自由的世界人 <3196812536@qq.com>
Co-authored-by: one <wangan.cs@gmail.com>
Co-authored-by: chenxue <DDU1222@users.noreply.github.com>
Co-authored-by: zhaochenxue <zhaochenxue@bixin.cn>
Co-authored-by: SuYao <sy20010504@gmail.com>
Co-authored-by: kangfenmao <kangfenmao@qq.com>
Co-authored-by: Teo <cheesen.xu@gmail.com>
Co-authored-by: Chen Tao <70054568+eeee0717@users.noreply.github.com>
Co-authored-by: LiuVaayne <10231735+vaayne@users.noreply.github.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Co-authored-by: Wang Jiyuan <59059173+EurFelux@users.noreply.github.com>
Co-authored-by: 陈天寒 <silenceboychen@gmail.com>
Co-authored-by: fullex <0xfullex@gmail.com>
2025-06-26 15:43:45 +08:00
one
6342998c9f feat(MentionedModels): improve feedback for MessageGroupModelList (#7539)
* feat(MentionedModels): improve feedback for MessageGroupModelList

* refactor: reuse pulse animation, fix tooltip triggering area

* refactor: use lightbulbSoftVariants
2025-06-26 15:01:36 +08:00
suyao
f555e604a3 fix(models): update isReasoningModel function to exclude embedding models
- Added a check to the isReasoningModel function to return false for embedding models, ensuring correct model classification.
2025-06-26 13:32:32 +08:00
one
5811adfb7f refactor(CodePreview): handle chunking in ShikiStreamService, make the algorithm more robust (#7409)
* refactor(ShikiStreamService, CodePreview): handle chunking in ShikiStreamService, make the algorithm more robust

- Add highlightStreamingCode with improved robustness
- Improve viewport detection

* perf: improve checks for appending

* chore: update comments
2025-06-26 13:30:49 +08:00
亢奋猫
1db93e8b56 Fix anthropic request cannot handle webSearch and knowbase references (#7559)
修复 Anthropic 模型请求忽略了知识库和网络搜索引用内容的问题
2025-06-26 13:19:36 +08:00
fullex
68b0f5f460 feat(SelectionAssistant): add macOS support and process trust handling
- Updated the selection assistant to support macOS, including new IPC channels for process trust verification.
- Enhanced the SelectionService to check for accessibility permissions on macOS before starting the service.
- Added user interface elements to guide macOS users in granting necessary permissions.
- Updated localization files to reflect macOS support and provide relevant user instructions.
- Refactored selection-related configurations to accommodate both Windows and macOS environments.
2025-06-26 13:16:39 +08:00
亢奋猫
3048d0850c fix: Gemini reasoning model check and improve citation popover structure (#7554)
- Added a new condition to the Gemini reasoning model check to include models with IDs starting with 'gemini' and containing 'thinking'.
- Refactored the CitationsList component to improve the structure of popover content for web search and knowledge citations.
- Updated styled components for better layout and responsiveness in the citation popover.
- Adjusted margin styles in ErrorBlock for consistent spacing.
2025-06-26 12:00:31 +08:00
Teo
08a526e511 style: 优化消息滚动条 (#7549)
* feat(Messages): integrate Scrollbar component into Message and MessageGroup styled containers

* style(Messages): add margin-top to MessageFooter for improved layout

* fix(SelectionToolbar): update regex to remove background styles more accurately
2025-06-26 11:42:12 +08:00
one
5e0cae06db fix(CodeEditor): save to db (#7504) 2025-06-26 11:19:11 +08:00
fullex
1f09c8a022 refactor(SelectionAssistant): make all Toolbar CSS variables customizable (#7532)
refactor: update selection toolbar styles and structure

- Enhanced the selection toolbar's HTML structure for better readability.
- Updated CSS variables for improved theming and consistency across the toolbar.
- Refactored the styled components in SelectionToolbar.tsx to utilize new CSS variables for layout and styling.
- Added support for hover states and improved button styling for better user experience.
2025-06-26 10:17:09 +08:00
suyao
751879d42e feat(AihubmixAPIClient): add getBaseURL method to handle client base URL retrieval 2025-06-26 01:30:55 +08:00
fullex
5f2d0d4bfc fix(SelectionAssistant): opacity slider too slow when sliding in settings page (#7537)
feat: enhance opacity control in Selection Assistant Settings

- Added state management for opacity value in SelectionAssistantSettings component.
- Updated Slider component to use the new opacity state instead of the previous actionWindowOpacity variable.
- Ensured onChangeComplete updates the actionWindowOpacity accordingly.
2025-06-26 01:16:17 +08:00
fullex
3d535d0e68 feat: enhance WindowFooter with show/hide functionality for UI elements
- Added state management to control visibility of UI elements in the WindowFooter.
- Implemented a timer to automatically hide elements after a period of inactivity.
- Updated hotkey handlers to reset the visibility timer on user interaction.
- Modified styled component to reflect the new visibility logic.
2025-06-25 22:56:48 +08:00
SuYao
9362304db0 refactor(GeminiAPIClient): separate model and user message handling to adapt vertex (#7511)
- Introduced a new modelParts array to manage model-related messages separately from user messages.
- Updated the logic to push model messages to currentReqMessages only if they exist, improving clarity and structure.
- Adjusted the return order of messages in buildSdkMessages to ensure history is appended correctly.
- Enhanced McpToolChunkMiddleware to reset tool processing state output when output is present.
2025-06-25 22:16:27 +08:00
陈天寒
17a8f0a724 feat: Support custom registry address when configuring mcp for npm & fix lint error (#7531)
* feat: Support custom registry address when configuring mcp for npm

* fix: lint
2025-06-25 21:37:10 +08:00
Wang Jiyuan
066aad7fed fix: Resolve vllm bad request caused by always sending dimensions in embedding requests (#7525)
fix(知识库): 将dimensions字段改为可选并修复相关逻辑
2025-06-25 21:15:05 +08:00
one
5138f5b314 fix: clear search cache on resending (#7510) 2025-06-25 21:10:15 +08:00
自由的世界人
839c44eb7a refactor: data migration modal logic in DataSettings (#7503)
* refactor: data migration modal logic in DataSettings

Moved showProgressModal and startMigration functions inside the useEffect hook and added t as a dependency. This improves encapsulation and ensures translation updates are handled correctly.

* remove trailing whitespace in DataSettings.tsx

Cleaned up a line by removing unnecessary trailing whitespace in the DataSettings component.
2025-06-25 21:07:40 +08:00
fullex
0001bc60a9 refactor: rename isWindows to isWin for consistency across main/renderer (#7530)
refactor: rename isWindows to isWin for consistency across components
2025-06-25 19:59:47 +08:00
LiuVaayne
04e6f2c1ad feat: implement Python MCP server using existing Pyodide infrastructure (#7506) 2025-06-25 18:21:10 +08:00
Chen Tao
a94847faeb fix: bailian reranker (#7518) 2025-06-25 15:48:04 +08:00
eeee0717
0d9fd1e6f8 fix: bailian reranker 2025-06-25 14:43:37 +08:00
Teo
64b01cce47 feat: 一些UI上的优化和重构 (#7479)
- 调整AntdProvider中主题配置,包括颜色、尺寸
- 重构聊天气泡模式的样式
- 重构多选模式的样式
- 添加Selector组件取代ant Select组件
- 重构消息搜索弹窗界面
- 重构知识库搜索弹窗界面
- 优化其他弹框UI
2025-06-25 14:34:18 +08:00
kangfenmao
3df5aeb3c3 Revert "feat: Update API Key Management Interface (#3444)"
This reverts commit 31b3ce1049.
2025-06-25 13:10:46 +08:00
SuYao
9fe5fb9a91 fix: non streamoutput sometimes (#7512)
* feat(migrate): add default settings for assistants during migration

- Introduced a new migration step to assign default settings for assistants that lack configuration.
- Default settings include temperature, context count, and other parameters to ensure consistent behavior across the application.

* chore(store): increment version number to 115 for persisted reducer
2025-06-25 12:49:00 +08:00
chenxue
17951ad157 feat: add appcode (#7507)
Co-authored-by: zhaochenxue <zhaochenxue@bixin.cn>
2025-06-25 09:17:27 +08:00
beyondkmp
3640d846b9 feat: Implement occupied directories handling during data copy (#7485)
* feat: Implement occupied directories handling during data copy

- Added `occupiedDirs` constant to manage directories that should not be copied.
- Enhanced the `copyOccupiedDirsInMainProcess` function to copy occupied directories to a new app data path in the main process.
- Updated IPC and preload APIs to support passing occupied directories during the copy operation.
- Modified the DataSettings component to utilize the new copy functionality with occupied directories.

* fix: Improve occupied directories handling during data copy

- Updated the filter logic in the `registerIpc` function to resolve directory paths correctly.
- Modified the `DataSettings` component to pass the correct occupied directories format during the copy operation.
2025-06-25 00:39:28 +08:00
one
becb6543e0 fix(model): doubao thinking param (#7499) 2025-06-24 23:42:55 +08:00
自由的世界人
1055903456 fix: add tag collapse state management for assistants (#7436)
Add tag collapse state management for assistants

Introduces a collapsedTags state to manage the collapsed/expanded state of tag groups in the assistants list. Updates useTags and AssistantsTab to use this state, and adds actions to toggle and initialize tag collapse in the Redux store.
2025-06-24 21:12:49 +08:00
自由的世界人
e2b8133729 refactor: file actions into FileAction service (#7413)
* refactor: file actions into FileAction service

Moved file sorting, deletion, and renaming logic from FilesPage to a new FileAction service for better modularity and reuse. Updated FileList and FilesPage to use the new service functions, and improved the delete button UI in FileList.
2025-06-24 18:51:58 +08:00
one
f2c9bf433e refactor(CodePreview): auto resize gutters (#7481)
* refactor(CodePreview): auto resize gutters

* refactor: remove unnecessary usememo
2025-06-24 04:01:05 +08:00
Xunjin ZHENG
31b3ce1049 feat: Update API Key Management Interface (#3444)
* feat: enhance API key management in ApiCheckPopup: allow users to add new API key

- Enhanced ApiCheckPopup component to allow users to add new API key, including validation for duplicate entries and improved user feedback.

* feat: update localization strings and refactor API key management components

- Added "Invalid API key" message to localization files for English, Japanese, Russian, Simplified Chinese, and Traditional Chinese.
- Refactored API key management by replacing the ApiCheckPopup with a new ApiKeyList component, enhancing user experience and modularity in handling API keys across provider settings.

* refactor: update OAuthButton and ApiKeyList components for improved UI and localization

- Commented out the translation key in OAuthButton for future use.
- Removed unnecessary localization strings related to API key tips across multiple languages.
- Enhanced ApiKeyList component with styled components for better layout and user interaction.
- Updated ProviderSetting and WebSearchProviderSetting to streamline API key management UI.

* refactor: streamline ApiKeyList component and update localization strings

- Removed the "Check Multiple API Keys" translation key from English, Japanese, Russian, Simplified Chinese, and Traditional Chinese localization files.
- Updated ApiKeyList component to eliminate the model prop, enhancing its simplicity and usability.
- Improved error handling in API key validation by integrating model selection directly within the check process.

* feat: add latency tooltip to API key validation in ApiKeyList component and update localization strings

- Introduced a latency tooltip in the ApiKeyList component to display the time taken for API key validation.
- Updated localization files for English, Japanese, Russian, Simplified Chinese, and Traditional Chinese to include the new latency tooltip string.

* refactor: remove unused imports in WebSearchProviderSetting component

* refactor: improve error handling and latency tracking in ApiKeyList component

- Enhanced error handling during model selection to prevent failures when the user cancels the popup.
- Introduced latency tracking for API key validation, ensuring accurate measurement of response times.
- Streamlined the code for better readability and maintainability.

* refactor: improve styling in ApiKeyList component for better UI consistency

- Updated padding styles for error messages and list items in the ApiKeyList component to enhance visual clarity and user experience.
- Adjusted Card component properties to ensure consistent styling across the interface.

* refactor: extract key formatting logic into a separate function in ApiKeyList component

- Created a new function `formatAndConvertKeysToArray` to handle the formatting and conversion of API keys into an array of unique key objects.
- Updated the state initialization and effect hook in the ApiKeyList component to utilize the new function, improving code readability and maintainability.

* refactor: conditionally render API key section for non-copilot providers

- Updated the ProviderSetting component to conditionally display the API key section only for providers other than 'copilot', improving the user interface and experience.
- Maintained existing functionality for API key management while enhancing code readability.

* refactor: enhance ApiKeyList component for copilot provider handling

- Introduced a new condition to manage the rendering and functionality of buttons in the ApiKeyList component based on the provider type, specifically for 'copilot'.
- Updated the ProviderSetting component to ensure the API key section is consistently displayed for all providers, improving overall user experience and code clarity.

* fix model type error

* feat(ApiKeyList): exclude rerank models from being checked for API key validation after #3969 is merged

* refactor(ApiKeyList): conditionally render check and remove buttons based on key statuses

* refactor(ApiKeyList): using Promise.all for improved performance after #4066 is merged

* refactor(ProviderSettings): update API key display and tooltip integration for improved layout and accessibility

* fix(ApiKeyList): prevent notifications from showing when checking multiple API keys

* feat(ApiKeyList): enhance API key handling with improved key formatting and auto-focus logic for add button

* refactor: clean up WebSearchProviderSetting component

* refactor(ApiKeyList): replace icon buttons with styled components for save and cancel actions

* refactor: API key list UI and remove unused components

Simplified the API key list UI by removing custom styled components for status and actions, replacing them with Ant Design icons and buttons. Improved the key checking logic and removed the tooltip for key check results. Also removed an unused help text in ProviderSetting.

* refactor: add edit functionality to API key list

Introduces the ability to edit existing API keys in the ApiKeyList component. Removes custom save/cancel icon buttons in favor of standard input blur/enter and icon actions. Also adjusts styling for help text in ProviderSetting.

* refactor(ApiKeyList): enhance key status display with tooltips and color coding

* feat(i18n): add "checking" status message in multiple languages

* feat(ApiKeyList): enhance API key management with confirmation for deletion and improved state handling

- Added confirmation for deleting API keys, allowing users to confirm before removal.
- Introduced a cancel state for adding new keys to improve user experience.
- Enhanced key status updates to prevent unnecessary re-renders.
- Improved UI interactions with better handling of edit and cancel actions.
- Added escape key functionality for canceling edits and new key entries.

* fix(ApiKeyList): adjust layout of API key list for improved spacing and alignment

- Updated the Flex component to justify content between elements, enhancing the visual layout of the API key list.
- Minor style adjustment to maintain consistency in the user interface.

* fix(ApiKeyList): refine padding for API key list items to enhance visual consistency

- Adjusted padding for API key list text and items to improve overall layout and alignment.
- Ensured consistent spacing across different states of the API key list.

---------

Co-authored-by: Pleasurecruise <3196812536@qq.com>
Co-authored-by: suyao <sy20010504@gmail.com>
2025-06-24 01:54:12 +08:00
Ying-xi
f69ea8648c fix: display updated timestamp when available in knowledge base (#7453)
* fix: display updated timestamp when available in knowledge base

- Add updated_at field when creating knowledge items
- Show updated_at timestamp if it's newer than created_at
- Fallback to created_at if updated_at is not available or older

Fixes #4587

Signed-off-by: Ying-xi <62348590+Ying-xi@users.noreply.github.com>

* refactor(knowledge): extract display time logic into a reusable function

Signed-off-by: Ying-xi <62348590+Ying-xi@users.noreply.github.com>

---------

Signed-off-by: Ying-xi <62348590+Ying-xi@users.noreply.github.com>
2025-06-24 00:06:52 +08:00
LiuVaayne
29af30b8d2 Feat/memory (#6454)
* feat(Memory): add memory management functionality with settings modal and integration into sidebar

* Add user memory search to chat completion flow

Enable assistants to use memory search results for more personalized
responses when enableMemory is true. Add enableMemory flag to Assistant
type.

* Add MemoryService and memory types interfaces

* Add memory settings tab to AssistantSettings

* feat(memory): implement Phase 1 core backend infrastructure

- Add Memory IPC channels for full CRUD operations
- Create main process MemoryService with LibSQL storage
- Implement memory database schema with history tracking
- Add IPC handlers for all memory operations
- Update preload API to expose memory functionality
- Update renderer MemoryService to use IPC instead of mock data
- Add comprehensive error handling and logging
- Support memory deduplication using SHA256 hashes
- Implement audit trail for all memory changes

Core features:
- Memory add/search/list/delete/update operations
- Full history tracking for changes
- User/agent/run filtering support
- Prepared for vector embeddings (Phase 2)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

*  feat: Implement memory vector search and hybrid search with LibSQL native vector support

- Implemented native vector support using `F32_BLOB` for storing embeddings directly in LibSQL.
- Created vector index using `libsql_vector_idx()` for efficient similarity search.
- Implemented `vectorSearch()` using `vector_top_k()` for fast nearest neighbor search based on cosine similarity.
- Implemented `hybridSearch()` combining text search and vector similarity search.
- Added `addBatchMemories()` to efficiently add multiple memories with embeddings.
- Added embedding model configuration via `setEmbeddingModel()`.
- Integrated embedding generation using `EmbeddingService`.
- Updated database schema with vector column and index.
- Added methods for embedding conversion and similarity calculations.
- Updated documentation with vector search details and schema changes.
- Improved memory management with embedding caching and clearing.
- Added `findSimilarMemories` to avoid duplicates
- Added embedding stats and cache methods

* feat(memory): add EmbeddingService and VectorSearch for memory embedding and search functionality

* fix(memory): update vector operations to match libsql documentation

- Fix vector32() function usage by removing quotes from embedding parameters
- Replace vector_top_k with standard queries to avoid index dependency
- Make embedding dimensions flexible by removing fixed 1536 dimension
- Add NULL checks for embeddings in all vector operations
- Update memory update method to regenerate embeddings
- Use parameterized queries to prevent SQL injection

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* update implement plan

* feat(memory): implement Phase 3 - UI and integration components

- Create Memory Page UI with full CRUD operations
  - Add, delete, search, and filter memories
  - User and date range filtering
  - Bulk operations support

- Implement Memory Processing Pipeline
  - Automatic fact extraction from conversations
  - Intelligent memory updates (add/update/delete)
  - Background processing for non-blocking UI

- Integrate memory search into ApiService
  - Inject relevant memories into conversation context
  - Post-conversation memory processing
  - Assistant-specific memory isolation

- Add Assistant Memory Settings
  - Toggle memory per assistant
  - View memory statistics
  - Configure from assistant settings panel

- Complete memory feature integration
  - Redux store already implemented
  - Memory service backend ready
  - Full end-to-end functionality

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* docs: update memory feature implementation plan to reflect Phase 3 completion

- Mark Phase 3 (UI and Integration) as completed
- Update implementation progress to 90%
- Document all completed components and features
- Add usage instructions for the memory feature
- List key implementation files for reference

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Revert "feat(memory): implement Phase 3 - UI and integration components"

This reverts commit 422463d0f7.

*  feat: Implement memory management for assistants

- Introduced `MemoryProcessor` to handle fact extraction, memory updates, and searches.
- Added `AssistantMemorySettings` component to allow enabling/disabling memory and viewing memory statistics.
- Integrated memory functionality with assistant settings.
- Implemented memory-related prompts and schema validation.
- Added memory service calls for adding, updating, deleting, and searching memories.

* fix: Update memory settings form handling in AssistantMemorySettings component

* feat(memory): implement Phase 3 - UI and integration components

- Create Memory Page UI with full CRUD operations
  - Add, delete, search, and filter memories
  - User and date range filtering
  - Bulk operations support

- Implement Memory Processing Pipeline
  - Automatic fact extraction from conversations
  - Intelligent memory updates (add/update/delete)
  - Background processing for non-blocking UI

- Integrate memory search into ApiService
  - Inject relevant memories into conversation context
  - Post-conversation memory processing
  - Assistant-specific memory isolation

- Add Assistant Memory Settings
  - Toggle memory per assistant
  - View memory statistics
  - Configure from assistant settings panel

- Complete memory feature integration
  - Redux store already implemented
  - Memory service backend ready
  - Full end-to-end functionality

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: update memory search method and integrate form handling in AssistantMemorySettings

* feat(memory): enhance memory service with new IPC channels and configuration updates

* refactor: remove VectorSearch service and update memory configuration methods

- Deleted the VectorSearch service implementation from the memory services.
- Updated the memory configuration method in the preload index from `updateConfig` to `setConfig`.
- Adjusted the corresponding call in the MemoryService to reflect the new method name.

* refactor(memory): remove embedding cache and related methods from MemoryService

* feat(memory): update MemoryService initialization to handle configuration updates and errors

* feat(memory): centralize SQL queries for MemoryService to improve maintainability

* feat: Enhance memory management with user context and CRUD operations

- Updated memory feature analysis with current implementation status and new functionalities.
- Added user context management, allowing automatic filtering based on selected user.
- Implemented full CRUD operations for memories, including add, edit, and delete functionalities.
- Introduced user management system with validation rules for user IDs.
- Enhanced internationalization support for memory features across multiple languages.
- Improved UI components for memory management, including user switching and memory editing modals.
- Updated MemoryService and MemoryProcessor to handle user-specific memory operations.
- Added comprehensive testing and documentation for new features.

* feat(memory): enhance UI components and user interactions in MemoriesPage

* feat(memory): integrate user context into memory operations and enhance user management

* feat(memory): add user deletion and reset functionality for specific users

* feat(memory): enhance localization for user management and memory operations in multiple languages

* feat(memory): remove reset functionality and add user listing feature in memory service

* feat(memory): enhance memory processing by adding fallback models and improving configuration handling

* feat(memory): refactor fact extraction and memory update logic to use fetchGenerate for LLM calls

* feat(memory): iinject memory to chat

* feat(memory): enhance memory handling by ensuring fallback to empty array and improving logging in memory search

* feat(memory): implement pagination for memory list operations

- Add offset parameter to MemoryListOptions interface for pagination support
- Update MemoryService.list() method to properly handle offset parameter
- Implement client-side pagination with 50 items per page default
- Add pagination controls with page size options (20, 50, 100, 200)
- Include pagination state management (currentPage, pageSize)
- Load all memories at once and paginate on client side for better search performance
- Reset pagination when switching users or performing searches
- Update memory CRUD operations to maintain current pagination state
- Add styled pagination component with consistent design

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(memory): correct state variable name in user switch handler

* feat(memory): add comprehensive memory feature guide in Chinese

* feat: Enhance memory management and citation handling

- Updated BaseApiClient to retrieve memory references from cache and format them for use.
- Modified CitationBlock to include memory references in rendering logic.
- Enhanced CitationsList to display memory citations with appropriate formatting.
- Improved MemoriesPage layout and functionality, including debounced search and user management.
- Refactored MemoryProcessor to handle memory updates and search queries more effectively.
- Updated API service to include memory in external tool results.
- Adjusted memory-related types and schemas for better integration.
- Enhanced createCitationBlock utility to accommodate memory data.

* feat(memory): update memory localization keys and descriptions for improved clarity

* feat(memory): add descriptions to memory localization files and improve error handling in MemoryService

*  style: Remove blank lines and fix typo in settings

- Removed blank lines in README files.
- Fixed a typo in the assistant settings label for the memory tab.

revert: revert format changes

revert: revert format changes

* feat(memory): enhance memory update logic and improve prompt clarity

* feat(memory): implement global memory toggle and enhance memory settings UI

* feat(memory): refine hybrid search to focus on vector similarity and update localization files

* feat(i18n): add memory configuration prompts in multiple languages

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-06-23 21:32:04 +08:00
beyondkmp
bbe380cc9e feat(ContextMenu): add spell check and dictionary suggestions to context menu (#7067)
* feat(ContextMenu): add spell check and dictionary suggestions to context menu

- Implemented spell check functionality in the context menu with options to learn spelling and view dictionary suggestions.
- Updated WindowService to enable spellcheck in the webview.
- Enabled spell check in Inputbar and MessageEditor components.

* feat(SpellCheck): implement spell check language settings and initialization

- Added support for configuring spell check languages based on user-selected language.
- Introduced IPC channel for setting spell check languages.
- Updated settings to manage spell check enablement and languages.
- Enhanced UI to allow users to toggle spell check functionality and select languages.
- Default spell check languages are set based on the current UI language if none are specified.

* refactor(SpellCheck): enhance spell check language mapping and UI settings

- Updated spell check language mapping to default to English for unsupported languages.
- Improved UI logic to only update spell check languages when enabled and no manual selections are made.
- Added a new selection component for users to choose from commonly supported spell check languages.

* feat(SpellCheck): integrate spell check functionality into Inputbar and MessageEditor

- Added enableSpellCheck setting to control spell check functionality in both Inputbar and MessageEditor components.
- Updated spellCheck prop to utilize the new setting, enhancing user experience by allowing customization of spell check behavior.

* refactor(SpellCheck): move spell check initialization to WindowService

- Removed spell check language initialization from index.ts and integrated it into WindowService.
- Added setupSpellCheck method to configure spell check languages based on user settings.
- Enhanced error handling for spell check language setup.

* feat(SpellCheck): add enable spell check functionality and IPC channel

- Introduced a new IPC channel for enabling/disabling spell check functionality.
- Updated the preload API to include a method for setting spell check enablement.
- Modified the main IPC handler to manage spell check settings based on user input.
- Simplified spell check language handling in the settings component by directly invoking the new API method.

* refactor(SpellCheck): remove spellcheck option from WindowService configuration

- Removed the spellcheck property from the WindowService configuration object.
- This change streamlines the configuration setup as spell check functionality is now managed through IPC channels.

* feat(i18n): add spell check translations for Japanese, Russian, and Traditional Chinese

- Added new translations for spell check functionality in ja-jp, ru-ru, and zh-tw locale files.
- Included descriptions and language selection options for spell check settings to enhance user experience.

* feat(migrate): add spell check configuration migration

- Implemented migration for spell check settings, disabling spell check and clearing selected languages in the new configuration.
- Enhanced error handling to ensure state consistency during migration process.

* fix(migrate): ensure spell check settings are updated safely

- Added a check to ensure state.settings exists before modifying spell check settings during migration.
- Removed redundant error handling that returned the state unmodified in case of an error.

* fix(WindowService): set default values for spell check configuration and update related UI texts

* refactor(Inputbar, MessageEditor): remove contextMenu attribute and add context menu handling in MessageEditor

---------

Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
2025-06-23 21:19:21 +08:00
eeee0717
4d8c60c3a5 fix: use file name as title 2025-06-23 18:59:53 +08:00
eeee0717
794fc2721e Merge branch 'main' into feat-knowlege-ocr 2025-06-23 17:37:18 +08:00
eeee0717
535d00dae2 fix: tei error 2025-06-23 17:34:52 +08:00
beyondkmp
be15206234 fix: Data config improvement (#7471)
* fix: update localization files for data migration warnings and path validation messages

* fix: update app data path validation and localization messages for installation path consistency

* fix: enhance app data flushing process by adding connection closure and delay in DataSettings component
2025-06-23 17:18:46 +08:00
Wang Jiyuan
aee8fe6196 feat(mcpServers): Add a thought field to sequential thinking mcp server (#7465)
feat(mcpServers): 在sequentialthinking中添加thought字段
2025-06-23 15:27:20 +08:00
one
4f2c8bd905 fix(Markdown): improve latex brackets handling (#7358) 2025-06-23 15:19:21 +08:00
Murphy
a2e2eb3b73 fix: re-add newline separator between reasoning_summary parts after openai middleware refactor (#7390)
re-add newline separator between reasoning_summary parts after openai client refactor

Signed-off-by: MurphyLo <murphylo@mail.bnu.edu.cn>
2025-06-23 12:51:08 +08:00
Wang Jiyuan
32d6c2e1d8 feat(TopicsTab): Allow deletion of inactive topics (#7415)
* fix(主题列表): 修复主题列表项悬停样式和菜单显示条件

调整主题列表项悬停时的背景色过渡效果,并修正菜单显示逻辑,仅在非挂起状态显示

* fix(TopicsTab): 移除话题待处理状态检查

* fix(TopicsTab): 修复删除话题时未检查当前活跃话题的问题
2025-06-23 09:59:50 +08:00
purefkh
b4c8e42d87 fix(rename): disable thinking for topic rename (#7461) 2025-06-23 09:48:29 +08:00
Tristan Zhang
a8e23966fa feat(FileStorage): add support for .doc files using word-extractor (#7374)
* feat(FileStorage): add support for .doc files and integrate word-extractor

* chore(package): add word-extractor to devdependencies
2025-06-23 08:55:03 +08:00
Wang Jiyuan
2350919f36 fix: use shouldThrow param in checkApi instead of adding error property to CompletionsResult (#7457)
* Revert "refactor(middleware): Add error property to CompletionResult and handle errors when checking API (#7407)"

This reverts commit 50d6f1f831.

* fix: use shouldThrow param in checkApi
2025-06-22 21:33:17 +08:00
kangfenmao
355d2aebb4 chore(version): 1.4.5 2025-06-22 17:31:43 +08:00
Wang Jiyuan
50d6f1f831 refactor(middleware): Add error property to CompletionResult and handle errors when checking API (#7407)
* refactor(aiCore): 添加错误处理

* remove console.log
2025-06-22 17:03:43 +08:00
自由的世界人
d9b8e68c30 fix: update source language handling and persist user selection in TranslatePage component (#7243) 2025-06-22 12:28:31 +08:00
beyondkmp
c660aaba3d fix: 修复数据目录迁移的bug (#7386)
* fix: move initAppDataDir function inline and remove export from utils/file.ts

* fix some bugs

* fix shouldcopy error

* fix: handle appDataPath initialization and update logic in file.ts; update defaultChecked in DataSettings component

* fix: improve appDataPath handling and migration logic in file.ts

* fix: add error message for selecting the same app data path in DataSettings component and update localization files

* fix: ensure migration confirmation modal is shown correctly in DataSettings component

* feat: add new IPC channel for retrieving data path from arguments and update related components for migration handling

* fix: update app data path validation to check for prefix match in DataSettings component

* refactor: simplify data migration logic in DataSettings component by removing unnecessary flag

* fix: update initAppDataDir invocation to check for app packaging status in bootstrap.ts
2025-06-22 10:32:23 +08:00
Wang Jiyuan
60b37876b1 fix: remove duplicated deepseek-v3 in volcengine (#7406)
fix: 移除重复的DeepSeek-V3模型配置
2025-06-21 21:20:40 +08:00
beyondkmp
37aaaee086 fix: add node-stream-zip for zip file extraction in install-bun script (#7403)
* chore(package): add node-stream-zip for zip file extraction in install-bun script

* refactor(install-uv): replace AdmZip with node-stream-zip for improved zip file extraction

* fix(install-uv): ensure correct extraction of uv binary for Unix/Linux/macOS

* refactor(install-uv): remove redundant file handling and cleanup for Unix/Linux/macOS installation

* fix(install-uv): update tar extraction command to strip leading components for Unix/Linux/macOS

* fix(install-uv): clarify comment for zip file extraction on Windows

* fix(install-bun): correct extraction directory for bun binary

* fix(install-bun, install-uv): update default versions and improve zip extraction process

* fix(install-bun): remove redundant cleanup of source directory after bun installation
2025-06-21 19:47:15 +08:00
Wang Jiyuan
b91ac0de1d fix(models): Unexpected inability to disable image generation feature (#7401)
* fix(models): 修复禁用图片生成模型检查逻辑

* fix(models): use getBaseName()
2025-06-20 22:30:14 +08:00
Wang Jiyuan
8d247add98 fix(ApiService): correct enableWebSearch conditional logic error (#7396)
* fix(ApiService): 修复enableWebSearch条件判断逻辑错误

* fix(web搜索): 修正web搜索模型判断逻辑
2025-06-20 18:06:44 +08:00
Wang Jiyuan
a813df993c fix: Chat does not work properly when configuring multiple API keys (#7385)
* refactor(openai): 使用getApiKey方法替代直接访问apiKey属性

* refactor(openai): 使用getApiKey方法替代直接访问provider.apiKey

* refactor(api客户端): 直接使用apiKey属性替代getApiKey方法
2025-06-20 17:46:45 +08:00
eeee0717
3498423b6f fix: knowledge item cannot click 2025-06-20 15:16:21 +08:00
SuYao
1915ba5bfb fix(GeminiAPIClient): update abortSignal option and ensure userLastMessage is pushed to messages (#7387) 2025-06-20 14:46:22 +08:00
George·Dong
3e142f67ad fix(i18n): fix model name export help text (#7372) 2025-06-19 23:32:32 +08:00
Tristan Zhang
b4b456ae06 fix(AssistantService): add default settings configuration to assistant initialization (#7371) 2025-06-19 22:56:46 +08:00
one
ed0bb7fd16 feat(Markdown): disable indented code blocks (#7288)
* feat(Markdown): disable indented code blocks

* chore: update remark/rehype packages
2025-06-19 19:39:33 +08:00
kangfenmao
c9f94a3b15 chore(version): 1.4.4 2025-06-19 19:09:28 +08:00
亢奋猫
ec36f78ffb fix: update WindowService transparency and improve Inputbar resizing … (#7362) 2025-06-19 18:37:53 +08:00
eeee0717
b43cdd124c chore: change to 1.5.0-rc.1 2025-06-19 17:41:32 +08:00
eeee0717
550740b42a Merge remote-tracking branch 'upstream/main' into feat-knowlege-ocr 2025-06-19 17:24:23 +08:00
one
439ec286b5 refactor: hard-coded language map (#7360) 2025-06-19 17:13:29 +08:00
eeee0717
ef4a7b042b fix 2025-06-19 16:10:08 +08:00
eeee0717
9566ce3d9a Merge remote-tracking branch 'upstream/main' into feat-knowlege-ocr 2025-06-19 16:02:53 +08:00
one
28b58d8e49 refactor(CodeBlock): support more file extensions for code downloading (#7192) 2025-06-19 15:09:01 +08:00
SuYao
26cb37c9be refactor: remove deprecated MCP server handling and knowledge base ID logic from Inputbar and related services (#7339)
- Removed unused MCP server handling from Inputbar and MessagesService.
- Updated ApiService to fetch active MCP servers directly from the store.
- Deprecated knowledgeBaseIds and enabledMCPs in Message types and related functions.
- Cleaned up related utility functions to enhance code clarity and maintainability.
2025-06-19 13:34:36 +08:00
one
115470fce6 chore(WebDav): remove useless webdav restore (#7347)
- remove webdav restore modal
- fix i18n keys
2025-06-19 12:33:59 +08:00
SuYao
23e9184323 fix: openai response tool use (#7332)
* fix: openai response tool use

- Added OpenAIResponseStreamListener interface for handling OpenAI response streams.
- Implemented attachRawStreamListener method in OpenAIResponseAPIClient to manage raw output.
- Updated RawStreamListenerMiddleware to integrate OpenAI response handling.
- Refactored BaseApiClient to remove unused attachRawStreamListener method.
- Improved buildSdkMessages to handle OpenAI response formats.

* fix: remove logging from StreamAdapterMiddleware

- Removed Logger.info call from StreamAdapterMiddleware to streamline output and reduce unnecessary logging.

* fix: update attachRawStreamListener to return a Promise

- Changed attachRawStreamListener method in OpenAIResponseAPIClient to be asynchronous, returning a Promise for better handling of raw output.
- Updated RawStreamListenerMiddleware to await the result of attachRawStreamListener, ensuring proper flow of data handling.

* refactor: enhance attachRawStreamListener to return a ReadableStream

- Updated the attachRawStreamListener method in OpenAIResponseAPIClient to return a ReadableStream, allowing for more efficient handling of streamed responses.
- Modified RawStreamListenerMiddleware to accommodate the new return type, ensuring proper integration of the transformed stream into the middleware flow.

* refactor: update getResponseChunkTransformer to accept CompletionsContext

- Modified the getResponseChunkTransformer method in BaseApiClient and its implementations to accept a CompletionsContext parameter, enhancing the flexibility of response handling.
- Adjusted related middleware and client classes to ensure compatibility with the new method signature, improving the overall integration of response transformations.

* refactor: update getResponseChunkTransformer to accept CompletionsContext

- Modified the getResponseChunkTransformer method in AihubmixAPIClient to accept a CompletionsContext parameter, enhancing the flexibility of response handling.
- Ensured compatibility with the updated method signature across related client classes.
2025-06-19 12:24:27 +08:00
SuYao
deac7de5aa fix(ApiService): improve error handling when fetching tools from MCP servers (#7340)
- Added error handling for tool fetching to log errors and return an empty array if a server fails to respond.
- Changed from Promise.all to Promise.allSettled to ensure all tool fetching attempts are accounted for, filtering out any rejected promises.
2025-06-19 12:02:03 +08:00
Teo
6996cdfbf9 fix: the issue where anchor clicks in multi-model responses fail to redirect (#7342)
* fix: 修复多模型回答的锚点点击无法跳转问题

* chore(Messages): remove debug logging from MessageAnchorLine component
2025-06-19 11:23:42 +08:00
Wang Jiyuan
8c9822cc71 Fix: Handle embedding dimension retrieval failure when creating knowledge base (#7324)
* fix(知识库): 处理获取嵌入维度为0时的错误情况

* fix(aiCore): 修复获取嵌入维度时错误处理不当的问题

修改各AI客户端获取嵌入维度的方法,在出错时抛出异常而不是返回0
同时在调用处移除对返回值为0的特殊处理,直接捕获异常

* refactor(aiCore): 移除获取嵌入维度的冗余try-catch块

简化代码结构,移除不必要的错误处理,因为错误会由上层调用者处理
2025-06-19 02:03:31 +08:00
SuYao
d05ff5ce48 fix(AnthropicAPIClient): non stream tooluse (#7338)
- Added debug logging in buildSdkMessages for better traceability.
- Improved handling of tool calls in the transform method to correctly index multiple tool uses.
- Enqueued additional response types to enhance the output structure for better integration with the streaming API.
- Refactored event listener attachment for clarity and maintainability.
2025-06-19 01:11:15 +08:00
purefkh
ccff6dc2b8 feat: update gemini-2.5 model capabilities and thinking budget (#7323)
Co-authored-by: suyao <sy20010504@gmail.com>
2025-06-19 00:32:49 +08:00
fullex
5ce4f91829 refactor(QuickAssistant): fix loop rendering & support context/pause/thinking block (#7336)
* fix: series bugs of quick assistant

* fix: update quick assistant ID handling and improve error management in HomeWindow

* refactor(HomeWindow, Messages): streamline clipboard handling and improve component structure

- Removed unused imports and hotkey functionality from Messages component.
- Refactored clipboard management in HomeWindow to use refs for better performance.
- Enhanced user input handling and state management in HomeWindow.
- Updated InputBar to accept assistant prop instead of model for better clarity.
- Improved Footer component to handle copy functionality and pin state more effectively.

* Enhance Footer component: add rotation animation to pin icon and adjust margin

- Updated the Pin icon in the Footer component to include a rotation animation based on the pin state.
- Adjusted the margin of the PinButtonArea for improved layout consistency.

* refactor(HomeWindow): improve clipboard handling and input placeholder logic

- Updated clipboard reading logic to check for document focus in addition to startup settings.
- Consolidated key event handling to streamline input processing.
- Enhanced placeholder logic in InputBar to reflect the current assistant's name or model more accurately.
2025-06-19 00:14:32 +08:00
one
757eed1617 fix(OpenAI): respect successful stream without finish reason (#7326)
* fix(OpenAI): respect successful stream without finish reason

* fix: lint errors
2025-06-18 23:19:25 +08:00
SuYao
333cc7b5a8 fix: lint (#7333) 2025-06-18 23:14:54 +08:00
eeee0717
571195e372 chore: add mineru placeholder 2025-06-18 17:41:43 +08:00
SuYao
91a936c151 fix: initialize messageContents and improve message handling in GeminiAPIClient; add new Gemini model to configuration (#7307)
* fix: initialize messageContents and improve message handling in GeminiAPIClient; add new Gemini model to configuration

* refactor: streamline message handling in GeminiAPIClient; enhance message extraction from SDK payload
2025-06-18 17:40:46 +08:00
beyondkmp
d409ac1b73 feat: Add app data path selection and relaunch functionality (#6096)
* feat: Add app data path selection and relaunch functionality

* Introduced new IPC channels for selecting and setting the app data path.
* Implemented logic to initialize the app data path on startup.
* Added confirmation modal for changing the app data directory in the settings.
* Updated translations for new app data path features in multiple languages.

* feat: Implement user data copying and app data path management

* Added IPC channels for copying user data to a new location and setting the app data path.
* Enhanced the user interface to support data copying with progress notifications.
* Updated translations to reflect new features related to app data management.
* Refactored file utility functions to streamline data path handling.

* refactor: update IPC channel names and streamline app data path handling

- Renamed IPC channels for selecting app data path and copying user data for clarity.
- Simplified the logic for selecting and setting app data paths, removing unnecessary success/error handling.
- Updated related functions and components to reflect the new IPC channel names and improved data handling.
- Removed unused copyUserDataToNewLocation function to clean up the codebase.

* fix: update app data directory selection text in multiple locales

- Changed the text for selecting the app data directory from "Select Directory" to "Modify Directory" in English, Japanese, Russian, Simplified Chinese, and Traditional Chinese locales to better reflect the action being performed.

* refactor: remove redundant success messages in DataSettings component

- Eliminated unnecessary success messages related to app data copying and app relaunching to streamline user feedback and improve code clarity.

* refactor: streamline file utility functions and update app data initialization

- Moved `getDataPath` function to the `utils/index.ts` for better organization and accessibility.
- Renamed `initUserDataDir` to `initAppDataDir` for clarity in its purpose.
- Removed commented-out code in `ConfigManager` to enhance code cleanliness.

* refactor: update import paths and localization strings for app data

- Refactored import statements for `getDataPath` to streamline utility access.
- Updated localization strings for app data in English, Japanese, Russian, Simplified Chinese, and Traditional Chinese to enhance clarity and consistency.

* update i18n

* add fc

* fix: handle errors in app data path retrieval

- Added error handling to the `getAppDataPathFromConfig` function to return null if the configuration file cannot be read or parsed, improving robustness.

* refactor: simplify app data path handling in IPC

- Removed error handling for setting the app data path in the IPC channel, streamlining the process by directly updating the configuration and user data path without try-catch blocks.

* fix: update userData path handling for portable applications

- Modified the initAppDataDir function to set the userData path based on the PORTABLE_EXECUTABLE_DIR environment variable, ensuring compatibility with portable application setups.

* feat: enhance app data path migration with progress indication

- Implemented a loading modal with progress tracking during the app data path migration process.
- Added visual feedback using a progress bar to inform users of the copying status.
- Improved error handling and user notifications for successful and failed migrations.
- Refactored the modal confirmation logic to streamline user interactions during the path selection and migration process.

* feat: add migration paths and update UI for data migration process

- Introduced new translation keys for migration paths in Japanese, Russian, Simplified Chinese, and Traditional Chinese.
- Enhanced the DataSettings component with a structured layout for displaying original and new paths during data migration.
- Updated modal titles and content to improve user experience during the migration process.

* feat: enhance data migration process with improved UI and progress tracking

- Refactored the DataSettings component to streamline the data migration workflow.
- Added a new function to display progress during the migration process, enhancing user feedback.
- Updated modal logic to improve clarity and user experience when selecting new app data paths.
- Implemented error handling and notifications for successful and failed migrations.

* feat: add stop quit app functionality during data migration

- Introduced a new IPC channel to manage the application's quit behavior during data transfer.
- Updated the DataSettings component to prevent the app from quitting while migration is in progress, enhancing user experience.
- Improved modal configurations for better responsiveness and visual appeal.

* feat: enhance app data path handling and localization updates

- Updated IPC handler to use 'filePath' for clarity in app data path management.
- Improved validation to ensure the new app data path is not the root path, enhancing user feedback during path selection.
- Added new translation keys for error messages related to app data path selection in English, Japanese, Russian, Simplified Chinese, and Traditional Chinese, improving localization support.

* feat: add write permission check and enhance quit prevention during data migration

- Introduced a new IPC channel to check write permissions for the app data path.
- Updated the DataSettings component to validate write permissions before proceeding with data migration.
- Enhanced the quit prevention logic to include a reason for blocking the app from quitting during data transfer.
- Added new localization keys for error messages related to write permissions in multiple languages, improving user feedback.

* feat: enhance confirmation modal in DataSettings component

- Updated the confirmation modal to include danger styling for the OK button, improving visual feedback.
- Added localized text for the OK and Cancel buttons, enhancing user experience through better accessibility.

* feat: add localization keys and improve quit prevention during data migration

- Added new localization keys for data migration, including titles and original path labels, enhancing user experience.
- Updated the DataSettings component to ensure the app does not quit during data migration, improving reliability and user feedback.

* feat(DataSettings): add data copying option and update related messages

- Introduced a switch to allow users to choose whether to copy data from the original directory when changing the app data path.
- Updated user notifications and progress messages to reflect the new functionality, including warnings about data copying.
- Enhanced localization files for multiple languages to include new strings related to data copying options and notifications.

* fix(DataSettings): set default for data copying option to true

- Updated the DataSettings component to set the default state of the data copying option to true.
- Added a new CopyDataContent component to enhance the user interface by displaying the data copying option alongside the existing path settings.
- Improved layout by ensuring proper spacing and alignment for better user experience.

---------

Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
2025-06-18 17:39:26 +08:00
GuanMu
9e8f14c9d3 fix: update dify icon (#7301)
* fix: update dify icon

* fix: 更新dify图标尺寸和视图框
2025-06-18 15:20:38 +08:00
fullex
e05eba2450 feat: toggle Selection Assistant on tray menu (#7286)
feat: toggle SelectionService on tray
2025-06-18 00:02:28 +08:00
SuYao
df2bcec768 fix: update buildSdkMessages to handle undefined output in API clients (#7293)
* fix: update buildSdkMessages to handle undefined output in API clients

* fix: update vision model check to include model name in regex validation
2025-06-17 23:11:12 +08:00
shiquda
0bf98cce9e feat: Add pricing configuration and display for models (#3125)
* feat: Add pricing configuration and display for models

- Introduce model pricing fields in ModelEditContent
- Add price calculation and display in MessageTokens
- Update localization files with price-related translations
- Extend Model type with optional pricing information

* fix: Correct currency symbol placement in message token pricing display

* feat: Add custom currency support in model pricing configuration

- Introduce custom currency option in ModelEditContent
- Update localization files with custom currency translations
- Enhance currency symbol selection with custom input
- Improve input styling for pricing configuration

* fix(OpenAIProvider): ensure messages.content of the request is string

* Update ModelEditContent.tsx

* fix(model-price): remove duplicate button

* fix: build error

---------

Co-authored-by: 自由的世界人 <3196812536@qq.com>
2025-06-17 22:53:47 +08:00
MyPrototypeWhat
45ec069dce fix: refactor provider middleware (#7164) 2025-06-17 21:20:52 +08:00
Chen Tao
006f134647 fix: use rewrite to search knowledge (#7289) 2025-06-17 21:02:09 +08:00
Ivan Hanloth
804f9235cd fix: classify agents as Chinese and English (#7287)
* feat: Create i18n for agents in Chinese

* fix: enhance agent loading by supporting language-specific agent files

---------

Co-authored-by: Pleasurecruise <3196812536@qq.com>
2025-06-17 20:05:44 +08:00
自由的世界人
5d9fc292b7 fix: add Markdown preview option in translation settings (#7250) 2025-06-17 14:42:27 +08:00
fullex
37dac7f6ea fix: unified the behavior of SendMessage shortcut (#7276) 2025-06-17 14:38:05 +08:00
koinin
68c1a3e1cc Update models.ts, fix doubao-seed-1-6 (#7274)
* Update models.ts, fix doubao-seed-1-6

* fix2 doubao-seed-1-6
2025-06-17 12:59:18 +08:00
George·Dong
8459e53e39 fix(MessageMenubar): add "copy plain text" control (#7261)
* fix(MessageMenubar): add "copy plain text" control

* fix(migrate): add default plain_text export option in v114
2025-06-17 12:43:36 +08:00
fullex
26597816e5 fix(Inputbar): handle Enter key press correctly during composition (#7269) 2025-06-17 10:28:34 +08:00
eeee0717
d38bcddefa fix: search mcp cannot open 2025-06-17 09:56:43 +08:00
Kingsword
b8b1083921 fix(PromptPopup): Textarea overflow causes modal's close button unclickable (#7266)
fix(PromptPopup): Textarea overflow causes modal's close button  unclickable.
2025-06-17 08:46:24 +08:00
Chen Tao
f19ba44574 fix: support tei (#7239)
fix: support mis-tei
2025-06-16 23:52:29 +08:00
chenxue
050bfe1380 [功能]: aihubmix 更新默认模型 (#7242)
Update models.ts

Co-authored-by: zhaochenxue <zhaochenxue@bixin.cn>
2025-06-16 23:44:59 +08:00
自由的世界人
1b5cba94d2 fix: modify siliconflow text-to-image available models (#7165)
* fix: remove painting provider

* Update PaintingsRoutePage.tsx

* fix: text to image models
2025-06-16 23:44:11 +08:00
SuYao
dbd75912aa Feat/vertex ai support (#6416)
* WIP

* feat: integrate Vertex AI support and enhance service account configuration

- Added Vertex AI service integration with authentication via service accounts.
- Implemented IPC channels for Vertex AI authentication and cache management.
- Updated UI components to support service account configuration, including private key and client email fields.
- Enhanced localization for Vertex AI settings in multiple languages.
- Refactored AiProvider to support dynamic provider creation for Vertex AI.
- Updated Redux store to manage Vertex AI settings and service account information.

* chore: remove debug script from package.json and clean up console log in main process

* fix: ensure async handling in useKnowledge hook for base parameters

- Updated the useKnowledge hook to await the result of getKnowledgeBaseParams when removing items, ensuring proper asynchronous behavior.

* fix: ensure async handling in KnowledgeQueue for base parameters

* fix(i18n): add English prompt placeholder to Russian localization

* chore(yarn): update yarn.lock and patch for @google/genai

* fix(AihubmixPage): update AI provider instantiation to use async create method

* refactor: update VertexAPIClient import and class definition

- Changed import statement for VertexAPIClient to use named import.
- Updated VertexProvider class to VertexAPIClient for consistency with naming conventions.

* refactor: update AiProvider instantiation across components

- Replaced the use of AiProvider.create() with the new AiProvider() constructor in AddKnowledgePopup, AihubmixPage, SiliconPage, and KnowledgeService for consistency and improved clarity.

* refactor: simplify getKnowledgeBaseParams and update API key checks

- Changed getKnowledgeBaseParams to a synchronous function for improved performance.
- Updated API key validation logic to remove unnecessary checks for 'vertexai' provider type across multiple functions.

* feat: add Cephalon provider configuration with API and website links

- Introduced a new provider configuration for Cephalon, including API URL and various website links for official resources, API key, documentation, and models.

* refactor: streamline API call in AddKnowledgePopup component

- Removed unnecessary await from the create API call in the AddKnowledgePopup component, improving code clarity and performance.

* refactor: remove unnecessary await from getKnowledgeBaseParams call

- Simplified the searchKnowledgeBase function by removing the await from getKnowledgeBaseParams, enhancing performance and code clarity.

* refactor: remove externalLiveBindings option from Rollup output configuration in electron.vite.config.ts
2025-06-16 21:46:27 +08:00
beyondkmp
9b321af3da fix: enhance AppUpdater with IP country detection (#7235)
* fix: downgrade version in package.json and enhance AppUpdater with IP country detection

- Downgraded the application version from 1.4.2 to 1.4.1 in package.json.
- Added a new private method `_getIpCountry` in AppUpdater to fetch the user's IP country with a timeout mechanism.
- Updated the `setAutoUpdate` method to adjust the feed URL based on the detected country, improving update handling for users outside of China.

* fix: adjust timeout duration and enhance IP country logging in AppUpdater

* fix: extend timeout duration in AppUpdater for improved fetch reliability

---------

Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
2025-06-16 19:25:14 +08:00
jwcrystal
d061cdb3ef feat: add quick assistant settings panel and management functionality (#6201)
* feat: add quick assistant settings panel and management functionality

- Create QuickAssistantSettings component for UI
- Extend useAssistant hook with quick assistant controls
- Add settings button in ModelSettings page
- Implement temperature, context count, max tokens, and other parameters
- Connect settings to store via updateQuickAssistant action

Separate quick assistant preferences from default assistant settings for better customization.

* refactor(QuickAssistantSettings): remove maxTokens and refine UI layout

- Removed maxTokens related state, logic, and UI elements
- Simplified settings page by eliminating unused configuration
- Adjusted layout for Slider and InputNumber for better usability
- Removed fixed width from Modal to enable responsive behavior

* refactor(HomeWindow): optimize message building logic

- Removed redundant quickAssistant fetching logic
- Use `useQuickAssistant` hook directly for cleaner code
- Simplified message content concatenation method

* style(QuickAssistantSettings): Adjust spacing in settings page layout

Change the column width of sliders and input fields from 20/4 to 21/3 for a more reasonable layout
Also set the popup width to 800px to improve user experience

* feat(Quick Assistant): Add option to select assistant or model, and optimize Quick Assistant logic

- Added functionality to choose between using models or referencing other assistants
- Optimized model selection logic to automatically select based on settings
- Added relevant internationalization texts

* fix(HomeWindow): Dynamically display input box placeholder text based on quick assistant states

* refactor(QuickAssistant): remove the implement of the quick assistant feature and restructure related logic

- Remove code related to the quick assistant feature, including the useQuickAssistant hook, QuickAssistantSettings component, and associated store logic.
- Restructure the HomeWindow component to use default or specified assistants instead of the quick assistant functionality, simplifying the code structure.

* refactor(QuickAssistant): Remove custom default model for quick assistant and switch to default assistant

- Refactor quick assistant functionality, remove independent model settings, change to select via assistant ID
- Update multilingual translation text to match new features

* refactor(QuickAssistant): Remove quick assistant-related states and simplify logic

- Remove unused quick assistant states and toggle functionality, simplifying related logic
- Update multilingual files to match the new default model and assistant labels

* refactor(i18n): Unify translation keys for input field placeholders

Unify the placeholder translation keys from `model_empty` and `assistant_empty` into empty across different scenarios, streamlining code logic

* refactor(settings): simplify quick helper selection logic by directly using the preset helper

- Removed redundant helper filtering logic, directly using the preset helper as the quick helper
2025-06-16 18:13:35 +08:00
Wang Jiyuan
97fb24e060 fix: reranker i18n (#7251) 2025-06-16 17:44:10 +08:00
LANYUN
7a035c5734 feat: Add new provider Lanyun Cloud MaaS (#7033)
* Add files via upload

添加蓝耘logo图片

* 添加lanyun api及站点信息

* fix:修改引号

---------

Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-06-16 17:29:16 +08:00
eeee0717
51d64293d6 fix 2025-06-16 15:31:07 +08:00
eeee0717
6f38702cab Merge remote-tracking branch 'upstream/main' into feat-knowlege-ocr 2025-06-16 15:30:49 +08:00
eeee0717
62669732a0 fix 2025-06-16 15:15:23 +08:00
eeee0717
3c8d13fc43 Merge branch 'main' into feat-knowlege-ocr 2025-06-16 15:06:18 +08:00
eeee0717
c7bfec9098 fix: use user key show unlimited 2025-06-16 15:05:56 +08:00
one
eb89ca5415 fix: gemini generateImage model detection (#7241)
* fix: gemini generateImage model detection

* refactor: use base name for websearch model detection
2025-06-16 13:06:52 +08:00
SuYao
eb650aa586 fix: enable stream output in assistant settings for chat completion (#7240) 2025-06-16 12:51:09 +08:00
自由的世界人
ce32fd32b6 fix: include image files in block retrieval for improved file handling (#7231) 2025-06-16 12:04:45 +08:00
Murphy
00e395f252 feat: Add PDF file support for OpenAI vision models (#7217)
* feat: add base64 PDF support for OpenAI vision models

Signed-off-by: MurphyLo <1335758958@qq.com>

* sort imports in OpenAIResponseAPIClient.ts

* sort imports in OpenAIResponseAPIClient.ts

* remove pdf-parse

* modify pdfPageCount implementation to use officeparser built-in pdf.js

* chore: update yarn.lock to remove pdf-parse dependency

---------

Signed-off-by: MurphyLo <1335758958@qq.com>
Co-authored-by: suyao <sy20010504@gmail.com>
2025-06-16 11:09:51 +08:00
fullex
b6b1b43094 fix(SelectionService): Win10 showing problem & AlwaysOnTop level (#7215)
refactor(SelectionService): enhance logging and adjust window behavior for Windows compatibility

- Updated logInfo method to include a forceShow parameter for improved logging control.
- Ensured toolbar window is set to always on top when shown.
- Commented out setOpacity calls to prevent transparency issues on Windows 10.
2025-06-16 09:54:20 +08:00
自由的世界人
68ae88dc1b fix: prevent update button from rendering when auto-check for updates… (#7212)
fix: prevent update button from rendering when auto-check for updates is disabled
2025-06-16 00:22:38 +08:00
George·Dong
acf78e8383 refactor: optimize notion export (#7228)
* fix(export): Initial fix for the multi-level list export issue in Notion

* fix(getMessageTitle): optimize loading message

* refactor(notion export): optimize notion export

- import notion-helper
- strengthen the robustness of the Notion Export function

* fix(i18n): optimize notion export infos
2025-06-15 23:18:36 +08:00
Wang Jiyuan
bd87b8a002 feat: use variables in topic naming and improve default prompt (#7083)
* feat: use variables in topic naming

* feat: use structured conversation string

* feat: add i18n

* feat: add i18n

* feat: implement summaries for other providers

* fix: adjust new version

* feat: Structure the conversation as a JSON string when naming the topic

* fix: improve logic

* fix: improve prompts

* update fetchMessageSummary
2025-06-15 22:40:37 +08:00
suyao
b4b71ee099 chore: re-add pdfjs-dist dependency in package.json
- Restored pdfjs-dist version 4.10.38 to package.json to maintain PDF rendering functionality after its removal in a previous commit.
2025-06-15 21:28:15 +08:00
suyao
95d9e2ced4 chore: restore pdfjs-dist dependency in package.json
- Re-added pdfjs-dist version 4.10.38 to package.json to ensure PDF rendering functionality is available.
2025-06-15 21:11:20 +08:00
suyao
c578e29621 chore: update package.json to remove redundant canvas patches
- Removed duplicate canvas dependency patches from package.json.
- Retained the necessary patch for @langchain/core to ensure compatibility.
2025-06-15 21:01:57 +08:00
suyao
4530872372 chore: update dependencies and improve OCR functionality
- Added @cherrystudio/pdf-to-img-napi dependency to package.json and yarn.lock for enhanced PDF processing.
- Updated pdfjs-dist to version 4.10.38 for improved PDF rendering capabilities.
- Modified MacSysOcrProvider to utilize the new pdf-to-img-napi module for OCR processing of PDF files.
- Removed unnecessary Windows build steps from the release workflow to streamline the process.
2025-06-15 21:00:04 +08:00
suyao
f907f7fe5e chore: enhance Windows build support in release workflow
- Added support for Windows 11 ARM architecture in the release workflow.
- Introduced a new step to install dependencies specific to Windows 11 ARM.
- Updated the canvas rebuild step to conditionally execute for Windows 11 ARM alongside existing Windows builds.
2025-06-15 19:50:38 +08:00
suyao
f32ccd0fba chore: add pdfjs-dist dependency to package.json and yarn.lock
- Added pdfjs-dist version 4.2.67 to both package.json and yarn.lock to support PDF rendering functionality.
2025-06-15 19:03:27 +08:00
suyao
79f63dd954 refactor: remove canvas and pdfjs-dist dependencies and related image cropping logic
- Eliminated the canvas and pdfjs-dist dependencies from package.json and yarn.lock.
- Removed the image cropping functionality from BaseOcrProvider, simplifying the OCR process in MacSysOcrProvider.
- Updated the NSIS configuration in electron-builder.yml to reflect these changes.
2025-06-15 18:42:29 +08:00
eeee0717
8589cda241 Merge branch 'main' into feat-knowlege-ocr 2025-06-15 18:11:20 +08:00
kangfenmao
7cf7368ae3 lint(SyncServersPopup): fix SyncServersPopup lint error 2025-06-15 14:11:29 +08:00
Aichaellee
9001a96fff feat:add lanyun mcp server 2025-06-15 11:17:02 +08:00
suyao
4e03c489b0 chore: enhance canvas rebuild steps for Windows in release workflow
- Updated the canvas rebuild step to specify architecture for Windows x64 and added a new step for Windows ARM64.
- Ensures compatibility with both x64 and ARM64 architectures during the build process.
2025-06-15 04:37:05 +08:00
suyao
574975f32d chore: add canvas rebuild step for Windows in release workflow
- Introduced a new step to rebuild the canvas module for Windows to ensure compatibility during the build process.
- This step is conditionally executed based on the operating system in the workflow.
2025-06-15 03:59:27 +08:00
suyao
dc3e28b414 chore: add Windows dependencies installation step in release workflow
- Introduced a new step to install necessary dependencies for Windows, including GTK and libjpeg-turbo.
- Updated the release workflow to ensure compatibility with Windows builds.
2025-06-15 03:26:12 +08:00
suyao
ba35ec1b4c chore: update app-builder-lib patch and enhance installAppDependencies method
- Updated the resolution and checksum for the app-builder-lib patch in yarn.lock.
- Modified installAppDependencies method to accept excludeReBuildModules parameter.
- Adjusted platformPackager to pass excludeReBuildModules during dependency installation.
- Updated yarn.js to correctly reference excludeReBuildModules from options.
2025-06-15 02:50:47 +08:00
Wang Jiyuan
9ea4d1f99f fix: send message shortcut doesn't work when editing existing message (#6934)
* fix: send message shortcut doesn't work when editing existing message

* fix: resend shortcut only apply on user msg
2025-06-14 23:11:52 +08:00
Chen Tao
fc62a5bdc2 fix: 7127 (#7196) 2025-06-14 23:01:45 +08:00
one
06b543039f chore(ci): remove --fix from lint (#7159)
* chore(ci): remove --fix from lint

* fix: lint errors
2025-06-14 22:58:49 +08:00
Doekin
1c354ffa0a fix(ImageGenerationMiddleware): correctly process image URLs (#7198) 2025-06-14 22:39:32 +08:00
one
163e28d9ba fix(model): qwen3 model detection (#7201) 2025-06-14 21:24:34 +08:00
suyao
9329eeb2c3 chore: remove Windows dependencies from release workflow 2025-06-14 21:11:29 +08:00
suyao
8b1743419d Merge branch 'feat-knowlege-ocr' of https://github.com/CherryHQ/cherry-studio into feat/ocr 2025-06-14 21:10:20 +08:00
suyao
a9b251e11b chore: add brew update step for macOS dependencies installation in release workflow 2025-06-14 21:09:29 +08:00
suyao
a05b0502bb chore: update dependencies installation for macOS and Ubuntu in release workflow 2025-06-14 20:47:42 +08:00
suyao
58dc927347 chore: add excludeReBuildModules for Windows build configuration 2025-06-14 20:35:17 +08:00
eeee0717
63718b7405 fix: remove windows dependencies 2025-06-14 20:10:22 +08:00
eeee0717
f5dfe3c7c0 Merge remote-tracking branch 'origin/feat-knowlege-ocr' into feat-knowlege-ocr 2025-06-14 19:57:25 +08:00
suyao
e318f8023a chore: remove duplicate pdfjs-dist entry from dependencies 2025-06-14 19:44:59 +08:00
suyao
d0a9a47d31 Merge branch 'main' into feat/ocr 2025-06-14 19:41:44 +08:00
beyondkmp
fd9ff4a432 fix: update app-builder-lib patch and adjust minimumSystemVersion handling (#7197)
- Updated the resolution and checksum for the app-builder-lib patch in yarn.lock.
- Modified macPackager.js and updateInfoBuilder.js to correctly reference LSMinimumSystemVersion.
- Enhanced ArchiveTarget.js and NsisTarget.js to include minimumSystemVersion in updateInfo if specified.
2025-06-14 19:39:28 +08:00
eeee0717
2db480f97a fix: add windows dependencies 2025-06-14 18:45:31 +08:00
eeee0717
e7531a26bf fix: move pdfjs-dist to dependencies 2025-06-14 18:08:57 +08:00
eeee0717
f03b7e1eff fix: knowledge citation display 2025-06-14 18:02:51 +08:00
suyao
fcd999e3b4 Merge branch 'feat-knowlege-ocr' of https://github.com/eeee0717/cherry-studio into feat/ocr 2025-06-14 17:21:53 +08:00
suyao
62251f456b chore: remove macOS-only OCR package from build configuration and scripts 2025-06-14 17:19:48 +08:00
eeee0717
0d4ee05d13 fix: use MAIN_VITE_MINERU_API_KEY 2025-06-14 17:17:01 +08:00
eeee0717
a2172a1d6b fix: use MAIN_VITE_MINERU_API_KEY and ocr only use in macos 2025-06-14 17:07:57 +08:00
eeee0717
1d626af789 chore: change VITE_MINERU_API_KEY to RENDERER_VITE_MINERU_API_KEY 2025-06-14 16:39:13 +08:00
eeee0717
262173774e fix 2025-06-14 16:25:38 +08:00
eeee0717
43f2237cb9 Merge remote-tracking branch 'origin/feat-knowlege-ocr' into feat-knowlege-ocr 2025-06-14 16:21:34 +08:00
suyao
8bb6cb2074 chore: exclude 'pdfjs-dist' and 'canvas' from rebuild modules in electron-builder configuration 2025-06-14 16:20:21 +08:00
eeee0717
bf44d283c6 fix: release.yml 2025-06-14 16:17:08 +08:00
suyao
3abc11a29b Merge remote-tracking branch 'origin/main' into feat/ocr 2025-06-14 16:07:51 +08:00
eeee0717
5cf2b5f9ee typo: excludeReBuildModules 2025-06-14 16:04:37 +08:00
eeee0717
91b012a2cc fix: skip canvas rebuild 2025-06-14 15:59:53 +08:00
eeee0717
e4a546a776 Merge remote-tracking branch 'upstream/main' into feat-knowlege-ocr 2025-06-14 15:57:54 +08:00
beyondkmp
cab975f88b fix: update app-builder-lib patch and add excludeReBuildModules option (#7193) 2025-06-14 15:57:39 +08:00
eeee0717
5b8644db50 fix: gtk url 2025-06-14 15:28:19 +08:00
eeee0717
b3354dfc27 fix: add windows dependencies 2025-06-14 15:24:12 +08:00
eeee0717
d0fb21aab3 fix: add canvas dependencies in linux 2025-06-14 15:01:24 +08:00
Wang Jiyuan
c644e4afa8 feat: add prompt variables docs on topic naming modal popup (#7175) 2025-06-14 14:59:29 +08:00
Wang Jiyuan
0a498460d6 fix: remove margin-bottom for loading animation (#7191)
* fix: remove margin-bottom for loading animation

* fix: just need to remove the margin-bottom of the last block
2025-06-14 14:57:31 +08:00
eeee0717
d3fe587b6e fix; move pdfjs to dependencies 2025-06-14 14:48:05 +08:00
eeee0717
c597905b78 fix 2025-06-14 14:45:03 +08:00
eeee0717
7739e67140 fix: add mineru key 2025-06-14 14:39:29 +08:00
eeee0717
d676dd349b fix: pdfjs-dist only use in macos 2025-06-14 14:34:49 +08:00
eeee0717
1115c54460 fix: pdf-dist 2025-06-14 14:25:11 +08:00
Wang Jiyuan
bd4333ab9a fix: transparent background on translate dropdown (#7189) 2025-06-14 14:18:25 +08:00
Wang Jiyuan
9138aecdf0 fix: missing topic prompt on resend/regenerate and duplicate prevention (#7173)
* fix: completion doesn't include topic prompt

* fix: Multiple additions of topic prompts

* fix: improve logic

* fix: improve logic
2025-06-14 13:37:48 +08:00
Wang Jiyuan
e4e4dcbd1e fix: model_name prompt var always use default model (#7178)
* fix: model_name prompt var always use default mode

* fix: incorrect model name
2025-06-14 13:35:32 +08:00
kangfenmao
3f2140807f Merge branch 'main' into feat-knowlege-ocr 2025-06-14 13:19:13 +08:00
kangfenmao
2a0484ede2 chore(release): update fetch depth in GitHub Actions workflow
- Changed the fetch depth to 0 in the release workflow to ensure all history is available for tagging. This adjustment improves the accuracy of the release process.
2025-06-14 13:18:59 +08:00
Wang Jiyuan
c9f12c2e49 feat: add prompt variable "username" (#7174) 2025-06-14 13:08:32 +08:00
eeee0717
beec45b373 Merge remote-tracking branch 'origin/feat-knowlege-ocr' into feat-knowlege-ocr 2025-06-14 12:32:48 +08:00
suyao
71ef510ac0 refactor(FilesPage): remove unused imports and simplify provider handling
- Eliminated unused imports including FilePdfOutlined and useProviders hook.
- Removed mapping of mistralProviders from the file type options, streamlining the component's logic.
2025-06-14 12:31:38 +08:00
suyao
8992c2788b chore(package.json): reorder and reintroduce embedjs dependencies for consistency 2025-06-14 12:29:28 +08:00
suyao
68840ff907 refactor: simplify development environment setup by removing redundant first setup check for userData path 2025-06-14 12:17:45 +08:00
eeee0717
1b2b17f56d fix 2025-06-14 12:15:26 +08:00
kangfenmao
76d4433519 chore: version 1.5.0-rc.0 2025-06-14 11:48:46 +08:00
fullex
27354d82e2 fix(SelectionAssistant): make add custom action button bigger (#7185)
fix: make add custom action button bigger
2025-06-14 11:43:13 +08:00
亢奋猫
7474b654eb Merge branch 'main' into feat-knowlege-ocr 2025-06-14 11:26:47 +08:00
beyondkmp
f5e1885ffa chore(electron.vite.config): update Rollup configuration for single file packaging (#7183)
- Modified the Rollup options to disable code splitting and enable inline dynamic imports, ensuring a single file output for the build process. This change optimizes the packaging of the Electron application.
2025-06-14 10:01:47 +08:00
eeee0717
f72796b59f Merge remote-tracking branch 'upstream/HEAD' into feat-knowlege-ocr 2025-06-14 09:33:26 +08:00
eeee0717
1bc52eecc6 fix: dev bug 2025-06-14 09:32:48 +08:00
beyondkmp
afc4731b9d feat: clean up Windows license files (#7133)
* feat: enable minification in build configurations and clean up Windows license files

- Added minification option to the build configurations in electron.vite.config.ts to optimize output size.
- Updated after-pack.js to remove unnecessary license files on Windows, improving the packaging process.

* refactor: remove minification from build configurations in electron.vite.config.ts

- Eliminated the minification option from the build settings in electron.vite.config.ts to streamline the build process.
- This change may improve build times and simplify configuration management.

---------

Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
2025-06-14 08:01:36 +08:00
suyao
d015faa8ab Merge branch 'feat-knowlege-ocr' of https://github.com/eeee0717/cherry-studio into feat/ocr 2025-06-13 22:27:48 +08:00
suyao
593dc903fd feat: enhance development environment setup by ensuring userData path is set only once during initial setup 2025-06-13 22:26:35 +08:00
eeee0717
bff7ccc479 fix: FileMetaData replace FileType 2025-06-13 21:25:39 +08:00
eeee0717
401ca04896 Merge branch 'main' into feat-knowlege-ocr 2025-06-13 21:10:12 +08:00
suyao
4d0d99daaf Merge branch 'feat-knowlege-ocr' of https://github.com/eeee0717/cherry-studio into feat/ocr 2025-06-13 20:48:15 +08:00
suyao
2378587684 chore: update package.json to include pdf-to-img dependency and add TODO comment in MacSysOcrProvider for future optimization 2025-06-13 20:48:01 +08:00
eeee0717
7cd2738ea0 feat: add quota tag 2025-06-13 20:46:12 +08:00
eeee0717
07c8dfa996 fix: quota tag 2025-06-13 19:56:17 +08:00
eeee0717
f34a8231b0 fix 2025-06-13 18:48:44 +08:00
eeee0717
7c03228816 Merge branch 'main' into feat-knowlege-ocr 2025-06-13 18:42:48 +08:00
eeee0717
7f63201f67 feat: add quota 2025-06-13 18:32:28 +08:00
MyPrototypeWhat
9411866727 refactor(ImageBlock): enhance loading state presentation and improve … (#7160)
* refactor(ImageBlock): enhance loading state presentation and improve layout responsiveness

- Wrapped the loading spinner in a new SpinnerWrapper for better alignment and presentation during streaming and processing states.
- Updated the ImageBlockGroup to use `repeat(auto-fit, minmax(...))` for more flexible grid layout, improving responsiveness across different screen sizes.

These changes enhance the user experience by providing a clearer loading indication and a more adaptable layout for image blocks.

* style(ImageBlockGroup): comment out child styling for future adjustments

- Commented out the child styling rules in ImageBlockGroup to allow for potential layout modifications without removing the code entirely.
- This change prepares the component for further enhancements while maintaining existing functionality.

* refactor(ImageBlock): replace loading spinner with Ant Design Skeleton component

- Updated the loading state presentation in ImageBlock by replacing the custom spinner with Ant Design's Skeleton component for a more consistent UI experience.
- Removed the SpinnerWrapper and simplified the return statement for better readability.
- This change enhances the visual feedback during image loading while maintaining the component's functionality.

---------

Co-authored-by: lizhixuan <zhixuan.li@banosuperapp.com>
2025-06-13 17:55:40 +08:00
one
c7fd1ac373 fix(TopicRenaming): captured activeTopic.id is outdated and causes accidental topic changing after renaming (#7157)
* fix(TopicRenaming): captured activeTopic.id is outdated and causes accidental topic changing after renaming

* fix: prevent topic changing on auto renaming

* fix: filter out main text on summarizing
2025-06-13 17:24:24 +08:00
eeee0717
bed0da6d31 feat: add quota 2025-06-13 15:14:25 +08:00
one
faf14ff10b fix(MermaidPreview): re-render mermaid on display change (#7058)
* fix(MermaidPreview): re-render mermaid on display change

* test: add tests for MermaidPreview
2025-06-13 13:52:50 +08:00
one
3b3b3c961e refactor(CodeEditor): remove the right border of gutters (#7137)
refactor: remove the right border of gutters
2025-06-13 11:02:22 +08:00
beyondkmp
06d495c7e1 feat: Enhance AppUpdater for Windows installation directory support (#7135)
- Added support for setting the installation directory for the autoUpdater on Windows using NsisUpdater.
- Imported the 'path' module to dynamically determine the installation path based on the executable location.
- This change improves the updater's functionality and ensures a smoother installation experience for Windows users.

Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
2025-06-13 10:52:25 +08:00
beyondkmp
922e142079 feat: Reduce app size (#7113)
* chore: update jsdom dependency to patch version 26.1.0

- Changed jsdom version from ^26.0.0 to a patched version 26.1.0 in package.json and yarn.lock.
- Applied a specific patch to address issues with the jsdom package.

* chore: update package.json dependencies

- Removed outdated dependencies and added new ones to improve project functionality.
- Updated versions for several packages, including @strongtz/win32-arm64-msvc, os-proxy-config, and selection-hook.
- Reorganized dependencies and devDependencies for better clarity and maintenance.

* chore: update package dependencies and remove jsdom patch

- Replaced @cherrystudio/embedjs-libsql with @libsql/client and added @libsql/win32-x64-msvc and jsdom as new dependencies.
- Updated turndown version and removed the jsdom patch from the project.
- Ensured consistency in dependency versions across package.json and yarn.lock.
2025-06-13 00:56:34 +08:00
Wang Jiyuan
cdc9347011 fix: token usage always display when assistant msg generation aborted (#7121)
* fix: token usage always display when assistant msg generation aborted

* remove console.log
2025-06-13 00:48:21 +08:00
Xin Rui
e264b5b052 feat: Support reasoning control for Doubao/Mistral models. (#7116)
* feat: Support reasoning control for Doubao models.

* feat: Enhance model handling and support for Doubao and Gemini in API clients

- Added support for Doubao thinking modes in OpenAIAPIClient and GeminiAPIClient.
- Introduced GEMINI_FLASH_MODEL_REGEX for model identification.
- Updated models.ts to include new Doubao and Gemini model regex patterns.
- Added new image asset for ChatGPT in models.
- Enhanced reasoning control and token budget handling for Doubao models.
- Improved the Inputbar's ThinkingButton component to accommodate new thinking options.

---------

Co-authored-by: suyao <sy20010504@gmail.com>
2025-06-13 00:03:58 +08:00
one
28696c0dad fix: start animation only if the topic should be renamed (#7125) 2025-06-12 22:43:44 +08:00
one
8689c07888 feat: animate topic renaming (#6794)
* feat: animate topic renaming

* fix: load messages before renaming a topic

* refactor: better error handling

* refactor: make function names more reasonable

* refactor: update shimmer colors

* refactor: use typing effect
2025-06-12 18:41:15 +08:00
one
aa0b7ed1a8 feat(Markdown): customize table to support source copying (#7019)
* feat(Markdown): customize table to support source copying

- add a customized table component
- update ChatNavigation excluded selectors

* refactor: remove redundant feedback

* test: add tests for Table
2025-06-12 16:28:28 +08:00
MyPrototypeWhat
5f4d73b00d feat: add middleware support for provider (#6176)
* feat: add middleware support for OpenAIProvider with logging capabilities

- Introduced middleware functionality in OpenAIProvider to enhance completions processing.
- Created AiProviderMiddlewareTypes for defining middleware interfaces and contexts.
- Implemented sampleLoggingMiddleware for logging message content and processing times.
- Updated OpenAIProvider constructor to accept middleware as an optional parameter.
- Refactored completions method to utilize middleware for improved extensibility and logging.

* refactor: streamline OpenAIProvider initialization and middleware application

- Removed optional middleware parameter from OpenAIProvider constructor for simplicity.
- Refactored ProviderFactory to create instances of providers and apply logging middleware consistently.
- Enhanced completions method visibility by changing it from private to public.
- Cleaned up unused code related to middleware handling in OpenAIProvider.

* feat: enhance AiProvider with new middleware capabilities and completion context

- Added public getter for provider info in BaseProvider.
- Introduced finalizeSdkRequestParams hook for middleware to modify SDK-specific request parameters.
- Refactored completions method in OpenAIProvider to accept a context object, improving middleware integration.
- Updated middleware types to include new context structure and callback functions for better extensibility.
- Enhanced logging middleware to utilize new context structure for improved logging capabilities.

* refactor: enhance middleware structure and context handling in AiProvider

- Updated BaseProvider and AiProvider to utilize AiProviderMiddlewareCompletionsContext for completions method.
- Introduced new utility functions for middleware context creation and execution.
- Refactored middleware application logic to improve extensibility and maintainability.
- Replaced sampleLoggingMiddleware with a more robust LoggingMiddleware implementation.
- Added new context management features for better middleware integration.

* refactor: update AiProvider and middleware structure for improved completions handling

- Refactored BaseProvider and AiProvider to change completions method signature from context to params.
- Removed unused AiProviderMiddlewareCompletionsContext and related code for cleaner implementation.
- Enhanced middleware configuration by introducing a dedicated middleware registration file.
- Implemented logging middleware for completions to improve observability during processing.
- Streamlined middleware application logic in ProviderFactory for better maintainability.

* docs: 添加中间件编写指南文档

- 新增《如何为 AI Provider 编写中间件》文档,详细介绍中间件架构、类型及编写示例。
- 说明了中间件的执行顺序、注册方法及最佳实践,旨在帮助开发者有效创建和维护中间件。

* refactor: update completions method signatures and introduce CompletionsResult type

- Changed the completions method signature in BaseProvider and AiProvider to return CompletionsResult instead of void.
- Added CompletionsResult type definition to encapsulate streaming and usage metrics.
- Updated middleware and related components to handle the new CompletionsResult structure, ensuring compatibility with existing functionality.
- Introduced new middleware for stream adaptation to enhance chunk processing during completions.

* refactor: enhance AiProvider middleware and streaming handling

- Updated CompletionsResult type to support both OpenAI SDK stream and ReadableStream.
- Modified CompletionsMiddleware to return CompletionsResult, improving type safety.
- Introduced StreamAdapterMiddleware to adapt OpenAI SDK streams to application-specific chunk streams.
- Enhanced logging in CompletionsLoggingMiddleware to capture and return results from next middleware calls.

* refactor: update AiProvider and middleware for OpenAI completions handling

- Renamed CompletionsResult to CompletionsOpenAIResult for clarity and updated its structure to support both OpenAI SDK and application-specific streams.
- Modified completions method signatures in AiProvider and OpenAIProvider to return CompletionsOpenAIResult.
- Enhanced middleware to process and adapt OpenAI SDK streams into standard chunk formats, improving overall streaming handling.
- Introduced new middleware components: FinalChunkConsumerAndNotifierMiddleware and OpenAISDKChunkToStandardChunkMiddleware for better chunk processing and logging.

* 删除 ExtractReasoningCompletionsMiddleware.ts 文件,清理未使用的中间件代码以提高代码整洁性和可维护性。

* refactor: consolidate middleware types and improve imports

- Replaced references to AiProviderMiddlewareTypes with the new middlewareTypes file across various middleware components for better organization.
- Introduced TextChunkMiddleware to enhance chunk processing from OpenAI SDK streams.
- Cleaned up imports in multiple files to reflect the new structure, improving code clarity and maintainability.

* feat: enhance abort handling with AbortController in middleware chain

- Update CompletionsOpenAIResult interface to use AbortController instead of AbortSignal
- Modify OpenAIProvider to pass abortController in completions method return
- Update AbortHandlerMiddleware to use controller from upstream result
- Improve abort handling flexibility by exposing full controller capabilities
- Enable middleware to actively control abort operations beyond passive monitoring

This change provides better control over request cancellation and enables
more sophisticated abort handling patterns in the middleware pipeline.

* refactor: enhance AiProvider and middleware for improved completions handling

- Updated BaseProvider to expose additional methods and properties, including getMessageParam and createAbortController.
- Modified OpenAIProvider to streamline completions processing and integrate new middleware for tool handling.
- Introduced TransformParamsBeforeCompletions middleware to standardize parameter transformation before completions.
- Added McpToolChunkMiddleware for managing tool calls within the completions stream.
- Enhanced middleware types to support new functionalities and improve overall structure.

These changes improve the flexibility and maintainability of the AiProvider and its middleware, facilitating better handling of OpenAI completions and tool interactions.

* refactor: enhance middleware for recursive handling and internal state management

- Introduced internal state management in middleware to support recursive calls, including enhanced dispatch functionality.
- Updated middleware types to include new internal fields for managing recursion depth and call status.
- Improved logging for better traceability of recursive calls and state transitions.
- Adjusted various middleware components to utilize the new internal state, ensuring consistent behavior during recursive processing.

These changes enhance the middleware's ability to handle complex scenarios involving recursive calls, improving overall robustness and maintainability.

* fix(OpenAIProvider): return empty object for missing sdkParams in completions handling

- Updated OpenAIProvider to return an empty object instead of undefined when sdkParams are not found, ensuring consistent return types.
- Enhanced TransformParamsBeforeCompletions middleware to include a flag for built-in web search functionality based on assistant settings.

* refactor(OpenAIProvider): enhance completions handling and middleware integration

- Updated the completions method in OpenAIProvider to include an onChunk callback for improved streaming support.
- Enabled the ThinkChunkMiddleware in the middleware registration for better handling of reasoning content.
- Increased the maximum recursion depth in McpToolChunkMiddleware to prevent infinite loops.
- Refined TextChunkMiddleware to directly enqueue chunks without unnecessary type checks.
- Improved the ThinkChunkMiddleware to better manage reasoning tags and streamline chunk processing.

These changes enhance the overall functionality and robustness of the AI provider and middleware components.

* feat(WebSearchMiddleware): add web search handling and integration

- Introduced WebSearchMiddleware to process various web search results, including annotations and citations, and generate LLM_WEB_SEARCH_COMPLETE chunks.
- Enhanced TextChunkMiddleware to support link conversion based on the model and assistant settings, improving the handling of TEXT_DELTA chunks.
- Updated middleware registration to include WebSearchMiddleware for comprehensive search result processing.

These changes enhance the AI provider's capabilities in handling web search functionalities and improve the overall middleware architecture.

* fix(middleware): improve optional chaining for chunk processing

- Updated McpToolChunkMiddleware and ThinkChunkMiddleware to use optional chaining for accessing choices, enhancing robustness against undefined values.
- Removed commented-out code in ThinkChunkMiddleware to streamline the chunk handling process.

These changes improve the reliability of middleware when processing OpenAI API responses.

* feat(middleware): enhance AbortHandlerMiddleware with recursion handling

- Added logic to detect and handle recursive calls, preventing unnecessary creation of AbortControllers.
- Improved logging for better visibility into middleware operations, including recursion depth and cleanup processes.
- Streamlined cleanup process for non-stream responses to ensure resources are released promptly.

These changes enhance the robustness and efficiency of the AbortHandlerMiddleware in managing API requests.

* docs(middleware): 迁移步骤

* feat(middleware): implement FinalChunkConsumerMiddleware for usage and metrics accumulation

- Introduced FinalChunkConsumerMiddleware to replace the deprecated FinalChunkConsumerAndNotifierMiddleware.
- This new middleware accumulates usage and metrics data from OpenAI API responses, enhancing tracking capabilities.
- Updated middleware registration to utilize the new FinalChunkConsumerMiddleware, ensuring proper integration.
- Added support for handling recursive calls and improved logging for better debugging and monitoring.

These changes enhance the middleware's ability to manage and report usage metrics effectively during API interactions.

* refactor(migrate): update API request and response structures to TypeScript types

- Changed the definitions of `CoreCompletionsRequest` and `Chunk` to use TypeScript types instead of Zod Schemas for better type safety and clarity.
- Updated middleware and service classes to handle the new `Chunk` type, ensuring compatibility with the revised API client structure.
- Enhanced the response processing logic to standardize the handling of raw SDK chunks into application-level `Chunk` objects.
- Adjusted middleware to consume the new `Chunk` type, streamlining the overall architecture and improving maintainability.

These changes facilitate a more robust and type-safe integration with AI provider APIs.

* feat(AiProvider): implement API client architecture

- Introduced ApiClientFactory for creating instances of API clients based on provider configuration.
- Added BaseApiClient as an abstract class to provide common functionality for specific client implementations.
- Implemented OpenAIApiClient for OpenAI and Azure OpenAI, including request and response handling.
- Defined types and interfaces for API client operations, enhancing type safety and clarity.
- Established middleware schemas for standardized request processing across AI providers.

These changes lay the groundwork for a modular and extensible API client architecture, improving the integration of various AI providers.

* refactor(StreamAdapterMiddleware): simplify stream adaptation logic

- Updated StreamAdapterMiddleware to directly use AsyncIterable instead of wrapping it with rawSdkChunkAdapter, streamlining the adaptation process.
- Modified asyncGeneratorToReadableStream to accept AsyncIterable, enhancing its flexibility and usability.

These changes improve the efficiency of stream handling in the middleware.

* refactor(AiProvider): simplify ResponseChunkTransformer interface and streamline OpenAIApiClient response handling

- Changed ResponseChunkTransformer from an interface to a type for improved clarity and simplicity.
- Refactored OpenAIApiClient to streamline the response transformation logic, reducing unnecessary complexity in handling tool calls and reasoning content.
- Enhanced type safety by ensuring consistent handling of optional properties in response processing.

These changes improve the maintainability and readability of the codebase while ensuring robust response handling in the API client.

* doc(technicalArchitecture): add comprehensive documentation for AI Provider architecture

* feat(architecture): introduce AI Core Design documentation and middleware specification

- Added a comprehensive technical architecture document for the new AI Provider (`aiCore`), outlining core design principles, component details, and execution flow.
- Established a middleware specification document to define the design, implementation, and usage of middleware within the `aiCore` module, promoting a flexible and maintainable system.
- These additions provide clarity and guidance for future development and integration of AI functionalities within Cherry Studio.

* refactor(middleware): consolidate and enhance middleware architecture

- Removed deprecated extractReasoningMiddleware and integrated its functionality into existing middleware.
- Streamlined middleware registration and improved type definitions for better clarity and maintainability.
- Introduced new middleware components for handling chunk processing, web search, and reasoning tags, enhancing overall functionality.
- Updated various middleware to utilize the new structures and improve logging for better debugging.

These changes enhance the middleware's efficiency and maintainability, providing a more robust framework for API interactions.

* refactor(AiProvider): enhance API client and middleware integration

- Updated ApiClientFactory to include new SDK types for improved type safety and clarity.
- Refactored BaseApiClient to support additional parameters in the completions method, enhancing flexibility for processing states.
- Streamlined OpenAIApiClient to better handle tool calls and responses, including the introduction of new chunk types for tool management.
- Improved middleware architecture by integrating processing states and refining message handling, ensuring a more robust interaction with the API.

These changes enhance the overall maintainability and functionality of the API client and middleware, providing a more efficient framework for AI interactions.

* fix(McpToolChunkMiddleware): remove redundant logging in recursion state update

* refactor(McpToolChunkMiddleware): update tool call handling and type definitions

- Replaced ChatCompletionMessageToolCall with SdkToolCall for improved type consistency.
- Updated return types of executeToolCalls and executeToolUses functions to SdkMessage[], enhancing clarity in message handling.
- Removed unused import to streamline the code.

These changes enhance the maintainability and type safety of the middleware, ensuring better integration with the SDK.

* refactor(middleware): enhance middleware structure and type handling

- Updated middleware components to utilize new SDK types, improving type safety and clarity across the board.
- Refactored various middleware to streamline processing logic, including enhanced handling of SDK messages and tool calls.
- Improved logging and error handling for better debugging and maintainability.
- Consolidated middleware functions to reduce redundancy and improve overall architecture.

These changes enhance the robustness and maintainability of the middleware framework, ensuring a more efficient interaction with the API.

* refactor(middleware): unify type imports and enhance middleware structure

- Updated middleware components to import types from a unified 'types' file, improving consistency and clarity across the codebase.
- Removed the deprecated 'type.ts' file to streamline the middleware structure.
- Enhanced middleware registration and export mechanisms for better accessibility and maintainability.

These changes contribute to a more organized and efficient middleware framework, facilitating easier future development and integration.

* refactor(AiProvider): enhance API client and middleware integration

- Updated AiProvider components to support new SDK types, improving type safety and clarity.
- Refactored middleware to streamline processing logic, including enhanced handling of tool calls and responses.
- Introduced new middleware for tool use extraction and raw stream listening, improving overall functionality.
- Improved logging and error handling for better debugging and maintainability.

These changes enhance the robustness and maintainability of the API client and middleware, ensuring a more efficient interaction with the API.

* feat(middleware): add new middleware components for raw stream listening and tool use extraction

- Introduced RawStreamListenerMiddleware and ToolUseExtractionMiddleware to enhance middleware capabilities.
- Updated MiddlewareRegistry to include new middleware entries, improving overall functionality and extensibility.

These changes expand the middleware framework, facilitating better handling of streaming and tool usage scenarios.

* refactor(AiProvider): integrate new API client and middleware architecture

- Replaced BaseProvider with ApiClientFactory to enhance API client instantiation.
- Updated completions method to utilize new middleware architecture for improved processing.
- Added TODOs for refactoring remaining methods to align with the new API client structure.
- Removed deprecated middleware wrapping logic from ApiClientFactory for cleaner implementation.

These changes improve the overall structure and maintainability of the AiProvider, facilitating better integration with the new middleware system.

* refactor(middleware): update middleware architecture and documentation

- Revised middleware naming conventions and introduced a centralized MiddlewareRegistry for better management and accessibility.
- Enhanced MiddlewareBuilder to support named middleware and streamline the construction of middleware chains.
- Updated documentation to reflect changes in middleware usage and structure, improving clarity for future development.

These changes improve the organization and usability of the middleware framework, facilitating easier integration and maintenance.

* refactor(AiProvider): enhance completions middleware logic and API client handling

- Updated the completions method to conditionally remove middleware based on parameters, improving flexibility in processing.
- Refactored the response chunk transformer in OpenAIApiClient and AnthropicAPIClient to utilize a more streamlined approach with TransformStream.
- Simplified middleware context handling by removing unnecessary custom state management.
- Improved logging and error handling across middleware components for better debugging and maintainability.

These changes enhance the efficiency and clarity of the AiProvider's middleware integration, ensuring a more adaptable and robust processing framework.

* refactor(AiProvider, middleware): clean up logging and improve method naming

- Removed unnecessary logging of parameters in AiProvider to streamline the code.
- Updated method name assignment in middleware to enhance clarity and consistency.

These changes contribute to a cleaner codebase and improve the readability of the middleware and provider components.

* feat(middleware): enhance middleware types and add RawStreamListenerMiddleware

- Introduced RawStreamListenerMiddleware to the MiddlewareName enum for improved middleware capabilities.
- Updated type definitions across middleware components to enhance type safety and clarity, including the addition of new SDK types.
- Refactored context and middleware API interfaces to support more specific type parameters, improving overall maintainability.

These changes expand the middleware framework, facilitating better handling of streaming scenarios and enhancing type safety across the codebase.

* refactor(messageThunk): convert callback functions to async and handle errors during database updates

This commit updates several callback functions in the messageThunk to be asynchronous, ensuring that block transitions are awaited properly. Additionally, error handling is added for the database update function to log any failures when saving blocks. This improves the reliability and responsiveness of the message processing flow.

* refactor: enhance message block handling in messageThunk

This commit refactors the message processing logic in messageThunk to improve the management of message blocks. Key changes include the introduction of dedicated IDs for different block types (main text, thinking, tool, and image) to streamline updates and transitions. The handling of placeholder blocks has been improved, ensuring that they are correctly converted to their respective types during processing. Additionally, error handling has been enhanced for better reliability in database updates.

* feat(AiProvider): add default timeout configuration and enhance API client aborthandler

- Introduced a default timeout constant to the configuration for improved API client timeout management.
- Updated BaseApiClient and its derived classes to utilize the new timeout setting, ensuring consistent timeout behavior across different API clients.
- Enhanced middleware to pass the timeout value during API calls, improving error handling and responsiveness.

These changes improve the overall robustness and configurability of the API client interactions, facilitating better control over request timeouts.

* feat(GeminiProvider): implement Gemini API client and enhance file handling

- Introduced GeminiAPIClient to facilitate interactions with the Gemini API, replacing the previous GoogleGenAI integration.
- Refactored GeminiProvider to utilize the new API client, improving code organization and maintainability.
- Enhanced file handling capabilities, including support for PDF uploads and retrieval of file metadata.
- Updated message processing to accommodate new SDK types and improve content generation logic.

These changes significantly enhance the functionality and robustness of the GeminiProvider, enabling better integration with the Gemini API and improving overall user experience.

* refactor(AiProvider, middleware): streamline API client and middleware integration

- Removed deprecated methods and types from various API clients, enhancing code clarity and maintainability.
- Updated the CompletionsParams interface to support messages as a string or array, improving flexibility in message handling.
- Refactored middleware components to eliminate unnecessary state management and improve type safety.
- Enhanced the handling of streaming responses and added utility functions for better stream management.

These changes contribute to a more robust and efficient architecture for the AiProvider and its associated middleware, facilitating improved API interactions and user experience.

* refactor(middleware): translation 适配

- Deleted SdkCallMiddleware to streamline middleware architecture and improve maintainability.
- Commented out references to SdkCallModule in examples and registration files to prevent usage.
- Enhanced logging in AbortHandlerMiddleware for better debugging and tracking of middleware execution.
- Updated parameters in ResponseTransformMiddleware to improve flexibility in handling response settings.

These changes contribute to a cleaner and more efficient middleware framework, facilitating better integration and performance.

* refactor(ApiCheck): streamline API validation and error handling

- Updated the API check logic to simplify validation processes and improve error handling across various components.
- Refactored the `checkApi` function to throw errors directly instead of returning validation objects, enhancing clarity in error management.
- Improved the handling of API key checks in `checkModelWithMultipleKeys` to provide more informative error messages.
- Added a new method `getEmbeddingDimensions` in the `AiProvider` class to facilitate embedding dimension retrieval, enhancing model compatibility checks.

These changes contribute to a more robust and maintainable API validation framework, improving overall user experience and error reporting.

* refactor(HealthCheckService, ModelService): improve error handling and performance metrics

- Updated error handling in `checkModelWithMultipleKeys` to truncate error messages for better readability.
- Refactored `performModelCheck` to remove unnecessary error handling, focusing on performance metrics by returning only latency.
- Enhanced the `checkModel` function to ensure consistent return types, improving clarity in API interactions.

These changes contribute to a more efficient and user-friendly error reporting and performance tracking system.

* refactor(AiProvider, models): enhance model handling and API client integration

- Updated the `listModels` method in various API clients to improve model retrieval and ensure consistent return types.
- Refactored the `EditModelsPopup` component to handle model properties more robustly, including fallback options for `id`, `name`, and other attributes.
- Enhanced type definitions for models in the SDK to support new integrations and improve type safety.

These changes contribute to a more reliable and maintainable model management system within the AiProvider, enhancing overall user experience and API interactions.

* refactor(AiProvider, clients): implement image generation functionality

- Refactored the `generateImage` method in the `AiProvider` class to utilize the `apiClient` for image generation, replacing the previous placeholder implementation.
- Updated the `BaseApiClient` to include an abstract `generateImage` method, ensuring all derived clients implement this functionality.
- Implemented the `generateImage` method in `GeminiAPIClient` and `OpenAIAPIClient`, providing specific logic for image generation based on the respective SDKs.
- Added type definitions for `GenerateImageParams` across relevant files to enhance type safety and clarity in image generation parameters.

These changes enhance the image generation capabilities of the AiProvider, improving integration with various API clients and overall user experience.

* refactor(AiProvider, clients): restructure API client architecture and remove deprecated components

- Refactored the `ProviderFactory` and removed the `AihubmixProvider` to streamline the API client architecture.
- Updated the import paths for `isOpenAIProvider` to reflect the new structure.
- Introduced `AihubmixAPIClient` and `OpenAIResponseAPIClient` to enhance client handling based on model types.
- Improved the `AiProvider` class to utilize the new clients for better model-specific API interactions.
- Enhanced type definitions and error handling across various components to improve maintainability and clarity.

These changes contribute to a more efficient and organized API client structure, enhancing overall integration and user experience.

* fix: update system prompt handling in API clients to use await for asynchronous operations

- Modified the `AnthropicAPIClient`, `GeminiAPIClient`, `OpenAIAPIClient`, and `OpenAIResponseAPIClient` to ensure `buildSystemPrompt` is awaited, improving the handling of system prompts.
- Adjusted the `fetchMessagesSummary` function to utilize the last five user messages for better context in API calls and added a utility function to clean up topic names.

These changes enhance the reliability of prompt generation and improve the overall API interaction experience.

* refactor(middleware): remove examples.ts to streamline middleware documentation

- Deleted the `examples.ts` file containing various middleware usage examples to simplify the middleware structure and documentation.
- This change contributes to a cleaner codebase and focuses on essential middleware components, enhancing maintainability.

* refactor(AiProvider, middleware): enhance middleware handling and error management

- Updated the `CompletionsParams` interface to include a new `callType` property for better middleware decision-making based on the context of the API call.
- Introduced `ErrorHandlerMiddleware` to standardize error handling across middleware, allowing errors to be captured and processed as `ErrorChunk` objects.
- Modified the `AbortHandlerMiddleware` to conditionally remove itself based on the `callType`, improving middleware efficiency.
- Cleaned up logging in `AbortHandlerMiddleware` to reduce console output and enhance performance.
- Updated middleware registration to include the new `ErrorHandlerMiddleware`, ensuring comprehensive error management in the middleware pipeline.

These changes contribute to a more robust and maintainable middleware architecture, improving error handling and overall API interaction efficiency.

* feat: implement token estimation for message handling

- Added an abstract method `estimateMessageTokens` to the `BaseApiClient` class for estimating token usage based on message content.
- Implemented the `estimateMessageTokens` method in `AnthropicAPIClient`, `GeminiAPIClient`, `OpenAIAPIClient`, and `OpenAIResponseAPIClient` to calculate token consumption for various message types.
- Enhanced middleware to accumulate token usage for new messages, improving tracking of API call costs.

These changes improve the efficiency of message processing and provide better insights into token usage across different API clients.

* feat: add support for image generation and model handling

- Introduced `SUPPORTED_DISABLE_GENERATION_MODELS` to manage models that disable image generation.
- Updated `isSupportedDisableGenerationModel` function to check model compatibility.
- Enhanced `Inputbar` logic to conditionally enable image generation based on model support.
- Modified API clients to handle image generation calls and responses, including new chunk types for image data.
- Updated middleware and service layers to incorporate image generation parameters and improve overall processing.

These changes enhance the application's capabilities for image generation and improve the handling of various model types.

* feat: enhance GeminiAPIClient for image generation support

- Added `getGenerateImageParameter` method to configure image generation parameters.
- Updated request handling in `GeminiAPIClient` to include image generation options.
- Enhanced response processing to handle image data and enqueue it correctly.

These changes improve the GeminiAPIClient's capabilities for generating and processing images, aligning with recent enhancements in image generation support.

* feat: enhance image generation handling in OpenAIResponseAPIClient and middleware

- Updated OpenAIResponseAPIClient to improve user message processing for image generation.
- Added handling for image creation events in TransformCoreToSdkParamsMiddleware.
- Adjusted ApiService to streamline image generation event handling.
- Modified messageThunk to reflect changes in image block status during processing.

These enhancements improve the integration and responsiveness of image generation features across the application.

* refactor: remove unused AI provider classes

- Deleted `AihubmixProvider`, `AnthropicProvider`, `BaseProvider`, `GeminiProvider`, and `OpenAIProvider` as they are no longer utilized in the codebase.
- This cleanup reduces code complexity and improves maintainability by removing obsolete components related to AI provider functionality.

* chore: remove obsolete test files for middleware

- Deleted test files for `AbortHandlerMiddleware`, `LoggingMiddleware`, `TextChunkMiddleware`, `ThinkChunkMiddleware`, and `WebSearchMiddleware` as they are no longer needed.
- This cleanup helps streamline the codebase and reduces maintenance overhead by removing outdated tests.

* chore: remove Suggestions component and related functionality

- Deleted the `Suggestions` component from the home page as it is no longer needed.
- Removed associated imports and functions related to suggestion fetching, streamlining the codebase.
- This cleanup helps improve maintainability by eliminating unused components.

* feat: enhance OpenAIAPIClient and StreamProcessingService for tool call handling

- Updated OpenAIAPIClient to conditionally include tool calls in the assistant message, improving message processing logic.
- Enhanced tool call handling in the response transformer to correctly manage and enqueue tool call data.
- Added a new callback for LLM response completion in StreamProcessingService, allowing better integration of response handling.

These changes improve the functionality and responsiveness of the OpenAI API client and stream processing capabilities.

* fix: copilot error

* fix: improve chunk handling in TextChunkMiddleware and ThinkChunkMiddleware

- Updated TextChunkMiddleware to enqueue LLM_RESPONSE_COMPLETE chunks based on accumulated text content.
- Refactored ThinkChunkMiddleware to generate THINKING_COMPLETE chunks when receiving non-THINKING_DELTA chunks, ensuring proper handling of accumulated thinking content.
- These changes enhance the middleware's responsiveness and accuracy in processing text and thinking chunks.

* chore: update dependencies and improve styling

- Updated `selection-hook` dependency to version 0.9.23 in `package.json` and `yarn.lock`.
- Removed unused styles from `container.scss` and adjusted padding in `index.scss`.
- Enhanced message rendering and layout in various components, including `Message`, `MessageHeader`, and `MessageMenubar`.
- Added tooltip support for message divider settings in `SettingsTab`.
- Improved handling of citation display in `CitationsList` and `CitationBlock`.

These changes streamline the codebase and enhance the user interface for better usability.

* feat: implement image generation middleware and enhance model handling

- Added `ImageGenerationMiddleware` to handle dedicated image generation models, integrating image processing and OpenAI's image generation API.
- Updated `AiProvider` to utilize the new middleware for dedicated image models, ensuring proper middleware chaining.
- Introduced constants for dedicated image models in `models.ts` to streamline model identification.
- Refactored error handling in `ErrorHandlerMiddleware` to use a utility function for better error management.
- Cleaned up imports and removed unused code in various files for improved maintainability.

* fix: update dedicated image models identification logic

- Modified the `DEDICATED_IMAGE_MODELS` array to include 'grok-2-image' for improved model handling.
- Enhanced the `isDedicatedImageGenerationModel` function to use a more robust check for model identification, ensuring better accuracy in middleware processing.

* refactor: remove OpenAIResponseProvider class

- Deleted the `OpenAIResponseProvider` class from the `AiProvider` module, streamlining the codebase by eliminating unused code.
- This change enhances maintainability and reduces complexity in the provider architecture.

* fix: usermessage

* refactor: simplify AbortHandlerMiddleware for improved abort handling

- Removed direct dependency on ApiClient for creating AbortController, enhancing modularity.
- Introduced utility functions to manage abort controllers, streamlining the middleware's responsibilities.
- Delegated abort signal handling to downstream middlewares, allowing for cleaner separation of concerns.

* refactor(aiCore): Consolidate AI provider and middleware architecture

This commit refactors the AI-related modules by unifying the `clients` and `middleware` directories under a single `aiCore` directory. This change simplifies the project structure, improves modularity, and makes the architecture more cohesive.

Key changes:
- Relocated provider-specific clients and middleware into the `aiCore` directory, removing the previous `providers/AiProvider` structure.
- Updated the architectural documentation (`AI_CORE_DESIGN.md`) to accurately reflect the new, streamlined directory layout and execution flow.
- The main `AiProvider` class is now the primary export of `aiCore/index.ts`, serving as the central access point for AI functionalities.

* refactor: update imports and enhance middleware functionality

- Adjusted import statements in `AnthropicAPIClient` and `GeminiAPIClient` for better organization.
- Improved `AbortHandlerMiddleware` to handle abort signals more effectively, including the conversion of streams to handle abort scenarios.
- Enhanced `ErrorHandlerMiddleware` to differentiate between abort errors and other types, ensuring proper error handling.
- Cleaned up commented-out code in `FinalChunkConsumerMiddleware` for better readability and maintainability.

* refactor: streamline middleware logging and improve error handling

- Removed excessive debug logging from various middleware components, including `AbortHandlerMiddleware`, `FinalChunkConsumerMiddleware`, and `McpToolChunkMiddleware`, to enhance readability and performance.
- Updated logging levels to use warnings for potential issues in `ResponseTransformMiddleware`, `TextChunkMiddleware`, and `ThinkChunkMiddleware`, ensuring better visibility of important messages.
- Cleaned up commented-out code and unnecessary debug statements across multiple middleware files for improved maintainability.

---------

Co-authored-by: suyao <sy20010504@gmail.com>
Co-authored-by: eeee0717 <chentao020717Work@outlook.com>
Co-authored-by: lizhixuan <zhixuan.li@banosuperapp.com>
2025-06-12 16:01:19 +08:00
kangfenmao
6ad9044cd1 refactor: replace 302ai PNG with WEBP format and update provider configurations
- Deleted the old PNG logo for 302ai and added a new WEBP version.
- Updated the provider configuration to use the new WEBP logo.
- Added translations for the new Cephalon provider in Japanese and Russian.
- Disabled the 302ai and Cephalon providers in the initial state of the store.
- Adjusted migration logic to accommodate the new provider setup.
2025-06-12 12:16:43 +08:00
JI4JUN
9e9a1ec024 feat: support 302ai provider (#7044)
* feat(porvider): add provider 302ai

* style(provider): change provider name 302AI to 302.AI

* style(provider): system models replacement of 302.AI provider

---------

Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-06-12 12:04:21 +08:00
HzTTT
a214dca6fa feat:add cephalon provider (#7050)
* feat: add Cephalon provider and related assets

* add Cephalon logo image
* update models to include Cephalon's DeepSeek-R1
* add Cephalon provider configuration and API details
* include Cephalon translations in multiple languages
* update store to initialize Cephalon as a provider
* increment version for migration

* feat: update Cephalon provider configuration and assets

* add Cephalon logo image
* enable Cephalon provider in the store
* remove previous disabled configuration for Cephalon

* fix: update Cephalon provider model URL

* fix: update official website URL for Cephalon provider
2025-06-12 12:02:03 +08:00
one
b142e5647e fix(Markdown): inline math overflow (#7095) 2025-06-12 11:05:52 +08:00
kangfenmao
a33a8da5c1 chore(version): 1.4.2 2025-06-12 09:36:27 +08:00
eeee0717
f21771266e Merge branch 'main' into feat-knowlege-ocr 2025-06-12 09:27:04 +08:00
kangfenmao
e029159067 Revert "fix: qwen3 cannot name a topic (#6722)"
This reverts commit 389f750d7b.
2025-06-11 20:31:24 +08:00
eeee0717
9310166307 fix 2025-06-11 19:10:47 +08:00
eeee0717
dd3d25762b Merge branch 'main' into feat-knowlege-ocr 2025-06-11 19:01:10 +08:00
fullex
8582ad2529 fix(SelectionAssistant): shortcut in mac and running handling (#7084)
fix(SelectionService): enhance selection and clipboard handling

- Updated processSelectTextByShortcut to include a check for the 'started' state before processing.
- Modified writeToClipboard to ensure it only attempts to write if the selectionHook is available and 'started'.
- Adjusted ShortcutSettings to filter out additional shortcuts when not on Windows, improving platform compatibility.
2025-06-11 18:30:48 +08:00
fullex
e7f1127aee feat(SelectionAssistant): add shortcut for selecting text (#7073)
* feat(SelectionAssistant): add shortcut for selecting text and update trigger modes

- Introduced a new trigger mode 'Shortcut' in SelectionService to handle text selection via shortcuts.
- Implemented processSelectTextByShortcut method to process selected text when the shortcut is activated.
- Updated ShortcutService to register the new selection_assistant_select_text shortcut.
- Enhanced localization for the new shortcut and updated descriptions for trigger modes in multiple languages.
- Adjusted SelectionAssistantSettings to include tooltip information for the new shortcut option.

* fix: should destroy window when disable
2025-06-11 17:39:12 +08:00
Guscccc
7e54c465b1 feat: add plain text copy functionality for messages and topics. 添加了复制纯文本的功能(去除Markdown格式符号) (#5965)
* feat: add plain text copy functionality for messages and topics.

* refactor: move minapp settings to minapp page

* fix: add success message after copying topic and message as text

* fix: refactor test imports and add mocks for translation and window.message

---------

Co-authored-by: Guscccc <Augustus.Li@outlook.com>
Co-authored-by: kangfenmao <kangfenmao@qq.com>
Co-authored-by: 自由的世界人 <3196812536@qq.com>
2025-06-11 17:23:35 +08:00
自由的世界人
5c76d398c5 fix: readme twitter link error (#7075) 2025-06-11 15:30:25 +08:00
fullex
f6a935f14f feat(SelectionAssistant): shortcut key to toggle on/off (#6983)
* feat: add toggle selection assistant functionality and corresponding shortcuts

- Implemented toggleEnabled method in SelectionService to manage the selection assistant state.
- Registered new shortcut for toggling the selection assistant in ShortcutService.
- Updated StoreSyncService to sync the selection assistant state across renderer windows.
- Added localization for the toggle selection assistant feature in multiple languages.
- Adjusted ShortcutSettings to conditionally display the toggle selection assistant shortcut based on the platform.
- Included toggle selection assistant in the initial state of shortcuts in the store.

* fix: shortcut key

* fix: accelerator name
2025-06-11 13:32:49 +08:00
fullex
26d018b1b7 fix(SelectionAssistant): improve auto-scroll behavior in action window (#6999)
fix(SelectionActionApp): improve auto-scroll behavior and manage scroll height tracking
2025-06-11 13:03:52 +08:00
Wang Jiyuan
cd8c5115df Feat: Allows setting the vector dimension of the knowledge base embedding model (#7025) 2025-06-11 11:52:15 +08:00
beyondkmp
0020e9f3c9 feat(i18n): add tooltips for model name in multiple languages (#7064)
Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
2025-06-11 11:44:04 +08:00
fullex
8df4cd7e76 fix(SelectionAssistant): reduce Copy conflict (#7060)
fix: reduce Copy conflict
2025-06-10 23:56:38 +08:00
Wang Jiyuan
ee7e6c0f87 fix: bubble overflow patch (#7055)
* fix: bubble overflow

* fix: bubble content doesn't fill context width
2025-06-10 21:42:18 +08:00
Wang Jiyuan
e65091f83c feat: add citation index to show (#7052) 2025-06-10 19:42:30 +08:00
Wang Jiyuan
3ee8186f96 Fix: bubble-style unnecessary menu background (Plan D) (#7026)
* fix: bubble-style  unnecessary menu background

* fix: show divider in message only in plain mode

* fix: bubble user message style in dark mode

* fix: action button hover style

* refactor: The rendering position of the message menbar is determined by the settings

* fix: bubble style assistant message token usage left align

* fix: bubble style

* fix: bubble style

* fix: text color and bubble edit

* fix: bubble editing

* fix: bubble editing

* fix: bubble editor

* fix: editor width

* fix: remove redundant tokens usage

* fix: not unified token font size and color

* fix: unexpected display behavior in plain mode

* fix: info style

* fix: bubble style

* fix: Style fixes for better compatibility

* fix: bubble style

* fix: Move the menu of the last message to the outside

* fix: bubble style

* fix: why this happened?

* feat: add description for messages divider in settings

* fix: 谁想出来的上下margin不一样还是神秘数字

* fix: new context style
2025-06-10 18:13:11 +08:00
FischLu
49f1b62848 翻译功能增加手动选择源语言的选项 (#6916)
* feat(TranslatePage): add user-selectable source language with auto-detection

* fix: update detected language label for consistency across translations

---------

Co-authored-by: Pleasurecruise <3196812536@qq.com>
2025-06-10 16:25:22 +08:00
Wang Jiyuan
90a84bb55a fix: shouldn't edit embedding dimension on existing knowledge base (#7022)
* fix: shouldn't edit embedding dimension on existing knowledge base

* remove dim settings
2025-06-10 15:34:27 +08:00
neko engineer
d2147aed3b fix: fix waring in usetags (#7039)
fix: 修复usetags中的警告

Co-authored-by: linshuhao <nmnm1996>
2025-06-10 15:07:29 +08:00
fullex
4f28086a64 feat(SelectionAssistant): support thinking block in action window (#6998)
feat(ActionUtils): enhance message processing to include thinking block handling
2025-06-09 20:08:17 +08:00
one
d9c20c8815 refactor: use CodeEditor for customizing css (#6877)
* refactor: use CodeEditor for customizing css

* fix: editor height
2025-06-09 19:56:57 +08:00
beyondkmp
b951d89c6a feat: enhance unresponsive renderer handling and crash reporting (#6995)
* feat: enhance unresponsive renderer handling and crash reporting

* Added support for collecting JavaScript call stacks from unresponsive renderers.
* Updated the Document Policy in the HTML to include JS call stacks in crash reports.
* Removed legacy unresponsive logging from WindowService.

* feat: improve unresponsive renderer handling and update crash reporting

* Added session web request handling to include Document-Policy for JS call stacks in crash reports.
* Removed legacy Document-Policy meta tag from HTML.
* Enhanced logging for unresponsive renderer call stacks.

* fix: remove unused session import in index.ts

---------

Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
2025-06-09 19:50:05 +08:00
Suzu
ac7d4cb4fa fix: check if embedding is base64 encoded before convert it to float … (#7014)
fix: check if embedding is base64 encoded before convert it to float array
2025-06-09 19:46:17 +08:00
自由的世界人
d2ea0592ce fix: add Youdao and Nomic logos to model logo mapping (#7017) 2025-06-09 19:44:49 +08:00
Wang Jiyuan
66ddeb94bf fix: ollama embedding knowledge query score always 100% (#7001)
* fix: ollama embedding knowledge query score always 100%

* fix: force ollama to use api without v1
2025-06-09 16:52:01 +08:00
Wang Jiyuan
e13b136484 feat: add prompt variables description (#6991)
* feat: add prompt variables description

* fix: remove comment
2025-06-09 10:41:26 +08:00
自由的世界人
9c5fa57936 fix: update README files to enhance navigation and add project badges (#6982)
* fix: update README files to enhance navigation and add project badges

* fix: english version

* fix: sponsor link error
2025-06-08 21:47:22 +08:00
kangfenmao
7e201522d0 fix: remove topic or message did not delte releated files
This reverts commit df35f25502.
2025-06-08 13:23:48 +08:00
自由的世界人
df35f25502 fix: streamline file selection and ensure deletion of topic-related f… (#6872)
* fix: streamline file selection and ensure deletion of topic-related files

* fix: improve file deletion logic
2025-06-08 12:42:53 +08:00
George·Dong
f9e557763e fix(migrate): old translateModel incorrect (#6965)
* fix(migrate): old translateModel incorrect

* fix(migrate): old translateModel incorrect

* feat(models): improve default model init

* fix(migrate): update translateModel check

* fix(migrate): update translateModel check
2025-06-08 12:38:50 +08:00
beyondkmp
eafd814caf fix(BackupManager): add content length to WebDAV file upload options (#6977)
feat(BackupManager): add content length to WebDAV file upload options
2025-06-08 12:36:20 +08:00
kangfenmao
b84f7bf596 fix: prevent textarea from focusing when in fullscreen mode 2025-06-08 11:37:38 +08:00
kangfenmao
c1d753b7fe refactor: update input tools configuration to hide unused tools and set initial collapsed state 2025-06-08 11:30:50 +08:00
kangfenmao
3350f58422 fix: cannot remove assistat tag 2025-06-08 11:11:52 +08:00
自由的世界人
8c617872e0 fix: Implement label folding, drag-and-drop sorting of assistants within labels, and drag-and-drop sorting of labels (#6735)
* fix: add collapsible tags in AssistantsTab for better organization

* fix: implement drag-and-drop functionality for reordering assistants in tags

* fix: implement drag-and-drop functionality for reordering tags in AssistantTagsPopup

* fix: eslint error
2025-06-08 11:03:39 +08:00
purefkh
a333c635cb fix: prevent emoji picker from closing unexpectedly with IME 2025-06-08 10:55:54 +08:00
Caelan
a244057b3a feat: dmxapi images to image (#6935)
新增改图,合并图
2025-06-08 10:54:46 +08:00
tommyzhang100504
79d7ffcbad build: 增加自动更新文档中版本号的github workflow (#6971)
更新程序
2025-06-08 10:49:56 +08:00
Wang Jiyuan
2d985c1f91 refactor: better semantic of obsidian export options (#6926) 2025-06-08 00:02:15 +08:00
fullex
5879ccbeb2 fix: update default translate model to deepseek-v3 (#6960)
fix: update translate model to new default in llm state and migration logic
2025-06-07 21:44:28 +08:00
Wang Jiyuan
7887f4867d fix: voyage ai can't be used on text embedding (#6950) 2025-06-07 21:40:14 +08:00
Doekin
c38a6cdfbf feat(restoreFromWebdav): make credentials and path optional (#6922)
* feat(BackupService): add feedback messages for backup operations

* feat(WebDAV): Allow optional username, password, and path for unauthenticated access
2025-06-07 21:25:08 +08:00
Wang Jiyuan
ea7766db44 fix: update silicon docs and models (#6953) 2025-06-07 17:29:07 +08:00
fullex
a5012ce49e fix: set message translate dropdown height (#6954)
fix: improve dropdown menu styling and placement in MessageMenubar component

- Set a maximum height and overflow behavior for the dropdown menu to enhance usability.
- Changed the dropdown placement from "topRight" to "top" for better alignment with the UI.
2025-06-07 17:17:02 +08:00
Wang Jiyuan
d3da4f4623 fix: couldn't edit text when sent file-only message (#6930) 2025-06-07 00:19:21 +08:00
purefkh
7f12c2f8b8 fix: set thinking budget to 0 for gemini-2.5-flash when reasoning effort is off (#6917) 2025-06-06 22:11:18 +08:00
Wang Jiyuan
9ba2dea148 fix: message editor doesn't resize (#6924)
* fix: message editor doesn't resize

* fix: remove console log

* fix: optimize useEffect dependencies and improve textarea resizing logic

---------

Co-authored-by: Pleasurecruise <3196812536@qq.com>
2025-06-06 22:02:48 +08:00
Doekin
653bfa1f17 refactor: unified image viewer with integrated context menu (#6892)
* fix(Markdown): eliminate hydration error from image `<div>` nested in `<p>`

Signed-off-by: Chan Lee <Leetimemp@gmail.com>

* feat: add support for reading local files in binary format

Signed-off-by: Chan Lee <Leetimemp@gmail.com>

* refactor(ImageViewer): Consolidate image rendering for unified display and context menu

Signed-off-by: Chan Lee <Leetimemp@gmail.com>

---------

Signed-off-by: Chan Lee <Leetimemp@gmail.com>
2025-06-06 18:52:45 +08:00
one
fa00b5b173 feat(SelectionAssistant): add the "quote" action (#6868)
* feat(SelectionAssistant): add the "quote" action

* fix: i18n for "高级"

* refactor: move quote-to-main to WindowService

* refactor: move formatQuotedText to renderer
2025-06-06 18:12:38 +08:00
fullex
70fb6393b6 fix(SelectionAssistant): add explorer.exe to filterlist 2025-06-06 17:32:16 +08:00
kangfenmao
5b379666f4 refactor: move minapp settings to minapp page 2025-06-06 17:30:16 +08:00
kangfenmao
3cb34d30a9 refactor: remove isPreset messages and assistant.messages 2025-06-06 15:54:32 +08:00
beyondkmp
d47c93b4d8 feat: add set feed url functionality for early access (#5723)
* feat: add update channel functionality for beta testing

- Introduced a new IPC channel for setting the update channel.
- Implemented logic in AppUpdater to handle update channel changes.
- Updated settings to include a beta testing toggle, allowing users to switch between stable and beta update channels.
- Enhanced the settings UI to reflect the new beta testing option.

* add i18n

* update i18n

* update i18n

* refactor: rename update channel to feed URL and update related functionality

- Changed IPC channel from App_SetUpdateChannel to App_SetFeedUrl.
- Updated AppUpdater to set feed URL instead of update channel.
- Modified preload and settings to reflect the new feed URL functionality.
- Added constants for production and early access feed URLs.

* refactor: remove setAutoUpdate method from API

- Eliminated the setAutoUpdate method from the API object in preload index, streamlining the IPC communication interface.

* refactor: update early access feed URL and improve tooltip descriptions

- Changed EARLY_ACCESS_FEED_URL to point to the latest GitHub release.
- Simplified the setEarlyAccess function to directly set the feed URL.
- Added tooltips for early access settings in multiple languages to inform users about potential instability and the need for data backup.

* feat(migrate): add early access setting to state configuration

- Introduced a new state setting 'earlyAccess' and initialized it to false in the migration configuration.

* fix(i18n): update early access tooltip translations for clarity

- Revised the tooltip descriptions for the early access feature in English, Simplified Chinese, and Traditional Chinese to enhance clarity and ensure consistency in messaging regarding potential instability and the importance of data backup.

* feat: introduce FeedUrl enum for centralized feed URL management

- Added a new enum `FeedUrl` in the constants file to define production and early access feed URLs.
- Updated relevant IPC handlers and services to utilize the `FeedUrl` enum for type safety and consistency.
- Refactored the configuration manager to include methods for getting and setting the feed URL using the new enum.

* feat(settings): initialize early access and auto-update settings in AboutSettings component

- Added initialization for early access and auto-check update settings in the AboutSettings component to enhance user configuration options.

---------

Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
2025-06-06 15:48:54 +08:00
SuYao
bc5cc4bf02 hotfix: enhance OpenAI stream handling and error management (#6541)
fix: enhance OpenAI stream handling and error management

- Updated the `openAIChunkToTextDelta` function to include error handling with a try-catch block, improving robustness during stream processing.
- Refined the `readableStreamAsyncIterable` function to ensure proper handling of stream completion and errors, including a return method for cleanup.
- Adjusted type definitions for better clarity and consistency in the handling of async iterables.
2025-06-06 15:18:16 +08:00
SuYao
8efa7d25f8 fix(Inputbar): remove unnecessary flex properties from Inputbar styles (#6902) 2025-06-06 15:16:12 +08:00
fullex
59195fec1a fix(SelectionAssistant): default disabled (#6897)
fix: selection default off
2025-06-06 14:19:55 +08:00
one
14e6a80049 fix(SelectionToolbar): prevent dragging the demo (#6888) 2025-06-06 12:34:02 +08:00
eeee0717
d9d9d435b1 chore: set version 1.5.0-rc.1 2025-06-06 09:32:34 +08:00
one
67ab36e0ea refactor(SelectionToolbar): add transition effects to action buttons (#6869)
* refactor(SelectionToolbar): add transition effects to action buttons

* refactor: reduce transition duration
2025-06-06 09:24:11 +08:00
fullex
dfc32967ed fix(SelectionAssistant): support selection when alt key pressed (#6865)
fix: support alt key selection
2025-06-06 08:29:00 +08:00
rainnoon
aa3c376def fix(Inputbar): fix textarea expansion and collapse issues with long text (CherryHQ#6857) (#6873)
fix(Inputbar): fix textarea expansion and collapse issues with long text (#6857)
2025-06-06 04:05:17 +08:00
自由的世界人
61c58caf78 hotfix: gemini-2.5-pro-preview-06-05 using error (#6870) 2025-06-06 03:42:52 +08:00
one
b402cdf7ff perf: improve responsiveness on streaming formulas (#6659)
* perf: improve performance on streaming formulas

* refactor: create throttlers for blocks

* refactor: use LRU cache for better memory management
2025-06-06 03:07:59 +08:00
one
d80513d011 refactor(CodePreview): improve the triggering timing for highlighting (#6866) 2025-06-06 00:41:03 +08:00
Doekin
4bcfbf785f feat: enable rendering and download of inline base64-encoded images (#6669)
This commit introduces support for displaying and downloading
inline base64-encoded images (specifically PNG and JPEG formats)
within Markdown content.

Key changes:
- Modified 'urlTransform' in the Markdown component to allow 'data:image/png'
  and 'data:image/jpeg' URLs, enabling their rendering.
- Updated the 'download' utility to handle 'data:' URLs,
  allowing users to save these inline images.

Signed-off-by: Chan Lee <Leetimemp@gmail.com>
2025-06-06 00:29:47 +08:00
SuYao
b722dab56b fix(OpenAIProvider): ensure tool_calls are only yielded when present (#6861)
This update modifies the OpenAIProvider to yield tool_calls only if they exist and have a length greater than zero, improving the handling of delta content. Additionally, a minor cleanup was performed by removing an unnecessary blank line in the code.
2025-06-05 22:49:29 +08:00
eeee0717
40809d4f2f chore 2025-06-05 20:44:08 +08:00
eeee0717
449a62ba7a Merge branch 'main' into feat-knowlege-ocr 2025-06-05 20:43:23 +08:00
eeee0717
a351fba483 feat: add preprocess icon 2025-06-05 20:32:47 +08:00
fullex
6165e4a47f fix(SelectionToolbar): prevent CSS updates in demo mode 2025-06-05 19:50:49 +08:00
eeee0717
4570e21965 feat: hide built in key 2025-06-05 19:38:15 +08:00
fullex
b829abed2d fix(SelectionAssistant): ignore CtrlKey mode when ctrl+click (#6843)
fix(SelectionService): add mouse-down listener for multi-selection in ctrlkey mode
2025-06-05 19:05:17 +08:00
kangfenmao
36f56ba9aa chore(version): 1.4.1 2025-06-05 16:30:09 +08:00
Pleasurecruise
022b11cf6c fix: Improve the switching logic in multi-tab state 2025-06-05 16:26:34 +08:00
LiuVaayne
8d6662cb48 chore: remove unused Delete tokenflux_painting_page.md (#6840)
Delete tokenflux_painting_page.md
2025-06-05 16:23:00 +08:00
kangfenmao
a59a45f109 fix(AssistantsTab): remove untagged group title
This commit updates the AssistantsTab component to only display group titles for tagged assistants, excluding the 'untagged' category. This change enhances the UI by reducing clutter and improving clarity in the display of assistant groups.
2025-06-05 16:18:54 +08:00
SuYao
6337561f65 chore: update OpenAI package to version 5.1.0 and adjust related patches (#6838)
* chore: update OpenAI package to version 5.1.0 and adjust related patches

- Updated OpenAI dependency from version 4.96.0 to 5.1.0 in package.json and yarn.lock.
- Removed obsolete patch for OpenAI 4.96.0 and added new patch for OpenAI 5.1.0.
- Adjusted types for image handling in OpenAIResponseProvider to use Uploadable instead of FileLike.
- Minor code refactoring for better clarity and maintainability.

* refactor(OpenAIResponseProvider): remove logging for image generation process
2025-06-05 16:10:40 +08:00
kangfenmao
fbbc94028d refactor(i18n): reorganize Notion settings localization strings in ja-jp.json
This commit restructures the localization strings for Notion settings in the Japanese language file, moving them from a nested structure to a more accessible format. This change improves clarity and maintainability of the localization data.
2025-06-05 15:59:24 +08:00
kangfenmao
93d955c4b9 feat: optimize UI interface display 2025-06-05 15:51:03 +08:00
LiuVaayne
1c71e6d474 support tokenflux image generation for [Flux.1 Kontext] (#6705)
* Add support for TokenFlux image generation service

This commit integrates TokenFlux as a new painting provider with dynamic
form generation based on model schemas, real-time generation polling,
and full painting history management.

Key features:
- Dynamic form rendering from JSON schema input parameters
- Model selection with pricing display
- Real-time generation status polling
- Integration with existing painting workflow and file management
- Provider-specific painting state management

The implementation follows existing patterns from other painting pages
while adding TokenFlux-specific functionality like schema-based form
generation and asynchronous polling for generation results.

* Add image upload support and comparison view to TokenFlux

Implements file upload handling for image parameters with base64
conversion, random seed generation, and side-by-side comparison
layout when input images are present.

* Refactor TokenFlux to use service class and components

Extract form rendering logic to DynamicFormRender component and API
logic to TokenFluxService class. Simplifies the main component by
removing duplicate code for model fetching, image generation polling,
and form field rendering.

* Refactor TokenFlux to fix state management and polling

- Change painting field from modelId to model for consistency
- Fix updatePaintingState to use functional state updates
- Add automatic polling for in-progress generations on mount
- Group models by provider in the selection dropdown
- Separate prompt from other input params in form data handling
- Improve error handling in the paintings store

* Auto-select first model when models are loaded

* Add image generation UI localization strings

Add translation keys for model selection, input parameters, image
labels, pricing display, and form validation across all supported
locales (en-us, ja-jp, ru-ru, zh-cn, zh-tw). Update TokenFluxPage
component to use localized strings instead of hardcoded English text.

* fix: Add a right border to the first child of the ImageComparisonSection

* style: Remove padding from UploadedImageContainer in TokenFluxPage

* feat: Implement caching for TokenFlux model fetching and update image upload handling

* feat: Enhance localization support by adding language context handling in TokenFluxPage

* refactor: Simplify layout structure in TokenFluxPage by removing unnecessary SectionGroup components and improving section title styling

---------

Co-authored-by: kangfenmao <kangfenmao@qq.com>
2025-06-05 15:47:51 +08:00
eeee0717
28da94c362 Merge branch 'main' into feat-knowlege-ocr 2025-06-05 15:40:54 +08:00
Murphy
b2d10b7a6b fix: add blank lines between reasoning summary parts (#6827)
Co-authored-by: Chen Tao <70054568+eeee0717@users.noreply.github.com>
2025-06-05 15:39:56 +08:00
eeee0717
85043f1faf feat: improve ui and notification 2025-06-05 15:38:01 +08:00
George·Dong
1215bcb046 refactor: enhance export functions (#5854)
* feat(markdown-export): add option to show model name in export

* refactor(export): Refactor the Obsidian export modal to Ant Design style

* refactor(obsidian-export): export to obsidian using markdown interface & support COT

* feat(markdown-export): optimize COT export style, support export model & provider name

Add a new setting to toggle displaying the model provider alongside the
model name in markdown exports. Update the export logic to include the
provider name when enabled, improving context and clarity of exported
messages. Also fix invalid filename character removal regex for Mac.

* feat(export): add option to export reasoning in Joplin notes

Introduce a new setting to toggle exporting reasoning details when
exporting topics or messages to Joplin. Update the export function to
handle raw messages and convert them to markdown with or without
reasoning based on the setting. This improves the export feature by
allowing users to include more detailed context in their Joplin notes.

* feat(export): update i18n for new export options

* fix(settings): remove duplicate showModelNameInMarkdown state

* feat(export): add CoT export for notion & optmize notion export

* feat(export): update Notion settings i18n

* fix(utils): correct citation markdown formatting

Swap citation title and URL positions in markdown links to ensure
the link text displays the title (or URL if title is missing) and
the link points to the correct URL. This improves citation clarity.
2025-06-05 14:41:53 +08:00
fullex
9195a0324e fix(SelectionAssistant): ignore ctrl pressing when user is zooming in/out (#6822)
* fix(SelectionService): ignore ctrl pressing when user is zomming in/out

* chore: rename function

* fix: reset listener status
2025-06-05 14:28:50 +08:00
熊可狸
acbec213e8 hotfix: ensure show token usage setting defaults to true (#6828)
Hotfix: ensure show token usage setting defaults to true
2025-06-05 14:02:09 +08:00
熊可狸
e2a08e31e8 feat(Settings): Add token count display toggle (#6772)
* feat(Settings): add token count toggle

* fix(i18n): update token usage messages for zh-cn and zh-tw locales

* fix(InstallNpxUv): optimize checkBinaries function with useCallback for better performance

---------

Co-authored-by: Pleasurecruise <3196812536@qq.com>
2025-06-05 12:46:20 +08:00
SuYao
e479ee3dbc feat(constants): expand supported file extensions and categorize text… (#6815)
* feat(constants): expand supported file extensions and categorize text file types

* refactor(constants): remove binary file extensions

* refactor(constants): remove Xcode project
2025-06-05 12:32:28 +08:00
Wang Jiyuan
f6462ef998 fix: OpenAI provider api check doesn't handle error (#6769) 2025-06-05 12:09:37 +08:00
eeee0717
d17ba3a835 chore: i18n 2025-06-05 11:17:24 +08:00
Murphy
dcdf49a5ce fix: sync active topic after rename (#6804)
Co-authored-by: Chen Tao <70054568+eeee0717@users.noreply.github.com>
2025-06-05 09:44:11 +08:00
SuYao
74f72fa5b6 fix(AnthropicProvider): update usage and metrics handling to prevent TypeError (#6813) 2025-06-05 09:33:40 +08:00
one
36f33fed75 fix: use monospace font for theme colorpicker (#6816) 2025-06-05 09:33:26 +08:00
Chen Tao
3b5617a0e2 Merge branch 'main' into feat-knowlege-ocr 2025-06-05 09:28:52 +08:00
fullex
eb7c05fd4c fix(SelectionAssistant): JetBrains IDEs, Remote desktop, Gaming, PDF views, etc (#6809)
fix: jetbrains ides, remote desktop, pdf views, etcs
2025-06-04 23:56:05 +08:00
SuYao
cb746fd722 hotfix: gemini auto thinking (#6810) 2025-06-04 23:25:42 +08:00
one
0449bc359a fix(MermaidPreview): debounce mermaid rendering to alleviate flickering (#6675) 2025-06-04 23:09:47 +08:00
Chen Tao
dcc5e7eb4b Merge branch 'main' into feat-knowlege-ocr 2025-06-04 20:54:28 +08:00
eeee0717
4b7e38425f chore: add i18n 2025-06-04 20:50:34 +08:00
eeee0717
62cfccc035 feat: split ocr and preprocess 2025-06-04 20:45:57 +08:00
one
d3e51ffb1c fix: codeblock overflow in bubble style (#6773)
* refactor: revert CodeBlockView style change

* fix: codeblock width and overflow

* refactor: improve CodeEditor border

* revert: context-menu-container width for message group
2025-06-04 19:56:31 +08:00
fullex
77eb70626c feat(SelectionAssistant): fullscreen game/presentation mode 2025-06-04 19:09:35 +08:00
fullex
345c4f096e fix: transparent window flashing when show (#6755)
* fix: avoid SelectionAssistant toolbar flashing

* add comments
2025-06-04 19:07:07 +08:00
Zhaker
a4aab3fd4e fix: correct variable name obsidianVault in Obsidian export (#6796) 2025-06-04 18:28:59 +08:00
eeee0717
88204878b0 Merge branch 'main' into feat-knowlege-ocr 2025-06-04 18:00:17 +08:00
自由的世界人
ecf770e183 fix: optimize multilingual display of documents (#6793)
Update Sidebar.tsx
2025-06-04 17:57:25 +08:00
eeee0717
d1f1703d4e chore 2025-06-04 17:53:23 +08:00
eeee0717
8de8e6e5a1 chore: add i18n 2025-06-04 17:46:27 +08:00
Lucas
d58911ac60 fix(ci): Update the nightly-build workflow (#6791)
Update the branch name from `develop` to `main`
2025-06-04 17:37:13 +08:00
one
bb0a35b920 fix: chat navigation triggering (#6774)
* fix: exclude MessageEditor

* fix: more accurate triggering area
2025-06-04 17:34:51 +08:00
fullex
403649f2ea feat(SelectionAssistant): Smart Translation ( aka BiDirectionTranslate) (#6715)
* feat(Translation): enhance translation functionality and UI improvements

- Added secondary text color variables in color.scss for better UI contrast.
- Updated translation configuration to include language codes for better language handling.
- Enhanced translation UI with new language selection options and improved loading indicators.
- Implemented smart translation tips in multiple language JSON files for user guidance.
- Refactored translation logic to streamline message processing and error handling.

* feat(Translation): expand language options and update localization files

- Added new languages (Polish, Turkish, Thai, Vietnamese, Indonesian, Urdu, Malay) to translation options in translate.ts.
- Updated localization JSON files (en-us, ja-jp, ru-ru, zh-cn, zh-tw) to include translations for the new languages.
- Enhanced language detection logic in translate.ts to support new language codes.
2025-06-04 17:11:53 +08:00
fullex
958f8387d0 fix(SelectionAssistant): customCSS should not override background (#6746)
fix: customCSS should not override background
2025-06-04 17:11:31 +08:00
eeee0717
3b3453c963 chore 2025-06-04 14:33:27 +08:00
eeee0717
fa7d7deda6 feat: remove upload file 2025-06-04 14:30:03 +08:00
eeee0717
9418701ccd fix: preprocess cannot remove 2025-06-04 13:29:53 +08:00
beyondkmp
9c89676030 refactor(BackupManager, WebDav): streamline WebDAV client initialization and enhance directory listing functionality (#6784)
Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
2025-06-04 12:51:21 +08:00
one
34ec018840 fix: prevent message overflow when minimized width (#6775) 2025-06-04 11:50:56 +08:00
one
1be103a249 chore(gitignore): exclude cursor settings (#6779) 2025-06-04 11:48:58 +08:00
eeee0717
cdb32ce992 chore: remove unnecessary page 2025-06-04 10:26:47 +08:00
Wang Jiyuan
f83f8bb789 Fix: outdated provider websites and models (#6766)
* fix: inappropriate provider websites (openrouter, grok)

* fix: outdated model list (grok)
2025-06-04 00:00:33 +08:00
suyao
1257c49d96 refactor: simplify ToolSettings component layout
- Removed the SettingContainer wrapper for improved readability.
- Cleaned up imports and streamlined the rendering logic for WebSearchSettings and PreprocessSettings.
2025-06-03 22:51:00 +08:00
eeee0717
1c9bba353b feat: change add knowledge ui 2025-06-03 21:50:34 +08:00
eeee0717
777eb48e6e rename ocr to preprocess 2025-06-03 21:29:08 +08:00
eeee0717
d767057c50 fix: fix doc2x extract zip error 2025-06-03 19:48:00 +08:00
suyao
642c2404fb refactor: remove unused file components and clean up imports
- Deleted GeminiFiles, MistralFiles, and RemoteFileList components to streamline the codebase.
- Cleaned up imports in AppUpdater.ts for improved organization and clarity.
- Updated Message.tsx to remove redundant import, enhancing code maintainability.
2025-06-03 18:27:36 +08:00
suyao
6a26a5619a refactor: remove unused imports in GeminiProvider for cleaner code
- Eliminated unnecessary imports such as FileState, Pager, and CacheService from GeminiProvider.ts to enhance code clarity and maintainability.
2025-06-03 18:21:53 +08:00
suyao
af37568ec4 refactor: update type definitions for file handling in FileStorage and FilesPage components
- Changed return type from FileType to FileMetadata in saveBase64Image method of FileStorage class for consistency.
- Updated import in FilesPage component to reflect the new FileMetadata type, enhancing clarity in file handling.
2025-06-03 18:17:14 +08:00
suyao
58253a210d chore: clean up yarn.lock by removing unused package entries
- Removed obsolete entries for 'caseless' and 'path-type' packages from yarn.lock to streamline dependencies and reduce clutter.
2025-06-03 18:15:07 +08:00
suyao
01d2518bf1 Merge branch 'main' into feat/ocr 2025-06-03 18:08:09 +08:00
suyao
d7df076672 refactor: add OCR provider selection to KnowledgeSettings component
- Introduced a new settings item for selecting OCR providers in the KnowledgeSettings component.
- Removed the previous implementation of the OCR provider selection to streamline the UI.
- Updated the state management for the selected OCR provider to enhance user experience.
2025-06-03 17:52:54 +08:00
suyao
791bd37adf refactor: streamline OCR processing in MacSysOcrProvider and update type definitions in MineruOcrProvider
- Removed batch processing in MacSysOcrProvider for direct page handling, improving efficiency.
- Updated type definitions from FileType to FileMetadata in MineruOcrProvider for consistency across the codebase.
2025-06-03 17:48:22 +08:00
suyao
de58296136 Merge branch 'feat-knowlege-ocr' of https://github.com/eeee0717/cherry-studio into feat/ocr 2025-06-03 14:58:21 +08:00
eeee0717
6cc0ec20a7 chore: add rc version 2025-06-03 14:41:10 +08:00
eeee0717
8269ede05b chore: add i18n 2025-06-03 14:32:49 +08:00
beyondkmp
cc2810b117 feat(AppUpdater): implement localized update dialog (#6742)
feat(AppUpdater): implement localized update dialog with new translations for multiple languages

Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
2025-06-03 12:34:12 +08:00
SuYao
be1dae7ef0 hotfix: update qwen3 model identification logic to use startsWith for im… (#6738)
fix: update qwen3 model identification logic to use startsWith for improved accuracy
2025-06-03 10:50:31 +08:00
SuYao
446d26d8dc hotfix(OpenAIProvider): remove redundant 'unkown' chunk (#6737)
fix(OpenAIProvider): remove redundant 'unknown' yield case in chunk processing
2025-06-03 10:48:11 +08:00
May
7724b49ec4 fix: mcp uv&bun installation status icon in nav bar not updated after… (#6654)
fix: mcp uv&bun installation status icon in nav bar not updated after installed

Signed-off-by: aprilandjan <merlin.ye@qq.com>
2025-06-02 23:29:23 +08:00
Zhaker
ecbd283779 fix: assistant emoji displaying incorrectly in specific situations #6243 (#6280)
* fix:  ssistant emoji displaying incorrectly in specific situations

* chore: remove unuse import

* fix: ensure default emoji

* fix: remove redundant min-width in AssistantItem and EmojiIcon components; enhance emoji click handling

---------

Co-authored-by: 自由的世界人 <3196812536@qq.com>
2025-06-02 23:25:54 +08:00
Wang Jiyuan
389f750d7b fix: qwen3 cannot name a topic (#6722)
* fix: qwen3 cannot name a topic

* feat: Display error message when topic naming fails
2025-06-02 23:18:41 +08:00
Wang Jiyuan
23eaae80c8 fix: token usage not updated after editing message (#6725)
fix: update token usage when edit message
2025-06-02 23:17:40 +08:00
one
8f8c2f852e test: more unit tests for message rendering (#6663)
* refactor(encodeHTML): remove duplicate definition

* test(Scrollbar): update snapshot

* test: add more tests

Add tests for
- MainTextBlock
- ThinkingBlock
- Markdown
- CitationTooltip
2025-06-02 17:36:25 +08:00
George Zhao
13f7269e36 fix: adjust sidebar icon margins based on fullscreen state 2025-06-02 17:36:04 +08:00
fullex
0cd62a07fb feat(SelectionService): enhance trigger mode handling and update predefined blacklist 2025-06-02 17:34:41 +08:00
icarus
20b55693cb fix: provider o3 docs not found 2025-06-02 17:34:05 +08:00
Pleasurecruise
74cccf2c09 fix: replace franc with franc-min for improved performance 2025-06-02 17:31:49 +08:00
Doekin
54d20aa99b fix(OpenAIProvider): prevent atob error with non-base64 image URLs (#6673)
Signed-off-by: Chan Lee <Leetimemp@gmail.com>
2025-06-02 13:29:42 +08:00
one
2c8086f078 refactor: sort mentioned models in QuickPanel (#6666) 2025-06-01 20:04:20 +08:00
kangfenmao
ea061a3ba6 chore(version): 1.4.0 2025-06-01 16:59:50 +08:00
fullex
28a6ba1b5d feat(SelectionAssistant): predefined apps filter list (#6662)
* feat: predefined app blacklist

* fix

* fix

* fix

* fix: improve filter list processing in SelectionFilterListModal
2025-05-31 21:51:58 +08:00
one
8b793a9ca9 fix: thinking time reset (#6665)
* fix: thinking time reset

* fix: update theme listener to properly handle theme updates

---------

Co-authored-by: Pleasurecruise <3196812536@qq.com>
2025-05-31 11:08:15 +08:00
kangfenmao
fe1cf5d605 chore(version): 1.4.0-rc.3 2025-05-30 15:18:46 +08:00
Rudbeckia.hirta.L
f0335b5aaa fix: The edit button cannot be used after using MCP. 修复对话中使用 MCP 后编辑按钮消失的问题 (#6623)
fix: The edit button cannot be used after using MCP.
2025-05-30 15:15:59 +08:00
fullex
6c394ec375 fix: interrupting in shell and improve pdf readers 2025-05-30 15:11:29 +08:00
beyondkmp
9f49ce6dc9 refactor: Theme improve (#6619)
* refactor(IpcChannel): rename theme change event and streamline theme handling

- Updated the IpcChannel enum to rename 'theme:change' to 'theme:updated' for clarity.
- Refactored theme handling in ipc.ts to utilize a new ThemeService, simplifying theme updates and event broadcasting.
- Adjusted various components to consistently use the updated theme variable naming convention.

* refactor(Theme): standardize theme handling across components

- Updated theme retrieval to use 'actualTheme' instead of 'theme' for consistency.
- Changed default theme setting from 'auto' to 'system' in ConfigManager and related components.
- Adjusted theme handling in various components to reflect the new naming convention and ensure proper theme application.

* fix(Theme): improve theme handling and migration logic

- Added a console log for debugging theme transitions in ThemeProvider.
- Updated ThemeService to ensure theme is set correctly when changed.
- Incremented version number in store configuration to reflect changes.
- Enhanced migration logic to convert 'auto' theme setting to 'system' for better consistency.

* feat(Theme): add getTheme IPC channel and improve theme management

- Introduced a new IPC channel 'App_GetTheme' to retrieve the current theme.
- Updated ThemeService to include a method for getting the current theme.
- Refactored theme initialization in WindowService to ensure proper theme setup.
- Enhanced theme handling in various components to utilize the new theme retrieval method.

* fix(ThemeService): improve theme initialization and retrieval logic

- Set default theme to 'system' and updated theme initialization to handle legacy versions.
- Enhanced getTheme method to return both the current theme and the actual theme based on nativeTheme settings.
- Removed redundant initTheme method from ThemeService and ensured themeService is imported in WindowService for proper initialization.
- Updated ThemeProvider to handle the new structure of the theme retrieval response.

* refactor(Settings): remove theme management from settings

- Eliminated theme-related state and actions from the settings slice.
- Updated useSettings hook to remove theme handling functionality.
- Cleaned up imports by removing unused ThemeMode type.

* refactor(Theme): update theme retrieval in GeneralSettings and HomeWindow

- Restored theme retrieval in GeneralSettings and HomeWindow components.
- Adjusted imports to ensure proper theme management.
- Updated theme condition checks to utilize the ThemeMode enumeration for consistency.

* refactor(Theme): update theme terminology and retrieval in Sidebar and DisplaySettings

- Changed theme label from 'auto' to 'system' in multiple localization files for consistency.
- Updated Sidebar component to reflect the new theme terminology.
- Adjusted DisplaySettings to display the updated theme label.

* refactor(ThemeProvider): initialize theme state from API response

* refactor(ThemeProvider): reset theme state to default values and streamline initialization logic

* refactor(Theme): enhance theme management by incorporating 'system' mode and updating state handling

- Updated ThemeService to include 'system' as a valid theme option.
- Refactored ThemeProvider to utilize useSettings for theme state management and ensure proper initialization.
- Adjusted useSettings to include theme setting functionality.
- Modified settings slice to manage theme state effectively.

* refactor(WindowService, ThemeProvider, Messages, HomeWindow): streamline imports and clean up unused variables

- Removed duplicate import of ThemeService in WindowService.
- Adjusted import order in ThemeProvider for clarity.
- Simplified useSettings destructuring in Messages component.
- Cleaned up unused ThemeMode import in HomeWindow.

* refactor(Theme): standardize theme usage across components by replacing 'actualTheme' with 'theme'

- Updated components to consistently use 'theme' instead of 'actualTheme' for better clarity and maintainability.
- Adjusted ThemeProvider to reflect changes in theme state management.
- Ensured all relevant components are aligned with the new theme structure.

* refactor(Theme): remove unused theme retrieval functionality

- Eliminated the App_GetTheme channel and associated methods from ThemeService and IPC handling.
- Updated components to use the new theme structure, replacing 'actualTheme' with 'settedTheme' for consistency.
- Ensured all theme-related functionalities are streamlined and aligned with the latest changes.

* refactor(Theme): update theme variable usage in ChatFlowHistory and GeneralSettings

- Replaced 'theme' with 'settedTheme' in ChatFlowHistory for consistency with recent theme structure changes.
- Simplified theme destructuring in GeneralSettings by removing unused 'themeMode' variable.
- Ensured alignment with the latest theme management updates across components.

* refactor(Theme): update theme variable in GeneralSettings component

- Replaced 'themeMode' with 'theme' in GeneralSettings for consistency with recent theme structure changes.
- Ensured alignment with the latest theme management updates across components.

---------

Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
2025-05-30 15:10:58 +08:00
自由的世界人
0df331cf8a feat: improve translation setting logic (#6463)
* feat: add auto-detect language option and improve translation logic

* feat: remove auto-detect language option and add bidirectional translation settings

* fix: remove unused model removal function from TranslatePage component

* feat: add language detection and bidirectional translation utilities

* feat: update translation settings to include bidirectional translation tips and remove deprecated options

* fix: improve interaction

* fix: change cld3-asm to franc

* fix: ui/ux

* fix: change eslint

* fix: update

* Revert "fix: update"

This reverts commit 1126a5cce9.

* Reapply "fix: update"

This reverts commit 82b7890f92.

* fix: setloading missing
2025-05-30 13:49:39 +08:00
kangfenmao
a5a04e1df7 lint: fix eslint error and build:check 2025-05-30 13:44:58 +08:00
kangfenmao
170d1a3a9c fix(Messages, WebSearchProviderSetting): remove unused variables and update provider logo styling 2025-05-30 13:29:32 +08:00
MyPrototypeWhat
ce941b6532 fix(MainTextBlock): update whiteSpace style for user messages to 'pre-wrap' 2025-05-30 12:12:06 +08:00
kangfenmao
c5fc7df258 test(scrollbar): fix snapshot mismatched 2025-05-30 12:11:13 +08:00
one
30844b8e21 refactor(SvgPreview): use shadow dom 2025-05-30 12:02:53 +08:00
Caelan
99b00cedb4 feat: dmxapi generate multiple image (#6632)
* chore(version): 1.3.8

* 新增自动添加

* 图片自增功能优化

---------

Co-authored-by: kangfenmao <kangfenmao@qq.com>
2025-05-30 10:35:21 +08:00
fullex
63242384d6 fix: setting tab font size 2025-05-30 10:28:21 +08:00
kangfenmao
e83d31a232 refactor(Scrollbar, Messages): clean up scrollbar component and styles
- Removed unused 'right' prop from Scrollbar component.
- Increased scrolling timeout duration for better user experience.
- Updated scrollbar styles to simplify color handling.
- Adjusted Messages component to remove unnecessary props and added margin for better layout.
- Added responsive styles to CitationBlock for improved mobile display.
2025-05-30 10:27:13 +08:00
fullex
65c7b720de feat(SelectionAssistant): improve selection in browsers and pdf readers (#6618)
fix: improve browsers and pdf readers selection
2025-05-29 22:12:03 +08:00
kangfenmao
77ecfbac9f chore(version): 1.4.0-rc.2 2025-05-29 19:58:55 +08:00
fullex
1a090a7c51 feat: add "Regenerate" in action window 2025-05-29 19:56:34 +08:00
fullex
a88bf104df feat(SelectionAssistant): add "Remember Window Size" functionality
- Introduced a new setting to remember the last adjusted size of the action window.
- Updated ConfigManager, SelectionService, and IPC channels to handle the new feature.
- Enhanced UI components to allow users to toggle the "Remember Size" option.
- Localized the new setting in multiple languages.
2025-05-29 19:55:54 +08:00
kangfenmao
c9caa5f46b revert: fix: english serif font rendering issue #6224
This reverts commit 5dd508b4f4.
2025-05-29 18:51:49 +08:00
kangfenmao
96ae5df1f1 test(QuickPanelView): integrate Redux store into tests and refactor rendering logic
- Added a mock Redux store to the QuickPanelView tests for better state management.
- Refactored test rendering to use a wrapper function for consistent provider usage.
- Updated Scrollbar test to verify throttle behavior with new delay and options.
2025-05-29 18:12:52 +08:00
kangfenmao
6048f42740 refactor: standardize variable naming and improve tag calculation logic
- Renamed variables for consistency, changing `AssistantsTabSortType` to `assistantsTabSortType`.
- Refactored tag calculation in `useTags` to utilize `uniq` and `flatMap` for better performance and readability.
- Updated localization files to remove unnecessary characters in quick trigger messages.
- Enhanced the `AssistantItem` component by extracting menu item creation logic and sorting functions for better maintainability.
2025-05-29 18:02:55 +08:00
eeee0717
e4dea4be45 feat: add MinerU 2025-05-29 16:22:34 +08:00
neko engineer
5b199aa736 feat: 调整分组的效果 (#6561)
1,未分组标签改为未分组
2,列表展示效果持久化
3,增加一个管理列表展示效过的store

Co-authored-by: linshuhao <nmnm1996>
2025-05-29 15:40:32 +08:00
kangfenmao
a6bb58bb45 feat(DisplaySettings): add theme color presets and zoom settings
- Introduced a new color selection feature in DisplaySettings, allowing users to choose from predefined theme color presets.
- Added a dedicated section for zoom settings in the DisplaySettings component, enhancing user customization options.
- Updated localization files to include new zoom settings titles in multiple languages.
2025-05-29 15:35:32 +08:00
kangfenmao
a78db10798 refactor(Messages): enhance message rendering and navigation exclusions
- Updated styles for message content and group containers to improve layout.
- Added new selectors to exclude additional elements from navigation.
- Implemented conditional rendering for mentions in message content.
- Simplified token display logic in message tokens component.
2025-05-29 15:30:03 +08:00
kangfenmao
479b3ccfb7 refactor(Scrollbar, Chat, Messages): improve scroll handling and clean up component structure 2025-05-29 15:30:03 +08:00
kangfenmao
f916002a71 refactor(Chat, Messages): simplify maxWidth calculations and remove unused showAssistants variable 2025-05-29 15:30:03 +08:00
Teo
c5208eeaef feat(theme): 用户自定义主题色 (#4613)
* feat(theme): 用户自定义主题色

* refactor(QuickPanel): integrate user theme for dynamic color handling

* refactor(ThemeProvider): separate user theme initialization into its own useEffect

* refactor(useUserTheme): move theme initialization logic into a dedicated function

* feat(settings): enhance color picker with presets and update styles for ant-collapse

* feat: Refactor theme management to use userTheme object for colorPrimary
2025-05-29 15:29:35 +08:00
Alain
2e8cbdc4aa fix(provider): update Qiniu's name and logo, fix gitee typo (#6593)
* fix(provider): update Qiniu's name and logo

* fix(provider): typo
2025-05-29 13:32:46 +08:00
kangfenmao
77b0dfc8d3 fix(PROVIDER_CONFIG): update website URLs from ppinfra.com to ppio.cn 2025-05-29 10:17:24 +08:00
fullex
c5c5681cfd feat(SelectionAssistant): support Shift+Click & enhance Ctrl key mode (#6566)
* feat: add filter mode and list functionality to selection assistant

- Introduced new filter mode options (default, whitelist, blacklist) for the selection assistant.
- Added methods to set and get filter mode and filter list in ConfigManager.
- Enhanced SelectionService to manage filter mode and list, affecting text selection processing.
- Updated UI components to allow users to configure filter settings.
- Localized new filter settings in multiple languages.

* feat: support Shift+Click & enhance Ctrl key method

* fix: remove comments
2025-05-29 10:10:55 +08:00
one
808afa053f fix(SvgPreview): dragging and sanitizing (#6568)
* fix(SvgPreview): dragging

* fix(SvgPreview): sanitize svg content
2025-05-29 09:51:15 +08:00
one
cb75d01fd3 fix(style): global cursor style for scrollbar thumb 2025-05-29 09:46:19 +08:00
one
3ae7bbf304 refactor: chat navigation triggering (#6576)
* refactor(ChatNavigation): move down the navigation bar

* refactor: attach listeners to MessagesContainer for better triggering experience

* refactor: add delay to Tooltips

* refactor: exclude some toolbars areas from triggering
2025-05-29 09:44:55 +08:00
one
fc3d536433 fix(HealthCheck): add a disclaimer (#6570)
* fix(HealthCheck): add a disclaimer

* fix: remove duplicates in zh-tw.json
2025-05-28 23:37:00 +08:00
kangfenmao
36abf3f099 Revert "fix: Repair abnormal line break display"
This reverts commit 3d7fd5a30c.
2025-05-28 20:04:59 +08:00
stevending1st
3d7fd5a30c fix: Repair abnormal line break display 2025-05-28 17:10:19 +08:00
fullex
f83d9fc03c feat(SelectionAssistant): App Filter / 应用筛选 (#6519)
feat: add filter mode and list functionality to selection assistant

- Introduced new filter mode options (default, whitelist, blacklist) for the selection assistant.
- Added methods to set and get filter mode and filter list in ConfigManager.
- Enhanced SelectionService to manage filter mode and list, affecting text selection processing.
- Updated UI components to allow users to configure filter settings.
- Localized new filter settings in multiple languages.
2025-05-28 16:25:21 +08:00
kangfenmao
94e6ba759e fix: suppress exhaustive-deps warnings in multiple components
- Added eslint-disable comments for react-hooks/exhaustive-deps in CustomCollapse, DmxapiPage, SelectionActionApp, ActionGeneral, and ActionTranslate components to prevent warnings related to missing dependencies in useEffect hooks.
2025-05-28 16:24:53 +08:00
suyao
c8c30f327b fix(OpenAIProvider): adjust reasoning effort setting to default to 'medium' when set to 'auto' 2025-05-28 16:20:54 +08:00
kangfenmao
72fae1af25 fix: update artifact patterns in release workflow
- Modified the artifact patterns in the GitHub Actions release workflow to include 'dist/rc*.yml' for better versioning support.
2025-05-28 16:19:41 +08:00
kangfenmao
98f8bacdc8 chore(version): 1.4.0-rc.1 2025-05-28 15:51:44 +08:00
FunJim
06f6da725d fix: add custom parameters to OpenAI generateImageByChat requests 2025-05-28 15:47:18 +08:00
fullex
d24eabb97c fix[SelectionAssistant]: interrupting in terminal apps (#6549)
fix: interrupting in terminal apps
2025-05-28 13:09:10 +08:00
suyao
eca3f1d71e fix: update token limits for Claude-4 models and refine reasoning checks in OpenAIProvider
- Adjusted max token limit for 'claude-sonnet-4' and 'claude-opus-4' models from 64000 to 32000.
- Simplified reasoning checks in OpenAIProvider to combine conditions for supported models, enhancing code clarity.
2025-05-28 09:41:08 +08:00
beyondkmp
87d178773a fix: update TikToken implementation and remove js-tiktoken dependency
- Replaced the existing TikToken implementation with a placeholder error message indicating it is not implemented.
- Removed the js-tiktoken dependency from package.json to streamline the project.
- Updated yarn.lock to reflect changes in dependencies and checksums.
2025-05-28 08:55:52 +08:00
George Zhao
02cb005668 fix: increase max cache limit and update slider marks in MiniAppSettings (#6414)
* fix: increase max cache limit and update slider marks in MiniAppSettings

* fix: adjust max cache limit and update slider marks in MiniAppSettings

* Update MiniAppSettings.tsx

---------

Co-authored-by: George Zhao <georgezhao@SKJLAB>
2025-05-28 01:06:17 +08:00
nmnmtttt
cf1d5c098f feat: Assistant add tag (#6065)
* feat: 添加助手标签显示逻辑
-增加助手的标签属性
-能够删除,修改,调整助手的标签
Signed-off-by: LeeSH <shuhao_lin@fzzixun.com>

* fix: 修复不能输入新增标签的问题

* feat: 完善不同状态下,提示文本展示

* feat: 调整标签展示逻辑
1,左键调整列表页展示逻辑
2,新增标签改为使用+号提示

* feat: 移除搜索栏可以直接增加tag值的功能
Signed-off-by: LeeSH <shuhao_lin@fzzixun.com>

* fix: 修复点击不能切换话题的bug

* feat:  调整了标签修改的交互
1,添加和管理分开处理
2,可以点击标签之间切换
3,点击删除可以之间移除所有关联助手的标签

tips:为了简单实现,标签本身不具有具体类,都是助手的子属性。所以如果关联的所有助手都没了该属性,标签会直接消失,而且标签目前无法排序

Signed-off-by: LeeSH <shuhao_lin@fzzixun.com>

* feat:优化标签管理
1,列表状态管理向上提,切换左侧列表不会影响原来的列表状态
2,标签名称增加最大宽度
3,标签内的助手顺序,参照原顺序排列
4,增加标签ui,提示语调整
5,标签管理ui,提示语调整
6,标签管理增加标签暂时态,防止误删没有其他助手的标签项的时候,标签在弹窗内整个消失(如果关闭弹窗那标签就无法找回)
7,如果没有标签的时候,右键仅展示添加标签

Signed-off-by: LeeSH <shuhao_lin@fzzixun.com>

---------

Signed-off-by: LeeSH <shuhao_lin@fzzixun.com>
Co-authored-by: linshuhao <nmnm1996>
Co-authored-by: Lee SH <shuhao_lin@fzzixun.com>
2025-05-27 21:57:15 +08:00
purefkh
65273b055c feat: support system prompt variables (#5995)
* feat: support system prompt variables

* feat: add tip

* fix ci test fail
2025-05-27 21:49:25 +08:00
beyondkmp
f171839830 chore: refine file exclusion patterns in electron-builder configuration (#6502)
- Updated exclusion patterns to ensure more comprehensive filtering of unnecessary files and directories during the build process.
- Added additional file types and configurations to the exclusion list for better optimization.

Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
2025-05-27 21:46:36 +08:00
fullex
8f9a5642f2 feat[SelectionAssistant]: add faq&feedback link (#6531)
feat: add FAQ button to Selection Assistant settings
2025-05-27 21:45:49 +08:00
SuYao
e906d5db25 fix: Optimize error message formatting (#5988)
* fix: Optimize error message formatting

* fix: improve error unit test

* refactor: simplify error handling in ErrorBlock component

- Replaced custom StyledAlert with a more streamlined Alert component for error messages.
- Reduced complexity by removing unnecessary JSX wrappers and improving readability.
- Adjusted styling for the Alert component to maintain visual consistency.

* fix: update error handling in ErrorBlock component

- Removed unnecessary message prop from Alert component to simplify error display.
- Maintained existing error handling logic while improving code clarity.
2025-05-27 21:45:04 +08:00
fullex
80c09a07dc refactor: TrayService & ConfigManager (#6526)
* refactor: TrayService

- Removed the App_RestartTray channel from IpcChannel and its usage in ipc.ts and preload/index.ts.
- Updated TrayService to handle configuration changes without the need for a restart.
- Enhanced ConfigManager to notify subscribers on language and quick assistant settings changes.
- Adjusted QuickAssistantSettings to close the mini window based on the quick assistant's enable state.

* refactor: enhance configuration management

- Updated ConfigManager to consolidate setting and notification logic into a single method, setAndNotify.
- Modified IPC handler to accept an additional parameter for notification control.
- Adjusted QuickAssistantSettings to utilize the new parameter for enabling notifications during configuration changes.
2025-05-27 21:11:49 +08:00
chenxue
af6145600a feat: aihubmix painting support imagen (#6525)
* add imagen

* feat: support imagen model

* update proxy notice

---------

Co-authored-by: zhaochenxue <zhaochenxue@bixin.cn>
2025-05-27 21:02:02 +08:00
kangfenmao
42bda59392 feat: add default painting provider support and update routing
- Introduced defaultPaintingProvider in settings to manage selected painting provider.
- Updated Sidebar component to reflect the selected painting provider in the route.
- Enhanced PaintingsRoutePage to dispatch the default painting provider based on URL parameters.
- Added PaintingProvider type to define available options for painting providers.
2025-05-27 17:38:00 +08:00
chenxue
e73f6505e9 feat: painting aihubmix support model: gpt-image-1 (#6486)
* update select style

* add openai painting

* support base64 response

* update config

* fix upload preview bug

* fix remix default model

* fix history data

* feat: optimize structure

* fix history data

---------

Co-authored-by: zhaochenxue <zhaochenxue@bixin.cn>
2025-05-27 17:01:39 +08:00
kangfenmao
332aa45618 chore: remove electron-icon-builder 2025-05-27 16:57:31 +08:00
kangfenmao
253075e332 fix: remove tiktoken 2025-05-27 16:57:18 +08:00
shiquda
737b8f02b1 feat: add title to selection action button in compact mode (#6498)
* feat: add title prototype to selection action button in compact mode

* fix: optimize the display name logic for action buttons in the selection toolbar
2025-05-27 12:51:49 +08:00
MyPrototypeWhat
2a996e2c9a fix(MainTextBlock): adjust whiteSpace style for user role messages (#6501) 2025-05-27 12:10:09 +08:00
suyao
109a355116 refactor: update file handling and dependencies
- Added '@cherrystudio/mac-system-ocr' to external dependencies in electron.vite.config.ts.
- Updated debug script in package.json to use 'electron-vite dev' for better debugging.
- Renamed 'File_Create' to 'File_CreateTempFile' in IpcChannel for clarity.
- Replaced 'adm-zip' with 'node-stream-zip' for zip file extraction in install-bun.js and install-uv.js scripts.
- Refactored file handling across various components to use 'FileMetadata' instead of 'FileType' for improved type consistency.
- Removed unused GeminiService and updated related file handling logic.
- Enhanced error handling and logging in file services and message services.
2025-05-27 12:06:18 +08:00
kangfenmao
c77d627077 chore: update electron-builder configuration to refine file exclusion patterns
- Added exclusions for various distribution directories and module types to optimize the build process.
- Updated license file exclusions to be more inclusive of different casing variations.
2025-05-27 10:06:39 +08:00
kangfenmao
11daf93094 chore: update @google/genai to version 1.0.1 and remove GeminiService references
- Updated the @google/genai dependency in package.json and yarn.lock to version 1.0.1.
- Removed the GeminiService and its related references from the codebase to streamline functionality.
- Introduced a new CacheService for managing cached data effectively.
2025-05-27 10:04:41 +08:00
beyondkmp
44b07ee35d fix: adjust order of tools in CodeToolbar constants for correct display 2025-05-27 09:38:02 +08:00
fullex
b24de23219 feat: integrate custom CSS support in SelectionAssistant 2025-05-27 09:37:23 +08:00
fullex
431e2aaa13 fix[SelectionAssistant]: remove console.log (#6474)
fix: remove console.log
2025-05-26 20:11:13 +08:00
beyondkmp
9896c75a2e fix: cannot run from yarn dev (#6468) 2025-05-26 19:20:38 +08:00
suyao
c5349af29f fix(i18n): update Japanese, Russian, Chinese, and Traditional Chinese localization files 2025-05-26 18:46:19 +08:00
suyao
b305c23c52 fix(i18n): update localization for tools and web search settings
- Added new OCR settings under tools in English, Chinese (Simplified and Traditional) localization files.
- Updated web search settings to reflect new structure in localization files.
- Adjusted navigation path for web search settings in the Inputbar component.
2025-05-26 18:39:11 +08:00
beyondkmp
94cec70737 chore: removed unused dependencies to reduce size (#6464)
* chore: update package dependencies and refactor BackupManager to use fs.promises

- Removed unused dependencies: fetch-socks and fs-extra from package.json and yarn.lock.
- Updated BackupManager to utilize fs.promises for file system operations, improving consistency and modernizing the codebase.
- Ensured all file operations in BackupManager are handled with promises for better error handling and readability.

* chore: add fs-extra dependency and refactor BackupManager for improved file handling

- Added fs-extra to package.json and updated yarn.lock to enhance file system operations.
- Refactored BackupManager to utilize fs-extra methods for better readability and functionality, replacing fs.promises with fs-extra equivalents for directory and file operations.

---------

Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
2025-05-26 18:34:57 +08:00
suyao
02580a1998 chore: update yarn.lock and modify useSettings hook
- Added new dependencies for mac-system-ocr and mistralai packages in yarn.lock.
- Removed unused topN setting from KnowledgeSettings component.
- Refactored useSettings hook to include setPinTopicsToTop method.
2025-05-26 18:28:37 +08:00
suyao
4d48a533b7 refactor: remove binaryImage method from api in preload index 2025-05-26 18:22:13 +08:00
suyao
f7e8b1803a Merge branch 'main' into feat/ocr 2025-05-26 18:18:48 +08:00
fullex
2ba4e51e93 feat: Selection Assistant / 划词助手 (#5900)
* feat(selection): implement selection assistant with toolbar and action management

- Added selection assistant functionality including a toolbar for actions.
- Introduced new settings for enabling/disabling the selection assistant and configuring its behavior.
- Implemented action items for built-in functionalities like translate, explain, and copy.
- Integrated selection service to manage selection events and actions.
- Updated localization files to support new selection assistant features in multiple languages.
- Added new components for action management and user interaction within the selection assistant.

* chore: update selection-hook to version 0.9.10 and exclude prebuilds from packaging

* fix: toolbar hiding

* feat: enhance error handling and service management in main index

* fix: improve logical coordinate handling in SelectionService

* fix: update URL loading and coordinate conversion in SelectionService

* fix: replace console.error with Logger for error handling in SelectionService

* refactor(SelectionService): enhance preloaded action window management

* chore(electron-builder): add filter for .node build files in configuration

* fix: toolbar position calculating for multi monitor

* fix: update selection assistant configuration and improve error handling in SelectionService

* fix: SelectionActionUserModal layout

* feat: add hints for custom search URL in multiple languages

* fix: update calculateToolbarPosition to ensure integer return type and round position values

* feat: add action window opacity setting and update related UI components

refactor: SelectionActionsList

* chore: enhance tooltip for trigger mode settings

* fix: console.log

* chore: update selection-hook to version 0.9.12

* fix: integrate language settings into selection components

* fix: filter out default assistant from user predefined assistants in selection modal

* chore: update selection-hook package version to 0.9.13

* chore: update selection-hook package version to 0.9.14
2025-05-26 16:50:52 +08:00
one
665a62080b test: more unit tests (#5130)
* test: more unit tests

- Adjust vitest configuration to handle main process and renderer process tests separately
- Add unit tests for main process utils
- Add unit tests for the renderer process
- Add three component tests to verify vitest usage: `DragableList`, `Scrollbar`, `QuickPanelView`
- Add an e2e startup test to verify playwright usage
- Extract `splitApiKeyString` and add tests for it
- Add and format some comments

* fix: mock individual properties

* test: add tests for CustomTag

* test: add tests for ExpandableText

* test: conditional rendering tooltip of tag

* chore: update dependencies
2025-05-26 16:50:26 +08:00
fullex
a05a7e45cc chore: update electron-builder configuration and package dependencies
- Modified electron-builder.yml to refine file inclusion/exclusion patterns.
- Removed and re-added dependencies in package.json for consistency and updated yarn.lock to reflect these changes.
- Cleaned up unnecessary entries in yarn.lock to streamline the dependency tree.
2025-05-26 16:49:09 +08:00
kangfenmao
f8e9216270 refactor: remove early return for empty MCP servers in MCPToolsButton
- Eliminated the conditional return for empty active MCP servers to streamline the component rendering logic.
2025-05-26 16:24:19 +08:00
kangfenmao
11d72f14dc chore(version): 1.3.12 2025-05-26 15:15:24 +08:00
kangfenmao
f36735f6db refactor: streamline provider menu logic in settings
- Consolidated edit and delete menu items for providers into separate constants for improved readability and maintainability.
- Enhanced the logic for displaying menus based on provider status, ensuring correct options are presented for system providers and initial providers.
2025-05-26 15:14:14 +08:00
kangfenmao
1b0b08c4c4 chore: remove gitee provider 2025-05-26 15:08:20 +08:00
kangfenmao
13d440b0b6 chore: update release notes and fix various issues
- Updated release notes to include new DMXAPI service and fixed knowledge base search results issue.
- Enhanced drag-and-drop functionality for message selection and resolved memory exceptions in translation replies.
- Added styling adjustments for context menu and improved layout in CodeBlockView and MessageGroup components.
2025-05-26 15:07:53 +08:00
Teo
2dc81ab8c8 Feat: Supports sorting of textarea function buttons by dragging (#6268)
* feat(inputbar): add collapsible tools and localization for tool actions

* refactor(inputbar): simplify tool rendering logic in InputbarTools

* refactor(inputbar): enhance tool visibility logic and improve rendering structure in InputbarTools

* fix(inputbar): correct tooltip text for collapse/expand action in InputbarTools

* refactor(Inputbar): simplify Toolbar structure and improve styling
2025-05-26 14:23:27 +08:00
SuYao
b2b0fe9072 chore: update electron configuration and add debug script (#6361)
* chore: update electron configuration and add debug script

- Added sourcemap generation for development builds in electron.vite.config.ts.
- Introduced a new debug script in package.json for easier debugging with remote inspection.

* docs: add debug section to development documentation

- Introduced a new section for debugging instructions, including the command to run the debug script and how to access the Chrome inspect tool.
2025-05-26 11:48:19 +08:00
kangfenmao
da30b52334 feat: add dark mode support for DMXAPI logo in settings
- Introduced a new dark mode logo for DMXAPI and updated the logo rendering logic in the DMXAPISettings component to switch between light and dark logos based on the current theme.
2025-05-26 11:46:56 +08:00
Roland
e854ef8757 fix: 修复Nutstore设置中的自动同步状态和错误消息内容 (#6452)
- 在NutstoreSettings组件中,添加了设置Nutstore自动同步状态的逻辑。
- 更新NutstoreService中的错误消息内容,确保使用正确的国际化键。
2025-05-26 11:46:26 +08:00
kangfenmao
d90ac44945 docs: update README files to enhance feature listings and organization
- Renumbered feature sections for clarity and consistency across English, Japanese, and Chinese README files.
- Improved formatting by removing unnecessary bullet points for a cleaner presentation of core features, knowledge management, platform support, and advanced features.
2025-05-26 11:30:34 +08:00
kangfenmao
55852cb0a1 fix: change display style of .shiki class to flex for improved layout in CodePreview component 2025-05-26 10:59:35 +08:00
Pleasurecruise
c28afebdfd fix: update popup content to improve user interaction in MessageGroup component 2025-05-26 10:35:30 +08:00
kangfenmao
07407f751f docs: update README files to reflect new roadmap and feature enhancements
- Revised the TODO section to a comprehensive roadmap outlining core features, knowledge management, platform support, and advanced features.
- Added links to the project board and GitHub Discussions for community engagement and feedback.
2025-05-26 10:27:02 +08:00
kanweiwei
4726673508 fix: return value from appUpdater.checkForUpdates in IPC handler 2025-05-26 10:11:24 +08:00
Konv Suu
5dc48580a0 fix: improve header styling in CustomCollapse component (#6449) 2025-05-26 10:10:21 +08:00
fullex
676c1cbe83 chore: remove postinstall script from package.json 2025-05-26 10:07:20 +08:00
iola1999
6d61bcd605 fix: Chinese input issue in AddProviderPopup (#6445) 2025-05-26 09:46:31 +08:00
MyPrototypeWhat
ee78dbd27e feat: throttle updateTranslationBlock dispatch for improved performance (#6442)
- Introduced throttling to the updateTranslationBlock dispatch function to limit the frequency of updates, enhancing performance during message operations.
- Utilized lodash's throttle function to ensure efficient handling of accumulated text updates.
2025-05-25 23:37:59 +08:00
Pleasurecruise
d88d78e143 fix: escape special characters in search pattern for improved filtering 2025-05-25 21:20:26 +08:00
SuYao
458f017517 fix: enhance web search recognization in AI providers (#6423) 2025-05-25 21:13:29 +08:00
SuYao
f462b7f94e fix: enhance ExportService to support nested bold and italic formatting (#6420)
* fix: enhance ExportService to support nested bold and italic formatting

- Added tracking for nested bold and italic tags in the ExportService.
- Updated text rendering logic to apply bold and italic styles based on the nesting level of the tags.

* fix: remove unused citation variable in messageToMarkdown function
2025-05-25 21:08:47 +08:00
SuYao
94792c9bb1 feat: enhance citation handling in message export functionality (#6422)
* feat: enhance citation handling in message export functionality

- Refactored message export functions to include citation content in markdown output.
- Introduced a new utility function to extract and format citations from messages.
- Updated related imports and adjusted existing markdown generation logic for improved clarity and maintainability.

* feat: enhance message export tests to include citation and reasoning content

- Added tests to verify inclusion of citation content in markdown output when citation blocks exist.
- Ensured proper formatting with double newlines between sections in exported markdown.
- Updated existing tests to handle cases with reasoning content and no main text block gracefully.

* fix: update citation mapping in export tests for consistency

- Modified the citation mapping in export tests to use the index parameter directly, improving clarity and consistency in the generated markdown output.
2025-05-25 21:08:06 +08:00
w
adef817e86 修复DMXAPI文生成画bug 2025-05-25 21:05:15 +08:00
one
2f312d68a0 refactor(CodeTool): use hook for codeblock tools rather than context (#6273)
* refactor(CodeTool): use hook for codeblock tools rather than context

* fix: codeblock overflow behaviour

* fix: CodePreview scrollbar

* refactor: move margin to CodeHeader

* refactor: add min-width to codeblock
2025-05-25 18:01:27 +08:00
one
a7520169e6 fix: MessageMenubar copy uses latest content (#6435)
* Fix: MessageMenubar copy uses latest content

The 'Copy' button in MessageMenubar was previously using memoized content
derived from component props. This could lead to copying stale content if
you edited a message (e.g., a code block), saved it, and then
immediately clicked 'Copy', because the asynchronous Redux store update
might not have completed and propagated to the props yet.

This commit modifies the onCopy function in MessageMenubar.tsx to
fetch the latest version of the message directly from the Redux store
(store.getState().messages.entities[message.id]) at the moment the
copy action is performed. This ensures that the most up-to-date content
is always copied, resolving the stale content issue.

* Chore: Remove unnecessary comments from MessageMenubar

Removes a few explanatory comments from the onCopy function in
MessageMenubar.tsx that were deemed unnecessary, to keep the code
cleaner.

The comments originated from an example provided in a previous description. The core logic of the function remains unchanged.

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-05-25 15:57:54 +08:00
SuYao
59e3082642 fix: update dimensions handling in KnowledgeBaseParams (#6417)
fix: update dimensions handling in KnowledgeBaseParams and add supported dimension providers
2025-05-25 13:07:21 +08:00
自由的世界人
795d12c91e fix: ensure args are an array in AddMcpServerModal and MCPService com… (#6413)
fix: ensure args are an array in AddMcpServerModal and MCPService components
2025-05-24 23:17:15 +08:00
SuYao
8eb0be7562 fix: handle optional usage properties in AnthropicProvider (#6418) 2025-05-24 23:12:57 +08:00
kangfenmao
bca4fbe7de fix: update MainTextBlock to use a class for markdown styling
- Changed the paragraph element in MainTextBlock to include a "markdown" class for improved styling consistency.
2025-05-24 18:35:57 +08:00
Caelan
2b99d6066f feat: 文字生成图新增提供商DMXAPI (#6352)
dmxapi文字生成图

Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-05-24 16:14:32 +08:00
自由的世界人
9357bd6e0f feat: add disable MCP server functionality and update translations (#6398)
* feat: add disable MCP server functionality and update translations

* feat: update MCPToolsButton and WebSearchButton to use CircleX icon and change labels to 'close'

---------

Co-authored-by: kangfenmao <kangfenmao@qq.com>
2025-05-24 16:00:55 +08:00
Pleasurecruise
c4e0744806 fix: improve multi-select functionality in Messages and SelectionBox components 2025-05-24 15:44:50 +08:00
one
1b6cba454d chore: add dependabot (#6369) 2025-05-24 08:58:24 +08:00
SuYao
77cd958d08 fix: floating-sidebar header sticky (#6371) 2025-05-24 08:55:20 +08:00
kangfenmao
d8aac9ecb8 feat: add support for Windows ARM64 architecture in bun installation script
- Included package mappings for 'win32-arm64' and 'win32-arm64-baseline' to the BUN_PACKAGES object in install-bun.js, enhancing compatibility with ARM64 devices on Windows.
2025-05-23 18:53:55 +08:00
kangfenmao
2758321821 chore: disable code signature verification for Windows updates in electron-builder configuration 2025-05-23 17:50:50 +08:00
kangfenmao
9dfa81f11f chore(version): 1.3.11 2025-05-23 17:15:54 +08:00
kangfenmao
3693e115a6 chore: update release notes and improve README assets
- Updated release notes to include new features such as TokenFlux service support, Claude 4 model integration, and fixes for various issues including Windows user startup problems and search crashes.
- Replaced outdated screenshots in README files with new images across English, Japanese, and Chinese documentation.
- Enhanced the 'Related Projects' section for better visibility.
2025-05-23 17:11:33 +08:00
kangfenmao
2f3a3c8c48 refactor: remove manual chunking logic from Vite configuration
- Eliminated custom output chunking strategy for worker files and node_modules from the electron Vite configuration.
- Streamlined the configuration for improved maintainability and clarity.
2025-05-23 17:10:23 +08:00
LiuVaayne
f6d71868cb feat: support tokenflux provider (#6358)
* feat: add Cherry Cloud provider with associated assets and localization support

* feat: add Cherry Cloud provider support with OAuth integration and IPC handling

* fix: add success message for Cherry Cloud API key update

* feat: enhance provider navigation with dynamic ID in URL and update selected provider state

* feat: implement Cherry Cloud server synchronization with token management and error handling

* feat: add CherryCloud provider configuration and token management

* feat: integrate TokenFlux provider support and update related configurations

fix: update redux-persist version to 104

refactor: remove redundant tokenflux provider model assignment in migration

fix: update migration to add TokenFlux provider instead of CherryCloud

* feat: enhance TokenFlux server synchronization with API key authentication support

* feat: update TokenFlux provider assets and add new models

* feat: update migration logic for version 106 to add TokenFlux provider

* feat: disable TokenFlux provider by default in INITIAL_PROVIDERS

* feat: add TokenFlux billing URLs to providerCharge and providerBills functions
2025-05-23 17:10:07 +08:00
beyondkmp
e5bf6916a6 chore: update electron version to 35.4.0 in package.json and yarn.lock 2025-05-23 16:28:27 +08:00
beyondkmp
7c119e2747 feat: add navigation buttons for webview history in MinApp popup (#6342)
* feat: add navigation buttons for webview history in MinApp popup

- Implemented 'Go Back' and 'Go Forward' functionality in the MinApp popup.
- Added corresponding translations for English, Japanese, Russian, and Chinese locales.
- Included icons for navigation buttons to enhance user experience.

* fix: update Russian and Traditional Chinese translations for UI elements

- Revised translations for "rightclick_copyurl", "close", and "minimize" to improve clarity and consistency in the Russian and Traditional Chinese locales.
- Ensured that the translations align better with user expectations and common usage.

* fix: update Russian translations for MinApp popup UI elements

- Revised translations for "close" and "minimize" to specify their context within the MinApp, enhancing clarity for users.
- Ensured consistency with existing translations and improved user understanding of the interface.

---------

Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
2025-05-23 15:29:13 +08:00
kangfenmao
03ef52c6a7 fix: ensure correct PATH assignment in shell environment
- Updated the environment variable initialization to use a consistent type.
- Added logic to set the PATH variable correctly, ensuring it falls back to existing values if necessary.
2025-05-23 15:25:01 +08:00
kangfenmao
e21e0d238e fix: minapp search error 2025-05-23 15:18:58 +08:00
jtsang4
631fa3a42a feat: support pin topic to the top
Signed-off-by: jtsang4 <info@jtsang.me>
2025-05-23 13:58:48 +08:00
karl
ee042e11f1 fix: editing user messages is not re-sent; it can only be saved#6327 2025-05-23 12:57:54 +08:00
kangfenmao
178d164ff9 chore(version): 1.3.10 2025-05-23 11:17:12 +08:00
suyao
e5ded81d9b feat: gemini thinking summary support
- Removed unnecessary content accumulation and streamlined chunk processing logic.
- Introduced distinct handling for 'thinking' and 'text' parts, ensuring accurate onChunk calls for both types.
- Enhanced timing tracking for reasoning content, improving overall responsiveness in streaming scenarios.
2025-05-23 11:10:46 +08:00
hutchisr
c8e6872fb8 feat: Support Claude 4 (#6328) 2025-05-23 08:45:44 +08:00
one
2820f85be4 feat: toggle MCP servers on the card list (#6232) 2025-05-23 00:39:02 +08:00
suyao
1989f246fd feat: add support for 'grok' provider in web search functionality
- Enhanced `isWebSearchModel` to recognize 'grok' as a valid web search model.
- Updated `getOpenAIWebSearchParams` to return specific search parameters for 'grok'.
- Modified `OpenAIProvider` to handle citations from 'grok' in web search results.
- Added 'grok' to the `WebSearchSource` enum for citation formatting.
2025-05-22 23:28:32 +08:00
kangfenmao
3ac414e97b fix: handle proxy environment variables for bun command in MCPService
- Added logic to remove proxy environment variables when the command ends with 'bun'.
- Introduced a new private method `removeProxyEnv` to clean up the environment variables before starting the server.
2025-05-22 22:57:49 +08:00
kangfenmao
bcb93fc2d0 fix: adjusted max-width in McpDescription.tsx 2025-05-22 22:57:40 +08:00
karl
9f579334f8 fix: shiki does not load language as a fallback & themes error (#6281)
* fix: shiki does not load language as a fallback & themes error

* feat: shiki automatic loading language
2025-05-22 22:00:30 +08:00
自由的世界人
6f75b1738d fix: #6301 (#6317)
* fix: #6301

* fix: update dependencies in useUpdateHandler and add eslint comment in ContentSearch
2025-05-22 21:24:40 +08:00
SuYao
72d939721d fix: non-streaming reasoning_content (#6308)
* fix: non-streaming reasoning_content

* fix: streamline reasoning handling in OpenAIProvider
2025-05-22 20:35:47 +08:00
Pleasurecruise
7d6ef1d69a fix: handle empty block content in MessageTranslate component 2025-05-22 19:39:34 +08:00
SuYao
e162da55bd fix: enhance backup and restore functionality with skip option (#6294)
* fix: enhance backup and restore functionality with skip option

- Updated `restore` and `restoreFromWebdav` methods in `BackupManager` to include a `skipBackupFile` parameter, allowing users to skip restoring the Data directory if desired.
- Modified corresponding IPC calls in `preload` and `BackupService` to support the new parameter.
- Added success message translations in multiple languages for improved user feedback.

* fix: integrate skipBackupFile option in RestorePopup for enhanced restore functionality

* refactor: remove skipBackupFile parameter from restore methods for simplified usage

- Updated `restore` and `restoreFromWebdav` methods in `BackupManager`, `BackupService`, and `NutstoreService` to remove the `skipBackupFile` parameter, streamlining the restore process.
- Adjusted corresponding IPC calls in `preload` and `RestorePopup` to reflect the changes, ensuring consistent functionality across the application.
2025-05-22 19:38:34 +08:00
kangfenmao
fc5209723f build: add win-sign script 2025-05-22 19:33:40 +08:00
kangfenmao
75153ce83c chore: upgrade yarn version to v4.9.1 2025-05-22 15:48:20 +08:00
kangfenmao
fd1cf1331f feat: implement message location functionality and refactor multi-select handling
- Added event listeners for LOCATE_MESSAGE events to scroll to specific messages in the MessageGroup component.
- Introduced a new SelectionBox component to handle multi-select functionality, allowing users to select multiple messages with drag actions.
- Refactored Messages component to remove unused multi-select logic and improve overall structure.
- Cleaned up code by removing commented-out sections and unnecessary state management related to dragging.
2025-05-22 15:14:13 +08:00
MyPrototypeWhat
a5738fdae5 feat: add functionality to insert messages at a specific index in the… (#6299)
* feat: add functionality to insert messages at a specific index in the Redux store

- Introduced a new interface for inserting messages at a specified index.
- Implemented the insertMessageAtIndex reducer to handle message insertion.
- Updated saveMessageAndBlocksToDB to support message insertion logic.
- Modified appendAssistantResponseThunk to utilize the new insertion functionality.

* feat: integrate multi-select mode handling in MessageGroup component

- Added useChatContext hook to access multi-select mode state.
- Updated isGrouped logic to account for multi-select mode, ensuring proper message grouping behavior.
- Enhanced MessageWrapper styles for better layout management in different modes.

---------

Co-authored-by: kangfenmao <kangfenmao@qq.com>
2025-05-22 14:57:54 +08:00
chenxue
86b95ee17a fix: aihubmix provider model proxy rule (#6293)
Update AihubmixProvider.ts

Co-authored-by: zhaochenxue <zhaochenxue@bixin.cn>
2025-05-22 14:46:40 +08:00
one
587e1d9971 fix: Use effective theme for code style in SettingsTab (#6305)
* Fix: Use effective theme for code style in SettingsTab

The SettingsTab component was previously using the theme setting directly from useSettings to determine whether to apply the light or dark code style. This caused an issue when the theme was set to 'auto', as it wouldn't correctly reflect the actual system theme (light or dark).

This commit modifies SettingsTab.tsx to use the `theme` from the `useTheme` hook (which provides the effective theme) for the logic that determines the code editor and preview styles. This ensures that the code style accurately reflects your current effective theme, including when 'auto' theme is selected and the OS theme changes.

* Refactor: Remove unnecessary comments in SettingsTab

This commit removes non-essential comments that were added during a previous refactoring of `SettingsTab.tsx`. The core logic for using the effective theme for code style selection remains unchanged. This change is purely for code cleanliness.

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-05-22 14:45:36 +08:00
SuYao
b8e978f2a1 fix: token 取整 (#6300) 2025-05-22 14:13:28 +08:00
kangfenmao
bd8452032e fix: enhance message loading and search functionality in HistoryPage and SearchResults
- Integrated Redux dispatch to load topic messages when a message is clicked in HistoryPage.
- Updated SearchResults to utilize message blocks for improved search results, including content extraction.
- Refactored state management to accommodate new content structure in search results.
2025-05-22 11:48:38 +08:00
kangfenmao
0079f4f437 refactor: update Gemini file upload method to accept baseURL parameter
- Modified the uploadFile method in GeminiService to include baseURL in the parameters.
- Updated the corresponding calls in the preload and renderer layers to pass the baseURL along with the apiKey.
2025-05-22 10:11:26 +08:00
one
0436ea671e refactor: CodePreview fade in on the first highlighting (#6228)
* refactor(CodePreview): fade in on the first highlighting

* refactor: improve code placeholder style
2025-05-22 00:05:30 +08:00
kangfenmao
05c29b2bc1 revert: mcp run python (#6151)
This reverts commit c468c3cfd5.
2025-05-22 00:04:15 +08:00
one
3f97aef93f fix: show x-scrollbar in codeblock if unwrapped, simplify style definitions (#6266)
* fix: show x-scrollbar in codeblock if unwrapped, simplify style definitions

* chore: clean up useless code
2025-05-21 23:39:23 +08:00
SuYao
2e3adb0b1b fix: update service tier check to exclude GitHub and Copilot models
* refactor: improve shiki highlighter utils and reuse it in ShikiStreamService

* refactor: reuse shiki highlighter and markdown-it renderer

* hotfix: exclude GitHub and Copilot models

* fix: update service tier check to exclude GitHub and Copilot models

---------

Co-authored-by: one <wangan.cs@gmail.com>
2025-05-21 23:29:55 +08:00
kangfenmao
507da84b80 chore: update release notes in electron-builder.yml
- Added new features including message notification functionality and support for Google Mini Programs.
- Improved MCP capabilities to run Python code and fixed several issues related to message editing and display.
- Updated release notes to reflect these changes and enhancements.
2025-05-21 23:23:43 +08:00
suyao
b30a30efa8 refactor: enhance notification handling based on page context
- Updated NotificationProvider to truncate long messages for better display.
- Modified message sending logic in messageThunk to prevent notifications on the home page, improving user experience.
2025-05-21 23:18:55 +08:00
kangfenmao
c29ff577ed refactor: update IPC channel names for notifications
- Renamed IPC channels for notifications to improve clarity and consistency.
- Updated related handlers in the main process and preload scripts to reflect the new naming convention.
- Enhanced notification service to respect user settings before sending notifications.
2025-05-21 23:11:34 +08:00
kangfenmao
f9512d6ef2 fix: handle user cancellation and improve error reporting in file saving process
- Added a check for user cancellation in the file save dialog, rejecting the promise if canceled.
- Enhanced error handling to reject the promise with a detailed error message instead of returning null.
2025-05-21 22:40:20 +08:00
kangfenmao
326163d798 style: update border color in SearchBarContainer for improved UI consistency 2025-05-21 22:31:55 +08:00
kangfenmao
7099bee833 refactor: enhance multi-selection handling in Inputbar and MessageEditor
- Integrated `useAppSelector` in Inputbar to manage multi-selection state.
- Updated Inputbar to conditionally render based on multi-selection mode.
- Modified MessageEditor to display the resend button only for assistant messages, improving UI clarity.
2025-05-21 22:22:01 +08:00
kangfenmao
b1839b722f refactor: migrate chat context to a custom hook and enhance multi-selection functionality
- Replaced the ChatContext with a custom hook `useChatContext` for better modularity and reusability.
- Updated components to utilize the new hook, passing the active topic as an argument.
- Enhanced multi-selection logic and state management for messages, improving user experience in the chat interface.
- Removed the old ChatContext file to streamline the codebase.
2025-05-21 21:40:27 +08:00
kangfenmao
46ae4f9b55 refactor: improve ContextMenu and Message components layout
- Replaced the div in ContextMenu with a styled component for better styling control.
- Enhanced Message component to handle editing state more cleanly, separating the editor from the message display.
- Adjusted styling for the MessageEditor and FileBlocksContainer for improved layout and responsiveness.
2025-05-21 21:15:39 +08:00
one
a9a0ae87d3 refactor: reuse shiki highlighter utils (#6235)
* refactor: improve shiki highlighter utils and reuse it in ShikiStreamService

* refactor: reuse shiki highlighter and markdown-it renderer

* refactor: import shiki/markdown-it/core dynamically

* chore: update shiki
2025-05-21 19:06:56 +08:00
自由的世界人
d9661602b2 fix: increase the upper limit of issue-management operations-per-run (#6257) 2025-05-21 15:31:28 +08:00
kangfenmao
877a1f8306 chore(version): 1.3.9 2025-05-21 15:14:37 +08:00
kangfenmao
5dd508b4f4 fix: english serif font rendering issue #6224
close #6224
2025-05-21 15:09:10 +08:00
kangfenmao
406bf6a509 fix: topic prompt not working #6226
close #6226
2025-05-21 14:26:24 +08:00
kangfenmao
f0ae2aa6dc chore: remove electron-notification-state dependency and update notification settings
- Removed the electron-notification-state package from dependencies as it is no longer used.
- Updated NotificationService to eliminate Do Not Disturb handling.
- Changed default notification settings in the Redux store to false for assistant messages, backups, and knowledge embedding.
2025-05-21 14:03:24 +08:00
kangfenmao
0884caea97 fix: settings -> openAI -> summaryText undefined 2025-05-21 13:57:59 +08:00
kangfenmao
8e870710b5 fix: message content width will exceed the bubble limit in narrow layout mode 2025-05-21 13:57:39 +08:00
kangfenmao
27a92463bf fix: topic deletion button covering the text 2025-05-21 13:56:47 +08:00
kangfenmao
3298b3f403 refactor: simplify MCP service integration and cleanup logic
- Replaced singleton pattern with direct instantiation of McpService for cleaner code.
- Updated IPC handlers to use the new mcpService instance directly.
- Removed unnecessary logging in Inputbar and MCPToolsButton components to streamline functionality.
- Cleaned up error handling in McpSettings to improve user experience.
2025-05-21 13:10:27 +08:00
kangfenmao
894c20dd05 fix: enhance OpenAI service tier handling and initialize settings during migration
- Updated getServiceTier method to ensure proper handling of undefined OpenAI models.
- Added initialization for OpenAI settings in the migration process to set default values if not present.
2025-05-21 13:02:25 +08:00
kangfenmao
a0945af285 feat: add Google miniapp 2025-05-21 12:46:20 +08:00
kangfenmao
6e12d2fa2e refactor: update MultiSelectionPopup icons and improve styling
- Replaced Ant Design icons with Lucide icons for a more modern look.
- Adjusted ActionButton styling to have a circular border radius.
- Updated translation keys in Chinese locales for better formatting.
- Enhanced event handling in ChatContext to manage multi-select mode more effectively.
- Cleaned up unused imports and props in MessageGroup and MessageSelect components.
2025-05-21 12:18:31 +08:00
SuYao
2798bd9d9d feat/notification (#6144)
* WIP

* feat: integrate notification system using Electron's Notification API

- Replaced the previous notification implementation with Electron's Notification API for better integration.
- Updated notification types and structures to support new features.
- Added translations for notification messages in multiple languages.
- Cleaned up unused dependencies related to notifications.

* refactor: remove unused node-notifier dependency from Electron config

* clean: remove node-notifier from asarUnpack in Electron config

* fix: update notification type in preload script to align with new structure

* feat: Integrate NotificationService for user notifications across various components

- Implemented NotificationService in useUpdateHandler to notify users of available updates.
- Enhanced KnowledgeQueue to send success and error notifications during item processing.
- Updated BackupService to notify users upon successful restoration and backup completion.
- Added error notifications in message handling to improve user feedback on assistant responses.

This update improves user experience by providing timely notifications for important actions and events.

* feat: Refactor notification handling and integrate new notification settings

- Moved SYSTEM_MODELS to a new file for better organization.
- Enhanced notification handling across various components, including BackupService and KnowledgeQueue, to include a source attribute for better context.
- Introduced notification settings in the GeneralSettings component, allowing users to toggle notifications for assistant messages, backups, and knowledge embedding.
- Updated the Redux store to manage notification settings and added migration logic for the new settings structure.
- Improved user feedback by ensuring notifications are sent based on user preferences.

This update enhances the user experience by providing customizable notification options and clearer context for notifications.

* feat: Add 'update' source to NotificationSource type for enhanced notification context

* feat: Integrate electron-notification-state for improved notification handling

- Added electron-notification-state package to manage Do Not Disturb settings.
- Updated NotificationService to respect user DND preferences when sending notifications.
- Adjusted notification settings in various components (BackupService, KnowledgeQueue, useUpdateHandler) to ensure notifications are sent based on user preferences.
- Enhanced user feedback by allowing notifications to be silenced based on DND status.

* feat: Add notification icon to Electron notifications

* fix: import SYSTEM_MODELS in EditModelsPopup for improved model handling

* feat(i18n): add knowledge base notifications in multiple languages

- Added success and error messages for knowledge base operations in English, Japanese, Russian, Chinese (Simplified and Traditional).
- Updated the KnowledgeQueue to utilize the new notification messages for better user feedback.

* feat(notification): introduce NotificationProvider and integrate into App component

- Added NotificationProvider to manage notifications within the application.
- Updated App component to include NotificationProvider, enhancing user feedback through notifications.
- Refactored NotificationQueue to support multiple listeners for notification handling.
2025-05-21 12:11:52 +08:00
自由的世界人
d07c6ecc6b feat: add message multiple select (#6085)
* feat: add message multiple select

* fix: build error

* feat: add drag-and-drop multi-selection

* fix: code review

* Revert "fix: code review"

This reverts commit 7e29d5147c.

* fix: hide input bar display

* fix: extract the ChatContext

* fix: eventemitter

* feat: enhance multi-select functionality with message registration

* fix: history page message search

* fix: build error

* fix: remove Event Emitter

* fix: build error

* feat: add hideMenuBar prop to MessageItem and integrate MessageEditingProvider

* fix: improve message selection logic and handle drag events

* fix: update translation keys for multiple select functionality

* fix: refactor message deletion logic and enhance message selection handling

* fix: replace useSelector with useStore for message selection in ChatContext

* fix: refactor MessageGroup to utilize context for multi-select handling and message registration

* Revert "fix: refactor MessageGroup to utilize context for multi-select handling and message registration"

This reverts commit f4d1454525.

* fix: simplify MessageGroup props and utilize context for message selection handling

* fix: streamline multi-select handling by consolidating context usage and simplifying component props
2025-05-21 11:22:36 +08:00
kangfenmao
57f10bf56f fix: sse mcp 404 not found 2025-05-21 10:50:28 +08:00
one
d4fc5d6503 fix: improve CodeEditor controlled mode, prevent unnecessary trimming (#6221)
* fix: improve CodeEditor controlled mode, prevent unnecessary trimming

* fix: useEffect dependency
2025-05-21 03:51:30 +08:00
one
55c57d72ba fix: handle undefined html title (#6229) 2025-05-20 20:57:14 +08:00
LiuVaayne
c468c3cfd5 Feat/mcp run python (#6151)
* feat: add MCP Run Python server and integrate Pyodide for executing Python code

* fix: comment out unused polyfill imports in MCP Run Python server
2025-05-20 20:47:30 +08:00
beyondkmp
bb3bfafe7e refactor(PasteService): optimize handler registration logic (#6223)
- Updated registerHandler to only log and update the handler if it changes, reducing unnecessary operations.
- Removed logging from unregisterHandler for cleaner code.
2025-05-20 19:12:45 +08:00
kangfenmao
0641857f26 chore(version): 1.3.8 2025-05-20 18:41:41 +08:00
kangfenmao
0d5b9d8d62 feat: implement getFilePath method in FileManager and update KnowledgeContent to use it
- Added getFilePath method in FileManager to construct file paths based on file ID and extension.
- Updated KnowledgeContent to utilize the new getFilePath method for opening file paths, improving code clarity and maintainability.
2025-05-20 18:04:01 +08:00
kangfenmao
09952a4d3b Revert "feat: add resolveFilePath functionality to resolve restoring from different computer (#5980)"
This reverts commit 3abe0e803c.
2025-05-20 17:44:04 +08:00
kangfenmao
e8753e0cf3 refactor: improve FloatingSidebar and HomeTabs components
- Simplified the onOpenChange handler in FloatingSidebar for better readability.
- Added style prop to HomeTabs for enhanced customization.
- Adjusted Container style in HomeTabs to merge with existing border styles.
2025-05-20 17:17:57 +08:00
George Zhao
05dc5da7b0 fix: add context menu trigger to FloatingSidebar component 2025-05-20 17:10:47 +08:00
kangfenmao
12f5d9acfd feat: enhance ContentSearch and MessageTools components
- Added placeholder and adjusted styles for the Input in ContentSearch.
- Updated SearchBarContainer to use fixed positioning and improved padding.
- Refactored MessageTools to render raw content correctly and added a new MarkdownContainer for better styling.
- Minor adjustments to other components for improved layout and user experience.
2025-05-20 15:33:10 +08:00
Zhaker
30885655dd fix: knowledge icon consistency across components (#6209)
feat: knowledge icon consistency across components
2025-05-20 15:07:57 +08:00
karl
49d4ae6e9b fix(mcp): mcp result preview is missing parameters (#6165) 2025-05-20 14:46:21 +08:00
Wei
2d7caf9fc5 feat: add new model provider BurnCloud 2025-05-20 13:55:57 +08:00
fullex
5cf0a43b2c chore: update Hailuo logo (#6208)
* feat: update Hailuo model configuration with new logo property and border option

* chore: update hailuo_dark model image
2025-05-20 13:11:54 +08:00
beyondkmp
98426e084a refactor: centralize paste handling logic with PasteService (#6199)
- Integrated PasteService for handling paste events in Inputbar and MessageEditor components.
- Removed redundant paste handling code and improved maintainability.
- Registered paste handlers and set last focused component for better user experience.
- Ensured consistent behavior for text and file pasting across components.

Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
2025-05-20 13:09:37 +08:00
kangfenmao
52559534c6 chore(version): 1.3.7 2025-05-20 11:33:52 +08:00
kangfenmao
ab5ffe4e2e fix: set default initial values for rendering speed in aihubmixConfig
- Added initialValue 'DEFAULT' for renderingSpeed in multiple mode configurations to ensure consistent default behavior across the application.
2025-05-20 11:31:35 +08:00
jwcrystal
3d8f514f30 feat: add MCP servers via JSON quickly (#6099)
* feat: add MCP servers via JSON quickly

* refactor(MCPSettings): Extract JSON parsing logic into a helper function

* feat: json linter for EditMcpJsonPopup

* feat(mcp): confirm the MCP server status as connection

* refactor(AddMcpServerModal): 移除冗余注释并修复加载状态

* feat(MCPSettings): Add support for SSE and streamableHttp formats and optimize server configuration parsing

- Add server type validation to ensure the type is stdio, SSE, or streamableHttp
- Optimize JSON parsing logic to ensure server configuration completeness and validity
- Update example text to provide more detailed configuration examples

* fix(MCPSettings): fix AddMcpServerModal default baseUrl login

移除serverToAdd.url作为baseUrl的备选值,确保baseUrl仅使用serverToAdd.baseUrl的值

* feat(MCPSettings): support CodeEditor in AddMcpServerModal

* fix: Remove unnecessary type checks for JSON parsing login

* fix(MCPSettings): fix compatibility issues with the URL field when parsing server data

* refactor: remove unnessary cdoe

* chore: Add a server dropdown button to integrate new features in UI

- Integrate the two buttons for adding a server into a single dropdown menu to enhance user experience and simplify the interface

* chroe: modify the Dropdown items' name of addServer

* refactor(i18n): unify the translation for the MCP server import function

---------

Co-authored-by: one <wangan.cs@gmail.com>
2025-05-20 10:41:25 +08:00
kangfenmao
47faa6edf2 fix: update default values and improve component structure
- Changed default value for `getTrayOnClose` to true in `ConfigManager`.
- Removed fullscreen toggle logic from `WindowService`.
- Adjusted styles in `OpenAIAlert` for better spacing.
- Reorganized imports in `Navbar` and updated component paths in `AssistantsTab` and `SettingsTab`.
- Added new components `AssistantItem` and `OpenAISettingsGroup` for better modularity.
- Enhanced `SettingGroup` styles for improved UI consistency.
- Updated `QuickPhraseSettings` to utilize theme context.
- Minor fixes and refactoring across various services and components.
2025-05-20 00:20:02 +08:00
suyao
a95ace3dc5 fix: update file path resolution in new Electron 2025-05-19 23:02:14 +08:00
kangfenmao
582427663f docs: update branching strategy documentation and add English and Chinese versions
- Updated the README to link to the new English branching strategy document.
- Added a new English version of the branching strategy document.
- Removed the outdated branching strategy document.
- Added a Chinese version of the branching strategy document.
2025-05-19 22:25:46 +08:00
beyondkmp
3abe0e803c feat: add resolveFilePath functionality to resolve restoring from different computer (#5980)
* feat: add resolveFilePath functionality to file management

* Added new IPC channel for resolving file paths.
* Implemented resolveFilePath method in FileStorage service.
* Updated FileManager to utilize the new resolveFilePath method.
* Enhanced preload API to expose resolveFilePath to the renderer.
* Updated KnowledgeService to ensure file paths are correctly resolved in knowledge bases.

* refactor: remove unused path import from preload index

* Removed the unused 'resolve' import to clean up the codebase.
* Improved code readability by eliminating unnecessary dependencies.

---------

Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
2025-05-19 21:58:44 +08:00
kangfenmao
94b602b250 refactor: remove constructor from KnowledgeQueue and invoke checkAllBases in useAppInit hook 2025-05-19 21:28:25 +08:00
kangfenmao
d42bf89045 Merge branch 'develop' 2025-05-19 21:23:17 +08:00
jwcrystal
75f25d8a44 feat: support default Quick Assistant model (#6150)
* feat: support default Quick Assistant model

- support the configuration of the quick assistant model.
- manage the models independently in Quick Assistant and Default Assistant.

* docs(i18n): Add translation for quick assistant model

* fix(llm): fix the default value of quickAssistantModel to silicon[1]

* refactor(i18n): uniformly the terms, changing "快速助手" to "快捷助手"
2025-05-19 20:49:13 +08:00
SuYao
ae163ff0ed hotfix: add OpenAI settings tab and related functionality (#6040)
* feat: add OpenAI settings tab and related functionality

* fix: update related logic to support flexible service layer.

* fix(OpenAIResponseProvider): remove unused isOpenAILLMModel import
2025-05-19 20:18:16 +08:00
SuYao
cc4008bf2b feat(settings): add OpenAI alert (#6164) 2025-05-19 20:06:54 +08:00
one
e9dc0d12d6 hotfix: respect user-defined model group name (#6174) 2025-05-19 18:40:01 +08:00
SuYao
00f1fb1e11 Hotfix/gemini-para-bug (#6173)
* fix(OpenAIProvider): enhance model support and formatting logic

* fix(OpenAIProvider): Gemini OpenAI Compatible
2025-05-19 17:34:35 +08:00
beyondkmp
db01b4981d feat: add zoom factor handling on window restore in WindowService (#6169)
Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
2025-05-19 17:14:55 +08:00
SuYao
6036a94690 hotfix: enhance reasoning summary handling in OpenAI response processing (#6037) 2025-05-19 17:07:35 +08:00
jwcrystal
0c32ac1262 refactor(Scrollbar): Optimize scroll handling logic to support external scroll events (#6047)
* refactor(Scrollbar): Optimize scroll handling logic to support external scroll events

- Refactor `onScroll` logic to support external scroll events
- Integrate with `useScrollPosition` hook for better scroll state management
- Memorize the scoll state for better user experience
- Fix type definition for `ref` attribute
- Remove unnecessary `ref` type overrides
- Improve component compatibility and maintainability

* perf(useScrollPosition): Optimize scroll position updates using requestAnimationFrame

- Wrap the `window.keyv.set` call in `requestAnimationFrame` to reduce unnecessary performance overhead and improve responsiveness during scrolling.

* fix(Messages): Remove unused FC imports and add onComponentUpdate and onFirstUpdate properties
2025-05-19 16:33:06 +08:00
Morax
e3f5999362 feat: Add-aihubmix-ideogram-v3 (#5958)
* chore: update Yarn version to 4.9.1 and add rendering speed option for V3 model

* Discard changes to .yarnrc.yml

* Discard changes to .yarn/releases/yarn-4.6.0.cjs

* Update package.json

* Delete .yarn/releases/yarn-4.9.1.cjs

* Discard changes to .yarn/releases/yarn-4.6.0.cjs

* docs: Update README.zh.md add GitCode✖️Cherry Studio【新源力】贡献挑战赛

GitCode✖️Cherry Studio【新源力】贡献挑战赛

* fix: Update the file permissions for yarn-4.6.0.cjs, modify image links and formatting in README.zh.md

* clean

* refactor: improve switch case blocks and update config parameters in AihubmixPage

* feat: add error handling for empty image URLs and update localization messages

* refactor: replace modal error handling with warning messages for empty image URLs

* feat: update localization for rendering speed and translating messages in Japanese, Russian, and Traditional Chinese

* feat: add style types and rendering speed options to localization files

---------

Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
Co-authored-by: suyao <sy20010504@gmail.com>
2025-05-19 16:30:07 +08:00
SuYao
f20b8c58ee refactor: implement message editing and resend functionality (#5901)
* feat: implement message editing and resend functionality with block management

* fix: move start_time_millsec initialization to onChunk for accurate timing

* feat: refactor message update thunks to separate block addition and updates

* feat: enhance MessageBlockEditor with toolbar buttons and attachment functionality

* refactor: implement message editing context and integrate with message operations

* style: adjust padding in MessageBlockEditor and related components

* refactor: remove MessageEditingContext and integrate editing logic directly in Message component

* refactor: streamline message rendering logic by using conditional rendering for MessageEditor and MessageContent

* refactor: remove redundant ipcRenderer variable in useMCPServers hook

* fix: Add mock for electron's ipcRenderer to support testing

* test: Update mocks for ipcRenderer and remove redundant window.electron mock

* fix: enhance file handling in MessageEditor with new Electron API

- Added support for file dragging with visual feedback.
- Improved file type validation during drag-and-drop and clipboard pasting.
- Displayed user notifications for unsupported file types.
- Refactored file handling logic for better clarity and maintainability.
2025-05-19 15:38:00 +08:00
MyPrototypeWhat
553e3d7989 refactor(messageThunk): optimize message update logic with atomic modifications
* Wrapped message and block updates in a database transaction for improved consistency.
* Replaced direct updates with atomic modifications using where().modify() for better performance and clarity.
* Enhanced error handling for message updates to ensure robustness.
2025-05-19 13:48:47 +08:00
suyao
b1e0b56783 fix: update token limits for Claude models 2025-05-19 13:47:51 +08:00
LiuVaayne
6356e1c0c2 refactor: improve sanitization and formatting in buildFunctionCallToo… (#6152)
refactor: improve sanitization and formatting in buildFunctionCallToolName function
2025-05-19 11:20:38 +08:00
George Zhao
362fdc069e feat: add FloatingSidebar component and integrate assistant switching… (#5852)
* feat: add FloatingSidebar component and integrate assistant switching functionality

* refactor: simplify FloatingSidebar by removing unused hooks and components

* refactor: remove unused AddAssistantPopup and related code from FloatingSidebar

* feat: implement sidebar hide cooldown and adjust tooltip delays in Navbar.

* feat: integrate HomeTabs into FloatingSidebar and update Navbar props

* refactor: remove commented-out code and unused components from FloatingSidebar

* fix: update Popover placement from rightTop to bottomRight in FloatingSidebar.

* feat: add forceToSeeAllTab prop to HomeTabs for improved tab visibility control

* fix: update HomeTabs logic to respect forceToSeeAllTab prop for tab selection

* feat: pass position prop to FloatingSidebar and HomeTabs for consistent layout control

* feat: integrate FloatingSidebar into Navbar for improved topic visibility and update HomeTabs logic for consistent tab rendering

* fix: remove unused showTopics from Navbar component

* feat: enhance topic visibility control in Navbar with cooldown logic for sidebar toggle

* fix: add onMouseOut handler to NavbarIcon for sidebar cooldown reset

---------

Co-authored-by: George Zhao <georgezhao@SKJLAB>
2025-05-19 11:05:15 +08:00
kangfenmao
ee67f7bf9b fix: update min token limit for qwen3 models in THINKING_TOKEN_MAP 2025-05-19 10:49:33 +08:00
kangfenmao
5cee35b167 Merge branch 'main' into develop 2025-05-19 10:12:15 +08:00
one
cd02ee3125 refactor: transparent border for code blocks 2025-05-19 08:36:09 +08:00
fullex
7dac8cee64 refactor: simplify font family handling and improve layout styles in MessageTools and ThinkingBlock components 2025-05-19 08:32:37 +08:00
SuYao
5d3b751aa0 fix: 多发消息时除fold布局以外的其他布局不能被渲染 (#6143) 2025-05-19 01:43:21 +08:00
SuYao
0707be1e1f Revert "feat: add MCP Run Python server and integrate Pyodide for exe… (#6141)
Revert "feat: add MCP Run Python server and integrate Pyodide for executing P… (#5793)"

This reverts commit 086b09d99a.
2025-05-19 00:54:32 +08:00
kangfenmao
5e1c45370b chore(version): 1.3.6 2025-05-18 23:57:53 +08:00
kangfenmao
d4abea4101 refactor(SyntaxHighlighter): modularize highlighter logic and improve theme/language loading
* Moved highlighter initialization and loading functions to a new utility file for better organization.
* Simplified theme and language loading in the SyntaxHighlighterProvider using the new utility functions.
* Removed redundant code and improved readability in MessageTools by introducing a new CollapsedContent component for rendering tool responses.
* Updated MCPDescription to use an async function for Shiki instance initialization.
2025-05-18 23:33:43 +08:00
kangfenmao
08e7b6a7ba feat(electron.vite.config): add manual chunking for vendor modules in output configuration 2025-05-18 23:33:43 +08:00
LiuVaayne
086b09d99a feat: add MCP Run Python server and integrate Pyodide for executing P… (#5793)
feat: add MCP Run Python server and integrate Pyodide for executing Python code
2025-05-18 23:31:05 +08:00
LiuVaayne
1475f75a35 feat: add buildFunctionCallToolName utility for generating tool names (#6136) 2025-05-18 23:05:44 +08:00
jwcrystal
b1babc8cb3 hotfix(i18n): Add multi-language support for network search settings (#6138) 2025-05-18 22:44:57 +08:00
Rudbeckia.hirta.L
537ada3256 fix: Search results are on the right side (#6133) 2025-05-18 22:21:13 +08:00
kangfenmao
bdbb937403 refactor: update spinner handling and improve initialization timing
* Modified the Content Security Policy to include 'unsafe-inline' for script-src.
* Changed the spinner display style from 'none' to 'flex' for better visibility.
* Removed the initSpinner function and directly initialized the spinner in useAppInit.
* Added console timing for initialization to track performance.
2025-05-18 22:05:35 +08:00
kangfenmao
8bfbbd497c refactor: streamline MCP service handling and improve IPC registration
* Refactored MCPService to implement a singleton pattern for better instance management.
* Updated IPC registration to utilize the new getMcpInstance method for handling MCP-related requests.
* Removed redundant IPC handlers from the main index file and centralized them in the ipc module.
* Added background throttling option in WindowService configuration to enhance performance.
* Introduced delays in MCPToolsButton to optimize resource and prompt fetching after initial load.
2025-05-18 22:04:56 +08:00
自由的世界人
4b2417ce37 hotfix: github models check error (#6128) 2025-05-18 20:23:29 +08:00
自由的世界人
68689692b0 hotfix: github models check error (#6128) 2025-05-18 20:16:33 +08:00
kangfenmao
03fa6b5a74 fix(WindowService): handle fullscreen toggle before hiding window 2025-05-18 19:43:47 +08:00
George Zhao
2202b82f33 fix: remove infinite token display for max count and simplify context count rendering. (#6103)
Co-authored-by: George Zhao <georgezhao@SKJLAB>
2025-05-18 18:37:08 +08:00
MyPrototypeWhat
fed855a4ae refactor(MessageGroup): optimize selected message handling with useMe… (#6124)
* refactor(MessageGroup): optimize selected message handling with useMemo and clean up unused code

* refactor(MainTextBlock): optimize citation handling with useMemo and improve code clarity

* fix:del console
2025-05-18 18:08:13 +08:00
SuYao
22ee6f042f Hotfix/rich text paste (#6122)
fix(Inputbar): 优化粘贴处理逻辑,优先处理文本粘贴
2025-05-18 17:16:05 +08:00
Konjac-XZ
114d4850b1 fix: Summary for single message export doesn't work. 2025-05-18 15:11:30 +08:00
purefkh
711888a897 fix: Prevent sending message during input method composition in mini window (#6104) 2025-05-18 15:09:56 +08:00
kangfenmao
f43c16b85f fix(WindowService): add backgroundThrottling option to Electron configuration 2025-05-18 14:41:10 +08:00
purefkh
2f47250748 fix(i18n): websearch has no translation (#6118) 2025-05-18 12:44:06 +08:00
kangfenmao
653f1d54d2 chore: update dependencies in yarn.lock
- Removed outdated dependencies including "@babel/plugin-syntax-jsx" and "@bcoe/v8-coverage".
- Added new dependencies such as "@sec-ant/readable-stream", "browserslist", and "cacheable-request".
- Updated versions for existing packages including "got", "ow", and "type-fest".
- Ensured compatibility with the latest versions of peer dependencies.
2025-05-18 11:58:02 +08:00
kangfenmao
f0e43e9bcd refactor: streamline SettingsTab layout and remove unnecessary Divider components 2025-05-18 11:50:26 +08:00
Konjac-XZ
7706a4cc36 fix: Summary for single message export doesn't work. 2025-05-18 10:21:45 +08:00
自由的世界人
bd65e7bac4 feat: make sidebar setting group collapsible (#6019)
* feat: code tools, editor, executor

CodeEditor & Preview
- CodeEditor: CodeMirror 6
  - Switch to CodeEditor in the settings
  - Support edit&save with a accurate diff&lookup strategy
  - Use CodeEditor for editing MCP json configuration
- CodePreview: Original Shiki syntax highlighting
  - Implemented using a custom Shiki stream tokenizer
  - Remov code caching as it is incompatible with the current streaming code highlighting
  - Add a webworker for shiki
- Other preview components
  - Merge MermaidPopup and Mermaid to MermaidPreview, use local mermaidjs
  - Show mermaid syntax error message on demand
  - Rename PlantUML to PlantUmlPreview
- Rename SyntaxHighlighterProvider to CodeStyleProvider for clarity
- Both light and dark themes are preserved for convenience

CodeToolbar
- Top sticky toolbar provides quick tools (left) and core tools (right)
- Quick tools are hidden under the `More` button to avoid clutter, while core tools are always visible
- View&edit mode
  - Allow switching between preview and edit modes
  - Add a split view

Code execution
- Pyodide for executing Python scripts
- Add a webworker for Pyodide

* fix: migrate version and lint error

* refactor: use constants for defining tool specs

* feat: make setting group collapsible

* fix: yarn.lock

* fix: conflict error

---------

Co-authored-by: one <wangan.cs@gmail.com>
2025-05-18 10:11:14 +08:00
one
f6a496d1b9 refactor: clean up code for MessageGroupModelList (#6084)
* refactor: clean up comments and useless z-index

* refactor: remove useless styles, restore segment animation, extract renderLabel

* refactor: add left margin to the toggle button

* revert: font size
2025-05-18 10:05:19 +08:00
eeee0717
ba88a24455 fix(knowledge): remove topN 2025-05-18 10:02:05 +08:00
MyPrototypeWhat
42f5485899 fix: group message resend (#6106) 2025-05-18 09:52:27 +08:00
MyPrototypeWhat
e51a37cc74 fix: group message resend (#6106) 2025-05-17 23:53:57 +08:00
kangfenmao
5a7423463f Merge branch 'main' into develop 2025-05-17 21:41:38 +08:00
fullex
928a597d38 chore: remove unused packages (#5948)
* chore: update @cherrystudio/embedjs packages to version 0.1.29 and update sass to version 1.88.0; remove deprecated dependencies from package.json and yarn.lock

* chore: add node-stream-zip and update devDependencies in package.json and yarn.lock

* chore: reorganize and update @cherrystudio/embedjs dependencies in package.json

* chore: add zipread dependency to package.json and update yarn.lock

* chore: add @strongtz/win32-arm64-msvc dependency to package.json and update yarn.lock
2025-05-17 21:36:06 +08:00
purefkh
86a58ea050 fix: Prevent sending message during input method composition in mini window (#6104) 2025-05-17 21:34:17 +08:00
fullex
71ae6f2713 fix: font-family changed in Windows with new Electron (#6079) 2025-05-17 21:27:29 +08:00
icinggslits
dbc6014506 feat: Highlighted search in chat page (#3302)
* feat: Highlighted search in chat page

* Bug fixes and added a temporary F3 shortcut

* Bug fixes

* Bug fixes

* feat: Implement content search functionality with keyboard shortcuts

- Added a new `ContentSearch` component for searching text within a specified target.
- Integrated search functionality with keyboard shortcuts, allowing users to enable search via a new shortcut key.
- Updated internationalization files to include new search-related messages in multiple languages.
- Enhanced shortcut management to accommodate the new search feature, including a migration for shortcut updates.
- Refactored the `Chat` component to utilize the new content search capabilities.

* fix(ContentSearch): Update search index check and enhance container styling

* feat(ContentSearch): Enhance search functionality with case sensitivity and whole word options

- Added options for case sensitivity and whole word matching in the search feature.
- Updated the highlightText function to accommodate new search parameters.
- Improved styling and layout of the search input and buttons for better user experience.
- Refactored related components to support the new search options.

* refactor(useShortcuts): Remove console log for shortcut invocation

* feat: Add user filter and initial text to search

- Improve ContentSearch UI:
  - Add tooltips for search options
  - Enhance result display (e.g., "No results", "0/0")
  - Disable navigation buttons when no matches
  - Relocate search bar to the top of the chat view
- Apply case-sensitivity logic only to Latin characters
- Add translations for new options

* i18n: Translate "No results" message

* Add in-chat search shortcut, update global search to Cmd/Ctrl+Shift+F.

* feat: Allow users to scroll during input and optimize the search result index update logic

* feat: Update search message shortcut to include Shift for improved accessibility

* feat: Refactor search component layout and update highlight color variables

* fix: Adjust margin-bottom for SearchBarContainer

---------

Co-authored-by: suyao <sy20010504@gmail.com>
2025-05-17 21:14:03 +08:00
kangfenmao
6bbfa287e4 chore(version): 1.3.5 2025-05-17 20:05:16 +08:00
kangfenmao
b2ceea2483 fix: electron-store config.json missing
* Added 'electron-store' to the Vite configuration for Electron.
* Imported configuration from '@main/config' in the main index file.
* Changed default return value for getTrayOnClose method in ConfigManager to false
2025-05-17 19:58:38 +08:00
SuiYunsy
f7b5bd8d22 拓宽”请选择要检测的模型“模态框 (#6062)
许多模型名称很长,目前模态框太短,无法完全显示
2025-05-17 19:57:46 +08:00
kangfenmao
727a84e5ca fix: adjust visibility timer and trigger area dimensions in ChatNavigation
* Reduced the button visibility timer from 1500ms to 500ms for quicker feedback.
* Decreased the trigger width from 80 to 60 for improved interaction.
* Updated the height calculation from 40% to 30% of the window height for better layout consistency.
2025-05-17 19:57:09 +08:00
kangfenmao
d0a368d9ef refactor: remove deprecated max token settings from OpenAIProvider and OpenAIResponseProvider 2025-05-17 19:57:09 +08:00
George Zhao
d7139cca02 feat: implement useFullscreen hook and integrate with NavbarRight for dynamic padding (#6000)
* feat: implement useFullscreen hook and integrate with NavbarRight for dynamic padding

* feat: integrate useFullscreen hook to adjust sidebar layout based on fullscreen state

* fix: adjust sidebar height based on fullscreen state for better layout

---------

Co-authored-by: George Zhao <georgezhao@SKJLAB>
2025-05-17 19:48:40 +08:00
Rudbeckia.hirta.L
e9ab193a24 feat: support skipping files during backup(slim backup) (#6075)
* feat: support skipping files during backup

* 修复 lint

* 修复 lint

---------

Co-authored-by: daisai.1 <daisai.1@bytedance.com>
2025-05-17 19:20:40 +08:00
George Zhao
548db37066 fix: Ensure last app is displayed when no filtered apps are found (#6090)
* fix: Ensure last app is displayed when no filtered apps are found

* fix: Remove Empty component from AppsPage when no apps are found

---------

Co-authored-by: George Zhao <georgezhao@SKJLAB>
2025-05-17 17:27:45 +08:00
one
ece9e2ef13 chore: reduce package size (#6092) 2025-05-17 17:07:30 +08:00
Steven Ding
2894eec438 fix: change minimax's URL (#6091)
Signed-off-by: stevending1st <stevending1st@163.com>
2025-05-17 15:55:36 +08:00
beyondkmp
c2465c33b7 feat: Drop file improvements (#6089)
* feat: enhance file drag-and-drop functionality and global paste handling in Inputbar

- Added support for file dragging with visual feedback.
- Implemented global paste event handling to allow pasting outside the text area.
- Improved file drop handling to notify users of unsupported file types.

* refactor(Inputbar): simplify global paste handling logic

- Removed unnecessary checks for active element in global paste event handling.
- Streamlined the paste event processing for improved clarity and maintainability.

* style(Inputbar): clean up comments and maintain visual feedback for file dragging

- Removed unnecessary comments related to the styling of the file dragging state.
- Ensured the visual feedback for file dragging remains intact with updated background color.
2025-05-17 09:35:25 +08:00
kangfenmao
3c2e8e2f1d fix: electron-store config.json missing
* Added 'electron-store' to the Vite configuration for Electron.
* Imported configuration from '@main/config' in the main index file.
* Changed default return value for getTrayOnClose method in ConfigManager to false
2025-05-17 08:46:26 +08:00
1600822305
f84358adfd fix: Update file API usage for Electron 35.2.2 and add translations f… (#6087)
* Fix: Update file API usage for Electron 35.2.2 and add translations for file error messages

* 修复Electron 35.2.2中的文件API问题
2025-05-17 08:09:30 +08:00
one
51071d65fb refactor(CodeEditor): add more options to props for better customization, fix auto theme (#6071)
* refactor(CodeEditor): add more options to props for better customization

- A complete BasicSetupOptions could be passed in to override system-wise options
- EditMcpJsonPopup now use customized options

* fix: accommodate ThemeMode.auto

* fix: typos
2025-05-17 01:32:54 +08:00
方程
ba30bffa49 Gitee AI:update name, update models (#6006)
* Gitee AI:update name, update models

* Gitee AI:update name, update models

---------

Co-authored-by: 方程 <fangcheng@oschina.cn>
2025-05-17 00:47:42 +08:00
SuYao
5701b09c23 Hotfix/gemini openrouter (#6080)
feat: 添加对openai兼容情况下Gemini模型的思考配置支持
2025-05-17 00:45:26 +08:00
自由的世界人
c66563d335 feat: add citation list right-click copy (#6066)
* feat: add citation list right-click copy

* fix: extract the right-click menu as a component
2025-05-17 00:22:09 +08:00
SuiYunsy
c7b0b5ce53 拓宽”请选择要检测的模型“模态框 (#6062)
许多模型名称很长,目前模态框太短,无法完全显示
2025-05-16 23:40:22 +08:00
SuYao
883bffd2db fix: Update the state of the last message block as a fallback (#6076) 2025-05-16 22:21:05 +08:00
MyPrototypeWhat
2fca383e1e Hotfix/thinking time render (#6073)
refactor: simplify ThinkingBlock component and extract thinking time logic

* Removed unnecessary state and interval management from ThinkingBlock.
* Introduced ThinkingTimeSeconds component to handle thinking time display and logic.
* Cleaned up code for better readability and maintainability.
2025-05-16 21:56:40 +08:00
SuYao
523d6de257 hotfix: openai websearch render and gemini think (#6055) 2025-05-16 20:42:59 +08:00
SuiYunsy
89f31ddd94 fix: 禁止“自定义CSS”输入框的拼写检查 (#6064) 2025-05-16 19:23:43 +08:00
亢奋猫
273fabafcb docs: Update README.zh.md add GitCode✖️Cherry Studio【新源力】贡献挑战赛
GitCode✖️Cherry Studio【新源力】贡献挑战赛
2025-05-16 17:25:21 +08:00
karl
c088378d7e fix: mcp params error(issues/6050) (#6058) 2025-05-16 16:50:10 +08:00
kangfenmao
6f5f917c98 fix: adjust visibility timer and trigger area dimensions in ChatNavigation
* Reduced the button visibility timer from 1500ms to 500ms for quicker feedback.
* Decreased the trigger width from 80 to 60 for improved interaction.
* Updated the height calculation from 40% to 30% of the window height for better layout consistency.
2025-05-16 14:46:22 +08:00
kangfenmao
4ad3e44769 refactor: remove deprecated max token settings from OpenAIProvider and OpenAIResponseProvider 2025-05-16 14:36:40 +08:00
one
2dedd95fcc feat: code tools, editor, executor (#4632)
* feat: code tools, editor, executor

CodeEditor & Preview
- CodeEditor: CodeMirror 6
  - Switch to CodeEditor in the settings
  - Support edit&save with a accurate diff&lookup strategy
  - Use CodeEditor for editing MCP json configuration
- CodePreview: Original Shiki syntax highlighting
  - Implemented using a custom Shiki stream tokenizer
  - Remov code caching as it is incompatible with the current streaming code highlighting
  - Add a webworker for shiki
- Other preview components
  - Merge MermaidPopup and Mermaid to MermaidPreview, use local mermaidjs
  - Show mermaid syntax error message on demand
  - Rename PlantUML to PlantUmlPreview
- Rename SyntaxHighlighterProvider to CodeStyleProvider for clarity
- Both light and dark themes are preserved for convenience

CodeToolbar
- Top sticky toolbar provides quick tools (left) and core tools (right)
- Quick tools are hidden under the `More` button to avoid clutter, while core tools are always visible
- View&edit mode
  - Allow switching between preview and edit modes
  - Add a split view

Code execution
- Pyodide for executing Python scripts
- Add a webworker for Pyodide

* fix: migrate version and lint error

* refactor: use constants for defining tool specs

* refactor: add user-select, fix tool specs

* refactor: simplify some state changing

* fix: make sure editor tools registered after the editor is ready

---------

Co-authored-by: 自由的世界人 <3196812536@qq.com>
2025-05-16 13:53:44 +08:00
beyondkmp
c6b87b307b feat: upgrade electron to 35.2.2 (#5151)
* upgrade electron to 35.2.0

* update electron to 32.3.3

* udpate electron-vite to 3.0.0

* upgrade to 35.2.2

* patch https://github.com/electron-userland/electron-builder/pull/9046

* add minimumSystemVersion config

* update electron vite

---------

Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
2025-05-16 12:56:52 +08:00
tiankuo.zhou
e6e0000328 fix: update mcp sdk version to solve the bug-preserve custom paths in SSE endpoint URLs (#6021)
* fix: update mcp sdk to slove the bug - preserve custom paths in SSE endpoint URLs

* add signoff

Signed-off-by: tiankuo.zhou <tiankuo.zhou@lofty.com>

* add signoff

Signed-off-by: tiankuo.zhou <tiankuo.zhou@lofty.com>

---------

Signed-off-by: tiankuo.zhou <tiankuo.zhou@lofty.com>
Co-authored-by: tiankuo.zhou <tiankuo.zhou@lofty.com>
2025-05-16 10:13:53 +08:00
kangfenmao
29d0e60136 chore(version): 1.3.4 2025-05-16 10:12:26 +08:00
kangfenmao
2211b23e0e Merge branch 'develop' 2025-05-16 10:11:57 +08:00
kangfenmao
51d2e03740 style: adjust padding and layout in various components
* Updated padding in CustomCollapse for improved spacing.
* Modified Messages component to conditionally apply padding based on prompt visibility.
* Enhanced ModelListSearchBar by adding a flex display style for better alignment.
* Increased gap in ProviderSetting's HStack for improved layout consistency.
2025-05-15 23:00:43 +08:00
Song
e9d6b9f441 fix: fix portable dir setup time (#6022) 2025-05-15 23:00:43 +08:00
kangfenmao
f18c81b7b8 refactor: add tool use mode translations and refactor settings
* Introduced new translations for "Tool Use Mode" and its options ("Function" and "Prompt") in English, Japanese, Russian, Simplified Chinese, and Traditional Chinese.
* Refactored settings components to replace the deprecated `enableToolUse` with `toolUseMode`, updating related logic and UI elements accordingly.
* Adjusted migration logic to ensure backward compatibility with previous settings.
2025-05-15 23:00:43 +08:00
kangfenmao
18a24b2b4f i18n: update max tokens settings translations for multiple languages
* Changed the wording for max tokens settings in English, Japanese, Russian, Simplified Chinese, and Traditional Chinese to improve clarity.
* Adjusted confirmation messages to better reflect the functionality of setting maximum token limits.
2025-05-15 23:00:43 +08:00
kangfenmao
fd76989c7e refactor: remove extended context settings and related logic
* Removed EXTENDED_CONTEXT_LIMIT and EXTENDED_CONTEXT_STEP constants from the configuration.
* Eliminated enableMaxContexts state and associated logic from settings components.
* Updated contextCount handling to accommodate a maximum of 100, with a special case for 100 to represent an unlimited context.
* Cleaned up related translations for max contexts in multiple languages.
2025-05-15 23:00:43 +08:00
fullex
1577dbefae feat: implement global error handling for uncaught exceptions and unhandled rejections in production mode 2025-05-15 22:54:04 +08:00
MyPrototypeWhat
1e40bd013d fix: remove undici dependency and clean up ProxyManager code (#6020) 2025-05-15 22:09:53 +08:00
Song
b48c6525ca fix: fix portable dir setup time (#6022) 2025-05-15 22:07:10 +08:00
kangfenmao
0d7f965e29 Merge branch 'main' into develop
# Conflicts:
#	yarn.lock
2025-05-15 20:24:00 +08:00
kangfenmao
385a6793f5 chore: remove artifacts and database packages
* Deleted the @cherry-studio/artifacts package including its README, package.json, and associated CSS files.
* Removed the @cherry-studio/database package along with its README, package.json, and source files for data handling.
* Cleaned up related yarn.lock files and installation states for both packages.
2025-05-15 20:21:43 +08:00
kangfenmao
e430731d02 chore(version): 1.3.3 2025-05-15 19:50:21 +08:00
Konv Suu
cc092e7222 fix: strange corner style in miniapp pop up (#5976)
* fix: strange corner style in miniapp pop up
2025-05-15 19:46:19 +08:00
MyPrototypeWhat
84251c0324 refactor: update ImageBlockGroup layout to use CSS grid for better re… (#5998)
refactor: update ImageBlockGroup layout to use CSS grid for better responsiveness
2025-05-15 19:46:15 +08:00
SuYao
9b3b71b6d8 fix: enhance image block handling in message processing (#5971) 2025-05-15 19:45:09 +08:00
SuYao
f67a0c330d fix: timing measurement before sending request (#5970) 2025-05-15 19:44:18 +08:00
Chen Tao
59438eac9d fix: remove dimensions(except voyage) (#6015)
* fix: remove dimensions(except voyage)

* fix: #6016
2025-05-15 18:05:29 +08:00
SuYao
873d3b22bd fix: update geminiapi check (#6002) 2025-05-15 17:51:08 +08:00
Lao
c3cf66fd52 fix: Update Server McpSettings (#6018)
fix:初始化一个新的MCP Server时,没有防止用户多次点击启用开关
2025-05-15 17:50:52 +08:00
one
7332763d9f fix: update current topic id and support EmojiAvatar for ChatFlowHistory (#5861)
* fix: update current topic id for ChatFlowHistory to work

* refactor: set current topic id early in loadTopicMessagesThunk

* refactor: extract EmojiAvatar

* fix: style
2025-05-15 01:42:18 +08:00
MyPrototypeWhat
928530c6f6 refactor: update ImageBlockGroup layout to use CSS grid for better re… (#5998)
refactor: update ImageBlockGroup layout to use CSS grid for better responsiveness
2025-05-14 23:44:48 +08:00
Konv Suu
33b28d783a fix: strange corner style in miniapp pop up (#5976)
* fix: strange corner style in miniapp pop up
2025-05-14 23:38:19 +08:00
George Zhao
15e3bdf20d feat: add support for allowing Escape key to exit fullscreen mode (#5930)
* feat: add support for allowing Escape key to exit fullscreen mode

* feat(i18n): add translation for allowing ESC key to exit fullscreen mode in multiple locales

* feat: enable Escape key to exit fullscreen mode regardless of platform

* feat: 添加允许使用Escape键退出全屏模式的功能,并更新相关国际化支持

* fix: 修复全屏模式下Escape键退出功能的状态管理,移除相关设置项

* feat: 添加全屏状态管理功能至导航栏,更新右侧导航栏组件以支持全屏模式

* feat: 更新导航栏以支持全屏模式,调整右侧导航栏的内边距

* fix: 更新全屏模式下Escape键退出功能的默认设置为启用

* refactor: 移除全屏模式下Escape键退出功能的状态管理逻辑

* fix: 移除全屏模式下Escape键退出功能的调试日志

* feat: 添加全屏模式下Escape键的快捷键配置,默认启用

* refactor: 移除与全屏模式下Escape键退出功能相关的IPC通道和配置

* refactor: 移除全屏模式下Escape键退出功能的配置项

* refactor: 移除Navbar和McpSettingsNavbar中与全屏模式相关的代码

* refactor: 移动exit_fullscreen快捷键配置到shortcuts数组末尾

* refactor: 添加全屏模式下快捷键未设置时直接退出全屏的逻辑

* refactor: 添加全屏模式下快捷键未设置时直接退出全屏的逻辑

* refactor: remove unused useFullscreen hook

* refactor: remove 'allow ESC key to exit fullscreen mode' translations from multiple locale files

---------

Co-authored-by: George Zhao <georgezhao@SKJLAB>
2025-05-14 23:35:02 +08:00
SuYao
85f2f454c4 fix: inaccurate temperature param (#5973)
* fix: inaccurate temperature param

* fix: enhance model support check for reasoning and web search models
2025-05-14 22:08:04 +08:00
kangfenmao
fb548ca20a fix: ensure topic is created if not found in loadTopicMessagesThunk
* Added logic to create a new topic with an empty messages array if the specified topic does not exist in the database.
2025-05-14 21:53:28 +08:00
George Zhao
1bc6571d7d docs: 贡献者数据源 (#5992)
更新贡献者数据源。
2025-05-14 21:40:47 +08:00
SuYao
3792ee3073 fix: enhance image block handling in message processing (#5971) 2025-05-14 20:55:03 +08:00
SuYao
88e472975a fix: timing measurement before sending request (#5970) 2025-05-14 20:53:08 +08:00
George Zhao
c004e06823 fix: use EXTENDED_CONTEXT_STEP for slider step value in settings (#5989)
Co-authored-by: George Zhao <georgezhao@SKJLAB>
2025-05-14 20:08:47 +08:00
George Zhao
3766fe4833 feat: 更长上下文 (#5963)
* feat: Extended the fillable context length to 100. #5514

Update src/renderer/src/pages/home/Tabs/SettingsTab.tsx

fix: update context length settings and localization for multiple languages

* fix: adjust context count slider limits and behavior based on max contexts setting

* feat: implement event handling for max contexts changes in settings

* feat: update context count handling to use EXTENDED_CONTEXT_LIMIT in settings

* feat: update context count logic to use EXTENDED_CONTEXT_LIMIT when max contexts are enabled

* refactor: remove unused EXTENDED_CONTEXT_LIMIT import from AssistantService

* feat: simplify context count logic with validAndChangeContextCount function

* feat: 移除TokenCount组件中对最大计数为20的特殊处理,简化上下文计数显示逻辑

* refactor: simplify getContextCount logic by removing max context handling

* feat: adjust step value for context count input based on max contexts setting

---------

Co-authored-by: George Zhao <georgezhao@SKJLAB>
2025-05-14 19:37:37 +08:00
Konv Suu
484e63b47e fix: define line-clamp for compatibility (#5983) 2025-05-14 18:57:02 +08:00
Lao
cb611d2671 fix lint errors (#5987)
* Fix code snippets that don't comply with code standards by applying lint rules

* update package.json:add test:lint script
2025-05-14 17:01:33 +08:00
SuYao
b6c29e6598 fix: append topic prompt if exists (#5969) 2025-05-14 13:52:31 +08:00
SuYao
03a4f4199a fix: improve citation deduplication logic for non-knowledge citations (#5981) 2025-05-14 13:51:25 +08:00
one
8bc8a9fc99 fix: quickpanel auto-scroll behaviour (#5950)
* fix: quickpanel scrollto changed to smart

* fix: add scrollTrigger as the replacement for scrollBlock

* fix: add a 'none' trigger to prevent accidental scrolling
2025-05-14 00:52:25 +08:00
自由的世界人
e7c0bbb348 feat: add citation content copy button (#5966)
* feat: add citation content copy button

* fix: build error
2025-05-14 00:13:00 +08:00
上房揭瓦
71cd2def2e 添加智能体订阅功能 (#5954)
* 添加智能体订阅功能

* 修改图标

* 修改hook点

修改图标

* 优雅的引用图标

* feat(i18n): add settings title for agents in multiple languages

* fix(i18n): update translations for improved clarity

* Merge branch 'main' into Subscribe

---------

Co-authored-by: VM 96 <eov@88.com>
Co-authored-by: suyao <sy20010504@gmail.com>
2025-05-13 23:09:38 +08:00
kangfenmao
e00f03db2b chore(version): 1.3.2 2025-05-13 21:04:14 +08:00
kangfenmao
8bd38ccd86 Merge branch 'main' into develop
# Conflicts:
#	src/renderer/src/providers/AiProvider/OpenAIProvider.ts
#	src/renderer/src/providers/AiProvider/OpenAIResponseProvider.ts
2025-05-13 20:53:23 +08:00
kangfenmao
02ae0349bf fix: Grouped message should not reset model and modelId
* Updated the reset logic to conditionally handle model and modelId for grouped messages.
* Ensured that the original model is retained when regenerating responses for grouped messages.
2025-05-13 20:50:52 +08:00
kangfenmao
ff8224a2dc fix: OpenAIResponseProvider summaryForSearch impl model wrong 2025-05-13 20:50:29 +08:00
kangfenmao
8214a70c38 revert: openai compatible type 2025-05-13 20:50:02 +08:00
kangfenmao
f642cfb3ba fix: regenerate message use assistant model 2025-05-13 20:45:50 +08:00
kangfenmao
d8b47d36ad fix: Grouped message should not reset model and modelId
* Updated the reset logic to conditionally handle model and modelId for grouped messages.
* Ensured that the original model is retained when regenerating responses for grouped messages.
2025-05-13 20:41:15 +08:00
kangfenmao
69ccd2aa32 fix: history topic message block is empty
* Added useEffect to dispatch loadTopicMessagesThunk when the topic is available
* Integrated useAppDispatch for state management
2025-05-13 20:24:41 +08:00
kangfenmao
c80e195ec2 fix: history topic message block is empty
* Added useEffect to dispatch loadTopicMessagesThunk when the topic is available
* Integrated useAppDispatch for state management
2025-05-13 20:24:19 +08:00
Yohann
011b9dca33 feat: add DevTools functionality and localization support (#5796)
* feat: add DevTools functionality and localization support

* Added new IPC channels for opening and toggling DevTools.
* Implemented corresponding handlers in the main process.
* Updated preload API to include DevTools methods.
* Enhanced the AboutSettings component with a debug section to control DevTools.
* Added localization strings for debug actions in English, Simplified Chinese, and Traditional Chinese.

* refactor: remove DevTools open state handling and related localization strings

* Removed the IPC channel and associated handlers for checking if DevTools is open.
* Updated the AboutSettings component to eliminate the DevTools open state management.
* Removed localization strings for the DevTools close action in English, Simplified Chinese, and Traditional Chinese.

* ToggleDevTools event uses the source window to trigger switching, compatible with multiple windows

* Remove empty comments

---------

Co-authored-by: yangheng <492238647@qq.com>
2025-05-13 16:53:55 +08:00
fullex
6381a28b27 fix(WebviewService): simplify user agent string modification by removing Chrome version replacement 2025-05-13 16:47:18 +08:00
Konv Suu
392a821c6c feat: add cache size retrieval functionality and integrate with UI (#5689)
* feat: add cache size retrieval functionality and integrate with UI

* chore: clean

* update

* update
2025-05-13 16:17:09 +08:00
one
dc93e168df refactor: improve model management UI, add animations to some buttons (#5932)
* feat: add motion to ModelListSearchBar

* feat: add motion to health checking button

* refactor(EditModelsPopup): show spin while fetching models

* refactor: remove redundant filtering, use transient props

* chore: remove useless component ModelTags

* refactor: extract and reuse ModelIdWithTags

* refactor(EditModelsPopup): use ExpandableText instead of expandable Typography.Paragraph

* refactor(EditModelsPopup): implement optimistic updates for filter type and loading state

* refactor: startTransition for search

* refactor(EditModelsPopup): enhance search and filter handling with optimistic updates

* refactor(EditModelsPopup): implement debounced search filter updates

---------

Co-authored-by: suyao <sy20010504@gmail.com>
2025-05-13 15:43:42 +08:00
one
b9224ed311 fix: animation on resolving SelectModelPopup (#5947) 2025-05-13 15:26:43 +08:00
dlzmoe
b1d87321aa feat: Optimize the display method for the three modes (#5938)
chore: Optimize the display method for the three modes
2025-05-13 15:26:04 +08:00
SuYao
044420dd7e fix: timer stop (#5914) 2025-05-13 15:25:27 +08:00
one
0da17e2808 refactor: improve model management UI, add animations to some buttons (#5932)
* feat: add motion to ModelListSearchBar

* feat: add motion to health checking button

* refactor(EditModelsPopup): show spin while fetching models

* refactor: remove redundant filtering, use transient props

* chore: remove useless component ModelTags

* refactor: extract and reuse ModelIdWithTags

* refactor(EditModelsPopup): use ExpandableText instead of expandable Typography.Paragraph

* refactor(EditModelsPopup): implement optimistic updates for filter type and loading state

* refactor: startTransition for search

* refactor(EditModelsPopup): enhance search and filter handling with optimistic updates

* refactor(EditModelsPopup): implement debounced search filter updates

---------

Co-authored-by: suyao <sy20010504@gmail.com>
2025-05-13 14:48:59 +08:00
kangfenmao
6a48b76c5e chore(version): 1.3.1 2025-05-13 13:48:19 +08:00
beyondkmp
a183cf6d61 chore: use node-stream-zip to improve perfermanc and remove unused dependencies (#5946)
* chore: remove unused dependencies from package.json and yarn.lock

* fix: update backup extraction progress logging in BackupManager

---------

Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
2025-05-13 13:41:06 +08:00
one
cb98e49d75 fix: animation on resolving SelectModelPopup (#5947) 2025-05-13 13:22:24 +08:00
dlzmoe
487c864860 feat: Optimize the display method for the three modes (#5938)
chore: Optimize the display method for the three modes
2025-05-13 12:21:12 +08:00
jwcrystal
be97826ba7 docs: Add Photo instructions to the branch strategy document (#5944) 2025-05-13 12:20:01 +08:00
Teo
dac200f330 feature: Hide disabled options for web search (#5943)
* refactor(WebSearchButton): streamline provider item creation and filter disabled items

* refactor(WebSearchButton): optimize provider items mapping and add pageSize to quick panel

* refactor(WebSearchButton): filter out disabled providers in items mapping
2025-05-13 12:07:08 +08:00
kangfenmao
e4d1dd0c87 fix: OpenAIResponseProvider summaryForSearch impl model wrong 2025-05-13 10:23:12 +08:00
SuYao
872339ca75 fix: timer stop (#5914) 2025-05-13 08:47:14 +08:00
suyao
09761f21bc fix: add mocks for minapps configuration and window.api in export tests 2025-05-13 00:42:36 +08:00
suyao
ec6f76520e fix: add File_DeleteDir channel and update deleteDir invocation in preload API 2025-05-13 00:37:52 +08:00
suyao
9b5d0cec69 fix: ensure MacOCR is correctly assigned after dynamic import in MacSysOcrProvider 2025-05-13 00:25:35 +08:00
suyao
bb65fec348 fix: add macOS availability checks in MacSysOcrProvider and OcrProviderFactory 2025-05-13 00:04:06 +08:00
suyao
602d80c699 fix: update mac-system-ocr dependency to version 0.2.2 2025-05-12 23:57:25 +08:00
kangfenmao
352b449948 revert: openai compatible type 2025-05-12 22:40:32 +08:00
suyao
98707a9d59 Merge branch 'main' into feat-knowlege-ocr 2025-05-12 22:33:27 +08:00
beyondkmp
341f744e07 fix(ipc): enhance theme handling with title bar overlay updates and broadcast notifications (#5915)
feat(ipc): enhance theme handling with title bar overlay updates and broadcast notifications
2025-05-12 22:27:27 +08:00
George Zhao
d456b3d4ed fix: ensure correct handling of custom mini app updates and removals (#5922)
* fix: ensure correct handling of custom mini app updates and removals

* fix: update title for custom mini app to be more concise in localization files

---------

Co-authored-by: George Zhao <georgezhao@SKJLAB>
2025-05-12 22:26:44 +08:00
Chen Tao
6314b391db fix: add i18n (#5921)
* fix(i18n)

* Update en-us.json
2025-05-12 22:26:38 +08:00
beyondkmp
440359cf75 fix(ipc): enhance theme handling with title bar overlay updates and broadcast notifications (#5915)
feat(ipc): enhance theme handling with title bar overlay updates and broadcast notifications
2025-05-12 21:57:50 +08:00
saica.go
5200dcfef6 feat: add undo functionality to agent prompt generation (#5821)
* feat: add undo functionality to agent prompt generation

* feat: add a standalone undo button
2025-05-12 21:48:53 +08:00
George Zhao
f416500ef1 fix: ensure correct handling of custom mini app updates and removals (#5922)
* fix: ensure correct handling of custom mini app updates and removals

* fix: update title for custom mini app to be more concise in localization files

---------

Co-authored-by: George Zhao <georgezhao@SKJLAB>
2025-05-12 20:58:35 +08:00
Chen Tao
0b5f05c489 fix: add i18n (#5921)
* fix(i18n)

* Update en-us.json
2025-05-12 20:49:31 +08:00
one
ff570a58d5 refactor: SelectModelPopup pinning (#5855)
* refactor: focus the hovered item when toggling a pinned model

* refactor: focus the selected item after loading pinned models

* refactor: update sticky group after loading pinned models

* fix: rapidly update sticky group

* refactor: defer lastscrolloffset

* refactor: rename updateOnListChange to focusOnListChange for clarity

* refactor: increaset overscan count

* refactor: use startTransition instead of deferred value

* refactor: add guard, clean up code

* refactor: simplify cleanup logic

* refactor: remove unnecessary dep on  pinnedModels

* fix: flicker on searching

* refactor: simplify tag tooltips, prevent tooltips in SelectModelPopup
2025-05-12 20:43:45 +08:00
Chen Tao
63b8ca4888 feat(knowledge): adjust default top-n to 10 (#5919) 2025-05-12 20:32:28 +08:00
kangfenmao
657c3148cb fix: regenerate message use assistant model 2025-05-12 20:28:51 +08:00
suyao
1ab9ea295d fix: move start_time_millsec initialization to onChunk for accurate timing 2025-05-12 20:28:12 +08:00
suyao
0bb25bfe9e fix: move start_time_millsec initialization to onChunk for accurate timing 2025-05-12 18:23:32 +08:00
Wang Jiyuan
55c78382e4 feat: minimize token usage when testing model (#5905) 2025-05-12 18:19:03 +08:00
jwcrystal
84b205cac2 fix: fix the formating error on qwen3 (#5899)
fix(ModelMessageService): fix the formating error on qwen3
2025-05-12 14:55:23 +08:00
fullex
698096e523 chore: remove bufferutil dependency from package.json and yarn.lock 2025-05-12 13:11:52 +08:00
kangfenmao
aaee8aa59c fix: update miniWindow URL path in dev mode 2025-05-12 09:50:13 +08:00
chenxue
4c15ca507c fix:painting support reload (#5886)
* add painting aihubmix provider

* fix: Cannot read properties of undefined (reading 'unshift')

* fix: painting redux data

* feat: customize aihubmix provider request logic

* fix: download error retry

* Update AihubmixProvider.ts

* back

* back

---------

Co-authored-by: zhaochenxue <zhaochenxue@bixin.cn>
Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-05-12 09:23:52 +08:00
beyondkmp
98d14fa02d feat(i18n): add page zoom settings in English, Japanese, and Russian locales 2025-05-12 09:03:09 +08:00
fullex
f9afa6f4f4 fix: miniWindow not found 2025-05-11 23:54:47 +08:00
GeorgeDong32
1c35ede129 chore(workflows): update workflows for new repo structure 2025-05-11 23:52:37 +08:00
kangfenmao
22295359e8 fix: update vitest configuration and add setup file for renderer tests
- Updated vitest.config.ts to handle optional chaining for plugins and alias.
- Added setup.ts for mocking electron-log in renderer tests.
- Adjusted test include and exclude patterns to refine test coverage.
2025-05-11 23:41:26 +08:00
Chen Tao
d091e3e9ee fix: copilot annotation bug (#5882)
fix: copilot annotation
2025-05-11 23:04:29 +08:00
jwcrystal
d2f7152d5a docs: Improve the README for better readability (#5880)
docs: Improve README readability
2025-05-11 22:02:31 +08:00
kangfenmao
29f0c72941 docs: add Branching Strategy document and update README with contribution guidelines 2025-05-11 21:07:57 +08:00
SuYao
9048cbb895 fix: ensure modelId is case-insensitive in findTokenLimit function (#5844)
* fix: ensure modelId is case-insensitive in findTokenLimit function

* fix: make modelId case-insensitive in findTokenLimit function
2025-05-11 20:59:42 +08:00
kangfenmao
8eb8505739 chore(version): 1.3.0 2025-05-11 20:28:51 +08:00
MyPrototypeWhat
431d04078f fix: next release bugs (#5801)
* style: update ChatNavigation and CitationsList components for improved UI consistency

- Added header style to remove borders in ChatNavigation.
- Enhanced CitationsList with new Skeleton loading state and improved layout for citation cards.
- Refactored CitationLink to a div for better styling control and adjusted padding in OpenButton for a more polished appearance.

* fix: update citation rendering logic in MainTextBlock component

- Added a check to determine if the citation URL is a valid link.
- Updated citation tag formatting to conditionally include the link based on the URL validity.

* Remove Zhipu mode and text-only link handling

* refactor: update message handling and state management

- Simplified message editing logic by removing unnecessary success/error logging.
- Added `updatedAt` timestamp to message updates for better tracking.
- Refactored `editMessageBlocks` to accept message ID and updates directly.
- Removed unused `getTopicLimit` function from `TopicManager`.
- Updated message rendering to use `updatedAt` when available.
- Enhanced type definitions to include `updatedAt` in message structure.

* refactor: optimize block update logic and remove unused code

- Updated `throttledBlockUpdate` to handle asynchronous updates directly.
- Removed the unused `throttledBlockDbUpdate` function and its related logic.
- Added cancellation for throttled updates on error and completion to improve performance and reliability.
- Cleaned up commented-out code for better readability.

* fix: enhance logging and update async handling in StreamProcessingService and messageThunk

- Enabled logging in `createStreamProcessor` for better debugging.
- Added logging for updated messages in `updateExistingMessageAndBlocksInDB` and `saveUpdatesToDB`.
- Updated `onTextComplete` and `onLLMWebSearchComplete` to handle asynchronous operations correctly.
- Commented out unused `saveUpdatedBlockToDB` calls to prevent unnecessary database updates.

* feat: enhance citation handling and add metadata support in citation blocks

* fix: prevent default action in handleLinkClick for better link handling

* fix: update styled component props to use dollar sign prefix for consistency

* feat(i18n): add download success and failure messages in multiple languages

* refactor(messageThunk): remove console.log statements for cleaner code

* refactor(StreamProcessingService): comment out console.log for cleaner code

* feat(MessageMenubar): add edit option to dropdown for single message editing

* fix:  set default zoomFactor in settings

* fix: add support for inline base64 image data in image block

* fix: remove 'auto' option from qwen model supported options

* fix: adjust thinking millisecond handling in message thunk

* fix: update regex for function calling models and improve time tracking logic

* fix: enhance error handling and metrics tracking across AI providers and message processing

* fix: add new image generation models to the configuration

* refactor(GeminiProvider): implement image generation handling in chat responses

* Revert "fix:  set default zoomFactor in settings"

This reverts commit 428b1fbe40.

---------

Co-authored-by: kangfenmao <kangfenmao@qq.com>
Co-authored-by: suyao <sy20010504@gmail.com>
2025-05-11 20:20:43 +08:00
kangfenmao
77286eb9dd feat: replace SvgSpinners180Ring with BeatLoader for improved loading animation in MinappPopupContainer 2025-05-11 19:51:02 +08:00
kangfenmao
a6379bd05e chore: remove opendal dependency and related code from RemoteStorage service 2025-05-11 19:50:55 +08:00
kangfenmao
b4945e2fea fix: update persisted reducer version and remove obsolete migration logic 2025-05-11 19:40:12 +08:00
kangfenmao
4f1414d5c6 feat: add transition animations to various popups and dialogs for improved user experience 2025-05-11 19:38:16 +08:00
kangfenmao
cb950ecde1 refactor: replace console.log with Logger for improved logging consistency across the application 2025-05-11 19:25:50 +08:00
kangfenmao
2b447a7911 fix: message and rerank errors
commit ee9c7ca69e
Merge: 476855c9 d4fe5dfa
Author: kangfenmao <kangfenmao@qq.com>
Date:   Sun May 11 18:43:56 2025 +0800

    Merge branch 'main' into fix/next-release-bugs

commit 476855c9c7
Author: suyao <sy20010504@gmail.com>
Date:   Sun May 11 18:09:58 2025 +0800

    refactor(GeminiProvider): implement image generation handling in chat responses

commit 66939a5302
Merge: 2f278b3f 499fb306
Author: suyao <sy20010504@gmail.com>
Date:   Sun May 11 16:45:29 2025 +0800

    Merge branch 'main' into fix/next-release-bugs

commit 2f278b3fac
Author: suyao <sy20010504@gmail.com>
Date:   Sun May 11 16:41:38 2025 +0800

    fix: add new image generation models to the configuration

commit a55e9759f3
Merge: 4c50dfbd 8e1c10ab
Author: suyao <sy20010504@gmail.com>
Date:   Sun May 11 13:14:17 2025 +0800

    Merge branch 'main' into fix/next-release-bugs

commit 4c50dfbd19
Author: suyao <sy20010504@gmail.com>
Date:   Sun May 11 13:13:20 2025 +0800

    fix: enhance error handling and metrics tracking across AI providers and message processing

commit 9b9a395451
Author: suyao <sy20010504@gmail.com>
Date:   Sun May 11 05:36:52 2025 +0800

    fix: update regex for function calling models and improve time tracking logic

commit c2f23d6916
Author: suyao <sy20010504@gmail.com>
Date:   Sun May 11 05:05:05 2025 +0800

    fix: adjust thinking millisecond handling in message thunk

commit c565d91591
Author: suyao <sy20010504@gmail.com>
Date:   Sun May 11 03:52:26 2025 +0800

    fix: remove 'auto' option from qwen model supported options

commit dfeb54fd94
Author: suyao <sy20010504@gmail.com>
Date:   Sun May 11 03:50:05 2025 +0800

    fix: add support for inline base64 image data in image block

commit 9b2992fce4
Merge: 428b1fbe db6408f3
Author: suyao <sy20010504@gmail.com>
Date:   Sun May 11 03:00:57 2025 +0800

    Merge branch 'main' into fix/next-release-bugs

commit 428b1fbe40
Author: suyao <sy20010504@gmail.com>
Date:   Sun May 11 03:00:11 2025 +0800

    fix:  set default zoomFactor in settings

commit 8a99eea28a
Merge: f4963888 2193a665
Author: suyao <sy20010504@gmail.com>
Date:   Sun May 11 01:31:05 2025 +0800

    Merge branch 'main' into fix/next-release-bugs

commit f4963888e8
Merge: c6cf7908 3f1fadb9
Author: kangfenmao <kangfenmao@qq.com>
Date:   Sat May 10 20:18:44 2025 +0800

    Merge branch 'main' into fix/next-release-bugs

commit c6cf790851
Author: lizhixuan <daoquqiexing@gmail.com>
Date:   Sat May 10 11:38:01 2025 +0800

    feat(MessageMenubar): add edit option to dropdown for single message editing

commit 87b106fad6
Author: lizhixuan <daoquqiexing@gmail.com>
Date:   Sat May 10 10:53:10 2025 +0800

    refactor(StreamProcessingService): comment out console.log for cleaner code

commit 7d0b8b33af
Author: lizhixuan <daoquqiexing@gmail.com>
Date:   Sat May 10 10:52:08 2025 +0800

    refactor(messageThunk): remove console.log statements for cleaner code

commit 7310eebebc
Author: kangfenmao <kangfenmao@qq.com>
Date:   Sat May 10 10:17:44 2025 +0800

    feat(i18n): add download success and failure messages in multiple languages

commit 42733d0fc8
Merge: 6364f4c0 ac0651a9
Author: kangfenmao <kangfenmao@qq.com>
Date:   Sat May 10 09:54:38 2025 +0800

    Merge branch 'main' into fix/next-release-bugs

commit 6364f4c006
Author: suyao <sy20010504@gmail.com>
Date:   Fri May 9 22:19:35 2025 +0800

    fix: update styled component props to use dollar sign prefix for consistency

commit 34c49b84f6
Author: suyao <sy20010504@gmail.com>
Date:   Fri May 9 22:02:06 2025 +0800

    fix: prevent default action in handleLinkClick for better link handling

commit 84bf76cc43
Merge: 572ffcc8 3697b31c
Author: suyao <sy20010504@gmail.com>
Date:   Fri May 9 21:55:54 2025 +0800

    Merge branch 'main' into fix/next-release-bugs

commit 572ffcc8be
Merge: 9ba630b5 a6a8324c
Author: suyao <sy20010504@gmail.com>
Date:   Fri May 9 21:48:13 2025 +0800

    Merge branch 'main' into fix/next-release-bugs

commit 9ba630b5e8
Merge: bf819a71 6d910755
Author: suyao <sy20010504@gmail.com>
Date:   Fri May 9 21:27:08 2025 +0800

    Merge branch 'fix/next-release-bugs' of github.com:CherryHQ/cherry-studio into fix/next-release-bugs

commit bf819a7142
Author: suyao <sy20010504@gmail.com>
Date:   Fri May 9 21:24:48 2025 +0800

    feat: enhance citation handling and add metadata support in citation blocks

commit 6d9107558e
Author: MyPrototypeWhat <daoquqiexing@gmail.com>
Date:   Fri May 9 19:47:24 2025 +0800

    fix: enhance logging and update async handling in StreamProcessingService and messageThunk

    - Enabled logging in `createStreamProcessor` for better debugging.
    - Added logging for updated messages in `updateExistingMessageAndBlocksInDB` and `saveUpdatesToDB`.
    - Updated `onTextComplete` and `onLLMWebSearchComplete` to handle asynchronous operations correctly.
    - Commented out unused `saveUpdatedBlockToDB` calls to prevent unnecessary database updates.

commit c402a1d21f
Author: MyPrototypeWhat <daoquqiexing@gmail.com>
Date:   Fri May 9 18:47:55 2025 +0800

    refactor: optimize block update logic and remove unused code

    - Updated `throttledBlockUpdate` to handle asynchronous updates directly.
    - Removed the unused `throttledBlockDbUpdate` function and its related logic.
    - Added cancellation for throttled updates on error and completion to improve performance and reliability.
    - Cleaned up commented-out code for better readability.

commit 6da1d08c9a
Author: MyPrototypeWhat <daoquqiexing@gmail.com>
Date:   Fri May 9 18:42:00 2025 +0800

    refactor: update message handling and state management

    - Simplified message editing logic by removing unnecessary success/error logging.
    - Added `updatedAt` timestamp to message updates for better tracking.
    - Refactored `editMessageBlocks` to accept message ID and updates directly.
    - Removed unused `getTopicLimit` function from `TopicManager`.
    - Updated message rendering to use `updatedAt` when available.
    - Enhanced type definitions to include `updatedAt` in message structure.

commit 30696e1ef1
Author: suyao <sy20010504@gmail.com>
Date:   Fri May 9 16:19:55 2025 +0800

    Remove Zhipu mode and text-only link handling

commit 5b95d20294
Author: kangfenmao <kangfenmao@qq.com>
Date:   Fri May 9 15:49:02 2025 +0800

    fix: update citation rendering logic in MainTextBlock component

    - Added a check to determine if the citation URL is a valid link.
    - Updated citation tag formatting to conditionally include the link based on the URL validity.

commit 28f1e486e6
Author: kangfenmao <kangfenmao@qq.com>
Date:   Thu May 8 18:31:14 2025 +0800

    style: update ChatNavigation and CitationsList components for improved UI consistency

    - Added header style to remove borders in ChatNavigation.
    - Enhanced CitationsList with new Skeleton loading state and improved layout for citation cards.
    - Refactored CitationLink to a div for better styling control and adjusted padding in OpenButton for a more polished appearance.
2025-05-11 18:44:28 +08:00
beyondkmp
d4fe5dfa32 refactor: update zoom handling in IPC and settings (#5868)
* refactor: update zoom handling in IPC and settings

* renamed zoom-related IPC channels for clarity
* refactored zoom handling logic in ipc.ts and ShortcutService
* removed unused zoom factor state management from settings
* updated DisplaySettings component to manage zoom via buttons
* localized zoom settings in multiple languages

* refactor: remove unused zoom factor state from settings

* eliminated the zoomFactor state from initialSettings as part of the zoom handling refactor

* refactor: improve zoom handling in DisplaySettings component

* initialized current zoom value on component mount
* refactored resize event listener to prevent memory leaks
* added cleanup for resize event listener to enhance performance

* refactor: enhance resize event handling in DisplaySettings component

* added logic to track previous window width to prevent unnecessary updates during resize events
* improved comments for clarity on zoom handling and resize event listener functionality

* refactor: streamline zoom handling across IPC and ShortcutService

* updated handleZoomFactor function to accept an array of BrowserWindows for batch processing
* simplified zoom factor adjustments in IPC and shortcut handlers
* removed unnecessary window destruction checks for improved performance
2025-05-11 18:42:25 +08:00
MyPrototypeWhat
499fb306f6 feat: add motion library for animations and enhance Spinner and Messa… (#5869)
feat: add motion library for animations and enhance Spinner and MessageBlock components

- Added 'motion' library to package.json and yarn.lock for animation support.
- Refactored Spinner component to utilize motion for animated effects.
- Introduced AnimatedBlockWrapper in MessageBlockRenderer for animated transitions.
- Updated ThinkingBlock to include animated lightbulb effect during thinking state.
2025-05-11 16:20:28 +08:00
one
d66e8cb4ec fix(Inputbar): do not reset selection on focus (#5866) 2025-05-11 13:47:25 +08:00
自由的世界人
1375d1a1c2 feat: add message translate copy & close (#5684)
* feat: add message translate copy & close

* fix: remove blockEntity
2025-05-11 13:40:09 +08:00
one
4f641c294b refactor(checkAPI): check api or model with stream enabled first (#5857)
* refactor(checkAPI): check api or model with stream enabled first

* refactor: improve healthcheck summary

* refactor: remove cursor style from status indicator

* fix: update apikey input box after deleting invalid keys
2025-05-11 13:32:47 +08:00
one
baa9fbbeeb fix: conditionally aquire focus for inputbar (#5860) 2025-05-11 13:27:10 +08:00
SuYao
8e1c10abd6 Revert "fix: update selectedTypes logic in ModelEditContent for better handling" (#5858) 2025-05-11 12:18:51 +08:00
one
db6408f3b9 revert: customtag tooltip delay (#5856) 2025-05-11 02:46:34 +08:00
自由的世界人
6ee181ed38 fix: clean up code (#5851) 2025-05-11 00:37:01 +08:00
one
2193a665c6 fix: check isComposing on keydown (#5848) 2025-05-10 23:55:18 +08:00
George Zhao
138ab1c5b7 feat(i18n): 更新机器翻译多语言,使用Qwen3 236b进行机器翻译。 (#5840)
feat(i18n): update Portuguese translations for import/export features, assistant settings, and mini app configurations

Co-authored-by: George Zhao <georgezhao@SKJLAB>
2025-05-10 23:40:57 +08:00
SuYao
8da51585ed fix: jina embedding error (#5839)
* fix: jina embedding error

* fix: handle jina model encoding format in Embeddings class
2025-05-10 23:03:48 +08:00
George Zhao
2f5349cb64 feat: regularPhrases可以随Agent一起导出。 (#5836)
* feat: add regularPhrases to AgentCard props

* fix: agentcard style btw

---------

Co-authored-by: George Zhao <georgezhao@SKJLAB>
Co-authored-by: Pleasurecruise <3196812536@qq.com>
2025-05-10 22:49:29 +08:00
kangfenmao
47d0a3cc0d style: add centered prop to modals and components for improved layout consistency 2025-05-10 22:21:37 +08:00
George Zhao
b80b63e207 feat: Agent Regular Phrases (#5775)
* feat: add regular prompts settings component and integrate into assistant settings.

* feat: add regular prompts to assistant creation and update QuickPhrasesButton to utilize them.

* feat: add regular prompts settings and update localization for multiple languages.

* fix: update assistantObj type to Assistant and clean up unused console logs.

* feat: enhance QuickPhrasesButton with modal for adding phrases and localization updates.

* feat: update localization for regular prompts to regular phrases in English, Simplified Chinese, and Traditional Chinese.

* fix: update localization for assistant prompts to assistant phrases in English and Simplified Chinese.

* feat: add regular prompts to new agents during import.

* refactor: rename regular_prompts to regular_phrases across localization and components

* feat: enhance QuickPhrasesButton with icons for location selection options

* perf: optimize loadQuickListPhrases with useCallback and update icon sizes in QuickPhrasesButton

---------

Co-authored-by: George Zhao <georgezhao@SKJLAB>
2025-05-10 21:57:57 +08:00
Camol
3fe6aee5b8 style: remove small size prop from Switch component in AssistantModel… (#5833)
style: remove small size prop from Switch component in AssistantModelSettings

Co-authored-by: kanweiwei <kanweiwei@nutstore.net>
2025-05-10 21:34:48 +08:00
Jee
3f1fadb9b6 feat: add prompt display control (#5439)
Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-05-10 20:16:59 +08:00
kangfenmao
b962126d98 fix: message render bugs
commit c6cf790851
Author: lizhixuan <daoquqiexing@gmail.com>
Date:   Sat May 10 11:38:01 2025 +0800

    feat(MessageMenubar): add edit option to dropdown for single message editing

commit 87b106fad6
Author: lizhixuan <daoquqiexing@gmail.com>
Date:   Sat May 10 10:53:10 2025 +0800

    refactor(StreamProcessingService): comment out console.log for cleaner code

commit 7d0b8b33af
Author: lizhixuan <daoquqiexing@gmail.com>
Date:   Sat May 10 10:52:08 2025 +0800

    refactor(messageThunk): remove console.log statements for cleaner code

commit 7310eebebc
Author: kangfenmao <kangfenmao@qq.com>
Date:   Sat May 10 10:17:44 2025 +0800

    feat(i18n): add download success and failure messages in multiple languages

commit 42733d0fc8
Merge: 6364f4c0 ac0651a9
Author: kangfenmao <kangfenmao@qq.com>
Date:   Sat May 10 09:54:38 2025 +0800

    Merge branch 'main' into fix/next-release-bugs

commit 6364f4c006
Author: suyao <sy20010504@gmail.com>
Date:   Fri May 9 22:19:35 2025 +0800

    fix: update styled component props to use dollar sign prefix for consistency

commit 34c49b84f6
Author: suyao <sy20010504@gmail.com>
Date:   Fri May 9 22:02:06 2025 +0800

    fix: prevent default action in handleLinkClick for better link handling

commit 84bf76cc43
Merge: 572ffcc8 3697b31c
Author: suyao <sy20010504@gmail.com>
Date:   Fri May 9 21:55:54 2025 +0800

    Merge branch 'main' into fix/next-release-bugs

commit 572ffcc8be
Merge: 9ba630b5 a6a8324c
Author: suyao <sy20010504@gmail.com>
Date:   Fri May 9 21:48:13 2025 +0800

    Merge branch 'main' into fix/next-release-bugs

commit 9ba630b5e8
Merge: bf819a71 6d910755
Author: suyao <sy20010504@gmail.com>
Date:   Fri May 9 21:27:08 2025 +0800

    Merge branch 'fix/next-release-bugs' of github.com:CherryHQ/cherry-studio into fix/next-release-bugs

commit bf819a7142
Author: suyao <sy20010504@gmail.com>
Date:   Fri May 9 21:24:48 2025 +0800

    feat: enhance citation handling and add metadata support in citation blocks

commit 6d9107558e
Author: MyPrototypeWhat <daoquqiexing@gmail.com>
Date:   Fri May 9 19:47:24 2025 +0800

    fix: enhance logging and update async handling in StreamProcessingService and messageThunk

    - Enabled logging in `createStreamProcessor` for better debugging.
    - Added logging for updated messages in `updateExistingMessageAndBlocksInDB` and `saveUpdatesToDB`.
    - Updated `onTextComplete` and `onLLMWebSearchComplete` to handle asynchronous operations correctly.
    - Commented out unused `saveUpdatedBlockToDB` calls to prevent unnecessary database updates.

commit c402a1d21f
Author: MyPrototypeWhat <daoquqiexing@gmail.com>
Date:   Fri May 9 18:47:55 2025 +0800

    refactor: optimize block update logic and remove unused code

    - Updated `throttledBlockUpdate` to handle asynchronous updates directly.
    - Removed the unused `throttledBlockDbUpdate` function and its related logic.
    - Added cancellation for throttled updates on error and completion to improve performance and reliability.
    - Cleaned up commented-out code for better readability.

commit 6da1d08c9a
Author: MyPrototypeWhat <daoquqiexing@gmail.com>
Date:   Fri May 9 18:42:00 2025 +0800

    refactor: update message handling and state management

    - Simplified message editing logic by removing unnecessary success/error logging.
    - Added `updatedAt` timestamp to message updates for better tracking.
    - Refactored `editMessageBlocks` to accept message ID and updates directly.
    - Removed unused `getTopicLimit` function from `TopicManager`.
    - Updated message rendering to use `updatedAt` when available.
    - Enhanced type definitions to include `updatedAt` in message structure.

commit 30696e1ef1
Author: suyao <sy20010504@gmail.com>
Date:   Fri May 9 16:19:55 2025 +0800

    Remove Zhipu mode and text-only link handling

commit 5b95d20294
Author: kangfenmao <kangfenmao@qq.com>
Date:   Fri May 9 15:49:02 2025 +0800

    fix: update citation rendering logic in MainTextBlock component

    - Added a check to determine if the citation URL is a valid link.
    - Updated citation tag formatting to conditionally include the link based on the URL validity.

commit 28f1e486e6
Author: kangfenmao <kangfenmao@qq.com>
Date:   Thu May 8 18:31:14 2025 +0800

    style: update ChatNavigation and CitationsList components for improved UI consistency

    - Added header style to remove borders in ChatNavigation.
    - Enhanced CitationsList with new Skeleton loading state and improved layout for citation cards.
    - Refactored CitationLink to a div for better styling control and adjusted padding in OpenButton for a more polished appearance.
2025-05-10 20:12:11 +08:00
Camol
14d013243c fix: update selectedTypes logic in ModelEditContent for better handling (#5819)
refactor: improve model type checking logic in models.ts and ModelEditContent.tsx

* Refactor isFunctionCallingModel, isEmbeddingModel, isVisionModel, isReasoningModel, and isWebSearchModel functions for better readability and maintainability.
* Simplify type selection logic in ModelEditContent by directly using model.type or defaultTypes.
* Remove unnecessary conditional checks to streamline the code.

Co-authored-by: kanweiwei <kanweiwei@nutstore.net>
2025-05-10 19:55:56 +08:00
jwcrystal
a448fa1804 docs(README): add Architecture overview document (#5824)
- Add the Architecture Overview document to help the contributor how to develop quickly.
2025-05-10 18:03:19 +08:00
SuYao
b07e5839c2 feat(webSearch): add Bocha web search provider integration (#5608)
* feat(webSearch): add Bocha web search provider integration

- Introduced BochaProvider for handling web search queries.
- Added Bocha logo and updated web search provider configuration.
- Implemented API host and key validation for Bocha.
- Enhanced web search settings to support Bocha provider.
- Updated Redux store to include Bocha in the web search provider list.
- Added validation schemas for Bocha search parameters and responses.

* fix(WebSearch): improve error handling in BochaProvider and validate web search questions

- Added error handling for failed Bocha search responses.
- Enhanced validation for web search questions to ensure they are an array and not empty.

* fix(WebSearch): add API host validation for Tavily provider

* chore: remove api host check button

* fix: add check for unnecessary web search in fetchExternalTool

---------

Co-authored-by: eeee0717 <chentao020717Work@outlook.com>
2025-05-10 16:42:09 +08:00
suyao
c3124a8cfc fix: update IPC handler for base64 file and enhance upload response structure in GeminiService 2025-05-10 16:21:51 +08:00
suyao
7ab1380407 fix: update web search localization keys for consistency and clarity 2025-05-10 15:34:23 +08:00
SuYao
3c7f72acc0 fix: qwen3 check (#5811) 2025-05-10 13:52:39 +08:00
one
77c6ae5a8c fix: SelectModelPopup scrolling behaviour (#5812)
* fix: focus the selected or the first item on searching

* refactor: remove unnecessary deferred values

* refactor: add a hook usePinnedModels for pinned models

* refactor: make the definition more consistent with other popups

* refactor: improve state management, improve scrolling behaviour

* fix: avoid potential modulo-by-zero

* fix: type error

* fix: async loading pinned models
2025-05-10 13:48:25 +08:00
Chen Tao
03c562bf5b feat: combine to general reranker (#5818)
* feat: combine to general reranker

* chore

* chore: set not support provider

* chore: add i18n
2025-05-10 13:42:54 +08:00
suyao
c14dd77861 feat: enhance migration logic and add file type definitions
- Refactored migration logic in migrate.ts to improve error handling and state management.
- Introduced new file type definitions in file.ts, including interfaces for local and remote files, and type guards for file validation.
- Updated index.ts to export new file types and removed redundant file type definitions.
- Cleaned up file utility functions by removing unused base64 conversion function.
- Updated yarn.lock to include new dependencies and version updates for @mistralai/mistralai and @cherrystudio/mac-system-ocr.
2025-05-10 11:59:34 +08:00
suyao
47c8e8096c Merge branch 'main' into feat-knowlege-ocr 2025-05-10 01:33:08 +08:00
jwcrystal
ac0651a9f3 fix(Qwen3): Add Qwen3 Model Thinking Mode Switch in Thinking Button(#5781)
* feat(Qwen3): Add Qwen3 Model Thinking Mode Switch

- Add a thinking mode switch for the Qwen3 model on the settings page,
- Enabled: Generates thinking content. Disabled: Does not generate thinking content.

This feature is implemented by adding new settings items and corresponding logic.

* docs(i18n): Add multilingual translations for Qwen3 model's thinking mode

* refactor(Qwen3): Remove Qwen thinking mode related code from SettingTab

- Remove Qwen thinking mode related state and logic from the SettingsTab component
- Integarte Qwen 3 thinking mode switch login the ThinkingButton component to simplify the code and improve maintainability

* refactor(OpenAICompatibleProvider): Extract qwen3 handling logic to ModelMessageService

Move the postsuffix handling logic in OpenAICompatibleProvider to ModelMessageService to improve code maintainability and reusability

* docs(i18n): Remove Qwen3 model-related translations

Remove the translation content of the unused Qwen3 model's thinking mode and its prompts
2025-05-09 22:21:04 +08:00
beyondkmp
3a36da1bf9 feat: add inspect option to context menu with localization support (#5807)
* implemented a new inspect menu item in the context menu that toggles developer tools
* added localization for the inspect option in English, Japanese, Russian, and Chinese (both simplified and traditional)
2025-05-09 22:12:16 +08:00
Camol
3697b31c7b fix: update input schema reference in MessageTools for accurate tool … (#5804)
* fix: update input schema reference in MessageTools for accurate tool response handling

* refactor: remove unused CustomEditorContainer styles from MiniAppSettings

---------

Co-authored-by: kanweiwei <kanweiwei@nutstore.net>
2025-05-09 21:54:13 +08:00
kangfenmao
a6a8324cdb refactor: update icon usage and improve painting state management
* replaced InfoCircleFilled icon with Info from lucide-react for consistency
* simplified painting state initialization and handling in AihubmixPage and PaintingsPage
* removed unnecessary conditional logic for setting default painting
2025-05-09 20:50:18 +08:00
Camol
ce8b85020b feat: support both function call and system prompt for MCP tools (#5499)
* feat: support both function call and system prompt for MCP tools
- Add support for using both function call and system prompt to implement MCP tool calls
- Refactor tool handling logic to be more flexible and maintainable
- Improve code readability with better variable naming and comments
- Fix potential issues with tool call implementation

* fix: Add tool_calls in OpenAI streaming logic

* refactor: enhance OpenAICompatibleProvider and BaseOpenAiProvider structure

* feat: add tool call setting to SettingsTab component

* fix: enhance tool call handling in OpenAICompatibleProvider

* fix: enhance content handling in GeminiProvider for nonstreaming response

* refactor: improve tool property filtering logic in OpenAIProvider and mcp-tools utility

* fix: resolve eslint errors

* fix: add history for function call message in GeminiProvider

* refactor: unify MCP tool response handling across providers for consistency

* refactor: update mcp tools conversion logic in OpenAICompatibleProvider and OpenAIProvider

* refactor: enhance AihubmixProvider and BaseProvider with MCP tool handling methods

* refactor: introduce SYSTEM_PROMPT_THRESHOLD constant in BaseProvider for improved readability

* refactor: rename tool_call to enable_tool_use for clarity and consistency across the application

* refactor: remove unnecessary onChunk call in processStream for cleaner code

* fix: add toolCallId to response structure and enhance content handling in AnthropicProvider

* fix: respond image data to llm while using function call

* fix: add reasoning handling in OpenAICompatibleProvider for improved response processing

---------

Co-authored-by: kanweiwei <kanweiwei@nutstore.net>
Co-authored-by: jay <sevenjay@users.noreply.github.com>
2025-05-09 20:20:16 +08:00
kangfenmao
c0cb1693da feat: replace n8n icon with SVG version and update references
* removed the old n8n.ico file
* added new n8n.svg file
* updated references in minapps configuration and app components to use the new SVG logo
* changed file handling from 'customMiniAPP' to 'custom-minapps.json' for consistency
2025-05-09 20:19:34 +08:00
kangfenmao
6708efdbe1 Revert "feat: ParateraAI 添加支持 (#5792)"
This reverts commit e134cacbec.
2025-05-09 20:04:44 +08:00
one
8786ba6410 fix: SelectModelPopup sticky header (#5795)
* fix: remove console logs

* refactor: use onScroll instead of onItemsRendered
2025-05-09 16:43:22 +08:00
kangfenmao
c66dfa50cf fix: message citations styles and bugs 2025-05-09 15:56:54 +08:00
George Zhao
e134cacbec feat: ParateraAI 添加支持 (#5792)
* feat: add Paratera mini app with logo and URL.

* feat: add Paratera AI provider and associated model.

* feat: add Paratera provider to migration configuration

* fix: update Paratera entry in default mini apps configuration

* feat: add additional Paratera models to system models configuration

* feat: reintroduce Paratera provider in migration configuration

* fix: update redux-persist version to 99 in store configuration

---------

Co-authored-by: George Zhao <georgezhao@SKJLAB>
2025-05-09 14:45:29 +08:00
one
85e3233a72 fix: user message usage (#5657)
* fix: user message usage estimation

* fix: estimate usage on resending edited user message

* refactor: renaming

* refactor: renaming
2025-05-09 14:17:28 +08:00
Roland
be64faf9e2 feat: add the "Export Agent" feature (#5789) 2025-05-09 13:30:21 +08:00
one
45827890ac perf: virtual list for quick panel and SelectModelPopup (#5594)
* perf: quick panel with virtual list

* fix: adaptive virtual list height

* fix: keep panel content if it is re-opened in a very short interval

* refactor: use modified rc-virtual-list to support overscan

* fix: virtual list item key

* refactor: remove useless styles

* refactor: support smooth scrolling for virtual list

* fix: lint error

* perf: use virtual list for SelectModelPopup

* refactor: change model name style

* fix: better auto scroll behaviour

* perf: improve memorization for SelectModelPopup

* fix: group name background

* refactor: change model item margin

* chore: update rc-virtual-list to 3.19.2

* fix: adaptive list height

* refactor: improve styles for focused or selected items

* refactor: do not show model if the assistant has not default model

* chore: migrate to custom rc-virtual-list

* refactor: improve selected item style

* refactor: improve selected item style

* fix: left margin

* refactor: simplify the indicator for selected item

* fix: prevent mouse hover for keyboard events

* chore: bump rc-virtual-list

* refactor: simulate sticky group header in SelectModelPopup

* fix: cleanup timer, add comments

* perf: improve smooth scrolling

* chore: bump to rc-virtual-list:3.19.6

* refactor: update memorization

* refactor: extract item rendering logic

* refactor: delay CustomTag tooltip for performance

* fix: disable spellcheck in model search bar

* refactor: expand/collapse model label on resizing window

* refactor: simplify filtering

* chore: update rc-virtual-list

* refactor: always render virtual list to avoid inconsistent state

* chore: update dependencies

* chore: update dependencies

* chore: update dependencies

* refactor: remove useless states

* refactor: simplify selected state

* refactor: improve keyboard events for SelectModelPopup

* revert: do not expand mode tags

* refactor: reduce animation time

* chore: update dependencies

* refactor: better names and comments

* refactor: better error handling

* refactor: simplify auto-scrolling logic

* refactor: use react-window rather than rc-virtual-list

* fix: disable auto-scroll

* fix: scroll bar style and item margin

* fix: initialize sticky banner

* refactor: distinguish auto-scrolling behaviour for different causes

* fix: keyboard navigation error
2025-05-09 11:54:54 +08:00
Konv Suu
4fce9f8986 fix: remove useless border and border radius for code block 2025-05-09 09:55:47 +08:00
karl
db7a4a737f feat: tooluse result display style optimization (#5758) 2025-05-09 09:52:15 +08:00
Camol
6dd06c8e29 fix: display image from mcp response (#5780) 2025-05-09 09:43:22 +08:00
George Zhao
ba5de53c71 feat(minapps): add n8n mini app with logo and URL. (#5776)
Co-authored-by: George Zhao <georgezhao@SKJLAB>
2025-05-09 00:52:15 +08:00
one
e23127a515 refactor(ModelList): improve model list style and grouping (#5674)
* refactor(ModelList): make the group removing button consistent with model removing button

* refactor(ModelList): improve auto-grouping, reduce the number of groups

* refactor(EditModelsPopup): extract model group tools

* refactor(naming): add special grouping rules for some providers

* feat(ModelList): add a button to add/remove all the listed models

* refactor(naming): update auto grouping

* refactor: update auto grouping for dmxapi

* revert: remove ungrouped
2025-05-08 23:20:29 +08:00
George Zhao
2b91fac5fa feat: Custom mini app (#5731)
* feat: 新增文件写入功能,支持通过 ID 写入文件并加载自定义小应用配置。

* feat(i18n): 添加自定义小程序配置的多语言支持,包括英文、简体中文和繁体中文。

* fix(minapps): 使用 await 加载自定义小应用并合并到默认应用中,同时添加日志输出以便调试

* fix(minapps): 在开发环境中添加条件日志输出,以便调试加载的默认小应用。

* refactor(miniappSettings): 移动自定义小应用编辑区域的位置,优化界面布局。

* refactor(miniappSettings): 修改自定义小应用保存逻辑,优化应用列表重新加载方式。

* feat(i18n): 修复在merge过程中丢失的语言设置。

* fix(bug_risk): Consider adding stricter validation for the JSON config on load.

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>

* feat(miniapp): 添加自定义小应用功能,优化应用列表展示,支持通过模态框添加新应用。

* feat(App): enhance custom app modal to support logo upload via URL.

* feat(miniapp): add application logo support and update mini app list reloading logic.

* feat(i18n): update mini app custom settings translations for multiple languages.

* feat(miniapp): add updateDefaultMinApps function and refactor mini app list reloading logic.

* feat(miniapp): add removeCustom functionality to handle custom mini app deletion

* feat(miniapp): add duplicate ID check when adding custom mini apps.

* feat(i18n): 重构侧边栏相关翻译为结构化格式,增加删除自定义应用的翻译支持。

* feat(miniapp): 优化删除自定义应用的逻辑,使用条件渲染简化代码结构。

* feat(miniapp): 添加自定义小应用内容的空值处理,确保 JSON 格式有效。

* feat(i18n): 更新默认语言为英语,并移除多个语言文件中的默认代理字段。

* feat(i18n): 为多个语言文件添加自定义小应用配置编辑描述翻译。

* feat(i18n): add success and error messages for deleting custom mini apps in multiple language files.

* feat(i18n): update success and error messages for custom mini app operations and add placeholder text in multiple language files.

* feat(i18n): 为多个语言文件添加重复ID和冲突ID的错误信息翻译,并在自定义小应用设置中实现相关检查逻辑。

* feat(miniapp): 在添加自定义小应用时,增加对默认最小应用ID的重复检查逻辑。

* feat(i18n): update edit description for custom mini app configuration in Traditional Chinese locale

* fix(miniapp): enhance error messages for duplicate and conflicting IDs in custom mini app configuration

---------

Co-authored-by: George Zhao <georgezhao@SKJLAB>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: suyao <sy20010504@gmail.com>
2025-05-08 21:59:55 +08:00
SuYao
8550e5be98 Feat/claude websearch support (#5771)
* feat: enhance web search capabilities in AnthropicProvider

- Added support for Claude models in web search functionality with a new regex.
- Implemented logic to retrieve web search parameters and handle web search results.
- Updated message handling to include web search progress and completion states.
- Enhanced citation formatting for web search results from Anthropic source.

* feat: import WebSearchResultBlock for enhanced message handling

- Added import for WebSearchResultBlock from the Anthropic SDK to improve message processing capabilities in messageBlock.ts.
- Removed duplicate import to streamline the code.

* chore: update @anthropic-ai/sdk to version 0.41.0 in package.json and yarn.lock

* Update src/renderer/src/store/messageBlock.ts

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: Chen Tao <70054568+eeee0717@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-05-08 21:30:43 +08:00
Roland
0e202509d3 fix(MCP): Revise the server type judgment logic to ensure the correct… (#5769) 2025-05-08 20:57:48 +08:00
ous50 | ousfifty | 欧式fifty
cdbba49dd5 Feat: change Gemini Safety Settings to OFF; upgrade @google/genai package (#5763)
* Feat: change Gemini Safety Settings to OFF; upgrade @google/genai package

* fix: remove model.id param in getSafetySettings in Gemini Provider
2025-05-08 18:21:39 +08:00
MyPrototypeWhat
191aafe1fc fix: enhance search functionality with optional HTTP options (#5765)
* feat: enhance search functionality with optional HTTP options

- Updated the search method signatures in BaseWebSearchProvider, WebSearchEngineProvider, LocalSearchProvider, and WebSearchService to accept optional HTTP options.
- Modified fetchWebContent and fetchWebContents to utilize the new HTTP options parameter for improved request handling.
- Enhanced error handling in messageThunk to manage abort errors more effectively.

* feat: implement abortable promises for web search and fetch operations

- Added createAbortPromise utility to handle abort signals for promises.
- Updated LocalSearchProvider and fetchWebContent to utilize abortable promises, allowing for better control over ongoing requests.
- Enhanced error handling in ApiService to log errors consistently.
2025-05-08 18:03:19 +08:00
自由的世界人
2a787fe87b fix(theme): citation list dark theme display & url repeatedly requesting (#5752)
* fix(theme): citation list dark theme  display

* fix: 减少属性变量及反复请求

* fix: update react-query
2025-05-08 17:24:04 +08:00
MyPrototypeWhat
4b2882aab7 feat(MCP): update auto-install server name and add server registration logic
- Changed the auto-install server name to '@cherry/mcp-auto-install' in migration logic.
- Implemented logic to register the MCP server upon tool invocation if it matches the auto-install server name.
2025-05-08 13:26:40 +08:00
kangfenmao
8d3e243f3c feat: refactor AihubmixProvider and OpenAICompatibleProvider for improved model handling (#5732) 2025-05-08 13:20:12 +08:00
LiuVaayne
35bc5afdad feat(MCP): implement login shell environment retrieval (#5739)
feat: implement login shell environment retrieval
2025-05-08 10:14:01 +08:00
kangfenmao
1185ce2b73 feat: customize aihubmix provider request logic (#5728) 2025-05-08 09:52:53 +08:00
suyao
c19a6cb764 chore: remove unuseful doc 2025-05-08 09:40:08 +08:00
beyondkmp
930074a717 feat: add zoom factor setting and localization support (#5665)
* feat: add zoom factor setting and localization support

- Introduced App_SetZoomFactor IPC channel for managing zoom levels.
- Implemented zoom factor functionality in the main IPC handler.
- Added setZoomFactor method in the settings store and corresponding UI in DisplaySettings.
- Included localization for zoom settings in English and Chinese.

* add i18n

* recover file

* delete code

* fix: update zoom factor handling to apply to all windows

- Modified the IPC handler for App_SetZoomFactor to set the zoom factor for all non-destroyed windows instead of just the main window.

* add getzoomfactor api

* feat: synchronize zoom factor with Redux state on app initialization

- Added functionality to fetch the zoom factor from the main process and dispatch it to the Redux store during app initialization.
- Removed redundant zoom factor fetching logic from DisplaySettings component.

* feat: enhance zoom factor management with IPC updates

- Added a new IPC channel for zoom factor updates to notify all renderer processes.
- Introduced a constant for predefined zoom levels to streamline zoom adjustments.
- Updated the zoom handling logic to utilize the new zoom levels and ensure smooth transitions.
- Implemented a listener in the preload script to handle zoom factor updates from the main process.
- Refactored the app initialization to include real-time updates for the zoom factor in the Redux state.

* feat: integrate zoom options into DisplaySettings component

- Added ZOOM_OPTIONS constant to generate structured options for Ant Design Select from predefined zoom levels.
- Refactored DisplaySettings to utilize ZOOM_OPTIONS, removing redundant zoom option definitions.
- Simplified the zoom factor fetching logic in useAppInit for better readability and efficiency.

* refactor: streamline zoom factor handling and remove unused IPC channel

- Removed the App_GetZoomFactor IPC channel as it was no longer needed.
- Updated zoom factor handling to directly set and notify the main window of changes.
- Simplified the logic for setting the zoom factor in the WindowService and ShortcutService.
- Adjusted the useAppInit hook to utilize the new zoom factor management approach.

* refactor: improve zoom factor handling in WindowService and useAppInit hook

- Simplified the zoom factor setting in WindowService by directly using the config manager.
- Updated useAppInit to ensure the zoom factor is set correctly on initialization, enhancing responsiveness to changes.
2025-05-08 07:18:43 +08:00
Xuanwo
8b7bc0ff4e feat: Add OpenDAL based Remote Storage class (#2700)
* feat: Add OpenDAL based Remote Storage class

Signed-off-by: Xuanwo <github@xuanwo.io>

* Fix error logging

Signed-off-by: Xuanwo <github@xuanwo.io>

* fix(dependencies): update opendal version to ^0.47.11 and add platform-specific binaries

---------

Signed-off-by: Xuanwo <github@xuanwo.io>
Co-authored-by: suyao <sy20010504@gmail.com>
2025-05-08 03:09:40 +08:00
自由的世界人
80177458b1 fix: citation list loading (#5742)
* fix: citation loading

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>

* fix: remove unused import & cleanup some code

---------

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-05-08 03:04:31 +08:00
chenxi
a38f4a5ad3 fix: failed to connect OAuth MCP server (#5709)
* fix: failed to connect OAuth MCP server

* polish: handle token fetching errors gracefully
2025-05-08 00:32:51 +08:00
SuYao
f8b4b41b91 refactor(middleware): add extractReasoningMiddleware for enhanced text processing (#5637) 2025-05-07 22:09:12 +08:00
kangfenmao
06a590328c Revert "perf: <tool_use> display (#5489)"
This reverts commit 0782b24790.
2025-05-07 21:08:59 +08:00
kangfenmao
5fe1d077e3 fix(upgrades): add check for empty content in error block creation during upgrade to v7 2025-05-07 21:08:59 +08:00
自由的世界人
636c788e2b fix: knowledge base url error (#5735) 2025-05-07 19:42:48 +08:00
Chen Tao
97130cfb1e feat: optimize knowledge recognize (#5707)
Co-authored-by: 自由的世界人 <3196812536@qq.com>
2025-05-07 14:34:38 +08:00
自由的世界人
b6520cdc9a feat: change citation list style (#5516)
* feat: change citation list style

* feat: add link preview

* fix: model inside searching

* fix: change button word
2025-05-07 14:21:58 +08:00
自由的世界人
599370be4e fix: chat message translate (#5682)
* fix: add updateTranslationBlockThunk
2025-05-07 14:19:47 +08:00
Chen Tao
0f34bde749 feat: support dashscope reranker (#5725) 2025-05-07 14:17:03 +08:00
MyPrototypeWhat
afcb0eeae2 优化消息块渲染性能,使用 useMemo 缓存图像块组;移除调试日志以清理代码 (#5722) 2025-05-07 13:38:09 +08:00
fullex
22315b7201 fix(StoreSyncService): set flag bug when register IPC handler (#5715)
fix: register IPC handler in StoreSyncService
2025-05-07 10:52:51 +08:00
Teo
2e804eeebc feat(WebSearchButton): add 'Disable Web Search' option (#5717) 2025-05-07 10:37:08 +08:00
SuYao
1035dd2572 fix: update thinkingbutton model checks (#5708)
* fix: update model checks to include supported reasoning and thinking token models

* fix: simplify thinking button visibility logic in Inputbar component
2025-05-06 23:39:36 +08:00
fullex
6d3a994392 feat: emit event on message complete (#5696)
feat: add MESSAGE_COMPLETE event to EventService and emit on message processing completion
2025-05-06 23:14:41 +08:00
ipcjs
c920ca3da6 feat(miniapps): add Grok / X (#5706) 2025-05-06 20:17:57 +08:00
one
c0c6435fc5 fix: memorize assistant with model (#5701) 2025-05-06 18:05:32 +08:00
SuYao
89e403ae61 fix: include thinking_millsec in message block creation (#5685) 2025-05-06 08:09:25 +08:00
自由的世界人
4a925870d1 fix: openaiprovider timeout is not an integer (#5681)
Update OpenAIProvider.ts
2025-05-05 22:03:28 +08:00
SuYao
0c369b5a3e feat(OpenAI): new Responses API support (#5621)
* feat(OpenAI): new Responses API support

- Added OpenAICompatibleProvider to handle requests for OpenAI-compatible models.
- Updated ProviderSettings to reflect changes in provider types from 'openai' to 'openai-compatible'.
- Enhanced model validation and response handling in OpenAIProvider to support new input formats.
- Refactored existing components to accommodate the new provider structure and ensure compatibility with OpenAI's response API.
- Incremented store version to 98 to reflect changes in provider types and settings.
- Updated migration logic to convert existing 'openai' provider types to 'openai-compatible' where applicable.

* refactor(OpenAI): update model validation and response handling

- Renamed `isOpenAIModel` to `isOpenAILLMModel` for clarity in model type checking.
- Updated references to the new model validation function across `OpenAICompatibleProvider` and `OpenAIProvider`.
- Enhanced web search model validation logic to accommodate new model checks.
- Refactored `getOpenAIWebSearchParams` to return structured parameters based on model type.
- Improved citation formatting in message blocks for better web search results handling.

* fix(OpenAICompatibleProvider): reset timestamps for first token handling

- Updated logic to reset timestamps for the first token and content when no prior thinking content is present.
- Added comments for clarity on the purpose of the changes and marked a temporary fix for timestamp handling.

* refactor(OpenAICompatibleProvider): improve code readability with consistent formatting

* fix(OpenAIProvider): refine service tier logic for model identification

* fix: eslint error

* fix(OpenAIProvider): enhance response metrics tracking in streaming process

* feat(OpenAIProvider): add timeout handling for model requests

---------

Co-authored-by: 自由的世界人 <3196812536@qq.com>
2025-05-05 21:08:05 +08:00
chenxi
bb5c6a8bb9 Fix: 'Web Search' and 'Clear Context' don't work (#5677) 2025-05-05 21:04:18 +08:00
beyondkmp
197016f0db refactor: add Linux support for margin adjustments in MinappPopupConainer and McpSettingsNavbar (#5673)
* refactor: add Linux support for margin adjustments in MinappPopupContainer and McpSettingsNavbar

* refactor: adjust margin and padding for Linux support in MinappPopupContainer and McpSettingsNavbar

* refactor: enhance Linux support in MinappPopupContainer by updating button group class condition
2025-05-05 16:58:14 +08:00
one
7ce0b3072b fix: infinite scroller layout (#5671) 2025-05-05 15:17:10 +08:00
chenxi
e506460ef9 feat: popup question editor support translation assistant (#5660)
* feat: TextEditPopup support translation assistant

* polish: ensure safe state updates in TextEditPopup during unmount

* test: make delay assertion more lenient in unclassified utils tests

* feat: add loading indicator to translation button in TextEditPopup
2025-05-05 14:58:57 +08:00
one
82884e3945 fix: conditionally show loading more spinner (#5670) 2025-05-05 14:57:01 +08:00
SuYao
9acd2121d4 Fix/image height (#5658) 2025-05-04 22:31:00 +08:00
George Zhao
7ec5953892 feat: 支持自定义助手地址 (#5540)
* feat: 支持自定义助手地址

feat: 支持自定义助手地址

* feat: 更新多语言支持,添加“defaultaides”字段至隐私设置,并修改默认智能体的值为设置中的引用。

* feat: 更新默认助手设置,修复函数命名错误并优化状态管理

* refactor: update agent loading logic to use settings and improve error handling

* refactor: update DefaultaidesSettings to use custom hook for state management and replace icon in DataSettings

* fix: improve error message formatting in callMCPTool function

* feat: 添加多语言支持的默认助手设置,包括英文、日文、俄文和中文的翻译。

* refactor: 优化智能体加载逻辑,合并本地和远程智能体,并改进错误处理。

* feat: add import functionality for agents and update translations in multiple languages.

* feat: implement agent import functionality with validation and error handling.

* feat(i18n): add import success and error messages for agents in multiple languages.

* fix(i18n): standardize import success message key across multiple languages.

* refactor(i18n): remove default aides section from multiple language files

* refactor(i18n): update Traditional Chinese translations for agent management and privacy settings.

* feat(i18n): add import functionality for agents with URL and file options, including error handling and translations in multiple languages.

* refactor(i18n): rename 'defaultaides' to 'defaultAgent' across multiple language files and update related settings.

* refactor(AgentsPage): remove unused addAgent function from useAgents hook.

---------

Co-authored-by: 上房揭瓦 <hoaobo@foxmail.com>
Co-authored-by: George Zhao <georgezhao@SKJLAB>
Co-authored-by: suyao <sy20010504@gmail.com>
2025-05-04 21:04:04 +08:00
自由的世界人
f258f5b2cb fix: remove redundant local variables (#5654) 2025-05-04 19:56:56 +08:00
beyondkmp
5ceb2af056 chore(dependencies): update electron-builder to 26.0.15 (#5651)
* chore(dependencies): update electron-builder and related dependencies to version 26.0.15

* chore(electron-builder): update portable build configuration and clean up artifact build script

- Set buildUniversalInstaller to false for portable builds in electron-builder configuration.
- Removed obsolete condition for deleting portable files in artifact build completion script.
2025-05-04 18:34:43 +08:00
beyondkmp
0d0aae8863 chore(dependencies): update electron-updater to version 6.6.4 and remove patches (#5650)
chore(dependencies): update electron-updater to version 6.6.4 and remove obsolete patch
2025-05-04 18:33:27 +08:00
SuYao
97a3f89e73 fix(models): normalize model IDs to lowercase for consistency (#5642)
fix(models): normalize model IDs to lowercase for consistent matching in isSupportedThinkingTokenQwenModel function
2025-05-04 16:07:35 +08:00
beyondkmp
9e86cc9bfb refactor(WindowService, ThemeProvider): streamline title bar style and theme toggling logic (#5633)
* fix(config): update title bar overlay colors for better visibility

* fix(Navbar): add Linux support for padding adjustment in Navbar component
2025-05-04 13:19:56 +08:00
Starsky Wong
5985946c2a fix the issue of webdav local backup file storage (#5643)
fix the issue of unlimited webdav local backup file storage
2025-05-04 13:16:06 +08:00
beyondkmp
01ef941e52 refactor(WindowService): improve context menu setup (#5589)
* refactor(WindowService): streamline context menu setup and enhance webview spellcheck functionality

* update format

* delete setSpellCheckerLanguages
2025-05-04 11:04:56 +08:00
SuYao
e43d316f10 fix(OpenAIProvider): enhance token budget calculation in OpenRouter (#5625)
* fix(OpenAIProvider): enhance token budget calculation in OpenRouter

* fix(OpenAIProvider): update budget token calculation and adjust effort ratio for improved reasoning support
2025-05-04 01:04:38 +08:00
MyPrototypeWhat
62bf38b1f3 feat(messageOperations): add editMessageBlocks functionality and update message handling logic (#5641)
feat(messageOperations): add editMessageBlocks functionality and update message handling logic

- Introduced editMessageBlocks to update properties of message blocks.
- Enhanced editMessage to include error handling and logging.
- Updated useTopicMessages to accept topic ID directly.
- Refactored MessageMenubar to utilize editMessageBlocks for editing messages.
- Improved saveMessageAndBlocksToDB for better state management.
2025-05-04 00:57:10 +08:00
MyPrototypeWhat
81a9e6c1fe fix(messageThunk): enhance reset message logic to include model for s… (#5632)
fix(messageThunk): enhance reset message logic to include model for single message resets
2025-05-03 20:39:40 +08:00
SuYao
15b51940c0 fix(i18n): add missing translation for Ru (#5631)
fix(i18n): add missing translation for reasoning effort settings in Russian locale
2025-05-03 17:22:17 +08:00
yushihang
227ea3e39b Remove redundant condition check in MCP service args handling (#5606)
Remove duplicate !args.includes('-y') check
2025-05-02 22:51:40 +08:00
KumaKorin
f7f35f095b fix: resolve scrolling issue on files page (#5618) (#5619) 2025-05-02 22:37:05 +08:00
SuYao
eedbaa965c fix(Anthropic): add base64 file handling to IPC and file management (#5595) 2025-05-02 22:30:34 +08:00
fullex
66abb416df refactor: simplify custom CSS functionality by store sync (#5596)
* feat: implement store synchronization across windows

- Added new IPC channels for store synchronization: StoreSync_Subscribe, StoreSync_Unsubscribe, StoreSync_OnUpdate, and StoreSync_BroadcastSync.
- Integrated store sync service in various components, including the main IPC handler and renderer store.
- Removed the MiniWindowReload IPC channel as it was no longer needed.
- Updated the store configuration to support synchronization of specific state slices.

* refactor: remove custom CSS functionality from IPC and related components

- Removed the App_SetCustomCss channel and associated handlers from the IPC and ConfigManager.
- Updated the renderer components to eliminate references to custom CSS settings.
- Refactored the MiniWindow component to manage custom CSS directly without IPC communication.
2025-05-02 15:19:47 +08:00
one
9d35f1d6ab perf(inputbar): improve long text paste (#5580) 2025-05-02 11:27:16 +08:00
fullex
36e1340e6e feat: implement store synchronization across windows (#5592)
- Added new IPC channels for store synchronization: StoreSync_Subscribe, StoreSync_Unsubscribe, StoreSync_OnUpdate, and StoreSync_BroadcastSync.
- Integrated store sync service in various components, including the main IPC handler and renderer store.
- Removed the MiniWindowReload IPC channel as it was no longer needed.
- Updated the store configuration to support synchronization of specific state slices.
2025-05-02 03:08:26 +08:00
SuYao
ef7abbcb0e Feat/qwen3 support (#5533)
* feat: implement ThinkingPanel for managing reasoning effort and token limits

- Added ThinkingPanel component to handle user settings for reasoning effort and thinking budget.
- Introduced ThinkingSelect and ThinkingSlider components for selecting reasoning effort and adjusting token limits.
- Updated models and hooks to support new reasoning effort and thinking budget features.
- Enhanced Inputbar to integrate ThinkingPanel and provide a toggle for enabling thinking features.
- Updated translations and styles for new components.

* refactor: enhance ThinkingPanel and related components for improved reasoning effort management

- Updated ThinkingPanel to streamline token mapping and error messaging.
- Refactored ThinkingSelect to utilize a list for better UI interaction.
- Enhanced ThinkingSlider with styled components for a more intuitive user experience.
- Adjusted model checks in the configuration to support new reasoning models.
- Improved translations for clarity and consistency across languages.

* feat: close ThinkingPanel on outside click

* feat(icons): add new lightbulb icons and update reasoning effort settings in translations

- Introduced new SVG icons for lightbulb states (off, on at 10%, 50%, and 90%).
- Added "Off" reasoning effort option in English, Japanese, Russian, Simplified Chinese, and Traditional Chinese translations.
- Refactored Inputbar and ThinkingButton components to integrate new reasoning effort logic and icon display.

* feat(thinking): refactor reasoning effort management and introduce new lightbulb icon

- Removed ThinkingPanel, ThinkingSelect, and ThinkingSlider components to streamline reasoning effort management.
- Added new MdiLightbulbAutoOutline icon for the auto reasoning effort option.
- Updated reasoning effort logic in ThinkingButton to support 'auto' and fallback options.
- Enhanced translations for reasoning effort options across multiple languages.
- Adjusted model configurations to integrate new reasoning effort settings.

* refactor(messageThunk): update multi-model dispatch logic for improved assistant handling

- Changed the parameter from baseAssistantId to assistant object for better clarity.
- Updated tasksToQueue structure to include assistant configuration instead of just ID and model.
- Enhanced the creation of assistant messages to utilize the full assistant object.

* chore(messageThunk): remove unused comment for clarity in multi-model response handling

* fix(ThinkingButton): update quick panel title for reasoning effort settings

* fix(GeminiProvider, OpenAIProvider): apply Math.floor to budget calculations for improved accuracy

---------

Co-authored-by: ousugo <dkzyxh@gmail.com>
Co-authored-by: Teo <cheesen.xu@gmail.com>
2025-05-01 22:57:04 +08:00
fullex
7c0086a484 refactor: Seperate MiniWindow loading from MainWindow (#5581) 2025-05-01 21:29:41 +08:00
Chen Tao
49c9e14790 fix: 调整图片高度,修复gemini画图 (#5585) 2025-05-01 21:03:10 +08:00
fullex
3b81f60c93 refactor: remove unused selection window (#5586) 2025-05-01 20:57:31 +08:00
SuYao
68e98f9a56 refactor: enhance image block rendering and styling (#5567)
* refactor: enhance image block rendering and styling

* 更新 index.tsx

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>

* refactor: update key usage in MessageBlockRenderer for improved readability

---------

Co-authored-by: Chen Tao <70054568+eeee0717@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-05-01 18:22:27 +08:00
MyPrototypeWhat
f4debacbfc fix(mcp-tools): improve error message formatting and response handlin… (#5565)
fix(mcp-tools): improve error message formatting and response handling in upsertMCPToolResponse function
2025-05-01 18:06:53 +08:00
one
3a496a7d1f perf: improve inputbar button memorization 2025-05-01 17:49:51 +08:00
SuYao
a068d36f87 feat(OpenAIProvider): support image edit (#5469)
* feat(OpenAIProvider): support image edit

* fix: can edit image

* feat: add upload situation

* chore: optimize  abort

* fix: image cannot read

* chore(SvgSpinners180Ring): remove unused React import

* refactor(FileManager): simplify file reading logic by storing intermediate data

---------

Co-authored-by: eeee0717 <chentao020717Work@outlook.com>
2025-05-01 12:38:33 +08:00
one
cb9c42b262 fix: reset hasReasoningContent (#5563) 2025-05-01 11:47:53 +08:00
SuYao
18092480f2 fix(messageThunk): ensure usage is only estimated when not already present in response (#5553)
* fix(messageThunk): ensure usage is only estimated when not already present in response

* refactor: clean logic
2025-05-01 11:04:43 +08:00
one
a2c5b8e191 fix: refresh thinking state on streaming (#5557) 2025-05-01 01:08:22 +08:00
nmnmtttt
b6cb567de2 Fix error #5456 (#5543)
* Fix default assistant model settings where temperature value 0 fails to trigger updates #5456

Signed-off-by: LeeSH <shuhao_lin@fzzixun.com>

* fix: remove console.log

Signed-off-by: LeeSH <shuhao_lin@fzzixun.com>

* fix: use simple condition to tell value  (#5456)
*use  value not equal null to  tell false condition
Signed-off-by: LeeSH <shuhao_lin@fzzixun.com>

---------

Signed-off-by: LeeSH <shuhao_lin@fzzixun.com>
Co-authored-by: Lee SH <shuhao_lin@fzzixun.com>
2025-04-30 22:52:18 +08:00
one
32d03eae30 feat: support streaming for model health check (#5546) 2025-04-30 22:25:32 +08:00
one
432c65e5ef fix: prevent overriding block status on aborting (#5547) 2025-04-30 20:15:13 +08:00
beyondkmp
54355db0d3 feat(WindowService): add main window monitor for renderer process events (#5532)
* feat(WindowService): add main window monitor for renderer process events

* fix(WindowService): enhance renderer process crash handling to improve application stability
2025-04-30 18:02:25 +08:00
MyPrototypeWhat
23d086a1d2 Fix/message block structure (#5536)
* refactor:  重构快捷助手

- 移除不必要的 `model` 属性,简化 `MessageContent` 和相关组件的参数传递。
- 更新 `MessageItem` 和 `MessageBlockRenderer` 以提高可读性和性能,确保消息内容的正确渲染。
- 修复 `fetchCitations` 中的潜在错误,确保引用数据的正确处理。
- 清理未使用的代码和注释,提升代码整洁性。

* refactor: 优化消息块处理和错误显示逻辑

- 在 `upgradeToV7` 函数中调整了消息块的创建顺序,以保持与旧版本的一致性。
- 更新了 `ErrorBlock` 组件,增强了错误信息的显示逻辑,支持更详细的 HTTP 错误状态处理。
- 在多个语言文件中添加了暂停占位符文本,提升了用户体验。
- 移除了未使用的代码和注释,提升了代码整洁性。

* refactor(useAssistant): optimize topic handling with useMemo

* feat(locales): add Russian translations for MinApp and MiniWindow components

- Introduced new translations for various UI elements in the MinApp and MiniWindow sections, enhancing the user experience for Russian-speaking users.
- Updated the HomeWindow component to streamline topic handling by directly accessing the default assistant's topics, improving code clarity and performance.

* refactor(message): remove loading state management from newMessage slice and streamline message loading logic

- Removed the loading state update for topics in the `newMessage` slice to simplify state management.
- Updated `loadTopicMessagesThunk` to eliminate unnecessary loading checks, enhancing clarity and performance during message loading.

---------

Co-authored-by: suyao <sy20010504@gmail.com>
2025-04-30 17:58:08 +08:00
Akey Zhang
ecd7518505 style: optimize mcp arg name display layout when tool or prompt descr… (#5467)
* style: optimize mcp arg name display layout when tool or prompt description is short

* style: optimize mcp arg name display layout, make it simple

* fix: remove unused import
2025-04-30 11:22:39 +08:00
MyPrototypeWhat
08ee877676 fix: update webSearch type and results structure in upgrade logic (#5512) 2025-04-30 00:16:58 +08:00
one
6ee8a72823 fix: determining thinking process using block status (#5509)
* fix: determining thinking process using block status

* refactor: merge MessageThought to ThinkingBlock

* style: fix typos

* fix: error handling

* refactor: set collapsed status as default

* refactor: remove pending status

* refactor: better collapsing behaviour

* refactor: remove processing status
2025-04-30 00:04:13 +08:00
SuYao
b0d6f209d7 feat(messageThunk): integrate autoRenameTopic functionality to update topic names based on assistant responses (#5504) 2025-04-29 23:07:09 +08:00
Chen Tao
1c5526c020 feat: optimize extract logic (#5470)
* feat: optimize extract logic

* chore
2025-04-29 20:43:50 +08:00
karl
f29b83faab fix: The Error display of the failed mcp call shows that the Error type cannot be displayed (#5492)
* fix: The Error display of the failed mcp call shows that the Error type cannot be displayed

* Update src/renderer/src/utils/mcp-tools.ts

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-04-29 17:40:50 +08:00
SuYao
57e8b9a592 fix(GeminiProvider): relocate grounding metadata handling (#5490)
* fix(GeminiProvider): relocate grounding metadata handling to improve code clarity and maintainability

* refactor(GeminiProvider): enhance conditional checks for chunk processing
2025-04-29 17:36:35 +08:00
karl
0782b24790 perf: <tool_use> display (#5489) 2025-04-29 16:39:19 +08:00
Teo
0a7bf99f9c refactor: network search module, support quick menu (#5291)
* refactor: Reconstruct the network search module to support quick menu switching between different suppliers.

* refactor(GeminiProvider): simplify web search enablement logic

* refactor(settings): remove unnecessary SettingDivider for cleaner layout

* refactor(SelectModelButton): remove unused setModel function for improved performance

* refactor(ApiService): simplify web search condition by removing redundant check
2025-04-29 16:31:41 +08:00
Chen Tao
7be6ddfb59 fix: message do not use knowledge (#5485) 2025-04-29 16:19:19 +08:00
SuYao
0413884021 refactor(MainTextBlock): enhance content processing by ignoring tooluse (#5483) 2025-04-29 16:16:34 +08:00
MyPrototypeWhat
4225d20760 feat: 添加 messageBlock、messageThunk 和 useMessageOperations 使用指南文档
- 新增 `how-to-use-messageBlock.md`,详细介绍 `messageBlock.ts` 的 Redux Slice 及其状态管理、actions 和 selectors。
- 新增 `how-to-use-messageThunk.md`,概述 `messageThunk.ts` 的核心功能和主要 Thunks 的使用。
- 新增 `how-to-use-useMessageOperations.md`,提供 `useMessageOperations` Hook 的使用示例和功能说明,简化组件与消息数据的交互。
2025-04-29 15:14:55 +08:00
chenxue
efad8f9ad0 feat: add painting aihubmix provider (#4503)
* add painting aihubmix provider

* fix: Cannot read properties of undefined (reading 'unshift')

* fix: painting redux data

---------

Co-authored-by: zhaochenxue <zhaochenxue@bixin.cn>
Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-04-29 14:38:59 +08:00
MyPrototypeWhat
a6822d4037 refactor: message block structure (#4660)
* feat(message-blocks): introduce new message block types and middleware for handling message updates

- Added new types for message blocks including MainText, Thinking, Translation, Code, Image, ToolCall, ToolResult, KnowledgeCitation, WebSearch, File, and Error blocks.
- Implemented middleware to manage message block mapping and updates in Redux, enhancing the handling of message states and blocks.
- Introduced LRU caching for efficient message block retrieval and management.

* feat(messages): implement message management slice and utility functions

- Introduced a new Redux slice for managing messages, including actions for setting the current topic, loading state, error handling, and message updates.
- Added utility functions for creating various message block types, enhancing the structure and management of message content.
- Updated message type definitions to include timestamped block references, improving the tracking of message block states.

* feat(store): add messageBlocks reducer and integrate into rootReducer

- Introduced a new messageBlocks reducer to manage message block state.
- Updated rootReducer to include messageBlocks alongside existing reducers.
- Refactored newMessage slice to accommodate changes in message structure and block handling.
- Removed obsolete messageBlockMap utility file to streamline codebase.

* feat(database): implement version 7 migration and enhance message structure

- Added new message_blocks table to the database schema for improved message handling.
- Introduced upgradeToV7 function to migrate existing topics and messages to the new structure.
- Refactored message creation utilities to support new message block types and improved error handling.
- Implemented various message filtering utilities to streamline message processing.
- Updated Redux store to accommodate new message structure and loading states.

* feat(message): refactor message handling and introduce messageStreamProcessor

- Updated database schema to correct types for topics and message blocks.
- Introduced messageStreamProcessor to handle API responses and transform them into application-specific data structures.
- Refactored messageThunk to streamline message creation and updates, ensuring consistency with the new message structure.
- Enhanced error handling and state management during message processing.

* refactor(message): update message handling with new types and utility functions

- Refactored message operations to utilize new message types and improved utility functions for content retrieval.
- Introduced helper functions for finding message blocks, enhancing the structure and readability of message processing.
- Updated various providers to align with the new message structure, ensuring consistent handling of message content and blocks.
- Enhanced error handling and state management during message processing, improving overall reliability.

* refactor(message): wip create XxxBlock components

- Refactored message handling to utilize new message types, enhancing the overall structure and readability.
- Introduced new message blocks including CitationBlock, CodeBlock, ErrorBlock, FileBlock, ImageBlock, ThinkingBlock, ToolBlock, and TranslationBlock.
- Updated existing components to align with the new message structure, ensuring consistent handling of message content and blocks.
- Improved utility functions for finding and processing message blocks, enhancing the reliability of message operations.

* refactor(message): enhance message operations with new selectors and blocks

- Updated useMessageOperations to integrate new message block types and selectors for improved state management.
- Introduced new selectors for fetching topic messages and loading states, enhancing the efficiency of message retrieval.
- Refactored message handling in Inputbar and MessageContent components to align with the new message structure.
- Added CitationBlock and improved rendering logic for message blocks, ensuring consistent display of message content.
- Enhanced error handling and logging for message operations, improving overall reliability.

* refactor(message): enhance message update logic with block instructions

- Updated the updateMessage reducer to handle block instructions, allowing for more flexible message updates.
- Improved the fetchAndProcessAssistantResponseImpl function to track the last added block, ensuring proper handling of streaming content.
- Refactored stream processing to accommodate new callback signatures and improve error handling.
- Removed unused console logs and cleaned up code for better readability and maintainability.

* merge origin/main

* refactor(message): update message handling and block structure

- Replaced `prepareTopicMessages` with `loadTopicMessagesThunk` for improved message loading logic.
- Updated `MessageTools` to accept `ToolBlock` instead of `Message`, enhancing type safety.
- Introduced `resetMessage` utility to streamline message object creation and reset mutable fields.
- Refactored `findCitationBlocks` and related types for consistency in message block handling.
- Enhanced error handling in message update logic to ensure robustness during database operations.

* refactor(message): update message and block handling for improved clarity and performance

- Refactored message handling by removing unnecessary cloning of messages in `MessageContent`.
- Updated `Inputbar` to import `Message` from the new message types module.
- Simplified block rendering logic in `MessageBlockRenderer` by removing redundant checks.
- Adjusted `StreamProcessingService` to use the updated import path for `GroundingMetadata`.
- Enhanced message status handling in `newMessage` to include 'streaming' status.
- Removed deprecated `createUserMessageThunk` to streamline thunk actions.
- Updated type definitions in `newMessageTypes` for better clarity and consistency.

* refactor(message): enhance message block structure and type handling

- Updated `Markdown` component to utilize `MainTextMessageBlock` for improved type safety.
- Refactored `MessageContent` to remove error handling logic and streamline rendering.
- Adjusted `MessageError` to accept `ErrorMessageBlock` and simplified error display logic.
- Enhanced `MessageTools` to work with `ToolMessageBlock`, improving clarity in tool response handling.
- Updated `MainTextBlock` to pass the correct props to `Markdown`, ensuring consistent rendering.
- Refactored utility functions to align with new message block types, enhancing overall code clarity and maintainability.

* refactor: update message types import paths and enhance message handling logic

- Changed import paths for message types from 'newMessageTypes' to 'newMessage' across multiple files.
- Refactored message handling functions to utilize the new message structure, ensuring compatibility with the updated types.
- Improved logic for finding and processing main text blocks in messages.
- Updated related components and hooks to reflect the new message structure, enhancing overall code maintainability.

* refactor: improve stream processing and message handling logic

- Updated the `createStreamProcessor` function to handle null and undefined chunks more robustly.
- Introduced a helper function `handleBlockTransition` to streamline state transitions between message blocks.
- Enhanced error handling in the `onComplete` function to specifically manage abort errors and create error blocks when necessary.
- Improved final block status updates to ensure accurate tracking of message processing states.

* refactor: use rehype-sanitize for html tags

# Conflicts:
#	src/renderer/src/pages/home/Markdown/Markdown.tsx

* refactor: merge rehype plugins

* refactor(ModelList): extract NameSpan component and adjust styling for better layout

* feat: update Z.ai app configuration with additional styling and increment store version to 97

# Conflicts:
#	src/renderer/src/store/index.ts

* feat(FeatureMenus, Footer): replace Ant Design icons with Lucide icons and enhance layout

- Updated icons in FeatureMenus from Ant Design to Lucide for improved visual consistency.
- Refactored Footer component to use Lucide icons and adjusted layout for better alignment and spacing.
- Enhanced styling of Tag components for a more cohesive design.

* lint: fix code format

* chore(version): 1.2.5

* feat(locales): add locale cleanup functionality to after-pack script

- Introduced a new `remove-locales.js` script to handle the removal of unnecessary locale files based on the platform.
- Integrated the locale cleanup process into the `after-pack.js` script to ensure locales are managed during packaging.

* feat: support escaping the comma character in the API key. (#5088)

feat: support escaping the comma character in the API key.

* feat(Citations): enhance CitationsList with title and info icon, and update styling

* Revert "feat: add chat message translate copy button (#4620)"

This reverts commit 8b462935b4.

# Conflicts:
#	src/renderer/src/hooks/useMessageOperations.ts
#	src/renderer/src/pages/home/Inputbar/Inputbar.tsx

* refactor: update message status handling and improve message creation logic

- Introduced `AssistantMessageStatus` to standardize message statuses across the application.
- Updated various components and services to utilize the new status enum, replacing string literals for better type safety.
- Refactored message creation and processing functions to align with the new status definitions.
- Adjusted filtering logic in `useMessageOperations` to reflect changes in message status handling.
- Cleaned up unused code and comments for improved readability.

* refactor: enhance citation handling and web search integration

- Updated CitationBlock and MainTextBlock components to improve citation processing logic.
- Refactored citation data handling to accommodate new web search sources and formats.
- Introduced new chunk types for better handling of streaming responses, including text and web search results.
- Enhanced the integration of web search results into message blocks, ensuring accurate citation references.
- Updated related types and interfaces to reflect changes in citation and web search structures.

* refactor: improve message handling and citation integration

- Added debug logging to various components for better traceability during message processing.
- Refactored CitationBlock and MainTextBlock to streamline citation handling and improve integration with web search results.
- Updated Inputbar to include debug logs for message sending and dispatching actions.
- Enhanced the message block rendering logic to decouple citation references from main text blocks.
- Improved the handling of citation data and ensured accurate formatting across different sources.

* feat: add regenerate assistant response functionality

- Introduced `regenerateAssistantResponseThunk` to allow regeneration of assistant messages.
- Updated `useMessageOperations` to include the new `regenerateAssistantMessage` function.
- Refactored `MessageMenubar` to utilize the new regeneration feature.
- Adjusted `MessageImage` and `ImageBlock` components to align with updated props.
- Cleaned up unused code and comments across various files for improved readability.

* fix: deepseek-reasoner does not support successive user or assistant messages in MCP scenario (#5112)

* fix: deepseek-reasoner does not support successive user or assistant messages in MCP scenario.

* fix: @ts-ignore

* refactor: remove google analytics

* feat: add PostHogProvider for analytics integration

- Introduced PostHogProvider to manage data collection based on user settings.
- Wrapped the main application in PostHogProvider to enable analytics when data collection is allowed.

* refactor(AxiosProxy): improve proxy handling and initialization logic

- Changed cacheAxios from undefined to null for better initialization.
- Updated proxy handling to use ProxyAgent, ensuring axios instance is recreated when the proxy changes.
- Simplified axios instance creation by directly using the current proxy agent.

* refactor: remove search enhanceMode

* fix: 知识库和网络搜索使用输出语言问题 (#5129)

* feat(proxy): use os-proxy-config to get system proxy info instead of resolveProxy (#5123)

* feat(proxy): integrate os-proxy-config for system proxy management

- Added os-proxy-config dependency to manage system proxy settings.
- Refactored setSystemProxy method to utilize getSystemProxy for improved proxy handling.

* fix lint error

* chore(version): 1.2.6

* fix: zipfile dependencies

* chore(release): update default release tag to v1.0.0 and install setuptools for Mac build

* disable auto update in portable exe

* chore(electron-builder): add StartupWMClass for CherryStudio in liunx desktop configuration (#5158)

chore(electron-builder): add StartupWMClass for CherryStudio in desktop configuration

* fix(MinApp): integrate dynamic background color for MinappPopupContainer (#5142)

* fix(models): 更新OpenRouter模型ID和名称,简化模型组分类 (#5172)

* fix: purify minapp user agent tag (#5173)

* fix: electron-builder 新增配置导致的无法构建的问题  (#5175)

fix: electron-builder 新增配置导致的无法构建的问题

当前 electron-builder 的版本为 "26.0.13",但在 v26 之后,StartupWMClass 等配置标签要在 desktop > entry 下,而不是直接在 desktop 下,否则会导致无法构建打包

* Revert "fix(minapps): remove AI Studio entry from default mini apps list" (#5177)

This reverts commit aed9c04c20.

* refactor(Markdown): remove rehype-sanitize and implement custom element filtering

- Removed rehype-sanitize dependency and its related configuration.
- Introduced ALLOWED_ELEMENTS and DISALLOWED_ELEMENTS for custom HTML element filtering.
- Updated rehypePlugins logic to conditionally apply plugins based on message content.
- Added encodeHTML utility function for HTML entity encoding.

# Conflicts:
#	src/renderer/src/pages/home/Markdown/Markdown.tsx

* refactor: mcp buttons and mcp settings

* refactor: add MessageTranslate.tsx & MessageCitations.tsx

* refactor: add MessageContent.main.tsx { getModelUniqId } from '@renderer/services/ModelService' import { Message, Model } from '@renderer/types' import { getBriefInfo } from '@renderer/utils' import { formatCitations, withMessageThought } from '@renderer/utils/formats' import { encodeHTML } from '@renderer/utils/markdown' import { Flex } from 'antd' import { clone } from 'lodash' import { Search } from 'lucide-react' import React, { Fragment, useMemo } from 'react' import { useTranslation } from 'react-i18next' import BarLoader from 'react-spinners/BarLoader' import styled, { css } from 'styled-components'

* refactor: enhance translation handling by integrating TranslationMessageBlock into Markdown and MessageTranslate components, and streamline TranslationBlock to utilize MessageTranslate for rendering.

* refactor: introduce citation processing optimization checklist and enhance citation handling

- Added a new refactoring checklist for optimizing citation processing logic.
- Implemented a lookup map for citations in MainTextBlock to improve performance.
- Updated Citation interface to include optional content field.
- Modified chunk types for web and knowledge search responses to improve type safety.
- Enhanced citation formatting to include content from web search results.

* refactor: update web search handling in GeminiProvider and OpenAIProvider

* refactor: update prompt handling and citation processing logic

* refactor: standardize chunk type usage across providers and improve image handling in MessageImage component

* refactor: update message operations and API service for improved message handling

- Translated comment in useMessageOperations.ts for clarity.
- Refactored ApiService to utilize findMainTextBlocks for knowledge base checks.
- Enhanced messageThunk with multi-model dispatch logic for better assistant response handling.

* refactor: optimize knowledge base ID handling in ApiService

- Removed unused store import and streamlined knowledge base ID extraction logic.
- Enhanced fetchExternalTool function to utilize mainTextBlocks for knowledge base checks, improving clarity and efficiency.

* feat: add message lifecycle documentation and enhance citation handling in CitationBlock component

* feat: add SearchingSpinner component and enhance message handling with ThinkingMessageBlock

- Introduced a new SearchingSpinner component for better user feedback during processing.
- Updated Markdown and MessageThought components to support ThinkingMessageBlock.
- Enhanced CitationBlock to display the SearchingSpinner when processing citations.
- Refactored message handling to include thinking time metrics across various components and services.

* refactor: enhance ApiService and message handling for improved search functionality

- Streamlined knowledge base ID extraction using flatMap for better performance.
- Added early checks for extractResults in search functions to prevent errors and improve logging.
- Updated chunk types to include SEARCH_IN_PROGRESS_UNION and SEARCH_COMPLETE_UNION for better state management during searches.
- Refactored search execution logic to handle different search scenarios more efficiently.

* refactor: streamline message update logic and enhance block handling

- Simplified message update dispatching by using the store's dispatch directly.
- Improved block transition handling by replacing direct calls with a dedicated function.
- Refactored conditional logic for updating blocks to ensure accurate state management.

* feat: enhance StreamProcessingService with tool call progress handling

- Added onToolCallInProgress callback to StreamProcessorCallbacks for handling tool call progress updates.
- Updated createStreamProcessor function to accept an empty object as default for callbacks.
- Implemented logic to process MCP_TOOL_IN_PROGRESS and MCP_TOOL_COMPLETE chunks in message handling.
- Improved type definitions for MCPToolInProgressChunk to include responses.

* refactor: enhance AI providers with abort controller integration for improved request handling

- Added abort controller functionality to AnthropicProvider, GeminiProvider, and OpenAIProvider to manage request cancellations effectively.
- Updated API calls to include signal for aborting requests, ensuring better control over ongoing operations.
- Improved cleanup logic to handle abort scenarios gracefully.

* feat: add TODO for pause capability in WebSearchService

- Added a TODO comment in WebSearchService to implement pause functionality for network searches, enhancing future service capabilities.

* fix(WebdavBackupManager): update modal confirmation to use window.modal and center content

* refactor: improve message operations and API service for enhanced functionality

- Updated useMessageOperations to dispatch resendMessageThunk with topic ID instead of object for better clarity.
- Refactored ApiService to streamline knowledge base ID extraction using flatMap and added early checks for improved error handling.
- Enhanced message handling in messageThunk by integrating topic queue management and simplifying error handling logic.
- Cleaned up commented-out code for better readability and maintainability.

* fix: enhance message resending functionality and integrate abort signal for web searches

- Updated resendMessageThunk to reset assistant messages without deleting other messages, improving user experience.
- Integrated abort signal handling in WebSearchService and fetch functions to manage request cancellations effectively.
- Refactored fetchWebContents and fetchWebContent to accept an optional abort signal for better control over fetch operations.
- Added resetAssistantMessage utility to streamline the resetting of assistant messages for regeneration.

* fix: enhance chunk handling in AI providers for improved message processing

- Added onChunk calls in AnthropicProvider and GeminiProvider to ensure complete text messages are processed correctly.
- Updated OpenAIProvider to handle finish reasons more accurately, improving message completion handling.
- Removed outdated TODO comment in WebSearchService for better code clarity.

* feat: enhance SearchingSpinner component and add processing text localization

- Updated SearchingSpinner to accept a text prop for dynamic message rendering.
- Added "processing" text localization in English, Japanese, Russian, Chinese (Simplified and Traditional) for improved user experience.
- Integrated updated SearchingSpinner in CitationBlock and MainTextBlock components to display appropriate loading messages.

* fix(WebdavBackupManager): update modal confirmation to use window.modal and center content

fix sse no headers

add eventSourceInit

refactor: switch from @vitejs/plugin-react to @vitejs/plugin-react-swc for improved performance

perf: improve streaming performance (#4986)

feat(ProviderSettings): move model provider to the top when toggled

When the model provider is toggled (OFF to ON), it is moved to the top of the provider setting for convenience. The change is minimal.

fix(settings): handle undefined content limit in BasicSettings component (#5252)

feat: update os-proxy-config to 1.1.2 and delete the patch (#5255)

updte os-proxy-config to 1.1.2 and delete the patch

feat: 添加嵌入维度配置 (#3947)

fix(ci): Remove a deleted step which make the nightly build pipeline fail

These lines were deleted in `release.yml` in commit 75f98608.

build: fix nightly build error

build: remove sentry integration

refactor(GeminiProvider): streamline abort signal handling and improve stream processing #5276

需要处理 GeminiProvider processStream 函数代码

https://github.com/CherryHQ/cherry-studio/pull/5276/files

Update @modelcontextprotocol/sdk to v1.10.2 (#5266)

- Removed MCPStreamableHttpClient.ts as it is now provided by the SDK.
- Adjusted imports in MCPService.ts to use the SDK's implementation.
- Updated yarn.lock to reflect the new SDK version.

feat: add cherry-text-logo.svg and remove npm.svg; update MCPSettings and NpxSearch components

- Introduced a new cherry-text-logo.svg file for branding.
- Removed the deprecated npm.svg file.
- Refactored MCPSettings and NpxSearch components to enhance functionality and UI, including state management and layout adjustments.
- Updated translations in multiple locales to include new types for MCP servers.

style(settings): update border-radius to use CSS variable for consistency

feat(mcp): mcp setting add service description page

chore: update dependencies and clean up code

- Reintroduced @mozilla/readability, @shikijs/markdown-it, and @xyflow/react to package.json.
- Updated shiki version to 3.2.2 in both package.json and yarn.lock.
- Removed trailing whitespace in IpcChannel.ts and index.ts for code cleanliness.
- Added outline style to .ant-tabs-tab-btn in ant.scss for improved UI consistency.

feat(WindowService): add maximize functionality and disable electron-window-state maxmize (#5292)

* feat(WindowService): add maximize functionality and clean up window close logic

- Introduced a new `maximize` option in the window state configuration.
- Added `setupMaximize` method to handle window maximization based on the launch state.
- Removed redundant logic from the window close event handler for clarity.

* add code

* update code

Create pull_request_template.md

feat: enhance MinAppIcon component with sidebar prop

- Added optional sidebar prop to MinAppIcon for conditional styling.
- Updated Sidebar component to pass sidebar prop to MinAppIcon for consistent appearance in sidebar context.

refactor(MessageAttachments): move styled component definition inside the component for better encapsulation

feat: support portable config dir (#5039)

* feat: support portable config dir

* fix: remove redundant mkdir

feat(image): support grok-2-image image and gpt-4o-image (#4767)

* feat(image): support grok image

* feat: add gpt-4o-image

* feat: 添加 gpt-image-1 到生成图像模型列表

* refactor(GeminiProvider): remove redundant onChunk call in processStream function

* refactor(OpenAIProvider): update image generation response format and improve prompt handling

* feat(AiProvider): implement thought processing for incremental reasoning and update MessageContent component

* refactor(useMessageOperations): update topic handling in resendUserMessageWithEditThunk and improve MessageMenubar component structure

* refactor(Messages): streamline message rendering and update type imports for better clarity

* refactor(Messages):  improve message block rendering logic

* refactor(Messages): enhance thinking time calculations

* refactor(Messages): enhance message usage estimation logic

* refactor(OpenAIProvider): get image generation usage

* refactor(Messages): optimize citation handling and improve main text block rendering

* refactor(Messages): improve clipboard copy functionality and streamline API response handling

* refactor(Messages): update message state management and improve selector usage for topic messages

* refactor(upgrades): update citation data structure in upgradeToV7 function and remove unused comments in messageBlock.ts

* feat(OpenAIProvider): enhance link conversion for web search results and refactor related logic in ApiService and messageBlock

* feat(translation): implement streaming translation updates and refactor translation handling

- Added a new `getTranslationUpdater` function to manage streaming translation updates.
- Refactored `translate` methods across various providers to support incremental updates.
- Updated `fetchTranslate` to accept content directly instead of a message object.
- Removed the `MessageContent.main.tsx` file as part of the cleanup.
- Enhanced error handling and logging during translation processes.

* feat(message-operations): add appendAssistantResponse functionality and enhance message operations

- Introduced `appendAssistantResponse` to allow appending new assistant responses using a specified model.
- Updated `useMessageOperations` hook to include the new function and improved documentation for existing methods.
- Refactored `MessageMenubar` to utilize the new `appendAssistantResponse` function for message handling.
- Enhanced error handling and logging in message-related thunks for better debugging and state management.

* feat(message): refactor message handling and enhance file block integration

- Updated `message_blocks` schema to include `file.id` for better file association.
- Refactored `FilesPage` to improve file deletion logic, ensuring related message blocks are updated or deleted accordingly.
- Enhanced `Inputbar` and `MessageAttachments` components to utilize new message structure and improve file handling.
- Removed deprecated `MessageCitations` component to streamline message management.
- Updated various components to use the new `MessageInputBaseParams` type for consistency across message operations.

* refactor(tests): clean up and organize formats test suite

- Removed commented-out code and unnecessary imports to enhance readability.
- Organized test cases for `escapeDollarNumber`, `escapeBrackets`, `extractTitle`, and `removeSvgEmptyLines` for better structure.
- Maintained existing test functionality while improving overall code clarity.

* refactor(tests): comment out unused tests in formats test suite

- Commented out the `withGeminiGrounding` test suite to improve clarity and focus on active tests.
- Removed unnecessary imports and organized the test structure for better readability.
- Maintained existing functionality while enhancing overall code organization.

* refactor(components): remove role prop from Markdown component in MessageThought and MessageTranslate

- Removed the `role` prop from the `Markdown` component in both `MessageThought` and `MessageTranslate` for consistency and to simplify the component usage.
- Updated import statements in `export.ts` to use type imports for `Message` and `Topic`, enhancing type safety.
- Commented out unused mock dependencies in the formats test suite to improve clarity and focus on active tests.

* refactor(messages): update message selection and handling for improved consistency

- Replaced legacy message selectors with new message handling methods in `ChatFlowHistory`, `ChatNavigation`, and `MessageAnchorLine` components.
- Utilized `getMainTextContent` utility for consistent message content retrieval across components.
- Updated state management in `messageThunk` to set the current topic ID correctly.
- Enhanced markdown export functions to utilize new message structure for better content handling.

* fix(databases): correct syntax in message_blocks schema for proper key separation

- Updated the `message_blocks` schema to include a comma separator between `messageId` and `file.id` for accurate primary key definition.
- Ensured consistency in database schema definitions to prevent potential issues during data retrieval.

* refactor(messages): enhance loading state handling and improve message block rendering

- Introduced a new `LoadingBlock` component to manage loading states for different message block types using `BeatLoader`.
- Updated `MessageContent` to display loading indicators when messages are pending.
- Cleaned up commented-out code and improved the structure of message block rendering logic.
- Adjusted `throttledBlockUpdate` and `throttledBlockDbUpdate` to prevent unnecessary updates when block statuses are already successful.
- Added error handling improvements in `fetchExternalTool` and `fetchAndProcessAssistantResponseImpl` for better robustness.

* refactor(messages): improve loading state handling in message block rendering

- Integrated `MessageBlockStatus` for better management of message block statuses.
- Added `LoadingBlock` component to handle loading states during message processing.
- Updated `fetchAndProcessAssistantResponseImpl` to set the status of tool blocks to `PROCESSING` for improved state tracking.
- Cleaned up commented-out code to enhance readability and maintainability of the rendering logic.

* refactor(messages): streamline message handling for clearing user messages

* feat(message-operations): add createTopicBranch functionality to clone messages to a new topic

- Implemented `createTopicBranch` in `useMessageOperations` to facilitate cloning messages from a source topic to a new topic.
- Introduced `cloneMessagesToNewTopicThunk` for handling the cloning process, including unique ID generation and database updates.
- Updated `Messages` component to utilize the new cloning functionality, ensuring proper topic management and error handling.
- Cleaned up unused imports and commented-out code in `MessageMenubar` for improved readability.

* fix(Messages): remove unused message operations in Messages component

- Removed `createNewContext` from the destructured message operations in the `Messages` component to clean up unused functionality.
- Added `getUserMessage` import to enhance message handling capabilities.

* 优化格式化和测试:重构消息处理和格式化功能

- 在 `formats.ts` 中移除未使用的 `withGeminiGrounding` 函数,并更新相关类型导入。
- 在测试文件中添加了对 `withGenerateImage` 和 `addImageFileToContents` 函数的测试,确保它们正确处理消息块和图像元数据。
- 通过创建辅助函数来简化测试数据的生成,提高测试的可读性和一致性。
- 清理了测试中的注释代码,提升了代码的整洁性。

* 优化消息处理和类型导入:更新消息相关组件以使用新消息类型

- 在多个组件中更新消息导入,确保使用 `newMessage` 类型以提高类型安全性。
- 移除未使用的 `CodeBlock` 组件,简化代码结构。
- 在 `SearchResults` 组件中引入 `getMainTextContent` 函数,以改进消息内容处理。
- 清理 `Suggestions` 组件中的冗余代码,提升可读性。
- 更新 `Message` 组件以支持新的消息处理逻辑,确保与助手消息状态的兼容性。

* feat(PlaceholderBlock): introduce PlaceholderBlock and Spinner component for loading states

- Added a new `Spinner` component to provide a visual loading indicator using `BarLoader` and `Search` icon.
- Replaced the deprecated `SearchingSpinner` with the new `Spinner` component in `CitationBlock` and `PlaceholderBlock` for improved consistency in loading states.
- Removed the unused `LoadingBlock` component to streamline the codebase.
- Updated `MessageContent` to enhance rendering logic by removing commented-out code and improving readability.

* feat:upgradeToV7 del catch

* fix:mini/message lint error

* feat(CitationsList): refactor citations rendering with Collapse component

- Replaced the direct rendering of citations with a Collapse component for better UI organization.
- Utilized useMemo for optimized rendering of citation items.
- Updated styling in CitationsContainer for improved layout.
- Enhanced PlaceholderBlock to use BeatLoader for loading state indication.

* fix(messageThunk): improve logging and cloneMessagesToNewTopicThunk functionality

- Updated debug logging to provide clearer information about topic retrieval and cloning process.
- Enhanced the cloning logic to correctly map askId for assistant messages, ensuring proper linkage in the new topic.
- Added checks to ensure file modifications only occur if the file exists, improving robustness.
- Cleaned up comments and improved readability in the cloneMessagesToNewTopicThunk function.

* fix(GeminiProvider): enhance image generation logic and response configuration (#5447)

* feat(GeminiProvider): enhance image generation logic and response configuration

* refactor(GeminiProvider): improve image generation logic readability

* feat(Message): enhance message handling and introduce MessageContent component

- Updated createAssistantMessage to remove unnecessary 'blocks' property from overrides.
- Refactored MessageItem to manage MainTextMessageBlock state and improve message processing logic.
- Added new MessageContent component for rendering message content with mentions and Markdown support.

---------

Co-authored-by: lizhixuan <zhixuan.li@banosuperapp.com>
Co-authored-by: one <wangan.cs@gmail.com>
Co-authored-by: ousugo <dkzyxh@gmail.com>
Co-authored-by: kangfenmao <kangfenmao@qq.com>
Co-authored-by: chenxi <16267732+chenxi-null@users.noreply.github.com>
Co-authored-by: suyao <sy20010504@gmail.com>
Co-authored-by: beyondkmp <beyondkmp@gmail.com>
Co-authored-by: Chen Tao <70054568+eeee0717@users.noreply.github.com>
Co-authored-by: Asurada <43401755+ousugo@users.noreply.github.com>
Co-authored-by: Roland <shlroland1995@gmail.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Co-authored-by: tchigher <34847046+tchigher@users.noreply.github.com>
2025-04-29 14:12:07 +08:00
Teo
8423fb5610 refactor(TopicsTab): Use onContextMenu instead of onMouseEnter (#5459)
refactor(TopicsTab): change mouse event from onMouseEnter to onContextMenu for setting target topic
2025-04-29 10:14:19 +08:00
kangfenmao
350c2735e4 refactor(Sidebar, McpSettingsNavbar): update icons and improve layout for better UI consistency 2025-04-29 09:35:02 +08:00
kangfenmao
f844a7e024 chore(version): 1.2.10 2025-04-29 09:12:13 +08:00
SuYao
74e7c6a327 fix(GeminiProvider): enhance image generation logic and response configuration (#5447)
* feat(GeminiProvider): enhance image generation logic and response configuration

* refactor(GeminiProvider): improve image generation logic readability
2025-04-29 09:02:39 +08:00
Akey Zhang
8c05b4f067 refactor: use the existing hook 2025-04-29 09:00:08 +08:00
kangfenmao
449d74040f refactor(McpSettings): streamline form layout and enhance advanced settings toggle functionality 2025-04-29 08:58:42 +08:00
xixiaxixi
712bd11274 feat: 允许功能键(F1-F19)可以被设置为快捷键而不需要修饰键 2025-04-29 08:01:21 +08:00
kangfenmao
cc89f5330a fix: update API key URL in provider configuration 2025-04-29 07:58:11 +08:00
SuYao
db7a7e2c2b fix(McpOAuthClientProvider): update redirect URL (#5449)
fix(McpOAuthClientProvider): update redirect URL to use 127.0.0.1 instead of localhost
2025-04-29 01:40:08 +08:00
Camol
d64ae18bfc chore: Update runtime version in VSCode launch configuration (#5434)
Co-authored-by: kanweiwei <kanweiwei@nutstore.net>
2025-04-28 18:48:00 +08:00
Akey Zhang
9f2ac4aa81 style: optimize mcp arg name display layout 2025-04-28 18:11:33 +08:00
Teo
e227fbf821 feat(TopicsTab): 简单方式优化话题列表切换卡顿问题 (#5436)
* feat(TopicsTab): refactor topic menu item handling and improve state management

* refactor(TopicsTab): enhance state management with useDeferredValue for target topic
2025-04-28 17:55:42 +08:00
beyondkmp
6595dc9a1e feat: update theme handling in ConfigManager and WindowService (#5433)
- Change default theme return value to 'auto' in ConfigManager.
- Adjust WindowService to set nativeTheme based on the updated theme configuration.
2025-04-28 16:52:56 +08:00
kangfenmao
d16235d916 feat: Add model notes functionality to provider context menu 2025-04-28 09:38:28 +08:00
africa1207
f5a7258229 feat: 增加模型备注功能 (#5392)
* feat: 增加模型备注功能

* fix: 移除未使用变量

---------

Co-authored-by: liutao <>
2025-04-28 09:11:55 +08:00
karl
dfd957434c fix(MCPService): Tool call failure caused by incorrect tool parameters 2025-04-28 09:05:49 +08:00
fullex
2e0d315ce4 refactor: simplify window.api definition (#5412)
* refactor(preload): remove unused index.d.ts file and export WindowApiType from index.ts

* fix: type def errors in original index.ts file
2025-04-28 09:02:14 +08:00
beyondkmp
47bde9eb36 fix(AppUpdater): update condition for checking available updates (#5417) 2025-04-27 22:22:31 +08:00
Chen Tao
506af6cfb9 revert: generate image button (#5414)
* revert: generate image button

* chore
2025-04-27 21:19:27 +08:00
beyondkmp
4e07faf520 fix: update electron-updater patch and refine content-type regex (#5416)
fix: update electron-updater patch and refine content-type regex in multipleRangeDownloader.js
2025-04-27 21:17:33 +08:00
木子不是木子狸
381377c0eb #4288 Added a "Copy" button next to each search result. (#5389)
Co-authored-by: eeee0717 <chentao020717Work@outlook.com>
Co-authored-by: Chen Tao <70054568+eeee0717@users.noreply.github.com>
2025-04-27 19:41:30 +08:00
Chen Tao
24f59047a5 chore: add grok image alias (#5408) 2025-04-27 17:07:36 +08:00
SuYao
e1a97ccd50 fix(OpenAIProvider): refine system message handling for specific model IDs (#5397)
* fix(OpenAIProvider): refine system message handling for specific model IDs

* refactor(OpenAIProvider): introduce OPENAI_NO_SUPPORT_DEV_ROLE_MODELS for model ID checks
2025-04-27 15:10:01 +08:00
LiuVaayne
f2929d44d8 feat(MCP): Add MCP resources dropdown in settings navbar (#5394)
* Add MCP resources dropdown in settings navbar

* Refactor MCP settings navbar with inline styles

- Replace styled-components with inline styles
- Update resource URLs and capitalize "Servers" in title
- Add noopener,noreferrer to external links
- Simplify component structure with direct Menu.Item usage
2025-04-27 14:32:27 +08:00
beyondkmp
bb02dca7e9 feat(MCPService): add method to find PowerShell executable path (#5393)
- Implemented `findPowerShellExecutable` to determine the correct PowerShell executable path on Windows.
- Updated `getSystemPath` to utilize the new method for improved path retrieval.
2025-04-27 14:25:37 +08:00
LiuVaayne
54cb4d7ac1 Feat/mcp enhancement (#5386) 2025-04-27 12:15:00 +08:00
karl
b76a609b97 fix(MCPSettings): fix mcp setting state error,fix mcp setting save searchKey lose (#5384) 2025-04-27 11:42:19 +08:00
AO2233
9cea0166e6 fix: Fix the image support for the GitHub Copilot models (#5379) 2025-04-27 01:55:19 +08:00
beyondkmp
e5e04c8132 feat: Enhance theme management with auto mode support (#5374)
- Updated IPC channel to handle 'auto' theme mode, allowing dynamic theme changes based on system preferences.
- Modified theme setting functions in preload scripts to accommodate the new 'auto' option.
- Adjusted Sidebar component to display an icon for 'auto' theme mode.
- Refactored ThemeProvider to manage theme state more effectively and listen for theme changes across windows.
2025-04-26 22:16:12 +08:00
Chen Tao
6b113c19a3 feat: Enable image generation in assistant based on model selection (#5364)
* feat: Enable image generation in assistant based on model selection

* chore: remove generate image button
2025-04-26 22:15:48 +08:00
kangfenmao
bcbb3f294e chore(version): 1.2.9 2025-04-26 15:45:48 +08:00
Song
e17765f1bf fix: more robust portable data dir setup logic (#5347) 2025-04-26 15:29:54 +08:00
kangfenmao
3064b7a3e3 feat: Update MCP server configurations with environment variables
- Adjusted MCP server definitions to include environment variable placeholders for MEMORY_FILE_PATH, BRAVE_API_KEY, and DIFY_KEY.
- Modified styling in SyncServersPopup to reduce gap between elements and removed unnecessary margin.
2025-04-26 11:29:51 +08:00
emaryn
da72a5706f feat: Implement deep linking for AppImage on Linux (#5360)
Signed-off-by: emaryn <197520219+emaryn@users.noreply.github.com>
Co-authored-by: emaryn <emaryn@users.noreply.github.com>
Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-04-26 11:19:53 +08:00
Chen Tao
261eeb097a feat: add dify knowledge mcp (#5290)
feat: add dify mcp
2025-04-26 11:19:22 +08:00
LiuVaayne
bf17e71445 feat: Add MCP server installation via URL protocol (#5351)
* Add MCP server installation via URL protocol

Implement handler for cherrystudio://mcp/install URLs to add MCP servers
from encoded configuration data. Supports multiple server configuration
formats and adds a new IPC channel for server addition.

* feat: Enhance MCP protocol handling and navigation

- Implemented navigation to the '/settings/mcp' page using executeJavaScript in the MCP protocol URL handler.
- Updated NavigationService to expose the navigate function globally for easier access in the application.
- Added NavigateFunction type to the global environment for improved type safety in navigation operations.

---------

Co-authored-by: kangfenmao <kangfenmao@qq.com>
2025-04-26 11:09:58 +08:00
SuYao
0744e42be9 feat(models): add new search models (#5349)
* feat(models): add new Perplexity search models and update Gemini search models

* fix(models): update Perplexity search model names for consistency
2025-04-25 22:57:39 +08:00
LiuVaayne
2833c377fa feat(McpServersList): add ModelScope sync functionality (#5250)
* feat: add sync servers functionality and UI components for MCP settings

* Rename 'Discover Models' to 'Discover MCP Servers'

Replace Radio button group with Select dropdown for provider selection
in the sync servers popup UI and update related styling
Rename 'Discover Models' to 'Discover MCP Servers'

* Add error messages for MCP server sync

Improve error handling in modelscopeSyncUtils with new localization
strings for unauthorized access and no available servers. Update error
message handling in all language files and use nanoid for unique server
naming.
2025-04-25 22:11:23 +08:00
eeee0717
ad5769f6b7 feat: add document count in create popup 2025-04-25 21:40:13 +08:00
木子不是木子狸
a6a4a32159 fix #5127
Signed-off-by: 木子不是木子狸 <richardllleeeee@gmail.com>
2025-04-25 21:23:58 +08:00
beyondkmp
a112b143e7 refactor(auto-update): should triggle download when checking for update manually (#5262)
refactor(auto-update): streamline update check logic and enhance error handling

- Moved update check logic from IPC handler to AppUpdater class for better organization.
- Improved error handling during update checks to ensure graceful failure.
- Removed redundant conditions in the AboutSettings component for cleaner rendering.
2025-04-25 21:21:44 +08:00
自由的世界人
a7ee3cbd02 Update issue-management.yml (#5314)
* Update issue-management.yml

* feat: enhance issue management with new templates and automated stale issue handling

* fix: update issue templates for clarity and consistency in descriptions

* fix: improve clarity in issue templates and add area labels for better categorization

* fix: reorder question template title for improved clarity and update issue-checker to remove redundant label handling

* fix: add skip and remove labels for kind/bug, kind/enhancement, and kind/question in issue-checker

* fix: remove redundant handling for needs-more-info labels in issue-checker
2025-04-25 21:18:17 +08:00
Miter
32f160444b 获取searxng搜索结果url的内容作为大模型回答的参考,而不是使用searxng搜索结果的摘要内容 2025-04-25 18:13:43 +08:00
beyondkmp
a546c265ee fix: update electron-updater to patch to support window arm upgrade (#5337) 2025-04-25 18:13:07 +08:00
kangfenmao
ea89a37b1d feat: update licensing terms and UI components
- Revised the licensing agreement to introduce a User-Segmented Dual Licensing model, detailing conditions for individual and organizational use.
- Enhanced UI components to display a specific empty state image in various popups and pages.
- Adjusted styles in MiniAppIconsManager and MiniAppSettings for improved layout and appearance.
- Updated default web search provider to 'local-bing' and modified font size in ProviderOAuth description for better readability.
- Changed window style setting from 'transparent' to 'opaque' for a more consistent user experience.
2025-04-25 17:50:33 +08:00
kangfenmao
c288b4a8d0 refactor: reorder llm providers 2025-04-25 17:16:40 +08:00
kangfenmao
e8384db91a refactor: remove ollama settings 2025-04-25 17:16:27 +08:00
kangfenmao
36c87451d9 feat: enhance OAuth provider settings with new functionality
- Added a new ProviderOAuth component to manage OAuth authentication and billing for providers.
- Updated existing components to integrate the new ProviderOAuth functionality.
- Enhanced internationalization support for OAuth-related texts across multiple languages.
- Introduced new utility functions for handling provider billing.
2025-04-25 16:55:36 +08:00
fullex
eaa37fe674 feat: open popup url in external browser (#4446)
* feat: open popup url in external browser

* fix: allow google auth popup internal

* feat: add functionality(including settings) to open links in external browser for webviews

* fix: set useragent globally

* fix: remove setUserAgent in webview

* fix: set Chrome version to newest
2025-04-25 09:45:54 +08:00
kangfenmao
308ad9f68f feat: update release notes with new features and fixes
- Added support for grok-2-image and gpt-4o-image.
- Enabled portable version of Windows to use the data directory for storage.
- Revamped MCP interface with new description display.
- Optimized Mermaid rendering logic.
- Added option to disable public rendering.
- Fixed OpenAI type rendering errors.
2025-04-25 09:44:13 +08:00
shiquda
62b6584d65 feat: support preview of MCP call results (#5236) 2025-04-25 08:59:41 +08:00
Chen Tao
5a44f6aca8 fix: image abort error and message render error (#5303) 2025-04-24 21:55:47 +08:00
dcai
4c6a904929 fix: Resolve unsafe map call in MessageContent.tsx (#5311) 2025-04-24 21:39:35 +08:00
kangfenmao
be4ef2990f chore(version): 1.2.8 2025-04-24 18:16:00 +08:00
kangfenmao
2807e71f1a docs: contributor guide 2025-04-24 18:14:21 +08:00
SuYao
a5f8ac8587 feat: add English contributor guide and update issue templates (#5300)
- Introduced a new English version of the contributor guide (CONTRIBUTING_EN.md) to enhance accessibility for non-Chinese speakers.
- Updated issue templates to use more specific labels (kind/bug, kind/enhancement, kind/question) for better categorization.
- Added a testing section in the developer guide to clarify testing procedures.
2025-04-24 18:04:45 +08:00
Chen Tao
4bd50251ff fix(openai): 修复OpenAI类型渲染错误 (#5263) 2025-04-24 17:51:13 +08:00
Chen Tao
f0d60052c4 feat(image): support grok-2-image image and gpt-4o-image (#4767)
* feat(image): support grok image

* feat: add gpt-4o-image

* feat: 添加 gpt-image-1 到生成图像模型列表
2025-04-24 17:26:15 +08:00
Song
84f4b565f3 feat: support portable config dir (#5039)
* feat: support portable config dir

* fix: remove redundant mkdir
2025-04-24 17:23:56 +08:00
kanweiwei
ebdacdde3e refactor(MessageAttachments): move styled component definition inside the component for better encapsulation 2025-04-24 17:06:35 +08:00
kangfenmao
aeb66195a0 feat: enhance MinAppIcon component with sidebar prop
- Added optional sidebar prop to MinAppIcon for conditional styling.
- Updated Sidebar component to pass sidebar prop to MinAppIcon for consistent appearance in sidebar context.
2025-04-24 17:03:12 +08:00
HuiZhang
53ef8b0f32 Create pull_request_template.md 2025-04-24 16:56:43 +08:00
beyondkmp
794c23f296 feat(WindowService): add maximize functionality and disable electron-window-state maxmize (#5292)
* feat(WindowService): add maximize functionality and clean up window close logic

- Introduced a new `maximize` option in the window state configuration.
- Added `setupMaximize` method to handle window maximization based on the launch state.
- Removed redundant logic from the window close event handler for clarity.

* add code

* update code
2025-04-24 16:55:51 +08:00
kangfenmao
62440cbfa1 chore: update dependencies and clean up code
- Reintroduced @mozilla/readability, @shikijs/markdown-it, and @xyflow/react to package.json.
- Updated shiki version to 3.2.2 in both package.json and yarn.lock.
- Removed trailing whitespace in IpcChannel.ts and index.ts for code cleanliness.
- Added outline style to .ant-tabs-tab-btn in ant.scss for improved UI consistency.
2025-04-24 16:39:09 +08:00
寇佳龙
39b723f143 feat(mcp): mcp setting add service description page 2025-04-24 15:55:43 +08:00
kangfenmao
bdc75f2f4e style(settings): update border-radius to use CSS variable for consistency 2025-04-24 15:18:53 +08:00
kangfenmao
eb3f136997 feat: add cherry-text-logo.svg and remove npm.svg; update MCPSettings and NpxSearch components
- Introduced a new cherry-text-logo.svg file for branding.
- Removed the deprecated npm.svg file.
- Refactored MCPSettings and NpxSearch components to enhance functionality and UI, including state management and layout adjustments.
- Updated translations in multiple locales to include new types for MCP servers.
2025-04-24 15:17:20 +08:00
LiuVaayne
6ba5768650 Update @modelcontextprotocol/sdk to v1.10.2 (#5266)
- Removed MCPStreamableHttpClient.ts as it is now provided by the SDK.
- Adjusted imports in MCPService.ts to use the SDK's implementation.
- Updated yarn.lock to reflect the new SDK version.
2025-04-24 15:05:42 +08:00
SuYao
1f588d242e refactor(GeminiProvider): streamline abort signal handling and improve stream processing (#5276) 2025-04-24 13:52:29 +08:00
kangfenmao
25b1e309ed build: remove sentry integration 2025-04-24 11:48:53 +08:00
kangfenmao
7a7b24fe2f build: fix nightly build error 2025-04-24 10:59:52 +08:00
Lucas
0686b2d813 fix(ci): Remove a deleted step which make the nightly build pipeline fail
These lines were deleted in `release.yml` in commit 75f98608.
2025-04-24 10:29:05 +08:00
Chen Tao
4a027892b9 feat: 添加嵌入维度配置 (#3947) 2025-04-24 10:18:23 +08:00
beyondkmp
be323b6304 feat: update os-proxy-config to 1.1.2 and delete the patch (#5255)
updte os-proxy-config to 1.1.2 and delete the patch
2025-04-24 09:24:08 +08:00
Asurada
2f5cfc0162 fix(settings): handle undefined content limit in BasicSettings component (#5252) 2025-04-24 02:58:36 +08:00
kabu1204
4a00eb57ad feat(ProviderSettings): move model provider to the top when toggled
When the model provider is toggled (OFF to ON), it is moved to the top of the provider setting for convenience. The change is minimal.
2025-04-24 00:04:30 +08:00
one
784b02e62e perf: improve streaming performance (#4986) 2025-04-24 00:02:04 +08:00
suyao
4c2c026f6d refactor: switch from @vitejs/plugin-react to @vitejs/plugin-react-swc for improved performance 2025-04-23 23:56:02 +08:00
Rocky LIU Yan
07b2c6f169 fix sse no headers
add eventSourceInit
2025-04-23 22:35:10 +08:00
kangfenmao
aafd04090e fix(WebdavBackupManager): update modal confirmation to use window.modal and center content 2025-04-23 22:33:18 +08:00
Teo
af10ae3f37 style: fix animation (#5243)
* style: fix animation

* fix(animation): correct animation name typos in multiple components
2025-04-23 22:31:26 +08:00
kangfenmao
3df4680c7b feat(mermaid): update Mermaid integration and improve rendering logic
- Upgraded Mermaid script to version 11.6.0.
- Refactored rendering logic to use a debounced function for improved performance.
- Added event listener for 'mermaid-loaded' to trigger rendering.
- Enhanced error handling during Mermaid chart rendering in both main and popup components.
- Removed unnecessary initialization calls and streamlined the use of theme settings.
2025-04-23 21:12:54 +08:00
kangfenmao
5d04ef2508 chore(release): increase Node.js memory limit in release workflow
- Added NODE_OPTIONS to set max-old-space-size to 8192 in the release workflow for Mac, Windows, and Linux builds.
2025-04-23 18:59:53 +08:00
beyondkmp
7fb6eb1949 feat(auto-update): improve auto-update toggle functionality (#5215)
* feat(auto-update): improve auto-update toggle functionality

- Added setAutoUpdate method in AppUpdater to control auto-update behavior.
- Updated IPC handler to set auto-update status based on user preference.
- Modified AboutSettings component to conditionally display update options based on auto-check setting.

* update autoupdate position
2025-04-23 16:13:55 +08:00
fullex
4fe99cddce fix: should give more time to init autosync (#5219) 2025-04-23 16:01:02 +08:00
beyondkmp
a84763def6 fix(proxy): update os-proxy-config patch to correct proxy URL handling (#5222)
* fix(proxy): update os-proxy-config patch to correct proxy URL handling

- Modified the os-proxy-config dependency in package.json to apply a patch.
- The patch updates the logic in getSystemProxy to correctly handle HTTP and SOCKS proxy settings.

* use http instead of https for https proxy
2025-04-23 15:53:25 +08:00
PilgrimLyieu
8125fac309 feat: add support for 'none' option in math engine settings (#5122) 2025-04-23 14:53:19 +08:00
kangfenmao
6c6b2f0b9e fix(sentry): update Sentry configuration and initialization logic
- Changed the organization in the Sentry Vite plugin configuration.
- Modified Sentry initialization in the main process to always check data collection settings.
- Simplified Sentry initialization in the renderer process by removing the packaged check.
2025-04-23 10:59:17 +08:00
kangfenmao
314be9b198 feat: add sentry integration 2025-04-22 22:05:56 +08:00
kangfenmao
409e0096d8 chore(version): 1.2.7 2025-04-22 20:39:14 +08:00
Chen Tao
a1ffabae41 fix(knowledge): fix citation bug and optimize extract logic (#5195)
* fix(knowledge): change search ui and fix search bug

* fix: knowledge citation

* feat: optimize extract logic
2025-04-22 20:17:11 +08:00
kangfenmao
0fa10627bc feat(BackupManager): replace AdmZip with archiver for improved backup compression and add extract-zip for unzipping functionality
- Updated BackupManager to use archiver for creating ZIP files, enabling better performance and support for large files.
- Integrated extract-zip for unzipping backup files, enhancing the backup restoration process.
- Adjusted progress reporting during backup and restore operations for better user feedback.
- Updated package.json and yarn.lock to include archiver and extract-zip dependencies.
2025-04-22 18:03:16 +08:00
eeee0717
80618b2331 fix(knowledge): change search ui and fix search bug 2025-04-22 16:10:03 +08:00
kangfenmao
bf8baedfcf feat(Messages): add MessageCitations and MessageTranslate components for citation and translation display
- Introduced MessageCitations component to handle and display citations from messages.
- Added MessageTranslate component to show translated content with loading state.
- Updated MessageContent to integrate new components and streamline citation formatting.
- Refactored citation handling logic in formats utility for improved performance and clarity.
- Enhanced MessageImage component to manage image download and clipboard copy functionality.

refactor(MCP): optimize MCP server handling in Inputbar and MCPToolsButton

wip

refactor(MCPSettings): streamline MCP server management and enhance UI components

- Removed unused imports and optimized state management for selected MCP servers.
- Introduced McpServersList component to encapsulate server listing and management logic.
- Updated routing to accommodate the new component structure.
- Adjusted styles for better layout and user experience in MCP settings.
2025-04-22 15:40:39 +08:00
SuYao
98f2c8a0b6 Revert "fix(minapps): remove AI Studio entry from default mini apps list" (#5177)
This reverts commit aed9c04c20.
2025-04-22 15:40:33 +08:00
tchigher
3887cf2a6f fix: electron-builder 新增配置导致的无法构建的问题 (#5175)
fix: electron-builder 新增配置导致的无法构建的问题

当前 electron-builder 的版本为 "26.0.13",但在 v26 之后,StartupWMClass 等配置标签要在 desktop > entry 下,而不是直接在 desktop 下,否则会导致无法构建打包
2025-04-22 15:40:33 +08:00
fullex
eb89c6ea21 fix: purify minapp user agent tag (#5173) 2025-04-22 15:40:33 +08:00
Roland
fd09edc2b9 fix(models): 更新OpenRouter模型ID和名称,简化模型组分类 (#5172) 2025-04-22 15:40:33 +08:00
kangfenmao
55a9447a7b refactor(Markdown): remove rehype-sanitize and implement custom element filtering
- Removed rehype-sanitize dependency and its related configuration.
- Introduced ALLOWED_ELEMENTS and DISALLOWED_ELEMENTS for custom HTML element filtering.
- Updated rehypePlugins logic to conditionally apply plugins based on message content.
- Added encodeHTML utility function for HTML entity encoding.
2025-04-22 11:00:27 +08:00
SuYao
c576aa5cb4 fix(MinApp): integrate dynamic background color for MinappPopupContainer (#5142) 2025-04-21 23:44:15 +08:00
Asurada
ca553a2454 chore(electron-builder): add StartupWMClass for CherryStudio in liunx desktop configuration (#5158)
chore(electron-builder): add StartupWMClass for CherryStudio in desktop configuration
2025-04-21 23:40:20 +08:00
beyondkmp
ef9c8fd037 disable auto update in portable exe 2025-04-21 20:14:07 +08:00
kangfenmao
234a5e085f chore(release): update default release tag to v1.0.0 and install setuptools for Mac build 2025-04-21 20:02:37 +08:00
kangfenmao
cb22b80ead fix: zipfile dependencies 2025-04-21 19:25:09 +08:00
kangfenmao
a6d9ad6716 chore(version): 1.2.6 2025-04-21 18:52:01 +08:00
beyondkmp
185900ada6 feat(proxy): use os-proxy-config to get system proxy info instead of resolveProxy (#5123)
* feat(proxy): integrate os-proxy-config for system proxy management

- Added os-proxy-config dependency to manage system proxy settings.
- Refactored setSystemProxy method to utilize getSystemProxy for improved proxy handling.

* fix lint error
2025-04-21 12:45:01 +08:00
Chen Tao
288ebe5222 fix: 知识库和网络搜索使用输出语言问题 (#5129) 2025-04-21 11:42:48 +08:00
kangfenmao
6e91066e5d refactor: remove search enhanceMode 2025-04-21 11:35:06 +08:00
beyondkmp
49a7b2dc8b refactor(AxiosProxy): improve proxy handling and initialization logic
- Changed cacheAxios from undefined to null for better initialization.
- Updated proxy handling to use ProxyAgent, ensuring axios instance is recreated when the proxy changes.
- Simplified axios instance creation by directly using the current proxy agent.
2025-04-21 11:26:13 +08:00
kangfenmao
4789ba3e8f feat: add PostHogProvider for analytics integration
- Introduced PostHogProvider to manage data collection based on user settings.
- Wrapped the main application in PostHogProvider to enable analytics when data collection is allowed.
2025-04-21 11:18:11 +08:00
kangfenmao
cc18f0f0c3 refactor: remove google analytics 2025-04-21 11:01:22 +08:00
chenxi
9bb96c212d fix: deepseek-reasoner does not support successive user or assistant messages in MCP scenario (#5112)
* fix: deepseek-reasoner does not support successive user or assistant messages in MCP scenario.

* fix: @ts-ignore
2025-04-21 09:04:47 +08:00
one
81eab1179b test: add vitest (#5085)
* test: migrate to vitest

* test: update vitest config

* test: updates tests for utils

* ci: fix test command

* test: add tests for format.ts

* test: add snapshots

* test: update snapshots

* test: add tests for linkConverter

* test: add tests for error.ts

* test: update test coverage script name

* test: update tests for prompt.ts

* test: re-group utils, add tests

* test: add tests for export.ts

* test: add tests for sort.ts
2025-04-20 22:44:01 +08:00
beyondkmp
24c9a8e8f1 refactor(locales): fix locales errors (#5080) 2025-04-20 21:27:49 +08:00
Pleasurecruise
c4d0f8e950 fix: language error 2025-04-20 19:03:06 +08:00
kangfenmao
3bdf0be4ad update(README): replace outdated screenshots in English, Japanese, and Chinese documentation 2025-04-20 15:50:58 +08:00
kangfenmao
9e4ebf7c6f Revert "refactor(ipc): remove Windows ARM update check from IPC handler and AboutSettings component"
This reverts commit d1c2bbed1b.
2025-04-20 11:32:59 +08:00
fullex
2408566d34 fix(AssistantSettings): temporarily disable transitionName to resolve modal closing issues in production 2025-04-20 11:20:15 +08:00
lossercode
cf61ae927c fix(MCPService):修复MCP server 请求头不生效 (#5072) 2025-04-20 11:18:34 +08:00
chenxi
60680936d3 feat: support escaping the comma character in the API key. (#5088)
feat: support escaping the comma character in the API key.
2025-04-20 10:25:28 +08:00
kangfenmao
5bfa13112a feat(locales): add locale cleanup functionality to after-pack script
- Introduced a new `remove-locales.js` script to handle the removal of unnecessary locale files based on the platform.
- Integrated the locale cleanup process into the `after-pack.js` script to ensure locales are managed during packaging.
2025-04-19 19:22:36 +08:00
kangfenmao
7f7db748a7 chore(version): 1.2.5 2025-04-19 18:58:53 +08:00
kangfenmao
55aac1cb9b lint: fix code format 2025-04-19 18:58:26 +08:00
kangfenmao
4663794ba6 feat(FeatureMenus, Footer): replace Ant Design icons with Lucide icons and enhance layout
- Updated icons in FeatureMenus from Ant Design to Lucide for improved visual consistency.
- Refactored Footer component to use Lucide icons and adjusted layout for better alignment and spacing.
- Enhanced styling of Tag components for a more cohesive design.
2025-04-19 18:54:17 +08:00
kangfenmao
e4de5331e0 Revert "feat: add chat message translate copy button (#4620)"
This reverts commit 8b462935b4.
2025-04-19 18:09:44 +08:00
kangfenmao
c7ed15684a feat(Messages): enhance citations display with improved styling and translation support
- Added a title for the citations list with translation using `useTranslation`.
- Introduced an `Info` icon next to the citations title.
- Updated the `CitationsContainer` styling for better visual appeal.
- Refactored citation rendering logic in `MessageContent` to streamline citation handling.
2025-04-19 17:44:44 +08:00
kangfenmao
1bb27ee3f9 feat: update Z.ai app configuration with additional styling and increment store version to 97 2025-04-19 17:28:23 +08:00
ousugo
579d7d1e5d refactor(ModelList): extract NameSpan component and adjust styling for better layout 2025-04-19 13:58:21 +08:00
one
36aa13c4f1 refactor: merge rehype plugins 2025-04-19 13:55:33 +08:00
one
c5161b9da4 refactor: use rehype-sanitize for html tags 2025-04-19 13:55:33 +08:00
karl
32c96daf1f feat: mcp configuration extraction logic optimization (#4918)
Co-authored-by: 寇佳龙 <koujialong@bonc.com.cn>
2025-04-19 10:45:22 +08:00
寇佳龙
30309c29ff fix: mcp search field redundancy 2025-04-19 10:39:44 +08:00
自由的世界人
8b462935b4 feat: add chat message translate copy button (#4620)
* feat: add chat message translate copy button

* Update MessageMenubar.tsx

* fix: copy button display
2025-04-19 10:36:57 +08:00
Simple4
d907344ca7 fix(obsidian): update title update logic 2025-04-19 10:24:45 +08:00
缘生
9b21c334cc feat: implement maximum backups feature in WebDAV settings (#5060)
* feat: implement maximum backups feature in WebDAV settings

- Add maximum backups feature to WebDAV settings

Signed-off-by: ysicing <i@ysicing.me>

* refactor: refactor backup file management for device-specific handling

- Change the order of hostname and device type in the backup file name
- Add filtering for backup files to manage device-specific backups
- Update logic to delete the oldest backup files based on the specific device count

Signed-off-by: ysicing <i@ysicing.me>

---------

Signed-off-by: ysicing <i@ysicing.me>
2025-04-19 10:22:03 +08:00
Asurada
3e1e814004 fix (UI): Resolve the issue of overly long file names and path names not being displayed correctly (#5054)
* feat(Messages): enhance file upload display with styled component for better UI

* feat(Inputbar): add file name truncation for better display in attachment preview

* feat(DataSettings): replace Typography.Text with PathText for improved path display and add text truncation styling

* feat(DataSettings): refactor path display with PathRow component for better layout and styling
2025-04-19 02:00:11 +08:00
Hantong Chen
1c5adc1329 feat(websearch): HTTP basic auth support for Searxng (#5009)
* feat(websearch): HTTP basic auth support for Searxng

* fix(websearch): schema migration

* refactor(i18n): update translations for basic authentication

* fix(websearch): 修正 `HTTP 认证` 相关翻译

* feat(websearch): 为 `HTTP 认证` 添加注释

---------

Co-authored-by: suyao <sy20010504@gmail.com>
2025-04-19 01:58:03 +08:00
SuYao
3360905275 feat: gemini reasoning budget support (#5052)
* feat(models): add Gemini 2.5 reasoning model identification and integrate reasoning effort logic in GeminiProvider

* feat(AiProvider): enhance usage tracking by adding thoughts_tokens and updating usage types
2025-04-19 01:27:20 +08:00
chenxi
0a28df132d fix(deepseek-reasoner) doesn't support successive user or assistant messages (#5051)
fix(deepseek-reasoner) does not support successive user or assistant messages
2025-04-19 01:21:27 +08:00
fullex
fd3d9f17b8 fix: should not download when autoupdate is false (#5029) 2025-04-18 16:28:20 +08:00
ousugo
73f8148a94 feat(models): update gemini model identification logic to be more general 2025-04-18 09:58:44 +08:00
fullex
456f0657a6 fix: Nutstore auto-sync when app starts (#5005)
feat: integrate Nutstore auto-sync functionality in initialization process
2025-04-17 21:57:24 +08:00
缘生
53f74725ed feat: add hostname retrieval for backup webdav (#5004)
fix #4705

Signed-off-by: ysicing <i@ysicing.me>
2025-04-17 21:21:39 +08:00
SuYao
4fa04a801a feat(UI): Support custcom css in mini window (#4255)
* feat(UI): enable custom CSS functionality with miniWindow

* feat(UI): implement custom CSS handling in IPC and update related components
2025-04-17 20:54:34 +08:00
Chen Tao
c5580f5b71 fix: knowledge citations (#4988) 2025-04-17 15:43:30 +08:00
one
f8f808c9f4 refactor: improve error boundary messsage (#4987) 2025-04-17 15:39:40 +08:00
ousugo
dbbd539207 fix(AddAgentPopup): update form handling and simplify prompt input layout 2025-04-17 15:30:42 +08:00
Asurada
703eae5777 fix(models): simplify OpenAI o-series model identification logic (#4985)
* fix(models): simplify OpenAI o-series model identification logic

* Update OpenAIProvider.ts

---------

Co-authored-by: Pleasurecruise <3196812536@qq.com>
2025-04-17 15:19:14 +08:00
Chen Tao
9438c8e6ff feat: LLM可以根据需求自行选择使用知识库或者网络搜索 (#4806) 2025-04-17 13:11:43 +08:00
beyondkmp
75f986087a chore(electron-builder): Simplify file renaming logic and remove space (#4919)
* chore(electron-builder): Disable universal installer option in NSIS configuration

* refactor(after-build): Change file handling to delete files with spaces and rename files in YAML data

- Updated the function to delete files containing spaces instead of renaming them.
- Enhanced YAML processing to rename files and their blockmaps, ensuring proper handling of setup and portable versions.
- Adjusted the final YAML output to reflect the new file names.

* refactor(after-build): Simplify file renaming logic and remove space handling script

- Updated the after-build script to rename artifact files by replacing spaces with hyphens.
- Removed the replace-spaces.js script as its functionality is now integrated into the after-build process.
- Adjusted the build process in package.json to reflect the changes in file handling.

* refactor(electron-builder): Update artifact build script reference and remove obsolete after-build script

- Changed the artifactBuildCompleted script reference in electron-builder.yml to point to the new script.
- Deleted the outdated after-build.js script, which is no longer needed for file handling.

* delete js-yml
2025-04-17 10:05:48 +08:00
Asurada
7ac8f480bb feat(models): add support for o3 and o4-mini models in vision and logo configurations (#4963) 2025-04-17 02:13:53 +08:00
SuYao
676ac21804 fix(GeminiProvider): update content configuration based on model type (#4960)
* fix(GeminiProvider): update content configuration based on model type

* chore(ApiService): comment out debug log for message output
2025-04-17 00:00:35 +08:00
SuYao
24ddd69cd5 refactor(Gemini): migrate generative-ai sdk to genai sdk (#4939)
* refactor(GeminiService): migrate to new Google GenAI SDK and update file handling methods

- Updated import statements to use the new Google GenAI SDK.
- Refactored file upload, retrieval, and deletion methods to align with the new SDK's API.
- Adjusted type definitions and response handling for improved type safety and clarity.
- Enhanced file listing and processing logic to utilize async iteration for better performance.

* refactor(GeminiProvider): update message handling and integrate abort signal support

- Refactored message content handling to align with updated type definitions, ensuring consistent use of Content type.
- Enhanced abort signal management for chat requests, allowing for better control over ongoing operations.
- Improved message processing logic to streamline user message history handling and response generation.
- Adjusted type definitions for message contents to enhance type safety and clarity.

* refactor(electron.vite.config): replace direct import of Vite React plugin with dynamic import

* fix(Gemini): clean up unused methods and improve property access

* fix(typecheck): update color properties to use CSS variables

* feat: 修改画图逻辑

* fix: import viteReact

---------

Co-authored-by: eeee0717 <chentao020717Work@outlook.com>
2025-04-16 23:13:22 +08:00
LiuVaayne
35c50b54a8 Feat/mcp oauth (#4837)
* feat: implement OAuth client provider and lockfile management

* feat: implement OAuth callback server and refactor authentication flow

* fix(McpService): restrict command handling to 'npx' for improved clarity

* refactor: make callbackPort optional in OAuthProviderOptions and clean up MCPService

* refactor: restructure OAuth handling by creating separate callback and provider classes, and remove unused utility functions
2025-04-16 22:07:32 +08:00
beyondkmp
ac0fe75078 chore: Update electron-builder configuration to remove architecture specifications for targets and adjust build scripts for Windows, macOS, and Linux to include both x64 and arm64 architectures. 2025-04-16 10:49:27 +08:00
nutstore-dev
f0c25f8108 refractor: nutstore sdk changed to JS version (#4913)
Co-authored-by: shlroland <shlroland1995@gmail.com>
2025-04-16 10:47:08 +08:00
W
c10e5a9ca4 fix: 快捷助手发起询问后没有清理掉输入框内的内容 (#4907) 2025-04-16 10:42:34 +08:00
Asurada
444abc9b88 fix(OpenAIProvider): Filter empty system prompts (#4896) 2025-04-16 02:15:06 +08:00
Cle2ment
2d130a8526 fix(ReadMe): the redirection error of the Maple Neon theme (#4893)
* 修复Maple Neon Theme的链接重定向错误.

* 修复中文和日语主题的排版错误,改为和英文README统一的列表.
2025-04-16 00:03:11 +08:00
liqihao
5061ee5c4d Fix(MCPService): 修复 getSystemPath 因硬编码 Shell 路径导致的兼容性问题 (#4853)
Fix(MCPService): Prioritize process.env.SHELL for PATH retrieval

Co-authored-by: liqihao <liqiha0@outlook.com>
2025-04-15 23:23:28 +08:00
心如止水自在如风
9e913f531c fix: MCP服务器添加server-filesystem时填写参数后启用时报错 (#4872)
fix: MCP服务器添加server-filesystem时填写地址后启用时报错

Co-authored-by: annan01 <annan01@qianxin.com>
2025-04-15 23:19:22 +08:00
Cle2ment
98130de8ac chore(README): 为各语言的README都添加了Maple-Neon主题. (#4891) 2025-04-15 23:14:14 +08:00
SuYao
b339b7b6d4 fix(OpenAIProvider): remove unnecessary o-series model stream restriction (#4889)
* fix(OpenAIProvider): remove unnecessary o-series model stream restriction

* lint(OpenAIProvider): remove redundant code
2025-04-15 22:53:34 +08:00
Hao He
eb8ee5ec02 feat(MessageContent): Add Collapsible Citations Display (#4285)
* feat(MessageContent): 添加引用内容折叠功能,优化用户界面交互

* feat(Citations): add hideTitle prop to control title visibility in CitationsList

* feat(Messages): add message update functionality and manage UI state for citations and web search

* fix: web search citation

---------

Co-authored-by: 自由的世界人 <3196812536@qq.com>
2025-04-15 22:47:20 +08:00
牡丹凤凰
a34e10cb0d Update README.ja.md 2025-04-15 19:45:40 +08:00
牡丹凤凰
fcae5b097b Update README.zh.md 2025-04-15 19:44:23 +08:00
牡丹凤凰
3cb339e480 Update README.md 2025-04-15 19:42:16 +08:00
SuYao
35224f5213 feat(model): add ModelCard schema and related types for input/output capabilities (#4812)
* feat(model): add ModelCard schema and related types for input/output capabilities

* refactor(model): make limits and price properties optional in ModelSchema

* feat(model): add textGeneration capability to ModelSchema
2025-04-15 19:40:13 +08:00
beyondkmp
b8b37fcd11 feat: integrate AxiosProxy for HTTP requests in rerankers and Copilot… (#4858)
* feat: integrate AoxisProxy for HTTP requests in rerankers and CopilotService

- Replaced direct axios calls with aoxisProxy in JinaReranker, SiliconFlowReranker, and VoyageReranker to utilize proxy settings.
- Introduced AoxisProxy service to manage axios instances with proxy configurations.
- Updated CopilotService to use aoxisProxy for API requests, ensuring consistent proxy handling across services.

* refactor(AxiosProxy): improve proxy handling and initialization logic

* fix tyop

* fix tyop
2025-04-15 18:42:31 +08:00
ousugo
615fda0547 fix(styles): add support for lucide icons in global styles 2025-04-15 17:44:50 +08:00
karl
0585d28312 feat/search mcp auto config (#4780)
feat: mcp search carry basic configuration

Co-authored-by: 寇佳龙 <koujialong@bonc.com.cn>
2025-04-15 16:05:17 +08:00
Teo
9ad40b9219 feat(QuickPanel): enhance pinyin filtering and improve input handling in QuickPanel 2025-04-15 15:58:44 +08:00
Asurada
18e99dee67 chore(issue-template): improve clarity and requirements in bug report checklist (#4847) 2025-04-15 13:29:16 +08:00
Asurada
43ef1d6815 feat(models): add gpt-4.1 model to visionAllowedModels (#4843) 2025-04-15 12:14:51 +08:00
Asurada
141904e61a feat(models): update GLM model list and add new GLM-Z1 reasoning models (#4836) 2025-04-15 11:07:17 +08:00
Chen Tao
247501c26c fix: websearch ui (#4840)
fix(ui)
2025-04-15 11:06:28 +08:00
自由的世界人
748252febc Update issue-management.yml (#4830)
* Update issue-management.yml

* Update issue-management.yml
2025-04-15 09:59:37 +08:00
自由的世界人
8ac4d07d6b feat: create issue-management.yml (#4822) 2025-04-15 04:03:01 +08:00
Asurada
5fbff8c1fe feat(Grok): add isGrokModel function and update systemMessage handling for Grok models (#4823) 2025-04-15 03:15:07 +08:00
Asurada
f0f44d5768 feat(Miniapp): add Z.ai mini app with logo and migration support (#4820) 2025-04-15 01:43:56 +08:00
beyondkmp
8c20bd6d8f update electron-builder to 26.0.13 2025-04-14 21:52:58 +08:00
kangfenmao
d1c2bbed1b refactor(ipc): remove Windows ARM update check from IPC handler and AboutSettings component 2025-04-14 20:04:48 +08:00
kangfenmao
f372ebe485 ci(after-build): move renameFilesWithSpaces call to the end of the process 2025-04-14 18:42:18 +08:00
kangfenmao
833873b95e chore(version): 1.2.4 2025-04-14 17:30:41 +08:00
LiuVaayne
1d211ee9f7 feat: mcp custom headers (#4800)
* Add support for custom HTTP headers in MCP servers

Allow users to configure custom HTTP headers for SSE and streamable HTTP
MCP server connections. This enables authentication and other API
requirements.

* Add custom headers i18n strings
2025-04-14 17:17:13 +08:00
LiuVaayne
c7ef2c5791 Feat/mcp tool response support image (#4787)
* Add typed MCPCallToolResponse interface and format converters

The commit introduces a structured response type for MCP tool calls with
proper handling for different content types (text, image, audio). It adds
provider-specific converter functions to transform tool responses into
the appropriate message format for OpenAI, Anthropic, and Gemini.

* Support vision models in tool call responses

Add isVisionModel parameter to tool response formatters to conditionally
handle content based on model capabilities. Non-vision models now receive
JSON stringified content, while vision models get proper multimedia parts.
2025-04-14 17:16:42 +08:00
kangfenmao
6e66721688 feat: add after-build script for renaming files and updating latest.yml
- Introduced a new script to rename files with spaces in the 'dist' directory.
- Updated 'latest.yml' to remove the first file entry and adjust paths accordingly.
- Enhanced build process for Windows to include the new script execution.
- Added js-yaml dependency for YAML file manipulation.
2025-04-14 17:14:45 +08:00
kangfenmao
ffc8a33ccf fix: emoji icon empty 2025-04-14 17:10:55 +08:00
Teo
81538a5446 feat: update icons in Inputbar and related components for consistency 2025-04-14 16:06:17 +08:00
fullex
e6b325dd88 fix: quickAssistant transalte not work by key select 2025-04-14 10:31:52 +08:00
kangfenmao
0e8c053cee feat: enhance styling and icon consistency across components 2025-04-14 09:34:13 +08:00
kangfenmao
24e46efa0c feat(migrate, websearch): enable enhanceMode in websearch and update migration logic 2025-04-14 09:34:13 +08:00
fullex
64200b00a9 fix: mac fullscreen changed when switch back through clicking dock icon 2025-04-13 23:34:55 +08:00
fullex
ab4fb7d1d6 fix: numpad enter not work 2025-04-13 23:34:20 +08:00
Reamd7
352731827c fix(MCPService): 增加获取系统 PATH 的功能, 修复 process.env.PATH 无法获取系统PATH的问题 (#4766) 2025-04-13 22:45:02 +08:00
LiuVaayne
e13a43d82a feat: Enhance web search with XML-based query extraction (#4770)
Add support for webpage summarization, direct URL references, and
better query processing using a structured XML format. Move web content
fetching to dedicated utility functions with improved error handling
and format options.
2025-04-13 22:42:14 +08:00
kangfenmao
e51de5b492 fix(Sidebar): rename Sparkle icon to Sparkles for consistency 2025-04-13 22:05:32 +08:00
africa1207
a54360cc69 feat: 优化webdav备份文件恢复管理功能 (#4699)
* feat: 优化webdav备份文件恢复管理功能

* fix: 恢复和删除操作更改为文字而非图标

* feat: 统一坚果云与webdav备份恢复功能
2025-04-13 21:52:16 +08:00
kangfenmao
88cbb27557 style(Sidebar, Messages, ModelSettings): update icon styles and clean up unused imports
- Added 'icon' class to various icons in Sidebar for consistent styling.
- Removed unused loading state from Messages component.
- Cleaned up iconStyle variable in ModelSettings as it was no longer needed.
2025-04-13 21:29:48 +08:00
LiuVaayne
e22d076d67 feat(MCP): add resource management features and localization support (#4746)
* feat(MCP): add resource management features and localization support

* feat(MCP): enhance resource handling with improved error messages and response structure

* fix(MCPToolsButton): add missing useEffect import for resource handling

---------

Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-04-13 21:08:57 +08:00
Teo
de7f806bbc hotfix: 优化一些issue反馈 (#4758)
feat(Inputbar, Settings): add backspace delete model functionality and localization updates

- Implemented a new setting to enable backspace key functionality for deleting models/attachments in the Inputbar.
- Added corresponding localization strings for English, Japanese, Russian, Chinese (Simplified and Traditional) in the i18n files.
- Updated the QuickPanelBody styling to inherit border-radius.
- Migrated the new setting to the state management for persistence.

Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-04-13 21:07:00 +08:00
kangfenmao
5f7d8652bc feat: new icon style 2025-04-13 21:03:19 +08:00
bjl101501
39c614e4db docs(README): Add 仿Claude样式主题 (#4751)
* Update README.md

* Add 仿Claude样式主题 in README.zh.md

* Add 仿Claude样式主题 in README.ja.md
2025-04-13 20:40:13 +08:00
George·Dong
412e8b03fc fix: Update dashscoop provider configuration and enhance model editing functionality (#4748)
* fix(provider config): update dashscoop new links

* feat(EditModelsPopup): add grouping function for bailian

* fix(isWebSearchModel): Correctly handle the priority of manually setting model support for web search
2025-04-13 20:38:25 +08:00
kangfenmao
486ccc1a15 fix(EditModelsPopup, ModelList): adjust avatar size and streamline model description rendering
- Reduced avatar size in ModelList for better alignment.
- Simplified rendering logic for model descriptions in EditModelsPopup to enhance readability.
2025-04-13 13:34:48 +08:00
kangfenmao
c6ab7b9326 style(MCPSettings): adjust layout and spacing in NpxSearch and MainContainer
- Updated MainContainer to use flex display for better layout.
- Increased margin in NpxSearch component for improved spacing.
- Adjusted ResultList to use two columns instead of three for better content presentation.
2025-04-13 11:00:07 +08:00
kangfenmao
41981acd77 feat(Settings): implement assistant icon type selection and localization updates 2025-04-13 10:45:47 +08:00
Teo
97ef7016d3 feat(AssistantItem): add emoji support and improve icon display logic 2025-04-13 10:01:03 +08:00
Teo
e4514bd04c refactor(AgentPage): Refactor AgentPage UI (#4737)
* refactor(AgentPage): Refactor AgentPage UI

* style(AgentCard): update HeaderInfoEmoji styling for improved layout and visual consistency

* fix(AgentCard): conditionally render HeaderInfoEmoji to prevent rendering of undefined

* feat(AgentsPage): add handleAddAgent function to streamline agent addition process

* style(AgentsPage): remove unnecessary whitespace in title rendering
2025-04-13 09:58:46 +08:00
王叔叔
f39bb9869b Update LICENSE (#4744) 2025-04-13 08:00:41 +08:00
purefkh
fc884d72af fix(UI): Correct citation tooltip style in light theme (#4738) 2025-04-12 21:48:14 +08:00
kangfenmao
883bdd6283 chore(version): 1.2.3 2025-04-12 20:47:08 +08:00
kangfenmao
fa19f41385 feat(Ipc): add architecture information and update check logic for Windows arm64 2025-04-12 20:42:20 +08:00
kangfenmao
8b95a131ec fix(SettingsTab): refine reasoning effort handling for Grok models
fix: #4735
2025-04-12 20:23:31 +08:00
kangfenmao
72e18fbcc1 feat(MCPSettings): enhance MCP server management and localization updates
- Added a new SVG icon for npm in the MCP settings.
- Introduced a custom hook `useMCPServer` for retrieving a specific MCP server by ID.
- Updated localization files to include new error messages for tool and prompt loading in English, Japanese, Russian, and Chinese.
- Refactored MCP settings components for improved navigation and state management, including the use of React Router for routing.
- Enhanced the Npx search functionality and UI for better user experience.
2025-04-12 19:47:36 +08:00
kangfenmao
b62c59eb52 style(SelectModelPopup): update background color animation for improved visual consistency 2025-04-12 17:02:17 +08:00
kangfenmao
ffe7702c1c style(QuickPanel): update font sizes and line height for improved readability 2025-04-12 16:41:39 +08:00
kangfenmao
1ed6320caf refactor(license.html): update structure and styling for improved readability and consistency 2025-04-12 16:41:26 +08:00
kangfenmao
315271ac35 Revert "fix(ChatNavigation): improve navigation button collapse functionality"
This reverts commit fb5ddaf9d5.
2025-04-12 16:12:34 +08:00
kangfenmao
0bd24f652d feat(NewContextButton): add styled container for responsive design
- Introduced a styled container to the NewContextButton component to hide it on smaller screens (max-width: 800px).
- Ensured the tooltip and button functionality remain intact while enhancing the component's layout.
2025-04-12 16:11:00 +08:00
kangfenmao
0e7c4e4bdd refactor(Inputbar, Messages): simplify clear topic functionality and improve message display logic
- Removed unused QuestionCircleOutlined icon and Popconfirm from Inputbar, replacing it with a direct button click for clearing topics.
- Refactored message display logic in Messages component to enhance clarity and maintainability, while preserving existing functionality.
2025-04-12 16:07:40 +08:00
kangfenmao
d4bf8da225 feat(CustomCollapse): enhance component with customizable styles and improve usage in EditModelsPopup 2025-04-12 15:57:50 +08:00
LiuVaayne
8eb6632620 Feat/improve UI mcp settings (#4717)
* feat(MCPSettings): implement server selection and navigation with back button

* chore(ui)

* chore(UI): npx search padding

* feat(NpxSearch): add server selection and navigation; update styles

---------

Co-authored-by: eeee0717 <chentao020717Work@outlook.com>
2025-04-12 15:31:52 +08:00
王叔叔
10225512f4 docs: Update LICENSE (#4723) 2025-04-12 15:31:33 +08:00
Hao He
76058bd749 feat(MessageTools): add error handling and status indicator for tool responses (#4712)
* feat(MessageTools): add error handling and status indicator for tool responses

* feat(i18n): add error message for tool invocation in English, Japanese, and Russian locales
2025-04-12 10:33:14 +08:00
Herio
a692ae7e9d fix(Messages): 调整ScrollContainer和Container的样式以减少底部空间 2025-04-12 10:28:06 +08:00
LiuVaayne
a70ca190ba Feat/mcp support MCP prompt (#4675)
* Add MCP prompt listing and retrieval functionality

* Add generic caching mechanism for MCP service methods

Refactor caching strategy by implementing a higher-order withCache function
to centralize cache logic and reduce code duplication. Separate implementation
details from caching concerns in listTools, listPrompts and getPrompt methods.

# Conflicts:
#	src/main/services/MCPService.ts

* Add MCP prompts listing feature

- Add IPC handlers for listing and getting prompts
- Create UI component to display available prompts in settings tab
- Improve error handling in MCP service methods

* fix(McpService): add error handling for tool and prompt listing methods

* feat(MCPSettings): enhance prompts and tools sections with improved UI and reset functionality

* feat(i18n): add tabs and prompts sections to localization files

* feat(MCPToolsButton): add MCP prompt list functionality to Inputbar

* feat(McpSettings, NpxSearch): improve user feedback with success messages on server addition

* feat(MCPService, MCPToolsButton): enhance prompt handling with caching and improved selection logic

* feat(MCPToolsButton): enhance prompt handling with argument support and error management

---------

Co-authored-by: Teo <cheesen.xu@gmail.com>
2025-04-12 10:27:48 +08:00
robot-AI
7c39116351 重构了memory.ts,增加了文件写入锁,解决了并行写入导致记忆文件错误的问题; (#4671)
优化了memory.json文件的加载过程,只加载一次,其它涉及图谱的操作均在内存中完成,提高效率;
注意新引入了async-mutex软件包,需要yarn install安装。
2025-04-11 22:03:57 +08:00
kangfenmao
04333535dd chore(version): 1.2.2 2025-04-11 14:43:02 +08:00
kangfenmao
a1dba93d27 feat(websearch): initialize subscribeSources in migrateConfig and update WebSearchState interface 2025-04-11 14:42:35 +08:00
Chen Tao
0842b7e84d fix(llm): rename settingsSlice to llmSlice for clarity (#4688) 2025-04-11 11:32:30 +08:00
kangfenmao
24d6d146c0 fix(scripts): update download URLs and default versions for bun and uv binaries 2025-04-11 11:25:37 +08:00
kangfenmao
978c3ea3cf feat(i18n): update subscription terminology in multiple languages for consistency 2025-04-10 22:12:27 +08:00
ousugo
a9eb235c43 refactor(SettingsTab): update reasoning effort change handler to use useCallback for performance optimization 2025-04-10 21:47:14 +08:00
ousugo
e0a47de8f7 feat(CodeBlock): add tooltips for collapse and copy buttons 2025-04-10 21:47:14 +08:00
ousugo
78a4696327 feat(models): add grok-3 support to FUNCTION_CALLING_MODELS 2025-04-10 21:46:48 +08:00
Asurada
57fa0aad38 feat(xAI): Add support for Grok-3-mini and update reasoning effort logic (#4657)
* feat(models): add grok-3-mini support and update reasoning effort logic in SettingsTab and OpenAIProvider

* feat(settings): update reasoning effort logic for Grok models and enhance localization in multiple languages

* fix(models): correct spelling of reasoning in model support functions

* fix(settings): correct spelling of reasoning_effort in OpenAIProvider
2025-04-10 18:43:20 +08:00
Chen Tao
2e0251aed7 feat: support ublacklist subscribe (#2974)
* feat: support ublacklist subscribe

* Merge branch 'main' into feat-ublacklist

* chore

* chore
2025-04-10 17:25:38 +08:00
ousugo
afd1381d7f refactor(CodeBlock): simplify header layout and adjust CollapseIcon position 2025-04-10 17:22:20 +08:00
LiuVaayne
c3b5cbee8f Clean up MCPService connections on app quit (#4647)
* Clean up MCPService connections on app quit

* Improve application shutdown error handling
2025-04-10 17:19:02 +08:00
kangfenmao
e1f255048e feat(models): add Qiniu models to SYSTEM_MODELS and update migration logic to initialize provider models
- Introduced new models for the Qiniu provider in SYSTEM_MODELS.
- Updated migration logic to populate Qiniu provider models if they are empty during state initialization.
2025-04-10 13:42:03 +08:00
kangfenmao
8a579be4c1 refactor(after-pack): rename function to keepArchNodeFiles and update logic for retaining architecture-specific node modules
close PR#4522
2025-04-10 13:15:41 +08:00
kangfenmao
efcffbaa30 feat(websearch): enhance web search provider settings and localization
- Updated web search provider settings to include API key and free status indicators.
- Improved localization for English, Japanese, Russian, Chinese, and Taiwanese languages to reflect new API key and free status fields.
- Refactored web search provider management to prevent duplicates and streamline provider addition during state migration.
- Adjusted UI components to conditionally render based on provider type, enhancing user experience.
2025-04-10 13:07:55 +08:00
LiuVaayne
f9c6bddae5 feat(search): support using google as default search provider (#4569)
* feat(websearch): implement search window functionality and enhance search service

* feat(DefaultProvider): integrate @mozilla/readability for improved content parsing

* Add LocalSearchProvider for web page scraping

AI: Change `provider` from private to protected in BaseWebSearchProvider and implement LocalSearchProvider for web searching with browser-based content extraction.

* Add web search provider management features

Implement addWebSearchProvider function to prevent duplicates,
automatically load default providers on initialization, fix
LocalSearchProvider implementation, and update local provider
identification logic.

* Improve web search with specialized search engine parsers

Add dedicated parsers for Google, Bing, and Baidu search results,
replacing the generic URL extraction approach. Enhance page loading
with proper wait mechanisms and window cleanup. Remove DuckDuckGo
provider as it's no longer supported.

* Simplify DefaultProvider to unimplemented placeholder

* Remove default search engine from initial state

* Improve web search providers config and display

Add configuration for local search providers, remove empty apiKey fields,
and enhance the UI by sorting providers alphabetically and showing
whether they require an API key.

* Add stderr logging for MCP servers

* Make search window initially hidden
2025-04-10 12:29:09 +08:00
司马琦昂
5e086a1686 fix: O3 config text-embedding-3-small duplicate 2025-04-10 10:20:34 +08:00
fullex
0db4c8b475 fix: [mac] issues related to fullscreen mode (#4618) 2025-04-10 09:02:53 +08:00
自由的世界人
d5fcef39d3 feat: add model provider logo upload (#4408)
* feat: add model provider logo upload

* Update index.tsx

* fix: upload image delete
2025-04-09 23:52:42 +08:00
kangfenmao
5c44f71684 refactor(ModelList): replace FileItem with ListItem and HStack for improved layout and styling 2025-04-09 20:42:36 +08:00
fullex
3462be2a2a fix:[mac] window level to show py input 2025-04-09 20:12:33 +08:00
Teo
a0be911dc9 feat: Optimize QuickPanel (#4604)
* feat(QuickPanel): enhance close action options and improve input handling

- Added 'enter_empty' as a new close action option for QuickPanel.
- Refactored input handling to include a delay before clearing search text after panel closure.
- Updated keyboard event handling to prevent default actions for specific keys.
- Improved styling for selected and focused states in QuickPanel components.
- Enhanced AttachmentPreview to utilize a separate FileNameRender component for better readability and functionality.

* feat(AttachmentPreview): enhance file icon rendering and styling

* feat(CustomTag): add closable functionality and improve styling

- Enhanced CustomTag component to support closable tags with an onClose callback.
- Updated styling for better visual integration and added hover effects for the close icon.
- Refactored usage of CustomTag in AttachmentPreview, KnowledgeBaseInput, and MentionModelsInput components for consistency.

* feat(SelectModelPopup, QuickPanel): update tag component and enhance search functionality

* feat(Inputbar, SettingsTab): add enable quick panel triggers setting and update translations

* feat(QuickPanel): integrate color library for dynamic styling and update package dependencies
2025-04-09 17:00:34 +08:00
magicdmer
f7f7d2bde8 fix: 解决聊天页面图片复制失败的问题和点击编辑回复的时候,不显示图片url的问题 (#4496)
* fix: 解决聊天页面图片复制失败的问题和点击编辑回复的时候,不显示图片url的问题

* fix: 解决chat模式,gemini-2.0-flash-exp-image-generation返回base64图片,无法复制的问题

* fix(MessageImage): Update the image copying feature to process base64 and URL formatted images based on their type

---------

Co-authored-by: magicdmer <magicdmer@163.com>
Co-authored-by: eeee0717 <chentao020717Work@outlook.com>
2025-04-09 16:23:25 +08:00
fullex
10efa444bf fix: missing ExportMenuOptions in persist leads to useSelector re-render a lot (#4593)
* fix: missing ExportMenuOptions in persist leads to useSelector re-render

* chore: cleanup
2025-04-09 13:54:15 +08:00
LiuVaayne
24e28b86cf feat(mcp): support MCP by prompt (#4476)
* feat: implement tool usage handling and system prompt building for AI providers

* refactor: streamline tool usage handling and remove unused code in OpenAIProvider and formats

* refactor: simplify tool usage handling in Anthropic and Gemini providers, and update prompt instructions

* refactor: remove unused function calling model checks and simplify MCP tools handling in Inputbar

* hidden tool use in message

* revert  import

* Add idx parameter to parseAndCallTools for unique tool IDs
2025-04-09 11:22:14 +08:00
Hao He
fa66d048d7 feat(AssistantsTab): add sorting functionality by Pinyin and update translations (#4507) 2025-04-09 09:23:11 +08:00
Vaayne
fe7a392116 fix(NpxSearch): update SearchResult type to use MCPServer type definition 2025-04-09 09:21:35 +08:00
Vaayne
c883fd85d8 feat(MCP): add StreamableHTTPClientTransport and update server type handling 2025-04-09 09:21:35 +08:00
suyao
aa73025568 feat(websearch): improve web search enablement logic 2025-04-09 09:19:42 +08:00
ZhuangYumin
9689f00214 fix: fix main-window fake show up in Wayland KDE 2025-04-09 00:12:33 +08:00
kangfenmao
3674cc4afe chore(version): 1.2.1 2025-04-08 23:19:52 +08:00
kangfenmao
1f21b99820 feat(ModelTagsWithLabel): enhance tag component styling and update layout
- Improved icon size handling in the ModelTagsWithLabel component for better visual consistency.
- Adjusted the layout of the tags to prevent wrapping and added horizontal scrolling for better usability.
- Updated the EditModelsPopup to increase its width for improved content display.
- Removed unnecessary CustomTag usage in ModelList for cleaner code.
2025-04-08 21:32:17 +08:00
kangfenmao
a3e10dd116 chore(version): 1.2.0 2025-04-08 20:29:54 +08:00
SuYao
ab1a5f18c9 feat(websearch): add overwrite functionality for search service (#4530)
* feat(websearch): add overwrite functionality for search service

- Introduced new settings to allow users to override the default search service.
- Updated localization files for English, Japanese, Russian, Simplified Chinese, and Traditional Chinese to include new overwrite options and tooltips.
- Modified relevant components and services to support the new overwrite feature in the web search settings.

* feat(websearch): enhance web search model integration

* chore(websearch): unnecessary return
2025-04-08 20:07:00 +08:00
kangfenmao
2a0d6eb08a feat: update dangbei miniapp integration and version bump
- Added `bodered` property to the dangbei miniapp configuration.
- Refactored migration logic to utilize a new `addMiniApp` function for cleaner code.
- Incremented store version from 91 to 92 for migration compatibility.
2025-04-08 19:59:32 +08:00
DemonJun
f78663f815 feat: add dangbei miniapp (#4552)
* feat: add dangbei miniapp

* compressed logo file

---------

Co-authored-by: demonjun <demonjun@foxmail.com>
2025-04-08 19:46:26 +08:00
kangfenmao
8bcb31071e feat(CustomCollapse, KnowledgeContent): enhance collapsible behavior and UI updates
- Added `activeKey` prop to `CustomCollapse` for better control over active panels.
- Updated styles in `CustomCollapse` for improved visual consistency.
- Refactored `KnowledgeContent` to include expand/collapse functionality for file and directory sections, enhancing user experience.
- Added translations for "collapse" in multiple languages.
- Minor style adjustments across various components for better UI consistency.
2025-04-08 19:38:15 +08:00
Teo
3aaa1848f0 style(ProviderSettings): Refactor ProviderSettings UI (#4475)
* chore(version): 1.1.19

* style(ProviderSettings): Refactor ProviderSettings UI

* style(CustomTag, ModelTagsWithLabel): enhance layout and styling for better UI consistency

* refactor(CustomTag, ModelTagsWithLabel, MentionModelsButton): update props handling and improve component usage

* feat(CustomTag, ModelTagsWithLabel): add tooltip support and improve label visibility based on container size

* fix(ModelTagsWithLabel): adjust maxWidth for non-Chinese languages to improve layout

* style(ModelList): add text overflow handling for list item names

* feat(ModelList): enhance group label with item count using CustomTag

* feat(FileItem): add style prop for customizable background color in FileItem component

* style(index.scss): update border color variables for improved UI consistency

* style(EditModelsPopup): update background color for model items to enhance visual distinction

* style(HealthCheckPopup): update button size for improved usability

* feat(CustomCollapse): add collapsible prop to customize collapse behavior

* chore: remove hover models color

---------

Co-authored-by: kangfenmao <kangfenmao@qq.com>
Co-authored-by: eeee0717 <chentao020717Work@outlook.com>
2025-04-08 19:37:11 +08:00
Vaayne
037027f1f4 fix(McpService): improve client connection handling with error logging 2025-04-08 17:28:09 +08:00
suyao
97c1d67cbf fix(formats): add optional chaining for grounding support properties to prevent errors 2025-04-08 17:27:06 +08:00
suyao
d38c4c7368 fix(MessageContent): handle optional chaining for grounding metadata and citations 2025-04-08 17:27:06 +08:00
Hamm
b1bd5d0531 refactor(reranker): 重构重排序功能以提高可维护性 (#4539)
* refactor(reranker): 重构重排序功能以提高可维护性

- 将 BaseReranker 类中的公共逻辑提取到受保护的方法中
- 优化了 JinaReranker、SiliconFlowReranker 和 VoyageReranker 的实现
- 新增 getRerankUrl 和 getRerankResult 方法以提高代码复用性
- 简化了重排序结果的处理逻辑

* refactor(reranker): 将 formatErrorMessage 方法的访问权限改为受保护

- 将 formatErrorMessage 方法的访问权限从公共 (public) 改为受保护 (protected)
- 这一更改限制了方法的访问范围,仅允许子类访问该方法
- 有助于提高代码的封装性和安全性
2025-04-08 16:53:31 +08:00
one
1fcee6c829 fix: wrap inline code 2025-04-08 09:26:37 +08:00
MyPrototypeWhat
cbcebdc87a fix(NpxSearch): update search result mapping to use record name as ke… (#4491)
fix(NpxSearch): update search result mapping to use record name as key and handle optional search results

Co-authored-by: lizhixuan <zhixuan.li@banosuperapp.com>
2025-04-07 19:45:40 +08:00
kangfenmao
96df9f6979 chore(version): 1.1.19 2025-04-07 16:04:48 +08:00
kangfenmao
4ef9d52694 Revert "refactor(Navbar): replace FormOutlined with SearchOutlined and update tooltip functionality"
This reverts commit d8baf378ea.
2025-04-07 14:34:12 +08:00
kangfenmao
41b9f8dbd5 feat(mcp): add automatic MCP server registration for auto-install tool
- Implemented functionality to automatically register MCP servers when the '@cherry/mcp-auto-install' tool is called.
- Utilized nanoid for unique server ID generation and dispatched the new server to the Redux store.
2025-04-07 14:33:43 +08:00
kangfenmao
8191791036 refactor(mcp): move inMemory servers to npx search scope
- Updated error handling in FileSystemServer to throw errors instead of exiting the process.
- Enhanced MCPService to use a more flexible server name check and updated the path for MCP_REGISTRY_PATH.
- Refined Inputbar to conditionally set enabled MCPs only if they are not empty.
- Cleaned up MCPToolsButton and MCPSettings by removing unused imports and effects.
- Updated NpxSearch to include a new npm scope and improved search result handling.
- Enhanced builtin MCP server descriptions for better clarity.
2025-04-07 14:07:01 +08:00
fullex
99b37f2782 perf: remove unused codes related to minapp (#4444) 2025-04-07 09:51:10 +08:00
fullex
da49c3ddd3 fix: remove sidebar minapp animation to stop gpu high load 2025-04-07 09:37:10 +08:00
one
6891068ca1 perf: prevent unnecessary reflow 2025-04-07 09:36:46 +08:00
kangfenmao
b361001f39 fix(WindowService): conditionally hide dock icon for macOS when closing to tray 2025-04-06 21:32:56 +08:00
kangfenmao
3823912b3e feat(i18n): add user and system labels to multiple language files 2025-04-06 21:27:37 +08:00
one
b5ad77e70c fix: LRU cache import 2025-04-06 21:11:37 +08:00
eeee0717
3491eec86b fix(websearch): improve error handling and response validation 2025-04-06 21:03:38 +08:00
kangfenmao
581ad5fbda feat: add qiniu ai provider 2025-04-06 18:50:35 +08:00
Teo
90424808ab refactor(Inputbar): streamline Backspace handling and update knowledge base management 2025-04-06 18:49:50 +08:00
kangfenmao
c884b11f01 feat(MCPSettings): enhance server management with segmented control and improved layout 2025-04-06 16:59:09 +08:00
kangfenmao
a530ce652e fix(useAssistant): ensure safe access to assistant ID in setModel callback 2025-04-06 14:40:32 +08:00
Shelly
9c052dee5c fix: 🐛 LRUCache export name error (#4420)
BREAKING CHANGE: 🧨 SyntaxError: The requested module
'/@fs/Users/bary/code/tools/cherry-studio/node_modules/.vite/deps/lru-cache.js?v=9139ab94'
does not provide an export named 'LRUCache' (at
CodeCacheService.ts:2:10)
2025-04-06 12:41:30 +08:00
LiuVaayne
1085c11240 bugfix(MCP): ensure memory path exists on initialization and remove unused… (#4418)
* bugfix: ensure memory path exists on initialization and remove unused everything mcp server

* refactor(factory): remove unused EverythingServer import and case

* fix(CodeCacheService): update import statement for LRUCache to default import

Error: src/renderer/src/services/CodeCacheService.ts(2,10): error TS2595: 'LRUCache' can only be imported by using a default import.
2025-04-06 12:40:51 +08:00
kangfenmao
ae6097a29e chore(dependencies): update libsql and add sindresorhus/is package
- Updated libsql patch reference in package.json.
- Added sindresorhus/is package to yarn.lock with version 7.0.1.
- Removed duplicate sindresorhus/is entry from yarn.lock.
2025-04-06 10:51:41 +08:00
kangfenmao
d74f05f27e refactor(Inputbar, Markdown): optimize citation handling and improve performance
- Refactored AttachmentButton to use useMemo for extensions calculation.
- Simplified citation extraction in Markdown by moving logic to a new utility function.
- Updated TopicsTab dependencies for better performance and reactivity.
2025-04-06 10:49:52 +08:00
Sophon
8501ab82c6 build: Add support for Windows ARM64 platform (#3431)
Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-04-06 09:35:08 +08:00
SuYao
f2ca56a088 feat(UI, OpenAI): support OpenAI-4o-web-search add support for web search citations (#3524)
* feat(UI, OpenAI): support  OpenAI 4o web search add support for web search citations

- refactor: Introduced a new CitationsList component to display citations in MessageContent.
- feat: Enhanced message handling to support web search results and annotations from OpenAI.
- refactor: Removed the deprecated MessageSearchResults component for cleaner code structure.
- refactor: Added utility functions for link conversion and URL extraction from Markdown.

* chore: remove debug logging from ProxyManager

* revert(OpenAIProvider): streamline reasoning check for stream output handling

* chore(OpenAIProvider): correct placement of webSearch in response object

* fix(patches): update OpenAI package version and remove patch references

- Integrated dayjs for dynamic date formatting in prompts.ts.

* feat(Citation, Favicon): enhance OpenAI web search support and citation handling

- Improved FallbackFavicon component to cache failed favicon URLs.
- Support all web search citation preview
- Added support for Hunyuan search model in OpenAIProvider and ApiService.

* refactor(provider/AI): move additional search parameters to AI Provider
2025-04-06 09:11:59 +08:00
kangfenmao
e02c967f5b fix(Markdown): Conditionally apply MarkdownShadowDOMRenderer for style components based on message content 2025-04-06 09:11:23 +08:00
PilgrimLyieu
7284679907 feat: Support bottom anchor in message anchor line 2025-04-06 08:50:05 +08:00
George·Dong
56e9a7371a refactor(export): 添加导出菜单选项设置、思维链导出功能 (#4168)
* refactor(settings): Add export menu setting & optimize data settings page

* feat: add dynamic export menu options from Redux state in MessageMenubar and TopicsTab

* feat(export): Add export to markdown with reasoning method

* feat(export): optimize reasoning style

* feat(export): Add export to markdown with reasoning to export menu

* feat(i18n): Update i18n for new export options

---------

Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-04-06 08:43:54 +08:00
one
95639df35c perf(CodeBlock): improve long codeblock loading experience (#4167)
* perf(CodeBlock): improve long codeblock loading experience

* refactor: use requestIdleCallback rather than observer

* refactor: simplify setting expanded and unwrapped

* refactor: simplify logic

* refactor: revert to observer

* fix: turn mermaid listener to passive to avoid scrolling performance downgrade

* feat: add lru cache for syntax highlighting

* refactor: adjust cache options

* feat: add highlighter cache

* fix: highlighter should be loaded before highlighting

* refactor: reduce cache time

* refactor: adjust cache size and hash

* refactor: decrease cache size

* fix: restore the behaviour of ShowExpandButton

* fix: check streaming status

* fix: empty code

* refactor: improve streaming check

* fix: optimizeDeps excludes

* refactor: adjust cache policy

* feat: add a setting for code caching

* feat: add more settings for code cache

* fix: initialize service

* refactor: prevent accident cache reset, update settings

* refactor: update code cache service

* fix: revert unecessary changes

* refactor: adjust cache settings

* fix: update migrate version

* chore: update to shiki v3

* fix: import path

* refactor: remove highlighter cache, improve fallbacks

* fix: revert path changes

* style: fix lint errors

* style: improve readability

* style: improve readability

* chore: update migrate version

* chore: update packages
2025-04-06 08:38:02 +08:00
PeterWang-dev
641dfc60b0 feat(icons): explicitly add icons in multiple resolutions to correct appimage icon path 2025-04-06 08:28:10 +08:00
kangfenmao
46c7df6f5b refactor(GraphRAG): Remove GraphRAG related files and references from the project 2025-04-06 08:11:10 +08:00
one
b828d1f54f perf(QuickPanel): improve search responsiveness (#4406) 2025-04-06 01:06:54 +08:00
kangfenmao
d9abfc5443 feat(database): Add version 6 with new 'files' store and update existing stores 2025-04-05 20:59:36 +08:00
kangfenmao
7364646caa feat(MCPSettings): Reset form change state on server ID change and disable server type selection for inMemory servers 2025-04-05 20:58:36 +08:00
kangfenmao
5fa7465174 refactor(Inputbar): Update file name handling in AttachmentPreview, adjust padding in Inputbar, and enhance textarea expansion logic 2025-04-05 20:33:44 +08:00
Teo
bc02727633 feat(QuickPanel): Optimize QuickPanel (#4404)
feat(QuickPanel): Add footer resizing and improve item action handling
2025-04-05 20:19:43 +08:00
kangfenmao
c76f274562 feat: google analytics 2025-04-05 16:07:04 +08:00
Teo
f9be0e0d26 feat(QuickPanel): Add new feature QuickPanel, unify input box operation. (#4356)
* feat(QuickPanel): Add new feature QuickPanel, unify input box operation.

* refactor(Inputbar): Remove unused quickPanelSymbol reference and update navigation action in KnowledgeBaseButton

* fix(Inputbar): Prevent translation action when input text is empty and reorder MentionModelsInput component

* refactor(Inputbar): Add resizeTextArea prop to QuickPhrasesButton for better text area management

* feat(i18n): Add translation strings for input actions and quick phrases in multiple languages

* feat(Inputbar): Enhance AttachmentButton to support ref forwarding and quick panel opening

* feat(i18n, Inputbar): Add upload file translation strings and enhance file count display in multiple languages

* style(QuickPanel): Update background color for QuickPanelBody and add dark theme support

* fix(Inputbar): Update upload label for vision model support

* feat(QuickPanel): Add outside click handling and update close action type

* feat(QuickPanel): Improve scrolling behavior with key press handling and add PageUp/PageDown support

* feat(i18n): Add translation strings for menu description in multiple languages

* refactor(QuickPhrasesButton): simplify phrase mapping by removing index-based disabling

* fix(QuickPanel): correct regex pattern for search functionality

* refactor(QuickPanel): remove searchText state and related logic for cleaner context management

* refactor(QuickPanel): enhance search text handling and input management

* refactor(Inputbar): update file name handling in AttachmentPreview and Inputbar components
2025-04-05 16:05:28 +08:00
LiuVaayne
ea059d5517 feat(mcp): add in-memory MCP server support and configuration management (#4359) 2025-04-05 14:17:56 +08:00
kangfenmao
9c6de71fbb lint: fix eslint error 2025-04-05 10:52:45 +08:00
Hamm
3290ac4b1b refactor(Constants): 优化一些常量和枚举值 (#3773)
* refactor(main): 使用枚举管理 IPC 通道

- 新增 IpcChannel 枚举,用于统一管理所有的 IPC 通道
- 修改相关代码,使用 IpcChannel 枚举替代硬编码的字符串通道名称
- 此改动有助于提高代码的可维护性和可读性,避免因通道名称变更导致的错误

* refactor(ipc): 将字符串通道名称替换为 IpcChannel 枚举

- 在多个文件中将硬编码的字符串通道名称替换为 IpcChannel 枚举值
- 更新了相关文件的导入,增加了对 IpcChannel 的引用
- 通过使用枚举来管理 IPC 通道名称,提高了代码的可维护性和可读性

* refactor(ipc): 调整 IPC 通道枚举和预加载脚本

- 移除了 IpcChannel 枚举中的未使用注释
- 更新了预加载脚本中 IpcChannel 的导入路径

* refactor(ipc): 更新 IpcChannel导入路径

- 将 IpcChannel 的导入路径从 @main/enum/IpcChannel 修改为 @shared/IpcChannel
- 此修改涉及多个文件,包括 AppUpdater、BackupManager、EditMcpJsonPopup 等
- 同时移除了 tsconfig.web.json 中对 src/main/**/* 的引用

* refactor(ipc): 添加 ReduxStoreReady 事件并更新事件监听

- 在 IpcChannel 枚举中添加 ReduxStoreReady 事件
- 更新 ReduxService 中的事件监听,使用新的枚举值

* refactor(main): 重构 ReduxService 中的状态变化事件处理

- 将状态变化事件名称定义为常量 STATUS_CHANGE_EVENT
- 更新事件监听和触发使用新的常量
- 优化了代码结构,提高了可维护性

* refactor(i18n): 优化国际化配置和语言选择逻辑

- 在多个文件中引入 defaultLanguage 常量,统一默认语言设置
- 调整 i18n 初始化和语言变更逻辑,使用新配置
- 更新相关组件和 Hook 中的语言选择逻辑

* refactor(ConfigManager): 重构配置管理器

- 添加 ConfigKeys 枚举,用于统一配置项的键名
- 引入 defaultLanguage,作为默认语言设置
- 重构 get 和 set 方法,使用 ConfigKeys 枚举作为键名
- 优化类型定义和方法签名,提高代码可读性和可维护性

* refactor(ConfigManager): 重命名配置键 ZoomFactor

将配置键 zoomFactor 重命名为 ZoomFactor,以符合命名规范。
更新了相关方法和属性以反映这一变更。

* refactor(shared): 重构常量定义并优化文件大小格式化逻辑

- 在 constant.ts 中添加 KB、MB、GB 常量定义
- 将 defaultLanguage 移至 constant.ts
- 更新 ConfigManager、useAppInit、i18n、GeneralSettings 等文件中的导入路径
- 优化 formatFileSize 函数,使用新定义的常量

* refactor(FileSize): 使用 GB/MB/KB 等常量处理文件大小计算

* refactor(ipc): 将字符串通道名称替换为 IpcChannel 枚举

- 在多个文件中将硬编码的字符串通道名称替换为 IpcChannel 枚举值
- 更新了相关文件的导入,增加了对 IpcChannel 的引用
- 通过使用枚举来管理 IPC 通道名称,提高了代码的可维护性和可读性

* refactor(ipc): 更新 IpcChannel导入路径

- 将 IpcChannel 的导入路径从 @main/enum/IpcChannel 修改为 @shared/IpcChannel
- 此修改涉及多个文件,包括 AppUpdater、BackupManager、EditMcpJsonPopup 等
- 同时移除了 tsconfig.web.json 中对 src/main/**/* 的引用

* refactor(i18n): 优化国际化配置和语言选择逻辑

- 在多个文件中引入 defaultLanguage 常量,统一默认语言设置
- 调整 i18n 初始化和语言变更逻辑,使用新配置
- 更新相关组件和 Hook 中的语言选择逻辑

* refactor(shared): 重构常量定义并优化文件大小格式化逻辑

- 在 constant.ts 中添加 KB、MB、GB 常量定义
- 将 defaultLanguage 移至 constant.ts
- 更新 ConfigManager、useAppInit、i18n、GeneralSettings 等文件中的导入路径
- 优化 formatFileSize 函数,使用新定义的常量

* refactor: 移除重复的导入语句

- 在 HomeWindow.tsx 和 useAppInit.ts 文件中移除了重复的 defaultLanguage导入语句
- 这个改动简化了代码结构,提高了代码的可读性和维护性
2025-04-04 19:07:23 +08:00
lizhixuan
ef8250ab72 refactor(MCPSettings): replace MainContent callback with useMemo for performance optimization 2025-04-04 18:59:54 +08:00
kangfenmao
773c0da9ef chore(version): 1.1.18 2025-04-04 12:07:05 +08:00
kangfenmao
a3d124b9fd feat(migrate): update migration logic to remove specific mini app from state and increment version to 89 2025-04-04 11:54:24 +08:00
kangfenmao
c11adc01dc fix(SelectModelPopup): set popup width to 600 for improved layout 2025-04-04 11:49:59 +08:00
kangfenmao
d8baf378ea refactor(Navbar): replace FormOutlined with SearchOutlined and update tooltip functionality 2025-04-04 10:54:21 +08:00
kangfenmao
3768c135d8 fix(Inputbar): enhance message usage estimation and clean up code structure 2025-04-04 10:34:08 +08:00
LiuVaayne
10848f7a45 feat: mcp tool permissions (#4348)
* feat(MCPSettings): add tool toggle functionality and update server configuration

* fix(McpSettings): improve server type handling and tool fetching logic
2025-04-04 09:57:54 +08:00
fullex
4d5cfe06f5 feat: render markdown when show assistant prompt (#4365)
* feat: render markdown when show assistant prompt

* fix: polish user experience
2025-04-04 09:37:29 +08:00
George·Dong
fb5ddaf9d5 fix(ChatNavigation): improve navigation button collapse functionality 2025-04-04 00:07:36 +08:00
fullex
8cb11e6d55 fix: webdav backup resume and modal problem 2025-04-03 23:09:59 +08:00
ousugo
d0cb333f3c fix(TopicsTab): Topic prompt word modification does not take effect immediately 2025-04-03 23:03:32 +08:00
MyPrototypeWhat
23de48ecbd feat(mcp): add registryUrl to initialState for improved package manag… (#4279)
* feat(mcp): add registryUrl to initialState for improved package management

* feat(mcp): initialize registryUrl in MCP server state for future enhancements

* fix(inputbar):mcp server list

* refactor(Inputbar): remove unused MCP server variable and console log for cleaner code

* fix(Inputbar): 还原

* fix(Inputbar): Add activedMcpServers to Inputbar component props
2025-04-03 18:51:29 +08:00
BlBana
06c730aaf6 fix(Inputbar): Solve the problem that the initial state of assistant mcpServers is empty, and can not get enable mcp servers. 2025-04-03 17:45:14 +08:00
ousugo
aed9c04c20 fix(minapps): remove AI Studio entry from default mini apps list 2025-04-03 17:41:13 +08:00
Asurada
d067d21561 feat(Anthropic): Enable Anthropic 128k context beta feature (#2887) 2025-04-03 17:16:36 +08:00
Camol
515721239f fix(nutstore): restore from nutstore #4318 (#4334)
Co-authored-by: kanweiwei <kanweiwei@nutstore.net>
2025-04-03 10:56:05 +08:00
suyao
148249eaca feat(OCR): add options for recognition level and minimum confidence 2025-03-29 01:41:35 +08:00
suyao
1db577ed16 feat(UI/files): integrate Mistral file handling and update OCR provider to use optional dependency 2025-03-29 01:32:38 +08:00
suyao
7f69ef5356 chore(OCR): remove redundant logging statements 2025-03-28 22:21:28 +08:00
suyao
91f3948efd chore(package): move @cherrystudio/mac-system-ocr to optionalDependencies 2025-03-28 22:16:53 +08:00
suyao
7f310bc29f feat(OCR): add recognition level and minimum confidence options for Mac system OCR provider 2025-03-28 22:09:36 +08:00
suyao
29ccbf16d8 Merge branch 'main' into local-pr-3734 2025-03-28 16:30:17 +08:00
suyao
aa44396a3e refactor(Knowledge): enhance progress tracking in UI components 2025-03-28 16:02:34 +08:00
suyao
0d794cae36 refactor(KnowledgeService): improve file name handling and remove debug logs from KnowledgeContent 2025-03-28 11:30:34 +08:00
suyao
22f86d0476 chore(dependency): update mac-system-ocr and refine electron-builder configuration 2025-03-28 04:08:54 +08:00
suyao
9799aa873a feat(OCR): improve PDF handling and update package versions 2025-03-28 00:25:10 +08:00
suyao
a3e300e672 Merge branch 'main' into local-pr-3734 2025-03-27 14:30:33 +08:00
eeee0717
5be9b318ea feat(KnowledgeService): 提取OCR预处理逻辑为单独方法 2025-03-26 16:37:06 +08:00
eeee0717
78f3123ddd feat(OcrProvider): 统一文件格式 2025-03-26 15:53:12 +08:00
eeee0717
ec9b35af5d chore 2025-03-26 14:17:23 +08:00
eeee0717
1242dedee2 fix: redux migrate error 2025-03-26 14:07:27 +08:00
eeee0717
da1c07ff4c Merge branch 'main' into feat-knowlege-ocr 2025-03-26 13:58:00 +08:00
eeee0717
721a255a22 fix(FileStorage): add check for existing directory before deletion 2025-03-26 09:51:58 +08:00
suyao
52838f93e3 merge 'main' into local-pr-3734 2025-03-25 17:54:54 +08:00
suyao
bbdcd22a4a fix(FileStorage): update base64File method to return base64 string instead of Buffer 2025-03-25 17:45:51 +08:00
suyao
25bdb61c56 feat(OCR): add MacSysOcrProvider for macOS OCR functionality
- Introduced MacSysOcrProvider to handle OCR tasks using the mac-system-ocr library.
- Enhanced the OcrProviderFactory to support the new macOS OCR provider.
- Updated file handling to include base64 file processing.
- Added a new SVG icon for the macOS OCR provider.
- Updated the state management to include the new system OCR provider option.
- Improved user interface to conditionally display the system OCR provider based on the operating system.
2025-03-25 17:24:35 +08:00
eeee0717
adb34464c9 Merge branch 'main' into feat-knowlege-ocr 2025-03-24 16:17:43 +08:00
suyao
0553f75f02 refactor(icons): update icon components 2025-03-24 13:35:40 +08:00
suyao
5fe4bf3f19 feat(OCR): implement Mistral OCR provider and enhance file handling
- Introduced MistralOcrProvider for processing OCR tasks with Mistral API.
- Updated BaseOcrProvider to return LocalFileSource in parseFile method.
- Enhanced file upload and retrieval logic in MistralService.
- Added support for local file source handling in various services.
- Updated preload API and type definitions to accommodate new OCR provider functionalities.
2025-03-24 12:38:07 +08:00
suyao
64838cb3fb refactor(fileService): integrate Mistral and Gemini file services
- Added Mistral and Gemini file services to handle file uploads, retrieval, listing, and deletion.
- Refactored IPC handlers to support new file service architecture.
- Updated preload API to accommodate new file service methods.
- Removed deprecated Gemini service implementation.
- Enhanced type definitions for file handling to support local and remote sources.
2025-03-24 01:47:57 +08:00
suyao
4775a3a77d refactor(Settings): Refactored knowledge settings to utilize the new OCR provider management. 2025-03-23 19:00:38 +08:00
suyao
2941651189 Merge branch 'main' into local-pr-3734 2025-03-23 14:03:08 +08:00
eeee0717
7122353c54 chore 2025-03-22 16:06:05 +08:00
eeee0717
d787dc140e feat(knowledge-ocr): optimize and clean code 2025-03-22 16:00:53 +08:00
eeee0717
a824e81b30 Merge branch 'main' into feat-knowlege-ocr 2025-03-21 16:32:12 +08:00
eeee0717
7196931527 feat: support doc2x ocr 2025-03-21 16:26:41 +08:00
eeee0717
024aac9c4a feat: knowledge ocr settings 2025-03-21 11:12:28 +08:00
eeee0717
60d5f7035c chore 2025-03-20 19:31:29 +08:00
826 changed files with 132376 additions and 28158 deletions

View File

@@ -1,7 +1,7 @@
name: 🐛 错误报告 (中文)
description: 创建一个报告以帮助我们改进
title: '[错误]: '
labels: ['bug']
labels: ['kind/bug']
body:
- type: markdown
attributes:
@@ -18,7 +18,9 @@ body:
options:
- label: 我理解 Issue 是用于反馈和解决问题的,而非吐槽评论区,将尽可能提供更多信息帮助问题解决。
required: true
- label: 已经查看了置顶 Issue 并搜索了现有的 [开放Issue](https://github.com/CherryHQ/cherry-studio/issues)和[已关闭Issue](https://github.com/CherryHQ/cherry-studio/issues?q=is%3Aissue%20state%3Aclosed%20),没有找到类似的问题
- label: 的问题不是 [常见问题](https://github.com/CherryHQ/cherry-studio/issues/3881) 中的内容
required: true
- label: 我已经查看了 **置顶 Issue** 并搜索了现有的 [开放Issue](https://github.com/CherryHQ/cherry-studio/issues)和[已关闭Issue](https://github.com/CherryHQ/cherry-studio/issues?q=is%3Aissue%20state%3Aclosed%20),没有找到类似的问题。
required: true
- label: 我填写了简短且清晰明确的标题,以便开发者在翻阅 Issue 列表时能快速确定大致问题。而不是“一个建议”、“卡住了”等。
required: true
@@ -48,8 +50,8 @@ body:
id: description
attributes:
label: 错误描述
description: 描述问题时请尽可能详细
placeholder: 告诉我们发生了什么...
description: 描述问题时请尽可能详细。请尽可能提供截图或屏幕录制,以帮助我们更好地理解问题。
placeholder: 告诉我们发生了什么...(记得附上截图/录屏,如果适用)
validations:
required: true
@@ -57,12 +59,14 @@ body:
id: reproduction
attributes:
label: 重现步骤
description: 提供详细的重现步骤,以便于我们可以准确地重现问题
description: 提供详细的重现步骤,以便于我们的开发人员可以准确地重现问题。请尽可能为每个步骤提供截图或屏幕录制。
placeholder: |
1. 转到 '...'
2. 点击 '....'
3. 向下滚动到 '....'
4. 看到错误
记得尽可能为每个步骤附上截图/录屏!
validations:
required: true

View File

@@ -1,7 +1,7 @@
name: 💡 功能建议 (中文)
description: 为项目提出新的想法
title: '[功能]: '
labels: ['enhancement']
labels: ['kind/enhancement']
body:
- type: markdown
attributes:

View File

@@ -1,7 +1,7 @@
name: 讨论 & 提问 (中文)
name: 提问 & 讨论 (中文)
description: 寻求帮助、讨论问题、提出疑问等...
title: '[讨论]: '
labels: ['question']
labels: ['kind/question']
body:
- type: markdown
attributes:

76
.github/ISSUE_TEMPLATE/#3_others.yml vendored Normal file
View File

@@ -0,0 +1,76 @@
name: 🤔 其他问题 (中文)
description: 提交不属于错误报告或功能需求的问题
title: '[其他]: '
body:
- type: markdown
attributes:
value: |
感谢您花时间提出问题!
在提交此问题之前,请确保您已经了解了[常见问题](https://docs.cherry-ai.com/question-contact/questions)和[知识科普](https://docs.cherry-ai.com/question-contact/knowledge)
- type: checkboxes
id: checklist
attributes:
label: 提交前检查
description: |
在提交 Issue 前请确保您已经完成了以下所有步骤
options:
- label: 我理解 Issue 是用于反馈和解决问题的,而非吐槽评论区,将尽可能提供更多信息帮助问题解决。
required: true
- label: 我已经查看了置顶 Issue 并搜索了现有的 [开放Issue](https://github.com/CherryHQ/cherry-studio/issues)和[已关闭Issue](https://github.com/CherryHQ/cherry-studio/issues?q=is%3Aissue%20state%3Aclosed%20),没有找到类似的问题。
required: true
- label: 我填写了简短且清晰明确的标题,以便开发者在翻阅 Issue 列表时能快速确定大致问题。而不是"一个问题"、"求助"等。
required: true
- label: 我的问题不属于错误报告或功能需求类别。
required: true
- type: dropdown
id: platform
attributes:
label: 平台
description: 您正在使用哪个平台?
options:
- Windows
- macOS
- Linux
validations:
required: true
- type: input
id: version
attributes:
label: 版本
description: 您正在运行的 Cherry Studio 版本是什么?
placeholder: 例如 v1.0.0
validations:
required: true
- type: textarea
id: question
attributes:
label: 问题描述
description: 请详细描述您的问题或疑问
placeholder: 我想了解有关...的更多信息
validations:
required: true
- type: textarea
id: context
attributes:
label: 相关背景
description: 请提供与您的问题相关的任何背景信息或上下文
placeholder: 我尝试实现...时遇到了疑问
validations:
required: true
- type: textarea
id: attempts
attributes:
label: 您已尝试的方法
description: 请描述您为解决问题已经尝试过的方法(如果有)
- type: textarea
id: additional
attributes:
label: 附加信息
description: 任何能让我们对您的问题有更多了解的信息,包括截图或相关链接

View File

@@ -1,7 +1,7 @@
name: 🐛 Bug Report (English)
description: Create a report to help us improve
title: '[Bug]: '
labels: ['bug']
labels: ['kind/bug']
body:
- type: markdown
attributes:
@@ -18,7 +18,9 @@ body:
options:
- label: I understand that issues are for feedback and problem solving, not for complaining in the comment section, and will provide as much information as possible to help solve the problem.
required: true
- label: I've looked at pinned issues and searched for existing [Open Issues](https://github.com/CherryHQ/cherry-studio/issues), [Closed Issues](https://github.com/CherryHQ/cherry-studio/issues?q=is%3Aissue%20state%3Aclosed), and [Discussions](https://github.com/CherryHQ/cherry-studio/discussions), no similar issue or discussion was found.
- label: My issue is not listed in the [FAQ](https://github.com/CherryHQ/cherry-studio/issues/3881).
required: true
- label: I've looked at **pinned issues** and searched for existing [Open Issues](https://github.com/CherryHQ/cherry-studio/issues), [Closed Issues](https://github.com/CherryHQ/cherry-studio/issues?q=is%3Aissue%20state%3Aclosed), and [Discussions](https://github.com/CherryHQ/cherry-studio/discussions), no similar issue or discussion was found.
required: true
- label: I've filled in short, clear headings so that developers can quickly identify a rough idea of what to expect when flipping through the list of issues. And not "a suggestion", "stuck", etc.
required: true

View File

@@ -1,7 +1,7 @@
name: 💡 Feature Request (English)
description: Suggest an idea for this project
title: '[Feature]: '
labels: ['enhancement']
labels: ['kind/enhancement']
body:
- type: markdown
attributes:

View File

@@ -1,7 +1,7 @@
name: Discussion & Questions
name: Questions & Discussion
description: Seeking help, discussing issues, asking questions, etc...
title: '[Discussion]: '
labels: ['question']
labels: ['kind/question']
body:
- type: markdown
attributes:

76
.github/ISSUE_TEMPLATE/3_others.yml vendored Normal file
View File

@@ -0,0 +1,76 @@
name: 🤔 Other Questions (English)
description: Submit questions that don't fit into bug reports or feature requests
title: '[Other]: '
body:
- type: markdown
attributes:
value: |
Thank you for taking the time to ask a question!
Before submitting this issue, please make sure you've reviewed the [FAQ](https://docs.cherry-ai.com/question-contact/questions) and [Knowledge Base](https://docs.cherry-ai.com/question-contact/knowledge)
- type: checkboxes
id: checklist
attributes:
label: Pre-submission Checklist
description: |
Please ensure you've completed all the steps below before submitting your issue
options:
- label: I understand that Issues are for feedback and problem-solving, not for complaints, and I will provide as much information as possible to help resolve the issue.
required: true
- label: I have checked the pinned Issues and searched through existing [open Issues](https://github.com/CherryHQ/cherry-studio/issues) and [closed Issues](https://github.com/CherryHQ/cherry-studio/issues?q=is%3Aissue%20state%3Aclosed%20) and didn't find similar questions.
required: true
- label: I have written a short and clear title that helps developers quickly understand the nature of my question, rather than vague titles like "A question" or "Help needed".
required: true
- label: My question doesn't fall under bug reports or feature requests categories.
required: true
- type: dropdown
id: platform
attributes:
label: Platform
description: Which platform are you using?
options:
- Windows
- macOS
- Linux
validations:
required: true
- type: input
id: version
attributes:
label: Version
description: What version of Cherry Studio are you running?
placeholder: e.g., v1.0.0
validations:
required: true
- type: textarea
id: question
attributes:
label: Question Description
description: Please describe your question or inquiry in detail
placeholder: I would like to know more about...
validations:
required: true
- type: textarea
id: context
attributes:
label: Relevant Context
description: Please provide any background information or context related to your question
placeholder: I encountered this question while trying to implement...
validations:
required: true
- type: textarea
id: attempts
attributes:
label: Attempted Solutions
description: Please describe any methods you've already tried to resolve your question (if applicable)
- type: textarea
id: additional
attributes:
label: Additional Information
description: Any other information that could help us better understand your question, including screenshots or relevant links

86
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,86 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 7
target-branch: "main"
commit-message:
prefix: "chore"
include: "scope"
groups:
# 核心框架
core-framework:
patterns:
- "react"
- "react-dom"
- "electron"
- "typescript"
- "@types/react*"
- "@types/node"
update-types:
- "minor"
- "patch"
# Electron 生态和构建工具
electron-build:
patterns:
- "electron-*"
- "@electron*"
- "vite"
- "@vitejs/*"
- "dotenv-cli"
- "rollup-plugin-*"
- "@swc/*"
update-types:
- "minor"
- "patch"
# 测试工具
testing-tools:
patterns:
- "vitest"
- "@vitest/*"
- "playwright"
- "@playwright/*"
- "eslint*"
- "@eslint*"
- "prettier"
- "husky"
- "lint-staged"
update-types:
- "minor"
- "patch"
# CherryStudio 自定义包
cherrystudio-packages:
patterns:
- "@cherrystudio/*"
update-types:
- "minor"
- "patch"
# 兜底其他 dependencies
other-dependencies:
dependency-type: "production"
# 兜底其他 devDependencies
other-dev-dependencies:
dependency-type: "development"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 3
commit-message:
prefix: "ci"
include: "scope"
groups:
github-actions:
patterns:
- "*"
update-types:
- "minor"
- "patch"

252
.github/issue-checker.yml vendored Normal file
View File

@@ -0,0 +1,252 @@
default-mode:
add:
remove: [pull_request_target, issues]
labels:
# <!-- [Ss]kip `LABEL` --> 跳过一个 label
# <!-- [Rr]emove `LABEL` --> 去掉一个 label
# skips and removes
- name: skip all
content:
regexes: "[Ss]kip (?:[Aa]ll |)[Ll]abels?"
- name: remove all
content:
regexes: "[Rr]emove (?:[Aa]ll |)[Ll]abels?"
- name: skip kind/bug
content:
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)kind/bug(?:`|)"
- name: remove kind/bug
content:
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)kind/bug(?:`|)"
- name: skip kind/enhancement
content:
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)kind/enhancement(?:`|)"
- name: remove kind/enhancement
content:
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)kind/enhancement(?:`|)"
- name: skip kind/question
content:
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)kind/question(?:`|)"
- name: remove kind/question
content:
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)kind/question(?:`|)"
- name: skip area/Connectivity
content:
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)area/Connectivity(?:`|)"
- name: remove area/Connectivity
content:
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)area/Connectivity(?:`|)"
- name: skip area/UI/UX
content:
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)area/UI/UX(?:`|)"
- name: remove area/UI/UX
content:
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)area/UI/UX(?:`|)"
- name: skip kind/documentation
content:
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)kind/documentation(?:`|)"
- name: remove kind/documentation
content:
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)kind/documentation(?:`|)"
- name: skip client:linux
content:
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)client:linux(?:`|)"
- name: remove client:linux
content:
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)client:linux(?:`|)"
- name: skip client:mac
content:
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)client:mac(?:`|)"
- name: remove client:mac
content:
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)client:mac(?:`|)"
- name: skip client:win
content:
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)client:win(?:`|)"
- name: remove client:win
content:
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)client:win(?:`|)"
- name: skip sig/Assistant
content:
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)sig/Assistant(?:`|)"
- name: remove sig/Assistant
content:
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)sig/Assistant(?:`|)"
- name: skip sig/Data
content:
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)sig/Data(?:`|)"
- name: remove sig/Data
content:
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)sig/Data(?:`|)"
- name: skip sig/MCP
content:
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)sig/MCP(?:`|)"
- name: remove sig/MCP
content:
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)sig/MCP(?:`|)"
- name: skip sig/RAG
content:
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)sig/RAG(?:`|)"
- name: remove sig/RAG
content:
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)sig/RAG(?:`|)"
- name: skip lgtm
content:
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)lgtm(?:`|)"
- name: remove lgtm
content:
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)lgtm(?:`|)"
- name: skip License
content:
regexes: "[Ss]kip (?:[Ll]abels? |)(?:`|)License(?:`|)"
- name: remove License
content:
regexes: "[Rr]emove (?:[Ll]abels? |)(?:`|)License(?:`|)"
# `Dev Team`
- name: Dev Team
mode:
add: [pull_request_target, issues]
author_association:
- COLLABORATOR
# Area labels
- name: area/Connectivity
content: area/Connectivity
regexes: "代理|[Pp]roxy"
skip-if:
- skip all
- skip area/Connectivity
remove-if:
- remove all
- remove area/Connectivity
- name: area/UI/UX
content: area/UI/UX
regexes: "界面|[Uu][Ii]|重叠|按钮|图标|组件|渲染|菜单|栏目|头像|主题|样式|[Cc][Ss][Ss]"
skip-if:
- skip all
- skip area/UI/UX
remove-if:
- remove all
- remove area/UI/UX
# Kind labels
- name: kind/documentation
content: kind/documentation
regexes: "文档|教程|[Dd]oc(s|umentation)|[Rr]eadme"
skip-if:
- skip all
- skip kind/documentation
remove-if:
- remove all
- remove kind/documentation
# Client labels
- name: client:linux
content: client:linux
regexes: "(?:[Ll]inux|[Uu]buntu|[Dd]ebian)"
skip-if:
- skip all
- skip client:linux
remove-if:
- remove all
- remove client:linux
- name: client:mac
content: client:mac
regexes: "(?:[Mm]ac|[Mm]acOS|[Oo]SX)"
skip-if:
- skip all
- skip client:mac
remove-if:
- remove all
- remove client:mac
- name: client:win
content: client:win
regexes: "(?:[Ww]in|[Ww]indows)"
skip-if:
- skip all
- skip client:win
remove-if:
- remove all
- remove client:win
# SIG labels
- name: sig/Assistant
content: sig/Assistant
regexes: "快捷助手|[Aa]ssistant"
skip-if:
- skip all
- skip sig/Assistant
remove-if:
- remove all
- remove sig/Assistant
- name: sig/Data
content: sig/Data
regexes: "[Ww]ebdav|坚果云|备份|同步|数据|Obsidian|Notion|Joplin|思源"
skip-if:
- skip all
- skip sig/Data
remove-if:
- remove all
- remove sig/Data
- name: sig/MCP
content: sig/MCP
regexes: "[Mm][Cc][Pp]"
skip-if:
- skip all
- skip sig/MCP
remove-if:
- remove all
- remove sig/MCP
- name: sig/RAG
content: sig/RAG
regexes: "知识库|[Rr][Aa][Gg]"
skip-if:
- skip all
- skip sig/RAG
remove-if:
- remove all
- remove sig/RAG
# Other labels
- name: lgtm
content: lgtm
regexes: "(?:[Ll][Gg][Tt][Mm]|[Ll]ooks [Gg]ood [Tt]o [Mm]e)"
skip-if:
- skip all
- skip lgtm
remove-if:
- remove all
- remove lgtm
- name: License
content: License
regexes: "(?:[Ll]icense|[Cc]opyright|[Mm][Ii][Tt]|[Aa]pache)"
skip-if:
- skip all
- skip License
remove-if:
- remove all
- remove License

54
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,54 @@
<!-- Template from https://github.com/kubevirt/kubevirt/blob/main/.github/PULL_REQUEST_TEMPLATE.md?-->
<!-- Thanks for sending a pull request! Here are some tips for you:
1. Consider creating this PR as draft: https://github.com/CherryHQ/cherry-studio/blob/main/CONTRIBUTING.md
-->
### What this PR does
Before this PR:
After this PR:
<!-- (optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: -->
Fixes #
### Why we need it and why it was done in this way
The following tradeoffs were made:
The following alternatives were considered:
Links to places where the discussion took place: <!-- optional: slack, other GH issue, mailinglist, ... -->
### Breaking changes
<!-- optional -->
If this PR introduces breaking changes, please describe the changes and the impact on users.
### Special notes for your reviewer
<!-- optional -->
### Checklist
This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.
- [ ] PR: The PR description is expressive enough and will help future contributors
- [ ] Code: [Write code that humans can understand](https://en.wikiquote.org/wiki/Martin_Fowler#code-for-humans) and [Keep it simple](https://en.wikipedia.org/wiki/KISS_principle)
- [ ] Refactor: You have [left the code cleaner than you found it (Boy Scout Rule)](https://learning.oreilly.com/library/view/97-things-every/9780596809515/ch08.html)
- [ ] Upgrade: Impact of this change on upgrade flows was considered and addressed if required
- [ ] Documentation: A [user-guide update](https://docs.cherry-ai.com) was considered and is present (link) or not required. You want a user-guide update if it's a user facing feature.
### Release note
<!-- Write your release note:
1. Enter your extended release note in the below block. If the PR requires additional action from users switching to the new release, include the string "action required".
2. If no release note is required, just write "NONE".
-->
```release-note
```

25
.github/workflows/issue-checker.yml vendored Normal file
View File

@@ -0,0 +1,25 @@
name: "Issue Checker"
on:
issues:
types: [opened, edited]
pull_request_target:
types: [opened, edited]
issue_comment:
types: [created, edited]
permissions:
contents: read
issues: write
pull-requests: write
jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: MaaAssistantArknights/issue-checker@v1.14
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/issue-checker.yml
not-before: 2022-08-05T00:00:00Z
include-title: 1

58
.github/workflows/issue-management.yml vendored Normal file
View File

@@ -0,0 +1,58 @@
name: "Stale Issue Management"
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
env:
daysBeforeStale: 30 # Number of days of inactivity before marking as stale
daysBeforeClose: 10 # Number of days to wait after marking as stale before closing
jobs:
stale:
if: github.repository_owner == 'CherryHQ'
runs-on: ubuntu-latest
permissions:
actions: write # Workaround for https://github.com/actions/stale/issues/1090
issues: write
# Completely disable stalling for PRs
pull-requests: none
contents: none
steps:
- name: Close needs-more-info issues
uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
only-labels: "needs-more-info"
days-before-stale: ${{ env.daysBeforeStale }}
days-before-close: 0 # Close immediately after stale
stale-issue-label: "inactive"
close-issue-label: "closed:no-response"
stale-issue-message: |
This issue has been labeled as needing more information and has been inactive for ${{ env.daysBeforeStale }} days.
It will be closed now due to lack of additional information.
该问题被标记为"需要更多信息"且已经 ${{ env.daysBeforeStale }} 天没有任何活动,将立即关闭。
operations-per-run: 50
exempt-issue-labels: "pending, Dev Team"
days-before-pr-stale: -1
days-before-pr-close: -1
- name: Close inactive issues
uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: ${{ env.daysBeforeStale }}
days-before-close: ${{ env.daysBeforeClose }}
stale-issue-label: "inactive"
stale-issue-message: |
This issue has been inactive for a prolonged period and will be closed automatically in ${{ env.daysBeforeClose }} days.
该问题已长时间处于闲置状态,${{ env.daysBeforeClose }} 天后将自动关闭。
exempt-issue-labels: "pending, Dev Team, kind/enhancement"
days-before-pr-stale: -1 # Completely disable stalling for PRs
days-before-pr-close: -1 # Completely disable closing for PRs
# Temporary to reduce the huge issues number
operations-per-run: 1000
debug-only: false

View File

@@ -7,9 +7,41 @@ on:
permissions:
contents: write
actions: write # Required for deleting artifacts
jobs:
cleanup-artifacts:
runs-on: ubuntu-latest
steps:
- name: Delete old artifacts
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
run: |
# Calculate the date 14 days ago
cutoff_date=$(date -d "14 days ago" +%Y-%m-%d)
# List and delete artifacts older than cutoff date
gh api repos/$REPO/actions/artifacts --paginate | \
jq -r '.artifacts[] | select(.name | startswith("cherry-studio-nightly-")) | select(.created_at < "'$cutoff_date'") | .id' | \
while read artifact_id; do
echo "Deleting artifact $artifact_id"
gh api repos/$REPO/actions/artifacts/$artifact_id -X DELETE
done
check-repository:
runs-on: ubuntu-latest
outputs:
should_run: ${{ github.repository == 'CherryHQ/cherry-studio' }}
steps:
- name: Check if running in main repository
run: |
echo "Running in repository: ${{ github.repository }}"
echo "Should run: ${{ github.repository == 'CherryHQ/cherry-studio' }}"
nightly-build:
needs: check-repository
if: needs.check-repository.outputs.should_run == 'true'
runs-on: ${{ matrix.os }}
strategy:
@@ -20,12 +52,19 @@ jobs:
steps:
- name: Check out Git repository
uses: actions/checkout@v4
with:
ref: main
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: macos-latest dependencies fix
if: matrix.os == 'macos-latest'
run: |
brew install python-setuptools
- name: Install corepack
run: corepack enable && corepack prepare yarn@4.6.0 --activate
@@ -59,6 +98,7 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RENDERER_VITE_AIHUBMIX_SECRET: ${{ vars.RENDERER_VITE_AIHUBMIX_SECRET }}
NODE_OPTIONS: --max-old-space-size=8192
- name: Build Mac
if: matrix.os == 'macos-latest'
@@ -73,16 +113,17 @@ jobs:
APPLE_TEAM_ID: ${{ vars.APPLE_TEAM_ID }}
RENDERER_VITE_AIHUBMIX_SECRET: ${{ vars.RENDERER_VITE_AIHUBMIX_SECRET }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_OPTIONS: --max-old-space-size=8192
- name: Build Windows
if: matrix.os == 'windows-latest'
run: yarn build:win
run: |
yarn build:npm windows
yarn build:win
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RENDERER_VITE_AIHUBMIX_SECRET: ${{ vars.RENDERER_VITE_AIHUBMIX_SECRET }}
- name: Replace spaces in filenames
run: node scripts/replace-spaces.js
NODE_OPTIONS: --max-old-space-size=8192
- name: Rename artifacts with nightly format
shell: bash
@@ -93,39 +134,24 @@ jobs:
# Windows artifacts - based on actual file naming pattern
if [ "${{ matrix.os }}" == "windows-latest" ]; then
# Setup installer
find dist -name "*setup.exe" -exec cp {} renamed-artifacts/cherry-studio-nightly-${DATE}-setup.exe \;
find dist -name "*-x64-setup.exe" -exec cp {} renamed-artifacts/cherry-studio-nightly-${DATE}-x64-setup.exe \;
find dist -name "*-arm64-setup.exe" -exec cp {} renamed-artifacts/cherry-studio-nightly-${DATE}-arm64-setup.exe \;
# Portable exe
find dist -name "*portable.exe" -exec cp {} renamed-artifacts/cherry-studio-nightly-${DATE}-portable.exe \;
# Rename blockmap files to match the new exe names
if [ -f "dist/*setup.exe.blockmap" ]; then
cp dist/*setup.exe.blockmap renamed-artifacts/cherry-studio-nightly-${DATE}-setup.exe.blockmap || true
fi
find dist -name "*-x64-portable.exe" -exec cp {} renamed-artifacts/cherry-studio-nightly-${DATE}-x64-portable.exe \;
find dist -name "*-arm64-portable.exe" -exec cp {} renamed-artifacts/cherry-studio-nightly-${DATE}-arm64-portable.exe \;
fi
# macOS artifacts
if [ "${{ matrix.os }}" == "macos-latest" ]; then
# 处理arm64架构文件
find dist -name "*-arm64.dmg" -exec cp {} renamed-artifacts/cherry-studio-nightly-${DATE}-arm64.dmg \;
find dist -name "*-arm64.dmg.blockmap" -exec cp {} renamed-artifacts/cherry-studio-nightly-${DATE}-arm64.dmg.blockmap \;
find dist -name "*-arm64.zip" -exec cp {} renamed-artifacts/cherry-studio-nightly-${DATE}-arm64.zip \;
find dist -name "*-arm64.zip.blockmap" -exec cp {} renamed-artifacts/cherry-studio-nightly-${DATE}-arm64.zip.blockmap \;
# 处理x64架构文件
find dist -name "*-x64.dmg" -exec cp {} renamed-artifacts/cherry-studio-nightly-${DATE}-x64.dmg \;
find dist -name "*-x64.dmg.blockmap" -exec cp {} renamed-artifacts/cherry-studio-nightly-${DATE}-x64.dmg.blockmap \;
find dist -name "*-x64.zip" -exec cp {} renamed-artifacts/cherry-studio-nightly-${DATE}-x64.zip \;
find dist -name "*-x64.zip.blockmap" -exec cp {} renamed-artifacts/cherry-studio-nightly-${DATE}-x64.zip.blockmap \;
fi
# Linux artifacts
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
find dist -name "*.AppImage" -exec cp {} renamed-artifacts/cherry-studio-nightly-${DATE}.AppImage \;
find dist -name "*.snap" -exec cp {} renamed-artifacts/cherry-studio-nightly-${DATE}.snap \;
find dist -name "*.deb" -exec cp {} renamed-artifacts/cherry-studio-nightly-${DATE}.deb \;
find dist -name "*.rpm" -exec cp {} renamed-artifacts/cherry-studio-nightly-${DATE}.rpm \;
find dist -name "*.tar.gz" -exec cp {} renamed-artifacts/cherry-studio-nightly-${DATE}.tar.gz \;
find dist -name "*-x86_64.AppImage" -exec cp {} renamed-artifacts/cherry-studio-nightly-${DATE}-x86_64.AppImage \;
find dist -name "*-arm64.AppImage" -exec cp {} renamed-artifacts/cherry-studio-nightly-${DATE}-arm64.AppImage \;
fi
# Copy update files

View File

@@ -5,6 +5,7 @@ on:
pull_request:
branches:
- main
- develop
jobs:
build:
@@ -43,4 +44,4 @@ jobs:
run: yarn build:check
- name: Lint Check
run: yarn lint
run: yarn test:lint

View File

@@ -6,7 +6,7 @@ on:
tag:
description: 'Release tag (e.g. v1.0.0)'
required: true
default: 'v0.9.18'
default: 'v1.0.0'
push:
tags:
- v*.*.*
@@ -26,6 +26,8 @@ jobs:
steps:
- name: Check out Git repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get release tag
id: get-tag
@@ -71,10 +73,13 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RENDERER_VITE_AIHUBMIX_SECRET: ${{ vars.RENDERER_VITE_AIHUBMIX_SECRET }}
NODE_OPTIONS: --max-old-space-size=8192
MAIN_VITE_MINERU_API_KEY: ${{ vars.MAIN_VITE_MINERU_API_KEY }}
- name: Build Mac
if: matrix.os == 'macos-latest'
run: |
sudo -H pip install setuptools
yarn build:npm mac
yarn build:mac
env:
@@ -85,16 +90,19 @@ jobs:
APPLE_TEAM_ID: ${{ vars.APPLE_TEAM_ID }}
RENDERER_VITE_AIHUBMIX_SECRET: ${{ vars.RENDERER_VITE_AIHUBMIX_SECRET }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_OPTIONS: --max-old-space-size=8192
MAIN_VITE_MINERU_API_KEY: ${{ vars.MAIN_VITE_MINERU_API_KEY }}
- name: Build Windows
if: matrix.os == 'windows-latest'
run: yarn build:win
run: |
yarn build:npm windows
yarn build:win
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RENDERER_VITE_AIHUBMIX_SECRET: ${{ vars.RENDERER_VITE_AIHUBMIX_SECRET }}
- name: Replace spaces in filenames
run: node scripts/replace-spaces.js
NODE_OPTIONS: --max-old-space-size=8192
MAIN_VITE_MINERU_API_KEY: ${{ vars.MAIN_VITE_MINERU_API_KEY }}
- name: Release
uses: ncipollo/release-action@v1
@@ -103,5 +111,40 @@ jobs:
allowUpdates: true
makeLatest: false
tag: ${{ steps.get-tag.outputs.tag }}
artifacts: 'dist/*.exe,dist/*.zip,dist/*.dmg,dist/*.AppImage,dist/*.snap,dist/*.deb,dist/*.rpm,dist/*.tar.gz,dist/latest*.yml,dist/*.blockmap'
artifacts: 'dist/*.exe,dist/*.zip,dist/*.dmg,dist/*.AppImage,dist/*.snap,dist/*.deb,dist/*.rpm,dist/*.tar.gz,dist/latest*.yml,dist/rc*.yml,dist/*.blockmap'
token: ${{ secrets.GITHUB_TOKEN }}
dispatch-docs-update:
needs: release
if: success() && github.repository == 'CherryHQ/cherry-studio' # 确保所有构建成功且在主仓库中运行
runs-on: ubuntu-latest
steps:
- name: Get release tag
id: get-tag
shell: bash
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
else
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
fi
- name: Check if tag is pre-release
id: check-tag
shell: bash
run: |
TAG="${{ steps.get-tag.outputs.tag }}"
if [[ "$TAG" == *"rc"* || "$TAG" == *"pre-release"* ]]; then
echo "is_pre_release=true" >> $GITHUB_OUTPUT
else
echo "is_pre_release=false" >> $GITHUB_OUTPUT
fi
- name: Dispatch update-download-version workflow to cherry-studio-docs
if: steps.check-tag.outputs.is_pre_release == 'false'
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.REPO_DISPATCH_TOKEN }}
repository: CherryHQ/cherry-studio-docs
event-type: update-download-version
client-payload: '{"version": "${{ steps.get-tag.outputs.tag }}"}'

14
.gitignore vendored
View File

@@ -35,7 +35,6 @@ Thumbs.db
node_modules
dist
out
build/icons
stats.html
# ENV
@@ -46,4 +45,15 @@ stats.html
local
.aider*
.cursorrules
.cursor/rules
.cursor/*
# vitest
coverage
.vitest-cache
vitest.config.*.timestamp-*
# playwright
playwright-report
test-results
YOUR_MEMORY_FILE_PATH

10
.vscode/settings.json vendored
View File

@@ -31,5 +31,13 @@
"[markdown]": {
"files.trimTrailingWhitespace": false
},
"i18n-ally.localesPaths": ["src/renderer/src/i18n"]
"i18n-ally.localesPaths": ["src/renderer/src/i18n/locales"],
"i18n-ally.enabledFrameworks": ["react-i18next", "i18next"],
"i18n-ally.keystyle": "nested", // 翻译路径格式
"i18n-ally.sortKeys": true, // 排序
"i18n-ally.namespace": true, // 开启命名空间
"i18n-ally.enabledParsers": ["ts", "js", "json"], // 解析语言
"i18n-ally.sourceLanguage": "en-us", // 翻译源语言
"i18n-ally.displayLanguage": "zh-cn",
"i18n-ally.fullReloadOnChanged": true // 界面显示语言
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,71 @@
diff --git a/dist/utils/tiktoken.cjs b/dist/utils/tiktoken.cjs
index 973b0d0e75aeaf8de579419af31b879b32975413..f23c7caa8b9dc8bd404132725346a4786f6b278b 100644
--- a/dist/utils/tiktoken.cjs
+++ b/dist/utils/tiktoken.cjs
@@ -1,25 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.encodingForModel = exports.getEncoding = void 0;
-const lite_1 = require("js-tiktoken/lite");
const async_caller_js_1 = require("./async_caller.cjs");
const cache = {};
const caller = /* #__PURE__ */ new async_caller_js_1.AsyncCaller({});
async function getEncoding(encoding) {
- if (!(encoding in cache)) {
- cache[encoding] = caller
- .fetch(`https://tiktoken.pages.dev/js/${encoding}.json`)
- .then((res) => res.json())
- .then((data) => new lite_1.Tiktoken(data))
- .catch((e) => {
- delete cache[encoding];
- throw e;
- });
- }
- return await cache[encoding];
+ throw new Error("TikToken Not implemented");
}
exports.getEncoding = getEncoding;
async function encodingForModel(model) {
- return getEncoding((0, lite_1.getEncodingNameForModel)(model));
+ throw new Error("TikToken Not implemented");
}
exports.encodingForModel = encodingForModel;
diff --git a/dist/utils/tiktoken.js b/dist/utils/tiktoken.js
index 8e41ee6f00f2f9c7fa2c59fa2b2f4297634b97aa..aa5f314a6349ad0d1c5aea8631a56aad099176e0 100644
--- a/dist/utils/tiktoken.js
+++ b/dist/utils/tiktoken.js
@@ -1,20 +1,9 @@
-import { Tiktoken, getEncodingNameForModel, } from "js-tiktoken/lite";
import { AsyncCaller } from "./async_caller.js";
const cache = {};
const caller = /* #__PURE__ */ new AsyncCaller({});
export async function getEncoding(encoding) {
- if (!(encoding in cache)) {
- cache[encoding] = caller
- .fetch(`https://tiktoken.pages.dev/js/${encoding}.json`)
- .then((res) => res.json())
- .then((data) => new Tiktoken(data))
- .catch((e) => {
- delete cache[encoding];
- throw e;
- });
- }
- return await cache[encoding];
+ throw new Error("TikToken Not implemented");
}
export async function encodingForModel(model) {
- return getEncoding(getEncodingNameForModel(model));
+ throw new Error("TikToken Not implemented");
}
diff --git a/package.json b/package.json
index 36072aecf700fca1bc49832a19be832eca726103..90b8922fba1c3d1b26f78477c891b07816d6238a 100644
--- a/package.json
+++ b/package.json
@@ -37,7 +37,6 @@
"ansi-styles": "^5.0.0",
"camelcase": "6",
"decamelize": "1.2.0",
- "js-tiktoken": "^1.0.12",
"langsmith": ">=0.2.8 <0.4.0",
"mustache": "^4.2.0",
"p-queue": "^6.6.2",

View File

@@ -0,0 +1,324 @@
diff --git a/out/macPackager.js b/out/macPackager.js
index 852f6c4d16f86a7bb8a78bf1ed5a14647a279aa1..60e7f5f16a844541eb1909b215fcda1811e924b8 100644
--- a/out/macPackager.js
+++ b/out/macPackager.js
@@ -423,7 +423,7 @@ class MacPackager extends platformPackager_1.PlatformPackager {
}
appPlist.CFBundleName = appInfo.productName;
appPlist.CFBundleDisplayName = appInfo.productName;
- const minimumSystemVersion = this.platformSpecificBuildOptions.minimumSystemVersion;
+ const minimumSystemVersion = this.platformSpecificBuildOptions.LSMinimumSystemVersion;
if (minimumSystemVersion != null) {
appPlist.LSMinimumSystemVersion = minimumSystemVersion;
}
diff --git a/out/packager.js b/out/packager.js
index 579f7f4b62f61037234098ba378ab30efb64c7a9..02df1dd38f83a57a60258a51b2ee9f0b4020dab4 100644
--- a/out/packager.js
+++ b/out/packager.js
@@ -426,12 +426,12 @@ class Packager {
throw new Error(`Unknown platform: ${platform}`);
}
}
- async installAppDependencies(platform, arch) {
+ async installAppDependencies(platform, arch, excludeReBuildModules) {
if (this.options.prepackaged != null || !this.framework.isNpmRebuildRequired) {
return;
}
const frameworkInfo = { version: this.framework.version, useCustomDist: true };
- const config = this.config;
+ const config= this.config;
if (config.nodeGypRebuild === true) {
await (0, yarn_1.nodeGypRebuild)(platform.nodeName, builder_util_1.Arch[arch], frameworkInfo);
}
@@ -462,6 +462,7 @@ class Packager {
platform: platform.nodeName,
arch: builder_util_1.Arch[arch],
productionDeps: this.getNodeDependencyInfo(null, false),
+ excludeReBuildModules,
});
}
}
diff --git a/out/platformPackager.js b/out/platformPackager.js
index 05c740ead5e1e16dd77d5e523309c8b2c3bd581e..38f730d148ddda2e1bae64371658d7917e8ff05a 100644
--- a/out/platformPackager.js
+++ b/out/platformPackager.js
@@ -148,6 +148,7 @@ class PlatformPackager {
// Due to node-gyp rewriting GYP_MSVS_VERSION when reused across the same session, we must reset the env var: https://github.com/electron-userland/electron-builder/issues/7256
delete process.env.GYP_MSVS_VERSION;
const { outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets, options } = packOptions;
+ builder_util_1.log.info(platformSpecificBuildOptions,"platformSpecificBuildOptions");
await this.info.emitBeforePack({
appOutDir,
outDir,
@@ -156,7 +157,7 @@ class PlatformPackager {
packager: this,
electronPlatformName: platformName,
});
- await this.info.installAppDependencies(this.platform, arch);
+ await this.info.installAppDependencies(this.platform, arch, platformSpecificBuildOptions.excludeReBuildModules);
if (this.info.cancellationToken.cancelled) {
return;
}
diff --git a/out/publish/updateInfoBuilder.js b/out/publish/updateInfoBuilder.js
index 7924c5b47d01f8dfccccb8f46658015fa66da1f7..1a1588923c3939ae1297b87931ba83f0ebc052d8 100644
--- a/out/publish/updateInfoBuilder.js
+++ b/out/publish/updateInfoBuilder.js
@@ -133,6 +133,7 @@ async function createUpdateInfo(version, event, releaseInfo) {
const customUpdateInfo = event.updateInfo;
const url = path.basename(event.file);
const sha512 = (customUpdateInfo == null ? null : customUpdateInfo.sha512) || (await (0, hash_1.hashFile)(event.file));
+ const minimumSystemVersion = customUpdateInfo == null ? null : customUpdateInfo.minimumSystemVersion;
const files = [{ url, sha512 }];
const result = {
// @ts-ignore
@@ -143,9 +144,13 @@ async function createUpdateInfo(version, event, releaseInfo) {
path: url /* backward compatibility, electron-updater 1.x - electron-updater 2.15.0 */,
// @ts-ignore
sha512 /* backward compatibility, electron-updater 1.x - electron-updater 2.15.0 */,
+ minimumSystemVersion,
...releaseInfo,
};
if (customUpdateInfo != null) {
+ if (customUpdateInfo.minimumSystemVersion) {
+ delete customUpdateInfo.minimumSystemVersion;
+ }
// file info or nsis web installer packages info
Object.assign("sha512" in customUpdateInfo ? files[0] : result, customUpdateInfo);
}
diff --git a/out/targets/ArchiveTarget.js b/out/targets/ArchiveTarget.js
index e1f52a5fa86fff6643b2e57eaf2af318d541f865..47cc347f154a24b365e70ae5e1f6d309f3582ed0 100644
--- a/out/targets/ArchiveTarget.js
+++ b/out/targets/ArchiveTarget.js
@@ -69,6 +69,9 @@ class ArchiveTarget extends core_1.Target {
}
}
}
+ if (updateInfo != null && this.packager.platformSpecificBuildOptions.minimumSystemVersion) {
+ updateInfo.minimumSystemVersion = this.packager.platformSpecificBuildOptions.minimumSystemVersion;
+ }
await packager.info.emitArtifactBuildCompleted({
updateInfo,
file: artifactPath,
diff --git a/out/targets/nsis/NsisTarget.js b/out/targets/nsis/NsisTarget.js
index e8bd7bb46c8a54b3f55cf3a853ef924195271e01..f956e9f3fe9eb903c78aef3502553b01de4b89b1 100644
--- a/out/targets/nsis/NsisTarget.js
+++ b/out/targets/nsis/NsisTarget.js
@@ -305,6 +305,9 @@ class NsisTarget extends core_1.Target {
if (updateInfo != null && isPerMachine && (oneClick || options.packElevateHelper)) {
updateInfo.isAdminRightsRequired = true;
}
+ if (updateInfo != null && this.packager.platformSpecificBuildOptions.minimumSystemVersion) {
+ updateInfo.minimumSystemVersion = this.packager.platformSpecificBuildOptions.minimumSystemVersion;
+ }
await packager.info.emitArtifactBuildCompleted({
file: installerPath,
updateInfo,
diff --git a/out/util/yarn.js b/out/util/yarn.js
index 1ee20f8b252a8f28d0c7b103789cf0a9a427aec1..74177e6f230d9b7176bdaddd3007922cc99ccdb9 100644
--- a/out/util/yarn.js
+++ b/out/util/yarn.js
@@ -140,6 +140,7 @@ async function rebuild(config, { appDir, projectDir }, options) {
arch,
platform,
buildFromSource,
+ ignoreModules: options.excludeReBuildModules || undefined,
projectRootPath: projectDir,
mode: config.nativeRebuilder || "sequential",
disablePreGypCopy: true,
diff --git a/scheme.json b/scheme.json
index 433e2efc9cef156ff5444f0c4520362ed2ef9ea7..0167441bf928a92f59b5dbe70b2317a74dda74c9 100644
--- a/scheme.json
+++ b/scheme.json
@@ -1825,6 +1825,20 @@
"string"
]
},
+ "excludeReBuildModules": {
+ "anyOf": [
+ {
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The modules to exclude from the rebuild."
+ },
"executableArgs": {
"anyOf": [
{
@@ -1975,6 +1989,13 @@
],
"description": "The mime types in addition to specified in the file associations. Use it if you don't want to register a new mime type, but reuse existing."
},
+ "minimumSystemVersion": {
+ "description": "The minimum os kernel version required to install the application.",
+ "type": [
+ "null",
+ "string"
+ ]
+ },
"packageCategory": {
"description": "backward compatibility + to allow specify fpm-only category for all possible fpm targets in one place",
"type": [
@@ -2327,6 +2348,13 @@
"MacConfiguration": {
"additionalProperties": false,
"properties": {
+ "LSMinimumSystemVersion": {
+ "description": "The minimum version of macOS required for the app to run. Corresponds to `LSMinimumSystemVersion`.",
+ "type": [
+ "null",
+ "string"
+ ]
+ },
"additionalArguments": {
"anyOf": [
{
@@ -2527,6 +2555,20 @@
"string"
]
},
+ "excludeReBuildModules": {
+ "anyOf": [
+ {
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The modules to exclude from the rebuild."
+ },
"executableName": {
"description": "The executable name. Defaults to `productName`.",
"type": [
@@ -2737,7 +2779,7 @@
"type": "boolean"
},
"minimumSystemVersion": {
- "description": "The minimum version of macOS required for the app to run. Corresponds to `LSMinimumSystemVersion`.",
+ "description": "The minimum os kernel version required to install the application.",
"type": [
"null",
"string"
@@ -2959,6 +3001,13 @@
"MasConfiguration": {
"additionalProperties": false,
"properties": {
+ "LSMinimumSystemVersion": {
+ "description": "The minimum version of macOS required for the app to run. Corresponds to `LSMinimumSystemVersion`.",
+ "type": [
+ "null",
+ "string"
+ ]
+ },
"additionalArguments": {
"anyOf": [
{
@@ -3159,6 +3208,20 @@
"string"
]
},
+ "excludeReBuildModules": {
+ "anyOf": [
+ {
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The modules to exclude from the rebuild."
+ },
"executableName": {
"description": "The executable name. Defaults to `productName`.",
"type": [
@@ -3369,7 +3432,7 @@
"type": "boolean"
},
"minimumSystemVersion": {
- "description": "The minimum version of macOS required for the app to run. Corresponds to `LSMinimumSystemVersion`.",
+ "description": "The minimum os kernel version required to install the application.",
"type": [
"null",
"string"
@@ -6381,6 +6444,20 @@
"string"
]
},
+ "excludeReBuildModules": {
+ "anyOf": [
+ {
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The modules to exclude from the rebuild."
+ },
"executableName": {
"description": "The executable name. Defaults to `productName`.",
"type": [
@@ -6507,6 +6584,13 @@
"string"
]
},
+ "minimumSystemVersion": {
+ "description": "The minimum os kernel version required to install the application.",
+ "type": [
+ "null",
+ "string"
+ ]
+ },
"protocols": {
"anyOf": [
{
@@ -7153,6 +7237,20 @@
"string"
]
},
+ "excludeReBuildModules": {
+ "anyOf": [
+ {
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The modules to exclude from the rebuild."
+ },
"executableName": {
"description": "The executable name. Defaults to `productName`.",
"type": [
@@ -7376,6 +7474,13 @@
],
"description": "MAS (Mac Application Store) development options (`mas-dev` target)."
},
+ "minimumSystemVersion": {
+ "description": "The minimum os kernel version required to install the application.",
+ "type": [
+ "null",
+ "string"
+ ]
+ },
"msi": {
"anyOf": [
{

View File

@@ -0,0 +1,17 @@
diff --git a/index.js b/index.js
index 4e8423491ab51a9eb9fee22182e4ea0fcc3d3d3b..2846c5d4354c130d478dc99565b3ecd6d85b7d2e 100644
--- a/index.js
+++ b/index.js
@@ -19,7 +19,11 @@ function requireNative() {
break;
}
}
- return require(`@libsql/${target}`);
+ if (target === "win32-arm64-msvc") {
+ return require(`@strongtz/win32-arm64-msvc`);
+ } else {
+ return require(`@libsql/${target}`);
+ }
}
const {

View File

@@ -1,39 +0,0 @@
diff --git a/core.js b/core.js
index e75a18281ce8f051990c5a50bc1076afdddf91a3..e62f796791a155f23d054e74a429516c14d6e11b 100644
--- a/core.js
+++ b/core.js
@@ -156,7 +156,7 @@ class APIClient {
Accept: 'application/json',
'Content-Type': 'application/json',
'User-Agent': this.getUserAgent(),
- ...getPlatformHeaders(),
+ // ...getPlatformHeaders(),
...this.authHeaders(opts),
};
}
diff --git a/core.mjs b/core.mjs
index fcef58eb502664c41a77483a00db8adaf29b2817..18c5d6ed4be86b3640931277bdc27700006764d7 100644
--- a/core.mjs
+++ b/core.mjs
@@ -149,7 +149,7 @@ export class APIClient {
Accept: 'application/json',
'Content-Type': 'application/json',
'User-Agent': this.getUserAgent(),
- ...getPlatformHeaders(),
+ // ...getPlatformHeaders(),
...this.authHeaders(opts),
};
}
diff --git a/error.mjs b/error.mjs
index 7d19f5578040afa004bc887aab1725e8703d2bac..59ec725b6142299a62798ac4bdedb63ba7d9932c 100644
--- a/error.mjs
+++ b/error.mjs
@@ -36,7 +36,7 @@ export class APIError extends OpenAIError {
if (!status || !headers) {
return new APIConnectionError({ message, cause: castToError(errorResponse) });
}
- const error = errorResponse?.['error'];
+ const error = errorResponse?.['error'] || errorResponse;
if (status === 400) {
return new BadRequestError(status, error, message, headers);
}

View File

@@ -0,0 +1,279 @@
diff --git a/client.js b/client.js
index 33b4ff6309d5f29187dab4e285d07dac20340bab..8f568637ee9e4677585931fb0284c8165a933f69 100644
--- a/client.js
+++ b/client.js
@@ -433,7 +433,7 @@ class OpenAI {
'User-Agent': this.getUserAgent(),
'X-Stainless-Retry-Count': String(retryCount),
...(options.timeout ? { 'X-Stainless-Timeout': String(Math.trunc(options.timeout / 1000)) } : {}),
- ...(0, detect_platform_1.getPlatformHeaders)(),
+ // ...(0, detect_platform_1.getPlatformHeaders)(),
'OpenAI-Organization': this.organization,
'OpenAI-Project': this.project,
},
diff --git a/client.mjs b/client.mjs
index c34c18213073540ebb296ea540b1d1ad39527906..1ce1a98256d7e90e26ca963582f235b23e996e73 100644
--- a/client.mjs
+++ b/client.mjs
@@ -430,7 +430,7 @@ export class OpenAI {
'User-Agent': this.getUserAgent(),
'X-Stainless-Retry-Count': String(retryCount),
...(options.timeout ? { 'X-Stainless-Timeout': String(Math.trunc(options.timeout / 1000)) } : {}),
- ...getPlatformHeaders(),
+ // ...getPlatformHeaders(),
'OpenAI-Organization': this.organization,
'OpenAI-Project': this.project,
},
diff --git a/core/error.js b/core/error.js
index a12d9d9ccd242050161adeb0f82e1b98d9e78e20..fe3a5462480558bc426deea147f864f12b36f9bd 100644
--- a/core/error.js
+++ b/core/error.js
@@ -40,7 +40,7 @@ class APIError extends OpenAIError {
if (!status || !headers) {
return new APIConnectionError({ message, cause: (0, errors_1.castToError)(errorResponse) });
}
- const error = errorResponse?.['error'];
+ const error = errorResponse?.['error'] || errorResponse;
if (status === 400) {
return new BadRequestError(status, error, message, headers);
}
diff --git a/core/error.mjs b/core/error.mjs
index 83cefbaffeb8c657536347322d8de9516af479a2..63334b7972ec04882aa4a0800c1ead5982345045 100644
--- a/core/error.mjs
+++ b/core/error.mjs
@@ -36,7 +36,7 @@ export class APIError extends OpenAIError {
if (!status || !headers) {
return new APIConnectionError({ message, cause: castToError(errorResponse) });
}
- const error = errorResponse?.['error'];
+ const error = errorResponse?.['error'] || errorResponse;
if (status === 400) {
return new BadRequestError(status, error, message, headers);
}
diff --git a/resources/embeddings.js b/resources/embeddings.js
index 2404264d4ba0204322548945ebb7eab3bea82173..8f1bc45cc45e0797d50989d96b51147b90ae6790 100644
--- a/resources/embeddings.js
+++ b/resources/embeddings.js
@@ -5,52 +5,64 @@ exports.Embeddings = void 0;
const resource_1 = require("../core/resource.js");
const utils_1 = require("../internal/utils.js");
class Embeddings extends resource_1.APIResource {
- /**
- * Creates an embedding vector representing the input text.
- *
- * @example
- * ```ts
- * const createEmbeddingResponse =
- * await client.embeddings.create({
- * input: 'The quick brown fox jumped over the lazy dog',
- * model: 'text-embedding-3-small',
- * });
- * ```
- */
- create(body, options) {
- const hasUserProvidedEncodingFormat = !!body.encoding_format;
- // No encoding_format specified, defaulting to base64 for performance reasons
- // See https://github.com/openai/openai-node/pull/1312
- let encoding_format = hasUserProvidedEncodingFormat ? body.encoding_format : 'base64';
- if (hasUserProvidedEncodingFormat) {
- (0, utils_1.loggerFor)(this._client).debug('embeddings/user defined encoding_format:', body.encoding_format);
- }
- const response = this._client.post('/embeddings', {
- body: {
- ...body,
- encoding_format: encoding_format,
- },
- ...options,
- });
- // if the user specified an encoding_format, return the response as-is
- if (hasUserProvidedEncodingFormat) {
- return response;
- }
- // in this stage, we are sure the user did not specify an encoding_format
- // and we defaulted to base64 for performance reasons
- // we are sure then that the response is base64 encoded, let's decode it
- // the returned result will be a float32 array since this is OpenAI API's default encoding
- (0, utils_1.loggerFor)(this._client).debug('embeddings/decoding base64 embeddings from base64');
- return response._thenUnwrap((response) => {
- if (response && response.data) {
- response.data.forEach((embeddingBase64Obj) => {
- const embeddingBase64Str = embeddingBase64Obj.embedding;
- embeddingBase64Obj.embedding = (0, utils_1.toFloat32Array)(embeddingBase64Str);
- });
- }
- return response;
- });
- }
+ /**
+ * Creates an embedding vector representing the input text.
+ *
+ * @example
+ * ```ts
+ * const createEmbeddingResponse =
+ * await client.embeddings.create({
+ * input: 'The quick brown fox jumped over the lazy dog',
+ * model: 'text-embedding-3-small',
+ * });
+ * ```
+ */
+ create(body, options) {
+ const hasUserProvidedEncodingFormat = !!body.encoding_format;
+ // No encoding_format specified, defaulting to base64 for performance reasons
+ // See https://github.com/openai/openai-node/pull/1312
+ let encoding_format = hasUserProvidedEncodingFormat
+ ? body.encoding_format
+ : "base64";
+ if (body.model.includes("jina")) {
+ encoding_format = undefined;
+ }
+ if (hasUserProvidedEncodingFormat) {
+ (0, utils_1.loggerFor)(this._client).debug(
+ "embeddings/user defined encoding_format:",
+ body.encoding_format
+ );
+ }
+ const response = this._client.post("/embeddings", {
+ body: {
+ ...body,
+ encoding_format: encoding_format,
+ },
+ ...options,
+ });
+ // if the user specified an encoding_format, return the response as-is
+ if (hasUserProvidedEncodingFormat || body.model.includes("jina")) {
+ return response;
+ }
+ // in this stage, we are sure the user did not specify an encoding_format
+ // and we defaulted to base64 for performance reasons
+ // we are sure then that the response is base64 encoded, let's decode it
+ // the returned result will be a float32 array since this is OpenAI API's default encoding
+ (0, utils_1.loggerFor)(this._client).debug(
+ "embeddings/decoding base64 embeddings from base64"
+ );
+ return response._thenUnwrap((response) => {
+ if (response && response.data && typeof response.data[0]?.embedding === 'string') {
+ response.data.forEach((embeddingBase64Obj) => {
+ const embeddingBase64Str = embeddingBase64Obj.embedding;
+ embeddingBase64Obj.embedding = (0, utils_1.toFloat32Array)(
+ embeddingBase64Str
+ );
+ });
+ }
+ return response;
+ });
+ }
}
exports.Embeddings = Embeddings;
//# sourceMappingURL=embeddings.js.map
diff --git a/resources/embeddings.mjs b/resources/embeddings.mjs
index 19dcaef578c194a89759c4360073cfd4f7dd2cbf..0284e9cc615c900eff508eb595f7360a74bd9200 100644
--- a/resources/embeddings.mjs
+++ b/resources/embeddings.mjs
@@ -2,51 +2,61 @@
import { APIResource } from "../core/resource.mjs";
import { loggerFor, toFloat32Array } from "../internal/utils.mjs";
export class Embeddings extends APIResource {
- /**
- * Creates an embedding vector representing the input text.
- *
- * @example
- * ```ts
- * const createEmbeddingResponse =
- * await client.embeddings.create({
- * input: 'The quick brown fox jumped over the lazy dog',
- * model: 'text-embedding-3-small',
- * });
- * ```
- */
- create(body, options) {
- const hasUserProvidedEncodingFormat = !!body.encoding_format;
- // No encoding_format specified, defaulting to base64 for performance reasons
- // See https://github.com/openai/openai-node/pull/1312
- let encoding_format = hasUserProvidedEncodingFormat ? body.encoding_format : 'base64';
- if (hasUserProvidedEncodingFormat) {
- loggerFor(this._client).debug('embeddings/user defined encoding_format:', body.encoding_format);
- }
- const response = this._client.post('/embeddings', {
- body: {
- ...body,
- encoding_format: encoding_format,
- },
- ...options,
- });
- // if the user specified an encoding_format, return the response as-is
- if (hasUserProvidedEncodingFormat) {
- return response;
- }
- // in this stage, we are sure the user did not specify an encoding_format
- // and we defaulted to base64 for performance reasons
- // we are sure then that the response is base64 encoded, let's decode it
- // the returned result will be a float32 array since this is OpenAI API's default encoding
- loggerFor(this._client).debug('embeddings/decoding base64 embeddings from base64');
- return response._thenUnwrap((response) => {
- if (response && response.data) {
- response.data.forEach((embeddingBase64Obj) => {
- const embeddingBase64Str = embeddingBase64Obj.embedding;
- embeddingBase64Obj.embedding = toFloat32Array(embeddingBase64Str);
- });
- }
- return response;
- });
- }
+ /**
+ * Creates an embedding vector representing the input text.
+ *
+ * @example
+ * ```ts
+ * const createEmbeddingResponse =
+ * await client.embeddings.create({
+ * input: 'The quick brown fox jumped over the lazy dog',
+ * model: 'text-embedding-3-small',
+ * });
+ * ```
+ */
+ create(body, options) {
+ const hasUserProvidedEncodingFormat = !!body.encoding_format;
+ // No encoding_format specified, defaulting to base64 for performance reasons
+ // See https://github.com/openai/openai-node/pull/1312
+ let encoding_format = hasUserProvidedEncodingFormat
+ ? body.encoding_format
+ : "base64";
+ if (body.model.includes("jina")) {
+ encoding_format = undefined;
+ }
+ if (hasUserProvidedEncodingFormat) {
+ loggerFor(this._client).debug(
+ "embeddings/user defined encoding_format:",
+ body.encoding_format
+ );
+ }
+ const response = this._client.post("/embeddings", {
+ body: {
+ ...body,
+ encoding_format: encoding_format,
+ },
+ ...options,
+ });
+ // if the user specified an encoding_format, return the response as-is
+ if (hasUserProvidedEncodingFormat || body.model.includes("jina")) {
+ return response;
+ }
+ // in this stage, we are sure the user did not specify an encoding_format
+ // and we defaulted to base64 for performance reasons
+ // we are sure then that the response is base64 encoded, let's decode it
+ // the returned result will be a float32 array since this is OpenAI API's default encoding
+ loggerFor(this._client).debug(
+ "embeddings/decoding base64 embeddings from base64"
+ );
+ return response._thenUnwrap((response) => {
+ if (response && response.data && typeof response.data[0]?.embedding === 'string') {
+ response.data.forEach((embeddingBase64Obj) => {
+ const embeddingBase64Str = embeddingBase64Obj.embedding;
+ embeddingBase64Obj.embedding = toFloat32Array(embeddingBase64Str);
+ });
+ }
+ return response;
+ });
+ }
}
//# sourceMappingURL=embeddings.mjs.map

File diff suppressed because one or more lines are too long

948
.yarn/releases/yarn-4.9.1.cjs vendored Executable file

File diff suppressed because one or more lines are too long

View File

@@ -4,4 +4,4 @@ httpTimeout: 300000
nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-4.6.0.cjs
yarnPath: .yarn/releases/yarn-4.9.1.cjs

View File

@@ -1,45 +1,73 @@
# Cherry Studio 贡献者指南
[中文](./docs/CONTRIBUTING.zh.md) | [English](./CONTRIBUTING.md)
欢迎来到 Cherry Studio 的贡献者社区!我们致力于将 Cherry Studio 打造成一个长期提供价值的项目,并希望邀请更多的开发者加入我们的行列。无论您是经验丰富的开发者还是刚刚起步的初学者,您的贡献都将帮助我们更好地服务用户,提升软件质量。
# Cherry Studio Contributor Guide
## 如何贡献
Welcome to the Cherry Studio contributor community! We are committed to making Cherry Studio a project that provides long-term value and hope to invite more developers to join us. Whether you are an experienced developer or a beginner just starting out, your contributions will help us better serve users and improve software quality.
以下是您可以参与的几种方式:
## How to Contribute
1. **贡献代码**:帮助我们开发新功能或优化现有代码。请确保您的代码符合我们的编码标准,并通过所有测试。
Here are several ways you can participate:
2. **修复 BUG**:如果您发现了 BUG欢迎提交修复方案。请在提交前确认问题已被解决并附上相关测试。
1. **Contribute Code**: Help us develop new features or optimize existing code. Please ensure your code adheres to our coding standards and passes all tests.
3. **维护 Issue**:协助我们管理 GitHub 上的 issue帮助标记、分类和解决问题。
2. **Fix Bugs**: If you find a bug, you are welcome to submit a fix. Please confirm the issue is resolved before submitting and include relevant tests.
4. **产品设计**:参与产品设计讨论,帮助我们改进用户体验和界面设计。
3. **Maintain Issues**: Help us manage issues on GitHub by assisting with tagging, classifying, and resolving problems.
5. **编写文档**帮助我们完善用户手册、API 文档和开发者指南。
4. **Product Design**: Participate in product design discussions to help us improve user experience and interface design.
6. **社区维护**:参与社区讨论,帮助解答用户问题,促进社区活跃。
5. **Write Documentation**: Help us improve the user manual, API documentation, and developer guides.
7. **推广使用**:通过博客、社交媒体等渠道推广 Cherry Studio吸引更多用户和开发者。
6. **Community Maintenance**: Participate in community discussions, help answer user questions, and promote community activity.
## 开始贡献
7. **Promote Usage**: Promote Cherry Studio through blogs, social media, and other channels to attract more users and developers.
1. **Fork 仓库**:在 GitHub 上 fork 我们的仓库,并将其克隆到本地。
## Before You Start
2. **创建分支**:为您要进行的更改创建一个新的分支。
Please make sure you have read the [Code of Conduct](CODE_OF_CONDUCT.md) and the [LICENSE](LICENSE).
3. **提交更改**:在本地进行更改并提交。请确保您的提交信息清晰明了。
## Getting Started
4. **发起 Pull Request**:将您的更改推送到 GitHub并发起 Pull Request。请描述您的更改内容和原因。
To help you get familiar with the codebase, we recommend tackling issues tagged with one or more of the following labels: [good-first-issue](https://github.com/CherryHQ/cherry-studio/labels/good%20first%20issue), [help-wanted](https://github.com/CherryHQ/cherry-studio/labels/help%20wanted), or [kind/bug](https://github.com/CherryHQ/cherry-studio/labels/kind%2Fbug). Any help is welcome.
### 其他建议
### Testing
- **联系开发者**:在提交 PR 之前,您可以先和开发者进行联系,共同探讨或者获取帮助。
- **成为核心开发者**:如果您能够稳定为项目贡献,恭喜您可以成为项目核心开发者,获取到项目成员身份。
Features without tests are considered non-existent. To ensure code is truly effective, relevant processes should be covered by unit tests and functional tests. Therefore, when considering contributions, please also consider testability. All tests can be run locally without dependency on CI. Please refer to the "Testing" section in the [Developer Guide](docs/dev.md).
## 联系我们
### Automated Testing for Pull Requests
如果您有任何问题或建议,欢迎通过以下方式联系我们:
Automated tests are triggered on pull requests (PRs) opened by members of the Cherry Studio organization, except for draft PRs. PRs opened by new contributors will initially be marked with the `needs-ok-to-test` label and will not be automatically tested. Once a Cherry Studio organization member adds `/ok-to-test` to the PR, the test pipeline will be created.
- 微信kangfenmao
### Consider Opening Your Pull Request as a Draft
Not all pull requests are ready for review when created. This might be because the author wants to start a discussion, they are not entirely sure if the changes are heading in the right direction, or the changes are not yet complete. Please consider creating these PRs as [draft pull requests](https://github.blog/2019-02-14-introducing-draft-pull-requests/). Draft PRs are skipped by CI, thus saving CI resources. This also means reviewers will not be automatically assigned, and the community will understand that this PR is not yet ready for review.
Reviewers will be assigned after you mark the draft pull request as ready for review.
### Contributor Compliance with Project Terms
We require every contributor to certify that they have the right to legally contribute to our project. Contributors express this by consciously signing their commits, thereby indicating their compliance with the [LICENSE](LICENSE).
A signed commit is one where the commit message includes the following:
You can generate a signed commit using the following command [git commit --signoff](https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---signoff):
```
git commit --signoff -m "Your commit message"
```
### Getting Code Reviewed/Merged
Maintainers are here to help you implement your use case within a reasonable timeframe. They will do their best to review your code and provide constructive feedback promptly. However, if you get stuck during the review process or feel your Pull Request is not receiving the attention it deserves, please contact us via comments in the Issue or through the [Community](README.md#-community).
### Other Suggestions
- **Contact Developers**: Before submitting a PR, you can contact the developers first to discuss or get help.
- **Become a Core Developer**: If you contribute to the project consistently, congratulations, you can become a core developer and gain project membership status. Please check our [Membership Guide](https://github.com/CherryHQ/community/blob/main/docs/membership.en.md).
## Contact Us
If you have any questions or suggestions, feel free to contact us through the following ways:
- WeChat: kangfenmao
- [GitHub Issues](https://github.com/CherryHQ/cherry-studio/issues)
感谢您的支持和贡献!我们期待与您一起将 Cherry Studio 打造成更好的产品。
Thank you for your support and contributions! We look forward to working with you to make Cherry Studio a better product.

111
LICENSE
View File

@@ -1,62 +1,87 @@
**许可协议**
**许可协议 (Licensing)**
软件采用 Apache License 2.0 许可。除 Apache License 2.0 规定的条款外,您在使用 Cherry Studio 时还应遵守以下附加条款:
项目采用**区分用户的双重许可 (User-Segmented Dual Licensing)** 模式。
**一. 商用许可**
**核心原则:**
在以下任何一种情况下,您需要联系我们并获得明确的书面商业授权后,方可继续使用 Cherry Studio 材料:
* **个人用户 和 10人及以下企业/组织:** 默认适用 **GNU Affero 通用公共许可证 v3.0 (AGPLv3)**。
* **超过10人的企业/组织:** **必须** 获取 **商业许可证 (Commercial License)**。
1. **修改与衍生** 您对 Cherry Studio 材料进行修改或基于其进行衍生开发包括但不限于修改应用名称、Logo、代码、功能、界面数据等
2. **企业服务** 在您的企业内部,或为企业客户提供基于 CherryStudio 的服务,且该服务支持 10 人及以上累计用户使用
3. **硬件捆绑销售** 您将 Cherry Studio 预装或集成到硬件设备或产品中进行捆绑销售。
4. **政府或教育机构大规模采购** 您的使用场景属于政府或教育机构的大规模采购项目,特别是涉及安全、数据隐私等敏感需求时。
5. **面向公众的公有云服务**:基于 Cherry Studio提供面向公众的公有云服务。
**二. 贡献者协议**
作为 Cherry Studio 的贡献者,您应当同意以下条款:
1. **许可调整**:生产者有权根据需要对开源协议进行调整,使其更加严格或宽松。
2. **商业用途**:您贡献的代码可能会被用于商业用途,包括但不限于云业务运营。
**三. 其他条款**
1. 本协议条款的解释权归 Cherry Studio 开发者所有。
2. 本协议可能根据实际情况进行更新,更新时将通过本软件通知用户。
如有任何问题或需申请商业授权,请联系 Cherry Studio 开发团队。
除上述特定条件外,其他所有权利和限制均遵循 Apache License 2.0。有关 Apache License 2.0 的详细信息,请访问 http://www.apache.org/licenses/LICENSE-2.0。
定义“10人及以下”
指在您的组织(包括公司、非营利组织、政府机构、教育机构等任何实体)中,能够访问、使用或以任何方式直接或间接受益于本软件(Cherry Studio功能的个人总数不超过10人。这包括但不限于开发者、测试人员、运营人员、最终用户、通过集成系统间接使用者等
---
**1. 开源许可证 (Open Source License): AGPLv3 - 适用于个人及10人及以下组织**
**License Agreement**
* 如果您是个人用户或者您的组织满足上述“10人及以下”的定义您可以在 **AGPLv3** 的条款下自由使用、修改和分发 Cherry Studio。AGPLv3 的完整文本可以访问 [https://www.gnu.org/licenses/agpl-3.0.html](https://www.gnu.org/licenses/agpl-3.0.html) 获取。
* **核心义务:** AGPLv3 的一个关键要求是,如果您修改了 Cherry Studio 并通过网络提供服务,或者分发了修改后的版本,您必须以 AGPLv3 许可证向接收者提供相应的**完整源代码**。即使您符合“10人及以下”的标准如果您希望避免此源代码公开义务您也需要考虑获取商业许可证见下文
* 使用前请务必仔细阅读并理解 AGPLv3 的所有条款。
This software is licensed under the Apache License 2.0. In addition to the terms stipulated by the Apache License 2.0, you must comply with the following supplementary terms when using Cherry Studio:
**2. 商业许可证 (Commercial License) - 适用于超过10人的组织或希望规避 AGPLv3 义务的用户**
**I. Commercial Licensing**
* **强制要求:** 如果您的组织**不**满足上述“10人及以下”的定义即有11人或更多人可以访问、使用或受益于本软件您**必须**联系我们获取并签署一份商业许可证才能使用 Cherry Studio。
* **自愿选择:** 即使您的组织满足“10人及以下”的条件但如果您的使用场景**无法满足 AGPLv3 的条款要求**(特别是关于**源代码公开**的义务),或者您需要 AGPLv3 **未提供**的特定商业条款(如保证、赔偿、无 Copyleft 限制等),您也**必须**联系我们获取并签署一份商业许可证。
* **需要商业许可证的常见情况包括(但不限于):**
* 您的组织规模超过10人。
* (无论组织规模)您希望分发修改过的 Cherry Studio 版本,但**不希望**根据 AGPLv3 公开您修改部分的源代码。
* (无论组织规模)您希望基于修改过的 Cherry Studio 提供网络服务SaaS但**不希望**根据 AGPLv3 向服务使用者提供修改后的源代码。
* (无论组织规模)您的公司政策、客户合同或项目要求不允许使用 AGPLv3 许可的软件,或要求闭源分发及保密。
* 商业许可证将为您提供豁免 AGPLv3 义务(如源代码公开)的权利,并可能包含额外的商业保障条款。
* **获取商业许可:** 请通过邮箱 **bd@cherry-ai.com** 联系 Cherry Studio 开发团队洽谈商业授权事宜。
You must contact us and obtain explicit written commercial authorization to continue using Cherry Studio materials under any of the following circumstances:
**3. 贡献 (Contributions)**
1. **Modifications and Derivatives:** You modify Cherry Studio materials or perform derivative development based on them (including but not limited to changing the applications name, logo, code, functionality, user interface, data, etc.).
2. **Enterprise Services:** You use Cherry Studio internally within your enterprise, or you provide Cherry Studio-based services for enterprise customers, and such services support cumulative usage by 10 or more users.
3. **Hardware Bundling and Sales:** You pre-install or integrate Cherry Studio into hardware devices or products for bundled sale.
4. **Large-scale Procurement by Government or Educational Institutions:** Your usage scenario involves large-scale procurement projects by government or educational institutions, especially in cases involving sensitive requirements such as security and data privacy.
5. **Public Cloud Services:** You provide public cloud-based product services utilizing Cherry Studio.
* 我们欢迎社区对 Cherry Studio 的贡献。所有向本项目提交的贡献都将被视为在 **AGPLv3** 许可证下提供。
* 通过向本项目提交贡献(例如通过 Pull Request即表示您同意您的代码以 AGPLv3 许可证授权给本项目及所有后续使用者(无论这些使用者最终遵循 AGPLv3 还是商业许可)。
* 您也理解并同意,您的贡献可能会被包含在根据商业许可证分发的 Cherry Studio 版本中。
**II. Contributor Agreement**
**4. 其他条款 (Other Terms)**
As a contributor to Cherry Studio, you must agree to the following terms:
* 关于商业许可证的具体条款和条件,以双方签署的正式商业许可协议为准。
* 项目维护者保留根据需要更新本许可政策(包括用户规模定义和阈值)的权利。相关更新将通过项目官方渠道(如代码仓库、官方网站)进行通知。
1. **License Adjustments:** The producer reserves the right to adjust the open-source license as necessary, making it more strict or permissive.
2. **Commercial Usage:** Your contributed code may be used commercially, including but not limited to cloud business operations.
---
**III. Other Terms**
**Licensing**
1. Cherry Studio developers reserve the right of final interpretation of these agreement terms.
2. This agreement may be updated according to practical circumstances, and users will be notified of updates through this software.
This project employs a **User-Segmented Dual Licensing** model.
If you have any questions or need to apply for commercial authorization, please contact the Cherry Studio development team.
**Core Principle:**
Other than these specific conditions, all remaining rights and restrictions follow the Apache License 2.0. For more detailed information regarding Apache License 2.0, please visit http://www.apache.org/licenses/LICENSE-2.0.
* **Individual Users and Organizations with 10 or Fewer Individuals:** Governed by default under the **GNU Affero General Public License v3.0 (AGPLv3)**.
* **Organizations with More Than 10 Individuals:** **Must** obtain a **Commercial License**.
Definition: "10 or Fewer Individuals"
Refers to any organization (including companies, non-profits, government agencies, educational institutions, etc.) where the total number of individuals who can access, use, or in any way directly or indirectly benefit from the functionality of this software (Cherry Studio) does not exceed 10. This includes, but is not limited to, developers, testers, operations staff, end-users, and indirect users via integrated systems.
---
**1. Open Source License: AGPLv3 - For Individuals and Organizations of 10 or Fewer**
* If you are an individual user, or if your organization meets the "10 or Fewer Individuals" definition above, you are free to use, modify, and distribute Cherry Studio under the terms of the **AGPLv3**. The full text of the AGPLv3 can be found in the LICENSE file at [https://www.gnu.org/licenses/agpl-3.0.html](https://www.gnu.org/licenses/agpl-3.0.html).
* **Core Obligation:** A key requirement of the AGPLv3 is that if you modify Cherry Studio and make it available over a network, or distribute the modified version, you must provide the **complete corresponding source code** under the AGPLv3 license to the recipients. Even if you qualify under the "10 or Fewer Individuals" rule, if you wish to avoid this source code disclosure obligation, you will need to obtain a Commercial License (see below).
* Please read and understand the full terms of the AGPLv3 carefully before use.
**2. Commercial License - For Organizations with More Than 10 Individuals, or Users Needing to Avoid AGPLv3 Obligations**
* **Mandatory Requirement:** If your organization does **not** meet the "10 or Fewer Individuals" definition above (i.e., 11 or more individuals can access, use, or benefit from the software), you **must** contact us to obtain and execute a Commercial License to use Cherry Studio.
* **Voluntary Option:** Even if your organization meets the "10 or Fewer Individuals" condition, if your intended use case **cannot comply with the terms of the AGPLv3** (particularly the obligations regarding **source code disclosure**), or if you require specific commercial terms **not offered** by the AGPLv3 (such as warranties, indemnities, or freedom from copyleft restrictions), you also **must** contact us to obtain and execute a Commercial License.
* **Common scenarios requiring a Commercial License include (but are not limited to):**
* Your organization has more than 10 individuals who can access, use, or benefit from the software.
* (Regardless of organization size) You wish to distribute a modified version of Cherry Studio but **do not want** to disclose the source code of your modifications under AGPLv3.
* (Regardless of organization size) You wish to provide a network service (SaaS) based on a modified version of Cherry Studio but **do not want** to provide the modified source code to users of the service under AGPLv3.
* (Regardless of organization size) Your corporate policies, client contracts, or project requirements prohibit the use of AGPLv3-licensed software or mandate closed-source distribution and confidentiality.
* The Commercial License grants you rights exempting you from AGPLv3 obligations (like source code disclosure) and may include additional commercial assurances.
* **Obtaining a Commercial License:** Please contact the Cherry Studio development team via email at **bd@cherry-ai.com** to discuss commercial licensing options.
**3. Contributions**
* We welcome community contributions to Cherry Studio. All contributions submitted to this project are considered to be offered under the **AGPLv3** license.
* By submitting a contribution to this project (e.g., via a Pull Request), you agree to license your code under the AGPLv3 to the project and all its downstream users (regardless of whether those users ultimately operate under AGPLv3 or a Commercial License).
* You also understand and agree that your contribution may be included in distributions of Cherry Studio offered under our commercial license.
**4. Other Terms**
* The specific terms and conditions of the Commercial License are governed by the formal commercial license agreement signed by both parties.
* The project maintainers reserve the right to update this licensing policy (including the definition and threshold for user count) as needed. Updates will be communicated through official project channels (e.g., code repository, official website).

194
README.md
View File

@@ -1,36 +1,94 @@
<div align="right" >
<details>
<summary >🌐 Language</summary>
<div>
<div align="right">
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=en">English</a></p>
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=zh-CN">简体中文</a></p>
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=zh-TW">繁體中文</a></p>
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=ja">日本語</a></p>
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=ko">한국어</a></p>
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=hi">हिन्दी</a></p>
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=th">ไทย</a></p>
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=fr">Français</a></p>
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=de">Deutsch</a></p>
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=es">Español</a></p>
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=it">Itapano</a></p>
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=ru">Русский</a></p>
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=pt">Português</a></p>
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=nl">Nederlands</a></p>
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=pl">Polski</a></p>
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=ar">العربية</a></p>
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=fa">فارسی</a></p>
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=tr">Türkçe</a></p>
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=vi">Tiếng Việt</a></p>
<p><a href="https://openaitx.github.io/view.html?user=CherryHQ&project=cherry-studio&lang=id">Bahasa Indonesia</a></p>
</div>
</div>
</details>
</div>
<h1 align="center">
<a href="https://github.com/CherryHQ/cherry-studio/releases">
<img src="https://github.com/CherryHQ/cherry-studio/blob/main/build/icon.png?raw=true" width="150" height="150" alt="banner" /><br>
</a>
</h1>
<p align="center">English | <a href="./docs/README.zh.md">中文</a> | <a href="./docs/README.ja.md">日本語</a><br></p>
<p align="center">English | <a href="./docs/README.zh.md">中文</a> | <a href="./docs/README.ja.md">日本語</a> | <a href="https://cherry-ai.com">Official Site</a> | <a href="https://docs.cherry-ai.com/cherry-studio-wen-dang/en-us">Documents</a> | <a href="./docs/dev.md">Development</a> | <a href="https://github.com/CherryHQ/cherry-studio/issues">Feedback</a><br></p>
<!-- 题头徽章组合 -->
<div align="center">
[![][deepwiki-shield]][deepwiki-link]
[![][twitter-shield]][twitter-link]
[![][discord-shield]][discord-link]
[![][telegram-shield]][telegram-link]
</div>
<!-- 项目统计徽章 -->
<div align="center">
[![][github-stars-shield]][github-stars-link]
[![][github-forks-shield]][github-forks-link]
[![][github-release-shield]][github-release-link]
[![][github-contributors-shield]][github-contributors-link]
</div>
<div align="center">
[![][license-shield]][license-link]
[![][commercial-shield]][commercial-link]
[![][sponsor-shield]][sponsor-link]
</div>
<div align="center">
<a href="https://hellogithub.com/repository/1605492e1e2a4df3be07abfa4578dd37" target="_blank"><img src="https://api.hellogithub.com/v1/widgets/recommend.svg?rid=1605492e1e2a4df3be07abfa4578dd37" alt="FeaturedHelloGitHub" style="width: 200px; height: 43px;" width="200" height="43" /></a>
<a href="https://trendshift.io/repositories/11772" target="_blank"><img src="https://trendshift.io/api/badge/repositories/11772" alt="kangfenmao%2Fcherry-studio | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
<a href="https://www.producthunt.com/posts/cherry-studio?embed=true&utm_source=badge-featured&utm_medium=badge&utm_souce=badge-cherry&#0045;studio" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=496640&theme=light" alt="Cherry&#0032;Studio - AI&#0032;Chatbots&#0044;&#0032;AI&#0032;Desktop&#0032;Client | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>
<a href="https://www.producthunt.com/posts/cherry-studio?embed=true&utm_source=badge-featured&utm_medium=badge&utm_souce=badge-cherry&#0045;studio" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=496640&theme=light" alt="Cherry&#0032;Studio - AI&#0032;Chatbots&#0044;&#0032;AI&#0032;Desktop&#0032;Client | Product Hunt" style="width: 200px; height: 43px;" width="200" height="43" /></a>
</div>
# 🍒 Cherry Studio
Cherry Studio is a desktop client that supports for multiple LLM providers, available on Windows, Mac and Linux.
👏 Join [Telegram Group](https://t.me/CherryStudioAI)[Discord](https://discord.gg/wez8HtpxqQ) | [QQ Group(472019156)](https://qm.qq.com/q/CbZiBWwCXu)
👏 Join [Telegram Group](https://t.me/CherryStudioAI)[Discord](https://discord.gg/wez8HtpxqQ) | [QQ Group(575014769)](https://qm.qq.com/q/lo0D4qVZKi)
❤️ Like Cherry Studio? Give it a star 🌟 or [Sponsor](docs/sponsor.md) to support the development!
# 📖 Guide
https://docs.cherry-ai.com
# 🌠 Screenshot
![](https://github.com/user-attachments/assets/28585d83-4bf0-4714-b561-8c7bf57cc600)
![](https://github.com/user-attachments/assets/8576863a-f632-4776-bc12-657eeced9da3)
![](https://github.com/user-attachments/assets/790790d7-b462-48dd-bde1-91c1697a4648)
![](https://github.com/user-attachments/assets/36dddb2c-e0fb-4a5f-9411-91447bab6e18)
![](https://github.com/user-attachments/assets/f549e8a0-2385-40b4-b52b-2039e39f2930)
![](https://github.com/user-attachments/assets/58e0237c-4d36-40de-b428-53051d982026)
# 🌟 Key Features
![](https://github.com/user-attachments/assets/7b4f2f78-5cbe-4be8-9aec-f98d8405a505)
1. **Diverse LLM Provider Support**:
- ☁️ Major LLM Cloud Services: OpenAI, Gemini, Anthropic, and more
@@ -67,33 +125,53 @@ https://docs.cherry-ai.com
- 📝 Complete Markdown Rendering
- 🤲 Easy Content Sharing
# 📝 TODO
# 📝 Roadmap
- [x] Quick popup (read clipboard, quick question, explain, translate, summarize)
- [x] Comparison of multi-model answers
- [x] Support login using SSO provided by service providers
- [x] All models support networking
- [x] Launch of the first official version
- [x] Bug fixes and improvements (In progress...)
- [ ] Plugin functionality (JavaScript)
- [ ] Browser extension (highlight text to translate, summarize, add to knowledge base)
- [ ] iOS & Android client
- [ ] AI notes
- [ ] Voice input and output (AI call)
- [ ] Data backup supports custom backup content
We're actively working on the following features and improvements:
1. 🎯 **Core Features**
- Selection Assistant - Smart content selection enhancement
- Deep Research - Advanced research capabilities
- Memory System - Global context awareness
- Document Preprocessing - Improved document handling
- MCP Marketplace - Model Context Protocol ecosystem
2. 🗂 **Knowledge Management**
- Notes and Collections
- Dynamic Canvas visualization
- OCR capabilities
- TTS (Text-to-Speech) support
3. 📱 **Platform Support**
- HarmonyOS Edition (PC)
- Android App (Phase 1)
- iOS App (Phase 1)
- Multi-Window support
- Window Pinning functionality
4. 🔌 **Advanced Features**
- Plugin System
- ASR (Automatic Speech Recognition)
- Assistant and Topic Interaction Refactoring
Track our progress and contribute on our [project board](https://github.com/orgs/CherryHQ/projects/7).
Want to influence our roadmap? Join our [GitHub Discussions](https://github.com/CherryHQ/cherry-studio/discussions) to share your ideas and feedback!
# 🌈 Theme
- Theme Gallery: https://cherrycss.com
- Aero Theme: https://github.com/hakadao/CherryStudio-Aero
- PaperMaterial Theme: https://github.com/rainoffallingstar/CherryStudio-PaperMaterial
- Theme Gallery: <https://cherrycss.com>
- Aero Theme: <https://github.com/hakadao/CherryStudio-Aero>
- PaperMaterial Theme: <https://github.com/rainoffallingstar/CherryStudio-PaperMaterial>
- Claude dynamic-style: <https://github.com/bjl101501/CherryStudio-Claudestyle-dynamic>
- Maple Neon Theme: <https://github.com/BoningtonChen/CherryStudio_themes>
Welcome PR for more themes
# 🖥️ Develop
Refer to the [development documentation](docs/dev.md)
# 🤝 Contributing
We welcome contributions to Cherry Studio! Here are some ways you can contribute:
@@ -106,6 +184,8 @@ We welcome contributions to Cherry Studio! Here are some ways you can contribute
6. **Community Engagement**: Join discussions and help users.
7. **Promote Usage**: Spread the word about Cherry Studio.
Refer to the [Branching Strategy](docs/branching-strategy-en.md) for contribution guidelines
## Getting Started
1. **Fork the Repository**: Fork and clone it to your local machine.
@@ -117,7 +197,7 @@ For more detailed guidelines, please refer to our [Contributing Guide](./CONTRIB
Thank you for your support and contributions!
## Related Projects
# 🔗 Related Projects
- [one-api](https://github.com/songquanpeng/one-api):LLM API management and distribution system, supporting mainstream models like OpenAI, Azure, and Anthropic. Features unified API interface, suitable for key management and secondary distribution.
@@ -126,26 +206,38 @@ Thank you for your support and contributions!
# 🚀 Contributors
<a href="https://github.com/CherryHQ/cherry-studio/graphs/contributors">
<img src="https://contrib.rocks/image?repo=kangfenmao/cherry-studio" />
<img src="https://contrib.rocks/image?repo=CherryHQ/cherry-studio" />
</a>
<br /><br />
# 🌐 Community
[Telegram](https://t.me/CherryStudioAI) | [Email](mailto:support@cherry-ai.com) | [Twitter](https://x.com/kangfenmao)
# ☕ Sponsor
[Buy Me a Coffee](docs/sponsor.md)
# 📃 License
[LICENSE](./LICENSE)
# ✉️ Contact
yinsenho@cherry-ai.com
# ⭐️ Star History
[![Star History Chart](https://api.star-history.com/svg?repos=kangfenmao/cherry-studio&type=Timeline)](https://star-history.com/#kangfenmao/cherry-studio&Timeline)
[![Star History Chart](https://api.star-history.com/svg?repos=CherryHQ/cherry-studio&type=Timeline)](https://star-history.com/#CherryHQ/cherry-studio&Timeline)
<!-- Links & Images -->
[deepwiki-shield]: https://img.shields.io/badge/Deepwiki-CherryHQ-0088CC?style=plastic
[deepwiki-link]: https://deepwiki.com/CherryHQ/cherry-studio
[twitter-shield]: https://img.shields.io/badge/Twitter-CherryStudioApp-0088CC?style=plastic&logo=x
[twitter-link]: https://twitter.com/CherryStudioHQ
[discord-shield]: https://img.shields.io/badge/Discord-@CherryStudio-0088CC?style=plastic&logo=discord
[discord-link]: https://discord.gg/wez8HtpxqQ
[telegram-shield]: https://img.shields.io/badge/Telegram-@CherryStudioAI-0088CC?style=plastic&logo=telegram
[telegram-link]: https://t.me/CherryStudioAI
<!-- Links & Images -->
[github-stars-shield]: https://img.shields.io/github/stars/CherryHQ/cherry-studio?style=social
[github-stars-link]: https://github.com/CherryHQ/cherry-studio/stargazers
[github-forks-shield]: https://img.shields.io/github/forks/CherryHQ/cherry-studio?style=social
[github-forks-link]: https://github.com/CherryHQ/cherry-studio/network
[github-release-shield]: https://img.shields.io/github/v/release/CherryHQ/cherry-studio
[github-release-link]: https://github.com/CherryHQ/cherry-studio/releases
[github-contributors-shield]: https://img.shields.io/github/contributors/CherryHQ/cherry-studio
[github-contributors-link]: https://github.com/CherryHQ/cherry-studio/graphs/contributors
<!-- Links & Images -->
[license-shield]: https://img.shields.io/badge/License-AGPLv3-important.svg?style=plastic&logo=gnu
[license-link]: https://www.gnu.org/licenses/agpl-3.0
[commercial-shield]: https://img.shields.io/badge/License-Contact-white.svg?style=plastic&logoColor=white&logo=telegram&color=blue
[commercial-link]: mailto:license@cherry-ai.com?subject=Commercial%20License%20Inquiry
[sponsor-shield]: https://img.shields.io/badge/Sponsor-FF6699.svg?style=plastic&logo=githubsponsors&logoColor=white
[sponsor-link]: https://github.com/CherryHQ/cherry-studio/blob/main/docs/sponsor.md

BIN
build/icons/1024x1024.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

BIN
build/icons/128x128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

BIN
build/icons/16x16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 B

BIN
build/icons/24x24.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
build/icons/256x256.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
build/icons/32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
build/icons/48x48.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
build/icons/512x512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
build/icons/64x64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@@ -1,8 +1,8 @@
# provider: generic
# url: http://127.0.0.1:8080
# updaterCacheDirName: cherry-studio-updater
provider: github
repo: cherry-studio
owner: kangfenmao
# provider: generic
# url: https://cherrystudio.ocool.online
# provider: github
# repo: cherry-studio
# owner: kangfenmao
provider: generic
url: https://releases.cherry-ai.com

77
docs/CONTRIBUTING.zh.md Normal file
View File

@@ -0,0 +1,77 @@
# Cherry Studio 贡献者指南
[**English**](../CONTRIBUTING.md) | [**中文**](./CONTRIBUTING.zh.md)
欢迎来到 Cherry Studio 的贡献者社区!我们致力于将 Cherry Studio 打造成一个长期提供价值的项目,并希望邀请更多的开发者加入我们的行列。无论您是经验丰富的开发者还是刚刚起步的初学者,您的贡献都将帮助我们更好地服务用户,提升软件质量。
## 如何贡献
以下是您可以参与的几种方式:
1. **贡献代码**:帮助我们开发新功能或优化现有代码。请确保您的代码符合我们的编码标准,并通过所有测试。
2. **修复 BUG**:如果您发现了 BUG欢迎提交修复方案。请在提交前确认问题已被解决并附上相关测试。
3. **维护 Issue**:协助我们管理 GitHub 上的 issue帮助标记、分类和解决问题。
4. **产品设计**:参与产品设计讨论,帮助我们改进用户体验和界面设计。
5. **编写文档**帮助我们完善用户手册、API 文档和开发者指南。
6. **社区维护**:参与社区讨论,帮助解答用户问题,促进社区活跃。
7. **推广使用**:通过博客、社交媒体等渠道推广 Cherry Studio吸引更多用户和开发者。
## 开始之前
请确保阅读了[行为准则](CODE_OF_CONDUCT.md)和[LICENSE](LICENSE)。
## 开始贡献
为了让您更熟悉代码,建议您处理一些标记有以下标签之一或多个的问题:[good-first-issue](https://github.com/CherryHQ/cherry-studio/labels/good%20first%20issue)、[help-wanted](https://github.com/CherryHQ/cherry-studio/labels/help%20wanted) 或 [kind/bug](https://github.com/CherryHQ/cherry-studio/labels/kind%2Fbug)。任何帮助都会收到欢迎。
### 测试
未经测试的功能等同于不存在。为确保代码真正有效,应通过单元测试和功能测试覆盖相关流程。因此,在考虑贡献时,也请考虑可测试性。所有测试均可本地运行,无需依赖 CI。请参阅[开发者指南](docs/dev.md#test)中的“Test”部分。
### 拉取请求的自动化测试
自动化测试会在 Cherry Studio 组织成员开启的拉取请求PR上触发草稿 PR 除外。新贡献者开启的 PR 最初会标记为 needs-ok-to-test 标签且不自动测试。待 Cherry Studio 组织成员在 PR 上添加 /ok-to-test 后,测试通道将被创建。
### 考虑将您的拉取请求作为草稿打开
并非所有拉取请求在创建时就准备好接受审查。这可能是因为作者想发起讨论,或者他们不完全确定更改是否朝着正确的方向发展,甚至可能是因为更改尚未完成。请考虑将这些 PR 创建为[草稿拉取请求](https://github.blog/2019-02-14-introducing-draft-pull-requests/)。草稿 PR 会被CI跳过从而节省CI资源。这也意味着审阅者不会被自动分配社区会理解此 PR 尚未准备好接受审阅。
在您将草稿拉取请求标记为准备审核后,审核人员将被分配
### 贡献者遵守项目条款
我们要求每位贡献者证明他们有权合法地为我们的项目做出贡献。贡献者通过有意识地签署他们的提交来表达这一点,并通过这一行为表明他们遵守许可证[LICENSE](LICENSE)。
签名提交是指提交信息中包含以下内容的提交:
```
Signed-off-by: Your Name <your.email@example.com>
```
您可以通过以下命令[git commit --signoff](https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---signoff)生成签名提交:
```
git commit --signoff -m "Your commit message"
```
### 获取代码审查/合并
维护者在此帮助您在合理时间内实现您的用例。他们会尽力在合理时间内审查您的代码并提供建设性反馈。但如果您在审查过程中受阻,或认为您的 Pull Request 未得到应有的关注,请通过 Issue 中的评论或者[社群](README.md#-community)联系我们
### 其他建议
- **联系开发者**:在提交 PR 之前,您可以先和开发者进行联系,共同探讨或者获取帮助。
- **成为核心开发者**:如果您能够稳定为项目贡献,恭喜您可以成为项目核心开发者,获取到项目成员身份。请查看我们的[成员指南](https://github.com/CherryHQ/community/blob/main/membership.md)
## 联系我们
如果您有任何问题或建议,欢迎通过以下方式联系我们:
- 微信kangfenmao
- [GitHub Issues](https://github.com/CherryHQ/cherry-studio/issues)
感谢您的支持和贡献!我们期待与您一起将 Cherry Studio 打造成更好的产品。

View File

@@ -1,37 +1,66 @@
<h1 align="center">
<a href="https://github.com/CherryHQ/cherry-studio/releases">
<img src="https://github.com/CherryHQ/cherry-studio/blob/main/build/icon.png?raw=true" width="150" height="150" alt="banner" />
<img src="https://github.com/CherryHQ/cherry-studio/blob/main/build/icon.png?raw=true" width="150" height="150" alt="banner" /><br>
</a>
</h1>
<p align="center">
<a href="https://github.com/CherryHQ/cherry-studio">English</a> | <a href="./README.zh.md">中文</a> | 日本語 <br>
<a href="https://github.com/CherryHQ/cherry-studio">English</a> | <a href="./README.zh.md">中文</a> | 日本語 | <a href="https://cherry-ai.com">公式サイト</a> | <a href="https://docs.cherry-ai.com/cherry-studio-wen-dang/ja">ドキュメント</a> | <a href="./dev.md">開発</a> | <a href="https://github.com/CherryHQ/cherry-studio/issues">フィードバック</a><br>
</p>
<!-- バッジコレクション -->
<div align="center">
<a href="https://trendshift.io/repositories/11772" target="_blank"><img src="https://trendshift.io/api/badge/repositories/11772" alt="kangfenmao%2Fcherry-studio | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
<a href="https://www.producthunt.com/posts/cherry-studio?embed=true&utm_source=badge-featured&utm_medium=badge&utm_souce=badge-cherry&#0045;studio" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=496640&theme=light" alt="Cherry&#0032;Studio - AI&#0032;Chatbots&#0044;&#0032;AI&#0032;Desktop&#0032;Client | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>
[![][deepwiki-shield]][deepwiki-link]
[![][twitter-shield]][twitter-link]
[![][discord-shield]][discord-link]
[![][telegram-shield]][telegram-link]
</div>
<!-- プロジェクト統計 -->
<div align="center">
[![][github-stars-shield]][github-stars-link]
[![][github-forks-shield]][github-forks-link]
[![][github-release-shield]][github-release-link]
[![][github-contributors-shield]][github-contributors-link]
</div>
<div align="center">
[![][license-shield]][license-link]
[![][commercial-shield]][commercial-link]
[![][sponsor-shield]][sponsor-link]
</div>
<div align="center">
<a href="https://hellogithub.com/repository/1605492e1e2a4df3be07abfa4578dd37" target="_blank"><img src="https://api.hellogithub.com/v1/widgets/recommend.svg?rid=1605492e1e2a4df3be07abfa4578dd37" alt="FeaturedHelloGitHub" style="width: 200px; height: 43px;" width="200" height="43" /></a>
<a href="https://trendshift.io/repositories/11772" target="_blank"><img src="https://trendshift.io/api/badge/repositories/11772" alt="kangfenmao%2Fcherry-studio | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
<a href="https://www.producthunt.com/posts/cherry-studio?embed=true&utm_source=badge-featured&utm_medium=badge&utm_souce=badge-cherry&#0045;studio" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=496640&theme=light" alt="Cherry&#0032;Studio - AI&#0032;Chatbots&#0044;&#0032;AI&#0032;Desktop&#0032;Client | Product Hunt" style="width: 200px; height: 43px;" width="200" height="43" /></a>
</div>
# 🍒 Cherry Studio
Cherry Studio は、複数の LLM プロバイダーをサポートするデスクトップクライアントで、Windows、Mac、Linux で利用可能です。
👏 [Telegram](https://t.me/CherryStudioAI)[Discord](https://discord.gg/wez8HtpxqQ) | [QQグループ(472019156)](https://qm.qq.com/q/CbZiBWwCXu)
👏 [Telegram](https://t.me/CherryStudioAI)[Discord](https://discord.gg/wez8HtpxqQ) | [QQグループ(575014769)](https://qm.qq.com/q/lo0D4qVZKi)
❤️ Cherry Studio をお気に入りにしましたか?小さな星をつけてください 🌟 または [スポンサー](sponsor.md) をして開発をサポートしてください!❤️
# 📖 ガイド
https://docs.cherry-ai.com
❤️ Cherry Studio をお気に入りにしましたか?小さな星をつけてください 🌟 または [スポンサー](sponsor.md) をして開発をサポートしてください!
# 🌠 スクリーンショット
![](https://github.com/user-attachments/assets/28585d83-4bf0-4714-b561-8c7bf57cc600)
![](https://github.com/user-attachments/assets/8576863a-f632-4776-bc12-657eeced9da3)
![](https://github.com/user-attachments/assets/790790d7-b462-48dd-bde1-91c1697a4648)
![](https://github.com/user-attachments/assets/36dddb2c-e0fb-4a5f-9411-91447bab6e18)
![](https://github.com/user-attachments/assets/f549e8a0-2385-40b4-b52b-2039e39f2930)
![](https://github.com/user-attachments/assets/58e0237c-4d36-40de-b428-53051d982026)
# 🌟 主な機能
![](https://github.com/user-attachments/assets/7b4f2f78-5cbe-4be8-9aec-f98d8405a505)
1. **多様な LLM サービス対応**
- ☁️ 主要な LLM クラウドサービス対応OpenAI、Gemini、Anthropic など
@@ -68,81 +97,119 @@ https://docs.cherry-ai.com
- 📝 完全な Markdown レンダリング
- 🤲 簡単な共有機能
# 📝 TODO
# 📝 開発計画
- [x] クイックポップアップ(クリップボードの読み取り、簡単な質問、説明、翻訳、要約)
- [x] 複数モデルの回答の比較
- [x] サービスプロバイダーが提供する SSO を使用したログインをサポート
- [x] すべてのモデルがネットワークをサポート
- [x] 最初の公式バージョンのリリース
- [ ] 錯誤修復と改善 (開発中...)
- [ ] プラグイン機能JavaScript
- [ ] ブラウザ拡張機能(テキストをハイライトして翻訳、要約、ナレッジベースに追加)
- [ ] iOS & Android クライアント
- [ ] AIート
- [ ] 音声入出力AI コール)
- [ ] データバックアップはカスタムバックアップコンテンツをサポート
以下の機能と改善に積極的に取り組んでいます:
1. 🎯 **コア機能**
- 選択アシスタント - スマートな内容選択の強化
- ディープリサーチ - 高度な研究能力
- メモリーシステム - グローバルコンテキスト認識
- ドキュメント前処理 - 文書処理の改善
- MCP マーケットプレイス - モデルコンテキストプロトコルエコシステム
2. 🗂 **ナレッジ管理**
- ノートとコレクション
- ダイナミックキャンバス可視化
- OCR 機能
- TTSテキスト読み上げサポート
3. 📱 **プラットフォーム対応**
- HarmonyOS エディション
- Android アプリフェーズ1
- iOS アプリフェーズ1
- マルチウィンドウ対応
- ウィンドウピン留め機能
4. 🔌 **高度な機能**
- プラグインシステム
- ASR音声認識
- アシスタントとトピックの対話機能リファクタリング
[プロジェクトボード](https://github.com/orgs/CherryHQ/projects/7)で進捗を確認し、貢献することができます。
開発計画に影響を与えたいですか?[GitHub ディスカッション](https://github.com/CherryHQ/cherry-studio/discussions)に参加して、アイデアやフィードバックを共有してください!
# 🌈 テーマ
テーマギャラリー: https://cherrycss.com
Aero テーマ: https://github.com/hakadao/CherryStudio-Aero
- テーマギャラリーhttps://cherrycss.com
- Aero テーマhttps://github.com/hakadao/CherryStudio-Aero
- PaperMaterial テーマhttps://github.com/rainoffallingstar/CherryStudio-PaperMaterial
- Claude テーマhttps://github.com/bjl101501/CherryStudio-Claudestyle-dynamic
- メープルネオンテーマhttps://github.com/BoningtonChen/CherryStudio_themes
より多くのテーマの PR を歓迎します
# 🖥️ 開発
参考[開発ドキュメント](dev.md)
# 🤝 貢献
Cherry Studio への貢献を歓迎します!以下の方法で貢献できます:
1. **コードの貢献**:新機能を開発するか、既存のコードを最適化します
2. **バグの修正**:見つけたバグを修正します
3. **問題の管理**GitHub の問題を管理するのを手伝います
4. **製品デザイン**:デザインの議論に参加します
5. **ドキュメントの作成**:ユーザーマニュアルやガイドを改善します
6. **コミュニティの参加**:ディスカッションに参加し、ユーザーを支援します
7. **使用の促進**Cherry Studio を広めます
1. **コードの貢献**:新機能を開発するか、既存のコードを最適化します
2. **バグの修正**:見つけたバグを修正します
3. **問題の管理**GitHub の問題を管理するのを手伝います
4. **製品デザイン**:デザインの議論に参加します
5. **ドキュメントの作成**:ユーザーマニュアルやガイドを改善します
6. **コミュニティの参加**:ディスカッションに参加し、ユーザーを支援します
7. **使用の促進**Cherry Studio を広めます
[ブランチ戦略](branching-strategy-en.md)を参照して貢献ガイドラインを確認してください
## 始め方
1. **リポジトリをフォーク**:フォークしてローカルマシンにクローンします
2. **ブランチを作成**:変更のためのブランチを作成します
3. **変更を提出**:変更をコミットしてプッシュします
4. **プルリクエストを開く**:変更内容と理由を説明します
1. **リポジトリをフォーク**:フォークしてローカルマシンにクローンします
2. **ブランチを作成**:変更のためのブランチを作成します
3. **変更を提出**:変更をコミットしてプッシュします
4. **プルリクエストを開く**:変更内容と理由を説明します
詳細なガイドラインについては、[貢献ガイド](../CONTRIBUTING.md)をご覧ください。
ご支援と貢献に感謝します!
## 関連頁版
# 🔗 関連プロジェクト
- [one-api](https://github.com/songquanpeng/one-api)LLM API の管理・配信システム。OpenAI、Azure、Anthropic などの主要モデルに対応し、統一 API インターフェースを提供。API キー管理と再配布に利用可能。
- [ublacklist](https://github.com/iorate/ublacklist)Google 検索結果から特定のサイトを非表示にします
# 🚀 コントリビューター
<a href="https://github.com/CherryHQ/cherry-studio/graphs/contributors">
<img src="https://contrib.rocks/image?repo=kangfenmao/cherry-studio" />
<img src="https://contrib.rocks/image?repo=CherryHQ/cherry-studio" />
</a>
# コミュニティ
[Telegram](https://t.me/CherryStudioAI) | [Email](mailto:support@cherry-ai.com) | [Twitter](https://x.com/kangfenmao)
# スポンサー
[Buy Me a Coffee](sponsor.md)
# 📃 ライセンス
[LICENSE](../LICENSE)
# ✉️ お問い合わせ
yinsenho@cherry-ai.com
<br /><br />
# ⭐️ スター履歴
[![Star History Chart](https://api.star-history.com/svg?repos=kangfenmao/cherry-studio&type=Timeline)](https://star-history.com/#kangfenmao/cherry-studio&Timeline)
[![Star History Chart](https://api.star-history.com/svg?repos=CherryHQ/cherry-studio&type=Timeline)](https://star-history.com/#CherryHQ/cherry-studio&Timeline)
<!-- リンクと画像 -->
[deepwiki-shield]: https://img.shields.io/badge/Deepwiki-CherryHQ-0088CC?style=plastic
[deepwiki-link]: https://deepwiki.com/CherryHQ/cherry-studio
[twitter-shield]: https://img.shields.io/badge/Twitter-CherryStudioApp-0088CC?style=plastic&logo=x
[twitter-link]: https://twitter.com/CherryStudioHQ
[discord-shield]: https://img.shields.io/badge/Discord-@CherryStudio-0088CC?style=plastic&logo=discord
[discord-link]: https://discord.gg/wez8HtpxqQ
[telegram-shield]: https://img.shields.io/badge/Telegram-@CherryStudioAI-0088CC?style=plastic&logo=telegram
[telegram-link]: https://t.me/CherryStudioAI
<!-- プロジェクト統計 -->
[github-stars-shield]: https://img.shields.io/github/stars/CherryHQ/cherry-studio?style=social
[github-stars-link]: https://github.com/CherryHQ/cherry-studio/stargazers
[github-forks-shield]: https://img.shields.io/github/forks/CherryHQ/cherry-studio?style=social
[github-forks-link]: https://github.com/CherryHQ/cherry-studio/network
[github-release-shield]: https://img.shields.io/github/v/release/CherryHQ/cherry-studio
[github-release-link]: https://github.com/CherryHQ/cherry-studio/releases
[github-contributors-shield]: https://img.shields.io/github/contributors/CherryHQ/cherry-studio
[github-contributors-link]: https://github.com/CherryHQ/cherry-studio/graphs/contributors
<!-- ライセンスとスポンサー -->
[license-shield]: https://img.shields.io/badge/License-AGPLv3-important.svg?style=plastic&logo=gnu
[license-link]: https://www.gnu.org/licenses/agpl-3.0
[commercial-shield]: https://img.shields.io/badge/商用ライセンス-お問い合わせ-white.svg?style=plastic&logoColor=white&logo=telegram&color=blue
[commercial-link]: mailto:license@cherry-ai.com?subject=商業ライセンスについて
[sponsor-shield]: https://img.shields.io/badge/スポンサー-FF6699.svg?style=plastic&logo=githubsponsors&logoColor=white
[sponsor-link]: https://github.com/CherryHQ/cherry-studio/blob/main/docs/sponsor.md

View File

@@ -1,37 +1,78 @@
<h1 align="center">
<a href="https://github.com/CherryHQ/cherry-studio/releases">
<img src="https://github.com/CherryHQ/cherry-studio/blob/main/build/icon.png?raw=true" width="150" height="150" alt="banner" />
<img src="https://github.com/CherryHQ/cherry-studio/blob/main/build/icon.png?raw=true" width="150" height="150" alt="banner" /><br>
</a>
</h1>
<p align="center">
<a href="https://github.com/CherryHQ/cherry-studio">English</a> | 中文 | <a href="./README.ja.md">日本語</a><br></p>
<a href="https://github.com/CherryHQ/cherry-studio">English</a> | 中文 | <a href="./README.ja.md">日本語</a> | <a href="https://cherry-ai.com">官方网站</a> | <a href="https://docs.cherry-ai.com/cherry-studio-wen-dang/zh-cn">文档</a> | <a href="./dev.md">开发</a> | <a href="https://github.com/CherryHQ/cherry-studio/issues">反馈</a><br>
</p>
<!-- 题头徽章组合 -->
<div align="center">
[![][deepwiki-shield]][deepwiki-link]
[![][twitter-shield]][twitter-link]
[![][discord-shield]][discord-link]
[![][telegram-shield]][telegram-link]
</div>
<!-- 项目统计徽章 -->
<div align="center">
[![][github-stars-shield]][github-stars-link]
[![][github-forks-shield]][github-forks-link]
[![][github-release-shield]][github-release-link]
[![][github-contributors-shield]][github-contributors-link]
</div>
<div align="center">
[![][license-shield]][license-link]
[![][commercial-shield]][commercial-link]
[![][sponsor-shield]][sponsor-link]
</div>
<div align="center">
<a href="https://hellogithub.com/repository/1605492e1e2a4df3be07abfa4578dd37" target="_blank"><img src="https://api.hellogithub.com/v1/widgets/recommend.svg?rid=1605492e1e2a4df3be07abfa4578dd37" alt="FeaturedHelloGitHub" style="width: 200px; height: 43px;" width="200" height="43" /></a>
<a href="https://trendshift.io/repositories/11772" target="_blank"><img src="https://trendshift.io/api/badge/repositories/11772" alt="kangfenmao%2Fcherry-studio | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
<a href="https://www.producthunt.com/posts/cherry-studio?embed=true&utm_source=badge-featured&utm_medium=badge&utm_souce=badge-cherry&#0045;studio" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=496640&theme=light" alt="Cherry&#0032;Studio - AI&#0032;Chatbots&#0044;&#0032;AI&#0032;Desktop&#0032;Client | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>
<a href="https://www.producthunt.com/posts/cherry-studio?embed=true&utm_source=badge-featured&utm_medium=badge&utm_souce=badge-cherry&#0045;studio" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=496640&theme=light" alt="Cherry&#0032;Studio - AI&#0032;Chatbots&#0044;&#0032;AI&#0032;Desktop&#0032;Client | Product Hunt" style="width: 200px; height: 43px;" width="200" height="43" /></a>
</div>
# 🍒 Cherry Studio
Cherry Studio 是一款支持多个大语言模型LLM服务商的桌面客户端兼容 Windows、Mac 和 Linux 系统。
👏 欢迎加入 [Telegram 群组](https://t.me/CherryStudioAI)[Discord](https://discord.gg/wez8HtpxqQ) | [QQ群(472019156)](https://qm.qq.com/q/CbZiBWwCXu)
👏 欢迎加入 [Telegram 群组](https://t.me/CherryStudioAI)[Discord](https://discord.gg/wez8HtpxqQ) | [QQ群(575014769)](https://qm.qq.com/q/lo0D4qVZKi)
❤️ 喜欢 Cherry Studio? 点亮小星星 🌟 或 [赞助开发者](sponsor.md)! ❤️
# GitCode✖Cherry Studio【新源力】贡献挑战赛
<p align="center">
<a href="https://gitcode.com/CherryHQ/cherry-studio/discussion/2">
<img src="https://raw.gitcode.com/user-images/assets/5007375/8d8d7559-1141-4691-b90f-d154558c6896/cherry-studio-gitcode.jpg" width="100%" alt="banner" />
</a>
</p>
# 📖 使用教程
https://docs.cherry-ai.com
# 🌠 界面
![](https://github.com/user-attachments/assets/28585d83-4bf0-4714-b561-8c7bf57cc600)
![](https://github.com/user-attachments/assets/8576863a-f632-4776-bc12-657eeced9da3)
![](https://github.com/user-attachments/assets/790790d7-b462-48dd-bde1-91c1697a4648)
![](https://github.com/user-attachments/assets/36dddb2c-e0fb-4a5f-9411-91447bab6e18)
![](https://github.com/user-attachments/assets/f549e8a0-2385-40b4-b52b-2039e39f2930)
![](https://github.com/user-attachments/assets/58e0237c-4d36-40de-b428-53051d982026)
# 🌟 主要特性
![](https://github.com/user-attachments/assets/995910f3-177a-4d1e-97ea-04e3b009ba36)
1. **多样化 LLM 服务支持**
- ☁️ 支持主流 LLM 云服务OpenAI、Gemini、Anthropic、硅基流动等
@@ -68,82 +109,119 @@ https://docs.cherry-ai.com
- 📝 完整的 Markdown 渲染
- 🤲 便捷的内容分享功能
# 📝 待辦事項
# 📝 开发计划
- [x] 快捷弹窗(读取剪贴板、快速提问、解释、翻译、总结)
- [x] 多模型回答对比
- [x] 支持使用服务供应商提供的 SSO 进行登入
- [x] 全部模型支持连网(开发中...
- [x] 推出第一个正式版
- [x] 错误修复和改进(开发中...
- [ ] 插件功能JavaScript
- [ ] 浏览器插件(划词翻译、总结、新增至知识库)
- [ ] iOS & Android 客户端
- [ ] AI 笔记
- [ ] 语音输入输出AI 通话)
- [ ] 数据备份支持自定义备份内容
我们正在积极开发以下功能和改进:
1. 🎯 **核心功能**
- 选择助手 - 智能内容选择增强
- 深度研究 - 高级研究能力
- 全局记忆 - 全局上下文感知
- 文档预处理 - 改进文档处理能力
- MCP 市场 - 模型上下文协议生态系统
2. 🗂 **知识管理**
- 笔记与收藏功能
- 动态画布可视化
- OCR 光学字符识别
- TTS 文本转语音支持
3. 📱 **平台支持**
- 鸿蒙版本 (PC)
- Android 应用(第一期)
- iOS 应用(第一期)
- 多窗口支持
- 窗口置顶功能
4. 🔌 **高级特性**
- 插件系统
- ASR 语音识别
- 助手与话题交互重构
在我们的[项目面板](https://github.com/orgs/CherryHQ/projects/7)上跟踪进展并参与贡献。
想要影响开发计划?欢迎加入我们的 [GitHub 讨论区](https://github.com/CherryHQ/cherry-studio/discussions) 分享您的想法和反馈!
# 🌈 主题
主题库https://cherrycss.com
Aero 主题https://github.com/hakadao/CherryStudio-Aero
- 主题库https://cherrycss.com
- Aero 主题https://github.com/hakadao/CherryStudio-Aero
- PaperMaterial 主题https://github.com/rainoffallingstar/CherryStudio-PaperMaterial
- 仿 Claude 主题https://github.com/bjl101501/CherryStudio-Claudestyle-dynamic
- 霓虹枫叶主题https://github.com/BoningtonChen/CherryStudio_themes
欢迎 PR 更多主题
# 🖥️ 开发
参考[开发文档](dev.md)
# 🤝 贡献
我们欢迎对 Cherry Studio 的贡献!您可以通过以下方式贡献:
1. **贡献代码**:开发新功能或优化现有代码
2. **修复错误**:提交您发现的错误修复
3. **维护问题**:帮助管理 GitHub 问题
4. **产品设计**:参与设计讨论
5. **撰写文档**:改进用户手册和指南
6. **社区参与**:加入讨论并帮助用户
7. **推广使用**:宣传 Cherry Studio
1. **贡献代码**:开发新功能或优化现有代码
2. **修复错误**:提交您发现的错误修复
3. **维护问题**:帮助管理 GitHub 问题
4. **产品设计**:参与设计讨论
5. **撰写文档**:改进用户手册和指南
6. **社区参与**:加入讨论并帮助用户
7. **推广使用**:宣传 Cherry Studio
参考[分支策略](branching-strategy-zh.md)了解贡献指南
## 入门
1. **Fork 仓库**Fork 并克隆到您的本地机器
2. **创建分支**:为您的更改创建分支
3. **提交更改**:提交并推送您的更改
4. **打开 Pull Request**:描述您的更改和原因
1. **Fork 仓库**Fork 并克隆到您的本地机器
2. **创建分支**:为您的更改创建分支
3. **提交更改**:提交并推送您的更改
4. **打开 Pull Request**:描述您的更改和原因
有关更详细的指南,请参阅我们的 [贡献指南](../CONTRIBUTING.md)
有关更详细的指南,请参阅我们的 [贡献指南](./CONTRIBUTING.zh.md)
感谢您的支持和贡献!
## 相关项目
# 🔗 相关项目
- [one-api](https://github.com/songquanpeng/one-api)LLM API 管理及分发系统,支持 OpenAI、Azure、Anthropic 等主流模型,统一 API 接口,可用于密钥管理与二次分发。
- [ublacklist](https://github.com/iorate/ublacklist):屏蔽特定网站在 Google 搜索结果中显示
# 🚀 贡献者
<a href="https://github.com/CherryHQ/cherry-studio/graphs/contributors">
<img src="https://contrib.rocks/image?repo=kangfenmao/cherry-studio" />
<img src="https://contrib.rocks/image?repo=CherryHQ/cherry-studio" />
</a>
<br /><br />
# 🌐 社区
[Telegram](https://t.me/CherryStudioAI) | [Email](mailto:support@cherry-ai.com) | [Twitter](https://x.com/kangfenmao)
# ☕ 赞助
[微信赞赏码](sponsor.md)
# 📃 许可证
[LICENSE](../LICENSE)
# ✉️ 联系我们
yinsenho@cherry-ai.com
# ⭐️ Star 记录
[![Star History Chart](https://api.star-history.com/svg?repos=kangfenmao/cherry-studio&type=Timeline)](https://star-history.com/#kangfenmao/cherry-studio&Timeline)
[![Star History Chart](https://api.star-history.com/svg?repos=CherryHQ/cherry-studio&type=Timeline)](https://star-history.com/#CherryHQ/cherry-studio&Timeline)
<!-- Links & Images -->
[deepwiki-shield]: https://img.shields.io/badge/Deepwiki-CherryHQ-0088CC?style=plastic
[deepwiki-link]: https://deepwiki.com/CherryHQ/cherry-studio
[twitter-shield]: https://img.shields.io/badge/Twitter-CherryStudioApp-0088CC?style=plastic&logo=x
[twitter-link]: https://twitter.com/CherryStudioHQ
[discord-shield]: https://img.shields.io/badge/Discord-@CherryStudio-0088CC?style=plastic&logo=discord
[discord-link]: https://discord.gg/wez8HtpxqQ
[telegram-shield]: https://img.shields.io/badge/Telegram-@CherryStudioAI-0088CC?style=plastic&logo=telegram
[telegram-link]: https://t.me/CherryStudioAI
<!-- 项目统计徽章 -->
[github-stars-shield]: https://img.shields.io/github/stars/CherryHQ/cherry-studio?style=social
[github-stars-link]: https://github.com/CherryHQ/cherry-studio/stargazers
[github-forks-shield]: https://img.shields.io/github/forks/CherryHQ/cherry-studio?style=social
[github-forks-link]: https://github.com/CherryHQ/cherry-studio/network
[github-release-shield]: https://img.shields.io/github/v/release/CherryHQ/cherry-studio
[github-release-link]: https://github.com/CherryHQ/cherry-studio/releases
[github-contributors-shield]: https://img.shields.io/github/contributors/CherryHQ/cherry-studio
[github-contributors-link]: https://github.com/CherryHQ/cherry-studio/graphs/contributors
<!-- 许可和赞助徽章 -->
[license-shield]: https://img.shields.io/badge/License-AGPLv3-important.svg?style=plastic&logo=gnu
[license-link]: https://www.gnu.org/licenses/agpl-3.0
[commercial-shield]: https://img.shields.io/badge/商用授权-联系-white.svg?style=plastic&logoColor=white&logo=telegram&color=blue
[commercial-link]: mailto:license@cherry-ai.com?subject=商业授权咨询
[sponsor-shield]: https://img.shields.io/badge/赞助支持-FF6699.svg?style=plastic&logo=githubsponsors&logoColor=white
[sponsor-link]: https://github.com/CherryHQ/cherry-studio/blob/main/docs/sponsor.md

View File

@@ -0,0 +1,71 @@
# 🌿 Branching Strategy
Cherry Studio implements a structured branching strategy to maintain code quality and streamline the development process.
## Main Branches
- `main`: Main development branch
- Contains the latest development code
- Direct commits are not allowed - changes must come through pull requests
- Code may contain features in development and might not be fully stable
- `release/*`: Release branches
- Created from `main` branch
- Contains stable code ready for release
- Only accepts documentation updates and bug fixes
- Thoroughly tested before production deployment
## Contributing Branches
When contributing to Cherry Studio, please follow these guidelines:
1. **Feature Branches:**
- Create from `main` branch
- Naming format: `feature/issue-number-brief-description`
- Submit PR back to `main`
2. **Bug Fix Branches:**
- Create from `main` branch
- Naming format: `fix/issue-number-brief-description`
- Submit PR back to `main`
3. **Documentation Branches:**
- Create from `main` branch
- Naming format: `docs/brief-description`
- Submit PR back to `main`
4. **Hotfix Branches:**
- Create from `main` branch
- Naming format: `hotfix/issue-number-brief-description`
- Submit PR to both `main` and relevant `release` branches
5. **Release Branches:**
- Create from `main` branch
- Naming format: `release/version-number`
- Used for final preparation work before version release
- Only accepts bug fixes and documentation updates
- After testing and preparation, merge back to `main` and tag with version
## Workflow Diagram
![](https://github.com/user-attachments/assets/61db64a2-fab1-4a16-8253-0c64c9df1a63)
## Pull Request Guidelines
- All PRs should be submitted to the `main` branch unless fixing a critical production issue
- Ensure your branch is up to date with the latest `main` changes before submitting
- Include relevant issue numbers in your PR description
- Make sure all tests pass and code meets our quality standards
- Add before/after screenshots if you add a new feature or modify a UI component
## Version Tag Management
- Major releases: v1.0.0, v2.0.0, etc.
- Feature releases: v1.1.0, v1.2.0, etc.
- Patch releases: v1.0.1, v1.0.2, etc.
- Hotfix releases: v1.0.1-hotfix, etc.

View File

@@ -0,0 +1,71 @@
# 🌿 分支策略
Cherry Studio 采用结构化的分支策略来维护代码质量并简化开发流程。
## 主要分支
- `main`:主开发分支
- 包含最新的开发代码
- 禁止直接提交 - 所有更改必须通过拉取请求Pull Request
- 此分支上的代码可能包含正在开发的功能,不一定完全稳定
- `release/*`:发布分支
-`main` 分支创建
- 包含准备发布的稳定代码
- 只接受文档更新和 bug 修复
- 经过完整测试后可以发布到生产环境
## 贡献分支
在为 Cherry Studio 贡献代码时,请遵循以下准则:
1. **功能开发分支:**
-`main` 分支创建
- 命名格式:`feature/issue-number-brief-description`
- 完成后提交 PR 到 `main` 分支
2. **Bug 修复分支:**
-`main` 分支创建
- 命名格式:`fix/issue-number-brief-description`
- 完成后提交 PR 到 `main` 分支
3. **文档更新分支:**
-`main` 分支创建
- 命名格式:`docs/brief-description`
- 完成后提交 PR 到 `main` 分支
4. **紧急修复分支:**
-`main` 分支创建
- 命名格式:`hotfix/issue-number-brief-description`
- 完成后需要同时合并到 `main` 和相关的 `release` 分支
5. **发布分支:**
-`main` 分支创建
- 命名格式:`release/version-number`
- 用于版本发布前的最终准备工作
- 只允许合并 bug 修复和文档更新
- 完成测试和准备工作后,将代码合并回 `main` 分支并打上版本标签
## 工作流程
![](https://github.com/user-attachments/assets/61db64a2-fab1-4a16-8253-0c64c9df1a63)
## 拉取请求PR指南
- 除非是修复生产环境的关键问题,否则所有 PR 都应该提交到 `main` 分支
- 提交 PR 前确保你的分支已经同步了最新的 `main` 分支内容
- 在 PR 描述中包含相关的 issue 编号
- 确保所有测试通过,且代码符合我们的质量标准
- 如果你添加了新功能或修改了 UI 组件,请附上更改前后的截图
## 版本标签管理
- 主要版本发布v1.0.0、v2.0.0 等
- 功能更新发布v1.1.0、v1.2.0 等
- 补丁修复发布v1.0.1、v1.0.2 等
- 紧急修复发布v1.0.1-hotfix 等

View File

@@ -37,6 +37,20 @@ yarn install
yarn dev
```
### Debug
```bash
yarn debug
```
Then input chrome://inspect in browser
### Test
```bash
yarn test
```
### Build
```bash

View File

@@ -0,0 +1,222 @@
# Cherry Studio 记忆功能指南
## 功能介绍
Cherry Studio 的记忆功能是一个强大的工具,能够帮助 AI 助手记住对话中的重要信息、用户偏好和上下文。通过记忆功能,您的 AI 助手可以:
- 📝 **记住重要信息**:自动从对话中提取并存储关键事实和信息
- 🧠 **个性化响应**:基于存储的记忆提供更加个性化和相关的回答
- 🔍 **智能检索**:在需要时自动搜索相关记忆,增强对话的连贯性
- 👥 **多用户支持**:为不同用户维护独立的记忆上下文
记忆功能特别适用于需要长期保持上下文的场景,例如个人助手、客户服务、教育辅导等。
## 如何启用记忆功能
### 1. 全局配置(首次设置)
在使用记忆功能之前,您需要先进行全局配置:
1. 点击侧边栏的 **记忆** 图标(记忆棒图标)进入记忆管理页面
2. 点击右上角的 **更多** 按钮(三个点),选择 **设置**
3. 在设置弹窗中配置以下必要项:
- **LLM 模型**:选择用于处理记忆的语言模型(推荐使用 GPT-4 或 Claude 等高级模型)
- **嵌入模型**:选择用于生成向量嵌入的模型(如 text-embedding-3-small
- **嵌入维度**:输入嵌入模型的维度(通常为 1536
4. 点击 **确定** 保存配置
> ⚠️ **注意**:嵌入模型和维度一旦设置后无法更改,请谨慎选择。
### 2. 为助手启用记忆
完成全局配置后,您可以为特定助手启用记忆功能:
1. 进入 **助手** 页面
2. 选择要启用记忆的助手,点击 **编辑**
3. 在助手设置中找到 **记忆** 部分
4. 打开记忆功能开关
5. 保存助手设置
启用后,该助手将在对话过程中自动提取和使用记忆。
## 使用方法
### 查看记忆
1. 点击侧边栏的 **记忆** 图标进入记忆管理页面
2. 您可以看到所有存储的记忆卡片,包括:
- 记忆内容
- 创建时间
- 所属用户
### 添加记忆
手动添加记忆有两种方式:
**方式一:在记忆管理页面添加**
1. 点击右上角的 **添加记忆** 按钮
2. 在弹窗中输入记忆内容
3. 点击 **添加** 保存
**方式二:在对话中自动提取**
- 当助手启用记忆功能后,系统会自动从对话中提取重要信息并存储为记忆
### 编辑记忆
1. 在记忆卡片上点击 **更多** 按钮(三个点)
2. 选择 **编辑**
3. 修改记忆内容
4. 点击 **保存**
### 删除记忆
1. 在记忆卡片上点击 **更多** 按钮
2. 选择 **删除**
3. 确认删除操作
## 记忆搜索
记忆管理页面提供了强大的搜索功能:
1. 在页面顶部的搜索框中输入关键词
2. 系统会实时过滤显示匹配的记忆
3. 搜索支持模糊匹配,可以搜索记忆内容的任何部分
## 用户管理
记忆功能支持多用户,您可以为不同的用户维护独立的记忆库:
### 切换用户
1. 在记忆管理页面,点击右上角的用户选择器
2. 选择要切换到的用户
3. 页面会自动加载该用户的记忆
### 添加新用户
1. 点击用户选择器
2. 选择 **添加新用户**
3. 输入用户 ID支持字母、数字、下划线和连字符
4. 点击 **添加**
### 删除用户
1. 切换到要删除的用户
2. 点击右上角的 **更多** 按钮
3. 选择 **删除用户**
4. 确认删除(注意:这将删除该用户的所有记忆)
> 💡 **提示**默认用户default-user无法删除。
## 设置说明
### LLM 模型
- 用于处理记忆提取和更新的语言模型
- 建议选择能力较强的模型以获得更好的记忆提取效果
- 可随时更改
### 嵌入模型
- 用于将文本转换为向量,支持语义搜索
- 一旦设置后无法更改(为了保证现有记忆的兼容性)
- 推荐使用 OpenAI 的 text-embedding 系列模型
### 嵌入维度
- 嵌入向量的维度,需要与选择的嵌入模型匹配
- 常见维度:
- text-embedding-3-small: 1536
- text-embedding-3-large: 3072
- text-embedding-ada-002: 1536
### 自定义提示词(可选)
- **事实提取提示词**:自定义如何从对话中提取信息
- **记忆更新提示词**:自定义如何更新现有记忆
## 最佳实践
### 1. 合理组织记忆
- 保持记忆简洁明了,每条记忆专注于一个具体信息
- 使用清晰的语言描述事实,避免模糊表达
- 定期审查和清理过时或不准确的记忆
### 2. 多用户场景
- 为不同的使用场景创建独立用户(如工作、个人、学习等)
- 使用有意义的用户 ID便于识别和管理
- 定期备份重要用户的记忆数据
### 3. 模型选择建议
- **LLM 模型**GPT-4、Claude 3 等高级模型能更准确地提取和理解信息
- **嵌入模型**:选择与您的主要使用语言匹配的模型
### 4. 性能优化
- 避免存储过多冗余记忆,这可能影响搜索性能
- 定期整理和合并相似的记忆
- 对于大量记忆的场景,考虑按主题或时间进行分类管理
## 常见问题
### Q: 为什么我无法启用记忆功能?
A: 请确保您已经完成全局配置,包括选择 LLM 模型和嵌入模型。
### Q: 记忆会自动同步到所有助手吗?
A: 不会。每个助手的记忆功能需要单独启用,且记忆是按用户隔离的。
### Q: 如何导出我的记忆数据?
A: 目前系统暂不支持直接导出功能,但所有记忆都存储在本地数据库中。
### Q: 删除的记忆可以恢复吗?
A: 删除操作是永久的,无法恢复。建议在删除前仔细确认。
### Q: 记忆功能会影响对话速度吗?
A: 记忆功能在后台异步处理,不会明显影响对话响应速度。但过多的记忆可能会略微增加搜索时间。
### Q: 如何清空所有记忆?
A: 您可以删除当前用户并重新创建,或者手动删除所有记忆条目。
## 注意事项
### 隐私保护
- 所有记忆数据都存储在您的本地设备上,不会上传到云端
- 请勿在记忆中存储敏感信息(如密码、私钥等)
- 定期审查记忆内容,确保没有意外存储的隐私信息
### 数据安全
- 记忆数据存储在本地数据库中
- 建议定期备份重要数据
- 更换设备时请注意迁移记忆数据
### 使用限制
- 单条记忆的长度建议不超过 500 字
- 每个用户的记忆数量建议控制在 1000 条以内
- 过多的记忆可能影响系统性能
## 技术细节
记忆功能使用了先进的 RAG检索增强生成技术
1. **信息提取**:使用 LLM 从对话中智能提取关键信息
2. **向量化存储**:通过嵌入模型将文本转换为向量,支持语义搜索
3. **智能检索**:在对话时自动搜索相关记忆,提供给 AI 作为上下文
4. **持续学习**:随着对话进行,不断更新和完善记忆库
---
💡 **提示**:记忆功能是 Cherry Studio 的高级特性,合理使用可以大大提升 AI 助手的智能程度和用户体验。如有更多问题,欢迎查阅文档或联系支持团队。

View File

@@ -0,0 +1,3 @@
# 消息的生命周期
![image](./message-lifecycle.png)

View File

@@ -0,0 +1,127 @@
# messageBlock.ts 使用指南
该文件定义了用于管理应用程序中所有 `MessageBlock` 实体的 Redux Slice。它使用 Redux Toolkit 的 `createSlice``createEntityAdapter` 来高效地处理规范化的状态,并提供了一系列 actions 和 selectors 用于与消息块数据交互。
## 核心目标
- **状态管理**: 集中管理所有 `MessageBlock` 的状态。`MessageBlock` 代表消息中的不同内容单元(如文本、代码、图片、引用等)。
- **规范化**: 使用 `createEntityAdapter``MessageBlock` 数据存储在规范化的结构中(`{ ids: [], entities: {} }`),这有助于提高性能和简化更新逻辑。
- **可预测性**: 提供明确的 actions 来修改状态,并通过 selectors 安全地访问状态。
## 关键概念
- **Slice (`createSlice`)**: Redux Toolkit 的核心 API用于创建包含 reducer 逻辑、action creators 和初始状态的 Redux 模块。
- **Entity Adapter (`createEntityAdapter`)**: Redux Toolkit 提供的工具,用于简化对规范化数据的 CRUD创建、读取、更新、删除操作。它会自动生成 reducer 函数和 selectors。
- **Selectors**: 用于从 Redux store 中派生和计算数据的函数。Selectors 可以被记忆化memoized以提高性能。
## State 结构
`messageBlocks` slice 的状态结构由 `createEntityAdapter` 定义,大致如下:
```typescript
{
ids: string[]; // 存储所有 MessageBlock ID 的有序列表
entities: { [id: string]: MessageBlock }; // 按 ID 存储 MessageBlock 对象的字典
loadingState: 'idle' | 'loading' | 'succeeded' | 'failed'; // (可选) 其他状态,如加载状态
error: string | null; // (可选) 错误信息
}
```
## Actions
该 slice 导出以下 actions (由 `createSlice``createEntityAdapter` 自动生成或自定义)
- **`upsertOneBlock(payload: MessageBlock)`**:
- 添加一个新的 `MessageBlock` 或更新一个已存在的 `MessageBlock`。如果 payload 中的 `id` 已存在,则执行更新;否则执行插入。
- **`upsertManyBlocks(payload: MessageBlock[])`**:
- 添加或更新多个 `MessageBlock`。常用于批量加载数据(例如,加载一个 Topic 的所有消息块)。
- **`removeOneBlock(payload: string)`**:
- 根据提供的 `id` (payload) 移除单个 `MessageBlock`
- **`removeManyBlocks(payload: string[])`**:
- 根据提供的 `id` 数组 (payload) 移除多个 `MessageBlock`。常用于删除消息或清空 Topic 时清理相关的块。
- **`removeAllBlocks()`**:
- 移除 state 中的所有 `MessageBlock` 实体。
- **`updateOneBlock(payload: { id: string; changes: Partial<MessageBlock> })`**:
- 更新一个已存在的 `MessageBlock``payload` 需要包含块的 `id` 和一个包含要更改的字段的 `changes` 对象。
- **`setMessageBlocksLoading(payload: 'idle' | 'loading')`**:
- (自定义) 设置 `loadingState` 属性。
- **`setMessageBlocksError(payload: string)`**:
- (自定义) 设置 `loadingState``'failed'` 并记录错误信息。
**使用示例 (在 Thunk 或其他 Dispatch 的地方):**
```typescript
import { upsertOneBlock, removeManyBlocks, updateOneBlock } from './messageBlock'
import store from './store' // 假设这是你的 Redux store 实例
// 添加或更新一个块
const newBlock: MessageBlock = {
/* ... block data ... */
}
store.dispatch(upsertOneBlock(newBlock))
// 更新一个块的内容
store.dispatch(updateOneBlock({ id: blockId, changes: { content: 'New content' } }))
// 删除多个块
const blockIdsToRemove = ['id1', 'id2']
store.dispatch(removeManyBlocks(blockIdsToRemove))
```
## Selectors
该 slice 导出由 `createEntityAdapter` 生成的基础 selectors并通过 `messageBlocksSelectors` 对象访问:
- **`messageBlocksSelectors.selectIds(state: RootState): string[]`**: 返回包含所有块 ID 的数组。
- **`messageBlocksSelectors.selectEntities(state: RootState): { [id: string]: MessageBlock }`**: 返回块 ID 到块对象的映射字典。
- **`messageBlocksSelectors.selectAll(state: RootState): MessageBlock[]`**: 返回包含所有块对象的数组。
- **`messageBlocksSelectors.selectTotal(state: RootState): number`**: 返回块的总数。
- **`messageBlocksSelectors.selectById(state: RootState, id: string): MessageBlock | undefined`**: 根据 ID 返回单个块对象,如果找不到则返回 `undefined`
**此外,还提供了一个自定义的、记忆化的 selector**
- **`selectFormattedCitationsByBlockId(state: RootState, blockId: string | undefined): Citation[]`**:
- 接收一个 `blockId`
- 如果该 ID 对应的块是 `CITATION` 类型,则提取并格式化其包含的引用信息(来自网页搜索、知识库等),进行去重和重新编号,最后返回一个 `Citation[]` 数组,用于在 UI 中显示。
- 如果块不存在或类型不匹配,返回空数组 `[]`
- 这个 selector 封装了处理不同引用来源Gemini, OpenAI, OpenRouter, Zhipu 等)的复杂逻辑。
**使用示例 (在 React 组件或 `useSelector` 中):**
```typescript
import { useSelector } from 'react-redux'
import { messageBlocksSelectors, selectFormattedCitationsByBlockId } from './messageBlock'
import type { RootState } from './store'
// 获取所有块
const allBlocks = useSelector(messageBlocksSelectors.selectAll)
// 获取特定 ID 的块
const specificBlock = useSelector((state: RootState) => messageBlocksSelectors.selectById(state, someBlockId))
// 获取特定引用块格式化后的引用列表
const formattedCitations = useSelector((state: RootState) => selectFormattedCitationsByBlockId(state, citationBlockId))
// 在组件中使用引用数据
// {formattedCitations.map(citation => ...)}
```
## 集成
`messageBlock.ts` slice 通常与 `messageThunk.ts` 中的 Thunks 紧密协作。Thunks 负责处理异步逻辑(如 API 调用、数据库操作),并在需要时 dispatch `messageBlock` slice 的 actions 来更新状态。例如,当 `messageThunk` 接收到流式响应时,它会 dispatch `upsertOneBlock``updateOneBlock` 来实时更新对应的 `MessageBlock`。同样,删除消息的 Thunk 会 dispatch `removeManyBlocks`
理解 `messageBlock.ts` 的职责是管理**状态本身**,而 `messageThunk.ts` 负责**触发状态变更**的异步流程,这对于维护清晰的应用架构至关重要。

View File

@@ -0,0 +1,105 @@
# messageThunk.ts 使用指南
该文件包含用于管理应用程序中消息流、处理助手交互以及同步 Redux 状态与 IndexedDB 数据库的核心 Thunk Action Creators。主要围绕 `Message``MessageBlock` 对象进行操作。
## 核心功能
1. **发送/接收消息**: 处理用户消息的发送,触发助手响应,并流式处理返回的数据,将其解析为不同的 `MessageBlock`
2. **状态管理**: 确保 Redux store 中的消息和消息块状态与 IndexedDB 中的持久化数据保持一致。
3. **消息操作**: 提供删除、重发、重新生成、编辑后重发、追加响应、克隆等消息生命周期管理功能。
4. **Block 处理**: 动态创建、更新和保存各种类型的 `MessageBlock`(文本、思考过程、工具调用、引用、图片、错误、翻译等)。
## 主要 Thunks
以下是一些关键的 Thunk 函数及其用途:
1. **`sendMessage(userMessage, userMessageBlocks, assistant, topicId)`**
- **用途**: 发送一条新的用户消息。
- **流程**:
- 保存用户消息 (`userMessage`) 及其块 (`userMessageBlocks`) 到 Redux 和 DB。
- 检查 `@mentions` 以确定是单模型响应还是多模型响应。
- 创建助手消息(们)的存根 (Stub)。
- 将存根添加到 Redux 和 DB。
- 将核心处理逻辑 `fetchAndProcessAssistantResponseImpl` 添加到该 `topicId` 的队列中以获取实际响应。
- **Block 相关**: 主要处理用户消息的初始 `MessageBlock` 保存。
2. **`fetchAndProcessAssistantResponseImpl(dispatch, getState, topicId, assistant, assistantMessage)`**
- **用途**: (内部函数) 获取并处理单个助手响应的核心逻辑,被 `sendMessage`, `resend...`, `regenerate...`, `append...` 等调用。
- **流程**:
- 设置 Topic 加载状态。
- 准备上下文消息。
- 调用 `fetchChatCompletion` API 服务。
- 使用 `createStreamProcessor` 处理流式响应。
- 通过各种回调 (`onTextChunk`, `onThinkingChunk`, `onToolCallComplete`, `onImageGenerated`, `onError`, `onComplete` 等) 处理不同类型的事件。
- **Block 相关**:
- 根据流事件创建初始 `UNKNOWN` 块。
- 实时创建和更新 `MAIN_TEXT``THINKING` 块,使用 `throttledBlockUpdate``throttledBlockDbUpdate` 进行节流更新。
- 创建 `TOOL`, `CITATION`, `IMAGE`, `ERROR` 等类型的块。
- 在事件完成时(如 `onTextComplete`, `onToolCallComplete`)将块状态标记为 `SUCCESS``ERROR`,并使用 `saveUpdatedBlockToDB` 保存最终状态。
- 使用 `handleBlockTransition` 管理非流式块(如 `TOOL`, `CITATION`)的添加和状态更新。
3. **`loadTopicMessagesThunk(topicId, forceReload)`**
- **用途**: 从数据库加载指定主题的所有消息及其关联的 `MessageBlock`
- **流程**:
- 从 DB 获取 `Topic` 及其 `messages` 列表。
- 根据消息 ID 列表从 DB 获取所有相关的 `MessageBlock`
- 使用 `upsertManyBlocks` 将块更新到 Redux。
- 将消息更新到 Redux。
- **Block 相关**: 负责将持久化的 `MessageBlock` 加载到 Redux 状态。
4. **删除 Thunks**
- `deleteSingleMessageThunk(topicId, messageId)`: 删除单个消息及其所有 `MessageBlock`
- `deleteMessageGroupThunk(topicId, askId)`: 删除一个用户消息及其所有相关的助手响应消息和它们的所有 `MessageBlock`
- `clearTopicMessagesThunk(topicId)`: 清空主题下的所有消息及其所有 `MessageBlock`
- **Block 相关**: 从 Redux 和 DB 中移除指定的 `MessageBlock`
5. **重发/重新生成 Thunks**
- `resendMessageThunk(topicId, userMessageToResend, assistant)`: 重发用户消息。会重置(清空 Block 并标记为 PENDING所有与该用户消息关联的助手响应然后重新请求生成。
- `resendUserMessageWithEditThunk(topicId, originalMessage, mainTextBlockId, editedContent, assistant)`: 用户编辑消息内容后重发。先更新用户消息的 `MAIN_TEXT` 块内容,然后调用 `resendMessageThunk`
- `regenerateAssistantResponseThunk(topicId, assistantMessageToRegenerate, assistant)`: 重新生成单个助手响应。重置该助手消息(清空 Block 并标记为 PENDING然后重新请求生成。
- **Block 相关**: 删除旧的 `MessageBlock`,并在重新生成过程中创建新的 `MessageBlock`
6. **`appendAssistantResponseThunk(topicId, existingAssistantMessageId, newModel, assistant)`**
- **用途**: 在已有的对话上下文中,针对同一个用户问题,使用新选择的模型追加一个新的助手响应。
- **流程**:
- 找到现有助手消息以获取原始 `askId`
- 创建使用 `newModel` 的新助手消息存根(使用相同的 `askId`)。
- 添加新存根到 Redux 和 DB。
-`fetchAndProcessAssistantResponseImpl` 添加到队列以生成新响应。
- **Block 相关**: 为新的助手响应创建全新的 `MessageBlock`
7. **`cloneMessagesToNewTopicThunk(sourceTopicId, branchPointIndex, newTopic)`**
- **用途**: 将源主题的部分消息(及其 Block克隆到一个**已存在**的新主题中。
- **流程**:
- 复制指定索引前的消息。
- 为所有克隆的消息和 Block 生成新的 UUID。
- 正确映射克隆消息之间的 `askId` 关系。
- 复制 `MessageBlock` 内容,更新其 `messageId` 指向新的消息 ID。
- 更新文件引用计数(如果 Block 是文件或图片)。
- 将克隆的消息和 Block 保存到新主题的 Redux 状态和 DB 中。
- **Block 相关**: 创建 `MessageBlock` 的副本,并更新其 ID 和 `messageId`
8. **`initiateTranslationThunk(messageId, topicId, targetLanguage, sourceBlockId?, sourceLanguage?)`**
- **用途**: 为指定消息启动翻译流程,创建一个初始的 `TRANSLATION` 类型的 `MessageBlock`
- **流程**:
- 创建一个状态为 `STREAMING``TranslationMessageBlock`
- 将其添加到 Redux 和 DB。
- 更新原消息的 `blocks` 列表以包含新的翻译块 ID。
- **Block 相关**: 创建并保存一个占位的 `TranslationMessageBlock`。实际翻译内容的获取和填充需要后续步骤。
## 内部机制和注意事项
- **数据库交互**: 通过 `saveMessageAndBlocksToDB`, `updateExistingMessageAndBlocksInDB`, `saveUpdatesToDB`, `saveUpdatedBlockToDB`, `throttledBlockDbUpdate` 等辅助函数与 IndexedDB (`db`) 交互,确保数据持久化。
- **状态同步**: Thunks 负责协调 Redux Store 和 IndexedDB 之间的数据一致性。
- **队列 (`getTopicQueue`)**: 使用 `AsyncQueue` 确保对同一主题的操作(尤其是 API 请求)按顺序执行,避免竞态条件。
- **节流 (`throttle`)**: 对流式响应中频繁的 Block 更新(文本、思考)使用 `lodash.throttle` 优化性能,减少 Redux dispatch 和 DB 写入次数。
- **错误处理**: `fetchAndProcessAssistantResponseImpl` 内的回调函数(特别是 `onError`)处理流处理和 API 调用中可能出现的错误,并创建 `ERROR` 类型的 `MessageBlock`
开发者在使用这些 Thunks 时,通常需要提供 `dispatch`, `getState` (由 Redux Thunk 中间件注入),以及如 `topicId`, `assistant` 配置对象, 相关的 `Message``MessageBlock` 对象/ID 等参数。理解每个 Thunk 的职责和它如何影响消息及块的状态至关重要。

View File

@@ -0,0 +1,156 @@
# useMessageOperations.ts 使用指南
该文件定义了一个名为 `useMessageOperations` 的自定义 React Hook。这个 Hook 的主要目的是为 React 组件提供一个便捷的接口用于执行与特定主题Topic相关的各种消息操作。它封装了调用 Redux Thunks (`messageThunk.ts`) 和 Actions (`newMessage.ts`, `messageBlock.ts`) 的逻辑,简化了组件与消息数据交互的代码。
## 核心目标
- **封装**: 将复杂的消息操作逻辑(如删除、重发、重新生成、编辑、翻译等)封装在易于使用的函数中。
- **简化**: 让组件可以直接调用这些操作函数,而无需直接与 Redux `dispatch` 或 Thunks 交互。
- **上下文关联**: 所有操作都与传入的 `topic` 对象相关联,确保操作作用于正确的主题。
## 如何使用
在你的 React 函数组件中,导入并调用 `useMessageOperations` Hook并传入当前活动的 `Topic` 对象。
```typescript
import React from 'react';
import { useMessageOperations } from '@renderer/hooks/useMessageOperations';
import type { Topic, Message, Assistant, Model } from '@renderer/types';
interface MyComponentProps {
currentTopic: Topic;
currentAssistant: Assistant;
}
function MyComponent({ currentTopic, currentAssistant }: MyComponentProps) {
const {
deleteMessage,
resendMessage,
regenerateAssistantMessage,
appendAssistantResponse,
getTranslationUpdater,
createTopicBranch,
// ... 其他操作函数
} = useMessageOperations(currentTopic);
const handleDelete = (messageId: string) => {
deleteMessage(messageId);
};
const handleResend = (message: Message) => {
resendMessage(message, currentAssistant);
};
const handleAppend = (existingMsg: Message, newModel: Model) => {
appendAssistantResponse(existingMsg, newModel, currentAssistant);
}
// ... 在组件中使用其他操作函数
return (
<div>
{/* Component UI */}
<button onClick={() => handleDelete('some-message-id')}>Delete Message</button>
{/* ... */}
</div>
);
}
```
## 返回值
`useMessageOperations(topic)` Hook 返回一个包含以下函数和值的对象:
- **`deleteMessage(id: string)`**:
- 删除指定 `id` 的单个消息。
- 内部调用 `deleteSingleMessageThunk`
- **`deleteGroupMessages(askId: string)`**:
- 删除与指定 `askId` 相关联的一组消息(通常是用户提问及其所有助手回答)。
- 内部调用 `deleteMessageGroupThunk`
- **`editMessage(messageId: string, updates: Partial<Message>)`**:
- 更新指定 `messageId` 的消息的部分属性。
- **注意**: 目前主要用于更新 Redux 状态
- 内部调用 `newMessagesActions.updateMessage`
- **`resendMessage(message: Message, assistant: Assistant)`**:
- 重新发送指定的用户消息 (`message`),这将触发其所有关联助手响应的重新生成。
- 内部调用 `resendMessageThunk`
- **`resendUserMessageWithEdit(message: Message, editedContent: string, assistant: Assistant)`**:
- 在用户消息的主要文本块被编辑后,重新发送该消息。
- 会先查找消息的 `MAIN_TEXT` 块 ID然后调用 `resendUserMessageWithEditThunk`
- **`clearTopicMessages(_topicId?: string)`**:
- 清除当前主题(或可选的指定 `_topicId`)下的所有消息。
- 内部调用 `clearTopicMessagesThunk`
- **`createNewContext()`**:
- 发出一个全局事件 (`EVENT_NAMES.NEW_CONTEXT`),通常用于通知 UI 清空显示,准备新的上下文。不直接修改 Redux 状态。
- **`displayCount`**:
- (非操作函数) 从 Redux store 中获取当前的 `displayCount` 值。
- **`pauseMessages()`**:
- 尝试中止当前主题中正在进行的消息生成(状态为 `processing``pending`)。
- 通过查找相关的 `askId` 并调用 `abortCompletion` 来实现。
- 同时会 dispatch `setTopicLoading` action 将加载状态设为 `false`
- **`resumeMessage(message: Message, assistant: Assistant)`**:
- 恢复/重新发送一个用户消息。目前实现为直接调用 `resendMessage`
- **`regenerateAssistantMessage(message: Message, assistant: Assistant)`**:
- 重新生成指定的**助手**消息 (`message`) 的响应。
- 内部调用 `regenerateAssistantResponseThunk`
- **`appendAssistantResponse(existingAssistantMessage: Message, newModel: Model, assistant: Assistant)`**:
- 针对 `existingAssistantMessage` 所回复的**同一用户提问**,使用 `newModel` 追加一个新的助手响应。
- 内部调用 `appendAssistantResponseThunk`
- **`getTranslationUpdater(messageId: string, targetLanguage: string, sourceBlockId?: string, sourceLanguage?: string)`**:
- **用途**: 获取一个用于逐步更新翻译块内容的函数。
- **流程**:
1. 内部调用 `initiateTranslationThunk` 来创建或获取一个 `TRANSLATION` 类型的 `MessageBlock`,并获取其 `blockId`
2. 返回一个**异步更新函数**。
- **返回的更新函数 `(accumulatedText: string, isComplete?: boolean) => void`**:
- 接收累积的翻译文本和完成状态。
- 调用 `updateOneBlock` 更新 Redux 中的翻译块内容和状态 (`STREAMING``SUCCESS`)。
- 调用 `throttledBlockDbUpdate` 将更新(节流地)保存到数据库。
- 如果初始化失败Thunk 返回 `undefined`),则此函数返回 `null`
- **`createTopicBranch(sourceTopicId: string, branchPointIndex: number, newTopic: Topic)`**:
- 创建一个主题分支,将 `sourceTopicId` 主题中 `branchPointIndex` 索引之前的消息克隆到 `newTopic` 中。
- **注意**: `newTopic` 对象必须是调用此函数**之前**已经创建并添加到 Redux 和数据库中的。
- 内部调用 `cloneMessagesToNewTopicThunk`
## 依赖
- **`topic: Topic`**: 必须传入当前操作上下文的主题对象。Hook 返回的操作函数将始终作用于这个主题的 `topic.id`
- **Redux `dispatch`**: Hook 内部使用 `useAppDispatch` 获取 `dispatch` 函数来调用 actions 和 thunks。
## 相关 Hooks
在同一文件中还定义了两个辅助 Hook
- **`useTopicMessages(topic: Topic)`**:
- 使用 `selectMessagesForTopic` selector 来获取并返回指定主题的消息列表。
- **`useTopicLoading(topic: Topic)`**:
- 使用 `selectNewTopicLoading` selector 来获取并返回指定主题的加载状态。
这些 Hook 可以与 `useMessageOperations` 结合使用,方便地在组件中获取消息数据、加载状态,并执行相关操作。

View File

@@ -0,0 +1,214 @@
# 如何为 AI Provider 编写中间件
本文档旨在指导开发者如何为我们的 AI Provider 框架创建和集成自定义中间件。中间件提供了一种强大而灵活的方式来增强、修改或观察 Provider 方法的调用过程,例如日志记录、缓存、请求/响应转换、错误处理等。
## 架构概览
我们的中间件架构借鉴了 Redux 的三段式设计,并结合了 JavaScript Proxy 来动态地将中间件应用于 Provider 的方法。
- **Proxy**: 拦截对 Provider 方法的调用,并将调用引导至中间件链。
- **中间件链**: 一系列按顺序执行的中间件函数。每个中间件都可以处理请求/响应,然后将控制权传递给链中的下一个中间件,或者在某些情况下提前终止链。
- **上下文 (Context)**: 一个在中间件之间传递的对象携带了关于当前调用的信息如方法名、原始参数、Provider 实例、以及中间件自定义的数据)。
## 中间件的类型
目前主要支持两种类型的中间件,它们共享相似的结构但针对不同的场景:
1. **`CompletionsMiddleware`**: 专门为 `completions` 方法设计。这是最常用的中间件类型,因为它允许对 AI 模型的核心聊天/文本生成功能进行精细控制。
2. **`ProviderMethodMiddleware`**: 通用中间件,可以应用于 Provider 上的任何其他方法(例如,`translate`, `summarize` 等,如果这些方法也通过中间件系统包装)。
## 编写一个 `CompletionsMiddleware`
`CompletionsMiddleware` 的基本签名TypeScript 类型)如下:
```typescript
import { AiProviderMiddlewareCompletionsContext, CompletionsParams, MiddlewareAPI } from './AiProviderMiddlewareTypes' // 假设类型定义文件路径
export type CompletionsMiddleware = (
api: MiddlewareAPI<AiProviderMiddlewareCompletionsContext, [CompletionsParams]>
) => (
next: (context: AiProviderMiddlewareCompletionsContext, params: CompletionsParams) => Promise<any> // next 返回 Promise<any> 代表原始SDK响应或下游中间件的结果
) => (context: AiProviderMiddlewareCompletionsContext, params: CompletionsParams) => Promise<void> // 最内层函数通常返回 Promise<void>,因为结果通过 onChunk 或 context 副作用传递
```
让我们分解这个三段式结构:
1. **第一层函数 `(api) => { ... }`**:
- 接收一个 `api` 对象。
- `api` 对象提供了以下方法:
- `api.getContext()`: 获取当前调用的上下文对象 (`AiProviderMiddlewareCompletionsContext`)。
- `api.getOriginalArgs()`: 获取传递给 `completions` 方法的原始参数数组 (即 `[CompletionsParams]`)。
- `api.getProviderId()`: 获取当前 Provider 的 ID。
- `api.getProviderInstance()`: 获取原始的 Provider 实例。
- 此函数通常用于进行一次性的设置或获取所需的服务/配置。它返回第二层函数。
2. **第二层函数 `(next) => { ... }`**:
- 接收一个 `next` 函数。
- `next` 函数代表了中间件链中的下一个环节。调用 `next(context, params)` 会将控制权传递给下一个中间件,或者如果当前中间件是链中的最后一个,则会调用核心的 Provider 方法逻辑 (例如,实际的 SDK 调用)。
- `next` 函数接收当前的 `context``params` (这些可能已被上游中间件修改)。
- **重要的是**`next` 的返回类型通常是 `Promise<any>`。对于 `completions` 方法,如果 `next` 调用了实际的 SDK它将返回原始的 SDK 响应例如OpenAI 的流对象或 JSON 对象)。你需要处理这个响应。
- 此函数返回第三层(也是最核心的)函数。
3. **第三层函数 `(context, params) => { ... }`**:
- 这是执行中间件主要逻辑的地方。
- 它接收当前的 `context` (`AiProviderMiddlewareCompletionsContext`) 和 `params` (`CompletionsParams`)。
- 在此函数中,你可以:
- **在调用 `next` 之前**:
- 读取或修改 `params`。例如,添加默认参数、转换消息格式。
- 读取或修改 `context`。例如,设置一个时间戳用于后续计算延迟。
- 执行某些检查,如果不满足条件,可以不调用 `next` 而直接返回或抛出错误(例如,参数校验失败)。
- **调用 `await next(context, params)`**:
- 这是将控制权传递给下游的关键步骤。
- `next` 的返回值是原始的 SDK 响应或下游中间件的结果,你需要根据情况处理它(例如,如果是流,则开始消费流)。
- **在调用 `next` 之后**:
- 处理 `next` 的返回结果。例如,如果 `next` 返回了一个流,你可以在这里开始迭代处理这个流,并通过 `context.onChunk` 发送数据块。
- 基于 `context` 的变化或 `next` 的结果执行进一步操作。例如,计算总耗时、记录日志。
- 修改最终结果(尽管对于 `completions`,结果通常通过 `onChunk` 副作用发出)。
### 示例:一个简单的日志中间件
```typescript
import {
AiProviderMiddlewareCompletionsContext,
CompletionsParams,
MiddlewareAPI,
OnChunkFunction // 假设 OnChunkFunction 类型被导出
} from './AiProviderMiddlewareTypes' // 调整路径
import { ChunkType } from '@renderer/types' // 调整路径
export const createSimpleLoggingMiddleware = (): CompletionsMiddleware => {
return (api: MiddlewareAPI<AiProviderMiddlewareCompletionsContext, [CompletionsParams]>) => {
// console.log(`[LoggingMiddleware] Initialized for provider: ${api.getProviderId()}`);
return (next: (context: AiProviderMiddlewareCompletionsContext, params: CompletionsParams) => Promise<any>) => {
return async (context: AiProviderMiddlewareCompletionsContext, params: CompletionsParams): Promise<void> => {
const startTime = Date.now()
// 从 context 中获取 onChunk (它最初来自 params.onChunk)
const onChunk = context.onChunk
console.log(
`[LoggingMiddleware] Request for ${context.methodName} with params:`,
params.messages?.[params.messages.length - 1]?.content
)
try {
// 调用下一个中间件或核心逻辑
// `rawSdkResponse` 是来自下游的原始响应 (例如 OpenAIStream 或 ChatCompletion 对象)
const rawSdkResponse = await next(context, params)
// 此处简单示例不处理 rawSdkResponse假设下游中间件 (如 StreamingResponseHandler)
// 会处理它并通过 onChunk 发送数据。
// 如果这个日志中间件在 StreamingResponseHandler 之后,那么流已经被处理。
// 如果在之前,那么它需要自己处理 rawSdkResponse 或确保下游会处理。
const duration = Date.now() - startTime
console.log(`[LoggingMiddleware] Request for ${context.methodName} completed in ${duration}ms.`)
// 假设下游已经通过 onChunk 发送了所有数据。
// 如果这个中间件是链的末端,并且需要确保 BLOCK_COMPLETE 被发送,
// 它可能需要更复杂的逻辑来跟踪何时所有数据都已发送。
} catch (error) {
const duration = Date.now() - startTime
console.error(`[LoggingMiddleware] Request for ${context.methodName} failed after ${duration}ms:`, error)
// 如果 onChunk 可用,可以尝试发送一个错误块
if (onChunk) {
onChunk({
type: ChunkType.ERROR,
error: { message: (error as Error).message, name: (error as Error).name, stack: (error as Error).stack }
})
// 考虑是否还需要发送 BLOCK_COMPLETE 来结束流
onChunk({ type: ChunkType.BLOCK_COMPLETE, response: {} })
}
throw error // 重新抛出错误,以便上层或全局错误处理器可以捕获
}
}
}
}
}
```
### `AiProviderMiddlewareCompletionsContext` 的重要性
`AiProviderMiddlewareCompletionsContext` 是在中间件之间传递状态和数据的核心。它通常包含:
- `methodName`: 当前调用的方法名 (总是 `'completions'`)。
- `originalArgs`: 传递给 `completions` 的原始参数数组。
- `providerId`: Provider 的 ID。
- `_providerInstance`: Provider 实例。
- `onChunk`: 从原始 `CompletionsParams` 传入的回调函数,用于流式发送数据块。**所有中间件都应该通过 `context.onChunk` 来发送数据。**
- `messages`, `model`, `assistant`, `mcpTools`: 从原始 `CompletionsParams` 中提取的常用字段,方便访问。
- **自定义字段**: 中间件可以向上下文中添加自定义字段,以供后续中间件使用。例如,一个缓存中间件可能会添加 `context.cacheHit = true`
**关键**: 当你在中间件中修改 `params``context` 时,这些修改会向下游中间件传播(如果它们在 `next` 调用之前修改)。
### 中间件的顺序
中间件的执行顺序非常重要。它们在 `AiProviderMiddlewareConfig` 的数组中定义的顺序就是它们的执行顺序。
- 请求首先通过第一个中间件,然后是第二个,依此类推。
- 响应(或 `next` 的调用结果)则以相反的顺序"冒泡"回来。
例如,如果链是 `[AuthMiddleware, CacheMiddleware, LoggingMiddleware]`
1. `AuthMiddleware` 先执行其 "调用 `next` 之前" 的逻辑。
2. 然后 `CacheMiddleware` 执行其 "调用 `next` 之前" 的逻辑。
3. 然后 `LoggingMiddleware` 执行其 "调用 `next` 之前" 的逻辑。
4. 核心SDK调用或链的末端
5. `LoggingMiddleware` 先接收到结果,执行其 "调用 `next` 之后" 的逻辑。
6. 然后 `CacheMiddleware` 接收到结果(可能已被 LoggingMiddleware 修改的上下文),执行其 "调用 `next` 之后" 的逻辑(例如,存储结果)。
7. 最后 `AuthMiddleware` 接收到结果,执行其 "调用 `next` 之后" 的逻辑。
### 注册中间件
中间件在 `src/renderer/src/providers/middleware/register.ts` (或其他类似的配置文件) 中进行注册。
```typescript
// register.ts
import { AiProviderMiddlewareConfig } from './AiProviderMiddlewareTypes'
import { createSimpleLoggingMiddleware } from './common/SimpleLoggingMiddleware' // 假设你创建了这个文件
import { createCompletionsLoggingMiddleware } from './common/CompletionsLoggingMiddleware' // 已有的
const middlewareConfig: AiProviderMiddlewareConfig = {
completions: [
createSimpleLoggingMiddleware(), // 你新加的中间件
createCompletionsLoggingMiddleware() // 已有的日志中间件
// ... 其他 completions 中间件
],
methods: {
// translate: [createGenericLoggingMiddleware()],
// ... 其他方法的中间件
}
}
export default middlewareConfig
```
### 最佳实践
1. **单一职责**: 每个中间件应专注于一个特定的功能(例如,日志、缓存、转换特定数据)。
2. **无副作用 (尽可能)**: 除了通过 `context``onChunk` 明确的副作用外,尽量避免修改全局状态或产生其他隐蔽的副作用。
3. **错误处理**:
- 在中间件内部使用 `try...catch` 来处理可能发生的错误。
- 决定是自行处理错误(例如,通过 `onChunk` 发送错误块)还是将错误重新抛出给上游。
- 如果重新抛出,确保错误对象包含足够的信息。
4. **性能考虑**: 中间件会增加请求处理的开销。避免在中间件中执行非常耗时的同步操作。对于IO密集型操作确保它们是异步的。
5. **可配置性**: 使中间件的行为可通过参数或配置进行调整。例如,日志中间件可以接受一个日志级别参数。
6. **上下文管理**:
- 谨慎地向 `context` 添加数据。避免污染 `context` 或添加过大的对象。
- 明确你添加到 `context` 的字段的用途和生命周期。
7. **`next` 的调用**:
- 除非你有充分的理由提前终止请求(例如,缓存命中、授权失败),否则**总是确保调用 `await next(context, params)`**。否则,下游的中间件和核心逻辑将不会执行。
- 理解 `next` 的返回值并正确处理它,特别是当它是一个流时。你需要负责消费这个流或将其传递给另一个能够消费它的组件/中间件。
8. **命名清晰**: 给你的中间件和它们创建的函数起描述性的名字。
9. **文档和注释**: 对复杂的中间件逻辑添加注释,解释其工作原理和目的。
### 调试技巧
- 在中间件的关键点使用 `console.log` 或调试器来检查 `params``context` 的状态以及 `next` 的返回值。
- 暂时简化中间件链,只保留你正在调试的中间件和最简单的核心逻辑,以隔离问题。
- 编写单元测试来独立验证每个中间件的行为。
通过遵循这些指南,你应该能够有效地为我们的系统创建强大且可维护的中间件。如果你有任何疑问或需要进一步的帮助,请咨询团队。

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 KiB

View File

@@ -1,53 +1,85 @@
appId: com.kangfenmao.CherryStudio
productName: Cherry Studio
electronLanguages:
- zh-CN
- zh-TW
- en-US
- ja # macOS/linux/win
- ru # macOS/linux/win
- zh_CN # for macOS
- zh_TW # for macOS
- en # for macOS
directories:
buildResources: build
files:
- '!{.vscode,.yarn,.github}'
- '!electron.vite.config.{js,ts,mjs,cjs}'
- '!{.eslintignore,.eslintrc.cjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}'
- '!{.env,.env.*,.npmrc,pnpm-lock.yaml}'
- '!{tsconfig.json,tsconfig.node.json,tsconfig.web.json}'
- '**/*'
- '!**/{.vscode,.yarn,.yarn-lock,.github,.cursorrules,.prettierrc}'
- '!electron.vite.config.{js,ts,mjs,cjs}}'
- '!**/{.eslintignore,.eslintrc.js,.eslintrc.json,.eslintcache,root.eslint.config.js,eslint.config.js,.eslintrc.cjs,.prettierignore,.prettierrc.yaml,eslint.config.mjs,dev-app-update.yml,CHANGELOG.md,README.md}'
- '!**/{.env,.env.*,.npmrc,pnpm-lock.yaml}'
- '!**/{tsconfig.json,tsconfig.tsbuildinfo,tsconfig.node.json,tsconfig.web.json}'
- '!**/{.editorconfig,.jekyll-metadata}'
- '!src'
- '!scripts'
- '!local'
- '!docs'
- '!packages'
- '!.swc'
- '!.bin'
- '!._*'
- '!*.log'
- '!stats.html'
- '!*.md'
- '!**/*.{iml,o,hprof,orig,pyc,pyo,rbc,swp,csproj,sln,xproj}'
- '!**/*.{map,ts,tsx,jsx,less,scss,sass,css.d.ts,d.cts,d.mts,md,markdown,yaml,yml}'
- '!**/{test,tests,__tests__,coverage}/**'
- '!**/{test,tests,__tests__,powered-test,coverage}/**'
- '!**/{example,examples}/**'
- '!**/*.{spec,test}.{js,jsx,ts,tsx}'
- '!**/*.min.*.map'
- '!**/*.d.ts'
- '!**/{.DS_Store,Thumbs.db}'
- '!**/{LICENSE,LICENSE.txt,LICENSE-MIT.txt,*.LICENSE.txt,NOTICE.txt,README.md,CHANGELOG.md}'
- '!**/dist/es6/**'
- '!**/dist/demo/**'
- '!**/amd/**'
- '!**/{.DS_Store,Thumbs.db,thumbs.db,__pycache__}'
- '!**/{LICENSE,license,LICENSE.*,*.LICENSE.txt,NOTICE.txt,README.md,readme.md,CHANGELOG.md}'
- '!node_modules/rollup-plugin-visualizer'
- '!node_modules/js-tiktoken'
- '!node_modules/@tavily/core/node_modules/js-tiktoken'
- '!node_modules/pdf-parse/lib/pdf.js/{v1.9.426,v1.10.88,v2.0.550}'
- '!node_modules/mammoth/{mammoth.browser.js,mammoth.browser.min.js}'
- '!node_modules/selection-hook/prebuilds/**/*' # we rebuild .node, don't use prebuilds
- '!**/*.{h,iobj,ipdb,tlog,recipe,vcxproj,vcxproj.filters}' # filter .node build files
- '!node_modules/pdfjs-dist/web/**/*'
- '!node_modules/pdfjs-dist/legacy/web/*'
asarUnpack:
- resources/**
- '**/*.{node,dll,metal,exp,lib}'
- '**/*.{metal,exp,lib}'
win:
executableName: Cherry Studio
artifactName: ${productName}-${version}-portable.${ext}
artifactName: ${productName}-${version}-${arch}-setup.${ext}
target:
- target: nsis
- target: portable
signtoolOptions:
sign: scripts/win-sign.js
verifyUpdateCodeSignature: false
nsis:
artifactName: ${productName}-${version}-setup.${ext}
artifactName: ${productName}-${version}-${arch}-setup.${ext}
shortcutName: ${productName}
uninstallDisplayName: ${productName}
createDesktopShortcut: always
allowToChangeInstallationDirectory: true
oneClick: false
include: build/nsis-installer.nsh
buildUniversalInstaller: false
portable:
artifactName: ${productName}-${version}-${arch}-portable.${ext}
buildUniversalInstaller: false
mac:
entitlementsInherit: build/entitlements.mac.plist
notarize: false
artifactName: ${productName}-${version}-${arch}.${ext}
minimumSystemVersion: '20.1.0' # 最低支持 macOS 11.0
extendInfo:
- NSCameraUsageDescription: Application requests access to the device's camera.
- NSMicrophoneUsageDescription: Application requests access to the device's microphone.
@@ -55,35 +87,32 @@ mac:
- NSDownloadsFolderUsageDescription: Application requests access to the user's Downloads folder.
target:
- target: dmg
arch:
- arm64
- x64
- target: zip
arch:
- arm64
- x64
linux:
artifactName: ${productName}-${version}-${arch}.${ext}
target:
- target: AppImage
arch:
- arm64
- x64
maintainer: electronjs.org
category: Utility
desktop:
entry:
StartupWMClass: CherryStudio
mimeTypes:
- x-scheme-handler/cherrystudio
publish:
# provider: generic
# url: https://cherrystudio.ocool.online
provider: github
repo: cherry-studio
owner: CherryHQ
provider: generic
url: https://releases.cherry-ai.com
electronDownload:
mirror: https://npmmirror.com/mirrors/electron/
afterPack: scripts/after-pack.js
afterSign: scripts/notarize.js
artifactBuildCompleted: scripts/artifact-build-completed.js
releaseInfo:
releaseNotes: |
小程序支持多开
支持 GPT-4o 图像生成
修复 MCP 服务器无法使用问题
修复升级导致旧版本数据丢失问题
界面优化:优化多处界面样式,气泡样式改版,自动调整代码预览边栏宽度
知识库:修复知识库引用不显示问题,修复部分嵌入模型适配问题
备份与恢复:修复超过 2GB 大文件无法恢复问题
文件处理:添加 .doc 文件支持
划词助手:支持自定义 CSS 样式
MCP基于 Pyodide 实现 Python MCP 服务
其他错误修复和优化

View File

@@ -1,4 +1,4 @@
import react from '@vitejs/plugin-react'
import react from '@vitejs/plugin-react-swc'
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
import { resolve } from 'path'
import { visualizer } from 'rollup-plugin-visualizer'
@@ -9,25 +9,7 @@ const visualizerPlugin = (type: 'renderer' | 'main') => {
export default defineConfig({
main: {
plugins: [
externalizeDepsPlugin({
exclude: [
'@cherrystudio/embedjs',
'@cherrystudio/embedjs-openai',
'@cherrystudio/embedjs-loader-web',
'@cherrystudio/embedjs-loader-markdown',
'@cherrystudio/embedjs-loader-msoffice',
'@cherrystudio/embedjs-loader-xml',
'@cherrystudio/embedjs-loader-pdf',
'@cherrystudio/embedjs-loader-sitemap',
'@cherrystudio/embedjs-libsql',
'@cherrystudio/embedjs-loader-image',
'p-queue',
'webdav'
]
}),
...visualizerPlugin('main')
],
plugins: [externalizeDepsPlugin(), ...visualizerPlugin('main')],
resolve: {
alias: {
'@main': resolve('src/main'),
@@ -37,20 +19,37 @@ export default defineConfig({
},
build: {
rollupOptions: {
external: ['@libsql/client']
external: ['@libsql/client', 'bufferutil', 'utf-8-validate', '@cherrystudio/mac-system-ocr'],
output: {
// 彻底禁用代码分割 - 返回 null 强制单文件打包
manualChunks: undefined,
// 内联所有动态导入,这是关键配置
inlineDynamicImports: true
}
},
sourcemap: process.env.NODE_ENV === 'development'
},
optimizeDeps: {
disabled: 'dev'
}
},
preload: {
plugins: [externalizeDepsPlugin()]
plugins: [externalizeDepsPlugin()],
resolve: {
alias: {
'@shared': resolve('packages/shared')
}
},
build: {
sourcemap: process.env.NODE_ENV === 'development'
}
},
renderer: {
plugins: [
react({
babel: {
plugins: [
[
'styled-components',
'@swc/plugin-styled-components',
{
displayName: true, // 开发环境下启用组件名称
fileName: false, // 不在类名中包含文件名
@@ -59,7 +58,6 @@ export default defineConfig({
}
]
]
}
}),
...visualizerPlugin('renderer')
],
@@ -70,7 +68,24 @@ export default defineConfig({
}
},
optimizeDeps: {
exclude: ['chunk-PZ64DZKH.js', 'chunk-JMKENWIY.js', 'chunk-UXYB6GHG.js', 'chunk-ALDIEZMG.js', 'chunk-4X6ZJEXY.js']
exclude: ['pyodide'],
esbuildOptions: {
target: 'esnext' // for dev
}
},
worker: {
format: 'es'
},
build: {
target: 'esnext', // for build
rollupOptions: {
input: {
index: resolve(__dirname, 'src/renderer/index.html'),
miniWindow: resolve(__dirname, 'src/renderer/miniWindow.html'),
selectionToolbar: resolve(__dirname, 'src/renderer/selectionToolbar.html'),
selectionAction: resolve(__dirname, 'src/renderer/selectionAction.html')
}
}
}
}
})

View File

@@ -1,6 +1,6 @@
{
"name": "CherryStudio",
"version": "1.1.17",
"version": "1.5.0-rc.2",
"private": true,
"description": "A powerful AI assistant for producer.",
"main": "./out/main/index.js",
@@ -20,15 +20,17 @@
"scripts": {
"start": "electron-vite preview",
"dev": "electron-vite dev",
"debug": "electron-vite dev -- --inspect --sourcemap --remote-debugging-port=9222",
"build": "npm run typecheck && electron-vite build",
"build:check": "yarn test && yarn typecheck && yarn check:i18n",
"build:check": "yarn typecheck && yarn check:i18n && yarn test",
"build:unpack": "dotenv npm run build && electron-builder --dir",
"build:win": "dotenv npm run build && electron-builder --win",
"build:win": "dotenv npm run build && electron-builder --win --x64 --arm64",
"build:win:x64": "dotenv npm run build && electron-builder --win --x64",
"build:mac": "dotenv electron-vite build && electron-builder --mac",
"build:win:arm64": "dotenv npm run build && electron-builder --win --arm64",
"build:mac": "dotenv electron-vite build && electron-builder --mac --arm64 --x64",
"build:mac:arm64": "dotenv electron-vite build && electron-builder --mac --arm64",
"build:mac:x64": "dotenv electron-vite build && electron-builder --mac --x64",
"build:linux": "dotenv electron-vite build && electron-builder --linux",
"build:linux": "dotenv electron-vite build && electron-builder --linux --x64 --arm64",
"build:linux:arm64": "dotenv electron-vite build && electron-builder --linux --arm64",
"build:linux:x64": "dotenv electron-vite build && electron-builder --linux --x64",
"build:npm": "node scripts/build-npm.js",
@@ -36,79 +38,84 @@
"publish": "yarn build:check && yarn release patch push",
"pulish:artifacts": "cd packages/artifacts && npm publish && cd -",
"generate:agents": "yarn workspace @cherry-studio/database agents",
"generate:icons": "electron-icon-builder --input=./build/logo.png --output=build",
"analyze:renderer": "VISUALIZER_RENDERER=true yarn build",
"analyze:main": "VISUALIZER_MAIN=true yarn build",
"typecheck": "npm run typecheck:node && npm run typecheck:web",
"typecheck:node": "tsc --noEmit -p tsconfig.node.json --composite false",
"typecheck:web": "tsc --noEmit -p tsconfig.web.json --composite false",
"check:i18n": "node scripts/check-i18n.js",
"test": "npx -y tsx --test src/**/*.test.ts",
"test": "vitest run --silent",
"test:main": "vitest run --project main",
"test:renderer": "vitest run --project renderer",
"test:update": "yarn test:renderer --update",
"test:coverage": "vitest run --coverage --silent",
"test:ui": "vitest --ui",
"test:watch": "vitest",
"test:e2e": "yarn playwright test",
"test:lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts",
"format": "prettier --write .",
"lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix",
"postinstall": "electron-builder install-app-deps",
"prepare": "husky"
},
"dependencies": {
"@cherrystudio/embedjs": "^0.1.28",
"@cherrystudio/embedjs-libsql": "^0.1.28",
"@cherrystudio/embedjs-loader-csv": "^0.1.28",
"@cherrystudio/embedjs-loader-image": "^0.1.28",
"@cherrystudio/embedjs-loader-markdown": "^0.1.28",
"@cherrystudio/embedjs-loader-msoffice": "^0.1.28",
"@cherrystudio/embedjs-loader-pdf": "^0.1.28",
"@cherrystudio/embedjs-loader-sitemap": "^0.1.28",
"@cherrystudio/embedjs-loader-web": "^0.1.28",
"@cherrystudio/embedjs-loader-xml": "^0.1.28",
"@cherrystudio/embedjs-openai": "^0.1.28",
"@electron-toolkit/utils": "^3.0.0",
"@electron/notarize": "^2.5.0",
"@google/generative-ai": "^0.24.0",
"@langchain/community": "^0.3.36",
"@notionhq/client": "^2.2.15",
"@tryfabric/martian": "^1.2.4",
"@types/react-infinite-scroll-component": "^5.0.0",
"@xyflow/react": "^12.4.4",
"adm-zip": "^0.5.16",
"docx": "^9.0.2",
"electron-log": "^5.1.5",
"electron-store": "^8.2.0",
"electron-updater": "^6.3.9",
"electron-window-state": "^5.0.3",
"epub": "patch:epub@npm%3A1.3.0#~/.yarn/patches/epub-npm-1.3.0-8325494ffe.patch",
"fast-xml-parser": "^5.0.9",
"fetch-socks": "^1.3.2",
"fs-extra": "^11.2.0",
"markdown-it": "^14.1.0",
"officeparser": "^4.1.1",
"proxy-agent": "^6.5.0",
"tar": "^7.4.3",
"undici": "^7.4.0",
"webdav": "^5.8.0",
"zipread": "^1.3.3"
"@cherrystudio/pdf-to-img-napi": "^0.0.1",
"@libsql/client": "0.14.0",
"@libsql/win32-x64-msvc": "^0.4.7",
"@strongtz/win32-arm64-msvc": "^0.4.7",
"jsdom": "26.1.0",
"node-stream-zip": "^1.15.0",
"notion-helper": "^1.3.22",
"os-proxy-config": "^1.1.2",
"pdfjs-dist": "4.10.38",
"selection-hook": "^1.0.1",
"turndown": "7.2.0"
},
"devDependencies": {
"@agentic/exa": "^7.3.3",
"@agentic/searxng": "^7.3.3",
"@agentic/tavily": "^7.3.3",
"@ant-design/v5-patch-for-react-19": "^1.0.3",
"@anthropic-ai/sdk": "^0.38.0",
"@anthropic-ai/sdk": "^0.41.0",
"@cherrystudio/embedjs": "^0.1.31",
"@cherrystudio/embedjs-libsql": "^0.1.31",
"@cherrystudio/embedjs-loader-csv": "^0.1.31",
"@cherrystudio/embedjs-loader-image": "^0.1.31",
"@cherrystudio/embedjs-loader-markdown": "^0.1.31",
"@cherrystudio/embedjs-loader-msoffice": "^0.1.31",
"@cherrystudio/embedjs-loader-pdf": "^0.1.31",
"@cherrystudio/embedjs-loader-sitemap": "^0.1.31",
"@cherrystudio/embedjs-loader-web": "^0.1.31",
"@cherrystudio/embedjs-loader-xml": "^0.1.31",
"@cherrystudio/embedjs-ollama": "^0.1.31",
"@cherrystudio/embedjs-openai": "^0.1.31",
"@electron-toolkit/eslint-config-prettier": "^3.0.0",
"@electron-toolkit/eslint-config-ts": "^3.0.0",
"@electron-toolkit/preload": "^3.0.0",
"@electron-toolkit/tsconfig": "^1.0.1",
"@electron-toolkit/utils": "^3.0.0",
"@electron/notarize": "^2.5.0",
"@emotion/is-prop-valid": "^1.3.1",
"@eslint-react/eslint-plugin": "^1.36.1",
"@eslint/js": "^9.22.0",
"@google/genai": "^0.4.0",
"@google/genai": "patch:@google/genai@npm%3A1.0.1#~/.yarn/patches/@google-genai-npm-1.0.1-e26f0f9af7.patch",
"@hello-pangea/dnd": "^16.6.0",
"@kangfenmao/keyv-storage": "^0.1.0",
"@modelcontextprotocol/sdk": "^1.8.0",
"@langchain/community": "^0.3.36",
"@langchain/ollama": "^0.2.1",
"@mistralai/mistralai": "^1.6.0",
"@modelcontextprotocol/sdk": "^1.11.4",
"@mozilla/readability": "^0.6.0",
"@notionhq/client": "^2.2.15",
"@playwright/test": "^1.52.0",
"@reduxjs/toolkit": "^2.2.5",
"@tavily/core": "patch:@tavily/core@npm%3A0.3.1#~/.yarn/patches/@tavily-core-npm-0.3.1-fe69bf2bea.patch",
"@shikijs/markdown-it": "^3.4.2",
"@swc/plugin-styled-components": "^7.1.5",
"@tanstack/react-query": "^5.27.0",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.3.0",
"@tryfabric/martian": "^1.2.4",
"@types/adm-zip": "^0",
"@types/diff": "^7",
"@types/fs-extra": "^11",
"@types/lodash": "^4.17.5",
"@types/markdown-it": "^14",
@@ -118,76 +125,122 @@
"@types/react": "^19.0.12",
"@types/react-dom": "^19.0.4",
"@types/react-infinite-scroll-component": "^5.0.0",
"@types/react-window": "^1",
"@types/tinycolor2": "^1",
"@vitejs/plugin-react": "^4.2.1",
"@types/word-extractor": "^1",
"@uiw/codemirror-extensions-langs": "^4.23.12",
"@uiw/codemirror-themes-all": "^4.23.12",
"@uiw/react-codemirror": "^4.23.12",
"@vitejs/plugin-react-swc": "^3.9.0",
"@vitest/browser": "^3.1.4",
"@vitest/coverage-v8": "^3.1.4",
"@vitest/ui": "^3.1.4",
"@vitest/web-worker": "^3.1.4",
"@xyflow/react": "^12.4.4",
"antd": "^5.22.5",
"applescript": "^1.0.0",
"archiver": "^7.0.1",
"async-mutex": "^0.5.0",
"axios": "^1.7.3",
"babel-plugin-styled-components": "^2.1.4",
"browser-image-compression": "^2.0.2",
"color": "^5.0.0",
"dayjs": "^1.11.11",
"dexie": "^4.0.8",
"dexie-react-hooks": "^1.1.7",
"diff": "^7.0.0",
"docx": "^9.0.2",
"dotenv-cli": "^7.4.2",
"electron": "31.7.6",
"electron-builder": "^24.13.3",
"electron": "35.4.0",
"electron-builder": "26.0.15",
"electron-devtools-installer": "^3.2.0",
"electron-icon-builder": "^2.0.1",
"electron-vite": "^2.3.0",
"electron-log": "^5.1.5",
"electron-store": "^8.2.0",
"electron-updater": "6.6.4",
"electron-vite": "^3.1.0",
"electron-window-state": "^5.0.3",
"emittery": "^1.0.3",
"emoji-picker-element": "^1.22.1",
"epub": "patch:epub@npm%3A1.3.0#~/.yarn/patches/epub-npm-1.3.0-8325494ffe.patch",
"eslint": "^9.22.0",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-unused-imports": "^4.1.4",
"fast-diff": "^1.3.0",
"fast-xml-parser": "^5.2.0",
"franc-min": "^6.2.0",
"fs-extra": "^11.2.0",
"google-auth-library": "^9.15.1",
"html-to-image": "^1.11.13",
"husky": "^9.1.7",
"i18next": "^23.11.5",
"jest-styled-components": "^7.2.0",
"lint-staged": "^15.5.0",
"lodash": "^4.17.21",
"lru-cache": "^11.1.0",
"lucide-react": "^0.487.0",
"markdown-it": "^14.1.0",
"mermaid": "^11.6.0",
"mime": "^4.0.4",
"motion": "^12.10.5",
"npx-scope-finder": "^1.2.0",
"openai": "patch:openai@npm%3A4.77.3#~/.yarn/patches/openai-npm-4.77.3-59c6d42e7a.patch",
"officeparser": "^4.1.1",
"openai": "patch:openai@npm%3A5.1.0#~/.yarn/patches/openai-npm-5.1.0-0e7b3ccb07.patch",
"p-queue": "^8.1.0",
"playwright": "^1.52.0",
"prettier": "^3.5.3",
"rc-virtual-list": "^3.18.5",
"proxy-agent": "^6.5.0",
"rc-virtual-list": "^3.18.6",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-hotkeys-hook": "^4.6.1",
"react-i18next": "^14.1.2",
"react-infinite-scroll-component": "^6.1.0",
"react-markdown": "^9.0.1",
"react-markdown": "^10.1.0",
"react-redux": "^9.1.2",
"react-router": "6",
"react-router-dom": "6",
"react-spinners": "^0.14.1",
"react-window": "^1.8.11",
"redux": "^5.0.1",
"redux-persist": "^6.0.0",
"rehype-katex": "^7.0.1",
"rehype-mathjax": "^7.0.0",
"rehype-mathjax": "^7.1.0",
"rehype-raw": "^7.0.0",
"remark-cjk-friendly": "^1.1.0",
"remark-gfm": "^4.0.0",
"remark-cjk-friendly": "^1.2.0",
"remark-gfm": "^4.0.1",
"remark-math": "^6.0.0",
"remove-markdown": "^0.6.2",
"rollup-plugin-visualizer": "^5.12.0",
"sass": "^1.77.2",
"shiki": "^1.22.2",
"sass": "^1.88.0",
"shiki": "^3.4.2",
"string-width": "^7.2.0",
"styled-components": "^6.1.11",
"tinycolor2": "^1.6.0",
"tokenx": "^0.4.1",
"tar": "^7.4.3",
"tiny-pinyin": "^1.3.2",
"tokenx": "^1.1.0",
"typescript": "^5.6.2",
"uuid": "^10.0.0",
"vite": "^5.0.12"
"vite": "6.2.6",
"vitest": "^3.1.4",
"webdav": "^5.8.0",
"word-extractor": "^1.0.4",
"zipread": "^1.3.3"
},
"optionalDependencies": {
"@cherrystudio/mac-system-ocr": "^0.2.2"
},
"resolutions": {
"pdf-parse@npm:1.1.1": "patch:pdf-parse@npm%3A1.1.1#~/.yarn/patches/pdf-parse-npm-1.1.1-04a6109b2a.patch",
"@langchain/openai@npm:^0.3.16": "patch:@langchain/openai@npm%3A0.3.16#~/.yarn/patches/@langchain-openai-npm-0.3.16-e525b59526.patch",
"@langchain/openai@npm:>=0.1.0 <0.4.0": "patch:@langchain/openai@npm%3A0.3.16#~/.yarn/patches/@langchain-openai-npm-0.3.16-e525b59526.patch",
"openai@npm:^4.77.0": "patch:openai@npm%3A4.77.3#~/.yarn/patches/openai-npm-4.77.3-59c6d42e7a.patch",
"pkce-challenge@npm:^4.1.0": "patch:pkce-challenge@npm%3A4.1.0#~/.yarn/patches/pkce-challenge-npm-4.1.0-fbc51695a3.patch"
"libsql@npm:^0.4.4": "patch:libsql@npm%3A0.4.7#~/.yarn/patches/libsql-npm-0.4.7-444e260fb1.patch",
"openai@npm:^4.77.0": "patch:openai@npm%3A5.1.0#~/.yarn/patches/openai-npm-5.1.0-0e7b3ccb07.patch",
"pkce-challenge@npm:^4.1.0": "patch:pkce-challenge@npm%3A4.1.0#~/.yarn/patches/pkce-challenge-npm-4.1.0-fbc51695a3.patch",
"app-builder-lib@npm:26.0.13": "patch:app-builder-lib@npm%3A26.0.13#~/.yarn/patches/app-builder-lib-npm-26.0.13-a064c9e1d0.patch",
"openai@npm:^4.87.3": "patch:openai@npm%3A5.1.0#~/.yarn/patches/openai-npm-5.1.0-0e7b3ccb07.patch",
"app-builder-lib@npm:26.0.15": "patch:app-builder-lib@npm%3A26.0.15#~/.yarn/patches/app-builder-lib-npm-26.0.15-360e5b0476.patch",
"@langchain/core@npm:^0.3.26": "patch:@langchain/core@npm%3A0.3.44#~/.yarn/patches/@langchain-core-npm-0.3.44-41d5c3cb0a.patch"
},
"packageManager": "yarn@4.6.0",
"packageManager": "yarn@4.9.1",
"lint-staged": {
"*.{js,jsx,ts,tsx,cjs,mjs,cts,mts}": [
"prettier --write",

View File

@@ -1 +0,0 @@
# Cherry Studio Artifacts

View File

@@ -1,19 +0,0 @@
{
"name": "@cherry-studio/artifacts",
"version": "0.1.0",
"description": "Cherry Studio Artifacts",
"main": "index.js",
"homepage": "https://github.com/kangfenmao/cherry-studio/blob/main/npm/artifacts",
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"artifacts"
],
"author": "kangfenmao",
"license": "ISC"
}

View File

@@ -1,108 +0,0 @@
:root {
/* 莫兰迪色系:使用柔和、低饱和度的颜色 */
--primary-color: #b6b5a7; /* 莫兰迪灰褐色,用于背景文字 */
--secondary-color: #9a8f8f; /* 莫兰迪灰棕色,用于标题背景 */
--accent-color: #c5b4a0; /* 莫兰迪淡棕色,用于强调元素 */
--background-color: #e8e3de; /* 莫兰迪米色,用于页面背景 */
--text-color: #5b5b5b; /* 莫兰迪深灰色,用于主要文字 */
--light-text-color: #8c8c8c; /* 莫兰迪中灰色,用于次要文字 */
--divider-color: #d1cbc3; /* 莫兰迪浅灰色,用于分隔线 */
}
body,
html {
margin: 0;
padding: 0;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
background-color: var(--background-color); /* 使用莫兰迪米色作为页面背景 */
font-family: 'Noto Sans SC', sans-serif;
color: var(--text-color); /* 使用莫兰迪深灰色作为主要文字颜色 */
}
.card {
width: 300px;
height: 500px;
background-color: #f2ede9; /* 莫兰迪浅米色,用于卡片背景 */
border-radius: 20px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
overflow: hidden;
position: relative;
display: flex;
flex-direction: column;
}
.header {
background-color: var(--secondary-color); /* 使用莫兰迪灰棕色作为标题背景 */
color: #f2ede9; /* 浅色文字与深色背景形成对比 */
padding: 20px;
text-align: left;
position: relative;
z-index: 1;
}
h1 {
font-family: 'Noto Serif SC', serif;
font-size: 20px;
margin: 0;
font-weight: 700;
}
.content {
padding: 30px 20px;
display: flex;
flex-direction: column;
flex-grow: 1;
}
.word {
text-align: left;
margin-bottom: 20px;
}
.word-main {
font-family: 'Noto Serif SC', serif;
font-size: 36px;
color: var(--text-color); /* 使用莫兰迪深灰色作为主要词汇颜色 */
margin-bottom: 10px;
position: relative;
}
.word-main::after {
content: '';
position: absolute;
left: 0;
bottom: -5px;
width: 50px;
height: 3px;
background-color: var(--accent-color); /* 使用莫兰迪淡棕色作为下划线 */
}
.word-sub {
font-size: 14px;
color: var(--light-text-color); /* 使用莫兰迪中灰色作为次要文字颜色 */
margin: 5px 0;
}
.divider {
width: 100%;
height: 1px;
background-color: var(--divider-color); /* 使用莫兰迪浅灰色作为分隔线 */
margin: 20px 0;
}
.explanation {
font-size: 18px;
line-height: 1.6;
text-align: left;
flex-grow: 1;
display: flex;
flex-direction: column;
justify-content: center;
}
.quote {
position: relative;
padding-left: 20px;
border-left: 3px solid var(--accent-color); /* 使用莫兰迪淡棕色作为引用边框 */
}
.background-text {
position: absolute;
font-size: 150px;
color: rgba(182, 181, 167, 0.15); /* 使用莫兰迪灰褐色的透明版本作为背景文字 */
z-index: 0;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-weight: bold;
}

View File

@@ -1,3 +0,0 @@
data/*
!data/.gitkeep

View File

@@ -1,3 +0,0 @@
# Cherry Studio Database
Cherry Studio 依赖的数据文件由这个数据库来生成,数据库文件请联系开发者获取

View File

@@ -1,13 +0,0 @@
{
"name": "@cherry-studio/database",
"packageManager": "yarn@4.6.0",
"dependencies": {
"csv-parser": "^3.0.0",
"sqlite3": "^5.1.7"
},
"scripts": {
"agents": "node src/agents.js",
"email": "yarn csv && node src/email.js",
"csv": "node src/csv.js"
}
}

View File

@@ -1,47 +0,0 @@
const sqlite3 = require('sqlite3').verbose()
const fs = require('fs')
// 连接到数据库
const db = new sqlite3.Database('./data/CherryStudio.sqlite3', (err) => {
if (err) {
console.error('Error connecting to the database:', err.message)
return
}
console.log('Connected to the database.')
})
// 查询数据并转换为JSON
db.all('SELECT * FROM agents', [], (err, rows) => {
if (err) {
console.error('Error querying the database:', err.message)
return
}
// 将 ID 类型转换为字符串
for (const row of rows) {
row.id = row.id.toString()
row.group = row.group.toString().split(',')
row.group = row.group.map((item) => item.trim().replace('\r\n', ''))
}
// 将查询结果转换为JSON字符串
const jsonData = JSON.stringify(rows, null, 2)
// 将JSON数据写入文件
fs.writeFile('../../src/renderer/src/config/agents.json', jsonData, (err) => {
if (err) {
console.error('Error writing to file:', err.message)
return
}
console.log('Data has been written to agents.json')
})
// 关闭数据库连接
db.close((err) => {
if (err) {
console.error('Error closing the database:', err.message)
return
}
console.log('Database connection closed.')
})
})

View File

@@ -1,77 +0,0 @@
const fs = require('fs')
const csv = require('csv-parser')
const sqlite3 = require('sqlite3').verbose()
// 连接到 SQLite 数据库
const db = new sqlite3.Database('./data/CherryStudio.sqlite3', (err) => {
if (err) {
console.error('Error opening database', err)
return
}
console.log('Connected to the SQLite database.')
})
// 创建一个数组来存储 CSV 数据
const results = []
// 读取 CSV 文件
fs.createReadStream('./data/data.csv')
.pipe(csv())
.on('data', (data) => results.push(data))
.on('end', () => {
// 准备 SQL 插入语句,使用 INSERT OR IGNORE
const stmt = db.prepare('INSERT OR IGNORE INTO emails (email, github, sent) VALUES (?, ?, ?)')
// 插入每一行数据
let inserted = 0
let skipped = 0
let emptyEmail = 0
db.serialize(() => {
// 开始一个事务以提高性能
db.run('BEGIN TRANSACTION')
results.forEach((row) => {
// 检查 email 是否为空
if (!row.email || row.email.trim() === '') {
emptyEmail++
return // 跳过这一行
}
stmt.run(row.email, row['user-href'], 0, function (err) {
if (err) {
console.error('Error inserting row', err)
} else {
if (this.changes === 1) {
inserted++
} else {
skipped++
}
}
})
})
// 提交事务
db.run('COMMIT', (err) => {
if (err) {
console.error('Error committing transaction', err)
} else {
console.log(
`Insertion complete. Inserted: ${inserted}, Skipped (duplicate): ${skipped}, Skipped (empty email): ${emptyEmail}`
)
}
// 完成插入
stmt.finalize()
// 关闭数据库连接
db.close((err) => {
if (err) {
console.error('Error closing database', err)
} else {
console.log('Database connection closed.')
}
})
})
})
})

View File

@@ -1,36 +0,0 @@
const sqlite3 = require('sqlite3').verbose()
// 连接到数据库
const db = new sqlite3.Database('./data/CherryStudio.sqlite3', (err) => {
if (err) {
console.error('Error connecting to the database:', err.message)
return
}
})
// 查询数据并转换为JSON
db.all('SELECT * FROM emails WHERE sent = 0', [], (err, rows) => {
if (err) {
console.error('Error querying the database:', err.message)
return
}
for (const row of rows) {
console.log(row.email)
// Update row set sent = 1
db.run('UPDATE emails SET sent = 1 WHERE id = ?', [row.id], (err) => {
if (err) {
console.error('Error updating the database:', err.message)
return
}
})
}
// 关闭数据库连接
db.close((err) => {
if (err) {
console.error('Error closing the database:', err.message)
return
}
})
})

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,243 @@
export enum IpcChannel {
App_GetCacheSize = 'app:get-cache-size',
App_ClearCache = 'app:clear-cache',
App_SetLaunchOnBoot = 'app:set-launch-on-boot',
App_SetLanguage = 'app:set-language',
App_SetEnableSpellCheck = 'app:set-enable-spell-check',
App_SetSpellCheckLanguages = 'app:set-spell-check-languages',
App_ShowUpdateDialog = 'app:show-update-dialog',
App_CheckForUpdate = 'app:check-for-update',
App_Reload = 'app:reload',
App_Info = 'app:info',
App_Proxy = 'app:proxy',
App_SetLaunchToTray = 'app:set-launch-to-tray',
App_SetTray = 'app:set-tray',
App_SetTrayOnClose = 'app:set-tray-on-close',
App_SetTheme = 'app:set-theme',
App_SetAutoUpdate = 'app:set-auto-update',
App_SetTestPlan = 'app:set-test-plan',
App_SetTestChannel = 'app:set-test-channel',
App_HandleZoomFactor = 'app:handle-zoom-factor',
App_Select = 'app:select',
App_HasWritePermission = 'app:has-write-permission',
App_Copy = 'app:copy',
App_SetStopQuitApp = 'app:set-stop-quit-app',
App_SetAppDataPath = 'app:set-app-data-path',
App_GetDataPathFromArgs = 'app:get-data-path-from-args',
App_FlushAppData = 'app:flush-app-data',
App_IsNotEmptyDir = 'app:is-not-empty-dir',
App_RelaunchApp = 'app:relaunch-app',
App_IsBinaryExist = 'app:is-binary-exist',
App_GetBinaryPath = 'app:get-binary-path',
App_InstallUvBinary = 'app:install-uv-binary',
App_InstallBunBinary = 'app:install-bun-binary',
App_MacIsProcessTrusted = 'app:mac-is-process-trusted',
App_MacRequestProcessTrust = 'app:mac-request-process-trust',
App_QuoteToMain = 'app:quote-to-main',
Notification_Send = 'notification:send',
Notification_OnClick = 'notification:on-click',
Webview_SetOpenLinkExternal = 'webview:set-open-link-external',
Webview_SetSpellCheckEnabled = 'webview:set-spell-check-enabled',
// Open
Open_Path = 'open:path',
Open_Website = 'open:website',
Minapp = 'minapp',
Config_Set = 'config:set',
Config_Get = 'config:get',
MiniWindow_Show = 'miniwindow:show',
MiniWindow_Hide = 'miniwindow:hide',
MiniWindow_Close = 'miniwindow:close',
MiniWindow_Toggle = 'miniwindow:toggle',
MiniWindow_SetPin = 'miniwindow:set-pin',
// Mcp
Mcp_AddServer = 'mcp:add-server',
Mcp_RemoveServer = 'mcp:remove-server',
Mcp_RestartServer = 'mcp:restart-server',
Mcp_StopServer = 'mcp:stop-server',
Mcp_ListTools = 'mcp:list-tools',
Mcp_CallTool = 'mcp:call-tool',
Mcp_ListPrompts = 'mcp:list-prompts',
Mcp_GetPrompt = 'mcp:get-prompt',
Mcp_ListResources = 'mcp:list-resources',
Mcp_GetResource = 'mcp:get-resource',
Mcp_GetInstallInfo = 'mcp:get-install-info',
Mcp_ServersChanged = 'mcp:servers-changed',
Mcp_ServersUpdated = 'mcp:servers-updated',
Mcp_CheckConnectivity = 'mcp:check-connectivity',
// Python
Python_Execute = 'python:execute',
//copilot
Copilot_GetAuthMessage = 'copilot:get-auth-message',
Copilot_GetCopilotToken = 'copilot:get-copilot-token',
Copilot_SaveCopilotToken = 'copilot:save-copilot-token',
Copilot_GetToken = 'copilot:get-token',
Copilot_Logout = 'copilot:logout',
Copilot_GetUser = 'copilot:get-user',
// obsidian
Obsidian_GetVaults = 'obsidian:get-vaults',
Obsidian_GetFiles = 'obsidian:get-files',
// nutstore
Nutstore_GetSsoUrl = 'nutstore:get-sso-url',
Nutstore_DecryptToken = 'nutstore:decrypt-token',
Nutstore_GetDirectoryContents = 'nutstore:get-directory-contents',
//aes
Aes_Encrypt = 'aes:encrypt',
Aes_Decrypt = 'aes:decrypt',
Gemini_UploadFile = 'gemini:upload-file',
Gemini_Base64File = 'gemini:base64-file',
Gemini_RetrieveFile = 'gemini:retrieve-file',
Gemini_ListFiles = 'gemini:list-files',
Gemini_DeleteFile = 'gemini:delete-file',
// VertexAI
VertexAI_GetAuthHeaders = 'vertexai:get-auth-headers',
VertexAI_ClearAuthCache = 'vertexai:clear-auth-cache',
Windows_ResetMinimumSize = 'window:reset-minimum-size',
Windows_SetMinimumSize = 'window:set-minimum-size',
KnowledgeBase_Create = 'knowledge-base:create',
KnowledgeBase_Reset = 'knowledge-base:reset',
KnowledgeBase_Delete = 'knowledge-base:delete',
KnowledgeBase_Add = 'knowledge-base:add',
KnowledgeBase_Remove = 'knowledge-base:remove',
KnowledgeBase_Search = 'knowledge-base:search',
KnowledgeBase_Rerank = 'knowledge-base:rerank',
KnowledgeBase_Check_Quota = 'knowledge-base:check-quota',
//file
File_Open = 'file:open',
File_OpenPath = 'file:openPath',
File_Save = 'file:save',
File_Select = 'file:select',
File_Upload = 'file:upload',
File_Clear = 'file:clear',
File_Read = 'file:read',
File_Delete = 'file:delete',
File_DeleteDir = 'file:deleteDir',
File_Get = 'file:get',
File_SelectFolder = 'file:selectFolder',
File_CreateTempFile = 'file:createTempFile',
File_Write = 'file:write',
File_WriteWithId = 'file:writeWithId',
File_SaveImage = 'file:saveImage',
File_Base64Image = 'file:base64Image',
File_SaveBase64Image = 'file:saveBase64Image',
File_Download = 'file:download',
File_Copy = 'file:copy',
File_BinaryImage = 'file:binaryImage',
File_Base64File = 'file:base64File',
File_GetPdfInfo = 'file:getPdfInfo',
Fs_Read = 'fs:read',
// file service
FileService_Upload = 'file-service:upload',
FileService_List = 'file-service:list',
FileService_Delete = 'file-service:delete',
FileService_Retrieve = 'file-service:retrieve',
Export_Word = 'export:word',
Shortcuts_Update = 'shortcuts:update',
// backup
Backup_Backup = 'backup:backup',
Backup_Restore = 'backup:restore',
Backup_BackupToWebdav = 'backup:backupToWebdav',
Backup_RestoreFromWebdav = 'backup:restoreFromWebdav',
Backup_ListWebdavFiles = 'backup:listWebdavFiles',
Backup_CheckConnection = 'backup:checkConnection',
Backup_CreateDirectory = 'backup:createDirectory',
Backup_DeleteWebdavFile = 'backup:deleteWebdavFile',
// zip
Zip_Compress = 'zip:compress',
Zip_Decompress = 'zip:decompress',
// system
System_GetDeviceType = 'system:getDeviceType',
System_GetHostname = 'system:getHostname',
// DevTools
System_ToggleDevTools = 'system:toggleDevTools',
// events
BackupProgress = 'backup-progress',
ThemeUpdated = 'theme:updated',
UpdateDownloadedCancelled = 'update-downloaded-cancelled',
RestoreProgress = 'restore-progress',
UpdateError = 'update-error',
UpdateAvailable = 'update-available',
UpdateNotAvailable = 'update-not-available',
DownloadProgress = 'download-progress',
UpdateDownloaded = 'update-downloaded',
DownloadUpdate = 'download-update',
DirectoryProcessingPercent = 'directory-processing-percent',
FullscreenStatusChanged = 'fullscreen-status-changed',
HideMiniWindow = 'hide-mini-window',
ShowMiniWindow = 'show-mini-window',
ReduxStateChange = 'redux-state-change',
ReduxStoreReady = 'redux-store-ready',
// Search Window
SearchWindow_Open = 'search-window:open',
SearchWindow_Close = 'search-window:close',
SearchWindow_OpenUrl = 'search-window:open-url',
//Store Sync
StoreSync_Subscribe = 'store-sync:subscribe',
StoreSync_Unsubscribe = 'store-sync:unsubscribe',
StoreSync_OnUpdate = 'store-sync:on-update',
StoreSync_BroadcastSync = 'store-sync:broadcast-sync',
// Provider
Provider_AddKey = 'provider:add-key',
//Selection Assistant
Selection_TextSelected = 'selection:text-selected',
Selection_ToolbarHide = 'selection:toolbar-hide',
Selection_ToolbarVisibilityChange = 'selection:toolbar-visibility-change',
Selection_ToolbarDetermineSize = 'selection:toolbar-determine-size',
Selection_WriteToClipboard = 'selection:write-to-clipboard',
Selection_SetEnabled = 'selection:set-enabled',
Selection_SetTriggerMode = 'selection:set-trigger-mode',
Selection_SetFilterMode = 'selection:set-filter-mode',
Selection_SetFilterList = 'selection:set-filter-list',
Selection_SetFollowToolbar = 'selection:set-follow-toolbar',
Selection_SetRemeberWinSize = 'selection:set-remeber-win-size',
Selection_ActionWindowClose = 'selection:action-window-close',
Selection_ActionWindowMinimize = 'selection:action-window-minimize',
Selection_ActionWindowPin = 'selection:action-window-pin',
Selection_ProcessAction = 'selection:process-action',
Selection_UpdateActionData = 'selection:update-action-data',
// Memory
Memory_Add = 'memory:add',
Memory_Search = 'memory:search',
Memory_List = 'memory:list',
Memory_Delete = 'memory:delete',
Memory_Update = 'memory:update',
Memory_Get = 'memory:get',
Memory_SetConfig = 'memory:set-config',
Memory_DeleteUser = 'memory:delete-user',
Memory_GetUsersList = 'memory:get-users-list'
}

View File

@@ -1,138 +1,379 @@
export const imageExts = ['.jpg', '.jpeg', '.png', '.gif', '.bmp', '.webp']
export const videoExts = ['.mp4', '.avi', '.mov', '.wmv', '.flv', '.mkv']
export const audioExts = ['.mp3', '.wav', '.ogg', '.flac', '.aac']
export const documentExts = ['.pdf', '.docx', '.pptx', '.xlsx', '.odt', '.odp', '.ods']
export const documentExts = ['.pdf', '.doc', '.docx', '.pptx', '.xlsx', '.odt', '.odp', '.ods']
export const thirdPartyApplicationExts = ['.draftsExport']
export const bookExts = ['.epub']
export const textExts = [
'.txt', // 普通文本文件
'.md', // Markdown 文件
'.mdx', // Markdown 文件
'.html', // HTML 文件
'.htm', // HTML 文件的另一种扩展名
'.xml', // XML 文件
'.json', // JSON 文件
'.yaml', // YAML 文件
'.yml', // YAML 文件的另一种扩展名
'.csv', // 逗号分隔值文件
'.tsv', // 制表符分隔值文件
'.ini', // 配置文件
'.log', // 日志文件
'.rtf', // 富文本格式文件
'.org', // org-mode 文件
'.wiki', // VimWiki 文件
'.tex', // LaTeX 文件
'.bib', // BibTeX 文件
'.srt', // 字幕文件
'.xhtml', // XHTML 文件
'.nfo', // 信息文件(主要用于场景发布)
'.conf', // 配置文件
'.config', // 配置文件
'.env', // 环境变量文件
'.rst', // reStructuredText 文件
'.php', // PHP 脚本文件,包含嵌入的 HTML
'.js', // JavaScript 文件(部分是文本,部分可能包含代码)
'.ts', // TypeScript 文件
'.jsp', // JavaServer Pages 文件
'.aspx', // ASP.NET 文件
'.bat', // Windows 批处理文件
'.sh', // Unix/Linux Shell 脚本文件
'.py', // Python 脚本文件
'.ipynb', // Jupyter 笔记本格式
'.rb', // Ruby 脚本文件
'.pl', // Perl 脚本文件
'.sql', // SQL 脚本文件
'.css', // Cascading Style Sheets 文件
'.less', // Less CSS 预处理器文件
'.scss', // Sass CSS 预处理器文件
'.sass', // Sass 文件
'.styl', // Stylus CSS 预处理器文件
'.coffee', // CoffeeScript 文件
'.ino', // Arduino 代码文件
'.asm', // Assembly 语言文件
'.go', // Go 语言文件
'.scala', // Scala 语言文件
'.swift', // Swift 语言文件
'.kt', // Kotlin 语言文件
'.rs', // Rust 语言文件
'.lua', // Lua 语言文件
'.groovy', // Groovy 语言文件
'.dart', // Dart 语言文件
'.hs', // Haskell 语言文件
'.clj', // Clojure 语言文件
'.cljs', // ClojureScript 语言文件
'.elm', // Elm 语言文件
'.erl', // Erlang 语言文件
'.ex', // Elixir 语言文件
'.exs', // Elixir 脚本文件
'.pug', // Pug (formerly Jade) 模板文件
'.haml', // Haml 模板文件
'.slim', // Slim 模板文件
'.tpl', // 模板文件(通用)
'.ejs', // Embedded JavaScript 模板文件
'.hbs', // Handlebars 模板文件
'.mustache', // Mustache 模板文件
'.jade', // Jade 模板文件 (已重命名为 Pug)
'.twig', // Twig 模板文件
'.blade', // Blade 模板文件 (Laravel)
'.vue', // Vue.js 单文件组件
'.jsx', // React JSX 文件
'.tsx', // React TSX 文件
'.graphql', // GraphQL 查询语言文件
'.gql', // GraphQL 查询语言文件
'.proto', // Protocol Buffers 文件
'.thrift', // Thrift 文件
'.toml', // TOML 配置文件
'.edn', // Clojure 数据表示文件
'.cake', // CakePHP 配置文件
'.ctp', // CakePHP 视图文件
'.cfm', // ColdFusion 标记语言文件
'.cfc', // ColdFusion 组件文件
'.m', // Objective-C 或 MATLAB 源文件
'.mm', // Objective-C++ 源文件
'.gradle', // Gradle 构建文件
'.groovy', // Gradle 构建文件
'.kts', // Kotlin Script 文件
'.java', // Java 代码文件
'.cs', // C# 代码文件
'.cpp', // C++ 代码文件
'.c', // C++ 代码文件
'.h', // C++ 头文件
'.hpp', // C++ 头文件
'.cc', // C++ 源文件
'.cxx', // C++ 源文件
'.cppm', // C++20 模块接口文件
'.ipp', // 模板实现文件
'.ixx', // C++20 模块实现文件
'.f90', // Fortran 90 源文件
'.f', // Fortran 固定格式源代码文件
'.f03', // Fortran 2003+ 源代码文件
'.ahk', // AutoHotKey 语言文件
'.tcl', // Tcl 脚本
'.do', // Questa 或 Modelsim Tcl 脚本
'.v', // Verilog 源文件
'.sv', // SystemVerilog 源文件
'.svh', // SystemVerilog 头文件
'.vhd', // VHDL 源文件
'.vhdl', // VHDL 源文件
'.lef', // Library Exchange Format
'.def', // Design Exchange Format
'.edif', // Electronic Design Interchange Format
'.sdf', // Standard Delay Format
'.sdc', // Synopsys Design Constraints
'.xdc', // Xilinx Design Constraints
'.rpt', // 报告文件
'.lisp', // Lisp 脚本
'.il', // Cadence SKILL 脚本
'.ils', // Cadence SKILL++ 脚本
'.sp', // SPICE netlist 文件
'.spi', // SPICE netlist 文件
'.cir', // SPICE netlist 文件
'.net', // SPICE netlist 文件
'.scs', // Spectre netlist 文件
'.asc', // LTspice netlist schematic 文件
'.tf' // Technology File
const textExtsByCategory = new Map([
[
'language',
[
'.js',
'.mjs',
'.cjs',
'.ts',
'.jsx',
'.tsx', // JavaScript/TypeScript
'.py', // Python
'.java', // Java
'.cs', // C#
'.cpp',
'.c',
'.h',
'.hpp',
'.cc',
'.cxx',
'.cppm',
'.ipp',
'.ixx', // C/C++
'.php', // PHP
'.rb', // Ruby
'.pl', // Perl
'.go', // Go
'.rs', // Rust
'.swift', // Swift
'.kt',
'.kts', // Kotlin
'.scala', // Scala
'.lua', // Lua
'.groovy', // Groovy
'.dart', // Dart
'.hs', // Haskell
'.clj',
'.cljs', // Clojure
'.elm', // Elm
'.erl', // Erlang
'.ex',
'.exs', // Elixir
'.ml',
'.mli', // OCaml
'.fs', // F#
'.r',
'.R', // R
'.sol', // Solidity
'.awk', // AWK
'.cob', // COBOL
'.asm',
'.s', // Assembly
'.lisp',
'.lsp', // Lisp
'.coffee', // CoffeeScript
'.ino', // Arduino
'.jl', // Julia
'.nim', // Nim
'.zig', // Zig
'.d', // D语言
'.pas', // Pascal
'.vb', // Visual Basic
'.rkt', // Racket
'.scm', // Scheme
'.hx', // Haxe
'.as', // ActionScript
'.pde', // Processing
'.f90',
'.f',
'.f03',
'.for',
'.f95', // Fortran
'.adb',
'.ads', // Ada
'.pro', // Prolog
'.m',
'.mm', // Objective-C/MATLAB
'.rpy', // Ren'Py
'.ets', // OpenHarmony,
'.uniswap', // DeFi
'.vy', // Vyper
'.shader',
'.glsl',
'.frag',
'.vert',
'.gd' // Godot
]
],
[
'script',
[
'.sh', // Shell
'.bat',
'.cmd', // Windows批处理
'.ps1', // PowerShell
'.tcl',
'.do', // Tcl
'.ahk', // AutoHotkey
'.zsh', // Zsh
'.fish', // Fish shell
'.csh', // C shell
'.vbs', // VBScript
'.applescript', // AppleScript
'.au3', // AutoIt
'.bash',
'.nu'
]
],
[
'style',
[
'.css', // CSS
'.less', // Less
'.scss',
'.sass', // Sass
'.styl', // Stylus
'.pcss', // PostCSS
'.postcss' // PostCSS
]
],
[
'template',
[
'.vue', // Vue.js
'.pug',
'.jade', // Pug/Jade
'.haml', // Haml
'.slim', // Slim
'.tpl', // 通用模板
'.ejs', // EJS
'.hbs', // Handlebars
'.mustache', // Mustache
'.twig', // Twig
'.blade', // Blade (Laravel)
'.liquid', // Liquid
'.jinja',
'.jinja2',
'.j2', // Jinja
'.erb', // ERB
'.vm', // Velocity
'.ftl', // FreeMarker
'.svelte', // Svelte
'.astro' // Astro
]
],
[
'config',
[
'.ini', // INI配置
'.conf',
'.config', // 通用配置
'.env', // 环境变量
'.toml', // TOML
'.cfg', // 通用配置
'.properties', // Java属性
'.desktop', // Linux桌面文件
'.service', // systemd服务
'.rc',
'.bashrc',
'.zshrc', // Shell配置
'.fishrc', // Fish shell配置
'.vimrc', // Vim配置
'.htaccess', // Apache配置
'.robots', // robots.txt
'.editorconfig', // EditorConfig
'.eslintrc', // ESLint
'.prettierrc', // Prettier
'.babelrc', // Babel
'.npmrc', // npm
'.dockerignore', // Docker ignore
'.npmignore',
'.yarnrc',
'.prettierignore',
'.eslintignore',
'.browserslistrc',
'.json5',
'.tfvars'
]
],
[
'document',
[
'.txt',
'.text', // 纯文本
'.md',
'.mdx', // Markdown
'.html',
'.htm',
'.xhtml', // HTML
'.xml', // XML
'.org', // Org-mode
'.wiki', // Wiki
'.tex',
'.bib', // LaTeX
'.rst', // reStructuredText
'.rtf', // 富文本
'.nfo', // 信息文件
'.adoc',
'.asciidoc', // AsciiDoc
'.pod', // Perl文档
'.1',
'.2',
'.3',
'.4',
'.5',
'.6',
'.7',
'.8',
'.9', // man页面
'.man', // man页面
'.texi',
'.texinfo', // Texinfo
'.readme',
'.me', // README
'.changelog', // 变更日志
'.license', // 许可证
'.authors', // 作者文件
'.po',
'.pot'
]
],
[
'data',
[
'.json', // JSON
'.jsonc', // JSON with comments
'.yaml',
'.yml', // YAML
'.csv',
'.tsv', // 分隔值文件
'.edn', // Clojure数据
'.jsonl',
'.ndjson', // 换行分隔JSON
'.geojson', // GeoJSON
'.gpx', // GPS Exchange
'.kml', // Keyhole Markup
'.rss',
'.atom', // Feed格式
'.vcf', // vCard
'.ics', // iCalendar
'.ldif', // LDAP数据交换
'.pbtxt',
'.map'
]
],
[
'build',
[
'.gradle', // Gradle
'.make',
'.mk', // Make
'.cmake', // CMake
'.sbt', // SBT
'.rake', // Rake
'.spec', // RPM spec
'.pom',
'.build', // Meson
'.bazel' // Bazel
]
],
[
'database',
[
'.sql', // SQL
'.ddl',
'.dml', // DDL/DML
'.plsql', // PL/SQL
'.psql', // PostgreSQL
'.cypher', // Cypher
'.sparql' // SPARQL
]
],
[
'web',
[
'.graphql',
'.gql', // GraphQL
'.proto', // Protocol Buffers
'.thrift', // Thrift
'.wsdl', // WSDL
'.raml', // RAML
'.swagger',
'.openapi' // API文档
]
],
[
'version',
[
'.gitignore', // Git ignore
'.gitattributes', // Git attributes
'.gitconfig', // Git config
'.hgignore', // Mercurial ignore
'.bzrignore', // Bazaar ignore
'.svnignore', // SVN ignore
'.githistory' // Git history
]
],
[
'subtitle',
[
'.srt',
'.sub',
'.ass' // 字幕格式
]
],
[
'log',
[
'.log',
'.rpt' // 日志和报告 (移除了.out因为通常是二进制可执行文件)
]
],
[
'eda',
[
'.v',
'.sv',
'.svh', // Verilog/SystemVerilog
'.vhd',
'.vhdl', // VHDL
'.lef',
'.def', // LEF/DEF
'.edif', // EDIF
'.sdf', // SDF
'.sdc',
'.xdc', // 约束文件
'.sp',
'.spi',
'.cir',
'.net', // SPICE
'.scs', // Spectre
'.asc', // LTspice
'.tf', // Technology File
'.il',
'.ils' // SKILL
]
],
[
'game',
[
'.mtl', // Material Template Library
'.x3d', // X3D文件
'.gltf', // glTF JSON
'.prefab', // Unity预制体 (YAML格式)
'.meta' // Unity元数据文件 (YAML格式)
]
],
[
'other',
[
'.mcfunction', // Minecraft函数
'.jsp', // JSP
'.aspx', // ASP.NET
'.ipynb', // Jupyter Notebook
'.cake',
'.ctp', // CakePHP
'.cfm',
'.cfc' // ColdFusion
]
]
])
export const textExts = Array.from(textExtsByCategory.values()).flat()
export const ZOOM_LEVELS = [0.25, 0.33, 0.5, 0.67, 0.75, 0.8, 0.9, 1, 1.1, 1.25, 1.5, 1.75, 2, 2.5, 3, 4, 5]
// 从 ZOOM_LEVELS 生成 Ant Design Select 所需的 options 结构
export const ZOOM_OPTIONS = ZOOM_LEVELS.map((level) => ({
value: level,
label: `${Math.round(level * 100)}%`
}))
export const ZOOM_SHORTCUTS = [
{
@@ -157,3 +398,24 @@ export const ZOOM_SHORTCUTS = [
system: true
}
]
export const KB = 1024
export const MB = 1024 * KB
export const GB = 1024 * MB
export const defaultLanguage = 'en-US'
export enum FeedUrl {
PRODUCTION = 'https://releases.cherry-ai.com',
GITHUB_LATEST = 'https://github.com/CherryHQ/cherry-studio/releases/latest/download',
PRERELEASE_LOWEST = 'https://github.com/CherryHQ/cherry-studio/releases/download/v1.4.0'
}
export enum UpgradeChannel {
LATEST = 'latest', // 最新稳定版本
RC = 'rc', // 公测版本
BETA = 'beta' // 预览版本
}
export const defaultTimeout = 5 * 1000 * 60
export const occupiedDirs = ['logs', 'Network', 'Partitions/webview/Network']

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,11 @@
import { ProcessingStatus } from '@types'
export type LoaderReturn = {
entriesAdded: number
uniqueId: string
uniqueIds: string[]
loaderType: string
status?: ProcessingStatus
message?: string
messageSource?: 'preprocess' | 'embedding'
}

42
playwright.config.ts Normal file
View File

@@ -0,0 +1,42 @@
import { defineConfig, devices } from '@playwright/test'
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
// Look for test files, relative to this configuration file.
testDir: './tests/e2e',
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
// baseURL: 'http://localhost:3000',
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry'
},
/* Configure projects for major browsers */
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] }
}
]
/* Run your local dev server before starting the tests */
// webServer: {
// command: 'npm run start',
// url: 'http://localhost:3000',
// reuseExistingServer: !process.env.CI,
// },
})

View File

@@ -1,116 +1,197 @@
<!doctype html>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CherryStudio 许可协议-ZH/EN</title>
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>许可协议 | License Agreement</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="bg-gray-100 p-8">
<div class="container mx-auto bg-white p-6 rounded shadow-lg">
<h1 class="text-3xl font-bold mb-6 text-center">Cherry Studio 许可协议</h1>
<div class="mb-8">
<h2 class="text-2xl font-semibold mb-4">许可协议</h2>
<p class="mb-4">
本软件采用 <strong>Apache License 2.0</strong> 许可。除 Apache License 2.0 规定的条款外,您在使用 Cherry
Studio 时还应遵守以下附加条款:
<body class="bg-gray-50">
<div class="max-w-4xl mx-auto px-4 py-8">
<!-- 中文版本 -->
<div class="mb-12">
<h1 class="text-3xl font-bold mb-8 text-gray-900">许可协议</h1>
<p class="mb-6 text-gray-700">本项目采用<strong>区分用户的双重许可 (User-Segmented Dual Licensing)</strong> 模式。</p>
<section class="mb-8">
<h2 class="text-xl font-semibold mb-4 text-gray-900">核心原则</h2>
<ul class="list-disc pl-6 space-y-2 text-gray-700">
<li><strong>个人用户 和 10人及以下企业/组织:</strong> 默认适用 <strong>GNU Affero 通用公共许可证 v3.0 (AGPLv3)</strong></li>
<li><strong>超过10人的企业/组织:</strong> <strong>必须</strong> 获取 <strong>商业许可证 (Commercial License)</strong></li>
</ul>
</section>
<section class="mb-8">
<h2 class="text-xl font-semibold mb-4 text-gray-900">定义:"10人及以下"</h2>
<p class="text-gray-700">
指在您的组织包括公司、非营利组织、政府机构、教育机构等任何实体能够访问、使用或以任何方式直接或间接受益于本软件Cherry
Studio功能的个人总数不超过10人。这包括但不限于开发者、测试人员、运营人员、最终用户、通过集成系统间接使用者等。
</p>
<h3 class="text-xl font-semibold mb-2">一. 商用许可</h3>
<ol class="list-decimal list-inside mb-4">
<li><strong>免费商用</strong>:用户在不修改代码的情况下,可以免费用于商业目的。</li>
<li>
<strong>商业授权</strong>:如果您满足以下任意条件之一,需取得商业授权:
<ol class="list-decimal list-inside ml-4">
<li>对本软件进行二次修改、开发包括但不限于修改应用名称、logo、代码以及功能</li>
<li>为企业客户提供多租户服务,且该服务支持 10 人或以上的使用。</li>
<li>预装或集成到硬件设备或产品中进行捆绑销售。</li>
<li>政府或教育机构的大规模采购项目,特别是涉及安全、数据隐私等敏感需求时。</li>
</ol>
</section>
<section class="mb-8">
<h2 class="text-xl font-semibold mb-4 text-gray-900">1. 开源许可证 (Open Source License): AGPLv3 - 适用于个人及10人及以下组织
</h2>
<ul class="list-disc pl-6 space-y-2 text-gray-700">
<li>如果您是个人用户,或者您的组织满足上述"10人及以下"的定义,您可以在 <strong>AGPLv3</strong> 的条款下自由使用、修改和分发 Cherry Studio。AGPLv3 的完整文本可以访问
<a href="https://www.gnu.org/licenses/agpl-3.0.html"
class="text-blue-600 hover:underline">https://www.gnu.org/licenses/agpl-3.0.html</a> 获取。
</li>
</ol>
<h3 class="text-xl font-semibold mb-2">二. 贡献者协议</h3>
<ol class="list-decimal list-inside mb-4">
<li><strong>许可调整</strong>:生产者有权根据需要对开源协议进行调整,使其更加严格或宽松。</li>
<li><strong>商业用途</strong>:您贡献的代码可能会被用于商业用途,包括但不限于云业务运营。</li>
</ol>
<h3 class="text-xl font-semibold mb-2">三. 其他条款</h3>
<ol class="list-decimal list-inside mb-4">
<li>本协议条款的解释权归 Cherry Studio 开发者所有。</li>
<li>本协议可能根据实际情况进行更新,更新时将通过本软件通知用户。</li>
</ol>
<p class="mb-4">如有任何问题或需申请商业授权,请联系 Cherry Studio 开发团队。</p>
<p>
除上述特定条件外,其他所有权利和限制均遵循 Apache License 2.0。有关 Apache License 2.0 的详细信息,请访问
<a href="http://www.apache.org/licenses/LICENSE-2.0"
class="text-blue-500 underline">http://www.apache.org/licenses/LICENSE-2.0</a>
</p>
<li><strong>核心义务:</strong> AGPLv3 的一个关键要求是,如果您修改了 Cherry Studio 并通过网络提供服务,或者分发了修改后的版本,您必须以 AGPLv3
许可证向接收者提供相应的<strong>完整源代码</strong>。即使您符合"10人及以下"的标准,如果您希望避免此源代码公开义务,您也需要考虑获取商业许可证(见下文)。</li>
<li>使用前请务必仔细阅读并理解 AGPLv3 的所有条款。</li>
</ul>
</section>
<section class="mb-8">
<h2 class="text-xl font-semibold mb-4 text-gray-900">2. 商业许可证 (Commercial License) - 适用于超过10人的组织或希望规避 AGPLv3
义务的用户</h2>
<ul class="list-disc pl-6 space-y-2 text-gray-700">
<li><strong>强制要求:</strong>
如果您的组织<strong></strong>满足上述"10人及以下"的定义即有11人或更多人可以访问、使用或受益于本软件<strong>必须</strong>联系我们获取并签署一份商业许可证才能使用
Cherry Studio。</li>
<li><strong>自愿选择:</strong> 即使您的组织满足"10人及以下"的条件,但如果您的使用场景<strong>无法满足 AGPLv3
的条款要求</strong>(特别是关于<strong>源代码公开</strong>的义务),或者您需要 AGPLv3 <strong>未提供</strong>的特定商业条款(如保证、赔偿、无 Copyleft
限制等),您也<strong>必须</strong>联系我们获取并签署一份商业许可证。</li>
<li><strong>需要商业许可证的常见情况包括(但不限于):</strong>
<ul class="list-disc pl-6 mt-2 space-y-1">
<li>您的组织规模超过10人。</li>
<li>(无论组织规模)您希望分发修改过的 Cherry Studio 版本,但<strong>不希望</strong>根据 AGPLv3 公开您修改部分的源代码。</li>
<li>(无论组织规模)您希望基于修改过的 Cherry Studio 提供网络服务SaaS<strong>不希望</strong>根据 AGPLv3 向服务使用者提供修改后的源代码。</li>
<li>(无论组织规模)您的公司政策、客户合同或项目要求不允许使用 AGPLv3 许可的软件,或要求闭源分发及保密。</li>
</ul>
</li>
<li><strong>获取商业许可:</strong> 请通过邮箱 <a href="mailto:bd@cherry-ai.com"
class="text-blue-600 hover:underline">bd@cherry-ai.com</a> 联系 Cherry Studio 开发团队洽谈商业授权事宜。</li>
</ul>
</section>
<section class="mb-8">
<h2 class="text-xl font-semibold mb-4 text-gray-900">3. 贡献 (Contributions)</h2>
<ul class="list-disc pl-6 space-y-2 text-gray-700">
<li>我们欢迎社区对 Cherry Studio 的贡献。所有向本项目提交的贡献都将被视为在 <strong>AGPLv3</strong> 许可证下提供。</li>
<li>通过向本项目提交贡献(例如通过 Pull Request即表示您同意您的代码以 AGPLv3 许可证授权给本项目及所有后续使用者(无论这些使用者最终遵循 AGPLv3 还是商业许可)。</li>
<li>您也理解并同意,您的贡献可能会被包含在根据商业许可证分发的 Cherry Studio 版本中。</li>
</ul>
</section>
<section class="mb-8">
<h2 class="text-xl font-semibold mb-4 text-gray-900">4. 其他条款 (Other Terms)</h2>
<ul class="list-disc pl-6 space-y-2 text-gray-700">
<li>关于商业许可证的具体条款和条件,以双方签署的正式商业许可协议为准。</li>
<li>项目维护者保留根据需要更新本许可政策(包括用户规模定义和阈值)的权利。相关更新将通过项目官方渠道(如代码仓库、官方网站)进行通知。</li>
</ul>
</section>
</div>
<h1 class="text-3xl font-bold mb-6 text-center">Cherry Studio License</h1>
<div class="mb-8">
<h2 class="text-2xl font-semibold mb-4">License Agreement</h2>
<p class="mb-4">
This software is licensed under the <strong>Apache License 2.0</strong>. In addition to the terms of the
Apache License 2.0, the following additional terms apply to the use of Cherry Studio:
<hr class="my-12 border-gray-300">
<!-- English Version -->
<div>
<h1 class="text-3xl font-bold mb-8 text-gray-900">Licensing</h1>
<p class="mb-6 text-gray-700">This project employs a <strong>User-Segmented Dual Licensing</strong> model.</p>
<section class="mb-8">
<h2 class="text-xl font-semibold mb-4 text-gray-900">Core Principle</h2>
<ul class="list-disc pl-6 space-y-2 text-gray-700">
<li><strong>Individual Users and Organizations with 10 or Fewer Individuals:</strong> Governed by default
under the <strong>GNU Affero General Public License v3.0 (AGPLv3)</strong>.</li>
<li><strong>Organizations with More Than 10 Individuals:</strong> <strong>Must</strong> obtain a
<strong>Commercial License</strong>.
</li>
</ul>
</section>
<section class="mb-8">
<h2 class="text-xl font-semibold mb-4 text-gray-900">Definition: "10 or Fewer Individuals"</h2>
<p class="text-gray-700">
Refers to any organization (including companies, non-profits, government agencies, educational institutions,
etc.) where the total number of individuals who can access, use, or in any way directly or indirectly benefit
from the functionality of this software (Cherry Studio) does not exceed 10. This includes, but is not limited
to, developers, testers, operations staff, end-users, and indirect users via integrated systems.
</p>
<h3 class="text-xl font-semibold mb-2">I. Commercial Use License</h3>
<ol class="list-decimal list-inside mb-4">
<li>
<strong>Free Commercial Use</strong>: Users can use the software for commercial purposes without
modifying
the code.
</section>
<section class="mb-8">
<h2 class="text-xl font-semibold mb-4 text-gray-900">1. Open Source License: AGPLv3 - For Individuals and
Organizations of 10 or Fewer</h2>
<ul class="list-disc pl-6 space-y-2 text-gray-700">
<li>If you are an individual user, or if your organization meets the "10 or Fewer Individuals" definition
above, you are free to use, modify, and distribute Cherry Studio under the terms of the
<strong>AGPLv3</strong>. The full text of the AGPLv3 can be found at <a
href="https://www.gnu.org/licenses/agpl-3.0.html"
class="text-blue-600 hover:underline">https://www.gnu.org/licenses/agpl-3.0.html</a>.
</li>
<li>
<strong>Commercial License Required</strong>: A commercial license is required if any of the
following
conditions are met:
<ol class="list-decimal list-inside ml-4">
<li>
You modify, develop, or alter the software, including but not limited to changes to the
application
name, logo, code, or functionality.
<li><strong>Core Obligation:</strong> A key requirement of the AGPLv3 is that if you modify Cherry Studio and
make it available over a network, or distribute the modified version, you must provide the <strong>complete
corresponding source code</strong> under the AGPLv3 license to the recipients. Even if you qualify under
the "10 or Fewer Individuals" rule, if you wish to avoid this source code disclosure obligation, you will
need to obtain a Commercial License (see below).</li>
<li>Please read and understand the full terms of the AGPLv3 carefully before use.</li>
</ul>
</section>
<section class="mb-8">
<h2 class="text-xl font-semibold mb-4 text-gray-900">2. Commercial License - For Organizations with More Than 10
Individuals, or Users Needing to Avoid AGPLv3 Obligations</h2>
<ul class="list-disc pl-6 space-y-2 text-gray-700">
<li><strong>Mandatory Requirement:</strong> If your organization does <strong>not</strong> meet the "10 or
Fewer Individuals" definition above (i.e., 11 or more individuals can access, use, or benefit from the
software), you <strong>must</strong> contact us to obtain and execute a Commercial License to use Cherry
Studio.</li>
<li><strong>Voluntary Option:</strong> Even if your organization meets the "10 or Fewer Individuals"
condition, if your intended use case <strong>cannot comply with the terms of the AGPLv3</strong>
(particularly the obligations regarding <strong>source code disclosure</strong>), or if you require specific
commercial terms <strong>not offered</strong> by the AGPLv3 (such as warranties, indemnities, or freedom
from copyleft restrictions), you also <strong>must</strong> contact us to obtain and execute a Commercial
License.</li>
<li><strong>Common scenarios requiring a Commercial License include (but are not limited to):</strong>
<ul class="list-disc pl-6 mt-2 space-y-1">
<li>Your organization has more than 10 individuals who can access, use, or benefit from the software.</li>
<li>(Regardless of organization size) You wish to distribute a modified version of Cherry Studio but
<strong>do not want</strong> to disclose the source code of your modifications under AGPLv3.
</li>
<li>You provide multi-tenant services to enterprise customers with 10 or more users.</li>
<li>
You pre-install or integrate the software into hardware devices or products and bundle it
for sale.
<li>(Regardless of organization size) You wish to provide a network service (SaaS) based on a modified
version of Cherry Studio but <strong>do not want</strong> to provide the modified source code to users
of the service under AGPLv3.</li>
<li>(Regardless of organization size) Your corporate policies, client contracts, or project requirements
prohibit the use of AGPLv3-licensed software or mandate closed-source distribution and confidentiality.
</li>
<li>
You are engaging in large-scale procurement for government or educational institutions,
especially
involving security, data privacy, or other sensitive requirements.
</ul>
</li>
</ol>
</li>
</ol>
<h3 class="text-xl font-semibold mb-2">II. Contributor Agreement</h3>
<ol class="list-decimal list-inside mb-4">
<li>
<strong>License Adjustment</strong>: The producer reserves the right to adjust the open-source
license as
needed, making it stricter or more lenient.
</li>
<li>
<strong>Commercial Use</strong>: Any code you contribute may be used for commercial purposes,
including but
not limited to cloud business operations.
</li>
</ol>
<h3 class="text-xl font-semibold mb-2">III. Other Terms</h3>
<ol class="list-decimal list-inside mb-4">
<li>The interpretation of these terms is subject to the discretion of Cherry Studio developers.</li>
<li>These terms may be updated, and users will be notified through the software when changes occur.</li>
</ol>
<p class="mb-4">
For any questions or to request a commercial license, please contact the Cherry Studio development team.
</p>
<p>
Apart from the specific conditions mentioned above, all other rights and restrictions follow the Apache
License 2.0. Detailed information about the Apache License 2.0 can be found at
<a href="http://www.apache.org/licenses/LICENSE-2.0"
class="text-blue-500 underline">http://www.apache.org/licenses/LICENSE-2.0</a>
</p>
<li><strong>Obtaining a Commercial License:</strong> Please contact the Cherry Studio development team via
email at <a href="mailto:bd@cherry-ai.com" class="text-blue-600 hover:underline">bd@cherry-ai.com</a> to
discuss commercial licensing options.</li>
</ul>
</section>
<section class="mb-8">
<h2 class="text-xl font-semibold mb-4 text-gray-900">3. Contributions</h2>
<ul class="list-disc pl-6 space-y-2 text-gray-700">
<li>We welcome community contributions to Cherry Studio. All contributions submitted to this project are
considered to be offered under the <strong>AGPLv3</strong> license.</li>
<li>By submitting a contribution to this project (e.g., via a Pull Request), you agree to license your code
under the AGPLv3 to the project and all its downstream users (regardless of whether those users ultimately
operate under AGPLv3 or a Commercial License).</li>
<li>You also understand and agree that your contribution may be included in distributions of Cherry Studio
offered under our commercial license.</li>
</ul>
</section>
<section class="mb-8">
<h2 class="text-xl font-semibold mb-4 text-gray-900">4. Other Terms</h2>
<ul class="list-disc pl-6 space-y-2 text-gray-700">
<li>The specific terms and conditions of the Commercial License are governed by the formal commercial license
agreement signed by both parties.</li>
<li>The project maintainers reserve the right to update this licensing policy (including the definition and
threshold for user count) as needed. Updates will be communicated through official project channels (e.g.,
code repository, official website).</li>
</ul>
</section>
</div>
</div>
</body>

View File

@@ -1,6 +1,5 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
@@ -18,7 +17,8 @@
<!-- Loading状态 -->
<div v-if="loading" class="text-center py-8">
<div class="inline-block animate-spin rounded-full h-8 w-8 border-4"
<div
class="inline-block animate-spin rounded-full h-8 w-8 border-4"
:class="isDark ? 'border-gray-700 border-t-blue-500' : 'border-gray-300 border-t-blue-500'"></div>
</div>
@@ -27,10 +27,14 @@
<!-- Release 列表 -->
<div v-else class="space-y-8">
<div v-for="release in releases" :key="release.id" class="relative pl-8"
<div
v-for="release in releases"
:key="release.id"
class="relative pl-8"
:class="isDark ? 'border-l-2 border-gray-700' : 'border-l-2 border-gray-200'">
<div class="absolute -left-2 top-0 w-4 h-4 rounded-full bg-green-500"></div>
<div class="rounded-lg shadow-sm p-6 transition-shadow"
<div
class="rounded-lg shadow-sm p-6 transition-shadow"
:class="isDark ? 'bg-black hover:shadow-md hover:shadow-black' : 'bg-white hover:shadow-md'">
<div class="flex items-start justify-between mb-4">
<div>
@@ -41,12 +45,15 @@
{{ formatDate(release.published_at) }}
</p>
</div>
<span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium"
<span
class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium"
:class="isDark ? 'bg-green-900 text-green-200' : 'bg-green-100 text-green-800'">
{{ release.tag_name }}
</span>
</div>
<div class="prose" :class="isDark ? 'text-gray-300 dark-prose' : 'text-gray-600'"
<div
class="prose"
:class="isDark ? 'text-gray-300 dark-prose' : 'text-gray-600'"
v-html="renderMarkdown(release.body)"></div>
</div>
</div>
@@ -198,5 +205,4 @@
}
</style>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,68 +0,0 @@
<head>
<style>
body {
margin: 0;
}
</style>
<script src="https://unpkg.com/3d-force-graph"></script>
</head>
<body>
<div id="3d-graph"></div>
<script src="./js/bridge.js"></script>
<script type="module">
import { getQueryParam } from './js/utils.js'
const apiUrl = getQueryParam('apiUrl')
const modelId = getQueryParam('modelId')
const jsonUrl = `${apiUrl}/v1/global_graph/${modelId}`
const infoCard = document.createElement('div')
infoCard.style.position = 'fixed'
infoCard.style.backgroundColor = 'rgba(255, 255, 255, 0.9)'
infoCard.style.padding = '8px'
infoCard.style.borderRadius = '4px'
infoCard.style.boxShadow = '0 2px 5px rgba(0,0,0,0.2)'
infoCard.style.fontSize = '12px'
infoCard.style.maxWidth = '200px'
infoCard.style.display = 'none'
infoCard.style.zIndex = '1000'
document.body.appendChild(infoCard)
document.addEventListener('mousemove', (event) => {
infoCard.style.left = `${event.clientX + 10}px`
infoCard.style.top = `${event.clientY + 10}px`
})
const elem = document.getElementById('3d-graph')
const Graph = ForceGraph3D()(elem)
.jsonUrl(jsonUrl)
.nodeAutoColorBy((node) => node.properties.type || 'default')
.nodeVal((node) => node.properties.degree)
.linkWidth((link) => link.properties.weight)
.onNodeHover((node) => {
if (node) {
infoCard.innerHTML = `
<div style="font-weight: bold; margin-bottom: 4px; color: #333;">
${node.properties.title}
</div>
<div style="color: #666;">
${node.properties.description}
</div>`
infoCard.style.display = 'block'
} else {
infoCard.style.display = 'none'
}
})
.onNodeClick((node) => {
const url = `${apiUrl}/v1/references/${modelId}/entities/${node.properties.human_readable_id}`
window.api.minApp({
url,
windowOptions: {
title: node.properties.title,
width: 500,
height: 800
}
})
})
</script>
</body>

View File

@@ -2,12 +2,12 @@ const fs = require('fs')
const path = require('path')
const os = require('os')
const { execSync } = require('child_process')
const AdmZip = require('adm-zip')
const StreamZip = require('node-stream-zip')
const { downloadWithRedirects } = require('./download')
// Base URL for downloading bun binaries
const BUN_RELEASE_BASE_URL = 'https://github.com/oven-sh/bun/releases/download'
const DEFAULT_BUN_VERSION = '1.2.5' // Default fallback version
const BUN_RELEASE_BASE_URL = 'https://gitcode.com/CherryHQ/bun/releases/download'
const DEFAULT_BUN_VERSION = '1.2.17' // Default fallback version
// Mapping of platform+arch to binary package name
const BUN_PACKAGES = {
@@ -15,6 +15,8 @@ const BUN_PACKAGES = {
'darwin-x64': 'bun-darwin-x64.zip',
'win32-x64': 'bun-windows-x64.zip',
'win32-x64-baseline': 'bun-windows-x64-baseline.zip',
'win32-arm64': 'bun-windows-x64.zip',
'win32-arm64-baseline': 'bun-windows-x64-baseline.zip',
'linux-x64': 'bun-linux-x64.zip',
'linux-x64-baseline': 'bun-linux-x64-baseline.zip',
'linux-arm64': 'bun-linux-aarch64.zip',
@@ -64,35 +66,36 @@ async function downloadBunBinary(platform, arch, version = DEFAULT_BUN_VERSION,
// Extract the zip file using adm-zip
console.log(`Extracting ${packageName} to ${binDir}...`)
const zip = new AdmZip(tempFilename)
zip.extractAllTo(tempdir, true)
const zip = new StreamZip.async({ file: tempFilename })
// Move files using Node.js fs
const sourceDir = path.join(tempdir, packageName.split('.')[0])
const files = fs.readdirSync(sourceDir)
// Get all entries in the zip file
const entries = await zip.entries()
for (const file of files) {
const sourcePath = path.join(sourceDir, file)
const destPath = path.join(binDir, file)
// Extract files directly to binDir, flattening the directory structure
for (const entry of Object.values(entries)) {
if (!entry.isDirectory) {
// Get just the filename without path
const filename = path.basename(entry.name)
const outputPath = path.join(binDir, filename)
fs.copyFileSync(sourcePath, destPath)
fs.unlinkSync(sourcePath)
// Set executable permissions for non-Windows platforms
console.log(`Extracting ${entry.name} -> ${filename}`)
await zip.extract(entry.name, outputPath)
// Make executable files executable on Unix-like systems
if (platform !== 'win32') {
try {
// 755 permission: rwxr-xr-x
fs.chmodSync(destPath, '755')
} catch (error) {
console.warn(`Warning: Failed to set executable permissions: ${error.message}`)
fs.chmodSync(outputPath, 0o755)
} catch (chmodError) {
console.error(`Warning: Failed to set executable permissions on ${filename}`)
return false
}
}
console.log(`Extracted ${entry.name} -> ${outputPath}`)
}
}
await zip.close()
// Clean up
fs.unlinkSync(tempFilename)
fs.rmSync(sourceDir, { recursive: true })
console.log(`Successfully installed bun ${version} for ${platformKey}`)
return true
} catch (error) {

View File

@@ -2,34 +2,33 @@ const fs = require('fs')
const path = require('path')
const os = require('os')
const { execSync } = require('child_process')
const tar = require('tar')
const AdmZip = require('adm-zip')
const StreamZip = require('node-stream-zip')
const { downloadWithRedirects } = require('./download')
// Base URL for downloading uv binaries
const UV_RELEASE_BASE_URL = 'https://github.com/astral-sh/uv/releases/download'
const DEFAULT_UV_VERSION = '0.6.6'
const UV_RELEASE_BASE_URL = 'https://gitcode.com/CherryHQ/uv/releases/download'
const DEFAULT_UV_VERSION = '0.7.13'
// Mapping of platform+arch to binary package name
const UV_PACKAGES = {
'darwin-arm64': 'uv-aarch64-apple-darwin.tar.gz',
'darwin-x64': 'uv-x86_64-apple-darwin.tar.gz',
'darwin-arm64': 'uv-aarch64-apple-darwin.zip',
'darwin-x64': 'uv-x86_64-apple-darwin.zip',
'win32-arm64': 'uv-aarch64-pc-windows-msvc.zip',
'win32-ia32': 'uv-i686-pc-windows-msvc.zip',
'win32-x64': 'uv-x86_64-pc-windows-msvc.zip',
'linux-arm64': 'uv-aarch64-unknown-linux-gnu.tar.gz',
'linux-ia32': 'uv-i686-unknown-linux-gnu.tar.gz',
'linux-ppc64': 'uv-powerpc64-unknown-linux-gnu.tar.gz',
'linux-ppc64le': 'uv-powerpc64le-unknown-linux-gnu.tar.gz',
'linux-s390x': 'uv-s390x-unknown-linux-gnu.tar.gz',
'linux-x64': 'uv-x86_64-unknown-linux-gnu.tar.gz',
'linux-armv7l': 'uv-armv7-unknown-linux-gnueabihf.tar.gz',
'linux-arm64': 'uv-aarch64-unknown-linux-gnu.zip',
'linux-ia32': 'uv-i686-unknown-linux-gnu.zip',
'linux-ppc64': 'uv-powerpc64-unknown-linux-gnu.zip',
'linux-ppc64le': 'uv-powerpc64le-unknown-linux-gnu.zip',
'linux-s390x': 'uv-s390x-unknown-linux-gnu.zip',
'linux-x64': 'uv-x86_64-unknown-linux-gnu.zip',
'linux-armv7l': 'uv-armv7-unknown-linux-gnueabihf.zip',
// MUSL variants
'linux-musl-arm64': 'uv-aarch64-unknown-linux-musl.tar.gz',
'linux-musl-ia32': 'uv-i686-unknown-linux-musl.tar.gz',
'linux-musl-x64': 'uv-x86_64-unknown-linux-musl.tar.gz',
'linux-musl-armv6l': 'uv-arm-unknown-linux-musleabihf.tar.gz',
'linux-musl-armv7l': 'uv-armv7-unknown-linux-musleabihf.tar.gz'
'linux-musl-arm64': 'uv-aarch64-unknown-linux-musl.zip',
'linux-musl-ia32': 'uv-i686-unknown-linux-musl.zip',
'linux-musl-x64': 'uv-x86_64-unknown-linux-musl.zip',
'linux-musl-armv6l': 'uv-arm-unknown-linux-musleabihf.zip',
'linux-musl-armv7l': 'uv-armv7-unknown-linux-musleabihf.zip'
}
/**
@@ -66,46 +65,35 @@ async function downloadUvBinary(platform, arch, version = DEFAULT_UV_VERSION, is
console.log(`Extracting ${packageName} to ${binDir}...`)
// 根据文件扩展名选择解压方法
if (packageName.endsWith('.zip')) {
// 使用 adm-zip 处理 zip 文件
const zip = new AdmZip(tempFilename)
zip.extractAllTo(binDir, true)
fs.unlinkSync(tempFilename)
console.log(`Successfully installed uv ${version} for ${platform}-${arch}`)
return true
} else {
// tar.gz 文件的处理保持不变
await tar.x({
file: tempFilename,
cwd: tempdir,
z: true
})
const zip = new StreamZip.async({ file: tempFilename })
// Move files using Node.js fs
const sourceDir = path.join(tempdir, packageName.split('.')[0])
const files = fs.readdirSync(sourceDir)
for (const file of files) {
const sourcePath = path.join(sourceDir, file)
const destPath = path.join(binDir, file)
fs.copyFileSync(sourcePath, destPath)
fs.unlinkSync(sourcePath)
// Get all entries in the zip file
const entries = await zip.entries()
// Set executable permissions for non-Windows platforms
// Extract files directly to binDir, flattening the directory structure
for (const entry of Object.values(entries)) {
if (!entry.isDirectory) {
// Get just the filename without path
const filename = path.basename(entry.name)
const outputPath = path.join(binDir, filename)
console.log(`Extracting ${entry.name} -> ${filename}`)
await zip.extract(entry.name, outputPath)
// Make executable files executable on Unix-like systems
if (platform !== 'win32') {
try {
fs.chmodSync(destPath, '755')
} catch (error) {
console.warn(`Warning: Failed to set executable permissions: ${error.message}`)
fs.chmodSync(outputPath, 0o755)
} catch (chmodError) {
console.error(`Warning: Failed to set executable permissions on ${filename}`)
return false
}
}
console.log(`Extracted ${entry.name} -> ${outputPath}`)
}
}
// Clean up
await zip.close()
fs.unlinkSync(tempFilename)
fs.rmSync(sourceDir, { recursive: true })
}
console.log(`Successfully installed uv ${version} for ${platform}-${arch}`)
return true
} catch (error) {

View File

@@ -1,117 +0,0 @@
import Cocoa
import Foundation
class TextSelectionObserver: NSObject {
let workspace = NSWorkspace.shared
var lastSelectedText: String?
override init() {
super.init()
//
let observer = NSWorkspace.shared.notificationCenter
observer.addObserver(
self,
selector: #selector(handleSelectionChange),
name: NSWorkspace.didActivateApplicationNotification,
object: nil
)
//
var axObserver: AXObserver?
let error = AXObserverCreate(getpid(), { observer, element, notification, userData in
let selfPointer = userData!.load(as: TextSelectionObserver.self)
selfPointer.checkSelectedText()
}, &axObserver)
if error == .success, let axObserver = axObserver {
CFRunLoopAddSource(
RunLoop.main.getCFRunLoop(),
AXObserverGetRunLoopSource(axObserver),
.defaultMode
)
//
updateActiveAppObserver(axObserver)
}
}
@objc func handleSelectionChange(_ notification: Notification) {
//
var axObserver: AXObserver?
let error = AXObserverCreate(getpid(), { _, _, _, _ in }, &axObserver)
if error == .success, let axObserver = axObserver {
updateActiveAppObserver(axObserver)
}
}
func updateActiveAppObserver(_ axObserver: AXObserver) {
guard let app = workspace.frontmostApplication else { return }
let pid = app.processIdentifier
let element = AXUIElementCreateApplication(pid)
//
AXObserverAddNotification(
axObserver,
element,
kAXSelectedTextChangedNotification as CFString,
UnsafeMutableRawPointer(Unmanaged.passUnretained(self).toOpaque())
)
}
func checkSelectedText() {
if let text = getSelectedText() {
if text.count > 0 && text != lastSelectedText {
print(text)
fflush(stdout)
lastSelectedText = text
}
}
}
func getSelectedText() -> String? {
guard let app = NSWorkspace.shared.frontmostApplication else { return nil }
let pid = app.processIdentifier
let axApp = AXUIElementCreateApplication(pid)
var focusedElement: AnyObject?
// Get focused element
let result = AXUIElementCopyAttributeValue(axApp, kAXFocusedUIElementAttribute as CFString, &focusedElement)
guard result == .success else { return nil }
// Try different approaches to get selected text
var selectedText: AnyObject?
// First try: Direct selected text
var textResult = AXUIElementCopyAttributeValue(focusedElement as! AXUIElement, kAXSelectedTextAttribute as CFString, &selectedText)
// Second try: Selected text in text area
if textResult != .success {
var selectedTextRange: AnyObject?
textResult = AXUIElementCopyAttributeValue(focusedElement as! AXUIElement, kAXSelectedTextRangeAttribute as CFString, &selectedTextRange)
if textResult == .success {
textResult = AXUIElementCopyAttributeValue(focusedElement as! AXUIElement, kAXValueAttribute as CFString, &selectedText)
}
}
// Third try: Get selected text from parent element
if textResult != .success {
var parent: AnyObject?
if AXUIElementCopyAttributeValue(focusedElement as! AXUIElement, kAXParentAttribute as CFString, &parent) == .success {
textResult = AXUIElementCopyAttributeValue(parent as! AXUIElement, kAXSelectedTextAttribute as CFString, &selectedText)
}
}
guard textResult == .success, let text = selectedText as? String else { return nil }
return text
}
}
let observer = TextSelectionObserver()
signal(SIGINT) { _ in
exit(0)
}
RunLoop.main.run()

View File

@@ -1,10 +1,8 @@
const { Arch } = require('electron-builder')
const { default: removeLocales } = require('./remove-locales')
const fs = require('fs')
const path = require('path')
exports.default = async function (context) {
await removeLocales(context)
const platform = context.packager.platform.name
const arch = context.arch
@@ -18,28 +16,74 @@ exports.default = async function (context) {
'node_modules'
)
removeDifferentArchNodeFiles(node_modules_path, '@libsql', arch === Arch.arm64 ? ['darwin-arm64'] : ['darwin-x64'])
keepPackageNodeFiles(node_modules_path, '@libsql', arch === Arch.arm64 ? ['darwin-arm64'] : ['darwin-x64'])
}
if (platform === 'linux') {
const node_modules_path = path.join(context.appOutDir, 'resources', 'app.asar.unpacked', 'node_modules')
const _arch = arch === Arch.arm64 ? ['linux-arm64-gnu', 'linux-arm64-musl'] : ['linux-x64-gnu', 'linux-x64-musl']
removeDifferentArchNodeFiles(node_modules_path, '@libsql', _arch)
keepPackageNodeFiles(node_modules_path, '@libsql', _arch)
// 删除 macOS 专用的 OCR 包
removeMacOnlyPackages(node_modules_path)
}
if (platform === 'windows') {
const node_modules_path = path.join(context.appOutDir, 'resources', 'app.asar.unpacked', 'node_modules')
removeDifferentArchNodeFiles(node_modules_path, '@libsql', ['win32-x64-msvc'])
if (arch === Arch.arm64) {
keepPackageNodeFiles(node_modules_path, '@strongtz', ['win32-arm64-msvc'])
keepPackageNodeFiles(node_modules_path, '@libsql', ['win32-arm64-msvc'])
}
if (arch === Arch.x64) {
keepPackageNodeFiles(node_modules_path, '@strongtz', ['win32-x64-msvc'])
keepPackageNodeFiles(node_modules_path, '@libsql', ['win32-x64-msvc'])
}
removeMacOnlyPackages(node_modules_path)
}
if (platform === 'windows') {
fs.rmSync(path.join(context.appOutDir, 'LICENSE.electron.txt'), { force: true })
fs.rmSync(path.join(context.appOutDir, 'LICENSES.chromium.html'), { force: true })
}
}
function removeDifferentArchNodeFiles(nodeModulesPath, packageName, arch) {
/**
* 删除 macOS 专用的包
* @param {string} nodeModulesPath
*/
function removeMacOnlyPackages(nodeModulesPath) {
const macOnlyPackages = ['@cherrystudio/mac-system-ocr']
macOnlyPackages.forEach((packageName) => {
const packagePath = path.join(nodeModulesPath, packageName)
if (fs.existsSync(packagePath)) {
fs.rmSync(packagePath, { recursive: true, force: true })
console.log(`[After Pack] Removed macOS-only package: ${packageName}`)
}
})
}
/**
* 使用指定架构的 node_modules 文件
* @param {*} nodeModulesPath
* @param {*} packageName
* @param {*} arch
* @returns
*/
function keepPackageNodeFiles(nodeModulesPath, packageName, arch) {
const modulePath = path.join(nodeModulesPath, packageName)
if (!fs.existsSync(modulePath)) {
console.log(`[After Pack] Directory does not exist: ${modulePath}`)
return
}
const dirs = fs.readdirSync(modulePath)
dirs
.filter((dir) => !arch.includes(dir))
.forEach((dir) => {
fs.rmSync(path.join(modulePath, dir), { recursive: true, force: true })
console.log(`Removed dir: ${dir}`, arch)
console.log(`[After Pack] Removed dir: ${dir}`, arch)
})
}

View File

@@ -0,0 +1,18 @@
const fs = require('fs')
exports.default = function (buildResult) {
try {
console.log('[artifact build completed] rename artifact file...')
if (!buildResult.file.includes(' ')) {
return
}
let oldFilePath = buildResult.file
const newfilePath = oldFilePath.replace(/ /g, '-')
fs.renameSync(oldFilePath, newfilePath)
buildResult.file = newfilePath
console.log(`[artifact build completed] rename file ${oldFilePath} to ${newfilePath} `)
} catch (error) {
console.error('Error renaming file:', error)
}
}

View File

@@ -33,6 +33,10 @@ async function downloadNpm(platform) {
'@libsql/win32-x64-msvc',
'https://registry.npmjs.org/@libsql/win32-x64-msvc/-/win32-x64-msvc-0.4.7.tgz'
)
downloadNpmPackage(
'@strongtz/win32-arm64-msvc',
'https://registry.npmjs.org/@strongtz/win32-arm64-msvc/-/win32-arm64-msvc-0.4.7.tgz'
)
}
}

View File

@@ -3,7 +3,7 @@ Object.defineProperty(exports, '__esModule', { value: true })
var fs = require('fs')
var path = require('path')
var translationsDir = path.join(__dirname, '../src/renderer/src/i18n/locales')
var baseLocale = 'zh-CN'
var baseLocale = 'en-us'
var baseFileName = ''.concat(baseLocale, '.json')
var baseFilePath = path.join(translationsDir, baseFileName)
/**

View File

@@ -7,7 +7,6 @@ exports.default = async function notarizing(context) {
}
if (!process.env.APPLE_ID || !process.env.APPLE_APP_SPECIFIC_PASSWORD || !process.env.APPLE_TEAM_ID) {
console.log('Skipping notarization')
return
}

View File

@@ -1,58 +0,0 @@
const fs = require('fs')
const path = require('path')
exports.default = async function (context) {
const platform = context.packager.platform.name
// 根据平台确定 locales 目录位置
let resourceDirs = []
if (platform === 'mac') {
// macOS 的语言文件位置
resourceDirs = [
path.join(context.appOutDir, 'Cherry Studio.app', 'Contents', 'Resources'),
path.join(
context.appOutDir,
'Cherry Studio.app',
'Contents',
'Frameworks',
'Electron Framework.framework',
'Resources'
)
]
} else {
// Windows 和 Linux 的语言文件位置
resourceDirs = [path.join(context.appOutDir, 'locales')]
}
// 处理每个资源目录
for (const resourceDir of resourceDirs) {
if (!fs.existsSync(resourceDir)) {
console.log(`Resource directory not found: ${resourceDir}, skipping...`)
continue
}
// 读取所有文件和目录
const items = fs.readdirSync(resourceDir)
// 遍历并删除不需要的语言文件
for (const item of items) {
if (platform === 'mac') {
// 在 macOS 上检查 .lproj 目录
if (item.endsWith('.lproj') && !item.match(/^(en|zh|ru)/)) {
const dirPath = path.join(resourceDir, item)
fs.rmSync(dirPath, { recursive: true, force: true })
console.log(`Removed locale directory: ${item} from ${resourceDir}`)
}
} else {
// 其他平台处理 .pak 文件
if (!item.match(/^(en|zh|ru)/)) {
const filePath = path.join(resourceDir, item)
fs.unlinkSync(filePath)
console.log(`Removed locale file: ${item} from ${resourceDir}`)
}
}
}
}
console.log('Locale cleanup completed!')
}

View File

@@ -1,58 +0,0 @@
// replaceSpaces.js
const fs = require('fs')
const path = require('path')
const directory = 'dist'
// 处理文件名中的空格
function replaceFileNames() {
fs.readdir(directory, (err, files) => {
if (err) throw err
files.forEach((file) => {
const oldPath = path.join(directory, file)
const newPath = path.join(directory, file.replace(/ /g, '-'))
fs.stat(oldPath, (err, stats) => {
if (err) throw err
if (stats.isFile() && oldPath !== newPath) {
fs.rename(oldPath, newPath, (err) => {
if (err) throw err
console.log(`Renamed: ${oldPath} -> ${newPath}`)
})
}
})
})
})
}
function replaceYmlContent() {
fs.readdir(directory, (err, files) => {
if (err) throw err
files.forEach((file) => {
if (path.extname(file).toLowerCase() === '.yml') {
const filePath = path.join(directory, file)
fs.readFile(filePath, 'utf8', (err, data) => {
if (err) throw err
// 替换内容
const newContent = data.replace(/Cherry Studio-/g, 'Cherry-Studio-')
// 写回文件
fs.writeFile(filePath, newContent, 'utf8', (err) => {
if (err) throw err
console.log(`Updated content in: ${filePath}`)
})
})
}
})
})
}
// 执行两个操作
replaceFileNames()
replaceYmlContent()

View File

@@ -1,16 +1,16 @@
/**
* OCOOL_API_KEY=sk-abcxxxxxxxxxxxxxxxxxxxxxxx123 ts-node scripts/update-i18n.ts
* Paratera_API_KEY=sk-abcxxxxxxxxxxxxxxxxxxxxxxx123 ts-node scripts/update-i18n.ts
*/
// OCOOL API KEY
const OCOOL_API_KEY = process.env.OCOOL_API_KEY
const Paratera_API_KEY = process.env.Paratera_API_KEY
const INDEX = [
// 语言的名称 代码 用来翻译的模型
{ name: 'France', code: 'fr-fr', model: 'qwen2.5-32b-instruct' },
{ name: 'Spanish', code: 'es-es', model: 'qwen2.5-32b-instruct' },
{ name: 'Portuguese', code: 'pt-pt', model: 'qwen2.5-72b-instruct' },
{ name: 'Greek', code: 'el-gr', model: 'qwen-turbo' }
{ name: 'France', code: 'fr-fr', model: 'Qwen3-235B-A22B' },
{ name: 'Spanish', code: 'es-es', model: 'Qwen3-235B-A22B' },
{ name: 'Portuguese', code: 'pt-pt', model: 'Qwen3-235B-A22B' },
{ name: 'Greek', code: 'el-gr', model: 'Qwen3-235B-A22B' }
]
const fs = require('fs')
@@ -19,8 +19,8 @@ import OpenAI from 'openai'
const zh = JSON.parse(fs.readFileSync('src/renderer/src/i18n/locales/zh-cn.json', 'utf8')) as object
const openai = new OpenAI({
apiKey: OCOOL_API_KEY,
baseURL: 'https://one.ocoolai.com/v1'
apiKey: Paratera_API_KEY,
baseURL: 'https://llmapi.paratera.com/v1'
})
// 递归遍历翻译

View File

@@ -22,7 +22,8 @@ function downloadNpmPackage(packageName, url) {
console.log(`Extracting ${filename}...`)
execSync(`tar -xvf ${filename}`)
execSync(`rm -rf ${filename}`)
execSync(`mv package ${targetDir}`)
execSync(`mkdir -p ${targetDir}`)
execSync(`mv package/* ${targetDir}/`)
} catch (error) {
console.error(`Error processing ${packageName}: ${error.message}`)
if (fs.existsSync(filename)) {

19
scripts/win-sign.js Normal file
View File

@@ -0,0 +1,19 @@
const { execSync } = require('child_process')
exports.default = async function (configuration) {
if (process.env.WIN_SIGN) {
const { path } = configuration
if (configuration.path) {
try {
console.log('Start code signing...')
console.log('Signing file:', path)
const signCommand = `signtool sign /tr http://timestamp.comodoca.com /td sha256 /fd sha256 /a /v "${path}"`
execSync(signCommand, { stdio: 'inherit' })
console.log('Code signing completed')
} catch (error) {
console.error('Code signing failed:', error)
throw error
}
}
}
}

33
src/main/bootstrap.ts Normal file
View File

@@ -0,0 +1,33 @@
import { occupiedDirs } from '@shared/config/constant'
import { app } from 'electron'
import fs from 'fs'
import path from 'path'
import { initAppDataDir } from './utils/file'
app.isPackaged && initAppDataDir()
// 在主进程中复制 appData 中某些一直被占用的文件
// 在renderer进程还没有启动时主进程可以复制这些文件到新的appData中
function copyOccupiedDirsInMainProcess() {
const newAppDataPath = process.argv
.slice(1)
.find((arg) => arg.startsWith('--new-data-path='))
?.split('--new-data-path=')[1]
if (!newAppDataPath) {
return
}
if (process.platform === 'win32') {
const appDataPath = app.getPath('userData')
occupiedDirs.forEach((dir) => {
const dirPath = path.join(appDataPath, dir)
const newDirPath = path.join(newAppDataPath, dir)
if (fs.existsSync(dirPath)) {
fs.cpSync(dirPath, newDirPath, { recursive: true })
}
})
}
}
copyOccupiedDirsInMainProcess()

View File

@@ -1,7 +1,6 @@
import { app } from 'electron'
import { getDataPath } from './utils'
const isDev = process.env.NODE_ENV === 'development'
if (isDev) {
@@ -12,12 +11,12 @@ export const DATA_PATH = getDataPath()
export const titleBarOverlayDark = {
height: 40,
color: 'rgba(0,0,0,0)',
symbolColor: '#ffffff'
color: 'rgba(255,255,255,0)',
symbolColor: '#fff'
}
export const titleBarOverlayLight = {
height: 40,
color: 'rgba(255,255,255,0)',
symbolColor: '#000000'
symbolColor: '#000'
}

View File

@@ -0,0 +1,61 @@
interface IFilterList {
WINDOWS: string[]
MAC: string[]
}
interface IFinetunedList {
EXCLUDE_CLIPBOARD_CURSOR_DETECT: IFilterList
INCLUDE_CLIPBOARD_DELAY_READ: IFilterList
}
/*************************************************************************
* 注意:请不要修改此配置,除非你非常清楚其含义、影响和行为的目的
* Note: Do not modify this configuration unless you fully understand its meaning, implications, and intended behavior.
* -----------------------------------------------------------------------
* A predefined application filter list to include commonly used software
* that does not require text selection but may conflict with it, and disable them in advance.
* Only available in the selected mode.
*
* Specification: must be all lowercase, need to accurately find the actual running program name
*************************************************************************/
export const SELECTION_PREDEFINED_BLACKLIST: IFilterList = {
WINDOWS: [
'explorer.exe',
// Screenshot
'snipaste.exe',
'pixpin.exe',
'sharex.exe',
// Office
'excel.exe',
'powerpnt.exe',
// Image Editor
'photoshop.exe',
'illustrator.exe',
// Video Editor
'adobe premiere pro.exe',
'afterfx.exe',
// Audio Editor
'adobe audition.exe',
// 3D Editor
'blender.exe',
'3dsmax.exe',
'maya.exe',
// CAD
'acad.exe',
'sldworks.exe',
// Remote Desktop
'mstsc.exe'
],
MAC: []
}
export const SELECTION_FINETUNED_LIST: IFinetunedList = {
EXCLUDE_CLIPBOARD_CURSOR_DETECT: {
WINDOWS: ['acrobat.exe', 'wps.exe', 'cajviewer.exe'],
MAC: []
},
INCLUDE_CLIPBOARD_DELAY_READ: {
WINDOWS: ['acrobat.exe', 'wps.exe', 'cajviewer.exe', 'foxitphantom.exe'],
MAC: []
}
}

View File

@@ -2,3 +2,4 @@ export const isMac = process.platform === 'darwin'
export const isWin = process.platform === 'win32'
export const isLinux = process.platform === 'linux'
export const isDev = process.env.NODE_ENV === 'development'
export const isPortable = isWin && 'PORTABLE_EXECUTABLE_DIR' in process.env

View File

@@ -5,8 +5,15 @@ import EmbeddingsFactory from './EmbeddingsFactory'
export default class Embeddings {
private sdk: BaseEmbeddings
constructor({ model, apiKey, apiVersion, baseURL, dimensions }: KnowledgeBaseParams) {
this.sdk = EmbeddingsFactory.create({ model, apiKey, apiVersion, baseURL, dimensions } as KnowledgeBaseParams)
constructor({ model, provider, apiKey, apiVersion, baseURL, dimensions }: KnowledgeBaseParams) {
this.sdk = EmbeddingsFactory.create({
model,
provider,
apiKey,
apiVersion,
baseURL,
dimensions
} as KnowledgeBaseParams)
}
public async init(): Promise<void> {
return this.sdk.init()

View File

@@ -1,21 +1,50 @@
import type { BaseEmbeddings } from '@cherrystudio/embedjs-interfaces'
import { OllamaEmbeddings } from '@cherrystudio/embedjs-ollama'
import { OpenAiEmbeddings } from '@cherrystudio/embedjs-openai'
import { AzureOpenAiEmbeddings } from '@cherrystudio/embedjs-openai/src/azure-openai-embeddings'
import { getInstanceName } from '@main/utils'
import { KnowledgeBaseParams } from '@types'
import VoyageEmbeddings from './VoyageEmbeddings'
import { SUPPORTED_DIM_MODELS as VOYAGE_SUPPORTED_DIM_MODELS, VoyageEmbeddings } from './VoyageEmbeddings'
export default class EmbeddingsFactory {
static create({ model, apiKey, apiVersion, baseURL, dimensions }: KnowledgeBaseParams): BaseEmbeddings {
static create({ model, provider, apiKey, apiVersion, baseURL, dimensions }: KnowledgeBaseParams): BaseEmbeddings {
const batchSize = 10
if (model.includes('voyage')) {
if (provider === 'voyageai') {
if (VOYAGE_SUPPORTED_DIM_MODELS.includes(model)) {
return new VoyageEmbeddings({
modelName: model,
apiKey,
outputDimension: dimensions,
batchSize: 8
})
} else {
return new VoyageEmbeddings({
modelName: model,
apiKey,
batchSize: 8
})
}
}
if (provider === 'ollama') {
if (baseURL.includes('v1/')) {
return new OllamaEmbeddings({
model: model,
baseUrl: baseURL.replace('v1/', ''),
requestOptions: {
// @ts-ignore expected
'encoding-format': 'float'
}
})
}
return new OllamaEmbeddings({
model: model,
baseUrl: baseURL,
requestOptions: {
// @ts-ignore expected
'encoding-format': 'float'
}
})
}
if (apiVersion !== undefined) {
return new AzureOpenAiEmbeddings({

View File

@@ -1,16 +1,20 @@
import { BaseEmbeddings } from '@cherrystudio/embedjs-interfaces'
import { VoyageEmbeddings as _VoyageEmbeddings } from '@langchain/community/embeddings/voyage'
export default class VoyageEmbeddings extends BaseEmbeddings {
/**
* 支持设置嵌入维度的模型
*/
export const SUPPORTED_DIM_MODELS = ['voyage-3-large', 'voyage-3.5', 'voyage-3.5-lite', 'voyage-code-3']
export class VoyageEmbeddings extends BaseEmbeddings {
private model: _VoyageEmbeddings
constructor(private readonly configuration?: ConstructorParameters<typeof _VoyageEmbeddings>[0]) {
super()
if (!this.configuration) this.configuration = {}
if (!this.configuration.modelName) this.configuration.modelName = 'voyage-3'
if (!this.configuration.outputDimension) {
throw new Error('You need to pass in the optional dimensions parameter for this model')
if (!SUPPORTED_DIM_MODELS.includes(this.configuration.modelName) && this.configuration.outputDimension) {
throw new Error(`VoyageEmbeddings only supports ${SUPPORTED_DIM_MODELS.join(', ')}`)
}
this.model = new _VoyageEmbeddings(this.configuration)
}
override async getDimensions(): Promise<number> {

View File

@@ -1,15 +1,76 @@
// don't reorder this file, it's used to initialize the app data dir and
// other which should be run before the main process is ready
// eslint-disable-next-line
import './bootstrap'
import '@main/config'
import { electronApp, optimizer } from '@electron-toolkit/utils'
import { replaceDevtoolsFont } from '@main/utils/windowUtil'
import { app, ipcMain } from 'electron'
import { app } from 'electron'
import installExtension, { REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS } from 'electron-devtools-installer'
import Logger from 'electron-log'
import { isDev, isWin } from './constant'
import { registerIpc } from './ipc'
import { configManager } from './services/ConfigManager'
import { CHERRY_STUDIO_PROTOCOL, handleProtocolUrl, registerProtocolClient } from './services/ProtocolClient'
import mcpService from './services/MCPService'
import {
CHERRY_STUDIO_PROTOCOL,
handleProtocolUrl,
registerProtocolClient,
setupAppImageDeepLink
} from './services/ProtocolClient'
import selectionService, { initSelectionService } from './services/SelectionService'
import { registerShortcuts } from './services/ShortcutService'
import { TrayService } from './services/TrayService'
import { windowService } from './services/WindowService'
Logger.initialize()
/**
* Disable chromium's window animations
* main purpose for this is to avoid the transparent window flashing when it is shown
* (especially on Windows for SelectionAssistant Toolbar)
* Know Issue: https://github.com/electron/electron/issues/12130#issuecomment-627198990
*/
if (isWin) {
app.commandLine.appendSwitch('wm-window-animations-disabled')
}
// Enable features for unresponsive renderer js call stacks
app.commandLine.appendSwitch('enable-features', 'DocumentPolicyIncludeJSCallStacksInCrashReports')
app.on('web-contents-created', (_, webContents) => {
webContents.session.webRequest.onHeadersReceived((details, callback) => {
callback({
responseHeaders: {
...details.responseHeaders,
'Document-Policy': ['include-js-call-stacks-in-crash-reports']
}
})
})
webContents.on('unresponsive', async () => {
// Interrupt execution and collect call stack from unresponsive renderer
Logger.error('Renderer unresponsive start')
const callStack = await webContents.mainFrame.collectJavaScriptCallStack()
Logger.error('Renderer unresponsive js call stack\n', callStack)
})
})
// in production mode, handle uncaught exception and unhandled rejection globally
if (!isDev) {
// handle uncaught exception
process.on('uncaughtException', (error) => {
Logger.error('Uncaught Exception:', error)
})
// handle unhandled rejection
process.on('unhandledRejection', (reason, promise) => {
Logger.error('Unhandled Rejection at:', promise, 'reason:', reason)
})
}
// Check for single instance lock
if (!app.requestSingleInstanceLock()) {
app.quit()
@@ -47,22 +108,17 @@ if (!app.requestSingleInstanceLock()) {
replaceDevtoolsFont(mainWindow)
if (process.env.NODE_ENV === 'development') {
// Setup deep link for AppImage on Linux
await setupAppImageDeepLink()
if (isDev) {
installExtension([REDUX_DEVTOOLS, REACT_DEVELOPER_TOOLS])
.then((name) => console.log(`Added Extension: ${name}`))
.catch((err) => console.log('An error occurred: ', err))
}
ipcMain.handle('system:getDeviceType', () => {
return process.platform === 'darwin' ? 'mac' : process.platform === 'win32' ? 'windows' : 'linux'
})
})
registerProtocolClient(app)
// macOS specific: handle protocol when app is already running
app.on('open-url', (event, url) => {
event.preventDefault()
handleProtocolUrl(url)
//start selection assistant service
initSelectionService()
})
registerProtocolClient(app)
@@ -89,6 +145,20 @@ if (!app.requestSingleInstanceLock()) {
app.on('before-quit', () => {
app.isQuitting = true
// quit selection service
if (selectionService) {
selectionService.quit()
}
})
app.on('will-quit', async () => {
// event.preventDefault()
try {
await mcpService.cleanup()
} catch (error) {
Logger.error('Error cleaning up MCP service:', error)
}
})
// In this file you can include the rest of your app"s specific main process

View File

@@ -0,0 +1,14 @@
interface CreateOAuthUrlArgs {
app: string;
}
declare function createOAuthUrl({ app }: CreateOAuthUrlArgs): Promise<string>;
declare function _dont_use_in_prod_createOAuthUrl({ app, }: CreateOAuthUrlArgs): Promise<string>;
interface DecryptSecretArgs {
app: string;
s: string;
}
declare function decryptSecret({ app, s }: DecryptSecretArgs): Promise<string>;
declare function _dont_use_in_prod_decryptSecret({ app, s, }: DecryptSecretArgs): Promise<string>;
export { type CreateOAuthUrlArgs, type DecryptSecretArgs, _dont_use_in_prod_createOAuthUrl, _dont_use_in_prod_decryptSecret, createOAuthUrl, decryptSecret };

Some files were not shown because too many files have changed in this diff Show More