mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-01 17:59:09 +08:00
88e77aa116
23 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
0648a1f567 |
refactor(assistants): rename agents to assistants and update related components
- Updated references from 'agents' to 'assistants' across various components and hooks. - Changed i18n keys to reflect the new terminology for better clarity. - Removed the deprecated agents slice and integrated its functionality into the assistants slice. - Adjusted UI components to align with the new naming conventions for assistant presets. |
||
|
|
8e163b8f17 | Merge branch 'main' of github.com:CherryHQ/cherry-studio into feat/agents-new | ||
|
|
a847b74c32
|
feat: add new provider aionly (#10179)
* feat: add new provider aionly * fix(store): update migration to properly add 'aionly' provider in v156 Move 'aionly' provider addition from v155 to v156 migration to ensure proper state initialization --------- Co-authored-by: fengjunhao <765838796@qq.com> Co-authored-by: Phantom <59059173+EurFelux@users.noreply.github.com> Co-authored-by: icarus <eurfelux@gmail.com> Co-authored-by: 亢奋猫 <kangfenmao@qq.com> |
||
|
|
8cd40a471e |
refactor(agent): replace agent type label map with switch statement
Simplify agent type label handling by replacing the map with a direct switch statement. Also update related type references and array type assertions for consistency. |
||
|
|
ea62294bd8 |
refactor(agent-settings): extract shared components and improve styling
- Move common components (AgentLabel, SettingsTitle, SettingsInline) to shared file - Update CSS to use @layer base for better organization - Fix agent type label translation key in AgentModal - Add agent type label utility function |
||
|
|
3405b7e429 |
refactor(ui): rename agents to assistantPresets for consistency
Update route paths, i18n keys and tab identifiers to use 'assistantPresets' instead of 'agents' Add new agents tab component while maintaining backward compatibility |
||
|
|
60e1f15e42
|
feat: add shortcuts to rename topic and edit last user message (#9466)
* feat: add rename topic shortcut (Ctrl/Cmd+T)
* fix: add migration for rename topic shortcut
* feat: add shortcut to edit last user message (Ctrl/Cmd+Shift+E)
- 用于在用户提示词生成的响应不符合预期时,便捷地激活提示词编辑,从而配合编辑器编辑支持的Enter键提交绑定来生成新的模型响应
- messages:绑定 useShortcut('edit_last_user_message'),定位最后一条非 clear 的用户消息并发出 EDIT_MESSAGE
- message:监听 EDIT_MESSAGE,调用 startEditing(message.id) 激活内联编辑(沿用现有自动滚动)
* fix: lint errors and sync i18n
* fix(i18n): complete missing translations in ES, PT, EL and FR locales
* disable new shortcuts by default
* show topic tab on rename shortcut
* refactor: use findLast to simplify find last user message
* add esc key to cancel message editing (discard changes)
* fix missing comma
* remove extra linebreak
* fix: version
---------
Co-authored-by: suyao <sy20010504@gmail.com>
|
||
|
|
7de31d8cb6
|
feat: Add PaddleOCR as a new OCR provider (#9876)
* feat: support PaddleOCR as an OCR provider * style: fix format * fix: update persistReducer version * update wrt comments * fix(ocr): 修复迁移147中OCR提供商的设置错误 将直接赋值改为使用addOcrProvider方法添加内置PaddleOCR提供商,确保正确初始化OCR服务 * Replace bare fetch with net.fetch * Use '\n' as delimiter * Optimize code wrt comments * Add tip --------- Co-authored-by: icarus <eurfelux@gmail.com> |
||
|
|
dfb3322b28
|
feat: add notes module (#8871)
* 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
|
||
|
|
ebe2806467
|
feat: add cherryin provider (#9681)
* 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. |
||
|
|
f95b9cef77
|
feat: System (MacOS & Windows) OCR (#9572)
* build: 添加 macOS 系统 OCR 作为可选依赖 * refactor: 移动TesseractService * feat(ocr): 添加MacOS Vision OCR支持并优化类型定义 添加对MacOS Vision OCR的支持,同时重构OCR相关类型定义以提升可维护性。新增PDF文件元数据类型为后续功能做准备。 * refactor(types): 重命名 isImageFile 为 isImageFileMetadata 以更准确描述功能 * refactor(ocr): 更新导入 * feat(ocr): 实现MacOS Vision OCR服务并重构OCR基础结构 添加MacOcrService以支持MacOS Vision OCR功能 创建OcrBaseService作为OCR服务的基类 清理MacOS OCR配置中的冗余字段 * fix(store): 更新持久化存储版本至138并添加MAC OCR提供者 添加内置OCR提供者支持并清空翻译输入框 * chore: 更新 @cherrystudio/mac-system-ocr 依赖至 0.2.4 版本 * feat(ocr): 添加 macOS 原生 OCR 服务支持 添加 macOS 原生 OCR 服务作为内置 OCR 提供商 在设置页面显示不可配置提示 添加相关 logo 和翻译文本 * build: 将 @cherrystudio/mac-system-ocr 从可选依赖移至常规依赖 * fix(ocr): 临时使用any类型替代平台特定依赖的类型定义 为了避免在Linux上运行类型检查CI时抛出错误,暂时将MacOCR属性的类型从平台特定依赖的类型定义改为any类型 * refactor(build): 将mac-system-ocr移至optionalDependencies并更新vite配置 将@cherrystudio/mac-system-ocr从dependencies移至optionalDependencies 更新electron.vite.config.ts中的external配置以包含该依赖 * feat(OCR设置): 根据平台过滤OCR提供商选项 添加平台检测逻辑,在非Mac平台隐藏Mac内置OCR提供商选项 * feat(OCR): 添加非MacOS系统的错误提示 在OCR图片设置中添加对非MacOS系统的错误提示,当用户尝试在非Mac系统上使用OCR功能时显示错误标签 * feat(i18n): 添加 OCR 相关多语言翻译 为 OCR 功能添加错误提示和配置项的多语言翻译,包括非 MacOS 系统提示和无配置项提示 * fix(MacOcrService): 忽略macOS专属模块的类型检查错误 添加@ts-ignore注释以避免在非macOS平台上的类型检查错误,该模块仅在macOS上可用 * build: 添加 @napi-rs/system-ocr 依赖以支持OCR功能 * chore: 移除未使用的mac-system-ocr依赖 * refactor(ocr): 将 MacOS OCR 重构为跨平台的系统 OCR 重构 OCR 服务,将原本仅支持 MacOS 的 OCR 功能扩展为支持 Windows 和 MacOS 的系统 OCR 更新相关类型定义、配置和界面适配 * feat(hooks): 添加设置图片OCR提供商的功能 * refactor(ocr): 重构OCR提供者相关逻辑,优化代码结构 - 将OCR提供者相关工具函数和hook合并到useOcrProvider中 - 替换mac提供者为system提供者 - 优化OCR设置界面的错误处理和UI展示 - 删除不再使用的ocr.ts工具文件 * refactor(OCR设置): 移除多余的SettingGroup包装并优化provider设置逻辑 移除OcrSettings中多余的SettingGroup包装,将主题样式直接应用于OcrProviderSettings组件 优化OcrProviderSettings逻辑,对于system provider直接返回null * fix(i18n): 移除OCR服务中不可配置项的翻译并更新系统OCR支持提示 * fix(ocr): 根据系统平台设置默认OCR提供商 在Windows和Mac平台上使用系统OCR作为默认提供商,其他平台继续使用Tesseract * build: 从外部依赖中移除 @cherrystudio/mac-system-ocr * fix(i18n): 更新多语言OCR相关翻译 * fix(store): 在迁移配置中移除翻译输入的清空操作 * refactor(hooks): 将 getOcrProviderLogo 重命名为 OcrProviderLogo 并改为组件形式 将 useOcrProviders 中的 getOcrProviderLogo 函数重构为 OcrProviderLogo 组件 更新 OcrProviderSettings 中对应的调用方式 * support jpg * refactor(ocr): 重构OCR服务基础结构并支持多语言配置 重构OCR基础服务类,提取公共接口为抽象类 为系统OCR和Tesseract服务添加多语言配置支持 * refactor(ocr): 重构OCR类型定义以提高可维护性 将OcrProviderConfig拆分为基础配置和具体实现配置类型 优化类型结构以更清晰地区分不同OCR提供者的配置 * feat(组件): 新增错误标签组件 ErrorTag * refactor(ocr): 替换自定义标签组件为ErrorTag组件以简化代码 * fix(ocr): 在macOS下忽略语言参数 * feat(组件): 添加警告标签组件用于显示警告信息 * feat(ocr): 添加系统OCR支持并优化语言配置 - 新增系统OCR设置组件,支持Windows和MacOS平台 - 为系统OCR添加语言选择功能,Windows需配置语言包 - 创建SuccessTag组件用于显示配置状态 - 统一OCR语言设置相关翻译键名 - 修复系统OCR在非Windows/Mac平台下的显示问题 * feat(i18n): 添加 OCR 设置页面的多语言支持 为 OCR 设置页面添加了新的多语言翻译,包括支持的语言列表和系统 OCR 的相关提示信息 * feat(ocr): 支持自定义 Tesseract OCR 语言选择 添加 Tesseract OCR 语言映射配置和动态语言选择功能 在设置界面实现多语言选择器,支持用户自定义 OCR 语言 更新相关类型定义和工具提示信息 * docs(i18n): 为Tesseract OCR添加自定义语言支持提示文本 * fix(i18n): 移除OCR服务中临时语言支持提示 * fix(ocr): 修复OCR服务未传递provider配置的问题 * fix(ocr): 修复OCR服务未传递provider配置的问题 * fix(TesseractService): 修复worker没有显式dispose的问题 * feat(拖拽): 在useDrag钩子中暴露setIsDragging方法 允许外部组件直接控制拖拽状态,用于在TranslatePage中处理文件拖放时重置拖拽状态 * feat(i18n): 更新输入框占位文本以支持OCR功能 * fix(ocr): 添加错误处理并记录日志以改进Tesseract服务 在TesseractService中添加错误处理回调函数,捕获并抛出worker创建过程中的错误 同时增加调试日志以跟踪语言数组和worker创建过程 * refactor(ocr): 重构OCR状态管理,使用ID引用图像提供者并添加选择器 将imageProvider字段改为imageProviderId以简化状态管理 添加getImageProvider选择器方便获取当前图像提供者 * update cn data * refactor(ocr): 重构OCR提供者管理逻辑,使用自定义hook统一处理 - 将OCR提供者状态管理从Redux迁移到自定义hook useOcrProviders - 修复默认OCR提供者初始化问题 - 优化OCR图片识别逻辑,使用useCallback提升性能 * fix(ocr): 修复Tesseract worker初始化错误处理逻辑 重构worker初始化流程,使用Promise处理错误而非全局变量 修正非CN地区语言包下载URL为空的问题 * fix(ocr): 修复url * feat(OCR设置): 在Tesseract语言选择器中添加自定义标签渲染 添加CustomTag组件以禁用默认的关闭操作 * refactor(translate): 优化拖拽上传文件的hooks调用顺序 将useDrag hooks的声明移到使用位置附近,提高代码可读性 * perf(ocr): 移除不必要的await提升图像预处理性能 * feat(translate): 添加文本文件类型检查并优化文件处理逻辑 在翻译页面中增加对文本文件类型的检查,避免处理非文本文件。同时优化文件处理流程,包括错误处理和加载状态管理。 * feat(i18n): 添加文件类型检查错误的多语言翻译 * docs(i18n): 更新输入框占位符文本以更清晰描述支持的功能 --------- Co-authored-by: beyondkmp <beyondkmp@gmail.com> |
||
|
|
168cc36410
|
fix(i18n): backup/restore progress (#9622) | ||
|
|
6376bbb9a7
|
fix: mcp-auto-install cannot start (#9015)
* refactor(types): 将内置MCPServer类型从MCPServer分离并添加类型守卫 将内置MCPServer相关逻辑从通用MCPServer类型中分离,新增BuiltinMCPServer类型和类型守卫函数 * refactor(MCPService): 使用isBuiltinMCPServer检查内置服务器类型 修改传输层创建逻辑,通过isBuiltinMCPServer函数判断是否为内置服务器,并排除特定服务器 * refactor(types): 统一内置MCP服务器名称的键值格式并优化类型定义 将BuiltinMCPServers对象的键改为与值相同的格式,使结构更一致 同时简化BuiltinMCPServerName类型定义和isBuiltinMCPServerName检查逻辑 * refactor(types): 为内置MCP服务器名称添加类型定义 为`MCP_AUTO_INSTALL_SERVER_NAME`和`builtInMcpDescriptionKeyMap`添加`BuiltinMCPServerName`类型定义,提高类型安全性 * refactor(types): 重命名BuiltinMCPServers为BuiltinMCPServerNames以更准确描述用途 * style: 移除 TabContainer 组件中的多余空行 * refactor(mcpServers): 使用类型化的BuiltinMCPServerName替换字符串参数 将createInMemoryMCPServer函数的name参数从string类型改为BuiltinMCPServerName类型,提高类型安全性 * refactor(types): 重构内置MCPServer名称常量及类型定义 将BuiltinMCPServerNames的键名改为驼峰命名,并添加BuiltinMCPServerNamesArray常量 修改isBuiltinMCPServerName函数使用数组进行判断 * refactor(mcp): 使用枚举替换硬编码的服务器名称字符串 |
||
|
|
cffaf99b17 | feat: add 'code_tools' to sidebar icons and update related components | ||
|
|
a4c61bcd66
|
fix: @cherry/memory i18n key wrong (#9164) | ||
|
|
1c7b7a1a55
|
feat: add code tools (#9043)
* 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. |
||
|
|
27c9ceab9f
|
fix: support gpt-5 (#8945)
* 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> |
||
|
|
18f52f2717
|
fix(mcp): builtin mcp objects cannot be serialized (#8903)
* fix(mcp): 修复无法序列化的问题 * refactor(i18n): 重构MCP服务器描述的国际化和错误处理 移除MCPServer接口中的descriptionI18nKey字段,改为使用统一的getLabel函数处理国际化 添加getBuiltInMcpServerDescriptionLabel函数集中管理MCP服务器描述 在标签翻译失败时添加错误日志记录 * feat(i18n): 添加 Poe 供应商的多语言支持并重构标签获取逻辑 * refactor(i18n): 优化标签翻译函数中的变量使用 * refactor(i18n): 将参数key重命名为id以提升可读性 |
||
|
|
4805e07106 |
Revert "feat(cherry-store): add cherry store (#8683)"
This reverts commit
|
||
|
|
4d79c96a4b
|
feat(cherry-store): add cherry store (#8683)
* 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 |
||
|
|
f1b52869a9
|
integrate AWS Bedrock API (#8383)
* feat(AWS Bedrock): integrate AWS Bedrock API client and configuration * feat(AWS Bedrock): add AWS Bedrock settings management and UI integration * refactor(AWS Bedrock): refactor AWS Bedrock API client and settings management with vertexai * fix: lint error * refactor: update aws bedrock placeholder * refactor(i18n):update i18n content with aws bedrock * feat(AwsBedrockAPIClient): enhance message handling, add image support * fix: code review suggestion * feat(test): add aws bedrock utils unit test * feat(AwsBedrockAPIClient): enhance getEmbeddingDimensions method to support dynamic model dimension retrieval * fix(AwsBedrockAPIClient): Modify the processing logic when the embedded dimension cannot be parsed, throw an error instead of returning the default value * chore(package): Reorganize AWS SDK dependencies in package.json |
||
|
|
8ffdb4d1c2
|
perf(i18n): improve performance when getting i18n text (#8548)
* refactor(i18n): 重构国际化标签映射为独立的键值映射对象 对象定义移出函数以优化性能 * docs(i18n): 更新国际化文档中的动态翻译推荐做法 修改中英文文档,添加通过维护键映射表来避免动态翻译键缺失的最佳实践 * chore(ProviderService): 添加注释 * chore: 移动注释位置 * refactor(ProviderService): 将获取提供者名称的逻辑移到utils中 移除冗余代码并使用统一的工具函数getFancyProviderName来获取提供者名称 |
||
|
|
36a22129a1
|
fix(i18n): standardize i18n usage (#8525)
* fix(数据设置): 修复菜单项标题未使用翻译函数的问题 * refactor(i18n): 使用labelMap集中管理翻译键以提升维护性 将分散在各处的翻译键集中管理到labelMap中,统一通过映射获取翻译文本 替换直接使用i18n.t的调用为从labelMap获取,减少重复代码 修复部分未考虑Linux平台的翻译描述 * fix(NewApiPage): 将未知提供者的值设为undefined以保持一致 * refactor(i18n): 将labelMap替换为动态获取标签的函数 重构国际化标签的获取方式,从静态对象改为动态函数,以支持语言切换时实时更新标签内容 * feat(i18n): 添加文件字段标签的国际化支持 将文件字段的标签文本提取到i18n模块中统一管理,便于维护和翻译 * refactor(utils): 移除调试用的console.log语句 |