* 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> * 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 * hotfix: enhance reasoning summary handling in OpenAI response processing (#6037) * feat: add zoom factor handling on window restore in WindowService (#6169) Co-authored-by: beyondkmp <beyondkmkp@gmail.com> * Hotfix/gemini-para-bug (#6173) * fix(OpenAIProvider): enhance model support and formatting logic * fix(OpenAIProvider): Gemini OpenAI Compatible * hotfix: respect user-defined model group name (#6174) * feat(settings): add OpenAI alert (#6164) * 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 * 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 "快捷助手" * refactor: remove constructor from KnowledgeQueue and invoke checkAllBases in useAppInit hook * 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> * 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. * fix: update file path resolution in new Electron * 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. * 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> * 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. * chore(version): 1.3.7 * 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> * chore: update Hailuo logo (#6208) * feat: update Hailuo model configuration with new logo property and border option * chore: update hailuo_dark model image * feat: add new model provider BurnCloud * fix(mcp): mcp result preview is missing parameters (#6165) * fix: knowledge icon consistency across components (#6209) feat: knowledge icon consistency across components * 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. * fix: add context menu trigger to FloatingSidebar component * 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. * Revert "feat: add resolveFilePath functionality to resolve restoring from different computer (#5980)" This reverts commit3abe0e803c. * 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. * chore(version): 1.3.8 * 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. * 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 * fix: handle undefined html title (#6229) * fix: improve CodeEditor controlled mode, prevent unnecessary trimming (#6221) * fix: improve CodeEditor controlled mode, prevent unnecessary trimming * fix: useEffect dependency * fix: sse mcp 404 not found * 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 commit7e29d5147c. * 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 commitf4d1454525. * fix: simplify MessageGroup props and utilize context for message selection handling * fix: streamline multi-select handling by consolidating context usage and simplifying component props * 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. * 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. * feat: add Google miniapp * 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. * 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. * fix: topic deletion button covering the text * fix: message content width will exceed the bubble limit in narrow layout mode * fix: settings -> openAI -> summaryText undefined * 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. * fix: topic prompt not working #6226 close #6226 * fix: english serif font rendering issue #6224 close #6224 * chore(version): 1.3.9 * fix: increase the upper limit of issue-management operations-per-run (#6257) * 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 * 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. * 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. * 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. * style: update border color in SearchBarContainer for improved UI consistency * 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. * 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. * 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. * 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. * 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> * 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 * revert: mcp run python (#6151) This reverts commitc468c3cfd5. * refactor: CodePreview fade in on the first highlighting (#6228) * refactor(CodePreview): fade in on the first highlighting * refactor: improve code placeholder style * 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. * 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. * fix: token 取整 (#6300) * 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> * fix: aihubmix provider model proxy rule (#6293) Update AihubmixProvider.ts Co-authored-by: zhaochenxue <zhaochenxue@bixin.cn> * 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> * 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. * chore: upgrade yarn version to v4.9.1 * build: add win-sign script * 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. * fix: handle empty block content in MessageTranslate component * fix: non-streaming reasoning_content (#6308) * fix: non-streaming reasoning_content * fix: streamline reasoning handling in OpenAIProvider * fix: #6301 (#6317) * fix: #6301 * fix: update dependencies in useUpdateHandler and add eslint comment in ContentSearch * 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 * fix: adjusted max-width in McpDescription.tsx * 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. * 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. * feat: toggle MCP servers on the card list (#6232) * feat: Support Claude 4 (#6328) * 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. * chore(version): 1.3.10 * fix: editing user messages is not re-sent; it can only be saved#6327 * feat: support pin topic to the top Signed-off-by: jtsang4 <info@jtsang.me> * fix: minapp search error * 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. * 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> * chore: update electron version to 35.4.0 in package.json and yarn.lock * 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 * 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. * 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. * chore(version): 1.3.11 * chore: disable code signature verification for Windows updates in electron-builder configuration * 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. * fix: floating-sidebar header sticky (#6371) * chore: add dependabot (#6369) * fix: improve multi-select functionality in Messages and SelectionBox components * 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> * feat: 文字生成图新增提供商DMXAPI (#6352) dmxapi文字生成图 Co-authored-by: 亢奋猫 <kangfenmao@qq.com> * 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. * fix: handle optional usage properties in AnthropicProvider (#6418) * fix: ensure args are an array in AddMcpServerModal and MCPService com… (#6413) fix: ensure args are an array in AddMcpServerModal and MCPService components * fix: update dimensions handling in KnowledgeBaseParams (#6417) fix: update dimensions handling in KnowledgeBaseParams and add supported dimension providers * 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> * 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 * 修复DMXAPI文生成画bug * 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. * 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 * fix: enhance web search recognization in AI providers (#6423) * fix: escape special characters in search pattern for improved filtering * 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. * fix: Chinese input issue in AddProviderPopup (#6445) * chore: remove postinstall script from package.json * fix: improve header styling in CustomCollapse component (#6449) * fix: return value from appUpdater.checkForUpdates in IPC handler * 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. * fix: update popup content to improve user interaction in MessageGroup component * fix: change display style of .shiki class to flex for improved layout in CodePreview component * 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. * fix: 修复Nutstore设置中的自动同步状态和错误消息内容 (#6452) - 在NutstoreSettings组件中,添加了设置Nutstore自动同步状态的逻辑。 - 更新NutstoreService中的错误消息内容,确保使用正确的国际化键。 * 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. * 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. * 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 * 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. * chore: remove gitee provider * 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. * chore(version): 1.3.12 * 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. * 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. * 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 * 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 * 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> * fix: cannot run from yarn dev (#6468) * fix[SelectionAssistant]: remove console.log (#6474) fix: remove console.log * feat: integrate custom CSS support in SelectionAssistant * fix: adjust order of tools in CodeToolbar constants for correct display * 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. * 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. * fix(MainTextBlock): adjust whiteSpace style for user role messages (#6501) * 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 * fix: remove tiktoken * chore: remove electron-icon-builder * 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> * 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. * feat: aihubmix painting support imagen (#6525) * add imagen * feat: support imagen model * update proxy notice --------- Co-authored-by: zhaochenxue <zhaochenxue@bixin.cn> * 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. * 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. * feat[SelectionAssistant]: add faq&feedback link (#6531) feat: add FAQ button to Selection Assistant settings * 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> * feat: support system prompt variables (#5995) * feat: support system prompt variables * feat: add tip * fix ci test fail * 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> * 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> * 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. * 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. * fix[SelectionAssistant]: interrupting in terminal apps (#6549) fix: interrupting in terminal apps * fix: add custom parameters to OpenAI generateImageByChat requests * chore(version): 1.4.0-rc.1 * 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. * fix(OpenAIProvider): adjust reasoning effort setting to default to 'medium' when set to 'auto' * 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. * 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. * fix: Repair abnormal line break display * Revert "fix: Repair abnormal line break display" This reverts commit3d7fd5a30c. * fix(HealthCheck): add a disclaimer (#6570) * fix(HealthCheck): add a disclaimer * fix: remove duplicates in zh-tw.json * 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 * fix(style): global cursor style for scrollbar thumb * fix(SvgPreview): dragging and sanitizing (#6568) * fix(SvgPreview): dragging * fix(SvgPreview): sanitize svg content * 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 * fix(PROVIDER_CONFIG): update website URLs from ppinfra.com to ppio.cn * fix(provider): update Qiniu's name and logo, fix gitee typo (#6593) * fix(provider): update Qiniu's name and logo * fix(provider): typo * 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 * refactor(Chat, Messages): simplify maxWidth calculations and remove unused showAssistants variable * refactor(Scrollbar, Chat, Messages): improve scroll handling and clean up component structure * 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. * 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. * feat: 调整分组的效果 (#6561) 1,未分组标签改为未分组 2,列表展示效果持久化 3,增加一个管理列表展示效过的store Co-authored-by: linshuhao <nmnm1996> * 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. * 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. * revert: fix: english serif font rendering issue #6224 This reverts commit5dd508b4f4. * 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. * feat: add "Regenerate" in action window * chore(version): 1.4.0-rc.2 * feat(SelectionAssistant): improve selection in browsers and pdf readers (#6618) fix: improve browsers and pdf readers selection * 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. * fix: setting tab font size * feat: dmxapi generate multiple image (#6632) * chore(version): 1.3.8 * 新增自动添加 * 图片自增功能优化 --------- Co-authored-by: kangfenmao <kangfenmao@qq.com> * refactor(SvgPreview): use shadow dom * test(scrollbar): fix snapshot mismatched * fix(MainTextBlock): update whiteSpace style for user messages to 'pre-wrap' * fix(Messages, WebSearchProviderSetting): remove unused variables and update provider logo styling * lint: fix eslint error and build:check * 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 commit1126a5cce9. * Reapply "fix: update" This reverts commit82b7890f92. * fix: setloading missing * 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> * fix: interrupting in shell and improve pdf readers * fix: The edit button cannot be used after using MCP. 修复对话中使用 MCP 后编辑按钮消失的问题 (#6623) fix: The edit button cannot be used after using MCP. * chore(version): 1.4.0-rc.3 * 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> * feat(SelectionAssistant): predefined apps filter list (#6662) * feat: predefined app blacklist * fix * fix * fix * fix: improve filter list processing in SelectionFilterListModal * chore(version): 1.4.0 * refactor: sort mentioned models in QuickPanel (#6666) * fix(OpenAIProvider): prevent atob error with non-base64 image URLs (#6673) Signed-off-by: Chan Lee <Leetimemp@gmail.com> * fix: replace franc with franc-min for improved performance * fix: provider o3 docs not found * feat(SelectionService): enhance trigger mode handling and update predefined blacklist * fix: adjust sidebar icon margins based on fullscreen state * 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 * fix: token usage not updated after editing message (#6725) fix: update token usage when edit message * fix: qwen3 cannot name a topic (#6722) * fix: qwen3 cannot name a topic * feat: Display error message when topic naming fails * 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> * 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> * hotfix(OpenAIProvider): remove redundant 'unkown' chunk (#6737) fix(OpenAIProvider): remove redundant 'unknown' yield case in chunk processing * hotfix: update qwen3 model identification logic to use startsWith for im… (#6738) fix: update qwen3 model identification logic to use startsWith for improved accuracy * 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> * Fix: outdated provider websites and models (#6766) * fix: inappropriate provider websites (openrouter, grok) * fix: outdated model list (grok) * chore(gitignore): exclude cursor settings (#6779) * fix: prevent message overflow when minimized width (#6775) * refactor(BackupManager, WebDav): streamline WebDAV client initialization and enhance directory listing functionality (#6784) Co-authored-by: beyondkmp <beyondkmkp@gmail.com> * fix(SelectionAssistant): customCSS should not override background (#6746) fix: customCSS should not override background * 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. * fix: chat navigation triggering (#6774) * fix: exclude MessageEditor * fix: more accurate triggering area * fix(ci): Update the nightly-build workflow (#6791) Update the branch name from `develop` to `main` * fix: optimize multilingual display of documents (#6793) Update Sidebar.tsx * fix: correct variable name obsidianVault in Obsidian export (#6796) * fix: transparent window flashing when show (#6755) * fix: avoid SelectionAssistant toolbar flashing * add comments * feat(SelectionAssistant): fullscreen game/presentation mode * 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 * fix(MermaidPreview): debounce mermaid rendering to alleviate flickering (#6675) * hotfix: gemini auto thinking (#6810) * fix(SelectionAssistant): JetBrains IDEs, Remote desktop, Gaming, PDF views, etc (#6809) fix: jetbrains ides, remote desktop, pdf views, etcs * fix: use monospace font for theme colorpicker (#6816) * fix(AnthropicProvider): update usage and metrics handling to prevent TypeError (#6813) * fix: sync active topic after rename (#6804) Co-authored-by: Chen Tao <70054568+eeee0717@users.noreply.github.com> * fix: OpenAI provider api check doesn't handle error (#6769) * 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 * 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> * hotfix: ensure show token usage setting defaults to true (#6828) Hotfix: ensure show token usage setting defaults to true * 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 * 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. * fix: add blank lines between reasoning summary parts (#6827) Co-authored-by: Chen Tao <70054568+eeee0717@users.noreply.github.com> * 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> * feat: optimize UI interface display * 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. * 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 * 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. * chore: remove unused Delete tokenflux_painting_page.md (#6840) Delete tokenflux_painting_page.md * fix: Improve the switching logic in multi-tab state * chore(version): 1.4.1 * 更新版本 * 解决冲突 --------- Signed-off-by: jtsang4 <info@jtsang.me> Signed-off-by: LeeSH <shuhao_lin@fzzixun.com> Signed-off-by: Chan Lee <Leetimemp@gmail.com> Signed-off-by: aprilandjan <merlin.ye@qq.com> Co-authored-by: Morax <100508620+fzlzjerry@users.noreply.github.com> Co-authored-by: 亢奋猫 <kangfenmao@qq.com> Co-authored-by: suyao <sy20010504@gmail.com> Co-authored-by: jwcrystal <121911854+jwcrystal@users.noreply.github.com> Co-authored-by: beyondkmp <beyondkmp@gmail.com> Co-authored-by: beyondkmp <beyondkmkp@gmail.com> Co-authored-by: one <wangan.cs@gmail.com> Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com> Co-authored-by: Wei <huangwei@burncloud.com> Co-authored-by: karl <jialongkou@163.com> Co-authored-by: Zhaker <0x149527@gmail.com> Co-authored-by: George Zhao <georgezhao@SKJLAB> Co-authored-by: LiuVaayne <10231735+vaayne@users.noreply.github.com> Co-authored-by: 自由的世界人 <3196812536@qq.com> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: chenxue <DDU1222@users.noreply.github.com> Co-authored-by: zhaochenxue <zhaochenxue@bixin.cn> Co-authored-by: MyPrototypeWhat <43230886+MyPrototypeWhat@users.noreply.github.com> Co-authored-by: hutchisr <42283663+hutchisr@users.noreply.github.com> Co-authored-by: jtsang4 <info@jtsang.me> Co-authored-by: Caelan <79105826+jin-wang-c@users.noreply.github.com> Co-authored-by: w <772814125@qq.com> Co-authored-by: iola1999 <iola1999@foxmail.com> Co-authored-by: fullex <0xfullex@gmail.com> Co-authored-by: Konv Suu <2583695112@qq.com> Co-authored-by: kanweiwei <kanweiwei@nutstore.net> Co-authored-by: Roland <shlroland1995@gmail.com> Co-authored-by: Teo <cheesen.xu@gmail.com> Co-authored-by: shiquda <czy1847259360@gmail.com> Co-authored-by: purefkh <purefkh@gmail.com> Co-authored-by: nmnmtttt <34001432+nmnmtttt@users.noreply.github.com> Co-authored-by: Lee SH <shuhao_lin@fzzixun.com> Co-authored-by: George Zhao <38124587+CreatorZZY@users.noreply.github.com> Co-authored-by: FunJim <xunjin.zheng@outlook.com> Co-authored-by: stevending1st <stevending1st@163.com> Co-authored-by: Alain <yinxulai@hotmail.com> Co-authored-by: MyPrototypeWhat <daoquqiexing@gmail.com> Co-authored-by: Rudbeckia.hirta.L <83773602@qq.com> Co-authored-by: Doekin <105162544+Doekin@users.noreply.github.com> Co-authored-by: icarus <eurfelux@gmail.com> Co-authored-by: Wang Jiyuan <59059173+EurFelux@users.noreply.github.com> Co-authored-by: May <aprilandjan@users.noreply.github.com> Co-authored-by: Lucas <lucas04@foxmail.com> Co-authored-by: Murphy <69335326+MurphyLo@users.noreply.github.com> Co-authored-by: Chen Tao <70054568+eeee0717@users.noreply.github.com> Co-authored-by: 熊可狸 <me@korin.im> Co-authored-by: George·Dong <98630204+GeorgeDong32@users.noreply.github.com>
174 lines
5.4 KiB
JavaScript
174 lines
5.4 KiB
JavaScript
const fs = require('fs')
|
|
const path = require('path')
|
|
const os = require('os')
|
|
const { execSync } = require('child_process')
|
|
const AdmZip = require('adm-zip')
|
|
const { downloadWithRedirects } = require('./download')
|
|
|
|
// Base URL for downloading bun binaries
|
|
const BUN_RELEASE_BASE_URL = 'https://gitcode.com/CherryHQ/bun/releases/download'
|
|
const DEFAULT_BUN_VERSION = '1.2.9' // Default fallback version
|
|
|
|
// Mapping of platform+arch to binary package name
|
|
const BUN_PACKAGES = {
|
|
'darwin-arm64': 'bun-darwin-aarch64.zip',
|
|
'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',
|
|
// MUSL variants
|
|
'linux-musl-x64': 'bun-linux-x64-musl.zip',
|
|
'linux-musl-x64-baseline': 'bun-linux-x64-musl-baseline.zip',
|
|
'linux-musl-arm64': 'bun-linux-aarch64-musl.zip'
|
|
}
|
|
|
|
/**
|
|
* Downloads and extracts the bun binary for the specified platform and architecture
|
|
* @param {string} platform Platform to download for (e.g., 'darwin', 'win32', 'linux')
|
|
* @param {string} arch Architecture to download for (e.g., 'x64', 'arm64')
|
|
* @param {string} version Version of bun to download
|
|
* @param {boolean} isMusl Whether to use MUSL variant for Linux
|
|
* @param {boolean} isBaseline Whether to use baseline variant
|
|
*/
|
|
async function downloadBunBinary(platform, arch, version = DEFAULT_BUN_VERSION, isMusl = false, isBaseline = false) {
|
|
let platformKey = isMusl ? `${platform}-musl-${arch}` : `${platform}-${arch}`
|
|
if (isBaseline) {
|
|
platformKey += '-baseline'
|
|
}
|
|
const packageName = BUN_PACKAGES[platformKey]
|
|
|
|
if (!packageName) {
|
|
console.error(`No binary available for ${platformKey}`)
|
|
return false
|
|
}
|
|
|
|
// Create output directory structure
|
|
const binDir = path.join(os.homedir(), '.cherrystudio', 'bin')
|
|
// Ensure directories exist
|
|
fs.mkdirSync(binDir, { recursive: true })
|
|
|
|
// Download URL for the specific binary
|
|
const downloadUrl = `${BUN_RELEASE_BASE_URL}/bun-v${version}/${packageName}`
|
|
const tempdir = os.tmpdir()
|
|
// Create a temporary file for the downloaded binary
|
|
const tempFilename = path.join(tempdir, packageName)
|
|
|
|
try {
|
|
console.log(`Downloading bun ${version} for ${platformKey}...`)
|
|
console.log(`URL: ${downloadUrl}`)
|
|
|
|
// Use the new download function
|
|
await downloadWithRedirects(downloadUrl, tempFilename)
|
|
|
|
// Extract the zip file using adm-zip
|
|
console.log(`Extracting ${packageName} to ${binDir}...`)
|
|
const zip = new AdmZip(tempFilename)
|
|
zip.extractAllTo(tempdir, true)
|
|
|
|
// 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)
|
|
|
|
// Set executable permissions for non-Windows platforms
|
|
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}`)
|
|
}
|
|
}
|
|
}
|
|
|
|
// Clean up
|
|
fs.unlinkSync(tempFilename)
|
|
fs.rmSync(sourceDir, { recursive: true })
|
|
|
|
console.log(`Successfully installed bun ${version} for ${platformKey}`)
|
|
return true
|
|
} catch (error) {
|
|
console.error(`Error installing bun for ${platformKey}: ${error.message}`)
|
|
// Clean up temporary file if it exists
|
|
if (fs.existsSync(tempFilename)) {
|
|
fs.unlinkSync(tempFilename)
|
|
}
|
|
|
|
// Check if binDir is empty and remove it if so
|
|
try {
|
|
const files = fs.readdirSync(binDir)
|
|
if (files.length === 0) {
|
|
fs.rmSync(binDir, { recursive: true })
|
|
console.log(`Removed empty directory: ${binDir}`)
|
|
}
|
|
} catch (cleanupError) {
|
|
console.warn(`Warning: Failed to clean up directory: ${cleanupError.message}`)
|
|
}
|
|
|
|
return false
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Detects current platform and architecture
|
|
*/
|
|
function detectPlatformAndArch() {
|
|
const platform = os.platform()
|
|
const arch = os.arch()
|
|
const isMusl = platform === 'linux' && detectIsMusl()
|
|
const isBaseline = platform === 'win32'
|
|
|
|
return { platform, arch, isMusl, isBaseline }
|
|
}
|
|
|
|
/**
|
|
* Attempts to detect if running on MUSL libc
|
|
*/
|
|
function detectIsMusl() {
|
|
try {
|
|
// Simple check for Alpine Linux which uses MUSL
|
|
const output = execSync('cat /etc/os-release').toString()
|
|
return output.toLowerCase().includes('alpine')
|
|
} catch (error) {
|
|
return false
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Main function to install bun
|
|
*/
|
|
async function installBun() {
|
|
// Get the latest version if no specific version is provided
|
|
const version = DEFAULT_BUN_VERSION
|
|
console.log(`Using bun version: ${version}`)
|
|
|
|
const { platform, arch, isMusl, isBaseline } = detectPlatformAndArch()
|
|
|
|
console.log(
|
|
`Installing bun ${version} for ${platform}-${arch}${isMusl ? ' (MUSL)' : ''}${isBaseline ? ' (baseline)' : ''}...`
|
|
)
|
|
|
|
await downloadBunBinary(platform, arch, version, isMusl, isBaseline)
|
|
}
|
|
|
|
// Run the installation
|
|
installBun()
|
|
.then(() => {
|
|
console.log('Installation successful')
|
|
process.exit(0)
|
|
})
|
|
.catch((error) => {
|
|
console.error('Installation failed:', error)
|
|
process.exit(1)
|
|
})
|