* refactor: migrate showWorkspace setting from global settings to notes module
- Move showWorkspace state from settings store to notes store for better module cohesion
- Add useShowWorkspace hook in useNotesSettings for consistent access pattern
- Add smooth animation for workspace panel show/hide transition
- Relocate save to notes action to message toolbar for better accessibility
- Add migration v146 to handle state migration for existing users
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: cli lint error
* feat: add open outside menu
* fix: hooks error
* Update useShowWorkspace.ts
* fix: update icon import in NotesSidebarHeader component
- Replaced FilePlus icon with FilePlus2 in the NotesSidebarHeader for consistency with the latest icon set.
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: suyao <sy20010504@gmail.com>
- Removed hardcoded external dependencies and replaced them with dynamic extraction from package.json.
- Cleaned up the configuration for better maintainability and flexibility in managing dependencies.
- Introduced a new translation key 'invalid_model' in English, Japanese, Russian, Chinese (Simplified and Traditional), Greek, Spanish, French, and Portuguese.
- Updated the SelectModelButton component to display an error tag when no valid provider is found, enhancing user feedback.
- Updated getProviderByModel function to improve provider selection.
- Added fallback logic to return a default or cherryin provider if the specified model provider is not found.
- Ensured that the first provider is returned as a last resort, enhancing robustness in provider retrieval.
* feat: integrate file selection and upload functionality in KnowledgeFiles component
- Added useFiles hook to manage file selection.
- Updated handleAddFile to utilize the new file selection logic, allowing multiple file uploads.
- Improved user experience by handling file uploads asynchronously and logging the results.
* feat: enhance file upload interaction in KnowledgeFiles component
- Wrapped Dragger component in a div to allow for custom click handling.
- Prevented default click behavior to improve user experience when adding files.
- Maintained existing file upload functionality while enhancing the UI interaction.
* refactor(KnowledgeFiles): 提取文件处理逻辑到独立函数
将重复的文件上传和处理逻辑提取到独立的processFiles函数中,提高代码复用性和可维护性
---------
Co-authored-by: icarus <eurfelux@gmail.com>
* refactor(dnd): rename idKey to itemKey for clarity
* refactor: key and id type for draggable lists
* chore: update yarn lock
* fix: type error
* refactor: improve getId fallbacks
- Added support for TypeScript incremental builds by enabling the `incremental` option and specifying the `tsBuildInfoFile` in both `tsconfig.node.json` and `tsconfig.web.json`.
- Updated the `typecheck` script in `package.json` to use `concurrently` for running node and web type checks in parallel.
- Added `.tsbuildinfo` to `.gitignore` to prevent build info files from being tracked.
chore: update electron.vite.config.ts and yarn.lock for dependency management
- Added additional external dependencies in electron.vite.config.ts to improve build configuration.
- Updated multiple package versions in yarn.lock, including @napi-rs/wasm-runtime, @oxc-project/runtime, and @rolldown packages to their latest beta versions for better compatibility and performance.
- Adjusted fdir and picomatch versions to ensure alignment with the latest features and fixes.
* refactor(ocr): streamline OCR service registration and improve image preprocessing
- Simplified the registration of the system OCR service by removing the conditional check for Linux.
- Updated SystemOcrService to directly import necessary modules, enhancing clarity.
- Refactored image preprocessing to use a static import of the 'sharp' library for better performance.
* add patch for system-ocr
* add patch
* add patch again
* add patch
* delete setting
* delete i18n
* lint error
* add isLinux
* Revert "delete i18n"
This reverts commit 173e65bbd0.
* Revert "delete setting"
This reverts commit de39c76f83.
* fix: add system check for error message
---------
Co-authored-by: icarus <eurfelux@gmail.com>
* feat(chat/input): allow sending during streaming; remove loading guard
- Inputbar: drop loading check; keep Send clickable; right-click to pause
- Message/MessageMenubar: render menubar even while streaming
- Minor cleanup of unused imports and lints
* feat(chat/menubar): one-click regenerate (remove confirm); add empty-context fallback
- MessageMenubar: remove Popconfirm; click to regenerate
- ApiService: ensure last user message is included if filters empty (avoid messages=[])
- Minor cleanup
* feat(chat/ui): decouple generation from sending; enable actions during streaming
- MessageGroupMenuBar: add “Retry all” (ReloadOutlined) to retry errored/empty/no-block replies; tooltip via i18n
- Context fallback: always include last user message in both messageThunk and ApiService
- i18n: add message.group.retry_failed (zh-CN, en-US, ja-JP, ru-RU, zh-TW)
- Cleanup: remove unused imports; fix lints
* feat(chat/settings): Add confirmation settings for message actions
- Add "Confirm before deleting message" and "Confirm before regenerating message" options to the settings page, allowing users to customize action confirmations.
- Update internationalization files to support multi-language prompt messages.
- Modify the message menu bar to integrate the confirmation logic, enhancing the user experience.
* fix(chat/ui): Apply regeneration confirmation to user messages
Previously, the "Regenerate" action on user messages would trigger immediately, bypassing the `confirmRegenerateMessage` setting. This behavior was inconsistent with the regeneration logic for assistant messages, which correctly showed a confirmation dialog.
This commit wraps the user message's regenerate button in a `Popconfirm` component, conditioned on the `confirmRegenerateMessage` setting. This aligns its behavior with the existing logic for assistant messages.
Now, all regeneration actions are uniformly governed by the user's confirmation preference, creating a more consistent and predictable user experience.
* fix(ui): Only show 'Retry failed' button when errors exist
fix(ui): Conditionally render the 'Retry failed' button
The 'Retry failed messages' button in the message group menu bar was previously always visible, even when no messages had failed.
- The 'Retry failed' button is now conditionally rendered and will only appear if one or more messages in the group meet the failure criteria.
* feat(chat/ui): Add dedicated button to pause message generation
Replaced the undiscoverable right-click-to-pause functionality on the send button with a dedicated, visible "Pause" button. This new button only appears during message generation, making the action intuitive and accessible.
- Removed `onPause` and context menu logic from `SendMessageButton`.
- Added a conditional `CirclePause` button to the `Inputbar` when loading.
* feat(settings/migrate): initialize confirm message flags for legacy users
- Add migration 138 to default confirmDeleteMessage/confirmRegenerateMessage
- No behavior change for fresh installs (uses initialState)
fix(format): correct indentation in MessageMenubar
fix(settings/migrate): fix persistedReducer verison
* fix(ui): resolve React Hook dependency warnings
- Remove unnecessary `topic.prompt` dependencies from Message components
- Remove `loading` dependency from Inputbar useCallback
Resolves ESLint exhaustive-deps warnings and conflicts
---------
Co-authored-by: n2yt584v2t4nh7y <117180266+n2yt584v2t4nh7y@users.noreply.github.com>
- Updated CLAUDE_OFFICIAL_SUPPORTED_PROVIDERS to include 'modelscope'.
- Added API base URL configuration for 'modelscope' under the anthropic provider settings.
- Eliminated the showTokens state and its associated actions from the settings management.
- Updated MessageTokens component to directly display token usage without relying on showTokens.
- Adjusted migration logic to remove default showTokens setting during state initialization.
- Consolidated vision and function calling model definitions into a more structured format.
- Introduced dedicated image generation model checks in the Inputbar component.
- Removed deprecated model checks and updated related logic in ApiService.
- Added new TEXT_TO_IMAGES_MODELS configuration for better image model management.
- Enhanced overall model type handling for improved clarity and maintainability.
- Added conditional registration of the system OCR service for non-Linux platforms.
- Updated SystemOcrService to handle Linux by returning an empty text response.
- Modified image preprocessing to dynamically require the 'sharp' library, improving compatibility and performance.
- Included additional files in the electron-builder configuration for packaging.
- Added the "supported_providers" translation key to English, Japanese, Russian, Simplified Chinese, and Traditional Chinese locale files.
- Updated CodeToolsPage to display a popover with supported providers when the Claude Code model is selected, improving user experience and accessibility of provider information.
- Introduced a new styled component for provider logos to enhance visual representation.
* refactor: replace afterPack script with beforePack and remove after-pack.js file
- Updated electron-builder configuration to use beforePack instead of afterPack.
- Removed the after-pack.js script as its functionality is no longer needed.
* refactor: streamline filter logic for architecture-specific packages in before-pack script
- Consolidated platform-specific filter conditions for arm64 and x64 architectures.
- Improved readability and maintainability by using arrays to manage filters for different architectures.
- Ensured that the correct filters are applied based on the architecture during the packaging process.
* chore: remove npm build commands from CI workflows
- Eliminated unnecessary `yarn build:npm` commands from the nightly build and release workflows for Linux, macOS, and Windows.
- Streamlined the build process by focusing on platform-specific build commands.
* delete build npm
* refactor: enhance architecture-specific package management in before-pack script
- Updated the before-pack script to include additional architecture-specific packages for arm64 and x64.
- Improved the organization of package filters and streamlined the logic for handling different architectures during the packaging process.
- Ensured that the correct filters are applied based on the architecture, enhancing the build process for various platforms.
* docs: clarify comment on prebuild binaries in before-pack script
* format code
* chore: add afterPack script to electron-builder configuration
- Included afterPack script in electron-builder.yml to enhance the packaging process.
- This addition allows for post-packaging tasks to be executed, improving build automation.
* chore: update macOS entitlements to disable library validation
- Added the key `com.apple.security.cs.disable-library-validation` to the entitlements file to enhance security settings for macOS builds.
* chore: remove unused package for win32 arm64 architecture
- Deleted the `@strongtz/win32-arm64-msvc` package from `package.json` and `yarn.lock` as it is no longer needed.
- Updated the `before-pack.js` script to improve architecture-specific package management by refining filter logic and ensuring correct package downloads based on architecture.
- Enhanced the `downloadNpmPackage` function to use Node.js streams for downloading and extracting packages, improving efficiency and error handling.
* feat: add html-tags and htmlparser2 dependencies; enhance CodeViewer and RichEditor components
* fix(NotesPage): prevent unnecessary state clearing when notesTree is empty
* feat(NotesPage): enhance note saving functionality to include file path management
* style: refine button and border styles across components for improved aesthetics
- Updated ToolbarButton styles to simplify background and hover effects.
- Adjusted border styles in NotesEditor, NotesSidebar, and NotesSidebarHeader for a more consistent look.
- Enhanced overall UI by reducing border thickness in various components.
* style: add bottom spacer to richtext component for improved viewport padding
* style: ensure drag handles and plus buttons are interactive in richtext component
* feat(RichEditor): add conditional focus behavior based on text length in rich editor
---------
Co-authored-by: kangfenmao <kangfenmao@qq.com>
- Adjust image block margin from 10px to 1em for better consistency
- Fix single vs multi-image display logic with proper layout
- Update ImageBlock component to handle single/multi display modes
- Fix image model detection logic for better compatibility
- Improve overall spacing between content blocks
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-authored-by: Claude <noreply@anthropic.com>
- Implemented downloading of architecture-specific versions of the @napi-rs/system-ocr packages for macOS and Windows platforms in build-npm.js.
- Updated after-pack.js to retain these packages during the packaging process, ensuring compatibility across different architectures.
* feat: enhance note saving functionality with immediate cache invalidation
* fix: improve file name handling and localization updates
* feat: implement multi-level note sorting and enhance state management
- Introduced sorting options for notes by name, update time, and creation time, allowing users to sort notes in ascending and descending order.
- Updated NotesPage and NotesSidebar components to handle sorting functionality.
- Enhanced Redux store to manage the sorting type, improving state management for note organization.
- Refactored related services to support recursive sorting logic, ensuring a consistent user experience.
* feat(i18n): add new file upload messages for multiple languages
* fix(styles): adjust padding in richtext.scss to accommodate scrollbar
* style(NotesSidebar): add border-top-left-radius to enhance sidebar aesthetics
* feat(RichEditPopup): add isFullWidth prop to enhance popup layout
* feat(RichEditPopup): disable keyboard interaction for improved user experience
* feat(NotesPage): integrate sorting after node deletion and movement
- Added sorting functionality to be triggered after deleting or moving nodes, ensuring notes are organized immediately.
- Updated dependencies in useCallback hooks to include sortType for consistent behavior across operations.
* feat(NotesService): update initWorkSpace and sortAllLevels to accept sortType
- Modified initWorkSpace to include sortType for improved note organization during initialization.
- Enhanced sortAllLevels to optionally accept a tree parameter, allowing for more flexible sorting operations.
- Updated NotesPage to utilize the new parameters, ensuring consistent sorting behavior across various actions.
* feat(NotesSidebar): implement in-place editing for note renaming
- Introduced a new hook, useInPlaceEdit, to manage in-place editing of note names, enhancing user experience during renaming.
- Updated the NotesSidebar component to utilize this hook, streamlining the editing process and improving state management.
- Removed redundant state variables related to editing, simplifying the component's logic.
* refactor(NotesPage): remove commented code for clarity
- Removed a comment regarding folder selection behavior to streamline the code and improve readability.
- This change does not affect functionality but enhances the overall code quality.
* feat(NotesSettings): update initWorkSpace to include default sort type
- Modified initWorkSpace calls in NotesSettings to accept a default sort type of 'sort_a2z', ensuring consistent note organization during path updates and resets.
- This change enhances the initialization process by applying a predefined sorting method.
* fix: initialize notes path on app startup to resolve missing default directory
- Add notes path initialization in store persistStore callback after rehydration
- Update NotesSettings to sync tempPath when notesPath changes from initialization
- Ensure notes directory is set even when user doesn't visit NotesPage first
- Fixes issue where notes path was empty after data reset until NotesPage visit
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Update NotesSettings.tsx
---------
Co-authored-by: Claude <noreply@anthropic.com>
- Added support for downloading and retaining architecture-specific versions of the `@img/sharp` and `@img/sharp-libvips` packages for macOS, Linux, and Windows platforms.
- Removed the deprecated function for deleting macOS-only packages, streamlining the package management process.
- Updated the `after-pack.js` and `build-npm.js` scripts to ensure proper handling of image processing dependencies across different architectures.
- Update version to 1.5.8-rc.1
- Update release notes with latest features and fixes
🤖 Generated with Claude Code
https://claude.ai/code
Co-Authored-By: Claude <noreply@anthropic.com>
* feat: integrate rich text editing
- Replaced the TextEditPopup with RichEditPopup for adding and editing notes, enhancing the editing experience with rich text capabilities.
- Updated note previews to display HTML content appropriately, improving usability and visual representation.
- Added a styled component for note previews to enhance user interaction.
* feat(RichEditor): enhance rich text editing capabilities
- Added new command system for rich text editing, allowing users to execute commands like headings, lists, and formatting.
- Integrated drag handle functionality for better content manipulation within the editor.
- Updated toolbar to include additional formatting options such as strikethrough and code blocks.
- Improved markdown and HTML content handling, enabling seamless conversion and previewing.
- Introduced new utility functions for markdown conversion and sanitization.
- Added tests for command list popover and rich editor functionalities to ensure reliability.
* refactor(RichEditor): remove debug log from command suggestion
* feat(RichEditor): add link and unlink functionality
- Introduced link and unlink commands in the RichEditor toolbar, enhancing text formatting capabilities.
- Updated placeholder text for the RichEditor to provide clearer user guidance.
- Refactored styles and removed unused code to streamline the RichEditor component.
- Added internationalization support for new toolbar items and placeholder text in both English and Chinese.
* wip: custom codeblock
* feat: add new dependencies for markdown processing
- Introduced `he` for HTML entity decoding and `striptags` for stripping HTML tags in markdown conversion.
- Updated `package.json` and `yarn.lock` to include new type definitions and library versions.
* feat(RichEditor): enhance image and math input capabilities
- Added ImageUploader component for embedding images with URL support and drag-and-drop functionality.
- Introduced MathInputDialog for entering LaTeX formulas, allowing real-time updates and integration with the editor.
- Enhanced RichEditor toolbar with new commands for image and math insertion.
- Updated styles for better user experience and accessibility.
- Added internationalization support for new features in multiple languages.
* refactor(CodeBlockView): change export to local variable
- Changed the export of CodeHeader to a local variable within CodeBlockView.
- Removed unused export from code-block-shiki index file.
* feat(RichEditor): enhance command management and toolbar functionality
- Added support for disabling specific commands in the RichEditPopup.
- Implemented dynamic command registration and management in the RichEditor, allowing for initial commands to be registered on mount.
- Updated toolbar to dynamically generate items based on command groups, improving organization and accessibility.
- Introduced new command definitions for text formatting, including bold, italic, underline, and strikethrough, with toolbar visibility options.
- Enhanced command handling capabilities, including the ability to unregister commands and set their availability based on editor context.
* refactor(RichEditPopup): remove translation functionality and related components
- Eliminated translation handling logic, including the translate button and associated state management.
- Cleaned up imports and unused variables to streamline the RichEditPopup component.
- Simplified the content change handling by focusing solely on rich content management.
* feat(ImageUploader): enhance image upload functionality and styling
- Added custom image upload button with improved styling and theme support.
- Refactored image display logic to use a more flexible layout.
- Updated file acceptance criteria to restrict uploads to PNG and JPEG formats.
- Simplified the upload process by preventing default behavior and customizing request handling.
- Improved overall component structure and styling for better user experience.
* feat(AssistantPromptSettings): implement throttled update functionality and enhance UI
- Introduced throttling for the update function to improve performance and reduce unnecessary updates.
- Added a save button to the UI for manual saving of changes, enhancing user experience.
- Refactored the component to streamline the handling of emoji selection and markdown changes.
- Updated layout with Flex component for better alignment of buttons in the settings interface.
* feat(RichEditor): integrate internationalization for placeholder text
- Updated the placeholder property to utilize the i18next translation function, enhancing support for multiple languages.
- Improved user experience by providing localized placeholder text in the RichEditor component.
* fix(styles): update list styles for ordered and unordered lists in richtext.scss
- Removed default list style for ordered lists and added decimal style.
- Added disc style for unordered lists to enhance visual consistency.
* fix(styles): improve table cell background handling in richtext.scss
- Added !important to header background color to ensure consistency.
- Set table cell backgrounds to transparent to prevent inheritance issues during drag operations.
- Updated ProseMirror widget styles to maintain transparency for table cells.
- Enhanced overall table styling to improve user experience.
* fix(styles): update padding and overflow handling in RichEditor
- Increased padding in the tiptap class for improved spacing.
- Modified overflow-x property in EditorContent to allow horizontal scrolling, preventing the drag handle from being cut off.
- Ensured proper positioning and visibility of the drag handle with updated styles.
- Adjusted ProseMirror editor content to maintain drag handle positioning.
* refactor(CodeBlockNodeView, shikijsPlugin): improve language handling for code blocks
- Updated language options to ensure 'text' is always available.
- Introduced a set of languages to skip syntax highlighting, enhancing performance and user experience.
- Simplified logic for checking loaded languages, avoiding unnecessary fallbacks for unsupported languages.
* fix(RichEditor): improve link handling and selection behavior
- Enhanced link insertion logic to ensure the entire paragraph is selected when creating a link.
- Added error handling to toggle link state if selection fails.
- Cleaned up code by moving paragraph text retrieval to the appropriate location for better readability.
* fix(styles): update inline code background and text colors in color.scss
- Changed inline code background color to a solid value for better visibility.
- Updated inline code text color to use RGB format for consistency.
* refactor(RichEditor): simplify editable state management and improve UI interactions
- Removed the disabled prop from RichEditor, simplifying the editable state logic.
- Updated the useRichEditor hook to directly manage the editable state based on the editable prop.
- Enhanced the AssistantPromptSettings component by streamlining the RichEditor rendering logic and improving the save button functionality.
* chore(tests): move useRichEditor test suite
* refactor(RichEditor): enhance command handling and UI responsiveness
- Removed the 'unlink' command from the command list and toolbar for a cleaner interface.
- Improved command filtering logic by removing the maxResults limit.
- Updated command positioning to use fixed strategy with enhanced middleware for better responsiveness.
- Integrated a dynamic virtual list for command suggestions, improving performance and user experience.
- Added internationalization support for 'undo' and 'redo' commands in multiple languages.
* fix(styles): adjust strong tag styling in richtext.scss
- Updated the strong tag styling to apply font-weight to all child elements, ensuring consistent text formatting within rich text content.
* fix(RichEditor): prevent codeBlock nodes from being skipped during drag operations
- Updated the placeholder extension to check for drag operations, ensuring that codeBlock nodes are not skipped when dragging is in progress. This improves the user experience by maintaining expected behavior during content manipulation.
* feat(markdown): integrate turndown-plugin-gfm for enhanced markdown support
- Added turndown-plugin-gfm to enable support for tables and additional markdown features.
- Updated the markdown converter to include new rules for underlining and table elements.
- Enhanced HTML sanitization to allow table-related attributes, improving markdown conversion accuracy.
* feat(markdown): add task list support and enhance markdown conversion
- Integrated @rxliuli/markdown-it-task-lists for task list functionality in markdown.
- Updated markdown converter to handle task list syntax, converting it to appropriate HTML structure.
- Enhanced styles for task lists in richtext.scss to improve visual representation.
- Modified useRichEditor to include task list extensions, ensuring proper functionality within the editor.
* fix(styles): update table header styling in richtext.scss
- Modified table header styling to apply background color and font weight to all child elements, ensuring consistent formatting within tables.
* fix(styles): enhance strong tag styling in richtext.scss
- Added styling for the strong tag to ensure consistent font-weight application across all child elements, improving text formatting in rich text content.
* refactor(markdown): remove @rxliuli/markdown-it-task-lists and implement custom task list plugin
- Removed dependency on @rxliuli/markdown-it-task-lists and integrated a custom task list plugin for markdown-it.
- Enhanced markdown conversion to support task lists with improved HTML structure and sanitization.
- Updated tests to validate task list functionality and ensure proper conversion between markdown and HTML.
* refactor(tests): remove redundant task item label test from markdownConverter tests
- Deleted the test case that checked for the absence of label wrapping around task items, as it is no longer relevant with the updated markdown conversion logic.
- Ensured that existing tests continue to validate the preservation of labels in sanitized HTML for task lists.
* feat(extension-table-plus): add new table extension for Tiptap
- Introduced the @cherrystudio/extension-table-plus package, providing a comprehensive table extension for Tiptap.
- Implemented core functionalities including table, table cell, header, and row management.
- Enhanced the editor with a TableKit for easier table manipulation and integration.
- Updated styles for improved table presentation and interaction within the rich text editor.
- Modified useRichEditor to utilize the new TableKit, ensuring seamless integration with existing features.
* chore(package): remove @tiptap/extension-table dependency
- Deleted the @tiptap/extension-table from package.json and yarn.lock as it is no longer needed.
- Updated dependency management to streamline the project and reduce unnecessary packages.
* chore(package): update package.json for @cherrystudio/extension-table-plus
- Changed the description to reflect the forked nature of the extension.
- Downgraded the version to 3.0.10 to align with the new release strategy.
- Updated the homepage URL to point to the new project site.
- Modified the repository URL to reflect the new GitHub location and directory structure.
* chore(package): update @cherrystudio/extension-table-plus version in package.json
- Changed the version of @cherrystudio/extension-table-plus from workspace:* to ^3.0.10 to align with the new release strategy.
* chore(yarn): update @cherrystudio/extension-table-plus version in yarn.lock
- Changed the version of @cherrystudio/extension-table-plus from workspace:* to npm:^3.0.10 to align with the updated package management strategy.
* chore(useRichEditor): clean up comments and improve code clarity
* chore(package): update @cherrystudio/extension-table-plus version to workspace:^ in package.json and yarn.lock
- Changed the version of @cherrystudio/extension-table-plus from ^3.0.10 to workspace:^ to align with the updated package management strategy.
* chore(tsconfig): add path mapping for @cherrystudio/extension-table-plus in tsconfig.web.json
- Updated tsconfig.web.json to include path mapping for the @cherrystudio/extension-table-plus package, enhancing module resolution for TypeScript.
* chore(dependencies): update ESLint and Prettier configurations
- Added ESLint and Prettier as development dependencies in package.json and yarn.lock.
- Updated lint script to format code and fix issues automatically.
- Enhanced type safety by specifying Node type in TableKit extension.
* fix(deleteTableWhenAllCellsSelected): ensure function returns true after cell count check
- Updated the deleteTableWhenAllCellsSelected function to return true after counting selected table cells, improving the logic for table deletion when all cells are selected.
* chore(electron.config): add path mapping for @cherrystudio/extension-table-plus
- Updated electron.vite.config.ts to include path mapping for the @cherrystudio/extension-table-plus package, improving module resolution for Electron builds.
* refactor(table-cell): rename allowNestedTables to allowNestedNodes and update content type
- Changed the TableCell option from allowNestedTables to allowNestedNodes for clarity on nested node support.
- Updated content type in TableCell and TableHeader from 'block+' to 'paragraph+' to better reflect intended structure.
- Adjusted logic in Table to disallow inserting tables inside nested nodes based on the new option.
* fix: math block bug
* feat(richEditor): add inline and block math commands with updated toolbar support
- Introduced 'inlineMath' and 'blockMath' commands for inserting inline and block mathematical formulas.
- Updated the toolbar to include new commands and their respective tooltips.
- Enhanced the math input dialog to handle both inline and block math types.
- Adjusted markdown conversion to support new math syntax for inline and block math.
- Updated localization files to include translations for new commands.
* feat(table-cell): add cell selection styling and decorations
- Implemented a new plugin for cell selection styling in table cells.
- Added logic to create decorations for selected cells, enhancing visual feedback.
- Updated CSS to style selected cells with borders based on selection edges.
* feat(table): enhance table action handling with new row/column action triggers
- Added optional callbacks for row and column action triggers in TableOptions.
- Implemented row and column action buttons in TableView, allowing for dynamic actions on selected rows and columns.
- Introduced utility functions for calculating cell selection bounds and element border widths.
- Updated styles to accommodate new action buttons and ensure proper positioning.
- Integrated action menu in RichEditor for managing table actions, enhancing user interaction.
* feat(table): enhance table action menu and localization support
- Updated TableOptions to include optional position parameters for row and column action callbacks.
- Refactored TableView to utilize new action callbacks for row and column actions, improving interaction.
- Integrated ActionMenu in RichEditor for better management of table actions, replacing the previous event-based approach.
- Added localization strings for new table action commands in multiple languages, enhancing user accessibility.
* feat(richEditor): update table action icons for improved clarity
- Replaced icons for row insertion actions in the table action menu, using ArrowUp for inserting a row before and ArrowDown for inserting a row after.
- Enhanced visual representation of table actions to better align with user expectations.
* chore(package): bump version to 3.0.11 for @cherrystudio/extension-table-plus
* feat(richtext): enhance table cell styling and resize handle functionality
- Added styles for text overflow handling in table cells to improve readability.
- Introduced a column resize handle with specific positioning and visibility rules.
- Updated the RichEditor to support resizable tables, enhancing user interaction with table elements.
* fix: auto scroll to incomplete command list
* fix: cli
* feat: add MdiDragHandle icon and update RichEditor to use it
- Introduced a new MdiDragHandle SVG icon in the SVGIcon component.
- Replaced the MdiLightbulbOn icon with MdiDragHandle in the RichEditor component for improved functionality.
* feat(RichEditor): add onPaste callback for handling paste events
- Introduced an onPaste callback in both RichEditorProps and UseRichEditorOptions interfaces to allow custom handling of paste events.
- Implemented paste event handling in the useRichEditor hook, converting pasted text to HTML and dispatching it to the editor.
* feat(markdownConverter): extend allowed attributes for HTML sanitization
- Added 'width', 'height', and 'loading' to the list of allowed attributes in the sanitizeHtml function to enhance HTML sanitization capabilities.
* refactor(richtext): update paragraph and heading styles for improved layout
- Removed default margins from paragraphs and adjusted margins for headings to enhance spacing.
- Updated font sizes for headings to improve hierarchy and readability.
- Enhanced blockquote styling with a new border color and italic font style.
- Added specific margin rules for the first and last paragraphs to ensure consistent spacing.
* style(richtext): adjust margins for headings and paragraphs
- Updated heading margins from 'em' to 'rem' for consistency.
- Modified paragraph margins to improve spacing and readability.
- Removed redundant margin rules for first and last paragraphs.
* feat(AssistantPromptSettings): implement draft prompt handling for improved token estimation
- Introduced a draftPrompt ref to manage prompt changes before committing.
- Updated token count estimation to use the draft prompt instead of the current prompt.
- Enhanced the onUpdate function to commit the draft prompt when saving changes.
- Modified handleMarkdownChange to update the draft prompt directly.
* refactor(RichEditor): optimize command handling with useCallback
- Refactored the handleCommand function to use useCallback for improved performance.
- Cleaned up the command handling logic for better readability and maintainability.
- Ensured consistent behavior for link handling and other formatting commands.
* style(richtext): reorganize list styles and enhance task item appearance
- Moved list styles for unordered and ordered lists to a new section for better organization.
- Ensured consistent padding and margin for list items.
- Updated task item styles to improve visual clarity, including checked checkbox appearance.
- Adjusted paragraph margins within list items for improved readability.
* feat(richtext): add table of contents support in RichEditor
- Introduced a new table of contents extension to enhance document navigation.
- Updated RichEditor component to conditionally render the table of contents based on the new `showTableOfContents` prop.
- Integrated table of contents functionality within the useRichEditor hook, allowing for dynamic updates based on document structure.
- Styled the table of contents for improved visibility and usability.
- Updated package.json and yarn.lock to include the new @tiptap/extension-table-of-contents dependency.
* feat(richtext): enhance RichEditor with content search functionality
- Added `enableContentSearch` prop to RichEditor for in-editor content search.
- Integrated ContentSearch component, allowing users to search within the editor.
- Introduced `showUserToggle` and `positionMode` props for ContentSearch customization.
- Updated styling for Container and SearchBarContainer to support new positioning options.
- Adjusted RichEditor settings in AssistantPromptSettings to reflect new content search feature.
* fix: renderer
* fix: styles
* fix: code styles
* fix: table save
* styles: a link
* feat: link editor
* perf: don't show when editable equals to false
* chore: remove some log
* feat: link remove
* style: reduce space for nested list
* fix/link
* feat: add PlusButton to RichEditor and adjust padding in richtext styles
* style: increase font size in richtext styles
* feat: add task list functionality to RichEditor with toolbar integration and localization support
* feat: enhance math dialog positioning and toolbar integration in RichEditor
* feat: enhance Table of Contents functionality with dynamic item display and scroll behavior
* feat: enhance markdown rendering by properly escaping HTML entities in code blocks and inline code
* feat: update link handling in RichEditor to use enhancedLink functionality and auto-update href based on text content
* feat: improve link hover functionality in RichEditor by calculating position based on full link range
* refactor: remove unused MdiDragHandle component from SVGIcon
* fix: update markdown conversion tests to ensure proper HTML output for line breaks and code blocks
* feat: enhance RichEditor functionality by adding code block handling for paste events and keyboard shortcuts for indentation
* feat: enhance code block language options in RichEditor by dynamically loading available languages from Shiki
* feat: update math syntax handling in RichEditor and markdown converter to use $$ for block and inline math
* feat: allow mathPlaceholder node to accept block content in EnhancedMath extension
* feat: improve paste handling in RichEditor by conditionally cleaning HTML based on cursor position and paragraph state
* fix: correct HTML cleaning logic in RichEditor to remove only outer paragraph tags during content insertion
* feat: enhance markdown conversion to support LaTeX in table cells and improve escaping logic
* fix: enhance link hover positioning in RichEditor to account for document boundaries and improve accuracy near the end of the document
* feat: add note book feature (#8234)
* feat: add notes feature with sidebar integration
Introduces a new Notes page and integrates it into the sidebar and routing. Updates sidebar icon types, default icons, and migration logic to support the new 'notes' icon. Adds initial types for notes and folders, and provides a basic NotesPage component. Also updates Chinese locale for notes.
* feat: add notes feature with sidebar, editor, and storage
Introduces a full notes management feature, including a sidebar for folders and notes, a markdown editor using Vditor, and persistent storage of the notes tree. Adds new components (NotesNavbar, NotesSidebar), a NotesService utility for CRUD operations, and updates settings and migration logic to support workspace visibility. Also updates Chinese i18n for notes, and refines the notes type definition.
* feat: enhance notes functionality with auto-save and file name synchronization
* feat: add export to Notes feature
Introduced the ability to export messages and topics to the Notes workspace. Updated UI components, i18n strings, settings, migration logic, and export utilities to support the new export option.
* fix: merge main branch error
* fix: build check error
* Update src/renderer/src/utils/export.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/renderer/src/utils/export.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/renderer/src/App.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/renderer/src/pages/home/Tabs/TopicsTab.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/renderer/src/pages/notes/NotesPage.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Revert "Update src/renderer/src/pages/notes/NotesPage.tsx"
This reverts commit a1b9c5a5b0.
* Merge branch 'feat/richeditor' into feat-note
* wip: read markdown
* wip: markdown content save
* fix: content save
* feat: add context menu to notes sidebar and loading state
Implemented a right-click context menu for notes in the sidebar, including options to rename, star, export to knowledge base, and delete notes. Added a loading spinner to NotesPage when loading note content. Updated i18n labels and Chinese translations for new features.
* Enable exporting notes to knowledge base
Added support for exporting individual notes to the knowledge base via a popup. Updated SaveToKnowledgePopup to handle notes, adjusted UI logic for note export, and added relevant i18n strings for export actions and feedback in all supported languages. NotesSidebar now provides an export option in the note context menu.
* Add favorite notes feature to notes sidebar
Introduces the ability to mark notes as favorites and view only starred notes in the sidebar. Updates i18n translations for related labels in all supported languages. Implements UI controls for toggling favorite status and switching between all notes and starred notes view.
* Refactor notes export and update UI labels
Moved NotesService to a shared services directory and updated all imports. Replaced the notes export menu option with a direct 'Save to Notes' action in message and topic menus. Updated i18n labels for 'Save to Notes' in multiple languages and removed the notes export toggle from settings. Cleaned up related migration logic and improved code organization.
* Add drag-and-drop Markdown note upload
Implemented drag-and-drop file upload in NotesSidebar, allowing users to upload Markdown (.md) files directly to notes. Added internationalized messages for upload success, failure, and file type restrictions. Updated NotesService with uploadNote method to handle file storage and tree updates.
* fix: editor init
* Implement drag-and-drop sorting for notes tree
Replaces node moving with a more flexible drag-and-drop sorting mechanism in the notes sidebar. Adds visual indicators for drop positions and updates NotesService with a sortNodes method to handle before, after, and inside placement of nodes. Improves user experience and tree manipulation capabilities.
* fix: some bugs
* fix: remove NotesService class
* Migrate notes tree storage to IndexedDB
Replaced localStorage usage with IndexedDB for storing and retrieving the notes tree structure. Updated NotesService methods and related logic to use the new notes_tree table in Dexie, including making buildNodePath asynchronous. Adjusted translations in NotesSidebar for consistency.
* fix: some bugs
* Merge branch 'feat/richeditor' into feat-note
* feat: enhance RichEditor with table of contents and content search features
Added 'showTableOfContents' and 'enableContentSearch' props to the RichEditor component in NotesPage, improving navigation and search capabilities within notes.
* Add multi-level note sorting functionality
Introduced sorting options for notes by name, update time, and creation time in ascending and descending order. Updated UI and i18n files to support new sorting features, refactored NotesSidebar and NotesPage to handle sorting, and extended NotesService with recursive sorting logic. Added NotesSortType to note types for better type safety.
* perf: reduce rerender
* Add search functionality to notes sidebar
Introduces a search view in the notes sidebar, allowing users to filter notes by keyword. Adds UI elements for toggling search mode and inputting search terms, and updates filtering logic to support both starred and search views.
* Update NotesPage.tsx
* Add header navbar to notes page
Introduced a new HeaderNavbar component for the notes page and integrated it into NotesPage. Adjusted layout styles and reduced NotesSidebar width from 280px to 250px for improved UI consistency.
* Refactor notes state management and add character count i18n
Moved activeNodeId state to Redux store for better state management in NotesPage. Added 'characters' translation key to all supported locales and updated NotesPage to use it. Cleaned exported note content in exportMessageToNotes to remove assistant header.
* Add breadcrumb navigation to notes header
Introduces breadcrumb navigation in the notes header by passing notesTree to HeaderNavbar and implementing path calculation using getNodePathArray. Also exports findNodeInTree and refactors layout for improved UI structure.
* fix: style
* fix: update sorting labels and title capitalization in localization files for multiple languages
* style: adjust margin and padding in TableOfContentsWrapper and ToCDock components
* feat: implement content update handling in RichEditor and enhance mode switching in NotesPage
* refactor: remove redundant content update handling in RichEditor
* Update NotesPage.tsx
* Update NotesPage.tsx
* feat: enhance Table of Contents functionality with dynamic item display and scroll behavior
* fix: update markdown conversion tests to ensure proper HTML output for line breaks and code blocks
* feat: add support for saving pasted images in RichEditor with compression handling and IPC integration
* feat: enhance markdown conversion to support file:// protocol images as HTML img tags
* fix: update RichEditor styles for overflow handling and adjust markdown conversion to preserve <br> tags
* fix: refine RichEditor styles to improve text wrapping and ensure proper display of paragraphs
* Update NotesPage.tsx
* fix: update content structure in TableCell and EnhancedImage to allow for multiple block types
* feat: add methods to set selection to the last row and last column in TableView for improved user experience
* fix: adjust table layout and minimum width in RichEditor styles for better responsiveness and display
* fix: update table layout and scrollbar styles in RichEditor for improved responsiveness and user experience
* fix: improve style
* fix: update content structure in TableCell to support images alongside paragraphs
* fix: enhance layout and styling in NotesPage for improved responsiveness and user experience
* fix: unsaved mention
* Update NotesPage.tsx
* Update NotesPage.tsx
* fix: refine styling in RichEditor and NotesPage for improved layout and responsiveness
* fix: remove extraneous text from Navbar component rendering
* fix: adjust layout and styling in HeaderNavbar for better alignment and responsiveness
* fix: update Scrollbar styling in RichEditor for improved layout
* feat: implement enhanced math command in RichEditor for improved math placeholder insertion
* chore: update @tiptap dependencies to version 3.2.0 and enhance drag handling in RichEditor
* refactor: remove italic font style from rich text and clean up button styles in RichEditor
* refactor: streamline drag handle behavior and adjust styling in RichEditor for improved layout
* style: add code block styling to rich text for consistent font properties
* feat: add tooltips for plus button and drag handle in RichEditor for enhanced user guidance
* fix: update @tiptap/extension-drag-handle to use a patch version for improved functionality in RichEditor
* feat: enhance RichEditor with full width and font family options, and update settings localization
* feat: add drop hint for importing markdown files in NotesSidebar and update localization for multiple languages
* refactor: remove EditorContainer and simplify JSX structure in NotesPage for cleaner layout
* feat: add copy content functionality to HeaderNavbar and update localization for multiple languages
* refactor: simplify NotesPage by integrating NotesEditor component and optimizing state management with useCallback
* wip: open external folder
* feat: enable full width option in AssistantPromptSettings for improved layout
* wip: open external folder
* wip: open external folder
* wip: open external folder
* fix: move node
* wip: fix file rename
* refactor: notebook feature
* fix: improve file and directory deletion and renaming logic
Enhanced error handling and logging for external file and directory deletion in FileStorage. Updated file renaming to consistently append '.md' extension. Improved NotesService and NotesTreeService to use externalPath for renaming and fixed path updates for renamed nodes. Breadcrumbs in HeaderNavbar now reset when no active node is present. File scanning now strips file extension from node names.
* Refactor notes directory handling and state management
Replaces 'folderPath' with 'notesPath' throughout the codebase for clarity and consistency. Adds getNotesDir utility and updates IPC, FileStorage, Redux store, hooks, and UI components to use the new notes directory logic. Improves initialization and workspace setup for notes, ensuring correct directory creation and state synchronization.
* fix
* wip: ensure unique names for notes and folders
Introduces logic to prevent name collisions when creating or uploading notes and folders by checking for existing paths and appending a counter if necessary. Updates related services and UI to handle only one file upload at a time and provide user feedback for invalid actions.
* feat: add file watcher functionality and validate notes directory
Introduces a file watcher using chokidar to monitor changes in the notes directory. Adds IPC channels for starting and stopping the watcher, and validates the selected notes directory to ensure it meets specific criteria. Updates relevant components and services to integrate the new functionality, enhancing the application's responsiveness to file changes.
* fix: add file name validation and uniqueness checks
Introduces file name legality and uniqueness checks to prevent duplicate or invalid file/folder names. Updates IPC, backend, and renderer logic to use these checks for creating, renaming, and uploading notes and folders. Removes legacy unique name logic and refactors related code for consistency.
* fix: file name guard
* fix: rename
* Update NotesSettings.tsx
* Update NotesSettings.tsx
* feat: enhance notes settings and editor functionality
Refactors the notes settings to introduce new display and editor configurations, including options for default view modes and content compression. Updates the Redux store to manage these new settings and modifies relevant components to reflect the changes. Ensures a more intuitive user experience by allowing users to customize their editing environment and display preferences.
* feat: enhance file change handling and directory scanning
Introduces a new FileChangeEvent type to manage file system events more effectively. Updates the FileStorage service to handle directory operations with immediate synchronization and implements a debounce mechanism for file changes. Enhances the scanDir function to support recursive directory scanning with a configurable depth, improving the overall file management capabilities. Additionally, updates the Redux store to track active file paths instead of node IDs, streamlining the note management process.
* feat: enhance directory scanning and note management
Updates the scanDir function to include an optional basePath parameter for improved relative path handling. Modifies the NotesPage and NotesSidebar components to manage selected folder states, allowing for more intuitive folder and note creation. Refactors the createFolder and createNote services to ensure proper tree structure updates based on the selected folder. Additionally, introduces a new utility function to find nodes by external path, enhancing the overall note management experience.
* feat: improve code block highlighting and note saving functionality
Enhances the ShikiPlugin to load themes and languages only when necessary, preventing redundant operations. Introduces error handling for loading processes. In the NotesPage component, implements a debounced save mechanism to optimize note saving, ensuring that changes are saved only after a pause in typing. Additionally, adds logic to compare file content changes before triggering updates, improving the efficiency of file watching and content management.
* Update file.ts
* fix: improve file name validation and sanitization
Refactored file name validation logic to support platform-specific rules and provide detailed error messages. Added a sanitizeFilename utility to clean file names by replacing invalid characters and handling reserved names. Updated getName and checkName functions to use the new validation and sanitization methods.
* fix: remove unused languageMap from useRichEditor hook
Eliminated the languageMap variable from the useRichEditor hook as it was not being utilized, streamlining the code and improving performance. Updated dependencies in the effect hook accordingly.
* refactor: streamline theme and language loading in ShikiPlugin
Removed unnecessary snapshot logic for loaded themes and languages in the ShikiPlugin. Simplified the loading check by introducing a flag to track if any themes or languages were loaded, enhancing performance and reducing complexity.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: suyao <sy20010504@gmail.com>
* feat: add isTextFile method to API for file type checking
Introduced a new method `isTextFile` in the preload API to determine if a given file path corresponds to a text file. This enhancement improves file handling capabilities within the application.
* refactor: remove useRichEditor test file
* fix: add i18n
* Update fr-fr.json
* fix: merge main branch build error
* fix the missing navbar when the navigation bar is on the left
* fix: version
* feat: update NotesEditor and NotesService functionality
- Added a temporary view mode state in NotesEditor for improved UI handling.
- Enhanced sortAllLevels function in NotesService to persist the notes tree after sorting.
- Changed default edit mode in note state from 'realtime' to 'preview' for better user experience.
* fix: prevent expanded CodeEditor in NotesEditor
* feat: implement initial sorting for notes tree
- Added a new ref to track if initial sorting has been applied.
- Introduced a useEffect to apply alphabetical sorting to the notes tree on initial load, ensuring a consistent order for users.
- Included error handling for the sorting process to log any issues encountered.
* refactor: comment out file content comparison logic in NotesPage
- Temporarily disabled the file content comparison logic in the NotesPage component to streamline the file reading process.
- This change is intended for further review and potential optimization of the file handling functionality.
* style: remove overflow-y property from richtext.scss
- Eliminated the overflow-y property to improve the styling of the rich text editor, allowing for better content display and user experience.
---------
Co-authored-by: Pleasure1234 <3196812536@qq.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: one <wangan.cs@gmail.com>
* feat: add Zhipu logo and update related images
- Introduced a new Zhipu logo component in SVG format.
- Updated existing image assets for chatglm, zhipu, and zhipu_dark.
- Added a new zhipu image for search functionality.
* feat: integrate Cherryin signature generation
- Added a new integration for Cherryin, including a signature generation feature.
- Updated IPC channels to handle Cherryin requests.
- Introduced a new JavaScript file for Cherryin integration.
- Modified configuration files to include Cherryin client secrets and paths.
- Enhanced the ESLint and TypeScript configurations to accommodate the new integration.
* feat: add Zhipu search provider and logo integration
- Implemented a new ZhipuProvider for web search functionality.
- Added Zhipu logo to the WebSearchButton component.
- Updated WebSearchProviderFactory to include Zhipu as a search option.
- Enhanced error handling and logging for Zhipu search requests.
* feat: add cherryin provider
* fix: correct import path for CherryinAPIClient and update paintings state structure in migration
* chore: update version number to 1.5.8 in package.json
* feat: enhance model filtering in SelectModelPopup
- Added support for identifying free trial models in the model filtering logic.
- Updated the condition for determining free models to include both free and free trial models.
* refactor: update navigation to use query parameters for provider settings
- Modified navigation logic in FreeTrialModelTag and related utilities to use query parameters instead of state for provider identification.
- Removed unused useLocation hook in ProviderList component to streamline state management.
* fix: remove provider ID from search parameters on selection change in ProviderList
* refactor: remove free trial model references and update related logic
- Eliminated the FreeTrialTag component and its associated logic from ModelTagsWithLabel and SelectModelPopup.
- Updated model filtering to only consider free models without the free trial distinction.
- Removed translations and utility functions related to free trial models across multiple locales.
* fix: prevent mutation of read-only properties in web search provider
- Updated the addWebSearchProvider function to clone the provider object before pushing it to the state, preventing mutation of read-only properties.
- Enhanced the migration logic to update the apiKey for the zhipu web search provider if it exists.
* refactor: streamline provider selection and navigation logic
- Updated FreeTrialModelTag to directly navigate to provider settings using query parameters, removing unnecessary provider fetching.
- Simplified ProviderList by eliminating the EventEmitter for provider selection and ensuring search parameters are updated correctly.
* fix: replace hardcoded window size on first start
Signed-off-by: dev <verc20.dev@proton.me>
* fix: change MIN_WINDOW_WIDTH from 1080 to 960
---------
Signed-off-by: dev <verc20.dev@proton.me>
* feat: add batch delete functionality for files page
- Add batch selection with checkboxes for individual files
- Implement batch delete operation with confirmation dialog
- Add select all/none functionality with indeterminate state
- Include safety check to prevent deleting files used in paintings
- Support multiple languages for batch operation UI text
- Exclude image files from batch operations per design requirements
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* style: make batch delete popconfirm icon color consistent
- Add red color styling to batch delete popconfirm icon to match individual delete
- Update i18n translations for batch warning message across all locales
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor: improve batch delete UX and i18n translations
- Change "batch_operation" label to "Select All" across all languages
- Remove unused batch_warning translation for paintings
- Simplify delete confirmation messages to use single form
- Optimize batch delete to use Promise.all for better performance
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* fix: not using system default terminal on deepin
deepin-terminal is not in the `linuxTerminals` list, that will
cause xterm picked as the terminal to run code tool, which has
compatibility with Chinese charaters.
see: https://bbs.deepin.org.cn/post/290948
Signed-off-by: Hualet Wang <mr.asianwang@gmail.com>
* feat(codetool): add support for deepin-terminal
---------
Signed-off-by: Hualet Wang <mr.asianwang@gmail.com>
Co-authored-by: GeorgeDong32 <GeorgeDong32@qq.com>
Updated the terminal command execution logic to open a new tab in the Terminal application for running commands. This change enhances user experience by keeping the original tab available while executing commands in a separate tab.
Added logic to extract and decode the actual target URL from Bing redirect links in LocalBingProvider. Also introduced debug logging in SearchService to log search URLs.
* refactor(DraggableList): remove antd List component
The DraggableList component was unnecessarily wrapped in an antd List component. This change removes the antd List and replaces it with a standard div.
A `className` has been added to the new div for testing purposes. The `listProps` prop is preserved and its type is updated to `React.HTMLAttributes<HTMLDivElement>`.
The tests have been updated to reflect the new DOM structure, using a class selector instead of a data-testid. The antd mock has been removed, and the snapshot has been updated.
* test: fix
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
The putFile method no longer sets the Content-Length header and now includes the duplex: 'half' option in the net.fetch call. This change ensures compatibility with streaming uploads and the requirements of net.fetch.
* refactor(ProxyManager): enhance bypass rule matching and logging
- Updated the `isByPass` function to improve hostname and port matching against bypass rules.
- Refactored the dispatcher logic to utilize the updated `isByPass` function for better clarity.
- Enhanced logging to include bypass rules in system proxy change notifications.
- Simplified URL handling in the dispatcher to ensure consistent behavior.
* delete file
* refactor(ProxyManager): improve bypass rule handling and error logging
- Enhanced the `isByPass` function to check for bypass rules more efficiently, including improved error handling and logging for rule parsing failures.
- Added error logging for exceptions during URL processing.
- Cleaned up the logic to ensure consistent return values and better readability.
- Removed unnecessary environment variable deletions in the proxy manager cleanup process.
* feat(ProxyManager): add no_proxy environment variable support
- Introduced the `no_proxy` environment variable to allow bypassing specific hosts in proxy settings.
- The `no_proxy` value is constructed from the existing bypass rules, enhancing flexibility in proxy management.
* refactor(TranslateService): remove content parameter from fetchTranslate function
- Updated fetchTranslate function to eliminate the content parameter, simplifying its signature.
- Adjusted related calls to ensure compatibility with the new function definition, maintaining functionality while improving code clarity.
* Update src/renderer/src/services/TranslateService.ts
---------
Co-authored-by: Phantom <59059173+EurFelux@users.noreply.github.com>
build: add sharp dependency for image processing
* Added sharp as a dependency in package.json to enhance image processing capabilities.
* Removed sharp from the devDependencies section.
* Refactored OCR image preprocessing by integrating grayscale and normalization directly into the process, improving overall efficiency.
* refactor(CopilotService): streamline token file handling and improve error management
- Consolidated token file path retrieval into a dedicated method for better clarity and maintainability.
- Updated file system operations to ensure directory existence before writing the token file.
- Enhanced error handling during token save and read operations, ensuring robust logging and user feedback.
* lint
* build: add sharp dependency for image processing
- Added sharp as a dependency in package.json to support image processing functionalities.
- Removed sharp from the devDependencies section to ensure it is available in production.
* fix(cmd): quote executable path on Windows in command string
Wrap the executable path in double quotes when running on Windows sopaths containing spaces are handled correctly. Previously the base
command used an unquoted path which could break execution for users
whose install location includes spaces. This change only alters the
Windows branch to produce a quoted executable path while keeping the
non-Windows command unchanged.
* fix(codetool): quote bun paths in shell commands to spaces
* fix(OpenAIApiClient): update toolCalls handling to support dynamic index assignment
* refactor(OpenAIApiClient): streamline toolCalls management with reusable object structure
* fix: unexpected anthropic model recognization
* refactor(RawStreamListenerMiddleware): replace model provider retrieval with API client instance check
* fix(renderer): prevent overlays from entering titlebar drag region via no-drag and platform safe gap; cap modal body height; fixes#9123
* fix: modal close button intercepted by drag region in small window mode
- Set modal content as no-drag to ensure button clickability
- Use z-index layering for titlebar drag region management
- Remove redundant platform detection and CSS variables
* refine: only disable drag on modal close button instead of entire modal content
This allows users to still drag the window by clicking on modal header or other areas,
improving UX in small window scenarios while still protecting the close button interaction.
* refactor: simplify NotificationService initialization and use windowService for notifications
- Removed the dependency on BrowserWindow in NotificationService constructor.
- Updated the notification handling to utilize windowService for showing notifications and sending events, improving code modularity.
* refactor: remove constructor from NotificationService for cleaner initialization
* refactor(CodeToolsPage): streamline CLI tool management and enhance provider filtering logic
- Removed hardcoded CLI tool options and supported providers, replacing them with imported constants for better maintainability.
- Optimized provider filtering to include additional providers for Claude and Gemini tools.
- Updated environment variable handling for CLI tools to utilize a centralized API base URL function.
* refactor(CodeToolsPage): enhance CLI tool management and environment variable handling
- Updated provider filtering logic to utilize a centralized mapping for CLI tools, improving maintainability and extensibility.
- Refactored environment variable generation and parsing to streamline the launch process for different CLI tools.
- Simplified state management for tool selection and directory handling, enhancing code clarity.
* Add 'builtin avatar' option to avatar dropdown
-Introduces a new 'builtin avatar' option to the avatar selection dropdown in AddProviderPopup.
-Updates i18n translation files for all supported languages to include the 'builtin' avatar label.
Signed-off-by: Yuhang <190720896+YuhangHere@users.noreply.github.com>
* Add provider logo picker for builtin avatar selection
-Introduces a ProviderLogoPicker component for selecting a builtin provider logo as an avatar in AddProviderPopup.
-Updates provider logo handling in ProviderSettings.(If deleting the logoFile caused any issues, I sincerely apologize.)
Signed-off-by: Yuhang <190720896+YuhangHere@users.noreply.github.com>
* Adjust ProviderLogoPicker layout dimensions and grid
Signed-off-by: Yuhang <190720896+YuhangHere@users.noreply.github.com>
* Fix ProviderLogoPicker popover trigger behavior
Signed-off-by: Yuhang <190720896+YuhangHere@users.noreply.github.com>
* Merge branch 'main' into feat/add-builtin-provider-avatars
* Update index.tsx
---------
Signed-off-by: Yuhang <190720896+YuhangHere@users.noreply.github.com>
* fix: add provider check in isMandatoryWebSearchModel
* Fix: Add provider check in isMandatoryWebSearchModel
The isMandatoryWebSearchModel function was throwing an error when the provider was undefined. This change adds a check to ensure the provider exists before accessing its properties, similar to how it's handled in isWebSearchModel.
The position of the check has also been moved to be between the provider and modelId initializations for better code flow.
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
* fix: incorrect default avatar casing in custom provider
* add background color to default avatar in custom provider
distinction among providers.
* set ProviderInitialsLogo text color to white
添加完背景色后发现,模型列表中默认头像字体始终为白色,而编辑提供商时默认头像字体颜色会随主题色而变,黑色字体某些背景色下不清晰(比如a),所以改成始终白色
* fix: default avatar fallback when no text is entered
-设置背景色后发现,未输入文本时的背景色是根据上一个背景色继续保持的,该情况下回退到默认背景颜色
-回退后白色字体又看不清,该情况下字体颜色回退到黑色
-最终效果就是未输入文本时显示的默认头像回退到与之前一致
* fix: do not reset citation block id
* refactor: disable external websearch for mandatory websearch models
* refactor: predicate
* refactor: include openrouter perplexity
- Enhanced DraggableList component to accept listProps, allowing for customization of the Ant Design List component.
- Updated MCPSettings to utilize the new listProps feature, providing a custom empty state message when no servers are available.
* support openai codex
* lint
* refactor: remove unused codeTools enum from constant.ts
* fix build
* fix lin
* fix: add support for qwenCode CLI tool and improve error handling in CodeToolsService
* refactor: use code font family in HtmlArtifactsCard
* fix: pass onSave to HtmlArtifactsPopup
* feat: add a save button
* fix: avoid extra blank lines
* feat: make split view resizable
* refactor: improve streaming check, simplify Markdown component
* refactor: improve button style and icons
* test: update snapshots, add tests
* refactor: move font family to TerminalPreview
* test: update
* refactor: add explicit type for Node
* refactor: remove min-height
* fix: type
* refactor: improve scrollbar and splitter style
* fix: prevent incorrect @ symbol deletion in QuickPanel
- Track trigger source (input vs button) and @ position
- Only delete @ when triggered by input with model selection
- Button-triggered panels never delete text content
- Validate @ still exists at recorded position before deletion
* feat: delete search text along with @ symbol
- Pass searchText from QuickPanel to onClose callback
- Delete both @ and search text (e.g., @cla) when model selected
- Validate text matches before deletion for safety
- Fallback to deleting only @ if text doesn't match
* refactor: clarify ESC vs Backspace behavior in QuickPanel
- ESC: Cancel operation, delete @ + searchText when models selected
- Backspace: Natural editing, @ already deleted by browser, no extra action
- Clear separation of intent improves predictability and UX
* fix(export): robustly export reasoning and handle errors
* fix(export): normalize <br> to newline before notion parsing
* feat(i18n): add notion truncation and unify export warn keys
* refactor(export): add typing, state guards, and error logging
* fix(export): preserve existing <br> in reasoning when convert to html
* feat(export): add DOMPurify sanitization for reasoning content
* chore(deps): remove unused @types/dompurify dev dep
* chore(deps): remove dompurify dependency
Remove dompurify from package.json and yarn. The changes
delete dompurify entries and simplify the lockfile resolution so the
project no longer declares dompurify as a direct dependency.
This cleans up unused dependency declarations and prevents installing
dompurify when it is not required.
* refactor(ManageModelsPopup): remove margin of Empty
* chore: use destroyOnHidden rather than deprecated destroyTooltipOnHide
* refactor: center Empty
* fix: Update KnowledgeBase form and service to handle preprocess provider correctly
- Enhanced useKnowledgeBaseForm hook to set preprocessProvider with the correct providerId type.
- Modified getKnowledgeBaseParams function to retrieve preprocess provider from the store instead of the base, ensuring accurate provider assignment.
* fix: Remove unused providerId from preprocessProvider in useKnowledgeBaseForm hook
- Cleaned up the useKnowledgeBaseForm hook by removing the unused providerId property from the preprocessProvider object, ensuring a more accurate representation of the data structure.
* format code
* feat: Sync preprocess provider updates across knowledge bases
- Added a new action to synchronize updates to the preprocess provider across all knowledge bases that reference it.
- Updated the usePreprocessProvider hook to dispatch the new sync action after updating the provider.
- Modified getKnowledgeBaseParams to ensure the correct preprocess provider is assigned when retrieving knowledge base parameters.
* fix: Update sync logic for preprocess provider updates
- Modified the syncPreprocessProvider action to merge updates directly into the existing provider object instead of replacing it.
- Adjusted the usePreprocessProvider hook to only dispatch the sync action when specific fields (apiHost, apiKey, model) are updated, improving efficiency.
* refactor: replace axios and node fetch with electron's net module for network requests in preprocess providers
- Updated Doc2xPreprocessProvider and MineruPreprocessProvider to use net.fetch instead of axios for making HTTP requests.
- Improved error handling for network responses across various methods.
- Removed unnecessary AxiosRequestConfig and related code to streamline the implementation.
* lint
* refactor(Doc2xPreprocessProvider): enhance file validation and upload process
- Added file size validation to prevent loading files larger than 300MB into memory.
- Implemented file size check before reading the PDF to ensure efficient memory usage.
- Updated the file upload method to use a stream, setting the 'Content-Length' header for better handling of large files.
* refactor(brave-search): update net.fetch calls to use url.toString()
- Modified all instances of net.fetch to use url.toString() for better URL handling.
- Ensured consistency in how URLs are passed to the fetch method across various functions.
* refactor(MCPService): improve URL handling in net.fetch calls
- Updated net.fetch to use url.toString() for better type handling of URLs.
- Ensured consistent URL processing across the MCPService class.
* feat(ProxyManager): integrate axios with fetch proxy support
- Added axios as a dependency to enable fetch proxy usage.
- Implemented logic to set axios's adapter to 'fetch' for proxy handling.
- Preserved original axios adapter for restoration when disabling the proxy.
- Renamed method from _getPreReleaseVersionFromGithub to _getReleaseVersionFromGithub for clarity.
- Enhanced logic to check for the latest release version using semver.
- Removed unnecessary checks related to test plans when updates are not available.
- Improved logging for better traceability of release version fetching.
* fix(QuickPanel): auto-close panel when no commands match (#7824)
Fixes the issue where QuickPanel remains visible when user types
invalid slash commands. Now the panel intelligently closes after
300ms when no matching commands are found.
- Add smart delayed closing mechanism for unmatched searches
- Optimize memory management with proper timer cleanup
- Preserve existing trigger behavior for / and @ symbols
* feat(inputbar): intelligent @ symbol handling on model selection panel close
- Add smart @ character deletion when user selects models and closes panel with ESC/Backspace
- Preserve @ character when user closes panel without selecting any models
- Implement action tracking using useRef to detect user model interactions
- Support both ESC key and Backspace key for consistent behavior
- Use React setState instead of DOM manipulation for proper state management
Resolves user experience issue where @ symbol always remained after closing model selection panel
* perf(QuickPanel): optimize timer management and fix React anti-patterns
- Move side effects from useMemo to useEffect for proper React lifecycle
- Add automatic timer cleanup on component unmount and dependency changes
- Remove unnecessary timer creation/destruction on each search input
- Improve memory management and prevent potential memory leaks
- Maintain existing smart auto-close functionality with better performance
Fixes React anti-pattern where side effects were executed in useMemo,
which should be a pure function. This improves performance especially
when users type quickly in the search input.
* refactor(QuickPanel): remove redundant timer cleanup useEffect
Remove duplicate timer cleanup logic as the existing useEffect at line 141-164
already handles component unmount cleanup properly.
* refactor(QuickPanel): optimize useEffect dependencies and timer cleanup logic
- Replace overly broad `ctx` dependency with precise `[ctx.isVisible, searchText, list.length, ctx.close]`
- Move timer cleanup before visibility check to ensure proper cleanup on panel hide
- Add early return when panel is invisible to prevent unnecessary timer creation
- Improve performance by avoiding redundant effect executions
- Fix edge case where timers might not be cleared when panel becomes invisible
Addresses review feedback about dependency array optimization while maintaining
existing auto-close functionality and improving memory management.
* feat(QuickPanel): implement smart re-opening with dependency optimization
Features:
- Implement smart re-opening during deletion with real-time matching
- Only reopen panel when actual matches exist to avoid unnecessary interactions
- Add intelligent @ symbol handling on model selection panel close
- Optimize search text length limits (≤10 chars) for performance
Fixes:
- Fix useMemo dependency from overly broad [ctx, searchText] to precise [ctx.isVisible, ctx.symbol, ctx.list, searchText]
- Resolve trailing whitespace formatting issues
- Eliminate ESLint exhaustive-deps warnings while maintaining stability
- Prevent unnecessary re-renders when unrelated ctx properties change
Performance improvements ensure optimal QuickPanel responsiveness while maintaining
existing auto-close functionality and improving user experience.
* fix(ci): add eslint-disable comment for exhaustive-deps warning
The useEffect dependency array [ctx.isVisible, searchText, list.length, ctx.close]
is intentionally precise to avoid unnecessary re-renders when unrelated ctx
properties change. Adding ctx object would cause performance degradation.
* refactor(QuickPanel): remove smart re-opening logic during deletion
- Remove 62 lines of complex deletion detection logic from Inputbar component
- Eliminates performance overhead from frequent string matching during typing
- Reduces code complexity and potential edge cases
- Maintains simple and predictable QuickPanel behavior
- Improves maintainability by removing unnecessary "smart" features
The deletion-triggered smart reopening feature added unnecessary complexity
without significant user benefit. Users can simply type / or @ again to
reopen panels when needed.
- Introduced QuickPhraseSettings component for managing quick phrases with add, edit, and delete functionality.
- Added PreprocessSettings component to configure document preprocessing options, including provider selection.
- Updated SettingsPage to include links to the new Quick Phrase and Preprocess settings.
- Removed the deprecated ToolSettings component and its associated routes.
- Enhanced WebSearchSettings with new compression settings and improved UI for managing web search providers.
- Removed the patch for windows-system-proxy@npm:1.0.0 and updated the dependency to version 1.0.1 in package.json and yarn.lock.
- Deleted the corresponding patch file to clean up the project.
- Updated AppUpdater to eliminate the mainWindow parameter from the constructor.
- Replaced direct mainWindow references with windowService calls to retrieve the main window, improving modularity and decoupling.
* feat: add code tools
* feat(CodeToolsService): add CLI executable management and installation check
- Introduced methods to determine the CLI executable name based on the tool.
- Added functionality to check if a package is installed and create the necessary bin directory if it doesn't exist.
- Enhanced the run method to handle installation and execution of CLI tools based on their installation status.
- Updated terminal command handling for different operating systems with improved comments and error messages.
* feat(ipService): implement IP address country detection and npm registry URL selection
- Added a new module for IP address country detection using the ipinfo.io API.
- Implemented functions to check if the user is in China and to return the appropriate npm registry URL based on the user's location.
- Updated AppUpdater and CodeToolsService to utilize the new ipService functions for improved user experience based on geographical location.
- Enhanced error handling and logging for better debugging and user feedback.
* feat: remember cli model
* feat(CodeToolsService): update options for auto-update functionality
- Refactored the options parameter in CodeToolsService to replace checkUpdate and forceUpdate with autoUpdateToLatest.
- Updated logic to handle automatic updates when the CLI tool is already installed.
- Modified related UI components to reflect the new auto-update option.
- Added corresponding translations for the new feature in multiple languages.
* feat(CodeToolsService): enhance CLI tool launch with debugging support
- Added detailed logging for CLI tool launch process, including environment variables and options.
- Implemented a temporary batch file for Windows to facilitate debugging and command execution.
- Improved error handling and cleanup for the temporary batch file after execution.
- Updated terminal command handling to use the new batch file for safer execution.
* refactor(CodeToolsService): simplify command execution output
- Removed display of environment variable settings during command execution in the CLI tool.
- Updated comments for clarity on the command execution process.
* feat(CodePage): add model filtering logic for provider selection
- Introduced a modelPredicate function to filter out embedding, rerank, and text-to-image models from the available providers.
- Updated the ModelSelector component to utilize the new predicate for improved model selection experience.
* refactor(CodeToolsService): improve logging and cleanup for CLI tool execution
- Updated logging to display only the keys of environment variables during CLI tool launch for better clarity.
- Introduced a variable to store the path of the temporary batch file for Windows.
- Enhanced cleanup logic to remove the temporary batch file after execution, improving resource management.
* feat(Router): replace CodePage with CodeToolsPage and add new page for code tools
- Updated Router to import and route to the new CodeToolsPage instead of the old CodePage.
- Introduced CodeToolsPage component, which provides a user interface for selecting CLI tools and models, managing directories, and launching code tools with enhanced functionality.
* refactor(CodeToolsService): improve temporary file management and cleanup
- Removed unused variable for Windows batch file path.
- Added a cleanup task to delete the temporary batch file after 10 seconds to enhance resource management.
- Updated logging to ensure clarity during the execution of CLI tools.
* refactor(CodeToolsService): streamline environment variable handling for CLI tool execution
- Introduced a utility function to remove proxy-related environment variables before launching terminal processes.
- Updated logging to display only the relevant environment variable keys, enhancing clarity during execution.
* refactor(MCPService, CodeToolsService): unify proxy environment variable handling
- Replaced custom proxy removal logic with a shared utility function `removeEnvProxy` to streamline environment variable management across services.
- Updated logging to reflect changes in environment variable handling during CLI tool execution.
- Introduced ApiOptionsSettings component to manage API options for providers.
- Added ApiOptionsSettingsPopup for displaying API options in a modal.
- Updated ProviderSetting to include a button for opening the API options popup for non-system providers.
- Refactored imports and adjusted layout in ProviderSetting for better UI consistency.
- Simplified proxy setting logic by removing unnecessary dispatches for 'system' and 'none' modes.
- Updated useAppInit to set proxy to undefined for 'system' mode and clarified direct mode handling with comments.
- Removed TranslateSettings and TranslateModelSettings components to streamline the translation settings interface.
- Introduced CustomLanguageSettings and TranslatePromptSettings components for better management of custom languages and prompt settings.
- Updated ModelSettings to utilize the new TranslateSettingsPopup for handling translation-related configurations.
- Enhanced the overall structure and readability of the translation settings page.
* refactor(FileManager): streamline file path handling in FilesPage and ImageBlock components
* refactor(file): implement getSafeFilePath utility for consistent file path handling across loaders and preprocessors
* refactor(FileStorage): replace getSafeFilePath with fileStorage.getFilePathById for consistent file path retrieval across services
* refactor(file): unify file path retrieval across loaders and preprocessors for improved consistency
* refactor(Inputbar, MessageEditor): replace getFileExtension with file.ext for improved file type handling
* refactor(FileStorage): simplify getFilePathById method by removing redundant checks for file path retrieval
* fix(FileStorage): update getFilePathById to ensure file.path is consistent with generated filePath
* refactor(FileStorage): simplify getFilePathById method by removing unnecessary file path consistency checks
* fix(FileStorage): update duplicate file check to use file.path for accurate detection
* fix(FileStorage): correct file path usage in uploadFile method for accurate duplicate detection
* fix(loader): update file path retrieval to use file.path for consistency across loaders
- Removed unused imports and components to simplify the codebase.
- Refactored the token count calculation for improved readability.
- Adjusted the layout of the operation bar and input/output containers for better spacing and alignment.
- Enhanced the copy button functionality and visibility within the output area.
- Updated styles for consistency and improved user experience.
* Update models.ts
* Update models.ts
* Update models.ts
* feat: add OpenAI verbosity setting for GPT-5 model
Introduces a new 'verbosity' option for the OpenAI GPT-5 model, allowing users to control the level of detail in model output. Updates settings state, migration logic, UI components, and i18n translations to support this feature.
* fix(models): 修正gpt-5模型判断逻辑以支持包含gpt-5的模型ID
* fix(i18n): 修正繁体中文和希腊语的翻译错误
* fix(models): 优化OpenAI推理模型判断逻辑
* fix(OpenAIResponseAPIClient): 不再为response api添加stream_options
* fix: update OpenAI model check and add verbosity setting
Changed GPT-5 model detection to use includes instead of strict equality. Added default 'verbosity' property to OpenAI settings in migration logic.
* feat(models): 添加 GPT-5 系列模型的图标和配置
添加 GPT-5、GPT-5-chat、GPT-5-mini 和 GPT-5-nano 的图标文件,并在 models.ts 中配置对应的模型 logo
* Merge branch 'main' into fix-gpt5
* Add verbosity setting to OpenAI API client
Introduces a getVerbosity method in BaseApiClient to retrieve verbosity from settings, and passes this value in the OpenAIResponseAPIClient request payload. This enables configurable response verbosity for OpenAI API interactions.
* Upgrade OpenAI package to 5.12.2 and update patch
Replaced the OpenAI dependency from version 5.12.0 to 5.12.2 and updated related patch files and references in package.json and yarn.lock. Also updated a log message in BaseApiClient.ts for clarity.
* fix: add type and property checks for tool call handling
Improves robustness by adding explicit checks for 'function' property and 'type' when parsing tool calls and estimating tokens. Also adds error handling for unknown tool call types in mcp-tools and updates related test logic.
* feat(模型配置): 添加gpt5模型支持及相关配置
- 在模型类型中新增gpt5支持
- 添加gpt5系列模型检测函数
- 更新推理选项配置和国际化文本
- 调整effort ratio数值
* fix(ThinkingButton): 为gpt-5及后续模型添加minimal到low的选项回退映射
* feat(i18n): 更新思维链长度的中文翻译并调整对应图标
为思维链长度的"minimal"选项添加中文翻译"微念",同时调整各选项对应的灯泡图标亮度
* feat(i18n): 为推理努力设置添加"minimal"选项并调整英文文案
* fix: openai patch
* wip: OpenAISettingsGroup display
* fix: 修复OpenAISettingsGroup组件中GPT5条件下的渲染逻辑
* refactor(OpenAISettingsGroup): 优化设置项的分组和分隔符逻辑
* feat(模型配置): 添加gpt-5到visionAllowedModels列表
* feat(模型配置): 添加gpt-5到函数调用支持列表
将gpt-5及其变体添加到FUNCTION_CALLING_MODELS支持列表,同时将gpt-5-chat添加到排除列表
* fix: 在OpenAI推理模型检查中添加gpt-5-chat支持
* Update OpenAISettingsGroup.tsx
* feat(模型支持): 添加对verbosity模型的支持判断
新增isSupportVerbosityModel函数用于判断是否支持verbosity模型
替换原有isGPT5SeriesModel判断逻辑,统一使用新函数
* fix: 修复支持详细程度模型的判断逻辑
使用 getLowerBaseModelName 处理模型 ID 以确保大小写不敏感的比较
* feat: 添加对gpt-5模型的网络搜索支持但不包括chat变体
* fix(models): 修复gpt5模型支持选项缺少'off'的问题
* fix: 添加gpt-5到支持Flex Service Tier的模型列表
* refactor(aiCore): 优化OpenAI verbosity类型定义和使用
移除OpenAIResponseAPIClient中冗余的OpenAIVerbosity导入
在BaseApiClient中明确getVerbosity返回类型为OpenAIVerbosity
简化OpenAIResponseAPIClient中verbosity的类型断言
* fix(openai): 仅在支持verbosity的模型中添加verbosity参数
* fix(i18n): 修正OpenAI设置中不一致的翻译
* fix: modify low effort ratio
* fix(openai): 修复GPT5系列模型在启用网页搜索时不能使用minimal reasoning_effort的问题
* fix(openai): 修复GPT5系列模型在启用web搜索时不能使用minimal推理的问题
---------
Co-authored-by: icarus <eurfelux@gmail.com>
Co-authored-by: Phantom <59059173+EurFelux@users.noreply.github.com>
* Updated electron-builder configuration to include RPM as a target for Linux builds.
* Modified GitHub workflows to install RPM dependencies during the build process for both nightly and release workflows.
Updated the logic for determining tool usage by consolidating conditions into a single variable. Improved the handling of MCP tools by filtering active servers and checking for enabled tools before sending notifications. Removed redundant code and ensured that tool execution completion notifications are sent based on the new logic.
* feat: add language filter to local web search queries
Integrates user's language setting into search queries by applying a language filter based on the provider (Google, Bing, or others). This improves search relevance for localized results.
* fix: update language filter logic in LocalSearchProvider
Refactored applyLanguageFilter to use provider.id instead of provider.name for search engine identification. Adjusted filtering for Google, Bing, and Baidu, and removed default language filter for other providers.
* Update LocalSearchProvider.ts
- Updated internal state synchronization for HTML content and preview.
- Enhanced preview refresh logic to check for content changes every 2 seconds.
- Improved comments for clarity and consistency in English.
- Added onChunkReceived call to fetchChatCompletion to improve response handling.
- Removed redundant onChunkReceived call from the completion parameters section in fetchChatCompletion.
refactor(ProxyManager): streamline proxy configuration and bypass rules handling
- Simplified proxy configuration logic in registerIpc by directly assigning bypass rules.
- Removed redundant bypass rules assignment in ProxyManager, initializing it as an empty array.
- Updated GeneralSettings to conditionally render based on custom proxy mode only.
- Removed unnecessary cursor styles from draggable items in the VirtualRow component.
- Updated snapshot tests to reflect changes in cursor styles.
- Introduced a new DragHandle component in ProviderSettings for improved drag interaction, with hover effects to enhance user experience.
Introduces logic to allow users to disable thinking mode directly from the ThinkingButton if supported. Tooltip text now reflects the action to close when thinking is enabled and 'off' is available.
* feat(discover): implement Discover feature with routing and UI components
- Added a new Discover page with sidebar and main content areas.
- Integrated routing for Discover, including subcategories and tabs.
- Created components for Discover sidebar and main content.
- Updated localization files to include new Discover titles and labels.
- Refactored existing components to accommodate the new Discover feature.
- Enhanced sidebar icons and navigation for better user experience.
* feat(discover): enhance Discover page with Tailwind CSS integration and routing improvements
- Added Tailwind CSS import to the entry point for styling.
- Updated the ThemeProvider to dynamically apply Tailwind themes based on user selection.
- Refactored Discover page to utilize new ROUTERS structure for better routing management.
- Simplified category handling in useDiscoverCategories hook by leveraging ROUTERS_ENTRIES.
- Introduced InternalCategory interface for better type management in Discover components.
- Cleaned up unused code and comments for improved readability.
* fix: update import statement for linguist-languages in update-languages.ts
* fix: standardize import quotes and improve localization files
- Updated import statements in use-mobile.ts and motionVariants.ts to use single quotes for consistency.
- Added new localization entries for the "discover" section in multiple language files, including English, Japanese, Russian, Traditional Chinese, Greek, Spanish, French, and Portuguese.
* refactor(discover): simplify Discover page structure and improve routing logic
- Refactored DiscoverPage component to streamline tab and sidebar handling.
- Updated routing logic to utilize a new ROUTERS_MAP for better category management.
- Removed unused props and simplified state management in useDiscoverCategories hook.
- Enhanced DiscoverSidebar and DiscoverMain components for improved clarity and performance.
- Adjusted CherryStoreType enum values for consistency in path definitions.
* fix: update file upload body type in MineruPreprocessProvider
- Changed the body of the fetch request from a Buffer to a Uint8Array to ensure proper handling of binary data during PDF uploads.
* fix: ensure Blob creation uses a copy of byte arrays for image handling
- Updated Blob creation in ImageGenerationMiddleware, ImageViewer, and MessageImage components to use `slice()` on byte arrays, preventing potential mutations of the original data.
* chore: update Vite React SWC plugin and adjust Electron config for conditional styling
- Upgraded `@vitejs/plugin-react-swc` from version 3.9.0 to 3.11.0 for improved performance and features.
- Modified Electron Vite configuration to conditionally apply styled-components plugin based on the VITEST environment variable.
- Updated snapshot tests for `InputEmbeddingDimension` and `Spinner` components to reflect style changes.
* chore: upgrade @swc/plugin-styled-components to version 9.0.2 in package.json and yarn.lock
* refactor: streamline styled-components plugin configuration in Electron Vite setup
- Consolidated the styled-components plugin configuration in the Electron Vite config file for improved readability and maintainability.
- Removed conditional application of the plugin based on the VITEST environment variable, ensuring consistent styling behavior across environments.
* i18n: update translations for discover section across multiple languages
- Replaced placeholder text with accurate translations for the "discover" section in English, Japanese, Russian, Traditional Chinese, Greek, Spanish, French, and Portuguese.
- Ensured consistency in terminology and improved clarity in user-facing messages.
* i18n: update "discover" title translations across multiple languages
- Updated the "discover" title in English, Japanese, Russian, Traditional Chinese, Greek, Spanish, French, and Portuguese to ensure accurate and consistent terminology.
- Adjusted related key mappings in the localization files for improved clarity in user-facing messages.
* chore: update lucide-react to version 0.536.0 and clean up tsconfig paths
* fix: update input style in snapshot tests and format message mentions in MessageContent component
* feat: disable mask closing for various popups across the application
- Updated multiple popup components to prevent closing when clicking outside, enhancing user experience and preventing accidental dismissals.
- Affected components include ImportAgentPopup, QuickPhrasesButton, NewAppButton, EditMcpJsonPopup, TopicNamingModalPopup, CustomHeaderPopup, and QuickPhraseSettings.
This change aims to improve the usability of modal dialogs by ensuring users must explicitly confirm or cancel their actions.
* feat: implement click outside to save edits in TopicsTab
- Added a useEffect hook to handle clicks outside the editing input, triggering save on blur.
- Updated onClick behavior for topic items to prevent switching while editing.
- Enhanced cursor style for better user experience during editing.
This change improves the editing experience by ensuring that edits are saved when the user clicks outside the input field.
* feat: integrate in-place editing for topic names in TopicsTab
- Added useInPlaceEdit hook to manage topic name editing, improving user experience.
- Removed previous editing logic and integrated new editing flow with save and cancel functionalities.
- Updated UI interactions to reflect the new editing state, ensuring a smoother editing process.
This change enhances the editing experience by allowing users to edit topic names directly within the list, streamlining the workflow.
* feat: add OpenAI o3 model support with enhanced tool calling
- Add o3 and o3-mini model definitions with reasoning effort support
- Implement o3-compatible strict schema validation for MCP tools
- Add comprehensive o3 schema processing with DRY improvements
- Extract reusable schema processing functions for maintainability
- Add 15+ test cases validating o3 strict mode requirements
- Fix schema composition keyword handling with loop-based approach
- Ensure ALL object schemas have complete required arrays for o3
- Support tool calling with proper o3 schema transformations
This enables OpenAI o3 models to work properly with MCP tool calling
while improving code organization and test coverage.
Signed-off-by: Luke Galea <luke@ideaforge.org>
* Remove redundant reference in HtmlArtifactsPopup.tsx
* refactor: move filterProperties to mcp-schema, fix tests
---------
Signed-off-by: Luke Galea <luke@ideaforge.org>
Co-authored-by: one <wangan.cs@gmail.com>
Co-authored-by: suyao <sy20010504@gmail.com>
* fix[AgentsPage]: fix using name deduplication leads to the loss of agents with the same name
* fix[agents-zh]: fix id 499 the problem of markdown display
* fix[agent]: agent search adds descriptive text search
* feat(ProxyManager): implement SelectiveDispatcher for localhost handling
- Added SelectiveDispatcher to manage proxy and direct connections based on the hostname.
- Introduced isLocalhost function to check for localhost addresses.
- Updated ProxyManager to bypass proxy for localhost in dispatch methods and set proxy bypass rules.
- Enhanced global dispatcher setup to utilize SelectiveDispatcher for both EnvHttpProxyAgent and SOCKS dispatcher.
* refactor(ProxyManager): update axios configuration to use fetch adapter
- Changed axios to use the 'fetch' adapter for proxy requests.
- Removed previous proxy settings for axios, streamlining the configuration.
- Updated HTTP methods to bind with the new proxy agent.
* feat(Proxy): add support for proxy bypass rules
- Updated IPC handler to accept optional bypass rules for proxy configuration.
- Enhanced ProxyManager to store and utilize bypass rules for localhost and other specified addresses.
- Modified settings and UI components to allow users to input and manage bypass rules.
- Added translations for bypass rules in multiple languages.
* feat(ProxyManager): add HTTP_PROXY environment variable support
- Added support for the HTTP_PROXY environment variable in ProxyManager to enhance proxy configuration capabilities.
* lint
* refactor(ProxyManager): optimize bypass rules handling
- Updated bypass rules initialization to split the rules string into an array for improved performance.
- Simplified the isByPass function to directly check against the array of bypass rules.
- Enhanced configuration handling to ensure bypass rules are correctly parsed from the provided settings.
* refactor(ProxyManager): streamline bypass rules initialization
- Consolidated the initialization of bypass rules by directly splitting the default rules string into an array.
- Updated configuration handling to ensure bypass rules are correctly assigned without redundant splitting.
* style(GeneralSettings): adjust proxy bypass rules input width to improve UI layout
* refactor(ProxyManager): enhance proxy configuration logging and handling
- Added proxy bypass rules to the configuration method for improved flexibility.
- Updated logging to include bypass rules for better debugging.
- Refactored the setGlobalProxy method to accept configuration parameters directly, streamlining proxy setup.
- Adjusted the useAppInit hook to handle proxy settings more cleanly.
* refactor(ProxyManager): implement close and destroy methods for proxy dispatcher
- Added close and destroy methods to the SelectiveDispatcher class for better resource management.
- Updated ProxyManager to handle the lifecycle of the proxyDispatcher, ensuring proper closure and destruction.
- Enhanced error handling during dispatcher closure and destruction to prevent resource leaks.
* refactor(ProxyManager): manage proxy agent lifecycle
- Introduced proxyAgent property to ProxyManager for better management of the proxy agent.
- Implemented error handling during the destruction of the proxy agent to prevent potential issues.
- Updated the proxy setup process to ensure the proxy agent is correctly initialized and cleaned up.
* refactor(ProxyManager): centralize default bypass rules management
- Moved default bypass rules to a shared constant for consistency across components.
- Updated ProxyManager and GeneralSettings to utilize the centralized bypass rules.
- Adjusted migration logic to set default bypass rules from the shared constant, ensuring uniformity in configuration.
* refactor: align lucide icons in antd button
* refactor(AssistantsTab): use lucide icon and typography in add assistant button
* refactor: use lucide icons for assistant item dropdown
* refactor: use lucide icons in topic item dropdown
* refactor: use lucide icon in InfoTooltip, align ApiOptionsSettings expand icon
* refactor: use lucide icons in TokenCount
* refactor: use brush in assistant item dropdown
* test: update snapshot
* test: mock tooltip
* fix: token count alignment
* refactor: update icons in MessageMenubar, bump antd
* refactor: use lucide icons in MessageTools, make colors consistent
* refactor: use lucide icons in ProviderSetting
* test: simplify test with mocks
* refactor: use lucide icons in knowledge base dropdown
* refactor: export all custom icons, use EditIcon for lucide pen
* refactor: use lucide copy for CopyIcon, update tests
* refactor: use lucide icons in MessageMenubar
* refactor: improve pause and send button style
* refactor: export SvgSpinners180Ring as LoadingIcon
* refactor: use lucide icons in Agents, use DeleteIcon
* refactor: use Pencil as EditIcon
* fix: i18n key missing
* refactor: use lucide icons in Files
* refactor: use lucide icons in KnowledgeBase items
* refactor: use lucide icons in assistant settings
* refactor: use lucide icons in memory settings, add UserSelector
* chore: remove duplicate memory component
* refactor: use lucide icons in ProviderList
* refactor: use lucide icons in QuickPhraseSettings
* refactor: use lucide icons in McpSettings
* refactor: use lucide icons in DataSettings
* refactor: use lucide icons in DefaultAssistantSettings
* refactor: add icon to save
* refactor: add lucide-custom
* fix: icon position in ModelEditContent
* refactor: use ListMinus in ManageModelsList
* refactor: improve TokenCount alignment
* fix: topic pin/unpin i18n
* fix: self review
* fix: simplify knowledge base dropdown
* fix: remove plus icon color
* refactor: add ResetIcon and RefreshIcon
* refactor: update theme handling in TabContainer and Sidebar components
* refactor: replace setTheme with toggleTheme and update theme state management
* feat: add Monitor icon for additional theme state in both components
* feat(DisplaySettings): replace theme icons with lucide icons for improved visual representation
* updated light and dark theme icons to use Sun and Moon from lucide
* replaced SyncOutlined with Monitor icon for system theme option
* format code
* feat(TabContainer): add tooltip for theme toggle button with translation support
* integrated Tooltip component to provide contextual information for the theme toggle button
* utilized useTranslation hook for internationalization of tooltip text
* imported getThemeModeLabel to enhance theme description
- use DynamicVirtualList in SelectModelPopup
- use DynamicVirtualList in QuickPanelView
- remove react-window
- simplify SelectModelPopup states, improve maintainability
* perf: inlining completeLineTokens and use memo for minor improvements
* chore: bump shiki to 3.9.1
* refactor: improve token line
* refactor: add plainTokenStyle
* feat(database): enable strict transaction durability for CherryStudio database
- Updated the Dexie database initialization to include `chromeTransactionDurability: 'strict'`, enhancing data integrity during transactions.
* feat(app): enhance application shutdown process and data flushing
- Added functionality to flush storage data and cookies before quitting the application, ensuring data integrity.
- Introduced a new `handleBeforeQuit` function to centralize cleanup logic for both manual and update-triggered quits.
- Updated logging to provide better insights during the shutdown process.
- Modified ProxyManager to use debug level for unchanged proxy configurations.
- Added `persistor` to the global window object and implemented `handleSaveData` to flush Redux state before quitting.
* format code
* feat(ipc): add App_SaveData channel and implement data saving on window close
- Introduced a new IPC channel `App_SaveData` for saving application data.
- Updated `WindowService` to send a save data message when the main window is closed.
- Enhanced `useAppInit` hook to handle the `App_SaveData` event and trigger data saving logic.
* refactor(env): remove persistor from global window object
- Removed the `persistor` property from the global `window` object in both `env.d.ts` and `index.ts` files, streamlining the application state management.
- add a custom dynamic virtual list component
- add tests
- support autohide
- used in ManageModelsList, ModelListGroup, KnowledgePage, FileList
- improve DraggableVirtualList
- use name DraggableVirtualList directly, make it flex by default
- use DraggableVirtualList in ProviderList
- Update Node.js version requirement to v22.x.x or higher
- Update Yarn version to 4.9.1
- Add electron-vite version (v4.0.0) to build system docs
- Note usage of experimental rolldown-vite
- Introduced a new ApiServerSettings component for managing API server configurations.
- Updated ToolSettings to include API server options and controls.
- Enhanced GeneralSettings to improve proxy settings management.
- Refactored UI elements for better organization and user experience.
* fix(prompt): fix variable replacement in function mode
* fix(i18n): update available variables in prompt tip
* feat(prompt): replace prompt variable in Prompt and AssistantPromptSettings components
* fix(prompt): add fallback value if replace failed
* feat(prompt): add hook and settings for automatic prompt replacement
* feat(prompt): add supported variables and utility function to check if they exist
* feat(prompt): enhance variable handling in prompt settings and tooltips
* feat(i18n): add prompt settings translations for multiple languages
* refactor(prompt): remove debug log from prompt processing
* fix(prompt): handle model name variables and improve prompt processing
* fix: correct variable replacement setting and update migration defaults
* remove prompt settings
* refactor: simplify model name replacement logic
- Remove unnecessary assistant parameter from buildSystemPrompt function
- Update all API clients to use the simplified function signature
- Centralize model name replacement logic in promptVariableReplacer
- Improve code maintainability by reducing parameter coupling
* fix: eslint error
* refactor: remove unused interval handling in usePromptProcessor
* test: add tests, remove redundant replacing
* feat: animate prompt substitution
* chore: prepare for merge
* refactor: update utils
* refactor: remove getStoreSettings
* refactor: update utils
* style(Message/Prompt): 禁止文本选中以提升用户体验
* fix(Prompt): 修复内存泄漏问题,清除内部定时器
* refactor: move prompt replacement to api service
---------
Co-authored-by: one <wangan.cs@gmail.com>
Co-authored-by: icarus <eurfelux@gmail.com>
* ✨ feat: make API server default to closed/disabled
- Add `enabled` field to ApiServerConfig interface with default value false
- Update Redux store to include apiServer.enabled setting (defaults to false)
- Add setApiServerEnabled action to control server state
- Modify main process to only auto-start API server if explicitly enabled
- Update UI to show enable/disable toggle in API server settings
- Add migrations to handle existing configurations
- Server controls now only visible when API server is enabled
The API server will no longer start automatically on application launch
unless explicitly enabled by the user through the settings interface.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* 🔧 chore: improve build and lint commands
- Move typecheck and i18n checks to lint command for better developer experience
- Simplify build:check to focus on linting and testing
- Ensure all quality checks run together during development
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* refactor(ApiService): optimize memory search handling and improve error logging
- Updated fetchExternalTool to handle memory search in a separate promise, ensuring better management of asynchronous operations.
- Enhanced error logging for memory search failures to improve debugging.
- Removed redundant memory search result storage logic from the main result handling section.
* refactor(ApiService): streamline external tool fetching and memory search handling
- Simplified the fetchExternalTool function by separating web and knowledge search calls into individual await statements.
- Improved memory search handling by awaiting the searchMemory function directly, ensuring better asynchronous flow.
- Updated result storage logic to ensure memory search results are stored correctly after fetching.
- improve responsiveness for provider switching
- improve ModelList performance
- use startTransition
- use virtual list for model groups
- remove excessive ModelEditContent, add EditModelPopup
- add model count
- improve model management popup
- rename to ManageModelsPopup
- use virtual list with sticky group name
- use SvgSpinners180Ring for spin
- Added "Start" and "Stop" labels in English, Japanese, Russian, Chinese (Simplified and Traditional) locales.
- Introduced "Authorization Header" title and descriptions for API key and port fields across all locales.
- Removed deprecated API documentation unavailable messages for a cleaner user experience.
- Added a new handleTabClick function to streamline tab navigation and hide the minapp popup when a tab is clicked.
- Implemented an animation for the minapp switch indicator in the TopNavbarOpenedMinappTabs component, improving visual feedback during tab switching.
- Refactored the rendering of minapp items to use Tooltip for better accessibility and user experience.
- Removed unnecessary StyledLink components to simplify the structure of the navigation items.
* fix(AppUpdater): simplify error logging and update version check logic
- Updated error logging to use a more concise format.
- Changed logging messages for update events to be more consistent.
- Modified the update check logic to return null when no update is available.
- Enhanced the app initialization hook to include update availability in the state dispatch.
* fix(useAppInit): simplify update state dispatch logic by removing update availability check
- Introduced a new function to check if a model is the Qwen 3-235B-A22B thinking model.
- Updated the ThinkingButton component to utilize the new detection function for improved model handling.
* refactor(ModelEditContent): enhance model capabilities management and introduce uniqueObjectArray utility
- Updated ModelEditContent to improve handling of model capabilities, ensuring user selections are accurately reflected.
- Introduced a new utility function, uniqueObjectArray, to filter out duplicate objects in arrays, enhancing data integrity.
- Refactored logic for updating model capabilities to utilize the new utility, streamlining the process and improving code clarity.
* refactor(ModelEditContent): enhance model capabilities management with useEffect and improved type handling
- Added useEffect to manage model capabilities based on user selections and showMoreSettings state.
- Refactored logic to streamline the handling of default and selected model types, improving clarity and maintainability.
- Utilized useRef to track changed types, ensuring accurate updates to model capabilities during user interactions.
* refactor(ModelEditContent): optimize model capabilities update logic with getUnion utility
- Enhanced the model capabilities management by integrating the getUnion utility to streamline the merging of selected types and unselected capabilities.
- Improved clarity in the useEffect hook for managing model capabilities based on user selections and the showMoreSettings state.
- Refactored condition checks for updating user selections to ensure accurate handling of model capabilities during interactions.
* refactor(ModelEditContent): improve model capabilities reset logic and enhance debugging
- Introduced a cloneDeep utility to preserve original model capabilities for reset functionality.
- Updated the handleResetTypes function to restore original capabilities instead of clearing them.
- Added console logs for better debugging and tracking of model capabilities during updates.
* feat(ModelEditContent): track user modifications for model capabilities
- Added a state variable to track if the user has modified model capabilities.
- Updated the handleTypeChange function to set the modification flag when types are changed.
- Modified the reset button to only display when there are user modifications, enhancing the user interface and interaction clarity.
* feat(models): add support for Zhipu model and enhance reasoning checks
- Introduced support for the new Zhipu model (GLM-4.5) in the models configuration.
- Added functions to check if the Zhipu model supports reasoning and thinking tokens.
- Updated the ThinkingButton component to recognize Zhipu model options and integrate them into the reasoning effort logic.
- Ensured that the reasoning checks are streamlined to include the new Zhipu model alongside existing models.
* feat(models): expand Zhipu model support and refine reasoning checks
- Added new Zhipu models: GLM-4.5-Flash, GLM-4.5-AIR, GLM-4.5-AIRX, and GLM-4.5-X to the models configuration.
- Enhanced the isZhipuReasoningModel function to include checks for the new models and ensure robust reasoning validation.
- Removed redundant checks for 'glm-z1' from the isReasoningModel function to streamline logic.
* fix(LocalBackup): streamline local backup directory handling
- Added a new state to manage the resolved local backup directory in LocalBackupSettings.
- Updated the LocalBackupManager component to use the resolved directory instead of the raw input.
- Enhanced the backupToLocal and restoreFromLocal functions to resolve the local backup directory path before use, improving reliability.
* refactor(Backup): remove setLocalBackupDir functionality
- Removed the setLocalBackupDir method and its associated IPC channel handling from the BackupManager and IpcChannel.
- Updated LocalBackupSettings to eliminate direct calls to setLocalBackupDir, instead resolving the local backup directory path directly.
- Cleaned up related code in the BackupService to streamline local backup operations.
* format code
- Implemented a function to check system and application architecture compatibility.
- Added error handling to notify users of architecture mismatches during installation.
- Enhanced the custom initialization macro to include architecture checks before proceeding with installation.
* feat: add Top-P parameter toggle with default enabled state and improved UI styling
* fix: resolve undefined enableTopP issue in ppio models by using getAssistantSettings
* refactor(api): Unify getTopP method to BaseApiClient
* feat(settings): adjust layout of Top-P setting in assistant model settings
* feat: add temperature parameter toggle control with UI and multi-language support
* fix: Fix lint error
* fix: Sort these imports
* style(settings): refactor model settings layout and styles
* chore: yarn sync:i18n
* feat(ipc): add isPathInside functionality to check path relationships
- Introduced a new IPC channel for checking if a path is inside another path, enhancing path validation capabilities.
- Implemented the isPathInside function in the file utility, which accurately determines parent-child path relationships, handling edge cases.
- Updated relevant components to utilize the new isPathInside function for validating app data and backup paths, ensuring better user experience and error handling.
- Added comprehensive tests for isPathInside to cover various scenarios, including edge cases and error handling.
* format code
- Removed the specific check for Grok models in OpenAIApiClient and consolidated it with the general reasoning effort model check.
- Added support for a new Perplexity model, 'sonar-deep-research', in the models configuration.
- Updated the reasoning model checks to include Perplexity models in the models.ts file.
- Enhanced the ThinkingButton component to recognize and handle Perplexity model options.
* feat(ModelList): add support for 'supported_text_delta' in model configuration
- Introduced a new boolean property 'supported_text_delta' to the model configuration, allowing models to indicate support for text delta outputs.
- Updated the AddModelPopup and ModelEditContent components to handle this new property, including UI elements for user interaction.
- Enhanced migration logic to set default values for existing models based on compatibility checks.
- Added corresponding translations for the new property in the i18n files.
* feat(OpenAIApiClient): enhance support for Qwen MT model and system message handling
- Added support for Qwen MT model in OpenAIApiClient, including translation options based on target language.
- Updated system message handling to accommodate models that do not support system messages.
- Introduced utility functions to identify Qwen MT models and their compatibility with text delta outputs.
- Enhanced TextChunkMiddleware to handle text accumulation based on model capabilities.
- Updated model configuration to include Qwen MT in the list of excluded models for function calling.
* feat(i18n): add translations for 'supported_text_delta' in multiple languages
- Introduced new translation entries for the 'supported_text_delta' property in English, Japanese, Russian, and Traditional Chinese localization files.
- Updated the corresponding labels and tooltips to enhance user experience across different languages.
* refactor(ModelEditContent): reposition 'supported_text_delta' input for improved UI layout
- Moved the 'supported_text_delta' Form.Item from its previous location to enhance the user interface and maintain consistency in the model editing experience.
- Ensured that the switch input for 'supported_text_delta' is now displayed in a more logical order within the form.
* fix(TextChunkMiddleware): update condition for supported_text_delta check
- Changed the condition in TextChunkMiddleware to explicitly check for 'supported_text_delta' being false, improving clarity in the logic.
- Updated test cases to reflect the new structure of model configurations, ensuring 'supported_text_delta' is consistently set to true for relevant models.
* feat(migrate): add support for 'supported_text_delta' in assistant models
- Updated migration logic to set 'supported_text_delta' for both default and specific models within assistants.
- Implemented checks to ensure compatibility with text delta outputs, enhancing model configuration consistency.
* feat(ModelList): add 'supported_text_delta' to model addition logic
- Enhanced the model addition process in EditModelsPopup, NewApiAddModelPopup, and NewApiBatchAddModelPopup to include the 'supported_text_delta' property.
- Ensured consistency across components by setting 'supported_text_delta' to true when adding models, improving compatibility with text delta outputs.
* feat(migrate): streamline model text delta support in migration logic
- Refactored migration logic to utilize a new helper function for updating the 'supported_text_delta' property across various model types, enhancing code clarity and reducing redundancy.
- Ensured that all relevant models, including those in assistants and LLM providers, are correctly configured for text delta compatibility during migration.
* feat(OpenAIApiClient): integrate language mapping for Qwen MT model translations
- Updated the OpenAIApiClient to utilize a new utility function for mapping target languages to Qwen MT model names, enhancing translation accuracy.
- Refactored migration logic to ensure default tool use mode is set for assistants lacking this configuration, improving user experience.
- Added a new utility function for language mapping in the utils module, supporting better integration with translation features.
* feat(ModelList): update model addition logic to determine 'supported_text_delta'
- Integrated a new utility function to assess model compatibility with text delta outputs during the model addition process in AddModelPopup.
- Simplified the logic for setting the 'supported_text_delta' property, enhancing clarity and ensuring accurate model configuration.
* feat(ModelList): unify model addition logic for 'supported_text_delta'
- Refactored model addition across AddModelPopup, EditModelsPopup, NewApiAddModelPopup, and NewApiBatchAddModelPopup to consistently determine 'supported_text_delta' using a utility function.
- Simplified the logic for setting 'supported_text_delta', enhancing clarity and ensuring accurate model configuration across components.
* feat(models): add support for new Qwen model and update effort ratio
- Introduced support for the 'qwen3-235b-a22b-thinking' model with a max token limit of 81,920.
- Updated the model options in ThinkingButton to include 'qwen_3235ba22b_thinking'.
- Adjusted the effort ratio for 'low' from 0.2 to 0.05 for improved performance.
* chore: remove
* feat(MCPService, MCPSettings, MessageTools): enhance long-running server support and UI integration
- Added support for long-running server configurations in MCPService, allowing for timeout adjustments based on server settings.
- Introduced a new `longRunning` property in MCPSettings to manage server behavior and UI elements accordingly.
- Integrated a ProgressBar component in MessageTools to visually represent progress for long-running operations, improving user experience.
* refactor(IpcChannel, MCPService, MessageTools): remove progress IPC channel and integrate progress handling
- Removed the `Mcp_SetProgress` channel from `IpcChannel` and its associated handlers in `ipc.ts` and `preload/index.ts`.
- Integrated progress handling directly in `McpService` to send progress updates to the main window.
- Updated `MessageTools` to display progress using Ant Design's `Progress` component, enhancing the user interface for long-running operations.
- Deleted the `ProgressBar` component as its functionality has been replaced by the new progress handling approach.
* feat(MCPService): add maxTotalTimeout configuration for long-running operations
- Introduced a new `maxTotalTimeout` property in MCPService to define a maximum timeout duration for long-running server operations, enhancing control over server behavior based on the `longRunning` setting.
* refactor(MCPService): remove unused notification handler for cancelled operations
* Removed the CancelledNotificationHandler from MCPService to streamline notification handling and improve code clarity.
* Updated MessageTools component to simplify rendering logic for status indicators, enhancing readability and maintainability.
* refactor(knowledge): simplify dimension settings, support base migration
Embedding dimension
- remove 'auto set dimension', let the user take control
- reuse findModelById
- improve error messages for VoyageEmbeddings
Knowledgebase migration
- enable migration when model or dimension changes
- add knowledgeThunk to reuse code
KnowledgeSettings
- unify UI for AddKnowledgeBasePopup and EditKnowledgeBasePopup
- refactor KnowledgeSettings, split it to smaller components
Tests:
- knowledgeThunk
- InputEmbeddingDimension
- KnowledgeBaseFormModal
- GeneralSettingsPanel
- AdvancedSettingsPanel
- InfoTooltip
Misc.
- add InfoTooltip
- remove MemoriesSettingsModal
* fix: i18n and vitest config
* refactor(useSmoothStream): optimize chunk handling and state management
- Replaced state management with refs for chunk queue to improve performance and reduce unnecessary re-renders.
- Introduced Intl.Segmenter for better character segmentation based on language support.
- Updated rendering logic to ensure final text is displayed correctly when the stream ends.
- Cleaned up unused effects and comments for improved code clarity.
* refactor(useSmoothStream): move segmenter initialization outside of addChunk function
- Moved the initialization of Intl.Segmenter to the top of the file for better performance and to avoid redundant instantiation within the addChunk callback.
- This change enhances the efficiency of chunk processing in the useSmoothStream hook.
Use spread operator to copy all fields from parsed JSON instead of manually
mapping specific fields. This ensures all MCPServer properties including
headers, timeout, dxtVersion, and other optional fields are preserved during
JSON import.
Previously missing fields:
- headers: Record<string, string>
- timeout: number
- dxtVersion: string
- dxtPath: string
- Other optional MCPServer properties
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-authored-by: Claude <noreply@anthropic.com>
* chore(env): add .env.example file and update .gitignore
- Introduced a new .env.example file with NODE_OPTIONS configuration.
- Updated .gitignore to exclude .env.example from being ignored.
- Added instructions in dev.md for copying .env.example to .env.
* fix(MessageTools): improve error handling and logging in message preview rendering (#8453)
- Enhanced the rendering logic for message previews by adding a try-catch block to handle JSON parsing errors more gracefully.
- Updated the error handling to provide clearer error messages in the preview when exceptions occur.
- Added debug logging to track the rendering process of message content.
* refactor(Theme): update theme management to use setTheme function
- Replaced toggleTheme with setTheme for more explicit theme handling.
- Removed unused SunMoon icon from TabContainer and Sidebar components.
- Updated theme icon rendering logic to directly reflect the current theme state.
- Adjusted ThemeProvider to include setTheme in context for better theme management.
* refactor(ModelList): streamline button layout and improve accessibility
- Removed tooltip wrappers from manage and add model buttons for a cleaner UI.
- Introduced a new Flex container for primary and default buttons, enhancing layout consistency.
- Updated button rendering to improve accessibility and user experience.
* feat(ModelList): add bulk add/remove functionality for models with confirmation dialog
- Implemented onAddAll and onRemoveAll functions to handle bulk actions for models.
- Added confirmation dialog for adding all models to the list, enhancing user experience.
- Updated translations for confirmation messages in multiple languages.
* chore(languages): update languages with a script (#8445)
* chore(languages): update languages with a script
* refactor: update languages and merge it into constants
* refactor: add usf and ush
* refactor(ipc): enhance write permission check and add untildify utility
- Updated the hasWritePermission function to resolve paths using the new untildify utility, improving path handling.
- Modified IPC handler to await the permission check for better asynchronous handling.
- Introduced a new untildify function to convert paths starting with '~' to the user's home directory.
* fix(ModelEdit): enhance model type management and introduce new selection logic (#8420)
* fix(ModelEdit): enhance model type management and introduce new selection logic
- Added support for 'rerank' model type in the ModelEditContent component.
- Refactored type selection logic to utilize new utility functions for finding differences and unions in model types.
- Updated model type handling to include user selection status, improving user experience in type management.
- Adjusted migration logic to initialize newType for existing models, ensuring backward compatibility.
- Introduced isUserSelectedModelType utility to streamline model type checks across the application.
* refactor(isFunctionCallingModel): simplify model type check logic
- Replaced the inline check for 'function_calling' model type with a call to the new utility function isUserSelectedModelType, enhancing code clarity and maintainability.
* feat(collection): add utility functions for array operations
- Introduced `findIntersection`, `findDifference`, and `findUnion` functions to handle array operations with support for custom key selectors and comparison functions.
- Removed previous implementations from `index.ts` to streamline utility exports.
- Added comprehensive tests for new functions covering basic types and object types with various edge cases.
* refactor(collection): rename utility functions for clarity
- Renamed `findIntersection`, `findDifference`, and `findUnion` to `getIntersection`, `getDifference`, and `getUnion` respectively for improved clarity and consistency in naming.
- Updated corresponding tests to reflect the new function names, ensuring all tests pass with the updated utility functions.
* refactor(ModelEditContent): update model type management and improve selection logic
- Replaced utility function calls to `findDifference` and `findUnion` with `getDifference` and `getUnion` for consistency.
- Introduced temporary state management for model types to enhance user selection handling.
- Added a reset functionality for model type selections, improving user experience.
- Updated the rendering logic to conditionally disable certain model types based on user selections.
* fix(ModelEditContent): enhance model type selection logic with conditional disabling
- Introduced logic to conditionally disable 'rerank' and 'embedding' model types based on user selections.
- Updated the state management for model types to ensure correct user selection handling.
- Improved the confirmation modal to reflect the updated selection logic for better user experience.
* fix(ModelEditContent): refine model type selection and update confirmation logic
- Enhanced the logic for model type selection to ensure accurate user selections for 'rerank' and 'embedding'.
- Updated the confirmation modal to reflect changes in selection handling, improving user experience.
- Adjusted state management to correctly handle updates based on selected model types.
* fix(models): update model support logic to include 'qwen3-235b-a22b-instruct'
* refactor(models): rename 'newType' to 'capabilities' and update related logic in ModelEditContent and migration scripts
* feat(ipc): add App_ResolvePath channel and update path handling
- Introduced a new IPC channel `App_ResolvePath` to resolve file paths, enhancing path management.
- Updated the `hasWritePermission` function to log the original directory instead of the resolved one.
- Modified the `LocalBackupSettings` component to utilize the new `resolvePath` method for improved directory validation.
* add ut
* fix comments
* fix clear manually
* delete duplicate var
---------
Co-authored-by: kangfenmao <kangfenmao@qq.com>
Co-authored-by: SuYao <sy20010504@gmail.com>
Co-authored-by: one <wangan.cs@gmail.com>
* refactor(CodeEditor): add fontSize to props
* feat: use CodeEditor in assistant prompt settings
* refactor(font): add code font family for windows
* refactor: support Sarasa
* chore(env): add .env.example file and update .gitignore
- Introduced a new .env.example file with NODE_OPTIONS configuration.
- Updated .gitignore to exclude .env.example from being ignored.
- Added instructions in dev.md for copying .env.example to .env.
* fix(MessageTools): improve error handling and logging in message preview rendering (#8453)
- Enhanced the rendering logic for message previews by adding a try-catch block to handle JSON parsing errors more gracefully.
- Updated the error handling to provide clearer error messages in the preview when exceptions occur.
- Added debug logging to track the rendering process of message content.
* refactor(Theme): update theme management to use setTheme function
- Replaced toggleTheme with setTheme for more explicit theme handling.
- Removed unused SunMoon icon from TabContainer and Sidebar components.
- Updated theme icon rendering logic to directly reflect the current theme state.
- Adjusted ThemeProvider to include setTheme in context for better theme management.
* refactor(ModelList): streamline button layout and improve accessibility
- Removed tooltip wrappers from manage and add model buttons for a cleaner UI.
- Introduced a new Flex container for primary and default buttons, enhancing layout consistency.
- Updated button rendering to improve accessibility and user experience.
* feat(ModelList): add bulk add/remove functionality for models with confirmation dialog
- Implemented onAddAll and onRemoveAll functions to handle bulk actions for models.
- Added confirmation dialog for adding all models to the list, enhancing user experience.
- Updated translations for confirmation messages in multiple languages.
* chore(languages): update languages with a script (#8445)
* chore(languages): update languages with a script
* refactor: update languages and merge it into constants
* refactor: add usf and ush
* fix(ModelEdit): enhance model type management and introduce new selection logic (#8420)
* fix(ModelEdit): enhance model type management and introduce new selection logic
- Added support for 'rerank' model type in the ModelEditContent component.
- Refactored type selection logic to utilize new utility functions for finding differences and unions in model types.
- Updated model type handling to include user selection status, improving user experience in type management.
- Adjusted migration logic to initialize newType for existing models, ensuring backward compatibility.
- Introduced isUserSelectedModelType utility to streamline model type checks across the application.
* refactor(isFunctionCallingModel): simplify model type check logic
- Replaced the inline check for 'function_calling' model type with a call to the new utility function isUserSelectedModelType, enhancing code clarity and maintainability.
* feat(collection): add utility functions for array operations
- Introduced `findIntersection`, `findDifference`, and `findUnion` functions to handle array operations with support for custom key selectors and comparison functions.
- Removed previous implementations from `index.ts` to streamline utility exports.
- Added comprehensive tests for new functions covering basic types and object types with various edge cases.
* refactor(collection): rename utility functions for clarity
- Renamed `findIntersection`, `findDifference`, and `findUnion` to `getIntersection`, `getDifference`, and `getUnion` respectively for improved clarity and consistency in naming.
- Updated corresponding tests to reflect the new function names, ensuring all tests pass with the updated utility functions.
* refactor(ModelEditContent): update model type management and improve selection logic
- Replaced utility function calls to `findDifference` and `findUnion` with `getDifference` and `getUnion` for consistency.
- Introduced temporary state management for model types to enhance user selection handling.
- Added a reset functionality for model type selections, improving user experience.
- Updated the rendering logic to conditionally disable certain model types based on user selections.
* fix(ModelEditContent): enhance model type selection logic with conditional disabling
- Introduced logic to conditionally disable 'rerank' and 'embedding' model types based on user selections.
- Updated the state management for model types to ensure correct user selection handling.
- Improved the confirmation modal to reflect the updated selection logic for better user experience.
* fix(ModelEditContent): refine model type selection and update confirmation logic
- Enhanced the logic for model type selection to ensure accurate user selections for 'rerank' and 'embedding'.
- Updated the confirmation modal to reflect changes in selection handling, improving user experience.
- Adjusted state management to correctly handle updates based on selected model types.
* fix(models): update model support logic to include 'qwen3-235b-a22b-instruct'
* refactor(models): rename 'newType' to 'capabilities' and update related logic in ModelEditContent and migration scripts
* refactor(ModelEditContent): remove maskClosable prop for improved modal behavior
* fix(ThinkingTagExtraction): add new tag configuration for 'kimi-vl-a3b-thinking' model (#8459)
* feat(ThinkingTagExtraction): add new tag configuration for 'kimi-vl-a3b-thinking' model and update model regex patterns in config
- Introduced a new tag configuration for the 'kimi-vl-a3b-thinking' model in ThinkingTagExtractionMiddleware.
- Updated models.ts to include regex patterns for 'kimi-vl-a3b-thinking', 'llama-guard-4', and 'llama-4' to enhance model compatibility.
* feat(models): add regex pattern for 'gemma3' model to enhance model compatibility
* fix(RawStreamListenerMiddleware): update model check (#8433)
* fix(RawStreamListenerMiddleware): update model check for Anthropic API integration
- Replaced provider type check with model ID check to enhance compatibility with Claude models.
- Improved clarity in the middleware logic for handling raw output from the SDK.
* refactor(RawStreamListenerMiddleware): enhance model identification for Anthropic integration
- Introduced a new utility function `isAnthropicModel` to streamline model checks across the codebase.
- Updated middleware logic to utilize the new function for improved clarity and maintainability.
- Adjusted related tests to ensure compatibility with the updated model identification approach.
* test(ApiService.test): add mock for isAnthropicModel to enhance test coverage for model identification
* refactor(ChatNavbar, Navbar): simplify toggle functions and remove unused fullscreen hook
- Removed unnecessary useCallback functions for toggling assistants and topics, directly using the toggle functions instead.
- Eliminated the unused fullscreen hook import to clean up the code.
- Updated click handlers in the Navbar components for better readability and efficiency.
* chore(version): 1.5.3
* style(MinAppsPage): adjust padding for AppsContainerWrapper based on navbar position
- Increased padding for the AppsContainerWrapper to 50px for better spacing.
- Added conditional padding for when the navbar is positioned at the top, reverting to 20px for improved layout consistency.
* fix(AiProvider): remove unnecessary middleware removal logic for… (#8437)
* refactor(AiProvider): remove unnecessary middleware removal logic for improved clarity
* feat(PPIOAPIClient): add compatibility type check for OpenAIAPIClient
* refactor(ModelEditContent): rename state variable for clarity and update model capabilities handling
- Renamed `tempModelTypes` to `modelCapabilities` for improved clarity in the ModelEditContent component.
- Updated state management and logic to consistently use the new `modelCapabilities` variable throughout the component, enhancing readability and maintainability.
* Feat/vertex-claude-support (#7564)
* 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
* feat(vertex-sdk): integrate Anthropic Vertex SDK and add access token retrieval
- Added support for the new `@anthropic-ai/vertex-sdk` in the project.
- Introduced a new IPC channel `VertexAI_GetAccessToken` to retrieve access tokens.
- Implemented `getAccessToken` method in `VertexAIService` to handle service account authentication.
- Updated the `IpcChannel` enum and related IPC handlers to support the new functionality.
- Enhanced the `VertexAPIClient` to utilize the `AnthropicVertexClient` for model handling.
- Refactored existing code to accommodate the integration of the Vertex SDK and improve modularity.
* feat(vertex-ai): enhance VertexAI settings and API host management
- Added a new method to format the API host URL in both AnthropicVertexClient and VertexAPIClient.
- Updated getBaseURL methods to utilize the new formatting logic.
- Enhanced VertexAISettings component to include an input for API host configuration, with help text for user guidance.
- Updated localization files to include new help text for the API host field in multiple languages.
* fix(vertex-sdk): update baseURL handling and patch dependencies
- Refactored baseURL assignment in AnthropicVertexClient to ensure it defaults to undefined when the URL is empty.
- Updated yarn.lock to reflect changes in dependency resolution and checksum for @anthropic-ai/vertex-sdk patch.
* refactor(VertexAISetting): use provider.id rather than provider
* refactor: improve API host formatting in AnthropicVertexClient
- Updated the `formatApiHost` method to streamline host URL handling.
- Introduced a helper function to determine if the original host should be used based on its format.
- Ensured consistent appending of the `/v1/` path for valid API requests.
* fix: handle empty host in AnthropicVertexClient
- Added a check in the `getBaseURL` method to return the host if it is empty, preventing potential errors.
- Included a console log for the base URL to aid in debugging and verification of the URL formatting.
* feat(AnthropicVertexClient): add logging for authentication errors and mock client in tests
- Introduced logging functionality in AnthropicVertexClient to replace console.error with logger service for better error tracking.
- Added mock implementation for AnthropicVertexClient in tests to enhance testing capabilities.
- Updated package.json to include the @aws-sdk/client-s3 dependency.
* feat(tests): add comprehensive tests for client compatibility types
- Introduced a new test file to validate compatibility types for various API clients including OpenAI, Anthropic, Gemini, Aihubmix, NewAPI, and Vertex.
- Implemented mock services to facilitate testing and ensure isolation of client behavior.
- Added tests for both direct API clients and decorator pattern clients, ensuring correct compatibility type returns.
- Enhanced middleware compatibility logic tests to verify correct identification of compatible clients.
---------
Co-authored-by: one <wangan.cs@gmail.com>
* fix(mcp-tools): enhance tool lookup logic to support partial matches (#8473)
* fix(mcp-tools): enhance tool lookup logic to support partial matches
- Updated the tool lookup logic in `geminiFunctionCallToMcpTool` to include partial matches for both tool IDs and names, improving the flexibility of tool identification.
* refactor(mcp-tools): simplify tool lookup logic for improved clarity
- Refactored the tool lookup logic in `geminiFunctionCallToMcpTool` to streamline the identification process by consolidating checks for tool IDs and names into a single variable. This enhances readability and maintains functionality for partial matches.
* chore(deps): update vite to rolldown-vite (#8460)
* chore(deps): update vite to rolldown-vite and add new dependencies
- Updated vite dependency to rolldown-vite@latest in package.json.
- Added new dependencies including @emnapi/core, @emnapi/runtime, and @napi-rs/wasm-runtime in yarn.lock.
- Introduced patches for atomically and file-stream-rotator packages.
- Added process import in index.ts for improved functionality.
* updrade vitest
* not package graceful-fs
* update yarn.lock
* fix(AppUpdater): improve update handling and logging for test plans
- Enhanced the update logic in AppUpdater to prevent sending an 'update not available' event when a test plan is enabled and the channel is not the latest.
- Refactored the feed URL and channel setting into a private method for better code organization.
- Added logging to provide clearer insights into the update check results and channel settings, particularly when the test plan is active.
---------
Co-authored-by: kangfenmao <kangfenmao@qq.com>
Co-authored-by: SuYao <sy20010504@gmail.com>
Co-authored-by: one <wangan.cs@gmail.com>
- Removed the reasoning check from the ThinkChunkMiddleware to streamline the processing logic.
- This change enhances the middleware's efficiency by focusing on handling streams directly without the reasoning condition.
- Updated navigation logic in `useMCPServers` and `McpServersList` to use server IDs in the URL for better routing.
- Implemented scroll position memory in `McpServersList` to enhance user experience when navigating back to the server list.
- Adjusted route parameters in `MCPSettings` to retrieve server IDs from the URL, improving data handling and clarity.
* chore(deps): update vite to rolldown-vite and add new dependencies
- Updated vite dependency to rolldown-vite@latest in package.json.
- Added new dependencies including @emnapi/core, @emnapi/runtime, and @napi-rs/wasm-runtime in yarn.lock.
- Introduced patches for atomically and file-stream-rotator packages.
- Added process import in index.ts for improved functionality.
* updrade vitest
* not package graceful-fs
* update yarn.lock
* fix(mcp-tools): enhance tool lookup logic to support partial matches
- Updated the tool lookup logic in `geminiFunctionCallToMcpTool` to include partial matches for both tool IDs and names, improving the flexibility of tool identification.
* refactor(mcp-tools): simplify tool lookup logic for improved clarity
- Refactored the tool lookup logic in `geminiFunctionCallToMcpTool` to streamline the identification process by consolidating checks for tool IDs and names into a single variable. This enhances readability and maintains functionality for partial matches.
* 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
* feat(vertex-sdk): integrate Anthropic Vertex SDK and add access token retrieval
- Added support for the new `@anthropic-ai/vertex-sdk` in the project.
- Introduced a new IPC channel `VertexAI_GetAccessToken` to retrieve access tokens.
- Implemented `getAccessToken` method in `VertexAIService` to handle service account authentication.
- Updated the `IpcChannel` enum and related IPC handlers to support the new functionality.
- Enhanced the `VertexAPIClient` to utilize the `AnthropicVertexClient` for model handling.
- Refactored existing code to accommodate the integration of the Vertex SDK and improve modularity.
* feat(vertex-ai): enhance VertexAI settings and API host management
- Added a new method to format the API host URL in both AnthropicVertexClient and VertexAPIClient.
- Updated getBaseURL methods to utilize the new formatting logic.
- Enhanced VertexAISettings component to include an input for API host configuration, with help text for user guidance.
- Updated localization files to include new help text for the API host field in multiple languages.
* fix(vertex-sdk): update baseURL handling and patch dependencies
- Refactored baseURL assignment in AnthropicVertexClient to ensure it defaults to undefined when the URL is empty.
- Updated yarn.lock to reflect changes in dependency resolution and checksum for @anthropic-ai/vertex-sdk patch.
* refactor(VertexAISetting): use provider.id rather than provider
* refactor: improve API host formatting in AnthropicVertexClient
- Updated the `formatApiHost` method to streamline host URL handling.
- Introduced a helper function to determine if the original host should be used based on its format.
- Ensured consistent appending of the `/v1/` path for valid API requests.
* fix: handle empty host in AnthropicVertexClient
- Added a check in the `getBaseURL` method to return the host if it is empty, preventing potential errors.
- Included a console log for the base URL to aid in debugging and verification of the URL formatting.
* feat(AnthropicVertexClient): add logging for authentication errors and mock client in tests
- Introduced logging functionality in AnthropicVertexClient to replace console.error with logger service for better error tracking.
- Added mock implementation for AnthropicVertexClient in tests to enhance testing capabilities.
- Updated package.json to include the @aws-sdk/client-s3 dependency.
* feat(tests): add comprehensive tests for client compatibility types
- Introduced a new test file to validate compatibility types for various API clients including OpenAI, Anthropic, Gemini, Aihubmix, NewAPI, and Vertex.
- Implemented mock services to facilitate testing and ensure isolation of client behavior.
- Added tests for both direct API clients and decorator pattern clients, ensuring correct compatibility type returns.
- Enhanced middleware compatibility logic tests to verify correct identification of compatible clients.
---------
Co-authored-by: one <wangan.cs@gmail.com>
- Renamed `tempModelTypes` to `modelCapabilities` for improved clarity in the ModelEditContent component.
- Updated state management and logic to consistently use the new `modelCapabilities` variable throughout the component, enhancing readability and maintainability.
- Increased padding for the AppsContainerWrapper to 50px for better spacing.
- Added conditional padding for when the navbar is positioned at the top, reverting to 20px for improved layout consistency.
- Removed unnecessary useCallback functions for toggling assistants and topics, directly using the toggle functions instead.
- Eliminated the unused fullscreen hook import to clean up the code.
- Updated click handlers in the Navbar components for better readability and efficiency.
* fix(RawStreamListenerMiddleware): update model check for Anthropic API integration
- Replaced provider type check with model ID check to enhance compatibility with Claude models.
- Improved clarity in the middleware logic for handling raw output from the SDK.
* refactor(RawStreamListenerMiddleware): enhance model identification for Anthropic integration
- Introduced a new utility function `isAnthropicModel` to streamline model checks across the codebase.
- Updated middleware logic to utilize the new function for improved clarity and maintainability.
- Adjusted related tests to ensure compatibility with the updated model identification approach.
* test(ApiService.test): add mock for isAnthropicModel to enhance test coverage for model identification
* feat(ThinkingTagExtraction): add new tag configuration for 'kimi-vl-a3b-thinking' model and update model regex patterns in config
- Introduced a new tag configuration for the 'kimi-vl-a3b-thinking' model in ThinkingTagExtractionMiddleware.
- Updated models.ts to include regex patterns for 'kimi-vl-a3b-thinking', 'llama-guard-4', and 'llama-4' to enhance model compatibility.
* feat(models): add regex pattern for 'gemma3' model to enhance model compatibility
* feat:update kimi setting
* feat:update kimi logo
* mergei18n
* 仅修复 eslint error
Improves code readability by reformatting Moonshot provider configuration and related ternary expressions. Indentation and spacing are adjusted for consistency, with no functional changes.
* change kimi logo to 200x200
* update
* update 2 warnings in AssistantModelSettings.tsx
* fix: lint error
* fix: test error
---------
Co-authored-by: 自由的世界人 <3196812536@qq.com>
Co-authored-by: xiaochen <gongxiaochen@msh.team>
* fix(ModelEdit): enhance model type management and introduce new selection logic
- Added support for 'rerank' model type in the ModelEditContent component.
- Refactored type selection logic to utilize new utility functions for finding differences and unions in model types.
- Updated model type handling to include user selection status, improving user experience in type management.
- Adjusted migration logic to initialize newType for existing models, ensuring backward compatibility.
- Introduced isUserSelectedModelType utility to streamline model type checks across the application.
* refactor(isFunctionCallingModel): simplify model type check logic
- Replaced the inline check for 'function_calling' model type with a call to the new utility function isUserSelectedModelType, enhancing code clarity and maintainability.
* feat(collection): add utility functions for array operations
- Introduced `findIntersection`, `findDifference`, and `findUnion` functions to handle array operations with support for custom key selectors and comparison functions.
- Removed previous implementations from `index.ts` to streamline utility exports.
- Added comprehensive tests for new functions covering basic types and object types with various edge cases.
* refactor(collection): rename utility functions for clarity
- Renamed `findIntersection`, `findDifference`, and `findUnion` to `getIntersection`, `getDifference`, and `getUnion` respectively for improved clarity and consistency in naming.
- Updated corresponding tests to reflect the new function names, ensuring all tests pass with the updated utility functions.
* refactor(ModelEditContent): update model type management and improve selection logic
- Replaced utility function calls to `findDifference` and `findUnion` with `getDifference` and `getUnion` for consistency.
- Introduced temporary state management for model types to enhance user selection handling.
- Added a reset functionality for model type selections, improving user experience.
- Updated the rendering logic to conditionally disable certain model types based on user selections.
* fix(ModelEditContent): enhance model type selection logic with conditional disabling
- Introduced logic to conditionally disable 'rerank' and 'embedding' model types based on user selections.
- Updated the state management for model types to ensure correct user selection handling.
- Improved the confirmation modal to reflect the updated selection logic for better user experience.
* fix(ModelEditContent): refine model type selection and update confirmation logic
- Enhanced the logic for model type selection to ensure accurate user selections for 'rerank' and 'embedding'.
- Updated the confirmation modal to reflect changes in selection handling, improving user experience.
- Adjusted state management to correctly handle updates based on selected model types.
* fix(models): update model support logic to include 'qwen3-235b-a22b-instruct'
* refactor(models): rename 'newType' to 'capabilities' and update related logic in ModelEditContent and migration scripts
- Implemented onAddAll and onRemoveAll functions to handle bulk actions for models.
- Added confirmation dialog for adding all models to the list, enhancing user experience.
- Updated translations for confirmation messages in multiple languages.
- Removed tooltip wrappers from manage and add model buttons for a cleaner UI.
- Introduced a new Flex container for primary and default buttons, enhancing layout consistency.
- Updated button rendering to improve accessibility and user experience.
- Replaced toggleTheme with setTheme for more explicit theme handling.
- Removed unused SunMoon icon from TabContainer and Sidebar components.
- Updated theme icon rendering logic to directly reflect the current theme state.
- Adjusted ThemeProvider to include setTheme in context for better theme management.
- Enhanced the rendering logic for message previews by adding a try-catch block to handle JSON parsing errors more gracefully.
- Updated the error handling to provide clearer error messages in the preview when exceptions occur.
- Added debug logging to track the rendering process of message content.
- Introduced a new .env.example file with NODE_OPTIONS configuration.
- Updated .gitignore to exclude .env.example from being ignored.
- Added instructions in dev.md for copying .env.example to .env.
- Updated lucide-react dependency from 0.487.0 to 0.525.0 in package.json and yarn.lock.
- Added fallback language configuration in i18n setup for improved localization support.
- Refactored Tabs component to utilize classNames for conditional styling.
- Adjusted TopicsTab component's style for better layout management.
- Introduced a button in AboutSettings to open documentation based on the user's language preference.
* fix(inputSchemas): convert input schemas to JSON schema format for consistency across DifyKnowledgeServer and FileSystemServer
* fix(AnthropicAPIClient): handle empty accumulated JSON input gracefully and improve auto-approval logic for built-in tools
* feat(ApiService.test): add tests for Anthropic API client integration and response handling
- Introduced mock implementation for AnthropicAPIClient to simulate completions and response transformations.
- Added test cases to validate the streaming of chunks with correct types and content for the Anthropic model.
- Enhanced existing tests to ensure compatibility with both Gemini and Anthropic API clients.
* feat(ApiService.test): enhance tests for Anthropic API client with streaming support
- Added new test cases for streaming responses from the Anthropic API client, validating chunk types and content.
- Refactored existing tests to differentiate between non-streaming and streaming chunk generators.
- Updated mock implementations to support both streaming and non-streaming scenarios for comprehensive testing.
* test: add test for thinking tag extraction middleware
* revert: unrelated changes
---------
Co-authored-by: one <wangan.cs@gmail.com>
* refactor: streamline system prompt handling and introduce built-in tools
- Removed the static SYSTEM_PROMPT_THRESHOLD from BaseApiClient and replaced it with a constant in constant.ts.
- Updated API clients (AnthropicAPIClient, GeminiAPIClient, OpenAIApiClient, OpenAIResponseAPIClient) to simplify system prompt logic by eliminating unnecessary checks and using new utility functions for prompt building.
- Introduced built-in tools functionality, including a new 'think' tool, to enhance the tool usage experience.
- Refactored ApiService to integrate built-in tools and adjust system prompt modifications accordingly.
- Added utility functions for managing built-in tools in mcp-tools.ts and created a new tools index for better organization.
* refactor(tests): update prompt tests to use new buildSystemPromptWithTools function
- Renamed the function used in prompt tests from buildSystemPrompt to buildSystemPromptWithTools to reflect recent changes in prompt handling.
- Adjusted test cases to ensure compatibility with the updated function, maintaining the integrity of user prompt handling.
* refactor(ApiService, mcp-tools, prompt): enhance tool usage and prompt handling
- Updated ApiService to improve system prompt construction based on tool usage mode, ensuring clearer logic for tool integration.
- Enhanced mcp-tools with a new response structure for the 'think' tool, allowing for better handling of tool responses.
- Expanded prompt utility functions to include detailed instructions for using the 'think' tool, improving user guidance.
- Refactored tests to validate new prompt building logic and tool integration, ensuring robust functionality across scenarios.
* fix: enhance prompt
* feat(McpToolChunkMiddleware): enhance tool call handling with built-in tool support
- Added support for built-in tools in the parseAndCallTools function, allowing for conditional tool invocation based on tool type.
- Implemented a check to return early if the tool call response is null, improving error handling.
refactor(useSmoothStream): remove unnecessary comments and improve state initialization in Markdown component
- Cleaned up comments in useSmoothStream for clarity.
- Updated displayedContent state initialization in Markdown to handle post-processing conditionally.
* refactor(AiProvider): enhance client compatibility checks and middleware handling
- Updated AiProvider to use a compatibility type check for API clients, improving type safety and middleware management.
- Implemented getClientCompatibilityType in AihubmixAPIClient, NewAPIClient, and OpenAIResponseAPIClient to return actual client types.
- Added support for Hunyuan models in various model checks and updated the ThinkingButton component to reflect these changes.
- Improved logging for middleware construction in AiProvider.
* test(ApiService): add client compatibility type checks for mock API clients
* fix: minimax-m1 reasoning export btw
---------
Co-authored-by: Pleasurecruise <3196812536@qq.com>
* feat: ui switch
* chore: update migration version to 122 and adjust settings topic position
* refactor: replace PinnedApps component with SidebarPinnedApps and SidebarOpenedMinappTabs for improved structure
* feat(i18n): add launchpad apps and minapps translations for multiple languages
* style: update MinAppIcon and IconContainer dimensions for improved UI consistency
* refactor: remove unused SidebarContainer component from AppsPage
* refactor: adjust Navbar padding and enhance search functionality in AgentsPage
* feat(minapps): implement MinApps page and enhance mini app management features
- Added MinAppsPage for managing mini applications.
- Introduced NewAppButton for adding custom mini apps.
- Created MiniAppSettings for configuring mini app settings.
- Enhanced mini app icon management with MiniAppIconsManager.
- Updated Router to include MinAppsPage and replaced AppsPage with MinAppsPage.
- Added translations for new mini app features in multiple languages.
* wip
* refactor: rename App component to MinApp and streamline LaunchpadPage logic
- Renamed App component to MinApp for clarity.
- Removed unnecessary state management in LaunchpadPage.
- Simplified minapp sorting logic by directly using openedKeepAliveMinapps.
* feat(i18n): update translations for multiple languages and restructure title entries
- Added missing title entries for various sections in English, Japanese, Russian, Chinese (Simplified and Traditional).
- Restructured the launchpad and minapp translations for better organization.
- Enhanced navbar display settings translations across all supported languages.
* feat: add header prop to DraggableVirtualList and implement Add Topic button in TopicsTab
- Introduced a new `header` prop in the DraggableVirtualList component to allow custom header content.
- Added an Add Topic button in the TopicsTab with a corresponding styled component and translation support for multiple languages.
- Updated styles in AssistantsTab and adjusted overflow behavior in Tabs index for better UI experience.
* style: adjust margins and max-width for improved layout in various components
- Updated margin-top in HtmlArtifactsCard for consistent spacing.
- Set max-width in MessageGroup to enhance responsiveness based on navbar position.
- Modified Add Topic button in TopicsTab to emit an event for better functionality.
* fix: correct state property name in migration for navbar position
- Updated the migration logic to set the correct state property from `topicPosition` to `navbarPosition` for proper configuration handling.
* fix: adjust traffic light position and navbar height for improved UI consistency
- Updated traffic light position in WindowService to enhance layout.
- Adjusted navbar height in color.scss for better alignment across components.
- Modified TabContainer to track last settings path and improve navigation handling.
* style: update AddTopicButton styling for improved hover effect in TopicsTab
- Changed AddTopicButton from a button to a div for better styling flexibility.
- Removed dashed border and added background color on hover for enhanced user experience.
- Retained border-radius for consistent design across components.
* feat: add TextBadge component and integrate into Display and Memory settings
- Introduced a new TextBadge component for displaying styled badges.
- Integrated TextBadge into DisplaySettings to highlight the navbar title as "New".
- Replaced inline badge implementation in MemorySettings with the new TextBadge component for consistency and improved maintainability.
* fix: adjust tab and navbar styling for improved UI consistency
- Increased height of title bar overlays for better visual balance.
- Updated tab creation logic to prevent duplicate tabs for specific paths.
- Modified tab icon and close button sizes for a more compact design.
- Enhanced tab spacing and padding for improved layout across components.
* style: update PinnedMinapps component for improved UI consistency
- Increased icon size and adjusted border radius for better visual appeal.
- Modified TopNavContainer padding and margin for enhanced layout.
- Reduced dimensions of TopNavIcon for a more compact design.
* refactor: enhance TabsContainer logic and styling for improved tab management
- Introduced a new `removeSpecialTabs` function to manage special tab removal more effectively.
- Updated tab filtering logic to utilize a dedicated `specialTabs` array for better maintainability.
- Adjusted styling in PinnedMinapps for consistent icon sizing and background color improvements.
* style: adjust layout and padding for improved UI consistency in Chat and Inputbar components
- Updated main height calculation in Chat component to account for additional spacing.
- Modified padding in Inputbar component for better alignment when navbar is positioned at the top.
- Ensured consistent minimum height in Tabs component to match updated navbar height calculations.
* refactor: update app menu item text keys for improved localization
- Changed text keys in the app menu items from specific titles to a more generalized 'title' namespace for better consistency and maintainability.
- Ensured that the visual representation of the menu items remains unchanged while enhancing the localization structure.
* refactor: simplify sidebar toggle logic in ChatNavbar and Navbar components
- Removed unnecessary cooldown logic when toggling the visibility of assistants and topics.
- Updated HomePage to conditionally render the Navbar based on the sidebar state for improved UI responsiveness.
* refactor: streamline Chat component and introduce useChatMaxWidth hook
- Consolidated max width calculation logic into a new `useChatMaxWidth` hook for better reusability.
- Removed unused variables and simplified state management in the Chat component.
- Updated MessageGroup to utilize the new `useChatMaxWidth` hook for consistent layout handling.
* refactor: remove FloatingSidebar component and integrate AssistantsDrawer for improved UI management
- Deleted the FloatingSidebar component to streamline the codebase.
- Introduced AssistantsDrawer for managing assistant interactions, enhancing user experience.
- Updated Navbar and ChatNavbar components to utilize AssistantsDrawer instead of FloatingSidebar for better responsiveness and maintainability.
* refactor: implement TabsService for improved tab management functionality
- Introduced TabsService to centralize tab operations, including closing and setting active tabs.
- Updated TabsContainer and LaunchpadPage components to utilize TabsService for closing tabs, enhancing code maintainability.
- Made minor UI adjustments in PinnedMinapps for consistent icon sizing and layout improvements.
* fix: prevent default event behavior when not in fullscreen mode
- Updated WindowService to conditionally call event.preventDefault() only when the main window is not in fullscreen, improving event handling logic.
* refactor: match provider and model using a consistent method
* refactor: use keywords matching across model selectors
* refactor: update match, reuse getFancyProviderName
* refactor: use modelSelectFilter in knowledgebase settings
* refactor: use filter in ModelList
* refactor: add filterModelsByKeywords
* refactor: add getModelSelectOptions
* style: better function names
* fix: update effect dependencies in popup and panel components
Adjusted dependency arrays in HtmlArtifactsPopup and QuickPanelView to ensure correct effect execution. This change improves state synchronization and prevents unnecessary updates.
* refactor: use match in memory settings
* refactor: add avatar to model selector
* refactor: simplify utils, move select options to components
* docs: add comments
* refactor: move filter to SelectOptions
* test: add tests for SelectOptions
* test: remove type mock
* refactor: use match in EditModelsPopup
* refactor: use SelectOptions in SelectProviderModelPopup, add more tests
* fix: api check model select
* refactor: improve websearch rag model select style
* refactor: add a ModelSelector
* test: update tests for ModelSelector
* docs: comments
---------
Co-authored-by: 自由的世界人 <3196812536@qq.com>
* fix: ensure add button is always visible for empty model providers
- Move add button outside of isEmpty(models) condition to fix regression
- Keep manage and health check buttons conditional (only show when models exist)
- Fixes issue where users cannot add first model to custom providers
- Maintains clean UI by hiding management features when no content exists
Resolves the UX blocker introduced in commit 2b0c46bf where all buttons
were hidden for empty providers, preventing users from adding initial models.
* fix: remove isEmpty check to always show model management buttons
Remove isEmpty(models) conditions for manage, search, and health check buttons
to ensure all functionality is available even with empty model lists.
* feat: implement useSmoothStream hook for dynamic text rendering
- Added a new custom hook `useSmoothStream` to manage smooth text streaming with adjustable delays.
- Integrated `useSmoothStream` into the Markdown component to enhance content display during streaming.
- Implemented logic to handle content updates and reset conditions based on block status.
* feat: enhance chunk processing in useSmoothStream hook
- Updated the `addChunk` function to split text into characters for Chinese and words for English using a regular expression.
- Improved text rendering logic to support mixed language content more effectively.
* refactor: improve regular expression for chunk processing in useSmoothStream hook
- Updated the regular expression to enhance text splitting capabilities, allowing for better handling of mixed language content, including Chinese characters and alphanumeric sequences.
* refactor: simplify character processing in useSmoothStream hook
- Replaced the regular expression for character extraction with a direct conversion of the chunk to an array of characters.
- This change streamlines the chunk processing logic, enhancing performance and readability.
* feat: add post-processing capability to Markdown component
- Enhanced the Markdown component to accept an optional post-processing function for text manipulation during streaming.
- Updated MainTextBlock to utilize the new postProcess prop, allowing for dynamic content adjustments based on citation references.
* fix: update mock Markdown component to support post-processing
- Modified the mock implementation of the Markdown component to accept and apply an optional postProcess function, ensuring that the test environment accurately reflects the updated functionality introduced in the previous commit.
* refactor(ProviderSetting): add a backtop to provider setting
* refactor: decouple ModelList from ProviderSetting
* refactor: move modellist to a single dir
* refactor: allow more props for CollapsibleSearchBar
* refactor: split ModelList into ModelList, ModelListGroup and ModelListItem
* refactor: simplify health check types, improve file structure
* refactor: split HealthStatusIndicator from list items
* refactor: better indicator tooltip
* refactor: improve model search, simplify some expressions
* refactor: further simplify ModelList by extracting onHealthCheck
* refactor: remove double scroller from EditModelsPopup
* revert: remove backtop
* fix: i18n order
* refactor: sort buttons
* refactor: move initAppDataDir function to a new utils module
- Updated the import path for initAppDataDir in bootstrap.ts to reflect its new location in the utils/init module.
- Removed the initAppDataDir function and related code from file.ts to streamline the file and improve organization.
* refactor: update import structure in ipc.ts
- Removed the import of updateAppDataConfig from file.ts and added it to the new init module for better organization and clarity in the code structure.
* refactor: rename getConfigPath to getConfigDir and update related references
- Renamed the function getConfigPath to getConfigDir for clarity.
- Updated references to the renamed function in getAppDataPathFromConfig and updateAppDataConfig to reflect the new naming convention.
* refactor: update pdfjs import and improve file filtering in electron-builder configuration
- Changed pdfjs import to a direct import from 'pdfjs-dist' for consistency across modules.
- Updated file filtering in electron-builder.yml to exclude all legacy files from pdfjs-dist instead of just specific ones.
* format code
* fix: fix persistent "Searching..." indicators for o3 model web search
- Add missing LLM_WEB_SEARCH_IN_PROGRESS event in OpenAIAPIClient
- Prevent duplicate CitationBlock creation
- Ensure search status updates correctly after completion
Fixes#8307
* fix: prevent duplicate citation blocks in web search callbacks
- Add checks in onExternalToolInProgress and onLLMWebSearchInProgress
- Return early if citationBlockId already exists
- Fixes persistent "Searching..." indicator for o3 model web search
* chore: update electron to version 37.1.0 and add node-abi dependency
* chore: specify Node.js engine version requirement in package.json
* hotfix: error on deleting assistant (#8190)
fix: error on deleting assistant
* Fix/mcp bug (#8189)
* feat(models): enhance function calling model detection and update migration logic
- Added support for 'gemini-1' in FUNCTION_CALLING_EXCLUDED_MODELS.
- Updated isFunctionCallingModel to handle optional model input.
- Modified migration logic to change tool use mode for assistants using function calling models.
* feat(models): add new models to vision and function calling lists
- Added 'kimi-thinking-preview' to visionAllowedModels.
- Added 'kimi-k2' to FUNCTION_CALLING_MODELS.
- Updated migration logic to ensure compatibility with new model settings.
* refactor(TextChunkMiddleware): streamline text accumulation logic and improve response handling
- Simplified the logic for accumulating text content and updating the internal state.
- Ensured that the final text is consistently used in response callbacks.
- Removed redundant code for handling text completion in the ToolUseExtractionMiddleware.
- Added mock state for MCP tools in tests to enhance coverage for tool use extraction.
* refactor(BaseApiClient): remove unused content extraction utility
- Replaced the usage of getContentWithTools with getMainTextContent in the getMessageContent method.
- Cleaned up imports by removing the unused getContentWithTools function.
* refactor: custom mini app loading logic (#8181)
* refactor: custom mini app loading logic
Replaces try-catch with an explicit file existence check before reading 'custom-minapps.json'. Ensures the file is created with an empty array if it does not exist, improving clarity and error handling.
* refactor: custom mini app loading logic
Simplifies the loading of custom mini apps by removing the explicit file existence check and handling the read failure case directly. If reading the file fails, an empty array is written and returned.
* fix: improve error handling in file reading for custom mini apps
* Revert "feat: optimize minapp cache with LRU (#8160)" (#8205)
This reverts commit f0043b4be5.
* feat: add support for 302AI provider in MCP settings (#7755)
* feat: add support for 302AI provider in MCP settings
- Introduced new provider for 302AI, including token management and server synchronization functionality.
- Updated SyncServersPopup to integrate 302AI provider.
- Added new file for 302AI provider utilities, including token storage and server fetching logic.
* fix: re-merge main
* chore: update check-i18n scripts and remove duplicate keys (#8203)
* chore(version): 1.5.0
* fix: handle mentions when resending message (#7819)
* fix(messageThunk): 修复重置消息时模型未正确继承的问题
* fix(消息重发): 修复重发消息时模型选择逻辑
确保当原始消息模型被提及时才使用该模型,否则使用助手默认模型
* style(PasteService): 统一文件换行符为LF格式
* Revert "style(PasteService): 统一文件换行符为LF格式"
This reverts commit 37a1443b73.
* refactor(messageThunk): 优化消息重发逻辑,分离新旧消息处理
将消息重发逻辑拆分为处理已有消息和新增提及模型消息两部分
简化条件判断,移除冗余代码
* style(messageThunk): 移除多余的空行
* fix(消息重传): 单条无提及消息重传时使用助手模型
当重传单条无提及消息时,使用助手模型进行重传,其他情况保持原有逻辑
* Revert "fix(消息重传): 单条无提及消息重传时使用助手模型"
This reverts commit 2e369174e7.
* fix(消息重发): 修改重发消息时模型设置逻辑
* feat: enhance proxy management and configuration (#8164)
* feat: enhance proxy management and configuration
- Added support for new proxy modes and improved proxy configuration handling.
- Replaced AxiosProxy with direct axios usage for HTTP requests.
- Introduced fetch-socks and undici for better proxy handling.
- Updated IPC and ConfigManager to accommodate new proxy settings.
- Removed deprecated AxiosProxy service to streamline codebase.
* format code
* feat: improve proxy configuration and monitoring
- Introduced a new mechanism to monitor system proxy changes and update configurations accordingly.
- Enhanced the configureProxy method to prevent concurrent executions and added error logging with electron-log.
- Refactored proxy handling logic to streamline the setting of global and session proxies.
- Removed deprecated methods related to proxy management for cleaner code.
* update yarn.lock
* fix: update proxy configuration logic to handle direct mode
- Modified the app's ready event to check for 'direct' mode before configuring the proxy.
- Ensured that the proxy configuration is only applied when necessary, improving efficiency.
* feat: enhance proxy configuration to support authentication
- Added userId and password fields to the proxy configuration for SOCKS connections.
- Improved handling of proxy credentials to allow for authenticated proxy usage.
* refactor: remove deprecated proxy methods and streamline configuration logic
- Eliminated the setProxy and getProxy methods from ConfigManager to simplify the proxy configuration process.
- Updated ProxyManager to initialize with a default proxy configuration and removed unnecessary checks for 'direct' mode during initialization.
- Enhanced logging for proxy configuration changes to improve traceability.
* format code
* feat: enhance WebDav and ProxyManager for self-signed certificate support
- Added handling for self-signed certificates in ProxyManager to allow secure connections with custom agents.
- Updated WebDav configuration to include an https.Agent with rejectUnauthorized set to false, facilitating connections to servers with self-signed certificates.
* delete global setting for rejectUnauthorized
* chore: update dependencies in package.json and yarn.lock
- Upgraded electron from 37.1.0 to 37.2.3.
- Updated electron-vite from 3.1.0 to 4.0.0.
- Various dependency updates in yarn.lock to align with the new versions, including Babel packages and esbuild to 0.25.6.
---------
Co-authored-by: one <wangan.cs@gmail.com>
Co-authored-by: SuYao <sy20010504@gmail.com>
Co-authored-by: 自由的世界人 <3196812536@qq.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Co-authored-by: ⌞L⌝ <151412975+mthezi@users.noreply.github.com>
Co-authored-by: kangfenmao <kangfenmao@qq.com>
Co-authored-by: Phantom <59059173+EurFelux@users.noreply.github.com>
refactor(Logger): enhance logging with environment variable support
- Updated LoggerService to utilize environment variables for filtering logs by level and module in development mode.
- Modified the logging level handling to use constants from the logger configuration.
- Enhanced documentation to include details on using environment variables for log filtering in both English and Chinese documentation files.
- Cleaned up unused type definitions related to logging.
* docs: enhance LoggerService documentation and usage guidelines
- Added details about `initWindowSource` method, emphasizing its return of the LoggerService instance for method chaining.
- Introduced a section on using LoggerService within `worker` threads, highlighting the need to call `initWindowSource` first.
- Updated both English and Chinese documentation files to reflect these changes, ensuring clarity in usage instructions for developers.
* docs: update LoggerService documentation and improve environment checks
- Enhanced documentation for using LoggerService in worker threads, clarifying logging support limitations in main and renderer processes.
- Added environment checks for development and production modes directly in the LoggerService.
- Removed the unused env utility file to streamline the codebase.
* refactor(ShikiStreamService): update highlighter management and improve test assertions
- Modified the highlighter management in ShikiStreamService to clear the reference instead of disposing it directly, as it is now managed by AsyncInitializer.
- Enhanced unit tests to verify the initialization of worker and main highlighters, ensuring that either one is active but not both, and updated assertions related to highlighter disposal.
* fix/selection-not-copy
* fix: abort not copy
* test: add actionUtil test
Update onStream callback to accept content parameter and set copyable content
during streaming instead of only at completion. Removes redundant content
tracking in ActionUtils and properly passes content to callbacks as it's
received. Adds test directory structure for components.
* refactor: improve streaming content handling and fix error states
Refine content handling in ActionUtils by tracking content internally rather than
passing it through onStream callbacks. Properly set error status in message
updates and ensure content is finalized on errors. Fix typo in test filename.
* fix: show error
* chore: remove unuse
* chore: remove console
* refactor: replace console logging with logger service across multiple components
- Updated various files to utilize the logger service instead of console.log for improved logging consistency and error tracking.
- Enhanced logging levels to better categorize messages, including debug and error levels.
- Refactored logging in components such as ApiClientFactory, KnowledgeService, and MemoryProcessor to align with the new logging standards.
* refactor: update logging level in App component from error to info
- Changed the logging level in the App component to provide a more appropriate context for initialization messages, enhancing clarity in the logging output.
* refactor(logging): replace console.log with logger service in middleware and update ESLint comments
- Updated the logging implementation in the createSimpleLoggingMiddleware function to use logger.debug and logger.error instead of console.log and console.error for improved logging consistency.
- Added eslint-disable comments for restricted syntax in preload and useAppInit hooks to suppress warnings.
* chore: update ESLint configuration and LoggerService formatting
- Refactored ESLint configuration to include custom rules for LoggerService, applying them specifically to the src directory while ignoring test and mock files.
- Commented out date formatting options in LoggerService for improved clarity in development logging.
* fix: add eslint-disable comments for restricted syntax in LoggerService
- Added eslint-disable comments to suppress warnings for restricted syntax in LoggerService for both main and renderer services.
- Improved error handling by logging messages when the window source is not initialized in the renderer LoggerService.
* Revert "feat: optimize minapp cache with LRU (#8160)"
This reverts commit f0043b4be5.
* feat: integrate logger service and enhance logging throughout the application
- Added a new LoggerService to standardize logging across the application.
- Replaced console.error and console.warn calls with logger methods for improved consistency and error tracking.
- Introduced a new IPC channel for logging messages to the main process.
- Updated various components and services to utilize the new logging system, enhancing error handling and debugging capabilities.
* refactor: enhance logging and error handling across various components
- Integrated the LoggerService for consistent logging throughout the application.
- Updated multiple components and services to utilize the new logging system, improving error tracking and debugging capabilities.
- Refactored file handling and error management in several services to enhance reliability and clarity.
- Improved the structure and readability of the codebase by removing redundant checks and simplifying logic.
* chore: update TypeScript configuration and enhance test setup
- Added test mock paths to tsconfig.web.json for improved test coverage.
- Configured Vitest to include a setup file for main tests, ensuring consistent test environment.
- Updated IPC logger context for better clarity in logging.
- Enhanced LoggerService to handle undefined values gracefully.
- Mocked LoggerService globally in renderer tests to streamline testing process.
* refactor: standardize logging across ProxyManager and ReduxService
- Replaced instances of Logger with logger for consistent logging implementation.
- Improved logging clarity in ProxyManager's configureProxy method and ReduxService's state handling.
- Enhanced error logging in ReduxService to align with the new logging system.
* refactor: reorganize LoggerService for improved clarity and consistency
- Moved the definition of SYSTEM_INFO, APP_VERSION, and DEFAULT_LEVEL to enhance code organization.
- Simplified the getIsDev function in the renderer LoggerService for better readability.
- Updated logging conditions to ensure messages are logged correctly based on context.
* docs: add usage instructions for LoggerService and clean up logging code
- Included important usage instructions for LoggerService in both English and Chinese.
- Commented out the console transport in LoggerService to streamline logging.
- Improved logging message formatting in MCPService for clarity.
- Removed redundant logging statements in SelectionService to enhance code cleanliness.
* refactor: update LoggerService documentation paths and enhance logging implementation
- Changed the documentation paths for LoggerService usage instructions to `docs/technical/how-to-use-logger-en.md` and `docs/technical/how-to-use-logger-zh.md`.
- Replaced console logging with the loggerService in various components, including `MCPSettings`, `BlockManager`, and multiple callback files, to ensure consistent logging practices across the application.
- Improved the clarity and context of log messages for better debugging and monitoring.
* docs: emphasize logger usage guidelines in documentation
- Added a note in both English and Chinese documentation to discourage the use of `console.xxx` for logging unless necessary, promoting consistent logging practices across the application.
* feat(minapp): add Google login tip for untrusted browser issue
* feat(miniapp): add open Google button for Google Login popup
* feat(minapp): replace custom alert with Ant Design Alert component
- Updated the getClient method to ensure the OpenAIResponseAPIClient is only returned for non-chat completion models, improving model compatibility checks.
* test: add comprehensive tests for ApiClientFactory
- Test all special ID client mappings (aihubmix, new-api, ppio)
- Test all standard provider type mappings
- Test edge cases and default behavior
- Test isOpenAIProvider utility function
- Achieve full coverage of factory logic
* test: fix ApiClientFactory test for OpenAIResponseAPIClient changes
- Add getClient mock method to OpenAIResponseAPIClient mock
- Fix provider id from 'azure' to 'azure-openai' to match actual configuration
- Ensure tests properly reflect the new OpenAIResponseAPIClient implementation
* test: refactor ApiClientFactory tests and move isOpenAIProvider to utils
- Simplify test data creation with createTestProvider helper
- Move isOpenAIProvider to utils and fix vertexai handling
- Update related imports
* refactor(ActionUtils): streamline message processing logic
- Removed unnecessary content accumulation for thinking and text blocks.
- Updated handling of message chunks to directly use incoming text for updates.
- Improved state management for thinking and text blocks during streaming.
- Enhanced the logic for creating and updating message blocks to ensure proper status and content handling.
* chore: remove log
* feat(ActionUtils): update message block instruction during processing
- Added dispatch to update the message block instruction with the current block ID when processing messages.
- Enhanced state management for message updates to ensure accurate tracking of block instructions during streaming.
* feat(ActionUtils): enhance message processing with text block content tracking
- Introduced a new variable to store the content of the text block during message processing.
- Updated the logic to dispatch the current text block content upon completion of message chunks, improving state management and accuracy in message updates.
* feat(ActionUtils): refine message processing error handling and status updates
- Enhanced the logic to update the message status based on error conditions, ensuring accurate representation of message states.
- Improved handling of text block content during processing, allowing for better state management and completion tracking.
- Streamlined the dispatch of updates for message blocks, particularly in error scenarios, to maintain consistency in message processing.
* feat(messageThunk): export throttled block update functions for improved message processing
- Changed the visibility of `throttledBlockUpdate` and `cancelThrottledBlockUpdate` functions to export, allowing their use in other modules.
- Updated `processMessages` in ActionUtils to utilize the newly exported functions for handling message updates, enhancing the efficiency of block updates during message processing.
* fix(ActionUtils): correct text block content handling in message processing
- Changed the declaration of `textBlockContent` to a constant to prevent unintended modifications.
- Updated the logic in `processMessages` to use the text block ID for throttled updates instead of the content, ensuring accurate message updates during processing.
* feat(HomeWindow): improve message processing with throttled updates
- Integrated `throttledBlockUpdate` and `cancelThrottledBlockUpdate` for managing thinking and text block updates, enhancing performance during message streaming.
- Updated logic to handle chunk types more effectively, ensuring accurate content updates and status management for message blocks.
- Streamlined the dispatch of message updates upon completion and error handling, improving overall state management.
* feat: add data parsing functionality in handleProvidersProtocolUrl
- Introduced a new ParseData function to decode and parse base64 encoded data from the URL parameters.
- Added error handling to log when data is null or invalid, improving robustness of the handleProvidersProtocolUrl function.
* fix: update data parsing in handleProvidersProtocolUrl and ProvidersList
- Modified ParseData function to return a JSON string instead of an object for consistency.
- Simplified data extraction in ProvidersList by directly parsing the addProviderData without base64 decoding, improving readability and performance.
* fix: improve data parsing in handleProvidersProtocolUrl
- Updated ParseData function to log the parsed result for better debugging.
- Enhanced data extraction by replacing URL-safe characters back to their original form before parsing, ensuring accurate data retrieval.
* fix: enhance error logging in ParseData function
- Updated the ParseData function to log errors when parsing fails, improving debugging capabilities and robustness in handling invalid data.
* format code
fix: enhance assistant topic validation in useActiveTopic hook
Updated the useActiveTopic hook to ensure that the assistant and its topics are properly validated before accessing properties. This prevents potential errors when data is not fully loaded.
* feat(ThinkingTagExtraction): accumulate thinking content for improved processing
- Introduced an `accumulatedThinkingContent` variable to gather content from multiple chunks before enqueuing.
- Updated the `ThinkingDeltaChunk` to use the accumulated content instead of individual extraction results, enhancing the coherence of thinking messages.
* feat(OpenAIAPIClient): enhance chunk processing for reasoning and content extraction
- Updated the OpenAIAPIClient to handle additional fields in response chunks, including `reasoning_content` and `reasoning`, improving the extraction of relevant information.
- Introduced a new mock implementation for testing OpenAI completions, ensuring accurate handling of thinking and text chunks in the response.
- Enhanced unit tests to validate the processing of OpenAI thinking chunks, ensuring expected behavior and output.
* feat: implement BlockManager and associated callbacks for message streaming
- Introduced BlockManager to manage message blocks with smart update strategies.
- Added various callback handlers for different message types including text, image, citation, and tool responses.
- Enhanced state management for active blocks and transitions between different message types.
- Created utility functions for handling block updates and transitions, improving overall message processing flow.
- Refactored message thunk to utilize BlockManager for better organization and maintainability.
This implementation lays the groundwork for more efficient message streaming and processing in the application.
* refactor: clean up BlockManager and callback implementations
- Removed redundant assignments of lastBlockType in various callback files.
- Updated error handling logic to ensure correct message status updates.
- Added console logs for debugging purposes in BlockManager and citation callbacks.
- Enhanced smartBlockUpdate method call in citation callbacks for better state management.
* refactor: streamline BlockManager and callback logic
- Removed unnecessary accumulated content variables in text and thinking callbacks.
- Updated content handling in callbacks to directly use incoming text instead of accumulating.
- Enhanced smartBlockUpdate calls for better state management in message streaming.
- Cleaned up console log statements for improved readability and debugging.
* chore: update package dependencies and add undici version 7.10.0
* chore: downgrade undici version from 7.10.0 to 6.21.2 in package.json and yarn.lock
* chore: update yarn.lock to reflect dependency version changes and removals
* feat: enhance proxy management and configuration
- Added support for new proxy modes and improved proxy configuration handling.
- Replaced AxiosProxy with direct axios usage for HTTP requests.
- Introduced fetch-socks and undici for better proxy handling.
- Updated IPC and ConfigManager to accommodate new proxy settings.
- Removed deprecated AxiosProxy service to streamline codebase.
* format code
* feat: improve proxy configuration and monitoring
- Introduced a new mechanism to monitor system proxy changes and update configurations accordingly.
- Enhanced the configureProxy method to prevent concurrent executions and added error logging with electron-log.
- Refactored proxy handling logic to streamline the setting of global and session proxies.
- Removed deprecated methods related to proxy management for cleaner code.
* update yarn.lock
* fix: update proxy configuration logic to handle direct mode
- Modified the app's ready event to check for 'direct' mode before configuring the proxy.
- Ensured that the proxy configuration is only applied when necessary, improving efficiency.
* feat: enhance proxy configuration to support authentication
- Added userId and password fields to the proxy configuration for SOCKS connections.
- Improved handling of proxy credentials to allow for authenticated proxy usage.
* refactor: remove deprecated proxy methods and streamline configuration logic
- Eliminated the setProxy and getProxy methods from ConfigManager to simplify the proxy configuration process.
- Updated ProxyManager to initialize with a default proxy configuration and removed unnecessary checks for 'direct' mode during initialization.
- Enhanced logging for proxy configuration changes to improve traceability.
* format code
* feat: enhance WebDav and ProxyManager for self-signed certificate support
- Added handling for self-signed certificates in ProxyManager to allow secure connections with custom agents.
- Updated WebDav configuration to include an https.Agent with rejectUnauthorized set to false, facilitating connections to servers with self-signed certificates.
* delete global setting for rejectUnauthorized
* feat: add support for 302AI provider in MCP settings
- Introduced new provider for 302AI, including token management and server synchronization functionality.
- Updated SyncServersPopup to integrate 302AI provider.
- Added new file for 302AI provider utilities, including token storage and server fetching logic.
* fix: re-merge main
* refactor: custom mini app loading logic
Replaces try-catch with an explicit file existence check before reading 'custom-minapps.json'. Ensures the file is created with an empty array if it does not exist, improving clarity and error handling.
* refactor: custom mini app loading logic
Simplifies the loading of custom mini apps by removing the explicit file existence check and handling the read failure case directly. If reading the file fails, an empty array is written and returned.
* fix: improve error handling in file reading for custom mini apps
* feat(models): enhance function calling model detection and update migration logic
- Added support for 'gemini-1' in FUNCTION_CALLING_EXCLUDED_MODELS.
- Updated isFunctionCallingModel to handle optional model input.
- Modified migration logic to change tool use mode for assistants using function calling models.
* feat(models): add new models to vision and function calling lists
- Added 'kimi-thinking-preview' to visionAllowedModels.
- Added 'kimi-k2' to FUNCTION_CALLING_MODELS.
- Updated migration logic to ensure compatibility with new model settings.
* refactor(TextChunkMiddleware): streamline text accumulation logic and improve response handling
- Simplified the logic for accumulating text content and updating the internal state.
- Ensured that the final text is consistently used in response callbacks.
- Removed redundant code for handling text completion in the ToolUseExtractionMiddleware.
- Added mock state for MCP tools in tests to enhance coverage for tool use extraction.
* refactor(BaseApiClient): remove unused content extraction utility
- Replaced the usage of getContentWithTools with getMainTextContent in the getMessageContent method.
- Cleaned up imports by removing the unused getContentWithTools function.
* fix: add channel property to notifications for backup and assistant messages
* Add notification tip and improve assistant notification logic
Added a tooltip in the notification settings UI to clarify that only messages exceeding 30 seconds will trigger a reminder. Updated i18n files for all supported languages with the new tip. Modified notification logic to only send notifications for assistant responses or errors if the message duration exceeds 30 seconds and the user is not on the home page or the window is not focused.
* Remove duplicate InfoCircleOutlined import
Consolidated the import of InfoCircleOutlined from '@ant-design/icons' to avoid redundancy in GeneralSettings.tsx.
* fix: add isFocused mock and simplify createMockStore
Added a mock for isFocused in the window utility and refactored createMockStore to return the configured store directly. This improves test setup clarity and ensures all necessary window utilities are mocked.
feat(WindowService): enhance mini window behavior and resizing logic
- Introduced dynamic resizing for the mini window based on user adjustments.
- Implemented positioning logic to ensure the mini window appears centered on the cursor's screen.
- Added opacity handling to improve user experience during window state changes.
- Refactored mini window creation to utilize predefined size constants for better maintainability.
* Merge memory into main
* Improvement/memory UI (#7655)
* feat: add auto-dimension detection to memory settings
- Add automatic embedding dimension detection for memory configuration
- Add toggle switch to enable/disable auto-detection (enabled by default)
- Detect dimensions by making test API call to embedding provider
- Show dimension input field only when auto-detection is disabled
- Add loading state and error handling during dimension detection
- Maintain consistency with knowledge base dimension handling
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* ✨ feat: implement unified embedding dimensions for memory service
- Add jaison dependency for robust JSON parsing
- Normalize all embeddings to 1536 dimensions for consistency
- Improve embedding dimension logging
- Update memory processor to use jaison for better error handling
- Handle various JSON response formats in fact extraction
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat: refactor MemoriesPage layout with new styled components and improved user management features
---------
Co-authored-by: Claude <noreply@anthropic.com>
* Improvement/memory UI (#7656)
Co-authored-by: Claude <noreply@anthropic.com>
* ✨ feat: add memory icon to sidebar for existing users
- Add migration version 118 to enable memory feature visibility
- Adds 'memory' icon to sidebar visible icons if not already present
- Updates store version to trigger migration for existing users
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(memory): include last user message ID in processor config
* ✨ feat(memory): enhance memory settings UI and add new translations
* Enhance memory management UI: Added settings, statistics, search, actions, and user management sections to the memory page. Updated translations for multiple languages to include new UI elements. Refactored component structure for improved layout and readability.
* feat: add i18n
* ui: Enhance memory modals and UI
* refactor(memory): replace direct message calls with window.message for error and success notifications
* fix: eslint error
* feat(memory): enhance memory restoration logic and queries
- Updated MemoryService to restore deleted memories instead of inserting new ones if a memory with the same hash exists.
- Added new SQL queries to check for deleted memories and restore them.
- Improved logging for memory restoration and embedding generation.
- Refactored related API service methods to handle updated memory processing logic.
* refactor: update memory configuration to use ApiClient structure
- Refactored memory-related services and components to utilize the new ApiClient structure for embedding and reranking models.
- Updated constructors and method signatures across multiple files to accept embedApiClient and rerankApiClient parameters.
- Enhanced memory settings UI to reflect changes in memory configuration management.
- Improved type definitions for KnowledgeBaseParams and MemoryConfig to align with the new structure.
* ui: improve user interface for adding new users in memory page
- Enhanced the button for adding new users by incorporating an icon and adjusting padding for better alignment.
- Updated the user selection options to ensure consistent alignment of avatars and user names.
- Refactored layout to improve overall user experience and visual consistency.
* refactor(memory): streamline MemoryProcessor usage in ApiService
- Removed the singleton instance of MemoryProcessor and instantiated it directly within the ApiService methods.
- Updated relevant methods to utilize the new instance for searching and processing memories, improving clarity and encapsulation of memory handling logic.
* chore: move knowledge dir
* fix: correct import paths in KnowledgeService.ts
* fix(Memory): memory deduplicate
* fix(Memory): memory llm provider
* fix: ci error
* fix(Memory): update fact extraction prompt to focus on personal information
* feat: Refactor memory fom sidebar to settings page
- Removed MemoryStick icon from Sidebar component.
- Updated navigation to point to the new memory settings page.
- Introduced MemoriesSettingsModal for managing memory configurations.
- Created MemorySettings component for comprehensive memory management.
- Added user management features including adding, editing, and deleting users.
- Implemented pagination and search functionality for memory items.
- Updated sidebar settings to remove memory icon and ensure proper migration.
- Adjusted Redux store settings to reflect changes in sidebar icons.
* feat: redesign memory settings page with improved UI and layout
* fix i18n
* fix: update citation titles to include memory hash and increment version number
* fix: remove unnecessary prop from KnowledgeCitation component
* feat: enhance fact extraction prompt with clearer guidelines and examples
* 🔧 feat: disable global memory by default and improve UI
- Set globalMemoryEnabled default to false for better user experience
- Remove manual localStorage handling to rely on redux-persist
- Add Beta badge to memory settings section
- Improve layout and styling of memory settings UI components
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Simplify external tool completion handling
* Fix whitespace in migrate config
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: suyao <sy20010504@gmail.com>
Co-authored-by: eeee0717 <chentao020717Work@outlook.com>
Co-authored-by: kangfenmao <kangfenmao@qq.com>
Co-authored-by: 自由的世界人 <3196812536@qq.com>
Add support for syncing MCP servers from MCProuter platform.
- Add mcprouter provider utility with token management
- Implement MCProuter API integration for list-servers endpoint
- Add provider configuration to SyncServersPopup
- Support authentication with Bearer token and custom headers
- Include proper error handling and duplicate server filtering
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat: Add URL Context ability for Gemini Models
* feat: Adding URL Context Button to tool bar and make it visible only when gemini models selected.
It is not working (adding urlContext tools) for now.
* fix: trying to force enable UrlContext function
* fix: enableUrlContext indication reverted
* feat: migration script for refreshing tool order to add URL Context button.
* fix: optimize migrate.ts
* fix: upgrade version
---------
Co-authored-by: suyao <sy20010504@gmail.com>
* test: add unit tests for getPotentialIndex and input utils
- Add tests for getPotentialIndex function covering streaming text tag detection scenarios
- Add tests for input utils including file drop and keyboard shortcut detection
* test: refactor test structure to comply with TEST_UTILS.md guidelines
- Add file-level describe blocks for both test files
- Fix mock cleanup in input.test.ts:
- Add vi.clearAllMocks() in beforeEach
- Replace vi.clearAllMocks() with vi.restoreAllMocks() in afterEach
- Maintain two-layer describe structure as per project standards
* feat: enhance OpenAIResponseAPIClient and update localization for Azure API version
- Added a new method `formatApiHost` in OpenAIResponseAPIClient to ensure correct API host formatting.
- Updated localization files for English, Japanese, Russian, and Chinese to include tips for Azure OpenAI API version usage.
- Modified ProviderSetting component to display the new Azure API version tip in the settings interface.
* chore: clean log
- Updated Vite configuration to remove conditional output settings, ensuring consistent build behavior.
- Refactored CitationsList component to use a Scrollbar for improved UI, encapsulating popover content within a styled container.
- Added support for incremental output in AnthropicAPIClient by introducing TEXT_START and THINKING_START chunk types.
- Updated OpenAIAPIClient to conditionally enable incremental output for specific models.
- Modified messageThunk to handle updated smartBlockUpdate calls with an isComplete parameter for better state management.
- Introduced incremental_output parameter in ReasoningEffortOptionalParams type for enhanced configuration options.
* feat(i18n): add smooth stream output translations for multiple languages
* feat(ThinkingBlock): integrate MarqueeComponent for enhanced message display
* refactor(i18n): remove smooth stream output references from translations and components
* refactor(typingOutput): enhance typing output logic and add debugging information
* refactor(Markdown): consolidate markdown utility imports for cleaner code
* feat(styles): add new styles for dropdown menus, popovers, and modals
* test(ThinkingBlock): enhance tests for streaming status and content collapse behavior
* refactor(typingOutput): remove debugging console log from outputNextChar function
* refactor(MarqueeComponent): comment out blur effect for last marquee item and adjust ThinkingBlock margin
* style(ThinkingBlock): update snapshot to include margin-top for improved layout
* refactor(typingOutput): 修改流式输出逻辑以支持队列长度检查
* refactor(Markdown): simplify useTypingOutput by removing isStreaming parameter
* test(Markdown): comment out re-render tests for content changes
* test(Markdown): remove commented-out re-render tests for content changes
* feat(ThinkingEffect): implement ThinkingEffect component for dynamic message display
- Introduced ThinkingEffect component to enhance the visual representation of thinking states.
- Integrated the new component into ThinkingBlock, replacing MarqueeComponent for improved functionality.
- Added animations and dynamic height adjustments based on message content and expansion state.
* test(ThinkingBlock): update mocks for ThinkingEffect and motion components in tests
* fix: Delete unnecessary comments
- Removed unnecessary extracted components and integrated their logic directly into HtmlArtifactsPopup.
- Enhanced preview functionality with a debounced update mechanism for HTML content.
- Updated styling for better layout and responsiveness, including fullscreen handling.
- Adjusted view mode management for clearer code structure and improved user experience.
- Introduced `isDev` and `isProd` constants for clearer environment checks.
- Simplified sourcemap and noDiscovery settings based on environment.
- Enhanced esbuild configuration for production to drop console and debugger statements.
* fix: replace Select component with custom Selector in LocalBackupSettings
- Updated LocalBackupSettings to use a custom Selector component for better styling and functionality.
- Enhanced the options for auto-sync interval and max backups with improved structure and internationalization support.
- Added success notification handling in restoreFromLocalBackup function in BackupService for better user feedback.
* refactor: streamline backup service and settings management
- Removed local backup auto-sync functionality and integrated its logic into the general auto-sync mechanism.
- Updated backup service methods to handle specific backup types (webdav, s3, local) more efficiently.
- Renamed backup functions for consistency and clarity.
- Enhanced local backup management in settings to utilize the new auto-sync structure.
- Improved error handling and logging for backup operations.
* refactor: replace Select component with custom Selector in S3Settings
- Updated S3Settings to utilize a custom Selector component for improved styling and functionality.
- Enhanced the options for auto-sync interval and max backups with better structure and internationalization support.
- Removed deprecated Select component to streamline the settings interface.
- Introduced `isHtmlCode` function to identify HTML content based on DOCTYPE and tag presence.
- Updated `CodeBlockView` to utilize `isHtmlCode` for conditional rendering of HTML artifacts.
- Added comprehensive tests for `isHtmlCode` to ensure accurate detection of HTML structures.
2025-07-11 12:16:44 +08:00
1053 changed files with 138366 additions and 58382 deletions
- 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.
- 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
required:true
- label:I've confirmed that I am using the latest version of Cherry Studio.
@@ -56,7 +56,7 @@ class AnthropicVertex extends client_1.BaseAnthropic {
throw new Error('No region was given. The client should be instantiated with the `region` option or the `CLOUD_ML_REGION` environment variable should be set.');
// create a shallow copy of the request body so that code that mutates it later
diff --git a/client.mjs b/client.mjs
index 70274cbf38f69f87cbcca9567e77e4a7b938cf90..4dea954b6f4afad565663426b7adfad5de973a7d 100644
--- a/client.mjs
+++ b/client.mjs
@@ -1,6 +1,6 @@
import { BaseAnthropic } from '@anthropic-ai/sdk/client';
import * as Resources from '@anthropic-ai/sdk/resources/index';
-import { GoogleAuth } from 'google-auth-library';
+// import { GoogleAuth } from 'google-auth-library';
import { readEnv } from "./internal/utils/env.mjs";
import { isObj } from "./internal/utils/values.mjs";
import { buildHeaders } from "./internal/headers.mjs";
@@ -29,7 +29,7 @@ export class AnthropicVertex extends BaseAnthropic {
throw new Error('No region was given. The client should be instantiated with the `region` option or the `CLOUD_ML_REGION` environment variable should be set.');
- Document Preprocessing with improved document handling
- MCP Marketplace - Model Context Protocol ecosystem
- MCP Marketplace for Model Context Protocol ecosystem
2. 🗂 **Knowledge Management**
2. 🗂 **Knowledge Management**
@@ -199,7 +199,7 @@ To give back to our core contributors and create a virtuous cycle, we have estab
**The inaugural tracking period for this program will be Q3 2025 (July, August, September). Rewards for this cycle will be distributed on October 1st.**
**The inaugural tracking period for this program will be Q3 2025 (July, August, September). Rewards for this cycle will be distributed on October 1st.**
Within any tracking period (e.g., July 1st to September 30th for the first cycle), any developer who contributes more than **30 meaningful commits** to any of Cherry Studio's open-source projects on GitHub is eligible for the following benefits:
Within any tracking period (e.g., July 1st to September 30th for the first cycle), any developer who contributes more than **30 meaningful commits** to any of Cherry Studio's open-source projects on GitHub will be eligible for the following benefits:
- **Cursor Subscription Sponsorship**: Receive a **$70 USD** credit or reimbursement for your [Cursor](https://cursor.sh/) subscription, making AI your most efficient coding partner.
- **Cursor Subscription Sponsorship**: Receive a **$70 USD** credit or reimbursement for your [Cursor](https://cursor.sh/) subscription, making AI your most efficient coding partner.
- **Unlimited Model Access**: Get **unlimited** API calls for the **DeepSeek** and **Qwen** models.
- **Unlimited Model Access**: Get **unlimited** API calls for the **DeepSeek** and **Qwen** models.
@@ -223,17 +223,17 @@ Let's build together.
# 🏢 Enterprise Edition
# 🏢 Enterprise Edition
Building on the Community Edition, we are proud to introduce **Cherry Studio Enterprise Edition**—a privatelydeployable AI productivity and management platform designed for modern teams and enterprises.
Building on the Community Edition, we are proud to introduce **Cherry Studio Enterprise Edition**—a privately-deployable AI productivity and management platform designed for modern teams and enterprises.
The Enterprise Edition addresses core challenges in team collaboration by centralizing the management of AI resources, knowledge, and data. It empowers organizations to enhance efficiency, foster innovation, and ensure compliance, all while maintaining 100% control over their data in a secure environment.
The Enterprise Edition addresses core challenges in team collaboration by centralizing the management of AI resources, knowledge, and data. It empowers organizations to enhance efficiency, foster innovation, and ensure compliance, all while maintaining 100% control over their data in a secure environment.
## Core Advantages
## Core Advantages
- **Unified Model Management**: Centrally integrate and manage various cloud-based LLMs (e.g., OpenAI, Anthropic, Google Gemini) and locally deployed private models. Employees can use them out-of-the-box without individual configuration.
- **Unified Model Management**: Centrally integrate and manage various cloud-based LLMs (e.g., OpenAI, Anthropic, Google Gemini) and locally deployed private models. Employees can use them out-of-the-box without individual configuration.
- **Enterprise-Grade Knowledge Base**: Build, manage, and share team-wide knowledge bases. Ensure knowledge is retained and consistent, enabling team members to interact with AI based on unified and accurate information.
- **Enterprise-Grade Knowledge Base**: Build, manage, and share team-wide knowledge bases. Ensures knowledge retention and consistency, enabling team members to interact with AI based on unified and accurate information.
- **Fine-Grained Access Control**: Easily manage employee accounts and assign role-based permissions for different models, knowledge bases, and features through a unified admin backend.
- **Fine-Grained Access Control**: Easily manage employee accounts and assign role-based permissions for different models, knowledge bases, and features through a unified admin backend.
- **Fully Private Deployment**: Deploy the entire backend service on your on-premises servers or private cloud, ensuring your data remains 100% private and under your control to meet the strictest security and compliance standards.
- **Fully Private Deployment**: Deploy the entire backend service on your on-premises servers or private cloud, ensuring your data remains 100% private and under your control to meet the strictest security and compliance standards.
- **Reliable Backend Services**: Provides stable API services, enterprise-grade data backup and recovery mechanisms to ensure business continuity.
- **Reliable Backend Services**: Provides stable API services and enterprise-grade data backup and recovery mechanisms to ensure business continuity.
## ✨ Online Demo
## ✨ Online Demo
@@ -247,23 +247,23 @@ The Enterprise Edition addresses core challenges in team collaboration by centra
| Feature | Community Edition | Enterprise Edition |
| Feature | Community Edition | Enterprise Edition |
We believe the Enterprise Edition will become your team's AI productivity engine. If you are interested in Cherry Studio Enterprise Edition and would like to learn more, request a quote, or schedule a demo, please contact us.
We believe the Enterprise Edition will become your team's AI productivity engine. If you are interested in Cherry Studio Enterprise Edition and would like to learn more, request a quote, or schedule a demo, please feel free to contact us.
- **For Business Inquiries & Purchasing**:
- **For Business Inquiries & Purchasing**:
**📧 [bd@cherry-ai.com](mailto:bd@cherry-ai.com)**
**📧 [bd@cherry-ai.com](mailto:bd@cherry-ai.com)**
# 🔗 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.
- [one-api](https://github.com/songquanpeng/one-api):LLM API management and distribution system supporting mainstream models like OpenAI, Azure, and Anthropic. Features a unified API interface, suitable for key management and secondary distribution.
- [ublacklist](https://github.com/iorate/ublacklist):Blocks specific sites from appearing in Google search results
- [ublacklist](https://github.com/iorate/ublacklist):Blocks specific sites from appearing in Google search results
At Cherry Studio, we take security seriously and appreciate your efforts to responsibly disclose vulnerabilities. If you discover a security issue, please report it as soon as possible.
**Please do not create public issues for security-related reports.**
- To report a security issue, please use the GitHub Security Advisories tab to "[Open a draft security advisory](https://github.com/CherryHQ/cherry-studio/security/advisories/new)".
- Include a detailed description of the issue, steps to reproduce, potential impact, and any possible mitigations.
- If applicable, please also attach proof-of-concept code or screenshots.
We will acknowledge your report within **72 hours** and provide a status update as we investigate.
---
## 🔒 Supported Versions
We aim to support the latest released version and one previous minor release.
| Version | Supported |
| --------------- | ---------------- |
| Latest (`main`) | ✅ Supported |
| Previous minor | ✅ Supported |
| Older versions | ❌ Not supported |
If you are using an unsupported version, we strongly recommend updating to the latest release to receive security fixes.
---
## 💡 Security Measures
Cherry Studio integrates several security best practices, including:
- Strict dependency updates and regular vulnerability scanning.
- TypeScript strict mode and linting to reduce potential injection or runtime issues.
- Enforced code formatting and pre-commit hooks.
- Internal security reviews before releases.
- Dedicated MCP (Model Context Protocol) safeguards for model interactions and data privacy.
---
## 🛡️ Disclosure Policy
- We follow a **coordinated disclosure** approach.
- We will not publicly disclose vulnerabilities until a fix has been developed and released.
- Credit will be given to researchers who responsibly disclose vulnerabilities, if requested.
---
## 🤝 Acknowledgements
We greatly appreciate contributions from the security community and strive to recognize all researchers who help keep Cherry Studio safe.
---
## 🌟 Questions?
For any security-related questions not involving vulnerabilities, please reach out to:
**security@cherry-ai.com**
---
Thank you for helping keep Cherry Studio and its users secure!
CodeBlockView is the core component in Cherry Studio for displaying and manipulating code blocks. It supports multiple view modes and visual previews for special languages, providing rich interactive tools.
## Component Structure
```mermaid
graph TD
A[CodeBlockView] --> B[CodeToolbar]
A --> C[SourceView]
A --> D[SpecialView]
A --> E[StatusBar]
B --> F[CodeToolButton]
C --> G[CodeEditor / CodeViewer]
D --> H[MermaidPreview]
D --> I[PlantUmlPreview]
D --> J[SvgPreview]
D --> K[GraphvizPreview]
F --> L[useCopyTool]
F --> M[useDownloadTool]
F --> N[useViewSourceTool]
F --> O[useSplitViewTool]
F --> P[useRunTool]
F --> Q[useExpandTool]
F --> R[useWrapTool]
F --> S[useSaveTool]
```
## Core Concepts
### View Types
- **preview**: Preview view, where non-source code is displayed as special views
- **edit**: Edit view
### View Modes
- **source**: Source code view mode
- **special**: Special view mode (Mermaid, PlantUML, SVG)
- **split**: Split view mode (source code and special view displayed side by side)
### Special View Languages
- mermaid
- plantuml
- svg
- dot
- graphviz
## Component Details
### CodeBlockView Main Component
Main responsibilities:
1. Managing view mode state
2. Coordinating the display of source code view and special view
3. Managing toolbar tools
4. Handling code execution state
### Subcomponents
#### CodeToolbar
- Toolbar displayed at the top-right corner of the code block
- Contains core and quick tools
- Dynamically displays relevant tools based on context
#### CodeEditor/CodeViewer Source View
- Editable code editor or read-only code viewer
- Uses either component based on settings
- Supports syntax highlighting for multiple programming languages
#### Special View Components
- **MermaidPreview**: Mermaid diagram preview
- **PlantUmlPreview**: PlantUML diagram preview
- **SvgPreview**: SVG image preview
- **GraphvizPreview**: Graphviz diagram preview
All special view components share a common architecture for consistent user experience and functionality. For detailed information about these components and their implementation, see [Image Preview Components Documentation](./ImagePreview-en.md).
#### StatusBar
- Displays Python code execution results
- Can show both text and image results
## Tool System
CodeBlockView uses a hook-based tool system:
```mermaid
graph TD
A[CodeBlockView] --> B[useCopyTool]
A --> C[useDownloadTool]
A --> D[useViewSourceTool]
A --> E[useSplitViewTool]
A --> F[useRunTool]
A --> G[useExpandTool]
A --> H[useWrapTool]
A --> I[useSaveTool]
B --> J[ToolManager]
C --> J
D --> J
E --> J
F --> J
G --> J
H --> J
I --> J
J --> K[CodeToolbar]
```
Each tool hook is responsible for registering specific function tool buttons to the tool manager, which then passes these tools to the CodeToolbar component for rendering.
### Tool Types
- **core**: Core tools, always displayed in the toolbar
- **quick**: Quick tools, displayed in a dropdown menu when there are more than one
### Tool List
1.**Copy**: Copy code or image
2.**Download**: Download code or image
3.**View Source**: Switch between special view and source code view
4.**Split View**: Toggle split view mode
5.**Run**: Run Python code
6.**Expand/Collapse**: Control code block expansion/collapse
7.**Wrap**: Control automatic line wrapping
8.**Save**: Save edited code
## State Management
CodeBlockView manages the following states through React hooks:
1.**viewMode**: Current view mode ('source' | 'special' | 'split')
2.**isRunning**: Python code execution status
3.**executionResult**: Python code execution result
4.**tools**: Toolbar tool list
5.**expandOverride/unwrapOverride**: User override settings for expand/wrap
Image Preview Components are a set of specialized components in Cherry Studio for rendering and displaying various diagram and image formats. They provide a consistent user experience across different preview types with shared functionality for loading states, error handling, and interactive controls.
## Supported Formats
- **Mermaid**: Interactive diagrams and flowcharts
- **PlantUML**: UML diagrams and system architecture
- **SVG**: Scalable vector graphics
- **Graphviz/DOT**: Graph visualization and network diagrams
## Architecture
```mermaid
graph TD
A[MermaidPreview] --> D[ImagePreviewLayout]
B[PlantUmlPreview] --> D
C[SvgPreview] --> D
E[GraphvizPreview] --> D
D --> F[ImageToolbar]
D --> G[useDebouncedRender]
F --> H[Pan Controls]
F --> I[Zoom Controls]
F --> J[Reset Function]
F --> K[Dialog Control]
G --> L[Debounced Rendering]
G --> M[Error Handling]
G --> N[Loading State]
G --> O[Dependency Management]
```
## Core Components
### ImagePreviewLayout
A common layout wrapper that provides the foundation for all image preview components.
**Features:**
- **Loading State Management**: Shows loading spinner during rendering
- **Error Display**: Displays error messages when rendering fails
- **Toolbar Integration**: Conditionally renders ImageToolbar when enabled
- **Container Management**: Wraps preview content with consistent styling
- **Responsive Design**: Adapts to different container sizes
**Props:**
-`children`: The preview content to be displayed
-`loading`: Boolean indicating if content is being rendered
-`error`: Error message to display if rendering fails
-`enableToolbar`: Whether to show the interactive toolbar
-`imageRef`: Reference to the container element for image manipulation
> This document is machine translated from Chinese. While we strive for accuracy, there may be some imperfections in the translation.
## Enhance Development Experience with the i18n Ally Plugin
i18n Ally is a powerful VSCode extension that provides real-time feedback during development, helping developers detect missing or incorrect translations earlier.
The plugin has already been configured in the project — simply install it to get started.
### Advantages During Development
- **Real-time Preview**: Translated texts are displayed directly in the editor.
- **Error Detection**: Automatically tracks and highlights missing translations or unused keys.
- **Quick Navigation**: Jump to key definitions with Ctrl/Cmd + click.
- **Auto-completion**: Provides suggestions when typing i18n keys.
### Demo



## i18n Conventions
### **Avoid Flat Structure at All Costs**
Never use flat structures like `"add.button.tip": "Add"`. Instead, adopt a clear nested structure:
```json
// Wrong - Flat structure
{
"add.button.tip":"Add",
"delete.button.tip":"Delete"
}
// Correct - Nested structure
{
"add":{
"button":{
"tip":"Add"
}
},
"delete":{
"button":{
"tip":"Delete"
}
}
}
```
#### Why Use Nested Structure?
1.**Natural Grouping**: Related texts are logically grouped by their context through object nesting.
2.**Plugin Requirement**: Tools like i18n Ally require either flat or nested format to properly analyze translation files.
### **Avoid Template Strings in `t()`**
**We strongly advise against using template strings for dynamic interpolation.** While convenient in general JavaScript development, they cause several issues in i18n scenarios.
#### 1. **Plugin Cannot Track Dynamic Keys**
Tools like i18n Ally cannot parse dynamic content within template strings, resulting in:
- No real-time preview
- No detection of missing translations
- No navigation to key definitions
```javascript
// Not recommended - Plugin cannot resolve
constmessage=t(`fruits.${fruit}`)
```
#### 2. **No Real-time Rendering in Editor**
Template strings appear as raw code instead of the final translated text in IDEs, degrading the development experience.
#### 3. **Harder to Maintain**
Since the plugin cannot track such usages, developers must manually verify the existence of corresponding keys in language files.
### Recommended Approach
To avoid missing keys, all dynamically translated texts should first maintain a `FooKeyMap`, then retrieve the translation text through a function.
Updates translations in language files under `src/renderer/src/i18n/translate` at the object level, preserving existing translations and only updating new content.
**Not recommended** — prefer `auto:i18n` for translation tasks.
```bash
yarn update:i18n
```
### Workflow
1. During development, first add the required text in `zh-cn.json`
2. Confirm it displays correctly in the Chinese environment
3. Run `yarn sync:i18n` to propagate the keys to other language files
4. Run `yarn auto:i18n` to perform machine translation
5. Grab a coffee and let the magic happen!
## Best Practices
1.**Use Chinese as Source Language**: All development starts in Chinese, then translates to other languages.
2.**Run Check Script Before Commit**: Use `yarn check:i18n` to catch i18n issues early.
3.**Translate in Small Increments**: Avoid accumulating a large backlog of untranslated content.
4.**Keep Keys Semantically Clear**: Keys should clearly express their purpose, e.g., `user.profile.avatar.upload.error`
-`moduleName` is the name of the current file's module. It can be named after the filename, main class name, main function name, etc. The principle is to be clear and understandable.
-`moduleName` will be printed in the terminal and will also be present in the file log, making it easier to filter.
### Setting `CONTEXT` information (Optional)
In `withContext`, you can also set other `CONTEXT` information:
-`CONTEXT` is an object of the form `{ key: value, ... }`.
-`CONTEXT` information will not be printed in the terminal, but it will be recorded in the file log, making it easier to filter.
### Logging
In your code, you can call `logger` at any time to record logs. The supported levels are: `error`, `warn`, `info`, `verbose`, `debug`, and `silly`.
For the meaning of each level, please refer to the subsequent sections.
The following are the supported parameters for logging (using `logger.LEVEL` as an example, where `LEVEL` represents one of the levels mentioned above):
```typescript
logger.LEVEL(message)
logger.LEVEL(message,CONTEXT)
logger.LEVEL(message,error)
logger.LEVEL(message,error,CONTEXT)
```
**Only the four calling methods above are supported**.
| `message` | `string` | Required. This is the core field of the log, containing the main content to be recorded. |
| `CONTEXT` | `object` | Optional. Additional information to be recorded in the log file. It is recommended to use the `{ key: value, ...}` format. |
| `error` | `Error` | Optional. The error stack trace will also be printed.<br/>Note that the `error` caught by `catch(error)` is of the `unknown` type. According to TypeScript best practices, you should first use `instanceof` for type checking. If you are certain it is an `Error` type, you can also use a type assertion like `as Error`. |
#### Recording non-`object` type context information
```typescript
constfoo=getFoo()
logger.debug(`foo ${foo}`)
```
### Log Levels
- In the development environment, all log levels are printed to the terminal and recorded in the file log.
- In the production environment, the default log level is `info`. Logs are only recorded to the file and are not printed to the terminal.
Changing the log level:
- You can change the log level with `logger.setLevel('newLevel')`.
-`logger.resetLevel()` resets it to the default level.
-`logger.getLevel()` gets the current log level.
**Note:** Changing the log level has a global effect. Please do not change it arbitrarily in your code unless you are very clear about what you are doing.
## Usage in the `renderer` process
Usage in the `renderer` process for _importing_, _setting module information_, and _setting context information_ is **exactly the same** as in the `main` process.
The following section focuses on the differences.
### `initWindowSource`
In the `renderer` process, there are different `window`s. Before starting to use the `logger`, we must set the `window` information:
```typescript
loggerService.initWindowSource('windowName')
```
As a rule, we will set this in the `window`'s `entryPoint.tsx`. This ensures that `windowName` is set before it's used.
- An error will be thrown if `windowName` is not set, and the `logger` will not work.
-`windowName` can only be set once; subsequent attempts to set it will have no effect.
-`windowName` will not be printed in the `devTool`'s `console`, but it will be recorded in the `main` process terminal and the file log.
-`initWindowSource` returns the LoggerService instance, allowing for method chaining.
### Log Levels
- In the development environment, all log levels are printed to the `devTool`'s `console` by default.
- In the production environment, the default log level is `info`, and logs are printed to the `devTool`'s `console`.
- In both development and production environments, `warn` and `error` level logs are, by default, transmitted to the `main` process and recorded in the file log.
- In the development environment, the `main` process terminal will also print the logs transmitted from the renderer.
#### Changing the Log Level
Same as in the `main` process, you can manage the log level using `setLevel('level')`, `resetLevel()`, and `getLevel()`.
Similarly, changing the log level is a global adjustment.
#### Changing the Level Transmitted to `main`
Logs from the `renderer` are sent to `main` to be managed and recorded to a file centrally (according to `main`'s file logging level). By default, only `warn` and `error` level logs are transmitted to `main`.
There are two ways to change the log level for transmission to `main`:
##### Global Change
The following methods can be used to set, reset, and get the log level for transmission to `main`, respectively.
```typescript
logger.setLogToMainLevel('newLevel')
logger.resetLogToMainLevel()
logger.getLogToMainLevel()
```
**Note:** This method has a global effect. Please do not change it arbitrarily in your code unless you are very clear about what you are doing.
##### Per-log Change
By adding `{ logToMain: true }` at the end of the log call, you can force a single log entry to be transmitted to `main` (bypassing the global log level restriction), for example:
```typescript
logger.info('message',{logToMain: true})
```
## About `worker` Threads
- Currently, logging is not supported for workers in the `main` process.
- Logging is supported for workers started in the `renderer` process, but currently these logs are not sent to `main` for recording.
### How to Use Logging in `renderer` Workers
Since worker threads are independent, using LoggerService in them is equivalent to using it in a new `renderer` window. Therefore, you must first call `initWindowSource`.
If the worker is relatively simple (just one file), you can also use method chaining directly:
In a development environment, you can define environment variables to filter displayed logs by level and module. This helps developers focus on their specific logs and improves development efficiency.
Environment variables can be set in the terminal or defined in the `.env` file in the project's root directory. The available variables are as follows:
| `CSLOGGER_MAIN_LEVEL` | Log level for the `main` process. Logs below this level will not be displayed. |
| `CSLOGGER_MAIN_SHOW_MODULES` | Filters log modules for the `main` process. Use a comma (`,`) to separate modules. The filter is case-sensitive. Only logs from modules in this list will be displayed. |
| `CSLOGGER_RENDERER_LEVEL` | Log level for the `renderer` process. Logs below this level will not be displayed. |
| `CSLOGGER_RENDERER_SHOW_MODULES` | Filters log modules for the `renderer` process. Use a comma (`,`) to separate modules. The filter is case-sensitive. Only logs from modules in this list will be displayed. |
| **`error`** | **Critical error causing the program to crash or core functionality to become unusable.**<br> This is the highest-priority log, usually requiring immediate reporting or user notification. | - Main or renderer process crash. <br> - Failure to read/write critical user data files (e.g., database, configuration files), preventing the application from running. <br> - All unhandled exceptions. |
| **`warn`** | **Potential issue or unexpected situation that does not affect the program's core functionality.**<br> The program can recover or use a fallback. | - Configuration file `settings.json` is missing; started with default settings. <br> - Auto-update check failed, but does not affect the use of the current version. <br> - A non-essential plugin failed to load. |
| **`info`** | **Records application lifecycle events and key user actions.**<br> This is the default level that should be recorded in a production release to trace the user's main operational path. | - Application start, exit. <br> - User successfully opens/saves a file. <br> - Main window created/closed. <br> - Starting an important task (e.g., "Start video export"). |
| **`verbose`** | **More detailed flow information than `info`, used for tracing specific features.**<br> Enabled when diagnosing issues with a specific feature to help understand the internal execution flow. | - Loading `Toolbar` module. <br> - IPC message `open-file-dialog` sent from the renderer process. <br> - Applying filter 'Sepia' to the image. |
| **`debug`** | **Detailed diagnostic information used during development and debugging.**<br>**Must not be enabled by default in production releases**, as it may contain sensitive data and impact performance. | - Parameters for function `renderImage`: `{ width: 800, ... }`. <br> - Specific data content received by IPC message `save-file`. <br> - Details of Redux/Vuex state changes in the renderer process. |
| **`silly`** | **The most detailed, low-level information, used only for extreme debugging.**<br> Rarely used in regular development; only for solving very difficult problems. | - Real-time mouse coordinates `(x: 150, y: 320)`. <br> - Size of each data chunk when reading a file. <br> - Time taken for each rendered frame. |
- '!node_modules/selection-hook/prebuilds/**/*'# we rebuild .node, don't use prebuilds
- '!node_modules/selection-hook/prebuilds/**/*'# we rebuild .node, don't use prebuilds
- '!node_modules/pdfjs-dist/web/**/*'
- '!node_modules/pdfjs-dist/legacy/web/*'
- '!node_modules/selection-hook/node_modules'# we don't need what in the node_modules dir
- '!node_modules/selection-hook/node_modules'# we don't need what in the node_modules dir
- '!node_modules/selection-hook/src'# we don't need source files
- '!node_modules/selection-hook/src'# we don't need source files
- '!node_modules/tesseract.js-core/{tesseract-core.js,tesseract-core.wasm,tesseract-core.wasm.js}'# we don't need source files
- '!node_modules/tesseract.js-core/{tesseract-core-lstm.js,tesseract-core-lstm.wasm,tesseract-core-lstm.wasm.js}'# we don't need source files
- '!node_modules/tesseract.js-core/{tesseract-core-simd-lstm.js,tesseract-core-simd-lstm.wasm,tesseract-core-simd-lstm.wasm.js}'# we don't need source files
Tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as _New York Times_, _The Guardian_ or _Atlassian_.
## Official Documentation
Documentation can be found on the [Tiptap website](https://tiptap.dev).
## License
Tiptap is open sourced software licensed under the [MIT license](https://github.com/ueberdosis/tiptap/blob/main/LICENSE.md).
"prompt":"I want you to act as a Graphviz DOT generator, an expert to create meaningful diagrams. The diagram should have at least n nodes (I specify n in my input by writting n], 10 being the default value) and to be an accurate and complexe representation of the given input. Each node is indexed by a number to reduce the size of the output, should not include any styling, and with layout=neato, overlap=false, node shape=rectangle] as parameters. The code should be valid, bugless and returned on a single line, without any explanation. Provide a clear and organized diagram, the relationships between the nodes have to make sense for an expert of that input. My first diagram is: \"The water cycle 8]\".\n\n",
"prompt":"I want you to act as a Graphviz DOT generator, an expert to create meaningful diagrams. The diagram should have at least n nodes (I specify n in my input by writing n], 10 being the default value) and to be an accurate and complex representation of the given input. Each node is indexed by a number to reduce the size of the output, should not include any styling, and with layout=neato, overlap=false, node shape=rectangle] as parameters. The code should be valid, bugless and returned on a single line, without any explanation. Provide a clear and organized diagram, the relationships between the nodes have to make sense for an expert of that input. My first diagram is: \"The water cycle 8]\".\n\n",
"description":"Generate meaningful charts."
"description":"Generate meaningful charts."
},
},
{
{
@@ -2148,7 +2148,7 @@
"Career",
"Career",
"Business"
"Business"
],
],
"prompt":"Please acknowledge my following request. Please respond to me as a product manager. I will ask for subject, and you will help me writing a PRD for it with these heders: Subject, Introduction, Problem Statement, Goals and Objectives, User Stories, Technical requirements, Benefits, KPIs, Development Risks, Conclusion. Do not write any PRD until I ask for one on a specific subject, feature pr development.\n\n",
"prompt":"Please acknowledge my following request. Please respond to me as a product manager. I will ask for subject, and you will help me writing a PRD for it with these headers: Subject, Introduction, Problem Statement, Goals and Objectives, User Stories, Technical requirements, Benefits, KPIs, Development Risks, Conclusion. Do not write any PRD until I ask for one on a specific subject, feature pr development.\n\n",
"description":"Help draft the Product Requirements Document."
"description":"Help draft the Product Requirements Document."
},
},
{
{
@@ -2159,7 +2159,7 @@
"Entertainment",
"Entertainment",
"General"
"General"
],
],
"prompt":"I want you to act as a drunk person. You will only answer like a very drunk person texting and nothing else. Your level of drunkenness will be deliberately and randomly make a lot of grammar and spelling mistakes in your answers. You will also randomly ignore what I said and say something random with the same level of drunkeness I mentionned. Do not write explanations on replies. My first sentence is \"how are you?",
"prompt":"I want you to act as a drunk person. You will only answer like a very drunk person texting and nothing else. Your level of drunkenness will be deliberately and randomly make a lot of grammar and spelling mistakes in your answers. You will also randomly ignore what I said and say something random with the same level of drunkenness I mentioned. Do not write explanations on replies. My first sentence is \"how are you?",
"description":"Mimic the speech pattern of a drunk person."
"description":"Mimic the speech pattern of a drunk person."
},
},
{
{
@@ -3517,7 +3517,7 @@
"Tools",
"Tools",
"Copywriting"
"Copywriting"
],
],
"prompt":"I want you to act as a scientific manuscript matcher. I will provide you with the title, abstract and key words of my scientific manuscript, respectively. Your task is analyzing my title, abstract and key words synthetically to find the most related, reputable journals for potential publication of my research based on an analysis of tens of millions of citation connections in database, such as Web of Science, Pubmed, Scopus, ScienceDirect and so on. You only need to provide me with the 15 most suitable journals. Your reply should include the name of journal, the cooresponding match score (The full score is ten). I want you to reply in text-based excel sheet and sort by matching scores in reverse order.\nMy title is \"XXX\" My abstract is \"XXX\" My key words are \"XXX\"\n\n",
"prompt":"I want you to act as a scientific manuscript matcher. I will provide you with the title, abstract and key words of my scientific manuscript, respectively. Your task is analyzing my title, abstract and key words synthetically to find the most related, reputable journals for potential publication of my research based on an analysis of tens of millions of citation connections in database, such as Web of Science, Pubmed, Scopus, ScienceDirect and so on. You only need to provide me with the 15 most suitable journals. Your reply should include the name of journal, the corresponding match score (The full score is ten). I want you to reply in text-based excel sheet and sort by matching scores in reverse order.\nMy title is \"XXX\" My abstract is \"XXX\" My key words are \"XXX\"\n\n",
logger.info('User in China, using Taobao npm mirror')
return'https://registry.npmmirror.com'
}else{
logger.info('User not in China, using default npm mirror')
return'https://registry.npmjs.org'
}
}
module.exports={
getIpCountry,
isUserInChina,
getNpmRegistryUrl
}
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.